language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
C
wireshark/epan/dissectors/packet-uftp.c
/* packet-uftp.c * Routines for UFTP packet dissection * Copyright Dennis Bush <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #define UFTP_VER_NUM 0x31 #define UFTP_3_0_VER 0x30 #define ANNOUNCE 1 #define REGISTER 2 #define CLIENT_KEY 3 #define REG_CONF 4 #define FILEINFO 5 #define KEYINFO 6 #define INFO_ACK 7 #define FILESEG 8 #define DONE 9 #define STATUS 10 #define PRSTATUS 11 #define COMPLETE 12 #define DONE_CONF 13 #define HB_REQ 14 #define HB_RESP 15 #define KEY_REQ 16 #define PROXY_KEY 17 #define ENCRYPTED 80 #define ABORT 99 #define MAXDEST 10000 #define MAXFILENAME 100 #define MAXDIRNAME 200 #define MAXPATHNAME 300 #define MAXPROXYDEST 1000 #define DESTNAME_LEN 100 #define MAXFILES 500 #define IFNAME_LEN 25 #define MAX_INTERFACES 20 #define IPSTR_LEN 16 #define FTYPE_REG 0 #define FTYPE_DIR 1 #define FTYPE_LINK 2 #define KEY_NONE 0x00 #define KEY_DES 0x01 #define KEY_DES_EDE3 0x02 #define KEY_AES128 0x03 #define KEY_AES256 0x04 #define HASH_NONE 0x00 #define HASH_MD5 0x01 #define HASH_SHA1 0x02 #define HASH_SHA256 0x03 #define SIG_NONE 0x00 #define SIG_HMAC 0x01 #define SIG_RSA 0x02 #define FLAG_RESTART 0x01 #define FLAG_SYNC_MODE 0x02 #define FLAG_SYNC_PREVIEW 0x04 #define FLAG_ANNOUNCE_RESERVED 0xF8 #define FLAG_PARTIAL 0x01 #define FLAG_INFOACK_RESERVED 0xFE #define FLAG_CURRENT_FILE 0x01 #define FLAG_ABORT_RESERVED 0xFE #define COMP_STAT_NORMAL 0 #define COMP_STAT_SKIPPED 1 #define COMP_STAT_OVERWRITE 2 #define COMP_STAT_REJECTED 3 #define HB_AUTH_FAILED 0 #define HB_AUTH_OK 1 #define HB_AUTH_CHALLENGE 2 #define PUBKEY_LEN 256 /* big enough for RSA-2048 */ #define RAND_LEN 32 /* rfc 5246 */ #define HMAC_LEN 32 /* big enough for SHA-256 */ #define VERIFY_LEN 12 /* rfc 5246 */ #define MASTER_LEN 48 /* rfc 5246 */ #define MAXIV 16 /* big enough for AES256 */ #define MAXKEY 32 /* big enough for AES256 */ #define KEYBLSIZE 16 /* Maximum symetric key blocksize */ #define DEF_RSA_LEN 512 /* Default length of generated RSA keys */ #define RSA_EXP 65537 /* Public key exponent of generated RSA keys */ #define UFTP_LEN 16 #define ANNOUNCE_LEN 64 #define REGISTER_LEN 40 #define CLIENT_KEY_LEN 12 #define REG_CONF_LEN 4 #define FILEINFO_LEN 324 #define FILEINFO_30_LEN 320 #define KEYINFO_LEN 12 #define DESTKEY_LEN 52 #define INFO_ACK_LEN 20 #define FILESEG_LEN 12 #define DONE_LEN 8 #define STATUS_LEN 12 #define PRSTATUS_LEN 12 #define COMPLETE_LEN 8 #define DONE_CONF_LEN 8 #define HB_REQ_LEN 16 #define HB_RESP_LEN 8 #define KEY_REQ_LEN 4 #define PROXY_KEY_LEN 16 #define ENCRYPTED_LEN 12 #define ABORT_LEN 308 void proto_register_uftp(void); void proto_reg_handoff_uftp(void); static int proto_uftp = -1; #define UFTP_PORT 1044 /* Not IANA registered */ /* main header and common fields */ static int hf_uftp_version = -1; static int hf_uftp_func = -1; static int hf_uftp_blsize = -1; static int hf_uftp_group_id = -1; static int hf_uftp_srcaddr = -1; static int hf_uftp_destaddr = -1; static int hf_uftp_destlist = -1; static int hf_uftp_dest = -1; /* ANNOUNCE fields */ static int hf_uftp_announce = -1; static int hf_uftp_announce_func = -1; static int hf_uftp_announce_flags = -1; static int hf_uftp_announce_flags_restart = -1; static int hf_uftp_announce_flags_sync = -1; static int hf_uftp_announce_flags_syncpreview = -1; static int hf_uftp_announce_flags_reserved = -1; static int hf_uftp_announce_destcount = -1; static int hf_uftp_announce_announce_int = -1; static int hf_uftp_announce_status_int = -1; static int hf_uftp_announce_register_int = -1; static int hf_uftp_announce_done_int = -1; static int hf_uftp_announce_announce_time = -1; static int hf_uftp_announce_status_time = -1; static int hf_uftp_announce_mtu = -1; static int hf_uftp_announce_privatemcast = -1; static int hf_uftp_announce_client_auth = -1; static int hf_uftp_announce_sigtype = -1; static int hf_uftp_announce_hashtype = -1; static int hf_uftp_announce_keytype = -1; static int hf_uftp_announce_keylen = -1; static int hf_uftp_announce_reserved = -1; static int hf_uftp_announce_keyexp = -1; static int hf_uftp_announce_rand1 = -1; static int hf_uftp_announce_keymod = -1; /* REGISTER fields */ static int hf_uftp_register = -1; static int hf_uftp_register_func = -1; static int hf_uftp_register_reserved = -1; static int hf_uftp_register_destcount = -1; static int hf_uftp_register_premaster_len = -1; static int hf_uftp_register_rand2 = -1; static int hf_uftp_register_premaster = -1; /* CLIENT_KEY fields */ static int hf_uftp_clientkey = -1; static int hf_uftp_clientkey_func = -1; static int hf_uftp_clientkey_reserved = -1; static int hf_uftp_clientkey_keylen = -1; static int hf_uftp_clientkey_verifylen = -1; static int hf_uftp_clientkey_keyexp = -1; static int hf_uftp_clientkey_keymod = -1; static int hf_uftp_clientkey_verify = -1; /* REG_CONF fields */ static int hf_uftp_regconf = -1; static int hf_uftp_regconf_func = -1; static int hf_uftp_regconf_reserved = -1; static int hf_uftp_regconf_destcount = -1; /* FILEINFO fields */ static int hf_uftp_fileinfo = -1; static int hf_uftp_fileinfo_func = -1; static int hf_uftp_fileinfo_ftype = -1; static int hf_uftp_fileinfo_file_id = -1; static int hf_uftp_fileinfo_block_total = -1; static int hf_uftp_fileinfo_section_total = -1; static int hf_uftp_fileinfo_destcount = -1; static int hf_uftp_fileinfo_fsize = -1; static int hf_uftp_fileinfo_ftstamp = -1; static int hf_uftp_fileinfo_name = -1; /* KEYINFO fields */ static int hf_uftp_keyinfo = -1; static int hf_uftp_keyinfo_func = -1; static int hf_uftp_keyinfo_reserved = -1; static int hf_uftp_keyinfo_destcount = -1; static int hf_uftp_keyinfo_groupmaster_len = -1; static int hf_uftp_keyinfo_tstamp = -1; static int hf_uftp_keyinfo_destkey = -1; static int hf_uftp_keyinfo_destaddr = -1; static int hf_uftp_keyinfo_groupmaster = -1; /* INFO_ACK fields */ static int hf_uftp_infoack = -1; static int hf_uftp_infoack_func = -1; static int hf_uftp_infoack_flags = -1; static int hf_uftp_infoack_flags_partial = -1; static int hf_uftp_infoack_flags_reserved = -1; static int hf_uftp_infoack_file_id = -1; static int hf_uftp_infoack_destcount = -1; static int hf_uftp_infoack_reserved = -1; static int hf_uftp_infoack_verify_data = -1; /* FILESEG fields */ static int hf_uftp_fileseg = -1; static int hf_uftp_fileseg_func = -1; static int hf_uftp_fileseg_reserved1 = -1; static int hf_uftp_fileseg_file_id = -1; static int hf_uftp_fileseg_pass = -1; static int hf_uftp_fileseg_reserved2 = -1; static int hf_uftp_fileseg_section = -1; static int hf_uftp_fileseg_seq_num = -1; static int hf_uftp_fileseg_data = -1; /* DONE fields */ static int hf_uftp_done = -1; static int hf_uftp_done_func = -1; static int hf_uftp_done_pass = -1; static int hf_uftp_done_section = -1; static int hf_uftp_done_file_id = -1; static int hf_uftp_done_destcount = -1; /* STATUS fields */ static int hf_uftp_status = -1; static int hf_uftp_status_func = -1; static int hf_uftp_status_reserved = -1; static int hf_uftp_status_file_id = -1; static int hf_uftp_status_pass = -1; static int hf_uftp_status_seq = -1; static int hf_uftp_status_section = -1; static int hf_uftp_status_nak_count = -1; static int hf_uftp_status_naks = -1; /* PRSTATUS fields */ static int hf_uftp_prstatus = -1; static int hf_uftp_prstatus_func = -1; static int hf_uftp_prstatus_reserved1 = -1; static int hf_uftp_prstatus_file_id = -1; static int hf_uftp_prstatus_pass = -1; static int hf_uftp_prstatus_seq = -1; static int hf_uftp_prstatus_section = -1; static int hf_uftp_prstatus_destcount = -1; static int hf_uftp_prstatus_reserved2 = -1; /* COMPLETE fields */ static int hf_uftp_complete = -1; static int hf_uftp_complete_func = -1; static int hf_uftp_complete_status = -1; static int hf_uftp_complete_file_id = -1; static int hf_uftp_complete_destcount = -1; static int hf_uftp_complete_reserved2 = -1; /* DONE_CONF fields */ static int hf_uftp_doneconf = -1; static int hf_uftp_doneconf_func = -1; static int hf_uftp_doneconf_reserved1 = -1; static int hf_uftp_doneconf_file_id = -1; static int hf_uftp_doneconf_destcount = -1; static int hf_uftp_doneconf_reserved2 = -1; /* HB_REQ fields */ static int hf_uftp_hbreq = -1; static int hf_uftp_hbreq_func = -1; static int hf_uftp_hbreq_reserved = -1; static int hf_uftp_hbreq_nonce = -1; static int hf_uftp_hbreq_keylen = -1; static int hf_uftp_hbreq_siglen = -1; static int hf_uftp_hbreq_keyexp = -1; static int hf_uftp_hbreq_keymod = -1; static int hf_uftp_hbreq_verify = -1; /* HB_RESP fields */ static int hf_uftp_hbresp = -1; static int hf_uftp_hbresp_func = -1; static int hf_uftp_hbresp_authenticated = -1; static int hf_uftp_hbresp_reserved = -1; static int hf_uftp_hbresp_nonce = -1; /* KEY_REQ fields */ static int hf_uftp_keyreq = -1; static int hf_uftp_keyreq_func = -1; static int hf_uftp_keyreq_reserved = -1; /* PROXY_KEY fields */ static int hf_uftp_proxykey = -1; static int hf_uftp_proxykey_func = -1; static int hf_uftp_proxykey_reserved = -1; static int hf_uftp_proxykey_nonce = -1; static int hf_uftp_proxykey_keylen = -1; static int hf_uftp_proxykey_siglen = -1; static int hf_uftp_proxykey_keyexp = -1; static int hf_uftp_proxykey_keymod = -1; static int hf_uftp_proxykey_verify = -1; /* ENCRYPTED fields */ static int hf_uftp_encrypted = -1; static int hf_uftp_encrypted_tstamp = -1; static int hf_uftp_encrypted_sig_len = -1; static int hf_uftp_encrypted_payload_len = -1; static int hf_uftp_encrypted_signature = -1; static int hf_uftp_encrypted_payload = -1; /* ABORT fields */ static int hf_uftp_abort = -1; static int hf_uftp_abort_func = -1; static int hf_uftp_abort_flags = -1; static int hf_uftp_abort_flags_curfile = -1; static int hf_uftp_abort_flags_reserved = -1; static int hf_uftp_abort_reserved = -1; static int hf_uftp_abort_host = -1; static int hf_uftp_abort_message = -1; static gint ett_uftp = -1; static gint ett_uftp_announce = -1; static gint ett_uftp_register = -1; static gint ett_uftp_clientkey = -1; static gint ett_uftp_regconf = -1; static gint ett_uftp_fileinfo = -1; static gint ett_uftp_keyinfo = -1; static gint ett_uftp_infoack = -1; static gint ett_uftp_fileseg = -1; static gint ett_uftp_done = -1; static gint ett_uftp_status = -1; static gint ett_uftp_prstatus = -1; static gint ett_uftp_complete = -1; static gint ett_uftp_doneconf = -1; static gint ett_uftp_hbreq = -1; static gint ett_uftp_hbresp = -1; static gint ett_uftp_keyreq = -1; static gint ett_uftp_proxykey = -1; static gint ett_uftp_encrypted = -1; static gint ett_uftp_abort = -1; static gint ett_uftp_announce_flags = -1; static gint ett_uftp_keyinfo_destkey = -1; static gint ett_uftp_infoack_flags = -1; static gint ett_uftp_abort_flags = -1; static gint ett_uftp_destlist = -1; static expert_field ei_uftp_length_invalid = EI_INIT; static expert_field ei_uftp_func_unknown = EI_INIT; static dissector_handle_t uftp4_handle; static dissector_handle_t uftp5_handle; static const value_string messages[] = { { ANNOUNCE, "ANNOUNCE" }, { REGISTER, "REGISTER" }, { CLIENT_KEY, "CLIENT_KEY" }, { REG_CONF, "REG_CONF" }, { FILEINFO, "FILEINFO" }, { KEYINFO, "KEYINFO" }, { INFO_ACK, "INFO_ACK" }, { FILESEG, "FILESEG" }, { DONE, "DONE" }, { STATUS, "STATUS" }, { PRSTATUS, "PRSTATUS" }, { COMPLETE, "COMPLETE" }, { DONE_CONF, "DONE_CONF" }, { HB_REQ, "HB_REQ" }, { HB_RESP, "HB_RESP" }, { KEY_REQ, "KEY_REQ" }, { PROXY_KEY, "PROXY_KEY" }, { ENCRYPTED, "ENCRYPTED" }, { ABORT, "ABORT" }, { 0, NULL } }; static const value_string signature_types[] = { { SIG_NONE, "NONE" }, { SIG_HMAC, "HMAC" }, { SIG_RSA, "RSA" }, { 0, NULL } }; static const value_string hash_types[] = { { HASH_NONE, "NONE" }, { HASH_MD5, "MD5" }, { HASH_SHA1, "SHA-1" }, { HASH_SHA256, "SHA-256" }, { 0, NULL } }; static const value_string key_types[] = { { KEY_NONE, "NONE" }, { KEY_DES, "DES" }, { KEY_DES_EDE3, "3 Key Triple DES" }, { KEY_AES128, "AES-128" }, { KEY_AES256, "AES-256" }, { 0, NULL } }; static const value_string hb_auth_types[] = { { HB_AUTH_FAILED, "Authorization Failed" }, { HB_AUTH_OK, "Authorization Succeeded" }, { HB_AUTH_CHALLENGE, "Authorization Required" }, { 0, NULL } }; static const value_string file_types[] = { { FTYPE_REG, "Regular file" }, { FTYPE_DIR, "Directory" }, { FTYPE_LINK, "Symbolic link" }, { 0, NULL } }; static int * const announce_flags[] = { &hf_uftp_announce_flags_restart, &hf_uftp_announce_flags_sync, &hf_uftp_announce_flags_syncpreview, &hf_uftp_announce_flags_reserved, NULL }; static int * const infoack_flags[] = { &hf_uftp_infoack_flags_partial, &hf_uftp_infoack_flags_reserved, NULL }; static int * const abort_flags[] = { &hf_uftp_abort_flags_curfile, &hf_uftp_abort_flags_reserved, NULL }; static const value_string comp_status[] = { { COMP_STAT_NORMAL, "Normal" }, { COMP_STAT_SKIPPED, "Skipped" }, { COMP_STAT_OVERWRITE, "Overwrite" }, { COMP_STAT_REJECTED, "Rejected" }, { 0, NULL } }; static void dissect_uftp_announce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *announce_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 destcount, keylen, idx; if (tvb_reported_length(tvb) < ANNOUNCE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 2); keylen = tvb_get_ntohs(tvb, 24); if ((gint)tvb_reported_length(tvb) < ANNOUNCE_LEN + keylen + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, keylen = %d, count=%d", tvb_reported_length(tvb), keylen, destcount); return; } ti = proto_tree_add_item(tree, hf_uftp_announce, tvb, offset, -1, ENC_NA); announce_tree = proto_item_add_subtree(ti, ett_uftp_announce); proto_tree_add_item(announce_tree, hf_uftp_announce_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(announce_tree, tvb, offset, hf_uftp_announce_flags, ett_uftp_announce_flags, announce_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_announce_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_status_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_register_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_done_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_announce_time, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_status_time, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_mtu, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_privatemcast, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(announce_tree, hf_uftp_announce_client_auth, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_sigtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_hashtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_keytype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_keyexp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(announce_tree, hf_uftp_announce_rand1, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { proto_tree_add_item(announce_tree, hf_uftp_announce_keymod, tvb, offset, keylen, ENC_NA); offset += keylen; } if (destcount > 0) { destlist = proto_tree_add_item(announce_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_register(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *register_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 destcount, keylen, idx; if (tvb_reported_length(tvb) < REGISTER_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 4); keylen = tvb_get_ntohs(tvb, 6); if ((gint)tvb_reported_length(tvb) < REGISTER_LEN + keylen + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, keylen = %d, count=%d", tvb_reported_length(tvb), keylen, destcount); return; } ti = proto_tree_add_item(tree, hf_uftp_register, tvb, offset, -1, ENC_NA); register_tree = proto_item_add_subtree(ti, ett_uftp_register); proto_tree_add_item(register_tree, hf_uftp_register_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(register_tree, hf_uftp_register_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(register_tree, hf_uftp_register_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(register_tree, hf_uftp_register_premaster_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(register_tree, hf_uftp_register_rand2, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { proto_tree_add_item(register_tree, hf_uftp_register_premaster, tvb, offset, keylen, ENC_NA); offset += keylen; } if (destcount > 0) { destlist = proto_tree_add_item(register_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_clientkey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *clientkey_tree = NULL; gint offset = 0; guint16 keylen, verifylen; if (tvb_reported_length(tvb) < CLIENT_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } keylen = tvb_get_ntohs(tvb, 4); verifylen = tvb_get_ntohs(tvb, 6); if ((gint)tvb_reported_length(tvb) < CLIENT_KEY_LEN + keylen + verifylen) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, keylen=%d verifylen=%d", tvb_reported_length(tvb), keylen, verifylen); return; } ti = proto_tree_add_item(tree, hf_uftp_clientkey, tvb, offset, -1, ENC_NA); clientkey_tree = proto_item_add_subtree(ti, ett_uftp_clientkey); proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_verifylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_keyexp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_keymod, tvb, offset, keylen, ENC_NA); offset += keylen; } if (verifylen > 0) { proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_verify, tvb, offset, verifylen, ENC_NA); } } static void dissect_uftp_regconf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *regconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 destcount, idx; if (tvb_reported_length(tvb) < REG_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 2); if ((gint)tvb_reported_length(tvb) < REG_CONF_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } ti = proto_tree_add_item(tree, hf_uftp_regconf, tvb, offset, -1, ENC_NA); regconf_tree = proto_item_add_subtree(ti, ett_uftp_regconf); proto_tree_add_item(regconf_tree, hf_uftp_regconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(regconf_tree, hf_uftp_regconf_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(regconf_tree, hf_uftp_regconf_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (destcount > 0) { destlist = proto_tree_add_item(regconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_fileinfo_30(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfo_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < FILEINFO_30_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < FILEINFO_30_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); ti = proto_tree_add_item(tree, hf_uftp_fileinfo, tvb, offset, -1, ENC_NA); fileinfo_tree = proto_item_add_subtree(ti, ett_uftp_fileinfo); proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_block_total, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_section_total, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_fsize, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_name, tvb, offset, MAXPATHNAME, ENC_ASCII); offset += MAXPATHNAME; if (destcount > 0) { destlist = proto_tree_add_item(fileinfo_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfo_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < FILEINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < FILEINFO_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); ti = proto_tree_add_item(tree, hf_uftp_fileinfo, tvb, offset, -1, ENC_NA); fileinfo_tree = proto_item_add_subtree(ti, ett_uftp_fileinfo); proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_block_total, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_section_total, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_fsize, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftstamp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_name, tvb, offset, MAXPATHNAME, ENC_ASCII); offset += MAXPATHNAME; if (destcount > 0) { destlist = proto_tree_add_item(fileinfo_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_keyinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_item *destkey = NULL; proto_tree *keyinfo_tree = NULL; proto_tree *destlist_tree = NULL; proto_tree *destkey_tree = NULL; gint offset = 0; guint8 destcount, idx; if (tvb_reported_length(tvb) < KEYINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_guint8(tvb, 2); if ((gint)tvb_reported_length(tvb) < KEYINFO_LEN + (destcount * DESTKEY_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } ti = proto_tree_add_item(tree, hf_uftp_keyinfo, tvb, offset, -1, ENC_NA); keyinfo_tree = proto_item_add_subtree(ti, ett_uftp_keyinfo); proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_destcount, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_groupmaster_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_tstamp, tvb, offset, 8, ENC_NA); offset += 8; if (destcount > 0) { destlist = proto_tree_add_item(keyinfo_tree, hf_uftp_destlist, tvb, offset, destcount * DESTKEY_LEN, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { destkey = proto_tree_add_item(destlist_tree, hf_uftp_keyinfo_destkey, tvb, offset, DESTKEY_LEN, ENC_NA); destkey_tree = proto_item_add_subtree(destkey, ett_uftp_keyinfo_destkey); proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_destaddr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_groupmaster, tvb, offset, 48, ENC_NA); offset += 48; } } static void dissect_uftp_infoack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *infoack_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < INFO_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 4); if ((gint)tvb_reported_length(tvb) < INFO_ACK_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_infoack, tvb, offset, -1, ENC_NA); infoack_tree = proto_item_add_subtree(ti, ett_uftp_infoack); proto_tree_add_item(infoack_tree, hf_uftp_infoack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(infoack_tree, tvb, offset, hf_uftp_infoack_flags, ett_uftp_infoack_flags, infoack_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(infoack_tree, hf_uftp_infoack_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(infoack_tree, hf_uftp_infoack_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(infoack_tree, hf_uftp_infoack_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(infoack_tree, hf_uftp_infoack_verify_data, tvb, offset, VERIFY_LEN, ENC_NA); offset += VERIFY_LEN; if (destcount > 0) { destlist = proto_tree_add_item(infoack_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_fileseg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *fileseg_tree = NULL; gint offset = 0; guint8 pass; guint16 file_id; guint32 seq_num; if (tvb_reported_length(tvb) < FILESEG_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } file_id = tvb_get_ntohs(tvb, 2); pass = tvb_get_guint8(tvb, 4); seq_num = tvb_get_ntohl(tvb, 8); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Pass=%d Seq=%d", file_id, pass, seq_num); ti = proto_tree_add_item(tree, hf_uftp_fileseg, tvb, offset, -1, ENC_NA); fileseg_tree = proto_item_add_subtree(ti, ett_uftp_fileseg); proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_pass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_seq_num, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_data, tvb, offset, -1, ENC_NA); } static void dissect_uftp_done(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *done_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint8 pass; guint16 file_id, section, destcount, idx; if (tvb_reported_length(tvb) < DONE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 6); if ((gint)tvb_reported_length(tvb) < DONE_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } pass = tvb_get_guint8(tvb, 1); section = tvb_get_ntohs(tvb, 2); file_id = tvb_get_ntohs(tvb, 4); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Pass=%d Section=%d", file_id, pass, section); } ti = proto_tree_add_item(tree, hf_uftp_done, tvb, offset, -1, ENC_NA); done_tree = proto_item_add_subtree(ti, ett_uftp_done); proto_tree_add_item(done_tree, hf_uftp_done_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(done_tree, hf_uftp_done_pass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(done_tree, hf_uftp_done_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (destcount > 0) { destlist = proto_tree_add_item(done_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *status_tree = NULL; gint offset = 0; guint8 pass, seq; guint16 file_id, section; guint32 nak_count; if (tvb_reported_length(tvb) < STATUS_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 2); pass = tvb_get_guint8(tvb, 4); seq = tvb_get_guint8(tvb, 5); nak_count = tvb_get_ntohl(tvb, 8); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Pass=%d Section=%d Seq=%d", file_id, pass, section, seq); ti = proto_tree_add_item(tree, hf_uftp_status, tvb, offset, -1, ENC_NA); status_tree = proto_item_add_subtree(ti, ett_uftp_status); proto_tree_add_item(status_tree, hf_uftp_status_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_pass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_seq, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_nak_count, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (nak_count > 0) { proto_tree_add_item(status_tree, hf_uftp_status_naks, tvb, offset, -1, ENC_NA); } } static void dissect_uftp_prstatus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *prstatus_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint8 pass, seq; guint16 file_id, destcount, idx, section; guint32 nak_count; if (tvb_reported_length(tvb) < PRSTATUS_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 8); if ((gint)tvb_reported_length(tvb) < PRSTATUS_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 2); pass = tvb_get_guint8(tvb, 4); seq = tvb_get_guint8(tvb, 5); nak_count = tvb_get_ntohl(tvb, 8); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Pass=%d Section=%d Seq=%d " "NAKs=%d", file_id, pass, section, seq, nak_count); ti = proto_tree_add_item(tree, hf_uftp_prstatus, tvb, offset, -1, ENC_NA); prstatus_tree = proto_item_add_subtree(ti, ett_uftp_prstatus); proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_pass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_seq, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(prstatus_tree, hf_uftp_prstatus_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (destcount > 0) { destlist = proto_tree_add_item(prstatus_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *complete_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < COMPLETE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 4); if ((gint)tvb_reported_length(tvb) < COMPLETE_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_complete, tvb, offset, -1, ENC_NA); complete_tree = proto_item_add_subtree(ti, ett_uftp_complete); proto_tree_add_item(complete_tree, hf_uftp_complete_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(complete_tree, hf_uftp_complete_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(complete_tree, hf_uftp_complete_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (destcount > 0) { destlist = proto_tree_add_item(complete_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_doneconf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *doneconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < DONE_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } destcount = tvb_get_ntohs(tvb, 4); if ((gint)tvb_reported_length(tvb) < DONE_CONF_LEN + (destcount * 4)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, count=%d", tvb_reported_length(tvb), destcount); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_doneconf, tvb, offset, -1, ENC_NA); doneconf_tree = proto_item_add_subtree(ti, ett_uftp_doneconf); proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_destcount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (destcount > 0) { destlist = proto_tree_add_item(doneconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_hbreq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbreq_tree = NULL; gint offset = 0; guint16 keylen, siglen; if (tvb_reported_length(tvb) < HB_REQ_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } keylen = tvb_get_ntohs(tvb, 8); siglen = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < HB_REQ_LEN + keylen + siglen) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, keylen=%d siglen=%d", tvb_reported_length(tvb), keylen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_hbreq, tvb, offset, -1, ENC_NA); hbreq_tree = proto_item_add_subtree(ti, ett_uftp_hbreq); proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_keyexp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_keymod, tvb, offset, keylen, ENC_NA); offset += keylen; } if (siglen > 0) { proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_verify, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_hbresp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbresp_tree = NULL; gint offset = 0; if (tvb_reported_length(tvb) < HB_RESP_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } ti = proto_tree_add_item(tree, hf_uftp_hbresp, tvb, offset, -1, ENC_NA); hbresp_tree = proto_item_add_subtree(ti, ett_uftp_hbresp); proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_authenticated, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); } static void dissect_uftp_keyreq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *keyreq_tree = NULL; gint offset = 0; if (tvb_reported_length(tvb) < KEY_REQ_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } ti = proto_tree_add_item(tree, hf_uftp_keyreq, tvb, offset, -1, ENC_NA); keyreq_tree = proto_item_add_subtree(ti, ett_uftp_keyreq); proto_tree_add_item(keyreq_tree, hf_uftp_keyreq_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(keyreq_tree, hf_uftp_keyreq_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); } static void dissect_uftp_proxykey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *proxykey_tree = NULL; gint offset = 0; guint16 keylen, siglen; if (tvb_reported_length(tvb) < PROXY_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } keylen = tvb_get_ntohs(tvb, 8); siglen = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < PROXY_KEY_LEN + keylen + siglen) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, keylen=%d siglen=%d", tvb_reported_length(tvb), keylen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_proxykey, tvb, offset, -1, ENC_NA); proxykey_tree = proto_item_add_subtree(ti, ett_uftp_proxykey); proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_keyexp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_keymod, tvb, offset, keylen, ENC_NA); offset += keylen; } if (siglen > 0) { proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_verify, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_encrypted(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *encrypted_tree = NULL; gint offset = 0; guint16 sig_len, payload_len; if (tvb_reported_length(tvb) < ENCRYPTED_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } sig_len = tvb_get_ntohs(tvb, 8); payload_len = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < ENCRYPTED_LEN + sig_len + payload_len) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, sig=%d, payload=%d", tvb_reported_length(tvb), sig_len, payload_len); return; } ti = proto_tree_add_item(tree, hf_uftp_encrypted, tvb, offset, -1, ENC_NA); encrypted_tree = proto_item_add_subtree(ti, ett_uftp_encrypted); proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_tstamp, tvb, offset, 8, ENC_NA); offset += 8; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_sig_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_signature, tvb, offset, sig_len, ENC_NA); offset += sig_len; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload, tvb, offset, payload_len, ENC_NA); } static void dissect_uftp_abort(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *abort_tree = NULL; gint offset = 0; if (tvb_reported_length(tvb) < ABORT_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } ti = proto_tree_add_item(tree, hf_uftp_abort, tvb, offset, -1, ENC_NA); abort_tree = proto_item_add_subtree(ti, ett_uftp_abort); proto_tree_add_item(abort_tree, hf_uftp_abort_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_bitmask(abort_tree, tvb, offset, hf_uftp_abort_flags, ett_uftp_abort_flags, abort_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(abort_tree, hf_uftp_abort_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(abort_tree, hf_uftp_abort_host, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(abort_tree, hf_uftp_abort_message, tvb, offset, -1, ENC_ASCII); } static int dissect_uftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 version; guint8 mes_type; guint32 group_id; guint16 blsize; tvbuff_t *next_tvb; proto_item *ti = NULL; proto_tree *uftp_tree = NULL; gint offset = 0; version = tvb_get_guint8(tvb, 0); if (version == 0x50) { return call_dissector(uftp5_handle, tvb, pinfo, tree); } else if (version == 0x40) { return call_dissector(uftp4_handle, tvb, pinfo, tree); } else if (version != UFTP_VER_NUM && version != UFTP_3_0_VER) { return 0; } if (tvb_reported_length(tvb) < UFTP_LEN) { return 0; } mes_type = tvb_get_guint8(tvb, 1); blsize = tvb_get_ntohs(tvb, 2); group_id = tvb_get_ntohl(tvb, 4); if (tvb_reported_length(tvb) != (unsigned)UFTP_LEN + blsize) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "UFTP"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%-10s", val_to_str(mes_type, messages, "Unknown (%d)")); if ((mes_type != HB_REQ) && (mes_type != HB_RESP)) { col_append_fstr(pinfo->cinfo, COL_INFO, " ID=%08X", group_id); } ti = proto_tree_add_item(tree, proto_uftp, tvb, 0, -1, ENC_NA); uftp_tree = proto_item_add_subtree(ti, ett_uftp); proto_tree_add_item(uftp_tree, hf_uftp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_blsize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(uftp_tree, hf_uftp_group_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_srcaddr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_destaddr, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, blsize); switch (mes_type) { case ANNOUNCE: dissect_uftp_announce(next_tvb, pinfo, uftp_tree); break; case REGISTER: dissect_uftp_register(next_tvb, pinfo, uftp_tree); break; case CLIENT_KEY: dissect_uftp_clientkey(next_tvb, pinfo, uftp_tree); break; case REG_CONF: dissect_uftp_regconf(next_tvb, pinfo, uftp_tree); break; case FILEINFO: if (version == UFTP_3_0_VER) { dissect_uftp_fileinfo_30(next_tvb, pinfo, uftp_tree); } else { dissect_uftp_fileinfo(next_tvb, pinfo, uftp_tree); } break; case KEYINFO: dissect_uftp_keyinfo(next_tvb, pinfo, uftp_tree); break; case INFO_ACK: dissect_uftp_infoack(next_tvb, pinfo, uftp_tree); break; case FILESEG: dissect_uftp_fileseg(next_tvb, pinfo, uftp_tree); break; case DONE: dissect_uftp_done(next_tvb, pinfo, uftp_tree); break; case STATUS: dissect_uftp_status(next_tvb, pinfo, uftp_tree); break; case PRSTATUS: dissect_uftp_prstatus(next_tvb, pinfo, uftp_tree); break; case COMPLETE: dissect_uftp_complete(next_tvb, pinfo, uftp_tree); break; case DONE_CONF: dissect_uftp_doneconf(next_tvb, pinfo, uftp_tree); break; case HB_REQ: dissect_uftp_hbreq(next_tvb, pinfo, uftp_tree); break; case HB_RESP: dissect_uftp_hbresp(next_tvb, pinfo, uftp_tree); break; case KEY_REQ: dissect_uftp_keyreq(next_tvb, pinfo, uftp_tree); break; case PROXY_KEY: dissect_uftp_proxykey(next_tvb, pinfo, uftp_tree); break; case ENCRYPTED: dissect_uftp_encrypted(next_tvb, pinfo, uftp_tree); break; case ABORT: dissect_uftp_abort(next_tvb, pinfo, uftp_tree); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_uftp_func_unknown, tvb, offset, -1, "Function unknown: %d", mes_type); break; } return tvb_reported_length(tvb); } void proto_register_uftp(void) { static hf_register_info hf[] = { { &hf_uftp_version, { "Protocol Version", "uftp.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_func, { "Type", "uftp.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_blsize, { "Block Size", "uftp.blsize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_group_id, { "Group ID", "uftp.group_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_srcaddr, { "Source Address", "uftp.srcaddr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_destaddr, { "Destination Address", "uftp.destaddr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_destlist, { "Destination List", "uftp.destlist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_dest, { "Destination", "uftp.dest", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce, { "ANNOUNCE", "uftp.announce", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_func, { "Type", "uftp.announce.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags, { "Flags", "uftp.announce.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags_restart, { "Restart", "uftp.announce.flags.restart", FT_BOOLEAN, 8, NULL, FLAG_RESTART, NULL, HFILL } }, { &hf_uftp_announce_flags_sync, { "Sync mode", "uftp.announce.flags.sync", FT_BOOLEAN, 8, NULL, FLAG_SYNC_MODE, NULL, HFILL } }, { &hf_uftp_announce_flags_syncpreview, { "Sync preview mode", "uftp.announce.flags.syncpreview", FT_BOOLEAN, 8, NULL, FLAG_SYNC_PREVIEW, NULL, HFILL } }, { &hf_uftp_announce_flags_reserved, { "Reserved", "uftp.announce.flags.reserved", FT_BOOLEAN, 8, NULL, FLAG_ANNOUNCE_RESERVED, NULL, HFILL } }, { &hf_uftp_announce_destcount, { "Destination Count", "uftp.announce.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_announce_int, { "Announce Interval", "uftp.announce.announce_int", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_status_int, { "Status Interval", "uftp.announce.status_int", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_register_int, { "Register Interval", "uftp.announce.register_int", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_done_int, { "Done Interval", "uftp.announce.done_int", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_announce_time, { "Announce Time", "uftp.announce.announce_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_status_time, { "Status Time", "uftp.announce.status_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_mtu, { "MTU", "uftp.announce.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_privatemcast, { "Private Multicast Address", "uftp.announce.privatemcast", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_client_auth, { "Client Auth", "uftp.announce.client_auth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_sigtype, { "Signature Type", "uftp.announce.sigtype", FT_UINT8, BASE_DEC, VALS(signature_types), 0x0, NULL, HFILL } }, { &hf_uftp_announce_hashtype, { "Hash Type", "uftp.announce.hashtype", FT_UINT8, BASE_DEC, VALS(hash_types), 0x0, NULL, HFILL } }, { &hf_uftp_announce_keytype, { "Key Type", "uftp.announce.keytype", FT_UINT8, BASE_DEC, VALS(key_types), 0x0, NULL, HFILL } }, { &hf_uftp_announce_keylen, { "Public Key Length", "uftp.announce.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_reserved, { "Reserved", "uftp.announce.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_keyexp, { "Public Key Exponent", "uftp.announce.keyexp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_rand1, { "Server Random Number", "uftp.announce.rand1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_keymod, { "Public Key Modulus", "uftp.announce.keymod", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register, { "REGISTER", "uftp.register", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_func, { "Type", "uftp.register.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_register_reserved, { "Reserved", "uftp.register.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_destcount, { "Destination Count", "uftp.register.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_premaster_len, { "Premaster Secret Length", "uftp.register.premaster_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_rand2, { "Client Random Number", "uftp.register.rand2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_premaster, { "Encrypted Premaster Secret", "uftp.register.premaster", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey, { "CLIENT_KEY", "uftp.clientkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_func, { "Type", "uftp.clientkey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_reserved, { "Reserved", "uftp.clientkey.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_keylen, { "Key Length", "uftp.clientkey.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_verifylen, { "Signature Length", "uftp.clientkey.verifylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_keyexp, { "Public Key Exponent", "uftp.clientkey.keyexp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_keymod, { "Public Key Modulus", "uftp.clientkey.keymod", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_verify, { "Signature", "uftp.clientkey.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf, { "REG_CONF", "uftp.regconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_func, { "Type", "uftp.regconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_regconf_reserved, { "Reserved", "uftp.regconf.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_destcount, { "Destination Count", "uftp.regconf.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo, { "FILEINFO", "uftp.fileinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_func, { "Type", "uftp.fileinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftype, { "File Type", "uftp.fileinfo.ftype", FT_UINT8, BASE_DEC, VALS(file_types), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_file_id, { "File ID", "uftp.fileinfo.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_block_total, { "Total Blocks", "uftp.fileinfo.block_total", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_section_total, { "Total Sections", "uftp.fileinfo.section_total", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_destcount, { "Destination Count", "uftp.fileinfo.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_fsize, { "File Size", "uftp.fileinfo.fsize", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftstamp, { "File Timestamp", "uftp.fileinfo.tstamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_name, { "File Name", "uftp.fileinfo.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo, { "KEYINFO", "uftp.keyinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_func, { "Type", "uftp.keyinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_reserved, { "Reserved", "uftp.keyinfo.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destcount, { "Destination Count", "uftp.keyinfo.destcount", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_groupmaster_len, { "Group Master Length", "uftp.keyinfo.groupmaster_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_tstamp, { "Timestamp", "uftp.keyinfo.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destkey, { "Destination Key", "uftp.keyinfo.destkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destaddr, { "Destination Address", "uftp.keyinfo.destaddr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_groupmaster, { "Encrypted Group Master", "uftp.keyinfo.groupmaster", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack, { "INFO_ACK", "uftp.infoack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack_func, { "Type", "uftp.infoack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_infoack_flags, { "Flags", "uftp.infoack.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack_flags_partial, { "Partial", "uftp.infoack.flags.partial", FT_BOOLEAN, 8, NULL, FLAG_PARTIAL, NULL, HFILL } }, { &hf_uftp_infoack_flags_reserved, { "Reserved", "uftp.infoack.flags.reserved", FT_BOOLEAN, 8, NULL, FLAG_INFOACK_RESERVED, NULL, HFILL } }, { &hf_uftp_infoack_file_id, { "File ID", "uftp.infoack.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack_destcount, { "Destination Count", "uftp.infoack.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack_reserved, { "Reserved", "uftp.infoack.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_infoack_verify_data, { "Verify Data", "uftp.infoack.verify_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg, { "FILESEG", "uftp.fileseg", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_func, { "Type", "uftp.fileseg.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_reserved1, { "Reserved", "uftp.fileseg.reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_file_id, { "File ID", "uftp.fileseg.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_pass, { "Pass", "uftp.fileseg.pass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_reserved2, { "Reserved", "uftp.fileseg.reserved2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_section, { "Section", "uftp.fileseg.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_seq_num, { "Sequence Number", "uftp.fileseg.seq_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_data, { "Data", "uftp.fileseg.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done, { "DONE", "uftp.done", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_func, { "Type", "uftp.done.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_done_pass, { "Pass", "uftp.done.pass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_section, { "Section", "uftp.done.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_file_id, { "File ID", "uftp.done.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_destcount, { "Destination Count", "uftp.done.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status, { "STATUS", "uftp.status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_func, { "Type", "uftp.status.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_status_reserved, { "Reserved", "uftp.status.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_file_id, { "File ID", "uftp.status.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_pass, { "Pass", "uftp.status.pass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_seq, { "Sequence", "uftp.status.seq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_section, { "Section", "uftp.status.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_nak_count, { "NAK Count", "uftp.status.nak_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_naks, { "NAKs", "uftp.status.naks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus, { "PRSTATUS", "uftp.prstatus", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_func, { "Type", "uftp.prstatus.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_reserved1, { "Reserved", "uftp.prstatus.reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_file_id, { "File ID", "uftp.prstatus.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_pass, { "Pass", "uftp.prstatus.pass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_seq, { "Sequence", "uftp.prstatus.seq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_section, { "Section", "uftp.prstatus.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_destcount, { "Destination Count", "uftp.prstatus.destcount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_prstatus_reserved2, { "Reserved", "uftp.prstatus.reserved2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete, { "COMPLETE", "uftp.complete", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_func, { "Type", "uftp.complete.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_complete_status, { "Completion status", "uftp.complete.status", FT_UINT8, BASE_DEC, VALS(comp_status), 0x0, NULL, HFILL } }, { &hf_uftp_complete_file_id, { "File ID", "uftp.complete.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_destcount, { "Destination Count", "uftp.complete.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_reserved2, { "Reserved", "uftp.complete.reserved2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf, { "DONE_CONF", "uftp.doneconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_func, { "Type", "uftp.doneconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_reserved1, { "Reserved", "uftp.doneconf.reserved1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_file_id, { "File ID", "uftp.doneconf.file_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_destcount, { "Destination Count", "uftp.doneconf.destcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_reserved2, { "Reserved", "uftp.doneconf.reserved2", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq, { "HB_REQ", "uftp.hbreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_func, { "Type", "uftp.hbreq.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_reserved, { "Reserved", "uftp.hbreq.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_nonce, { "Nonce", "uftp.hbreq.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_keylen, { "Key Length", "uftp.hbreq.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_siglen, { "Signature Length", "uftp.hbreq.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_keyexp, { "Public Key Exponent", "uftp.hbreq.keyexp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_keymod, { "Public Key Modulus", "uftp.hbreq.keymod", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_verify, { "Signature", "uftp.hbreq.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp, { "HB_RESP", "uftp.hbresp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_func, { "Type", "uftp.hbresp.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_authenticated, { "Authenticated", "uftp.hbresp.authenticated", FT_UINT8, BASE_DEC, VALS(hb_auth_types), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_reserved, { "Reserved", "uftp.hbresp.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_nonce, { "Nonce", "uftp.hbresp.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyreq, { "KEY_REQ", "uftp.keyreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyreq_func, { "Type", "uftp.keyreq.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyreq_reserved, { "Reserved", "uftp.keyreq.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey, { "PROXY_KEY", "uftp.proxykey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_func, { "Type", "uftp.proxykey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_reserved, { "Reserved", "uftp.proxykey.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_nonce, { "Nonce", "uftp.proxykey.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_keylen, { "Key Length", "uftp.proxykey.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_siglen, { "Signature Length", "uftp.proxykey.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_keyexp, { "Public Key Exponent", "uftp.proxykey.keyexp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_keymod, { "Public Key Modulus", "uftp.proxykey.keymod", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_verify, { "Signature", "uftp.proxykey.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted, { "ENCRYPTED", "uftp.encrypted", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_tstamp, { "Timestamp", "uftp.encrypted.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_sig_len, { "Signature Length", "uftp.encrypted.sig_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload_len, { "Payload Length", "uftp.encrypted.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_signature, { "Signature", "uftp.encrypted.signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload, { "Encrypted Payload", "uftp.encrypted.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort, { "ABORT", "uftp.abort", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_func, { "Type", "uftp.abort.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags, { "Flags", "uftp.abort.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags_curfile, { "Current file", "uftp.abort.flags.curfile", FT_BOOLEAN, 8, NULL, FLAG_CURRENT_FILE, NULL, HFILL } }, { &hf_uftp_abort_flags_reserved, { "Reserved", "uftp.abort.flags.reserved", FT_BOOLEAN, 8, NULL, FLAG_ABORT_RESERVED, NULL, HFILL } }, { &hf_uftp_abort_reserved, { "Reserved", "uftp.abort.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_host, { "Host", "uftp.abort.host", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_message, { "Message", "uftp.abort.message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_uftp, &ett_uftp_announce, &ett_uftp_register, &ett_uftp_clientkey, &ett_uftp_regconf, &ett_uftp_fileinfo, &ett_uftp_keyinfo, &ett_uftp_keyinfo_destkey, &ett_uftp_infoack, &ett_uftp_fileseg, &ett_uftp_done, &ett_uftp_status, &ett_uftp_prstatus, &ett_uftp_complete, &ett_uftp_doneconf, &ett_uftp_hbreq, &ett_uftp_hbresp, &ett_uftp_keyreq, &ett_uftp_proxykey, &ett_uftp_encrypted, &ett_uftp_abort, &ett_uftp_announce_flags, &ett_uftp_infoack_flags, &ett_uftp_abort_flags, &ett_uftp_destlist }; static ei_register_info ei[] = { { &ei_uftp_length_invalid, { "uftp.length.invalid", PI_MALFORMED, PI_ERROR, "Length is invalid", EXPFILL }}, { &ei_uftp_func_unknown, { "uftp.func.invalid", PI_MALFORMED, PI_ERROR, "Unknown function", EXPFILL }} }; expert_module_t* expert_uftp; proto_uftp = proto_register_protocol("UDP based FTP w/ multicast", "UFTP", "uftp"); proto_register_field_array(proto_uftp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_uftp = expert_register_protocol(proto_uftp); expert_register_field_array(expert_uftp, ei, array_length(ei)); } void proto_reg_handoff_uftp(void) { static dissector_handle_t uftp_handle; uftp4_handle = find_dissector("uftp4"); uftp5_handle = find_dissector("uftp5"); uftp_handle = create_dissector_handle(dissect_uftp, proto_uftp); dissector_add_uint_with_preference("udp.port", UFTP_PORT, uftp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-uftp4.c
/* packet-uftp4.c * Routines for UFTP version 4 packet dissection * Copyright Dennis Bush <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <math.h> #define UFTP_VER_NUM 0x40 #define ANNOUNCE 1 #define REGISTER 2 #define CLIENT_KEY 3 #define REG_CONF 4 #define KEYINFO 5 #define KEYINFO_ACK 6 #define FILEINFO 7 #define FILEINFO_ACK 8 #define FILESEG 9 #define DONE 10 #define STATUS 11 #define COMPLETE 12 #define DONE_CONF 13 #define HB_REQ 14 #define HB_RESP 15 #define KEY_REQ 16 #define PROXY_KEY 17 #define ENCRYPTED 18 #define ABORT 19 #define CONG_CTRL 20 #define CC_ACK 21 #define FTYPE_REG 0 #define FTYPE_DIR 1 #define FTYPE_LINK 2 #define FTYPE_DELETE 3 #define FTYPE_FREESPACE 4 #define KEY_NONE 0 #define KEY_DES 1 #define KEY_DES_EDE3 2 #define KEY_AES128_CBC 3 #define KEY_AES256_CBC 4 #define KEY_AES128_GCM 5 #define KEY_AES256_GCM 6 #define KEY_AES128_CCM 7 #define KEY_AES256_CCM 8 #define HASH_NONE 0 #define HASH_MD5 1 #define HASH_SHA1 2 #define HASH_SHA256 3 #define HASH_SHA384 4 #define HASH_SHA512 5 #define SIG_NONE 0 #define SIG_HMAC 1 #define SIG_KEYEX 2 #define SIG_AUTHENC 3 #define KEYEX_NONE 0 #define KEYEX_RSA 1 #define KEYEX_ECDH_RSA 2 #define KEYEX_ECDH_ECDSA 3 #define KEYBLOB_RSA 1 #define KEYBLOB_EC 2 #define CURVE_sect163k1 1 #define CURVE_sect163r1 2 #define CURVE_sect163r2 3 #define CURVE_sect193r1 4 #define CURVE_sect193r2 5 #define CURVE_sect233k1 6 #define CURVE_sect233r1 7 #define CURVE_sect239k1 8 #define CURVE_sect283k1 9 #define CURVE_sect283r1 10 #define CURVE_sect409k1 11 #define CURVE_sect409r1 12 #define CURVE_sect571k1 13 #define CURVE_sect571r1 14 #define CURVE_secp160k1 15 #define CURVE_secp160r1 16 #define CURVE_secp160r2 17 #define CURVE_secp192k1 18 #define CURVE_secp192r1 19 #define CURVE_secp224k1 20 #define CURVE_secp224r1 21 #define CURVE_secp256k1 22 #define CURVE_secp256r1 23 #define CURVE_secp384r1 24 #define CURVE_secp521r1 25 #define CURVE_prime192v1 CURVE_secp192r1 #define CURVE_prime256v1 CURVE_secp256r1 #define CC_NONE 0 #define CC_UFTP3 1 #define CC_TFMCC 2 #define CC_PGMCC 3 #define EXT_ENC_INFO 1 #define EXT_TFMCC_DATA_INFO 2 #define EXT_TFMCC_ACK_INFO 3 #define EXT_PGMCC_DATA_INFO 4 #define EXT_PGMCC_NAK_INFO 5 #define EXT_PGMCC_ACK_INFO 6 #define EXT_FREESPACE_INFO 7 #define FLAG_SYNC_MODE 0x01 #define FLAG_SYNC_PREVIEW 0x02 #define FLAG_IPV6 0x04 #define FLAG_ANNOUNCE_RESERVED 0xF8 #define FLAG_CLIENT_AUTH 0x01 #define FLAG_ENCINFO_RESERVED 0xFE #define FLAG_PARTIAL 0x01 #define FLAG_FILEINFOACK_RESERVED 0xFE #define FLAG_CURRENT_FILE 0x01 #define FLAG_ABORT_RESERVED 0xFE #define FLAG_CC_CLR 0x01 #define FLAG_CC_RTT 0x02 #define FLAG_CC_START 0x04 #define FLAG_CC_LEAVE 0x08 #define FLAG_CC_RESERVED 0xF0 #define COMP_STAT_NORMAL 0 #define COMP_STAT_SKIPPED 1 #define COMP_STAT_OVERWRITE 2 #define COMP_STAT_REJECTED 3 #define HB_AUTH_FAILED 0 #define HB_AUTH_OK 1 #define HB_AUTH_CHALLENGE 2 #define MAXFILENAME 100 #define MAXDIRNAME 200 #define MAXPATHNAME 300 #define MAXBACKUPPATHNAME 600 #define MAXPROXYDEST 1000 #define MAXDIR 10 #define MAXSECTION 65536 #define DESTNAME_LEN 80 #define IFNAME_LEN 25 #define MAX_INTERFACES 100 #define IPSTR_LEN 16 #define PUBKEY_LEN 256 /* big enough for RSA-2048 */ #define RAND_LEN 32 /* rfc 5246 */ #define HMAC_LEN 64 /* big enough for SHA-512 */ #define VERIFY_LEN 12 /* rfc 5246 */ #define MASTER_LEN 48 /* rfc 5246 */ #define MAXIV 16 /* big enough for AES256 */ #define MAXKEY 32 /* big enough for AES256 */ #define KEYBLSIZE 16 /* Maximum symetric key blocksize */ #define DEF_RSA_LEN 512 /* Default length of generated RSA keys */ #define RSA_EXP 65537 /* Public key exponent of generated RSA keys */ #define SALT_LEN 4 /* Length of salt for IV */ #define GCM_IV_LEN 12 /* Length of IV for ciphers in GCM mode */ #define CCM_IV_LEN 12 /* Length of IV for ciphers in CCM mode */ #define GCM_TAG_LEN 16 /* Length of tag for ciphers in GCM mode */ #define CCM_TAG_LEN 16 /* Length of tag for ciphers in CCM mode */ #define UFTP_LEN 16 #define ANNOUNCE_LEN 16 #define ENC_INFO_LEN 44 #define REGISTER_LEN 44 #define CLIENT_KEY_LEN 8 #define REG_CONF_LEN 4 #define KEYINFO_LEN 12 #define DESTKEY_LEN 52 #define KEYINFO_ACK_LEN 16 #define FILEINFO_LEN 28 #define FILEINFO_ACK_LEN 16 #define FILESEG_LEN 8 #define TFMCC_DATA_LEN 8 #define DONE_LEN 8 #define STATUS_LEN 8 #define COMPLETE_LEN 8 #define FREESPACE_LEN 12 #define DONE_CONF_LEN 4 #define HB_REQ_LEN 12 #define HB_RESP_LEN 8 #define KEY_REQ_LEN 4 #define PROXY_KEY_LEN 12 #define ENCRYPTED_LEN 12 #define ABORT_LEN 308 #define CONG_CTRL_LEN 16 #define CC_ITEM_LEN 8 #define CC_ACK_LEN 4 #define TFMCC_ACK_LEN 20 #define RSA_BLOB_LEN 8 #define EC_BLOB_LEN 4 void proto_register_uftp4(void); static int proto_uftp = -1; /* main header and common fields */ static int hf_uftp_version = -1; static int hf_uftp_func = -1; static int hf_uftp_seq = -1; static int hf_uftp_src_id = -1; static int hf_uftp_group_id = -1; static int hf_uftp_group_inst = -1; static int hf_uftp_grtt = -1; static int hf_uftp_gsize = -1; static int hf_uftp_reserved = -1; static int hf_uftp_destlist = -1; static int hf_uftp_dest = -1; /* ANNOUNCE fields */ static int hf_uftp_announce = -1; static int hf_uftp_announce_func = -1; static int hf_uftp_announce_hlen = -1; static int hf_uftp_announce_flags = -1; static int hf_uftp_announce_flags_sync = -1; static int hf_uftp_announce_flags_syncpreview = -1; static int hf_uftp_announce_flags_ipv6 = -1; static int hf_uftp_announce_flags_reserved = -1; static int hf_uftp_announce_robust = -1; static int hf_uftp_announce_cc_type = -1; static int hf_uftp_announce_reserved = -1; static int hf_uftp_announce_blocksize = -1; static int hf_uftp_announce_tstamp = -1; static int hf_uftp_announce_publicmcast_ipv4 = -1; static int hf_uftp_announce_publicmcast_ipv6 = -1; static int hf_uftp_announce_privatemcast_ipv4 = -1; static int hf_uftp_announce_privatemcast_ipv6 = -1; /* EXT_ENC_INFO fields */ static int hf_uftp_encinfo = -1; static int hf_uftp_encinfo_exttype = -1; static int hf_uftp_encinfo_extlen = -1; static int hf_uftp_encinfo_flags = -1; static int hf_uftp_encinfo_flags_client_auth = -1; static int hf_uftp_encinfo_flags_reserved = -1; static int hf_uftp_encinfo_keyextype = -1; static int hf_uftp_encinfo_sigtype = -1; static int hf_uftp_encinfo_keytype = -1; static int hf_uftp_encinfo_hashtype = -1; static int hf_uftp_encinfo_keylen = -1; static int hf_uftp_encinfo_dhlen = -1; static int hf_uftp_encinfo_siglen = -1; static int hf_uftp_encinfo_rand1 = -1; static int hf_uftp_encinfo_keyblob = -1; static int hf_uftp_encinfo_dhblob = -1; static int hf_uftp_encinfo_sig = -1; /* rsa_blob_t fields */ static int hf_uftp_rsablob_blobtype = -1; static int hf_uftp_rsablob_reserved = -1; static int hf_uftp_rsablob_modlen = -1; static int hf_uftp_rsablob_exponent = -1; static int hf_uftp_rsablob_modulus = -1; /* ec_blob_t fields */ static int hf_uftp_ecblob_blobtype = -1; static int hf_uftp_ecblob_curve = -1; static int hf_uftp_ecblob_keylen = -1; static int hf_uftp_ecblob_key = -1; /* REGISTER fields */ static int hf_uftp_register = -1; static int hf_uftp_register_func = -1; static int hf_uftp_register_hlen = -1; static int hf_uftp_register_keyinfo_len = -1; static int hf_uftp_register_tstamp = -1; static int hf_uftp_register_rand2 = -1; static int hf_uftp_register_keyinfo = -1; /* CLIENT_KEY fields */ static int hf_uftp_clientkey = -1; static int hf_uftp_clientkey_func = -1; static int hf_uftp_clientkey_hlen = -1; static int hf_uftp_clientkey_reserved = -1; static int hf_uftp_clientkey_bloblen = -1; static int hf_uftp_clientkey_siglen = -1; static int hf_uftp_clientkey_keyblob = -1; static int hf_uftp_clientkey_verify = -1; /* REG_CONF fields */ static int hf_uftp_regconf = -1; static int hf_uftp_regconf_func = -1; static int hf_uftp_regconf_hlen = -1; static int hf_uftp_regconf_reserved = -1; /* KEYINFO fields */ static int hf_uftp_keyinfo = -1; static int hf_uftp_keyinfo_func = -1; static int hf_uftp_keyinfo_hlen = -1; static int hf_uftp_keyinfo_reserved = -1; static int hf_uftp_keyinfo_ivctr = -1; static int hf_uftp_keyinfo_destkey = -1; static int hf_uftp_keyinfo_destid = -1; static int hf_uftp_keyinfo_groupmaster = -1; /* KEYINFO_ACK fields */ static int hf_uftp_keyinfoack = -1; static int hf_uftp_keyinfoack_func = -1; static int hf_uftp_keyinfoack_hlen = -1; static int hf_uftp_keyinfoack_reserved = -1; static int hf_uftp_keyinfoack_verify_data = -1; /* FILEINFO fields */ static int hf_uftp_fileinfo = -1; static int hf_uftp_fileinfo_func = -1; static int hf_uftp_fileinfo_hlen = -1; static int hf_uftp_fileinfo_file_id = -1; static int hf_uftp_fileinfo_ftype = -1; static int hf_uftp_fileinfo_reserved = -1; static int hf_uftp_fileinfo_namelen = -1; static int hf_uftp_fileinfo_linklen = -1; static int hf_uftp_fileinfo_fsize = -1; static int hf_uftp_fileinfo_ftstamp = -1; static int hf_uftp_fileinfo_tstamp = -1; static int hf_uftp_fileinfo_name = -1; static int hf_uftp_fileinfo_link = -1; /* FILEINFO_ACK fields */ static int hf_uftp_fileinfoack = -1; static int hf_uftp_fileinfoack_func = -1; static int hf_uftp_fileinfoack_hlen = -1; static int hf_uftp_fileinfoack_file_id = -1; static int hf_uftp_fileinfoack_flags = -1; static int hf_uftp_fileinfoack_flags_partial = -1; static int hf_uftp_fileinfoack_flags_reserved = -1; static int hf_uftp_fileinfoack_reserved = -1; static int hf_uftp_fileinfoack_tstamp = -1; /* FILESEG fields */ static int hf_uftp_fileseg = -1; static int hf_uftp_fileseg_func = -1; static int hf_uftp_fileseg_hlen = -1; static int hf_uftp_fileseg_file_id = -1; static int hf_uftp_fileseg_section = -1; static int hf_uftp_fileseg_sec_block = -1; static int hf_uftp_fileseg_data = -1; /* EXT_TFMCC_DATA_INFO fields */ static int hf_uftp_tfmccdata = -1; static int hf_uftp_tfmccdata_exttype = -1; static int hf_uftp_tfmccdata_extlen = -1; static int hf_uftp_tfmccdata_send_rate = -1; static int hf_uftp_tfmccdata_cc_seq = -1; static int hf_uftp_tfmccdata_cc_rate = -1; /* DONE fields */ static int hf_uftp_done = -1; static int hf_uftp_done_func = -1; static int hf_uftp_done_hlen = -1; static int hf_uftp_done_file_id = -1; static int hf_uftp_done_section = -1; static int hf_uftp_done_reserved = -1; /* STATUS fields */ static int hf_uftp_status = -1; static int hf_uftp_status_func = -1; static int hf_uftp_status_hlen = -1; static int hf_uftp_status_file_id = -1; static int hf_uftp_status_section = -1; static int hf_uftp_status_reserved = -1; static int hf_uftp_status_naks = -1; /* COMPLETE fields */ static int hf_uftp_complete = -1; static int hf_uftp_complete_func = -1; static int hf_uftp_complete_hlen = -1; static int hf_uftp_complete_file_id = -1; static int hf_uftp_complete_status = -1; static int hf_uftp_complete_reserved = -1; /* EXT_FREESPACE_INFO fields */ static int hf_uftp_freespace = -1; static int hf_uftp_freespace_exttype = -1; static int hf_uftp_freespace_extlen = -1; static int hf_uftp_freespace_reserved = -1; static int hf_uftp_freespace_freespace = -1; /* DONE_CONF fields */ static int hf_uftp_doneconf = -1; static int hf_uftp_doneconf_func = -1; static int hf_uftp_doneconf_hlen = -1; static int hf_uftp_doneconf_reserved = -1; /* HB_REQ fields */ static int hf_uftp_hbreq = -1; static int hf_uftp_hbreq_func = -1; static int hf_uftp_hbreq_hlen = -1; static int hf_uftp_hbreq_reserved = -1; static int hf_uftp_hbreq_bloblen = -1; static int hf_uftp_hbreq_siglen = -1; static int hf_uftp_hbreq_nonce = -1; static int hf_uftp_hbreq_keyblob = -1; static int hf_uftp_hbreq_verify = -1; /* HB_RESP fields */ static int hf_uftp_hbresp = -1; static int hf_uftp_hbresp_func = -1; static int hf_uftp_hbresp_hlen = -1; static int hf_uftp_hbresp_authenticated = -1; static int hf_uftp_hbresp_reserved = -1; static int hf_uftp_hbresp_nonce = -1; /* KEY_REQ fields */ static int hf_uftp_keyreq = -1; static int hf_uftp_keyreq_func = -1; static int hf_uftp_keyreq_hlen = -1; static int hf_uftp_keyreq_reserved = -1; /* PROXY_KEY fields */ static int hf_uftp_proxykey = -1; static int hf_uftp_proxykey_func = -1; static int hf_uftp_proxykey_hlen = -1; static int hf_uftp_proxykey_bloblen = -1; static int hf_uftp_proxykey_dhlen = -1; static int hf_uftp_proxykey_siglen = -1; static int hf_uftp_proxykey_nonce = -1; static int hf_uftp_proxykey_keyblob = -1; static int hf_uftp_proxykey_dhblob = -1; static int hf_uftp_proxykey_verify = -1; /* CONG_CTRL fields */ static int hf_uftp_congctrl = -1; static int hf_uftp_congctrl_func = -1; static int hf_uftp_congctrl_hlen = -1; static int hf_uftp_congctrl_reserved = -1; static int hf_uftp_congctrl_cc_seq = -1; static int hf_uftp_congctrl_cc_rate = -1; static int hf_uftp_congctrl_tstamp = -1; static int hf_uftp_congctrl_cclist = -1; static int hf_uftp_congctrl_item = -1; static int hf_uftp_congctrl_item_destid = -1; static int hf_uftp_congctrl_item_flags = -1; static int hf_uftp_congctrl_item_flags_clr = -1; static int hf_uftp_congctrl_item_flags_rtt = -1; static int hf_uftp_congctrl_item_flags_start = -1; static int hf_uftp_congctrl_item_flags_leave = -1; static int hf_uftp_congctrl_item_flags_reserved = -1; static int hf_uftp_congctrl_item_rtt = -1; static int hf_uftp_congctrl_item_rate = -1; /* CC_ACK fields */ static int hf_uftp_ccack = -1; static int hf_uftp_ccack_func = -1; static int hf_uftp_ccack_hlen = -1; static int hf_uftp_ccack_reserved = -1; /* EXT_TFMCC_ACK_INFO fields */ static int hf_uftp_tfmccack = -1; static int hf_uftp_tfmccack_exttype = -1; static int hf_uftp_tfmccack_extlen = -1; static int hf_uftp_tfmccack_flags = -1; static int hf_uftp_tfmccack_flags_clr = -1; static int hf_uftp_tfmccack_flags_rtt = -1; static int hf_uftp_tfmccack_flags_start = -1; static int hf_uftp_tfmccack_flags_leave = -1; static int hf_uftp_tfmccack_flags_reserved = -1; static int hf_uftp_tfmccack_reserved = -1; static int hf_uftp_tfmccack_cc_seq = -1; static int hf_uftp_tfmccack_cc_rate = -1; static int hf_uftp_tfmccack_client_id = -1; static int hf_uftp_tfmccack_tstamp = -1; /* ENCRYPTED fields */ static int hf_uftp_encrypted = -1; static int hf_uftp_encrypted_ivctr = -1; static int hf_uftp_encrypted_sig_len = -1; static int hf_uftp_encrypted_payload_len = -1; static int hf_uftp_encrypted_signature = -1; static int hf_uftp_encrypted_payload = -1; /* ABORT fields */ static int hf_uftp_abort = -1; static int hf_uftp_abort_func = -1; static int hf_uftp_abort_hlen = -1; static int hf_uftp_abort_flags = -1; static int hf_uftp_abort_flags_curfile = -1; static int hf_uftp_abort_flags_reserved = -1; static int hf_uftp_abort_reserved = -1; static int hf_uftp_abort_clientid = -1; static int hf_uftp_abort_message = -1; static gint ett_uftp = -1; static gint ett_uftp_announce = -1; static gint ett_uftp_register = -1; static gint ett_uftp_clientkey = -1; static gint ett_uftp_regconf = -1; static gint ett_uftp_keyinfo = -1; static gint ett_uftp_keyinfoack = -1; static gint ett_uftp_fileinfo = -1; static gint ett_uftp_fileinfoack = -1; static gint ett_uftp_fileseg = -1; static gint ett_uftp_done = -1; static gint ett_uftp_status = -1; static gint ett_uftp_complete = -1; static gint ett_uftp_doneconf = -1; static gint ett_uftp_hbreq = -1; static gint ett_uftp_hbresp = -1; static gint ett_uftp_keyreq = -1; static gint ett_uftp_proxykey = -1; static gint ett_uftp_congctrl = -1; static gint ett_uftp_ccack = -1; static gint ett_uftp_encrypted = -1; static gint ett_uftp_abort = -1; static gint ett_uftp_announce_flags = -1; static gint ett_uftp_encinfo = -1; static gint ett_uftp_encinfo_flags = -1; static gint ett_uftp_keyinfo_destkey = -1; static gint ett_uftp_fileinfoack_flags = -1; static gint ett_uftp_congctrl_cclist = -1; static gint ett_uftp_congctrl_item = -1; static gint ett_uftp_congctrl_item_flags = -1; static gint ett_uftp_tfmccdata = -1; static gint ett_uftp_tfmccack = -1; static gint ett_uftp_tfmccack_flags = -1; static gint ett_uftp_freespace = -1; static gint ett_uftp_abort_flags = -1; static gint ett_uftp_destlist = -1; static gint ett_uftp_rsablob = -1; static gint ett_uftp_ecblob = -1; static expert_field ei_uftp_length_invalid = EI_INIT; static expert_field ei_uftp_func_unknown = EI_INIT; static const value_string messages[] = { { ANNOUNCE, "ANNOUNCE" }, { REGISTER, "REGISTER" }, { CLIENT_KEY, "CLIENT_KEY" }, { REG_CONF, "REG_CONF" }, { KEYINFO, "KEYINFO" }, { KEYINFO_ACK, "KEYINFO_ACK" }, { FILEINFO, "FILEINFO" }, { FILEINFO_ACK, "FILEINFO_ACK" }, { FILESEG, "FILESEG" }, { DONE, "DONE" }, { STATUS, "STATUS" }, { COMPLETE, "COMPLETE" }, { DONE_CONF, "DONE_CONF" }, { HB_REQ, "HB_REQ" }, { HB_RESP, "HB_RESP" }, { KEY_REQ, "KEY_REQ" }, { PROXY_KEY, "PROXY_KEY" }, { ENCRYPTED, "ENCRYPTED" }, { ABORT, "ABORT" }, { CONG_CTRL, "CONG_CTRL" }, { CC_ACK, "CC_ACK" }, { 0, NULL } }; static const value_string extensions[] = { { EXT_ENC_INFO, "EXT_ENC_INFO" }, { EXT_TFMCC_DATA_INFO, "EXT_TFMCC_DATA_INFO" }, { EXT_TFMCC_ACK_INFO, "EXT_TFMCC_ACK_INFO" }, { EXT_PGMCC_DATA_INFO, "EXT_PGMCC_DATA_INFO" }, { EXT_PGMCC_NAK_INFO, "EXT_PGMCC_NAK_INFO" }, { EXT_PGMCC_ACK_INFO, "EXT_PGMCC_ACK_INFO" }, { EXT_FREESPACE_INFO, "EXT_FREESPACE_INFO" }, { 0, NULL } }; static const value_string cc_types[] = { { CC_NONE, "NONE" }, { CC_UFTP3, "UFTP3" }, { CC_TFMCC, "TFMCC" }, { CC_PGMCC, "PGMCC" }, { 0, NULL } }; static const value_string keyblob_types[] = { { KEYBLOB_RSA, "RSA" }, { KEYBLOB_EC, "EC" }, { 0, NULL } }; static const value_string curves[] = { { CURVE_sect163k1, "sect163k1" }, { CURVE_sect163r1, "sect163r1" }, { CURVE_sect163r2, "sect163r2" }, { CURVE_sect193r1, "sect193r1" }, { CURVE_sect193r2, "sect193r2" }, { CURVE_sect233k1, "sect233k1" }, { CURVE_sect233r1, "sect233r1" }, { CURVE_sect239k1, "sect239k1" }, { CURVE_sect283k1, "sect283k1" }, { CURVE_sect283r1, "sect283r1" }, { CURVE_sect409k1, "sect409k1" }, { CURVE_sect409r1, "sect409r1" }, { CURVE_sect571k1, "sect571k1" }, { CURVE_sect571r1, "sect571r1" }, { CURVE_secp160k1, "secp160k1" }, { CURVE_secp160r1, "secp160r1" }, { CURVE_secp160r2, "secp160r2" }, { CURVE_secp192k1, "secp192k1" }, { CURVE_secp192r1, "prime192v1" }, { CURVE_secp224k1, "secp224k1" }, { CURVE_secp224r1, "secp224r1" }, { CURVE_secp256k1, "secp256k1" }, { CURVE_secp256r1, "prime256v1" }, { CURVE_secp384r1, "secp384r1" }, { CURVE_secp521r1, "secp521r1" }, { 0, NULL } }; static const value_string keyexchange_types[] = { { KEYEX_NONE, "NONE" }, { KEYEX_RSA, "RSA" }, { KEYEX_ECDH_RSA, "ECDH_RSA" }, { KEYEX_ECDH_ECDSA, "ECDH_ECDSA" }, { 0, NULL } }; static const value_string signature_types[] = { { SIG_NONE, "NONE" }, { SIG_HMAC, "HMAC" }, { SIG_KEYEX, "KEYEX" }, { SIG_AUTHENC, "AUTHENC" }, { 0, NULL } }; static const value_string hash_types[] = { { HASH_NONE, "NONE" }, { HASH_MD5, "MD5" }, { HASH_SHA1, "SHA-1" }, { HASH_SHA256, "SHA-256" }, { HASH_SHA384, "SHA-384" }, { HASH_SHA512, "SHA-512" }, { 0, NULL } }; static const value_string key_types[] = { { KEY_NONE, "NONE" }, { KEY_DES, "DES" }, { KEY_DES_EDE3, "3 Key Triple DES" }, { KEY_AES128_CBC, "AES-128-CBC" }, { KEY_AES256_CBC, "AES-256-CBC" }, { KEY_AES128_GCM, "AES-128-GCM" }, { KEY_AES256_GCM, "AES-256-GCM" }, { KEY_AES128_CCM, "AES-128-CCM" }, { KEY_AES256_CCM, "AES-256-CCM" }, { 0, NULL } }; static const value_string hb_auth_types[] = { { HB_AUTH_FAILED, "Authorization Failed" }, { HB_AUTH_OK, "Authorization Succeeded" }, { HB_AUTH_CHALLENGE, "Authorization Required" }, { 0, NULL } }; static const value_string file_types[] = { { FTYPE_REG, "Regular file" }, { FTYPE_DIR, "Directory" }, { FTYPE_LINK, "Symbolic link" }, { FTYPE_DELETE, "Delete request" }, { FTYPE_FREESPACE, "Free space request" }, { 0, NULL } }; static int * const announce_flags[] = { &hf_uftp_announce_flags_sync, &hf_uftp_announce_flags_syncpreview, &hf_uftp_announce_flags_ipv6, &hf_uftp_announce_flags_reserved, NULL }; static int * const encinfo_flags[] = { &hf_uftp_encinfo_flags_client_auth, &hf_uftp_encinfo_flags_reserved, NULL }; static int * const fileinfoack_flags[] = { &hf_uftp_fileinfoack_flags_partial, &hf_uftp_fileinfoack_flags_reserved, NULL }; static int * const abort_flags[] = { &hf_uftp_abort_flags_curfile, &hf_uftp_abort_flags_reserved, NULL }; static int * const cc_item_flags[] = { &hf_uftp_congctrl_item_flags_clr, &hf_uftp_congctrl_item_flags_rtt, &hf_uftp_congctrl_item_flags_start, &hf_uftp_congctrl_item_flags_leave, &hf_uftp_congctrl_item_flags_reserved, NULL }; static int * const tfmcc_ack_flags[] = { &hf_uftp_tfmccack_flags_clr, &hf_uftp_tfmccack_flags_rtt, &hf_uftp_tfmccack_flags_start, &hf_uftp_tfmccack_flags_leave, &hf_uftp_tfmccack_flags_reserved, NULL }; static const value_string comp_status[] = { { COMP_STAT_NORMAL, "Normal" }, { COMP_STAT_SKIPPED, "Skipped" }, { COMP_STAT_OVERWRITE, "Overwrite" }, { COMP_STAT_REJECTED, "Rejected" }, { 0, NULL } }; #define RTT_MIN 1.0e-6 #define RTT_MAX 1000.0 static double unquantize_grtt(guint8 rtt) { return ((rtt <= 31) ? (((double)(rtt + 1)) * (double)RTT_MIN) : (RTT_MAX / exp(((double)(255 - rtt)) / (double)13.0))); } static guint unquantize_gsize(guint8 size) { gint E, i; double rval; E = size & 0x7; rval = (size >> 3) * (10.0 / 32.0); for (i = 0; i < E; i++) { rval *= 10; } return (guint)(rval + 0.5); } static guint unquantize_rate(guint16 rate) { gint E, i; double rval; E = rate & 0xF; rval = (rate >> 4) * (10.0 / 4096.0); for (i = 0; i < E; i++) { rval *= 10; } return (guint)rval; } static int dissect_uftp_rsablob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int tree_hf) { proto_item *ti = NULL; proto_tree *rsablob_tree = NULL; gint offset = 0, modlen; if (tvb_reported_length(tvb) < RSA_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } modlen = (gint)tvb_get_ntohs(tvb, 2); if ((gint)tvb_reported_length(tvb) < modlen + RSA_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d", tvb_reported_length(tvb)); return 0; } ti = proto_tree_add_item(tree, tree_hf, tvb, offset, RSA_BLOB_LEN + modlen, ENC_NA); rsablob_tree = proto_item_add_subtree(ti, ett_uftp_rsablob); proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_blobtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_modlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_exponent, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_modulus, tvb, offset, modlen, ENC_NA); return RSA_BLOB_LEN + modlen; } static int dissect_uftp_ecblob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int tree_hf) { proto_item *ti = NULL; proto_tree *ecblob_tree = NULL; gint offset = 0, keylen; if (tvb_reported_length(tvb) < EC_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } keylen = (gint)tvb_get_ntohs(tvb, 2); if ((gint)tvb_reported_length(tvb) < keylen + EC_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d", tvb_reported_length(tvb)); return 0; } ti = proto_tree_add_item(tree, tree_hf, tvb, offset, EC_BLOB_LEN + keylen, ENC_NA); ecblob_tree = proto_item_add_subtree(ti, ett_uftp_ecblob); proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_blobtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_curve, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_key, tvb, offset, keylen, ENC_NA); return EC_BLOB_LEN + keylen; } static gint dissect_uftp_encinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *encinfo_tree = NULL; gint offset = 0, hlen, keylen, dhlen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < ENC_INFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = (gint)tvb_get_ntohs(tvb, 6); dhlen = (gint)tvb_get_ntohs(tvb, 8); siglen = (gint)tvb_get_ntohs(tvb, 10); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < ENC_INFO_LEN + keylen + dhlen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, " "keylen = %d, dhlen = %d, siglen = %d", tvb_reported_length(tvb), hlen, keylen, dhlen, siglen); return 0; } ti = proto_tree_add_item(tree, hf_uftp_encinfo, tvb, offset, ENC_INFO_LEN + keylen + dhlen + siglen, ENC_NA); encinfo_tree = proto_item_add_subtree(ti, ett_uftp_encinfo); proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(encinfo_tree, hf_uftp_encinfo_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(encinfo_tree, tvb, offset, hf_uftp_encinfo_flags, ett_uftp_encinfo_flags, encinfo_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_keyextype, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_sigtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_keytype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_hashtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_dhlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_rand1, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_keyblob); break; } offset += parsed; } if (dhlen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, dhlen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_dhblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_dhblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_sig, tvb, offset, siglen, ENC_NA); } return ENC_INFO_LEN + keylen + dhlen + siglen; } static void dissect_uftp_announce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *announce_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; gint hlen, iplen, destcount, idx, extlen_total; guint8 flags, ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < ANNOUNCE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if ((gint)tvb_reported_length(tvb) < hlen) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } flags = tvb_get_guint8(tvb, 2); ti = proto_tree_add_item(tree, hf_uftp_announce, tvb, offset, -1, ENC_NA); announce_tree = proto_item_add_subtree(ti, ett_uftp_announce); proto_tree_add_item(announce_tree, hf_uftp_announce_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(announce_tree, hf_uftp_announce_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(announce_tree, tvb, offset, hf_uftp_announce_flags, ett_uftp_announce_flags, announce_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_robust, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_cc_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_blocksize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(announce_tree, hf_uftp_announce_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); offset += 8; if (flags & FLAG_IPV6) { iplen = 16; proto_tree_add_item(announce_tree, hf_uftp_announce_publicmcast_ipv6, tvb, offset, iplen, ENC_NA); offset += iplen; proto_tree_add_item(announce_tree, hf_uftp_announce_privatemcast_ipv6, tvb, offset, iplen, ENC_NA); offset += iplen; } else { iplen = 4; proto_tree_add_item(announce_tree, hf_uftp_announce_publicmcast_ipv4, tvb, offset, iplen, ENC_BIG_ENDIAN); offset += iplen; proto_tree_add_item(announce_tree, hf_uftp_announce_privatemcast_ipv4, tvb, offset, iplen, ENC_BIG_ENDIAN); offset += iplen; } extlen_total = hlen - (ANNOUNCE_LEN + ( 2 * iplen)); while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_ENC_INFO: parsed = dissect_uftp_encinfo(next_tvb, pinfo, announce_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(announce_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_register(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *register_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, keylen, idx; if (tvb_reported_length(tvb) < REGISTER_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 2); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < REGISTER_LEN + keylen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen = %d", tvb_reported_length(tvb), hlen, keylen); return; } ti = proto_tree_add_item(tree, hf_uftp_register, tvb, offset, -1, ENC_NA); register_tree = proto_item_add_subtree(ti, ett_uftp_register); proto_tree_add_item(register_tree, hf_uftp_register_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(register_tree, hf_uftp_register_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(register_tree, hf_uftp_register_keyinfo_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(register_tree, hf_uftp_register_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); offset += 8; proto_tree_add_item(register_tree, hf_uftp_register_rand2, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { proto_tree_add_item(register_tree, hf_uftp_register_keyinfo, tvb, offset, keylen, ENC_NA); } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(register_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_clientkey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *clientkey_tree = NULL; gint offset = 0, hlen; guint16 keylen, verifylen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < CLIENT_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 4); verifylen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CLIENT_KEY_LEN + keylen + verifylen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen = %d verifylen = %d", tvb_reported_length(tvb), hlen, keylen, verifylen); return; } ti = proto_tree_add_item(tree, hf_uftp_clientkey, tvb, offset, -1, ENC_NA); clientkey_tree = proto_item_add_subtree(ti, ett_uftp_clientkey); proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(clientkey_tree, hf_uftp_clientkey_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, clientkey_tree, hf_uftp_clientkey_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, clientkey_tree, hf_uftp_clientkey_keyblob); break; } offset += parsed; } if (verifylen > 0) { proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_verify, tvb, offset, verifylen, ENC_NA); } } static void dissect_uftp_regconf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *regconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, idx; if (tvb_reported_length(tvb) < REG_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < REG_CONF_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_regconf, tvb, offset, -1, ENC_NA); regconf_tree = proto_item_add_subtree(ti, ett_uftp_regconf); proto_tree_add_item(regconf_tree, hf_uftp_regconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(regconf_tree, hf_uftp_regconf_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(regconf_tree, hf_uftp_regconf_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(regconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_keyinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_item *destkey = NULL; proto_tree *keyinfo_tree = NULL; proto_tree *destlist_tree = NULL; proto_tree *destkey_tree = NULL; gint offset = 0, hlen; guint8 destcount, idx; if (tvb_reported_length(tvb) < KEYINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < KEYINFO_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_keyinfo, tvb, offset, -1, ENC_NA); keyinfo_tree = proto_item_add_subtree(ti, ett_uftp_keyinfo); proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(keyinfo_tree, hf_uftp_keyinfo_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_ivctr, tvb, offset, 8, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / DESTKEY_LEN; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(keyinfo_tree, hf_uftp_destlist, tvb, offset, destcount * DESTKEY_LEN, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { destkey = proto_tree_add_item(destlist_tree, hf_uftp_keyinfo_destkey, tvb, offset, DESTKEY_LEN, ENC_NA); destkey_tree = proto_item_add_subtree(destkey, ett_uftp_keyinfo_destkey); proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_destid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_groupmaster, tvb, offset, 48, ENC_NA); offset += 48; } } static void dissect_uftp_keyinfoack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *keyinfoack_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < KEYINFO_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < KEYINFO_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_keyinfoack, tvb, offset, -1, ENC_NA); keyinfoack_tree = proto_item_add_subtree(ti, ett_uftp_keyinfoack); proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(keyinfoack_tree, hf_uftp_keyinfoack_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_verify_data, tvb, offset, VERIFY_LEN, ENC_NA); } static void dissect_uftp_fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfo_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, destcount, idx, namelen, linklen; if (tvb_reported_length(tvb) < FILEINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; namelen = tvb_get_guint8(tvb, 8) * 4; linklen = tvb_get_guint8(tvb, 9) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILEINFO_LEN + namelen + linklen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, namelen = %d, linklen = %d", tvb_reported_length(tvb), hlen, namelen, linklen); return; } file_id = tvb_get_ntohs(tvb, 2); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); ti = proto_tree_add_item(tree, hf_uftp_fileinfo, tvb, offset, -1, ENC_NA); fileinfo_tree = proto_item_add_subtree(ti, ett_uftp_fileinfo); proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileinfo_tree, hf_uftp_fileinfo_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_namelen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_linklen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_fsize, tvb, offset, 6, ENC_BIG_ENDIAN); offset += 6; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftstamp, tvb, offset, 4, ENC_TIME_SECS); offset += 4; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); offset += 8; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_name, tvb, offset, namelen, ENC_ASCII); offset += namelen; if (linklen > 0) { proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_link, tvb, offset, linklen, ENC_ASCII); } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(fileinfo_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_fileinfoack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfoack_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, destcount, idx; if (tvb_reported_length(tvb) < FILEINFO_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILEINFO_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_fileinfoack, tvb, offset, -1, ENC_NA); fileinfoack_tree = proto_item_add_subtree(ti, ett_uftp_fileinfoack); proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileinfoack_tree, hf_uftp_fileinfoack_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(fileinfoack_tree, tvb, offset, hf_uftp_fileinfoack_flags, ett_uftp_fileinfoack_flags, fileinfoack_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(fileinfoack_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static gint dissect_uftp_tfmccdata(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *tfmccdata_tree = NULL; gint offset = 0, hlen; guint rate, srate; if (tvb_reported_length(tvb) < TFMCC_DATA_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < TFMCC_DATA_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); srate = unquantize_rate(tvb_get_ntohs(tvb, 2)); ti = proto_tree_add_item(tree, hf_uftp_tfmccdata, tvb, offset, TFMCC_DATA_LEN, ENC_NA); tfmccdata_tree = proto_item_add_subtree(ti, ett_uftp_tfmccdata); proto_tree_add_item(tfmccdata_tree, hf_uftp_tfmccdata_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(tfmccdata_tree, hf_uftp_tfmccdata_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_uint(tfmccdata_tree, hf_uftp_tfmccdata_send_rate, tvb, offset, 2, srate); offset += 2; proto_tree_add_item(tfmccdata_tree, hf_uftp_tfmccdata_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(tfmccdata_tree, hf_uftp_tfmccdata_cc_rate, tvb, offset, 2, rate); return TFMCC_DATA_LEN; } static void dissect_uftp_fileseg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *fileseg_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, section, sec_block; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < FILESEG_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILESEG_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 4); sec_block = tvb_get_ntohs(tvb, 6); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d Block=%d", file_id, section, sec_block); ti = proto_tree_add_item(tree, hf_uftp_fileseg, tvb, offset, -1, ENC_NA); fileseg_tree = proto_item_add_subtree(ti, ett_uftp_fileseg); proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileseg_tree, hf_uftp_fileseg_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_sec_block, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - FILESEG_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_DATA_INFO: parsed = dissect_uftp_tfmccdata(next_tvb, pinfo, fileseg_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } offset = hlen; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_data, tvb, offset, -1, ENC_NA); } static void dissect_uftp_done(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *done_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, section, destcount, idx; if (tvb_reported_length(tvb) < DONE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < DONE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 6); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d", file_id, section); } ti = proto_tree_add_item(tree, hf_uftp_done, tvb, offset, -1, ENC_NA); done_tree = proto_item_add_subtree(ti, ett_uftp_done); proto_tree_add_item(done_tree, hf_uftp_done_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(done_tree, hf_uftp_done_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(done_tree, hf_uftp_done_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(done_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static gint dissect_uftp_tfmccack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *tfmccack_tree = NULL; gint offset = 0, hlen; guint rate; if (tvb_reported_length(tvb) < TFMCC_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < TFMCC_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); ti = proto_tree_add_item(tree, hf_uftp_tfmccack, tvb, offset, TFMCC_ACK_LEN, ENC_NA); tfmccack_tree = proto_item_add_subtree(ti, ett_uftp_tfmccack); proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(tfmccack_tree, hf_uftp_tfmccack_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(tfmccack_tree, tvb, offset, hf_uftp_tfmccack_flags, ett_uftp_tfmccack_flags, tfmcc_ack_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(tfmccack_tree, hf_uftp_tfmccack_cc_rate, tvb, offset, 2, rate); offset += 2; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_client_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); return TFMCC_ACK_LEN; } static void dissect_uftp_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *status_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, section; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < STATUS_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < STATUS_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 4); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d", file_id, section); ti = proto_tree_add_item(tree, hf_uftp_status, tvb, offset, -1, ENC_NA); status_tree = proto_item_add_subtree(ti, ett_uftp_status); proto_tree_add_item(status_tree, hf_uftp_status_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(status_tree, hf_uftp_status_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - STATUS_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_ACK_INFO: parsed = dissect_uftp_tfmccack(next_tvb, pinfo, status_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } offset = hlen; proto_tree_add_item(status_tree, hf_uftp_status_naks, tvb, offset, -1, ENC_NA); } static gint dissect_uftp_freespace(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *freespace_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < FREESPACE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FREESPACE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } ti = proto_tree_add_item(tree, hf_uftp_freespace, tvb, offset, FREESPACE_LEN, ENC_NA); freespace_tree = proto_item_add_subtree(ti, ett_uftp_freespace); proto_tree_add_item(freespace_tree, hf_uftp_freespace_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(freespace_tree, hf_uftp_freespace_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(freespace_tree, hf_uftp_freespace_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(freespace_tree, hf_uftp_freespace_freespace, tvb, offset, 8, ENC_BIG_ENDIAN); return FREESPACE_LEN; } static void dissect_uftp_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *complete_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, destcount, idx; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < COMPLETE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < COMPLETE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_complete, tvb, offset, -1, ENC_NA); complete_tree = proto_item_add_subtree(ti, ett_uftp_complete); proto_tree_add_item(complete_tree, hf_uftp_complete_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(complete_tree, hf_uftp_complete_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(complete_tree, hf_uftp_complete_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; extlen_total = hlen - COMPLETE_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_FREESPACE_INFO: parsed = dissect_uftp_freespace(next_tvb, pinfo, complete_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(complete_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_doneconf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *doneconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, idx; if (tvb_reported_length(tvb) < DONE_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < DONE_CONF_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_doneconf, tvb, offset, -1, ENC_NA); doneconf_tree = proto_item_add_subtree(ti, ett_uftp_doneconf); proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(doneconf_tree, hf_uftp_doneconf_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(doneconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_hbreq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbreq_tree = NULL; gint offset = 0, hlen; guint16 keylen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < HB_REQ_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 4); siglen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < HB_REQ_LEN + keylen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen=%d siglen=%d", tvb_reported_length(tvb), hlen, keylen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_hbreq, tvb, offset, -1, ENC_NA); hbreq_tree = proto_item_add_subtree(ti, ett_uftp_hbreq); proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(hbreq_tree, hf_uftp_hbreq_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, hbreq_tree, hf_uftp_hbreq_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, hbreq_tree, hf_uftp_hbreq_keyblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_verify, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_hbresp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbresp_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < HB_RESP_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < HB_RESP_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_hbresp, tvb, offset, -1, ENC_NA); hbresp_tree = proto_item_add_subtree(ti, ett_uftp_hbresp); proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(hbresp_tree, hf_uftp_hbresp_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_authenticated, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); } static void dissect_uftp_keyreq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *keyreq_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < KEY_REQ_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < KEY_REQ_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_keyreq, tvb, offset, -1, ENC_NA); keyreq_tree = proto_item_add_subtree(ti, ett_uftp_keyreq); proto_tree_add_item(keyreq_tree, hf_uftp_keyreq_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(keyreq_tree, hf_uftp_keyreq_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(keyreq_tree, hf_uftp_keyreq_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); } static void dissect_uftp_proxykey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *proxykey_tree = NULL; gint offset = 0, hlen; guint16 keylen, dhlen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < PROXY_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 2); dhlen = tvb_get_ntohs(tvb, 4); siglen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < PROXY_KEY_LEN + keylen + dhlen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen=%d, dhlen=%d, siglen=%d", tvb_reported_length(tvb), hlen, keylen, dhlen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_proxykey, tvb, offset, -1, ENC_NA); proxykey_tree = proto_item_add_subtree(ti, ett_uftp_proxykey); proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(proxykey_tree, hf_uftp_proxykey_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_dhlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_keyblob); break; } offset += parsed; } if (dhlen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, dhlen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_dhblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_dhblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_verify, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_congctrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *cclist = NULL; proto_item *ccitem = NULL; proto_tree *congctrl_tree = NULL; proto_tree *cclist_tree = NULL; proto_tree *ccitem_tree = NULL; gint offset = 0, hlen; guint rate; guint8 itemcount, idx; if (tvb_reported_length(tvb) < CONG_CTRL_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CONG_CTRL_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); ti = proto_tree_add_item(tree, hf_uftp_congctrl, tvb, offset, -1, ENC_NA); congctrl_tree = proto_item_add_subtree(ti, ett_uftp_congctrl); proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(congctrl_tree, hf_uftp_congctrl_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(congctrl_tree, hf_uftp_congctrl_cc_rate, tvb, offset, 2, rate); offset += 2; proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_tstamp, tvb, offset, 8, ENC_TIME_SECS_USECS); itemcount = (tvb_reported_length(tvb) - hlen) / CC_ITEM_LEN; offset = hlen; if (itemcount > 0) { cclist = proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_cclist, tvb, offset, itemcount * CC_ITEM_LEN, ENC_NA); cclist_tree = proto_item_add_subtree(cclist, ett_uftp_congctrl_cclist); } for (idx = 0; idx < itemcount; idx++) { guint itemrate; double itemrtt; itemrtt = unquantize_grtt(tvb_get_guint8(tvb, offset + 5)); itemrate = unquantize_rate(tvb_get_ntohs(tvb, offset + 6)); ccitem = proto_tree_add_item(cclist_tree, hf_uftp_congctrl_item, tvb, offset, CC_ITEM_LEN, ENC_NA); ccitem_tree = proto_item_add_subtree(ccitem, ett_uftp_congctrl_item); proto_tree_add_item(ccitem_tree, hf_uftp_congctrl_item_destid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_bitmask(ccitem_tree, tvb, offset, hf_uftp_congctrl_item_flags, ett_uftp_congctrl_item_flags, cc_item_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_double(ccitem_tree, hf_uftp_congctrl_item_rtt, tvb, offset, 1, itemrtt); offset += 1; proto_tree_add_uint(ccitem_tree, hf_uftp_congctrl_item_rate, tvb, offset, 2, itemrate); offset += 2; } } static void dissect_uftp_ccack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *ccack_tree = NULL; gint offset = 0, hlen, extlen_total; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < CC_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CC_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_ccack, tvb, offset, -1, ENC_NA); ccack_tree = proto_item_add_subtree(ti, ett_uftp_ccack); proto_tree_add_uint_format_value(ccack_tree, hf_uftp_ccack_func, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(ccack_tree, hf_uftp_ccack_hlen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ccack_tree, hf_uftp_ccack_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - CC_ACK_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_ACK_INFO: parsed = dissect_uftp_tfmccack(next_tvb, pinfo, ccack_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } } static void dissect_uftp_encrypted(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *encrypted_tree = NULL; gint offset = 0; guint16 sig_len, payload_len; if (tvb_reported_length(tvb) < ENCRYPTED_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } sig_len = tvb_get_ntohs(tvb, 8); payload_len = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < ENCRYPTED_LEN + sig_len + payload_len) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, sig=%d, payload=%d", tvb_reported_length(tvb), sig_len, payload_len); return; } ti = proto_tree_add_item(tree, hf_uftp_encrypted, tvb, offset, -1, ENC_NA); encrypted_tree = proto_item_add_subtree(ti, ett_uftp_encrypted); proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_ivctr, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_sig_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_signature, tvb, offset, sig_len, ENC_NA); offset += sig_len; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload, tvb, offset, payload_len, ENC_NA); } static void dissect_uftp_abort(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *abort_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < ABORT_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < ABORT_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_abort, tvb, offset, -1, ENC_NA); abort_tree = proto_item_add_subtree(ti, ett_uftp_abort); proto_tree_add_item(abort_tree, hf_uftp_abort_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(abort_tree, hf_uftp_abort_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(abort_tree, tvb, offset, hf_uftp_abort_flags, ett_uftp_abort_flags, abort_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(abort_tree, hf_uftp_abort_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(abort_tree, hf_uftp_abort_clientid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(abort_tree, hf_uftp_abort_message, tvb, offset, -1, ENC_ASCII); } static int dissect_uftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 version; guint8 mes_type; guint32 group_id; tvbuff_t *next_tvb; proto_item *ti = NULL; proto_tree *uftp_tree = NULL; gint offset = 0; guint l_gsize; double grtt; if (tvb_reported_length(tvb) < UFTP_LEN + 4) { return 0; } version = tvb_get_guint8(tvb, 0); mes_type = tvb_get_guint8(tvb, 1); group_id = tvb_get_ntohl(tvb, 8); if (version != UFTP_VER_NUM) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "UFTP"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%-12s", val_to_str(mes_type, messages, "Unknown (%d)")); if ((mes_type != HB_REQ) && (mes_type != HB_RESP)) { col_append_fstr(pinfo->cinfo, COL_INFO, " ID=%08X", group_id); } grtt = unquantize_grtt(tvb_get_guint8(tvb, 13)); l_gsize = unquantize_gsize(tvb_get_guint8(tvb, 14)); ti = proto_tree_add_item(tree, proto_uftp, tvb, 0, -1, ENC_NA); uftp_tree = proto_item_add_subtree(ti, ett_uftp); proto_tree_add_item(uftp_tree, hf_uftp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(uftp_tree, hf_uftp_src_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_group_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_group_inst, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_double(uftp_tree, hf_uftp_grtt, tvb, offset, 1, grtt); offset += 1; proto_tree_add_uint(uftp_tree, hf_uftp_gsize, tvb, offset, 1, l_gsize); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_reported_length(tvb) - UFTP_LEN); switch (mes_type) { case ANNOUNCE: dissect_uftp_announce(next_tvb, pinfo, uftp_tree); break; case REGISTER: dissect_uftp_register(next_tvb, pinfo, uftp_tree); break; case CLIENT_KEY: dissect_uftp_clientkey(next_tvb, pinfo, uftp_tree); break; case REG_CONF: dissect_uftp_regconf(next_tvb, pinfo, uftp_tree); break; case KEYINFO: dissect_uftp_keyinfo(next_tvb, pinfo, uftp_tree); break; case KEYINFO_ACK: dissect_uftp_keyinfoack(next_tvb, pinfo, uftp_tree); break; case FILEINFO: dissect_uftp_fileinfo(next_tvb, pinfo, uftp_tree); break; case FILEINFO_ACK: dissect_uftp_fileinfoack(next_tvb, pinfo, uftp_tree); break; case FILESEG: dissect_uftp_fileseg(next_tvb, pinfo, uftp_tree); break; case DONE: dissect_uftp_done(next_tvb, pinfo, uftp_tree); break; case STATUS: dissect_uftp_status(next_tvb, pinfo, uftp_tree); break; case COMPLETE: dissect_uftp_complete(next_tvb, pinfo, uftp_tree); break; case DONE_CONF: dissect_uftp_doneconf(next_tvb, pinfo, uftp_tree); break; case HB_REQ: dissect_uftp_hbreq(next_tvb, pinfo, uftp_tree); break; case HB_RESP: dissect_uftp_hbresp(next_tvb, pinfo, uftp_tree); break; case KEY_REQ: dissect_uftp_keyreq(next_tvb, pinfo, uftp_tree); break; case PROXY_KEY: dissect_uftp_proxykey(next_tvb, pinfo, uftp_tree); break; case CONG_CTRL: dissect_uftp_congctrl(next_tvb, pinfo, uftp_tree); break; case CC_ACK: dissect_uftp_ccack(next_tvb, pinfo, uftp_tree); break; case ENCRYPTED: dissect_uftp_encrypted(next_tvb, pinfo, uftp_tree); break; case ABORT: dissect_uftp_abort(next_tvb, pinfo, uftp_tree); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_uftp_func_unknown, tvb, offset, -1, "Function unknown: %d", mes_type); break; } return tvb_reported_length(tvb); } void proto_register_uftp4(void) { static hf_register_info hf[] = { { &hf_uftp_version, { "Protocol Version", "uftp4.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_func, { "Type", "uftp4.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_seq, { "Sequence Number", "uftp4.seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_src_id, { "Source ID", "uftp4.src_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_group_id, { "Group ID", "uftp4.group_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_group_inst, { "Group Instance ID", "uftp4.group_inst", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_grtt, { "Group Round Trip Time", "uftp4.grtt", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_gsize, { "Group Size", "uftp4.gsize", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_reserved, { "Reserved", "uftp4.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_destlist, { "Destination List", "uftp4.destlist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_dest, { "Destination", "uftp4.dest", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce, { "ANNOUNCE", "uftp4.announce", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_func, { "Type", "uftp4.announce.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_announce_hlen, { "Header Length", "uftp4.announce.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags, { "Flags", "uftp4.announce.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags_sync, { "Sync mode", "uftp4.announce.flags.sync", FT_BOOLEAN, 8, NULL, FLAG_SYNC_MODE, NULL, HFILL } }, { &hf_uftp_announce_flags_syncpreview, { "Sync preview mode", "uftp4.announce.flags.syncpreview", FT_BOOLEAN, 8, NULL, FLAG_SYNC_PREVIEW, NULL, HFILL } }, { &hf_uftp_announce_flags_ipv6, { "IPv6", "uftp4.announce.flags.ipv6", FT_BOOLEAN, 8, NULL, FLAG_IPV6, NULL, HFILL } }, { &hf_uftp_announce_flags_reserved, { "Reserved", "uftp4.announce.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ANNOUNCE_RESERVED, NULL, HFILL } }, { &hf_uftp_announce_robust, { "Robustness Factor", "uftp4.announce.robust", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_cc_type, { "Congestion Control Type", "uftp4.announce.cc_type", FT_UINT8, BASE_DEC, VALS(cc_types), 0x0, NULL, HFILL } }, { &hf_uftp_announce_reserved, { "Reserved", "uftp4.announce.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_blocksize, { "Block Size", "uftp4.announce.blocksize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_tstamp, { "Timestamp", "uftp4.announce.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_publicmcast_ipv4, { "Public Multicast Address", "uftp4.announce.publicmcast.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_publicmcast_ipv6, { "Public Multicast Address", "uftp4.announce.publicmcast.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_privatemcast_ipv4, { "Private Multicast Address", "uftp4.announce.privatemcast.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_privatemcast_ipv6, { "Private Multicast Address", "uftp4.announce.privatemcast.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo, { "EXT_ENC_INFO", "uftp4.encinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_exttype, { "Extension Type", "uftp4.encinfo.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_extlen, { "Extension Length", "uftp4.encinfo.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_flags, { "Flags", "uftp4.encinfo.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_flags_client_auth, { "Client Authorization", "uftp4.encinfo.flags.client_auth", FT_BOOLEAN, 8, NULL, FLAG_CLIENT_AUTH, NULL, HFILL } }, { &hf_uftp_encinfo_flags_reserved, { "Reserved", "uftp4.encinfo.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ENCINFO_RESERVED, NULL, HFILL } }, { &hf_uftp_encinfo_keyextype, { "Key Exchange Type", "uftp4.encinfo.keyextype", FT_UINT8, BASE_DEC, VALS(keyexchange_types), 0xF0, NULL, HFILL } }, { &hf_uftp_encinfo_sigtype, { "Signature Type", "uftp4.encinfo.sigtype", FT_UINT8, BASE_DEC, VALS(signature_types), 0x0F, NULL, HFILL } }, { &hf_uftp_encinfo_keytype, { "Key Type", "uftp4.encinfo.keytype", FT_UINT8, BASE_DEC, VALS(key_types), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_hashtype, { "Hash Type", "uftp4.encinfo.hashtype", FT_UINT8, BASE_DEC, VALS(hash_types), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_keylen, { "Public Key Length", "uftp4.encinfo.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_dhlen, { "Diffie-Hellman Key Length", "uftp4.encinfo.dhlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_siglen, { "Signature Length", "uftp4.encinfo.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_rand1, { "Server Random Number", "uftp4.encinfo.rand1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_keyblob, { "Public Key Blob", "uftp4.encinfo.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_dhblob, { "Diffie-Hellman Key Blob", "uftp4.encinfo.dhblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_sig, { "Signature", "uftp4.encinfo.sig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_blobtype, { "Keyblob Type", "uftp4.rsablob.blobtype", FT_UINT8, BASE_DEC, VALS(keyblob_types), 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_reserved, { "Reserved", "uftp4.rsablob.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_modlen, { "Modulus Length", "uftp4.rsablob.modlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_exponent, { "Exponent", "uftp4.rsablob.exponent", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_modulus, { "Modulus", "uftp4.rsablob.modulus", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_blobtype, { "Keyblob Type", "uftp4.ecblob.blobtype", FT_UINT8, BASE_DEC, VALS(keyblob_types), 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_curve, { "Curve", "uftp4.ecblob.curve", FT_UINT8, BASE_DEC, VALS(curves), 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_keylen, { "Key Length", "uftp4.ecblob.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_key, { "Key", "uftp4.ecblob.key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register, { "REGISTER", "uftp4.register", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_func, { "Type", "uftp4.register.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_register_hlen, { "Header Length", "uftp4.register.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_keyinfo_len, { "Key Info Length", "uftp4.register.keyinfo_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_tstamp, { "Timestamp", "uftp4.register.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_rand2, { "Client Random Number", "uftp4.register.rand2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_keyinfo, { "Key Info", "uftp4.register.keyinfo", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey, { "CLIENT_KEY", "uftp4.clientkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_func, { "Type", "uftp4.clientkey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_hlen, { "Header Length", "uftp4.clientkey.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_reserved, { "Reserved", "uftp4.clientkey.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_bloblen, { "Keyblob Length", "uftp4.clientkey.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_siglen, { "Signature Length", "uftp4.clientkey.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_keyblob, { "Public Key Blob", "uftp4.clientkey.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_verify, { "Signature", "uftp4.clientkey.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf, { "REG_CONF", "uftp4.regconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_func, { "Type", "uftp4.regconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_regconf_hlen, { "Header Length", "uftp4.regconf.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_reserved, { "Reserved", "uftp4.regconf.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo, { "KEYINFO", "uftp4.keyinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_func, { "Type", "uftp4.keyinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_hlen, { "Header Length", "uftp4.keyinfo.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_reserved, { "Reserved", "uftp4.keyinfo.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_ivctr, { "IV Counter", "uftp4.keyinfo.ivctr", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destkey, { "Destination Key", "uftp4.keyinfo.destkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destid, { "Destination ID", "uftp4.keyinfo.destid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_groupmaster, { "Encrypted Group Master", "uftp4.keyinfo.groupmaster", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack, { "KEYINFO_ACK", "uftp4.keyinfoack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_func, { "Type", "uftp4.keyinfoack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_hlen, { "Header Length", "uftp4.keyinfoack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_reserved, { "Reserved", "uftp4.keyinfoack.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_verify_data, { "Verify Data", "uftp4.keyinfoack.verify_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo, { "FILEINFO", "uftp4.fileinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_func, { "Type", "uftp4.fileinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_hlen, { "Header Length", "uftp4.fileinfo.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_file_id, { "File ID", "uftp4.fileinfo.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftype, { "File Type", "uftp4.fileinfo.ftype", FT_UINT8, BASE_DEC, VALS(file_types), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_reserved, { "Reserved", "uftp4.fileinfo.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_namelen, { "Name Length", "uftp4.fileinfo.namelen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_linklen, { "Link Length", "uftp4.fileinfo.linklen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_fsize, { "File Size", "uftp4.fileinfo.fsize", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftstamp, { "File Timestamp", "uftp4.fileinfo.ftstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_tstamp, { "Timestamp", "uftp4.fileinfo.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_name, { "File Name", "uftp4.fileinfo.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_link, { "Link Name", "uftp4.fileinfo.link", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack, { "FILEINFO_ACK", "uftp4.fileinfoack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_func, { "Type", "uftp4.fileinfoack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_hlen, { "Header Length", "uftp4.fileinfoack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_file_id, { "File ID", "uftp4.fileinfoack.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags, { "Flags", "uftp4.fileinfoack.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags_partial, { "Partial", "uftp4.fileinfoack.flags.partial", FT_BOOLEAN, 8, NULL, FLAG_PARTIAL, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags_reserved, { "Reserved", "uftp4.fileinfoack.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_FILEINFOACK_RESERVED, NULL, HFILL } }, { &hf_uftp_fileinfoack_reserved, { "Reserved", "uftp4.fileinfoack.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_tstamp, { "Timestamp", "uftp4.fileinfoack.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg, { "FILESEG", "uftp4.fileseg", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_func, { "Type", "uftp4.fileseg.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_hlen, { "Header Length", "uftp4.fileseg.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_file_id, { "File ID", "uftp4.fileseg.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_section, { "Section", "uftp4.fileseg.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_sec_block, { "Block", "uftp4.fileseg.sec_block", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata, { "EXT_TFMCC_DATA_INFO", "uftp4.tfmccdata", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_exttype, { "Extension Type", "uftp4.tfmccdata.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_extlen, { "Extension Length", "uftp4.tfmccdata.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_send_rate, { "Send Rate", "uftp4.tfmccdata.send_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_cc_seq, { "CC Sequence Number", "uftp4.tfmccdata.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_cc_rate, { "Rate", "uftp4.tfmccdata.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_data, { "Data", "uftp4.fileseg.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done, { "DONE", "uftp4.done", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_func, { "Type", "uftp4.done.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_done_hlen, { "Header Length", "uftp4.done.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_file_id, { "File ID", "uftp4.done.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_section, { "Section", "uftp4.done.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_reserved, { "Reserved", "uftp4.done.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status, { "STATUS", "uftp4.status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_func, { "Type", "uftp4.status.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_status_hlen, { "Header Length", "uftp4.status.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_file_id, { "File ID", "uftp4.status.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_section, { "Section", "uftp4.status.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_reserved, { "Reserved", "uftp4.status.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_naks, { "NAKs", "uftp4.status.naks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete, { "COMPLETE", "uftp4.complete", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_func, { "Type", "uftp4.complete.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_complete_hlen, { "Header Length", "uftp4.complete.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_file_id, { "File ID", "uftp4.complete.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_status, { "Completion Status", "uftp4.complete.status", FT_UINT8, BASE_DEC, VALS(comp_status), 0x0, NULL, HFILL } }, { &hf_uftp_complete_reserved, { "Reserved", "uftp4.complete.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace, { "EXT_FREESPACE_INFO", "uftp4.freespace", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_exttype, { "Extension Type", "uftp4.freespace.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_freespace_extlen, { "Extension Length", "uftp4.freespace.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_reserved, { "Reserved", "uftp4.freespace.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_freespace, { "Free Space", "uftp4.freespace.freespace", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf, { "DONE_CONF", "uftp4.doneconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_func, { "Type", "uftp4.doneconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_hlen, { "Header Length", "uftp4.doneconf.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_reserved, { "Reserved", "uftp4.doneconf.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq, { "HB_REQ", "uftp4.hbreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_func, { "Type", "uftp4.hbreq.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_hlen, { "Header Length", "uftp4.hbreq.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_reserved, { "Reserved", "uftp4.hbreq.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_bloblen, { "Keyblob Length", "uftp4.hbreq.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_siglen, { "Signature Length", "uftp4.hbreq.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_nonce, { "Nonce", "uftp4.hbreq.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_keyblob, { "Public Key Blob", "uftp4.hbreq.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_verify, { "Signature", "uftp4.hbreq.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp, { "HB_RESP", "uftp4.hbresp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_func, { "Type", "uftp4.hbresp.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_hlen, { "Header Length", "uftp4.hbresp.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_authenticated, { "Authenticated", "uftp4.hbresp.authenticated", FT_UINT8, BASE_DEC, VALS(hb_auth_types), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_reserved, { "Reserved", "uftp4.hbresp.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_nonce, { "Nonce", "uftp4.hbresp.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyreq, { "KEY_REQ", "uftp4.keyreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyreq_func, { "Type", "uftp4.keyreq.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyreq_hlen, { "Header Length", "uftp4.keyreq.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyreq_reserved, { "Reserved", "uftp4.keyreq.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey, { "PROXY_KEY", "uftp4.proxykey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_func, { "Type", "uftp4.proxykey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_hlen, { "Header Length", "uftp4.proxykey.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_bloblen, { "Keyblob Length", "uftp4.proxykey.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_dhlen, { "Diffie-Hellman Keyblob Length", "uftp4.proxykey.dhlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_siglen, { "Signature Length", "uftp4.proxykey.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_nonce, { "Nonce", "uftp4.proxykey.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_keyblob, { "Public Key Blob", "uftp4.proxykey.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_dhblob, { "Diffie-Hellman Key Blob", "uftp4.proxykey.dhblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_verify, { "Signature", "uftp4.proxykey.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl, { "CONG_CTRL", "uftp4.congctrl", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_func, { "Type", "uftp4.congctrl.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_hlen, { "Header Length", "uftp4.congctrl.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_reserved, { "Reserved", "uftp4.congctrl.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cc_seq, { "CC Sequence", "uftp4.congctrl.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cc_rate, { "Rate", "uftp4.congctrl.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_tstamp, { "Timestamp", "uftp4.congctrl.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cclist, { "Congestion Control List", "uftp4.congctrl.cclist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item, { "Destination", "uftp4.congctrl.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_destid, { "Destination ID", "uftp4.congctrl.item.destid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags, { "Flags", "uftp4.congctrl.item.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_clr, { "CLR", "uftp4.congctrl.item.flags.clr", FT_BOOLEAN, 8, NULL, FLAG_CC_CLR, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_rtt, { "RTT", "uftp4.congctrl.item.flags.rtt", FT_BOOLEAN, 8, NULL, FLAG_CC_RTT, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_start, { "Slowstart", "uftp4.congctrl.item.flags.start", FT_BOOLEAN, 8, NULL, FLAG_CC_START, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_leave, { "Leave", "uftp4.congctrl.item.flags.leave", FT_BOOLEAN, 8, NULL, FLAG_CC_LEAVE, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_reserved, { "Reserved", "uftp4.congctrl.item.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_CC_RESERVED, NULL, HFILL } }, { &hf_uftp_congctrl_item_rtt, { "Round Trip Time", "uftp4.congctrl.item.rtt", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_rate, { "Rate", "uftp4.congctrl.item.rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack, { "CC_ACK", "uftp4.ccack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack_func, { "Type", "uftp4.ccack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_ccack_hlen, { "Header Length", "uftp4.ccack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack_reserved, { "Reserved", "uftp4.ccack.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack, { "EXT_TFMCC_ACK_INFO", "uftp4.tfmccack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_exttype, { "Extension Type", "uftp4.tfmccack.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_extlen, { "Extension Length", "uftp4.tfmccack.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_flags, { "Flags", "uftp4.tfmccack.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_clr, { "CLR", "uftp4.tfmccack.flags.clr", FT_BOOLEAN, 8, NULL, FLAG_CC_CLR, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_rtt, { "RTT", "uftp4.tfmccack.flags.rtt", FT_BOOLEAN, 8, NULL, FLAG_CC_RTT, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_start, { "Slowstart", "uftp4.tfmccack.flags.start", FT_BOOLEAN, 8, NULL, FLAG_CC_START, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_leave, { "Leave", "uftp4.tfmccack.flags.leave", FT_BOOLEAN, 8, NULL, FLAG_CC_LEAVE, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_reserved, { "Reserved", "uftp4.tfmccack.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_CC_RESERVED, NULL, HFILL } }, { &hf_uftp_tfmccack_reserved, { "Reserved", "uftp4.tfmccack.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_cc_seq, { "CC Sequence Number", "uftp4.tfmccack.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_cc_rate, { "Rate", "uftp4.tfmccack.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_client_id, { "Client ID", "uftp4.tfmccack.client_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_tstamp, { "Timestamp", "uftp4.tfmccack.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted, { "ENCRYPTED", "uftp4.encrypted", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_ivctr, { "IV Counter", "uftp4.encrypted.ivctr", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_sig_len, { "Signature Length", "uftp4.encrypted.sig_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload_len, { "Payload Length", "uftp4.encrypted.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_signature, { "Signature", "uftp4.encrypted.signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload, { "Encrypted Payload", "uftp4.encrypted.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort, { "ABORT", "uftp4.abort", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_func, { "Type", "uftp4.abort.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_abort_hlen, { "Header Length", "uftp4.abort.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags, { "Flags", "uftp4.abort.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags_curfile, { "Current file", "uftp4.abort.flags.curfile", FT_BOOLEAN, 8, NULL, FLAG_CURRENT_FILE, NULL, HFILL } }, { &hf_uftp_abort_flags_reserved, { "Reserved", "uftp4.abort.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ABORT_RESERVED, NULL, HFILL } }, { &hf_uftp_abort_reserved, { "Reserved", "uftp4.abort.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_clientid, { "Client ID", "uftp4.abort.clientid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_message, { "Message", "uftp4.abort.message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_uftp, &ett_uftp_announce, &ett_uftp_encinfo, &ett_uftp_register, &ett_uftp_clientkey, &ett_uftp_regconf, &ett_uftp_keyinfo, &ett_uftp_keyinfo_destkey, &ett_uftp_keyinfoack, &ett_uftp_fileinfo, &ett_uftp_fileinfoack, &ett_uftp_fileseg, &ett_uftp_tfmccdata, &ett_uftp_done, &ett_uftp_status, &ett_uftp_complete, &ett_uftp_freespace, &ett_uftp_doneconf, &ett_uftp_hbreq, &ett_uftp_hbresp, &ett_uftp_keyreq, &ett_uftp_proxykey, &ett_uftp_congctrl, &ett_uftp_congctrl_cclist, &ett_uftp_congctrl_item, &ett_uftp_ccack, &ett_uftp_tfmccack, &ett_uftp_encrypted, &ett_uftp_abort, &ett_uftp_announce_flags, &ett_uftp_encinfo_flags, &ett_uftp_fileinfoack_flags, &ett_uftp_abort_flags, &ett_uftp_congctrl_item_flags, &ett_uftp_tfmccack_flags, &ett_uftp_destlist, &ett_uftp_rsablob, &ett_uftp_ecblob }; static ei_register_info ei[] = { { &ei_uftp_length_invalid, { "uftp4.length.invalid", PI_MALFORMED, PI_ERROR, "Length is invalid", EXPFILL }}, { &ei_uftp_func_unknown, { "uftp4.func.invalid", PI_MALFORMED, PI_ERROR, "Unknown function", EXPFILL }} }; expert_module_t* expert_uftp; proto_uftp = proto_register_protocol("UDP based FTP w/ multicast V4", "UFTP4", "uftp4"); proto_register_field_array(proto_uftp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("uftp4", dissect_uftp, proto_uftp); expert_uftp = expert_register_protocol(proto_uftp); expert_register_field_array(expert_uftp, ei, array_length(ei)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-uftp5.c
/* packet-uftp5.c * Routines for UFTP version 5 packet dissection * Copyright Dennis Bush <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <math.h> #define UFTP_VER_NUM 0x50 #define ANNOUNCE 1 #define REGISTER 2 #define CLIENT_KEY 3 #define REG_CONF 4 #define KEYINFO 5 #define KEYINFO_ACK 6 #define FILEINFO 7 #define FILEINFO_ACK 8 #define FILESEG 9 #define DONE 10 #define STATUS 11 #define COMPLETE 12 #define DONE_CONF 13 #define HB_REQ 14 #define HB_RESP 15 // obsolete: 16 #define KEY_REQ 16 #define PROXY_KEY 17 #define ENCRYPTED 18 #define ABORT 19 #define CONG_CTRL 20 #define CC_ACK 21 #define FTYPE_REG 0 #define FTYPE_DIR 1 #define FTYPE_LINK 2 #define FTYPE_DELETE 3 #define FTYPE_FREESPACE 4 #define KEY_NONE 0 // obsolete: 1-4 #define KEY_DES 1 #define KEY_DES_EDE3 2 #define KEY_AES128_CBC 3 #define KEY_AES256_CBC 4 #define KEY_AES128_GCM 5 #define KEY_AES256_GCM 6 #define KEY_AES128_CCM 7 #define KEY_AES256_CCM 8 #define HASH_NONE 0 // obsolete: 1-2 #define HASH_MD5 1 #define HASH_SHA1 2 #define HASH_SHA256 3 #define HASH_SHA384 4 #define HASH_SHA512 5 #define KEYBLOB_RSA 1 #define KEYBLOB_EC 2 // obsolete: 1-22 #define CURVE_sect163k1 1 #define CURVE_sect163r1 2 #define CURVE_sect163r2 3 #define CURVE_sect193r1 4 #define CURVE_sect193r2 5 #define CURVE_sect233k1 6 #define CURVE_sect233r1 7 #define CURVE_sect239k1 8 #define CURVE_sect283k1 9 #define CURVE_sect283r1 10 #define CURVE_sect409k1 11 #define CURVE_sect409r1 12 #define CURVE_sect571k1 13 #define CURVE_sect571r1 14 #define CURVE_secp160k1 15 #define CURVE_secp160r1 16 #define CURVE_secp160r2 17 #define CURVE_secp192k1 18 #define CURVE_secp192r1 19 #define CURVE_secp224k1 20 #define CURVE_secp224r1 21 #define CURVE_secp256k1 22 #define CURVE_secp256r1 23 #define CURVE_secp384r1 24 #define CURVE_secp521r1 25 #define CURVE_prime192v1 CURVE_secp192r1 #define CURVE_prime256v1 CURVE_secp256r1 #define CC_NONE 0 #define CC_UFTP3 1 #define CC_TFMCC 2 #define CC_PGMCC 3 #define EXT_ENC_INFO 1 #define EXT_TFMCC_DATA_INFO 2 #define EXT_TFMCC_ACK_INFO 3 #define EXT_PGMCC_DATA_INFO 4 #define EXT_PGMCC_NAK_INFO 5 #define EXT_PGMCC_ACK_INFO 6 #define EXT_FREESPACE_INFO 7 #define FLAG_SYNC_MODE 0x01 #define FLAG_SYNC_PREVIEW 0x02 #define FLAG_IPV6 0x04 #define FLAG_ANNOUNCE_RESERVED 0xF8 #define FLAG_CLIENT_AUTH 0x01 #define FLAG_ENCINFO_RESERVED 0xFE #define FLAG_PARTIAL 0x01 #define FLAG_FILEINFOACK_RESERVED 0xFE #define FLAG_CURRENT_FILE 0x01 #define FLAG_ABORT_RESERVED 0xFE #define FLAG_CC_CLR 0x01 #define FLAG_CC_RTT 0x02 #define FLAG_CC_START 0x04 #define FLAG_CC_LEAVE 0x08 #define FLAG_CC_RESERVED 0xF0 #define COMP_STAT_NORMAL 0 #define COMP_STAT_SKIPPED 1 #define COMP_STAT_OVERWRITE 2 #define COMP_STAT_REJECTED 3 #define HB_AUTH_FAILED 0 #define HB_AUTH_OK 1 #define HB_AUTH_CHALLENGE 2 #define MAXFILENAME 100 #define MAXDIRNAME 200 #define MAXPATHNAME 300 #define MAXBACKUPPATHNAME 600 #define MAXPROXYDEST 1000 #define MAXDIR 10 #define MAXSECTION 65536 #define DESTNAME_LEN 80 #define IFNAME_LEN 25 #define MAX_INTERFACES 100 #define IPSTR_LEN 16 #define PUBKEY_LEN 392 // big enough for a keyblob with RSA-3072 #define RAND_LEN 32 // RFC 8446/5246 #define HMAC_LEN 64 // big enough for SHA-512 #define HASH_LEN 64 // big enough for SHA-512 #define VERIFY4_LEN 12 // RFC 5246 #define MASTER4_LEN 48 // RFC 5246 #define MASTER_LEN 32 // based on SHA-256 length #define ENC_MASTER_LEN 48 // based on SHA-256 length + tag length #define MAXIV 16 // big enough for AES256 #define MAXKEY 32 // big enough for AES256 #define KEYBLSIZE 16 // Maximum symmetric key blocksize #define DEF_RSA_LEN 1024 // Default length of generated RSA keys #define RSA_MIN 1024 // Minimum RSA key length #define RSA_MAX 3072 // Maximum RSA key length #define DEF_CURVE CURVE_prime256v1 // Default EC curve #define RSA_EXP 65537 // Public key exponent of generated RSA keys #define SALT_LEN 4 // Length of salt for IV #define GCM_IV_LEN 12 // Length of IV for ciphers in GCM mode #define CCM_IV_LEN 12 // Length of IV for ciphers in CCM mode #define GCM_TAG_LEN 16 // Length of tag for ciphers in GCM mode #define CCM_TAG_LEN 16 // Length of tag for ciphers in CCM mode #define UFTP_LEN 16 #define ANNOUNCE_LEN 16 #define ENC_INFO_LEN 44 #define REGISTER_LEN 44 #define CLIENT_KEY_LEN 8 #define REG_CONF_LEN 4 #define KEYINFO_LEN 12 #define DESTKEY_LEN 52 #define KEYINFO_ACK_LEN 4 #define FILEINFO_LEN 28 #define FILEINFO_ACK_LEN 16 #define FILESEG_LEN 8 #define TFMCC_DATA_LEN 8 #define DONE_LEN 8 #define STATUS_LEN 8 #define COMPLETE_LEN 8 #define FREESPACE_LEN 12 #define DONE_CONF_LEN 4 #define HB_REQ_LEN 12 #define HB_RESP_LEN 8 #define PROXY_KEY_LEN 8 #define ENCRYPTED_LEN 12 #define ABORT_LEN 308 #define CONG_CTRL_LEN 16 #define CC_ITEM_LEN 8 #define CC_ACK_LEN 4 #define TFMCC_ACK_LEN 20 #define RSA_BLOB_LEN 8 #define EC_BLOB_LEN 4 void proto_register_uftp5(void); static int proto_uftp = -1; /* main header and common fields */ static int hf_uftp_version = -1; static int hf_uftp_func = -1; static int hf_uftp_seq = -1; static int hf_uftp_src_id = -1; static int hf_uftp_group_id = -1; static int hf_uftp_group_inst = -1; static int hf_uftp_grtt = -1; static int hf_uftp_gsize = -1; static int hf_uftp_reserved = -1; static int hf_uftp_destlist = -1; static int hf_uftp_dest = -1; /* ANNOUNCE fields */ static int hf_uftp_announce = -1; static int hf_uftp_announce_func = -1; static int hf_uftp_announce_hlen = -1; static int hf_uftp_announce_flags = -1; static int hf_uftp_announce_flags_sync = -1; static int hf_uftp_announce_flags_syncpreview = -1; static int hf_uftp_announce_flags_ipv6 = -1; static int hf_uftp_announce_flags_reserved = -1; static int hf_uftp_announce_robust = -1; static int hf_uftp_announce_cc_type = -1; static int hf_uftp_announce_reserved = -1; static int hf_uftp_announce_blocksize = -1; static int hf_uftp_announce_tstamp = -1; static int hf_uftp_announce_publicmcast_ipv4 = -1; static int hf_uftp_announce_publicmcast_ipv6 = -1; static int hf_uftp_announce_privatemcast_ipv4 = -1; static int hf_uftp_announce_privatemcast_ipv6 = -1; /* EXT_ENC_INFO fields */ static int hf_uftp_encinfo = -1; static int hf_uftp_encinfo_exttype = -1; static int hf_uftp_encinfo_extlen = -1; static int hf_uftp_encinfo_flags = -1; static int hf_uftp_encinfo_flags_client_auth = -1; static int hf_uftp_encinfo_flags_reserved = -1; static int hf_uftp_encinfo_reserved = -1; static int hf_uftp_encinfo_keytype = -1; static int hf_uftp_encinfo_hashtype = -1; static int hf_uftp_encinfo_keylen = -1; static int hf_uftp_encinfo_dhlen = -1; static int hf_uftp_encinfo_siglen = -1; static int hf_uftp_encinfo_rand1 = -1; static int hf_uftp_encinfo_keyblob = -1; static int hf_uftp_encinfo_dhblob = -1; static int hf_uftp_encinfo_sig = -1; /* rsa_blob_t fields */ static int hf_uftp_rsablob_blobtype = -1; static int hf_uftp_rsablob_reserved = -1; static int hf_uftp_rsablob_modlen = -1; static int hf_uftp_rsablob_exponent = -1; static int hf_uftp_rsablob_modulus = -1; /* ec_blob_t fields */ static int hf_uftp_ecblob_blobtype = -1; static int hf_uftp_ecblob_curve = -1; static int hf_uftp_ecblob_keylen = -1; static int hf_uftp_ecblob_key = -1; /* REGISTER fields */ static int hf_uftp_register = -1; static int hf_uftp_register_func = -1; static int hf_uftp_register_hlen = -1; static int hf_uftp_register_dhlen = -1; static int hf_uftp_register_tstamp = -1; static int hf_uftp_register_rand2 = -1; static int hf_uftp_register_dhkey = -1; /* CLIENT_KEY fields */ static int hf_uftp_clientkey = -1; static int hf_uftp_clientkey_func = -1; static int hf_uftp_clientkey_hlen = -1; static int hf_uftp_clientkey_reserved = -1; static int hf_uftp_clientkey_bloblen = -1; static int hf_uftp_clientkey_siglen = -1; static int hf_uftp_clientkey_keyblob = -1; static int hf_uftp_clientkey_verify = -1; /* REG_CONF fields */ static int hf_uftp_regconf = -1; static int hf_uftp_regconf_func = -1; static int hf_uftp_regconf_hlen = -1; static int hf_uftp_regconf_reserved = -1; /* KEYINFO fields */ static int hf_uftp_keyinfo = -1; static int hf_uftp_keyinfo_func = -1; static int hf_uftp_keyinfo_hlen = -1; static int hf_uftp_keyinfo_siglen = -1; static int hf_uftp_keyinfo_ivctr = -1; static int hf_uftp_keyinfo_sig = -1; static int hf_uftp_keyinfo_destkey = -1; static int hf_uftp_keyinfo_destid = -1; static int hf_uftp_keyinfo_groupmaster = -1; /* KEYINFO_ACK fields */ static int hf_uftp_keyinfoack = -1; static int hf_uftp_keyinfoack_func = -1; static int hf_uftp_keyinfoack_hlen = -1; static int hf_uftp_keyinfoack_verify_len = -1; static int hf_uftp_keyinfoack_verify_data = -1; /* FILEINFO fields */ static int hf_uftp_fileinfo = -1; static int hf_uftp_fileinfo_func = -1; static int hf_uftp_fileinfo_hlen = -1; static int hf_uftp_fileinfo_file_id = -1; static int hf_uftp_fileinfo_ftype = -1; static int hf_uftp_fileinfo_reserved = -1; static int hf_uftp_fileinfo_ftstamp_hi = -1; static int hf_uftp_fileinfo_namelen = -1; static int hf_uftp_fileinfo_linklen = -1; static int hf_uftp_fileinfo_fsize = -1; static int hf_uftp_fileinfo_ftstamp = -1; static int hf_uftp_fileinfo_tstamp = -1; static int hf_uftp_fileinfo_name = -1; static int hf_uftp_fileinfo_link = -1; /* FILEINFO_ACK fields */ static int hf_uftp_fileinfoack = -1; static int hf_uftp_fileinfoack_func = -1; static int hf_uftp_fileinfoack_hlen = -1; static int hf_uftp_fileinfoack_file_id = -1; static int hf_uftp_fileinfoack_flags = -1; static int hf_uftp_fileinfoack_flags_partial = -1; static int hf_uftp_fileinfoack_flags_reserved = -1; static int hf_uftp_fileinfoack_reserved = -1; static int hf_uftp_fileinfoack_tstamp = -1; /* FILESEG fields */ static int hf_uftp_fileseg = -1; static int hf_uftp_fileseg_func = -1; static int hf_uftp_fileseg_hlen = -1; static int hf_uftp_fileseg_file_id = -1; static int hf_uftp_fileseg_section = -1; static int hf_uftp_fileseg_sec_block = -1; static int hf_uftp_fileseg_data = -1; /* EXT_TFMCC_DATA_INFO fields */ static int hf_uftp_tfmccdata = -1; static int hf_uftp_tfmccdata_exttype = -1; static int hf_uftp_tfmccdata_extlen = -1; static int hf_uftp_tfmccdata_send_rate = -1; static int hf_uftp_tfmccdata_cc_seq = -1; static int hf_uftp_tfmccdata_cc_rate = -1; /* DONE fields */ static int hf_uftp_done = -1; static int hf_uftp_done_func = -1; static int hf_uftp_done_hlen = -1; static int hf_uftp_done_file_id = -1; static int hf_uftp_done_section = -1; static int hf_uftp_done_reserved = -1; /* STATUS fields */ static int hf_uftp_status = -1; static int hf_uftp_status_func = -1; static int hf_uftp_status_hlen = -1; static int hf_uftp_status_file_id = -1; static int hf_uftp_status_section = -1; static int hf_uftp_status_reserved = -1; static int hf_uftp_status_naks = -1; /* COMPLETE fields */ static int hf_uftp_complete = -1; static int hf_uftp_complete_func = -1; static int hf_uftp_complete_hlen = -1; static int hf_uftp_complete_file_id = -1; static int hf_uftp_complete_status = -1; static int hf_uftp_complete_reserved = -1; /* EXT_FREESPACE_INFO fields */ static int hf_uftp_freespace = -1; static int hf_uftp_freespace_exttype = -1; static int hf_uftp_freespace_extlen = -1; static int hf_uftp_freespace_reserved = -1; static int hf_uftp_freespace_freespace = -1; /* DONE_CONF fields */ static int hf_uftp_doneconf = -1; static int hf_uftp_doneconf_func = -1; static int hf_uftp_doneconf_hlen = -1; static int hf_uftp_doneconf_reserved = -1; /* HB_REQ fields */ static int hf_uftp_hbreq = -1; static int hf_uftp_hbreq_func = -1; static int hf_uftp_hbreq_hlen = -1; static int hf_uftp_hbreq_reserved = -1; static int hf_uftp_hbreq_bloblen = -1; static int hf_uftp_hbreq_siglen = -1; static int hf_uftp_hbreq_nonce = -1; static int hf_uftp_hbreq_keyblob = -1; static int hf_uftp_hbreq_verify = -1; /* HB_RESP fields */ static int hf_uftp_hbresp = -1; static int hf_uftp_hbresp_func = -1; static int hf_uftp_hbresp_hlen = -1; static int hf_uftp_hbresp_authenticated = -1; static int hf_uftp_hbresp_reserved = -1; static int hf_uftp_hbresp_nonce = -1; /* PROXY_KEY fields */ static int hf_uftp_proxykey = -1; static int hf_uftp_proxykey_func = -1; static int hf_uftp_proxykey_hlen = -1; static int hf_uftp_proxykey_bloblen = -1; static int hf_uftp_proxykey_dhlen = -1; static int hf_uftp_proxykey_siglen = -1; static int hf_uftp_proxykey_keyblob = -1; static int hf_uftp_proxykey_dhblob = -1; static int hf_uftp_proxykey_sig = -1; /* CONG_CTRL fields */ static int hf_uftp_congctrl = -1; static int hf_uftp_congctrl_func = -1; static int hf_uftp_congctrl_hlen = -1; static int hf_uftp_congctrl_reserved = -1; static int hf_uftp_congctrl_cc_seq = -1; static int hf_uftp_congctrl_cc_rate = -1; static int hf_uftp_congctrl_tstamp = -1; static int hf_uftp_congctrl_cclist = -1; static int hf_uftp_congctrl_item = -1; static int hf_uftp_congctrl_item_destid = -1; static int hf_uftp_congctrl_item_flags = -1; static int hf_uftp_congctrl_item_flags_clr = -1; static int hf_uftp_congctrl_item_flags_rtt = -1; static int hf_uftp_congctrl_item_flags_start = -1; static int hf_uftp_congctrl_item_flags_leave = -1; static int hf_uftp_congctrl_item_flags_reserved = -1; static int hf_uftp_congctrl_item_rtt = -1; static int hf_uftp_congctrl_item_rate = -1; /* CC_ACK fields */ static int hf_uftp_ccack = -1; static int hf_uftp_ccack_func = -1; static int hf_uftp_ccack_hlen = -1; static int hf_uftp_ccack_reserved = -1; /* EXT_TFMCC_ACK_INFO fields */ static int hf_uftp_tfmccack = -1; static int hf_uftp_tfmccack_exttype = -1; static int hf_uftp_tfmccack_extlen = -1; static int hf_uftp_tfmccack_flags = -1; static int hf_uftp_tfmccack_flags_clr = -1; static int hf_uftp_tfmccack_flags_rtt = -1; static int hf_uftp_tfmccack_flags_start = -1; static int hf_uftp_tfmccack_flags_leave = -1; static int hf_uftp_tfmccack_flags_reserved = -1; static int hf_uftp_tfmccack_reserved = -1; static int hf_uftp_tfmccack_cc_seq = -1; static int hf_uftp_tfmccack_cc_rate = -1; static int hf_uftp_tfmccack_client_id = -1; static int hf_uftp_tfmccack_tstamp = -1; /* ENCRYPTED fields */ static int hf_uftp_encrypted = -1; static int hf_uftp_encrypted_ivctr = -1; static int hf_uftp_encrypted_reserved = -1; static int hf_uftp_encrypted_payload_len = -1; static int hf_uftp_encrypted_payload = -1; /* ABORT fields */ static int hf_uftp_abort = -1; static int hf_uftp_abort_func = -1; static int hf_uftp_abort_hlen = -1; static int hf_uftp_abort_flags = -1; static int hf_uftp_abort_flags_curfile = -1; static int hf_uftp_abort_flags_reserved = -1; static int hf_uftp_abort_reserved = -1; static int hf_uftp_abort_clientid = -1; static int hf_uftp_abort_message = -1; static gint ett_uftp = -1; static gint ett_uftp_announce = -1; static gint ett_uftp_register = -1; static gint ett_uftp_clientkey = -1; static gint ett_uftp_regconf = -1; static gint ett_uftp_keyinfo = -1; static gint ett_uftp_keyinfoack = -1; static gint ett_uftp_fileinfo = -1; static gint ett_uftp_fileinfoack = -1; static gint ett_uftp_fileseg = -1; static gint ett_uftp_done = -1; static gint ett_uftp_status = -1; static gint ett_uftp_complete = -1; static gint ett_uftp_doneconf = -1; static gint ett_uftp_hbreq = -1; static gint ett_uftp_hbresp = -1; static gint ett_uftp_proxykey = -1; static gint ett_uftp_congctrl = -1; static gint ett_uftp_ccack = -1; static gint ett_uftp_encrypted = -1; static gint ett_uftp_abort = -1; static gint ett_uftp_announce_flags = -1; static gint ett_uftp_encinfo = -1; static gint ett_uftp_encinfo_flags = -1; static gint ett_uftp_keyinfo_destkey = -1; static gint ett_uftp_fileinfoack_flags = -1; static gint ett_uftp_congctrl_cclist = -1; static gint ett_uftp_congctrl_item = -1; static gint ett_uftp_congctrl_item_flags = -1; static gint ett_uftp_tfmccdata = -1; static gint ett_uftp_tfmccack = -1; static gint ett_uftp_tfmccack_flags = -1; static gint ett_uftp_freespace = -1; static gint ett_uftp_abort_flags = -1; static gint ett_uftp_destlist = -1; static gint ett_uftp_rsablob = -1; static gint ett_uftp_ecblob = -1; static expert_field ei_uftp_length_invalid = EI_INIT; static expert_field ei_uftp_func_unknown = EI_INIT; static const value_string messages[] = { { ANNOUNCE, "ANNOUNCE" }, { REGISTER, "REGISTER" }, { CLIENT_KEY, "CLIENT_KEY" }, { REG_CONF, "REG_CONF" }, { KEYINFO, "KEYINFO" }, { KEYINFO_ACK, "KEYINFO_ACK" }, { FILEINFO, "FILEINFO" }, { FILEINFO_ACK, "FILEINFO_ACK" }, { FILESEG, "FILESEG" }, { DONE, "DONE" }, { STATUS, "STATUS" }, { COMPLETE, "COMPLETE" }, { DONE_CONF, "DONE_CONF" }, { HB_REQ, "HB_REQ" }, { HB_RESP, "HB_RESP" }, { KEY_REQ, "KEY_REQ (obsolete)" }, { PROXY_KEY, "PROXY_KEY" }, { ENCRYPTED, "ENCRYPTED" }, { ABORT, "ABORT" }, { CONG_CTRL, "CONG_CTRL" }, { CC_ACK, "CC_ACK" }, { 0, NULL } }; static const value_string extensions[] = { { EXT_ENC_INFO, "EXT_ENC_INFO" }, { EXT_TFMCC_DATA_INFO, "EXT_TFMCC_DATA_INFO" }, { EXT_TFMCC_ACK_INFO, "EXT_TFMCC_ACK_INFO" }, { EXT_PGMCC_DATA_INFO, "EXT_PGMCC_DATA_INFO" }, { EXT_PGMCC_NAK_INFO, "EXT_PGMCC_NAK_INFO" }, { EXT_PGMCC_ACK_INFO, "EXT_PGMCC_ACK_INFO" }, { EXT_FREESPACE_INFO, "EXT_FREESPACE_INFO" }, { 0, NULL } }; static const value_string cc_types[] = { { CC_NONE, "NONE" }, { CC_UFTP3, "UFTP3 (obsolete)" }, { CC_TFMCC, "TFMCC" }, { CC_PGMCC, "PGMCC" }, { 0, NULL } }; static const value_string keyblob_types[] = { { KEYBLOB_RSA, "RSA" }, { KEYBLOB_EC, "EC" }, { 0, NULL } }; static const value_string curves[] = { { CURVE_sect163k1, "sect163k1 (obsolete)" }, { CURVE_sect163r1, "sect163r1 (obsolete)" }, { CURVE_sect163r2, "sect163r2 (obsolete)" }, { CURVE_sect193r1, "sect193r1 (obsolete)" }, { CURVE_sect193r2, "sect193r2 (obsolete)" }, { CURVE_sect233k1, "sect233k1 (obsolete)" }, { CURVE_sect233r1, "sect233r1 (obsolete)" }, { CURVE_sect239k1, "sect239k1 (obsolete)" }, { CURVE_sect283k1, "sect283k1 (obsolete)" }, { CURVE_sect283r1, "sect283r1 (obsolete)" }, { CURVE_sect409k1, "sect409k1 (obsolete)" }, { CURVE_sect409r1, "sect409r1 (obsolete)" }, { CURVE_sect571k1, "sect571k1 (obsolete)" }, { CURVE_sect571r1, "sect571r1 (obsolete)" }, { CURVE_secp160k1, "secp160k1 (obsolete)" }, { CURVE_secp160r1, "secp160r1 (obsolete)" }, { CURVE_secp160r2, "secp160r2 (obsolete)" }, { CURVE_secp192k1, "secp192k1 (obsolete)" }, { CURVE_secp192r1, "prime192v1 (obsolete)" }, { CURVE_secp224k1, "secp224k1 (obsolete)" }, { CURVE_secp224r1, "secp224r1 (obsolete)" }, { CURVE_secp256k1, "secp256k1 (obsolete)" }, { CURVE_secp256r1, "prime256v1" }, { CURVE_secp384r1, "secp384r1" }, { CURVE_secp521r1, "secp521r1" }, { 0, NULL } }; static const value_string hash_types[] = { { HASH_NONE, "NONE" }, { HASH_MD5, "MD5 (obsolete)" }, { HASH_SHA1, "SHA-1 (obsolete)" }, { HASH_SHA256, "SHA-256" }, { HASH_SHA384, "SHA-384" }, { HASH_SHA512, "SHA-512" }, { 0, NULL } }; static const value_string key_types[] = { { KEY_NONE, "NONE" }, { KEY_DES, "DES (obsolete)" }, { KEY_DES_EDE3, "3 Key Triple DES (obsolete)" }, { KEY_AES128_CBC, "AES-128-CBC (obsolete)" }, { KEY_AES256_CBC, "AES-256-CBC (obsolete)" }, { KEY_AES128_GCM, "AES-128-GCM" }, { KEY_AES256_GCM, "AES-256-GCM" }, { KEY_AES128_CCM, "AES-128-CCM" }, { KEY_AES256_CCM, "AES-256-CCM" }, { 0, NULL } }; static const value_string hb_auth_types[] = { { HB_AUTH_FAILED, "Authorization Failed" }, { HB_AUTH_OK, "Authorization Succeeded" }, { HB_AUTH_CHALLENGE, "Authorization Required" }, { 0, NULL } }; static const value_string file_types[] = { { FTYPE_REG, "Regular file" }, { FTYPE_DIR, "Directory" }, { FTYPE_LINK, "Symbolic link" }, { FTYPE_DELETE, "Delete request" }, { FTYPE_FREESPACE, "Free space request" }, { 0, NULL } }; static int * const announce_flags[] = { &hf_uftp_announce_flags_sync, &hf_uftp_announce_flags_syncpreview, &hf_uftp_announce_flags_ipv6, &hf_uftp_announce_flags_reserved, NULL }; static int * const encinfo_flags[] = { &hf_uftp_encinfo_flags_client_auth, &hf_uftp_encinfo_flags_reserved, NULL }; static int * const fileinfoack_flags[] = { &hf_uftp_fileinfoack_flags_partial, &hf_uftp_fileinfoack_flags_reserved, NULL }; static int * const abort_flags[] = { &hf_uftp_abort_flags_curfile, &hf_uftp_abort_flags_reserved, NULL }; static int * const cc_item_flags[] = { &hf_uftp_congctrl_item_flags_clr, &hf_uftp_congctrl_item_flags_rtt, &hf_uftp_congctrl_item_flags_start, &hf_uftp_congctrl_item_flags_leave, &hf_uftp_congctrl_item_flags_reserved, NULL }; static int * const tfmcc_ack_flags[] = { &hf_uftp_tfmccack_flags_clr, &hf_uftp_tfmccack_flags_rtt, &hf_uftp_tfmccack_flags_start, &hf_uftp_tfmccack_flags_leave, &hf_uftp_tfmccack_flags_reserved, NULL }; static const value_string comp_status[] = { { COMP_STAT_NORMAL, "Normal" }, { COMP_STAT_SKIPPED, "Skipped" }, { COMP_STAT_OVERWRITE, "Overwrite" }, { COMP_STAT_REJECTED, "Rejected" }, { 0, NULL } }; #define RTT_MIN 1.0e-6 #define RTT_MAX 1000.0 static double unquantize_grtt(guint8 rtt) { return ((rtt <= 31) ? (((double)(rtt + 1)) * (double)RTT_MIN) : (RTT_MAX / exp(((double)(255 - rtt)) / (double)13.0))); } static guint unquantize_gsize(guint8 size) { gint E, i; double rval; E = size & 0x7; rval = (size >> 3) * (10.0 / 32.0); for (i = 0; i < E; i++) { rval *= 10; } return (guint)(rval + 0.5); } static guint unquantize_rate(guint16 rate) { gint E, i; double rval; E = rate & 0xF; rval = (rate >> 4) * (10.0 / 4096.0); for (i = 0; i < E; i++) { rval *= 10; } return (guint)rval; } static nstime_t usec_to_nstime(guint64 t) { nstime_t result; result.secs = t / 1000000; result.nsecs = (t % 1000000) * 1000; return result; } static int dissect_uftp_rsablob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int tree_hf) { proto_item *ti = NULL; proto_tree *rsablob_tree = NULL; gint offset = 0, modlen; if (tvb_reported_length(tvb) < RSA_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } modlen = (gint)tvb_get_ntohs(tvb, 2); if ((gint)tvb_reported_length(tvb) < modlen + RSA_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d", tvb_reported_length(tvb)); return 0; } ti = proto_tree_add_item(tree, tree_hf, tvb, offset, RSA_BLOB_LEN + modlen, ENC_NA); rsablob_tree = proto_item_add_subtree(ti, ett_uftp_rsablob); proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_blobtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_modlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_exponent, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(rsablob_tree, hf_uftp_rsablob_modulus, tvb, offset, modlen, ENC_NA); return RSA_BLOB_LEN + modlen; } static int dissect_uftp_ecblob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int tree_hf) { proto_item *ti = NULL; proto_tree *ecblob_tree = NULL; gint offset = 0, keylen; if (tvb_reported_length(tvb) < EC_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } keylen = (gint)tvb_get_ntohs(tvb, 2); if ((gint)tvb_reported_length(tvb) < keylen + EC_BLOB_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d", tvb_reported_length(tvb)); return 0; } ti = proto_tree_add_item(tree, tree_hf, tvb, offset, EC_BLOB_LEN + keylen, ENC_NA); ecblob_tree = proto_item_add_subtree(ti, ett_uftp_ecblob); proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_blobtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_curve, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(ecblob_tree, hf_uftp_ecblob_key, tvb, offset, keylen, ENC_NA); return EC_BLOB_LEN + keylen; } static gint dissect_uftp_encinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *encinfo_tree = NULL; gint offset = 0, hlen, keylen, dhlen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < ENC_INFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = (gint)tvb_get_ntohs(tvb, 6); dhlen = (gint)tvb_get_ntohs(tvb, 8); siglen = (gint)tvb_get_ntohs(tvb, 10); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < ENC_INFO_LEN + keylen + dhlen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, " "keylen = %d, dhlen = %d, siglen = %d", tvb_reported_length(tvb), hlen, keylen, dhlen, siglen); return 0; } ti = proto_tree_add_item(tree, hf_uftp_encinfo, tvb, offset, ENC_INFO_LEN + keylen + dhlen + siglen, ENC_NA); encinfo_tree = proto_item_add_subtree(ti, ett_uftp_encinfo); proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(encinfo_tree, hf_uftp_encinfo_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(encinfo_tree, tvb, offset, hf_uftp_encinfo_flags, ett_uftp_encinfo_flags, encinfo_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_keytype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_hashtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_keylen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_dhlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_rand1, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_keyblob); break; } offset += parsed; } if (dhlen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, dhlen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_dhblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, encinfo_tree, hf_uftp_encinfo_dhblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(encinfo_tree, hf_uftp_encinfo_sig, tvb, offset, siglen, ENC_NA); } return ENC_INFO_LEN + keylen + dhlen + siglen; } static void dissect_uftp_announce(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *announce_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0; gint hlen, iplen, destcount, idx, extlen_total; guint8 flags, ext_type; nstime_t tstamp; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < ANNOUNCE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if ((gint)tvb_reported_length(tvb) < hlen) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } flags = tvb_get_guint8(tvb, 2); ti = proto_tree_add_item(tree, hf_uftp_announce, tvb, offset, -1, ENC_NA); announce_tree = proto_item_add_subtree(ti, ett_uftp_announce); proto_tree_add_item(announce_tree, hf_uftp_announce_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(announce_tree, hf_uftp_announce_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(announce_tree, tvb, offset, hf_uftp_announce_flags, ett_uftp_announce_flags, announce_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_robust, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_cc_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(announce_tree, hf_uftp_announce_blocksize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(announce_tree, hf_uftp_announce_tstamp, tvb, offset, 8, &tstamp); offset += 8; if (flags & FLAG_IPV6) { iplen = 16; proto_tree_add_item(announce_tree, hf_uftp_announce_publicmcast_ipv6, tvb, offset, iplen, ENC_NA); offset += iplen; proto_tree_add_item(announce_tree, hf_uftp_announce_privatemcast_ipv6, tvb, offset, iplen, ENC_NA); offset += iplen; } else { iplen = 4; proto_tree_add_item(announce_tree, hf_uftp_announce_publicmcast_ipv4, tvb, offset, iplen, ENC_BIG_ENDIAN); offset += iplen; proto_tree_add_item(announce_tree, hf_uftp_announce_privatemcast_ipv4, tvb, offset, iplen, ENC_BIG_ENDIAN); offset += iplen; } extlen_total = hlen - (ANNOUNCE_LEN + ( 2 * iplen)); while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_ENC_INFO: parsed = dissect_uftp_encinfo(next_tvb, pinfo, announce_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(announce_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_register(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *register_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, keylen, idx; nstime_t tstamp; if (tvb_reported_length(tvb) < REGISTER_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 2); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < REGISTER_LEN + keylen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen = %d", tvb_reported_length(tvb), hlen, keylen); return; } ti = proto_tree_add_item(tree, hf_uftp_register, tvb, offset, -1, ENC_NA); register_tree = proto_item_add_subtree(ti, ett_uftp_register); proto_tree_add_item(register_tree, hf_uftp_register_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(register_tree, hf_uftp_register_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(register_tree, hf_uftp_register_dhlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(register_tree, hf_uftp_register_tstamp, tvb, offset, 8, &tstamp); offset += 8; proto_tree_add_item(register_tree, hf_uftp_register_rand2, tvb, offset, RAND_LEN, ENC_NA); offset += RAND_LEN; if (keylen > 0) { proto_tree_add_item(register_tree, hf_uftp_register_dhkey, tvb, offset, keylen, ENC_NA); } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(register_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_clientkey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *clientkey_tree = NULL; gint offset = 0, hlen; guint16 keylen, verifylen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < CLIENT_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 4); verifylen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CLIENT_KEY_LEN + keylen + verifylen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen = %d verifylen = %d", tvb_reported_length(tvb), hlen, keylen, verifylen); return; } ti = proto_tree_add_item(tree, hf_uftp_clientkey, tvb, offset, -1, ENC_NA); clientkey_tree = proto_item_add_subtree(ti, ett_uftp_clientkey); proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(clientkey_tree, hf_uftp_clientkey_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, clientkey_tree, hf_uftp_clientkey_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, clientkey_tree, hf_uftp_clientkey_keyblob); break; } offset += parsed; } if (verifylen > 0) { proto_tree_add_item(clientkey_tree, hf_uftp_clientkey_verify, tvb, offset, verifylen, ENC_NA); } } static void dissect_uftp_regconf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *regconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, idx; if (tvb_reported_length(tvb) < REG_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < REG_CONF_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_regconf, tvb, offset, -1, ENC_NA); regconf_tree = proto_item_add_subtree(ti, ett_uftp_regconf); proto_tree_add_item(regconf_tree, hf_uftp_regconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(regconf_tree, hf_uftp_regconf_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(regconf_tree, hf_uftp_regconf_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(regconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_keyinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_item *destkey = NULL; proto_tree *keyinfo_tree = NULL; proto_tree *destlist_tree = NULL; proto_tree *destkey_tree = NULL; gint offset = 0, hlen, siglen; guint8 destcount, idx; if (tvb_reported_length(tvb) < KEYINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; siglen = (gint)tvb_get_ntohs(tvb, 2); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < KEYINFO_LEN + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, siglen = %d", tvb_reported_length(tvb), hlen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_keyinfo, tvb, offset, -1, ENC_NA); keyinfo_tree = proto_item_add_subtree(ti, ett_uftp_keyinfo); proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(keyinfo_tree, hf_uftp_keyinfo_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_ivctr, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(keyinfo_tree, hf_uftp_keyinfo_sig, tvb, offset, siglen, ENC_NA); destcount = (tvb_reported_length(tvb) - hlen) / DESTKEY_LEN; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(keyinfo_tree, hf_uftp_destlist, tvb, offset, destcount * DESTKEY_LEN, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { destkey = proto_tree_add_item(destlist_tree, hf_uftp_keyinfo_destkey, tvb, offset, DESTKEY_LEN, ENC_NA); destkey_tree = proto_item_add_subtree(destkey, ett_uftp_keyinfo_destkey); proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_destid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(destkey_tree, hf_uftp_keyinfo_groupmaster, tvb, offset, 48, ENC_NA); offset += 48; } } static void dissect_uftp_keyinfoack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *keyinfoack_tree = NULL; gint offset = 0, hlen, verifylen; if (tvb_reported_length(tvb) < KEYINFO_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; verifylen = (gint)tvb_get_guint8(tvb, 2); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < KEYINFO_ACK_LEN + verifylen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_keyinfoack, tvb, offset, -1, ENC_NA); keyinfoack_tree = proto_item_add_subtree(ti, ett_uftp_keyinfoack); proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(keyinfoack_tree, hf_uftp_keyinfoack_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_verify_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(keyinfoack_tree, hf_uftp_keyinfoack_verify_data, tvb, offset, verifylen, ENC_NA); } static void dissect_uftp_fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfo_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, destcount, idx, namelen, linklen; nstime_t ftstamp, tstamp; if (tvb_reported_length(tvb) < FILEINFO_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; namelen = tvb_get_guint8(tvb, 8) * 4; linklen = tvb_get_guint8(tvb, 9) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILEINFO_LEN + namelen + linklen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, namelen = %d, linklen = %d", tvb_reported_length(tvb), hlen, namelen, linklen); return; } file_id = tvb_get_ntohs(tvb, 2); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); ti = proto_tree_add_item(tree, hf_uftp_fileinfo, tvb, offset, -1, ENC_NA); fileinfo_tree = proto_item_add_subtree(ti, ett_uftp_fileinfo); proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileinfo_tree, hf_uftp_fileinfo_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; // high bytes of file timestamp ftstamp.secs = (gint64)tvb_get_ntohs(tvb, offset) << 16; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_ftstamp_hi, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_namelen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_linklen, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_fsize, tvb, offset, 6, ENC_BIG_ENDIAN); offset += 6; // low bytes of file timestamp ftstamp.secs |= tvb_get_ntohl(tvb, offset); ftstamp.nsecs = 0; proto_tree_add_time(fileinfo_tree, hf_uftp_fileinfo_ftstamp, tvb, offset, 4, &ftstamp); offset += 4; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(fileinfo_tree, hf_uftp_fileinfo_tstamp, tvb, offset, 8, &tstamp); offset += 8; proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_name, tvb, offset, namelen, ENC_ASCII); offset += namelen; if (linklen > 0) { proto_tree_add_item(fileinfo_tree, hf_uftp_fileinfo_link, tvb, offset, linklen, ENC_ASCII); } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(fileinfo_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_fileinfoack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *fileinfoack_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, destcount, idx; nstime_t tstamp; if (tvb_reported_length(tvb) < FILEINFO_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILEINFO_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_fileinfoack, tvb, offset, -1, ENC_NA); fileinfoack_tree = proto_item_add_subtree(ti, ett_uftp_fileinfoack); proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileinfoack_tree, hf_uftp_fileinfoack_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(fileinfoack_tree, tvb, offset, hf_uftp_fileinfoack_flags, ett_uftp_fileinfoack_flags, fileinfoack_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(fileinfoack_tree, hf_uftp_fileinfoack_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(fileinfoack_tree, hf_uftp_fileinfoack_tstamp, tvb, offset, 8, &tstamp); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(fileinfoack_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static gint dissect_uftp_tfmccdata(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *tfmccdata_tree = NULL; gint offset = 0, hlen; guint rate, srate; if (tvb_reported_length(tvb) < TFMCC_DATA_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < TFMCC_DATA_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); srate = unquantize_rate(tvb_get_ntohs(tvb, 2)); ti = proto_tree_add_item(tree, hf_uftp_tfmccdata, tvb, offset, TFMCC_DATA_LEN, ENC_NA); tfmccdata_tree = proto_item_add_subtree(ti, ett_uftp_tfmccdata); proto_tree_add_item(tfmccdata_tree, hf_uftp_tfmccdata_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(tfmccdata_tree, hf_uftp_tfmccdata_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_uint(tfmccdata_tree, hf_uftp_tfmccdata_send_rate, tvb, offset, 2, srate); offset += 2; proto_tree_add_item(tfmccdata_tree, hf_uftp_tfmccdata_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(tfmccdata_tree, hf_uftp_tfmccdata_cc_rate, tvb, offset, 2, rate); return TFMCC_DATA_LEN; } static void dissect_uftp_fileseg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *fileseg_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, section, sec_block; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < FILESEG_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FILESEG_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 4); sec_block = tvb_get_ntohs(tvb, 6); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d Block=%d", file_id, section, sec_block); ti = proto_tree_add_item(tree, hf_uftp_fileseg, tvb, offset, -1, ENC_NA); fileseg_tree = proto_item_add_subtree(ti, ett_uftp_fileseg); proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(fileseg_tree, hf_uftp_fileseg_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_sec_block, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - FILESEG_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_DATA_INFO: parsed = dissect_uftp_tfmccdata(next_tvb, pinfo, fileseg_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } offset = hlen; proto_tree_add_item(fileseg_tree, hf_uftp_fileseg_data, tvb, offset, -1, ENC_NA); } static void dissect_uftp_done(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *done_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 file_id, section, destcount, idx; if (tvb_reported_length(tvb) < DONE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < DONE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 6); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d", file_id, section); } ti = proto_tree_add_item(tree, hf_uftp_done, tvb, offset, -1, ENC_NA); done_tree = proto_item_add_subtree(ti, ett_uftp_done); proto_tree_add_item(done_tree, hf_uftp_done_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(done_tree, hf_uftp_done_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(done_tree, hf_uftp_done_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(done_tree, hf_uftp_done_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(done_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static gint dissect_uftp_tfmccack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *tfmccack_tree = NULL; gint offset = 0, hlen; guint rate; nstime_t tstamp; if (tvb_reported_length(tvb) < TFMCC_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < TFMCC_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); ti = proto_tree_add_item(tree, hf_uftp_tfmccack, tvb, offset, TFMCC_ACK_LEN, ENC_NA); tfmccack_tree = proto_item_add_subtree(ti, ett_uftp_tfmccack); proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(tfmccack_tree, hf_uftp_tfmccack_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(tfmccack_tree, tvb, offset, hf_uftp_tfmccack_flags, ett_uftp_tfmccack_flags, tfmcc_ack_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(tfmccack_tree, hf_uftp_tfmccack_cc_rate, tvb, offset, 2, rate); offset += 2; proto_tree_add_item(tfmccack_tree, hf_uftp_tfmccack_client_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(tfmccack_tree, hf_uftp_tfmccack_tstamp, tvb, offset, 8, &tstamp); return TFMCC_ACK_LEN; } static void dissect_uftp_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *status_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, section; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < STATUS_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < STATUS_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); section = tvb_get_ntohs(tvb, 4); col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X Section=%d", file_id, section); ti = proto_tree_add_item(tree, hf_uftp_status, tvb, offset, -1, ENC_NA); status_tree = proto_item_add_subtree(ti, ett_uftp_status); proto_tree_add_item(status_tree, hf_uftp_status_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(status_tree, hf_uftp_status_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(status_tree, hf_uftp_status_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_section, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(status_tree, hf_uftp_status_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - STATUS_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_ACK_INFO: parsed = dissect_uftp_tfmccack(next_tvb, pinfo, status_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } offset = hlen; proto_tree_add_item(status_tree, hf_uftp_status_naks, tvb, offset, -1, ENC_NA); } static gint dissect_uftp_freespace(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *freespace_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < FREESPACE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return 0; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < FREESPACE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return 0; } ti = proto_tree_add_item(tree, hf_uftp_freespace, tvb, offset, FREESPACE_LEN, ENC_NA); freespace_tree = proto_item_add_subtree(ti, ett_uftp_freespace); proto_tree_add_item(freespace_tree, hf_uftp_freespace_exttype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(freespace_tree, hf_uftp_freespace_extlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(freespace_tree, hf_uftp_freespace_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(freespace_tree, hf_uftp_freespace_freespace, tvb, offset, 8, ENC_BIG_ENDIAN); return FREESPACE_LEN; } static void dissect_uftp_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *complete_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen, extlen_total; guint16 file_id, destcount, idx; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < COMPLETE_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < COMPLETE_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } file_id = tvb_get_ntohs(tvb, 2); if (file_id > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ":%04X", file_id); } ti = proto_tree_add_item(tree, hf_uftp_complete, tvb, offset, -1, ENC_NA); complete_tree = proto_item_add_subtree(ti, ett_uftp_complete); proto_tree_add_item(complete_tree, hf_uftp_complete_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(complete_tree, hf_uftp_complete_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_file_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(complete_tree, hf_uftp_complete_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(complete_tree, hf_uftp_complete_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; extlen_total = hlen - COMPLETE_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_FREESPACE_INFO: parsed = dissect_uftp_freespace(next_tvb, pinfo, complete_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(complete_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_doneconf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *destlist = NULL; proto_tree *doneconf_tree = NULL; proto_tree *destlist_tree = NULL; gint offset = 0, hlen; guint16 destcount, idx; if (tvb_reported_length(tvb) < DONE_CONF_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < DONE_CONF_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_doneconf, tvb, offset, -1, ENC_NA); doneconf_tree = proto_item_add_subtree(ti, ett_uftp_doneconf); proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(doneconf_tree, hf_uftp_doneconf_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(doneconf_tree, hf_uftp_doneconf_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); destcount = (tvb_reported_length(tvb) - hlen) / 4; offset = hlen; if (destcount > 0) { destlist = proto_tree_add_item(doneconf_tree, hf_uftp_destlist, tvb, offset, destcount * 4, ENC_NA); destlist_tree = proto_item_add_subtree(destlist, ett_uftp_destlist); } for (idx = 0; idx < destcount; idx++) { proto_tree_add_item(destlist_tree, hf_uftp_dest, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } } static void dissect_uftp_hbreq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbreq_tree = NULL; gint offset = 0, hlen; guint16 keylen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < HB_REQ_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 4); siglen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < HB_REQ_LEN + keylen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen=%d siglen=%d", tvb_reported_length(tvb), hlen, keylen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_hbreq, tvb, offset, -1, ENC_NA); hbreq_tree = proto_item_add_subtree(ti, ett_uftp_hbreq); proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(hbreq_tree, hf_uftp_hbreq_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, hbreq_tree, hf_uftp_hbreq_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, hbreq_tree, hf_uftp_hbreq_keyblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(hbreq_tree, hf_uftp_hbreq_verify, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_hbresp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *hbresp_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < HB_RESP_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < HB_RESP_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_hbresp, tvb, offset, -1, ENC_NA); hbresp_tree = proto_item_add_subtree(ti, ett_uftp_hbresp); proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(hbresp_tree, hf_uftp_hbresp_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_authenticated, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hbresp_tree, hf_uftp_hbresp_nonce, tvb, offset, 4, ENC_BIG_ENDIAN); } static void dissect_uftp_proxykey(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *proxykey_tree = NULL; gint offset = 0, hlen; guint16 keylen, dhlen, siglen; gint8 blobtype; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < PROXY_KEY_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; keylen = tvb_get_ntohs(tvb, 2); dhlen = tvb_get_ntohs(tvb, 4); siglen = tvb_get_ntohs(tvb, 6); if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < PROXY_KEY_LEN + keylen + dhlen + siglen)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d, keylen=%d, dhlen=%d, siglen=%d", tvb_reported_length(tvb), hlen, keylen, dhlen, siglen); return; } ti = proto_tree_add_item(tree, hf_uftp_proxykey, tvb, offset, -1, ENC_NA); proxykey_tree = proto_item_add_subtree(ti, ett_uftp_proxykey); proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(proxykey_tree, hf_uftp_proxykey_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_bloblen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_dhlen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_siglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (keylen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, keylen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_keyblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_keyblob); break; } offset += parsed; } if (dhlen > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, dhlen); blobtype = tvb_get_guint8(tvb, offset); switch (blobtype) { case KEYBLOB_RSA: parsed = dissect_uftp_rsablob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_dhblob); break; case KEYBLOB_EC: parsed = dissect_uftp_ecblob(next_tvb, pinfo, proxykey_tree, hf_uftp_proxykey_dhblob); break; } offset += parsed; } if (siglen > 0) { proto_tree_add_item(proxykey_tree, hf_uftp_proxykey_sig, tvb, offset, siglen, ENC_NA); } } static void dissect_uftp_congctrl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_item *cclist = NULL; proto_item *ccitem = NULL; proto_tree *congctrl_tree = NULL; proto_tree *cclist_tree = NULL; proto_tree *ccitem_tree = NULL; gint offset = 0, hlen; guint rate; guint8 itemcount, idx; nstime_t tstamp; if (tvb_reported_length(tvb) < CONG_CTRL_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CONG_CTRL_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } rate = unquantize_rate(tvb_get_ntohs(tvb, 6)); ti = proto_tree_add_item(tree, hf_uftp_congctrl, tvb, offset, -1, ENC_NA); congctrl_tree = proto_item_add_subtree(ti, ett_uftp_congctrl); proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(congctrl_tree, hf_uftp_congctrl_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_cc_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_uint(congctrl_tree, hf_uftp_congctrl_cc_rate, tvb, offset, 2, rate); offset += 2; tstamp = usec_to_nstime(tvb_get_ntoh64(tvb, offset)); proto_tree_add_time(congctrl_tree, hf_uftp_congctrl_tstamp, tvb, offset, 8, &tstamp); itemcount = (tvb_reported_length(tvb) - hlen) / CC_ITEM_LEN; offset = hlen; if (itemcount > 0) { cclist = proto_tree_add_item(congctrl_tree, hf_uftp_congctrl_cclist, tvb, offset, itemcount * CC_ITEM_LEN, ENC_NA); cclist_tree = proto_item_add_subtree(cclist, ett_uftp_congctrl_cclist); } for (idx = 0; idx < itemcount; idx++) { guint itemrate; double itemrtt; itemrtt = unquantize_grtt(tvb_get_guint8(tvb, offset + 5)); itemrate = unquantize_rate(tvb_get_ntohs(tvb, offset + 6)); ccitem = proto_tree_add_item(cclist_tree, hf_uftp_congctrl_item, tvb, offset, CC_ITEM_LEN, ENC_NA); ccitem_tree = proto_item_add_subtree(ccitem, ett_uftp_congctrl_item); proto_tree_add_item(ccitem_tree, hf_uftp_congctrl_item_destid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_bitmask(ccitem_tree, tvb, offset, hf_uftp_congctrl_item_flags, ett_uftp_congctrl_item_flags, cc_item_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_double(ccitem_tree, hf_uftp_congctrl_item_rtt, tvb, offset, 1, itemrtt); offset += 1; proto_tree_add_uint(ccitem_tree, hf_uftp_congctrl_item_rate, tvb, offset, 2, itemrate); offset += 2; } } static void dissect_uftp_ccack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *ccack_tree = NULL; gint offset = 0, hlen, extlen_total; guint8 ext_type; tvbuff_t *next_tvb; if (tvb_reported_length(tvb) < CC_ACK_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < CC_ACK_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_ccack, tvb, offset, -1, ENC_NA); ccack_tree = proto_item_add_subtree(ti, ett_uftp_ccack); proto_tree_add_item(ccack_tree, hf_uftp_ccack_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(ccack_tree, hf_uftp_ccack_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_item(ccack_tree, hf_uftp_ccack_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; extlen_total = hlen - CC_ACK_LEN; while (extlen_total > 0) { gint parsed = 0; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, extlen_total); ext_type = tvb_get_guint8(tvb, offset); switch (ext_type) { case EXT_TFMCC_ACK_INFO: parsed = dissect_uftp_tfmccack(next_tvb, pinfo, ccack_tree); break; } if (!parsed) break; extlen_total -= parsed; offset += parsed; } } static void dissect_uftp_encrypted(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *encrypted_tree = NULL; gint offset = 0; guint16 payload_len; if (tvb_reported_length(tvb) < ENCRYPTED_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } payload_len = tvb_get_ntohs(tvb, 10); if ((gint)tvb_reported_length(tvb) < ENCRYPTED_LEN + payload_len) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, payload=%d", tvb_reported_length(tvb), payload_len); return; } ti = proto_tree_add_item(tree, hf_uftp_encrypted, tvb, offset, -1, ENC_NA); encrypted_tree = proto_item_add_subtree(ti, ett_uftp_encrypted); proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_ivctr, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(encrypted_tree, hf_uftp_encrypted_payload, tvb, offset, payload_len, ENC_NA); } static void dissect_uftp_abort(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_item *ti = NULL; proto_tree *abort_tree = NULL; gint offset = 0, hlen; if (tvb_reported_length(tvb) < ABORT_LEN) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length: %d", tvb_reported_length(tvb)); return; } hlen = (gint)tvb_get_guint8(tvb, 1) * 4; if (((gint)tvb_reported_length(tvb) < hlen) || (hlen < ABORT_LEN)) { proto_tree_add_expert_format(tree, pinfo, &ei_uftp_length_invalid, tvb, offset, -1, "Invalid length, len = %d, hlen = %d", tvb_reported_length(tvb), hlen); return; } ti = proto_tree_add_item(tree, hf_uftp_abort, tvb, offset, -1, ENC_NA); abort_tree = proto_item_add_subtree(ti, ett_uftp_abort); proto_tree_add_item(abort_tree, hf_uftp_abort_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format_value(abort_tree, hf_uftp_abort_hlen, tvb, offset, 1, hlen, "%d bytes (%d)", hlen, hlen/4); offset += 1; proto_tree_add_bitmask(abort_tree, tvb, offset, hf_uftp_abort_flags, ett_uftp_abort_flags, abort_flags, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(abort_tree, hf_uftp_abort_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(abort_tree, hf_uftp_abort_clientid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(abort_tree, hf_uftp_abort_message, tvb, offset, -1, ENC_ASCII); } static int dissect_uftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 version; guint8 mes_type; guint32 group_id; tvbuff_t *next_tvb; proto_item *ti = NULL; proto_tree *uftp_tree = NULL; gint offset = 0; guint l_gsize; double grtt; if (tvb_reported_length(tvb) < UFTP_LEN + 4) { return 0; } version = tvb_get_guint8(tvb, 0); mes_type = tvb_get_guint8(tvb, 1); group_id = tvb_get_ntohl(tvb, 8); if (version != UFTP_VER_NUM) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "UFTP"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%-12s", val_to_str(mes_type, messages, "Unknown (%d)")); if ((mes_type != HB_REQ) && (mes_type != HB_RESP)) { col_append_fstr(pinfo->cinfo, COL_INFO, " ID=%08X", group_id); } grtt = unquantize_grtt(tvb_get_guint8(tvb, 13)); l_gsize = unquantize_gsize(tvb_get_guint8(tvb, 14)); ti = proto_tree_add_item(tree, proto_uftp, tvb, 0, -1, ENC_NA); uftp_tree = proto_item_add_subtree(ti, ett_uftp); proto_tree_add_item(uftp_tree, hf_uftp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_func, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_seq, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(uftp_tree, hf_uftp_src_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_group_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(uftp_tree, hf_uftp_group_inst, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_double(uftp_tree, hf_uftp_grtt, tvb, offset, 1, grtt); offset += 1; proto_tree_add_uint(uftp_tree, hf_uftp_gsize, tvb, offset, 1, l_gsize); offset += 1; proto_tree_add_item(uftp_tree, hf_uftp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; next_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, tvb_reported_length(tvb) - UFTP_LEN); switch (mes_type) { case ANNOUNCE: dissect_uftp_announce(next_tvb, pinfo, uftp_tree); break; case REGISTER: dissect_uftp_register(next_tvb, pinfo, uftp_tree); break; case CLIENT_KEY: dissect_uftp_clientkey(next_tvb, pinfo, uftp_tree); break; case REG_CONF: dissect_uftp_regconf(next_tvb, pinfo, uftp_tree); break; case KEYINFO: dissect_uftp_keyinfo(next_tvb, pinfo, uftp_tree); break; case KEYINFO_ACK: dissect_uftp_keyinfoack(next_tvb, pinfo, uftp_tree); break; case FILEINFO: dissect_uftp_fileinfo(next_tvb, pinfo, uftp_tree); break; case FILEINFO_ACK: dissect_uftp_fileinfoack(next_tvb, pinfo, uftp_tree); break; case FILESEG: dissect_uftp_fileseg(next_tvb, pinfo, uftp_tree); break; case DONE: dissect_uftp_done(next_tvb, pinfo, uftp_tree); break; case STATUS: dissect_uftp_status(next_tvb, pinfo, uftp_tree); break; case COMPLETE: dissect_uftp_complete(next_tvb, pinfo, uftp_tree); break; case DONE_CONF: dissect_uftp_doneconf(next_tvb, pinfo, uftp_tree); break; case HB_REQ: dissect_uftp_hbreq(next_tvb, pinfo, uftp_tree); break; case HB_RESP: dissect_uftp_hbresp(next_tvb, pinfo, uftp_tree); break; case PROXY_KEY: dissect_uftp_proxykey(next_tvb, pinfo, uftp_tree); break; case CONG_CTRL: dissect_uftp_congctrl(next_tvb, pinfo, uftp_tree); break; case CC_ACK: dissect_uftp_ccack(next_tvb, pinfo, uftp_tree); break; case ENCRYPTED: dissect_uftp_encrypted(next_tvb, pinfo, uftp_tree); break; case ABORT: dissect_uftp_abort(next_tvb, pinfo, uftp_tree); break; default: proto_tree_add_expert_format(tree, pinfo, &ei_uftp_func_unknown, tvb, offset, -1, "Function unknown: %d", mes_type); break; } return tvb_reported_length(tvb); } void proto_register_uftp5(void) { static hf_register_info hf[] = { { &hf_uftp_version, { "Protocol Version", "uftp5.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_func, { "Type", "uftp5.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_seq, { "Sequence Number", "uftp5.seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_src_id, { "Source ID", "uftp5.src_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_group_id, { "Group ID", "uftp5.group_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_group_inst, { "Group Instance ID", "uftp5.group_inst", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_grtt, { "Group Round Trip Time", "uftp5.grtt", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_gsize, { "Group Size", "uftp5.gsize", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_reserved, { "Reserved", "uftp5.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_destlist, { "Destination List", "uftp5.destlist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_dest, { "Destination", "uftp5.dest", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce, { "ANNOUNCE", "uftp5.announce", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_func, { "Type", "uftp5.announce.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_announce_hlen, { "Header Length", "uftp5.announce.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags, { "Flags", "uftp5.announce.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_flags_sync, { "Sync mode", "uftp5.announce.flags.sync", FT_BOOLEAN, 8, NULL, FLAG_SYNC_MODE, NULL, HFILL } }, { &hf_uftp_announce_flags_syncpreview, { "Sync preview mode", "uftp5.announce.flags.syncpreview", FT_BOOLEAN, 8, NULL, FLAG_SYNC_PREVIEW, NULL, HFILL } }, { &hf_uftp_announce_flags_ipv6, { "IPv6", "uftp5.announce.flags.ipv6", FT_BOOLEAN, 8, NULL, FLAG_IPV6, NULL, HFILL } }, { &hf_uftp_announce_flags_reserved, { "Reserved", "uftp5.announce.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ANNOUNCE_RESERVED, NULL, HFILL } }, { &hf_uftp_announce_robust, { "Robustness Factor", "uftp5.announce.robust", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_cc_type, { "Congestion Control Type", "uftp5.announce.cc_type", FT_UINT8, BASE_DEC, VALS(cc_types), 0x0, NULL, HFILL } }, { &hf_uftp_announce_reserved, { "Reserved", "uftp5.announce.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_blocksize, { "Block Size", "uftp5.announce.blocksize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_tstamp, { "Timestamp", "uftp5.announce.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_publicmcast_ipv4, { "Public Multicast Address", "uftp5.announce.publicmcast.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_publicmcast_ipv6, { "Public Multicast Address", "uftp5.announce.publicmcast.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_privatemcast_ipv4, { "Private Multicast Address", "uftp5.announce.privatemcast.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_announce_privatemcast_ipv6, { "Private Multicast Address", "uftp5.announce.privatemcast.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo, { "EXT_ENC_INFO", "uftp5.encinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_exttype, { "Extension Type", "uftp5.encinfo.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_extlen, { "Extension Length", "uftp5.encinfo.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_flags, { "Flags", "uftp5.encinfo.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_flags_client_auth, { "Client Authorization", "uftp5.encinfo.flags.client_auth", FT_BOOLEAN, 8, NULL, FLAG_CLIENT_AUTH, NULL, HFILL } }, { &hf_uftp_encinfo_flags_reserved, { "Reserved", "uftp5.encinfo.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ENCINFO_RESERVED, NULL, HFILL } }, { &hf_uftp_encinfo_reserved, { "Reserved", "uftp5.encinfo.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_keytype, { "Key Type", "uftp5.encinfo.keytype", FT_UINT8, BASE_DEC, VALS(key_types), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_hashtype, { "Hash Type", "uftp5.encinfo.hashtype", FT_UINT8, BASE_DEC, VALS(hash_types), 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_keylen, { "Public Key Length", "uftp5.encinfo.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_dhlen, { "Diffie-Hellman Key Length", "uftp5.encinfo.dhlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_siglen, { "Signature Length", "uftp5.encinfo.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_rand1, { "Server Random Number", "uftp5.encinfo.rand1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_keyblob, { "Public Key Blob", "uftp5.encinfo.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_dhblob, { "Diffie-Hellman Key Blob", "uftp5.encinfo.dhblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encinfo_sig, { "Signature", "uftp5.encinfo.sig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_blobtype, { "Keyblob Type", "uftp5.rsablob.blobtype", FT_UINT8, BASE_DEC, VALS(keyblob_types), 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_reserved, { "Reserved", "uftp5.rsablob.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_modlen, { "Modulus Length", "uftp5.rsablob.modlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_exponent, { "Exponent", "uftp5.rsablob.exponent", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_rsablob_modulus, { "Modulus", "uftp5.rsablob.modulus", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_blobtype, { "Keyblob Type", "uftp5.ecblob.blobtype", FT_UINT8, BASE_DEC, VALS(keyblob_types), 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_curve, { "Curve", "uftp5.ecblob.curve", FT_UINT8, BASE_DEC, VALS(curves), 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_keylen, { "Key Length", "uftp5.ecblob.keylen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ecblob_key, { "Key", "uftp5.ecblob.key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register, { "REGISTER", "uftp5.register", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_func, { "Type", "uftp5.register.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_register_hlen, { "Header Length", "uftp5.register.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_dhlen, { "Key Info Length", "uftp5.register.dhlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_tstamp, { "Timestamp", "uftp5.register.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_rand2, { "Client Random Number", "uftp5.register.rand2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_register_dhkey, { "Key Info", "uftp5.register.dhkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey, { "CLIENT_KEY", "uftp5.clientkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_func, { "Type", "uftp5.clientkey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_hlen, { "Header Length", "uftp5.clientkey.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_reserved, { "Reserved", "uftp5.clientkey.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_bloblen, { "Keyblob Length", "uftp5.clientkey.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_siglen, { "Signature Length", "uftp5.clientkey.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_keyblob, { "Public Key Blob", "uftp5.clientkey.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_clientkey_verify, { "Signature", "uftp5.clientkey.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf, { "REG_CONF", "uftp5.regconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_func, { "Type", "uftp5.regconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_regconf_hlen, { "Header Length", "uftp5.regconf.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_regconf_reserved, { "Reserved", "uftp5.regconf.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo, { "KEYINFO", "uftp5.keyinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_func, { "Type", "uftp5.keyinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_hlen, { "Header Length", "uftp5.keyinfo.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_siglen, { "Signature Length", "uftp5.keyinfo.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_ivctr, { "IV Counter", "uftp5.keyinfo.ivctr", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_sig, { "signature", "uftp5.keyinfo.sig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destkey, { "Destination Key", "uftp5.keyinfo.destkey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_destid, { "Destination ID", "uftp5.keyinfo.destid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfo_groupmaster, { "Encrypted Group Master", "uftp5.keyinfo.groupmaster", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack, { "KEYINFO_ACK", "uftp5.keyinfoack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_func, { "Type", "uftp5.keyinfoack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_hlen, { "Header Length", "uftp5.keyinfoack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_verify_len, { "Verify Data Length", "uftp5.keyinfoack.verify_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_keyinfoack_verify_data, { "Verify Data", "uftp5.keyinfoack.verify_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo, { "FILEINFO", "uftp5.fileinfo", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_func, { "Type", "uftp5.fileinfo.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_hlen, { "Header Length", "uftp5.fileinfo.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_file_id, { "File ID", "uftp5.fileinfo.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftype, { "File Type", "uftp5.fileinfo.ftype", FT_UINT8, BASE_DEC, VALS(file_types), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_reserved, { "Reserved", "uftp5.fileinfo.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftstamp_hi, { "File Timestamp (high order bytes)", "uftp5.fileinfo.ftstamp_hi", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_namelen, { "Name Length", "uftp5.fileinfo.namelen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_linklen, { "Link Length", "uftp5.fileinfo.linklen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_fsize, { "File Size", "uftp5.fileinfo.fsize", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_ftstamp, { "File Timestamp", "uftp5.fileinfo.ftstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_tstamp, { "Timestamp", "uftp5.fileinfo.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_name, { "File Name", "uftp5.fileinfo.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfo_link, { "Link Name", "uftp5.fileinfo.link", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack, { "FILEINFO_ACK", "uftp5.fileinfoack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_func, { "Type", "uftp5.fileinfoack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_hlen, { "Header Length", "uftp5.fileinfoack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_file_id, { "File ID", "uftp5.fileinfoack.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags, { "Flags", "uftp5.fileinfoack.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags_partial, { "Partial", "uftp5.fileinfoack.flags.partial", FT_BOOLEAN, 8, NULL, FLAG_PARTIAL, NULL, HFILL } }, { &hf_uftp_fileinfoack_flags_reserved, { "Reserved", "uftp5.fileinfoack.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_FILEINFOACK_RESERVED, NULL, HFILL } }, { &hf_uftp_fileinfoack_reserved, { "Reserved", "uftp5.fileinfoack.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileinfoack_tstamp, { "Timestamp", "uftp5.fileinfoack.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg, { "FILESEG", "uftp5.fileseg", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_func, { "Type", "uftp5.fileseg.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_hlen, { "Header Length", "uftp5.fileseg.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_file_id, { "File ID", "uftp5.fileseg.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_section, { "Section", "uftp5.fileseg.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_sec_block, { "Block", "uftp5.fileseg.sec_block", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata, { "EXT_TFMCC_DATA_INFO", "uftp5.tfmccdata", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_exttype, { "Extension Type", "uftp5.tfmccdata.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_extlen, { "Extension Length", "uftp5.tfmccdata.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_send_rate, { "Send Rate", "uftp5.tfmccdata.send_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_cc_seq, { "CC Sequence Number", "uftp5.tfmccdata.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccdata_cc_rate, { "Rate", "uftp5.tfmccdata.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_fileseg_data, { "Data", "uftp5.fileseg.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done, { "DONE", "uftp5.done", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_func, { "Type", "uftp5.done.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_done_hlen, { "Header Length", "uftp5.done.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_file_id, { "File ID", "uftp5.done.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_section, { "Section", "uftp5.done.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_done_reserved, { "Reserved", "uftp5.done.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status, { "STATUS", "uftp5.status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_func, { "Type", "uftp5.status.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_status_hlen, { "Header Length", "uftp5.status.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_file_id, { "File ID", "uftp5.status.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_section, { "Section", "uftp5.status.section", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_reserved, { "Reserved", "uftp5.status.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_status_naks, { "NAKs", "uftp5.status.naks", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete, { "COMPLETE", "uftp5.complete", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_func, { "Type", "uftp5.complete.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_complete_hlen, { "Header Length", "uftp5.complete.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_file_id, { "File ID", "uftp5.complete.file_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_complete_status, { "Completion Status", "uftp5.complete.status", FT_UINT8, BASE_DEC, VALS(comp_status), 0x0, NULL, HFILL } }, { &hf_uftp_complete_reserved, { "Reserved", "uftp5.complete.reserved", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace, { "EXT_FREESPACE_INFO", "uftp5.freespace", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_exttype, { "Extension Type", "uftp5.freespace.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_freespace_extlen, { "Extension Length", "uftp5.freespace.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_reserved, { "Reserved", "uftp5.freespace.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_freespace_freespace, { "Free Space", "uftp5.freespace.freespace", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf, { "DONE_CONF", "uftp5.doneconf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_func, { "Type", "uftp5.doneconf.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_hlen, { "Header Length", "uftp5.doneconf.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_doneconf_reserved, { "Reserved", "uftp5.doneconf.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq, { "HB_REQ", "uftp5.hbreq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_func, { "Type", "uftp5.hbreq.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_hlen, { "Header Length", "uftp5.hbreq.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_reserved, { "Reserved", "uftp5.hbreq.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_bloblen, { "Keyblob Length", "uftp5.hbreq.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_siglen, { "Signature Length", "uftp5.hbreq.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_nonce, { "Nonce", "uftp5.hbreq.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_keyblob, { "Public Key Blob", "uftp5.hbreq.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbreq_verify, { "Signature", "uftp5.hbreq.verify", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp, { "HB_RESP", "uftp5.hbresp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_func, { "Type", "uftp5.hbresp.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_hlen, { "Header Length", "uftp5.hbresp.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_authenticated, { "Authenticated", "uftp5.hbresp.authenticated", FT_UINT8, BASE_DEC, VALS(hb_auth_types), 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_reserved, { "Reserved", "uftp5.hbresp.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_hbresp_nonce, { "Nonce", "uftp5.hbresp.nonce", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey, { "PROXY_KEY", "uftp5.proxykey", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_func, { "Type", "uftp5.proxykey.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_hlen, { "Header Length", "uftp5.proxykey.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_bloblen, { "Keyblob Length", "uftp5.proxykey.bloblen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_dhlen, { "Diffie-Hellman Keyblob Length", "uftp5.proxykey.dhlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_siglen, { "Signature Length", "uftp5.proxykey.siglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_keyblob, { "Public Key Blob", "uftp5.proxykey.keyblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_dhblob, { "Diffie-Hellman Key Blob", "uftp5.proxykey.dhblob", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_proxykey_sig, { "Signature", "uftp5.proxykey.sig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl, { "CONG_CTRL", "uftp5.congctrl", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_func, { "Type", "uftp5.congctrl.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_hlen, { "Header Length", "uftp5.congctrl.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_reserved, { "Reserved", "uftp5.congctrl.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cc_seq, { "CC Sequence", "uftp5.congctrl.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cc_rate, { "Rate", "uftp5.congctrl.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_tstamp, { "Timestamp", "uftp5.congctrl.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_cclist, { "Congestion Control List", "uftp5.congctrl.cclist", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item, { "Destination", "uftp5.congctrl.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_destid, { "Destination ID", "uftp5.congctrl.item.destid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags, { "Flags", "uftp5.congctrl.item.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_clr, { "CLR", "uftp5.congctrl.item.flags.clr", FT_BOOLEAN, 8, NULL, FLAG_CC_CLR, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_rtt, { "RTT", "uftp5.congctrl.item.flags.rtt", FT_BOOLEAN, 8, NULL, FLAG_CC_RTT, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_start, { "Slowstart", "uftp5.congctrl.item.flags.start", FT_BOOLEAN, 8, NULL, FLAG_CC_START, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_leave, { "Leave", "uftp5.congctrl.item.flags.leave", FT_BOOLEAN, 8, NULL, FLAG_CC_LEAVE, NULL, HFILL } }, { &hf_uftp_congctrl_item_flags_reserved, { "Reserved", "uftp5.congctrl.item.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_CC_RESERVED, NULL, HFILL } }, { &hf_uftp_congctrl_item_rtt, { "Round Trip Time", "uftp5.congctrl.item.rtt", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_congctrl_item_rate, { "Rate", "uftp5.congctrl.item.rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack, { "CC_ACK", "uftp5.ccack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack_func, { "Type", "uftp5.ccack.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_ccack_hlen, { "Header Length", "uftp5.ccack.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_ccack_reserved, { "Reserved", "uftp5.ccack.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack, { "EXT_TFMCC_ACK_INFO", "uftp5.tfmccack", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_exttype, { "Extension Type", "uftp5.tfmccack.exttype", FT_UINT8, BASE_DEC, VALS(extensions), 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_extlen, { "Extension Length", "uftp5.tfmccack.extlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_flags, { "Flags", "uftp5.tfmccack.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_clr, { "CLR", "uftp5.tfmccack.flags.clr", FT_BOOLEAN, 8, NULL, FLAG_CC_CLR, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_rtt, { "RTT", "uftp5.tfmccack.flags.rtt", FT_BOOLEAN, 8, NULL, FLAG_CC_RTT, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_start, { "Slowstart", "uftp5.tfmccack.flags.start", FT_BOOLEAN, 8, NULL, FLAG_CC_START, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_leave, { "Leave", "uftp5.tfmccack.flags.leave", FT_BOOLEAN, 8, NULL, FLAG_CC_LEAVE, NULL, HFILL } }, { &hf_uftp_tfmccack_flags_reserved, { "Reserved", "uftp5.tfmccack.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_CC_RESERVED, NULL, HFILL } }, { &hf_uftp_tfmccack_reserved, { "Reserved", "uftp5.tfmccack.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_cc_seq, { "CC Sequence Number", "uftp5.tfmccack.cc_seq", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_cc_rate, { "Rate", "uftp5.tfmccack.cc_rate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_client_id, { "Client ID", "uftp5.tfmccack.client_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_tfmccack_tstamp, { "Timestamp", "uftp5.tfmccack.tstamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted, { "ENCRYPTED", "uftp5.encrypted", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_ivctr, { "IV Counter", "uftp5.encrypted.ivctr", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_reserved, { "Reserved", "uftp5.encrypted.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload_len, { "Payload Length", "uftp5.encrypted.payload_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_encrypted_payload, { "Encrypted Payload", "uftp5.encrypted.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort, { "ABORT", "uftp5.abort", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_func, { "Type", "uftp5.abort.func", FT_UINT8, BASE_DEC, VALS(messages), 0x0, NULL, HFILL } }, { &hf_uftp_abort_hlen, { "Header Length", "uftp5.abort.hlen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags, { "Flags", "uftp5.abort.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_flags_curfile, { "Current file", "uftp5.abort.flags.curfile", FT_BOOLEAN, 8, NULL, FLAG_CURRENT_FILE, NULL, HFILL } }, { &hf_uftp_abort_flags_reserved, { "Reserved", "uftp5.abort.flags.reserved", FT_UINT8, BASE_HEX, NULL, FLAG_ABORT_RESERVED, NULL, HFILL } }, { &hf_uftp_abort_reserved, { "Reserved", "uftp5.abort.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_clientid, { "Client ID", "uftp5.abort.clientid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_uftp_abort_message, { "Message", "uftp5.abort.message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_uftp, &ett_uftp_announce, &ett_uftp_encinfo, &ett_uftp_register, &ett_uftp_clientkey, &ett_uftp_regconf, &ett_uftp_keyinfo, &ett_uftp_keyinfo_destkey, &ett_uftp_keyinfoack, &ett_uftp_fileinfo, &ett_uftp_fileinfoack, &ett_uftp_fileseg, &ett_uftp_tfmccdata, &ett_uftp_done, &ett_uftp_status, &ett_uftp_complete, &ett_uftp_freespace, &ett_uftp_doneconf, &ett_uftp_hbreq, &ett_uftp_hbresp, &ett_uftp_proxykey, &ett_uftp_congctrl, &ett_uftp_congctrl_cclist, &ett_uftp_congctrl_item, &ett_uftp_ccack, &ett_uftp_tfmccack, &ett_uftp_encrypted, &ett_uftp_abort, &ett_uftp_announce_flags, &ett_uftp_encinfo_flags, &ett_uftp_fileinfoack_flags, &ett_uftp_abort_flags, &ett_uftp_congctrl_item_flags, &ett_uftp_tfmccack_flags, &ett_uftp_destlist, &ett_uftp_rsablob, &ett_uftp_ecblob }; static ei_register_info ei[] = { { &ei_uftp_length_invalid, { "uftp5.length.invalid", PI_MALFORMED, PI_ERROR, "Length is invalid", EXPFILL }}, { &ei_uftp_func_unknown, { "uftp5.func.invalid", PI_MALFORMED, PI_ERROR, "Unknown function", EXPFILL }} }; expert_module_t* expert_uftp; proto_uftp = proto_register_protocol("UDP based FTP w/ multicast V5", "UFTP5", "uftp5"); proto_register_field_array(proto_uftp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("uftp5", dissect_uftp, proto_uftp); expert_uftp = expert_register_protocol(proto_uftp); expert_register_field_array(expert_uftp, ei, array_length(ei)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-uhd.c
/* packet-uhd.c * Routines for UHD captures * * (C) 2013 by Klyuchnikov Ivan <[email protected]>, Dario Lombardo <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Original dissector can be found here * https://github.com/chemeris/uhd_dissector */ #include "config.h" #include <epan/packet.h> void proto_register_uhd(void); /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ #define USRP2_CTRL_ID_HUH_WHAT 0x20 /* ' ' */ #define UMTRX_CTRL_ID_REQUEST 0x75 /* 'u' */ #define UMTRX_CTRL_ID_RESPONSE 0x55 /* 'U' */ #define USRP2_CTRL_ID_WAZZUP_BRO 0x61 /* 'a' */ #define USRP2_CTRL_ID_WAZZUP_DUDE 0x41 /* 'A' */ #define USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO 0x73 /* 's' */ #define USRP2_CTRL_ID_OMG_TRANSACTED_SPI_DUDE 0x53 /* 'S' */ #define USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO 0x69 /* 'i' */ #define USRP2_CTRL_ID_HERES_THE_I2C_DATA_DUDE 0x49 /* 'I' */ #define USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO 0x68 /* 'h' */ #define USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE 0x48 /* 'H' */ #define USRP2_CTRL_ID_GET_THIS_REGISTER_FOR_ME_BRO 0x72 /* 'r' */ #define USRP2_CTRL_ID_OMG_GOT_REGISTER_SO_BAD_DUDE 0x52 /* 'R' */ #define USRP2_CTRL_ID_HOLLER_AT_ME_BRO 0x6c /* 'l' */ #define USRP2_CTRL_ID_HOLLER_BACK_DUDE 0x4c /* 'L' */ #define USRP2_CTRL_ID_PEACE_OUT 0x7e /* '~' */ #define USRP2_REG_ACTION_FPGA_PEEK32 1 #define USRP2_REG_ACTION_FPGA_PEEK16 2 #define USRP2_REG_ACTION_FPGA_POKE32 3 #define USRP2_REG_ACTION_FPGA_POKE16 4 #define USRP2_REG_ACTION_FW_PEEK32 5 #define USRP2_REG_ACTION_FW_POKE32 6 #define UHD_UDP_PORT 49152 /* This is the header as it is used by uhd-generating software. * It is not used by the wireshark dissector and provided for reference only. typedef struct{ uint32_t proto_ver; uint32_t id; uint32_t seq; union{ uint32_t ip_addr; struct { uint32_t dev; uint32_t data; uint8_t miso_edge; uint8_t mosi_edge; uint8_t num_bits; uint8_t readback; } spi_args; struct { uint8_t addr; uint8_t bytes; uint8_t data[20]; } i2c_args; struct { uint32_t addr; uint32_t data; uint8_t action; } reg_args; struct { uint32_t len; } echo_args; } data; } usrp2_ctrl_data_t; */ static int proto_uhd = -1; static int hf_uhd_version = -1; static int hf_uhd_id = -1; static int hf_uhd_seq = -1; static int hf_uhd_ip_addr = -1; static int hf_uhd_i2c_addr = -1; static int hf_uhd_i2c_bytes = -1; static int hf_uhd_i2c_data = -1; static int hf_uhd_spi_dev = -1; static int hf_uhd_spi_data = -1; static int hf_uhd_spi_miso_edge = -1; static int hf_uhd_spi_mosi_edge = -1; static int hf_uhd_spi_num_bits = -1; static int hf_uhd_spi_readback = -1; static int hf_uhd_reg_addr = -1; static int hf_uhd_reg_data = -1; static int hf_uhd_reg_action = -1; static int hf_uhd_echo_len = -1; static gint ett_uhd = -1; static const value_string uhd_ids[] = { { USRP2_CTRL_ID_HUH_WHAT, "HUH WHAT" }, { UMTRX_CTRL_ID_REQUEST, "UMTRX REQUEST" }, { UMTRX_CTRL_ID_RESPONSE, "UMTRX RESPONSE" }, { USRP2_CTRL_ID_WAZZUP_BRO, "WAZZUP BRO" }, { USRP2_CTRL_ID_WAZZUP_DUDE, "WAZZUP DUDE" }, { USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO, "TRANSACT ME SOME SPI BRO" }, { USRP2_CTRL_ID_OMG_TRANSACTED_SPI_DUDE, "OMG TRANSACTED SPI DUDE" }, { USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO, "DO AN I2C READ FOR ME BRO" }, { USRP2_CTRL_ID_HERES_THE_I2C_DATA_DUDE, "HERES THE I2C DATA DUDE" }, { USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO, "WRITE THESE I2C VALUES BRO" }, { USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE, "COOL IM DONE I2C WRITE DUDE" }, { USRP2_CTRL_ID_GET_THIS_REGISTER_FOR_ME_BRO, "GET THIS REGISTER FOR ME BRO" }, { USRP2_CTRL_ID_OMG_GOT_REGISTER_SO_BAD_DUDE, "OMG GOT REGISTER SO BAD DUDE" }, { USRP2_CTRL_ID_HOLLER_AT_ME_BRO, "HOLLER AT ME BRO" }, { USRP2_CTRL_ID_HOLLER_BACK_DUDE, "HOLLER BACK DUDE" }, { USRP2_CTRL_ID_PEACE_OUT, "PEACE OUT" }, { 0, NULL } }; static const value_string uhd_reg_actions[] = { { USRP2_REG_ACTION_FPGA_PEEK32, "FPGA PEEK32" }, { USRP2_REG_ACTION_FPGA_PEEK16, "FPGA PEEK16" }, { USRP2_REG_ACTION_FPGA_POKE32, "FPGA POKE32" }, { USRP2_REG_ACTION_FPGA_POKE16, "FPGA POKE16" }, { USRP2_REG_ACTION_FW_PEEK32, "FW PEEK32" }, { USRP2_REG_ACTION_FW_POKE32, "FW POKE32" }, { 0, NULL } }; void proto_reg_handoff_uhd(void); /* dissect a UHD header and hand payload off to respective dissector */ static int dissect_uhd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int ind; proto_item *ti; proto_tree *uhd_tree; guint32 id; guint8 i2c_bytes; col_set_str(pinfo->cinfo, COL_PROTOCOL, "UHD"); col_clear(pinfo->cinfo, COL_INFO); id = tvb_get_ntohl(tvb, 4); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(id, uhd_ids, "Unknown UHD message type '%c'")); if (tree == NULL) return tvb_captured_length(tvb); ti = proto_tree_add_protocol_format(tree, proto_uhd, tvb, 0, 34, "UHD id = %c ", id); uhd_tree = proto_item_add_subtree(ti, ett_uhd); proto_tree_add_item(uhd_tree, hf_uhd_version, tvb, 0, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_id, tvb, 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_seq, tvb, 8, 4, ENC_BIG_ENDIAN); switch (id) { case UMTRX_CTRL_ID_REQUEST: case UMTRX_CTRL_ID_RESPONSE: case USRP2_CTRL_ID_WAZZUP_BRO: case USRP2_CTRL_ID_WAZZUP_DUDE: proto_tree_add_item(uhd_tree, hf_uhd_ip_addr, tvb, 12, 4, ENC_BIG_ENDIAN); break; case USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO: case USRP2_CTRL_ID_OMG_TRANSACTED_SPI_DUDE: proto_tree_add_item(uhd_tree, hf_uhd_spi_dev, tvb, 12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_spi_data, tvb, 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_spi_miso_edge, tvb, 20, 1, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_spi_mosi_edge, tvb, 21, 1, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_spi_num_bits, tvb, 22, 1, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_spi_readback, tvb, 23, 1, ENC_BIG_ENDIAN); break; case USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO: case USRP2_CTRL_ID_HERES_THE_I2C_DATA_DUDE: case USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO: case USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE: proto_tree_add_item(uhd_tree, hf_uhd_i2c_addr, tvb, 12, 1, ENC_BIG_ENDIAN); i2c_bytes = tvb_get_guint8(tvb, 13); proto_tree_add_item(uhd_tree, hf_uhd_i2c_bytes, tvb, 13, 1, ENC_BIG_ENDIAN); for (ind = 0; ind < i2c_bytes; ind++) { proto_tree_add_item(uhd_tree, hf_uhd_i2c_data, tvb, 14 + ind, 1, ENC_BIG_ENDIAN); } break; case USRP2_CTRL_ID_GET_THIS_REGISTER_FOR_ME_BRO: case USRP2_CTRL_ID_OMG_GOT_REGISTER_SO_BAD_DUDE: proto_tree_add_item(uhd_tree, hf_uhd_reg_addr, tvb, 12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_reg_data, tvb, 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(uhd_tree, hf_uhd_reg_action, tvb, 20, 1, ENC_BIG_ENDIAN); break; case USRP2_CTRL_ID_HOLLER_AT_ME_BRO: case USRP2_CTRL_ID_HOLLER_BACK_DUDE: case USRP2_CTRL_ID_HUH_WHAT: case USRP2_CTRL_ID_PEACE_OUT: proto_tree_add_item(uhd_tree, hf_uhd_echo_len, tvb, 12, 4, ENC_BIG_ENDIAN); break; } return tvb_captured_length(tvb); } void proto_register_uhd(void) { static hf_register_info hf[] = { { &hf_uhd_version, { "VERSION", "uhd.version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_uhd_id, { "ID", "uhd.id", FT_UINT32, BASE_HEX, VALS(uhd_ids), 0, NULL, HFILL } }, { &hf_uhd_seq, { "SEQ", "uhd.seq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_uhd_ip_addr, { "IP ADDR", "uhd.ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0,"", HFILL } }, { &hf_uhd_i2c_addr, { "I2C ADDR", "uhd.i2c_addr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_i2c_bytes, { "I2C BYTES", "uhd.i2c_bytes", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_uhd_i2c_data, { "I2C DATA", "uhd.i2c_data", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_dev, { "SPI DEV", "uhd.spi_dev", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_data, { "SPI DATA", "uhd.spi_data", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_miso_edge, { "SPI MISO EDGE", "uhd.spi_miso_edge", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_mosi_edge, { "SPI MOSI EDGE", "uhd.spi_mosi_edge", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_num_bits, { "SPI NUM BITS", "uhd.spi_num_bits", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_uhd_spi_readback, { "SPI READBACK", "uhd.spi_readback", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_reg_addr, { "REG ADDR", "uhd.reg_addr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_reg_data, { "REG DATA", "uhd.reg_data", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_uhd_reg_action, { "REG ACTION", "uhd.reg_action", FT_UINT8, BASE_HEX, VALS(uhd_reg_actions), 0, NULL, HFILL } }, { &hf_uhd_echo_len, { "ECHO LEN", "uhd.echo_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, }; static gint *ett[] = { &ett_uhd }; proto_uhd = proto_register_protocol("UHD", "UHD", "uhd"); proto_register_field_array(proto_uhd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_uhd(void) { dissector_handle_t uhd_handle; uhd_handle = create_dissector_handle(dissect_uhd, proto_uhd); dissector_add_for_decode_as_with_preference("udp.port", uhd_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-ulp.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-ulp.c */ /* asn2wrs.py -L -p ulp -c ./ulp.cnf -s ./packet-ulp-template -D . -O ../.. ULP.asn SUPL.asn ULP-Components.asn */ /* packet-ulp.c * Routines for OMA UserPlane Location Protocol packet dissection * Copyright 2006, Anders Broman <[email protected]> * Copyright 2014-2019, Pascal Quantin <[email protected]> * Copyright 2020, Stig Bjorlykke <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * ref OMA-TS-ULP-V2_0_5-20191028-A * http://www.openmobilealliance.org */ #include "config.h" #include "math.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/asn1.h> #include "packet-per.h" #include "packet-tcp.h" #include "packet-gsm_map.h" #include "packet-e164.h" #include "packet-e212.h" #define PNAME "OMA UserPlane Location Protocol" #define PSNAME "ULP" #define PFNAME "ulp" void proto_register_ulp(void); static dissector_handle_t rrlp_handle; static dissector_handle_t lpp_handle; /* IANA Registered Ports * oma-ulp 7275/tcp OMA UserPlane Location * oma-ulp 7275/udp OMA UserPlane Location */ #define ULP_PORT 7275 /* Initialize the protocol and registered fields */ static int proto_ulp = -1; #define ULP_HEADER_SIZE 2 static gboolean ulp_desegment = TRUE; static int hf_ulp_ULP_PDU_PDU = -1; /* ULP_PDU */ static int hf_ulp_length = -1; /* INTEGER_0_65535 */ static int hf_ulp_version = -1; /* Version */ static int hf_ulp_sessionID = -1; /* SessionID */ static int hf_ulp_message = -1; /* UlpMessage */ static int hf_ulp_msSUPLINIT = -1; /* SUPLINIT */ static int hf_ulp_msSUPLSTART = -1; /* SUPLSTART */ static int hf_ulp_msSUPLRESPONSE = -1; /* SUPLRESPONSE */ static int hf_ulp_msSUPLPOSINIT = -1; /* SUPLPOSINIT */ static int hf_ulp_msSUPLPOS = -1; /* SUPLPOS */ static int hf_ulp_msSUPLEND = -1; /* SUPLEND */ static int hf_ulp_msSUPLAUTHREQ = -1; /* SUPLAUTHREQ */ static int hf_ulp_msSUPLAUTHRESP = -1; /* SUPLAUTHRESP */ static int hf_ulp_msSUPLTRIGGEREDSTART = -1; /* Ver2_SUPLTRIGGEREDSTART */ static int hf_ulp_msSUPLTRIGGEREDRESPONSE = -1; /* Ver2_SUPLTRIGGEREDRESPONSE */ static int hf_ulp_msSUPLTRIGGEREDSTOP = -1; /* Ver2_SUPLTRIGGEREDSTOP */ static int hf_ulp_msSUPLNOTIFY = -1; /* Ver2_SUPLNOTIFY */ static int hf_ulp_msSUPLNOTIFYRESPONSE = -1; /* Ver2_SUPLNOTIFYRESPONSE */ static int hf_ulp_msSUPLSETINIT = -1; /* Ver2_SUPLSETINIT */ static int hf_ulp_msSUPLREPORT = -1; /* Ver2_SUPLREPORT */ static int hf_ulp_posMethod = -1; /* PosMethod */ static int hf_ulp_notification = -1; /* Notification */ static int hf_ulp_sLPAddress = -1; /* SLPAddress */ static int hf_ulp_qoP = -1; /* QoP */ static int hf_ulp_sLPMode = -1; /* SLPMode */ static int hf_ulp_mac = -1; /* MAC */ static int hf_ulp_keyIdentity = -1; /* KeyIdentity */ static int hf_ulp_ver2_SUPL_INIT_extension = -1; /* Ver2_SUPL_INIT_extension */ static int hf_ulp_notificationType = -1; /* NotificationType */ static int hf_ulp_encodingType = -1; /* EncodingType */ static int hf_ulp_requestorId = -1; /* T_requestorId */ static int hf_ulp_requestorIdType = -1; /* FormatIndicator */ static int hf_ulp_clientName = -1; /* T_clientName */ static int hf_ulp_clientNameType = -1; /* FormatIndicator */ static int hf_ulp_ver2_Notification_extension = -1; /* Ver2_Notification_extension */ static int hf_ulp_sETCapabilities = -1; /* SETCapabilities */ static int hf_ulp_locationId = -1; /* LocationId */ static int hf_ulp_ver2_SUPL_START_extension = -1; /* Ver2_SUPL_START_extension */ static int hf_ulp_posTechnology = -1; /* PosTechnology */ static int hf_ulp_prefMethod = -1; /* PrefMethod */ static int hf_ulp_posProtocol = -1; /* PosProtocol */ static int hf_ulp_ver2_SETCapabilities_extension = -1; /* Ver2_SETCapabilities_extension */ static int hf_ulp_agpsSETassisted = -1; /* BOOLEAN */ static int hf_ulp_agpsSETBased = -1; /* BOOLEAN */ static int hf_ulp_autonomousGPS = -1; /* BOOLEAN */ static int hf_ulp_aflt = -1; /* BOOLEAN */ static int hf_ulp_ecid = -1; /* BOOLEAN */ static int hf_ulp_eotd = -1; /* BOOLEAN */ static int hf_ulp_otdoa = -1; /* BOOLEAN */ static int hf_ulp_ver2_PosTechnology_extension = -1; /* Ver2_PosTechnology_extension */ static int hf_ulp_tia801 = -1; /* BOOLEAN */ static int hf_ulp_rrlp = -1; /* BOOLEAN */ static int hf_ulp_rrc = -1; /* BOOLEAN */ static int hf_ulp_ver2_PosProtocol_extension = -1; /* Ver2_PosProtocol_extension */ static int hf_ulp_sETAuthKey = -1; /* SETAuthKey */ static int hf_ulp_keyIdentity4 = -1; /* KeyIdentity4 */ static int hf_ulp_ver2_SUPL_RESPONSE_extension = -1; /* Ver2_SUPL_RESPONSE_extension */ static int hf_ulp_shortKey = -1; /* BIT_STRING_SIZE_128 */ static int hf_ulp_longKey = -1; /* BIT_STRING_SIZE_256 */ static int hf_ulp_requestedAssistData = -1; /* RequestedAssistData */ static int hf_ulp_position = -1; /* Position */ static int hf_ulp_suplpos = -1; /* SUPLPOS */ static int hf_ulp_ver = -1; /* Ver */ static int hf_ulp_ver2_SUPL_POS_INIT_extension = -1; /* Ver2_SUPL_POS_INIT_extension */ static int hf_ulp_almanacRequested = -1; /* BOOLEAN */ static int hf_ulp_utcModelRequested = -1; /* BOOLEAN */ static int hf_ulp_ionosphericModelRequested = -1; /* BOOLEAN */ static int hf_ulp_dgpsCorrectionsRequested = -1; /* BOOLEAN */ static int hf_ulp_referenceLocationRequested = -1; /* BOOLEAN */ static int hf_ulp_referenceTimeRequested = -1; /* BOOLEAN */ static int hf_ulp_acquisitionAssistanceRequested = -1; /* BOOLEAN */ static int hf_ulp_realTimeIntegrityRequested = -1; /* BOOLEAN */ static int hf_ulp_navigationModelRequested = -1; /* BOOLEAN */ static int hf_ulp_navigationModelData = -1; /* NavigationModel */ static int hf_ulp_ver2_RequestedAssistData_extension = -1; /* Ver2_RequestedAssistData_extension */ static int hf_ulp_gpsWeek = -1; /* INTEGER_0_1023 */ static int hf_ulp_gpsToe = -1; /* INTEGER_0_167 */ static int hf_ulp_nsat = -1; /* INTEGER_0_31 */ static int hf_ulp_toeLimit = -1; /* INTEGER_0_10 */ static int hf_ulp_satInfo = -1; /* SatelliteInfo */ static int hf_ulp_SatelliteInfo_item = -1; /* SatelliteInfoElement */ static int hf_ulp_satId = -1; /* INTEGER_0_63 */ static int hf_ulp_iode = -1; /* INTEGER_0_255 */ static int hf_ulp_posPayLoad = -1; /* PosPayLoad */ static int hf_ulp_velocity = -1; /* Velocity */ static int hf_ulp_ver2_SUPL_POS_extension = -1; /* Ver2_SUPL_POS_extension */ static int hf_ulp_tia801payload = -1; /* OCTET_STRING_SIZE_1_8192 */ static int hf_ulp_rrcPayload = -1; /* OCTET_STRING_SIZE_1_8192 */ static int hf_ulp_rrlpPayload = -1; /* T_rrlpPayload */ static int hf_ulp_ver2_PosPayLoad_extension = -1; /* Ver2_PosPayLoad_extension */ static int hf_ulp_statusCode = -1; /* StatusCode */ static int hf_ulp_ver2_SUPL_END_extension = -1; /* Ver2_SUPL_END_extension */ static int hf_ulp_sPCSETKey = -1; /* SPCSETKey */ static int hf_ulp_spctid = -1; /* SPCTID */ static int hf_ulp_sPCSETKeylifetime = -1; /* SPCSETKeylifetime */ static int hf_ulp_notificationResponse = -1; /* NotificationResponse */ static int hf_ulp_targetSETID = -1; /* SETId */ static int hf_ulp_applicationID = -1; /* ApplicationID */ static int hf_ulp_multipleLocationIds = -1; /* MultipleLocationIds */ static int hf_ulp_thirdParty = -1; /* ThirdParty */ static int hf_ulp_triggerType = -1; /* TriggerType */ static int hf_ulp_triggerParams = -1; /* TriggerParams */ static int hf_ulp_reportingCap = -1; /* ReportingCap */ static int hf_ulp_causeCode = -1; /* CauseCode */ static int hf_ulp_periodicParams = -1; /* PeriodicParams */ static int hf_ulp_areaEventParams = -1; /* AreaEventParams */ static int hf_ulp_numberOfFixes = -1; /* INTEGER_1_8639999 */ static int hf_ulp_intervalBetweenFixes = -1; /* INTEGER_1_8639999 */ static int hf_ulp_startTime = -1; /* INTEGER_0_2678400 */ static int hf_ulp_areaEventType = -1; /* AreaEventType */ static int hf_ulp_locationEstimate = -1; /* BOOLEAN */ static int hf_ulp_repeatedReportingParams = -1; /* RepeatedReportingParams */ static int hf_ulp_stopTime = -1; /* INTEGER_0_11318399 */ static int hf_ulp_geographicTargetAreaList = -1; /* GeographicTargetAreaList */ static int hf_ulp_areaIdLists = -1; /* SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList */ static int hf_ulp_areaIdLists_item = -1; /* AreaIdList */ static int hf_ulp_minimumIntervalTime = -1; /* INTEGER_1_604800 */ static int hf_ulp_maximumNumberOfReports = -1; /* INTEGER_1_1024 */ static int hf_ulp_GeographicTargetAreaList_item = -1; /* GeographicTargetArea */ static int hf_ulp_circularArea = -1; /* CircularArea */ static int hf_ulp_ellipticalArea = -1; /* EllipticalArea */ static int hf_ulp_polygonArea = -1; /* PolygonArea */ static int hf_ulp_areaIdSet = -1; /* AreaIdSet */ static int hf_ulp_areaIdSetType = -1; /* AreaIdSetType */ static int hf_ulp_geoAreaMappingList = -1; /* GeoAreaMappingList */ static int hf_ulp_AreaIdSet_item = -1; /* AreaId */ static int hf_ulp_gSMAreaId = -1; /* GSMAreaId */ static int hf_ulp_wCDMAAreaId = -1; /* WCDMAAreaId */ static int hf_ulp_cDMAAreaId = -1; /* CDMAAreaId */ static int hf_ulp_hRPDAreaId = -1; /* HRPDAreaId */ static int hf_ulp_uMBAreaId = -1; /* UMBAreaId */ static int hf_ulp_lTEAreaId = -1; /* LTEAreaId */ static int hf_ulp_wLANAreaId = -1; /* WLANAreaId */ static int hf_ulp_wiMAXAreaId = -1; /* WimaxAreaId */ static int hf_ulp_nRAreaId = -1; /* NRAreaId */ static int hf_ulp_refMCC = -1; /* INTEGER_0_999 */ static int hf_ulp_refMNC = -1; /* INTEGER_0_999 */ static int hf_ulp_refLAC = -1; /* INTEGER_0_65535 */ static int hf_ulp_refCI = -1; /* INTEGER_0_65535 */ static int hf_ulp_refUC = -1; /* INTEGER_0_268435455 */ static int hf_ulp_refSID = -1; /* INTEGER_0_65535 */ static int hf_ulp_refNID = -1; /* INTEGER_0_32767 */ static int hf_ulp_refBASEID = -1; /* INTEGER_0_65535 */ static int hf_ulp_refSECTORID = -1; /* BIT_STRING_SIZE_128 */ static int hf_ulp_refCI_01 = -1; /* BIT_STRING_SIZE_29 */ static int hf_ulp_apMACAddress = -1; /* T_apMACAddress */ static int hf_ulp_bsID_MSB = -1; /* BIT_STRING_SIZE_24 */ static int hf_ulp_bsID_LSB = -1; /* BIT_STRING_SIZE_24 */ static int hf_ulp_refCI_02 = -1; /* BIT_STRING_SIZE_36 */ static int hf_ulp_GeoAreaMappingList_item = -1; /* GeoAreaIndex */ static int hf_ulp_supportedNetworkInformation = -1; /* SupportedNetworkInformation */ static int hf_ulp_reportingMode = -1; /* ReportingMode */ static int hf_ulp_gnssPosTechnology = -1; /* GNSSPosTechnology */ static int hf_ulp_repMode = -1; /* RepModee */ static int hf_ulp_batchRepConditions = -1; /* BatchRepConditions */ static int hf_ulp_batchRepType = -1; /* BatchRepType */ static int hf_ulp_num_interval = -1; /* INTEGER_1_1024 */ static int hf_ulp_num_minutes = -1; /* INTEGER_1_2048 */ static int hf_ulp_endofsession = -1; /* NULL */ static int hf_ulp_reportPosition = -1; /* BOOLEAN */ static int hf_ulp_reportMeasurements = -1; /* BOOLEAN */ static int hf_ulp_intermediateReports = -1; /* BOOLEAN */ static int hf_ulp_discardOldest = -1; /* BOOLEAN */ static int hf_ulp_sessionList = -1; /* SessionList */ static int hf_ulp_reportDataList = -1; /* ReportDataList */ static int hf_ulp_moreComponents = -1; /* NULL */ static int hf_ulp_SessionList_item = -1; /* SessionInformation */ static int hf_ulp_ReportDataList_item = -1; /* ReportData */ static int hf_ulp_positionData = -1; /* PositionData */ static int hf_ulp_resultCode = -1; /* ResultCode */ static int hf_ulp_timestamp = -1; /* TimeStamp */ static int hf_ulp_ganssSignalsInfo = -1; /* GANSSsignalsInfo */ static int hf_ulp_GANSSsignalsInfo_item = -1; /* GANSSSignalsDescription */ static int hf_ulp_ganssId = -1; /* INTEGER_0_15 */ static int hf_ulp_gANSSSignals = -1; /* GANSSSignals */ static int hf_ulp_absoluteTime = -1; /* UTCTime */ static int hf_ulp_relativeTime = -1; /* INTEGER_0_31536000 */ static int hf_ulp_notificationMode = -1; /* NotificationMode */ static int hf_ulp_e_SLPAddress = -1; /* SLPAddress */ static int hf_ulp_historicReporting = -1; /* HistoricReporting */ static int hf_ulp_protectionLevel = -1; /* ProtectionLevel */ static int hf_ulp_minimumMajorVersion = -1; /* INTEGER_0_255 */ static int hf_ulp_allowedReportingType = -1; /* AllowedReportingType */ static int hf_ulp_reportingCriteria = -1; /* ReportingCriteria */ static int hf_ulp_timeWindow = -1; /* TimeWindow */ static int hf_ulp_maxNumberofReports = -1; /* INTEGER_1_65536 */ static int hf_ulp_minTimeInterval = -1; /* INTEGER_1_86400 */ static int hf_ulp_startTime_01 = -1; /* INTEGER_M525600_M1 */ static int hf_ulp_stopTime_01 = -1; /* INTEGER_M525599_0 */ static int hf_ulp_protlevel = -1; /* ProtLevel */ static int hf_ulp_basicProtectionParams = -1; /* BasicProtectionParams */ static int hf_ulp_keyIdentifier = -1; /* OCTET_STRING_SIZE_8 */ static int hf_ulp_basicReplayCounter = -1; /* INTEGER_0_65535 */ static int hf_ulp_basicMAC = -1; /* BIT_STRING_SIZE_32 */ static int hf_ulp_initialApproximateposition = -1; /* Position */ static int hf_ulp_utran_GPSReferenceTimeResult = -1; /* UTRAN_GPSReferenceTimeResult */ static int hf_ulp_utran_GANSSReferenceTimeResult = -1; /* UTRAN_GANSSReferenceTimeResult */ static int hf_ulp_utran_GPSReferenceTimeAssistance = -1; /* UTRAN_GPSReferenceTimeAssistance */ static int hf_ulp_utran_GANSSReferenceTimeAssistance = -1; /* UTRAN_GANSSReferenceTimeAssistance */ static int hf_ulp_ver2_HighAccuracyPosition = -1; /* Ver2_HighAccuracyPosition */ static int hf_ulp_emergencyCallLocation = -1; /* NULL */ static int hf_ulp_serviceCapabilities = -1; /* ServiceCapabilities */ static int hf_ulp_supportedBearers = -1; /* SupportedBearers */ static int hf_ulp_servicesSupported = -1; /* ServicesSupported */ static int hf_ulp_reportingCapabilities = -1; /* ReportingCap */ static int hf_ulp_eventTriggerCapabilities = -1; /* EventTriggerCapabilities */ static int hf_ulp_sessionCapabilities = -1; /* SessionCapabilities */ static int hf_ulp_periodicTrigger = -1; /* BOOLEAN */ static int hf_ulp_areaEventTrigger = -1; /* BOOLEAN */ static int hf_ulp_geoAreaShapesSupported = -1; /* GeoAreaShapesSupported */ static int hf_ulp_maxNumGeoAreaSupported = -1; /* INTEGER_0_maxNumGeoArea */ static int hf_ulp_maxAreaIdListSupported = -1; /* INTEGER_0_maxAreaIdList */ static int hf_ulp_maxAreaIdSupportedPerList = -1; /* INTEGER_0_maxAreaId */ static int hf_ulp_ellipticalArea_01 = -1; /* BOOLEAN */ static int hf_ulp_polygonArea_01 = -1; /* BOOLEAN */ static int hf_ulp_maxNumberTotalSessions = -1; /* INTEGER_1_128 */ static int hf_ulp_maxNumberPeriodicSessions = -1; /* INTEGER_1_32 */ static int hf_ulp_maxNumberTriggeredSessions = -1; /* INTEGER_1_32 */ static int hf_ulp_gsm = -1; /* BOOLEAN */ static int hf_ulp_wcdma = -1; /* BOOLEAN */ static int hf_ulp_lte = -1; /* BOOLEAN */ static int hf_ulp_cdma = -1; /* BOOLEAN */ static int hf_ulp_hprd = -1; /* BOOLEAN */ static int hf_ulp_umb = -1; /* BOOLEAN */ static int hf_ulp_wlan = -1; /* BOOLEAN */ static int hf_ulp_wiMAX = -1; /* BOOLEAN */ static int hf_ulp_nr = -1; /* BOOLEAN */ static int hf_ulp_lpp = -1; /* BOOLEAN */ static int hf_ulp_posProtocolVersionRRLP = -1; /* PosProtocolVersion3GPP */ static int hf_ulp_posProtocolVersionRRC = -1; /* PosProtocolVersion3GPP */ static int hf_ulp_posProtocolVersionTIA801 = -1; /* PosProtocolVersion3GPP2 */ static int hf_ulp_posProtocolVersionLPP = -1; /* PosProtocolVersion3GPP */ static int hf_ulp_lppe = -1; /* BOOLEAN */ static int hf_ulp_posProtocolVersionLPPe = -1; /* PosProtocolVersionOMA */ static int hf_ulp_majorVersionField = -1; /* INTEGER_0_255 */ static int hf_ulp_technicalVersionField = -1; /* INTEGER_0_255 */ static int hf_ulp_editorialVersionField = -1; /* INTEGER_0_255 */ static int hf_ulp_PosProtocolVersion3GPP2_item = -1; /* Supported3GPP2PosProtocolVersion */ static int hf_ulp_revisionNumber = -1; /* BIT_STRING_SIZE_6 */ static int hf_ulp_pointReleaseNumber = -1; /* INTEGER_0_255 */ static int hf_ulp_internalEditLevel = -1; /* INTEGER_0_255 */ static int hf_ulp_minorVersionField = -1; /* INTEGER_0_255 */ static int hf_ulp_gANSSPositionMethods = -1; /* GANSSPositionMethods */ static int hf_ulp_additionalPositioningMethods = -1; /* AdditionalPositioningMethods */ static int hf_ulp_GANSSPositionMethods_item = -1; /* GANSSPositionMethod */ static int hf_ulp_ganssSBASid = -1; /* T_ganssSBASid */ static int hf_ulp_gANSSPositioningMethodTypes = -1; /* GANSSPositioningMethodTypes */ static int hf_ulp_rtk = -1; /* RTK */ static int hf_ulp_osr = -1; /* BOOLEAN */ static int hf_ulp_setAssisted = -1; /* BOOLEAN */ static int hf_ulp_setBased = -1; /* BOOLEAN */ static int hf_ulp_autonomous = -1; /* BOOLEAN */ static int hf_ulp_AdditionalPositioningMethods_item = -1; /* AddPosSupport_Element */ static int hf_ulp_addPosID = -1; /* T_addPosID */ static int hf_ulp_addPosMode = -1; /* T_addPosMode */ static int hf_ulp_ganssRequestedCommonAssistanceDataList = -1; /* GanssRequestedCommonAssistanceDataList */ static int hf_ulp_ganssRequestedGenericAssistanceDataList = -1; /* GanssRequestedGenericAssistanceDataList */ static int hf_ulp_extendedEphemeris = -1; /* ExtendedEphemeris */ static int hf_ulp_extendedEphemerisCheck = -1; /* ExtendedEphCheck */ static int hf_ulp_ganssReferenceTime = -1; /* BOOLEAN */ static int hf_ulp_ganssIonosphericModel = -1; /* BOOLEAN */ static int hf_ulp_ganssAdditionalIonosphericModelForDataID00 = -1; /* BOOLEAN */ static int hf_ulp_ganssAdditionalIonosphericModelForDataID11 = -1; /* BOOLEAN */ static int hf_ulp_ganssEarthOrientationParameters = -1; /* BOOLEAN */ static int hf_ulp_ganssAdditionalIonosphericModelForDataID01 = -1; /* BOOLEAN */ static int hf_ulp_GanssRequestedGenericAssistanceDataList_item = -1; /* GanssReqGenericData */ static int hf_ulp_ganssId_01 = -1; /* T_ganssId */ static int hf_ulp_ganssSBASid_01 = -1; /* T_ganssSBASid_01 */ static int hf_ulp_ganssRealTimeIntegrity = -1; /* BOOLEAN */ static int hf_ulp_ganssDifferentialCorrection = -1; /* DGANSS_Sig_Id_Req */ static int hf_ulp_ganssAlmanac = -1; /* BOOLEAN */ static int hf_ulp_ganssNavigationModelData = -1; /* GanssNavigationModelData */ static int hf_ulp_ganssTimeModels = -1; /* T_ganssTimeModels */ static int hf_ulp_ganssReferenceMeasurementInfo = -1; /* BOOLEAN */ static int hf_ulp_ganssDataBits = -1; /* GanssDataBits */ static int hf_ulp_ganssUTCModel = -1; /* BOOLEAN */ static int hf_ulp_ganssAdditionalDataChoices = -1; /* GanssAdditionalDataChoices */ static int hf_ulp_ganssAuxiliaryInformation = -1; /* BOOLEAN */ static int hf_ulp_ganssExtendedEphemeris = -1; /* ExtendedEphemeris */ static int hf_ulp_ganssExtendedEphemerisCheck = -1; /* GanssExtendedEphCheck */ static int hf_ulp_bds_DifferentialCorrection = -1; /* BDS_Sig_Id_Req */ static int hf_ulp_bds_GridModelReq = -1; /* BOOLEAN */ static int hf_ulp_ganssWeek = -1; /* T_ganssWeek */ static int hf_ulp_ganssToe = -1; /* T_ganssToe */ static int hf_ulp_t_toeLimit = -1; /* T_t_toeLimit */ static int hf_ulp_satellitesListRelatedDataList = -1; /* SatellitesListRelatedDataList */ static int hf_ulp_SatellitesListRelatedDataList_item = -1; /* SatellitesListRelatedData */ static int hf_ulp_iod = -1; /* INTEGER_0_1023 */ static int hf_ulp_ganssTODmin = -1; /* INTEGER_0_59 */ static int hf_ulp_reqDataBitAssistanceList = -1; /* ReqDataBitAssistanceList */ static int hf_ulp_gnssSignals = -1; /* GANSSSignals */ static int hf_ulp_ganssDataBitInterval = -1; /* INTEGER_0_15 */ static int hf_ulp_ganssDataBitSatList = -1; /* T_ganssDataBitSatList */ static int hf_ulp_ganssDataBitSatList_item = -1; /* INTEGER_0_63 */ static int hf_ulp_orbitModelID = -1; /* INTEGER_0_7 */ static int hf_ulp_clockModelID = -1; /* INTEGER_0_7 */ static int hf_ulp_utcModelID = -1; /* INTEGER_0_7 */ static int hf_ulp_almanacModelID = -1; /* INTEGER_0_7 */ static int hf_ulp_validity = -1; /* INTEGER_1_256 */ static int hf_ulp_beginTime = -1; /* GPSTime */ static int hf_ulp_endTime = -1; /* GPSTime */ static int hf_ulp_beginTime_01 = -1; /* GANSSextEphTime */ static int hf_ulp_endTime_01 = -1; /* GANSSextEphTime */ static int hf_ulp_gPSWeek = -1; /* INTEGER_0_1023 */ static int hf_ulp_gPSTOWhour = -1; /* INTEGER_0_167 */ static int hf_ulp_gANSSday = -1; /* INTEGER_0_8191 */ static int hf_ulp_gANSSTODhour = -1; /* INTEGER_0_23 */ static int hf_ulp_lPPPayload = -1; /* T_lPPPayload */ static int hf_ulp_lPPPayload_item = -1; /* T_lPPPayload_item */ static int hf_ulp_tia801Payload = -1; /* T_tia801Payload */ static int hf_ulp_tia801Payload_item = -1; /* OCTET_STRING_SIZE_1_60000 */ static int hf_ulp_maj = -1; /* INTEGER_0_255 */ static int hf_ulp_min = -1; /* INTEGER_0_255 */ static int hf_ulp_servind = -1; /* INTEGER_0_255 */ static int hf_ulp_setSessionID = -1; /* SetSessionID */ static int hf_ulp_slpSessionID = -1; /* SlpSessionID */ static int hf_ulp_sessionId = -1; /* INTEGER_0_65535 */ static int hf_ulp_setId = -1; /* SETId */ static int hf_ulp_msisdn = -1; /* T_msisdn */ static int hf_ulp_mdn = -1; /* T_mdn */ static int hf_ulp_minsi = -1; /* BIT_STRING_SIZE_34 */ static int hf_ulp_imsi = -1; /* T_imsi */ static int hf_ulp_nai = -1; /* IA5String_SIZE_1_1000 */ static int hf_ulp_iPAddress = -1; /* IPAddress */ static int hf_ulp_ver2_imei = -1; /* OCTET_STRING_SIZE_8 */ static int hf_ulp_sessionSlpID = -1; /* OCTET_STRING_SIZE_4 */ static int hf_ulp_slpId = -1; /* SLPAddress */ static int hf_ulp_ipv4Address = -1; /* OCTET_STRING_SIZE_4 */ static int hf_ulp_ipv6Address = -1; /* OCTET_STRING_SIZE_16 */ static int hf_ulp_fqdn = -1; /* FQDN */ static int hf_ulp_cellInfo = -1; /* CellInfo */ static int hf_ulp_status = -1; /* Status */ static int hf_ulp_gsmCell = -1; /* GsmCellInformation */ static int hf_ulp_wcdmaCell = -1; /* WcdmaCellInformation */ static int hf_ulp_cdmaCell = -1; /* CdmaCellInformation */ static int hf_ulp_ver2_CellInfo_extension = -1; /* Ver2_CellInfo_extension */ static int hf_ulp_timestamp_01 = -1; /* UTCTime */ static int hf_ulp_positionEstimate = -1; /* PositionEstimate */ static int hf_ulp_latitudeSign = -1; /* T_latitudeSign */ static int hf_ulp_latitude = -1; /* INTEGER_0_8388607 */ static int hf_ulp_longitude = -1; /* INTEGER_M8388608_8388607 */ static int hf_ulp_uncertainty = -1; /* T_uncertainty */ static int hf_ulp_uncertaintySemiMajor = -1; /* INTEGER_0_127 */ static int hf_ulp_uncertaintySemiMinor = -1; /* INTEGER_0_127 */ static int hf_ulp_orientationMajorAxis = -1; /* INTEGER_0_180 */ static int hf_ulp_confidence = -1; /* INTEGER_0_100 */ static int hf_ulp_altitudeInfo = -1; /* AltitudeInfo */ static int hf_ulp_altitudeDirection = -1; /* T_altitudeDirection */ static int hf_ulp_altitude = -1; /* INTEGER_0_32767 */ static int hf_ulp_altUncertainty = -1; /* INTEGER_0_127 */ static int hf_ulp_refNID_01 = -1; /* INTEGER_0_65535 */ static int hf_ulp_refSID_01 = -1; /* INTEGER_0_32767 */ static int hf_ulp_refBASELAT = -1; /* INTEGER_0_4194303 */ static int hf_ulp_reBASELONG = -1; /* INTEGER_0_8388607 */ static int hf_ulp_refREFPN = -1; /* INTEGER_0_511 */ static int hf_ulp_refWeekNumber = -1; /* INTEGER_0_65535 */ static int hf_ulp_refSeconds = -1; /* INTEGER_0_4194303 */ static int hf_ulp_nmr = -1; /* NMR */ static int hf_ulp_ta = -1; /* INTEGER_0_255 */ static int hf_ulp_frequencyInfo = -1; /* FrequencyInfo */ static int hf_ulp_primaryScramblingCode = -1; /* INTEGER_0_511 */ static int hf_ulp_measuredResultsList = -1; /* MeasuredResultsList */ static int hf_ulp_cellParametersId = -1; /* INTEGER_0_127 */ static int hf_ulp_timingAdvance = -1; /* TimingAdvance */ static int hf_ulp_ta_01 = -1; /* INTEGER_0_8191 */ static int hf_ulp_tAResolution = -1; /* TAResolution */ static int hf_ulp_chipRate = -1; /* ChipRate */ static int hf_ulp_modeSpecificFrequencyInfo = -1; /* FrequencySpecificInfo */ static int hf_ulp_fdd_fr = -1; /* FrequencyInfoFDD */ static int hf_ulp_tdd_fr = -1; /* FrequencyInfoTDD */ static int hf_ulp_uarfcn_UL = -1; /* UARFCN */ static int hf_ulp_uarfcn_DL = -1; /* UARFCN */ static int hf_ulp_uarfcn_Nt = -1; /* UARFCN */ static int hf_ulp_NMR_item = -1; /* NMRelement */ static int hf_ulp_arfcn = -1; /* INTEGER_0_1023 */ static int hf_ulp_bsic = -1; /* INTEGER_0_63 */ static int hf_ulp_rxLev = -1; /* INTEGER_0_63 */ static int hf_ulp_MeasuredResultsList_item = -1; /* MeasuredResults */ static int hf_ulp_utra_CarrierRSSI = -1; /* UTRA_CarrierRSSI */ static int hf_ulp_cellMeasuredResultsList = -1; /* CellMeasuredResultsList */ static int hf_ulp_CellMeasuredResultsList_item = -1; /* CellMeasuredResults */ static int hf_ulp_cellIdentity = -1; /* INTEGER_0_268435455 */ static int hf_ulp_modeSpecificInfo = -1; /* T_modeSpecificInfo */ static int hf_ulp_fdd = -1; /* T_fdd */ static int hf_ulp_primaryCPICH_Info = -1; /* PrimaryCPICH_Info */ static int hf_ulp_cpich_Ec_N0 = -1; /* CPICH_Ec_N0 */ static int hf_ulp_cpich_RSCP = -1; /* CPICH_RSCP */ static int hf_ulp_pathloss = -1; /* Pathloss */ static int hf_ulp_tdd = -1; /* T_tdd */ static int hf_ulp_cellParametersID = -1; /* CellParametersID */ static int hf_ulp_proposedTGSN = -1; /* TGSN */ static int hf_ulp_primaryCCPCH_RSCP = -1; /* PrimaryCCPCH_RSCP */ static int hf_ulp_timeslotISCP_List = -1; /* TimeslotISCP_List */ static int hf_ulp_TimeslotISCP_List_item = -1; /* TimeslotISCP */ static int hf_ulp_horacc = -1; /* INTEGER_0_127 */ static int hf_ulp_veracc = -1; /* INTEGER_0_127 */ static int hf_ulp_maxLocAge = -1; /* INTEGER_0_65535 */ static int hf_ulp_delay = -1; /* INTEGER_0_7 */ static int hf_ulp_ver2_responseTime = -1; /* INTEGER_1_128 */ static int hf_ulp_horvel = -1; /* Horvel */ static int hf_ulp_horandvervel = -1; /* Horandvervel */ static int hf_ulp_horveluncert = -1; /* Horveluncert */ static int hf_ulp_horandveruncert = -1; /* Horandveruncert */ static int hf_ulp_bearing = -1; /* T_bearing */ static int hf_ulp_horspeed = -1; /* T_horspeed */ static int hf_ulp_verdirect = -1; /* T_verdirect */ static int hf_ulp_bearing_01 = -1; /* T_bearing_01 */ static int hf_ulp_horspeed_01 = -1; /* T_horspeed_01 */ static int hf_ulp_verspeed = -1; /* T_verspeed */ static int hf_ulp_bearing_02 = -1; /* T_bearing_02 */ static int hf_ulp_horspeed_02 = -1; /* T_horspeed_02 */ static int hf_ulp_uncertspeed = -1; /* T_uncertspeed */ static int hf_ulp_verdirect_01 = -1; /* T_verdirect_01 */ static int hf_ulp_bearing_03 = -1; /* T_bearing_03 */ static int hf_ulp_horspeed_03 = -1; /* T_horspeed_03 */ static int hf_ulp_verspeed_01 = -1; /* T_verspeed_01 */ static int hf_ulp_horuncertspeed = -1; /* T_horuncertspeed */ static int hf_ulp_veruncertspeed = -1; /* T_veruncertspeed */ static int hf_ulp_MultipleLocationIds_item = -1; /* LocationIdData */ static int hf_ulp_relativetimestamp = -1; /* RelativeTime */ static int hf_ulp_servingFlag = -1; /* BOOLEAN */ static int hf_ulp_supportedWLANInfo = -1; /* SupportedWLANInfo */ static int hf_ulp_supportedWLANApsList = -1; /* SupportedWLANApsList */ static int hf_ulp_supportedWCDMAInfo = -1; /* SupportedWCDMAInfo */ static int hf_ulp_hrdp = -1; /* BOOLEAN */ static int hf_ulp_wimax = -1; /* BOOLEAN */ static int hf_ulp_historic = -1; /* BOOLEAN */ static int hf_ulp_nonServing = -1; /* BOOLEAN */ static int hf_ulp_uTRANGPSReferenceTime = -1; /* BOOLEAN */ static int hf_ulp_uTRANGANSSReferenceTime = -1; /* BOOLEAN */ static int hf_ulp_apTP = -1; /* BOOLEAN */ static int hf_ulp_apAG = -1; /* BOOLEAN */ static int hf_ulp_apSN = -1; /* BOOLEAN */ static int hf_ulp_apDevType = -1; /* BOOLEAN */ static int hf_ulp_apRSSI = -1; /* BOOLEAN */ static int hf_ulp_apChanFreq = -1; /* BOOLEAN */ static int hf_ulp_apRTD = -1; /* BOOLEAN */ static int hf_ulp_setTP = -1; /* BOOLEAN */ static int hf_ulp_setAG = -1; /* BOOLEAN */ static int hf_ulp_setSN = -1; /* BOOLEAN */ static int hf_ulp_setRSSI = -1; /* BOOLEAN */ static int hf_ulp_apRepLoc = -1; /* BOOLEAN */ static int hf_ulp_apRL = -1; /* BOOLEAN */ static int hf_ulp_opClass = -1; /* BOOLEAN */ static int hf_ulp_apSSID = -1; /* BOOLEAN */ static int hf_ulp_apPHYType = -1; /* BOOLEAN */ static int hf_ulp_setMACAddress = -1; /* BOOLEAN */ static int hf_ulp_supportedWLANApDataList = -1; /* SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData */ static int hf_ulp_supportedWLANApDataList_item = -1; /* SupportedWLANApData */ static int hf_ulp_supportedWLANapsChannel11a = -1; /* SupportedWLANApsChannel11a */ static int hf_ulp_supportedWLANapsChannel11bg = -1; /* SupportedWLANApsChannel11bg */ static int hf_ulp_ch34 = -1; /* BOOLEAN */ static int hf_ulp_ch36 = -1; /* BOOLEAN */ static int hf_ulp_ch38 = -1; /* BOOLEAN */ static int hf_ulp_ch40 = -1; /* BOOLEAN */ static int hf_ulp_ch42 = -1; /* BOOLEAN */ static int hf_ulp_ch44 = -1; /* BOOLEAN */ static int hf_ulp_ch46 = -1; /* BOOLEAN */ static int hf_ulp_ch48 = -1; /* BOOLEAN */ static int hf_ulp_ch52 = -1; /* BOOLEAN */ static int hf_ulp_ch56 = -1; /* BOOLEAN */ static int hf_ulp_ch60 = -1; /* BOOLEAN */ static int hf_ulp_ch64 = -1; /* BOOLEAN */ static int hf_ulp_ch149 = -1; /* BOOLEAN */ static int hf_ulp_ch153 = -1; /* BOOLEAN */ static int hf_ulp_ch157 = -1; /* BOOLEAN */ static int hf_ulp_ch161 = -1; /* BOOLEAN */ static int hf_ulp_ch1 = -1; /* BOOLEAN */ static int hf_ulp_ch2 = -1; /* BOOLEAN */ static int hf_ulp_ch3 = -1; /* BOOLEAN */ static int hf_ulp_ch4 = -1; /* BOOLEAN */ static int hf_ulp_ch5 = -1; /* BOOLEAN */ static int hf_ulp_ch6 = -1; /* BOOLEAN */ static int hf_ulp_ch7 = -1; /* BOOLEAN */ static int hf_ulp_ch8 = -1; /* BOOLEAN */ static int hf_ulp_ch9 = -1; /* BOOLEAN */ static int hf_ulp_ch10 = -1; /* BOOLEAN */ static int hf_ulp_ch11 = -1; /* BOOLEAN */ static int hf_ulp_ch12 = -1; /* BOOLEAN */ static int hf_ulp_ch13 = -1; /* BOOLEAN */ static int hf_ulp_ch14 = -1; /* BOOLEAN */ static int hf_ulp_apMACAddress_01 = -1; /* T_apMACAddress_01 */ static int hf_ulp_apDevType_01 = -1; /* T_apDevType */ static int hf_ulp_mrl = -1; /* BOOLEAN */ static int hf_ulp_hrpdCell = -1; /* HrpdCellInformation */ static int hf_ulp_umbCell = -1; /* UmbCellInformation */ static int hf_ulp_lteCell = -1; /* LteCellInformation */ static int hf_ulp_wlanAP = -1; /* WlanAPInformation */ static int hf_ulp_wimaxBS = -1; /* WimaxBSInformation */ static int hf_ulp_nrCell = -1; /* NRCellInformation */ static int hf_ulp_cellGlobalIdEUTRA = -1; /* CellGlobalIdEUTRA */ static int hf_ulp_physCellId = -1; /* PhysCellId */ static int hf_ulp_trackingAreaCode = -1; /* TrackingAreaCode */ static int hf_ulp_rsrpResult = -1; /* RSRP_Range */ static int hf_ulp_rsrqResult = -1; /* RSRQ_Range */ static int hf_ulp_ta_02 = -1; /* INTEGER_0_1282 */ static int hf_ulp_measResultListEUTRA = -1; /* MeasResultListEUTRA */ static int hf_ulp_earfcn = -1; /* INTEGER_0_65535 */ static int hf_ulp_earfcn_ext = -1; /* INTEGER_65536_262143 */ static int hf_ulp_rsrpResult_ext = -1; /* RSRP_Range_Ext */ static int hf_ulp_rsrqResult_ext = -1; /* RSRQ_Range_Ext */ static int hf_ulp_rs_sinrResult = -1; /* RS_SINR_Range */ static int hf_ulp_servingInformation5G = -1; /* ServingInformation5G */ static int hf_ulp_MeasResultListEUTRA_item = -1; /* MeasResultEUTRA */ static int hf_ulp_cgi_Info = -1; /* T_cgi_Info */ static int hf_ulp_cellGlobalId = -1; /* CellGlobalIdEUTRA */ static int hf_ulp_measResult = -1; /* T_measResult */ static int hf_ulp_neighbourInformation5G = -1; /* NeighbourInformation5G */ static int hf_ulp_plmn_Identity = -1; /* PLMN_Identity */ static int hf_ulp_cellIdentity_01 = -1; /* CellIdentity */ static int hf_ulp_mcc = -1; /* MCC */ static int hf_ulp_mnc = -1; /* MNC */ static int hf_ulp_MCC_item = -1; /* MCC_MNC_Digit */ static int hf_ulp_MNC_item = -1; /* MCC_MNC_Digit */ static int hf_ulp_trackingAreaCode_01 = -1; /* TrackingAreaCodeNR */ static int hf_ulp_apMACAddress_02 = -1; /* T_apMACAddress_02 */ static int hf_ulp_apTransmitPower = -1; /* INTEGER_M127_128 */ static int hf_ulp_apAntennaGain = -1; /* INTEGER_M127_128 */ static int hf_ulp_apSignaltoNoise = -1; /* INTEGER_M127_128 */ static int hf_ulp_apDeviceType = -1; /* T_apDeviceType */ static int hf_ulp_apSignalStrength = -1; /* INTEGER_M127_128 */ static int hf_ulp_apChannelFrequency = -1; /* INTEGER_0_256 */ static int hf_ulp_apRoundTripDelay = -1; /* RTD */ static int hf_ulp_setTransmitPower = -1; /* INTEGER_M127_128 */ static int hf_ulp_setAntennaGain = -1; /* INTEGER_M127_128 */ static int hf_ulp_setSignaltoNoise = -1; /* INTEGER_M127_128 */ static int hf_ulp_setSignalStrength = -1; /* INTEGER_M127_128 */ static int hf_ulp_apReportedLocation = -1; /* ReportedLocation */ static int hf_ulp_apRepLocation = -1; /* RepLocation */ static int hf_ulp_apSignalStrengthDelta = -1; /* INTEGER_0_1 */ static int hf_ulp_apSignaltoNoiseDelta = -1; /* INTEGER_0_1 */ static int hf_ulp_setSignalStrengthDelta = -1; /* INTEGER_0_1 */ static int hf_ulp_setSignaltoNoiseDelta = -1; /* INTEGER_0_1 */ static int hf_ulp_operatingClass = -1; /* INTEGER_0_255 */ static int hf_ulp_apSSID_01 = -1; /* T_apSSID */ static int hf_ulp_apPHYType_01 = -1; /* T_apPHYType */ static int hf_ulp_setMACAddress_01 = -1; /* T_setMACAddress */ static int hf_ulp_rTDValue = -1; /* INTEGER_0_16777216 */ static int hf_ulp_rTDUnits = -1; /* RTDUnits */ static int hf_ulp_rTDAccuracy = -1; /* INTEGER_0_255 */ static int hf_ulp_locationEncodingDescriptor = -1; /* LocationEncodingDescriptor */ static int hf_ulp_locationData = -1; /* LocationData */ static int hf_ulp_locationAccuracy = -1; /* INTEGER_0_4294967295 */ static int hf_ulp_locationValue = -1; /* OCTET_STRING_SIZE_1_128 */ static int hf_ulp_lciLocData = -1; /* LciLocData */ static int hf_ulp_locationDataLCI = -1; /* LocationDataLCI */ static int hf_ulp_latitudeResolution = -1; /* BIT_STRING_SIZE_6 */ static int hf_ulp_latitude_01 = -1; /* BIT_STRING_SIZE_34 */ static int hf_ulp_longitudeResolution = -1; /* BIT_STRING_SIZE_6 */ static int hf_ulp_longitude_01 = -1; /* BIT_STRING_SIZE_34 */ static int hf_ulp_altitudeType = -1; /* BIT_STRING_SIZE_4 */ static int hf_ulp_altitudeResolution = -1; /* BIT_STRING_SIZE_6 */ static int hf_ulp_altitude_01 = -1; /* BIT_STRING_SIZE_30 */ static int hf_ulp_datum = -1; /* BIT_STRING_SIZE_8 */ static int hf_ulp_wimaxBsID = -1; /* WimaxBsID */ static int hf_ulp_wimaxRTD = -1; /* WimaxRTD */ static int hf_ulp_wimaxNMRList = -1; /* WimaxNMRList */ static int hf_ulp_rtd = -1; /* INTEGER_0_65535 */ static int hf_ulp_rTDstd = -1; /* INTEGER_0_1023 */ static int hf_ulp_WimaxNMRList_item = -1; /* WimaxNMR */ static int hf_ulp_relDelay = -1; /* INTEGER_M32768_32767 */ static int hf_ulp_relDelaystd = -1; /* INTEGER_0_1023 */ static int hf_ulp_rssi = -1; /* INTEGER_0_255 */ static int hf_ulp_rSSIstd = -1; /* INTEGER_0_63 */ static int hf_ulp_bSTxPower = -1; /* INTEGER_0_255 */ static int hf_ulp_cinr = -1; /* INTEGER_0_255 */ static int hf_ulp_cINRstd = -1; /* INTEGER_0_63 */ static int hf_ulp_bSLocation = -1; /* ReportedLocation */ static int hf_ulp_servingCellInformation = -1; /* ServingCellInformationNR */ static int hf_ulp_measuredResultsListNR = -1; /* MeasResultListNR */ static int hf_ulp_ServingCellInformationNR_item = -1; /* ServCellNR */ static int hf_ulp_physCellId_01 = -1; /* PhysCellIdNR */ static int hf_ulp_arfcn_NR = -1; /* ARFCN_NR */ static int hf_ulp_cellGlobalId_01 = -1; /* CellGlobalIdNR */ static int hf_ulp_ssb_Measurements = -1; /* NR_Measurements */ static int hf_ulp_csi_rs_Measurements = -1; /* NR_Measurements */ static int hf_ulp_ta_03 = -1; /* INTEGER_0_3846 */ static int hf_ulp_MeasResultListNR_item = -1; /* MeasResultNR */ static int hf_ulp_cellIdentityNR = -1; /* CellIdentityNR */ static int hf_ulp_rsrp_Range = -1; /* INTEGER_0_127 */ static int hf_ulp_rsrq_Range = -1; /* INTEGER_0_127 */ static int hf_ulp_sinr_Range = -1; /* INTEGER_0_127 */ static int hf_ulp_utran_GPSReferenceTime = -1; /* UTRAN_GPSReferenceTime */ static int hf_ulp_gpsReferenceTimeUncertainty = -1; /* INTEGER_0_127 */ static int hf_ulp_utranGPSDriftRate = -1; /* UTRANGPSDriftRate */ static int hf_ulp_utran_GPSTimingOfCell = -1; /* T_utran_GPSTimingOfCell */ static int hf_ulp_ms_part = -1; /* INTEGER_0_1023 */ static int hf_ulp_ls_part = -1; /* INTEGER_0_4294967295 */ static int hf_ulp_modeSpecificInfo_01 = -1; /* T_modeSpecificInfo_01 */ static int hf_ulp_fdd_01 = -1; /* T_fdd_01 */ static int hf_ulp_referenceIdentity = -1; /* PrimaryCPICH_Info */ static int hf_ulp_tdd_01 = -1; /* T_tdd_01 */ static int hf_ulp_referenceIdentity_01 = -1; /* CellParametersID */ static int hf_ulp_sfn = -1; /* INTEGER_0_4095 */ static int hf_ulp_set_GPSTimingOfCell = -1; /* T_set_GPSTimingOfCell */ static int hf_ulp_ms_part_01 = -1; /* INTEGER_0_16383 */ static int hf_ulp_modeSpecificInfo_02 = -1; /* T_modeSpecificInfo_02 */ static int hf_ulp_fdd_02 = -1; /* T_fdd_02 */ static int hf_ulp_tdd_02 = -1; /* T_tdd_02 */ static int hf_ulp_ganssDay = -1; /* INTEGER_0_8191 */ static int hf_ulp_ganssTimeID = -1; /* INTEGER_0_15 */ static int hf_ulp_utran_GANSSReferenceTime = -1; /* UTRAN_GANSSReferenceTime */ static int hf_ulp_utranGANSSDriftRate = -1; /* UTRANGANSSDriftRate */ static int hf_ulp_ganssTOD = -1; /* INTEGER_0_86399 */ static int hf_ulp_utran_GANSSTimingOfCell = -1; /* INTEGER_0_3999999 */ static int hf_ulp_modeSpecificInfo_03 = -1; /* T_modeSpecificInfo_03 */ static int hf_ulp_fdd_03 = -1; /* T_fdd_03 */ static int hf_ulp_tdd_03 = -1; /* T_tdd_03 */ static int hf_ulp_ganss_TODUncertainty = -1; /* INTEGER_0_127 */ static int hf_ulp_set_GANSSReferenceTime = -1; /* SET_GANSSReferenceTime */ static int hf_ulp_set_GANSSTimingOfCell = -1; /* T_set_GANSSTimingOfCell */ static int hf_ulp_ms_part_02 = -1; /* INTEGER_0_80 */ static int hf_ulp_modeSpecificInfo_04 = -1; /* T_modeSpecificInfo_04 */ static int hf_ulp_fdd_04 = -1; /* T_fdd_04 */ static int hf_ulp_tdd_04 = -1; /* T_tdd_04 */ static int hf_ulp_gps = -1; /* BOOLEAN */ static int hf_ulp_galileo = -1; /* BOOLEAN */ static int hf_ulp_sbas = -1; /* BOOLEAN */ static int hf_ulp_modernized_gps = -1; /* BOOLEAN */ static int hf_ulp_qzss = -1; /* BOOLEAN */ static int hf_ulp_glonass = -1; /* BOOLEAN */ static int hf_ulp_bds = -1; /* BOOLEAN */ static int hf_ulp_rtk_osr = -1; /* BOOLEAN */ static int hf_ulp_rand = -1; /* BIT_STRING_SIZE_128 */ static int hf_ulp_slpFQDN = -1; /* FQDN */ static int hf_ulp_ThirdParty_item = -1; /* ThirdPartyID */ static int hf_ulp_logicalName = -1; /* IA5String_SIZE_1_1000 */ static int hf_ulp_msisdn_01 = -1; /* T_msisdn_01 */ static int hf_ulp_emailaddr = -1; /* IA5String_SIZE_1_1000 */ static int hf_ulp_sip_uri = -1; /* T_sip_uri */ static int hf_ulp_ims_public_identity = -1; /* T_ims_public_identity */ static int hf_ulp_min_01 = -1; /* BIT_STRING_SIZE_34 */ static int hf_ulp_mdn_01 = -1; /* T_mdn_01 */ static int hf_ulp_uri = -1; /* T_uri */ static int hf_ulp_appProvider = -1; /* IA5String_SIZE_1_24 */ static int hf_ulp_appName = -1; /* IA5String_SIZE_1_32 */ static int hf_ulp_appVersion = -1; /* IA5String_SIZE_1_8 */ static int hf_ulp_minInt = -1; /* INTEGER_1_3600 */ static int hf_ulp_maxInt = -1; /* INTEGER_1_1440 */ static int hf_ulp_repMode_01 = -1; /* RepMode */ static int hf_ulp_batchRepCap = -1; /* BatchRepCap */ static int hf_ulp_realtime = -1; /* BOOLEAN */ static int hf_ulp_quasirealtime = -1; /* BOOLEAN */ static int hf_ulp_batch = -1; /* BOOLEAN */ static int hf_ulp_report_position = -1; /* BOOLEAN */ static int hf_ulp_report_measurements = -1; /* BOOLEAN */ static int hf_ulp_max_num_positions = -1; /* INTEGER_1_1024 */ static int hf_ulp_max_num_measurements = -1; /* INTEGER_1_1024 */ static int hf_ulp_latitudeSign_01 = -1; /* T_latitudeSign_01 */ static int hf_ulp_coordinateLatitude = -1; /* INTEGER_0_8388607 */ static int hf_ulp_coordinateLongitude = -1; /* INTEGER_M8388608_8388607 */ static int hf_ulp_coordinate = -1; /* Coordinate */ static int hf_ulp_radius = -1; /* INTEGER_1_1000000 */ static int hf_ulp_radius_min = -1; /* INTEGER_1_1000000 */ static int hf_ulp_radius_max = -1; /* INTEGER_1_1500000 */ static int hf_ulp_semiMajor = -1; /* INTEGER_1_1000000 */ static int hf_ulp_semiMajor_min = -1; /* INTEGER_1_1000000 */ static int hf_ulp_semiMajor_max = -1; /* INTEGER_1_1500000 */ static int hf_ulp_semiMinor = -1; /* INTEGER_1_1000000 */ static int hf_ulp_semiMinor_min = -1; /* INTEGER_1_1000000 */ static int hf_ulp_semiMinor_max = -1; /* INTEGER_1_1500000 */ static int hf_ulp_angle = -1; /* INTEGER_0_179 */ static int hf_ulp_polygonDescription = -1; /* PolygonDescription */ static int hf_ulp_polygonHysteresis = -1; /* INTEGER_1_100000 */ static int hf_ulp_PolygonDescription_item = -1; /* Coordinate */ static int hf_ulp_highAccuracyPositionEstimate = -1; /* HighAccuracyPositionEstimate */ static int hf_ulp_degreesLatitude = -1; /* INTEGER_M2147483648_2147483647 */ static int hf_ulp_degreesLongitude = -1; /* INTEGER_M2147483648_2147483647 */ static int hf_ulp_uncertaintySemiMajor_01 = -1; /* INTEGER_0_255 */ static int hf_ulp_uncertaintySemiMinor_01 = -1; /* INTEGER_0_255 */ static int hf_ulp_orientationMajorAxis_01 = -1; /* INTEGER_0_179 */ static int hf_ulp_horizontalConfidence = -1; /* INTEGER_0_100 */ static int hf_ulp_highAccuracyAltitudeInfo = -1; /* HighAccuracyAltitudeInfo */ static int hf_ulp_altitude_02 = -1; /* INTEGER_64000_1280000 */ static int hf_ulp_uncertaintyAltitude = -1; /* INTEGER_0_255 */ static int hf_ulp_verticalConfidence = -1; /* INTEGER_0_100 */ /* named bits */ static int hf_ulp_T_addPosMode_standalone = -1; static int hf_ulp_T_addPosMode_setBased = -1; static int hf_ulp_T_addPosMode_setAssisted = -1; static int hf_ulp_GANSSSignals_signal1 = -1; static int hf_ulp_GANSSSignals_signal2 = -1; static int hf_ulp_GANSSSignals_signal3 = -1; static int hf_ulp_GANSSSignals_signal4 = -1; static int hf_ulp_GANSSSignals_signal5 = -1; static int hf_ulp_GANSSSignals_signal6 = -1; static int hf_ulp_GANSSSignals_signal7 = -1; static int hf_ulp_GANSSSignals_signal8 = -1; static int hf_ulp_mobile_directory_number = -1; static int hf_ulp_ganssTimeModels_bit0 = -1; static int hf_ulp_ganssTimeModels_bit1 = -1; static int hf_ulp_ganssTimeModels_bit2 = -1; static int hf_ulp_ganssTimeModels_bit3 = -1; static int hf_ulp_ganssTimeModels_bit4 = -1; static int hf_ulp_ganssTimeModels_spare = -1; /* Initialize the subtree pointers */ static gint ett_ulp = -1; static gint ett_ulp_setid = -1; static gint ett_ulp_thirdPartyId = -1; static gint ett_ulp_ganssTimeModels = -1; static gint ett_ulp_ULP_PDU = -1; static gint ett_ulp_UlpMessage = -1; static gint ett_ulp_SUPLINIT = -1; static gint ett_ulp_Notification = -1; static gint ett_ulp_SUPLSTART = -1; static gint ett_ulp_SETCapabilities = -1; static gint ett_ulp_PosTechnology = -1; static gint ett_ulp_PosProtocol = -1; static gint ett_ulp_SUPLRESPONSE = -1; static gint ett_ulp_SETAuthKey = -1; static gint ett_ulp_SUPLPOSINIT = -1; static gint ett_ulp_RequestedAssistData = -1; static gint ett_ulp_NavigationModel = -1; static gint ett_ulp_SatelliteInfo = -1; static gint ett_ulp_SatelliteInfoElement = -1; static gint ett_ulp_SUPLPOS = -1; static gint ett_ulp_PosPayLoad = -1; static gint ett_ulp_SUPLEND = -1; static gint ett_ulp_SUPLAUTHREQ = -1; static gint ett_ulp_SUPLAUTHRESP = -1; static gint ett_ulp_Ver2_SUPLNOTIFY = -1; static gint ett_ulp_Ver2_SUPLNOTIFYRESPONSE = -1; static gint ett_ulp_Ver2_SUPLSETINIT = -1; static gint ett_ulp_Ver2_SUPLTRIGGEREDSTART = -1; static gint ett_ulp_TriggerParams = -1; static gint ett_ulp_PeriodicParams = -1; static gint ett_ulp_AreaEventParams = -1; static gint ett_ulp_SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList = -1; static gint ett_ulp_RepeatedReportingParams = -1; static gint ett_ulp_GeographicTargetAreaList = -1; static gint ett_ulp_GeographicTargetArea = -1; static gint ett_ulp_AreaIdList = -1; static gint ett_ulp_AreaIdSet = -1; static gint ett_ulp_AreaId = -1; static gint ett_ulp_GSMAreaId = -1; static gint ett_ulp_WCDMAAreaId = -1; static gint ett_ulp_CDMAAreaId = -1; static gint ett_ulp_HRPDAreaId = -1; static gint ett_ulp_UMBAreaId = -1; static gint ett_ulp_LTEAreaId = -1; static gint ett_ulp_WLANAreaId = -1; static gint ett_ulp_WimaxAreaId = -1; static gint ett_ulp_NRAreaId = -1; static gint ett_ulp_GeoAreaMappingList = -1; static gint ett_ulp_Ver2_SUPLTRIGGEREDRESPONSE = -1; static gint ett_ulp_ReportingMode = -1; static gint ett_ulp_BatchRepConditions = -1; static gint ett_ulp_BatchRepType = -1; static gint ett_ulp_Ver2_SUPLREPORT = -1; static gint ett_ulp_SessionList = -1; static gint ett_ulp_SessionInformation = -1; static gint ett_ulp_ReportDataList = -1; static gint ett_ulp_ReportData = -1; static gint ett_ulp_PositionData = -1; static gint ett_ulp_GANSSsignalsInfo = -1; static gint ett_ulp_GANSSSignalsDescription = -1; static gint ett_ulp_TimeStamp = -1; static gint ett_ulp_Ver2_SUPLTRIGGEREDSTOP = -1; static gint ett_ulp_Ver2_SUPL_INIT_extension = -1; static gint ett_ulp_HistoricReporting = -1; static gint ett_ulp_ReportingCriteria = -1; static gint ett_ulp_TimeWindow = -1; static gint ett_ulp_ProtectionLevel = -1; static gint ett_ulp_BasicProtectionParams = -1; static gint ett_ulp_Ver2_SUPL_START_extension = -1; static gint ett_ulp_Ver2_SUPL_RESPONSE_extension = -1; static gint ett_ulp_Ver2_SUPL_POS_INIT_extension = -1; static gint ett_ulp_Ver2_SUPL_POS_extension = -1; static gint ett_ulp_Ver2_SUPL_END_extension = -1; static gint ett_ulp_Ver2_Notification_extension = -1; static gint ett_ulp_Ver2_SETCapabilities_extension = -1; static gint ett_ulp_ServiceCapabilities = -1; static gint ett_ulp_ServicesSupported = -1; static gint ett_ulp_EventTriggerCapabilities = -1; static gint ett_ulp_GeoAreaShapesSupported = -1; static gint ett_ulp_SessionCapabilities = -1; static gint ett_ulp_SupportedBearers = -1; static gint ett_ulp_Ver2_PosProtocol_extension = -1; static gint ett_ulp_PosProtocolVersion3GPP = -1; static gint ett_ulp_PosProtocolVersion3GPP2 = -1; static gint ett_ulp_Supported3GPP2PosProtocolVersion = -1; static gint ett_ulp_PosProtocolVersionOMA = -1; static gint ett_ulp_Ver2_PosTechnology_extension = -1; static gint ett_ulp_GANSSPositionMethods = -1; static gint ett_ulp_GANSSPositionMethod = -1; static gint ett_ulp_RTK = -1; static gint ett_ulp_GANSSPositioningMethodTypes = -1; static gint ett_ulp_AdditionalPositioningMethods = -1; static gint ett_ulp_AddPosSupport_Element = -1; static gint ett_ulp_T_addPosMode = -1; static gint ett_ulp_Ver2_RequestedAssistData_extension = -1; static gint ett_ulp_GanssRequestedCommonAssistanceDataList = -1; static gint ett_ulp_GanssRequestedGenericAssistanceDataList = -1; static gint ett_ulp_GanssReqGenericData = -1; static gint ett_ulp_GanssNavigationModelData = -1; static gint ett_ulp_SatellitesListRelatedDataList = -1; static gint ett_ulp_SatellitesListRelatedData = -1; static gint ett_ulp_GanssDataBits = -1; static gint ett_ulp_ReqDataBitAssistanceList = -1; static gint ett_ulp_T_ganssDataBitSatList = -1; static gint ett_ulp_GanssAdditionalDataChoices = -1; static gint ett_ulp_ExtendedEphemeris = -1; static gint ett_ulp_ExtendedEphCheck = -1; static gint ett_ulp_GanssExtendedEphCheck = -1; static gint ett_ulp_GPSTime = -1; static gint ett_ulp_GANSSextEphTime = -1; static gint ett_ulp_Ver2_PosPayLoad_extension = -1; static gint ett_ulp_T_lPPPayload = -1; static gint ett_ulp_T_tia801Payload = -1; static gint ett_ulp_Version = -1; static gint ett_ulp_SessionID = -1; static gint ett_ulp_SetSessionID = -1; static gint ett_ulp_SETId = -1; static gint ett_ulp_SlpSessionID = -1; static gint ett_ulp_IPAddress = -1; static gint ett_ulp_SLPAddress = -1; static gint ett_ulp_LocationId = -1; static gint ett_ulp_CellInfo = -1; static gint ett_ulp_Position = -1; static gint ett_ulp_PositionEstimate = -1; static gint ett_ulp_T_uncertainty = -1; static gint ett_ulp_AltitudeInfo = -1; static gint ett_ulp_CdmaCellInformation = -1; static gint ett_ulp_GsmCellInformation = -1; static gint ett_ulp_WcdmaCellInformation = -1; static gint ett_ulp_TimingAdvance = -1; static gint ett_ulp_FrequencyInfo = -1; static gint ett_ulp_FrequencySpecificInfo = -1; static gint ett_ulp_FrequencyInfoFDD = -1; static gint ett_ulp_FrequencyInfoTDD = -1; static gint ett_ulp_NMR = -1; static gint ett_ulp_NMRelement = -1; static gint ett_ulp_MeasuredResultsList = -1; static gint ett_ulp_MeasuredResults = -1; static gint ett_ulp_CellMeasuredResultsList = -1; static gint ett_ulp_CellMeasuredResults = -1; static gint ett_ulp_T_modeSpecificInfo = -1; static gint ett_ulp_T_fdd = -1; static gint ett_ulp_T_tdd = -1; static gint ett_ulp_TimeslotISCP_List = -1; static gint ett_ulp_PrimaryCPICH_Info = -1; static gint ett_ulp_QoP = -1; static gint ett_ulp_Velocity = -1; static gint ett_ulp_Horvel = -1; static gint ett_ulp_Horandvervel = -1; static gint ett_ulp_Horveluncert = -1; static gint ett_ulp_Horandveruncert = -1; static gint ett_ulp_MultipleLocationIds = -1; static gint ett_ulp_LocationIdData = -1; static gint ett_ulp_SupportedNetworkInformation = -1; static gint ett_ulp_SupportedWLANInfo = -1; static gint ett_ulp_SupportedWLANApsList = -1; static gint ett_ulp_SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData = -1; static gint ett_ulp_SupportedWLANApsChannel11a = -1; static gint ett_ulp_SupportedWLANApsChannel11bg = -1; static gint ett_ulp_SupportedWLANApData = -1; static gint ett_ulp_SupportedWCDMAInfo = -1; static gint ett_ulp_Ver2_CellInfo_extension = -1; static gint ett_ulp_HrpdCellInformation = -1; static gint ett_ulp_UmbCellInformation = -1; static gint ett_ulp_LteCellInformation = -1; static gint ett_ulp_MeasResultListEUTRA = -1; static gint ett_ulp_MeasResultEUTRA = -1; static gint ett_ulp_T_cgi_Info = -1; static gint ett_ulp_T_measResult = -1; static gint ett_ulp_CellGlobalIdEUTRA = -1; static gint ett_ulp_PLMN_Identity = -1; static gint ett_ulp_MCC = -1; static gint ett_ulp_MNC = -1; static gint ett_ulp_ServingInformation5G = -1; static gint ett_ulp_NeighbourInformation5G = -1; static gint ett_ulp_WlanAPInformation = -1; static gint ett_ulp_RTD = -1; static gint ett_ulp_ReportedLocation = -1; static gint ett_ulp_LocationData = -1; static gint ett_ulp_RepLocation = -1; static gint ett_ulp_LciLocData = -1; static gint ett_ulp_LocationDataLCI = -1; static gint ett_ulp_WimaxBSInformation = -1; static gint ett_ulp_WimaxBsID = -1; static gint ett_ulp_WimaxRTD = -1; static gint ett_ulp_WimaxNMRList = -1; static gint ett_ulp_WimaxNMR = -1; static gint ett_ulp_NRCellInformation = -1; static gint ett_ulp_ServingCellInformationNR = -1; static gint ett_ulp_ServCellNR = -1; static gint ett_ulp_MeasResultListNR = -1; static gint ett_ulp_MeasResultNR = -1; static gint ett_ulp_CellGlobalIdNR = -1; static gint ett_ulp_NR_Measurements = -1; static gint ett_ulp_UTRAN_GPSReferenceTimeAssistance = -1; static gint ett_ulp_UTRAN_GPSReferenceTime = -1; static gint ett_ulp_T_utran_GPSTimingOfCell = -1; static gint ett_ulp_T_modeSpecificInfo_01 = -1; static gint ett_ulp_T_fdd_01 = -1; static gint ett_ulp_T_tdd_01 = -1; static gint ett_ulp_UTRAN_GPSReferenceTimeResult = -1; static gint ett_ulp_T_set_GPSTimingOfCell = -1; static gint ett_ulp_T_modeSpecificInfo_02 = -1; static gint ett_ulp_T_fdd_02 = -1; static gint ett_ulp_T_tdd_02 = -1; static gint ett_ulp_UTRAN_GANSSReferenceTimeAssistance = -1; static gint ett_ulp_UTRAN_GANSSReferenceTime = -1; static gint ett_ulp_T_modeSpecificInfo_03 = -1; static gint ett_ulp_T_fdd_03 = -1; static gint ett_ulp_T_tdd_03 = -1; static gint ett_ulp_UTRAN_GANSSReferenceTimeResult = -1; static gint ett_ulp_SET_GANSSReferenceTime = -1; static gint ett_ulp_T_set_GANSSTimingOfCell = -1; static gint ett_ulp_T_modeSpecificInfo_04 = -1; static gint ett_ulp_T_fdd_04 = -1; static gint ett_ulp_T_tdd_04 = -1; static gint ett_ulp_GNSSPosTechnology = -1; static gint ett_ulp_GANSSSignals = -1; static gint ett_ulp_SPCTID = -1; static gint ett_ulp_ThirdParty = -1; static gint ett_ulp_ThirdPartyID = -1; static gint ett_ulp_ApplicationID = -1; static gint ett_ulp_ReportingCap = -1; static gint ett_ulp_RepMode = -1; static gint ett_ulp_BatchRepCap = -1; static gint ett_ulp_Coordinate = -1; static gint ett_ulp_CircularArea = -1; static gint ett_ulp_EllipticalArea = -1; static gint ett_ulp_PolygonArea = -1; static gint ett_ulp_PolygonDescription = -1; static gint ett_ulp_Ver2_HighAccuracyPosition = -1; static gint ett_ulp_HighAccuracyPositionEstimate = -1; static gint ett_ulp_HighAccuracyAltitudeInfo = -1; static dissector_handle_t ulp_tcp_handle; static dissector_handle_t ulp_pdu_handle; static const value_string ulp_ganss_id_vals[] = { { 0, "Galileo"}, { 1, "SBAS"}, { 2, "Modernized GPS"}, { 3, "QZSS"}, { 4, "GLONASS"}, { 5, "BDS"}, { 0, NULL}, }; static const value_string ulp_ganss_sbas_id_vals[] = { { 0, "WAAS"}, { 1, "EGNOS"}, { 2, "MSAS"}, { 3, "GAGAN"}, { 0, NULL}, }; static void ulp_ganssDataBitInterval_fmt(gchar *s, guint32 v) { if (v == 15) { snprintf(s, ITEM_LABEL_LENGTH, "Time interval is not specified (15)"); } else { double interval = (0.1*pow(2, (double)v)); snprintf(s, ITEM_LABEL_LENGTH, "%gs (%u)", interval, v); } } static void ulp_ExtendedEphemeris_validity_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%uh (%u)", 4*v, v); } static void ulp_PositionEstimate_latitude_fmt(gchar *s, guint32 v) { double latitude = ((double)v*90)/pow(2,23); snprintf(s, ITEM_LABEL_LENGTH, "%g degrees (%u)", latitude, v); } static void ulp_PositionEstimate_longitude_fmt(gchar *s, guint32 v) { double longitude = ((double)(gint32)v*360)/pow(2,24); snprintf(s, ITEM_LABEL_LENGTH, "%g degrees (%u)", longitude, v); } static void ulp_NMRelement_rxLev_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "RxLev < -110dBm (0)"); } else if (v == 63) { snprintf(s, ITEM_LABEL_LENGTH, "RxLev >= -48dBm (63)"); } else { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= RxLev < %ddBm (%u)", -111+v, -110+v, v); } } static void ulp_UTRA_CarrierRSSI_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "RSSI < -100dBm (0)"); } else if (v == 76) { snprintf(s, ITEM_LABEL_LENGTH, "RSSI >= -25dBm (76)"); } else if (v > 76) { snprintf(s, ITEM_LABEL_LENGTH, "Spare (%u)", v); } else { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= RSSI < %ddBm (%u)", -101+v, -100+v, v); } } static void ulp_PrimaryCCPCH_RSCP_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "RSCP < -115dBm (0)"); } else if (v == 91) { snprintf(s, ITEM_LABEL_LENGTH, "RSCP >= -25dBm (91)"); } else if (v > 91) { snprintf(s, ITEM_LABEL_LENGTH, "Spare (%u)", v); } else { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= RSCP < %ddBm (%u)", -116+v, -115+v, v); } } static void ulp_CPICH_Ec_N0_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "CPICH Ec/N0 < -24dB (0)"); } else if (v == 49) { snprintf(s, ITEM_LABEL_LENGTH, "CPICH Ec/N0 >= 0dB (49)"); } else if (v > 49) { snprintf(s, ITEM_LABEL_LENGTH, "Spare (%u)", v); } else { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB <= CPICH Ec/N0 < %.1fdB (%u)", -24.5+((float)v/2), -24+((float)v/2), v); } } static void ulp_CPICH_RSCP_fmt(gchar *s, guint32 v) { if (v == 123) { snprintf(s, ITEM_LABEL_LENGTH, "CPICH RSCP < -120dBm (123)"); } else if (v > 123) { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= CPICH RSCP < %ddBm (%u)", -244+v, -243+v, v); } else if (v == 91) { snprintf(s, ITEM_LABEL_LENGTH, "CPICH RSCP >= -25dBm (91)"); } else if (v < 91) { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm < CPICH RSCP <= %ddBm (%u)", -116+v, -115+v, v); } else { snprintf(s, ITEM_LABEL_LENGTH, "Spare (%u)", v); } } static void ulp_QoP_horacc_fmt(gchar *s, guint32 v) { double uncertainty = 10*(pow(1.1, (double)v)-1); if (uncertainty < 1000) { snprintf(s, ITEM_LABEL_LENGTH, "%fm (%u)", uncertainty, v); } else { snprintf(s, ITEM_LABEL_LENGTH, "%fkm (%u)", uncertainty/1000, v); } } static void ulp_QoP_veracc_fmt(gchar *s, guint32 v) { double uncertainty = 45*(pow(1.025, (double)v)-1); snprintf(s, ITEM_LABEL_LENGTH, "%fm (%u)", uncertainty, v); } static void ulp_QoP_delay_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%gs (%u)", pow(2, (double)v), v); } static const true_false_string ulp_vertical_dir_val = { "Downward", "Upward" }; static void ulp_RelativeTime_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.2fs (%u)", 0.01*v, v); } static void ulp_RSRP_Range_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "RSRP < -140dBm (0)"); } else if (v == 97) { snprintf(s, ITEM_LABEL_LENGTH, "RSRP >= -44dBm (97)"); } else { snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= RSRP < %ddBm (%u)", -141+v, -140+v, v); } } static void ulp_RSRQ_Range_fmt(gchar *s, guint32 v) { if (v == 0) { snprintf(s, ITEM_LABEL_LENGTH, "RSRQ < -19.5dB (0)"); } else if (v == 64) { snprintf(s, ITEM_LABEL_LENGTH, "RSRQ >= -3dB (34)"); } else { snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB <= RSRQ < %.1fdB (%u)", -20+((float)v/2), -19.5+((float)v/2), v); } } static void ulp_SignalDelta_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%sdB (%u)", v ? "0.5" : "0", v); } static void ulp_locationAccuracy_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.1fm (%u)", 0.1*v, v); } static void ulp_WimaxRTD_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.2fus (%u)", 0.01*v, v); } static void ulp_WimaxNMR_rssi_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.2fdBm (%u)", -103.75+(0.25*v), v); } static void ulp_UTRAN_gpsReferenceTimeUncertainty_fmt(gchar *s, guint32 v) { double uncertainty = 0.0022*(pow(1.18, (double)v)-1); snprintf(s, ITEM_LABEL_LENGTH, "%fus (%u)", uncertainty, v); } static const value_string ulp_ganss_time_id_vals[] = { { 0, "Galileo"}, { 1, "QZSS"}, { 2, "GLONASS"}, { 3, "BDS"}, { 0, NULL}, }; static void ulp_utran_GANSSTimingOfCell_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%.2fus (%u)", 0.25*v, v); } static void ulp_Coordinate_latitude_fmt(gchar *s, guint32 v) { snprintf(s, ITEM_LABEL_LENGTH, "%f degrees (%u)", ((float)v/8388607.0)*90, v); } static void ulp_Coordinate_longitude_fmt(gchar *s, guint32 v) { gint32 longitude = (gint32) v; snprintf(s, ITEM_LABEL_LENGTH, "%f degrees (%d)", ((float)longitude/8388608.0)*180, longitude); } /* Include constants */ #define maxReqLength 50 #define maxClientLength 50 #define maxNumGeoArea 32 #define maxAreaId 256 #define maxAreaIdList 32 #define maxnumSessions 64 #define maxGANSS 16 #define maxGANSSSat 32 #define maxCellMeas 32 #define maxFreq 8 #define maxTS 14 #define maxLidSize 64 #define maxWLANApDataSize 128 #define maxCellReport 8 #define maxWimaxBSMeas 32 #define maxNRServingCell 32 #define maxCellReportNR 32 typedef struct { guint8 notif_enc_type; guint8 ganss_req_gen_data_ganss_id; } ulp_private_data_t; static ulp_private_data_t* ulp_get_private_data(asn1_ctx_t *actx) { if (actx->private_data == NULL) { actx->private_data = wmem_new0(actx->pinfo->pool, ulp_private_data_t); } return (ulp_private_data_t*)actx->private_data; } static int dissect_ulp_INTEGER_0_65535(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_255(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, NULL, FALSE); return offset; } static const per_sequence_t Version_sequence[] = { { &hf_ulp_maj , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_min , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_servind , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Version(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Version, Version_sequence); return offset; } static int dissect_ulp_T_msisdn(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *msisdn_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &msisdn_tvb); if (msisdn_tvb) { proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_ulp_setid); dissect_e164_msisdn(msisdn_tvb, subtree, 0, 8, E164_ENC_BCD); } return offset; } static int dissect_ulp_T_mdn(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *mdn_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &mdn_tvb); if (mdn_tvb) { proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_ulp_setid); proto_tree_add_item(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, ENC_BCD_DIGITS_0_9); } return offset; } static int dissect_ulp_BIT_STRING_SIZE_34(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 34, 34, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_T_imsi(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *imsi_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &imsi_tvb); if (imsi_tvb) { proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_ulp_setid); dissect_e212_imsi(imsi_tvb, actx->pinfo, subtree, 0, 8, FALSE); } return offset; } static int dissect_ulp_IA5String_SIZE_1_1000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_IA5String(tvb, offset, actx, tree, hf_index, 1, 1000, FALSE, NULL); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_4(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, NULL); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_16(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL); return offset; } static const value_string ulp_IPAddress_vals[] = { { 0, "ipv4Address" }, { 1, "ipv6Address" }, { 0, NULL } }; static const per_choice_t IPAddress_choice[] = { { 0, &hf_ulp_ipv4Address , ASN1_NO_EXTENSIONS , dissect_ulp_OCTET_STRING_SIZE_4 }, { 1, &hf_ulp_ipv6Address , ASN1_NO_EXTENSIONS , dissect_ulp_OCTET_STRING_SIZE_16 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_IPAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_IPAddress, IPAddress_choice, NULL); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_8(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL); return offset; } static const value_string ulp_SETId_vals[] = { { 0, "msisdn" }, { 1, "mdn" }, { 2, "min" }, { 3, "imsi" }, { 4, "nai" }, { 5, "iPAddress" }, { 6, "ver2-imei" }, { 0, NULL } }; static const per_choice_t SETId_choice[] = { { 0, &hf_ulp_msisdn , ASN1_EXTENSION_ROOT , dissect_ulp_T_msisdn }, { 1, &hf_ulp_mdn , ASN1_EXTENSION_ROOT , dissect_ulp_T_mdn }, { 2, &hf_ulp_minsi , ASN1_EXTENSION_ROOT , dissect_ulp_BIT_STRING_SIZE_34 }, { 3, &hf_ulp_imsi , ASN1_EXTENSION_ROOT , dissect_ulp_T_imsi }, { 4, &hf_ulp_nai , ASN1_EXTENSION_ROOT , dissect_ulp_IA5String_SIZE_1_1000 }, { 5, &hf_ulp_iPAddress , ASN1_EXTENSION_ROOT , dissect_ulp_IPAddress }, { 6, &hf_ulp_ver2_imei , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_OCTET_STRING_SIZE_8 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_SETId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_SETId, SETId_choice, NULL); return offset; } static const per_sequence_t SetSessionID_sequence[] = { { &hf_ulp_sessionId , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_setId , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SETId }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SetSessionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SetSessionID, SetSessionID_sequence); return offset; } static int dissect_ulp_FQDN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index, 1, 255, FALSE, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-", 64, NULL); return offset; } static const value_string ulp_SLPAddress_vals[] = { { 0, "iPAddress" }, { 1, "fqdn" }, { 0, NULL } }; static const per_choice_t SLPAddress_choice[] = { { 0, &hf_ulp_iPAddress , ASN1_EXTENSION_ROOT , dissect_ulp_IPAddress }, { 1, &hf_ulp_fqdn , ASN1_EXTENSION_ROOT , dissect_ulp_FQDN }, { 0, NULL, 0, NULL } }; static int dissect_ulp_SLPAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_SLPAddress, SLPAddress_choice, NULL); return offset; } static const per_sequence_t SlpSessionID_sequence[] = { { &hf_ulp_sessionSlpID , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_OCTET_STRING_SIZE_4 }, { &hf_ulp_slpId , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SLPAddress }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SlpSessionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SlpSessionID, SlpSessionID_sequence); return offset; } static const per_sequence_t SessionID_sequence[] = { { &hf_ulp_setSessionID , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_SetSessionID }, { &hf_ulp_slpSessionID , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_SlpSessionID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SessionID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SessionID, SessionID_sequence); return offset; } static const value_string ulp_PosMethod_vals[] = { { 0, "agpsSETassisted" }, { 1, "agpsSETbased" }, { 2, "agpsSETassistedpref" }, { 3, "agpsSETbasedpref" }, { 4, "autonomousGPS" }, { 5, "aflt" }, { 6, "ecid" }, { 7, "eotd" }, { 8, "otdoa" }, { 9, "noPosition" }, { 10, "ver2-historicalDataRetrieval" }, { 11, "ver2-agnssSETassisted" }, { 12, "ver2-agnssSETbased" }, { 13, "ver2-agnssSETassistedpref" }, { 14, "ver2-agnssSETbasedpref" }, { 15, "ver2-autonomousGNSS" }, { 16, "ver2-sessioninfoquery" }, { 17, "ver2-mbs" }, { 0, NULL } }; static int dissect_ulp_PosMethod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 10, NULL, TRUE, 8, NULL); return offset; } static const value_string ulp_NotificationType_vals[] = { { 0, "noNotificationNoVerification" }, { 1, "notificationOnly" }, { 2, "notificationAndVerficationAllowedNA" }, { 3, "notificationAndVerficationDeniedNA" }, { 4, "privacyOverride" }, { 0, NULL } }; static int dissect_ulp_NotificationType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const value_string ulp_EncodingType_vals[] = { { 0, "ucs2" }, { 1, "gsmDefault" }, { 2, "utf8" }, { 0, NULL } }; static int dissect_ulp_EncodingType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 val; ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, &val, TRUE, 0, NULL); ulp_priv->notif_enc_type = (guint8) val; return offset; } static int dissect_ulp_T_requestorId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, maxReqLength, FALSE, &val_tvb); if (val_tvb) { ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); switch(ulp_priv->notif_enc_type) { case 0: /* UCS-2 */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_UCS_2|ENC_BIG_ENDIAN); break; case 1: /* GSM 7bits */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_3GPP_TS_23_038_7BITS|ENC_NA); break; case 2: /* UTF-8 */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_UTF_8|ENC_NA); break; default: actx->created_item = proto_tree_add_string(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), tvb_bytes_to_str(actx->pinfo->pool, val_tvb, 0, tvb_reported_length(val_tvb))); break; } } return offset; } static const value_string ulp_FormatIndicator_vals[] = { { 0, "logicalName" }, { 1, "e-mailAddress" }, { 2, "msisdn" }, { 3, "url" }, { 4, "sipUrl" }, { 5, "min" }, { 6, "mdn" }, { 7, "iMSPublicidentity" }, { 0, NULL } }; static int dissect_ulp_FormatIndicator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 8, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_T_clientName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, maxClientLength, FALSE, &val_tvb); if (val_tvb) { ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); switch(ulp_priv->notif_enc_type) { case 0: /* UCS-2 */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_UCS_2|ENC_BIG_ENDIAN); break; case 1: /* GSM 7bits */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_3GPP_TS_23_038_7BITS|ENC_NA); break; case 2: /* UTF-8 */ actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), ENC_UTF_8|ENC_NA); break; default: actx->created_item = proto_tree_add_string(tree, hf_index, val_tvb, 0, tvb_reported_length(val_tvb), tvb_bytes_to_str(actx->pinfo->pool, val_tvb, 0, tvb_reported_length(val_tvb))); break; } } return offset; } static int dissect_ulp_NULL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_null(tvb, offset, actx, tree, hf_index); return offset; } static const per_sequence_t Ver2_Notification_extension_sequence[] = { { &hf_ulp_emergencyCallLocation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NULL }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_Notification_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_Notification_extension, Ver2_Notification_extension_sequence); return offset; } static const per_sequence_t Notification_sequence[] = { { &hf_ulp_notificationType, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_NotificationType }, { &hf_ulp_encodingType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_EncodingType }, { &hf_ulp_requestorId , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_requestorId }, { &hf_ulp_requestorIdType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_FormatIndicator }, { &hf_ulp_clientName , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_clientName }, { &hf_ulp_clientNameType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_FormatIndicator }, { &hf_ulp_ver2_Notification_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_Notification_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Notification(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); ulp_priv->notif_enc_type = -1; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Notification, Notification_sequence); return offset; } static int dissect_ulp_INTEGER_0_127(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 7U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_1_128(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 128U, NULL, FALSE); return offset; } static const per_sequence_t QoP_sequence[] = { { &hf_ulp_horacc , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_127 }, { &hf_ulp_veracc , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { &hf_ulp_maxLocAge , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_delay , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_7 }, { &hf_ulp_ver2_responseTime, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_1_128 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_QoP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_QoP, QoP_sequence); return offset; } static const value_string ulp_SLPMode_vals[] = { { 0, "proxy" }, { 1, "nonProxy" }, { 0, NULL } }; static int dissect_ulp_SLPMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static int dissect_ulp_MAC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 64, 64, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_KeyIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 128, 128, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string ulp_NotificationMode_vals[] = { { 0, "normal" }, { 1, "basedOnLocation" }, { 0, NULL } }; static int dissect_ulp_NotificationMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_BOOLEAN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_boolean(tvb, offset, actx, tree, hf_index, NULL); return offset; } static const per_sequence_t SupportedWLANInfo_sequence[] = { { &hf_ulp_apTP , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apAG , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apSN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apDevType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apRSSI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apChanFreq , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apRTD , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_setTP , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_setAG , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_setSN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_setRSSI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apRepLoc , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_apRL , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_opClass , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_apSSID , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_apPHYType , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_setMACAddress , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWLANInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWLANInfo, SupportedWLANInfo_sequence); return offset; } static int dissect_ulp_T_apMACAddress_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 48, 48, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_item(tree, hf_index, val_tvb, 0, 6, ENC_NA); } return offset; } static const value_string ulp_T_apDevType_vals[] = { { 0, "wlan802-11a" }, { 1, "wlan802-11b" }, { 2, "wlan802-11g" }, { 0, NULL } }; static int dissect_ulp_T_apDevType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t SupportedWLANApData_sequence[] = { { &hf_ulp_apMACAddress_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_apMACAddress_01 }, { &hf_ulp_apDevType_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_apDevType }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWLANApData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWLANApData, SupportedWLANApData_sequence); return offset; } static const per_sequence_t SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData_sequence_of[1] = { { &hf_ulp_supportedWLANApDataList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SupportedWLANApData }, }; static int dissect_ulp_SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData, SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData_sequence_of, 1, maxWLANApDataSize, FALSE); return offset; } static const per_sequence_t SupportedWLANApsChannel11a_sequence[] = { { &hf_ulp_ch34 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch36 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch38 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch40 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch42 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch44 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch46 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch48 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch52 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch56 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch60 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch64 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch149 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch153 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch157 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch161 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWLANApsChannel11a(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWLANApsChannel11a, SupportedWLANApsChannel11a_sequence); return offset; } static const per_sequence_t SupportedWLANApsChannel11bg_sequence[] = { { &hf_ulp_ch1 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch2 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch3 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch4 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch5 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch6 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch7 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch8 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch9 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch10 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch11 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch12 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch13 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ch14 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWLANApsChannel11bg(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWLANApsChannel11bg, SupportedWLANApsChannel11bg_sequence); return offset; } static const per_sequence_t SupportedWLANApsList_sequence[] = { { &hf_ulp_supportedWLANApDataList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData }, { &hf_ulp_supportedWLANapsChannel11a, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedWLANApsChannel11a }, { &hf_ulp_supportedWLANapsChannel11bg, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedWLANApsChannel11bg }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWLANApsList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWLANApsList, SupportedWLANApsList_sequence); return offset; } static const per_sequence_t SupportedWCDMAInfo_sequence[] = { { &hf_ulp_mrl , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedWCDMAInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedWCDMAInfo, SupportedWCDMAInfo_sequence); return offset; } static const per_sequence_t SupportedNetworkInformation_sequence[] = { { &hf_ulp_wlan , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_supportedWLANInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedWLANInfo }, { &hf_ulp_supportedWLANApsList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedWLANApsList }, { &hf_ulp_gsm , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_wcdma , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_supportedWCDMAInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedWCDMAInfo }, { &hf_ulp_cdma , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_hrdp , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_umb , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_lte , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_wimax , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_historic , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_nonServing , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_uTRANGPSReferenceTime, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_uTRANGANSSReferenceTime, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_nr , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedNetworkInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedNetworkInformation, SupportedNetworkInformation_sequence); return offset; } static const value_string ulp_TriggerType_vals[] = { { 0, "periodic" }, { 1, "areaEvent" }, { 0, NULL } }; static int dissect_ulp_TriggerType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const value_string ulp_AllowedReportingType_vals[] = { { 0, "positionsOnly" }, { 1, "measurementsOnly" }, { 2, "positionsAndMeasurements" }, { 0, NULL } }; static int dissect_ulp_AllowedReportingType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_INTEGER_M525600_M1(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -525600, -1, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_M525599_0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -525599, 0U, NULL, FALSE); return offset; } static const per_sequence_t TimeWindow_sequence[] = { { &hf_ulp_startTime_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M525600_M1 }, { &hf_ulp_stopTime_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M525599_0 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_TimeWindow(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_TimeWindow, TimeWindow_sequence); return offset; } static int dissect_ulp_INTEGER_1_65536(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 65536U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_1_86400(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 86400U, NULL, FALSE); return offset; } static const per_sequence_t ReportingCriteria_sequence[] = { { &hf_ulp_timeWindow , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TimeWindow }, { &hf_ulp_maxNumberofReports, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_65536 }, { &hf_ulp_minTimeInterval , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_86400 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReportingCriteria(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReportingCriteria, ReportingCriteria_sequence); return offset; } static const per_sequence_t HistoricReporting_sequence[] = { { &hf_ulp_allowedReportingType, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_AllowedReportingType }, { &hf_ulp_reportingCriteria, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportingCriteria }, { NULL, 0, 0, NULL } }; static int dissect_ulp_HistoricReporting(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_HistoricReporting, HistoricReporting_sequence); return offset; } static const value_string ulp_ProtLevel_vals[] = { { 0, "nullProtection" }, { 1, "basicProtection" }, { 0, NULL } }; static int dissect_ulp_ProtLevel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_BIT_STRING_SIZE_32(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 32, 32, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t BasicProtectionParams_sequence[] = { { &hf_ulp_keyIdentifier , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_OCTET_STRING_SIZE_8 }, { &hf_ulp_basicReplayCounter, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_basicMAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_32 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_BasicProtectionParams(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_BasicProtectionParams, BasicProtectionParams_sequence); return offset; } static const per_sequence_t ProtectionLevel_sequence[] = { { &hf_ulp_protlevel , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ProtLevel }, { &hf_ulp_basicProtectionParams, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BasicProtectionParams }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ProtectionLevel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ProtectionLevel, ProtectionLevel_sequence); return offset; } static const per_sequence_t GNSSPosTechnology_sequence[] = { { &hf_ulp_gps , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_galileo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_sbas , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_modernized_gps , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_qzss , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_glonass , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_bds , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_rtk_osr , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GNSSPosTechnology(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GNSSPosTechnology, GNSSPosTechnology_sequence); return offset; } static const per_sequence_t Ver2_SUPL_INIT_extension_sequence[] = { { &hf_ulp_notificationMode, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NotificationMode }, { &hf_ulp_supportedNetworkInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedNetworkInformation }, { &hf_ulp_triggerType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TriggerType }, { &hf_ulp_e_SLPAddress , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SLPAddress }, { &hf_ulp_historicReporting, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_HistoricReporting }, { &hf_ulp_protectionLevel , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ProtectionLevel }, { &hf_ulp_gnssPosTechnology, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GNSSPosTechnology }, { &hf_ulp_minimumMajorVersion, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_INIT_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_INIT_extension, Ver2_SUPL_INIT_extension_sequence); return offset; } static const per_sequence_t SUPLINIT_sequence[] = { { &hf_ulp_posMethod , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosMethod }, { &hf_ulp_notification , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Notification }, { &hf_ulp_sLPAddress , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SLPAddress }, { &hf_ulp_qoP , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_QoP }, { &hf_ulp_sLPMode , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SLPMode }, { &hf_ulp_mac , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MAC }, { &hf_ulp_keyIdentity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_KeyIdentity }, { &hf_ulp_ver2_SUPL_INIT_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_INIT_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLINIT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLINIT, SUPLINIT_sequence); return offset; } static int dissect_ulp_INTEGER_0_15(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 15U, NULL, FALSE); return offset; } static int dissect_ulp_T_ganssSBASid(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 3, 3, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 3, ENC_NA); } return offset; } static const per_sequence_t GANSSPositioningMethodTypes_sequence[] = { { &hf_ulp_setAssisted , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_setBased , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_autonomous , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GANSSPositioningMethodTypes(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSPositioningMethodTypes, GANSSPositioningMethodTypes_sequence); return offset; } static int * const GANSSSignals_bits[] = { &hf_ulp_GANSSSignals_signal1, &hf_ulp_GANSSSignals_signal2, &hf_ulp_GANSSSignals_signal3, &hf_ulp_GANSSSignals_signal4, &hf_ulp_GANSSSignals_signal5, &hf_ulp_GANSSSignals_signal6, &hf_ulp_GANSSSignals_signal7, &hf_ulp_GANSSSignals_signal8, NULL }; static int dissect_ulp_GANSSSignals(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 8, FALSE, GANSSSignals_bits, 8, NULL, NULL); return offset; } static const per_sequence_t RTK_sequence[] = { { &hf_ulp_osr , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_RTK(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_RTK, RTK_sequence); return offset; } static const per_sequence_t GANSSPositionMethod_sequence[] = { { &hf_ulp_ganssId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_15 }, { &hf_ulp_ganssSBASid , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_ganssSBASid }, { &hf_ulp_gANSSPositioningMethodTypes, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSPositioningMethodTypes }, { &hf_ulp_gANSSSignals , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSSignals }, { &hf_ulp_rtk , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RTK }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GANSSPositionMethod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSPositionMethod, GANSSPositionMethod_sequence); return offset; } static const per_sequence_t GANSSPositionMethods_sequence_of[1] = { { &hf_ulp_GANSSPositionMethods_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSPositionMethod }, }; static int dissect_ulp_GANSSPositionMethods(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSPositionMethods, GANSSPositionMethods_sequence_of, 1, 16, FALSE); return offset; } static const value_string ulp_T_addPosID_vals[] = { { 0, "mBS" }, { 0, NULL } }; static int dissect_ulp_T_addPosID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 1, NULL, TRUE, 0, NULL); return offset; } static int * const T_addPosMode_bits[] = { &hf_ulp_T_addPosMode_standalone, &hf_ulp_T_addPosMode_setBased, &hf_ulp_T_addPosMode_setAssisted, NULL }; static int dissect_ulp_T_addPosMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 1, 8, FALSE, T_addPosMode_bits, 3, NULL, NULL); return offset; } static const per_sequence_t AddPosSupport_Element_sequence[] = { { &hf_ulp_addPosID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_addPosID }, { &hf_ulp_addPosMode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_addPosMode }, { NULL, 0, 0, NULL } }; static int dissect_ulp_AddPosSupport_Element(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_AddPosSupport_Element, AddPosSupport_Element_sequence); return offset; } static const per_sequence_t AdditionalPositioningMethods_sequence_of[1] = { { &hf_ulp_AdditionalPositioningMethods_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_AddPosSupport_Element }, }; static int dissect_ulp_AdditionalPositioningMethods(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_AdditionalPositioningMethods, AdditionalPositioningMethods_sequence_of, 1, 8, FALSE); return offset; } static const per_sequence_t Ver2_PosTechnology_extension_sequence[] = { { &hf_ulp_gANSSPositionMethods, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GANSSPositionMethods }, { &hf_ulp_additionalPositioningMethods, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_AdditionalPositioningMethods }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_PosTechnology_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_PosTechnology_extension, Ver2_PosTechnology_extension_sequence); return offset; } static const per_sequence_t PosTechnology_sequence[] = { { &hf_ulp_agpsSETassisted , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_agpsSETBased , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_autonomousGPS , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_aflt , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ecid , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_eotd , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_otdoa , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ver2_PosTechnology_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_PosTechnology_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PosTechnology(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PosTechnology, PosTechnology_sequence); return offset; } static const value_string ulp_PrefMethod_vals[] = { { 0, "agpsSETassistedPreferred" }, { 1, "agpsSETBasedPreferred" }, { 2, "noPreference" }, { 0, NULL } }; static int dissect_ulp_PrefMethod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t PosProtocolVersion3GPP_sequence[] = { { &hf_ulp_majorVersionField, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_technicalVersionField, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_editorialVersionField, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PosProtocolVersion3GPP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PosProtocolVersion3GPP, PosProtocolVersion3GPP_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 6, 6, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t Supported3GPP2PosProtocolVersion_sequence[] = { { &hf_ulp_revisionNumber , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_6 }, { &hf_ulp_pointReleaseNumber, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_internalEditLevel, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Supported3GPP2PosProtocolVersion(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Supported3GPP2PosProtocolVersion, Supported3GPP2PosProtocolVersion_sequence); return offset; } static const per_sequence_t PosProtocolVersion3GPP2_sequence_of[1] = { { &hf_ulp_PosProtocolVersion3GPP2_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_Supported3GPP2PosProtocolVersion }, }; static int dissect_ulp_PosProtocolVersion3GPP2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_PosProtocolVersion3GPP2, PosProtocolVersion3GPP2_sequence_of, 1, 8, FALSE); return offset; } static const per_sequence_t PosProtocolVersionOMA_sequence[] = { { &hf_ulp_majorVersionField, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_minorVersionField, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PosProtocolVersionOMA(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PosProtocolVersionOMA, PosProtocolVersionOMA_sequence); return offset; } static const per_sequence_t Ver2_PosProtocol_extension_sequence[] = { { &hf_ulp_lpp , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_posProtocolVersionRRLP, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PosProtocolVersion3GPP }, { &hf_ulp_posProtocolVersionRRC, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PosProtocolVersion3GPP }, { &hf_ulp_posProtocolVersionTIA801, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PosProtocolVersion3GPP2 }, { &hf_ulp_posProtocolVersionLPP, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PosProtocolVersion3GPP }, { &hf_ulp_lppe , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { &hf_ulp_posProtocolVersionLPPe, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_PosProtocolVersionOMA }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_PosProtocol_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_PosProtocol_extension, Ver2_PosProtocol_extension_sequence); return offset; } static const per_sequence_t PosProtocol_sequence[] = { { &hf_ulp_tia801 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_rrlp , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_rrc , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ver2_PosProtocol_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_PosProtocol_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PosProtocol(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PosProtocol, PosProtocol_sequence); return offset; } static const per_sequence_t ServicesSupported_sequence[] = { { &hf_ulp_periodicTrigger , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_areaEventTrigger, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ServicesSupported(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ServicesSupported, ServicesSupported_sequence); return offset; } static int dissect_ulp_INTEGER_1_3600(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 3600U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_1_1440(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 1440U, NULL, FALSE); return offset; } static const per_sequence_t RepMode_sequence[] = { { &hf_ulp_realtime , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_quasirealtime , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_batch , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_RepMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_RepMode, RepMode_sequence); return offset; } static int dissect_ulp_INTEGER_1_1024(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 1024U, NULL, FALSE); return offset; } static const per_sequence_t BatchRepCap_sequence[] = { { &hf_ulp_report_position , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_report_measurements, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_max_num_positions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1024 }, { &hf_ulp_max_num_measurements, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1024 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_BatchRepCap(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_BatchRepCap, BatchRepCap_sequence); return offset; } static const per_sequence_t ReportingCap_sequence[] = { { &hf_ulp_minInt , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_3600 }, { &hf_ulp_maxInt , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1440 }, { &hf_ulp_repMode_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_RepMode }, { &hf_ulp_batchRepCap , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BatchRepCap }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReportingCap(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReportingCap, ReportingCap_sequence); return offset; } static const per_sequence_t GeoAreaShapesSupported_sequence[] = { { &hf_ulp_ellipticalArea_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_polygonArea_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GeoAreaShapesSupported(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GeoAreaShapesSupported, GeoAreaShapesSupported_sequence); return offset; } static int dissect_ulp_INTEGER_0_maxNumGeoArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxNumGeoArea, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_maxAreaIdList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxAreaIdList, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_maxAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxAreaId, NULL, FALSE); return offset; } static const per_sequence_t EventTriggerCapabilities_sequence[] = { { &hf_ulp_geoAreaShapesSupported, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GeoAreaShapesSupported }, { &hf_ulp_maxNumGeoAreaSupported, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_maxNumGeoArea }, { &hf_ulp_maxAreaIdListSupported, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_maxAreaIdList }, { &hf_ulp_maxAreaIdSupportedPerList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_maxAreaId }, { NULL, 0, 0, NULL } }; static int dissect_ulp_EventTriggerCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_EventTriggerCapabilities, EventTriggerCapabilities_sequence); return offset; } static int dissect_ulp_INTEGER_1_32(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 32U, NULL, FALSE); return offset; } static const per_sequence_t SessionCapabilities_sequence[] = { { &hf_ulp_maxNumberTotalSessions, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_128 }, { &hf_ulp_maxNumberPeriodicSessions, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_32 }, { &hf_ulp_maxNumberTriggeredSessions, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_32 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SessionCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SessionCapabilities, SessionCapabilities_sequence); return offset; } static const per_sequence_t ServiceCapabilities_sequence[] = { { &hf_ulp_servicesSupported, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ServicesSupported }, { &hf_ulp_reportingCapabilities, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportingCap }, { &hf_ulp_eventTriggerCapabilities, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_EventTriggerCapabilities }, { &hf_ulp_sessionCapabilities, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SessionCapabilities }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ServiceCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ServiceCapabilities, ServiceCapabilities_sequence); return offset; } static const per_sequence_t SupportedBearers_sequence[] = { { &hf_ulp_gsm , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_wcdma , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_lte , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_cdma , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_hprd , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_umb , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_wlan , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_wiMAX , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_nr , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SupportedBearers(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SupportedBearers, SupportedBearers_sequence); return offset; } static const per_sequence_t Ver2_SETCapabilities_extension_sequence[] = { { &hf_ulp_serviceCapabilities, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ServiceCapabilities }, { &hf_ulp_supportedBearers, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_SupportedBearers }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SETCapabilities_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SETCapabilities_extension, Ver2_SETCapabilities_extension_sequence); return offset; } static const per_sequence_t SETCapabilities_sequence[] = { { &hf_ulp_posTechnology , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosTechnology }, { &hf_ulp_prefMethod , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PrefMethod }, { &hf_ulp_posProtocol , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosProtocol }, { &hf_ulp_ver2_SETCapabilities_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SETCapabilities_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SETCapabilities(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SETCapabilities, SETCapabilities_sequence); return offset; } static int dissect_ulp_INTEGER_0_999(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 999U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_1023(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1023U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_63(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 63U, NULL, FALSE); return offset; } static const per_sequence_t NMRelement_sequence[] = { { &hf_ulp_arfcn , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_1023 }, { &hf_ulp_bsic , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_63 }, { &hf_ulp_rxLev , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_63 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NMRelement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NMRelement, NMRelement_sequence); return offset; } static const per_sequence_t NMR_sequence_of[1] = { { &hf_ulp_NMR_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_NMRelement }, }; static int dissect_ulp_NMR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_NMR, NMR_sequence_of, 1, 15, FALSE); return offset; } static const per_sequence_t GsmCellInformation_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refLAC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refCI , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_nmr , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NMR }, { &hf_ulp_ta , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GsmCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GsmCellInformation, GsmCellInformation_sequence); return offset; } static int dissect_ulp_INTEGER_0_268435455(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 268435455U, NULL, FALSE); return offset; } static int dissect_ulp_UARFCN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 16383U, NULL, FALSE); return offset; } static const per_sequence_t FrequencyInfoFDD_sequence[] = { { &hf_ulp_uarfcn_UL , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UARFCN }, { &hf_ulp_uarfcn_DL , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_UARFCN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_FrequencyInfoFDD(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_FrequencyInfoFDD, FrequencyInfoFDD_sequence); return offset; } static const per_sequence_t FrequencyInfoTDD_sequence[] = { { &hf_ulp_uarfcn_Nt , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_UARFCN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_FrequencyInfoTDD(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_FrequencyInfoTDD, FrequencyInfoTDD_sequence); return offset; } static const value_string ulp_FrequencySpecificInfo_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t FrequencySpecificInfo_choice[] = { { 0, &hf_ulp_fdd_fr , ASN1_EXTENSION_ROOT , dissect_ulp_FrequencyInfoFDD }, { 1, &hf_ulp_tdd_fr , ASN1_EXTENSION_ROOT , dissect_ulp_FrequencyInfoTDD }, { 0, NULL, 0, NULL } }; static int dissect_ulp_FrequencySpecificInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_FrequencySpecificInfo, FrequencySpecificInfo_choice, NULL); return offset; } static const per_sequence_t FrequencyInfo_sequence[] = { { &hf_ulp_modeSpecificFrequencyInfo, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_FrequencySpecificInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_FrequencyInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_FrequencyInfo, FrequencyInfo_sequence); return offset; } static int dissect_ulp_INTEGER_0_511(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 511U, NULL, FALSE); return offset; } static int dissect_ulp_UTRA_CarrierRSSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static const per_sequence_t PrimaryCPICH_Info_sequence[] = { { &hf_ulp_primaryScramblingCode, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_511 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PrimaryCPICH_Info(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PrimaryCPICH_Info, PrimaryCPICH_Info_sequence); return offset; } static int dissect_ulp_CPICH_Ec_N0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 63U, NULL, FALSE); return offset; } static int dissect_ulp_CPICH_RSCP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_ulp_Pathloss(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 46U, 173U, NULL, FALSE); return offset; } static const per_sequence_t T_fdd_sequence[] = { { &hf_ulp_primaryCPICH_Info, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PrimaryCPICH_Info }, { &hf_ulp_cpich_Ec_N0 , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_CPICH_Ec_N0 }, { &hf_ulp_cpich_RSCP , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_CPICH_RSCP }, { &hf_ulp_pathloss , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_Pathloss }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_fdd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_fdd, T_fdd_sequence); return offset; } static int dissect_ulp_CellParametersID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_ulp_TGSN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 14U, NULL, FALSE); return offset; } static int dissect_ulp_PrimaryCCPCH_RSCP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_ulp_TimeslotISCP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static const per_sequence_t TimeslotISCP_List_sequence_of[1] = { { &hf_ulp_TimeslotISCP_List_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_TimeslotISCP }, }; static int dissect_ulp_TimeslotISCP_List(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_TimeslotISCP_List, TimeslotISCP_List_sequence_of, 1, maxTS, FALSE); return offset; } static const per_sequence_t T_tdd_sequence[] = { { &hf_ulp_cellParametersID, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellParametersID }, { &hf_ulp_proposedTGSN , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_TGSN }, { &hf_ulp_primaryCCPCH_RSCP, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_PrimaryCCPCH_RSCP }, { &hf_ulp_pathloss , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_Pathloss }, { &hf_ulp_timeslotISCP_List, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_TimeslotISCP_List }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_tdd(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_tdd, T_tdd_sequence); return offset; } static const value_string ulp_T_modeSpecificInfo_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t T_modeSpecificInfo_choice[] = { { 0, &hf_ulp_fdd , ASN1_NO_EXTENSIONS , dissect_ulp_T_fdd }, { 1, &hf_ulp_tdd , ASN1_NO_EXTENSIONS , dissect_ulp_T_tdd }, { 0, NULL, 0, NULL } }; static int dissect_ulp_T_modeSpecificInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_T_modeSpecificInfo, T_modeSpecificInfo_choice, NULL); return offset; } static const per_sequence_t CellMeasuredResults_sequence[] = { { &hf_ulp_cellIdentity , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_268435455 }, { &hf_ulp_modeSpecificInfo, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_T_modeSpecificInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CellMeasuredResults(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CellMeasuredResults, CellMeasuredResults_sequence); return offset; } static const per_sequence_t CellMeasuredResultsList_sequence_of[1] = { { &hf_ulp_CellMeasuredResultsList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellMeasuredResults }, }; static int dissect_ulp_CellMeasuredResultsList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_CellMeasuredResultsList, CellMeasuredResultsList_sequence_of, 1, maxCellMeas, FALSE); return offset; } static const per_sequence_t MeasuredResults_sequence[] = { { &hf_ulp_frequencyInfo , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_FrequencyInfo }, { &hf_ulp_utra_CarrierRSSI, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_UTRA_CarrierRSSI }, { &hf_ulp_cellMeasuredResultsList, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_CellMeasuredResultsList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_MeasuredResults(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_MeasuredResults, MeasuredResults_sequence); return offset; } static const per_sequence_t MeasuredResultsList_sequence_of[1] = { { &hf_ulp_MeasuredResultsList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MeasuredResults }, }; static int dissect_ulp_MeasuredResultsList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MeasuredResultsList, MeasuredResultsList_sequence_of, 1, maxFreq, FALSE); return offset; } static int dissect_ulp_INTEGER_0_8191(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 8191U, NULL, FALSE); return offset; } static const value_string ulp_TAResolution_vals[] = { { 0, "res10chip" }, { 1, "res05chip" }, { 2, "res0125chip" }, { 0, NULL } }; static int dissect_ulp_TAResolution(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const value_string ulp_ChipRate_vals[] = { { 0, "tdd128" }, { 1, "tdd384" }, { 2, "tdd768" }, { 0, NULL } }; static int dissect_ulp_ChipRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t TimingAdvance_sequence[] = { { &hf_ulp_ta_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8191 }, { &hf_ulp_tAResolution , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TAResolution }, { &hf_ulp_chipRate , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ChipRate }, { NULL, 0, 0, NULL } }; static int dissect_ulp_TimingAdvance(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_TimingAdvance, TimingAdvance_sequence); return offset; } static const per_sequence_t WcdmaCellInformation_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refUC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_268435455 }, { &hf_ulp_frequencyInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_FrequencyInfo }, { &hf_ulp_primaryScramblingCode, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_511 }, { &hf_ulp_measuredResultsList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MeasuredResultsList }, { &hf_ulp_cellParametersId, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { &hf_ulp_timingAdvance , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_TimingAdvance }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WcdmaCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WcdmaCellInformation, WcdmaCellInformation_sequence); return offset; } static int dissect_ulp_INTEGER_0_32767(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 32767U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_4194303(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4194303U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_8388607(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 8388607U, NULL, FALSE); return offset; } static const per_sequence_t CdmaCellInformation_sequence[] = { { &hf_ulp_refNID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refSID_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_32767 }, { &hf_ulp_refBASEID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refBASELAT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { &hf_ulp_reBASELONG , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8388607 }, { &hf_ulp_refREFPN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_511 }, { &hf_ulp_refWeekNumber , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refSeconds , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CdmaCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CdmaCellInformation, CdmaCellInformation_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_128(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 128, 128, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t HrpdCellInformation_sequence[] = { { &hf_ulp_refSECTORID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_128 }, { &hf_ulp_refBASELAT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { &hf_ulp_reBASELONG , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8388607 }, { &hf_ulp_refWeekNumber , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refSeconds , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_HrpdCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_HrpdCellInformation, HrpdCellInformation_sequence); return offset; } static const per_sequence_t UmbCellInformation_sequence[] = { { &hf_ulp_refSECTORID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_128 }, { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refBASELAT , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { &hf_ulp_reBASELONG , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8388607 }, { &hf_ulp_refWeekNumber , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refSeconds , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4194303 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UmbCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UmbCellInformation, UmbCellInformation_sequence); return offset; } static int dissect_ulp_MCC_MNC_Digit(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 9U, NULL, FALSE); return offset; } static const per_sequence_t MCC_sequence_of[1] = { { &hf_ulp_MCC_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MCC_MNC_Digit }, }; static int dissect_ulp_MCC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MCC, MCC_sequence_of, 3, 3, FALSE); return offset; } static const per_sequence_t MNC_sequence_of[1] = { { &hf_ulp_MNC_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MCC_MNC_Digit }, }; static int dissect_ulp_MNC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MNC, MNC_sequence_of, 2, 3, FALSE); return offset; } static const per_sequence_t PLMN_Identity_sequence[] = { { &hf_ulp_mcc , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_MCC }, { &hf_ulp_mnc , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MNC }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PLMN_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PLMN_Identity, PLMN_Identity_sequence); return offset; } static int dissect_ulp_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 28, 28, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t CellGlobalIdEUTRA_sequence[] = { { &hf_ulp_plmn_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PLMN_Identity }, { &hf_ulp_cellIdentity_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_CellIdentity }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CellGlobalIdEUTRA(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CellGlobalIdEUTRA, CellGlobalIdEUTRA_sequence); return offset; } static int dissect_ulp_PhysCellId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 503U, NULL, FALSE); return offset; } static int dissect_ulp_TrackingAreaCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_RSRP_Range(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 97U, NULL, FALSE); return offset; } static int dissect_ulp_RSRQ_Range(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 34U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_1282(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1282U, NULL, FALSE); return offset; } static const per_sequence_t T_cgi_Info_sequence[] = { { &hf_ulp_cellGlobalId , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellGlobalIdEUTRA }, { &hf_ulp_trackingAreaCode, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_TrackingAreaCode }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_cgi_Info(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_cgi_Info, T_cgi_Info_sequence); return offset; } static int dissect_ulp_INTEGER_65536_262143(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 65536U, 262143U, NULL, FALSE); return offset; } static int dissect_ulp_RSRP_Range_Ext(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -17, -1, NULL, FALSE); return offset; } static int dissect_ulp_RSRQ_Range_Ext(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -30, 46U, NULL, FALSE); return offset; } static int dissect_ulp_RS_SINR_Range(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, NULL, FALSE); return offset; } static int dissect_ulp_TrackingAreaCodeNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 24, 24, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t NeighbourInformation5G_sequence[] = { { &hf_ulp_trackingAreaCode_01, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TrackingAreaCodeNR }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NeighbourInformation5G(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NeighbourInformation5G, NeighbourInformation5G_sequence); return offset; } static const per_sequence_t T_measResult_sequence[] = { { &hf_ulp_rsrpResult , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RSRP_Range }, { &hf_ulp_rsrqResult , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RSRQ_Range }, { &hf_ulp_earfcn , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_earfcn_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_65536_262143 }, { &hf_ulp_rsrpResult_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RSRP_Range_Ext }, { &hf_ulp_rsrqResult_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RSRQ_Range_Ext }, { &hf_ulp_rs_sinrResult , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RS_SINR_Range }, { &hf_ulp_neighbourInformation5G, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_NeighbourInformation5G }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_measResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_measResult, T_measResult_sequence); return offset; } static const per_sequence_t MeasResultEUTRA_sequence[] = { { &hf_ulp_physCellId , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PhysCellId }, { &hf_ulp_cgi_Info , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_T_cgi_Info }, { &hf_ulp_measResult , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_T_measResult }, { NULL, 0, 0, NULL } }; static int dissect_ulp_MeasResultEUTRA(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_MeasResultEUTRA, MeasResultEUTRA_sequence); return offset; } static const per_sequence_t MeasResultListEUTRA_sequence_of[1] = { { &hf_ulp_MeasResultListEUTRA_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MeasResultEUTRA }, }; static int dissect_ulp_MeasResultListEUTRA(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MeasResultListEUTRA, MeasResultListEUTRA_sequence_of, 1, maxCellReport, FALSE); return offset; } static const per_sequence_t ServingInformation5G_sequence[] = { { &hf_ulp_trackingAreaCode_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_TrackingAreaCodeNR }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ServingInformation5G(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ServingInformation5G, ServingInformation5G_sequence); return offset; } static const per_sequence_t LteCellInformation_sequence[] = { { &hf_ulp_cellGlobalIdEUTRA, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_CellGlobalIdEUTRA }, { &hf_ulp_physCellId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PhysCellId }, { &hf_ulp_trackingAreaCode, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_TrackingAreaCode }, { &hf_ulp_rsrpResult , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RSRP_Range }, { &hf_ulp_rsrqResult , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RSRQ_Range }, { &hf_ulp_ta_02 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1282 }, { &hf_ulp_measResultListEUTRA, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MeasResultListEUTRA }, { &hf_ulp_earfcn , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_earfcn_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_65536_262143 }, { &hf_ulp_rsrpResult_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RSRP_Range_Ext }, { &hf_ulp_rsrqResult_ext , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RSRQ_Range_Ext }, { &hf_ulp_rs_sinrResult , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RS_SINR_Range }, { &hf_ulp_servingInformation5G, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_ServingInformation5G }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LteCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LteCellInformation, LteCellInformation_sequence); return offset; } static int dissect_ulp_T_apMACAddress_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 48, 48, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_item(tree, hf_index, val_tvb, 0, 6, ENC_NA); } return offset; } static int dissect_ulp_INTEGER_M127_128(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -127, 128U, NULL, FALSE); return offset; } static const value_string ulp_T_apDeviceType_vals[] = { { 0, "wlan802-11a" }, { 1, "wlan802-11b" }, { 2, "wlan802-11g" }, { 3, "wlan802-11n" }, { 4, "wlan802-11ac" }, { 5, "wlan802-11ad" }, { 0, NULL } }; static int dissect_ulp_T_apDeviceType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 3, NULL); return offset; } static int dissect_ulp_INTEGER_0_256(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 256U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_16777216(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 16777216U, NULL, FALSE); return offset; } static const value_string ulp_RTDUnits_vals[] = { { 0, "microseconds" }, { 1, "hundredsofnanoseconds" }, { 2, "tensofnanoseconds" }, { 3, "nanoseconds" }, { 4, "tenthsofnanoseconds" }, { 0, NULL } }; static int dissect_ulp_RTDUnits(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 5, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t RTD_sequence[] = { { &hf_ulp_rTDValue , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_16777216 }, { &hf_ulp_rTDUnits , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_RTDUnits }, { &hf_ulp_rTDAccuracy , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_RTD(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_RTD, RTD_sequence); return offset; } static const value_string ulp_LocationEncodingDescriptor_vals[] = { { 0, "lci" }, { 1, "asn1" }, { 0, NULL } }; static int dissect_ulp_LocationEncodingDescriptor(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_INTEGER_0_4294967295(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4294967295U, NULL, FALSE); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_1_128(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 128, FALSE, NULL); return offset; } static const per_sequence_t LocationData_sequence[] = { { &hf_ulp_locationAccuracy, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_4294967295 }, { &hf_ulp_locationValue , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_OCTET_STRING_SIZE_1_128 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LocationData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LocationData, LocationData_sequence); return offset; } static const per_sequence_t ReportedLocation_sequence[] = { { &hf_ulp_locationEncodingDescriptor, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationEncodingDescriptor }, { &hf_ulp_locationData , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationData }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReportedLocation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReportedLocation, ReportedLocation_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_4(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 4, 4, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_BIT_STRING_SIZE_30(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 30, 30, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_BIT_STRING_SIZE_8(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t LocationDataLCI_sequence[] = { { &hf_ulp_latitudeResolution, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_6 }, { &hf_ulp_latitude_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_34 }, { &hf_ulp_longitudeResolution, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_6 }, { &hf_ulp_longitude_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_34 }, { &hf_ulp_altitudeType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_4 }, { &hf_ulp_altitudeResolution, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_6 }, { &hf_ulp_altitude_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_30 }, { &hf_ulp_datum , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_8 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LocationDataLCI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LocationDataLCI, LocationDataLCI_sequence); return offset; } static const per_sequence_t LciLocData_sequence[] = { { &hf_ulp_locationDataLCI , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_LocationDataLCI }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LciLocData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LciLocData, LciLocData_sequence); return offset; } static const value_string ulp_RepLocation_vals[] = { { 0, "lciLocData" }, { 0, NULL } }; static const per_choice_t RepLocation_choice[] = { { 0, &hf_ulp_lciLocData , ASN1_EXTENSION_ROOT , dissect_ulp_LciLocData }, { 0, NULL, 0, NULL } }; static int dissect_ulp_RepLocation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_RepLocation, RepLocation_choice, NULL); return offset; } static int dissect_ulp_INTEGER_0_1(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1U, NULL, FALSE); return offset; } static int dissect_ulp_T_apSSID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *ssid_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, -1, 1, 32, FALSE, &ssid_tvb); if (ssid_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, ssid_tvb, 0, -1, ENC_ASCII|ENC_NA); } return offset; } static const value_string ulp_T_apPHYType_vals[] = { { 0, "unknown" }, { 1, "any" }, { 2, "fhss" }, { 3, "dsss" }, { 4, "irbaseband" }, { 5, "ofdm" }, { 6, "hrdsss" }, { 7, "erp" }, { 8, "ht" }, { 9, "ihv" }, { 0, NULL } }; static int dissect_ulp_T_apPHYType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 10, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_T_setMACAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 48, 48, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_item(tree, hf_index, val_tvb, 0, 6, ENC_NA); } return offset; } static const per_sequence_t WlanAPInformation_sequence[] = { { &hf_ulp_apMACAddress_02 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_apMACAddress_02 }, { &hf_ulp_apTransmitPower , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_apAntennaGain , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_apSignaltoNoise , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_apDeviceType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_apDeviceType }, { &hf_ulp_apSignalStrength, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_apChannelFrequency, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_256 }, { &hf_ulp_apRoundTripDelay, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RTD }, { &hf_ulp_setTransmitPower, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_setAntennaGain , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_setSignaltoNoise, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_setSignalStrength, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M127_128 }, { &hf_ulp_apReportedLocation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportedLocation }, { &hf_ulp_apRepLocation , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_RepLocation }, { &hf_ulp_apSignalStrengthDelta, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1 }, { &hf_ulp_apSignaltoNoiseDelta, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1 }, { &hf_ulp_setSignalStrengthDelta, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1 }, { &hf_ulp_setSignaltoNoiseDelta, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1 }, { &hf_ulp_operatingClass , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { &hf_ulp_apSSID_01 , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_T_apSSID }, { &hf_ulp_apPHYType_01 , ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_T_apPHYType }, { &hf_ulp_setMACAddress_01, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_T_setMACAddress }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WlanAPInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WlanAPInformation, WlanAPInformation_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_24(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 24, 24, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t WimaxBsID_sequence[] = { { &hf_ulp_bsID_MSB , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_24 }, { &hf_ulp_bsID_LSB , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_24 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WimaxBsID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxBsID, WimaxBsID_sequence); return offset; } static const per_sequence_t WimaxRTD_sequence[] = { { &hf_ulp_rtd , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_rTDstd , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1023 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WimaxRTD(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxRTD, WimaxRTD_sequence); return offset; } static int dissect_ulp_INTEGER_M32768_32767(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -32768, 32767U, NULL, FALSE); return offset; } static const per_sequence_t WimaxNMR_sequence[] = { { &hf_ulp_wimaxBsID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_WimaxBsID }, { &hf_ulp_relDelay , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_M32768_32767 }, { &hf_ulp_relDelaystd , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_1023 }, { &hf_ulp_rssi , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { &hf_ulp_rSSIstd , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_63 }, { &hf_ulp_bSTxPower , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { &hf_ulp_cinr , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_255 }, { &hf_ulp_cINRstd , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_63 }, { &hf_ulp_bSLocation , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportedLocation }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WimaxNMR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxNMR, WimaxNMR_sequence); return offset; } static const per_sequence_t WimaxNMRList_sequence_of[1] = { { &hf_ulp_WimaxNMRList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_WimaxNMR }, }; static int dissect_ulp_WimaxNMRList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxNMRList, WimaxNMRList_sequence_of, 1, maxWimaxBSMeas, FALSE); return offset; } static const per_sequence_t WimaxBSInformation_sequence[] = { { &hf_ulp_wimaxBsID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_WimaxBsID }, { &hf_ulp_wimaxRTD , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_WimaxRTD }, { &hf_ulp_wimaxNMRList , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_WimaxNMRList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WimaxBSInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxBSInformation, WimaxBSInformation_sequence); return offset; } static int dissect_ulp_PhysCellIdNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 1007U, NULL, FALSE); return offset; } static int dissect_ulp_ARFCN_NR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 3279165U, NULL, FALSE); return offset; } static int dissect_ulp_CellIdentityNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 36, 36, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t CellGlobalIdNR_sequence[] = { { &hf_ulp_plmn_Identity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PLMN_Identity }, { &hf_ulp_cellIdentityNR , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_CellIdentityNR }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CellGlobalIdNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CellGlobalIdNR, CellGlobalIdNR_sequence); return offset; } static const per_sequence_t NR_Measurements_sequence[] = { { &hf_ulp_rsrp_Range , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { &hf_ulp_rsrq_Range , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { &hf_ulp_sinr_Range , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NR_Measurements(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NR_Measurements, NR_Measurements_sequence); return offset; } static int dissect_ulp_INTEGER_0_3846(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 3846U, NULL, FALSE); return offset; } static const per_sequence_t ServCellNR_sequence[] = { { &hf_ulp_physCellId_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PhysCellIdNR }, { &hf_ulp_arfcn_NR , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ARFCN_NR }, { &hf_ulp_cellGlobalId_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_CellGlobalIdNR }, { &hf_ulp_trackingAreaCode_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_TrackingAreaCodeNR }, { &hf_ulp_ssb_Measurements, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NR_Measurements }, { &hf_ulp_csi_rs_Measurements, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NR_Measurements }, { &hf_ulp_ta_03 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_3846 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ServCellNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ServCellNR, ServCellNR_sequence); return offset; } static const per_sequence_t ServingCellInformationNR_sequence_of[1] = { { &hf_ulp_ServingCellInformationNR_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_ServCellNR }, }; static int dissect_ulp_ServingCellInformationNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_ServingCellInformationNR, ServingCellInformationNR_sequence_of, 1, maxNRServingCell, FALSE); return offset; } static const per_sequence_t MeasResultNR_sequence[] = { { &hf_ulp_physCellId_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PhysCellIdNR }, { &hf_ulp_arfcn_NR , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ARFCN_NR }, { &hf_ulp_cellGlobalId_01 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_CellGlobalIdNR }, { &hf_ulp_trackingAreaCode_01, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TrackingAreaCodeNR }, { &hf_ulp_ssb_Measurements, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NR_Measurements }, { &hf_ulp_csi_rs_Measurements, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NR_Measurements }, { NULL, 0, 0, NULL } }; static int dissect_ulp_MeasResultNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_MeasResultNR, MeasResultNR_sequence); return offset; } static const per_sequence_t MeasResultListNR_sequence_of[1] = { { &hf_ulp_MeasResultListNR_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_MeasResultNR }, }; static int dissect_ulp_MeasResultListNR(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MeasResultListNR, MeasResultListNR_sequence_of, 1, maxCellReportNR, FALSE); return offset; } static const per_sequence_t NRCellInformation_sequence[] = { { &hf_ulp_servingCellInformation, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ServingCellInformationNR }, { &hf_ulp_measuredResultsListNR, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MeasResultListNR }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NRCellInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NRCellInformation, NRCellInformation_sequence); return offset; } static const value_string ulp_Ver2_CellInfo_extension_vals[] = { { 0, "hrpdCell" }, { 1, "umbCell" }, { 2, "lteCell" }, { 3, "wlanAP" }, { 4, "wimaxBS" }, { 5, "nrCell" }, { 0, NULL } }; static const per_choice_t Ver2_CellInfo_extension_choice[] = { { 0, &hf_ulp_hrpdCell , ASN1_EXTENSION_ROOT , dissect_ulp_HrpdCellInformation }, { 1, &hf_ulp_umbCell , ASN1_EXTENSION_ROOT , dissect_ulp_UmbCellInformation }, { 2, &hf_ulp_lteCell , ASN1_EXTENSION_ROOT , dissect_ulp_LteCellInformation }, { 3, &hf_ulp_wlanAP , ASN1_EXTENSION_ROOT , dissect_ulp_WlanAPInformation }, { 4, &hf_ulp_wimaxBS , ASN1_EXTENSION_ROOT , dissect_ulp_WimaxBSInformation }, { 5, &hf_ulp_nrCell , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_NRCellInformation }, { 0, NULL, 0, NULL } }; static int dissect_ulp_Ver2_CellInfo_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_CellInfo_extension, Ver2_CellInfo_extension_choice, NULL); return offset; } static const value_string ulp_CellInfo_vals[] = { { 0, "gsmCell" }, { 1, "wcdmaCell" }, { 2, "cdmaCell" }, { 3, "ver2-CellInfo-extension" }, { 0, NULL } }; static const per_choice_t CellInfo_choice[] = { { 0, &hf_ulp_gsmCell , ASN1_EXTENSION_ROOT , dissect_ulp_GsmCellInformation }, { 1, &hf_ulp_wcdmaCell , ASN1_EXTENSION_ROOT , dissect_ulp_WcdmaCellInformation }, { 2, &hf_ulp_cdmaCell , ASN1_EXTENSION_ROOT , dissect_ulp_CdmaCellInformation }, { 3, &hf_ulp_ver2_CellInfo_extension, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_CellInfo_extension }, { 0, NULL, 0, NULL } }; static int dissect_ulp_CellInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_CellInfo, CellInfo_choice, NULL); return offset; } static const value_string ulp_Status_vals[] = { { 0, "stale" }, { 1, "current" }, { 2, "unknown" }, { 0, NULL } }; static int dissect_ulp_Status(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t LocationId_sequence[] = { { &hf_ulp_cellInfo , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_CellInfo }, { &hf_ulp_status , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_Status }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LocationId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LocationId, LocationId_sequence); return offset; } static int dissect_ulp_RelativeTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 65535U, NULL, FALSE); return offset; } static const per_sequence_t LocationIdData_sequence[] = { { &hf_ulp_locationId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationId }, { &hf_ulp_relativetimestamp, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RelativeTime }, { &hf_ulp_servingFlag , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LocationIdData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LocationIdData, LocationIdData_sequence); return offset; } static const per_sequence_t MultipleLocationIds_sequence_of[1] = { { &hf_ulp_MultipleLocationIds_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_LocationIdData }, }; static int dissect_ulp_MultipleLocationIds(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_MultipleLocationIds, MultipleLocationIds_sequence_of, 1, maxLidSize, FALSE); return offset; } static int dissect_ulp_T_msisdn_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *msisdn_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &msisdn_tvb); if (msisdn_tvb) { proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_ulp_thirdPartyId); dissect_e164_msisdn(msisdn_tvb, subtree, 0, 8, E164_ENC_BCD); } return offset; } static int dissect_ulp_T_sip_uri(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index, 1, 255, FALSE, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:./-_~%#@?", 72, NULL); return offset; } static int dissect_ulp_T_ims_public_identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index, 1, 255, FALSE, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:./-_~%#@?", 72, NULL); return offset; } static int dissect_ulp_T_mdn_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *mdn_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, &mdn_tvb); if (mdn_tvb) { proto_tree *subtree; subtree = proto_item_add_subtree(actx->created_item, ett_ulp_thirdPartyId); proto_tree_add_string(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, tvb_bcd_dig_to_str(actx->pinfo->pool, mdn_tvb, 0, 8, NULL, FALSE)); } return offset; } static int dissect_ulp_T_uri(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index, 1, 255, FALSE, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-_~%#", 69, NULL); return offset; } static const value_string ulp_ThirdPartyID_vals[] = { { 0, "logicalName" }, { 1, "msisdn" }, { 2, "emailaddr" }, { 3, "sip-uri" }, { 4, "ims-public-identity" }, { 5, "min" }, { 6, "mdn" }, { 7, "uri" }, { 0, NULL } }; static const per_choice_t ThirdPartyID_choice[] = { { 0, &hf_ulp_logicalName , ASN1_EXTENSION_ROOT , dissect_ulp_IA5String_SIZE_1_1000 }, { 1, &hf_ulp_msisdn_01 , ASN1_EXTENSION_ROOT , dissect_ulp_T_msisdn_01 }, { 2, &hf_ulp_emailaddr , ASN1_EXTENSION_ROOT , dissect_ulp_IA5String_SIZE_1_1000 }, { 3, &hf_ulp_sip_uri , ASN1_EXTENSION_ROOT , dissect_ulp_T_sip_uri }, { 4, &hf_ulp_ims_public_identity, ASN1_EXTENSION_ROOT , dissect_ulp_T_ims_public_identity }, { 5, &hf_ulp_min_01 , ASN1_EXTENSION_ROOT , dissect_ulp_BIT_STRING_SIZE_34 }, { 6, &hf_ulp_mdn_01 , ASN1_EXTENSION_ROOT , dissect_ulp_T_mdn_01 }, { 7, &hf_ulp_uri , ASN1_EXTENSION_ROOT , dissect_ulp_T_uri }, { 0, NULL, 0, NULL } }; static int dissect_ulp_ThirdPartyID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_ThirdPartyID, ThirdPartyID_choice, NULL); return offset; } static const per_sequence_t ThirdParty_sequence_of[1] = { { &hf_ulp_ThirdParty_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_ThirdPartyID }, }; static int dissect_ulp_ThirdParty(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_ThirdParty, ThirdParty_sequence_of, 1, 64, FALSE); return offset; } static int dissect_ulp_IA5String_SIZE_1_24(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_IA5String(tvb, offset, actx, tree, hf_index, 1, 24, FALSE, NULL); return offset; } static int dissect_ulp_IA5String_SIZE_1_32(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_IA5String(tvb, offset, actx, tree, hf_index, 1, 32, FALSE, NULL); return offset; } static int dissect_ulp_IA5String_SIZE_1_8(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_IA5String(tvb, offset, actx, tree, hf_index, 1, 8, FALSE, NULL); return offset; } static const per_sequence_t ApplicationID_sequence[] = { { &hf_ulp_appProvider , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_IA5String_SIZE_1_24 }, { &hf_ulp_appName , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_IA5String_SIZE_1_32 }, { &hf_ulp_appVersion , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_IA5String_SIZE_1_8 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ApplicationID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ApplicationID, ApplicationID_sequence); return offset; } static int dissect_ulp_UTCTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_VisibleString(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); return offset; } static const value_string ulp_T_latitudeSign_vals[] = { { 0, "north" }, { 1, "south" }, { 0, NULL } }; static int dissect_ulp_T_latitudeSign(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static int dissect_ulp_INTEGER_M8388608_8388607(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -8388608, 8388607U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_180(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 180U, NULL, FALSE); return offset; } static const per_sequence_t T_uncertainty_sequence[] = { { &hf_ulp_uncertaintySemiMajor, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_127 }, { &hf_ulp_uncertaintySemiMinor, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_127 }, { &hf_ulp_orientationMajorAxis, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_180 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_uncertainty(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_uncertainty, T_uncertainty_sequence); return offset; } static int dissect_ulp_INTEGER_0_100(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 100U, NULL, FALSE); return offset; } static const value_string ulp_T_altitudeDirection_vals[] = { { 0, "height" }, { 1, "depth" }, { 0, NULL } }; static int dissect_ulp_T_altitudeDirection(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t AltitudeInfo_sequence[] = { { &hf_ulp_altitudeDirection, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_altitudeDirection }, { &hf_ulp_altitude , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_32767 }, { &hf_ulp_altUncertainty , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_127 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_AltitudeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_AltitudeInfo, AltitudeInfo_sequence); return offset; } static const per_sequence_t PositionEstimate_sequence[] = { { &hf_ulp_latitudeSign , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_latitudeSign }, { &hf_ulp_latitude , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8388607 }, { &hf_ulp_longitude , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M8388608_8388607 }, { &hf_ulp_uncertainty , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_uncertainty }, { &hf_ulp_confidence , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_100 }, { &hf_ulp_altitudeInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_AltitudeInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PositionEstimate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PositionEstimate, PositionEstimate_sequence); return offset; } static int dissect_ulp_T_bearing(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 9, 9, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 9, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_horspeed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t Horvel_sequence[] = { { &hf_ulp_bearing , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_bearing }, { &hf_ulp_horspeed , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_horspeed }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Horvel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Horvel, Horvel_sequence); return offset; } static int dissect_ulp_T_verdirect(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 1, 1, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 1, ENC_NA); } return offset; } static int dissect_ulp_T_bearing_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 9, 9, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 9, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_horspeed_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_verspeed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 8, 8, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t Horandvervel_sequence[] = { { &hf_ulp_verdirect , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_verdirect }, { &hf_ulp_bearing_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_bearing_01 }, { &hf_ulp_horspeed_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_horspeed_01 }, { &hf_ulp_verspeed , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_verspeed }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Horandvervel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Horandvervel, Horandvervel_sequence); return offset; } static int dissect_ulp_T_bearing_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 9, 9, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 9, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_horspeed_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_uncertspeed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 8, 8, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t Horveluncert_sequence[] = { { &hf_ulp_bearing_02 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_bearing_02 }, { &hf_ulp_horspeed_02 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_horspeed_02 }, { &hf_ulp_uncertspeed , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_uncertspeed }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Horveluncert(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Horveluncert, Horveluncert_sequence); return offset; } static int dissect_ulp_T_verdirect_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 1, 1, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 1, ENC_NA); } return offset; } static int dissect_ulp_T_bearing_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 9, 9, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 9, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_horspeed_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 16, 16, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_verspeed_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 8, 8, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_horuncertspeed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 8, 8, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_T_veruncertspeed(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 8, 8, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { actx->created_item = proto_tree_add_item(tree, hf_index, val_tvb, 0, 1, ENC_BIG_ENDIAN); } return offset; } static const per_sequence_t Horandveruncert_sequence[] = { { &hf_ulp_verdirect_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_verdirect_01 }, { &hf_ulp_bearing_03 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_bearing_03 }, { &hf_ulp_horspeed_03 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_horspeed_03 }, { &hf_ulp_verspeed_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_verspeed_01 }, { &hf_ulp_horuncertspeed , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_horuncertspeed }, { &hf_ulp_veruncertspeed , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_veruncertspeed }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Horandveruncert(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Horandveruncert, Horandveruncert_sequence); return offset; } static const value_string ulp_Velocity_vals[] = { { 0, "horvel" }, { 1, "horandvervel" }, { 2, "horveluncert" }, { 3, "horandveruncert" }, { 0, NULL } }; static const per_choice_t Velocity_choice[] = { { 0, &hf_ulp_horvel , ASN1_EXTENSION_ROOT , dissect_ulp_Horvel }, { 1, &hf_ulp_horandvervel , ASN1_EXTENSION_ROOT , dissect_ulp_Horandvervel }, { 2, &hf_ulp_horveluncert , ASN1_EXTENSION_ROOT , dissect_ulp_Horveluncert }, { 3, &hf_ulp_horandveruncert , ASN1_EXTENSION_ROOT , dissect_ulp_Horandveruncert }, { 0, NULL, 0, NULL } }; static int dissect_ulp_Velocity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_Velocity, Velocity_choice, NULL); return offset; } static const per_sequence_t Position_sequence[] = { { &hf_ulp_timestamp_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_UTCTime }, { &hf_ulp_positionEstimate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PositionEstimate }, { &hf_ulp_velocity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Velocity }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Position(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Position, Position_sequence); return offset; } static const per_sequence_t Ver2_SUPL_START_extension_sequence[] = { { &hf_ulp_multipleLocationIds, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MultipleLocationIds }, { &hf_ulp_thirdParty , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ThirdParty }, { &hf_ulp_applicationID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ApplicationID }, { &hf_ulp_position , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Position }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_START_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_START_extension, Ver2_SUPL_START_extension_sequence); return offset; } static const per_sequence_t SUPLSTART_sequence[] = { { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SETCapabilities }, { &hf_ulp_locationId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationId }, { &hf_ulp_qoP , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_QoP }, { &hf_ulp_ver2_SUPL_START_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_START_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLSTART(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLSTART, SUPLSTART_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_256(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 256, 256, FALSE, NULL, 0, NULL, NULL); return offset; } static const value_string ulp_SETAuthKey_vals[] = { { 0, "shortKey" }, { 1, "longKey" }, { 0, NULL } }; static const per_choice_t SETAuthKey_choice[] = { { 0, &hf_ulp_shortKey , ASN1_EXTENSION_ROOT , dissect_ulp_BIT_STRING_SIZE_128 }, { 1, &hf_ulp_longKey , ASN1_EXTENSION_ROOT , dissect_ulp_BIT_STRING_SIZE_256 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_SETAuthKey(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_SETAuthKey, SETAuthKey_choice, NULL); return offset; } static int dissect_ulp_KeyIdentity4(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 128, 128, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_SPCSETKey(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 128, 128, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t SPCTID_sequence[] = { { &hf_ulp_rand , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_128 }, { &hf_ulp_slpFQDN , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_FQDN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SPCTID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SPCTID, SPCTID_sequence); return offset; } static int dissect_ulp_SPCSETKeylifetime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 24U, NULL, FALSE); return offset; } static const per_sequence_t Ver2_SUPL_RESPONSE_extension_sequence[] = { { &hf_ulp_supportedNetworkInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedNetworkInformation }, { &hf_ulp_sPCSETKey , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCSETKey }, { &hf_ulp_spctid , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCTID }, { &hf_ulp_sPCSETKeylifetime, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCSETKeylifetime }, { &hf_ulp_initialApproximateposition, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Position }, { &hf_ulp_gnssPosTechnology, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GNSSPosTechnology }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_RESPONSE_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_RESPONSE_extension, Ver2_SUPL_RESPONSE_extension_sequence); return offset; } static const per_sequence_t SUPLRESPONSE_sequence[] = { { &hf_ulp_posMethod , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosMethod }, { &hf_ulp_sLPAddress , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SLPAddress }, { &hf_ulp_sETAuthKey , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SETAuthKey }, { &hf_ulp_keyIdentity4 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_KeyIdentity4 }, { &hf_ulp_ver2_SUPL_RESPONSE_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_RESPONSE_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLRESPONSE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLRESPONSE, SUPLRESPONSE_sequence); return offset; } static int dissect_ulp_INTEGER_0_167(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 167U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_31(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 31U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_10(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 10U, NULL, FALSE); return offset; } static const per_sequence_t SatelliteInfoElement_sequence[] = { { &hf_ulp_satId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_63 }, { &hf_ulp_iode , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SatelliteInfoElement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SatelliteInfoElement, SatelliteInfoElement_sequence); return offset; } static const per_sequence_t SatelliteInfo_sequence_of[1] = { { &hf_ulp_SatelliteInfo_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SatelliteInfoElement }, }; static int dissect_ulp_SatelliteInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_SatelliteInfo, SatelliteInfo_sequence_of, 1, 31, FALSE); return offset; } static const per_sequence_t NavigationModel_sequence[] = { { &hf_ulp_gpsWeek , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_1023 }, { &hf_ulp_gpsToe , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_167 }, { &hf_ulp_nsat , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_31 }, { &hf_ulp_toeLimit , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_10 }, { &hf_ulp_satInfo , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SatelliteInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NavigationModel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NavigationModel, NavigationModel_sequence); return offset; } static const per_sequence_t GanssRequestedCommonAssistanceDataList_sequence[] = { { &hf_ulp_ganssReferenceTime, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssIonosphericModel, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssAdditionalIonosphericModelForDataID00, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssAdditionalIonosphericModelForDataID11, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssEarthOrientationParameters, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssAdditionalIonosphericModelForDataID01, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssRequestedCommonAssistanceDataList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssRequestedCommonAssistanceDataList, GanssRequestedCommonAssistanceDataList_sequence); return offset; } static int dissect_ulp_T_ganssId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 val; ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 15U, &val, FALSE); ulp_priv->ganss_req_gen_data_ganss_id = (guint8) val; return offset; } static int dissect_ulp_T_ganssSBASid_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 3, 3, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_bits_item(tree, hf_index, val_tvb, 0, 3, ENC_NA); } return offset; } static int dissect_ulp_DGANSS_Sig_Id_Req(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, NULL, NULL); return offset; } static int dissect_ulp_T_ganssWeek(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); if (ulp_priv->ganss_req_gen_data_ganss_id != 4) { /* Not GLONASS */ proto_item_append_text(actx->created_item, "wk"); } else { proto_item_append_text(actx->created_item, "d"); } return offset; } static int dissect_ulp_T_ganssToe(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 val; ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 167U, &val, FALSE); if (ulp_priv->ganss_req_gen_data_ganss_id != 4) { /* Not GLONASS */ proto_item_append_text(actx->created_item, "h"); } else { proto_item_set_text(actx->created_item, "%umin (%u)", 15*val, val); } return offset; } static int dissect_ulp_T_t_toeLimit(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 val; ulp_private_data_t *ulp_priv = ulp_get_private_data(actx); offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 15U, &val, FALSE); if (ulp_priv->ganss_req_gen_data_ganss_id != 4) { /* Not GLONASS */ proto_item_append_text(actx->created_item, "h"); } else { proto_item_set_text(actx->created_item, "%umin (%u)", 30*val, val); } return offset; } static const per_sequence_t SatellitesListRelatedData_sequence[] = { { &hf_ulp_satId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_63 }, { &hf_ulp_iod , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_1023 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SatellitesListRelatedData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SatellitesListRelatedData, SatellitesListRelatedData_sequence); return offset; } static const per_sequence_t SatellitesListRelatedDataList_sequence_of[1] = { { &hf_ulp_SatellitesListRelatedDataList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SatellitesListRelatedData }, }; static int dissect_ulp_SatellitesListRelatedDataList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_SatellitesListRelatedDataList, SatellitesListRelatedDataList_sequence_of, 0, maxGANSSSat, FALSE); return offset; } static const per_sequence_t GanssNavigationModelData_sequence[] = { { &hf_ulp_ganssWeek , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_ganssWeek }, { &hf_ulp_ganssToe , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_ganssToe }, { &hf_ulp_t_toeLimit , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_t_toeLimit }, { &hf_ulp_satellitesListRelatedDataList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SatellitesListRelatedDataList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssNavigationModelData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssNavigationModelData, GanssNavigationModelData_sequence); return offset; } static int dissect_ulp_T_ganssTimeModels(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 16, 16, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_ulp_ganssTimeModels); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_bit0, val_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_bit1, val_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_bit2, val_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_bit3, val_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_bit4, val_tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_ulp_ganssTimeModels_spare, val_tvb, 0, 2, ENC_BIG_ENDIAN); } return offset; } static int dissect_ulp_INTEGER_0_59(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 59U, NULL, FALSE); return offset; } static const per_sequence_t T_ganssDataBitSatList_sequence_of[1] = { { &hf_ulp_ganssDataBitSatList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_63 }, }; static int dissect_ulp_T_ganssDataBitSatList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_T_ganssDataBitSatList, T_ganssDataBitSatList_sequence_of, 1, maxGANSSSat, FALSE); return offset; } static const per_sequence_t ReqDataBitAssistanceList_sequence[] = { { &hf_ulp_gnssSignals , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSSignals }, { &hf_ulp_ganssDataBitInterval, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_15 }, { &hf_ulp_ganssDataBitSatList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_ganssDataBitSatList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReqDataBitAssistanceList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReqDataBitAssistanceList, ReqDataBitAssistanceList_sequence); return offset; } static const per_sequence_t GanssDataBits_sequence[] = { { &hf_ulp_ganssTODmin , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_59 }, { &hf_ulp_reqDataBitAssistanceList, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_ReqDataBitAssistanceList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssDataBits(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssDataBits, GanssDataBits_sequence); return offset; } static const per_sequence_t GanssAdditionalDataChoices_sequence[] = { { &hf_ulp_orbitModelID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_7 }, { &hf_ulp_clockModelID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_7 }, { &hf_ulp_utcModelID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_7 }, { &hf_ulp_almanacModelID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_7 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssAdditionalDataChoices(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssAdditionalDataChoices, GanssAdditionalDataChoices_sequence); return offset; } static int dissect_ulp_INTEGER_1_256(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 256U, NULL, FALSE); return offset; } static const per_sequence_t ExtendedEphemeris_sequence[] = { { &hf_ulp_validity , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_256 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ExtendedEphemeris(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ExtendedEphemeris, ExtendedEphemeris_sequence); return offset; } static int dissect_ulp_INTEGER_0_23(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 23U, NULL, FALSE); return offset; } static const per_sequence_t GANSSextEphTime_sequence[] = { { &hf_ulp_gANSSday , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8191 }, { &hf_ulp_gANSSTODhour , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_23 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GANSSextEphTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSextEphTime, GANSSextEphTime_sequence); return offset; } static const per_sequence_t GanssExtendedEphCheck_sequence[] = { { &hf_ulp_beginTime_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSextEphTime }, { &hf_ulp_endTime_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSextEphTime }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssExtendedEphCheck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssExtendedEphCheck, GanssExtendedEphCheck_sequence); return offset; } static int dissect_ulp_BDS_Sig_Id_Req(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 8, 8, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t GanssReqGenericData_sequence[] = { { &hf_ulp_ganssId_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_ganssId }, { &hf_ulp_ganssSBASid_01 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_ganssSBASid_01 }, { &hf_ulp_ganssRealTimeIntegrity, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssDifferentialCorrection, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_DGANSS_Sig_Id_Req }, { &hf_ulp_ganssAlmanac , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssNavigationModelData, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssNavigationModelData }, { &hf_ulp_ganssTimeModels , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_ganssTimeModels }, { &hf_ulp_ganssReferenceMeasurementInfo, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssDataBits , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssDataBits }, { &hf_ulp_ganssUTCModel , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssAdditionalDataChoices, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssAdditionalDataChoices }, { &hf_ulp_ganssAuxiliaryInformation, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ganssExtendedEphemeris, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ExtendedEphemeris }, { &hf_ulp_ganssExtendedEphemerisCheck, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssExtendedEphCheck }, { &hf_ulp_bds_DifferentialCorrection, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BDS_Sig_Id_Req }, { &hf_ulp_bds_GridModelReq, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GanssReqGenericData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GanssReqGenericData, GanssReqGenericData_sequence); return offset; } static const per_sequence_t GanssRequestedGenericAssistanceDataList_sequence_of[1] = { { &hf_ulp_GanssRequestedGenericAssistanceDataList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_GanssReqGenericData }, }; static int dissect_ulp_GanssRequestedGenericAssistanceDataList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_GanssRequestedGenericAssistanceDataList, GanssRequestedGenericAssistanceDataList_sequence_of, 1, maxGANSS, FALSE); return offset; } static const per_sequence_t GPSTime_sequence[] = { { &hf_ulp_gPSWeek , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_1023 }, { &hf_ulp_gPSTOWhour , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_167 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GPSTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GPSTime, GPSTime_sequence); return offset; } static const per_sequence_t ExtendedEphCheck_sequence[] = { { &hf_ulp_beginTime , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GPSTime }, { &hf_ulp_endTime , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GPSTime }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ExtendedEphCheck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ExtendedEphCheck, ExtendedEphCheck_sequence); return offset; } static const per_sequence_t Ver2_RequestedAssistData_extension_sequence[] = { { &hf_ulp_ganssRequestedCommonAssistanceDataList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssRequestedCommonAssistanceDataList }, { &hf_ulp_ganssRequestedGenericAssistanceDataList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GanssRequestedGenericAssistanceDataList }, { &hf_ulp_extendedEphemeris, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ExtendedEphemeris }, { &hf_ulp_extendedEphemerisCheck, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ExtendedEphCheck }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_RequestedAssistData_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_RequestedAssistData_extension, Ver2_RequestedAssistData_extension_sequence); return offset; } static const per_sequence_t RequestedAssistData_sequence[] = { { &hf_ulp_almanacRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_utcModelRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_ionosphericModelRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_dgpsCorrectionsRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_referenceLocationRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_referenceTimeRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_acquisitionAssistanceRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_realTimeIntegrityRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_navigationModelRequested, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_navigationModelData, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NavigationModel }, { &hf_ulp_ver2_RequestedAssistData_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_RequestedAssistData_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_RequestedAssistData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_RequestedAssistData, RequestedAssistData_sequence); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_1_8192(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 8192, FALSE, NULL); return offset; } static int dissect_ulp_T_rrlpPayload(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *rrlp_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 8192, FALSE, &rrlp_tvb); if (rrlp_tvb && rrlp_handle) { call_dissector(rrlp_handle, rrlp_tvb, actx->pinfo, tree); } return offset; } static int dissect_ulp_T_lPPPayload_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *lpp_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 60000, FALSE, &lpp_tvb); if (lpp_tvb && lpp_handle) { call_dissector(lpp_handle, lpp_tvb, actx->pinfo, tree); } return offset; } static const per_sequence_t T_lPPPayload_sequence_of[1] = { { &hf_ulp_lPPPayload_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_T_lPPPayload_item }, }; static int dissect_ulp_T_lPPPayload(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_T_lPPPayload, T_lPPPayload_sequence_of, 1, 3, FALSE); return offset; } static int dissect_ulp_OCTET_STRING_SIZE_1_60000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 60000, FALSE, NULL); return offset; } static const per_sequence_t T_tia801Payload_sequence_of[1] = { { &hf_ulp_tia801Payload_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_OCTET_STRING_SIZE_1_60000 }, }; static int dissect_ulp_T_tia801Payload(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_T_tia801Payload, T_tia801Payload_sequence_of, 1, 3, FALSE); return offset; } static const per_sequence_t Ver2_PosPayLoad_extension_sequence[] = { { &hf_ulp_lPPPayload , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_lPPPayload }, { &hf_ulp_tia801Payload , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_tia801Payload }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_PosPayLoad_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_PosPayLoad_extension, Ver2_PosPayLoad_extension_sequence); return offset; } static const value_string ulp_PosPayLoad_vals[] = { { 0, "tia801payload" }, { 1, "rrcPayload" }, { 2, "rrlpPayload" }, { 3, "ver2-PosPayLoad-extension" }, { 0, NULL } }; static const per_choice_t PosPayLoad_choice[] = { { 0, &hf_ulp_tia801payload , ASN1_EXTENSION_ROOT , dissect_ulp_OCTET_STRING_SIZE_1_8192 }, { 1, &hf_ulp_rrcPayload , ASN1_EXTENSION_ROOT , dissect_ulp_OCTET_STRING_SIZE_1_8192 }, { 2, &hf_ulp_rrlpPayload , ASN1_EXTENSION_ROOT , dissect_ulp_T_rrlpPayload }, { 3, &hf_ulp_ver2_PosPayLoad_extension, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_PosPayLoad_extension }, { 0, NULL, 0, NULL } }; static int dissect_ulp_PosPayLoad(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_PosPayLoad, PosPayLoad_choice, NULL); return offset; } static const per_sequence_t T_utran_GPSTimingOfCell_sequence[] = { { &hf_ulp_ms_part , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_1023 }, { &hf_ulp_ls_part , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4294967295 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_utran_GPSTimingOfCell(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_utran_GPSTimingOfCell, T_utran_GPSTimingOfCell_sequence); return offset; } static const per_sequence_t T_fdd_01_sequence[] = { { &hf_ulp_referenceIdentity, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PrimaryCPICH_Info }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_fdd_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_fdd_01, T_fdd_01_sequence); return offset; } static const per_sequence_t T_tdd_01_sequence[] = { { &hf_ulp_referenceIdentity_01, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellParametersID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_tdd_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_tdd_01, T_tdd_01_sequence); return offset; } static const value_string ulp_T_modeSpecificInfo_01_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t T_modeSpecificInfo_01_choice[] = { { 0, &hf_ulp_fdd_01 , ASN1_NO_EXTENSIONS , dissect_ulp_T_fdd_01 }, { 1, &hf_ulp_tdd_01 , ASN1_NO_EXTENSIONS , dissect_ulp_T_tdd_01 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_T_modeSpecificInfo_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_T_modeSpecificInfo_01, T_modeSpecificInfo_01_choice, NULL); return offset; } static int dissect_ulp_INTEGER_0_4095(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, NULL, FALSE); return offset; } static const per_sequence_t UTRAN_GPSReferenceTime_sequence[] = { { &hf_ulp_utran_GPSTimingOfCell, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_T_utran_GPSTimingOfCell }, { &hf_ulp_modeSpecificInfo_01, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_T_modeSpecificInfo_01 }, { &hf_ulp_sfn , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4095 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GPSReferenceTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GPSReferenceTime, UTRAN_GPSReferenceTime_sequence); return offset; } static const value_string ulp_UTRANGPSDriftRate_vals[] = { { 0, "utran-GPSDrift0" }, { 1, "utran-GPSDrift1" }, { 2, "utran-GPSDrift2" }, { 3, "utran-GPSDrift5" }, { 4, "utran-GPSDrift10" }, { 5, "utran-GPSDrift15" }, { 6, "utran-GPSDrift25" }, { 7, "utran-GPSDrift50" }, { 8, "utran-GPSDrift-1" }, { 9, "utran-GPSDrift-2" }, { 10, "utran-GPSDrift-5" }, { 11, "utran-GPSDrift-10" }, { 12, "utran-GPSDrift-15" }, { 13, "utran-GPSDrift-25" }, { 14, "utran-GPSDrift-50" }, { 0, NULL } }; static int dissect_ulp_UTRANGPSDriftRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 15, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t UTRAN_GPSReferenceTimeAssistance_sequence[] = { { &hf_ulp_utran_GPSReferenceTime, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_UTRAN_GPSReferenceTime }, { &hf_ulp_gpsReferenceTimeUncertainty, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { &hf_ulp_utranGPSDriftRate, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_UTRANGPSDriftRate }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GPSReferenceTimeAssistance(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GPSReferenceTimeAssistance, UTRAN_GPSReferenceTimeAssistance_sequence); return offset; } static int dissect_ulp_INTEGER_0_16383(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 16383U, NULL, FALSE); return offset; } static const per_sequence_t T_set_GPSTimingOfCell_sequence[] = { { &hf_ulp_ms_part_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_16383 }, { &hf_ulp_ls_part , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4294967295 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_set_GPSTimingOfCell(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_set_GPSTimingOfCell, T_set_GPSTimingOfCell_sequence); return offset; } static const per_sequence_t T_fdd_02_sequence[] = { { &hf_ulp_referenceIdentity, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PrimaryCPICH_Info }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_fdd_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_fdd_02, T_fdd_02_sequence); return offset; } static const per_sequence_t T_tdd_02_sequence[] = { { &hf_ulp_referenceIdentity_01, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellParametersID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_tdd_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_tdd_02, T_tdd_02_sequence); return offset; } static const value_string ulp_T_modeSpecificInfo_02_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t T_modeSpecificInfo_02_choice[] = { { 0, &hf_ulp_fdd_02 , ASN1_NO_EXTENSIONS , dissect_ulp_T_fdd_02 }, { 1, &hf_ulp_tdd_02 , ASN1_NO_EXTENSIONS , dissect_ulp_T_tdd_02 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_T_modeSpecificInfo_02(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_T_modeSpecificInfo_02, T_modeSpecificInfo_02_choice, NULL); return offset; } static const per_sequence_t UTRAN_GPSReferenceTimeResult_sequence[] = { { &hf_ulp_set_GPSTimingOfCell, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_set_GPSTimingOfCell }, { &hf_ulp_modeSpecificInfo_02, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_modeSpecificInfo_02 }, { &hf_ulp_sfn , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4095 }, { &hf_ulp_gpsReferenceTimeUncertainty, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GPSReferenceTimeResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GPSReferenceTimeResult, UTRAN_GPSReferenceTimeResult_sequence); return offset; } static int dissect_ulp_INTEGER_0_86399(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 86399U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_3999999(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 3999999U, NULL, FALSE); return offset; } static const per_sequence_t T_fdd_03_sequence[] = { { &hf_ulp_referenceIdentity, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PrimaryCPICH_Info }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_fdd_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_fdd_03, T_fdd_03_sequence); return offset; } static const per_sequence_t T_tdd_03_sequence[] = { { &hf_ulp_referenceIdentity_01, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellParametersID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_tdd_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_tdd_03, T_tdd_03_sequence); return offset; } static const value_string ulp_T_modeSpecificInfo_03_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t T_modeSpecificInfo_03_choice[] = { { 0, &hf_ulp_fdd_03 , ASN1_NO_EXTENSIONS , dissect_ulp_T_fdd_03 }, { 1, &hf_ulp_tdd_03 , ASN1_NO_EXTENSIONS , dissect_ulp_T_tdd_03 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_T_modeSpecificInfo_03(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_T_modeSpecificInfo_03, T_modeSpecificInfo_03_choice, NULL); return offset; } static const per_sequence_t UTRAN_GANSSReferenceTime_sequence[] = { { &hf_ulp_ganssTOD , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_86399 }, { &hf_ulp_utran_GANSSTimingOfCell, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_3999999 }, { &hf_ulp_modeSpecificInfo_03, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_modeSpecificInfo_03 }, { &hf_ulp_sfn , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4095 }, { &hf_ulp_ganss_TODUncertainty, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GANSSReferenceTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GANSSReferenceTime, UTRAN_GANSSReferenceTime_sequence); return offset; } static const value_string ulp_UTRANGANSSDriftRate_vals[] = { { 0, "utran-GANSSDrift0" }, { 1, "utran-GANSSDrift1" }, { 2, "utran-GANSSDrift2" }, { 3, "utran-GANSSDrift5" }, { 4, "utran-GANSSDrift10" }, { 5, "utran-GANSSDrift15" }, { 6, "utran-GANSSDrift25" }, { 7, "utran-GANSSDrift50" }, { 8, "utran-GANSSDrift-1" }, { 9, "utran-GANSSDrift-2" }, { 10, "utran-GANSSDrift-5" }, { 11, "utran-GANSSDrift-10" }, { 12, "utran-GANSSDrift-15" }, { 13, "utran-GANSSDrift-25" }, { 14, "utran-GANSSDrift-50" }, { 0, NULL } }; static int dissect_ulp_UTRANGANSSDriftRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 15, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t UTRAN_GANSSReferenceTimeAssistance_sequence[] = { { &hf_ulp_ganssDay , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_8191 }, { &hf_ulp_ganssTimeID , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_15 }, { &hf_ulp_utran_GANSSReferenceTime, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_UTRAN_GANSSReferenceTime }, { &hf_ulp_utranGANSSDriftRate, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_UTRANGANSSDriftRate }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GANSSReferenceTimeAssistance(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GANSSReferenceTimeAssistance, UTRAN_GANSSReferenceTimeAssistance_sequence); return offset; } static int dissect_ulp_INTEGER_0_80(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 80U, NULL, FALSE); return offset; } static const per_sequence_t T_set_GANSSTimingOfCell_sequence[] = { { &hf_ulp_ms_part_02 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_80 }, { &hf_ulp_ls_part , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4294967295 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_set_GANSSTimingOfCell(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_set_GANSSTimingOfCell, T_set_GANSSTimingOfCell_sequence); return offset; } static const per_sequence_t T_fdd_04_sequence[] = { { &hf_ulp_referenceIdentity, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PrimaryCPICH_Info }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_fdd_04(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_fdd_04, T_fdd_04_sequence); return offset; } static const per_sequence_t T_tdd_04_sequence[] = { { &hf_ulp_referenceIdentity_01, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_CellParametersID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_T_tdd_04(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_T_tdd_04, T_tdd_04_sequence); return offset; } static const value_string ulp_T_modeSpecificInfo_04_vals[] = { { 0, "fdd" }, { 1, "tdd" }, { 0, NULL } }; static const per_choice_t T_modeSpecificInfo_04_choice[] = { { 0, &hf_ulp_fdd_04 , ASN1_NO_EXTENSIONS , dissect_ulp_T_fdd_04 }, { 1, &hf_ulp_tdd_04 , ASN1_NO_EXTENSIONS , dissect_ulp_T_tdd_04 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_T_modeSpecificInfo_04(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_T_modeSpecificInfo_04, T_modeSpecificInfo_04_choice, NULL); return offset; } static const per_sequence_t SET_GANSSReferenceTime_sequence[] = { { &hf_ulp_set_GANSSTimingOfCell, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_set_GANSSTimingOfCell }, { &hf_ulp_modeSpecificInfo_04, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_T_modeSpecificInfo_04 }, { &hf_ulp_sfn , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_4095 }, { &hf_ulp_ganss_TODUncertainty, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_127 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SET_GANSSReferenceTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SET_GANSSReferenceTime, SET_GANSSReferenceTime_sequence); return offset; } static const per_sequence_t UTRAN_GANSSReferenceTimeResult_sequence[] = { { &hf_ulp_ganssTimeID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_15 }, { &hf_ulp_set_GANSSReferenceTime, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SET_GANSSReferenceTime }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UTRAN_GANSSReferenceTimeResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UTRAN_GANSSReferenceTimeResult, UTRAN_GANSSReferenceTimeResult_sequence); return offset; } static const per_sequence_t Ver2_SUPL_POS_extension_sequence[] = { { &hf_ulp_utran_GPSReferenceTimeAssistance, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GPSReferenceTimeAssistance }, { &hf_ulp_utran_GPSReferenceTimeResult, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GPSReferenceTimeResult }, { &hf_ulp_utran_GANSSReferenceTimeAssistance, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GANSSReferenceTimeAssistance }, { &hf_ulp_utran_GANSSReferenceTimeResult, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GANSSReferenceTimeResult }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_POS_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_POS_extension, Ver2_SUPL_POS_extension_sequence); return offset; } static const per_sequence_t SUPLPOS_sequence[] = { { &hf_ulp_posPayLoad , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosPayLoad }, { &hf_ulp_velocity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Velocity }, { &hf_ulp_ver2_SUPL_POS_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_POS_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLPOS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLPOS, SUPLPOS_sequence); return offset; } static int dissect_ulp_Ver(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 64, 64, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t Ver2_SUPL_POS_INIT_extension_sequence[] = { { &hf_ulp_multipleLocationIds, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MultipleLocationIds }, { &hf_ulp_utran_GPSReferenceTimeResult, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GPSReferenceTimeResult }, { &hf_ulp_utran_GANSSReferenceTimeResult, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_UTRAN_GANSSReferenceTimeResult }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_POS_INIT_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_POS_INIT_extension, Ver2_SUPL_POS_INIT_extension_sequence); return offset; } static const per_sequence_t SUPLPOSINIT_sequence[] = { { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SETCapabilities }, { &hf_ulp_requestedAssistData, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RequestedAssistData }, { &hf_ulp_locationId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationId }, { &hf_ulp_position , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Position }, { &hf_ulp_suplpos , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SUPLPOS }, { &hf_ulp_ver , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Ver }, { &hf_ulp_ver2_SUPL_POS_INIT_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_POS_INIT_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLPOSINIT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLPOSINIT, SUPLPOSINIT_sequence); return offset; } static const value_string ulp_StatusCode_vals[] = { { 0, "unspecified" }, { 1, "systemFailure" }, { 2, "unexpectedMessage" }, { 3, "protocolError" }, { 4, "dataMissing" }, { 5, "unexpectedDataValue" }, { 6, "posMethodFailure" }, { 7, "posMethodMismatch" }, { 8, "posProtocolMismatch" }, { 9, "targetSETnotReachable" }, { 10, "versionNotSupported" }, { 11, "resourceShortage" }, { 12, "invalidSessionId" }, { 13, "nonProxyModeNotSupported" }, { 14, "proxyModeNotSupported" }, { 15, "positioningNotPermitted" }, { 16, "authNetFailure" }, { 17, "authSuplinitFailure" }, { 100, "consentDeniedByUser" }, { 101, "consentGrantedByUser" }, { 18, "ver2-incompatibleProtectionLevel" }, { 19, "ver2-serviceNotSupported" }, { 20, "ver2-insufficientInterval" }, { 21, "ver2-noSUPLCoverage" }, { 102, "ver2-sessionStopped" }, { 103, "ver2-appIdDenied" }, { 0, NULL } }; static uint32_t StatusCode_value_map[20+6] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 100, 101, 18, 19, 20, 21, 102, 103}; static int dissect_ulp_StatusCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 20, NULL, TRUE, 6, StatusCode_value_map); return offset; } static int dissect_ulp_INTEGER_M2147483648_2147483647(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, G_MININT32, 2147483647U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_179(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 179U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_64000_1280000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 64000U, 1280000U, NULL, FALSE); return offset; } static const per_sequence_t HighAccuracyAltitudeInfo_sequence[] = { { &hf_ulp_altitude_02 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_64000_1280000 }, { &hf_ulp_uncertaintyAltitude, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_verticalConfidence, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_100 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_HighAccuracyAltitudeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_HighAccuracyAltitudeInfo, HighAccuracyAltitudeInfo_sequence); return offset; } static const per_sequence_t HighAccuracyPositionEstimate_sequence[] = { { &hf_ulp_degreesLatitude , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M2147483648_2147483647 }, { &hf_ulp_degreesLongitude, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M2147483648_2147483647 }, { &hf_ulp_uncertaintySemiMajor_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_uncertaintySemiMinor_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_255 }, { &hf_ulp_orientationMajorAxis_01, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_179 }, { &hf_ulp_horizontalConfidence, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_100 }, { &hf_ulp_highAccuracyAltitudeInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_HighAccuracyAltitudeInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_HighAccuracyPositionEstimate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_HighAccuracyPositionEstimate, HighAccuracyPositionEstimate_sequence); return offset; } static const per_sequence_t Ver2_HighAccuracyPosition_sequence[] = { { &hf_ulp_timestamp_01 , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_UTCTime }, { &hf_ulp_highAccuracyPositionEstimate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_HighAccuracyPositionEstimate }, { &hf_ulp_velocity , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Velocity }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_HighAccuracyPosition(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_HighAccuracyPosition, Ver2_HighAccuracyPosition_sequence); return offset; } static const per_sequence_t Ver2_SUPL_END_extension_sequence[] = { { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SETCapabilities }, { &hf_ulp_ver2_HighAccuracyPosition, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_HighAccuracyPosition }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPL_END_extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPL_END_extension, Ver2_SUPL_END_extension_sequence); return offset; } static const per_sequence_t SUPLEND_sequence[] = { { &hf_ulp_position , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Position }, { &hf_ulp_statusCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_StatusCode }, { &hf_ulp_ver , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Ver }, { &hf_ulp_ver2_SUPL_END_extension, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL , dissect_ulp_Ver2_SUPL_END_extension }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLEND(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLEND, SUPLEND_sequence); return offset; } static const per_sequence_t SUPLAUTHREQ_sequence[] = { { &hf_ulp_ver , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Ver }, { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SETCapabilities }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLAUTHREQ(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLAUTHREQ, SUPLAUTHREQ_sequence); return offset; } static const per_sequence_t SUPLAUTHRESP_sequence[] = { { &hf_ulp_sPCSETKey , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SPCSETKey }, { &hf_ulp_spctid , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SPCTID }, { &hf_ulp_sPCSETKeylifetime, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCSETKeylifetime }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SUPLAUTHRESP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SUPLAUTHRESP, SUPLAUTHRESP_sequence); return offset; } static int dissect_ulp_INTEGER_1_8639999(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 8639999U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_0_2678400(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 2678400U, NULL, FALSE); return offset; } static const per_sequence_t PeriodicParams_sequence[] = { { &hf_ulp_numberOfFixes , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_8639999 }, { &hf_ulp_intervalBetweenFixes, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_8639999 }, { &hf_ulp_startTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_2678400 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PeriodicParams(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PeriodicParams, PeriodicParams_sequence); return offset; } static const value_string ulp_AreaEventType_vals[] = { { 0, "enteringArea" }, { 1, "insideArea" }, { 2, "outsideArea" }, { 3, "leavingArea" }, { 0, NULL } }; static int dissect_ulp_AreaEventType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 4, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_INTEGER_1_604800(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 604800U, NULL, FALSE); return offset; } static const per_sequence_t RepeatedReportingParams_sequence[] = { { &hf_ulp_minimumIntervalTime, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_604800 }, { &hf_ulp_maximumNumberOfReports, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_1024 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_RepeatedReportingParams(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_RepeatedReportingParams, RepeatedReportingParams_sequence); return offset; } static int dissect_ulp_INTEGER_0_11318399(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 11318399U, NULL, FALSE); return offset; } static const value_string ulp_T_latitudeSign_01_vals[] = { { 0, "north" }, { 1, "south" }, { 0, NULL } }; static int dissect_ulp_T_latitudeSign_01(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, FALSE, 0, NULL); return offset; } static const per_sequence_t Coordinate_sequence[] = { { &hf_ulp_latitudeSign_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_T_latitudeSign_01 }, { &hf_ulp_coordinateLatitude, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_8388607 }, { &hf_ulp_coordinateLongitude, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_M8388608_8388607 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Coordinate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Coordinate, Coordinate_sequence); return offset; } static int dissect_ulp_INTEGER_1_1000000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 1000000U, NULL, FALSE); return offset; } static int dissect_ulp_INTEGER_1_1500000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 1500000U, NULL, FALSE); return offset; } static const per_sequence_t CircularArea_sequence[] = { { &hf_ulp_coordinate , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_Coordinate }, { &hf_ulp_radius , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_radius_min , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_radius_max , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1500000 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CircularArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CircularArea, CircularArea_sequence); return offset; } static const per_sequence_t EllipticalArea_sequence[] = { { &hf_ulp_coordinate , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_Coordinate }, { &hf_ulp_semiMajor , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_semiMajor_min , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_semiMajor_max , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1500000 }, { &hf_ulp_semiMinor , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_semiMinor_min , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1000000 }, { &hf_ulp_semiMinor_max , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_1500000 }, { &hf_ulp_angle , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_179 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_EllipticalArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_EllipticalArea, EllipticalArea_sequence); return offset; } static const per_sequence_t PolygonDescription_sequence_of[1] = { { &hf_ulp_PolygonDescription_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_Coordinate }, }; static int dissect_ulp_PolygonDescription(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_PolygonDescription, PolygonDescription_sequence_of, 3, 15, FALSE); return offset; } static int dissect_ulp_INTEGER_1_100000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 100000U, NULL, FALSE); return offset; } static const per_sequence_t PolygonArea_sequence[] = { { &hf_ulp_polygonDescription, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_PolygonDescription }, { &hf_ulp_polygonHysteresis, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_INTEGER_1_100000 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PolygonArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PolygonArea, PolygonArea_sequence); return offset; } static const value_string ulp_GeographicTargetArea_vals[] = { { 0, "circularArea" }, { 1, "ellipticalArea" }, { 2, "polygonArea" }, { 0, NULL } }; static const per_choice_t GeographicTargetArea_choice[] = { { 0, &hf_ulp_circularArea , ASN1_EXTENSION_ROOT , dissect_ulp_CircularArea }, { 1, &hf_ulp_ellipticalArea , ASN1_EXTENSION_ROOT , dissect_ulp_EllipticalArea }, { 2, &hf_ulp_polygonArea , ASN1_EXTENSION_ROOT , dissect_ulp_PolygonArea }, { 0, NULL, 0, NULL } }; static int dissect_ulp_GeographicTargetArea(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_GeographicTargetArea, GeographicTargetArea_choice, NULL); return offset; } static const per_sequence_t GeographicTargetAreaList_sequence_of[1] = { { &hf_ulp_GeographicTargetAreaList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_GeographicTargetArea }, }; static int dissect_ulp_GeographicTargetAreaList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_GeographicTargetAreaList, GeographicTargetAreaList_sequence_of, 1, maxNumGeoArea, FALSE); return offset; } static const per_sequence_t GSMAreaId_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refLAC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refCI , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GSMAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GSMAreaId, GSMAreaId_sequence); return offset; } static const per_sequence_t WCDMAAreaId_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refLAC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refUC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_268435455 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WCDMAAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WCDMAAreaId, WCDMAAreaId_sequence); return offset; } static const per_sequence_t CDMAAreaId_sequence[] = { { &hf_ulp_refSID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_refNID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_32767 }, { &hf_ulp_refBASEID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_65535 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_CDMAAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_CDMAAreaId, CDMAAreaId_sequence); return offset; } static const per_sequence_t HRPDAreaId_sequence[] = { { &hf_ulp_refSECTORID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_128 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_HRPDAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_HRPDAreaId, HRPDAreaId_sequence); return offset; } static const per_sequence_t UMBAreaId_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refSECTORID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_128 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_UMBAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_UMBAreaId, UMBAreaId_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_29(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 29, 29, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t LTEAreaId_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refCI_01 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_29 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_LTEAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_LTEAreaId, LTEAreaId_sequence); return offset; } static int dissect_ulp_T_apMACAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { tvbuff_t *val_tvb; offset = dissect_per_bit_string(tvb, offset, actx, tree, -1, 48, 48, FALSE, NULL, 0, &val_tvb, NULL); if (val_tvb) { proto_tree_add_item(tree, hf_index, val_tvb, 0, 6, ENC_NA); } return offset; } static const per_sequence_t WLANAreaId_sequence[] = { { &hf_ulp_apMACAddress , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_T_apMACAddress }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WLANAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WLANAreaId, WLANAreaId_sequence); return offset; } static const per_sequence_t WimaxAreaId_sequence[] = { { &hf_ulp_bsID_MSB , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_24 }, { &hf_ulp_bsID_LSB , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_BIT_STRING_SIZE_24 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_WimaxAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_WimaxAreaId, WimaxAreaId_sequence); return offset; } static int dissect_ulp_BIT_STRING_SIZE_36(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, 36, 36, FALSE, NULL, 0, NULL, NULL); return offset; } static const per_sequence_t NRAreaId_sequence[] = { { &hf_ulp_refMCC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refMNC , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_999 }, { &hf_ulp_refCI_02 , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BIT_STRING_SIZE_36 }, { NULL, 0, 0, NULL } }; static int dissect_ulp_NRAreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_NRAreaId, NRAreaId_sequence); return offset; } static const value_string ulp_AreaId_vals[] = { { 0, "gSMAreaId" }, { 1, "wCDMAAreaId" }, { 2, "cDMAAreaId" }, { 3, "hRPDAreaId" }, { 4, "uMBAreaId" }, { 5, "lTEAreaId" }, { 6, "wLANAreaId" }, { 7, "wiMAXAreaId" }, { 8, "nRAreaId" }, { 0, NULL } }; static const per_choice_t AreaId_choice[] = { { 0, &hf_ulp_gSMAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_GSMAreaId }, { 1, &hf_ulp_wCDMAAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_WCDMAAreaId }, { 2, &hf_ulp_cDMAAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_CDMAAreaId }, { 3, &hf_ulp_hRPDAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_HRPDAreaId }, { 4, &hf_ulp_uMBAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_UMBAreaId }, { 5, &hf_ulp_lTEAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_LTEAreaId }, { 6, &hf_ulp_wLANAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_WLANAreaId }, { 7, &hf_ulp_wiMAXAreaId , ASN1_EXTENSION_ROOT , dissect_ulp_WimaxAreaId }, { 8, &hf_ulp_nRAreaId , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_NRAreaId }, { 0, NULL, 0, NULL } }; static int dissect_ulp_AreaId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_AreaId, AreaId_choice, NULL); return offset; } static const per_sequence_t AreaIdSet_sequence_of[1] = { { &hf_ulp_AreaIdSet_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_AreaId }, }; static int dissect_ulp_AreaIdSet(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_AreaIdSet, AreaIdSet_sequence_of, 1, maxAreaId, FALSE); return offset; } static const value_string ulp_AreaIdSetType_vals[] = { { 0, "border" }, { 1, "within" }, { 0, NULL } }; static int dissect_ulp_AreaIdSetType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static int dissect_ulp_GeoAreaIndex(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, maxNumGeoArea, NULL, FALSE); return offset; } static const per_sequence_t GeoAreaMappingList_sequence_of[1] = { { &hf_ulp_GeoAreaMappingList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_GeoAreaIndex }, }; static int dissect_ulp_GeoAreaMappingList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_GeoAreaMappingList, GeoAreaMappingList_sequence_of, 1, maxNumGeoArea, FALSE); return offset; } static const per_sequence_t AreaIdList_sequence[] = { { &hf_ulp_areaIdSet , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_AreaIdSet }, { &hf_ulp_areaIdSetType , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_AreaIdSetType }, { &hf_ulp_geoAreaMappingList, ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_ulp_GeoAreaMappingList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_AreaIdList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_AreaIdList, AreaIdList_sequence); return offset; } static const per_sequence_t SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList_sequence_of[1] = { { &hf_ulp_areaIdLists_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_AreaIdList }, }; static int dissect_ulp_SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList, SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList_sequence_of, 1, maxAreaIdList, FALSE); return offset; } static const per_sequence_t AreaEventParams_sequence[] = { { &hf_ulp_areaEventType , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_AreaEventType }, { &hf_ulp_locationEstimate, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_repeatedReportingParams, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_RepeatedReportingParams }, { &hf_ulp_startTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_2678400 }, { &hf_ulp_stopTime , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_INTEGER_0_11318399 }, { &hf_ulp_geographicTargetAreaList, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GeographicTargetAreaList }, { &hf_ulp_areaIdLists , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList }, { NULL, 0, 0, NULL } }; static int dissect_ulp_AreaEventParams(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_AreaEventParams, AreaEventParams_sequence); return offset; } static const value_string ulp_TriggerParams_vals[] = { { 0, "periodicParams" }, { 1, "areaEventParams" }, { 0, NULL } }; static const per_choice_t TriggerParams_choice[] = { { 0, &hf_ulp_periodicParams , ASN1_EXTENSION_ROOT , dissect_ulp_PeriodicParams }, { 1, &hf_ulp_areaEventParams , ASN1_EXTENSION_ROOT , dissect_ulp_AreaEventParams }, { 0, NULL, 0, NULL } }; static int dissect_ulp_TriggerParams(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_TriggerParams, TriggerParams_choice, NULL); return offset; } static const value_string ulp_CauseCode_vals[] = { { 0, "servingNetWorkNotInAreaIdList" }, { 1, "sETCapabilitiesChanged" }, { 2, "noSUPLCoverage" }, { 0, NULL } }; static int dissect_ulp_CauseCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Ver2_SUPLTRIGGEREDSTART_sequence[] = { { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SETCapabilities }, { &hf_ulp_locationId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_LocationId }, { &hf_ulp_ver , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Ver }, { &hf_ulp_qoP , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_QoP }, { &hf_ulp_multipleLocationIds, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MultipleLocationIds }, { &hf_ulp_thirdParty , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ThirdParty }, { &hf_ulp_applicationID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ApplicationID }, { &hf_ulp_triggerType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TriggerType }, { &hf_ulp_triggerParams , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TriggerParams }, { &hf_ulp_position , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Position }, { &hf_ulp_reportingCap , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportingCap }, { &hf_ulp_causeCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_CauseCode }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLTRIGGEREDSTART(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLTRIGGEREDSTART, Ver2_SUPLTRIGGEREDSTART_sequence); return offset; } static const value_string ulp_RepModee_vals[] = { { 1, "realtime" }, { 2, "quasirealtime" }, { 3, "batch" }, { 0, NULL } }; static uint32_t RepModee_value_map[3+0] = {1, 2, 3}; static int dissect_ulp_RepModee(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 3, NULL, TRUE, 0, RepModee_value_map); return offset; } static int dissect_ulp_INTEGER_1_2048(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 2048U, NULL, FALSE); return offset; } static const value_string ulp_BatchRepConditions_vals[] = { { 0, "num-interval" }, { 1, "num-minutes" }, { 2, "endofsession" }, { 0, NULL } }; static const per_choice_t BatchRepConditions_choice[] = { { 0, &hf_ulp_num_interval , ASN1_EXTENSION_ROOT , dissect_ulp_INTEGER_1_1024 }, { 1, &hf_ulp_num_minutes , ASN1_EXTENSION_ROOT , dissect_ulp_INTEGER_1_2048 }, { 2, &hf_ulp_endofsession , ASN1_EXTENSION_ROOT , dissect_ulp_NULL }, { 0, NULL, 0, NULL } }; static int dissect_ulp_BatchRepConditions(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_BatchRepConditions, BatchRepConditions_choice, NULL); return offset; } static const per_sequence_t BatchRepType_sequence[] = { { &hf_ulp_reportPosition , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_reportMeasurements, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_intermediateReports, ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_BOOLEAN }, { &hf_ulp_discardOldest , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BOOLEAN }, { NULL, 0, 0, NULL } }; static int dissect_ulp_BatchRepType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_BatchRepType, BatchRepType_sequence); return offset; } static const per_sequence_t ReportingMode_sequence[] = { { &hf_ulp_repMode , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_RepModee }, { &hf_ulp_batchRepConditions, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BatchRepConditions }, { &hf_ulp_batchRepType , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_BatchRepType }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReportingMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReportingMode, ReportingMode_sequence); return offset; } static const per_sequence_t Ver2_SUPLTRIGGEREDRESPONSE_sequence[] = { { &hf_ulp_posMethod , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_PosMethod }, { &hf_ulp_triggerParams , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TriggerParams }, { &hf_ulp_sLPAddress , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SLPAddress }, { &hf_ulp_supportedNetworkInformation, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SupportedNetworkInformation }, { &hf_ulp_reportingMode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportingMode }, { &hf_ulp_sPCSETKey , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCSETKey }, { &hf_ulp_spctid , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCTID }, { &hf_ulp_sPCSETKeylifetime, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SPCSETKeylifetime }, { &hf_ulp_gnssPosTechnology, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GNSSPosTechnology }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLTRIGGEREDRESPONSE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLTRIGGEREDRESPONSE, Ver2_SUPLTRIGGEREDRESPONSE_sequence); return offset; } static const per_sequence_t Ver2_SUPLTRIGGEREDSTOP_sequence[] = { { &hf_ulp_statusCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_StatusCode }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLTRIGGEREDSTOP(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLTRIGGEREDSTOP, Ver2_SUPLTRIGGEREDSTOP_sequence); return offset; } static const per_sequence_t Ver2_SUPLNOTIFY_sequence[] = { { &hf_ulp_notification , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_Notification }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLNOTIFY(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLNOTIFY, Ver2_SUPLNOTIFY_sequence); return offset; } static const value_string ulp_NotificationResponse_vals[] = { { 0, "allowed" }, { 1, "notAllowed" }, { 0, NULL } }; static int dissect_ulp_NotificationResponse(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 2, NULL, TRUE, 0, NULL); return offset; } static const per_sequence_t Ver2_SUPLNOTIFYRESPONSE_sequence[] = { { &hf_ulp_notificationResponse, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NotificationResponse }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLNOTIFYRESPONSE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLNOTIFYRESPONSE, Ver2_SUPLNOTIFYRESPONSE_sequence); return offset; } static const per_sequence_t Ver2_SUPLSETINIT_sequence[] = { { &hf_ulp_targetSETID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SETId }, { &hf_ulp_qoP , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_QoP }, { &hf_ulp_applicationID , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ApplicationID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLSETINIT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLSETINIT, Ver2_SUPLSETINIT_sequence); return offset; } static const per_sequence_t SessionInformation_sequence[] = { { &hf_ulp_sessionID , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_SessionID }, { NULL, 0, 0, NULL } }; static int dissect_ulp_SessionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_SessionInformation, SessionInformation_sequence); return offset; } static const per_sequence_t SessionList_sequence_of[1] = { { &hf_ulp_SessionList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SessionInformation }, }; static int dissect_ulp_SessionList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_SessionList, SessionList_sequence_of, 1, maxnumSessions, FALSE); return offset; } static const per_sequence_t GANSSSignalsDescription_sequence[] = { { &hf_ulp_ganssId , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_15 }, { &hf_ulp_gANSSSignals , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSSignals }, { NULL, 0, 0, NULL } }; static int dissect_ulp_GANSSSignalsDescription(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSSignalsDescription, GANSSSignalsDescription_sequence); return offset; } static const per_sequence_t GANSSsignalsInfo_sequence_of[1] = { { &hf_ulp_GANSSsignalsInfo_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_GANSSSignalsDescription }, }; static int dissect_ulp_GANSSsignalsInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_GANSSsignalsInfo, GANSSsignalsInfo_sequence_of, 1, maxGANSS, FALSE); return offset; } static const per_sequence_t PositionData_sequence[] = { { &hf_ulp_position , ASN1_EXTENSION_ROOT , ASN1_NOT_OPTIONAL, dissect_ulp_Position }, { &hf_ulp_posMethod , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PosMethod }, { &hf_ulp_gnssPosTechnology, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GNSSPosTechnology }, { &hf_ulp_ganssSignalsInfo, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_GANSSsignalsInfo }, { NULL, 0, 0, NULL } }; static int dissect_ulp_PositionData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_PositionData, PositionData_sequence); return offset; } static const value_string ulp_ResultCode_vals[] = { { 1, "outofradiocoverage" }, { 2, "noposition" }, { 3, "nomeasurement" }, { 4, "nopositionnomeasurement" }, { 5, "outofmemory" }, { 6, "outofmemoryintermediatereporting" }, { 7, "other" }, { 0, NULL } }; static uint32_t ResultCode_value_map[7+0] = {1, 2, 3, 4, 5, 6, 7}; static int dissect_ulp_ResultCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 7, NULL, TRUE, 0, ResultCode_value_map); return offset; } static int dissect_ulp_INTEGER_0_31536000(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 31536000U, NULL, FALSE); return offset; } static const value_string ulp_TimeStamp_vals[] = { { 0, "absoluteTime" }, { 1, "relativeTime" }, { 0, NULL } }; static const per_choice_t TimeStamp_choice[] = { { 0, &hf_ulp_absoluteTime , ASN1_NO_EXTENSIONS , dissect_ulp_UTCTime }, { 1, &hf_ulp_relativeTime , ASN1_NO_EXTENSIONS , dissect_ulp_INTEGER_0_31536000 }, { 0, NULL, 0, NULL } }; static int dissect_ulp_TimeStamp(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_TimeStamp, TimeStamp_choice, NULL); return offset; } static const per_sequence_t ReportData_sequence[] = { { &hf_ulp_positionData , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_PositionData }, { &hf_ulp_multipleLocationIds, ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_MultipleLocationIds }, { &hf_ulp_resultCode , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ResultCode }, { &hf_ulp_timestamp , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_TimeStamp }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ReportData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_ReportData, ReportData_sequence); return offset; } static const per_sequence_t ReportDataList_sequence_of[1] = { { &hf_ulp_ReportDataList_item, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_ReportData }, }; static int dissect_ulp_ReportDataList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index, ett_ulp_ReportDataList, ReportDataList_sequence_of, 1, 1024, FALSE); return offset; } static const per_sequence_t Ver2_SUPLREPORT_sequence[] = { { &hf_ulp_sessionList , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SessionList }, { &hf_ulp_sETCapabilities , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_SETCapabilities }, { &hf_ulp_reportDataList , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_ReportDataList }, { &hf_ulp_ver , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_Ver }, { &hf_ulp_moreComponents , ASN1_EXTENSION_ROOT , ASN1_OPTIONAL , dissect_ulp_NULL }, { NULL, 0, 0, NULL } }; static int dissect_ulp_Ver2_SUPLREPORT(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_ulp_Ver2_SUPLREPORT, Ver2_SUPLREPORT_sequence); return offset; } static const value_string ulp_UlpMessage_vals[] = { { 0, "msSUPLINIT" }, { 1, "msSUPLSTART" }, { 2, "msSUPLRESPONSE" }, { 3, "msSUPLPOSINIT" }, { 4, "msSUPLPOS" }, { 5, "msSUPLEND" }, { 6, "msSUPLAUTHREQ" }, { 7, "msSUPLAUTHRESP" }, { 8, "msSUPLTRIGGEREDSTART" }, { 9, "msSUPLTRIGGEREDRESPONSE" }, { 10, "msSUPLTRIGGEREDSTOP" }, { 11, "msSUPLNOTIFY" }, { 12, "msSUPLNOTIFYRESPONSE" }, { 13, "msSUPLSETINIT" }, { 14, "msSUPLREPORT" }, { 0, NULL } }; static const per_choice_t UlpMessage_choice[] = { { 0, &hf_ulp_msSUPLINIT , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLINIT }, { 1, &hf_ulp_msSUPLSTART , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLSTART }, { 2, &hf_ulp_msSUPLRESPONSE , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLRESPONSE }, { 3, &hf_ulp_msSUPLPOSINIT , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLPOSINIT }, { 4, &hf_ulp_msSUPLPOS , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLPOS }, { 5, &hf_ulp_msSUPLEND , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLEND }, { 6, &hf_ulp_msSUPLAUTHREQ , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLAUTHREQ }, { 7, &hf_ulp_msSUPLAUTHRESP , ASN1_EXTENSION_ROOT , dissect_ulp_SUPLAUTHRESP }, { 8, &hf_ulp_msSUPLTRIGGEREDSTART, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLTRIGGEREDSTART }, { 9, &hf_ulp_msSUPLTRIGGEREDRESPONSE, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLTRIGGEREDRESPONSE }, { 10, &hf_ulp_msSUPLTRIGGEREDSTOP, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLTRIGGEREDSTOP }, { 11, &hf_ulp_msSUPLNOTIFY , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLNOTIFY }, { 12, &hf_ulp_msSUPLNOTIFYRESPONSE, ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLNOTIFYRESPONSE }, { 13, &hf_ulp_msSUPLSETINIT , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLSETINIT }, { 14, &hf_ulp_msSUPLREPORT , ASN1_NOT_EXTENSION_ROOT, dissect_ulp_Ver2_SUPLREPORT }, { 0, NULL, 0, NULL } }; static int dissect_ulp_UlpMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { guint32 UlpMessage; offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_ulp_UlpMessage, UlpMessage_choice, &UlpMessage); col_prepend_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(UlpMessage,ulp_UlpMessage_vals,"Unknown")); return offset; } static const per_sequence_t ULP_PDU_sequence[] = { { &hf_ulp_length , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_INTEGER_0_65535 }, { &hf_ulp_version , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_Version }, { &hf_ulp_sessionID , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_SessionID }, { &hf_ulp_message , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_ulp_UlpMessage }, { NULL, 0, 0, NULL } }; static int dissect_ulp_ULP_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { proto_item *it; proto_tree *ulp_tree; it = proto_tree_add_item(tree, proto_ulp, tvb, 0, -1, ENC_NA); ulp_tree = proto_item_add_subtree(it, ett_ulp); col_set_str(actx->pinfo->cinfo, COL_PROTOCOL, PSNAME); col_clear(actx->pinfo->cinfo, COL_INFO); offset = dissect_per_sequence(tvb, offset, actx, ulp_tree, hf_index, ett_ulp_ULP_PDU, ULP_PDU_sequence); return offset; } /*--- PDUs ---*/ static int dissect_ULP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, FALSE, pinfo); offset = dissect_ulp_ULP_PDU(tvb, offset, &asn1_ctx, tree, hf_ulp_ULP_PDU_PDU); offset += 7; offset >>= 3; return offset; } static guint get_ulp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* PDU length = Message length */ return tvb_get_ntohs(tvb,offset); } static int dissect_ulp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, ulp_desegment, ULP_HEADER_SIZE, get_ulp_pdu_len, dissect_ULP_PDU_PDU, data); return tvb_captured_length(tvb); } void proto_reg_handoff_ulp(void); /*--- proto_register_ulp -------------------------------------------*/ void proto_register_ulp(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_ulp_ULP_PDU_PDU, { "ULP-PDU", "ulp.ULP_PDU_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_length, { "length", "ulp.length", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_version, { "version", "ulp.version_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sessionID, { "sessionID", "ulp.sessionID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_message, { "message", "ulp.message", FT_UINT32, BASE_DEC, VALS(ulp_UlpMessage_vals), 0, "UlpMessage", HFILL }}, { &hf_ulp_msSUPLINIT, { "msSUPLINIT", "ulp.msSUPLINIT_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLINIT", HFILL }}, { &hf_ulp_msSUPLSTART, { "msSUPLSTART", "ulp.msSUPLSTART_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLSTART", HFILL }}, { &hf_ulp_msSUPLRESPONSE, { "msSUPLRESPONSE", "ulp.msSUPLRESPONSE_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLRESPONSE", HFILL }}, { &hf_ulp_msSUPLPOSINIT, { "msSUPLPOSINIT", "ulp.msSUPLPOSINIT_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLPOSINIT", HFILL }}, { &hf_ulp_msSUPLPOS, { "msSUPLPOS", "ulp.msSUPLPOS_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLPOS", HFILL }}, { &hf_ulp_msSUPLEND, { "msSUPLEND", "ulp.msSUPLEND_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLEND", HFILL }}, { &hf_ulp_msSUPLAUTHREQ, { "msSUPLAUTHREQ", "ulp.msSUPLAUTHREQ_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLAUTHREQ", HFILL }}, { &hf_ulp_msSUPLAUTHRESP, { "msSUPLAUTHRESP", "ulp.msSUPLAUTHRESP_element", FT_NONE, BASE_NONE, NULL, 0, "SUPLAUTHRESP", HFILL }}, { &hf_ulp_msSUPLTRIGGEREDSTART, { "msSUPLTRIGGEREDSTART", "ulp.msSUPLTRIGGEREDSTART_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLTRIGGEREDSTART", HFILL }}, { &hf_ulp_msSUPLTRIGGEREDRESPONSE, { "msSUPLTRIGGEREDRESPONSE", "ulp.msSUPLTRIGGEREDRESPONSE_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLTRIGGEREDRESPONSE", HFILL }}, { &hf_ulp_msSUPLTRIGGEREDSTOP, { "msSUPLTRIGGEREDSTOP", "ulp.msSUPLTRIGGEREDSTOP_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLTRIGGEREDSTOP", HFILL }}, { &hf_ulp_msSUPLNOTIFY, { "msSUPLNOTIFY", "ulp.msSUPLNOTIFY_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLNOTIFY", HFILL }}, { &hf_ulp_msSUPLNOTIFYRESPONSE, { "msSUPLNOTIFYRESPONSE", "ulp.msSUPLNOTIFYRESPONSE_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLNOTIFYRESPONSE", HFILL }}, { &hf_ulp_msSUPLSETINIT, { "msSUPLSETINIT", "ulp.msSUPLSETINIT_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLSETINIT", HFILL }}, { &hf_ulp_msSUPLREPORT, { "msSUPLREPORT", "ulp.msSUPLREPORT_element", FT_NONE, BASE_NONE, NULL, 0, "Ver2_SUPLREPORT", HFILL }}, { &hf_ulp_posMethod, { "posMethod", "ulp.posMethod", FT_UINT32, BASE_DEC, VALS(ulp_PosMethod_vals), 0, NULL, HFILL }}, { &hf_ulp_notification, { "notification", "ulp.notification_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sLPAddress, { "sLPAddress", "ulp.sLPAddress", FT_UINT32, BASE_DEC, VALS(ulp_SLPAddress_vals), 0, NULL, HFILL }}, { &hf_ulp_qoP, { "qoP", "ulp.qoP_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sLPMode, { "sLPMode", "ulp.sLPMode", FT_UINT32, BASE_DEC, VALS(ulp_SLPMode_vals), 0, NULL, HFILL }}, { &hf_ulp_mac, { "mac", "ulp.mac", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_keyIdentity, { "keyIdentity", "ulp.keyIdentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_INIT_extension, { "ver2-SUPL-INIT-extension", "ulp.ver2_SUPL_INIT_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_notificationType, { "notificationType", "ulp.notificationType", FT_UINT32, BASE_DEC, VALS(ulp_NotificationType_vals), 0, NULL, HFILL }}, { &hf_ulp_encodingType, { "encodingType", "ulp.encodingType", FT_UINT32, BASE_DEC, VALS(ulp_EncodingType_vals), 0, NULL, HFILL }}, { &hf_ulp_requestorId, { "requestorId", "ulp.requestorId", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_requestorIdType, { "requestorIdType", "ulp.requestorIdType", FT_UINT32, BASE_DEC, VALS(ulp_FormatIndicator_vals), 0, "FormatIndicator", HFILL }}, { &hf_ulp_clientName, { "clientName", "ulp.clientName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_clientNameType, { "clientNameType", "ulp.clientNameType", FT_UINT32, BASE_DEC, VALS(ulp_FormatIndicator_vals), 0, "FormatIndicator", HFILL }}, { &hf_ulp_ver2_Notification_extension, { "ver2-Notification-extension", "ulp.ver2_Notification_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sETCapabilities, { "sETCapabilities", "ulp.sETCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_locationId, { "locationId", "ulp.locationId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_START_extension, { "ver2-SUPL-START-extension", "ulp.ver2_SUPL_START_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_posTechnology, { "posTechnology", "ulp.posTechnology_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_prefMethod, { "prefMethod", "ulp.prefMethod", FT_UINT32, BASE_DEC, VALS(ulp_PrefMethod_vals), 0, NULL, HFILL }}, { &hf_ulp_posProtocol, { "posProtocol", "ulp.posProtocol_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_SETCapabilities_extension, { "ver2-SETCapabilities-extension", "ulp.ver2_SETCapabilities_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_agpsSETassisted, { "agpsSETassisted", "ulp.agpsSETassisted", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_agpsSETBased, { "agpsSETBased", "ulp.agpsSETBased", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_autonomousGPS, { "autonomousGPS", "ulp.autonomousGPS", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_aflt, { "aflt", "ulp.aflt", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ecid, { "ecid", "ulp.ecid", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_eotd, { "eotd", "ulp.eotd", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_otdoa, { "otdoa", "ulp.otdoa", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ver2_PosTechnology_extension, { "ver2-PosTechnology-extension", "ulp.ver2_PosTechnology_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_tia801, { "tia801", "ulp.tia801", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_rrlp, { "rrlp", "ulp.rrlp", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_rrc, { "rrc", "ulp.rrc", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ver2_PosProtocol_extension, { "ver2-PosProtocol-extension", "ulp.ver2_PosProtocol_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sETAuthKey, { "sETAuthKey", "ulp.sETAuthKey", FT_UINT32, BASE_DEC, VALS(ulp_SETAuthKey_vals), 0, NULL, HFILL }}, { &hf_ulp_keyIdentity4, { "keyIdentity4", "ulp.keyIdentity4", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_RESPONSE_extension, { "ver2-SUPL-RESPONSE-extension", "ulp.ver2_SUPL_RESPONSE_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_shortKey, { "shortKey", "ulp.shortKey", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_128", HFILL }}, { &hf_ulp_longKey, { "longKey", "ulp.longKey", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_256", HFILL }}, { &hf_ulp_requestedAssistData, { "requestedAssistData", "ulp.requestedAssistData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_position, { "position", "ulp.position_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_suplpos, { "suplpos", "ulp.suplpos_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver, { "ver", "ulp.ver", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_POS_INIT_extension, { "ver2-SUPL-POS-INIT-extension", "ulp.ver2_SUPL_POS_INIT_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_almanacRequested, { "almanacRequested", "ulp.almanacRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_utcModelRequested, { "utcModelRequested", "ulp.utcModelRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ionosphericModelRequested, { "ionosphericModelRequested", "ulp.ionosphericModelRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_dgpsCorrectionsRequested, { "dgpsCorrectionsRequested", "ulp.dgpsCorrectionsRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_referenceLocationRequested, { "referenceLocationRequested", "ulp.referenceLocationRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_referenceTimeRequested, { "referenceTimeRequested", "ulp.referenceTimeRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_acquisitionAssistanceRequested, { "acquisitionAssistanceRequested", "ulp.acquisitionAssistanceRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_realTimeIntegrityRequested, { "realTimeIntegrityRequested", "ulp.realTimeIntegrityRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_navigationModelRequested, { "navigationModelRequested", "ulp.navigationModelRequested", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_navigationModelData, { "navigationModelData", "ulp.navigationModelData_element", FT_NONE, BASE_NONE, NULL, 0, "NavigationModel", HFILL }}, { &hf_ulp_ver2_RequestedAssistData_extension, { "ver2-RequestedAssistData-extension", "ulp.ver2_RequestedAssistData_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_gpsWeek, { "gpsWeek", "ulp.gpsWeek", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_gpsToe, { "gpsToe", "ulp.gpsToe", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_hours, 0, "INTEGER_0_167", HFILL }}, { &hf_ulp_nsat, { "nsat", "ulp.nsat", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_31", HFILL }}, { &hf_ulp_toeLimit, { "toeLimit", "ulp.toeLimit", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_hours, 0, "INTEGER_0_10", HFILL }}, { &hf_ulp_satInfo, { "satInfo", "ulp.satInfo", FT_UINT32, BASE_DEC, NULL, 0, "SatelliteInfo", HFILL }}, { &hf_ulp_SatelliteInfo_item, { "SatelliteInfoElement", "ulp.SatelliteInfoElement_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_satId, { "satId", "ulp.satId", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_iode, { "iode", "ulp.iode", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_posPayLoad, { "posPayLoad", "ulp.posPayLoad", FT_UINT32, BASE_DEC, VALS(ulp_PosPayLoad_vals), 0, NULL, HFILL }}, { &hf_ulp_velocity, { "velocity", "ulp.velocity", FT_UINT32, BASE_DEC, VALS(ulp_Velocity_vals), 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_POS_extension, { "ver2-SUPL-POS-extension", "ulp.ver2_SUPL_POS_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_tia801payload, { "tia801payload", "ulp.tia801payload", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_1_8192", HFILL }}, { &hf_ulp_rrcPayload, { "rrcPayload", "ulp.rrcPayload", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_1_8192", HFILL }}, { &hf_ulp_rrlpPayload, { "rrlpPayload", "ulp.rrlpPayload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_PosPayLoad_extension, { "ver2-PosPayLoad-extension", "ulp.ver2_PosPayLoad_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_statusCode, { "statusCode", "ulp.statusCode", FT_UINT32, BASE_DEC, VALS(ulp_StatusCode_vals), 0, NULL, HFILL }}, { &hf_ulp_ver2_SUPL_END_extension, { "ver2-SUPL-END-extension", "ulp.ver2_SUPL_END_extension_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sPCSETKey, { "sPCSETKey", "ulp.sPCSETKey", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_spctid, { "spctid", "ulp.spctid_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sPCSETKeylifetime, { "sPCSETKeylifetime", "ulp.sPCSETKeylifetime", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_notificationResponse, { "notificationResponse", "ulp.notificationResponse", FT_UINT32, BASE_DEC, VALS(ulp_NotificationResponse_vals), 0, NULL, HFILL }}, { &hf_ulp_targetSETID, { "targetSETID", "ulp.targetSETID", FT_UINT32, BASE_DEC, VALS(ulp_SETId_vals), 0, "SETId", HFILL }}, { &hf_ulp_applicationID, { "applicationID", "ulp.applicationID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_multipleLocationIds, { "multipleLocationIds", "ulp.multipleLocationIds", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_thirdParty, { "thirdParty", "ulp.thirdParty", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_triggerType, { "triggerType", "ulp.triggerType", FT_UINT32, BASE_DEC, VALS(ulp_TriggerType_vals), 0, NULL, HFILL }}, { &hf_ulp_triggerParams, { "triggerParams", "ulp.triggerParams", FT_UINT32, BASE_DEC, VALS(ulp_TriggerParams_vals), 0, NULL, HFILL }}, { &hf_ulp_reportingCap, { "reportingCap", "ulp.reportingCap_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_causeCode, { "causeCode", "ulp.causeCode", FT_UINT32, BASE_DEC, VALS(ulp_CauseCode_vals), 0, NULL, HFILL }}, { &hf_ulp_periodicParams, { "periodicParams", "ulp.periodicParams_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_areaEventParams, { "areaEventParams", "ulp.areaEventParams_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_numberOfFixes, { "numberOfFixes", "ulp.numberOfFixes", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_8639999", HFILL }}, { &hf_ulp_intervalBetweenFixes, { "intervalBetweenFixes", "ulp.intervalBetweenFixes", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_8639999", HFILL }}, { &hf_ulp_startTime, { "startTime", "ulp.startTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_2678400", HFILL }}, { &hf_ulp_areaEventType, { "areaEventType", "ulp.areaEventType", FT_UINT32, BASE_DEC, VALS(ulp_AreaEventType_vals), 0, NULL, HFILL }}, { &hf_ulp_locationEstimate, { "locationEstimate", "ulp.locationEstimate", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_repeatedReportingParams, { "repeatedReportingParams", "ulp.repeatedReportingParams_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_stopTime, { "stopTime", "ulp.stopTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_11318399", HFILL }}, { &hf_ulp_geographicTargetAreaList, { "geographicTargetAreaList", "ulp.geographicTargetAreaList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_areaIdLists, { "areaIdLists", "ulp.areaIdLists", FT_UINT32, BASE_DEC, NULL, 0, "SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList", HFILL }}, { &hf_ulp_areaIdLists_item, { "AreaIdList", "ulp.AreaIdList_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_minimumIntervalTime, { "minimumIntervalTime", "ulp.minimumIntervalTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_604800", HFILL }}, { &hf_ulp_maximumNumberOfReports, { "maximumNumberOfReports", "ulp.maximumNumberOfReports", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1024", HFILL }}, { &hf_ulp_GeographicTargetAreaList_item, { "GeographicTargetArea", "ulp.GeographicTargetArea", FT_UINT32, BASE_DEC, VALS(ulp_GeographicTargetArea_vals), 0, NULL, HFILL }}, { &hf_ulp_circularArea, { "circularArea", "ulp.circularArea_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ellipticalArea, { "ellipticalArea", "ulp.ellipticalArea_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_polygonArea, { "polygonArea", "ulp.polygonArea_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_areaIdSet, { "areaIdSet", "ulp.areaIdSet", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_areaIdSetType, { "areaIdSetType", "ulp.areaIdSetType", FT_UINT32, BASE_DEC, VALS(ulp_AreaIdSetType_vals), 0, NULL, HFILL }}, { &hf_ulp_geoAreaMappingList, { "geoAreaMappingList", "ulp.geoAreaMappingList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_AreaIdSet_item, { "AreaId", "ulp.AreaId", FT_UINT32, BASE_DEC, VALS(ulp_AreaId_vals), 0, NULL, HFILL }}, { &hf_ulp_gSMAreaId, { "gSMAreaId", "ulp.gSMAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_wCDMAAreaId, { "wCDMAAreaId", "ulp.wCDMAAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cDMAAreaId, { "cDMAAreaId", "ulp.cDMAAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_hRPDAreaId, { "hRPDAreaId", "ulp.hRPDAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_uMBAreaId, { "uMBAreaId", "ulp.uMBAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_lTEAreaId, { "lTEAreaId", "ulp.lTEAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_wLANAreaId, { "wLANAreaId", "ulp.wLANAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_wiMAXAreaId, { "wiMAXAreaId", "ulp.wiMAXAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_nRAreaId, { "nRAreaId", "ulp.nRAreaId_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_refMCC, { "refMCC", "ulp.refMCC", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_999", HFILL }}, { &hf_ulp_refMNC, { "refMNC", "ulp.refMNC", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_999", HFILL }}, { &hf_ulp_refLAC, { "refLAC", "ulp.refLAC", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refCI, { "refCI", "ulp.refCI", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refUC, { "refUC", "ulp.refUC", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_268435455", HFILL }}, { &hf_ulp_refSID, { "refSID", "ulp.refSID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refNID, { "refNID", "ulp.refNID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_32767", HFILL }}, { &hf_ulp_refBASEID, { "refBASEID", "ulp.refBASEID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refSECTORID, { "refSECTORID", "ulp.refSECTORID", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_128", HFILL }}, { &hf_ulp_refCI_01, { "refCI", "ulp.refCI", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_29", HFILL }}, { &hf_ulp_apMACAddress, { "apMACAddress", "ulp.apMACAddress", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_bsID_MSB, { "bsID-MSB", "ulp.bsID_MSB", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_24", HFILL }}, { &hf_ulp_bsID_LSB, { "bsID-LSB", "ulp.bsID_LSB", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_24", HFILL }}, { &hf_ulp_refCI_02, { "refCI", "ulp.refCI", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_36", HFILL }}, { &hf_ulp_GeoAreaMappingList_item, { "GeoAreaIndex", "ulp.GeoAreaIndex", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedNetworkInformation, { "supportedNetworkInformation", "ulp.supportedNetworkInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_reportingMode, { "reportingMode", "ulp.reportingMode_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_gnssPosTechnology, { "gnssPosTechnology", "ulp.gnssPosTechnology_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_repMode, { "repMode", "ulp.repMode", FT_UINT32, BASE_DEC, VALS(ulp_RepModee_vals), 0, "RepModee", HFILL }}, { &hf_ulp_batchRepConditions, { "batchRepConditions", "ulp.batchRepConditions", FT_UINT32, BASE_DEC, VALS(ulp_BatchRepConditions_vals), 0, NULL, HFILL }}, { &hf_ulp_batchRepType, { "batchRepType", "ulp.batchRepType_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_num_interval, { "num-interval", "ulp.num_interval", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1024", HFILL }}, { &hf_ulp_num_minutes, { "num-minutes", "ulp.num_minutes", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_2048", HFILL }}, { &hf_ulp_endofsession, { "endofsession", "ulp.endofsession_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_reportPosition, { "reportPosition", "ulp.reportPosition", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_reportMeasurements, { "reportMeasurements", "ulp.reportMeasurements", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_intermediateReports, { "intermediateReports", "ulp.intermediateReports", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_discardOldest, { "discardOldest", "ulp.discardOldest", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_sessionList, { "sessionList", "ulp.sessionList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_reportDataList, { "reportDataList", "ulp.reportDataList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_moreComponents, { "moreComponents", "ulp.moreComponents_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_SessionList_item, { "SessionInformation", "ulp.SessionInformation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ReportDataList_item, { "ReportData", "ulp.ReportData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_positionData, { "positionData", "ulp.positionData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_resultCode, { "resultCode", "ulp.resultCode", FT_UINT32, BASE_DEC, VALS(ulp_ResultCode_vals), 0, NULL, HFILL }}, { &hf_ulp_timestamp, { "timestamp", "ulp.timestamp", FT_UINT32, BASE_DEC, VALS(ulp_TimeStamp_vals), 0, NULL, HFILL }}, { &hf_ulp_ganssSignalsInfo, { "ganssSignalsInfo", "ulp.ganssSignalsInfo", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_GANSSsignalsInfo_item, { "GANSSSignalsDescription", "ulp.GANSSSignalsDescription_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssId, { "ganssId", "ulp.ganssId", FT_UINT32, BASE_DEC, VALS(ulp_ganss_id_vals), 0, "INTEGER_0_15", HFILL }}, { &hf_ulp_gANSSSignals, { "gANSSSignals", "ulp.gANSSSignals", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_absoluteTime, { "absoluteTime", "ulp.absoluteTime", FT_STRING, BASE_NONE, NULL, 0, "UTCTime", HFILL }}, { &hf_ulp_relativeTime, { "relativeTime", "ulp.relativeTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_31536000", HFILL }}, { &hf_ulp_notificationMode, { "notificationMode", "ulp.notificationMode", FT_UINT32, BASE_DEC, VALS(ulp_NotificationMode_vals), 0, NULL, HFILL }}, { &hf_ulp_e_SLPAddress, { "e-SLPAddress", "ulp.e_SLPAddress", FT_UINT32, BASE_DEC, VALS(ulp_SLPAddress_vals), 0, "SLPAddress", HFILL }}, { &hf_ulp_historicReporting, { "historicReporting", "ulp.historicReporting_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_protectionLevel, { "protectionLevel", "ulp.protectionLevel_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_minimumMajorVersion, { "minimumMajorVersion", "ulp.minimumMajorVersion", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_allowedReportingType, { "allowedReportingType", "ulp.allowedReportingType", FT_UINT32, BASE_DEC, VALS(ulp_AllowedReportingType_vals), 0, NULL, HFILL }}, { &hf_ulp_reportingCriteria, { "reportingCriteria", "ulp.reportingCriteria_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_timeWindow, { "timeWindow", "ulp.timeWindow_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_maxNumberofReports, { "maxNumberofReports", "ulp.maxNumberofReports", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_65536", HFILL }}, { &hf_ulp_minTimeInterval, { "minTimeInterval", "ulp.minTimeInterval", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_86400", HFILL }}, { &hf_ulp_startTime_01, { "startTime", "ulp.startTime", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_minutes, 0, "INTEGER_M525600_M1", HFILL }}, { &hf_ulp_stopTime_01, { "stopTime", "ulp.stopTime", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_minutes, 0, "INTEGER_M525599_0", HFILL }}, { &hf_ulp_protlevel, { "protlevel", "ulp.protlevel", FT_UINT32, BASE_DEC, VALS(ulp_ProtLevel_vals), 0, NULL, HFILL }}, { &hf_ulp_basicProtectionParams, { "basicProtectionParams", "ulp.basicProtectionParams_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_keyIdentifier, { "keyIdentifier", "ulp.keyIdentifier", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_8", HFILL }}, { &hf_ulp_basicReplayCounter, { "basicReplayCounter", "ulp.basicReplayCounter", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_basicMAC, { "basicMAC", "ulp.basicMAC", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_32", HFILL }}, { &hf_ulp_initialApproximateposition, { "initialApproximateposition", "ulp.initialApproximateposition_element", FT_NONE, BASE_NONE, NULL, 0, "Position", HFILL }}, { &hf_ulp_utran_GPSReferenceTimeResult, { "utran-GPSReferenceTimeResult", "ulp.utran_GPSReferenceTimeResult_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_utran_GANSSReferenceTimeResult, { "utran-GANSSReferenceTimeResult", "ulp.utran_GANSSReferenceTimeResult_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_utran_GPSReferenceTimeAssistance, { "utran-GPSReferenceTimeAssistance", "ulp.utran_GPSReferenceTimeAssistance_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_utran_GANSSReferenceTimeAssistance, { "utran-GANSSReferenceTimeAssistance", "ulp.utran_GANSSReferenceTimeAssistance_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ver2_HighAccuracyPosition, { "ver2-HighAccuracyPosition", "ulp.ver2_HighAccuracyPosition_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_emergencyCallLocation, { "emergencyCallLocation", "ulp.emergencyCallLocation_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_serviceCapabilities, { "serviceCapabilities", "ulp.serviceCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedBearers, { "supportedBearers", "ulp.supportedBearers_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_servicesSupported, { "servicesSupported", "ulp.servicesSupported_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_reportingCapabilities, { "reportingCapabilities", "ulp.reportingCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, "ReportingCap", HFILL }}, { &hf_ulp_eventTriggerCapabilities, { "eventTriggerCapabilities", "ulp.eventTriggerCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sessionCapabilities, { "sessionCapabilities", "ulp.sessionCapabilities_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_periodicTrigger, { "periodicTrigger", "ulp.periodicTrigger", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_areaEventTrigger, { "areaEventTrigger", "ulp.areaEventTrigger", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_geoAreaShapesSupported, { "geoAreaShapesSupported", "ulp.geoAreaShapesSupported_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_maxNumGeoAreaSupported, { "maxNumGeoAreaSupported", "ulp.maxNumGeoAreaSupported", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_maxNumGeoArea", HFILL }}, { &hf_ulp_maxAreaIdListSupported, { "maxAreaIdListSupported", "ulp.maxAreaIdListSupported", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_maxAreaIdList", HFILL }}, { &hf_ulp_maxAreaIdSupportedPerList, { "maxAreaIdSupportedPerList", "ulp.maxAreaIdSupportedPerList", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_maxAreaId", HFILL }}, { &hf_ulp_ellipticalArea_01, { "ellipticalArea", "ulp.ellipticalArea", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_polygonArea_01, { "polygonArea", "ulp.polygonArea", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_maxNumberTotalSessions, { "maxNumberTotalSessions", "ulp.maxNumberTotalSessions", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_128", HFILL }}, { &hf_ulp_maxNumberPeriodicSessions, { "maxNumberPeriodicSessions", "ulp.maxNumberPeriodicSessions", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_32", HFILL }}, { &hf_ulp_maxNumberTriggeredSessions, { "maxNumberTriggeredSessions", "ulp.maxNumberTriggeredSessions", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_32", HFILL }}, { &hf_ulp_gsm, { "gsm", "ulp.gsm", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_wcdma, { "wcdma", "ulp.wcdma", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_lte, { "lte", "ulp.lte", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_cdma, { "cdma", "ulp.cdma", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_hprd, { "hprd", "ulp.hprd", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_umb, { "umb", "ulp.umb", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_wlan, { "wlan", "ulp.wlan", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_wiMAX, { "wiMAX", "ulp.wiMAX", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_nr, { "nr", "ulp.nr", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_lpp, { "lpp", "ulp.lpp", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_posProtocolVersionRRLP, { "posProtocolVersionRRLP", "ulp.posProtocolVersionRRLP_element", FT_NONE, BASE_NONE, NULL, 0, "PosProtocolVersion3GPP", HFILL }}, { &hf_ulp_posProtocolVersionRRC, { "posProtocolVersionRRC", "ulp.posProtocolVersionRRC_element", FT_NONE, BASE_NONE, NULL, 0, "PosProtocolVersion3GPP", HFILL }}, { &hf_ulp_posProtocolVersionTIA801, { "posProtocolVersionTIA801", "ulp.posProtocolVersionTIA801", FT_UINT32, BASE_DEC, NULL, 0, "PosProtocolVersion3GPP2", HFILL }}, { &hf_ulp_posProtocolVersionLPP, { "posProtocolVersionLPP", "ulp.posProtocolVersionLPP_element", FT_NONE, BASE_NONE, NULL, 0, "PosProtocolVersion3GPP", HFILL }}, { &hf_ulp_lppe, { "lppe", "ulp.lppe", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_posProtocolVersionLPPe, { "posProtocolVersionLPPe", "ulp.posProtocolVersionLPPe_element", FT_NONE, BASE_NONE, NULL, 0, "PosProtocolVersionOMA", HFILL }}, { &hf_ulp_majorVersionField, { "majorVersionField", "ulp.majorVersionField", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_technicalVersionField, { "technicalVersionField", "ulp.technicalVersionField", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_editorialVersionField, { "editorialVersionField", "ulp.editorialVersionField", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_PosProtocolVersion3GPP2_item, { "Supported3GPP2PosProtocolVersion", "ulp.Supported3GPP2PosProtocolVersion_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_revisionNumber, { "revisionNumber", "ulp.revisionNumber", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_6", HFILL }}, { &hf_ulp_pointReleaseNumber, { "pointReleaseNumber", "ulp.pointReleaseNumber", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_internalEditLevel, { "internalEditLevel", "ulp.internalEditLevel", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_minorVersionField, { "minorVersionField", "ulp.minorVersionField", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_gANSSPositionMethods, { "gANSSPositionMethods", "ulp.gANSSPositionMethods", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_additionalPositioningMethods, { "additionalPositioningMethods", "ulp.additionalPositioningMethods", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_GANSSPositionMethods_item, { "GANSSPositionMethod", "ulp.GANSSPositionMethod_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssSBASid, { "ganssSBASid", "ulp.ganssSBASid", FT_UINT8, BASE_DEC, VALS(ulp_ganss_sbas_id_vals), 0, NULL, HFILL }}, { &hf_ulp_gANSSPositioningMethodTypes, { "gANSSPositioningMethodTypes", "ulp.gANSSPositioningMethodTypes_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_rtk, { "rtk", "ulp.rtk_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_osr, { "osr", "ulp.osr", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setAssisted, { "setAssisted", "ulp.setAssisted", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setBased, { "setBased", "ulp.setBased", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_autonomous, { "autonomous", "ulp.autonomous", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_AdditionalPositioningMethods_item, { "AddPosSupport-Element", "ulp.AddPosSupport_Element_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_addPosID, { "addPosID", "ulp.addPosID", FT_UINT32, BASE_DEC, VALS(ulp_T_addPosID_vals), 0, NULL, HFILL }}, { &hf_ulp_addPosMode, { "addPosMode", "ulp.addPosMode", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssRequestedCommonAssistanceDataList, { "ganssRequestedCommonAssistanceDataList", "ulp.ganssRequestedCommonAssistanceDataList_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssRequestedGenericAssistanceDataList, { "ganssRequestedGenericAssistanceDataList", "ulp.ganssRequestedGenericAssistanceDataList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_extendedEphemeris, { "extendedEphemeris", "ulp.extendedEphemeris_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_extendedEphemerisCheck, { "extendedEphemerisCheck", "ulp.extendedEphemerisCheck_element", FT_NONE, BASE_NONE, NULL, 0, "ExtendedEphCheck", HFILL }}, { &hf_ulp_ganssReferenceTime, { "ganssReferenceTime", "ulp.ganssReferenceTime", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssIonosphericModel, { "ganssIonosphericModel", "ulp.ganssIonosphericModel", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssAdditionalIonosphericModelForDataID00, { "ganssAdditionalIonosphericModelForDataID00", "ulp.ganssAdditionalIonosphericModelForDataID00", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssAdditionalIonosphericModelForDataID11, { "ganssAdditionalIonosphericModelForDataID11", "ulp.ganssAdditionalIonosphericModelForDataID11", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssEarthOrientationParameters, { "ganssEarthOrientationParameters", "ulp.ganssEarthOrientationParameters", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssAdditionalIonosphericModelForDataID01, { "ganssAdditionalIonosphericModelForDataID01", "ulp.ganssAdditionalIonosphericModelForDataID01", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_GanssRequestedGenericAssistanceDataList_item, { "GanssReqGenericData", "ulp.GanssReqGenericData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssId_01, { "ganssId", "ulp.ganssId", FT_UINT32, BASE_DEC, VALS(ulp_ganss_id_vals), 0, NULL, HFILL }}, { &hf_ulp_ganssSBASid_01, { "ganssSBASid", "ulp.ganssSBASid", FT_UINT8, BASE_DEC, VALS(ulp_ganss_sbas_id_vals), 0, "T_ganssSBASid_01", HFILL }}, { &hf_ulp_ganssRealTimeIntegrity, { "ganssRealTimeIntegrity", "ulp.ganssRealTimeIntegrity", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssDifferentialCorrection, { "ganssDifferentialCorrection", "ulp.ganssDifferentialCorrection", FT_BYTES, BASE_NONE, NULL, 0, "DGANSS_Sig_Id_Req", HFILL }}, { &hf_ulp_ganssAlmanac, { "ganssAlmanac", "ulp.ganssAlmanac", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssNavigationModelData, { "ganssNavigationModelData", "ulp.ganssNavigationModelData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssTimeModels, { "ganssTimeModels", "ulp.ganssTimeModels", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssReferenceMeasurementInfo, { "ganssReferenceMeasurementInfo", "ulp.ganssReferenceMeasurementInfo", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssDataBits, { "ganssDataBits", "ulp.ganssDataBits_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssUTCModel, { "ganssUTCModel", "ulp.ganssUTCModel", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssAdditionalDataChoices, { "ganssAdditionalDataChoices", "ulp.ganssAdditionalDataChoices_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssAuxiliaryInformation, { "ganssAuxiliaryInformation", "ulp.ganssAuxiliaryInformation", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssExtendedEphemeris, { "ganssExtendedEphemeris", "ulp.ganssExtendedEphemeris_element", FT_NONE, BASE_NONE, NULL, 0, "ExtendedEphemeris", HFILL }}, { &hf_ulp_ganssExtendedEphemerisCheck, { "ganssExtendedEphemerisCheck", "ulp.ganssExtendedEphemerisCheck_element", FT_NONE, BASE_NONE, NULL, 0, "GanssExtendedEphCheck", HFILL }}, { &hf_ulp_bds_DifferentialCorrection, { "bds-DifferentialCorrection", "ulp.bds_DifferentialCorrection", FT_BYTES, BASE_NONE, NULL, 0, "BDS_Sig_Id_Req", HFILL }}, { &hf_ulp_bds_GridModelReq, { "bds-GridModelReq", "ulp.bds_GridModelReq", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ganssWeek, { "ganssWeek", "ulp.ganssWeek", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssToe, { "ganssToe", "ulp.ganssToe", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_t_toeLimit, { "t-toeLimit", "ulp.t_toeLimit", FT_UINT32, BASE_DEC, NULL, 0, "T_t_toeLimit", HFILL }}, { &hf_ulp_satellitesListRelatedDataList, { "satellitesListRelatedDataList", "ulp.satellitesListRelatedDataList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_SatellitesListRelatedDataList_item, { "SatellitesListRelatedData", "ulp.SatellitesListRelatedData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_iod, { "iod", "ulp.iod", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_ganssTODmin, { "ganssTODmin", "ulp.ganssTODmin", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_59", HFILL }}, { &hf_ulp_reqDataBitAssistanceList, { "reqDataBitAssistanceList", "ulp.reqDataBitAssistanceList_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_gnssSignals, { "gnssSignals", "ulp.gnssSignals", FT_BYTES, BASE_NONE, NULL, 0, "GANSSSignals", HFILL }}, { &hf_ulp_ganssDataBitInterval, { "ganssDataBitInterval", "ulp.ganssDataBitInterval", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_ganssDataBitInterval_fmt), 0, "INTEGER_0_15", HFILL }}, { &hf_ulp_ganssDataBitSatList, { "ganssDataBitSatList", "ulp.ganssDataBitSatList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssDataBitSatList_item, { "ganssDataBitSatList item", "ulp.ganssDataBitSatList_item", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_orbitModelID, { "orbitModelID", "ulp.orbitModelID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_7", HFILL }}, { &hf_ulp_clockModelID, { "clockModelID", "ulp.clockModelID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_7", HFILL }}, { &hf_ulp_utcModelID, { "utcModelID", "ulp.utcModelID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_7", HFILL }}, { &hf_ulp_almanacModelID, { "almanacModelID", "ulp.almanacModelID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_7", HFILL }}, { &hf_ulp_validity, { "validity", "ulp.validity", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_ExtendedEphemeris_validity_fmt), 0, "INTEGER_1_256", HFILL }}, { &hf_ulp_beginTime, { "beginTime", "ulp.beginTime_element", FT_NONE, BASE_NONE, NULL, 0, "GPSTime", HFILL }}, { &hf_ulp_endTime, { "endTime", "ulp.endTime_element", FT_NONE, BASE_NONE, NULL, 0, "GPSTime", HFILL }}, { &hf_ulp_beginTime_01, { "beginTime", "ulp.beginTime_element", FT_NONE, BASE_NONE, NULL, 0, "GANSSextEphTime", HFILL }}, { &hf_ulp_endTime_01, { "endTime", "ulp.endTime_element", FT_NONE, BASE_NONE, NULL, 0, "GANSSextEphTime", HFILL }}, { &hf_ulp_gPSWeek, { "gPSWeek", "ulp.gPSWeek", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_gPSTOWhour, { "gPSTOWhour", "ulp.gPSTOWhour", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_167", HFILL }}, { &hf_ulp_gANSSday, { "gANSSday", "ulp.gANSSday", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_8191", HFILL }}, { &hf_ulp_gANSSTODhour, { "gANSSTODhour", "ulp.gANSSTODhour", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_23", HFILL }}, { &hf_ulp_lPPPayload, { "lPPPayload", "ulp.lPPPayload", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_lPPPayload_item, { "lPPPayload item", "ulp.lPPPayload_item", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_tia801Payload, { "tia801Payload", "ulp.tia801Payload", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_tia801Payload_item, { "tia801Payload item", "ulp.tia801Payload_item", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_1_60000", HFILL }}, { &hf_ulp_maj, { "maj", "ulp.maj", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_min, { "min", "ulp.min", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_servind, { "servind", "ulp.servind", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_setSessionID, { "setSessionID", "ulp.setSessionID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_slpSessionID, { "slpSessionID", "ulp.slpSessionID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_sessionId, { "sessionId", "ulp.sessionId", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_setId, { "setId", "ulp.setId", FT_UINT32, BASE_DEC, VALS(ulp_SETId_vals), 0, NULL, HFILL }}, { &hf_ulp_msisdn, { "msisdn", "ulp.msisdn", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_mdn, { "mdn", "ulp.mdn", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_minsi, { "min", "ulp.min", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_34", HFILL }}, { &hf_ulp_imsi, { "imsi", "ulp.imsi", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_nai, { "nai", "ulp.nai", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_1000", HFILL }}, { &hf_ulp_iPAddress, { "iPAddress", "ulp.iPAddress", FT_UINT32, BASE_DEC, VALS(ulp_IPAddress_vals), 0, NULL, HFILL }}, { &hf_ulp_ver2_imei, { "ver2-imei", "ulp.ver2_imei", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_8", HFILL }}, { &hf_ulp_sessionSlpID, { "sessionID", "ulp.sessionID", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_4", HFILL }}, { &hf_ulp_slpId, { "slpId", "ulp.slpId", FT_UINT32, BASE_DEC, VALS(ulp_SLPAddress_vals), 0, "SLPAddress", HFILL }}, { &hf_ulp_ipv4Address, { "ipv4Address", "ulp.ipv4Address", FT_IPv4, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_4", HFILL }}, { &hf_ulp_ipv6Address, { "ipv6Address", "ulp.ipv6Address", FT_IPv6, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_16", HFILL }}, { &hf_ulp_fqdn, { "fqdn", "ulp.fqdn", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellInfo, { "cellInfo", "ulp.cellInfo", FT_UINT32, BASE_DEC, VALS(ulp_CellInfo_vals), 0, NULL, HFILL }}, { &hf_ulp_status, { "status", "ulp.status", FT_UINT32, BASE_DEC, VALS(ulp_Status_vals), 0, NULL, HFILL }}, { &hf_ulp_gsmCell, { "gsmCell", "ulp.gsmCell_element", FT_NONE, BASE_NONE, NULL, 0, "GsmCellInformation", HFILL }}, { &hf_ulp_wcdmaCell, { "wcdmaCell", "ulp.wcdmaCell_element", FT_NONE, BASE_NONE, NULL, 0, "WcdmaCellInformation", HFILL }}, { &hf_ulp_cdmaCell, { "cdmaCell", "ulp.cdmaCell_element", FT_NONE, BASE_NONE, NULL, 0, "CdmaCellInformation", HFILL }}, { &hf_ulp_ver2_CellInfo_extension, { "ver2-CellInfo-extension", "ulp.ver2_CellInfo_extension", FT_UINT32, BASE_DEC, VALS(ulp_Ver2_CellInfo_extension_vals), 0, NULL, HFILL }}, { &hf_ulp_timestamp_01, { "timestamp", "ulp.timestamp", FT_STRING, BASE_NONE, NULL, 0, "UTCTime", HFILL }}, { &hf_ulp_positionEstimate, { "positionEstimate", "ulp.positionEstimate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_latitudeSign, { "latitudeSign", "ulp.latitudeSign", FT_UINT32, BASE_DEC, VALS(ulp_T_latitudeSign_vals), 0, NULL, HFILL }}, { &hf_ulp_latitude, { "latitude", "ulp.latitude", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_PositionEstimate_latitude_fmt), 0, "INTEGER_0_8388607", HFILL }}, { &hf_ulp_longitude, { "longitude", "ulp.longitude", FT_INT32, BASE_CUSTOM, CF_FUNC(ulp_PositionEstimate_longitude_fmt), 0, "INTEGER_M8388608_8388607", HFILL }}, { &hf_ulp_uncertainty, { "uncertainty", "ulp.uncertainty_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_uncertaintySemiMajor, { "uncertaintySemiMajor", "ulp.uncertaintySemiMajor", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_horacc_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_uncertaintySemiMinor, { "uncertaintySemiMinor", "ulp.uncertaintySemiMinor", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_horacc_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_orientationMajorAxis, { "orientationMajorAxis", "ulp.orientationMajorAxis", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, "INTEGER_0_180", HFILL }}, { &hf_ulp_confidence, { "confidence", "ulp.confidence", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, "INTEGER_0_100", HFILL }}, { &hf_ulp_altitudeInfo, { "altitudeInfo", "ulp.altitudeInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_altitudeDirection, { "altitudeDirection", "ulp.altitudeDirection", FT_UINT32, BASE_DEC, VALS(ulp_T_altitudeDirection_vals), 0, NULL, HFILL }}, { &hf_ulp_altitude, { "altitude", "ulp.altitude", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_meters, 0, "INTEGER_0_32767", HFILL }}, { &hf_ulp_altUncertainty, { "altUncertainty", "ulp.altUncertainty", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_veracc_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_refNID_01, { "refNID", "ulp.refNID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refSID_01, { "refSID", "ulp.refSID", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_32767", HFILL }}, { &hf_ulp_refBASELAT, { "refBASELAT", "ulp.refBASELAT", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_4194303", HFILL }}, { &hf_ulp_reBASELONG, { "reBASELONG", "ulp.reBASELONG", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_8388607", HFILL }}, { &hf_ulp_refREFPN, { "refREFPN", "ulp.refREFPN", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_511", HFILL }}, { &hf_ulp_refWeekNumber, { "refWeekNumber", "ulp.refWeekNumber", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_refSeconds, { "refSeconds", "ulp.refSeconds", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_4194303", HFILL }}, { &hf_ulp_nmr, { "nmr", "ulp.nmr", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_ta, { "ta", "ulp.ta", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_frequencyInfo, { "frequencyInfo", "ulp.frequencyInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_primaryScramblingCode, { "primaryScramblingCode", "ulp.primaryScramblingCode", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_511", HFILL }}, { &hf_ulp_measuredResultsList, { "measuredResultsList", "ulp.measuredResultsList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellParametersId, { "cellParametersId", "ulp.cellParametersId", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_timingAdvance, { "timingAdvance", "ulp.timingAdvance_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ta_01, { "ta", "ulp.ta", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_8191", HFILL }}, { &hf_ulp_tAResolution, { "tAResolution", "ulp.tAResolution", FT_UINT32, BASE_DEC, VALS(ulp_TAResolution_vals), 0, NULL, HFILL }}, { &hf_ulp_chipRate, { "chipRate", "ulp.chipRate", FT_UINT32, BASE_DEC, VALS(ulp_ChipRate_vals), 0, NULL, HFILL }}, { &hf_ulp_modeSpecificFrequencyInfo, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_FrequencySpecificInfo_vals), 0, "FrequencySpecificInfo", HFILL }}, { &hf_ulp_fdd_fr, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, "FrequencyInfoFDD", HFILL }}, { &hf_ulp_tdd_fr, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, "FrequencyInfoTDD", HFILL }}, { &hf_ulp_uarfcn_UL, { "uarfcn-UL", "ulp.uarfcn_UL", FT_UINT32, BASE_DEC, NULL, 0, "UARFCN", HFILL }}, { &hf_ulp_uarfcn_DL, { "uarfcn-DL", "ulp.uarfcn_DL", FT_UINT32, BASE_DEC, NULL, 0, "UARFCN", HFILL }}, { &hf_ulp_uarfcn_Nt, { "uarfcn-Nt", "ulp.uarfcn_Nt", FT_UINT32, BASE_DEC, NULL, 0, "UARFCN", HFILL }}, { &hf_ulp_NMR_item, { "NMRelement", "ulp.NMRelement_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_arfcn, { "arfcn", "ulp.arfcn", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_bsic, { "bsic", "ulp.bsic", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_rxLev, { "rxLev", "ulp.rxLev", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_NMRelement_rxLev_fmt), 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_MeasuredResultsList_item, { "MeasuredResults", "ulp.MeasuredResults_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_utra_CarrierRSSI, { "utra-CarrierRSSI", "ulp.utra_CarrierRSSI", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_UTRA_CarrierRSSI_fmt), 0, NULL, HFILL }}, { &hf_ulp_cellMeasuredResultsList, { "cellMeasuredResultsList", "ulp.cellMeasuredResultsList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_CellMeasuredResultsList_item, { "CellMeasuredResults", "ulp.CellMeasuredResults_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellIdentity, { "cellIdentity", "ulp.cellIdentity", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_268435455", HFILL }}, { &hf_ulp_modeSpecificInfo, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_T_modeSpecificInfo_vals), 0, NULL, HFILL }}, { &hf_ulp_fdd, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_primaryCPICH_Info, { "primaryCPICH-Info", "ulp.primaryCPICH_Info_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cpich_Ec_N0, { "cpich-Ec-N0", "ulp.cpich_Ec_N0", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_CPICH_Ec_N0_fmt), 0, NULL, HFILL }}, { &hf_ulp_cpich_RSCP, { "cpich-RSCP", "ulp.cpich_RSCP", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_CPICH_RSCP_fmt), 0, NULL, HFILL }}, { &hf_ulp_pathloss, { "pathloss", "ulp.pathloss", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_tdd, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellParametersID, { "cellParametersID", "ulp.cellParametersID", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_proposedTGSN, { "proposedTGSN", "ulp.proposedTGSN", FT_UINT32, BASE_DEC, NULL, 0, "TGSN", HFILL }}, { &hf_ulp_primaryCCPCH_RSCP, { "primaryCCPCH-RSCP", "ulp.primaryCCPCH_RSCP", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_PrimaryCCPCH_RSCP_fmt), 0, NULL, HFILL }}, { &hf_ulp_timeslotISCP_List, { "timeslotISCP-List", "ulp.timeslotISCP_List", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_TimeslotISCP_List_item, { "TimeslotISCP", "ulp.TimeslotISCP", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_horacc, { "horacc", "ulp.horacc", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_horacc_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_veracc, { "veracc", "ulp.veracc", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_veracc_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_maxLocAge, { "maxLocAge", "ulp.maxLocAge", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_delay, { "delay", "ulp.delay", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_QoP_delay_fmt), 0, "INTEGER_0_7", HFILL }}, { &hf_ulp_ver2_responseTime, { "ver2-responseTime", "ulp.ver2_responseTime", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_128", HFILL }}, { &hf_ulp_horvel, { "horvel", "ulp.horvel_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_horandvervel, { "horandvervel", "ulp.horandvervel_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_horveluncert, { "horveluncert", "ulp.horveluncert_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_horandveruncert, { "horandveruncert", "ulp.horandveruncert_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_bearing, { "bearing", "ulp.bearing", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, NULL, HFILL }}, { &hf_ulp_horspeed, { "horspeed", "ulp.horspeed", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, NULL, HFILL }}, { &hf_ulp_verdirect, { "verdirect", "ulp.verdirect", FT_BOOLEAN, BASE_NONE, TFS(&ulp_vertical_dir_val), 0, NULL, HFILL }}, { &hf_ulp_bearing_01, { "bearing", "ulp.bearing", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, "T_bearing_01", HFILL }}, { &hf_ulp_horspeed_01, { "horspeed", "ulp.horspeed", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, "T_horspeed_01", HFILL }}, { &hf_ulp_verspeed, { "verspeed", "ulp.verspeed", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, NULL, HFILL }}, { &hf_ulp_bearing_02, { "bearing", "ulp.bearing", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, "T_bearing_02", HFILL }}, { &hf_ulp_horspeed_02, { "horspeed", "ulp.horspeed", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, "T_horspeed_02", HFILL }}, { &hf_ulp_uncertspeed, { "uncertspeed", "ulp.uncertspeed", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, NULL, HFILL }}, { &hf_ulp_verdirect_01, { "verdirect", "ulp.verdirect", FT_BOOLEAN, BASE_NONE, TFS(&ulp_vertical_dir_val), 0, "T_verdirect_01", HFILL }}, { &hf_ulp_bearing_03, { "bearing", "ulp.bearing", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, "T_bearing_03", HFILL }}, { &hf_ulp_horspeed_03, { "horspeed", "ulp.horspeed", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, "T_horspeed_03", HFILL }}, { &hf_ulp_verspeed_01, { "verspeed", "ulp.verspeed", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, "T_verspeed_01", HFILL }}, { &hf_ulp_horuncertspeed, { "horuncertspeed", "ulp.horuncertspeed", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, NULL, HFILL }}, { &hf_ulp_veruncertspeed, { "veruncertspeed", "ulp.veruncertspeed", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_kmh, 0, NULL, HFILL }}, { &hf_ulp_MultipleLocationIds_item, { "LocationIdData", "ulp.LocationIdData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_relativetimestamp, { "relativetimestamp", "ulp.relativetimestamp", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_RelativeTime_fmt), 0, "RelativeTime", HFILL }}, { &hf_ulp_servingFlag, { "servingFlag", "ulp.servingFlag", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_supportedWLANInfo, { "supportedWLANInfo", "ulp.supportedWLANInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedWLANApsList, { "supportedWLANApsList", "ulp.supportedWLANApsList_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedWCDMAInfo, { "supportedWCDMAInfo", "ulp.supportedWCDMAInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_hrdp, { "hrdp", "ulp.hrdp", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_wimax, { "wimax", "ulp.wimax", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_historic, { "historic", "ulp.historic", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_nonServing, { "nonServing", "ulp.nonServing", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_uTRANGPSReferenceTime, { "uTRANGPSReferenceTime", "ulp.uTRANGPSReferenceTime", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_uTRANGANSSReferenceTime, { "uTRANGANSSReferenceTime", "ulp.uTRANGANSSReferenceTime", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apTP, { "apTP", "ulp.apTP", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apAG, { "apAG", "ulp.apAG", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apSN, { "apSN", "ulp.apSN", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apDevType, { "apDevType", "ulp.apDevType", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apRSSI, { "apRSSI", "ulp.apRSSI", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apChanFreq, { "apChanFreq", "ulp.apChanFreq", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apRTD, { "apRTD", "ulp.apRTD", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setTP, { "setTP", "ulp.setTP", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setAG, { "setAG", "ulp.setAG", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setSN, { "setSN", "ulp.setSN", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setRSSI, { "setRSSI", "ulp.setRSSI", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apRepLoc, { "apRepLoc", "ulp.apRepLoc", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apRL, { "apRL", "ulp.apRL", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_opClass, { "opClass", "ulp.opClass", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apSSID, { "apSSID", "ulp.apSSID", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apPHYType, { "apPHYType", "ulp.apPHYType", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_setMACAddress, { "setMACAddress", "ulp.setMACAddress", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_supportedWLANApDataList, { "supportedWLANApDataList", "ulp.supportedWLANApDataList", FT_UINT32, BASE_DEC, NULL, 0, "SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData", HFILL }}, { &hf_ulp_supportedWLANApDataList_item, { "SupportedWLANApData", "ulp.SupportedWLANApData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedWLANapsChannel11a, { "supportedWLANapsChannel11a", "ulp.supportedWLANapsChannel11a_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_supportedWLANapsChannel11bg, { "supportedWLANapsChannel11bg", "ulp.supportedWLANapsChannel11bg_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ch34, { "ch34", "ulp.ch34", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch36, { "ch36", "ulp.ch36", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch38, { "ch38", "ulp.ch38", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch40, { "ch40", "ulp.ch40", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch42, { "ch42", "ulp.ch42", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch44, { "ch44", "ulp.ch44", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch46, { "ch46", "ulp.ch46", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch48, { "ch48", "ulp.ch48", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch52, { "ch52", "ulp.ch52", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch56, { "ch56", "ulp.ch56", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch60, { "ch60", "ulp.ch60", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch64, { "ch64", "ulp.ch64", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch149, { "ch149", "ulp.ch149", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch153, { "ch153", "ulp.ch153", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch157, { "ch157", "ulp.ch157", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch161, { "ch161", "ulp.ch161", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch1, { "ch1", "ulp.ch1", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch2, { "ch2", "ulp.ch2", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch3, { "ch3", "ulp.ch3", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch4, { "ch4", "ulp.ch4", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch5, { "ch5", "ulp.ch5", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch6, { "ch6", "ulp.ch6", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch7, { "ch7", "ulp.ch7", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch8, { "ch8", "ulp.ch8", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch9, { "ch9", "ulp.ch9", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch10, { "ch10", "ulp.ch10", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch11, { "ch11", "ulp.ch11", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch12, { "ch12", "ulp.ch12", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch13, { "ch13", "ulp.ch13", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_ch14, { "ch14", "ulp.ch14", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_apMACAddress_01, { "apMACAddress", "ulp.apMACAddress", FT_ETHER, BASE_NONE, NULL, 0, "T_apMACAddress_01", HFILL }}, { &hf_ulp_apDevType_01, { "apDevType", "ulp.apDevType", FT_UINT32, BASE_DEC, VALS(ulp_T_apDevType_vals), 0, NULL, HFILL }}, { &hf_ulp_mrl, { "mrl", "ulp.mrl", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_hrpdCell, { "hrpdCell", "ulp.hrpdCell_element", FT_NONE, BASE_NONE, NULL, 0, "HrpdCellInformation", HFILL }}, { &hf_ulp_umbCell, { "umbCell", "ulp.umbCell_element", FT_NONE, BASE_NONE, NULL, 0, "UmbCellInformation", HFILL }}, { &hf_ulp_lteCell, { "lteCell", "ulp.lteCell_element", FT_NONE, BASE_NONE, NULL, 0, "LteCellInformation", HFILL }}, { &hf_ulp_wlanAP, { "wlanAP", "ulp.wlanAP_element", FT_NONE, BASE_NONE, NULL, 0, "WlanAPInformation", HFILL }}, { &hf_ulp_wimaxBS, { "wimaxBS", "ulp.wimaxBS_element", FT_NONE, BASE_NONE, NULL, 0, "WimaxBSInformation", HFILL }}, { &hf_ulp_nrCell, { "nrCell", "ulp.nrCell_element", FT_NONE, BASE_NONE, NULL, 0, "NRCellInformation", HFILL }}, { &hf_ulp_cellGlobalIdEUTRA, { "cellGlobalIdEUTRA", "ulp.cellGlobalIdEUTRA_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_physCellId, { "physCellId", "ulp.physCellId", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_trackingAreaCode, { "trackingAreaCode", "ulp.trackingAreaCode", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_rsrpResult, { "rsrpResult", "ulp.rsrpResult", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_RSRP_Range_fmt), 0, "RSRP_Range", HFILL }}, { &hf_ulp_rsrqResult, { "rsrqResult", "ulp.rsrqResult", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_RSRQ_Range_fmt), 0, "RSRQ_Range", HFILL }}, { &hf_ulp_ta_02, { "ta", "ulp.ta", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1282", HFILL }}, { &hf_ulp_measResultListEUTRA, { "measResultListEUTRA", "ulp.measResultListEUTRA", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_earfcn, { "earfcn", "ulp.earfcn", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_earfcn_ext, { "earfcn-ext", "ulp.earfcn_ext", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_65536_262143", HFILL }}, { &hf_ulp_rsrpResult_ext, { "rsrpResult-ext", "ulp.rsrpResult_ext", FT_INT32, BASE_DEC, NULL, 0, "RSRP_Range_Ext", HFILL }}, { &hf_ulp_rsrqResult_ext, { "rsrqResult-ext", "ulp.rsrqResult_ext", FT_INT32, BASE_DEC, NULL, 0, "RSRQ_Range_Ext", HFILL }}, { &hf_ulp_rs_sinrResult, { "rs-sinrResult", "ulp.rs_sinrResult", FT_UINT32, BASE_DEC, NULL, 0, "RS_SINR_Range", HFILL }}, { &hf_ulp_servingInformation5G, { "servingInformation5G", "ulp.servingInformation5G_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_MeasResultListEUTRA_item, { "MeasResultEUTRA", "ulp.MeasResultEUTRA_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cgi_Info, { "cgi-Info", "ulp.cgi_Info_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellGlobalId, { "cellGlobalId", "ulp.cellGlobalId_element", FT_NONE, BASE_NONE, NULL, 0, "CellGlobalIdEUTRA", HFILL }}, { &hf_ulp_measResult, { "measResult", "ulp.measResult_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_neighbourInformation5G, { "neighbourInformation5G", "ulp.neighbourInformation5G_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_plmn_Identity, { "plmn-Identity", "ulp.plmn_Identity_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellIdentity_01, { "cellIdentity", "ulp.cellIdentity", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_mcc, { "mcc", "ulp.mcc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_mnc, { "mnc", "ulp.mnc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_MCC_item, { "MCC-MNC-Digit", "ulp.MCC_MNC_Digit", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_MNC_item, { "MCC-MNC-Digit", "ulp.MCC_MNC_Digit", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_trackingAreaCode_01, { "trackingAreaCode", "ulp.trackingAreaCode", FT_BYTES, BASE_NONE, NULL, 0, "TrackingAreaCodeNR", HFILL }}, { &hf_ulp_apMACAddress_02, { "apMACAddress", "ulp.apMACAddress", FT_ETHER, BASE_NONE, NULL, 0, "T_apMACAddress_02", HFILL }}, { &hf_ulp_apTransmitPower, { "apTransmitPower", "ulp.apTransmitPower", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_apAntennaGain, { "apAntennaGain", "ulp.apAntennaGain", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbi, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_apSignaltoNoise, { "apSignaltoNoise", "ulp.apSignaltoNoise", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_apDeviceType, { "apDeviceType", "ulp.apDeviceType", FT_UINT32, BASE_DEC, VALS(ulp_T_apDeviceType_vals), 0, NULL, HFILL }}, { &hf_ulp_apSignalStrength, { "apSignalStrength", "ulp.apSignalStrength", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_apChannelFrequency, { "apChannelFrequency", "ulp.apChannelFrequency", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_256", HFILL }}, { &hf_ulp_apRoundTripDelay, { "apRoundTripDelay", "ulp.apRoundTripDelay_element", FT_NONE, BASE_NONE, NULL, 0, "RTD", HFILL }}, { &hf_ulp_setTransmitPower, { "setTransmitPower", "ulp.setTransmitPower", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_setAntennaGain, { "setAntennaGain", "ulp.setAntennaGain", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbi, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_setSignaltoNoise, { "setSignaltoNoise", "ulp.setSignaltoNoise", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_setSignalStrength, { "setSignalStrength", "ulp.setSignalStrength", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0, "INTEGER_M127_128", HFILL }}, { &hf_ulp_apReportedLocation, { "apReportedLocation", "ulp.apReportedLocation_element", FT_NONE, BASE_NONE, NULL, 0, "ReportedLocation", HFILL }}, { &hf_ulp_apRepLocation, { "apRepLocation", "ulp.apRepLocation", FT_UINT32, BASE_DEC, VALS(ulp_RepLocation_vals), 0, "RepLocation", HFILL }}, { &hf_ulp_apSignalStrengthDelta, { "apSignalStrengthDelta", "ulp.apSignalStrengthDelta", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_SignalDelta_fmt), 0, "INTEGER_0_1", HFILL }}, { &hf_ulp_apSignaltoNoiseDelta, { "apSignaltoNoiseDelta", "ulp.apSignaltoNoiseDelta", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_SignalDelta_fmt), 0, "INTEGER_0_1", HFILL }}, { &hf_ulp_setSignalStrengthDelta, { "setSignalStrengthDelta", "ulp.setSignalStrengthDelta", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_SignalDelta_fmt), 0, "INTEGER_0_1", HFILL }}, { &hf_ulp_setSignaltoNoiseDelta, { "setSignaltoNoiseDelta", "ulp.setSignaltoNoiseDelta", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_SignalDelta_fmt), 0, "INTEGER_0_1", HFILL }}, { &hf_ulp_operatingClass, { "operatingClass", "ulp.operatingClass", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_apSSID_01, { "apSSID", "ulp.apSSID", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_apPHYType_01, { "apPHYType", "ulp.apPHYType", FT_UINT32, BASE_DEC, VALS(ulp_T_apPHYType_vals), 0, NULL, HFILL }}, { &hf_ulp_setMACAddress_01, { "setMACAddress", "ulp.setMACAddress", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_rTDValue, { "rTDValue", "ulp.rTDValue", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_16777216", HFILL }}, { &hf_ulp_rTDUnits, { "rTDUnits", "ulp.rTDUnits", FT_UINT32, BASE_DEC, VALS(ulp_RTDUnits_vals), 0, NULL, HFILL }}, { &hf_ulp_rTDAccuracy, { "rTDAccuracy", "ulp.rTDAccuracy", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_locationEncodingDescriptor, { "locationEncodingDescriptor", "ulp.locationEncodingDescriptor", FT_UINT32, BASE_DEC, VALS(ulp_LocationEncodingDescriptor_vals), 0, NULL, HFILL }}, { &hf_ulp_locationData, { "locationData", "ulp.locationData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_locationAccuracy, { "locationAccuracy", "ulp.locationAccuracy", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_locationAccuracy_fmt), 0, "INTEGER_0_4294967295", HFILL }}, { &hf_ulp_locationValue, { "locationValue", "ulp.locationValue", FT_BYTES, BASE_NONE, NULL, 0, "OCTET_STRING_SIZE_1_128", HFILL }}, { &hf_ulp_lciLocData, { "lciLocData", "ulp.lciLocData_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_locationDataLCI, { "locationDataLCI", "ulp.locationDataLCI_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_latitudeResolution, { "latitudeResolution", "ulp.latitudeResolution", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_6", HFILL }}, { &hf_ulp_latitude_01, { "latitude", "ulp.latitude", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_34", HFILL }}, { &hf_ulp_longitudeResolution, { "longitudeResolution", "ulp.longitudeResolution", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_6", HFILL }}, { &hf_ulp_longitude_01, { "longitude", "ulp.longitude", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_34", HFILL }}, { &hf_ulp_altitudeType, { "altitudeType", "ulp.altitudeType", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_4", HFILL }}, { &hf_ulp_altitudeResolution, { "altitudeResolution", "ulp.altitudeResolution", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_6", HFILL }}, { &hf_ulp_altitude_01, { "altitude", "ulp.altitude", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_30", HFILL }}, { &hf_ulp_datum, { "datum", "ulp.datum", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_8", HFILL }}, { &hf_ulp_wimaxBsID, { "wimaxBsID", "ulp.wimaxBsID_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_wimaxRTD, { "wimaxRTD", "ulp.wimaxRTD_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_wimaxNMRList, { "wimaxNMRList", "ulp.wimaxNMRList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_rtd, { "rtd", "ulp.rtd", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxRTD_fmt), 0, "INTEGER_0_65535", HFILL }}, { &hf_ulp_rTDstd, { "rTDstd", "ulp.rTDstd", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxRTD_fmt), 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_WimaxNMRList_item, { "WimaxNMR", "ulp.WimaxNMR_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_relDelay, { "relDelay", "ulp.relDelay", FT_INT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxRTD_fmt), 0, "INTEGER_M32768_32767", HFILL }}, { &hf_ulp_relDelaystd, { "relDelaystd", "ulp.relDelaystd", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxRTD_fmt), 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_rssi, { "rssi", "ulp.rssi", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxNMR_rssi_fmt), 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_rSSIstd, { "rSSIstd", "ulp.rSSIstd", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_bSTxPower, { "bSTxPower", "ulp.bSTxPower", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_WimaxNMR_rssi_fmt), 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_cinr, { "cinr", "ulp.cinr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_cINRstd, { "cINRstd", "ulp.cINRstd", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0, "INTEGER_0_63", HFILL }}, { &hf_ulp_bSLocation, { "bSLocation", "ulp.bSLocation_element", FT_NONE, BASE_NONE, NULL, 0, "ReportedLocation", HFILL }}, { &hf_ulp_servingCellInformation, { "servingCellInformation", "ulp.servingCellInformation", FT_UINT32, BASE_DEC, NULL, 0, "ServingCellInformationNR", HFILL }}, { &hf_ulp_measuredResultsListNR, { "measuredResultsListNR", "ulp.measuredResultsListNR", FT_UINT32, BASE_DEC, NULL, 0, "MeasResultListNR", HFILL }}, { &hf_ulp_ServingCellInformationNR_item, { "ServCellNR", "ulp.ServCellNR_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_physCellId_01, { "physCellId", "ulp.physCellId", FT_UINT32, BASE_DEC, NULL, 0, "PhysCellIdNR", HFILL }}, { &hf_ulp_arfcn_NR, { "arfcn-NR", "ulp.arfcn_NR", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellGlobalId_01, { "cellGlobalId", "ulp.cellGlobalId_element", FT_NONE, BASE_NONE, NULL, 0, "CellGlobalIdNR", HFILL }}, { &hf_ulp_ssb_Measurements, { "ssb-Measurements", "ulp.ssb_Measurements_element", FT_NONE, BASE_NONE, NULL, 0, "NR_Measurements", HFILL }}, { &hf_ulp_csi_rs_Measurements, { "csi-rs-Measurements", "ulp.csi_rs_Measurements_element", FT_NONE, BASE_NONE, NULL, 0, "NR_Measurements", HFILL }}, { &hf_ulp_ta_03, { "ta", "ulp.ta", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_3846", HFILL }}, { &hf_ulp_MeasResultListNR_item, { "MeasResultNR", "ulp.MeasResultNR_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_cellIdentityNR, { "cellIdentityNR", "ulp.cellIdentityNR", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_rsrp_Range, { "rsrp-Range", "ulp.rsrp_Range", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_rsrq_Range, { "rsrq-Range", "ulp.rsrq_Range", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_sinr_Range, { "sinr-Range", "ulp.sinr_Range", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_utran_GPSReferenceTime, { "utran-GPSReferenceTime", "ulp.utran_GPSReferenceTime_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_gpsReferenceTimeUncertainty, { "gpsReferenceTimeUncertainty", "ulp.gpsReferenceTimeUncertainty", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_UTRAN_gpsReferenceTimeUncertainty_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_utranGPSDriftRate, { "utranGPSDriftRate", "ulp.utranGPSDriftRate", FT_UINT32, BASE_DEC, VALS(ulp_UTRANGPSDriftRate_vals), 0, NULL, HFILL }}, { &hf_ulp_utran_GPSTimingOfCell, { "utran-GPSTimingOfCell", "ulp.utran_GPSTimingOfCell_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ms_part, { "ms-part", "ulp.ms_part", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_1023", HFILL }}, { &hf_ulp_ls_part, { "ls-part", "ulp.ls_part", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_4294967295", HFILL }}, { &hf_ulp_modeSpecificInfo_01, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_T_modeSpecificInfo_01_vals), 0, "T_modeSpecificInfo_01", HFILL }}, { &hf_ulp_fdd_01, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_fdd_01", HFILL }}, { &hf_ulp_referenceIdentity, { "referenceIdentity", "ulp.referenceIdentity_element", FT_NONE, BASE_NONE, NULL, 0, "PrimaryCPICH_Info", HFILL }}, { &hf_ulp_tdd_01, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_tdd_01", HFILL }}, { &hf_ulp_referenceIdentity_01, { "referenceIdentity", "ulp.referenceIdentity", FT_UINT32, BASE_DEC, NULL, 0, "CellParametersID", HFILL }}, { &hf_ulp_sfn, { "sfn", "ulp.sfn", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_4095", HFILL }}, { &hf_ulp_set_GPSTimingOfCell, { "set-GPSTimingOfCell", "ulp.set_GPSTimingOfCell_element", FT_NONE, BASE_NONE, NULL, 0, "T_set_GPSTimingOfCell", HFILL }}, { &hf_ulp_ms_part_01, { "ms-part", "ulp.ms_part", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_16383", HFILL }}, { &hf_ulp_modeSpecificInfo_02, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_T_modeSpecificInfo_02_vals), 0, "T_modeSpecificInfo_02", HFILL }}, { &hf_ulp_fdd_02, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_fdd_02", HFILL }}, { &hf_ulp_tdd_02, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_tdd_02", HFILL }}, { &hf_ulp_ganssDay, { "ganssDay", "ulp.ganssDay", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_8191", HFILL }}, { &hf_ulp_ganssTimeID, { "ganssTimeID", "ulp.ganssTimeID", FT_UINT32, BASE_DEC, VALS(ulp_ganss_time_id_vals), 0, "INTEGER_0_15", HFILL }}, { &hf_ulp_utran_GANSSReferenceTime, { "utran-GANSSReferenceTime", "ulp.utran_GANSSReferenceTime_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_utranGANSSDriftRate, { "utranGANSSDriftRate", "ulp.utranGANSSDriftRate", FT_UINT32, BASE_DEC, VALS(ulp_UTRANGANSSDriftRate_vals), 0, NULL, HFILL }}, { &hf_ulp_ganssTOD, { "ganssTOD", "ulp.ganssTOD", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_0_86399", HFILL }}, { &hf_ulp_utran_GANSSTimingOfCell, { "utran-GANSSTimingOfCell", "ulp.utran_GANSSTimingOfCell", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_utran_GANSSTimingOfCell_fmt), 0, "INTEGER_0_3999999", HFILL }}, { &hf_ulp_modeSpecificInfo_03, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_T_modeSpecificInfo_03_vals), 0, "T_modeSpecificInfo_03", HFILL }}, { &hf_ulp_fdd_03, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_fdd_03", HFILL }}, { &hf_ulp_tdd_03, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_tdd_03", HFILL }}, { &hf_ulp_ganss_TODUncertainty, { "ganss-TODUncertainty", "ulp.ganss_TODUncertainty", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_UTRAN_gpsReferenceTimeUncertainty_fmt), 0, "INTEGER_0_127", HFILL }}, { &hf_ulp_set_GANSSReferenceTime, { "set-GANSSReferenceTime", "ulp.set_GANSSReferenceTime_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_set_GANSSTimingOfCell, { "set-GANSSTimingOfCell", "ulp.set_GANSSTimingOfCell_element", FT_NONE, BASE_NONE, NULL, 0, "T_set_GANSSTimingOfCell", HFILL }}, { &hf_ulp_ms_part_02, { "ms-part", "ulp.ms_part", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_80", HFILL }}, { &hf_ulp_modeSpecificInfo_04, { "modeSpecificInfo", "ulp.modeSpecificInfo", FT_UINT32, BASE_DEC, VALS(ulp_T_modeSpecificInfo_04_vals), 0, "T_modeSpecificInfo_04", HFILL }}, { &hf_ulp_fdd_04, { "fdd", "ulp.fdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_fdd_04", HFILL }}, { &hf_ulp_tdd_04, { "tdd", "ulp.tdd_element", FT_NONE, BASE_NONE, NULL, 0, "T_tdd_04", HFILL }}, { &hf_ulp_gps, { "gps", "ulp.gps", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_galileo, { "galileo", "ulp.galileo", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_sbas, { "sbas", "ulp.sbas", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_modernized_gps, { "modernized-gps", "ulp.modernized_gps", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_qzss, { "qzss", "ulp.qzss", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_glonass, { "glonass", "ulp.glonass", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_bds, { "bds", "ulp.bds", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_rtk_osr, { "rtk-osr", "ulp.rtk_osr", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_rand, { "rand", "ulp.rand", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_128", HFILL }}, { &hf_ulp_slpFQDN, { "slpFQDN", "ulp.slpFQDN", FT_STRING, BASE_NONE, NULL, 0, "FQDN", HFILL }}, { &hf_ulp_ThirdParty_item, { "ThirdPartyID", "ulp.ThirdPartyID", FT_UINT32, BASE_DEC, VALS(ulp_ThirdPartyID_vals), 0, NULL, HFILL }}, { &hf_ulp_logicalName, { "logicalName", "ulp.logicalName", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_1000", HFILL }}, { &hf_ulp_msisdn_01, { "msisdn", "ulp.msisdn", FT_BYTES, BASE_NONE, NULL, 0, "T_msisdn_01", HFILL }}, { &hf_ulp_emailaddr, { "emailaddr", "ulp.emailaddr", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_1000", HFILL }}, { &hf_ulp_sip_uri, { "sip-uri", "ulp.sip_uri", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ims_public_identity, { "ims-public-identity", "ulp.ims_public_identity", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_min_01, { "min", "ulp.min", FT_BYTES, BASE_NONE, NULL, 0, "BIT_STRING_SIZE_34", HFILL }}, { &hf_ulp_mdn_01, { "mdn", "ulp.mdn", FT_BYTES, BASE_NONE, NULL, 0, "T_mdn_01", HFILL }}, { &hf_ulp_uri, { "uri", "ulp.uri", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_appProvider, { "appProvider", "ulp.appProvider", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_24", HFILL }}, { &hf_ulp_appName, { "appName", "ulp.appName", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_32", HFILL }}, { &hf_ulp_appVersion, { "appVersion", "ulp.appVersion", FT_STRING, BASE_NONE, NULL, 0, "IA5String_SIZE_1_8", HFILL }}, { &hf_ulp_minInt, { "minInt", "ulp.minInt", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, "INTEGER_1_3600", HFILL }}, { &hf_ulp_maxInt, { "maxInt", "ulp.maxInt", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_minutes, 0, "INTEGER_1_1440", HFILL }}, { &hf_ulp_repMode_01, { "repMode", "ulp.repMode_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_batchRepCap, { "batchRepCap", "ulp.batchRepCap_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_realtime, { "realtime", "ulp.realtime", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_quasirealtime, { "quasirealtime", "ulp.quasirealtime", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_batch, { "batch", "ulp.batch", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_report_position, { "report-position", "ulp.report_position", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_report_measurements, { "report-measurements", "ulp.report_measurements", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, { &hf_ulp_max_num_positions, { "max-num-positions", "ulp.max_num_positions", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1024", HFILL }}, { &hf_ulp_max_num_measurements, { "max-num-measurements", "ulp.max_num_measurements", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1024", HFILL }}, { &hf_ulp_latitudeSign_01, { "latitudeSign", "ulp.latitudeSign", FT_UINT32, BASE_DEC, VALS(ulp_T_latitudeSign_01_vals), 0, "T_latitudeSign_01", HFILL }}, { &hf_ulp_coordinateLatitude, { "latitude", "ulp.latitude", FT_UINT32, BASE_CUSTOM, CF_FUNC(ulp_Coordinate_latitude_fmt), 0, "INTEGER_0_8388607", HFILL }}, { &hf_ulp_coordinateLongitude, { "longitude", "ulp.longitude", FT_INT32, BASE_CUSTOM, CF_FUNC(ulp_Coordinate_longitude_fmt), 0, "INTEGER_M8388608_8388607", HFILL }}, { &hf_ulp_coordinate, { "coordinate", "ulp.coordinate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_radius, { "radius", "ulp.radius", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_meters, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_radius_min, { "radius-min", "ulp.radius_min", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_radius_max, { "radius-max", "ulp.radius_max", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1500000", HFILL }}, { &hf_ulp_semiMajor, { "semiMajor", "ulp.semiMajor", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_meters, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_semiMajor_min, { "semiMajor-min", "ulp.semiMajor_min", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_semiMajor_max, { "semiMajor-max", "ulp.semiMajor_max", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1500000", HFILL }}, { &hf_ulp_semiMinor, { "semiMinor", "ulp.semiMinor", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_meters, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_semiMinor_min, { "semiMinor-min", "ulp.semiMinor_min", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1000000", HFILL }}, { &hf_ulp_semiMinor_max, { "semiMinor-max", "ulp.semiMinor_max", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_1_1500000", HFILL }}, { &hf_ulp_angle, { "angle", "ulp.angle", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_degree_degrees, 0, "INTEGER_0_179", HFILL }}, { &hf_ulp_polygonDescription, { "polygonDescription", "ulp.polygonDescription", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_ulp_polygonHysteresis, { "polygonHysteresis", "ulp.polygonHysteresis", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_meters, 0, "INTEGER_1_100000", HFILL }}, { &hf_ulp_PolygonDescription_item, { "Coordinate", "ulp.Coordinate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_highAccuracyPositionEstimate, { "highAccuracyPositionEstimate", "ulp.highAccuracyPositionEstimate_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_degreesLatitude, { "degreesLatitude", "ulp.degreesLatitude", FT_INT32, BASE_DEC, NULL, 0, "INTEGER_M2147483648_2147483647", HFILL }}, { &hf_ulp_degreesLongitude, { "degreesLongitude", "ulp.degreesLongitude", FT_INT32, BASE_DEC, NULL, 0, "INTEGER_M2147483648_2147483647", HFILL }}, { &hf_ulp_uncertaintySemiMajor_01, { "uncertaintySemiMajor", "ulp.uncertaintySemiMajor", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_uncertaintySemiMinor_01, { "uncertaintySemiMinor", "ulp.uncertaintySemiMinor", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_orientationMajorAxis_01, { "orientationMajorAxis", "ulp.orientationMajorAxis", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_179", HFILL }}, { &hf_ulp_horizontalConfidence, { "horizontalConfidence", "ulp.horizontalConfidence", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_100", HFILL }}, { &hf_ulp_highAccuracyAltitudeInfo, { "highAccuracyAltitudeInfo", "ulp.highAccuracyAltitudeInfo_element", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_altitude_02, { "altitude", "ulp.altitude", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_64000_1280000", HFILL }}, { &hf_ulp_uncertaintyAltitude, { "uncertaintyAltitude", "ulp.uncertaintyAltitude", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_255", HFILL }}, { &hf_ulp_verticalConfidence, { "verticalConfidence", "ulp.verticalConfidence", FT_UINT32, BASE_DEC, NULL, 0, "INTEGER_0_100", HFILL }}, { &hf_ulp_T_addPosMode_standalone, { "standalone", "ulp.T.addPosMode.standalone", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_ulp_T_addPosMode_setBased, { "setBased", "ulp.T.addPosMode.setBased", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_ulp_T_addPosMode_setAssisted, { "setAssisted", "ulp.T.addPosMode.setAssisted", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal1, { "signal1", "ulp.GANSSSignals.signal1", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal2, { "signal2", "ulp.GANSSSignals.signal2", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal3, { "signal3", "ulp.GANSSSignals.signal3", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal4, { "signal4", "ulp.GANSSSignals.signal4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal5, { "signal5", "ulp.GANSSSignals.signal5", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal6, { "signal6", "ulp.GANSSSignals.signal6", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal7, { "signal7", "ulp.GANSSSignals.signal7", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_ulp_GANSSSignals_signal8, { "signal8", "ulp.GANSSSignals.signal8", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_ulp_mobile_directory_number, { "Mobile Directory Number", "ulp.mobile_directory_number", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_bit0, { "GPS", "ulp.ganssTimeModels.gps", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_bit1, { "Galileo", "ulp.ganssTimeModels.galileo", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_bit2, { "QZSS", "ulp.ganssTimeModels.qzss", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_bit3, { "GLONASS", "ulp.ganssTimeModels.glonass", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_bit4, { "BDS", "ulp.ganssTimeModels.bds", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0800, NULL, HFILL }}, { &hf_ulp_ganssTimeModels_spare, { "Spare", "ulp.ganssTimeModels.spare", FT_UINT16, BASE_HEX, NULL, 0x07ff, NULL, HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_ulp, &ett_ulp_setid, &ett_ulp_thirdPartyId, &ett_ulp_ganssTimeModels, &ett_ulp_ULP_PDU, &ett_ulp_UlpMessage, &ett_ulp_SUPLINIT, &ett_ulp_Notification, &ett_ulp_SUPLSTART, &ett_ulp_SETCapabilities, &ett_ulp_PosTechnology, &ett_ulp_PosProtocol, &ett_ulp_SUPLRESPONSE, &ett_ulp_SETAuthKey, &ett_ulp_SUPLPOSINIT, &ett_ulp_RequestedAssistData, &ett_ulp_NavigationModel, &ett_ulp_SatelliteInfo, &ett_ulp_SatelliteInfoElement, &ett_ulp_SUPLPOS, &ett_ulp_PosPayLoad, &ett_ulp_SUPLEND, &ett_ulp_SUPLAUTHREQ, &ett_ulp_SUPLAUTHRESP, &ett_ulp_Ver2_SUPLNOTIFY, &ett_ulp_Ver2_SUPLNOTIFYRESPONSE, &ett_ulp_Ver2_SUPLSETINIT, &ett_ulp_Ver2_SUPLTRIGGEREDSTART, &ett_ulp_TriggerParams, &ett_ulp_PeriodicParams, &ett_ulp_AreaEventParams, &ett_ulp_SEQUENCE_SIZE_1_maxAreaIdList_OF_AreaIdList, &ett_ulp_RepeatedReportingParams, &ett_ulp_GeographicTargetAreaList, &ett_ulp_GeographicTargetArea, &ett_ulp_AreaIdList, &ett_ulp_AreaIdSet, &ett_ulp_AreaId, &ett_ulp_GSMAreaId, &ett_ulp_WCDMAAreaId, &ett_ulp_CDMAAreaId, &ett_ulp_HRPDAreaId, &ett_ulp_UMBAreaId, &ett_ulp_LTEAreaId, &ett_ulp_WLANAreaId, &ett_ulp_WimaxAreaId, &ett_ulp_NRAreaId, &ett_ulp_GeoAreaMappingList, &ett_ulp_Ver2_SUPLTRIGGEREDRESPONSE, &ett_ulp_ReportingMode, &ett_ulp_BatchRepConditions, &ett_ulp_BatchRepType, &ett_ulp_Ver2_SUPLREPORT, &ett_ulp_SessionList, &ett_ulp_SessionInformation, &ett_ulp_ReportDataList, &ett_ulp_ReportData, &ett_ulp_PositionData, &ett_ulp_GANSSsignalsInfo, &ett_ulp_GANSSSignalsDescription, &ett_ulp_TimeStamp, &ett_ulp_Ver2_SUPLTRIGGEREDSTOP, &ett_ulp_Ver2_SUPL_INIT_extension, &ett_ulp_HistoricReporting, &ett_ulp_ReportingCriteria, &ett_ulp_TimeWindow, &ett_ulp_ProtectionLevel, &ett_ulp_BasicProtectionParams, &ett_ulp_Ver2_SUPL_START_extension, &ett_ulp_Ver2_SUPL_RESPONSE_extension, &ett_ulp_Ver2_SUPL_POS_INIT_extension, &ett_ulp_Ver2_SUPL_POS_extension, &ett_ulp_Ver2_SUPL_END_extension, &ett_ulp_Ver2_Notification_extension, &ett_ulp_Ver2_SETCapabilities_extension, &ett_ulp_ServiceCapabilities, &ett_ulp_ServicesSupported, &ett_ulp_EventTriggerCapabilities, &ett_ulp_GeoAreaShapesSupported, &ett_ulp_SessionCapabilities, &ett_ulp_SupportedBearers, &ett_ulp_Ver2_PosProtocol_extension, &ett_ulp_PosProtocolVersion3GPP, &ett_ulp_PosProtocolVersion3GPP2, &ett_ulp_Supported3GPP2PosProtocolVersion, &ett_ulp_PosProtocolVersionOMA, &ett_ulp_Ver2_PosTechnology_extension, &ett_ulp_GANSSPositionMethods, &ett_ulp_GANSSPositionMethod, &ett_ulp_RTK, &ett_ulp_GANSSPositioningMethodTypes, &ett_ulp_AdditionalPositioningMethods, &ett_ulp_AddPosSupport_Element, &ett_ulp_T_addPosMode, &ett_ulp_Ver2_RequestedAssistData_extension, &ett_ulp_GanssRequestedCommonAssistanceDataList, &ett_ulp_GanssRequestedGenericAssistanceDataList, &ett_ulp_GanssReqGenericData, &ett_ulp_GanssNavigationModelData, &ett_ulp_SatellitesListRelatedDataList, &ett_ulp_SatellitesListRelatedData, &ett_ulp_GanssDataBits, &ett_ulp_ReqDataBitAssistanceList, &ett_ulp_T_ganssDataBitSatList, &ett_ulp_GanssAdditionalDataChoices, &ett_ulp_ExtendedEphemeris, &ett_ulp_ExtendedEphCheck, &ett_ulp_GanssExtendedEphCheck, &ett_ulp_GPSTime, &ett_ulp_GANSSextEphTime, &ett_ulp_Ver2_PosPayLoad_extension, &ett_ulp_T_lPPPayload, &ett_ulp_T_tia801Payload, &ett_ulp_Version, &ett_ulp_SessionID, &ett_ulp_SetSessionID, &ett_ulp_SETId, &ett_ulp_SlpSessionID, &ett_ulp_IPAddress, &ett_ulp_SLPAddress, &ett_ulp_LocationId, &ett_ulp_CellInfo, &ett_ulp_Position, &ett_ulp_PositionEstimate, &ett_ulp_T_uncertainty, &ett_ulp_AltitudeInfo, &ett_ulp_CdmaCellInformation, &ett_ulp_GsmCellInformation, &ett_ulp_WcdmaCellInformation, &ett_ulp_TimingAdvance, &ett_ulp_FrequencyInfo, &ett_ulp_FrequencySpecificInfo, &ett_ulp_FrequencyInfoFDD, &ett_ulp_FrequencyInfoTDD, &ett_ulp_NMR, &ett_ulp_NMRelement, &ett_ulp_MeasuredResultsList, &ett_ulp_MeasuredResults, &ett_ulp_CellMeasuredResultsList, &ett_ulp_CellMeasuredResults, &ett_ulp_T_modeSpecificInfo, &ett_ulp_T_fdd, &ett_ulp_T_tdd, &ett_ulp_TimeslotISCP_List, &ett_ulp_PrimaryCPICH_Info, &ett_ulp_QoP, &ett_ulp_Velocity, &ett_ulp_Horvel, &ett_ulp_Horandvervel, &ett_ulp_Horveluncert, &ett_ulp_Horandveruncert, &ett_ulp_MultipleLocationIds, &ett_ulp_LocationIdData, &ett_ulp_SupportedNetworkInformation, &ett_ulp_SupportedWLANInfo, &ett_ulp_SupportedWLANApsList, &ett_ulp_SEQUENCE_SIZE_1_maxWLANApDataSize_OF_SupportedWLANApData, &ett_ulp_SupportedWLANApsChannel11a, &ett_ulp_SupportedWLANApsChannel11bg, &ett_ulp_SupportedWLANApData, &ett_ulp_SupportedWCDMAInfo, &ett_ulp_Ver2_CellInfo_extension, &ett_ulp_HrpdCellInformation, &ett_ulp_UmbCellInformation, &ett_ulp_LteCellInformation, &ett_ulp_MeasResultListEUTRA, &ett_ulp_MeasResultEUTRA, &ett_ulp_T_cgi_Info, &ett_ulp_T_measResult, &ett_ulp_CellGlobalIdEUTRA, &ett_ulp_PLMN_Identity, &ett_ulp_MCC, &ett_ulp_MNC, &ett_ulp_ServingInformation5G, &ett_ulp_NeighbourInformation5G, &ett_ulp_WlanAPInformation, &ett_ulp_RTD, &ett_ulp_ReportedLocation, &ett_ulp_LocationData, &ett_ulp_RepLocation, &ett_ulp_LciLocData, &ett_ulp_LocationDataLCI, &ett_ulp_WimaxBSInformation, &ett_ulp_WimaxBsID, &ett_ulp_WimaxRTD, &ett_ulp_WimaxNMRList, &ett_ulp_WimaxNMR, &ett_ulp_NRCellInformation, &ett_ulp_ServingCellInformationNR, &ett_ulp_ServCellNR, &ett_ulp_MeasResultListNR, &ett_ulp_MeasResultNR, &ett_ulp_CellGlobalIdNR, &ett_ulp_NR_Measurements, &ett_ulp_UTRAN_GPSReferenceTimeAssistance, &ett_ulp_UTRAN_GPSReferenceTime, &ett_ulp_T_utran_GPSTimingOfCell, &ett_ulp_T_modeSpecificInfo_01, &ett_ulp_T_fdd_01, &ett_ulp_T_tdd_01, &ett_ulp_UTRAN_GPSReferenceTimeResult, &ett_ulp_T_set_GPSTimingOfCell, &ett_ulp_T_modeSpecificInfo_02, &ett_ulp_T_fdd_02, &ett_ulp_T_tdd_02, &ett_ulp_UTRAN_GANSSReferenceTimeAssistance, &ett_ulp_UTRAN_GANSSReferenceTime, &ett_ulp_T_modeSpecificInfo_03, &ett_ulp_T_fdd_03, &ett_ulp_T_tdd_03, &ett_ulp_UTRAN_GANSSReferenceTimeResult, &ett_ulp_SET_GANSSReferenceTime, &ett_ulp_T_set_GANSSTimingOfCell, &ett_ulp_T_modeSpecificInfo_04, &ett_ulp_T_fdd_04, &ett_ulp_T_tdd_04, &ett_ulp_GNSSPosTechnology, &ett_ulp_GANSSSignals, &ett_ulp_SPCTID, &ett_ulp_ThirdParty, &ett_ulp_ThirdPartyID, &ett_ulp_ApplicationID, &ett_ulp_ReportingCap, &ett_ulp_RepMode, &ett_ulp_BatchRepCap, &ett_ulp_Coordinate, &ett_ulp_CircularArea, &ett_ulp_EllipticalArea, &ett_ulp_PolygonArea, &ett_ulp_PolygonDescription, &ett_ulp_Ver2_HighAccuracyPosition, &ett_ulp_HighAccuracyPositionEstimate, &ett_ulp_HighAccuracyAltitudeInfo, }; module_t *ulp_module; /* Register protocol */ proto_ulp = proto_register_protocol(PNAME, PSNAME, PFNAME); ulp_tcp_handle = register_dissector("ulp", dissect_ulp_tcp, proto_ulp); ulp_pdu_handle = register_dissector("ulp.pdu", dissect_ULP_PDU_PDU, proto_ulp); /* Register fields and subtrees */ proto_register_field_array(proto_ulp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); ulp_module = prefs_register_protocol(proto_ulp, NULL); prefs_register_bool_preference(ulp_module, "desegment_ulp_messages", "Reassemble ULP messages spanning multiple TCP segments", "Whether the ULP dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &ulp_desegment); } /*--- proto_reg_handoff_ulp ---------------------------------------*/ void proto_reg_handoff_ulp(void) { rrlp_handle = find_dissector_add_dependency("rrlp", proto_ulp); lpp_handle = find_dissector_add_dependency("lpp", proto_ulp); dissector_add_string("media_type","application/oma-supl-ulp", ulp_pdu_handle); dissector_add_string("media_type","application/vnd.omaloc-supl-init", ulp_pdu_handle); dissector_add_uint_with_preference("tcp.port", ULP_PORT, ulp_tcp_handle); dissector_add_uint_with_preference("udp.port", ULP_PORT, ulp_pdu_handle); }
C
wireshark/epan/dissectors/packet-uma.c
/* packet-uma.c * Routines for Unlicensed Mobile Access(UMA) dissection * Copyright 2005-2006,2009, Anders Broman <anders.broman[at]ericsson.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * * References: * http://www.umatechnology.org/ * UMA Protocols (Stage 3) R1.0.4 (5/16/2005) * * 3GPP TS 44.318 version 8.4.0 Release 8 * * https://www.3gpp.org/specifications/specification-numbering * 3GPP TS 24.008 V6.2.0 (2003-09) * Technical Specification * 3rd Generation Partnership Project; * Technical Specification Group Core Network; * Mobile radio interface Layer 3 specification; * Core network protocols; Stage 3 * (Release 6) * * 3GPP TS 44.018 V6.11.0 (2005-01) * 3rd Generation Partnership Project; * Technical Specification Group GSM/EDGE Radio Access Network; * Mobile radio interface layer 3 specification; * Radio Resource Control (RRC) protocol * (Release 6) * * 3GPP TS 45.009 V6.1.0 (2004-02) * 3rd Generation Partnership Project; * Technical Specification Group GSM/EDGE * Radio Access Network; * Link adaptation * (Release 6) * */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/asn1.h> #include "packet-bssap.h" #include "packet-gsm_a_common.h" #include "packet-rtp.h" #include "packet-rtcp.h" #include "packet-e212.h" #include "packet-tcp.h" #include "packet-rrc.h" void proto_register_uma(void); void proto_reg_handoff_uma(void); /* Length field is 2 bytes and comes first */ #define UMA_HEADER_SIZE 2 static gboolean uma_desegment = TRUE; static dissector_handle_t uma_tcp_handle; static dissector_handle_t uma_udp_handle; static dissector_table_t bssap_pdu_type_table; static dissector_handle_t rtcp_handle; static dissector_handle_t llc_handle; /* Initialize the protocol and registered fields */ static int proto_uma = -1; static int hf_uma_length_indicator = -1; static int hf_uma_pd = -1; static int hf_uma_skip_ind = -1; static int hf_uma_urr_msg_type = -1; static int hf_uma_urlc_msg_type = -1; static int hf_uma_urlc_TLLI = -1; static int hf_uma_urlc_seq_nr = -1; static int hf_uma_urr_IE = -1; static int hf_uma_urr_IE_len = -1; static int hf_uma_urr_uri = -1; static int hf_uma_urr_radio_type_of_id = -1; static int hf_uma_urr_radio_id = -1; static int hf_uma_urr_cell_id = -1; static int hf_uma_urr_lac = -1; static int hf_uma_urr_gci = -1; static int hf_uma_urr_tura = -1; static int hf_uma_urr_gc = -1; static int hf_uma_urr_uc = -1; static int hf_uma_urr_rrs = -1; static int hf_uma_urr_gmsi = -1; static int hf_uma_urr_psho = -1; static int hf_uma_urr_IP_Address_type = -1; static int hf_uma_urr_FQDN = -1; static int hf_uma_urr_sgw_ipv4 = -1; static int hf_uma_urr_redirection_counter = -1; static int hf_uma_urr_dis_rej_cau = -1; static int hf_uma_urr_MSCR = -1; static int hf_uma_urr_ATT = -1; static int hf_uma_urr_DTM = -1; static int hf_uma_urr_GPRS = -1; static int hf_uma_urr_NMO = -1; static int hf_uma_urr_ECMC = -1; static int hf_uma_urr_T3212_timer = -1; static int hf_uma_urr_RAC = -1; static int hf_uma_urr_ap_location = -1; static int hf_uma_urr_SGSNR = -1; static int hf_uma_urr_ECMP = -1; static int hf_uma_urr_RE = -1; static int hf_uma_urr_PFCFM = -1; static int hf_uma_urr_3GECS = -1; static int hf_uma_urr_TU3907_timer = -1; static int hf_uma_urr_GSM_RR_state = -1; static int hf_uma_urr_gan_band = -1; static int hf_uma_urr_URR_state = -1; static int hf_uma_urr_register_reject_cause = -1; static int hf_uma_urr_TU3906_timer = -1; static int hf_uma_urr_TU3910_timer = -1; static int hf_uma_urr_TU3902_timer = -1; static int hf_uma_urr_communication_port = -1; static int hf_uma_urr_L3_Message = -1; static int hf_uma_urr_L3_protocol_discriminator = -1; static int hf_uma_urr_GPRS_resumption = -1; static int hf_uma_urr_ULQI = -1; static int hf_uma_urr_TU3920_timer = -1; static int hf_uma_urr_peak_tpt_cls = -1; static int hf_uma_urr_radio_pri = -1; static int hf_uma_urr_rlc_mode = -1; static int hf_uma_urr_ga_psr_cause = -1; static int hf_uma_urr_udr = -1; static int hf_uma_urr_TU4001_timer = -1; static int hf_uma_urr_LS = -1; static int hf_uma_urr_cipher_res = -1; static int hf_uma_urr_rand_val = -1; static int hf_uma_urr_ciphering_command_mac = -1; static int hf_uma_urr_ciphering_key_seq_num = -1; static int hf_uma_urr_sapi_id = -1; static int hf_uma_urr_establishment_cause = -1; static int hf_uma_urr_channel = -1; static int hf_uma_urr_PDU_in_error = -1; static int hf_uma_urr_sample_size = -1; static int hf_uma_urr_payload_type = -1; static int hf_uma_urr_LLC_PDU = -1; static int hf_uma_urr_LBLI = -1; static int hf_uma_urr_RI = -1; static int hf_uma_urr_TU4003_timer = -1; static int hf_uma_urr_ap_service_name_type = -1; static int hf_uma_urr_ap_Service_name_value = -1; static int hf_uma_urr_uma_service_zone_icon_ind = -1; static int hf_uma_urr_uma_service_zone_str_len = -1; static int hf_uma_urr_window_size = -1; static int hf_uma_urr_uma_codec_mode = -1; static int hf_uma_urr_UTRAN_cell_id_disc = -1; static int hf_uma_urr_ms_radio_id = -1; static int hf_uma_urr_uma_service_zone_str = -1; static int hf_uma_urr_suti = -1; static int hf_uma_urr_uma_mps = -1; static int hf_uma_urr_num_of_plms = -1; static int hf_uma_urr_cbs = -1; static int hf_uma_urr_num_of_cbs_frms = -1; static int hf_uma_urr_unc_ipv4 = -1; static int hf_uma_unc_FQDN = -1; static int hf_uma_urr_GPRS_user_data_transport_ipv4 = -1; static int hf_uma_urr_GPRS_port = -1; static int hf_uma_urr_UNC_tcp_port = -1; static int hf_uma_urr_RTP_port = -1; static int hf_uma_urr_RTCP_port = -1; static int hf_uma_urr_RXLEV_NCELL = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_uma_access_control_class_n = -1; static int hf_uma_data = -1; /* Initialize the subtree pointers */ static int ett_uma = -1; static int ett_uma_toc = -1; static int ett_urr_ie = -1; /* Generated from convert_proto_tree_add_text.pl */ static expert_field ei_uma_fqdn_not_present = EI_INIT; static expert_field ei_uma_wrong_message_type = EI_INIT; static expert_field ei_uma_unknown_protocol = EI_INIT; static expert_field ei_uma_skip_this_message = EI_INIT; static expert_field ei_uma_cbs_frames = EI_INIT; static expert_field ei_uma_unknown_format = EI_INIT; /* The dynamic payload type which will be dissected as uma */ #define DEFAULT_UMA_PORT_RANGE "14001" /* Not IANA registered */ /* Global variables */ static guint32 unc_ipv4_address; /** static guint32 rtp_ipv4_address; **/ static guint32 rtcp_ipv4_address; static guint32 GPRS_user_data_ipv4_address; /* * Protocol Discriminator (PD) */ static const value_string uma_pd_vals[] = { { 0, "URR_C"}, { 1, "URR"}, { 2, "URLC"}, { 0, NULL } }; /* * Message types for Unlicensed Radio Resources management */ static const value_string uma_urr_msg_type_vals[] = { { 1, "GA-RC DISCOVERY REQUEST"}, { 2, "GA-RC DISCOVERY ACCEPT"}, { 3, "GA-RC DISCOVERY REJECT"}, { 16, "GA-RC REGISTER REQUEST"}, { 17, "GA-RC REGISTER ACCEPT"}, { 18, "GA-RC REGISTER REDIRECT"}, { 19, "GA-RC REGISTER REJECT"}, { 20, "GA-RC DEREGISTER"}, { 21, "GA-RC REGISTER UPDATE UPLINK"}, { 22, "GA-RC REGISTER UPDATE DOWNLINK"}, { 23, "GA-RC CELL BROADCAST INFO"}, { 32, "GA-CSR CIPHERING MODE COMMAND"}, { 33, "GA-CSR CIPHERING MODE COMPLETE"}, { 48, "GA-CSR ACTIVATE CHANNEL"}, { 49, "GA-CSR ACTIVATE CHANNEL ACK"}, { 50, "GA-CSR ACTIVATE CHANNEL COMPLETE"}, { 51, "GA-CSR ACTIVATE CHANNEL FAILURE"}, { 52, "GA-CSR CHANNEL MODE MODIFY"}, { 53, "GA-CSR CHANNEL MODE MODIFY ACKNOWLEDGE"}, { 64, "GA-CSR RELEASE"}, { 65, "GA-CSR RELEASE COMPLETE"}, { 66, "GA-CSR CLEAR REQUEST"}, { 80, "GA-CSR HANDOVER ACCESS"}, { 81, "GA-CSR HANDOVER COMPLETE"}, { 82, "GA-CSR UPLINK QUALITY INDICATION"}, { 83, "GA-CSR HANDOVER INFORMATION"}, { 84, "GA-CSR HANDOVER COMMAND"}, { 85, "GA-CSR HANDOVER FAILURE"}, { 96, "GA-CSR PAGING REQUEST"}, { 97, "GA-CSR PAGING RESPONSE"}, { 112, "GA-CSR UPLINK DIRECT TRANSFER"}, { 113, "URR INITIAL DIRECT TRANSFER"}, { 114, "GA-CSR DOWNLINK DIRECT TRANSFER"}, { 115, "GA-CSR STATUS"}, { 116, "GA-RC KEEP ALIVE"}, { 117, "GA-CSR CLASSMARK ENQUIRY"}, { 118, "GA-CSR CLASSMARK CHANGE"}, { 119, "GA-CSR GPRS SUSPENSION REQUEST"}, { 120, "GA-RC SYNCHRONIZATION INFORMATION"}, { 121, "GA-CSR UTRAN CLASSMARK CHANGE"}, { 128, "GA-CSR REQUEST"}, { 129, "GA-CSR REQUEST ACCEPT"}, { 130, "GA-CSR REQUEST REJECT"}, { 0, NULL } }; static value_string_ext uma_urr_msg_type_vals_ext = VALUE_STRING_EXT_INIT(uma_urr_msg_type_vals); /* * Message types for URLC signaling */ static const value_string uma_urlc_msg_type_vals[] = { { 1, "GA-PSR-DATA"}, { 2, "URLC UNITDATA"}, { 3, "GA-PSR-PS-PAGE"}, { 4, "Unknown"}, { 5, "Unknown"}, { 6, "URLC-UFC-REQ"}, { 7, "URLC-DFC-REQ"}, { 8, "GA-PSR-ACTIVATE-UTC-REQ"}, { 9, "GA-PSR-ACTIVATE-UTC-ACK"}, { 10, "GA-PSR-DEACTIVATE-UTC-REQ"}, { 11, "GA-PSR-DEACTIVATE-UTC-ACK"}, { 12, "GA-PSR STATUS"}, { 13, "GA-PSR HANDOVER COMPLETE"}, { 14, "GA-PSR UPLINK QUALITY INDICATION"}, { 15, "GA-PSR HANDOVER INFORMATION"}, { 16, "GA-PSR HANDOVER COMMAND"}, { 17, "GA-PSR HANDOVER CONTINUE"}, { 18, "GA-PSR HANDOVER FAILURE"}, { 0, NULL } }; static value_string_ext uma_urlc_msg_type_vals_ext = VALUE_STRING_EXT_INIT(uma_urlc_msg_type_vals); /* * IE type and identifiers for Unlicensed Radio Resources management */ static const value_string uma_urr_IE_type_vals[] = { { 1, "Mobile Identity"}, { 2, "GAN Release Indicator"}, { 3, "Radio Identity"}, { 4, "GERAN Cell Identity"}, { 5, "Location Area Identification"}, { 6, "GERAN/UTRAN Coverage Indicator"}, { 7, "GAN Classmark"}, { 8, "Geographical Location"}, { 9, "GANC-SEGW IP Address"}, { 10, "GANC-SEGW Fully Qualified Domain/Host Name"}, { 11, "Redirection Counter"}, { 12, "Discovery Reject Cause"}, { 13, "GAN Cell Description"}, { 14, "GAN Control Channel Description"}, { 15, "Cell Identifier List"}, { 16, "TU3907 Timer"}, { 17, "GSM RR/UTRAN RRC State"}, { 18, "Routing Area Identification"}, { 19, "GAN Band"}, { 20, "GA-RC/GA-CSR/GA-PSR State"}, { 21, "Register Reject Cause"}, { 22, "TU3906 Timer"}, { 23, "TU3910 Timer"}, { 24, "TU3902 Timer"}, { 25, "Communication Port Identity"}, { 26, "L3 Message"}, { 27, "Channel Mode"}, { 28, "Mobile Station Classmark 2"}, { 29, "RR Cause"}, { 30, "Cipher Mode Setting"}, { 31, "GPRS Resumption"}, { 32, "Handover From GAN Command"}, { 33, "UL Quality Indication"}, { 34, "TLLI"}, { 35, "Packet Flow Identifier"}, { 36, "Suspension Cause"}, { 37, "TU3920 Timer"}, { 38, "QoS"}, { 39, "GA-PSR Cause"}, { 40, "User Data Rate"}, { 41, "Routing Area Code"}, { 42, "AP Location"}, { 43, "TU4001 Timer"}, { 44, "Location Status"}, { 45, "Cipher Response"}, { 46, "Ciphering Command RAND"}, { 47, "Ciphering Command MAC"}, { 48, "Ciphering Key Sequence Number"}, { 49, "SAPI ID"}, { 50, "Establishment Cause"}, { 51, "Channel Needed"}, { 52, "PDU in Error"}, { 53, "Sample Size"}, { 54, "Payload Type"}, { 55, "Multi-rate Configuration"}, { 56, "Mobile Station Classmark 3"}, { 57, "LLC-PDU"}, { 58, "Location Black List indicator"}, { 59, "Reset Indicator"}, { 60, "TU4003 Timer"}, { 61, "AP Service Name"}, { 62, "GAN Service Zone Information"}, { 63, "RTP Redundancy Configuration"}, { 64, "UTRAN Classmark"}, { 65, "Classmark Enquiry Mask"}, { 66, "UTRAN Cell Identifier List"}, { 67, "Serving UNC table indicator"}, { 68, "Registration indicators"}, { 69, "GAN PLMN List"}, { 70, "Received Signal Level List"}, { 71, "Required GAN Services"}, { 72, "Broadcast Container"}, { 73, "3G Cell Identity"}, { 74, "3G Security Capability"}, /* 11.2.108 */ { 75, "NAS Synchronisation Indicator"}, /* 11.2.109 */ { 76, "GANC TEID"}, /* 11.2.110 */ { 77, "MS TEID"}, /* 11.2.110 */ { 78, "UTRAN RRC Message"}, /* 11.2.111 */ { 79, "GAN Mode Indicator"}, /* 11.2.79 */ { 80, "CN Domain Identity"}, /* 11.2.80 */ { 81, "GAN Iu Mode Cell Description"}, /* 11.2.81 */ { 82, "3G UARFCN"}, /* 11.2.82 */ { 83, "RAB ID"}, /* 11.2.83 */ { 84, "RAB ID List"}, /* 11.2.84 */ { 85, "GA-RRC Establishment Cause"}, /* 11.2.85 */ { 86, "GA-RRC Cause"}, /* 11.2.86 */ { 87, "GA-RRC Paging Cause"}, /* 11.2.87 */ { 88, "Intra Domain NAS Node Selector"}, /* 11.2.88 */ { 89, "CTC Activation List"}, /* 11.2.89 */ { 90, "CTC Description"}, /* 11.2.90 */ { 91, "CTC Activation Ack List"}, /* 11.2.91 */ { 92, "CTC Activation Ack Description"}, /* 11.2.92 */ { 93, "CTC Modification List"}, /* 11.2.93 */ { 94, "CTC Modification Ack List"}, /* 11.2.94 */ { 95, "CTC Modification Ack Description"}, /* 11.2.95 */ { 96, "MS Radio Identity"}, { 97, "GANC IP Address"}, { 98, "GANC Fully Qualified Domain/Host Name"}, { 99, "IP address for GPRS user data transport"}, { 100, "UDP Port for GPRS user data transport"}, { 101, "Unknown"}, { 102, "Unknown"}, { 103, "GANC TCP port"}, { 104, "RTP UDP port"}, { 105, "RTCP UDP port"}, { 106, "GERAN Received Signal Level List"}, { 107, "UTRAN Received Signal Level List"}, { 108, "PS Handover to GERAN Command"}, /* 11.2.74 */ { 109, "PS Handover to UTRAN Command"}, /* 11.2.75 */ { 110, "PS Handover to GERAN PSI"}, /* 11.2.76 */ { 111, "PS Handover to GERAN SI"}, /* 11.2.77 */ { 112, "TU4004 Timer"}, /* 11.2.78 */ { 113, "Unknown"}, { 114, "Unknown"}, { 115, "PTC Activation List"}, /* 11.2.96 */ { 116, "PTC Description"}, /* 11.2.97 */ { 117, "PTC Activation Ack List"}, /* 11.2.98 */ { 118, "PTC Activation Ack Description"}, /* 11.2.99 */ { 119, "PTC Modification List"}, /* 11.2.100 */ { 120, "PTC Modification Ack List"}, /* 11.2.101 */ { 121, "PTC Modification Ack Description"}, /* 11.2.102 */ { 122, "RAB Configuration"}, /* 11.2.103 */ { 123, "Multi-rate Configuration 2"}, /* 11.2.104 */ { 124, "Selected Integrity Protection Algorithm"}, /* 11.2.105 */ { 125, "Selected Encryption Algorithm"}, /* 11.2.106 */ { 126, "CN Domains to Handover"}, /* 11.2.107 */ { 127, "SRNS Relocation Info"}, /* 11.2.107 */ { 128, "MS Radio Access Capability"}, /* 11.2.107 */ { 129, "Handover Reporting Control"}, /* 11.2.107 */ { 0, NULL } }; static value_string_ext uma_urr_IE_type_vals_ext = VALUE_STRING_EXT_INIT(uma_urr_IE_type_vals); static const value_string uma_urr_gan_rel_ind_vals[] = { { 1, "Release 1 (i.e. 3GPP Release-6)"}, { 2, "Release 2 (i.e. 3GPP Release-7)"}, { 3, "Release 3 (i.e. 3GPP Release-8)"}, { 0, NULL } }; static const value_string radio_type_of_id_vals[] = { { 0, "IEEE MAC-address format"}, { 0, NULL } }; /* GCI, GSM Coverage Indicator (octet 3) */ static const value_string uma_gci_vals[] = { { 0, "Normal Service in the GERAN"}, { 1, "Limited Service in the GERAN"}, { 2, "MS has not found GSM coverage (LAI information taken from SIM, if available)"}, { 3, "MS has found GSM coverage, service state unknown"}, { 0, NULL } }; /* TURA, Type of Unlicensed Radio (octet 3) */ static const value_string uma_tura_vals[] = { { 0, "No radio"}, { 1, "Bluetooth"}, { 2, "WLAN 802.11"}, { 15, "Unspecified"}, { 0, NULL } }; /* GC, GERAN Capable (octet 3) */ static const value_string uma_gc_vals[] = { { 0, "The MS is not GERAN capable."}, { 1, "The MS is GERAN capable."}, { 0, NULL } }; /* UC, UTRAN Capable (octet 3) */ static const value_string uma_uc_vals[] = { { 0, "The MS is not UTRAN capable."}, { 1, "The MS is UTRAN capable."}, { 0, NULL } }; /*RRS, RTP Redundancy Support (octet 4)*/ static const value_string uma_rrs_vals[] = { { 0, "RTP Redundancy not supported"}, { 1, "RTP Redundancy supported"}, { 0, NULL } }; /* * PS HO, PS Handover Capable (octet 4) Bit 2 */ static const value_string uma_ps_ho_vals[] = { { 0, "The MS does not support PS handover to/from GAN A/Gb mode"}, { 1, "The MS supports PS handover to/from GAN A/Gb mode"}, { 0, NULL } }; /* * GMSI, GAN Mode Support Indicator (octet 4)v Bits 4 3 */ static const value_string uma_gmsi_vals[] = { { 0, "Unspecified"}, { 1, "The MS supports GAN A/Gb mode only"}, { 2, "The MS supports GAN Iu mode only"}, { 3, "The MS supports GAN A/Gb mode and GAN Iu mode"}, { 0, NULL } }; /*IP address type number value (octet 3)*/ static const value_string IP_address_type_vals[] = { { 0x21, "IPv4 address"}, { 0x57, "IPv6 address"}, { 0, NULL } }; /*Discovery Reject Cause (octet 3) */ static const value_string uma_discovery_reject_cause_vals[] = { { 0, "Network Congestion"}, { 1, "Unspecified"}, { 2, "IMSI not allowed"}, { 0, NULL } }; /*EC Emergency Call allowed (octet 3)*/ static const value_string EC_vals[] _U_ = { { 0, "Emergency call allowed in the cell to all MSs"}, { 1, "Emergency call not allowed in the cell except for the MSs that belong to one of the classes between 11 to 15."}, { 0, NULL } }; /*ECMC, Early Classmark Sending Control (octet 3)*/ static const value_string ECMC_vals[] = { { 0, "Early Classmark Sending is allowed"}, { 1, "Early Classmark Sending is forbidden"}, { 0, NULL } }; /*NMO, Network Mode of Operation (octet 3)*/ static const value_string NMO_vals[] = { { 0, "Network Mode of Operation I"}, { 1, "Network Mode of Operation II"}, { 2, "Network Mode of Operation III"}, { 3, "Reserved"}, { 0, NULL } }; /*GPRS, GPRS Availability (octet 3)*/ static const value_string GPRS_avail_vals[] = { { 0, "GPRS available"}, { 1, "GPRS not available"}, { 0, NULL } }; /*DTM, Dual Transfer Mode of Operation by network (octet 3)*/ static const value_string DTM_vals[] = { { 0, "Network does not support dual transfer mode"}, { 1, "Network supports dual transfer mode"}, { 0, NULL } }; /*ATT, Attach-detach allowed (octet 3)*/ static const value_string ATT_vals[] = { { 0, "MSs in the cell are not allowed to apply IMSI attach and detach procedure."}, { 1, "MSs in the cell shall apply IMSI attach and detach procedure."}, { 0, NULL } }; /*MSCR, MSC Release (octet 3)*/ static const value_string MSCR_vals[] = { { 0, "MSC is Release '98 or older"}, { 1, "MSC is Release '99 onwards"}, { 0, NULL } }; /* SGSNR, SGSN Release (octet 6)*/ static const value_string SGSNR_vals[] = { { 0, "SGSN is Release '98 or older"}, { 1, "SGSN is Release '99 onwards"}, { 0, NULL } }; /* ECMP, Emergency Call Mode Preference (octet 6)*/ static const value_string ECMP_vals[] = { { 0, "GSM GERAN is preferred for Emergency calls"}, { 1, "UMAN is preferred for Emergency calls"}, { 0, NULL } }; /* RE, Call reestablishment allowed (octet 6) */ static const value_string RE_vals[] = { { 0, "Call Reestablishment allowed in the cell"}, { 1, "Call Reestablishment not allowed in the cell"}, { 0, NULL } }; /* PFCFM, PFC_FEATURE_MODE (octet 6) */ static const value_string PFCFM_vals[] = { { 0, "The network does not support packet flow context procedures"}, { 1, "The network supports packet flow context procedures"}, { 0, NULL } }; /* 3GECS, 3G Early Classmark Sending Restriction (octet 6) */ static const value_string Three_GECS_vals[] = { { 0, "UTRAN classmark change message shall be sent with the Early classmark sending"}, { 1, "The sending of UTRAN Classmark Sending messages is controlled by the Early Classmark Sending Control parameter"}, { 0, NULL } }; /*GRS, GSM RR State (octet 3)*/ static const value_string uma_GRS_GSM_RR_State_vals[] = { { 0, "GSM RR is in IDLE state"}, { 1, "GSM RR is in DEDICATED state"}, { 2, "UTRAN RRC is in IDLE STATE"}, { 3, "UTRAN RRC is in CELL_DCH STATE"}, { 4, "UTRAN RRC is in CELL_FACH STATE"}, { 5, "UTRAN RRC is in CELL_PCH STATE"}, { 6, "UTRAN RRC is in URA_PCH STATE"}, { 7, "Unknown"}, { 0, NULL } }; static value_string_ext uma_GRS_GSM_RR_State_vals_ext = VALUE_STRING_EXT_INIT(uma_GRS_GSM_RR_State_vals); /* UMA Band (4 bit field) */ static const value_string uma_gan_band_vals[] = { { 0, "E-GSM is supported"}, { 1, "P-GSM is supported"}, { 2, "GSM 1800 is supported"}, { 3, "GSM 450 is supported"}, { 4, "GSM 480 is supported"}, { 5, "GSM 850 is supported"}, { 6, "GSM 1900 is supported"}, { 7, "GSM 700 is supported"}, { 0, NULL } }; static value_string_ext uma_gan_band_vals_ext = VALUE_STRING_EXT_INIT(uma_gan_band_vals); /*URS, URR State (octet 3) */ static const value_string URR_state_vals[] = { { 0, "GA-CSR is in GA-CSR-IDLE state"}, { 1, "GA-CSR is in GA-CSR-DEDICATED state"}, { 2, "GA-RC is in GA-RC-REGISTERED state while in GERAN/UTRAN mode"}, { 0, NULL } }; /* UPS, GA-PSR State (octet 3) Bit 3 0 GA-PSR is in GA-PSR-STANDBY state. 1 GA-PSR is in GA-PSR-ACTIVE state. GA-RRC-CS, GA-RRC (CS) State (octet 3) Bit 4 0 GA-RRC (CS) is in GA-RRC-IDLE state. 1 GA-RRC (CS) is in GA-RRC-CONNECTED state. GA-RRC-PS, GA-RRC (PS) State (octet 3) Bit 5 0 GA-RRC (PS) is in GA-RRC-IDLE state. 1 GA-RRC (PS) is in GA-RRC-CONNECTED state. */ /* Register Reject Cause (octet 3) */ static const value_string register_reject_cause_vals[] = { { 0, "Network Congestion"}, { 1, "AP not allowed"}, { 2, "Location not allowed"}, { 3, "Invalid GANC"}, { 4, "Geo Location not known"}, { 5, "IMSI not allowed"}, { 6, "Unspecified"}, { 7, "GANC-SEGW certificate not valid"}, { 8, "EAP_SIM authentication failed"}, { 9, "TCP establishment failed"}, { 10, "Redirection"}, { 11, "EAP-AKA authentication failed"}, /* 12 to 255 Reserved for future use. */ { 0, NULL } }; static value_string_ext register_reject_cause_vals_ext = VALUE_STRING_EXT_INIT(register_reject_cause_vals); /* L3 Protocol discriminator values according to TS 24 007 (640) */ #if 0 /** See packet-gms_a-dtap.c **/ static const value_string protocol_discriminator_vals[] = { {0x0, "Group call control"}, {0x1, "Broadcast call control"}, {0x2, "Reserved: was allocated in earlier phases of the protocol"}, {0x3, "Call Control; call related SS messages"}, {0x4, "GPRS Transparent Transport Protocol (GTTP)"}, {0x5, "Mobility Management messages"}, {0x6, "Radio Resources Management messages"}, {0x7, "Unknown"}, {0x8, "GPRS mobility management messages"}, {0x9, "SMS messages"}, {0xa, "GPRS session management messages"}, {0xb, "Non call related SS messages"}, {0xc, "Location services specified in 3GPP TS 44.071 [8a]"}, {0xd, "Unknown"}, {0xe, "Reserved for extension of the PD to one octet length "}, {0xf, "Reserved for tests procedures described in 3GPP TS 44.014 [5a] and 3GPP TS 34.109 [17a]."}, { 0, NULL } }; #endif /* GPRS Resumption */ static const value_string GPRS_resumption_vals[] = { { 0, "Resumption of GPRS services not successfully acknowledged"}, { 1, "Resumption of GPRS services successfully acknowledged"}, { 0, NULL } }; /* ULQI, UL Quality Indication (octet 3) */ static const value_string uma_ulqi_vals[] = { { 0, "Quality ok"}, { 1, "Radio problem"}, { 2, "Network problem"}, { 4, "Undetermined problem"}, { 0, NULL } }; static const value_string radio_pri_vals[] = { { 0, "Radio priority 1"}, { 1, "Radio priority 2"}, { 2, "Radio priority 3"}, { 3, "Radio priority 4"}, { 0, NULL } }; static const value_string rlc_mode_vals[] = { { 0, "RLC acknowledged mode"}, { 1, "RLC unacknowledged mode"}, { 0, NULL } }; /*URLC Cause (octet 3) */ static const value_string uma_ga_psr_cause_vals[] = { { 0, "success"}, { 1, "future use"}, { 2, "no available resources"}, { 3, "GANC failure"}, { 4, "not authorized for data service"}, { 5, "message type non existent or not implemented"}, { 6, "message type not compatible with the protocol state"}, { 7, "invalid mandatory information"}, { 8, "syntactically incorrect message"}, { 9, "GPRS suspended"}, { 10, "normal deactivation"}, { 11, "future use"}, { 12, "conditional IE error"}, { 13, "semantically incorrect message"}, { 14, "PS handover failure - incorrect handover command"}, { 15, "PS handover failure - target RAT access failure"}, { 16, "PS handover failure - missing SI/PSI information"}, { 17, "PS handover failure - no uplink TBF allocation"}, { 0, NULL } }; static value_string_ext uma_ga_psr_cause_vals_ext = VALUE_STRING_EXT_INIT(uma_ga_psr_cause_vals); /* LS, Location Status (octet 3) */ static const value_string LS_vals[] = { { 0, "MS location known"}, { 1, "MS location unknown"}, { 0, NULL } }; /* CR Cipher Response (octet 1) */ static const value_string CR_vals[] = { { 0, "IMEISV shall not be included"}, { 1, "IMEISV shall be included"}, { 0, NULL } }; /* SAPI ID, SAPI Identifier (octet 3) */ static const value_string sapi_id_vals[] = { { 0, "SAPI 0 (all other except SMS)"}, { 3, "SAPI 3 (SMS)"}, { 0, NULL } }; /* Sample Size (octet 3)*/ static const value_string sample_size_vals[] = { { 20, "20 ms of CS payload included in each RTP/UDP packet"}, { 40, "40 ms of CS payload included in each RTP/UDP packet"}, { 60, "60 ms of CS payload included in each RTP/UDP packet"}, { 80, "80 ms of CS payload included in each RTP/UDP packet"}, { 0, NULL } }; /* MPS, Manual PLMN Selection indicator (octet 3) */ static const value_string mps_vals[] = { { 0, "The MS is in Automatic PLMN selection mode."}, { 1, "The MS is in Manual PLMN selection mode and request the list of PLMN identities that may provide UMAN service in the current location."}, { 2, "The MS is in Manual PLMN selection mode and tries to register; no PLMN list is needed."}, { 0, NULL } }; /* CBS Cell Broadcast Service (octet 3) */ static const value_string cbs_vals[] = { { 0, "CBS is not required by the Mobile station"}, { 1, "CBS is required by the mobile station"}, { 0, NULL } }; /* LBLI, Location Black List indicator (octet 3) */ static const value_string LBLI_vals[] = { { 0, "MCC"}, { 1, "MCC and MNC"}, { 2, "MCC, MNC and LAC"}, { 0, NULL } }; /* AP Service Name type */ static const value_string ap_service_name_type_vals[] = { { 0, "SSID"}, { 1, "PAN Service Name"}, { 0, NULL } }; /* UMA Service Zone Icon Indicator, octet 3 */ static const value_string uma_service_zone_icon_ind_vals[] = { { 1, "Unlimited Calls"}, { 0, NULL } }; /*Establishment Cause (octet 3)*/ static const value_string uma_establishment_cause_val[] = { { 0x00, "Location Update"}, { 0x10, "Other SDCCH procedures including IMSI Detach, SMS, SS, paging response"}, /* note: Paging response for SDCCH needed is using codepoint 0001 0000 */ { 0x20, "Paging response (TCH/F needed)"}, { 0x30, "Paging response (TCH/F or TCH/H needed)"}, { 0x40, "Originating speech call from dual-rate mobile station when TCH/H is sufficient"}, { 0x50, "Originating data call from dual-rate mobile station when TCH/H is sufficient"}, { 0x80, "Paging response (any channel needed)"}, { 0xa0, "Emergency"}, { 0xc0, "Call re-establishment"}, { 0xe0, "Originating speech call and TCH/F is needed"}, { 0xf0, "Originating data call and TCH/F is needed"}, { 0, NULL } }; static value_string_ext uma_establishment_cause_val_ext = VALUE_STRING_EXT_INIT(uma_establishment_cause_val); /*CHANNEL (octet 3) */ static const value_string channel_vals[] = { { 0, "Any channel"}, { 1, "SDCCH"}, { 2, "TCH/F (Full rate)"}, { 3, "TCH/H or TCH/F (Dual rate)"}, { 0, NULL } }; /*RI, Reset Indicator (octet 3)*/ /*CHANNEL (octet 3) */ static const value_string RI_vals[] = { { 0, "The flow control condition continues to exist"}, { 1, "The flow control condition no longer exists"}, { 0, NULL } }; /* Window Size (octet 3 to octet n) */ static const value_string window_size_vals[] = { { 0, "Window size 1, No redundancy"}, { 1, "Window size 2 (single redundancy)"}, { 2, "Window size 3 (double redundancy)"}, { 0, NULL } }; static const value_string UTRAN_cell_id_disc_vals[] = { { 0, "PLMN-ID, LAC and a 28-bit Cell Id are used to identify the target UTRAN cell."}, { 0, NULL } }; /* SUTI, Serving UNC table indicator indicator (octet 3) */ static const value_string suti_vals[] = { { 0, "The MS is not allowed to store information in the stored Serving UNC table."}, { 1, "The MS is allowed to store information in the stored Serving UNC table."}, { 0, NULL } }; /* Code to actually dissect the packets */ static int dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { tvbuff_t *l3_tvb; tvbuff_t *llc_tvb; tvbuff_t *new_tvb; int ie_offset; guint8 ie_value; guint16 ie_len = 0; guint8 octet; proto_item *urr_ie_item; proto_tree *urr_ie_tree; const guint8 *string; guint16 GPRS_user_data_transport_UDP_port,UNC_tcp_port,RTP_UDP_port,RTCP_UDP_port; guint32 udr; conversation_t *conversation; address dst_addr, null_addr; guint8 str_len; address src_addr; ie_value = tvb_get_guint8(tvb,offset); urr_ie_tree = proto_tree_add_subtree(tree,tvb,offset,-1, ett_urr_ie, &urr_ie_item, val_to_str_ext(ie_value, &uma_urr_IE_type_vals_ext, "Unknown IE (%u)")); proto_tree_add_item(urr_ie_tree, hf_uma_urr_IE, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Some IE:s might have a length field of 2 octets */ ie_len = tvb_get_guint8(tvb,offset); if ( (ie_len & 0x80) == 0x80 ){ offset++; ie_len = (ie_len & 0x7f) << 8; ie_len = ie_len | (tvb_get_guint8(tvb,offset)); proto_item_set_len(urr_ie_item, ie_len + 3); proto_tree_add_uint(urr_ie_tree, hf_uma_urr_IE_len , tvb, offset-1, 2, ie_len ); ie_offset = offset +1; }else{ proto_item_set_len(urr_ie_item, ie_len + 2); proto_tree_add_item(urr_ie_tree, hf_uma_urr_IE_len, tvb, offset, 1, ENC_BIG_ENDIAN); ie_offset = offset +1; } switch(ie_value){ /* 11.2.1 Mobile Identity */ case 1: /* Mobile Identity * The rest of the IE is coded as in [TS 24.008] not including IEI and * length, if present.(10.5.1.4) */ de_mid(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 2: /* UMA Release Indicator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uri, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 3: /* Radio Identity */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_type_of_id, tvb, ie_offset, 1, ENC_BIG_ENDIAN); octet = tvb_get_guint8(tvb,ie_offset); if (( octet & 0xf) == 0){ /* IEEE MAC-address format */ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_id, tvb, ie_offset, ie_len-1, ENC_NA); }else{ proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_unknown_format, tvb, ie_offset, ie_len); } break; case 4: /* Cell Identity * The rest of the IE is coded as in [TS 24.008] not including IEI and length, if present. */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_cell_id, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 5: /* Location Area Identification * The rest of the IE is coded as in [TS 24.008] not including IEI and * length, if present. */ de_lai(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 6: /* GSM Coverage Indicator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_gci, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 7: /* 11.2.7 GAN Classmark */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_tura, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_gc, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_uc, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* UMA Protocols (Stage 3) R1.0.3 */ if(ie_len>1){ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_urr_gmsi, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_psho, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_rrs, tvb, ie_offset, 1, ENC_BIG_ENDIAN); } break; case 8: /* Geographical Location * The Location Estimate field is composed of 1 or more octets with an internal structure * according to section 7 in [23.032]. */ new_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len ); dissect_geographical_description(new_tvb, pinfo, urr_ie_tree); break; case 9: /* UNC SGW IP Address * IP Address type */ octet = tvb_get_guint8(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_IP_Address_type, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; if ( octet == 0x57 ){ /* IPv6 */ }else{ /* All other values shall be interpreted as Ipv4 address in this version of the protocol.*/ proto_tree_add_item(urr_ie_tree, hf_uma_urr_sgw_ipv4, tvb, ie_offset, 4, ENC_BIG_ENDIAN); } break; case 10: /* UNC SGW Fully Qualified Domain/Host Name */ if ( ie_len > 0){ proto_tree_add_item(urr_ie_tree, hf_uma_urr_FQDN, tvb, ie_offset, ie_len, ENC_ASCII); }else{ proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_fqdn_not_present, tvb, offset, 1); } break; case 11: /* Redirection Counter */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_redirection_counter, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 12: /* 11.2.12 Discovery Reject Cause */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_dis_rej_cau, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 13: /* 11.2.13 GAN Cell Description * The rest of the IE is coded as in [TS 44.018], Cell Description IE, not including IEI and length, if present */ de_rr_cell_dsc(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 14: /* * 11.2.14 GAN Control Channel Description */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ECMC, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_NMO, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_GPRS, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_DTM, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_ATT, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_MSCR, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* T3212 timeout value */ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_urr_T3212_timer, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* RAC, Routing Area Code (octet 5) */ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_urr_RAC, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; /* SGSNR, SGSN Release (octet 6) B1*/ proto_tree_add_item(urr_ie_tree, hf_uma_urr_SGSNR, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_ECMP, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_RE, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_PFCFM, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_3GECS, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* PS HO, PS Handover indicator (octet 6) Bit 6 */ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_access_control_class_n, tvb, ie_offset, 2, ENC_NA); /* These fields are specified and described in 3GPP TS 44.018 and 3GPP TS 22.011. */ break; case 15: /* 11.2.15 Cell Identifier List * The rest of the IE is coded as in [TS 48.008], not including IEI and length, if present */ be_cell_id_list(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 16: /* TU3907 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU3907_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 17: /* 11.2.17 GSM RR/UTRAN RRC State */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_GSM_RR_state, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 18: /* 11.2.18 Routing Area Identification */ /* The rest of the IE is coded as in [TS 24.008] not including IEI and length, if present.*/ de_gmm_rai(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 19: /* 11.2.19 GAN Band */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_gan_band, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 20: /* 11.2.20 GAN State */ /* URS, GA-RC/GA-CSR State (octet 3) Bits 2-1 */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_URR_state, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* UPS, GA-PSR State (octet 3) Bit 3 */ /* GA-RRC-CS, GA-RRC (CS) State (octet 3) Bit 4 */ /* GA-RRC-PS, GA-RRC (PS) State (octet 3) Bit 5 */ break; case 21: /* 11.2.21 Register Reject Cause */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_register_reject_cause, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 22: /* 11.2.22 TU3906 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU3906_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 23: /* 11.2.23 TU3910 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU3910_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 24: /* 11.2.24 TU3902 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU3902_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 25: /* 11.2.25 Communication Port Identity */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_communication_port, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 26: /* 11.2.26 L3 Message * The L3 Message information element contains the upper layer message to be transported * using the GA-CSR protocol or the GA-RRC protocol between the MS and the core network. */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_protocol_discriminator, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_Message, tvb, ie_offset, ie_len, ENC_NA); l3_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len ); if (!dissector_try_uint(bssap_pdu_type_table,BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, urr_ie_tree)) call_data_dissector(l3_tvb, pinfo, urr_ie_tree); break; case 27: /* 11.2.27 Channel Mode * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present */ de_rr_ch_mode(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 28: /* 11.2.28 Mobile Station Classmark 2 * The rest of the IE is coded as in [TS 24.008], not including IEI and length, if present */ de_ms_cm_2(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 29: /* 11.2.29 RR Cause * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present */ de_rr_cause(tvb, urr_ie_tree, pinfo, ie_offset, 1, NULL, 0); break; case 30: /* 11.2.30 Cipher Mode Setting * Note: The coding of fields SC and algorithm identifier is defined in [44.018] * as part of the Cipher Mode Setting IE. */ de_rr_cip_mode_set(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 31: /* 11.2.31 GPRS Resumption * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_GPRS_resumption, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 32: /* 11.2.32 Handover From GAN Command * If the target RAT is GERAN, the rest of the IE is coded as HANDOVER COMMAND message in [TS 44.018] * If the target RAT is UTRAN, the rest of the IE is coded as * HANDOVER TO UTRAN COMMAND message in [TS 25.331]. */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_protocol_discriminator, tvb, ie_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(urr_ie_tree, hf_uma_urr_L3_Message, tvb, ie_offset, ie_len, ENC_NA); /* XXX the dissector to call should depend on the RAT type ??? */ l3_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len ); if (!dissector_try_uint(bssap_pdu_type_table,BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, urr_ie_tree)) call_data_dissector(l3_tvb, pinfo, urr_ie_tree); break; case 33: /* 11.2.33 UL Quality Indication */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ULQI, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 34: /* 11.2.34 TLLI * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present. * [TS 44.018]:10.5.2.41a * The TLLI is encoded as a binary number with a length of 4 octets. TLLI is defined in 3GPP TS 23.003 */ de_rr_tlli(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 35: /* 11.2.35 Packet Flow Identifier * The rest of the IE is coded as in [TS 24.008], not including IEI and length, if present. */ de_sm_pflow_id(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 36: /* 11.2.36 Suspension Cause * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present. */ de_rr_sus_cau(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 37: /* 11.2.37 TU3920 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU3920_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; /* 11.2.38 QoS */ case 38: /* QoS * PEAK_THROUGHPUT_CLASS (octet 3, bits 1-4) * This field is coded as PEAK_THROUGHPUT_CLASS field in * the Channel Request Description information * element specified in [TS 44.060] */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_peak_tpt_cls, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* RADIO_PRIORITY (octet 3, bits 5-6) */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_pri, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* RLC_MODE (octet 3, bit 7) */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_rlc_mode, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* PEAK_THROUGHPUT_CLASS (octet 3, bits 1-4)*/ break; case 39: /* 11.2.39 GA-PSR Cause */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ga_psr_cause, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 40: /* 11.2.40 User Data Rate */ /* The R field is the binary encoding of the rate information expressed in 100 bits/sec * increments, starting from 0 x 100 bits/sec until 16777215 x 100 bits/sec (1.6 Gbps). */ udr = tvb_get_ntoh24(tvb, ie_offset) * 100; proto_tree_add_uint(urr_ie_tree, hf_uma_urr_udr , tvb, ie_offset, 3, udr ); break; case 41: /* 11.2.41 Routing Area Code * The rest of the IE is coded as in [TS 23.003] not including IEI and length, if present. */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_RAC, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 42: /* 11.2.42 AP Location * The rest of the IE is coded as in [GEOPRIV], not including IEI and length, if present * https://tools.ietf.org/html/draft-ietf-geopriv-dhcp-civil-05 */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ap_location, tvb, ie_offset, ie_len, ENC_NA); break; case 43: /* 11.2.43 TU4001 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU4001_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 44: /* 11.2.44 Location Status */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_LS, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 45: /* Cipher Response */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_cipher_res, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 46: /* Ciphering Command RAND */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_rand_val, tvb, ie_offset, ie_len, ENC_NA); break; case 47: /* Ciphering Command MAC (Message Authentication Code)*/ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ciphering_command_mac, tvb, ie_offset, ie_len, ENC_NA); break; case 48: /* Ciphering Key Sequence Number */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ciphering_key_seq_num, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 49: /* SAPI ID */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_sapi_id, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 50: /* 11.2.50 Establishment Cause */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_establishment_cause, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 51: /* Channel Needed */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_channel, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 52: /* PDU in Error */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_PDU_in_error, tvb, ie_offset, ie_len, ENC_NA); break; case 53: /* Sample Size */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_sample_size, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 54: /* 11.2.54 Payload Type * Payload Type (octet 3) Allowed values are between 96 and 127. */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_payload_type, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; /* 11.2.55 Multirate Configuration */ case 55: /* Multi-rate Configuration * The rest of the IE is coded as in [TS 44.018], not including IEI and length, if present */ de_rr_multirate_conf(tvb, urr_ie_tree, pinfo, ie_offset, ie_len, NULL, 0); break; case 56: /* 11.2.56 Mobile Station Classmark 3 * The rest of the IE is coded as in [TS 24.008], not including IEI and length, if present */ de_ms_cm_3(tvb, urr_ie_tree, pinfo, offset, ie_len, NULL, 0); break; case 57: /* 11.2.57 LLC-PDU * The rest of the IE is coded as in [TS 48.018], not including IEI and length, if present */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_LLC_PDU, tvb, ie_offset, ie_len, ENC_NA); llc_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len ); if (llc_handle) { col_append_str(pinfo->cinfo, COL_PROTOCOL, "/"); col_set_fence(pinfo->cinfo, COL_PROTOCOL); call_dissector(llc_handle, llc_tvb, pinfo, urr_ie_tree); }else{ call_data_dissector(llc_tvb, pinfo, urr_ie_tree); } break; case 58: /* 11.2.58 Location Black List indicator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_LBLI, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 59: /* 11.2.59 Reset Indicator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_RI, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 60: /* TU4003 Timer */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_TU4003_timer, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 61: /* AP Service Name */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ap_service_name_type, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; /* AP Service Name value (octet 4 to octet n) * The AP Service Name is coded as a string according to UTF-8 format defined in RFC * 3629 [50]. This means that the 1st octet of the UTF-8 string is coded in octet 4 and the * last octet of the UTF-8 string is coded in the last octet of this IE (octet n). */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_ap_Service_name_value, tvb, ie_offset, ie_len -1, ENC_ASCII); break; case 62: /* 11.2.62 GAN Service Zone Information * UMA Service Zone Icon Indicator, octet 3 */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uma_service_zone_icon_ind, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; /* Length of UMA Service Zone string */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uma_service_zone_str_len, tvb, ie_offset, 1, ENC_BIG_ENDIAN); str_len = tvb_get_guint8(tvb,ie_offset); ie_offset++; /* UMA Service Zone string, 1st character */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uma_service_zone_str, tvb, ie_offset, str_len, ENC_ASCII); break; /* 11.2.63 RTP Redundancy Configuration */ case 63: /* RTP Redundancy Configuration */ /* For each mode of the AMR Active Mode Set, as signaled in the Multi-rate Configuration IE, the window size for * including redundant frames is indicated. So if e.g. the Active Mode Set contains four active modes, then the * Redundancy Configuration IE consists of six octets, of which four indicate the Codec Mode to Window Size mapping. */ /* XXX TODO: loop ower the octets */ /* Window Size (octet 3 to octet n) Bits 2 1 */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_window_size, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* GAN A/Gb Mode Codec Mode (octet 3 to octet n) Bits 8 7 * The GAN A/Gb Mode Codec Mode is coded as in [47] sub-clause 3.4.1 */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uma_codec_mode, tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* GAN Iu Mode Codec Mode (octet 3 to octet n) Bits 6 5 4 3 */ break; case 64: /* 11.2.64 UTRAN Classmark * The rest of the IE is the INTER RAT HANDOVER INFO coded as in * [TS 25.331], not including IEI and length, if present */ new_tvb = tvb_new_subset_length(tvb, ie_offset, ie_len ); dissect_rrc_InterRATHandoverInfo_PDU(new_tvb, pinfo, urr_ie_tree, NULL); break; case 65: /* 11.2.65 Classmark Enquiry Mask * The rest of the IE is the Classmark Enquiry Mask coded as in [TS 44.018], not including IEI and length, if present */ de_rr_cm_enq_mask(tvb, urr_ie_tree, pinfo, offset, ie_len, NULL, 0); break; case 66: /* 11.2.66 UTRAN Cell Identifier List * UTRAN Cell Identification Discriminator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_UTRAN_cell_id_disc, tvb, ie_offset, 1, ENC_BIG_ENDIAN); octet = tvb_get_guint8(tvb,ie_offset); ie_offset++; if ( octet == 0 ){ ie_offset = dissect_e212_mcc_mnc(tvb, pinfo, urr_ie_tree, ie_offset, E212_NONE, TRUE); proto_tree_add_item(urr_ie_tree, hf_uma_urr_lac, tvb, ie_offset, 2, ENC_BIG_ENDIAN); /*ie_offset = ie_offset + 2;*/ /* The octets 9-12 are coded as shown in 3GPP TS 25.331, Table 'Cell identity'. * 10.3.2.2 Cell identity * This information element identifies a cell unambiguously within a PLMN. * NOTE: This information element may carry any implementation dependent identity that unambiguously identifies a * cell within a PLMN. * Cell identity - bit string(28) */ } break; case 67: /* 11.2.67 Serving GANC table indicator */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_suti, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 68: /* 11.2.68 Registration indicators */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_uma_mps, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 69: /* 11.2.69 GAN PLMN List */ octet = tvb_get_guint8(tvb,ie_offset); proto_tree_add_uint(urr_ie_tree, hf_uma_urr_num_of_plms , tvb, ie_offset, 1, octet); /* TODO insert while loop here */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_lac, tvb, ie_offset, 2, ENC_BIG_ENDIAN); break; case 70: /* 11.2.70 GERAN Received Signal Level List */ while(ie_offset<=(offset + ie_len)){ proto_tree_add_item(urr_ie_tree, hf_uma_urr_RXLEV_NCELL, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; } break; case 71: /* 11.2.71 Required GAN Services */ /* CBS Cell Broadcast Service (octet 3) */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_cbs, tvb, ie_offset, 1, ENC_BIG_ENDIAN); break; case 72: /* 11.2.72 Broadcast Container */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_num_of_cbs_frms , tvb, ie_offset, 1, ENC_BIG_ENDIAN); /* The coding of the page of the CBS message is defined in sub-clause 9.4.1 in TS 23.041. */ proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_cbs_frames, tvb, ie_offset + 1, ie_len-1); break; case 73: /* 11.2.73 3G Cell Identity */ /* The rest of the IE is coded as in [TS 25.331] not including IEI and length, if present. * See Annex F for coding */ break; case 79: /* 11.2.79 GAN Mode Indicator */ case 80: /* 11.2.80 CN Domain Identity */ case 81: /* 11.2.81 GAN Iu Mode Cell Description */ case 82: /* 11.2.82 3G UARFCN */ case 83: /* 11.2.83 RAB ID */ case 84: /* 11.2.84 RAB ID List */ case 85: /* 11.2.85 GA-RRC Establishment Cause */ case 86: /* 11.2.86 GA-RRC Cause */ case 87: /* 11.2.87 GA-RRC Paging Cause */ case 88: /* 11.2.88 Intra Domain NAS Node Selector */ case 89: /* 11.2.89 CTC Activation List */ case 90: /* 11.2.90 CTC Description */ case 91: /* 11.2.91 CTC Activation Ack List */ case 92: /* 11.2.92 CTC Activation Ack Description */ case 93: /* 11.2.93 CTC Modification List */ case 94: /* 11.2.94 CTC Modification Ack List */ case 95: /* 11.2.95 CTC Modification Ack Description */ proto_tree_add_item(urr_ie_tree, hf_uma_data, tvb, ie_offset, ie_len, ENC_NA); break; case 96: /* MS Radio Identity */ proto_tree_add_item(urr_ie_tree, hf_uma_urr_radio_type_of_id, tvb, ie_offset, 1, ENC_BIG_ENDIAN); octet = tvb_get_guint8(tvb,ie_offset); if (( octet & 0xf) == 0){ /* IEEE MAC-address format */ ie_offset++; proto_tree_add_item(urr_ie_tree, hf_uma_urr_ms_radio_id, tvb, ie_offset, ie_len-1, ENC_NA); }else{ proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_unknown_format, tvb, ie_offset, ie_len); } break; case 97: /* UNC IP Address * IP Address type */ octet = tvb_get_guint8(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_IP_Address_type, tvb, ie_offset, 1, ENC_BIG_ENDIAN); if (ie_len > 4 ) ie_offset++; if ( octet == 0x57 ){ /* IPv6 */ }else{ /* All other values shall be interpreted as Ipv4 address in this version of the protocol.*/ unc_ipv4_address = tvb_get_ipv4(tvb, ie_offset); proto_tree_add_ipv4(urr_ie_tree, hf_uma_urr_unc_ipv4, tvb, ie_offset, 4, unc_ipv4_address); } break; case 98: /* UNC Fully Qualified Domain/Host Name */ if ( ie_len > 0){ proto_tree_add_item_ret_string(urr_ie_tree, hf_uma_unc_FQDN, tvb, ie_offset, ie_len, ENC_ASCII|ENC_NA, pinfo->pool, &string); }else{ proto_tree_add_expert(urr_ie_tree, pinfo, &ei_uma_fqdn_not_present, tvb, offset, 1); } break; case 99: /* IP address for GPRS user data transport * IP Address type */ octet = tvb_get_guint8(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_IP_Address_type, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; if ( octet == 0x57 ){ /* IPv6 */ }else{ /* All other values shall be interpreted as Ipv4 address in this version of the protocol.*/ GPRS_user_data_ipv4_address = tvb_get_ipv4(tvb, ie_offset); proto_tree_add_ipv4(urr_ie_tree, hf_uma_urr_GPRS_user_data_transport_ipv4, tvb, ie_offset, 4, GPRS_user_data_ipv4_address); } break; case 100: /* UDP Port for GPRS user data transport */ GPRS_user_data_transport_UDP_port = tvb_get_ntohs(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_GPRS_port, tvb, ie_offset, 2, ENC_BIG_ENDIAN); /* * If this isn't the first time this packet has been processed, * we've already done this work, so we don't need to do it * again. */ if (pinfo->fd->visited) { break; } clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &GPRS_user_data_ipv4_address); conversation = find_conversation(pinfo->num, &dst_addr, &null_addr, CONVERSATION_UDP, GPRS_user_data_transport_UDP_port, 0, NO_ADDR_B|NO_PORT_B); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(pinfo->num, &dst_addr, &null_addr, CONVERSATION_UDP, GPRS_user_data_transport_UDP_port , 0, NO_ADDR2|NO_PORT2); /* Set dissector */ conversation_set_dissector(conversation, uma_udp_handle); } break; case 103: /* UNC TCP port */ UNC_tcp_port = tvb_get_ntohs(tvb,ie_offset); proto_tree_add_uint(urr_ie_tree, hf_uma_urr_UNC_tcp_port , tvb, ie_offset, 2, UNC_tcp_port); /* * If this isn't the first time this packet has been processed, * we've already done this work, so we don't need to do it * again. */ if (pinfo->fd->visited) { break; } clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &unc_ipv4_address); conversation = find_conversation(pinfo->num, &dst_addr, &null_addr, CONVERSATION_TCP, UNC_tcp_port, 0, NO_ADDR_B|NO_PORT_B); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(pinfo->num, &dst_addr, &null_addr, CONVERSATION_TCP, UNC_tcp_port, 0, NO_ADDR2|NO_PORT2); /* Set dissector */ conversation_set_dissector(conversation, uma_tcp_handle); } break; case 104: /* RTP UDP port */ RTP_UDP_port = tvb_get_ntohs(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_RTP_port, tvb, ie_offset, 2, ENC_BIG_ENDIAN); /* TODO find out exactly which element contains IP addr */ /* Debug proto_tree_add_debug_text(urr_ie_tree,tvb,ie_offset,ie_len,"IP %u, Port %u, rtp_ipv4_address,RTP_UDP_port); */ if(unc_ipv4_address!=0){ set_address(&src_addr, AT_IPv4, 4, &unc_ipv4_address); }else{ /* Set Source IP = own IP */ copy_address_shallow(&src_addr, &pinfo->src); } if((!pinfo->fd->visited) && RTP_UDP_port!=0){ rtp_add_address(pinfo, PT_UDP, &src_addr, RTP_UDP_port, 0, "UMA", pinfo->num, FALSE, 0); if ((RTP_UDP_port & 0x1) == 0){ /* Even number RTP port RTCP should follow on odd number */ RTCP_UDP_port = RTP_UDP_port + 1; rtcp_add_address(pinfo, &src_addr, RTCP_UDP_port, 0, "UMA", pinfo->num); } } break; case 105: /* RTCP UDP port */ RTCP_UDP_port = tvb_get_ntohs(tvb,ie_offset); proto_tree_add_item(urr_ie_tree, hf_uma_urr_RTCP_port, tvb, ie_offset, 2, ENC_BIG_ENDIAN); /* TODO find out exactly which element contains IP addr */ if((!pinfo->fd->visited) && rtcp_ipv4_address!=0 && RTCP_UDP_port!=0 && rtcp_handle){ set_address(&src_addr, AT_IPv4, 4, &rtcp_ipv4_address); rtcp_add_address(pinfo, &src_addr, RTCP_UDP_port, 0, "UMA", pinfo->num); } break; case 106: /* 11.2.70 GERAN Received Signal Level List */ while(ie_offset<=(offset + ie_len)){ proto_tree_add_item(urr_ie_tree, hf_uma_urr_RXLEV_NCELL, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; } break; case 107: /* 11.2.70 UTRAN Received Signal Level List */ while(ie_offset<=(offset + ie_len)){ proto_tree_add_item(urr_ie_tree, hf_uma_urr_RXLEV_NCELL, tvb, ie_offset, 1, ENC_BIG_ENDIAN); ie_offset++; } break; case 108: /* 11.2.74 PS Handover to GERAN Command */ case 109: /* 11.2.75 PS Handover to UTRAN Command */ case 110: /* 11.2.76 PS Handover to GERAN PSI */ case 111: /* 11.2.77 PS Handover to GERAN SI */ case 112: /* 11.2.78 TU4004 Timer */ case 115: /* 11.2.96 PTC Activation List */ case 116: /* 11.2.97 PTC Description */ case 117: /* 11.2.98 PTC Activation Ack List */ case 118: /* 11.2.99 PTC Activation Ack Description */ case 119: /* 11.2.100 PTC Modification List */ case 120: /* 11.2.101 PTC Modification Ack List */ case 121: /* 11.2.102 PTC Modification Ack Description */ case 122: /* 11.2.103 RAB Configuration */ case 123: /* 11.2.104 Multi-rate Configuration 2 */ case 124: /* 11.2.105 Selected Integrity Protection Algorithm */ case 125: /* 11.2.106 Selected Encryption Algorithm */ case 126: /* 11.2.107 CN Domains to Handover */ default: proto_tree_add_item(urr_ie_tree, hf_uma_data, tvb, ie_offset, ie_len, ENC_NA); break; } offset = offset + ie_len; return offset; } static int dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint8 octet, pd; guint16 msg_len; proto_item* pd_item; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *uma_tree; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "UMA"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_uma, tvb, 0, -1, ENC_NA); uma_tree = proto_item_add_subtree(ti, ett_uma); /* add an item to the subtree, see section 1.6 for more information */ msg_len = tvb_get_ntohs(tvb,offset); proto_tree_add_item(uma_tree, hf_uma_length_indicator, tvb, offset, 2, ENC_BIG_ENDIAN); offset = offset + 2; octet = tvb_get_guint8(tvb,offset); pd = octet & 0x0f; proto_tree_add_item(uma_tree, hf_uma_skip_ind, tvb, offset, 1, ENC_BIG_ENDIAN); if ((octet & 0xf0) != 0 ){ proto_tree_add_expert(uma_tree, pinfo, &ei_uma_skip_this_message, tvb, offset, -1); return tvb_reported_length(tvb); } pd_item = proto_tree_add_item(uma_tree, hf_uma_pd, tvb, offset, 1, ENC_BIG_ENDIAN); switch ( pd ){ case 0: /* URR_C */ case 1: /* URR */ offset++; octet = tvb_get_guint8(tvb,offset); proto_tree_add_item(uma_tree, hf_uma_urr_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext(octet, &uma_urr_msg_type_vals_ext, "Unknown URR (%u)")); while ((msg_len + 1) > offset ){ offset++; offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset); } break; case 2: /* URLC */ offset++; octet = tvb_get_guint8(tvb,offset); proto_tree_add_item(uma_tree, hf_uma_urlc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext(octet, &uma_urlc_msg_type_vals_ext, "Unknown URLC (%u)")); col_set_fence(pinfo->cinfo,COL_INFO); offset++; proto_tree_add_item(uma_tree, hf_uma_urlc_TLLI, tvb, offset, 4, ENC_NA); offset = offset + 3; while ((msg_len + 1) > offset ){ offset++; offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset); } break; default: expert_add_info(pinfo, pd_item, &ei_uma_unknown_protocol); break; } return tvb_reported_length(tvb); } static guint get_uma_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* PDU length = Message length + length of length indicator */ return tvb_get_ntohs(tvb,offset)+2; } static int dissect_uma_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { tcp_dissect_pdus(tvb, pinfo, tree, uma_desegment, UMA_HEADER_SIZE, get_uma_pdu_len, dissect_uma, data); return tvb_reported_length(tvb); } static int dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { int offset = 0; guint8 octet; guint16 msg_len; proto_item* msg_item; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *uma_tree; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "UMA"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_uma, tvb, 0, -1, ENC_NA); uma_tree = proto_item_add_subtree(ti, ett_uma); octet = tvb_get_guint8(tvb,offset); msg_item = proto_tree_add_item(uma_tree, hf_uma_urlc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str_ext(octet, &uma_urlc_msg_type_vals_ext, "Unknown URLC (%u)")); col_set_fence(pinfo->cinfo,COL_INFO); msg_len = tvb_reported_length_remaining(tvb,offset) - 1; switch ( octet ){ case 2: /* RLC UNITDATA */ case 6: /* URLC-UFC-REQ */ case 7: /* URLC-DFC-REQ only allowed message types*/ offset++; proto_tree_add_item(uma_tree, hf_uma_urlc_TLLI, tvb, offset, 4, ENC_NA); offset = offset + 4; proto_tree_add_item(uma_tree, hf_uma_urlc_seq_nr, tvb, offset, 2, ENC_NA); offset++; while (msg_len > offset){ offset++; offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset); } return offset; default: expert_add_info(pinfo, msg_item, &ei_uma_wrong_message_type); return tvb_reported_length(tvb); } } /* Register the protocol with Wireshark */ /* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and create the code that calls these routines. */ void proto_reg_handoff_uma(void) { dissector_add_for_decode_as_with_preference("udp.port", uma_udp_handle); rtcp_handle = find_dissector_add_dependency("rtcp", proto_uma); llc_handle = find_dissector_add_dependency("llcgprs", proto_uma); bssap_pdu_type_table = find_dissector_table("bssap.pdu_type"); dissector_add_uint_range_with_preference("tcp.port", DEFAULT_UMA_PORT_RANGE, uma_tcp_handle); } /* this format is require because a script is used to build the C function that calls all the protocol registration. */ void proto_register_uma(void) { module_t *uma_module; /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_uma_length_indicator, { "Length Indicator","uma.li", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_pd, { "Protocol Discriminator","uma.pd", FT_UINT8, BASE_DEC, VALS(uma_pd_vals), 0x0f, NULL, HFILL } }, { &hf_uma_skip_ind, { "Skip Indicator", "uma.skip.ind", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL } }, { &hf_uma_urr_msg_type, { "URR Message Type", "uma.urr.msg.type", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &uma_urr_msg_type_vals_ext, 0x0, NULL, HFILL } }, { &hf_uma_urlc_msg_type, { "URLC Message Type", "uma.urlc.msg.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &uma_urlc_msg_type_vals_ext, 0x0, NULL, HFILL } }, { &hf_uma_urlc_TLLI, { "Temporary Logical Link Identifier","uma.urlc.tlli", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urlc_seq_nr, { "Sequence Number","uma.urlc.seq.nr", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_IE, { "URR Information Element","uma.urr.ie.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &uma_urr_IE_type_vals_ext, 0x0, NULL, HFILL } }, { &hf_uma_urr_IE_len, { "URR Information Element length","uma.urr.ie.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_uri, { "GAN Release Indicator","uma.urr.uri", FT_UINT8, BASE_DEC, VALS(uma_urr_gan_rel_ind_vals), 0x07, "URI", HFILL } }, { &hf_uma_urr_radio_type_of_id, { "Type of identity","uma.urr.radio_type_of_id", FT_UINT8, BASE_DEC, VALS(radio_type_of_id_vals), 0x0f, NULL, HFILL } }, { &hf_uma_urr_radio_id, { "Radio Identity","uma.urr.radio_id", FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_uma_urr_cell_id, { "Cell Identity","uma.urr.cell_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_uma_urr_lac, { "Location area code","uma.urr.lac", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_gci, { "GCI, GSM Coverage Indicator","uma.urr.gci", FT_UINT8, BASE_DEC, VALS(uma_gci_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_tura, { "TURA, Type of Unlicensed Radio","uma.urr.tura", FT_UINT8,BASE_DEC, VALS(uma_tura_vals), 0xf, NULL, HFILL } }, { &hf_uma_urr_gc, { "GC, GERAN Capable","uma.urr.gc", FT_UINT8,BASE_DEC, VALS(uma_gc_vals), 0x10, NULL, HFILL } }, { &hf_uma_urr_uc, { "UC, UTRAN Capable","uma.urr.uc", FT_UINT8,BASE_DEC, VALS(uma_uc_vals), 0x20, "GC, GERAN Capable", HFILL } }, { &hf_uma_urr_rrs, { "RTP Redundancy Support(RRS)","uma.urr.rrs", FT_UINT8,BASE_DEC, VALS(uma_rrs_vals), 0x01, NULL, HFILL } }, { &hf_uma_urr_gmsi, { "GMSI, GAN Mode Support Indicator","uma.urr.gmsi", FT_UINT8,BASE_DEC, VALS(uma_gmsi_vals), 0x06, "GMSI, GAN Mode Support Indicator", HFILL } }, { &hf_uma_urr_psho, { "PS HO, PS Handover Capable","uma.urr.psho", FT_UINT8,BASE_DEC, VALS(uma_ps_ho_vals), 0x02, NULL, HFILL } }, { &hf_uma_urr_IP_Address_type, { "IP address type number value","uma.urr.ip_type", FT_UINT8,BASE_DEC, VALS(IP_address_type_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_FQDN, { "Fully Qualified Domain/Host Name (FQDN)", "uma.urr.fqdn", FT_STRING, BASE_NONE,NULL,0x0, NULL, HFILL } }, { &hf_uma_urr_sgw_ipv4, { "SGW IPv4 address","uma.urr.sgwipv4", FT_IPv4,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_redirection_counter, { "Redirection Counter","uma.urr.redirection_counter", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_dis_rej_cau, { "Discovery Reject Cause","uma.urr.dis_rej_cau", FT_UINT8,BASE_DEC, VALS(uma_discovery_reject_cause_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_ECMC, { "ECMC, Early Classmark Sending Control","uma.urr.ECMC", FT_UINT8,BASE_DEC, VALS(ECMC_vals), 0x2, NULL, HFILL } }, { &hf_uma_urr_NMO, { "NMO, Network Mode of Operation","uma.urr.NMO", FT_UINT8,BASE_DEC, VALS(NMO_vals), 0xc, NULL, HFILL } }, { &hf_uma_urr_GPRS, { "GPRS, GPRS Availability","uma.urr.GPRS", FT_UINT8,BASE_DEC, VALS(GPRS_avail_vals), 0x10, NULL, HFILL } }, { &hf_uma_urr_DTM, { "DTM, Dual Transfer Mode of Operation by network","uma.urr.dtm", FT_UINT8,BASE_DEC, VALS(DTM_vals), 0x20, NULL, HFILL } }, { &hf_uma_urr_ATT, { "ATT, Attach-detach allowed","uma.urr.att", FT_UINT8,BASE_DEC, VALS(ATT_vals), 0x40, NULL, HFILL } }, { &hf_uma_urr_MSCR, { "MSCR, MSC Release","uma.urr.mscr", FT_UINT8,BASE_DEC, VALS(MSCR_vals), 0x80, NULL, HFILL } }, { &hf_uma_urr_T3212_timer, { "T3212 Timer value(seconds)","uma.urr.t3212", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_RAC, { "Routing Area Code","uma.urr.rac", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_ap_location, { "AP Location","uma.urr.ap_location", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_SGSNR, { "SGSN Release","uma.urr.SGSNR", FT_UINT8,BASE_DEC, VALS(SGSNR_vals), 0x01, NULL, HFILL } }, { &hf_uma_urr_ECMP, { "ECMP, Emergency Call Mode Preference","uma.urr.ECMP", FT_UINT8,BASE_DEC, VALS(ECMP_vals), 0x02, NULL, HFILL } }, { &hf_uma_urr_RE, { "RE, Call reestablishment allowed","uma.urr.RE", FT_UINT8,BASE_DEC, VALS(RE_vals), 0x04, NULL, HFILL } }, { &hf_uma_urr_PFCFM, { "PFCFM, PFC_FEATURE_MODE","uma.urr.PFCFM", FT_UINT8,BASE_DEC, VALS(PFCFM_vals), 0x08, NULL, HFILL } }, { &hf_uma_urr_3GECS, { "3GECS, 3G Early Classmark Sending Restriction","uma.urr.3GECS", FT_UINT8,BASE_DEC, VALS(Three_GECS_vals), 0x10, NULL, HFILL } }, { &hf_uma_urr_TU3907_timer, { "TU3907 Timer value(seconds)","uma.urr.tu3907", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_GSM_RR_state, { "GSM RR State value","uma.urr.gsmrrstate", FT_UINT8,BASE_DEC|BASE_EXT_STRING, &uma_GRS_GSM_RR_State_vals_ext, 0x7, NULL, HFILL } }, { &hf_uma_urr_gan_band, { "UMA Band","uma.urr.umaband", FT_UINT8,BASE_DEC|BASE_EXT_STRING, &uma_gan_band_vals_ext, 0x0f, NULL, HFILL } }, { &hf_uma_urr_URR_state, { "URR State","uma.urr.state", FT_UINT8,BASE_DEC, VALS(URR_state_vals), 0x03, NULL, HFILL } }, { &hf_uma_urr_register_reject_cause, { "Register Reject Cause","uma.urr.reg_rej_cau", FT_UINT8,BASE_DEC|BASE_EXT_STRING, &register_reject_cause_vals_ext, 0x0, NULL, HFILL } }, { &hf_uma_urr_TU3906_timer, { "TU3906 Timer value(seconds)","uma.urr.tu3906", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_TU3910_timer, { "TU3910 Timer value(seconds)","uma.urr.tu3910", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_TU3902_timer, { "TU3902 Timer value(seconds)","uma.urr.tu3902", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_communication_port, { "Communication Port","uma.urr.communication_port", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_L3_Message, { "L3 message contents","uma.urr.l3", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_L3_protocol_discriminator, { "Protocol discriminator","uma.urr.L3_protocol_discriminator", FT_UINT8,BASE_DEC, VALS(protocol_discriminator_vals), 0x0f, NULL, HFILL } }, { &hf_uma_urr_GPRS_resumption, { "GPRS resumption ACK","uma.urr.GPRS_resumption", FT_UINT8,BASE_DEC, VALS(GPRS_resumption_vals), 0x1, NULL, HFILL } }, { &hf_uma_urr_ULQI, { "ULQI, UL Quality Indication","uma.urr.ULQI", FT_UINT8,BASE_DEC, VALS(uma_ulqi_vals), 0x0f, NULL, HFILL } }, { &hf_uma_urr_TU3920_timer, { "TU3920 Timer value(seconds)","uma.urr.tu3920", FT_UINT16,BASE_DEC, NULL, 0x0, "TU3920 Timer value(hundreds of of ms)", HFILL } }, { &hf_uma_urr_peak_tpt_cls, { "PEAK_THROUGHPUT_CLASS","uma.urr.peak_tpt_cls", FT_UINT8,BASE_DEC, NULL, 0x0f, NULL, HFILL } }, { &hf_uma_urr_radio_pri, { "Radio Priority","uma.urr.radio_pri", FT_UINT8,BASE_DEC, VALS(radio_pri_vals), 0x30, "RADIO_PRIORITY", HFILL } }, { &hf_uma_urr_rlc_mode, { "RLC mode","uma.urr.rrlc_mode", FT_UINT8,BASE_DEC, VALS(rlc_mode_vals), 0x80, NULL, HFILL } }, { &hf_uma_urr_ga_psr_cause, { "GA-PSR Cause","uma.urr.ga_psr_cause", FT_UINT8,BASE_DEC|BASE_EXT_STRING, &uma_ga_psr_cause_vals_ext, 0x0, NULL, HFILL } }, { &hf_uma_urr_udr, { "User Data Rate value (bits/s)","uma.urr.URLCcause", FT_UINT32,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_TU4001_timer, { "TU4001 Timer value(seconds)","uma.urr.tu4001", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_LS, { "Location Status(LS)","uma.urr.LS", FT_UINT8,BASE_DEC, VALS(LS_vals), 0x3, NULL, HFILL } }, { &hf_uma_urr_cipher_res, { "Cipher Response(CR)","uma.urr.CR", FT_UINT8,BASE_DEC, VALS(CR_vals), 0x3, NULL, HFILL } }, { &hf_uma_urr_rand_val, { "Ciphering Command RAND value","uma.rand_val", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_ciphering_command_mac, { "Ciphering Command MAC (Message Authentication Code)","uma.ciphering_command_mac", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_ciphering_key_seq_num, { "Values for the ciphering key","uma.ciphering_key_seq_num", FT_UINT8,BASE_DEC, NULL, 0x7, NULL, HFILL } }, { &hf_uma_urr_sapi_id, { "SAPI ID","uma.sapi_id", FT_UINT8,BASE_DEC, VALS(sapi_id_vals), 0x7, NULL, HFILL } }, { &hf_uma_urr_establishment_cause, { "Establishment Cause","uma.urr.establishment_cause", FT_UINT8,BASE_DEC|BASE_EXT_STRING, &uma_establishment_cause_val_ext, 0x0, NULL, HFILL } }, { &hf_uma_urr_channel, { "Channel","uma.urr.channel", FT_UINT8,BASE_DEC, VALS(channel_vals), 0x3, NULL, HFILL } }, { &hf_uma_urr_PDU_in_error, { "PDU in Error,","uma.urr.PDU_in_error", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_sample_size, { "Sample Size","uma.urr.sample_size", FT_UINT8,BASE_DEC, VALS(sample_size_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_payload_type, { "Payload Type","uma.urr.payload_type", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_LLC_PDU, { "LLC-PDU","uma.urr.llc_pdu", FT_BYTES,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_LBLI, { "LBLI, Location Black List indicator","uma.urr.LBLI", FT_UINT8,BASE_DEC, VALS(LBLI_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_RI, { "Reset Indicator(RI)","uma.urr.RI", FT_UINT8,BASE_DEC, VALS(RI_vals), 0x1, NULL, HFILL } }, { &hf_uma_urr_TU4003_timer, { "TU4003 Timer value(seconds)","uma.urr.tu4003", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_ap_service_name_type, { "AP Service Name type","uma.urr.ap_service_name_type", FT_UINT8,BASE_DEC, VALS(ap_service_name_type_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_ap_Service_name_value, { "AP Service Name Value","uma.urr.ap_service_name_value", FT_STRING,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_uma_service_zone_icon_ind, { "UMA Service Zone Icon Indicator","uma.urr.uma_service_zone_icon_ind", FT_UINT8,BASE_DEC, VALS(uma_service_zone_icon_ind_vals), 0x0, NULL, HFILL } }, { &hf_uma_urr_uma_service_zone_str_len, { "Length of UMA Service Zone string","uma.urr.service_zone_str_len", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_window_size, { "Window Size","uma.urr.uma_window_size", FT_UINT8,BASE_DEC, VALS(window_size_vals), 0x03, NULL, HFILL } }, { &hf_uma_urr_uma_codec_mode, { "GAN A/Gb Mode Codec Mode","uma.urr.uma_codec_mode", FT_UINT8,BASE_DEC, NULL, 0xc0, NULL, HFILL } }, { &hf_uma_urr_UTRAN_cell_id_disc, { "UTRAN Cell Identification Discriminator","uma.urr.uma_UTRAN_cell_id_disc", FT_UINT8,BASE_DEC, VALS(UTRAN_cell_id_disc_vals), 0x0f, NULL, HFILL } }, { &hf_uma_urr_suti, { "SUTI, Serving GANC table indicator","uma.urr.uma_suti", FT_UINT8,BASE_DEC, VALS(suti_vals), 0x01, NULL, HFILL } }, { &hf_uma_urr_uma_mps, { "UMPS, Manual PLMN Selection indicator","uma.urr.mps", FT_UINT8,BASE_DEC, VALS(mps_vals), 0x3, "MPS, Manual PLMN Selection indicator", HFILL } }, { &hf_uma_urr_num_of_plms, { "Number of PLMN:s","uma.urr.num_of_plms", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_cbs, { "CBS Cell Broadcast Service","uma.urr.cbs", FT_UINT8,BASE_DEC, VALS(cbs_vals), 0x01, NULL, HFILL } }, { &hf_uma_urr_num_of_cbs_frms, { "Number of CBS Frames","uma.urr.num_of_cbs_frms", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_ms_radio_id, { "MS Radio Identity","uma.urr.ms_radio_id", FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_uma_urr_uma_service_zone_str, { "UMA Service Zone string,","uma.urr.uma_service_zone_str", FT_STRING,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_unc_ipv4, { "UNC IPv4 address","uma.urr.uncipv4", FT_IPv4,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_unc_FQDN, { "UNC Fully Qualified Domain/Host Name (FQDN)", "uma.urr.unc_fqdn", FT_STRING, BASE_NONE,NULL,0x0, NULL, HFILL } }, { &hf_uma_urr_GPRS_user_data_transport_ipv4, { "IP address for GPRS user data transport","uma.urr.gprs_usr_data_ipv4", FT_IPv4,BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_GPRS_port, { "UDP Port for GPRS user data transport","uma.urr.gprs_port", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_UNC_tcp_port, { "UNC TCP port","uma.urr.tcp_port", FT_UINT16,BASE_DEC, NULL, 0x0, "UDP Port for GPRS user data transport", HFILL } }, { &hf_uma_urr_RTP_port, { "RTP UDP port","uma.urr.rtp_port", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_RTCP_port, { "RTCP UDP port","uma.urr.rtcp_port", FT_UINT16,BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_uma_urr_RXLEV_NCELL, { "RX Level","uma.urr.rxlevel", FT_UINT8,BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_uma_access_control_class_n, { "Access Control Class N", "uma.access_control_class_n", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_uma_data, { "DATA", "uma.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_uma, &ett_uma_toc, &ett_urr_ie, }; static ei_register_info ei[] = { /* Generated from convert_proto_tree_add_text.pl */ { &ei_uma_unknown_format, { "uma.unknown_format", PI_PROTOCOL, PI_WARN, "Unknown format", EXPFILL }}, { &ei_uma_fqdn_not_present, { "uma.fqdn_not_present", PI_PROTOCOL, PI_NOTE, "FQDN not present", EXPFILL }}, { &ei_uma_cbs_frames, { "uma.cbs_frames", PI_UNDECODED, PI_WARN, "CBS Frames - Not decoded", EXPFILL }}, { &ei_uma_skip_this_message, { "uma.skip_this_message", PI_PROTOCOL, PI_NOTE, "Skip this message", EXPFILL }}, { &ei_uma_unknown_protocol, { "uma.unknown_protocol", PI_PROTOCOL, PI_WARN, "Unknown protocol", EXPFILL }}, { &ei_uma_wrong_message_type, { "uma.wrong_message_type", PI_PROTOCOL, PI_WARN, "Wrong message type", EXPFILL }}, }; expert_module_t *expert_uma; /* Register the protocol name and description */ proto_uma = proto_register_protocol("Unlicensed Mobile Access","UMA", "uma"); /* subdissector code */ uma_tcp_handle = register_dissector("umatcp", dissect_uma_tcp, proto_uma); uma_udp_handle = register_dissector("umaudp", dissect_uma_urlc_udp, proto_uma); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_uma, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_uma = expert_register_protocol(proto_uma); expert_register_field_array(expert_uma, ei, array_length(ei)); /* Register a configuration option for port */ uma_module = prefs_register_protocol(proto_uma, NULL); prefs_register_bool_preference(uma_module, "desegment_ucp_messages", "Reassemble UMA messages spanning multiple TCP segments", "Whether the UMA dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &uma_desegment); prefs_register_obsolete_preference(uma_module, "tcp.port1"); prefs_register_obsolete_preference(uma_module, "udp.ports"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-umts_fp.c
/* packet-umts_fp.c * Routines for UMTS FP disassembly * * Martin Mathieson * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/conversation.h> #include <epan/proto_data.h> #include <wsutil/crc7.h> /* For FP data header and control frame CRC. */ #include <wsutil/crc16-plain.h> /* For FP Payload CRC. */ #include <wsutil/crc11.h> /* For FP EDCH header CRC. */ #include <wsutil/pint.h> #include "packet-umts_fp.h" #include "packet-nbap.h" #include "packet-rrc.h" /* The Frame Protocol (FP) is described in: * 3GPP TS 25.427 (for dedicated channels) * 3GPP TS 25.435 (for common/shared channels) * * TODO: * - IUR interface-specific formats * - do CRC verification before further parsing * - Set the logical channel properly for non multiplexed, channels * for channels that doesn't have the C/T field! This should be based * on the RRC message RadioBearerSetup. * - E-DCH T2 heuristic dissector */ void proto_register_fp(void); void proto_reg_handoff_fp(void); /* Initialize the protocol and registered fields. */ int proto_fp = -1; extern int proto_umts_mac; extern int proto_umts_rlc; static int hf_fp_release = -1; static int hf_fp_release_version = -1; static int hf_fp_release_year = -1; static int hf_fp_release_month = -1; static int hf_fp_channel_type = -1; static int hf_fp_division = -1; static int hf_fp_direction = -1; static int hf_fp_ddi_config = -1; static int hf_fp_ddi_config_ddi = -1; static int hf_fp_ddi_config_macd_pdu_size = -1; static int hf_fp_header_crc = -1; static int hf_fp_ft = -1; static int hf_fp_cfn = -1; static int hf_fp_pch_cfn = -1; static int hf_fp_pch_toa = -1; static int hf_fp_cfn_control = -1; static int hf_fp_toa = -1; static int hf_fp_tfi = -1; static int hf_fp_usch_tfi = -1; static int hf_fp_cpch_tfi = -1; static int hf_fp_propagation_delay = -1; static int hf_fp_tb = -1; static int hf_fp_chan_zero_tbs = -1; static int hf_fp_received_sync_ul_timing_deviation = -1; static int hf_fp_pch_pi = -1; static int hf_fp_pch_tfi = -1; static int hf_fp_fach_tfi = -1; static int hf_fp_transmit_power_level = -1; static int hf_fp_paging_indication_bitmap = -1; static int hf_fp_relevant_paging_indication_bitmap = -1; static int hf_fp_pdsch_set_id = -1; static int hf_fp_rx_timing_deviation = -1; static int hf_fp_dch_e_rucch_flag = -1; static int hf_fp_dch_control_frame_type = -1; static int hf_fp_dch_rx_timing_deviation = -1; static int hf_fp_quality_estimate = -1; static int hf_fp_payload_crc = -1; static int hf_fp_payload_crc_status = -1; static int hf_fp_edch_header_crc = -1; static int hf_fp_edch_fsn = -1; static int hf_fp_edch_subframe = -1; static int hf_fp_edch_number_of_subframes = -1; static int hf_fp_edch_harq_retransmissions = -1; static int hf_fp_edch_subframe_number = -1; static int hf_fp_edch_number_of_mac_es_pdus = -1; static int hf_fp_edch_ddi = -1; static int hf_fp_edch_subframe_header = -1; static int hf_fp_edch_number_of_mac_d_pdus = -1; static int hf_fp_edch_pdu_padding = -1; static int hf_fp_edch_tsn = -1; static int hf_fp_edch_mac_es_pdu = -1; static int hf_fp_edch_user_buffer_size = -1; static int hf_fp_edch_no_macid_sdus = -1; static int hf_fp_edch_number_of_mac_is_pdus = -1; static int hf_fp_edch_mac_is_pdu = -1; static int hf_fp_edch_e_rnti = -1; static int hf_fp_edch_macis_descriptors = -1; static int hf_fp_edch_macis_lchid = -1; static int hf_fp_edch_macis_length = -1; static int hf_fp_edch_macis_flag = -1; static int hf_fp_edch_entity = -1; static int hf_fp_frame_seq_nr = -1; static int hf_fp_hsdsch_pdu_block_header = -1; /* static int hf_fp_hsdsch_pdu_block = -1; */ static int hf_fp_flush = -1; static int hf_fp_fsn_drt_reset = -1; static int hf_fp_drt_indicator = -1; static int hf_fp_fach_indicator = -1; static int hf_fp_total_pdu_blocks = -1; static int hf_fp_drt = -1; static int hf_fp_hrnti = -1; static int hf_fp_rach_measurement_result = -1; static int hf_fp_lchid = -1; static int hf_fp_pdu_length_in_block = -1; static int hf_fp_pdus_in_block = -1; static int hf_fp_cmch_pi = -1; static int hf_fp_user_buffer_size = -1; static int hf_fp_hsdsch_credits = -1; static int hf_fp_hsdsch_max_macd_pdu_len = -1; static int hf_fp_hsdsch_max_macdc_pdu_len = -1; static int hf_fp_hsdsch_interval = -1; static int hf_fp_hsdsch_calculated_rate = -1; static int hf_fp_hsdsch_unlimited_rate = -1; static int hf_fp_hsdsch_repetition_period = -1; static int hf_fp_hsdsch_data_padding = -1; static int hf_fp_hsdsch_new_ie_flags = -1; static int hf_fp_hsdsch_new_ie_flag[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int hf_fp_hsdsch_drt = -1; static int hf_fp_hsdsch_entity = -1; static int hf_fp_hsdsch_physical_layer_category = -1; static int hf_fp_timing_advance = -1; static int hf_fp_num_of_pdu = -1; static int hf_fp_mac_d_pdu_len = -1; static int hf_fp_mac_d_pdu = -1; static int hf_fp_data = -1; static int hf_fp_crcis = -1; static int hf_fp_crci[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int hf_fp_common_control_frame_type = -1; static int hf_fp_t1 = -1; static int hf_fp_t2 = -1; static int hf_fp_t3 = -1; static int hf_fp_ul_sir_target = -1; static int hf_fp_pusch_set_id = -1; static int hf_fp_activation_cfn = -1; static int hf_fp_duration = -1; static int hf_fp_power_offset = -1; static int hf_fp_code_number = -1; static int hf_fp_spreading_factor = -1; static int hf_fp_mc_info = -1; static int hf_fp_rach_new_ie_flags = -1; static int hf_fp_rach_new_ie_flag_unused[7] = {-1, -1, -1, -1, -1, -1, -1 }; static int hf_fp_rach_ext_propagation_delay_present = -1; static int hf_fp_rach_cell_portion_id_present = -1; static int hf_fp_rach_angle_of_arrival_present = -1; static int hf_fp_rach_ext_rx_sync_ul_timing_deviation_present = -1; static int hf_fp_rach_ext_rx_timing_deviation_present = -1; static int hf_fp_cell_portion_id = -1; static int hf_fp_ext_propagation_delay = -1; static int hf_fp_angle_of_arrival = -1; static int hf_fp_ext_received_sync_ul_timing_deviation = -1; static int hf_fp_radio_interface_parameter_update_flag[5] = {-1, -1, -1, -1, -1}; static int hf_fp_dpc_mode = -1; static int hf_fp_tpc_po = -1; static int hf_fp_multiple_rl_set_indicator = -1; static int hf_fp_max_ue_tx_pow = -1; static int hf_fp_congestion_status = -1; static int hf_fp_e_rucch_present = -1; static int hf_fp_extended_bits_present = -1; static int hf_fp_extended_bits = -1; static int hf_fp_spare_extension = -1; static int hf_fp_ul_setup_frame = -1; static int hf_fp_dl_setup_frame = -1; static int hf_fp_relevant_pi_frame = -1; /* Subtrees. */ static int ett_fp = -1; static int ett_fp_release = -1; static int ett_fp_data = -1; static int ett_fp_crcis = -1; static int ett_fp_ddi_config = -1; static int ett_fp_edch_subframe_header = -1; static int ett_fp_edch_subframe = -1; static int ett_fp_edch_maces = -1; static int ett_fp_edch_macis_descriptors = -1; static int ett_fp_hsdsch_new_ie_flags = -1; static int ett_fp_rach_new_ie_flags = -1; static int ett_fp_hsdsch_pdu_block_header = -1; static int ett_fp_pch_relevant_pi = -1; static expert_field ei_fp_hsdsch_common_experimental_support = EI_INIT; static expert_field ei_fp_hsdsch_common_t3_not_implemented = EI_INIT; static expert_field ei_fp_channel_type_unknown = EI_INIT; static expert_field ei_fp_ddi_not_defined = EI_INIT; static expert_field ei_fp_stop_hsdpa_transmission = EI_INIT; static expert_field ei_fp_hsdsch_entity_not_specified = EI_INIT; static expert_field ei_fp_expecting_tdd = EI_INIT; static expert_field ei_fp_bad_payload_checksum = EI_INIT; static expert_field ei_fp_e_rnti_t2_edch_frames = EI_INIT; static expert_field ei_fp_crci_no_subdissector = EI_INIT; static expert_field ei_fp_timing_adjustmentment_reported = EI_INIT; static expert_field ei_fp_mac_is_sdus_miscount = EI_INIT; static expert_field ei_fp_maybe_srb = EI_INIT; static expert_field ei_fp_transport_channel_type_unknown = EI_INIT; static expert_field ei_fp_pch_lost_relevant_pi_frame = EI_INIT; static expert_field ei_fp_unable_to_locate_ddi_entry = EI_INIT; static expert_field ei_fp_e_rnti_first_entry = EI_INIT; static expert_field ei_fp_bad_header_checksum = EI_INIT; static expert_field ei_fp_crci_error_bit_set_for_tb = EI_INIT; static expert_field ei_fp_spare_extension = EI_INIT; static expert_field ei_fp_no_per_frame_info = EI_INIT; static expert_field ei_fp_no_per_conv_channel_info = EI_INIT; static expert_field ei_fp_invalid_frame_count = EI_INIT; static dissector_handle_t rlc_bcch_handle; static dissector_handle_t mac_fdd_dch_handle; static dissector_handle_t mac_fdd_rach_handle; static dissector_handle_t mac_fdd_fach_handle; static dissector_handle_t mac_fdd_pch_handle; static dissector_handle_t mac_fdd_edch_handle; static dissector_handle_t mac_fdd_edch_type2_handle; static dissector_handle_t mac_fdd_hsdsch_handle; static dissector_handle_t fp_handle; static proto_tree *top_level_tree = NULL; /* Variables used for preferences */ static gboolean preferences_call_mac_dissectors = TRUE; static gboolean preferences_show_release_info = TRUE; static gboolean preferences_payload_checksum = TRUE; static gboolean preferences_header_checksum = TRUE; static gboolean preferences_track_paging_indications = TRUE; /* E-DCH (T1) channel header information */ struct edch_t1_subframe_info { guint8 subframe_number; guint8 number_of_mac_es_pdus; guint8 ddi[64]; guint16 number_of_mac_d_pdus[64]; }; /* E-DCH (T2) channel header information */ struct edch_t2_subframe_info { guint8 subframe_number; guint8 number_of_mac_is_pdus; guint8 number_of_mac_is_sdus[16]; guint8 mac_is_lchid[16][16]; guint16 mac_is_length[16][16]; }; static const value_string channel_type_vals[] = { { CHANNEL_RACH_FDD, "RACH_FDD" }, { CHANNEL_RACH_TDD, "RACH_TDD" }, { CHANNEL_FACH_FDD, "FACH_FDD" }, { CHANNEL_FACH_TDD, "FACH_TDD" }, { CHANNEL_DSCH_FDD, "DSCH_FDD" }, { CHANNEL_DSCH_TDD, "DSCH_TDD" }, { CHANNEL_USCH_TDD_384, "USCH_TDD_384" }, { CHANNEL_USCH_TDD_128, "USCH_TDD_128" }, { CHANNEL_PCH, "PCH" }, { CHANNEL_CPCH, "CPCH" }, { CHANNEL_BCH, "BCH" }, { CHANNEL_DCH, "DCH" }, { CHANNEL_HSDSCH, "HSDSCH" }, { CHANNEL_IUR_CPCHF, "IUR CPCHF" }, { CHANNEL_IUR_FACH, "IUR FACH" }, { CHANNEL_IUR_DSCH, "IUR DSCH" }, { CHANNEL_EDCH, "EDCH" }, { CHANNEL_RACH_TDD_128, "RACH_TDD_128" }, { CHANNEL_HSDSCH_COMMON, "HSDSCH-COMMON" }, { CHANNEL_HSDSCH_COMMON_T3, "HSDSCH-COMMON-T3" }, { CHANNEL_EDCH_COMMON, "EDCH-COMMON"}, { 0, NULL } }; static const value_string division_vals[] = { { Division_FDD, "FDD"}, { Division_TDD_384, "TDD-384"}, { Division_TDD_128, "TDD-128"}, { Division_TDD_768, "TDD-768"}, { 0, NULL } }; /* Frame Type (ft) values */ #define FT_DATA 0 #define FT_CONTROL 1 static const value_string frame_type_vals[] = { { FT_DATA, "Data" }, { FT_CONTROL, "Control" }, { 0, NULL } }; static const value_string crci_vals[] = { { 0, "Correct" }, { 1, "Not correct" }, { 0, NULL } }; static const value_string paging_indication_vals[] = { { 0, "no PI-bitmap in payload" }, { 1, "PI-bitmap in payload" }, { 0, NULL } }; static const value_string spreading_factor_vals[] = { { 0, "4"}, { 1, "8"}, { 2, "16"}, { 3, "32"}, { 4, "64"}, { 5, "128"}, { 6, "256"}, { 0, NULL } }; static const value_string congestion_status_vals[] = { { 0, "No TNL congestion"}, { 1, "Reserved for future use"}, { 2, "TNL congestion - detected by delay build-up"}, { 3, "TNL congestion - detected by frame loss"}, { 0, NULL } }; static const value_string e_rucch_flag_vals[] = { { 0, "Conventional E-RUCCH reception" }, { 1, "TA Request reception" }, { 0, NULL } }; static const value_string hsdshc_mac_entity_vals[] = { { entity_not_specified, "Unspecified (assume MAC-hs)" }, { hs, "MAC-hs" }, { ehs, "MAC-ehs" }, { 0, NULL } }; static const value_string edch_mac_entity_vals[] = { { 0, "MAC-e/es" }, { 1, "MAC-i/is" }, { 0, NULL } }; static const value_string lchid_vals[] = { { 0, "Logical Channel 1" }, { 1, "Logical Channel 2" }, { 2, "Logical Channel 3" }, { 3, "Logical Channel 4" }, { 4, "Logical Channel 5" }, { 5, "Logical Channel 6" }, { 6, "Logical Channel 7" }, { 7, "Logical Channel 8" }, { 8, "Logical Channel 9" }, { 9, "Logical Channel 10" }, { 10, "Logical Channel 11" }, { 11, "Logical Channel 12" }, { 12, "Logical Channel 13" }, { 13, "Logical Channel 14" }, { 14, "CCCH (SRB0)" }, { 15, "E-RNTI being included (FDD only)" }, { 0, NULL } }; /* Dedicated control types */ #define DCH_OUTER_LOOP_POWER_CONTROL 1 #define DCH_TIMING_ADJUSTMENT 2 #define DCH_DL_SYNCHRONISATION 3 #define DCH_UL_SYNCHRONISATION 4 #define DCH_DL_NODE_SYNCHRONISATION 6 #define DCH_UL_NODE_SYNCHRONISATION 7 #define DCH_RX_TIMING_DEVIATION 8 #define DCH_RADIO_INTERFACE_PARAMETER_UPDATE 9 #define DCH_TIMING_ADVANCE 10 #define DCH_TNL_CONGESTION_INDICATION 11 static const value_string dch_control_frame_type_vals[] = { { DCH_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" }, { DCH_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" }, { DCH_DL_SYNCHRONISATION, "DL SYNCHRONISATION" }, { DCH_UL_SYNCHRONISATION, "UL SYNCHRONISATION" }, { 5, "Reserved Value" }, { DCH_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" }, { DCH_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" }, { DCH_RX_TIMING_DEVIATION, "RX TIMING DEVIATION" }, { DCH_RADIO_INTERFACE_PARAMETER_UPDATE, "RADIO INTERFACE PARAMETER UPDATE" }, { DCH_TIMING_ADVANCE, "TIMING ADVANCE" }, { DCH_TNL_CONGESTION_INDICATION, "TNL CONGESTION INDICATION" }, { 0, NULL } }; /* Common channel control types */ #define COMMON_OUTER_LOOP_POWER_CONTROL 1 #define COMMON_TIMING_ADJUSTMENT 2 #define COMMON_DL_SYNCHRONISATION 3 #define COMMON_UL_SYNCHRONISATION 4 #define COMMON_DL_NODE_SYNCHRONISATION 6 #define COMMON_UL_NODE_SYNCHRONISATION 7 #define COMMON_DYNAMIC_PUSCH_ASSIGNMENT 8 #define COMMON_TIMING_ADVANCE 9 #define COMMON_HS_DSCH_Capacity_Request 10 #define COMMON_HS_DSCH_Capacity_Allocation 11 #define COMMON_HS_DSCH_Capacity_Allocation_Type_2 12 static const value_string common_control_frame_type_vals[] = { { COMMON_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" }, { COMMON_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" }, { COMMON_DL_SYNCHRONISATION, "DL SYNCHRONISATION" }, { COMMON_UL_SYNCHRONISATION, "UL SYNCHRONISATION" }, { 5, "Reserved Value" }, { COMMON_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" }, { COMMON_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" }, { COMMON_DYNAMIC_PUSCH_ASSIGNMENT, "DYNAMIC PUSCH ASSIGNMENT" }, { COMMON_TIMING_ADVANCE, "TIMING ADVANCE" }, { COMMON_HS_DSCH_Capacity_Request, "HS-DSCH Capacity Request" }, { COMMON_HS_DSCH_Capacity_Allocation, "HS-DSCH Capacity Allocation" }, { COMMON_HS_DSCH_Capacity_Allocation_Type_2, "HS-DSCH Capacity Allocation Type 2" }, { 0, NULL } }; /* 0 to 7*/ static const guint8 hsdsch_macdflow_id_rlc_map[] = { RLC_UM, /*0 SRB */ RLC_AM, /*1 Interactive PS*/ RLC_AM, /*2 Interatcive PS*/ RLC_UNKNOWN_MODE, /*3 ???*/ RLC_AM, /*4 Streaming PS*/ RLC_UNKNOWN_MODE, RLC_UNKNOWN_MODE, RLC_UNKNOWN_MODE }; /* Mapping hsdsch MACd-FlowId to MAC_CONTENT, basically flowid = 1 (0) => SRB*/ /* 1 to 8*/ static const guint8 hsdsch_macdflow_id_mac_content_map[] = { MAC_CONTENT_DCCH, /*1 SRB */ MAC_CONTENT_PS_DTCH, /*2 Interactive PS*/ MAC_CONTENT_PS_DTCH, /*3 Interatcive PS*/ RLC_UNKNOWN_MODE, /*4 ???*/ MAC_CONTENT_PS_DTCH, /*5 Streaming PS*/ RLC_UNKNOWN_MODE, RLC_UNKNOWN_MODE, RLC_UNKNOWN_MODE }; /* Make fake logical channel id's based on MACdFlow-ID's, * XXXX Bug 12121 expanded the number of entries to 8(+2), * not at all sure what the proper value should be 0xfF? */ static const guint8 fake_lchid_macd_flow[] = {1,9,14,11,0,12,0,0}; /* Dissect message parts */ static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, dissector_handle_t *data_handle, void *data); static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 length, guint16 number_of_pdus, struct fp_info *p_fp_info, void *data); static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 length, guint16 number_of_pdus, struct fp_info * fpi, void *data); static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, fp_info *p_fp_info, int offset); static void dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 dch_crc_present, int offset, guint header_length); /* Dissect common control messages */ static int dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_common_dl_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_common_ul_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); static void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static int dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset); /* Dissect common channel types */ static void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); static void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); static void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); static void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static void dissect_bch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info); static void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); static void dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); static void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); /* Dissect DCH control messages */ static int dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static int dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); static int dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset); static void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info); /* Dissect a DCH channel */ static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data); /* Dissect dedicated channels */ static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, gboolean is_common, void *data); static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, int number_of_subframes, gboolean is_common, guint16 header_crc, proto_item * header_crc_pi, void *data); /* Main dissection function */ static int dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data); /* * CRNC sends data downlink on uplink parameters. */ void set_umts_fp_conv_data(conversation_t *conversation, umts_fp_conversation_info_t *umts_fp_conversation_info) { if (conversation == NULL) { return; } conversation_add_proto_data(conversation, proto_fp, umts_fp_conversation_info); } static int get_tb_count(struct fp_info *p_fp_info) { int chan, tb_count = 0; for (chan = 0; chan < p_fp_info->num_chans; chan++) { tb_count += p_fp_info->chan_num_tbs[chan]; } return tb_count; } static gboolean verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 frame_crc) { guint8 crc = 0; guint8 * data = NULL; /* Get data. */ data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb)); /* Include only FT flag bit in CRC calculation. */ data[0] = data[0] & 1; /* Calculate crc7 sum. */ crc = crc7update(0, data, tvb_reported_length(tvb)); crc = crc7finalize(crc); /* finalize crc */ if (frame_crc == crc) { proto_item_append_text(pi, " [correct]"); return TRUE; } else { proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc); expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum); return FALSE; } } static gboolean verify_header_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 header_crc, guint header_length) { guint8 crc = 0; guint8 * data = NULL; /* Get data of header with first byte removed. */ data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1); /* Calculate crc7 sum. */ crc = crc7update(0, data, header_length-1); crc = crc7finalize(crc); /* finalize crc */ if (header_crc == crc) { proto_item_append_text(pi, " [correct]"); return TRUE; } else { proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc); expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum); return FALSE; } } static gboolean verify_header_crc_edch(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 header_crc, guint header_length) { guint16 crc = 0; guint8 * data = NULL; /* First create new subset of header with first byte removed. */ tvbuff_t * headtvb = tvb_new_subset_length(tvb, 1, header_length-1); /* Get data of header with first byte removed. */ data = (guint8 *)tvb_memdup(wmem_packet_scope(), headtvb, 0, header_length-1); /* Remove first 4 bits of the remaining data which are Header CRC cont. */ data[0] = data[0] & 0x0f; crc = crc11_307_noreflect_noxor(data, header_length-1); if (header_crc == crc) { proto_item_append_text(pi, " [correct]"); return TRUE; } else { proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc); expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum); return FALSE; } } /* Dissect the TBs of a UL data frame*/ static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, dissector_handle_t *data_handle, void *data) { int chan, num_tbs = 0; int bit_offset = 0; int crci_bit_offset = (offset+1)<<3; /* Current offset + Quality estimate of 1 byte at the end*/ guint data_bits = 0; guint8 crci_bit = 0; proto_item *tree_ti = NULL; proto_tree *data_tree = NULL; gboolean dissected = FALSE; /* Add data subtree */ tree_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA); proto_item_set_text(tree_ti, "TB data for %u chans", p_fp_info->num_chans); data_tree = proto_item_add_subtree(tree_ti, ett_fp_data); if (p_fp_info->num_chans >= MAX_MAC_FRAMES) { expert_add_info_format(pinfo, data_tree, &ei_fp_invalid_frame_count, "Invalid Number of channels (max is %u)", MAX_MAC_FRAMES); return offset; } /* Calculate offset to CRCI bits */ if (p_fp_info->is_uplink) { for (chan=0; chan < p_fp_info->num_chans; chan++) { int n; for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) { /* Advance bit offset */ crci_bit_offset += p_fp_info->chan_tf_size[chan]; /* Pad out to next byte */ if (crci_bit_offset % 8) { crci_bit_offset += (8 - (crci_bit_offset % 8)); } } } } /* Now for the TB data */ for (chan=0; chan < p_fp_info->num_chans; chan++) { int n; p_fp_info->cur_chan = chan; /*Set current channel?*/ /* Clearly show channels with no TBs */ if (p_fp_info->chan_num_tbs[chan] == 0) { proto_item *no_tb_ti = proto_tree_add_uint(data_tree, hf_fp_chan_zero_tbs, tvb, offset+(bit_offset/8), 0, chan+1); proto_item_append_text(no_tb_ti, " (of size %d)", p_fp_info->chan_tf_size[chan]); proto_item_set_generated(no_tb_ti); } /* Show TBs from non-empty channels */ pinfo->fd->subnum = chan; /* set subframe number to current TB */ for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) { proto_item *ti; p_fp_info->cur_tb = chan; /*Set current transport block?*/ if (data_tree) { ti = proto_tree_add_item(data_tree, hf_fp_tb, tvb, offset + (bit_offset/8), ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8, ENC_NA); proto_item_set_text(ti, "TB (chan %u, tb %u, %u bits)", chan+1, n+1, p_fp_info->chan_tf_size[chan]); } if (preferences_call_mac_dissectors && data_handle && (p_fp_info->chan_tf_size[chan] > 0)) { tvbuff_t *next_tvb; proto_item *item; /* If this is DL we should not care about crci bits (since they don't exists)*/ if (p_fp_info->is_uplink) { if ( p_fp_info->channel == CHANNEL_RACH_FDD) { /*In RACH we don't have any QE field, hence go back 8 bits.*/ crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n-8, 1); item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n-8)/8, 1, ENC_BIG_ENDIAN); proto_item_set_generated(item); } else { crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n, 1); item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n)/8, 1, ENC_BIG_ENDIAN); proto_item_set_generated(item); } } if (crci_bit == 0 || !p_fp_info->is_uplink) { next_tvb = tvb_new_subset_length(tvb, offset + bit_offset/8, ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8); /****************/ /* TODO: maybe this decision can be based only on info available in fp_info */ call_dissector_with_data(*data_handle, next_tvb, pinfo, top_level_tree, data); dissected = TRUE; } else { proto_tree_add_expert(tree, pinfo, &ei_fp_crci_no_subdissector, tvb, offset + bit_offset/8, ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8); } } num_tbs++; /* Advance bit offset */ bit_offset += p_fp_info->chan_tf_size[chan]; data_bits += p_fp_info->chan_tf_size[chan]; /* Pad out to next byte */ if (bit_offset % 8) { bit_offset += (8 - (bit_offset % 8)); } } } if (dissected == FALSE) { col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)", data_bits, num_tbs); } /* Data tree should cover entire length */ if (data_tree) { proto_item_set_len(tree_ti, bit_offset/8); proto_item_append_text(tree_ti, " (%u bits in %u tbs)", data_bits, num_tbs); } /* Move offset past TBs (we know it's already padded out to next byte) */ offset += (bit_offset / 8); return offset; } /* Dissect the MAC-d PDUs of an HS-DSCH (type 1) frame. Length is in bits, and payload is offset by 4 bits of padding */ static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 length, guint16 number_of_pdus, struct fp_info *p_fp_info, void *data) { int pdu; int bit_offset = 0; proto_item *pdus_ti = NULL; proto_tree *data_tree = NULL; gboolean dissected = FALSE; /* Add data subtree */ pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA); proto_item_set_text(pdus_ti, "%u MAC-d PDUs of %u bits", number_of_pdus, length); data_tree = proto_item_add_subtree(pdus_ti, ett_fp_data); if (number_of_pdus >= MAX_MAC_FRAMES) { expert_add_info_format(pinfo, data_tree, &ei_fp_invalid_frame_count, "Invalid number_of_pdus (max is %u)", MAX_MAC_FRAMES); return offset; } /* Now for the PDUs */ for (pdu=0; pdu < number_of_pdus; pdu++) { proto_item *pdu_ti; if (data_tree) { /* Show 4 bits padding at start of PDU */ proto_tree_add_item(data_tree, hf_fp_hsdsch_data_padding, tvb, offset+(bit_offset/8), 1, ENC_BIG_ENDIAN); } bit_offset += 4; /* Data bytes! */ if (data_tree) { pdu_ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb, offset + (bit_offset/8), ((bit_offset % 8) + length + 7) / 8, ENC_NA); proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1); } pinfo->fd->subnum = pdu; /* set subframe number to current TB */ p_fp_info->cur_tb = pdu; /*Set TB (PDU) index correctly*/ if (preferences_call_mac_dissectors) { tvbuff_t *next_tvb; next_tvb = tvb_new_subset_length_caplen(tvb, offset + bit_offset/8, ((bit_offset % 8) + length + 7)/8, -1); call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data); dissected = TRUE; } /* Advance bit offset */ bit_offset += length; /* Pad out to next byte */ if (bit_offset % 8) { bit_offset += (8 - (bit_offset % 8)); } } /* Data tree should cover entire length */ proto_item_set_len(pdus_ti, bit_offset/8); /* Move offset past PDUs (we know it's already padded out to next byte) */ offset += (bit_offset / 8); /* Show summary in info column */ if (dissected == FALSE) { col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits", number_of_pdus, length); } return offset; } /* Dissect the MAC-d PDUs of an HS-DSCH (type 2) frame. Length is in bytes, and payload is byte-aligned (no padding) */ static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint16 length, guint16 number_of_pdus, struct fp_info *fpi, void *data) { int pdu; proto_item *pdus_ti = NULL; proto_tree *data_tree = NULL; int first_offset = offset; gboolean dissected = FALSE; /* Add data subtree */ pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA); proto_item_set_text(pdus_ti, "%u MAC-d PDUs of %u bytes", number_of_pdus, length); data_tree = proto_item_add_subtree(pdus_ti, ett_fp_data); if (number_of_pdus >= MAX_MAC_FRAMES) { expert_add_info_format(pinfo, data_tree, &ei_fp_invalid_frame_count, "Invalid number_of_pdus (max is %u)", MAX_MAC_FRAMES); return offset; } /* Now for the PDUs */ for (pdu=0; pdu < number_of_pdus; pdu++) { proto_item *pdu_ti; /* Data bytes! */ if (data_tree) { pdu_ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb, offset, length, ENC_NA); proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1); } if (preferences_call_mac_dissectors) { tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, length); fpi->cur_tb = pdu; /*Set proper pdu index for MAC and higher layers*/ pinfo->fd->subnum = pdu; call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data); dissected = TRUE; } /* Advance offset */ offset += length; } /* Data tree should cover entire length */ proto_item_set_len(pdus_ti, offset-first_offset); /* Show summary in info column */ if (!dissected) { col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits", number_of_pdus, length*8); } return offset; } /* Dissect CRCI bits (uplink) */ static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, fp_info *p_fp_info, int offset) { int n, num_tbs; proto_item *ti = NULL; proto_tree *crcis_tree = NULL; guint errors = 0; num_tbs = get_tb_count(p_fp_info); /* Add CRCIs subtree */ if (tree) { ti = proto_tree_add_item(tree, hf_fp_crcis, tvb, offset, (num_tbs+7)/8, ENC_NA); proto_item_set_text(ti, "CRCI bits for %u tbs", num_tbs); crcis_tree = proto_item_add_subtree(ti, ett_fp_crcis); } /* CRCIs */ for (n=0; n < num_tbs; n++) { int bit = (tvb_get_guint8(tvb, offset+(n/8)) >> (7-(n%8))) & 0x01; proto_tree_add_item(crcis_tree, hf_fp_crci[n%8], tvb, offset+(n/8), 1, ENC_BIG_ENDIAN); if (bit == 1) { errors++; expert_add_info(pinfo, ti, &ei_fp_crci_error_bit_set_for_tb); } } if (tree) { /* Highlight range of bytes covered by indicator bits */ proto_item_set_len(ti, (num_tbs+7) / 8); /* Show error count in root text */ proto_item_append_text(ti, " (%u errors)", errors); } offset += ((num_tbs+7) / 8); return offset; } static void dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 dch_crc_present, int offset, guint header_length) { int crc_size = 0; int remain = tvb_reported_length_remaining(tvb, offset); /* Payload CRC (optional) */ if ((dch_crc_present == 1) || ((dch_crc_present == 2) && (remain >= 2))) { crc_size = 2; } if (remain > crc_size) { proto_item *ti; ti = proto_tree_add_item(tree, hf_fp_spare_extension, tvb, offset, remain-crc_size, ENC_NA); proto_item_append_text(ti, " (%u octets)", remain-crc_size); expert_add_info_format(pinfo, ti, &ei_fp_spare_extension, "Spare Extension present (%u bytes)", remain-crc_size); offset += remain-crc_size; } if (crc_size) { guint flags = PROTO_CHECKSUM_NO_FLAGS; guint16 calc_crc = 0; if (preferences_payload_checksum) { flags = PROTO_CHECKSUM_VERIFY; if ((guint)offset > header_length) { guint8 * data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, header_length, offset-header_length); calc_crc = crc16_8005_noreflect_noxor(data, offset-header_length); } } if ((guint)offset == header_length && remain == 0) { /* 3GPP TS 25.427 and TS 25.435: "The Payload CRC IE may * only be present if the frame contains payload" (even * if defined as present at the setup of the transport bearer.) * If there's room for the CRC and no payload, assume zero, * otherwise, assume it's absent. */ flags = PROTO_CHECKSUM_NOT_PRESENT; } proto_tree_add_checksum(tree, tvb, offset, hf_fp_payload_crc, hf_fp_payload_crc_status, &ei_fp_bad_payload_checksum, pinfo, calc_crc, ENC_BIG_ENDIAN, flags); } } /***********************************************************/ /* Common control message types */ static int dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info _U_) { return dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset); } static int dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { gint32 toa; proto_item *toa_ti; if (p_fp_info->channel != CHANNEL_PCH) { guint32 cfn; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* ToA */ toa = tvb_get_ntohis(tvb, offset); toa_ti = proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa); } else { guint32 cfn; /* PCH CFN is 12 bits */ proto_tree_add_item_ret_uint(tree, hf_fp_pch_cfn, tvb, offset, 2, ENC_BIG_ENDIAN, &cfn); offset += 2; /* 4 bits of padding follow... */ /* 20 bits of ToA (followed by 4 padding bits) */ toa = ((int)(tvb_get_ntoh24(tvb, offset) << 8)) / 4096; toa_ti = proto_tree_add_int(tree, hf_fp_pch_toa, tvb, offset, 3, toa); offset += 3; col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa); } expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustmentment_reported, "Timing adjustmentment reported (%.3f ms)", ((float)(toa) / 8)); return offset; } static int dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { /* T1 (3 bytes) */ guint32 encoded = tvb_get_ntoh24(tvb, offset); float t1 = encoded * (float)0.125; proto_tree_add_float_format_value(tree, hf_fp_t1, tvb, offset, 3, t1, "%.3f ms (%u)", t1, encoded); offset += 3; col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%.3f", t1); return offset; } static int dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { guint32 encoded; float t1, t2, t3; /* T1 (3 bytes) */ encoded = tvb_get_ntoh24(tvb, offset); t1 = encoded * (float)0.125; proto_tree_add_float_format_value(tree, hf_fp_t1, tvb, offset, 3, t1, "%.3f ms (%u)", t1, encoded); offset += 3; /* T2 (3 bytes) */ encoded = tvb_get_ntoh24(tvb, offset); t2 = encoded * (float)0.125; proto_tree_add_float_format_value(tree, hf_fp_t2, tvb, offset, 3, t2, "%.3f ms (%u)", t2, encoded); offset += 3; /* T3 (3 bytes) */ encoded = tvb_get_ntoh24(tvb, offset); t3 = encoded * (float)0.125; proto_tree_add_float_format_value(tree, hf_fp_t3, tvb, offset, 3, t3, "%.3f ms (%u)", t3, encoded); offset += 3; col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%.3f T2=%.3f, T3=%.3f", t1, t2, t3); return offset; } static int dissect_common_dl_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { guint32 cfn; if (p_fp_info->channel != CHANNEL_PCH) { /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; } else { /* PCH CFN is 12 bits */ proto_tree_add_item_ret_uint(tree, hf_fp_pch_cfn, tvb, offset, 2, ENC_BIG_ENDIAN, &cfn); /* 4 bits of padding follow... */ offset += 2; } col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u", cfn); return offset; } static int dissect_common_ul_synchronisation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { return dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info); } static int dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { guint32 cfn; guint16 timing_advance; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* Timing Advance */ timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4; proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, TA = %u", cfn, timing_advance); return offset; } static int dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { guint8 priority; guint16 user_buffer_size; /* CmCH-PI */ priority = (tvb_get_guint8(tvb, offset) & 0x0f); proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* User buffer size */ user_buffer_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " CmCH-PI=%u User-Buffer-Size=%u", priority, user_buffer_size); return offset; } static int dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { proto_item *ti; proto_item *rate_ti; guint16 max_pdu_length; guint8 repetition_period; guint8 interval; guint64 credits; /* Congestion status (introduced sometime during R6...) */ if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) { proto_tree_add_bits_item(tree, hf_fp_congestion_status, tvb, offset*8 + 2, 2, ENC_BIG_ENDIAN); } /* CmCH-PI */ proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Max MAC-d PDU length (13 bits) */ max_pdu_length = tvb_get_ntohs(tvb, offset) >> 3; proto_tree_add_item(tree, hf_fp_hsdsch_max_macd_pdu_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset++; /* HS-DSCH credits (11 bits) */ ti = proto_tree_add_bits_ret_val(tree, hf_fp_hsdsch_credits, tvb, offset*8 + 5, 11, &credits, ENC_BIG_ENDIAN); offset += 2; /* Interesting values */ if (credits == 0) { proto_item_append_text(ti, " (stop transmission)"); expert_add_info(pinfo, ti, &ei_fp_stop_hsdpa_transmission); } if (credits == 2047) { proto_item_append_text(ti, " (unlimited)"); } /* HS-DSCH Interval */ interval = tvb_get_guint8(tvb, offset); ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10); offset++; if (interval == 0) { proto_item_append_text(ti, " (none of the credits shall be used)"); } /* HS-DSCH Repetition period */ repetition_period = tvb_get_guint8(tvb, offset); ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (repetition_period == 0) { proto_item_append_text(ti, " (unlimited repetition period)"); } /* Calculated and show effective rate enabled */ if (credits == 2047) { rate_ti = proto_tree_add_item(tree, hf_fp_hsdsch_unlimited_rate, tvb, 0, 0, ENC_NA); proto_item_set_generated(rate_ti); } else { if (interval != 0) { /* Cast on credits is safe, since we know it won't exceed 10^11 */ rate_ti = proto_tree_add_uint(tree, hf_fp_hsdsch_calculated_rate, tvb, 0, 0, (guint16)credits * max_pdu_length * (1000 / (interval*10))); proto_item_set_generated(rate_ti); } } col_append_fstr(pinfo->cinfo, COL_INFO, " Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u", max_pdu_length, (guint16)credits, interval, repetition_period); return offset; } static int dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *ti; proto_item *rate_ti; guint16 max_pdu_length; guint8 repetition_period; guint8 interval; guint16 credits; /* Congestion status */ proto_tree_add_bits_item(tree, hf_fp_congestion_status, tvb, offset*8 + 2, 2, ENC_BIG_ENDIAN); /* CmCH-PI */ proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* 5 spare bits follow here */ /* Max MAC-d/c PDU length (11 bits) */ max_pdu_length = tvb_get_ntohs(tvb, offset) & 0x7ff; proto_tree_add_item(tree, hf_fp_hsdsch_max_macdc_pdu_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* HS-DSCH credits (16 bits) */ credits = (tvb_get_ntohs(tvb, offset)); ti = proto_tree_add_uint(tree, hf_fp_hsdsch_credits, tvb, offset, 2, credits); offset += 2; /* Interesting values */ if (credits == 0) { proto_item_append_text(ti, " (stop transmission)"); expert_add_info(pinfo, ti, &ei_fp_stop_hsdpa_transmission); } if (credits == 65535) { proto_item_append_text(ti, " (unlimited)"); } /* HS-DSCH Interval */ interval = tvb_get_guint8(tvb, offset); ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10); offset++; if (interval == 0) { proto_item_append_text(ti, " (none of the credits shall be used)"); } /* HS-DSCH Repetition period */ repetition_period = tvb_get_guint8(tvb, offset); ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (repetition_period == 0) { proto_item_append_text(ti, " (unlimited repetition period)"); } /* Calculated and show effective rate enabled */ if (credits == 65535) { rate_ti = proto_tree_add_item(tree, hf_fp_hsdsch_unlimited_rate, tvb, 0, 0, ENC_NA); proto_item_set_generated(rate_ti); } else { if (interval != 0) { rate_ti = proto_tree_add_uint(tree, hf_fp_hsdsch_calculated_rate, tvb, 0, 0, credits * max_pdu_length * (1000 / (interval*10))); proto_item_set_generated(rate_ti); } } col_append_fstr(pinfo->cinfo, COL_INFO, " Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u", max_pdu_length, credits, interval, repetition_period); return offset; } static int dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { guint8 pusch_set_id; guint8 activation_cfn; guint8 duration; /* PUSCH Set Id */ pusch_set_id = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_pusch_set_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Activation CFN */ activation_cfn = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_activation_cfn, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Duration */ duration = tvb_get_guint8(tvb, offset) * 10; proto_tree_add_uint(tree, hf_fp_duration, tvb, offset, 1, duration); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " PUSCH Set Id=%u Activation CFN=%u Duration=%u", pusch_set_id, activation_cfn, duration); return offset; } /* Dissect the control part of a common channel message */ static void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { /* Common control frame type */ guint8 control_frame_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_common_control_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(control_frame_type, common_control_frame_type_vals, "Unknown")); /* Frame-type specific dissection */ switch (control_frame_type) { case COMMON_OUTER_LOOP_POWER_CONTROL: /*offset =*/ dissect_common_outer_loop_power_control(pinfo, tree, tvb, offset, p_fp_info); break; case COMMON_TIMING_ADJUSTMENT: /*offset =*/ dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info); break; case COMMON_DL_SYNCHRONISATION: /*offset =*/ dissect_common_dl_synchronisation(pinfo, tree, tvb, offset, p_fp_info); break; case COMMON_UL_SYNCHRONISATION: /*offset =*/ dissect_common_ul_synchronisation(pinfo, tree, tvb, offset, p_fp_info); break; case COMMON_DL_NODE_SYNCHRONISATION: /*offset =*/ dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset); break; case COMMON_UL_NODE_SYNCHRONISATION: /*offset =*/ dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset); break; case COMMON_DYNAMIC_PUSCH_ASSIGNMENT: /*offset =*/ dissect_common_dynamic_pusch_assignment(pinfo, tree, tvb, offset); break; case COMMON_TIMING_ADVANCE: /*offset =*/ dissect_common_timing_advance(pinfo, tree, tvb, offset); break; case COMMON_HS_DSCH_Capacity_Request: /*offset =*/ dissect_hsdpa_capacity_request(pinfo, tree, tvb, offset); break; case COMMON_HS_DSCH_Capacity_Allocation: /*offset =*/ dissect_hsdpa_capacity_allocation(pinfo, tree, tvb, offset, p_fp_info); break; case COMMON_HS_DSCH_Capacity_Allocation_Type_2: /*offset =*/ dissect_hsdpa_capacity_allocation_type_2(pinfo, tree, tvb, offset); break; default: break; } /* There is no Spare Extension nor payload crc in common control!? */ /* dissect_spare_extension_and_crc(tvb, pinfo, tree, 0, offset); */ } /**************************/ /* Dissect a RACH channel */ static void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; guint header_length; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint8 cfn; guint32 encoded; guint32 propagation_delay = 0; proto_item *propagation_delay_ti = NULL; guint32 received_sync_ul_timing_deviation = 0; proto_item *received_sync_ul_timing_deviation_ti = NULL; proto_item *rx_timing_deviation_ti = NULL; guint16 rx_timing_deviation = 0; /* DATA */ /* CFN */ cfn = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* TFI */ proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (p_fp_info->channel == CHANNEL_RACH_FDD) { /* Propagation delay */ encoded = tvb_get_guint8(tvb, offset); propagation_delay = encoded * 3; propagation_delay_ti = proto_tree_add_uint_format(tree, hf_fp_propagation_delay, tvb, offset, 1, propagation_delay, "Propagation Delay: %u chips (%u)", propagation_delay, encoded); offset++; } /* Should be TDD 3.84 or 7.68 */ if (p_fp_info->channel == CHANNEL_RACH_TDD) { /* Rx Timing Deviation */ rx_timing_deviation = tvb_get_guint8(tvb, offset); rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } if (p_fp_info->channel == CHANNEL_RACH_TDD_128) { /* Received SYNC UL Timing Deviation */ received_sync_ul_timing_deviation = tvb_get_guint8(tvb, offset); received_sync_ul_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_received_sync_ul_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } header_length = offset; /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_rach_handle, data); /* CRCIs */ offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset); /* Info introduced in R6 */ /* only check if it looks as if they are present */ if (((p_fp_info->release == 6) || (p_fp_info->release == 7)) && (tvb_reported_length_remaining(tvb, offset) > 2)) { int n; guint8 flags; /* guint8 flag_bytes = 0; */ gboolean cell_portion_id_present = FALSE; gboolean ext_propagation_delay_present = FALSE; gboolean angle_of_arrival_present = FALSE; gboolean ext_rx_sync_ul_timing_deviation_present = FALSE; gboolean ext_rx_timing_deviation_present = FALSE; /* New IE flags (assume mandatory for now) */ do { proto_item *new_ie_flags_ti; proto_tree *new_ie_flags_tree; guint ies_found = 0; /* Add new IE flags subtree */ new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_rach_new_ie_flags, tvb, offset, 1, "", "New IE flags"); new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_rach_new_ie_flags); /* Read next byte */ flags = tvb_get_guint8(tvb, offset); /* flag_bytes++ */ /* Dissect individual bits */ for (n=0; n < 8; n++) { switch (n) { case 6: switch (p_fp_info->division) { case Division_FDD: /* Ext propagation delay */ ext_propagation_delay_present = TRUE; proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_propagation_delay_present, tvb, offset, 1, ENC_BIG_ENDIAN); break; case Division_TDD_128: /* Ext Rx Sync UL Timing */ ext_rx_sync_ul_timing_deviation_present = TRUE; proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_sync_ul_timing_deviation_present, tvb, offset, 1, ENC_BIG_ENDIAN); break; default: /* Not defined */ proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_new_ie_flag_unused[6], tvb, offset, 1, ENC_BIG_ENDIAN); break; } break; case 7: switch (p_fp_info->division) { case Division_FDD: /* Cell Portion ID */ cell_portion_id_present = TRUE; proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_cell_portion_id_present, tvb, offset, 1, ENC_BIG_ENDIAN); break; case Division_TDD_128: /* AOA */ angle_of_arrival_present = TRUE; proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_angle_of_arrival_present, tvb, offset, 1, ENC_BIG_ENDIAN); break; case Division_TDD_384: case Division_TDD_768: /* Extended Rx Timing Deviation */ ext_rx_timing_deviation_present = TRUE; proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_timing_deviation_present, tvb, offset, 1, ENC_BIG_ENDIAN); break; } break; default: /* No defined meanings */ /* Visual Studio Code Analyzer wrongly thinks n can be 7 here. It can't */ proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_new_ie_flag_unused[n], tvb, offset, 1, ENC_BIG_ENDIAN); break; } if ((flags >> (7-n)) & 0x01) { ies_found++; } } offset++; proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found); /* Last bit set will indicate another flags byte follows... */ } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/ /* Cell Portion ID */ if (cell_portion_id_present) { proto_tree_add_item(tree, hf_fp_cell_portion_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } /* Ext Rx Timing Deviation */ if (ext_rx_timing_deviation_present) { guint8 extra_bits; guint bits_to_extend; switch (p_fp_info->division) { case Division_TDD_384: bits_to_extend = 1; break; case Division_TDD_768: bits_to_extend = 2; break; default: /* TODO: report unexpected division type */ bits_to_extend = 1; break; } extra_bits = tvb_get_guint8(tvb, offset) & ((bits_to_extend == 1) ? 0x01 : 0x03); rx_timing_deviation = (extra_bits << 8) | (rx_timing_deviation); proto_item_append_text(rx_timing_deviation_ti, " (extended to 0x%x)", rx_timing_deviation); proto_tree_add_bits_item(tree, hf_fp_extended_bits, tvb, offset*8 + (8-bits_to_extend), bits_to_extend, ENC_BIG_ENDIAN); offset++; } /* Ext propagation delay. */ if (ext_propagation_delay_present) { guint16 extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff; proto_tree_add_item(tree, hf_fp_ext_propagation_delay, tvb, offset, 2, ENC_BIG_ENDIAN); /* Adding 10 bits to original 8 */ proto_item_append_text(propagation_delay_ti, " (extended to %u)", ((extra_bits << 8) | propagation_delay) * 3); offset += 2; } /* Angle of Arrival (AOA) */ if (angle_of_arrival_present) { proto_tree_add_item(tree, hf_fp_angle_of_arrival, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } /* Ext. Rx Sync UL Timing Deviation */ if (ext_rx_sync_ul_timing_deviation_present) { guint16 extra_bits; /* Ext received Sync UL Timing Deviation */ extra_bits = tvb_get_ntohs(tvb, offset) & 0x1fff; proto_tree_add_item(tree, hf_fp_ext_received_sync_ul_timing_deviation, tvb, offset, 2, ENC_BIG_ENDIAN); /* Adding 13 bits to original 8 */ proto_item_append_text(received_sync_ul_timing_deviation_ti, " (extended to %u)", (extra_bits << 8) | received_sync_ul_timing_deviation); offset += 2; } } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a FACH channel */ static void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; guint header_length; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint8 cfn; /* DATA */ /* CFN */ cfn = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* TFI */ proto_tree_add_item(tree, hf_fp_fach_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Transmit power level */ proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1, (float)(int)(tvb_get_guint8(tvb, offset)) / 10); offset++; header_length = offset; /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_fach_handle, data); /* New IE flags (if it looks as though they are present) */ if ((p_fp_info->release == 7) && (tvb_reported_length_remaining(tvb, offset) > 2)) { guint8 flags = tvb_get_guint8(tvb, offset); guint8 aoa_present = flags & 0x01; offset++; if (aoa_present) { proto_tree_add_item(tree, hf_fp_angle_of_arrival, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a DSCH channel */ static void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { guint32 ft; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); } else { guint32 cfn; guint header_length = 0; /* DATA */ /* CFN */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* TFI */ proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Other fields depend upon release & FDD/TDD settings */ if (((p_fp_info->release == 99) || (p_fp_info->release == 4)) && (p_fp_info->channel == CHANNEL_DSCH_FDD)) { /* Power offset */ proto_tree_add_float(tree, hf_fp_power_offset, tvb, offset, 1, (float)(-32.0) + ((float)(int)(tvb_get_guint8(tvb, offset)) * (float)(0.25))); offset++; /* Code number */ proto_tree_add_item(tree, hf_fp_code_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Spreading Factor (3 bits) */ proto_tree_add_item(tree, hf_fp_spreading_factor, tvb, offset, 1, ENC_BIG_ENDIAN); /* MC info (4 bits)*/ proto_tree_add_item(tree, hf_fp_mc_info, tvb, offset, 1, ENC_BIG_ENDIAN); /* Last bit of this byte is spare */ offset++; } else { /* Normal case */ /* PDSCH Set Id */ proto_tree_add_item(tree, hf_fp_pdsch_set_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Transmit power level */ proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1, (float)(int)(tvb_get_guint8(tvb, offset)) / 10); offset++; } header_length = offset; /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL, NULL); /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a USCH channel */ static void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { guint32 ft; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); } else { guint cfn; guint16 rx_timing_deviation; proto_item *rx_timing_deviation_ti; guint header_length = 0; /* DATA */ /* CFN */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* TFI */ proto_tree_add_item(tree, hf_fp_usch_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Rx Timing Deviation */ rx_timing_deviation = tvb_get_guint8(tvb, offset); rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; header_length = offset; /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL, NULL); /* QE */ proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* CRCIs */ offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset); /* New IEs */ if ((p_fp_info->release == 7) && (tvb_reported_length_remaining(tvb, offset) > 2)) { guint8 flags = tvb_get_guint8(tvb, offset); guint8 bits_extended = flags & 0x01; offset++; if (bits_extended) { guint8 extra_bits = tvb_get_guint8(tvb, offset) & 0x03; proto_item_append_text(rx_timing_deviation_ti, " (extended to %u)", (rx_timing_deviation << 2) | extra_bits); } offset++; } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a PCH channel */ static void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint16 pch_cfn; guint32 tfi; gboolean paging_indication; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint header_length = 0; /* DATA */ /* 12-bit CFN value */ proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, ENC_BIG_ENDIAN); pch_cfn = (tvb_get_ntohs(tvb, offset) & 0xfff0) >> 4; offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%04u ", pch_cfn); /* Paging indication */ proto_tree_add_item(tree, hf_fp_pch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); paging_indication = tvb_get_guint8(tvb, offset) & 0x01; offset++; /* 5-bit TFI */ proto_tree_add_item_ret_uint(tree, hf_fp_pch_tfi, tvb, offset, 1, ENC_BIG_ENDIAN, &tfi); offset++; header_length = offset; /* Optional paging indications */ if (paging_indication) { proto_item *ti; ti = proto_tree_add_item(tree, hf_fp_paging_indication_bitmap, tvb, offset, (p_fp_info->paging_indications+7) / 8, ENC_NA); proto_item_append_text(ti, " (%u bits)", p_fp_info->paging_indications); if(preferences_track_paging_indications && !PINFO_FD_VISITED(pinfo)){ paging_indications_info_t* current_pi_info; current_pi_info = wmem_new0(wmem_file_scope(), paging_indications_info_t); current_pi_info->frame_number = pinfo->num; current_pi_info->paging_indications_bitmap = (guint8*)tvb_memdup(wmem_file_scope(), tvb, offset, (p_fp_info->paging_indications+7) / 8); p_fp_info->current_paging_indications = current_pi_info; } offset += ((p_fp_info->paging_indications+7) / 8); } if(preferences_track_paging_indications) { if(p_fp_info->relevant_paging_indications) { /*If tracking PI is enabled and PI info (from the last packet) is attached, show on tree*/ proto_item *ti; proto_tree *relevant_pi_tree; tvbuff_t *pi_tvb; pi_tvb = tvb_new_child_real_data(tvb, p_fp_info->relevant_paging_indications->paging_indications_bitmap, (p_fp_info->paging_indications+7) / 8, (p_fp_info->paging_indications+7) / 8); add_new_data_source(pinfo, pi_tvb, "Relevant Paging Indication"); ti = proto_tree_add_item(tree, hf_fp_relevant_paging_indication_bitmap, pi_tvb, 0, (p_fp_info->paging_indications+7) / 8, ENC_NA); proto_item_append_text(ti, " (%u bits)", p_fp_info->paging_indications); proto_item_set_generated(ti); relevant_pi_tree = proto_item_add_subtree(ti, ett_fp_pch_relevant_pi); ti = proto_tree_add_uint(relevant_pi_tree, hf_fp_relevant_pi_frame, tvb, 0, 0, p_fp_info->relevant_paging_indications->frame_number); proto_item_set_generated(ti); } else { /* PI info not attached. Check if this frame has any Transport Blocks (i.e. RRC payloads) */ if(tfi > 0) { /* This frame has RRC payload(s) but the PI info is missing, report to the user*/ proto_tree_add_expert(tree, pinfo, &ei_fp_pch_lost_relevant_pi_frame, tvb, offset, -1); } } } /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_pch_handle, data); if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a CPCH channel */ static void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { guint32 ft; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); } else { guint cfn; guint32 encoded; guint header_length = 0; guint32 propagation_delay = 0; /* DATA */ /* CFN */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* TFI */ proto_tree_add_item(tree, hf_fp_cpch_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Propagation delay */ encoded = tvb_get_guint8(tvb, offset); propagation_delay = encoded * 3; proto_tree_add_uint_format_value(tree, hf_fp_propagation_delay, tvb, offset, 1, propagation_delay, "Propagation Delay: %u chips (%u)", propagation_delay, encoded); offset++; header_length = offset; /* XXX this might be wrong */ /* TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL, NULL); /* CRCIs */ offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset); /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /**************************/ /* Dissect a BCH channel */ static void dissect_bch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { guint32 ft; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); } } /********************************/ /* Dissect an IUR DSCH channel */ static void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info) { guint32 ft; /* Header CRC */ proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); } else { /* TODO: DATA */ } } /************************/ /* DCH control messages */ static int dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { guint32 cfn; gint16 toa; proto_item *toa_ti; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* ToA */ toa = tvb_get_ntohs(tvb, offset); toa_ti = proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustmentment_reported, "Timing adjustmentment reported (%.3f ms)", ((float)(toa) / 8)); col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, ToA = %d", cfn, toa); return offset; } static int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { guint16 timing_deviation; gint timing_deviation_chips; proto_item *timing_deviation_ti; /* CFN control */ proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Rx Timing Deviation */ timing_deviation = tvb_get_guint8(tvb, offset); timing_deviation_ti = proto_tree_add_item(tree, hf_fp_dch_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* May be extended in R7, but in this case there are at least 2 bytes remaining */ if ((p_fp_info->release == 7) && (tvb_reported_length_remaining(tvb, offset) >= 2)) { /* New IE flags */ guint64 extended_bits_present; guint64 e_rucch_present; /* Read flags */ proto_tree_add_bits_ret_val(tree, hf_fp_e_rucch_present, tvb, offset*8 + 6, 1, &e_rucch_present, ENC_BIG_ENDIAN); proto_tree_add_bits_ret_val(tree, hf_fp_extended_bits_present, tvb, offset*8 + 7, 1, &extended_bits_present, ENC_BIG_ENDIAN); offset++; /* Optional E-RUCCH */ if (e_rucch_present) { /* Value of bit_offset depends upon division type */ int bit_offset; switch (p_fp_info->division) { case Division_TDD_384: bit_offset = 6; break; case Division_TDD_768: bit_offset = 5; break; default: { proto_tree_add_expert(tree, pinfo, &ei_fp_expecting_tdd, tvb, 0, 0); bit_offset = 6; } } proto_tree_add_item(tree, hf_fp_dch_e_rucch_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tree, hf_fp_dch_e_rucch_flag, tvb, offset*8 + bit_offset, 1, ENC_BIG_ENDIAN); } /* Timing deviation may be extended by another: - 1 bits (3.84 TDD) OR - 2 bits (7.68 TDD) */ if (extended_bits_present) { guint8 extra_bits; guint bits_to_extend; switch (p_fp_info->division) { case Division_TDD_384: bits_to_extend = 1; break; case Division_TDD_768: bits_to_extend = 2; break; default: /* TODO: report unexpected division type */ bits_to_extend = 1; break; } extra_bits = tvb_get_guint8(tvb, offset) & ((bits_to_extend == 1) ? 0x01 : 0x03); timing_deviation = (extra_bits << 8) | (timing_deviation); proto_item_append_text(timing_deviation_ti, " (extended to 0x%x)", timing_deviation); proto_tree_add_bits_item(tree, hf_fp_extended_bits, tvb, offset*8 + (8-bits_to_extend), bits_to_extend, ENC_BIG_ENDIAN); offset++; } } timing_deviation_chips = (timing_deviation*4) - 1024; proto_item_append_text(timing_deviation_ti, " (%d chips)", timing_deviation_chips); col_append_fstr(pinfo->cinfo, COL_INFO, " deviation = %u (%d chips)", timing_deviation, timing_deviation_chips); return offset; } static int dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { guint32 cfn; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u", cfn); return offset; } static int dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { guint32 cfn; gint16 toa; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* ToA */ toa = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, ToA = %d", cfn, toa); return offset; } static int dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { /* UL SIR target */ guint8 encoded = tvb_get_guint8(tvb, offset); float target = (float)-8.2 + ((float)0.1 * (float)(int)(encoded)); proto_tree_add_float_format_value(tree, hf_fp_ul_sir_target, tvb, offset, 1, target, "%.1f dB (%u)", target, encoded); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " UL SIR Target = %.1f", target); return offset; } static int dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { return dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset); } static int dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { return dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset); } static int dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { float tpc_po; gint8 max_tx_pwr; int n; guint8 encoded; /* Show defined flags in these 2 bytes */ for (n=4; n >= 0; n--) { proto_tree_add_item(tree, hf_fp_radio_interface_parameter_update_flag[n], tvb, offset, 2, ENC_BIG_ENDIAN); } offset += 2; /* CFN */ proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* DPC mode */ proto_tree_add_item(tree, hf_fp_dpc_mode, tvb, offset, 1, ENC_BIG_ENDIAN); /* TPC PO */ encoded = tvb_get_guint8(tvb, offset) & 0x1f; tpc_po = (float)encoded * 0.25f; proto_tree_add_float_format_value(tree, hf_fp_tpc_po, tvb, offset, 1, tpc_po, "%.2f dB (%u)", tpc_po, encoded); offset++; /* Multiple RL sets indicator */ proto_tree_add_item(tree, hf_fp_multiple_rl_set_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 2; /* Maximum UE TX Power */ encoded = tvb_get_guint8(tvb, offset) & 0x7f; max_tx_pwr = -55 + encoded; proto_tree_add_int_format(tree, hf_fp_max_ue_tx_pow, tvb, offset, 1, max_tx_pwr, "%d dBm (%u)", max_tx_pwr, encoded); offset++; return offset; } static int dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { guint32 cfn; guint16 timing_advance; proto_item *timing_advance_ti; /* CFN control */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* Timing Advance */ timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4; timing_advance_ti = proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance); offset++; if ((p_fp_info->release == 7) && (tvb_reported_length_remaining(tvb, offset) > 0)) { /* New IE flags */ guint8 flags = tvb_get_guint8(tvb, offset); guint8 extended_bits = flags & 0x01; offset++; if (extended_bits) { guint8 extra_bit = tvb_get_guint8(tvb, offset) & 0x01; proto_item_append_text(timing_advance_ti, " (extended to %u)", (timing_advance << 1) | extra_bit); } offset++; } col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, TA = %u", cfn, timing_advance); return offset; } static int dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { guint64 status; /* Congestion status */ proto_tree_add_bits_ret_val(tree, hf_fp_congestion_status, tvb, offset*8 + 6, 2, &status, ENC_BIG_ENDIAN); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " status = %s", val_to_str_const((guint16)status, congestion_status_vals, "unknown")); return offset; } /* DCH control frame */ static void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, struct fp_info *p_fp_info) { /* Control frame type */ guint8 control_frame_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_fp_dch_control_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(control_frame_type, dch_control_frame_type_vals, "Unknown")); switch (control_frame_type) { case DCH_TIMING_ADJUSTMENT: /*offset =*/ dissect_dch_timing_adjustment(tree, pinfo, tvb, offset); break; case DCH_RX_TIMING_DEVIATION: /*offset =*/ dissect_dch_rx_timing_deviation(pinfo, tree, tvb, offset, p_fp_info); break; case DCH_DL_SYNCHRONISATION: /*offset =*/ dissect_dch_dl_synchronisation(tree, pinfo, tvb, offset); break; case DCH_UL_SYNCHRONISATION: /*offset =*/ dissect_dch_ul_synchronisation(tree, pinfo, tvb, offset); break; case DCH_OUTER_LOOP_POWER_CONTROL: /*offset =*/ dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset); break; case DCH_DL_NODE_SYNCHRONISATION: /*offset =*/ dissect_dch_dl_node_synchronisation(tree, pinfo, tvb, offset); break; case DCH_UL_NODE_SYNCHRONISATION: /*offset =*/ dissect_dch_ul_node_synchronisation(tree, pinfo, tvb, offset); break; case DCH_RADIO_INTERFACE_PARAMETER_UPDATE: /*offset =*/ dissect_dch_radio_interface_parameter_update(tree, pinfo, tvb, offset); break; case DCH_TIMING_ADVANCE: /*offset =*/ dissect_dch_timing_advance(tree, pinfo, tvb, offset, p_fp_info); break; case DCH_TNL_CONGESTION_INDICATION: /*offset =*/ dissect_dch_tnl_congestion_indication(tree, pinfo, tvb, offset); break; } /* Spare Extension */ /* dissect_spare_extension_and_crc(tvb, pinfo, tree, 0, offset); */ } /*******************************/ /* Dissect a DCH channel */ static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint32 cfn; guint header_length; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_str(pinfo->cinfo, COL_INFO, (ft == FT_CONTROL )? " [Control] " : ((p_fp_info->is_uplink) ? " [ULData] " : " [DLData] " )); if (ft == FT_CONTROL) { /* DCH control frame */ dissect_dch_control_frame(tree, pinfo, tvb, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { /************************/ /* DCH data here */ int chan; /* CFN */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn); /* One TFI for each channel */ for (chan=0; chan < p_fp_info->num_chans; chan++) { proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } header_length = offset; /* Dissect TB data */ offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_dch_handle, data); /* QE and CRCI bits (uplink only) */ if (p_fp_info->is_uplink) { proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset); } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare extension and payload CRC (optional) */ dissect_spare_extension_and_crc(tvb, pinfo, tree, p_fp_info->dch_crc_present, offset, header_length); } } /**********************************/ /* Dissect an E-DCH channel */ static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, gboolean is_common, void *data) { guint32 ft; guint8 number_of_subframes; guint32 cfn; int n; struct edch_t1_subframe_info subframes[16]; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; proto_item * item; guint header_length; rlc_info * rlcinf; if (p_fp_info->edch_type == 1) { col_append_str(pinfo->cinfo, COL_INFO, " (T2)"); } /* Header CRC */ /* the bitmask doesn't properly handle this delicate case, do manually */ header_crc = (tvb_get_bits8(tvb, offset*8, 7) << 4) + tvb_get_bits8(tvb, offset*8+8, 4); /* Frame Type */ ft = tvb_get_guint8(tvb, offset) & 0x01; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { /* DCH control frame */ /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); proto_tree_add_item(tree, hf_fp_ft, tvb, 0, 1, ENC_BIG_ENDIAN); offset++; if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } dissect_dch_control_frame(tree, pinfo, tvb, offset, p_fp_info); } else { /********************************/ /* E-DCH data here */ guint bit_offset; guint total_pdus = 0; guint total_bits = 0; gboolean dissected = FALSE; rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!rlcinf) { rlcinf = wmem_new0(wmem_packet_scope(), rlc_info); } header_crc_pi = proto_tree_add_uint_format(tree, hf_fp_edch_header_crc, tvb, offset, 2, header_crc, "%u%u%u%u %u%u%u. %u%u%u%u .... = E-DCH Header CRC: 0x%x", (header_crc >> 10) & 1, (header_crc >> 9) & 1, (header_crc >> 8) & 1, (header_crc >> 7) & 1, (header_crc >> 6) & 1, (header_crc >> 5) & 1, (header_crc >> 4) & 1, (header_crc >> 3) & 1, (header_crc >> 2) & 1, (header_crc >> 1) & 1, (header_crc >> 0) & 1, header_crc); proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* FSN */ proto_tree_add_item(tree, hf_fp_edch_fsn, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Number of subframes. This was 3 bits in early releases, is 4 bits offset by 1 in later releases */ if ((p_fp_info->release >= 6) && ((p_fp_info->release_year > 2005) || ((p_fp_info->release_year == 2005) && (p_fp_info->release_month >= 9)))) { /* Use 4 bits plus offset of 1 */ number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x0f) + 1; } else { /* Use 3 bits only */ number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x07); } proto_tree_add_uint(tree, hf_fp_edch_number_of_subframes, tvb, offset, 1, number_of_subframes); offset++; /* CFN */ proto_tree_add_item_ret_uint(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn); offset++; /* Remainder of T2 or common data frames differ here... */ if (p_fp_info->edch_type == 1) { dissect_e_dch_t2_or_common_channel_info(tvb, pinfo, tree, offset, p_fp_info, number_of_subframes, is_common, header_crc, header_crc_pi, data); return; } /* EDCH subframe header list */ for (n=0; n < number_of_subframes; n++) { int i; int start_offset = offset; proto_item *subframe_header_ti; proto_tree *subframe_header_tree; /* Add subframe header subtree */ subframe_header_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0, "", "Subframe"); subframe_header_tree = proto_item_add_subtree(subframe_header_ti, ett_fp_edch_subframe_header); /* Number of HARQ Retransmissions */ proto_tree_add_item(subframe_header_tree, hf_fp_edch_harq_retransmissions, tvb, offset, 1, ENC_BIG_ENDIAN); /* Subframe number */ subframes[n].subframe_number = (tvb_get_guint8(tvb, offset) & 0x07); proto_tree_add_bits_item(subframe_header_tree, hf_fp_edch_subframe_number, tvb, offset*8+5, 3, ENC_BIG_ENDIAN); offset++; /* Number of MAC-es PDUs */ subframes[n].number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; proto_tree_add_item(subframe_header_tree, hf_fp_edch_number_of_mac_es_pdus, tvb, offset, 1, ENC_BIG_ENDIAN); bit_offset = 4; proto_item_append_text(subframe_header_ti, " %u header (%u MAC-es PDUs)", subframes[n].subframe_number, subframes[n].number_of_mac_es_pdus); /* Details of each MAC-es PDU */ for (i=0; i < subframes[n].number_of_mac_es_pdus; i++) { guint64 ddi; guint64 n_pdus; /*Size of the PDU*/ proto_item *ddi_ti; gint ddi_size = -1; int p; /* DDI (6 bits) */ ddi_ti = proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_ddi, tvb, offset*8 + bit_offset, 6, &ddi, ENC_BIG_ENDIAN); rlcinf->rbid[i] = (guint8)ddi; /********************************/ /* Look up data in higher layers*/ /* Look up the size from this DDI value */ for (p=0; p < p_fp_info->no_ddi_entries; p++) { if (ddi == p_fp_info->edch_ddi[p]) { ddi_size = p_fp_info->edch_macd_pdu_size[p]; break; } } if (ddi_size == -1) { expert_add_info_format(pinfo, ddi_ti, &ei_fp_ddi_not_defined, "DDI %u not defined for this UE!", (guint)ddi); return; } else { proto_item_append_text(ddi_ti, " (%d bits)", ddi_size); } subframes[n].ddi[i] = (guint8)ddi; bit_offset += 6; /* Number of MAC-d PDUs (6 bits) */ item = proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_number_of_mac_d_pdus, tvb, offset*8 + bit_offset, 6, &n_pdus, ENC_BIG_ENDIAN); if (n_pdus > MAX_MAC_FRAMES) { expert_add_info_format(pinfo, item, &ei_fp_invalid_frame_count, "Invalid number of PDUs (max is %u)", MAX_MAC_FRAMES); return; } subframes[n].number_of_mac_d_pdus[i] = (guint8)n_pdus; bit_offset += 6; } offset += ((bit_offset+7)/8); /* Tree should cover entire subframe header */ proto_item_set_len(subframe_header_ti, offset - start_offset); } header_length = offset; /* EDCH subframes */ for (n=0; n < number_of_subframes; n++) { int i; proto_item *subframe_ti; proto_tree *subframe_tree; guint bits_in_subframe = 0; guint mac_d_pdus_in_subframe = 0; guint lchid=0; /*Logcial channel id*/ guint32 user_identity; umts_mac_info *macinf; bit_offset = 0; macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); if (!macinf) { macinf = wmem_new0(wmem_packet_scope(), umts_mac_info); } /* Add subframe subtree */ subframe_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe, tvb, offset, 0, "", "Subframe %u data", subframes[n].subframe_number); subframe_tree = proto_item_add_subtree(subframe_ti, ett_fp_edch_subframe); for (i=0; i < subframes[n].number_of_mac_es_pdus; i++) { int m; guint16 size = 0; /* guint8 tsn; */ guint send_size; proto_item *ti; int macd_idx; proto_tree *maces_tree = NULL; /** TODO: Merge these two loops? **/ /* Look up mac-d pdu size for this ddi */ for (m=0; m < p_fp_info->no_ddi_entries; m++) { if (subframes[n].ddi[i] == p_fp_info->edch_ddi[m]) { size = p_fp_info->edch_macd_pdu_size[m]; break; } } /* Look up logicalchannel id for this DDI value */ for (m=0; m < p_fp_info->no_ddi_entries; m++) { if (subframes[n].ddi[i] == p_fp_info->edch_ddi[m]) { lchid = p_fp_info->edch_lchId[m]; break; } } if (m == p_fp_info->no_ddi_entries) { /* Not found. Oops */ expert_add_info(pinfo, NULL, &ei_fp_unable_to_locate_ddi_entry); return; } /* Send MAC-dd PDUs together as one MAC-es PDU */ send_size = size * subframes[n].number_of_mac_d_pdus[i]; /* 2 bits spare */ proto_tree_add_item(subframe_tree, hf_fp_edch_pdu_padding, tvb, offset + (bit_offset/8), 1, ENC_BIG_ENDIAN); bit_offset += 2; /* TSN */ /* tsn = (tvb_get_guint8(tvb, offset + (bit_offset/8)) & 0x3f); */ proto_tree_add_item(subframe_tree, hf_fp_edch_tsn, tvb, offset + (bit_offset/8), 1, ENC_BIG_ENDIAN); bit_offset += 6; /* PDU */ if (subframe_tree) { ti = proto_tree_add_item(subframe_tree, hf_fp_edch_mac_es_pdu, tvb, offset + (bit_offset/8), ((bit_offset % 8) + send_size + 7) / 8, ENC_NA); proto_item_append_text(ti, " (%u * %u = %u bits, PDU %d)", size, subframes[n].number_of_mac_d_pdus[i], send_size, n); maces_tree = proto_item_add_subtree(ti, ett_fp_edch_maces); } /* Determine the UE ID to use in RLC */ user_identity = p_fp_info->com_context_id; if(p_fp_info->urnti) { user_identity = p_fp_info->urnti; } for (macd_idx = 0; macd_idx < subframes[n].number_of_mac_d_pdus[i]; macd_idx++) { if (preferences_call_mac_dissectors) { /* Should no longer happen ??*/ if (macd_idx >= MAX_MAC_FRAMES) { expert_add_info_format(pinfo, subframe_tree, &ei_fp_invalid_frame_count, "Invalid frame count (max is %u)", MAX_MAC_FRAMES); return; } tvbuff_t *next_tvb; pinfo->fd->subnum = macd_idx; /* set subframe number to current TB */ /* create new TVB and pass further on */ next_tvb = tvb_new_subset_length(tvb, offset + bit_offset/8, ((bit_offset % 8) + size + 7) / 8); /*Set up information needed for MAC and lower layers*/ macinf->content[macd_idx] = lchId_type_table[lchid]; /*Set the proper Content type for the mac layer.*/ macinf->lchid[macd_idx] = lchid; rlcinf->mode[macd_idx] = lchId_rlc_map[lchid]; /* Set RLC mode by lchid to RLC_MODE map in nbap.h */ /* Set UE ID to U-RNTI or NBAP Comuncation Context*/ rlcinf->ueid[macd_idx] = user_identity; rlcinf->rbid[macd_idx] = lchid; rlcinf->li_size[macd_idx] = RLC_LI_7BITS; rlcinf->ciphered[macd_idx] = FALSE; rlcinf->deciphered[macd_idx] = FALSE; p_fp_info->cur_tb = macd_idx; /*Set the transport block index (NOTE: This and not subnum is used in MAC dissector!)*/ call_dissector_with_data(mac_fdd_edch_handle, next_tvb, pinfo, top_level_tree, data); dissected = TRUE; } else { /* Just add as a MAC-d PDU */ proto_tree_add_item(maces_tree, hf_fp_mac_d_pdu, tvb, offset + (bit_offset/8), ((bit_offset % 8) + size + 7) / 8, ENC_NA); } bit_offset += size; } bits_in_subframe += send_size; mac_d_pdus_in_subframe += subframes[n].number_of_mac_d_pdus[i]; /* Pad out to next byte */ if (bit_offset % 8) { bit_offset += (8 - (bit_offset % 8)); } } if (tree) { /* Tree should cover entire subframe */ proto_item_set_len(subframe_ti, bit_offset/8); /* Append summary info to subframe label */ proto_item_append_text(subframe_ti, " (%u bits in %u MAC-d PDUs)", bits_in_subframe, mac_d_pdus_in_subframe); } total_pdus += mac_d_pdus_in_subframe; total_bits += bits_in_subframe; offset += (bit_offset/8); } /* Report number of subframes in info column * do this only if no other dissector was called */ if (dissected == FALSE) { col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %03u (%u bits in %u pdus in %u subframes)", cfn, total_bits, total_pdus, number_of_subframes); } /* Add data summary to info column */ /*col_append_fstr(pinfo->cinfo, COL_INFO, " (%u bytes in %u SDUs in %u MAC-is PDUs in %u subframes)", total_bytes, macis_sdus_found, macis_pdus, number_of_subframes);*/ if (preferences_header_checksum) { verify_header_crc_edch(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare extension and payload CRC (optional) */ dissect_spare_extension_and_crc(tvb, pinfo, tree, p_fp_info->dch_crc_present, offset, header_length); } } /* Dissect the remainder of the T2 or common frame that differs from T1 */ static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, int number_of_subframes, gboolean is_common, guint16 header_crc, proto_item * header_crc_pi, void *data) { int n; int pdu_no; guint64 total_macis_sdus; guint16 macis_sdus_found = 0; /* guint16 macis_pdus = 0; */ gboolean F = TRUE; /* We want to continue loop if get E-RNTI indication... */ gint bit_offset; proto_item *subframe_macis_descriptors_ti = NULL; static struct edch_t2_subframe_info subframes[16]; guint header_length = 0; /* User Buffer size */ proto_tree_add_bits_item(tree, hf_fp_edch_user_buffer_size, tvb, offset*8, 18, ENC_BIG_ENDIAN); offset += 2; /* Spare is in-between... */ /* Total number of MAC-is SDUs */ proto_tree_add_bits_ret_val(tree, hf_fp_edch_no_macid_sdus, tvb, offset*8+4, 12, &total_macis_sdus, ENC_BIG_ENDIAN); offset += 2; if (is_common) { /* E-RNTI */ proto_tree_add_item(tree, hf_fp_edch_e_rnti, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } bit_offset = offset*8; /* EDCH subframe header list */ for (n=0; n < number_of_subframes; n++) { guint64 subframe_number; guint64 no_of_macis_pdus; proto_item *subframe_header_ti; proto_tree *subframe_header_tree; /* Add subframe header subtree */ subframe_header_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0, "", "Subframe"); subframe_header_tree = proto_item_add_subtree(subframe_header_ti, ett_fp_edch_subframe_header); /* Spare bit */ bit_offset++; if (!is_common) { /* Number of HARQ Retransmissions */ proto_tree_add_item(subframe_header_tree, hf_fp_edch_harq_retransmissions, tvb, bit_offset/8, 1, ENC_BIG_ENDIAN); bit_offset += 4; } /* Subframe number */ proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_subframe_number, tvb, bit_offset, 3, &subframe_number, ENC_BIG_ENDIAN); subframes[n].subframe_number = (guint8)subframe_number; bit_offset += 3; /* Number of MAC-is PDUs */ proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_number_of_mac_is_pdus, tvb, bit_offset, 4, &no_of_macis_pdus, ENC_BIG_ENDIAN); bit_offset += 4; subframes[n].number_of_mac_is_pdus = (guint8)no_of_macis_pdus; /* macis_pdus += subframes[n].number_of_mac_is_pdus; */ /* Next 4 bits are spare for T2*/ if (!is_common) { bit_offset += 4; } /* Show summary in root */ proto_item_append_text(subframe_header_ti, " (SFN %u, %u MAC-is PDUs)", subframes[n].subframe_number, subframes[n].number_of_mac_is_pdus); proto_item_set_len(subframe_header_ti, is_common ? 1 : 2); } offset = bit_offset / 8; /* MAC-is PDU descriptors for each subframe follow */ for (n=0; n < number_of_subframes; n++) { proto_tree *subframe_macis_descriptors_tree; /* Add subframe header subtree */ subframe_macis_descriptors_ti = proto_tree_add_string_format(tree, hf_fp_edch_macis_descriptors, tvb, offset, 0, "", "MAC-is descriptors (SFN %u)", subframes[n].subframe_number); proto_item_set_len(subframe_macis_descriptors_ti, subframes[n].number_of_mac_is_pdus*2); subframe_macis_descriptors_tree = proto_item_add_subtree(subframe_macis_descriptors_ti, ett_fp_edch_macis_descriptors); /* Find a sequence of descriptors for each MAC-is PDU in this subframe */ for (pdu_no=0; pdu_no < subframes[n].number_of_mac_is_pdus; pdu_no++) { proto_item *f_ti = NULL; subframes[n].number_of_mac_is_sdus[pdu_no] = 0; do { /* Check we haven't gone past the limit */ if (macis_sdus_found++ > total_macis_sdus) { expert_add_info_format(pinfo, f_ti, &ei_fp_mac_is_sdus_miscount, "Found too many (%u) MAC-is SDUs - header said there were %u", macis_sdus_found, (guint16)total_macis_sdus); } /* LCH-ID */ subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_lchid, tvb, offset, 1, ENC_BIG_ENDIAN); if (subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] == 15) { proto_item *ti; /* 4 bits of spare */ offset++; /* E-RNTI */ ti = proto_tree_add_item(tree, hf_fp_edch_e_rnti, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* This is only allowed if: - it's the common case AND - it's the first descriptor */ if (!is_common) { expert_add_info(pinfo, ti, &ei_fp_e_rnti_t2_edch_frames); } if (subframes[n].number_of_mac_is_sdus[pdu_no] > 0) { expert_add_info(pinfo, ti, &ei_fp_e_rnti_first_entry); } continue; } /* Length */ subframes[n].mac_is_length[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_ntohs(tvb, offset) & 0x0ffe) >> 1; proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset++; /* Flag */ F = tvb_get_guint8(tvb, offset) & 0x01; f_ti = proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_flag, tvb, offset, 1, ENC_BIG_ENDIAN); subframes[n].number_of_mac_is_sdus[pdu_no]++; offset++; } while (F == 0); } } /* Check overall count of MAC-is SDUs */ if (macis_sdus_found != total_macis_sdus) { expert_add_info_format(pinfo, subframe_macis_descriptors_ti, &ei_fp_mac_is_sdus_miscount, "Frame contains %u MAC-is SDUs - header said there would be %u!", macis_sdus_found, (guint16)total_macis_sdus); } header_length = offset; /* Now PDUs */ for (n=0; n < number_of_subframes; n++) { /* MAC-is PDU */ for (pdu_no=0; pdu_no < subframes[n].number_of_mac_is_pdus; pdu_no++) { int i; guint length = 0; umts_mac_is_info * mac_is_info = wmem_new(wmem_file_scope(), umts_mac_is_info); mac_is_info->number_of_mac_is_sdus = subframes[n].number_of_mac_is_sdus[pdu_no]; DISSECTOR_ASSERT(subframes[n].number_of_mac_is_sdus[pdu_no] <= MAX_MAC_FRAMES); for (i = 0; i < subframes[n].number_of_mac_is_sdus[pdu_no]; i++) { mac_is_info->sdulength[i] = subframes[n].mac_is_length[pdu_no][i]; mac_is_info->lchid[i] = subframes[n].mac_is_lchid[pdu_no][i]; length += subframes[n].mac_is_length[pdu_no][i]; } /* Call MAC for this PDU if configured to */ if (preferences_call_mac_dissectors) { p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, mac_is_info); call_dissector_with_data(mac_fdd_edch_type2_handle, tvb_new_subset_remaining(tvb, offset), pinfo, top_level_tree, data); } else { /* Still show data if not decoding as MAC PDU */ proto_tree_add_item(tree, hf_fp_edch_mac_is_pdu, tvb, offset, length, ENC_NA); } /* get_mac_tsn_size in packet-umts_mac.h, gets the global_mac_tsn_size preference in umts_mac.c */ if (get_mac_tsn_size() == MAC_TSN_14BITS) { offset += length + 2; /* Plus 2 bytes for TSN 14 bits and SS 2 bit. */ } else { offset += length + 1; /* Plus 1 byte for TSN 6 bits and SS 2 bit. */ } } } if (preferences_header_checksum) { verify_header_crc_edch(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare extension and payload CRC (optional) */ dissect_spare_extension_and_crc(tvb, pinfo, tree, p_fp_info->dch_crc_present, offset, header_length); } /**********************************************************/ /* Dissect an HSDSCH channel */ /* The data format corresponds to the format */ /* described in R5 and R6, and frame type 1 in Release 7. */ static void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint header_length; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint8 number_of_pdus; guint16 pdu_length; guint16 user_buffer_size; int i; umts_mac_info *macinf; rlc_info *rlcinf; guint32 user_identity; proto_item *item; rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!rlcinf) { rlcinf = wmem_new0(wmem_packet_scope(), rlc_info); } macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); if (!macinf) { macinf = wmem_new0(wmem_packet_scope(), umts_mac_info); } /**************************************/ /* HS-DCH data here (type 1 in R7) */ /* Frame Seq Nr */ if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) { guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no); } /* CmCH-PI */ proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* MAC-d PDU Length (13 bits) */ pdu_length = (tvb_get_ntohs(tvb, offset) >> 3); proto_tree_add_item(tree, hf_fp_mac_d_pdu_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; macinf->pdu_len = pdu_length; if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) { /* Flush bit */ proto_tree_add_item(tree, hf_fp_flush, tvb, offset-1, 1, ENC_BIG_ENDIAN); /* FSN/DRT reset bit */ proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset-1, 1, ENC_BIG_ENDIAN); } /* Num of PDUs */ number_of_pdus = tvb_get_guint8(tvb, offset); item = proto_tree_add_item(tree, hf_fp_num_of_pdu, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (number_of_pdus > MAX_MAC_FRAMES) { expert_add_info_format(pinfo, item, &ei_fp_invalid_frame_count, "Invalid number of PDUs (max is %u)", MAX_MAC_FRAMES); return; } /* User buffer size */ user_buffer_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; header_length = offset; /* Determine the UE ID to use in RLC */ user_identity = p_fp_info->com_context_id; if(p_fp_info->urnti) { user_identity = p_fp_info->urnti; } /************************/ /*Configure the pdus*/ for (i=0;i<number_of_pdus && i<MIN(MAX_MAC_FRAMES, MAX_RLC_CHANS); i++) { macinf->content[i] = hsdsch_macdflow_id_mac_content_map[p_fp_info->hsdsch_macflowd_id]; /*MAC_CONTENT_PS_DTCH;*/ macinf->lchid[i] = fake_lchid_macd_flow[p_fp_info->hsdsch_macflowd_id];/*Faked logical channel id 255 used as a mark if it doesn't exist...*/ macinf->fake_chid[i] = TRUE; /**/ macinf->macdflow_id[i] = p_fp_info->hsdsch_macflowd_id; /*Save the flow ID (+1 to make it human readable (it's zero indexed!))*/ /*Check if this is multiplexed (signaled by RRC)*/ if (p_fp_info->hsdhsch_macfdlow_is_mux[p_fp_info->hsdsch_macflowd_id] ) { macinf->ctmux[i] = TRUE; } else if (p_fp_info->hsdsch_macflowd_id == 0) { /*MACd-flow = 0 is often SRB */ expert_add_info(pinfo, NULL, &ei_fp_maybe_srb); } else { macinf->ctmux[i] = FALSE; /*Either it's multiplexed and not signled or it's not MUX*/ } /* Figure out RLC mode */ if(p_fp_info->hsdsch_rlc_mode != FP_RLC_MODE_UNKNOWN) { /* We know the RLC mode, possibly reported from NBAP */ rlcinf->mode[i] = (enum rlc_mode)(p_fp_info->hsdsch_rlc_mode - 1); } else { /* Guess the mode by the MACd-flow-ID, basically MACd-flow-ID = 0 then it's SRB0 == UM else AM */ /* This logic might be incorrect sometimes */ rlcinf->mode[i] = hsdsch_macdflow_id_rlc_map[p_fp_info->hsdsch_macflowd_id]; } rlcinf->ueid[i] = user_identity; rlcinf->li_size[i] = RLC_LI_7BITS; rlcinf->deciphered[i] = FALSE; rlcinf->ciphered[i] = FALSE; rlcinf->rbid[i] = macinf->lchid[i]; #if 0 /*When a flow has been reconfigured rlc needs to be reset. * This needs more work though since we must figure out when the re-configuration becomes * active based on the CFN value * */ /*Indicate we need to reset stream*/ if (p_fp_info->reset_frag) { rlc_reset_channel(rlcinf->mode[i], macinf->lchid[i], p_fp_info->is_uplink, rlcinf->ueid[i] ); p_fp_info->reset_frag = FALSE; } #endif } col_append_fstr(pinfo->cinfo, COL_INFO, " %ux%u-bit PDUs User-Buffer-Size=%u", number_of_pdus, pdu_length, user_buffer_size); /* MAC-d PDUs */ offset = dissect_macd_pdu_data(tvb, pinfo, tree, offset, pdu_length, number_of_pdus, p_fp_info, data); /* Extra IEs (if there is room for them) */ if (((p_fp_info->release == 6) || (p_fp_info->release == 7)) && (tvb_reported_length_remaining(tvb, offset) > 2)) { int n; guint8 flags; /* guint8 flag_bytes = 0; */ /* New IE flags */ do { proto_item *new_ie_flags_ti; proto_tree *new_ie_flags_tree; guint ies_found = 0; /* Add new IE flags subtree */ new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_new_ie_flags, tvb, offset, 1, "", "New IE flags"); new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_hsdsch_new_ie_flags); /* Read next byte */ flags = tvb_get_guint8(tvb, offset); /* flag_bytes++; */ /* Dissect individual bits */ for (n=0; n < 8; n++) { proto_tree_add_item(new_ie_flags_tree, hf_fp_hsdsch_new_ie_flag[n], tvb, offset, 1, ENC_BIG_ENDIAN); if ((flags >> (7-n)) & 0x01) { ies_found++; } } offset++; proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found); /* Last bit set will indicate another flags byte follows... */ } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/ if (1) /*(flags & 0x8) */ { /* DRT is shown as mandatory in the diagram (3GPP TS 25.435 V6.3.0), but the description below it states that it should depend upon the first bit. The detailed description of New IE flags doesn't agree, so treat as mandatory for now... */ proto_tree_add_item(tree, hf_fp_hsdsch_drt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /******************************************/ /* Dissect an HSDSCH type 2 channel */ /* (introduced in Release 7) */ /* N.B. there is currently no support for */ /* frame type 3 (IuR only?) */ static void dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; guint16 header_length; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint8 number_of_pdu_blocks; gboolean drt_present = FALSE; gboolean fach_present = FALSE; guint16 user_buffer_size; int n; guint j; guint64 lchid_val; #define MAX_PDU_BLOCKS 31 guint64 lchid_field[MAX_PDU_BLOCKS]; guint64 pdu_length[MAX_PDU_BLOCKS]; guint64 no_of_pdus[MAX_PDU_BLOCKS]; umts_mac_info *macinf; rlc_info *rlcinf; guint32 user_identity; rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!rlcinf) { rlcinf = wmem_new0(wmem_packet_scope(), rlc_info); } macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); if (!macinf) { macinf = wmem_new0(wmem_packet_scope(), umts_mac_info); } /********************************/ /* HS-DCH type 2 data here */ col_append_str(pinfo->cinfo, COL_INFO, "(ehs)"); /* Frame Seq Nr (4 bits) */ if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) { guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no); } /* CmCH-PI (4 bits) */ proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Total number of PDU blocks (5 bits) */ number_of_pdu_blocks = (tvb_get_guint8(tvb, offset) >> 3); proto_tree_add_item(tree, hf_fp_total_pdu_blocks, tvb, offset, 1, ENC_BIG_ENDIAN); if (p_fp_info->release == 7) { /* Flush bit */ proto_tree_add_item(tree, hf_fp_flush, tvb, offset, 1, ENC_BIG_ENDIAN); /* FSN/DRT reset bit */ proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset, 1, ENC_BIG_ENDIAN); /* DRT Indicator */ drt_present = tvb_get_guint8(tvb, offset) & 0x01; proto_tree_add_item(tree, hf_fp_drt_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); } offset++; /* FACH Indicator flag */ fach_present = (tvb_get_guint8(tvb, offset) & 0x80) >> 7; proto_tree_add_item(tree, hf_fp_fach_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* User buffer size */ user_buffer_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " User-Buffer-Size=%u", user_buffer_size); /********************************************************************/ /* Now read number_of_pdu_blocks header entries */ for (n=0; n < number_of_pdu_blocks; n++) { proto_item *pdu_block_header_ti; proto_tree *pdu_block_header_tree; int block_header_start_offset = offset; /* Add PDU block header subtree */ pdu_block_header_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_pdu_block_header, tvb, offset, 0, "", "PDU Block Header"); pdu_block_header_tree = proto_item_add_subtree(pdu_block_header_ti, ett_fp_hsdsch_pdu_block_header); /* MAC-d/c PDU length in this block (11 bits) */ proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdu_length_in_block, tvb, (offset*8) + ((n % 2) ? 4 : 0), 11, &pdu_length[n], ENC_BIG_ENDIAN); if ((n % 2) == 0) offset++; else offset += 2; /* # PDUs in this block (4 bits) */ proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdus_in_block, tvb, (offset*8) + ((n % 2) ? 0 : 4), 4, &no_of_pdus[n], ENC_BIG_ENDIAN); if ((n % 2) == 0) { offset++; } /* Logical channel ID in block (4 bits) */ proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_lchid, tvb, (offset*8) + ((n % 2) ? 4 : 0), 4, &lchid_field[n], ENC_BIG_ENDIAN); if ((n % 2) == 1) { offset++; } else { if (n == (number_of_pdu_blocks-1)) { /* Byte is padded out for last block */ offset++; } } /* Append summary to header tree root */ proto_item_append_text(pdu_block_header_ti, " (lch:%u, %u pdus of %u bytes)", (guint16)lchid_field[n], (guint16)no_of_pdus[n], (guint16)pdu_length[n]); /* Set length of header tree item */ if (((n % 2) == 0) && (n < (number_of_pdu_blocks-1))) { proto_item_set_len(pdu_block_header_ti, offset - block_header_start_offset+1); } else { proto_item_set_len(pdu_block_header_ti, offset - block_header_start_offset); } } header_length = offset; /**********************************************/ /* Optional fields indicated by earlier flags */ if (drt_present) { /* DRT */ proto_tree_add_item(tree, hf_fp_drt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } if (fach_present) { /* H-RNTI: */ proto_tree_add_item(tree, hf_fp_hrnti, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* RACH Measurement Result */ proto_tree_add_item(tree, hf_fp_rach_measurement_result, tvb, offset, 2, ENC_BIG_ENDIAN); offset++; } /* Determine the UE ID to use in RLC */ user_identity = p_fp_info->com_context_id; if(p_fp_info->urnti) { user_identity = p_fp_info->urnti; } /********************************************************************/ /* Now read the MAC-d/c PDUs for each block using info from headers */ for (n=0; n < number_of_pdu_blocks; n++) { for (j=0;j<no_of_pdus[n];j++) { /*Configure (signal to lower layers) the PDU!*/ if (lchid_field[n] != 0x0f) { lchid_val = lchid_field[n] + 1; /* Add 1 since 'LCHID' field is zero indexed. ie field value = 0 => Actual L-CHID = 1*/ macinf->content[j] = lchId_type_table[lchid_val]; macinf->lchid[j] = (guint8)lchid_val; macinf->macdflow_id[j] = p_fp_info->hsdsch_macflowd_id; /*Figure out RLC_MODE based on MACd-flow-ID, basically MACd-flow-ID = 0 then it's SRB0 == UM else AM*/ rlcinf->mode[j] = lchId_rlc_map[lchid_val]; macinf->ctmux[n] = FALSE; rlcinf->li_size[j] = RLC_LI_7BITS; rlcinf->ciphered[j] = FALSE; rlcinf->deciphered[j] = FALSE; rlcinf->rbid[j] = (guint8)lchid_val; rlcinf->ueid[j] = user_identity; } else { /* LCHID field is 15. This value indicates BCCH or PCCH mapped on HS-DSCH*/ /* The dissector does not handle this case yet, so we are filling zeroes and default values below*/ macinf->content[j] = MAC_CONTENT_UNKNOWN; macinf->lchid[j] = 0; /* LCHID field doesn't reflect a real ID in this case*/ macinf->macdflow_id[j] = 0; macinf->ctmux[j] = FALSE; rlcinf->mode[j] = RLC_TM; /* PCCH and BCCH should be using RLC TM? */ rlcinf->li_size[j] = RLC_LI_7BITS; rlcinf->ciphered[j] = FALSE; rlcinf->deciphered[j] = FALSE; rlcinf->rbid[j] = 0; rlcinf->ueid[j] = 0; } } /* Add PDU block header subtree */ offset = dissect_macd_pdu_data_type_2(tvb, pinfo, tree, offset, (guint16)pdu_length[n], (guint16)no_of_pdus[n], p_fp_info, data); } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /** * Dissect and CONFIGURE hsdsch_common channel. * * This will dissect hsdsch common channels of type 2, so this is * very similar to regular type two (ehs) the difference being how * the configuration is done. NOTE: VERY EXPERIMENTAL. * * @param tvb the tv buffer of the current data * @param pinfo the packet info of the current data * @param tree the tree to append this item to * @param offset the offset in the tvb * @param p_fp_info FP-packet information */ static void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, struct fp_info *p_fp_info, void *data) { guint32 ft; guint32 header_crc = 0; proto_item * header_crc_pi = NULL; guint header_length; /* Header CRC */ header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc); /* Frame Type */ proto_tree_add_item_ret_uint(tree, hf_fp_ft, tvb, offset, 1, ENC_BIG_ENDIAN, &ft); offset++; col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown")); if (ft == FT_CONTROL) { dissect_common_control(tvb, pinfo, tree, offset, p_fp_info); /* For control frame the header CRC is actually frame CRC covering all * bytes except the first */ if (preferences_header_checksum) { verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc); } } else { guint8 number_of_pdu_blocks; gboolean drt_present = FALSE; gboolean fach_present = FALSE; guint16 user_buffer_size; int n; guint j; #define MAX_PDU_BLOCKS 31 guint64 lchid[MAX_PDU_BLOCKS]; guint64 pdu_length[MAX_PDU_BLOCKS]; guint64 no_of_pdus[MAX_PDU_BLOCKS]; guint8 newieflags = 0; umts_mac_info *macinf; rlc_info *rlcinf; rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!rlcinf) { rlcinf = wmem_new0(wmem_packet_scope(), rlc_info); } macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); if (!macinf) { macinf = wmem_new0(wmem_packet_scope(), umts_mac_info); } /********************************/ /* HS-DCH type 2 data here */ col_append_str(pinfo->cinfo, COL_INFO, "(ehs)"); /* Frame Seq Nr (4 bits) */ if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) { guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no); } /* CmCH-PI (4 bits) */ proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Total number of PDU blocks (5 bits) */ number_of_pdu_blocks = (tvb_get_guint8(tvb, offset) >> 3); proto_tree_add_item(tree, hf_fp_total_pdu_blocks, tvb, offset, 1, ENC_BIG_ENDIAN); if (p_fp_info->release == 7) { /* Flush bit */ proto_tree_add_item(tree, hf_fp_flush, tvb, offset, 1, ENC_BIG_ENDIAN); /* FSN/DRT reset bit */ proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset, 1, ENC_BIG_ENDIAN); /* DRT Indicator */ drt_present = tvb_get_guint8(tvb, offset) & 0x01; proto_tree_add_item(tree, hf_fp_drt_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); } offset++; /* FACH Indicator flag */ fach_present = (tvb_get_guint8(tvb, offset) & 0x80) >> 7; proto_tree_add_item(tree, hf_fp_fach_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* User buffer size */ user_buffer_size = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; col_append_fstr(pinfo->cinfo, COL_INFO, " User-Buffer-Size=%u", user_buffer_size); /********************************************************************/ /* Now read number_of_pdu_blocks header entries */ for (n=0; n < number_of_pdu_blocks; n++) { proto_item *pdu_block_header_ti; proto_item *item; proto_tree *pdu_block_header_tree; int block_header_start_offset = offset; /* Add PDU block header subtree */ pdu_block_header_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_pdu_block_header, tvb, offset, 0, "", "PDU Block Header"); pdu_block_header_tree = proto_item_add_subtree(pdu_block_header_ti, ett_fp_hsdsch_pdu_block_header); /* MAC-d/c PDU length in this block (11 bits) */ proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdu_length_in_block, tvb, (offset*8) + ((n % 2) ? 4 : 0), 11, &pdu_length[n], ENC_BIG_ENDIAN); if ((n % 2) == 0) offset++; else offset += 2; /* # PDUs in this block (4 bits) */ item = proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdus_in_block, tvb, (offset*8) + ((n % 2) ? 0 : 4), 4, &no_of_pdus[n], ENC_BIG_ENDIAN); if ((n % 2) == 0) { offset++; } if (no_of_pdus[n] > MAX_MAC_FRAMES) { expert_add_info_format(pinfo, item, &ei_fp_invalid_frame_count, "Invalid number of PDUs (max is %u)", MAX_MAC_FRAMES); return; } /* Logical channel ID in block (4 bits) */ proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_lchid, tvb, (offset*8) + ((n % 2) ? 4 : 0), 4, &lchid[n], ENC_BIG_ENDIAN); if ((n % 2) == 1) { offset++; } else { if (n == (number_of_pdu_blocks-1)) { /* Byte is padded out for last block */ offset++; } } /* Append summary to header tree root */ proto_item_append_text(pdu_block_header_ti, " (lch:%u, %u pdus of %u bytes)", (guint16)lchid[n], (guint16)no_of_pdus[n], (guint16)pdu_length[n]); /* Set length of header tree item */ if (((n % 2) == 0) && (n < (number_of_pdu_blocks-1))) { proto_item_set_len(pdu_block_header_ti, offset - block_header_start_offset+1); } else { proto_item_set_len(pdu_block_header_ti, offset - block_header_start_offset); } } header_length = offset; /**********************************************/ /* Optional fields indicated by earlier flags */ if (drt_present) { /* DRT */ proto_tree_add_item(tree, hf_fp_drt, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } if (fach_present) { /* H-RNTI: */ proto_tree_add_item(tree, hf_fp_hrnti, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* RACH Measurement Result */ proto_tree_add_item(tree, hf_fp_rach_measurement_result, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } /********************************************************************/ /* Now read the MAC-d/c PDUs for each block using info from headers */ for (n=0; n < number_of_pdu_blocks; n++) { tvbuff_t *next_tvb; for (j=0; j<no_of_pdus[n]; j++) { /* If all bits are set, then this is BCCH or PCCH according to: 25.435 paragraph: 6.2.7.31 */ if (lchid[n] == 0xF) { /* In the very few test cases I've seen, this seems to be * BCCH with transparent MAC layer. Therefore skip right to * rlc_bcch and hope for the best. */ next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]); call_dissector_with_data(rlc_bcch_handle, next_tvb, pinfo, top_level_tree, data); offset += (gint)pdu_length[n]; } else { /* Else go for CCCH UM, this seems to work. */ p_fp_info->hsdsch_entity = ehs; /* HSDSCH type 2 */ /* TODO: use cur_tb or subnum everywhere. */ if (j >= MAX_MAC_FRAMES) { /* Should not happen as we check no_of_pdus[n]*/ expert_add_info_format(pinfo, tree, &ei_fp_invalid_frame_count, "Invalid frame count (max is %u)", MAX_MAC_FRAMES); return; } p_fp_info->cur_tb = j; /* set cur_tb for MAC */ pinfo->fd->subnum = j; /* set subframe number for RRC */ macinf->content[j] = MAC_CONTENT_CCCH; macinf->lchid[j] = (guint8)lchid[n]+1; /*Add 1 since it is zero indexed? */ macinf->macdflow_id[j] = p_fp_info->hsdsch_macflowd_id; macinf->ctmux[j] = FALSE; rlcinf->li_size[j] = RLC_LI_7BITS; rlcinf->ciphered[j] = FALSE; rlcinf->deciphered[j] = FALSE; rlcinf->rbid[j] = (guint8)lchid[n]+1; rlcinf->ueid[j] = p_fp_info->channel; /*We need to fake "UE ID"*/ next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]); call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data); offset += (gint)pdu_length[n]; } } } /* New IE Flags */ newieflags = tvb_get_guint8(tvb, offset); /* If newieflags == 0000 0010 then this indicates that there is a * HS-DSCH physical layer category and no other New IE flags. */ if (newieflags == 2) { /* HS-DSCH physical layer category presence bit. */ proto_tree_add_uint(tree, hf_fp_hsdsch_new_ie_flag[6], tvb, offset, 1, newieflags); offset++; /* HS-DSCH physical layer category. */ proto_tree_add_bits_item(tree, hf_fp_hsdsch_physical_layer_category, tvb, offset*8, 6, ENC_BIG_ENDIAN); offset++; } if (preferences_header_checksum) { verify_header_crc(tvb, pinfo, header_crc_pi, header_crc, header_length); } /* Spare Extension and Payload CRC */ dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset, header_length); } } /* Validates the header CRC in a Control FP frame */ /* Should only be used in heuristic dissectors! */ static gboolean check_control_frame_crc_for_heur(tvbuff_t * tvb) { guint8 crc = 0; guint8 calc_crc = 0; guint8 * data = NULL; guint reported_length = tvb_reported_length(tvb); if (reported_length == 0 || reported_length > tvb_captured_length(tvb)) return FALSE; crc = tvb_get_guint8(tvb, 0) >> 1; /* Get data. */ data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb)); /* Include only FT flag bit in CRC calculation. */ data[0] = data[0] & 1; calc_crc = crc7update(0, data, tvb_reported_length(tvb)); calc_crc = crc7finalize(calc_crc); return calc_crc == crc; } /* Validates the header CRC in a Data FP frame */ /* Should only be used in heuristic dissectors! */ static gboolean check_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length) { guint8 crc = 0; guint8 calc_crc = 0; const guint8 * data = NULL; if (header_length > tvb_captured_length(tvb)) return FALSE; crc = tvb_get_guint8(tvb, 0) >> 1; /* Get data of header excluding the first byte */ data = tvb_get_ptr(tvb, 1, header_length - 1); calc_crc = crc7update(0, data, header_length - 1); calc_crc = crc7finalize(calc_crc); return calc_crc == crc; } /* Validates the payload CRC in a Data FP frame */ /* Should only be used in heuristic dissectors! */ static gboolean check_payload_crc_for_heur(tvbuff_t *tvb, guint16 header_length) { guint16 reported_length; guint16 crc_index; guint16 crc = 0; guint16 calc_crc = 0; guint16 payload_index; guint16 payload_length; const guint8 *data = NULL; reported_length = tvb_reported_length(tvb); if (reported_length < 2 || reported_length > tvb_captured_length(tvb)) { return FALSE; } /* Payload CRC is in the last 2 bytes of the packet */ crc_index = reported_length - 2; crc = tvb_get_bits16(tvb, crc_index * 8, 16, ENC_BIG_ENDIAN); payload_index = header_length; /* payload first index is the same as the header length */ payload_length = (reported_length - payload_index) - 2; data = tvb_get_ptr(tvb, payload_index, payload_length); calc_crc = crc16_8005_noreflect_noxor(data, payload_length); return calc_crc == crc; } /* Validates the header CRC in a E-DCH Data FP frame */ /* Should only be used in heuristic dissectors! */ static gboolean check_edch_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length) { guint16 crc = 0; guint16 calc_crc = 0; guint8 * data = NULL; if (header_length > tvb_captured_length(tvb)) return FALSE; crc = (tvb_get_bits8(tvb, 0, 7) << 4) + tvb_get_bits8(tvb, 8, 4); /* Get data of header excluding the first byte */ data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1); /*Zero the part in the second byte which contains part of the CRC*/ data[0] = data[0] & 0x0f; calc_crc = crc11_307_noreflect_noxor(data, header_length-1); return calc_crc == crc; } /* Generates a unique 32bit identifier based on the frame's metadata */ /* This ID is used in the RLC dissector for reassembly */ /* Should only be used in heuristic dissectors! */ static guint32 generate_ue_id_for_heur(packet_info *pinfo) { if (pinfo->ptype == PT_UDP && pinfo->src.type == AT_IPv4 && pinfo->dst.type == AT_IPv4) { /* This logic assumes FP is delivered over IP/UDP*/ /* Will return the same ID even if the address and ports are reversed */ /* srcXor: [ ------- Source Address ------- ] (4 bytes)*/ /* XOR */ /* [ Source Port ][ Source Port ] (4 bytes)*/ int srcXor = pntoh32(pinfo->src.data) ^ ((pinfo->srcport << 16) | (pinfo->srcport)); /* dstXor: [ ---- Destination Address ---- ] (4 bytes)*/ /* XOR */ /* [ - Dest Port - ][ - Dest Port - ] (4 bytes)*/ int dstXor = pntoh32(pinfo->dst.data) ^ ((pinfo->destport << 16) | (pinfo->destport)); return srcXor ^ dstXor; } else { /* Fallback - When IP and/or UDP are missing for whatever reason */ /* Using the frame number of the first heuristicly dissected frame as the UE ID should be unique enough */ /* The bitwise NOT operator is used to prevent low UE ID values which are likely to collide */ /* with legitimate UE IDs derived from C-RNTIs in FACH/RACH */ return ~(pinfo->num); } } /* Fills common PCH information in a 'fp conversation info' object */ /* Should only be used in heuristic dissectors! */ static void fill_pch_conversation_info_for_heur(umts_fp_conversation_info_t* umts_fp_conversation_info ,packet_info *pinfo) { umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_PCH; umts_fp_conversation_info->num_dch_in_flow = 1; umts_fp_conversation_info->fp_dch_channel_info[0].num_dl_chans = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[1] = 1; umts_fp_conversation_info->channel_specific_info = (void*)wmem_new0(wmem_file_scope(), fp_pch_channel_info_t); } /* Attaches conversation info to both the downlink and uplink 'conversations' (streams) */ /* (Required since only one of them is checked in every dissected FP packet) */ /* Should only be used in heuristic dissectors! */ static void set_both_sides_umts_fp_conv_data(packet_info *pinfo, umts_fp_conversation_info_t *umts_fp_conversation_info) { conversation_t *packet_direction_conv; conversation_t *other_direction_conv; if (pinfo == NULL) { return; } /* Finding or creating conversation for the way the packet is heading */ packet_direction_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (packet_direction_conv == NULL) { /* Conversation does not exist yet, creating one now. */ packet_direction_conv = conversation_new(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR2); } conversation_add_proto_data(packet_direction_conv, proto_fp, umts_fp_conversation_info); /* Finding or creating conversation for the other side */ other_direction_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_src, &pinfo->net_dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, NO_ADDR_B); if (other_direction_conv == NULL) { /* Conversation does not exist yet, creating one now. */ other_direction_conv = conversation_new(pinfo->num, &pinfo->net_src, &pinfo->net_dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, NO_ADDR2); } conversation_add_proto_data(other_direction_conv, proto_fp, umts_fp_conversation_info); } static gboolean heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 tfi; guint8 pch_collisions_byte; /* Trying to find existing conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { if (umts_fp_conversation_info->channel == CHANNEL_DCH) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure FP info isn't already attached */ p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (p_fp_info) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ return FALSE; } /* Making sure we have at least enough bytes for header (3) + footer (2) */ captured_length = tvb_captured_length(tvb); if (captured_length < 5) { return FALSE; } reported_length = tvb_reported_length(tvb); tfi = tvb_get_guint8(tvb, 2) & 0x1f; /* Checking if this is a DCH frame with 0 TBs*/ if (tfi == 0x00) { if (reported_length != 5 /* DL */ && reported_length != 7 /* UL */) { return FALSE; } if (!check_header_crc_for_heur(tvb, 3)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 3)) { return FALSE; } /* All checks passed - This is an unknown DCH FP frame. */ /* To allow dissection of this frame after umts_fp_conversation_info will be added in a later frame */ /* the conversation must be created here if it doesn't exist yet*/ if (p_conv == NULL) { conversation_new(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR2); } return FALSE; } /* Checking this is a DCH frame with 1 TB */ if (tfi != 0x01) { return FALSE; } /* Expecting specific lengths: 24 for downlink frames, 26 for uplink frames */ /* This is the common Transport Format of DCCH over DCH ( See 3GPP TR 25.944 / 4.1.1.3.1.1 ) */ if (reported_length != 24 /* DL */ && reported_length != 26 /* UL */) { return FALSE; } if (!check_header_crc_for_heur(tvb, 3)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 3)) { return FALSE; } /* Checking if the 4th byte in the frame is zeroed. In this case the CRC checks aren't */ /* deterministic enough to gurantee this is a DCH since this packet could also be a PCH frame */ /* with PI Bitmap of 18 bytes + 0 TBs (Both CRCs will match for both formats) */ pch_collisions_byte = tvb_get_guint8(tvb, 3); if (pch_collisions_byte == 0) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; if (reported_length == 24) { /* Downlink */ copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; } else { /* Uplink*/ copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->dst); umts_fp_conversation_info->crnc_port = pinfo->destport; } umts_fp_conversation_info->channel = CHANNEL_DCH; umts_fp_conversation_info->num_dch_in_flow = 1; umts_fp_conversation_info->dch_ids_in_flow_list[0] = 31; umts_fp_conversation_info->fp_dch_channel_info[0].num_dl_chans = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[1] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = 148; umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = 1; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[1] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[1] = 148; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; fp_fach_channel_info_t* fp_fach_channel_info; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 tfi; guint8 tctf; /* Finding or creating conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { if (umts_fp_conversation_info->channel == CHANNEL_FACH_FDD) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure we have at least enough bytes for header (4) + footer (2) */ captured_length = tvb_captured_length(tvb); if(captured_length < 6) { return FALSE; } /* Expecting specific lengths: 51 for frames with 1 TB */ /* This is a common Transport Format of FACH ( See 3GPP TR 25.944 / 4.1.1.2 'FACH1' ) */ reported_length = tvb_reported_length(tvb); if (reported_length != 51) { return FALSE; } p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Making sure FP info isn't already attached */ if (p_fp_info) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ /* We can't tell the FP type and content of control frames */ return FALSE; } tfi = tvb_get_guint8(tvb, 2) & 0x1f; if (tfi != 0x01) { return FALSE; } tctf = tvb_get_guint8(tvb, 4); /* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-2 */ if (tctf != 0x40 && /* CCCH */ tctf != 0x50 && /* MCCH */ tctf != 0x5F && /* MSCH */ tctf != 0x80 && /* CTCH */ (tctf >> 4) != 0x06 && /* MTCH */ (tctf >> 6) != 0x00 && /* BCCH */ (tctf >> 6) != 0x03) { /* DCCH or DTCH over FACH */ return FALSE; } if (!check_header_crc_for_heur(tvb, 4)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 4)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_FACH_FDD; umts_fp_conversation_info->num_dch_in_flow = 1; umts_fp_conversation_info->fp_dch_channel_info[0].num_dl_chans = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[1] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = 360; /* Adding the 'channel specific info' for FACH */ fp_fach_channel_info = wmem_new0(wmem_file_scope(), fp_fach_channel_info_t); fp_fach_channel_info->crnti_to_urnti_map = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); umts_fp_conversation_info->channel_specific_info = (void*)fp_fach_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; fp_fach_channel_info_t* fp_fach_channel_info; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 tfi; guint8 tctf; /* Finding or creating conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { if (umts_fp_conversation_info->channel == CHANNEL_FACH_FDD) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure we have at least enough bytes for header (4) + footer (2) */ captured_length = tvb_captured_length(tvb); if(captured_length < 6) { return FALSE; } /* Expecting specific lengths: 27 for frames with 1 TB, 48 for frames with 2 TBs */ /* This is a common Transport Format of FACH ( See 3GPP TR 25.944 / 4.1.1.2 'FACH2' ) */ reported_length = tvb_reported_length(tvb); if (reported_length != 27 && reported_length != 48) { return FALSE; } p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Making sure FP info isn't already attached */ if (p_fp_info) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ /* We can't tell the FP type and content of control frames */ return FALSE; } tfi = tvb_get_guint8(tvb, 2) & 0x1f; if (reported_length == 27 && tfi != 0x01) { return FALSE; } if (reported_length == 48 && tfi != 0x02) { return FALSE; } tctf = tvb_get_guint8(tvb, 4); /* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-2 */ if (tctf != 0x40 && /* CCCH */ tctf != 0x50 && /* MCCH */ tctf != 0x5F && /* MSCH */ tctf != 0x80 && /* CTCH */ (tctf >> 4) != 0x06 && /* MTCH */ (tctf >> 6) != 0x00 && /* BCCH */ (tctf >> 6) != 0x03) { /* DCCH or DTCH over FACH */ return FALSE; } if (!check_header_crc_for_heur(tvb, 4)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 4)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_FACH_FDD; umts_fp_conversation_info->num_dch_in_flow = 1; umts_fp_conversation_info->fp_dch_channel_info[0].num_dl_chans = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[1] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = 168; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_num_tbs[2] = 2; umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[2] = 168; /* Adding the 'channel specific info' for FACH */ fp_fach_channel_info = wmem_new0(wmem_file_scope(), fp_fach_channel_info_t); fp_fach_channel_info->crnti_to_urnti_map = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); umts_fp_conversation_info->channel_specific_info = (void*)fp_fach_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; fp_rach_channel_info_t* fp_rach_channel_info; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 tfi; guint8 tctf; /* Finding or creating conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { if (umts_fp_conversation_info->channel == CHANNEL_RACH_FDD) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure we have at least enough bytes for header (4) + footer (2) */ captured_length = tvb_captured_length(tvb); if(captured_length < 6) { return FALSE; } /* Expecting specific lengths: rach frames are either 28 or 52 bytes long */ /* This is the common Transport Formats of RACH ( See 3GPP TR 25.944 / 4.1.2.1 ) */ reported_length = tvb_reported_length(tvb); if (reported_length != 28 && reported_length != 52) { return FALSE; } p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Making sure FP info isn't already attached */ if (p_fp_info) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ /* We can't tell the FP type and content of control frames */ return FALSE; } tfi = tvb_get_guint8(tvb, 2) & 0x1f; if (reported_length == 28 && tfi != 0x00) { return FALSE; } if (reported_length == 52 && tfi != 0x01) { return FALSE; } tctf = tvb_get_guint8(tvb, 4) >> 6; /* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-4 */ if (tctf != 0x00 && /* CCCH */ tctf != 0x01) /* DCCH over RACH */ { return FALSE; } if (!check_header_crc_for_heur(tvb, 4)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 4)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->dst); umts_fp_conversation_info->crnc_port = pinfo->destport; umts_fp_conversation_info->channel = CHANNEL_RACH_FDD; umts_fp_conversation_info->num_dch_in_flow = 1; umts_fp_conversation_info->fp_dch_channel_info[0].num_ul_chans = 0; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[0] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_num_tbs[1] = 1; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[0] = 168; umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[1] = 360; /* Adding the 'channel specific info' for RACH */ fp_rach_channel_info = wmem_new0(wmem_file_scope(), fp_rach_channel_info_t); fp_rach_channel_info->crnti_to_urnti_map = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); umts_fp_conversation_info->channel_specific_info = (void*)fp_rach_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; fp_pch_channel_info_t* fp_pch_channel_info = NULL; struct fp_info *p_fp_info; gboolean conversation_initialized = FALSE; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 reserved_bits; guint8 tfi; guint8 pi_byte_length; guint16 tb_byte_length; gboolean pi_present; gboolean tb_size_found; gboolean pi_length_found; guint8 cfn_lowest_bits; guint8 dch_collisions_byte; /* To correctly dissect a PCH stream 2 parameters are required: PI Bitmap length & TB length */ /* Both are optional in each packet and having them both in a packet without knowing any of them */ /* is not helpful.*/ /* Hence gathering the info from 2 different frames is required. */ /* Finding or creating conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { fp_pch_channel_info = (fp_pch_channel_info_t*)umts_fp_conversation_info->channel_specific_info; /* Making sure this conversation type is "PCH" and the PCH channel info is present */ if (umts_fp_conversation_info->channel == CHANNEL_PCH && fp_pch_channel_info != NULL) { conversation_initialized = TRUE; pi_length_found = fp_pch_channel_info->paging_indications != 0; tb_size_found = umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] != 0; if (pi_length_found && tb_size_found) { /* Stream already framed - contains both PI length and TB size */ dissect_fp(tvb, pinfo, tree, data); return TRUE; } } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } else { /* FP conversation info attached and the channel type is UNKNOWN - might be PCH */ tb_size_found = FALSE; pi_length_found = FALSE; } } else { /* FP conversation info not attached - no PCH info is known */ tb_size_found = FALSE; pi_length_found = FALSE; } } else { /* A conversation does not exist yet - no PCH info is known */ tb_size_found = FALSE; pi_length_found = FALSE; } /* Making sure we have at least enough bytes for header (4) + footer (2) */ captured_length = tvb_captured_length(tvb); if(captured_length < 6) { return FALSE; } p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Making sure FP info isn't already attached */ if (p_fp_info) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ /* We can't tell the FP type and content of control frames */ return FALSE; } /* Checking bits after CFN and before PI indicator are zeroed */ reserved_bits = tvb_get_guint8(tvb, 2) & 0x0E; if (reserved_bits != 0x00) { return FALSE; } tfi = tvb_get_guint8(tvb, 3) & 0x1f; if (tfi != 0x00 && tfi != 0x01) { return FALSE; } if (!check_header_crc_for_heur(tvb, 4)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 4)) { return FALSE; } reported_length = tvb_reported_length(tvb); pi_present = tvb_get_guint8(tvb, 2) & 0x01; /* Rightmost bit in the 3rd byte */ if (pi_present) { if (tfi == 0x00 && !pi_length_found) { /* PI Bitmap present and No TB. Can calculate PI bitmap length */ guint8 pi_bit_length; pi_byte_length = reported_length - 6; /* Removing header length (4) and footer length (2)*/ switch (pi_byte_length) { case 3: /* 18 bits bitmap + padding */ pi_bit_length = 18; break; case 5: /* 36 bits bitmap + padding */ pi_bit_length = 36; break; case 9: /* 72 bits bitmap */ pi_bit_length = 72; break; case 18: /* 144 bits bitmap */ pi_bit_length = 144; break; default: return FALSE; } if (pi_bit_length == 144 && !tb_size_found) { /* Nothing has confirmed yet that this channel is a PCH since */ /* both 'tb_size_found' and 'pi_length_found' are false. */ /* Checking if the 4 LSB bits of the CFN (the 4 leftmost bits in the 3rd byte) aren't zeroed. */ /* if they aren't this is probably PCH because those are reserved in DCH */ cfn_lowest_bits = tvb_get_guint8(tvb, 2) & 0xF0; if(cfn_lowest_bits == 0) { /* Checking if the 4th byte in the frame is zeroed. In this case the CRC checks aren't */ /* deterministic enough to gurantee this is a PCH since this packet could also be a DCH frame */ /* with MAC's C/T is 0 and 4 leftmost bits of RLC are 0 */ dch_collisions_byte = tvb_get_guint8(tvb, 3); if (dch_collisions_byte == 0) { return FALSE; } } } if (!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } if(!conversation_initialized) { fill_pch_conversation_info_for_heur(umts_fp_conversation_info, pinfo); fp_pch_channel_info = (fp_pch_channel_info_t*)umts_fp_conversation_info->channel_specific_info; } fp_pch_channel_info->paging_indications = pi_bit_length; pi_length_found = TRUE; } else if (tfi == 0x01 && !tb_size_found && pi_length_found) { /* TB present and PI bitmap length is known. Can calculate TB length.*/ pi_byte_length = (fp_pch_channel_info->paging_indications + 7) / 8; if (!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } if(!conversation_initialized) { fill_pch_conversation_info_for_heur(umts_fp_conversation_info, pinfo); } tb_byte_length = (reported_length - (pi_byte_length + 6)); /* Removing header length (4), footer length (2) and PI bitmap length*/ /* Possible TB lengths for PCH is 10 or 30 bytes ( See 3GPP TR 25.944 / 4.1.1.2 ) */ if (tb_byte_length == 10 || tb_byte_length == 30) { umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = tb_byte_length * 8; tb_size_found = TRUE; } } /* TODO: It should be possible to figure both PI & TB sizes if both are present in a frame and neither is known */ /* Since the total size of the frame should be unique */ /* e.g. 19 bytes = header (4) + PI 18bits (3) + TB (10) + footer (2)*/ /* 21 bytes = header (4) + PI 36bits (5) + TB (10) + footer (2)*/ /* etc... */ /* This could mostly help dissect 'busy' PCHs where most of the frames have both PI & TB*/ } else { if (tfi == 0x01 && !tb_size_found) { /* TB present and PI bitmap is missing. Can calculate TB length.*/ if (!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } if(!conversation_initialized) { fill_pch_conversation_info_for_heur(umts_fp_conversation_info, pinfo); } tb_byte_length = (reported_length - 6); /* Removing header length (4), footer length (2) */ /* Possible TB lengths for PCH is 10 or 30 bytes ( See 3GPP TR 25.944 / 4.1.1.2 ) */ if (tb_byte_length == 10 || tb_byte_length == 30) { umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = tb_byte_length * 8; set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); tb_size_found = TRUE; } } } if (pi_length_found && tb_size_found) { /* Stream completely framed! */ conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else { /* Some data still missing */ return FALSE; } } static gboolean heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; fp_hsdsch_channel_info_t* fp_hsdsch_channel_info; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint16 mac_d_pdu_length; guint16 num_of_pdus; guint32 expected_total_size; guint32 next_pdu_index; guint16 index_step; guint8 pre_pdu_padding; /* Trying to find existing conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { fp_hsdsch_channel_info = (fp_hsdsch_channel_info_t*)umts_fp_conversation_info->channel_specific_info; if (umts_fp_conversation_info->channel == CHANNEL_HSDSCH && fp_hsdsch_channel_info->hsdsch_entity == hs) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure FP info isn't already attached */ p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (p_fp_info) { return FALSE; } captured_length = tvb_reported_length(tvb); /* Lengths limit: header size (7) + at least 1 PDU Block (2) + CRC Payload size (2)*/ if (captured_length < 11) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ return FALSE; } /* Lengths limit: Smallest HS-DSCH type 1 data frame is 55 bytes (1 PDU of 336 bits) */ reported_length = tvb_reported_length(tvb); if (reported_length < 55) { return FALSE; } mac_d_pdu_length = tvb_get_guint16(tvb, 2, ENC_NA) >> 3; /* Only valid PDU lengths are 336 or 656 */ if (mac_d_pdu_length != 336 && mac_d_pdu_length != 656) { return FALSE; } num_of_pdus = tvb_get_guint8(tvb, 4); /* PDUs count shouldn't be 0*/ if (num_of_pdus == 0) { return FALSE; } /* Maximum PDUs count constraint: 32 PDUs * 336 bits or 17 PDUs * 656 bits */ if ((mac_d_pdu_length == 336 && num_of_pdus > 32) || (mac_d_pdu_length == 656 && num_of_pdus > 17)) { return FALSE; } /* Making sure the expected packet size is smaller/equals to the entire packet's size */ expected_total_size = (num_of_pdus * mac_d_pdu_length / 8) + 7 /*Header length*/ + 2 /*Footer length*/; if (expected_total_size > captured_length || expected_total_size > reported_length) { return FALSE; } /* Iterating through the PDUs making sure the padding nibble is present in all of them */ next_pdu_index = 7; index_step = mac_d_pdu_length / 8; for (int i = 0; i < num_of_pdus; i++) { pre_pdu_padding = tvb_get_guint8(tvb, next_pdu_index) >> 4; if (pre_pdu_padding != 0x00) { /* One of the padding nibbles is not zeroed */ return FALSE; } next_pdu_index += index_step; } if (!check_header_crc_for_heur(tvb, 7)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, 7)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_HSDSCH; fp_hsdsch_channel_info = wmem_new0(wmem_file_scope(), fp_hsdsch_channel_info_t); fp_hsdsch_channel_info->hsdsch_entity = hs; fp_hsdsch_channel_info->hsdsch_macdflow_id = 0; umts_fp_conversation_info->channel_specific_info = (void*)fp_hsdsch_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; fp_hsdsch_channel_info_t* fp_hsdsch_channel_info; struct fp_info *p_fp_info; guint32 captured_length; guint32 reported_length; guint8 frame_type; guint8 reserved_fach_ind_bits; guint8 pdu_block_header_reserved_bit; guint8 pdu_block_headers_count; guint16 next_pdu_block_header_index; guint16 pdu_block_header_pdu_length; guint8 pdu_block_header_pdus_count; guint8 pdu_block_header_lchid; guint32 total_header_length; guint32 expected_payload_length; /* Trying to find existing conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { fp_hsdsch_channel_info = (fp_hsdsch_channel_info_t*)umts_fp_conversation_info->channel_specific_info; if (umts_fp_conversation_info->channel == CHANNEL_HSDSCH && fp_hsdsch_channel_info->hsdsch_entity == ehs) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure FP info isn't already attached */ p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (p_fp_info) { return FALSE; } captured_length = tvb_captured_length(tvb); reported_length = tvb_reported_length(tvb); /* Lengths limit: header size + at least 1 PDU Block Header + CRC Payload size */ if (captured_length < 11) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ return FALSE; } pdu_block_header_reserved_bit = (tvb_get_guint8(tvb, 7) & 0x10) >> 4; if (pdu_block_header_reserved_bit == 0x1) { return FALSE; } /* Expecting at least 1 PDU Block Header */ pdu_block_headers_count = tvb_get_guint8(tvb, 2) >> 3; if (pdu_block_headers_count == 0) { return FALSE; } /* Getting 3 rightmost bits in the FACH Indicator's byte, which are reserved and should be 0 */ reserved_fach_ind_bits = tvb_get_guint8(tvb, 3) & 0x03; if (reserved_fach_ind_bits != 0x00) { return FALSE; } /* Iterating through the block headers looking for invalid fields and */ /* calculating the expected total packet length */ total_header_length = 6; expected_payload_length = 0; for (int i = 0; i < pdu_block_headers_count; i++) { /* Making sure the next index is not out of range */ if (((guint32)(8 + (i * 3))) >= captured_length) { return FALSE; } /* Getting blocks length and count from the i-th header */ if (i % 2 == 0) { next_pdu_block_header_index = (i * 25) / 10; } else { next_pdu_block_header_index = (((i-1) * 25) / 10) + 2; } pdu_block_header_pdu_length = tvb_get_guint16(tvb, 6 + next_pdu_block_header_index, ENC_NA) >> 5; pdu_block_header_pdus_count = tvb_get_guint8(tvb, 7 + next_pdu_block_header_index) & 0x0F; pdu_block_header_lchid = tvb_get_guint8(tvb, 8 + next_pdu_block_header_index) >> 4; /* Making sure PDUs' Length isn't zeroed*/ if (pdu_block_header_pdu_length == 0) { return FALSE; } /* Making sure PDUs Count isn't zeroed */ if (pdu_block_header_pdus_count == 0) { return FALSE; } /* Adding this header's length to expected length*/ if (i % 2 == 0) { total_header_length += 3; } else { total_header_length += 2; } /* Adding this header's paylod's size to expected length*/ expected_payload_length += (pdu_block_header_pdu_length * pdu_block_header_pdus_count); /* Checking padding after lchid */ if ((tvb_get_guint8(tvb, 8 + (i * 3)) & 0x0F) != 0x00) { return FALSE; } /* Checking lchid for reserved value 0x0F*/ if (pdu_block_header_lchid == 0x0F) { return FALSE; } } /* Adding Payload CRC'slength to payload length*/ expected_payload_length += 2; /* Calculated expected packet size must not exceed captured length or reported length*/ if ((total_header_length + expected_payload_length) > captured_length || (total_header_length + expected_payload_length) > reported_length) { return FALSE; } if (!check_header_crc_for_heur(tvb, total_header_length)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, total_header_length)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_HSDSCH; fp_hsdsch_channel_info = wmem_new0(wmem_file_scope(), fp_hsdsch_channel_info_t); fp_hsdsch_channel_info->hsdsch_entity = ehs; fp_hsdsch_channel_info->hsdsch_macdflow_id = 1; umts_fp_conversation_info->channel_specific_info = (void*)fp_hsdsch_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } static gboolean heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; fp_edch_channel_info_t* fp_edch_channel_info; struct fp_info *p_fp_info; guint32 captured_length; guint8 frame_type; guint8 num_sub_frames_byte; guint8 number_of_subframes; guint8 number_of_mac_es_pdus; guint32 subframe_number; guint32 total_sub_headers_len; guint32 total_header_length; guint32 payload_length; guint32 total_mac_pdus_count; guint32 macd_pdu_bit_size; guint32 bit_offset; guint32 offset; guint32 i = 0; guint32 n = 0; /* Trying to find existing conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { /* Checking if the conversation was already framed */ umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { fp_edch_channel_info = (fp_edch_channel_info_t*)umts_fp_conversation_info->channel_specific_info; if (umts_fp_conversation_info->channel == CHANNEL_EDCH && fp_edch_channel_info->edch_type == 0) { conversation_set_dissector(p_conv, fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){ /* This conversation was successfuly framed as ANOTHER type */ return FALSE; } } } /* Making sure FP info isn't already attached */ p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (p_fp_info) { return FALSE; } captured_length = tvb_reported_length(tvb); /* Lengths limit: header size + at least 1 Subframe Header + CRC Payload size */ if (captured_length < 9) { return FALSE; } frame_type = tvb_get_guint8(tvb, 0) & 0x01; if (frame_type == 1) { /* is 'control' frame type*/ return FALSE; } num_sub_frames_byte = tvb_get_guint8(tvb, 2); /* Checking 4 leftmost bits in the 'Number of Subframes' byte, which are reserved and should be 0 */ if (num_sub_frames_byte & 0xf0) { return FALSE; } /* Values {11-16} are reserved */ number_of_subframes = (num_sub_frames_byte & 0x0f) + 1; if (number_of_subframes >= 11) { return FALSE; } /* Iterating through the block headers looking for invalid fields */ total_header_length = 4; offset = 4; total_mac_pdus_count = 0; /* EDCH subframe header list */ for (n=0; n < number_of_subframes; n++) { /* Making sure the next index is not out of range */ if (((guint32)(offset + 3)) >= captured_length) { return FALSE; } /* Subframe number */ subframe_number = (tvb_get_guint8(tvb, offset) & 0x07); if (subframe_number > 4) { return FALSE; } offset++; /* Number of MAC-es PDUs */ number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; if (number_of_mac_es_pdus == 0) { return FALSE; } bit_offset = 4; /* Making sure enough bytes are presesnt for all sub-header */ total_sub_headers_len = ((int)((((1.5 + (number_of_mac_es_pdus * 1.5))*8+7)/8))); if ((offset + total_sub_headers_len) >= captured_length) { return FALSE; } /* Details of each MAC-es PDU */ for (i=0; i < number_of_mac_es_pdus; i++) { guint32 n_pdus; /*Size of the PDU*/ /* DDI (6 bits) */ bit_offset += 6; /* Number of MAC-d PDUs (6 bits) */ n_pdus = tvb_get_bits8( tvb, offset*8 + bit_offset, 6); total_mac_pdus_count += n_pdus; bit_offset += 6; } total_header_length += total_sub_headers_len; offset += ((bit_offset+7)/8); } /* Figure MAC bit size */ payload_length = captured_length - total_header_length - 3; /* Removing 3 bytes for Payload CRC and TSN */ if (payload_length == (total_mac_pdus_count * 42)) { macd_pdu_bit_size = 336; } else if (payload_length == (total_mac_pdus_count * 18)) { macd_pdu_bit_size = 144; } else { /* Unexpected payload length or DDIs combination */ return FALSE; } if (!check_edch_header_crc_for_heur(tvb, total_header_length)) { return FALSE; } if (!check_payload_crc_for_heur(tvb, total_header_length)) { return FALSE; } if(!umts_fp_conversation_info) { umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); } umts_fp_conversation_info->iface_type = IuB_Interface; umts_fp_conversation_info->division = Division_FDD; umts_fp_conversation_info->dl_frame_number = pinfo->num; umts_fp_conversation_info->ul_frame_number = pinfo->num; umts_fp_conversation_info->dch_crc_present = 1; umts_fp_conversation_info->com_context_id = generate_ue_id_for_heur(pinfo); umts_fp_conversation_info->rlc_mode = FP_RLC_AM; copy_address_wmem(wmem_file_scope(), &(umts_fp_conversation_info->crnc_address), &pinfo->src); umts_fp_conversation_info->crnc_port = pinfo->srcport; umts_fp_conversation_info->channel = CHANNEL_EDCH; fp_edch_channel_info = wmem_new0(wmem_file_scope(), fp_edch_channel_info_t); fp_edch_channel_info->no_ddi_entries = 0x0f; for(i = 0;i<0x0f;i++) { fp_edch_channel_info->edch_ddi[i] = i; fp_edch_channel_info->edch_macd_pdu_size[i] = macd_pdu_bit_size; fp_edch_channel_info->edch_lchId[i] = 9; } fp_edch_channel_info->edch_type = 0; /* Type 1 */ umts_fp_conversation_info->channel_specific_info = (void*)fp_edch_channel_info; conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle); dissect_fp(tvb, pinfo, tree, data); return TRUE; } /* This method can frame UDP streams containing FP packets but dissection of those packets will */ /* fail since the FP conversation info is never attached */ /* Usefull for DCH streams containing CS data and don't have their own heuristic method */ static gboolean heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *p_conv; umts_fp_conversation_info_t* umts_fp_conversation_info = NULL; struct fp_info *p_fp_info; guint32 length; guint8 frame_type; guint32 ft; /* Trying to find existing conversation */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); /* Check if FP Conversation Info is attached */ if (p_conv != NULL) { umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); if (umts_fp_conversation_info) { if (umts_fp_conversation_info->channel == CHANNEL_UNKNOWN) { /* This stream was framed using a previous control frame, we can call FP dissector without further tests*/ dissect_fp(tvb, pinfo, tree, data); return TRUE; } else { return FALSE; } } } p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Check if per-frame FP Info is attached*/ if(p_fp_info) { /* if FP info is present, check that it really is an ethernet link */ if (p_fp_info->link_type != FP_Link_Ethernet) { return FALSE; } /* discriminate 'lower' UDP layer from 'user data' UDP layer * (i.e. if an FP over UDP packet contains a user UDP packet */ if (p_fp_info->srcport != pinfo->srcport || p_fp_info->destport != pinfo->destport) return FALSE; /* assume this is FP */ dissect_fp(tvb, pinfo, tree, data); return TRUE; } /* Both per-frame FP info and conversation FP info are missing */ /* Try to frame control frames using header CRC */ ft = (tvb_get_guint8(tvb, 0) & 0x01); if(ft != FT_CONTROL) { /* This is a Data frame, can't tell if it's FP. */ return FALSE; } length = tvb_captured_length(tvb); /* Length limit: control frames header is 2 bytes */ if (length < 2) { return FALSE; } /* Check 'Frame Type' */ frame_type = tvb_get_guint8(tvb, 1); /* 0x00 is unused for both dedicated & common FP */ if( frame_type == 0x00 ) { return FALSE; } /* Max frame types are: */ /* For common channels: 0x0E */ /* For dedicated channels: 0x0B */ /* The left nibble is zeroed in both cases */ if( (frame_type & 0xF0) != 0x00) { return FALSE; } /* Checking Header CRC*/ if (!check_control_frame_crc_for_heur(tvb)) { /* The CRC is incorrect */ return FALSE; } /* The CRC is correct! */ /* Attaching 'FP Conversation Info' to the UDP conversation so other */ /* packets (both Control AND Data) will be marked as FP */ umts_fp_conversation_info = wmem_new0(wmem_file_scope(), umts_fp_conversation_info_t); umts_fp_conversation_info->channel = CHANNEL_UNKNOWN; set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info); /* Call FP Dissector for the current frame */ dissect_fp(tvb, pinfo, tree, data); return TRUE; } /* This method wraps the heuristic dissectors of all supported channels */ static gboolean heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gboolean match; match = heur_dissect_fp_dcch_over_dch(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_fach1(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_fach2(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_rach(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_pch(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_hsdsch_type_1(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_hsdsch_type_2(tvb, pinfo, tree, data); if(match) return TRUE; match = heur_dissect_fp_edch_type_1(tvb, pinfo, tree, data); if(match) return TRUE; /* NOTE: Add new heuristic dissectors BEFORE the 'unknown format' dissector */ /* since it might 'swallow' packets if the UDP stream is framed as 'CHANNEL_UNKNOWN' */ match = heur_dissect_fp_unknown_format(tvb, pinfo, tree, data); if(match) return TRUE; return FALSE; } static guint8 fakes =5; /*[] ={1,5,8};*/ static guint8 fake_map[256]; /* * TODO: This need to be fixed! * Basically you would want the actual RRC messages, that sooner or later maps * transport channel id's to logical id's or RAB IDs * to set the proper logical channel/RAB ID, but for now we make syntethic ones. * */ static guint8 make_fake_lchid(packet_info *pinfo _U_, gint trchld) { if ( fake_map[trchld] == 0) { fake_map[trchld] = fakes; fakes++; } return fake_map[trchld]; } /* Tries to resolve the U-RNTI of a channel user based on info in the fp conv info */ static void fp_conv_resolve_urnti(umts_fp_conversation_info_t *p_conv_data) { /* Trying to resolve the U-RNTI of the user if missing */ /* Resolving based on the 'C-RNC Communication Context' field found in NBAP */ if (!p_conv_data->urnti && p_conv_data->com_context_id != 0) { guint32 * mapped_urnti = (guint32 *)(wmem_tree_lookup32(nbap_crncc_urnti_map,p_conv_data->com_context_id)); if (mapped_urnti != 0) { p_conv_data->urnti = GPOINTER_TO_UINT(mapped_urnti); } } } /* Figures the best "UE ID" to use in RLC reassembly logic */ static guint32 get_ue_id_from_conv(umts_fp_conversation_info_t *p_conv_data) { guint32 user_identity; /* Choosing RLC 'UE ID': */ /* 1. Preferring the U-RNTI if attached */ /* 2. Fallback - Using the 'C-RNC Communication Context' used in NBAP for this user */ user_identity = p_conv_data->com_context_id; if(p_conv_data->urnti) { user_identity = p_conv_data->urnti; } return user_identity; } static fp_info * fp_set_per_packet_inf_from_conv(conversation_t *p_conv, umts_fp_conversation_info_t *p_conv_data, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_) { fp_info *fpi; guint8 tfi, c_t, lchid; int offset = 0, i=0, j=0, num_tbs, chan, tb_size, tb_bit_off; guint32 ft; gboolean is_known_dcch_tf,is_stndalone_ps_rab_tf,is_muxed_cs_ps_tf; umts_mac_info *macinf; rlc_info *rlcinf; guint8 fake_lchid=0; gint *cur_val=NULL; fp_hsdsch_channel_info_t* fp_hsdsch_channel_info = NULL; fp_edch_channel_info_t* fp_edch_channel_info = NULL; fp_pch_channel_info_t *fp_pch_channel_info = NULL; fp_fach_channel_info_t* fp_fach_channel_info = NULL; fp_rach_channel_info_t* fp_rach_channel_info = NULL; gboolean info_missing = FALSE; fpi = wmem_new0(wmem_file_scope(), fp_info); p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, fpi); fpi->iface_type = p_conv_data->iface_type; fpi->division = p_conv_data->division; fpi->release = 7; /* Set values greater then the checks performed */ fpi->release_year = 2006; fpi->release_month = 12; fpi->channel = p_conv_data->channel; fpi->dch_crc_present = p_conv_data->dch_crc_present; fpi->link_type = FP_Link_Ethernet; #if 0 /*Only do this the first run, signals that we need to reset the RLC fragtable*/ if (!PINFO_FD_VISITED(pinfo) && p_conv_data->reset_frag ) { fpi->reset_frag = p_conv_data->reset_frag; p_conv_data->reset_frag = FALSE; } #endif /* remember 'lower' UDP layer port information so we can later * differentiate 'lower' UDP layer from 'user data' UDP layer */ fpi->srcport = pinfo->srcport; fpi->destport = pinfo->destport; fpi->com_context_id = p_conv_data->com_context_id; if(!p_conv_data->urnti) { fp_conv_resolve_urnti(p_conv_data); } fpi->urnti = p_conv_data->urnti; if (pinfo->link_dir == P2P_DIR_UL) { fpi->is_uplink = TRUE; } else { fpi->is_uplink = FALSE; } ft = tvb_get_guint8(tvb, offset) & 0x01; switch (fpi->channel) { case CHANNEL_HSDSCH: /* HS-DSCH - High Speed Downlink Shared Channel */ fp_hsdsch_channel_info = (fp_hsdsch_channel_info_t*)p_conv_data->channel_specific_info; if(fp_hsdsch_channel_info == NULL) { proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1, "Can't dissect HS-DSCH FP stream because no per-conversation channel info was attached!"); info_missing = TRUE; break; } fpi->hsdsch_entity = fp_hsdsch_channel_info->hsdsch_entity; fpi->hsdsch_rlc_mode = p_conv_data->rlc_mode; macinf = wmem_new0(wmem_file_scope(), umts_mac_info); fpi->hsdsch_macflowd_id = fp_hsdsch_channel_info->hsdsch_macdflow_id; macinf->content[0] = hsdsch_macdflow_id_mac_content_map[fp_hsdsch_channel_info->hsdsch_macdflow_id]; macinf->lchid[0] = fp_hsdsch_channel_info->hsdsch_macdflow_id; p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); rlcinf = wmem_new0(wmem_file_scope(), rlc_info); /*Figure out RLC_MODE based on MACd-flow-ID, basically MACd-flow-ID = 0 then it's SRB0 == UM else AM*/ rlcinf->mode[0] = hsdsch_macdflow_id_rlc_map[fp_hsdsch_channel_info->hsdsch_macdflow_id]; if (fpi->hsdsch_entity == hs) { for (i=0; i<MAX_NUM_HSDHSCH_MACDFLOW; i++) { /*Figure out if this channel is multiplexed (signaled from RRC)*/ if ((cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)fp_hsdsch_channel_info->hrnti))) != NULL) { j = 1 << i; fpi->hsdhsch_macfdlow_is_mux[i] = j & *cur_val; } else { fpi->hsdhsch_macfdlow_is_mux[i] = FALSE; } } } rlcinf->ueid[0] = get_ue_id_from_conv(p_conv_data); rlcinf->li_size[0] = RLC_LI_7BITS; rlcinf->ciphered[0] = FALSE; rlcinf->deciphered[0] = FALSE; p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); return fpi; case CHANNEL_EDCH: fp_edch_channel_info = (fp_edch_channel_info_t*)p_conv_data->channel_specific_info; if(fp_edch_channel_info == NULL) { proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1, "Can't dissect E-DCH FP stream because no per-conversation channel info was attached!"); info_missing = TRUE; break; } macinf = wmem_new0(wmem_file_scope(), umts_mac_info); rlcinf = wmem_new0(wmem_file_scope(), rlc_info); fpi->no_ddi_entries = fp_edch_channel_info->no_ddi_entries; for (i=0; i<fpi->no_ddi_entries; i++) { fpi->edch_ddi[i] = fp_edch_channel_info->edch_ddi[i]; /*Set the DDI value*/ fpi->edch_macd_pdu_size[i] = fp_edch_channel_info->edch_macd_pdu_size[i]; /*Set the PDU size*/ fpi->edch_lchId[i] = fp_edch_channel_info->edch_lchId[i]; /*Set the channel id for this entry*/ } fpi->edch_type = fp_edch_channel_info->edch_type; rlcinf->ueid[0] = get_ue_id_from_conv(p_conv_data); rlcinf->li_size[0] = RLC_LI_7BITS; rlcinf->ciphered[0] = FALSE; rlcinf->deciphered[0] = FALSE; p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); return fpi; case CHANNEL_PCH: fp_pch_channel_info = (fp_pch_channel_info_t*)p_conv_data->channel_specific_info; if(fp_pch_channel_info == NULL) { proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1, "Can't dissect PCH FP stream because no per-conversation channel info was attached!"); info_missing = TRUE; break; } fpi->paging_indications = fp_pch_channel_info->paging_indications; fpi->num_chans = p_conv_data->num_dch_in_flow; if (ft == FT_CONTROL) { /* control frame, we're done */ return fpi; } /* Inesrting Paging Indication Info extracted from the previous packet */ fpi->relevant_paging_indications = fp_pch_channel_info->last_paging_indication_info; fp_pch_channel_info->last_paging_indication_info = NULL; /* Set offset to TFI */ offset = 3; break; case CHANNEL_DCH: fpi->num_chans = p_conv_data->num_dch_in_flow; if (ft == FT_CONTROL) { /* control frame, we're done */ return fpi; } rlcinf = wmem_new0(wmem_file_scope(), rlc_info); macinf = wmem_new0(wmem_file_scope(), umts_mac_info); offset = 2; /* Set offset to TFI */ fakes = 5; /* Reset fake counter */ for (chan=0; chan < fpi->num_chans; chan++) { /* Iterate over the DCH channels in the flow (each given a TFI) */ /* TFI is 5 bits according to 3GPP TS 25.427, paragraph 6.2.4.4 */ tfi = tvb_get_bits8(tvb, 3+offset*8, 5); /* Figure out the number of TBs and size */ num_tbs = (fpi->is_uplink) ? p_conv_data->fp_dch_channel_info[chan].ul_chan_num_tbs[tfi] : p_conv_data->fp_dch_channel_info[chan].dl_chan_num_tbs[tfi]; tb_size = (fpi->is_uplink) ? p_conv_data->fp_dch_channel_info[chan].ul_chan_tf_size[tfi] : p_conv_data->fp_dch_channel_info[chan].dl_chan_tf_size[tfi]; tb_bit_off = (2 + p_conv_data->num_dch_in_flow) * 8; /*Point to the C/T of first TB*/ /* Iterate over the Transport Blocks */ /* Set configuration for each individual block */ for (j=0; j < num_tbs && j+chan < MAX_MAC_FRAMES; j++) { /* Set transport channel id (useful for debugging) */ macinf->trchid[j+chan] = p_conv_data->dch_ids_in_flow_list[chan]; /* Checking for the common Transport Format of 3.4 kbps SRBs for DCCH ( See 3GPP TR 25.944 / 4.1.1.3.1.1 ) */ is_known_dcch_tf = (tfi == 1 && num_tbs == 1 && tb_size == 148); /* Checking for Transport Format of interactive or background PS RAB ( See 3GPP TS 34.108 / 6.10.2.4.1.23 -> 6.10.2.4.1.35 ) */ is_stndalone_ps_rab_tf = tb_size == 336; /* Checking for Transport Format of muxed CS & PS RABs ( See 3GPP TS 34.108 / 6.10.2.4.1.38 -> 6.10.2.4.1.51 ) */ is_muxed_cs_ps_tf = (p_conv_data->dch_ids_in_flow_list[chan] == 24 && tb_size == 340); if (is_known_dcch_tf || is_muxed_cs_ps_tf) { /* Channel is multiplexed (ie. C/T field present) */ macinf->ctmux[j+chan] = TRUE; /* Peek at C/T, different RLC params for different logical channels */ /* C/T is 4 bits according to 3GPP TS 25.321, paragraph 9.2.1, from MAC header (not FP) */ c_t = tvb_get_bits8(tvb, tb_bit_off, 4); lchid = (c_t + 1) % 0xf; /* C/T field represents the Logical Channel ID but it is zero-based */ macinf->lchid[j+chan] = lchid; macinf->content[j+chan] = lchId_type_table[lchid]; /* Base MAC content on logical channel id (Table is in packet-nbap.h) */ rlcinf->mode[j+chan] = lchId_rlc_map[lchid]; /* Base RLC mode on logical channel id */ } else if (is_stndalone_ps_rab_tf) { /* Channel isn't multiplexed (ie. C/T field not present) */ macinf->ctmux[j+chan] = FALSE; /* Using a fake 'interactive PS' DTCH logical channel id */ /* TODO: Once proper lchid is always set, this has to be changed */ macinf->fake_chid[j+chan] = TRUE; macinf->lchid[j+chan] = 11; macinf->content[j+chan] = MAC_CONTENT_PS_DTCH; rlcinf->mode[j+chan] = RLC_AM; } else { /* Unfamiliar DCH format, faking LCHID */ /* Asuming the channel isn't multiplexed (ie. C/T field not present) */ macinf->ctmux[j+chan] = FALSE; /* TODO: This stuff has to be reworked! */ /* Generates a fake logical channel id for non multiplexed channel */ fake_lchid = make_fake_lchid(pinfo, p_conv_data->dch_ids_in_flow_list[chan]); macinf->content[j+chan] = lchId_type_table[fake_lchid]; rlcinf->mode[j+chan] = lchId_rlc_map[fake_lchid]; /************************/ /* TODO: Once proper lchid is always set, this has to be removed */ macinf->fake_chid[j+chan] = TRUE; macinf->lchid[j+chan] = fake_lchid; /************************/ } /* Set RLC data */ rlcinf->ueid[j + chan] = get_ue_id_from_conv(p_conv_data); rlcinf->li_size[j+chan] = RLC_LI_7BITS; rlcinf->ciphered[j+chan] = FALSE; rlcinf->deciphered[j+chan] = FALSE; rlcinf->rbid[j+chan] = macinf->lchid[j+chan]; /*Step over this TB and it's C/T field.*/ tb_bit_off += tb_size+4; } offset++; } p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); /* Set offset to point to first TFI */ offset = 2; break; case CHANNEL_FACH_FDD: fp_fach_channel_info = (fp_fach_channel_info_t*)p_conv_data->channel_specific_info; if(fp_fach_channel_info == NULL) { proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1, "Can't dissect FACH FP stream because no per-conversation channel info was attached!"); info_missing = TRUE; break; } fpi->num_chans = p_conv_data->num_dch_in_flow; if (ft == FT_CONTROL) { /* control frame, we're done */ return fpi; } /* Set offset to TFI */ offset = 2; /* Set MAC data */ macinf = wmem_new0(wmem_file_scope(), umts_mac_info); macinf->ctmux[0] = 1; macinf->content[0] = MAC_CONTENT_DCCH; p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); /* Set RLC data */ rlcinf = wmem_new0(wmem_file_scope(), rlc_info); /* For RLC reassembly to work we need to fake a "UE ID" as an identifier of this stream.*/ /* Using the (UDP) conversation's ID and the prefix of 0xFFF */ rlcinf->ueid[0] = (p_conv->conv_index | 0xFFF00000); rlcinf->mode[0] = RLC_AM; rlcinf->li_size[0] = RLC_LI_7BITS; rlcinf->ciphered[0] = FALSE; rlcinf->deciphered[0] = FALSE; p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); break; case CHANNEL_RACH_FDD: fp_rach_channel_info = (fp_rach_channel_info_t*)p_conv_data->channel_specific_info; if(fp_rach_channel_info == NULL) { proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1, "Can't dissect RACH FP stream because no per-conversation channel info was attached!"); info_missing = TRUE; break; } fpi->num_chans = p_conv_data->num_dch_in_flow; if (ft == FT_CONTROL) { /* control frame, we're done */ return fpi; } /* Set offset to TFI */ offset = 2; /* set MAC & RLC data */ macinf = wmem_new0(wmem_file_scope(), umts_mac_info); rlcinf = wmem_new0(wmem_file_scope(), rlc_info); for ( chan = 0; chan < fpi->num_chans; chan++ ) { macinf->ctmux[chan] = 1; macinf->content[chan] = MAC_CONTENT_DCCH; /* RLC dissector's reassembly requires a non-zero stream identifier ('UE ID') to work */ /* For DCCH: MAC dissector will override this with C-RNTI/U-RNTI */ /* For CCCH: RLC's mode is TM and the dissector does not reassemble at all - showing 0 in the UI to indicate that */ rlcinf->ueid[chan] = 0; } p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); break; case CHANNEL_HSDSCH_COMMON: rlcinf = wmem_new0(wmem_file_scope(), rlc_info); macinf = wmem_new0(wmem_file_scope(), umts_mac_info); p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf); p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf); break; default: expert_add_info(pinfo, NULL, &ei_fp_transport_channel_type_unknown); info_missing = TRUE; break; } if(info_missing) { /* Some information was missing in the conversation struct and the FP info isn't complete */ p_remove_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); wmem_free(wmem_file_scope(), fpi); return NULL; } /* Peek at the packet as the per packet info seems not to take the tfi into account */ for (i=0; i<fpi->num_chans; i++) { /*TFI is 5 bits according to 3GPP TS 25.427, paragraph 6.2.4.4*/ tfi = tvb_get_guint8(tvb, offset) & 0x1f; if (pinfo->link_dir == P2P_DIR_UL) { fpi->chan_tf_size[i] = p_conv_data->fp_dch_channel_info[i].ul_chan_tf_size[tfi]; fpi->chan_num_tbs[i] = p_conv_data->fp_dch_channel_info[i].ul_chan_num_tbs[tfi]; } else { fpi->chan_tf_size[i] = p_conv_data->fp_dch_channel_info[i].dl_chan_tf_size[tfi]; fpi->chan_num_tbs[i] = p_conv_data->fp_dch_channel_info[i].dl_chan_num_tbs[tfi]; } offset++; } return fpi; } /* Updates the conversation info of a PCH stream based on information parsed in the current frame*/ static void update_pch_coversation_info(umts_fp_conversation_info_t *p_conv_data, packet_info *pinfo, struct fp_info *p_fp_info) { fp_pch_channel_info_t* fp_pch_channel_info; /* The channel type MUST be set to PCH */ DISSECTOR_ASSERT(p_conv_data); DISSECTOR_ASSERT(p_conv_data->channel == CHANNEL_PCH); fp_pch_channel_info = (fp_pch_channel_info_t*)p_conv_data->channel_specific_info; if(p_fp_info->current_paging_indications && !PINFO_FD_VISITED(pinfo)) { /* Saving the PI info for the next packet to find */ fp_pch_channel_info->last_paging_indication_info = p_fp_info->current_paging_indications; /* Resetting this field so we don't add it again to the conversation next time the packet is parsed */ p_fp_info->current_paging_indications = NULL; } } /*****************************/ /* Main dissection function. */ static int dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *fp_tree; proto_item *ti; gint offset = 0; struct fp_info *p_fp_info; conversation_t *p_conv = NULL; umts_fp_conversation_info_t *p_conv_data = NULL; /* Append this protocol name rather than replace. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP"); /* Create fp tree. */ ti = proto_tree_add_item(tree, proto_fp, tvb, offset, -1, ENC_NA); fp_tree = proto_item_add_subtree(ti, ett_fp); top_level_tree = tree; /* Look for packet info! */ p_fp_info = (struct fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Check if we have conversation info */ /* Trying to find exact match - with both RNC's address & port and Node B's address & port */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, 0); if (p_conv) { p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); } if (!p_conv || !p_conv_data) { /* Didn't find exact conversation match */ /* Try to find a partial match with just the source/destination included */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv) { p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); } } if (p_conv_data) { /*Figure out the direction of the link*/ if (addresses_equal(&(pinfo->net_dst), (&p_conv_data->crnc_address))) { /* Node B -> CRNC*/ pinfo->link_dir=P2P_DIR_UL; proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_ul_setup_frame, tvb, 0, 0, p_conv_data->ul_frame_number); proto_item_set_generated(item); } else { /* CRNC -> Node B */ pinfo->link_dir=P2P_DIR_DL; /* Maybe the frame number should be stored in the proper location already in nbap?, in ul_frame_number*/ proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_dl_setup_frame, tvb, 0, 0, p_conv_data->ul_frame_number); proto_item_set_generated(item); } if (p_fp_info == NULL) { p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); } } if (pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (pinfo->link_dir == P2P_DIR_UL) { pinfo->p2p_dir = P2P_DIR_RECV; } else { pinfo->p2p_dir = P2P_DIR_SENT; } } /* Can't dissect anything without it... */ if (p_fp_info == NULL) { proto_tree_add_expert(fp_tree, pinfo, &ei_fp_no_per_frame_info, tvb, offset, -1); return 1; } /* Show release information */ if (preferences_show_release_info) { proto_item *release_ti; proto_tree *release_tree; proto_item *temp_ti; release_ti = proto_tree_add_item(fp_tree, hf_fp_release, tvb, 0, 0, ENC_NA); proto_item_set_generated(release_ti); proto_item_append_text(release_ti, " R%u (%d/%d)", p_fp_info->release, p_fp_info->release_year, p_fp_info->release_month); release_tree = proto_item_add_subtree(release_ti, ett_fp_release); temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_version, tvb, 0, 0, p_fp_info->release); proto_item_set_generated(temp_ti); temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_year, tvb, 0, 0, p_fp_info->release_year); proto_item_set_generated(temp_ti); temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_month, tvb, 0, 0, p_fp_info->release_month); proto_item_set_generated(temp_ti); } /* Show channel type in info column, tree */ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(p_fp_info->channel, channel_type_vals, "Unknown channel type")); if (p_conv_data) { int i; col_append_fstr(pinfo->cinfo, COL_INFO, "(%u", p_conv_data->dch_ids_in_flow_list[0]); for (i=1; i < p_conv_data->num_dch_in_flow; i++) { col_append_fstr(pinfo->cinfo, COL_INFO, ",%u", p_conv_data->dch_ids_in_flow_list[i]); } col_append_fstr(pinfo->cinfo, COL_INFO, ") "); } proto_item_append_text(ti, " (%s)", val_to_str_const(p_fp_info->channel, channel_type_vals, "Unknown channel type")); /* Add channel type as a generated field */ ti = proto_tree_add_uint(fp_tree, hf_fp_channel_type, tvb, 0, 0, p_fp_info->channel); proto_item_set_generated(ti); /* Add division type as a generated field */ if (p_fp_info->release == 7) { ti = proto_tree_add_uint(fp_tree, hf_fp_division, tvb, 0, 0, p_fp_info->division); proto_item_set_generated(ti); } /* Add link direction as a generated field */ ti = proto_tree_add_boolean(fp_tree, hf_fp_direction, tvb, 0, 0, p_fp_info->is_uplink); proto_item_set_generated(ti); /* Don't currently handle IuR-specific formats, but it's useful to even see the channel type and direction */ if (p_fp_info->iface_type == IuR_Interface) { return 1; } /* Show DDI config info */ if (p_fp_info->no_ddi_entries > 0) { int n; proto_item *ddi_config_ti; proto_tree *ddi_config_tree; ddi_config_ti = proto_tree_add_string_format(fp_tree, hf_fp_ddi_config, tvb, offset, 0, "", "DDI Config ("); proto_item_set_generated(ddi_config_ti); ddi_config_tree = proto_item_add_subtree(ddi_config_ti, ett_fp_ddi_config); /* Add each entry */ for (n=0; n < p_fp_info->no_ddi_entries; n++) { proto_item_append_text(ddi_config_ti, "%s%u->%ubits", (n == 0) ? "" : " ", p_fp_info->edch_ddi[n], p_fp_info->edch_macd_pdu_size[n]); ti = proto_tree_add_uint(ddi_config_tree, hf_fp_ddi_config_ddi, tvb, 0, 0, p_fp_info->edch_ddi[n]); proto_item_set_generated(ti); ti = proto_tree_add_uint(ddi_config_tree, hf_fp_ddi_config_macd_pdu_size, tvb, 0, 0, p_fp_info->edch_macd_pdu_size[n]); proto_item_set_generated(ti); } proto_item_append_text(ddi_config_ti, ")"); } /*************************************/ /* Dissect according to channel type */ switch (p_fp_info->channel) { case CHANNEL_RACH_TDD: case CHANNEL_RACH_TDD_128: case CHANNEL_RACH_FDD: dissect_rach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; case CHANNEL_DCH: dissect_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; case CHANNEL_FACH_FDD: case CHANNEL_FACH_TDD: dissect_fach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; case CHANNEL_DSCH_FDD: case CHANNEL_DSCH_TDD: dissect_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info); break; case CHANNEL_USCH_TDD_128: case CHANNEL_USCH_TDD_384: dissect_usch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info); break; case CHANNEL_PCH: dissect_pch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); update_pch_coversation_info(p_conv_data, pinfo, p_fp_info); break; case CHANNEL_CPCH: dissect_cpch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info); break; case CHANNEL_BCH: dissect_bch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info); break; case CHANNEL_HSDSCH: /* Show configured MAC HS-DSCH entity in use */ if (fp_tree) { proto_item *entity_ti; entity_ti = proto_tree_add_uint(fp_tree, hf_fp_hsdsch_entity, tvb, 0, 0, p_fp_info->hsdsch_entity); proto_item_set_generated(entity_ti); } switch (p_fp_info->hsdsch_entity) { case entity_not_specified: case hs: /* This is the pre-R7 default */ dissect_hsdsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; case ehs: dissect_hsdsch_type_2_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; default: /* Report Error */ expert_add_info(pinfo, NULL, &ei_fp_hsdsch_entity_not_specified); break; } break; case CHANNEL_HSDSCH_COMMON: expert_add_info(pinfo, NULL, &ei_fp_hsdsch_common_experimental_support); /*if (FALSE)*/ dissect_hsdsch_common_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data); break; case CHANNEL_HSDSCH_COMMON_T3: expert_add_info(pinfo, NULL, &ei_fp_hsdsch_common_t3_not_implemented); /* TODO: */ break; case CHANNEL_IUR_CPCHF: /* TODO: */ break; case CHANNEL_IUR_FACH: /* TODO: */ break; case CHANNEL_IUR_DSCH: dissect_iur_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info); break; case CHANNEL_EDCH: case CHANNEL_EDCH_COMMON: /* Show configured MAC E-DCH entity in use */ if (fp_tree) { proto_item *entity_ti; entity_ti = proto_tree_add_uint(fp_tree, hf_fp_edch_entity, tvb, 0, 0, p_fp_info->edch_type); proto_item_set_generated(entity_ti); } dissect_e_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, p_fp_info->channel == CHANNEL_EDCH_COMMON, data); break; default: expert_add_info(pinfo, NULL, &ei_fp_channel_type_unknown); break; } return tvb_captured_length(tvb); } static int dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return dissect_fp_common(tvb, pinfo, tree, NULL); } static int dissect_fp_aal2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { return dissect_fp_common(tvb, pinfo, tree, data); } void proto_register_fp(void) { static hf_register_info hf[] = { { &hf_fp_release, { "Release", "fp.release", FT_NONE, BASE_NONE, NULL, 0x0, "Release information", HFILL } }, { &hf_fp_release_version, { "Release Version", "fp.release.version", FT_UINT8, BASE_DEC, NULL, 0x0, "3GPP Release number", HFILL } }, { &hf_fp_release_year, { "Release year", "fp.release.year", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_release_month, { "Release month", "fp.release.month", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_channel_type, { "Channel Type", "fp.channel-type", FT_UINT8, BASE_HEX, VALS(channel_type_vals), 0x0, NULL, HFILL } }, { &hf_fp_division, { "Division", "fp.division", FT_UINT8, BASE_HEX, VALS(division_vals), 0x0, "Radio division type", HFILL } }, { &hf_fp_direction, { "Direction", "fp.direction", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x0, "Link direction", HFILL } }, { &hf_fp_ddi_config, { "DDI Config", "fp.ddi-config", FT_STRING, BASE_NONE, NULL, 0x0, "DDI Config (for E-DCH)", HFILL } }, { &hf_fp_ddi_config_ddi, { "DDI", "fp.ddi-config.ddi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_ddi_config_macd_pdu_size, { "MACd PDU Size", "fp.ddi-config.macd-pdu-size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_header_crc, { "Header CRC", "fp.header-crc", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, { &hf_fp_ft, { "Frame Type", "fp.ft", FT_UINT8, BASE_HEX, VALS(frame_type_vals), 0x01, NULL, HFILL } }, { &hf_fp_cfn, { "CFN", "fp.cfn", FT_UINT8, BASE_DEC, NULL, 0x0, "Connection Frame Number", HFILL } }, { &hf_fp_pch_cfn, { "CFN (PCH)", "fp.pch.cfn", FT_UINT16, BASE_DEC, NULL, 0xfff0, "PCH Connection Frame Number", HFILL } }, { &hf_fp_pch_toa, { "ToA (PCH)", "fp.pch.toa", FT_INT24, BASE_DEC, NULL, 0x0, "PCH Time of Arrival", HFILL } }, { &hf_fp_cfn_control, { "CFN control", "fp.cfn-control", FT_UINT8, BASE_DEC, NULL, 0x0, "Connection Frame Number Control", HFILL } }, { &hf_fp_toa, { "ToA", "fp.toa", FT_INT16, BASE_DEC, NULL, 0x0, "Time of arrival (units are 125 microseconds)", HFILL } }, { &hf_fp_tb, { "TB", "fp.tb", FT_BYTES, BASE_NONE, NULL, 0x0, "Transport Block", HFILL } }, { &hf_fp_chan_zero_tbs, { "No TBs for channel", "fp.channel-with-zero-tbs", FT_UINT32, BASE_DEC, NULL, 0x0, "Channel with 0 TBs", HFILL } }, { &hf_fp_tfi, { "TFI", "fp.tfi", FT_UINT8, BASE_DEC, NULL, 0x0, "Transport Format Indicator", HFILL } }, { &hf_fp_usch_tfi, { "TFI", "fp.usch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f, "USCH Transport Format Indicator", HFILL } }, { &hf_fp_cpch_tfi, { "TFI", "fp.cpch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f, "CPCH Transport Format Indicator", HFILL } }, { &hf_fp_propagation_delay, { "Propagation Delay", "fp.propagation-delay", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_dch_control_frame_type, { "Control Frame Type", "fp.dch.control.frame-type", FT_UINT8, BASE_HEX, VALS(dch_control_frame_type_vals), 0x0, "DCH Control Frame Type", HFILL } }, { &hf_fp_dch_rx_timing_deviation, { "Rx Timing Deviation", "fp.dch.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0, "DCH Rx Timing Deviation", HFILL } }, { &hf_fp_quality_estimate, { "Quality Estimate", "fp.dch.quality-estimate", FT_UINT8, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_payload_crc, { "Payload CRC", "fp.payload-crc", FT_UINT16, BASE_HEX, 0, 0x0, NULL, HFILL } }, { &hf_fp_payload_crc_status, { "Payload CRC Status", "fp.payload-crc.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL } }, { &hf_fp_common_control_frame_type, { "Control Frame Type", "fp.common.control.frame-type", FT_UINT8, BASE_HEX, VALS(common_control_frame_type_vals), 0x0, "Common Control Frame Type", HFILL } }, { &hf_fp_crci[0], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x80, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[1], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x40, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[2], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x20, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[3], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x10, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[4], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x08, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[5], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x04, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[6], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x02, "CRC correctness indicator", HFILL } }, { &hf_fp_crci[7], { "CRCI", "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x01, "CRC correctness indicator", HFILL } }, { &hf_fp_received_sync_ul_timing_deviation, { "Received SYNC UL Timing Deviation", "fp.rx-sync-ul-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_pch_pi, { "Paging Indication", "fp.pch.pi", FT_UINT8, BASE_DEC, VALS(paging_indication_vals), 0x01, "Indicates if the PI Bitmap is present", HFILL } }, { &hf_fp_pch_tfi, { "TFI", "fp.pch.tfi", FT_UINT8, BASE_DEC, 0, 0x1f, "PCH Transport Format Indicator", HFILL } }, { &hf_fp_fach_tfi, { "TFI", "fp.fach.tfi", FT_UINT8, BASE_DEC, 0, 0x1f, "FACH Transport Format Indicator", HFILL } }, { &hf_fp_transmit_power_level, { "Transmit Power Level", "fp.transmit-power-level", FT_FLOAT, BASE_NONE, 0, 0x0, "Transmit Power Level (dB)", HFILL } }, { &hf_fp_pdsch_set_id, { "PDSCH Set Id", "fp.pdsch-set-id", FT_UINT8, BASE_DEC, 0, 0x0, "A pointer to the PDSCH Set which shall be used to transmit", HFILL } }, { &hf_fp_paging_indication_bitmap, { "Paging Indications bitmap", "fp.pch.pi-bitmap", FT_BYTES , BASE_NONE, NULL, 0x0, "Paging Indication bitmap", HFILL } }, { &hf_fp_relevant_paging_indication_bitmap, { "Relevant Paging Indications bitmap", "fp.pch.relevant-pi-bitmap", FT_BYTES , BASE_NONE, NULL, 0x0, "The Paging Indication bitmap used to inform users about the current frame", HFILL } }, { &hf_fp_rx_timing_deviation, { "Rx Timing Deviation", "fp.common.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0, "Common Rx Timing Deviation", HFILL } }, { &hf_fp_dch_e_rucch_flag, { "E-RUCCH Flag", "fp.common.control.e-rucch-flag", FT_UINT8, BASE_DEC, VALS(e_rucch_flag_vals), 0x0, NULL, HFILL } }, { &hf_fp_edch_header_crc, { "E-DCH Header CRC", "fp.edch.header-crc", FT_UINT16, BASE_HEX, 0, 0, NULL, HFILL } }, { &hf_fp_edch_fsn, { "FSN", "fp.edch.fsn", FT_UINT8, BASE_DEC, 0, 0x0f, "E-DCH Frame Sequence Number", HFILL } }, { &hf_fp_edch_number_of_subframes, { "No of subframes", "fp.edch.no-of-subframes", FT_UINT8, BASE_DEC, 0, 0x0f, "E-DCH Number of subframes", HFILL } }, { &hf_fp_edch_harq_retransmissions, { "No of HARQ Retransmissions", "fp.edch.no-of-harq-retransmissions", FT_UINT8, BASE_DEC, 0, 0x78, "E-DCH Number of HARQ retransmissions", HFILL } }, { &hf_fp_edch_subframe_number, { "Subframe number", "fp.edch.subframe-number", FT_UINT8, BASE_DEC, 0, 0x0, "E-DCH Subframe number", HFILL } }, { &hf_fp_edch_number_of_mac_es_pdus, { "Number of Mac-es PDUs", "fp.edch.number-of-mac-es-pdus", FT_UINT8, BASE_DEC, 0, 0xf0, NULL, HFILL } }, { &hf_fp_edch_ddi, { "DDI", "fp.edch.ddi", FT_UINT8, BASE_DEC, 0, 0x0, "E-DCH Data Description Indicator", HFILL } }, { &hf_fp_edch_subframe, { "Subframe", "fp.edch.subframe", FT_STRING, BASE_NONE, NULL, 0x0, "EDCH Subframe", HFILL } }, { &hf_fp_edch_subframe_header, { "Subframe header", "fp.edch.subframe-header", FT_STRING, BASE_NONE, NULL, 0x0, "EDCH Subframe header", HFILL } }, { &hf_fp_edch_number_of_mac_d_pdus, { "Number of Mac-d PDUs", "fp.edch.number-of-mac-d-pdus", FT_UINT8, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_edch_pdu_padding, { "Padding", "fp.edch-data-padding", FT_UINT8, BASE_DEC, 0, 0xc0, "E-DCH padding before PDU", HFILL } }, { &hf_fp_edch_tsn, { "TSN", "fp.edch-tsn", FT_UINT8, BASE_DEC, 0, 0x3f, "E-DCH Transmission Sequence Number", HFILL } }, { &hf_fp_edch_mac_es_pdu, { "MAC-es PDU", "fp.edch.mac-es-pdu", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_edch_user_buffer_size, { "User Buffer Size", "fp.edch.user-buffer-size", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_edch_no_macid_sdus, { "No of MAC-is SDUs", "fp.edch.no-macis-sdus", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_edch_number_of_mac_is_pdus, { "Number of Mac-is PDUs", "fp.edch.number-of-mac-is-pdus", FT_UINT8, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_edch_mac_is_pdu, { "Mac-is PDU", "fp.edch.mac-is-pdu", FT_BYTES, BASE_NONE, 0, 0x0, NULL, HFILL } }, { &hf_fp_edch_e_rnti, { "E-RNTI", "fp.edch.e-rnti", FT_UINT16, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_edch_macis_descriptors, { "MAC-is Descriptors", "fp.edch.mac-is.descriptors", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_edch_macis_lchid, { "LCH-ID", "fp.edch.mac-is.lchid", FT_UINT8, BASE_HEX, VALS(lchid_vals), 0xf0, NULL, HFILL } }, { &hf_fp_edch_macis_length, { "Length", "fp.edch.mac-is.length", FT_UINT16, BASE_DEC, 0, 0x0ffe, NULL, HFILL } }, { &hf_fp_edch_macis_flag, { "Flag", "fp.edch.mac-is.flag", FT_UINT8, BASE_HEX, 0, 0x01, "Indicates if another entry follows", HFILL } }, { &hf_fp_edch_entity, { "E-DCH Entity", "fp.edch.entity", FT_UINT8, BASE_DEC, VALS(edch_mac_entity_vals), 0x0, "Type of MAC entity for this E-DCH channel", HFILL } }, { &hf_fp_frame_seq_nr, { "Frame Seq Nr", "fp.frame-seq-nr", FT_UINT8, BASE_DEC, 0, 0xf0, "Frame Sequence Number", HFILL } }, { &hf_fp_hsdsch_pdu_block_header, { "PDU block header", "fp.hsdsch.pdu-block-header", FT_STRING, BASE_NONE, NULL, 0x0, "HS-DSCH type 2 PDU block header", HFILL } }, #if 0 { &hf_fp_hsdsch_pdu_block, { "PDU block", "fp.hsdsch.pdu-block", FT_STRING, BASE_NONE, NULL, 0x0, "HS-DSCH type 2 PDU block data", HFILL } }, #endif { &hf_fp_flush, { "Flush", "fp.flush", FT_UINT8, BASE_DEC, 0, 0x04, "Whether all PDUs for this priority queue should be removed", HFILL } }, { &hf_fp_fsn_drt_reset, { "FSN-DRT reset", "fp.fsn-drt-reset", FT_UINT8, BASE_DEC, 0, 0x02, "FSN/DRT Reset Flag", HFILL } }, { &hf_fp_drt_indicator, { "DRT Indicator", "fp.drt-indicator", FT_UINT8, BASE_DEC, 0, 0x01, NULL, HFILL } }, { &hf_fp_fach_indicator, { "FACH Indicator", "fp.fach-indicator", FT_UINT8, BASE_DEC, 0, 0x80, NULL, HFILL } }, { &hf_fp_total_pdu_blocks, { "PDU Blocks", "fp.pdu_blocks", FT_UINT8, BASE_DEC, 0, 0xf8, "Total number of PDU blocks", HFILL } }, { &hf_fp_drt, { "DelayRefTime", "fp.drt", FT_UINT16, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_hrnti, { "HRNTI", "fp.hrnti", FT_UINT16, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_rach_measurement_result, { "RACH Measurement Result", "fp.rach-measurement-result", FT_UINT16, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_lchid, { "Logical Channel ID", "fp.lchid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_pdu_length_in_block, { "PDU length in block", "fp.pdu-length-in-block", FT_UINT8, BASE_DEC, 0, 0x0, "Length of each PDU in this block in bytes", HFILL } }, { &hf_fp_pdus_in_block, { "PDUs in block", "fp.no-pdus-in-block", FT_UINT8, BASE_DEC, 0, 0x0, "Number of PDUs in block", HFILL } }, { &hf_fp_cmch_pi, { "CmCH-PI", "fp.cmch-pi", FT_UINT8, BASE_DEC, 0, 0x0f, "Common Transport Channel Priority Indicator", HFILL } }, { &hf_fp_user_buffer_size, { "User buffer size", "fp.user-buffer-size", FT_UINT16, BASE_DEC, 0, 0x0, "User buffer size in octets", HFILL } }, { &hf_fp_hsdsch_credits, { "HS-DSCH Credits", "fp.hsdsch-credits", FT_UINT16, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_hsdsch_max_macd_pdu_len, { "Max MAC-d PDU Length", "fp.hsdsch.max-macd-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8, "Maximum MAC-d PDU Length in bits", HFILL } }, { &hf_fp_hsdsch_max_macdc_pdu_len, { "Max MAC-d/c PDU Length", "fp.hsdsch.max-macdc-pdu-len", FT_UINT16, BASE_DEC, 0, 0x07ff, "Maximum MAC-d/c PDU Length in bits", HFILL } }, { &hf_fp_hsdsch_interval, { "HS-DSCH Interval in milliseconds", "fp.hsdsch-interval", FT_UINT8, BASE_DEC, 0, 0x0, NULL, HFILL } }, { &hf_fp_hsdsch_calculated_rate, { "Calculated rate allocation (bps)", "fp.hsdsch-calculated-rate", FT_UINT32, BASE_DEC, 0, 0x0, "Calculated rate RNC is allowed to send in bps", HFILL } }, { &hf_fp_hsdsch_unlimited_rate, { "Unlimited rate", "fp.hsdsch-unlimited-rate", FT_NONE, BASE_NONE, 0, 0x0, "No restriction on rate at which date may be sent", HFILL } }, { &hf_fp_hsdsch_repetition_period, { "HS-DSCH Repetition Period", "fp.hsdsch-repetition-period", FT_UINT8, BASE_DEC, 0, 0x0, "HS-DSCH Repetition Period in milliseconds", HFILL } }, { &hf_fp_hsdsch_data_padding, { "Padding", "fp.hsdsch-data-padding", FT_UINT8, BASE_DEC, 0, 0xf0, "HS-DSCH Repetition Period in milliseconds", HFILL } }, { &hf_fp_hsdsch_new_ie_flags, { "New IEs flags", "fp.hsdsch.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[0], { "DRT IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[1], { "New IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[2], { "New IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[3], { "New IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[4], { "New IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[5], { "New IE present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[6], { "HS-DSCH physical layer category present", "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02, NULL, HFILL } }, { &hf_fp_hsdsch_new_ie_flag[7], { "Another new IE flags byte", "fp.hsdsch.new-ie-flags-byte", FT_UINT8, BASE_DEC, 0, 0x01, "Another new IE flagsbyte", HFILL } }, { &hf_fp_hsdsch_drt, { "DRT", "fp.hsdsch.drt", FT_UINT16, BASE_DEC, 0, 0x0, "Delay Reference Time", HFILL } }, { &hf_fp_hsdsch_entity, { "HS-DSCH Entity", "fp.hsdsch.entity", FT_UINT8, BASE_DEC, VALS(hsdshc_mac_entity_vals), 0x0, "Type of MAC entity for this HS-DSCH channel", HFILL } }, { &hf_fp_timing_advance, { "Timing advance", "fp.timing-advance", FT_UINT8, BASE_DEC, 0, 0x3f, "Timing advance in chips", HFILL } }, { &hf_fp_num_of_pdu, { "Number of PDUs", "fp.hsdsch.num-of-pdu", FT_UINT8, BASE_DEC, 0, 0x0, "Number of PDUs in the payload", HFILL } }, { &hf_fp_mac_d_pdu_len, { "MAC-d PDU Length", "fp.hsdsch.mac-d-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8, "MAC-d PDU Length in bits", HFILL } }, { &hf_fp_mac_d_pdu, { "MAC-d PDU", "fp.mac-d-pdu", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_data, { "Data", "fp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_crcis, { "CRCIs", "fp.crcis", FT_BYTES, BASE_NONE, NULL, 0x0, "CRC Indicators for uplink TBs", HFILL } }, { &hf_fp_t1, { "T1", "fp.t1", FT_FLOAT, BASE_NONE, NULL, 0x0, "RNC frame number indicating time it sends frame", HFILL } }, { &hf_fp_t2, { "T2", "fp.t2", FT_FLOAT, BASE_NONE, NULL, 0x0, "NodeB frame number indicating time it received DL Sync", HFILL } }, { &hf_fp_t3, { "T3", "fp.t3", FT_FLOAT, BASE_NONE, NULL, 0x0, "NodeB frame number indicating time it sends frame", HFILL } }, { &hf_fp_ul_sir_target, { "UL_SIR_TARGET", "fp.ul-sir-target", FT_FLOAT, BASE_NONE, 0, 0x0, "Value (in dB) of the SIR target to be used by the UL inner loop power control", HFILL } }, { &hf_fp_pusch_set_id, { "PUSCH Set Id", "fp.pusch-set-id", FT_UINT8, BASE_DEC, NULL, 0x0, "Identifies PUSCH Set from those configured in NodeB", HFILL } }, { &hf_fp_activation_cfn, { "Activation CFN", "fp.activation-cfn", FT_UINT8, BASE_DEC, NULL, 0x0, "Activation Connection Frame Number", HFILL } }, { &hf_fp_duration, { "Duration (ms)", "fp.pusch-duration", FT_UINT8, BASE_DEC, NULL, 0x0, "Duration of the activation period of the PUSCH Set", HFILL } }, { &hf_fp_power_offset, { "Power offset", "fp.power-offset", FT_FLOAT, BASE_NONE, NULL, 0x0, "Power offset (in dB)", HFILL } }, { &hf_fp_code_number, { "Code number", "fp.code-number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_spreading_factor, { "Spreading factor", "fp.spreading-factor", FT_UINT8, BASE_DEC, VALS(spreading_factor_vals), 0xf0, NULL, HFILL } }, { &hf_fp_mc_info, { "MC info", "fp.mc-info", FT_UINT8, BASE_DEC, NULL, 0x0e, NULL, HFILL } }, { &hf_fp_rach_new_ie_flags, { "New IEs flags", "fp.rach.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0, NULL, HFILL } }, { &hf_fp_rach_new_ie_flag_unused[0], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80, NULL, HFILL } }, { &hf_fp_rach_new_ie_flag_unused[1], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40, NULL, HFILL } }, { &hf_fp_rach_new_ie_flag_unused[2], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20, "New IE present (unused)", HFILL } }, { &hf_fp_rach_new_ie_flag_unused[3], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10, "New IE present (unused)", HFILL } }, { &hf_fp_rach_new_ie_flag_unused[4], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08, "New IE present (unused)", HFILL } }, { &hf_fp_rach_new_ie_flag_unused[5], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04, "New IE present (unused)", HFILL } }, { &hf_fp_rach_new_ie_flag_unused[6], { "New IE present", "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02, "New IE present (unused)", HFILL } }, { &hf_fp_rach_cell_portion_id_present, { "Cell portion ID present", "fp.rach.cell-portion-id-present", FT_UINT8, BASE_DEC, 0, 0x01, NULL, HFILL } }, { &hf_fp_rach_angle_of_arrival_present, { "Angle of arrival present", "fp.rach.angle-of-arrival-present", FT_UINT8, BASE_DEC, 0, 0x01, NULL, HFILL } }, { &hf_fp_rach_ext_propagation_delay_present, { "Ext Propagation Delay Present", "fp.rach.ext-propagation-delay-present", FT_UINT8, BASE_DEC, 0, 0x02, NULL, HFILL } }, { &hf_fp_rach_ext_rx_sync_ul_timing_deviation_present, { "Ext Received Sync UL Timing Deviation present", "fp.rach.ext-rx-sync-ul-timing-deviation-present", FT_UINT8, BASE_DEC, 0, 0x02, NULL, HFILL } }, { &hf_fp_rach_ext_rx_timing_deviation_present, { "Ext Rx Timing Deviation present", "fp.rach.ext-rx-timing-deviation-present", FT_UINT8, BASE_DEC, 0, 0x01, NULL, HFILL } }, { &hf_fp_cell_portion_id, { "Cell Portion ID", "fp.cell-portion-id", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL } }, { &hf_fp_ext_propagation_delay, { "Ext Propagation Delay", "fp.ext-propagation-delay", FT_UINT16, BASE_DEC, NULL, 0x03ff, NULL, HFILL } }, { &hf_fp_angle_of_arrival, { "Angle of Arrival", "fp.angle-of-arrival", FT_UINT16, BASE_DEC, NULL, 0x03ff, NULL, HFILL } }, { &hf_fp_ext_received_sync_ul_timing_deviation, { "Ext Received SYNC UL Timing Deviation", "fp.ext-received-sync-ul-timing-deviation", FT_UINT16, BASE_DEC, NULL, 0x1fff, NULL, HFILL } }, { &hf_fp_radio_interface_parameter_update_flag[0], { "CFN valid", "fp.radio-interface-param.cfn-valid", FT_UINT16, BASE_DEC, 0, 0x0001, NULL, HFILL } }, { &hf_fp_radio_interface_parameter_update_flag[1], { "TPC PO valid", "fp.radio-interface-param.tpc-po-valid", FT_UINT16, BASE_DEC, 0, 0x0002, NULL, HFILL } }, { &hf_fp_radio_interface_parameter_update_flag[2], { "DPC mode valid", "fp.radio-interface-param.dpc-mode-valid", FT_UINT16, BASE_DEC, 0, 0x0004, NULL, HFILL } }, { &hf_fp_radio_interface_parameter_update_flag[3], { "RL sets indicator valid", "fp.radio-interface_param.rl-sets-indicator-valid", FT_UINT16, BASE_DEC, 0, 0x0020, NULL, HFILL } }, { &hf_fp_radio_interface_parameter_update_flag[4], { "Maximum UE TX Power valid", "fp.radio-interface-param.max-ue-tx-pow-valid", FT_UINT16, BASE_DEC, 0, 0x0040, "MAX UE TX POW valid", HFILL } }, { &hf_fp_dpc_mode, { "DPC Mode", "fp.dpc-mode", FT_UINT8, BASE_DEC, NULL, 0x20, "DPC Mode to be applied in the uplink", HFILL } }, { &hf_fp_tpc_po, { "TPC Power Offset", "fp.tpc-po", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_multiple_rl_set_indicator, { "Multiple RL sets indicator", "fp.multiple-rl-sets-indicator", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL } }, { &hf_fp_max_ue_tx_pow, { "Maximum UE TX Power", "fp.max-ue-tx-pow", FT_INT8, BASE_DEC, NULL, 0x0, "Max UE TX POW (dBm)", HFILL } }, { &hf_fp_congestion_status, { "Congestion Status", "fp.congestion-status", FT_UINT8, BASE_DEC, VALS(congestion_status_vals), 0x0, NULL, HFILL } }, { &hf_fp_e_rucch_present, { "E-RUCCH Present", "fp.erucch-present", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_extended_bits_present, { "Extended Bits Present", "fp.extended-bits-present", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_fp_extended_bits, { "Extended Bits", "fp.extended-bits", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_fp_spare_extension, { "Spare Extension", "fp.spare-extension", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_ul_setup_frame, { "UL setup frame", "fp.ul.setup_frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_dl_setup_frame, { "DL setup frame", "fp.dl.setup_frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_fp_relevant_pi_frame, { "Paging Indications frame number", "fp.pch.relevant-pi-frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The frame where this Paging Indication bitmap was found", HFILL } }, { &hf_fp_hsdsch_physical_layer_category, { "HS-DSCH physical layer category", "fp.hsdsch.physical_layer_category", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_fp, &ett_fp_data, &ett_fp_crcis, &ett_fp_ddi_config, &ett_fp_edch_subframe_header, &ett_fp_edch_subframe, &ett_fp_edch_maces, &ett_fp_edch_macis_descriptors, &ett_fp_hsdsch_new_ie_flags, &ett_fp_rach_new_ie_flags, &ett_fp_hsdsch_pdu_block_header, &ett_fp_pch_relevant_pi, &ett_fp_release }; static ei_register_info ei[] = { { &ei_fp_bad_header_checksum, { "fp.header.bad_checksum", PI_CHECKSUM, PI_WARN, "Bad header checksum.", EXPFILL }}, { &ei_fp_crci_no_subdissector, { "fp.crci.no_subdissector", PI_UNDECODED, PI_NOTE, "Not sent to subdissectors as CRCI is set", EXPFILL }}, { &ei_fp_crci_error_bit_set_for_tb, { "fp.crci.error_bit_set_for_tb", PI_CHECKSUM, PI_WARN, "CRCI error bit set for TB", EXPFILL }}, { &ei_fp_spare_extension, { "fp.spare-extension.expert", PI_UNDECODED, PI_WARN, "Spare Extension present (%u bytes)", EXPFILL }}, { &ei_fp_bad_payload_checksum, { "fp.payload-crc.bad", PI_CHECKSUM, PI_WARN, "Bad payload checksum.", EXPFILL }}, { &ei_fp_stop_hsdpa_transmission, { "fp.stop_hsdpa_transmission", PI_RESPONSE_CODE, PI_NOTE, "Stop HSDPA transmission", EXPFILL }}, { &ei_fp_timing_adjustmentment_reported, { "fp.timing_adjustmentment_reported", PI_SEQUENCE, PI_WARN, "Timing adjustmentment reported (%.3f ms)", EXPFILL }}, { &ei_fp_expecting_tdd, { "fp.expecting_tdd", PI_MALFORMED, PI_NOTE, "Error: expecting TDD-384 or TDD-768", EXPFILL }}, { &ei_fp_ddi_not_defined, { "fp.ddi_not_defined", PI_MALFORMED, PI_ERROR, "DDI %u not defined for this UE!", EXPFILL }}, { &ei_fp_unable_to_locate_ddi_entry, { "fp.unable_to_locate_ddi_entry", PI_UNDECODED, PI_ERROR, "Unable to locate DDI entry.", EXPFILL }}, { &ei_fp_mac_is_sdus_miscount, { "fp.mac_is_sdus.miscount", PI_MALFORMED, PI_ERROR, "Found too many (%u) MAC-is SDUs - header said there were %u", EXPFILL }}, { &ei_fp_e_rnti_t2_edch_frames, { "fp.e_rnti.t2_edch_frames", PI_MALFORMED, PI_ERROR, "E-RNTI not supposed to appear for T2 EDCH frames", EXPFILL }}, { &ei_fp_e_rnti_first_entry, { "fp.e_rnti.first_entry", PI_MALFORMED, PI_ERROR, "E-RNTI must be first entry among descriptors", EXPFILL }}, { &ei_fp_maybe_srb, { "fp.maybe_srb", PI_PROTOCOL, PI_NOTE, "Found MACd-Flow = 0 and not MUX detected. (This might be SRB)", EXPFILL }}, { &ei_fp_transport_channel_type_unknown, { "fp.transport_channel_type.unknown", PI_UNDECODED, PI_WARN, "Unknown transport channel type", EXPFILL }}, { &ei_fp_pch_lost_relevant_pi_frame, { "fp.pch_lost_relevant_pi_frame", PI_SEQUENCE, PI_WARN, "Previous PCH frame containing PI bitmap not captured (common at capture start)", EXPFILL }}, { &ei_fp_hsdsch_entity_not_specified, { "fp.hsdsch_entity_not_specified", PI_MALFORMED, PI_ERROR, "HSDSCH Entity not specified", EXPFILL }}, { &ei_fp_hsdsch_common_experimental_support, { "fp.hsdsch_common.experimental_support", PI_DEBUG, PI_WARN, "HSDSCH COMMON - Experimental support!", EXPFILL }}, { &ei_fp_hsdsch_common_t3_not_implemented, { "fp.hsdsch_common_t3.not_implemented", PI_DEBUG, PI_ERROR, "HSDSCH COMMON T3 - Not implemented!", EXPFILL }}, { &ei_fp_channel_type_unknown, { "fp.channel_type.unknown", PI_MALFORMED, PI_ERROR, "Unknown channel type", EXPFILL }}, { &ei_fp_no_per_frame_info, { "fp.no_per_frame_info", PI_UNDECODED, PI_ERROR, "Can't dissect FP frame because no per-frame info was attached!", EXPFILL }}, { &ei_fp_no_per_conv_channel_info, { "fp.no_per_conv_channel_info", PI_UNDECODED, PI_ERROR, "Can't dissect this FP stream because no per-conversation channel info was attached!", EXPFILL }}, { &ei_fp_invalid_frame_count, { "fp.invalid_frame_count", PI_MALFORMED, PI_ERROR, "Invalid frame count", EXPFILL }}, }; module_t *fp_module; expert_module_t *expert_fp; /* Register protocol. */ proto_fp = proto_register_protocol("FP", "FP", "fp"); proto_register_field_array(proto_fp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_fp = expert_register_protocol(proto_fp); expert_register_field_array(expert_fp, ei, array_length(ei)); /* Allow other dissectors to find this one by name. */ fp_handle = register_dissector("fp", dissect_fp, proto_fp); /* Preferences */ fp_module = prefs_register_protocol(proto_fp, NULL); /* Determines whether release information should be displayed */ prefs_register_bool_preference(fp_module, "show_release_info", "Show reported release info", "Show reported release info", &preferences_show_release_info); /* Determines whether MAC dissector should be called for payloads */ prefs_register_bool_preference(fp_module, "call_mac", "Call MAC dissector for payloads", "Call MAC dissector for payloads", &preferences_call_mac_dissectors); /* Determines whether or not to validate FP payload checksums */ prefs_register_bool_preference(fp_module, "payload_checksum", "Validate FP payload checksums", "Validate FP payload checksums", &preferences_payload_checksum); /* Determines whether or not to validate FP header checksums */ prefs_register_bool_preference(fp_module, "header_checksum", "Validate FP header checksums", "Validate FP header checksums", &preferences_header_checksum); /* Determines whether or not to track Paging Indications between PCH frames*/ prefs_register_bool_preference(fp_module, "track_paging_indications", "Track Paging Indications in PCH channels", "For each PCH data frame, Try to show the paging indications bitmap found in the previous frame", &preferences_track_paging_indications); prefs_register_obsolete_preference(fp_module, "udp_heur"); prefs_register_obsolete_preference(fp_module, "epandchannelconfigurationtable"); } void proto_reg_handoff_fp(void) { dissector_handle_t fp_aal2_handle; rlc_bcch_handle = find_dissector_add_dependency("rlc.bcch", proto_fp); mac_fdd_rach_handle = find_dissector_add_dependency("mac.fdd.rach", proto_fp); mac_fdd_fach_handle = find_dissector_add_dependency("mac.fdd.fach", proto_fp); mac_fdd_pch_handle = find_dissector_add_dependency("mac.fdd.pch", proto_fp); mac_fdd_dch_handle = find_dissector_add_dependency("mac.fdd.dch", proto_fp); mac_fdd_edch_handle = find_dissector_add_dependency("mac.fdd.edch", proto_fp); mac_fdd_edch_type2_handle = find_dissector_add_dependency("mac.fdd.edch.type2", proto_fp); mac_fdd_hsdsch_handle = find_dissector_add_dependency("mac.fdd.hsdsch", proto_fp); heur_dissector_add("udp", heur_dissect_fp, "FP over UDP", "fp_udp", proto_fp, HEURISTIC_DISABLE); heur_dissector_add("fp_mux", heur_dissect_fp, "FP over FP Mux", "fp_fp_mux", proto_fp, HEURISTIC_ENABLE); fp_aal2_handle = create_dissector_handle(dissect_fp_aal2, proto_fp); dissector_add_uint("atm.aal2.type", TRAF_UMTS_FP, fp_aal2_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-umts_fp.h
/* packet-umts_fp.h * * Martin Mathieson * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include <glib.h> /* Channel types */ #define CHANNEL_UNKNOWN 0 #define CHANNEL_RACH_FDD 1 #define CHANNEL_RACH_TDD 2 #define CHANNEL_FACH_FDD 3 #define CHANNEL_FACH_TDD 4 #define CHANNEL_DSCH_FDD 5 /* DSCH Downlink Shared Channel */ #define CHANNEL_DSCH_TDD 6 #define CHANNEL_USCH_TDD_384 8 #define CHANNEL_USCH_TDD_128 24 #define CHANNEL_PCH 9 #define CHANNEL_CPCH 10 #define CHANNEL_BCH 11 #define CHANNEL_DCH 12 /* DCH Dedicated Transport Channel */ #define CHANNEL_HSDSCH 13 /* HS-DSCH - High Speed Downlink Shared Channel */ #define CHANNEL_IUR_CPCHF 14 #define CHANNEL_IUR_FACH 15 #define CHANNEL_IUR_DSCH 16 #define CHANNEL_EDCH 17 /* E-DCH Enhanced DCH */ #define CHANNEL_RACH_TDD_128 18 #define CHANNEL_HSDSCH_COMMON 19 /* HS-DSCH - High Speed Downlink Shared Channel */ #define CHANNEL_HSDSCH_COMMON_T3 20 #define CHANNEL_EDCH_COMMON 21 /* Constants */ #define MAX_FP_CHANS 64 #define MAX_EDCH_DDIS 16 #define MAX_NUM_HSDHSCH_MACDFLOW 8 #define FP_maxNrOfDCHs 128 /* From NBAP-Constants.asn */ enum fp_interface_type { IuB_Interface, IuR_Interface }; enum division_type { Division_FDD = 1, Division_TDD_384 = 2, Division_TDD_128 = 3, Division_TDD_768 = 4 }; enum fp_hsdsch_entity { entity_not_specified = 0, hs = 1, ehs = 2 }; enum fp_link_type { FP_Link_Unknown, FP_Link_ATM, FP_Link_Ethernet }; enum fp_rlc_mode { FP_RLC_MODE_UNKNOWN, FP_RLC_TM, FP_RLC_UM, FP_RLC_AM }; typedef struct { gint num_ul_chans; gint ul_chan_tf_size[MAX_FP_CHANS]; gint ul_chan_num_tbs[MAX_FP_CHANS]; gint num_dl_chans; gint dl_chan_tf_size[MAX_FP_CHANS]; gint dl_chan_num_tbs[MAX_FP_CHANS]; } fp_dch_channel_info_t; /****************************************/ /* Channel Specific Information Structs */ /****************/ /* FACH Structs */ typedef struct fp_crnti_allocation_info_t { guint32 alloc_frame_number; /* Frame where C-RNTI was allocated */ guint32 urnti; /* The U-RNTI to which the C-RNTI was allocated*/ guint32 global_retrieval_count; /* How many times this alloc info was retrieved for FACH channels*/ } fp_crnti_allocation_info_t; /* Used in the 'channel_specific_info' field for FACH channels */ typedef struct fp_fach_channel_info_t { /* Key: (guint32) C-RNTI */ /* Value: (fp_crnti_allocation_info_t) U-RNTI allocation info */ wmem_tree_t* crnti_to_urnti_map; /* Mapping between C-RNTIs and U-RNTIs using them in this FACH */ } fp_fach_channel_info_t; /****************/ /* RACH Structs */ /* Used in the 'channel_specific_info' field for RACH channels */ typedef struct fp_rach_channel_info_t { /* Key: (guint32) C-RNTI */ /* Value: (fp_crnti_allocation_info_t) U-RNTI allocation info */ wmem_tree_t* crnti_to_urnti_map; /* Mapping between C-RNTIs and U-RNTIs using them in this RACH */ } fp_rach_channel_info_t; /****************/ /* PCH Structs */ /* Information about the Paging Indication Bitmap seen in a specific PCH frame*/ typedef struct paging_indications_info_t { guint32 frame_number; guint8* paging_indications_bitmap; } paging_indications_info_t; /* Used in the 'channel_specific_info' field for PCH channels */ typedef struct fp_pch_channel_info_t { /*Size of the Paging Indication field in this PCH*/ gint paging_indications; /* Information from the previous frame in this field which contained the paging indication field*/ paging_indications_info_t* last_paging_indication_info; } fp_pch_channel_info_t; /*****************/ /* E-DCH Structs */ /* Used in the 'channel_specific_info' field for E-DCH channels */ typedef struct fp_edch_channel_info_t { gint no_ddi_entries; guint8 edch_ddi[MAX_EDCH_DDIS]; guint edch_macd_pdu_size[MAX_EDCH_DDIS]; guint8 edch_lchId[MAX_EDCH_DDIS]; guint8 edch_type; /* 1 means T2 */ } fp_edch_channel_info_t; /*******************/ /* HS-DSCH Structs */ /* Used in the 'channel_specific_info' field for HS-DSCH channels */ typedef struct fp_hsdsch_channel_info_t { enum fp_hsdsch_entity hsdsch_entity; guint8 common_macdflow_id; guint8 hsdsch_macdflow_id; guint hrnti; /*Used for tracking a HS-DSCH flow*/ } fp_hsdsch_channel_info_t; /************************/ /* FP Conversation Data */ typedef struct { enum fp_interface_type iface_type; enum division_type division; gint channel; /* see Channel types definitions above */ enum fp_rlc_mode rlc_mode; guint32 dl_frame_number; /* the frame where this conversation is started from CRNC */ guint32 ul_frame_number; /* the frame where this conversation is started from Node B */ address crnc_address; guint16 crnc_port; guint urnti; /* Identifies a single UE in the UTRAN. Used for tracking it's RLC session across different transport channels */ gint com_context_id; /* Identifies a single UE in all NBAP messages */ guint32 scrambling_code; /* Identifies a single UE's radio transmissions in the UTRAN */ void* channel_specific_info; /* Extended channel info based on the channel type */ /* DCH's in this flow */ gint num_dch_in_flow; gint dch_ids_in_flow_list[FP_maxNrOfDCHs]; /* DCH type channel data */ fp_dch_channel_info_t fp_dch_channel_info[FP_maxNrOfDCHs]; guint8 dch_crc_present; /* 0=No, 1=Yes, 2=Unknown */ gboolean reset_frag; /*Used to indicate that a stream has been reconfigured, hence we need to reset the fragtable*/ guint32 cfn; guint32 cfn_index; } umts_fp_conversation_info_t; /********************************/ /* FP Packet Data */ /* (attached to each FP packet) */ typedef struct fp_info { enum fp_interface_type iface_type; enum division_type division; guint8 release; /* e.g. 99, 4, 5, 6, 7 */ guint16 release_year; /* e.g. 2001 */ guint8 release_month; /* e.g. 12 for December */ gboolean is_uplink; gint channel; /* see Channel types definitions above */ guint8 dch_crc_present; /* 0=No, 1=Yes, 2=Unknown */ gint num_chans; gint chan_tf_size[MAX_FP_CHANS]; gint chan_num_tbs[MAX_FP_CHANS]; gint no_ddi_entries; guint8 edch_ddi[MAX_EDCH_DDIS]; guint edch_macd_pdu_size[MAX_EDCH_DDIS]; guint edch_lchId[MAX_EDCH_DDIS]; /* Logical Channel Id for E-DCH*/ guint8 edch_type; /* 1 means T2 */ gint cur_tb; /* current transport block (required for dissecting of single TBs */ gint cur_chan; /* current channel, required to retrieve the correct channel configuration for UMTS MAC */ gint com_context_id; /* Identifies a single UE in the network */ guint16 srcport, destport; /* PCH Related data*/ gint paging_indications; paging_indications_info_t* relevant_paging_indications; /* Info from previous frame */ /* Info from the current frame. Used to carry information from this frame to the converstaion info */ paging_indications_info_t* current_paging_indications; /* HSDSCH Related data */ enum fp_hsdsch_entity hsdsch_entity; gint hsdsch_macflowd_id; gboolean hsdhsch_macfdlow_is_mux[MAX_NUM_HSDHSCH_MACDFLOW]; enum fp_rlc_mode hsdsch_rlc_mode; enum fp_link_type link_type; guint urnti; /*Used for tracking a "sequence" over diffrent transport channels*/ gboolean reset_frag; /*Used to indicate that a stream has been reconfigured, hence we need to reset the fragtable*/ } fp_info; void set_umts_fp_conv_data(conversation_t *conversation, umts_fp_conversation_info_t *umts_fp_conversation_info); /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-umts_mac.c
/* packet-umts_mac.c * Routines for UMTS MAC (3GPP TS 25.321) disassembly * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/proto_data.h> #include "packet-rrc.h" #include "packet-umts_fp.h" #include "packet-umts_mac.h" #include "packet-nbap.h" void proto_register_umts_mac(void); void proto_reg_handoff_umts_mac(void); int proto_umts_mac = -1; extern int proto_fp; extern int proto_umts_rlc; /* dissector fields */ static int hf_mac_fach_fdd_tctf = -1; static int hf_mac_rach_fdd_tctf = -1; static int hf_mac_ct = -1; static int hf_mac_ueid_type = -1; static int hf_mac_crnti = -1; static int hf_mac_urnti = -1; static int hf_mac_resolved_urnti = -1; static int hf_mac_crnti_urnti_match_frame = -1; static int hf_mac_channel = -1; /* static int hf_mac_channel_str = -1; */ static int hf_mac_lch_id = -1; static int hf_mac_macdflowd_id = -1; /* static int hf_mac_channel_hsdsch = -1; */ static int hf_mac_trch_id = -1; /* static int hf_mac_edch_type2_subframe_header = -1; */ /* static int hf_mac_edch_type2_descriptors = -1; */ /* static int hf_mac_edch_type2_lchid = -1; */ /* static int hf_mac_edch_type2_length = -1; */ /* static int hf_mac_edch_type2_flag = -1; */ static int hf_mac_edch_type2_tsn = -1; static int hf_mac_edch_type2_ss = -1; static int hf_mac_edch_type2_ss_interpretation = -1; static int hf_mac_edch_type2_sdu = -1; static int hf_mac_edch_type2_sdu_data = -1; static int hf_mac_is_fraglink = -1; static int hf_mac_is_reasmin = -1; /* subtrees */ static int ett_mac = -1; static int ett_mac_fach = -1; static int ett_mac_rach = -1; static int ett_mac_dch = -1; static int ett_mac_pch = -1; static int ett_mac_edch = -1; static int ett_mac_hsdsch = -1; static int ett_mac_edch_type2 = -1; static int ett_mac_edch_type2_sdu = -1; static int ett_mac_resolved_urnti = -1; static expert_field ei_mac_cs_dtch_not_implemented = EI_INIT; static expert_field ei_mac_rach_tctf_unknown = EI_INIT; static expert_field ei_mac_unknown_content = EI_INIT; static expert_field ei_mac_per_frame_info_missing = EI_INIT; static expert_field ei_mac_fach_content_type_unknown = EI_INIT; static expert_field ei_mac_no_logical_channel = EI_INIT; static expert_field ei_mac_faked_logical_channel_id = EI_INIT; static expert_field ei_mac_macis_sdu_reassembled = EI_INIT; static expert_field ei_mac_macis_sdu_first = EI_INIT; static expert_field ei_mac_macis_sdu_middle = EI_INIT; static expert_field ei_mac_macis_sdu_last = EI_INIT; static expert_field ei_mac_macis_sdu_complete = EI_INIT; static expert_field ei_mac_reserved_c_t = EI_INIT; static dissector_handle_t rlc_pcch_handle; static dissector_handle_t rlc_ccch_handle; static dissector_handle_t rlc_ctch_handle; static dissector_handle_t rlc_dcch_handle; static dissector_handle_t rlc_ps_dtch_handle; static dissector_handle_t rrc_handle; /* MAC-is reassembly */ static guint MAX_TSN = 64; static guint16 mac_tsn_size = 6; static gint global_mac_tsn_size = MAC_TSN_6BITS; gint get_mac_tsn_size(void) { return global_mac_tsn_size; } static const enum_val_t tsn_size_enumvals[] = { {"6 bits", "6 bits", MAC_TSN_6BITS}, {"14 bits", "14 bits", MAC_TSN_14BITS}, {NULL, NULL, -1}}; enum mac_is_fragment_type { MAC_IS_HEAD, MAC_IS_MIDDLE, MAC_IS_TAIL }; typedef struct _mac_is_fragment { guint8 * data; guint32 length; guint32 frame_num; guint16 tsn; guint8 type; struct _mac_is_fragment * next; } mac_is_fragment; typedef struct { guint32 frame_num; /* Where reassembly was done (depends on order of arrival). */ guint16 tsn; /* TSN for the tail fragment. */ guint8 * data; guint32 length; mac_is_fragment * fragments; } mac_is_sdu; typedef struct { mac_is_fragment * head; mac_is_fragment * middle; mac_is_fragment * tail; } body_parts; typedef struct { guint8 lchid; /* Logical Channel Identifier. */ guint ueid; /* User Equipment Identifier. */ } mac_is_channel; static GHashTable * mac_is_sdus = NULL; /* channel -> (frag -> sdu) */ static GHashTable * mac_is_fragments = NULL; /* channel -> body_parts[] */ static gboolean mac_is_channel_equal(gconstpointer a, gconstpointer b) { const mac_is_channel *x = (const mac_is_channel *)a, *y = (const mac_is_channel *)b; return x->lchid == y->lchid && x->ueid == y->ueid; } static guint mac_is_channel_hash(gconstpointer key) { const mac_is_channel * ch = (const mac_is_channel *)key; return (ch->ueid << 4) | ch->lchid; } static gboolean mac_is_fragment_equal(gconstpointer a, gconstpointer b) { const mac_is_fragment *x = (const mac_is_fragment *)a, *y = (const mac_is_fragment *)b; return x->frame_num == y->frame_num && x->tsn == y->tsn && x->type == y->type; } static guint mac_is_fragment_hash(gconstpointer key) { const mac_is_fragment *frag = (const mac_is_fragment *)key; return (frag->frame_num << 2) | frag->type; } static const value_string rach_fdd_tctf_vals[] = { { TCTF_CCCH_RACH_FDD , "CCCH over RACH (FDD)" }, { TCTF_DCCH_DTCH_RACH_FDD , "DCCH/DTCH over RACH (FDD)" }, { 0, NULL }}; static const value_string fach_fdd_tctf_vals[] = { { TCTF_BCCH_FACH_FDD , "BCCH over FACH (FDD)" }, { TCTF_DCCH_DTCH_FACH_FDD , "DCCH/DTCH over FACH (FDD)" }, { TCTF_MTCH_FACH_FDD , "MTCH over FACH (FDD)" }, { TCTF_CCCH_FACH_FDD , "CCCH over FACH (FDD)" }, { TCTF_MCCH_FACH_FDD , "MCCH over FACH (FDD)" }, { TCTF_MSCH_FACH_FDD , "MSCH over FACH (FDD)" }, { TCTF_CTCH_FACH_FDD , "CTCH over FACH (FDD)" }, { 0, NULL }}; static const value_string ueid_type_vals[] = { { MAC_UEID_TYPE_URNTI, "U-RNTI" }, { MAC_UEID_TYPE_CRNTI, "C-RNTI" }, { 0, NULL }}; static const value_string mac_logical_channel_vals[] = { { MAC_PCCH, "PCCH" }, { MAC_CCCH, "CCCH" }, { MAC_CTCH, "CTCH" }, { MAC_DCCH, "DCCH" }, { MAC_DTCH, "DTCH" }, { MAC_BCCH, "BCCH" }, { MAC_MCCH, "MCCH" }, { MAC_MSCH, "MSCH" }, { MAC_MTCH, "MTCH" }, { MAC_N_A, "N/A" }, { 0, NULL }}; static guint8 fach_fdd_tctf(guint8 hdr, guint16 *bit_offs) { guint8 tctf; /* first, test for valid 2-bit combinations */ tctf = hdr >> 6; switch (tctf) { case TCTF_BCCH_FACH_FDD: case TCTF_DCCH_DTCH_FACH_FDD: *bit_offs = 2; return tctf; } /* 4-bit combinations */ tctf = hdr >> 4; switch (tctf) { case TCTF_MTCH_FACH_FDD: *bit_offs = 4; return tctf; } /* just return the 8-bit combination */ *bit_offs = 8; tctf = hdr; switch (tctf) { case TCTF_CCCH_FACH_FDD: case TCTF_MCCH_FACH_FDD: case TCTF_MSCH_FACH_FDD: case TCTF_CTCH_FACH_FDD: return tctf; default: return tctf; /* TODO */ } } static guint16 tree_add_common_dcch_dtch_fields(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint16 bitoffs, fp_info *fpinf, umts_mac_info *macinf, rlc_info *rlcinf) { guint8 ueid_type; conversation_t *p_conv; umts_fp_conversation_info_t *umts_fp_conversation_info = NULL; fp_rach_channel_info_t *fp_rach_channel_info = NULL; fp_fach_channel_info_t *fp_fach_channel_info = NULL; wmem_tree_t* channel_rnti_map = NULL; guint16 c_rnti; fp_crnti_allocation_info_t *fp_crnti_allocation_info = NULL; ueid_type = tvb_get_bits8(tvb, bitoffs, 2); proto_tree_add_bits_item(tree, hf_mac_ueid_type, tvb, bitoffs, 2, ENC_BIG_ENDIAN); bitoffs += 2; if (ueid_type == MAC_UEID_TYPE_URNTI) { proto_tree_add_bits_item(tree, hf_mac_urnti, tvb, bitoffs, 32, ENC_BIG_ENDIAN); rlcinf->ueid[fpinf->cur_tb] = tvb_get_bits32(tvb, bitoffs, 32,ENC_BIG_ENDIAN); bitoffs += 32; } else if (ueid_type == MAC_UEID_TYPE_CRNTI) { proto_tree_add_bits_item(tree, hf_mac_crnti, tvb, 4, 16, ENC_BIG_ENDIAN); c_rnti = tvb_get_bits16(tvb, bitoffs, 16,ENC_BIG_ENDIAN); p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->destport, pinfo->srcport, NO_ADDR_B); if (p_conv != NULL) { umts_fp_conversation_info = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); } /* Trying to resolve the U-RNTI for this C-RNTI based on the channel type*/ switch(fpinf->channel){ case CHANNEL_RACH_FDD: /* In RACH: Get the channel's RNTIs map */ if (umts_fp_conversation_info) { fp_rach_channel_info = (fp_rach_channel_info_t *)umts_fp_conversation_info->channel_specific_info; if(fp_rach_channel_info) { channel_rnti_map = fp_rach_channel_info->crnti_to_urnti_map; } } break; case CHANNEL_FACH_FDD: /* In FACH: Get the channel's RNTIs map */ if (umts_fp_conversation_info) { fp_fach_channel_info = (fp_fach_channel_info_t *)umts_fp_conversation_info->channel_specific_info; if(fp_fach_channel_info) { channel_rnti_map = fp_fach_channel_info->crnti_to_urnti_map; } } break; } if(channel_rnti_map) { fp_crnti_allocation_info = (fp_crnti_allocation_info_t *)wmem_tree_lookup32(channel_rnti_map, c_rnti); } /* If not found in the RACH/FACH channel's map, Look in the global RNTIs map */ if(fp_crnti_allocation_info == NULL) { fp_crnti_allocation_info = (fp_crnti_allocation_info_t *)wmem_tree_lookup32(rrc_global_urnti_crnti_map, c_rnti); if(fp_crnti_allocation_info != NULL) { /* If found in the global map, check how many times it was retrieved (including this one) */ fp_crnti_allocation_info->global_retrieval_count++; /* If seen 2 times (RACH + fast FACH) remove from global map */ if(fp_crnti_allocation_info->global_retrieval_count == 2) { wmem_tree_remove32(rrc_global_urnti_crnti_map, c_rnti); } /* Also add to this channel's map for later retrieval */ if(channel_rnti_map) { wmem_tree_insert32(channel_rnti_map, c_rnti, (void *)fp_crnti_allocation_info); } } } /* Choosing between resolved U-RNTI (if found) or the C-RNTI as UE-ID for RLC */ if(fp_crnti_allocation_info != NULL) { /* Using U-RNTI */ rlcinf->ueid[fpinf->cur_tb] = fp_crnti_allocation_info->urnti; /* Adding 'Resolved U-RNTI' related tree items*/ proto_item *temp; proto_tree *resolved_urnti_tree; temp = proto_tree_add_uint(tree, hf_mac_resolved_urnti, tvb, 0, 0, fp_crnti_allocation_info->urnti); proto_item_set_generated(temp); resolved_urnti_tree = proto_item_add_subtree(temp, ett_mac_resolved_urnti); temp = proto_tree_add_uint(resolved_urnti_tree , hf_mac_crnti_urnti_match_frame, tvb, 0, 0, fp_crnti_allocation_info->alloc_frame_number); proto_item_set_generated(temp); } else { /* Using C-RNTI */ rlcinf->ueid[fpinf->cur_tb] = c_rnti; } bitoffs += 16; } if (macinf->ctmux[fpinf->cur_tb]) { proto_item * temp; if(rlcinf){ rlcinf->rbid[fpinf->cur_tb] = tvb_get_bits8(tvb, bitoffs, 4)+1; } proto_tree_add_bits_item(tree, hf_mac_ct, tvb, bitoffs, 4, ENC_BIG_ENDIAN); bitoffs += 4; if(rlcinf){ temp = proto_tree_add_uint(tree, hf_mac_lch_id, tvb, 0, 0, rlcinf->rbid[fpinf->cur_tb]); proto_item_set_generated(temp); } } return bitoffs; } static int dissect_mac_fdd_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *pch_tree = NULL; proto_item *channel_type; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); col_set_str(pinfo->cinfo, COL_INFO, "PCCH"); if (tree) { proto_item *ti; ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); pch_tree = proto_item_add_subtree(ti, ett_mac_pch); proto_item_append_text(ti, " (PCCH)"); channel_type = proto_tree_add_uint(pch_tree, hf_mac_channel, tvb, 0, 0, MAC_PCCH); proto_item_set_generated(channel_type); } call_dissector_with_data(rlc_pcch_handle, tvb, pinfo, tree, data); return tvb_captured_length(tvb); } static int dissect_mac_fdd_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint8 tctf; guint8 chan; guint16 bitoffs = 0; tvbuff_t *next_tvb; proto_tree *rach_tree = NULL; proto_item *channel_type; umts_mac_info *macinf; fp_info *fpinf; rlc_info *rlcinf; proto_item *ti = NULL; guint8 c_t; /* RACH TCTF is always 2 bit */ tctf = tvb_get_bits8(tvb, 0, 2); bitoffs += 2; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tctf, rach_fdd_tctf_vals, "Unknown TCTF")); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); rach_tree = proto_item_add_subtree(ti, ett_mac_rach); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!macinf || !fpinf) { proto_tree_add_expert(rach_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return 1; } proto_tree_add_bits_item(rach_tree, hf_mac_rach_fdd_tctf, tvb, 0, 2, ENC_BIG_ENDIAN); if (tctf == TCTF_DCCH_DTCH_RACH_FDD) { macinf->ctmux[fpinf->cur_tb] = 1; /* DCCH/DTCH on RACH *always* has a C/T */ bitoffs = tree_add_common_dcch_dtch_fields(tvb, pinfo, rach_tree, bitoffs, fpinf, macinf, rlcinf); } chan = fpinf->cur_chan; /* handoff to next dissector */ switch (tctf) { case TCTF_CCCH_RACH_FDD: proto_item_append_text(ti, " (CCCH)"); channel_type = proto_tree_add_uint(rach_tree, hf_mac_channel, tvb, 0, 0, MAC_CCCH); proto_item_set_generated(channel_type); next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[chan] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned CCCH Data"); call_dissector_with_data(rlc_ccch_handle, next_tvb, pinfo, tree, data); break; case TCTF_DCCH_DTCH_RACH_FDD: /*Set RLC Mode/MAC content based on the L-CHID derived from the C/T flag*/ c_t = tvb_get_bits8(tvb,bitoffs-4,4); if (c_t == 15) { /* reserved value, discard PDU */ expert_add_info(pinfo, NULL, &ei_mac_reserved_c_t); break; } rlcinf->mode[chan] = lchId_rlc_map[c_t+1]; macinf->content[chan] = lchId_type_table[c_t+1]; rlcinf->rbid[chan] = c_t+1; switch (macinf->content[chan]) { case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); channel_type = proto_tree_add_uint(rach_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[chan] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned DCCH Data"); call_dissector_with_data(rlc_dcch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); channel_type = proto_tree_add_uint(rach_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[chan] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned DTCH Data"); call_dissector_with_data(rlc_ps_dtch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); /* TODO */ break; default: proto_item_append_text(ti, " (Unknown RACH DCCH/DTCH Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown RACH DCCH/DTCH Content"); } break; default: proto_item_append_text(ti, " (Unknown RACH TCTF)"); expert_add_info_format(pinfo, NULL, &ei_mac_rach_tctf_unknown, "Unknown RACH TCTF"); } return tvb_captured_length(tvb); } static int dissect_mac_fdd_fach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint8 hdr, tctf; guint16 bitoffs = 0; guint16 tctf_len, chan; proto_tree *fach_tree = NULL; proto_item *channel_type; tvbuff_t *next_tvb; umts_mac_info *macinf; fp_info *fpinf; rlc_info *rlcinf; struct rrc_info *rrcinf; proto_item *ti = NULL; gint c_t; hdr = tvb_get_guint8(tvb, 0); /* get target channel type field */ tctf = fach_fdd_tctf(hdr, &bitoffs); tctf_len = bitoffs; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(tctf, fach_fdd_tctf_vals, "Unknown TCTF")); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); fach_tree = proto_item_add_subtree(ti, ett_mac_fach); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!macinf || !fpinf) { proto_tree_add_expert(fach_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return 1; } proto_tree_add_bits_item(fach_tree, hf_mac_fach_fdd_tctf, tvb, 0, tctf_len, ENC_BIG_ENDIAN); if (tctf == TCTF_DCCH_DTCH_FACH_FDD) { macinf->ctmux[fpinf->cur_tb] = 1; /* DCCH/DTCH on FACH *always* has a C/T */ bitoffs = tree_add_common_dcch_dtch_fields(tvb, pinfo, fach_tree, bitoffs, fpinf, macinf, rlcinf); } chan = fpinf->cur_chan; switch (tctf) { case TCTF_CCCH_FACH_FDD: proto_item_append_text(ti, " (CCCH)"); channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_CCCH); proto_item_set_generated(channel_type); /* CCCH over FACH is always octet aligned */ next_tvb = tvb_new_subset_remaining(tvb, 1); call_dissector_with_data(rlc_ccch_handle, next_tvb, pinfo, tree, data); break; case TCTF_DCCH_DTCH_FACH_FDD: /*Set RLC Mode based on the L-CHID derived from the C/T flag*/ c_t = tvb_get_bits8(tvb,bitoffs-4,4); if (c_t == 15) { /* reserved value, discard PDU */ expert_add_info(pinfo, NULL, &ei_mac_reserved_c_t); break; } rlcinf->mode[fpinf->cur_tb] = lchId_rlc_map[c_t+1]; macinf->content[fpinf->cur_tb] = lchId_type_table[c_t+1]; switch (macinf->content[fpinf->cur_tb]) { case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[chan] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned DCCH Data"); call_dissector_with_data(rlc_dcch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[chan] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned DCCH Data"); call_dissector_with_data(rlc_ps_dtch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); expert_add_info(pinfo, NULL, &ei_mac_cs_dtch_not_implemented); /* TODO */ break; default: proto_item_append_text(ti, " (Unknown FACH Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown FACH Content for this transportblock"); } break; case TCTF_CTCH_FACH_FDD: proto_item_append_text(ti, " (CTCH)"); channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_CTCH); proto_item_set_generated(channel_type); /* CTCH over FACH is always octet aligned */ next_tvb = tvb_new_subset_remaining(tvb, 1); call_dissector_with_data(rlc_ctch_handle, next_tvb, pinfo, tree, data); break; /* july 5: Added support for BCCH*/ case TCTF_BCCH_FACH_FDD: proto_item_append_text(ti, " (BCCH)"); channel_type = proto_tree_add_uint(fach_tree, hf_mac_channel, tvb, 0, 0, MAC_BCCH); proto_item_set_generated(channel_type); /*We need to skip the first two bits (the TCTF bits), and since there is no MAC header, send rest to RRC*/ next_tvb= tvb_new_octet_aligned(tvb, 2, (tvb_reported_length(tvb)*8)-2); add_new_data_source(pinfo, next_tvb, "Octet-Aligned BCCH Data"); /* In this case skip RLC and call RRC immediately subdissector */ rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rrc, 0); if (!rrcinf) { rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info); p_add_proto_data(wmem_file_scope(), pinfo, proto_rrc, 0, rrcinf); } rrcinf->msgtype[fpinf->cur_tb] = RRC_MESSAGE_TYPE_BCCH_FACH; call_dissector_with_data(rrc_handle, next_tvb, pinfo, tree, data); break; case TCTF_MSCH_FACH_FDD: case TCTF_MCCH_FACH_FDD: case TCTF_MTCH_FACH_FDD: expert_add_info(pinfo, NULL, &ei_mac_fach_content_type_unknown); break; default: proto_item_append_text(ti, " (Unknown FACH Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, " Unknown FACH Content"); break; } return tvb_captured_length(tvb); } static int dissect_mac_fdd_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint16 pos; guint8 bitoffs = 0; umts_mac_info *macinf; fp_info *fpinf; rlc_info *rlcinf; proto_tree *dch_tree = NULL; proto_item *channel_type; tvbuff_t *next_tvb; proto_item *ti = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); dch_tree = proto_item_add_subtree(ti, ett_mac_dch); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!macinf || !fpinf) { proto_tree_add_expert(dch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return 1; } pos = fpinf->cur_tb; if (macinf->ctmux[pos]) { if(rlcinf){ rlcinf->rbid[fpinf->cur_tb] = tvb_get_bits8(tvb, bitoffs, 4)+1; } /*Add CT flag to GUI*/ proto_tree_add_bits_item(dch_tree, hf_mac_ct, tvb, 0, 4, ENC_BIG_ENDIAN); bitoffs = 4; } if (bitoffs) { next_tvb = tvb_new_octet_aligned(tvb, bitoffs, fpinf->chan_tf_size[pos] - bitoffs); add_new_data_source(pinfo, next_tvb, "Octet-Aligned DCCH Data"); } else next_tvb = tvb; switch (macinf->content[pos]) { case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); /*Show logical channel id*/ channel_type = proto_tree_add_uint(dch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos]!= 255){ if(macinf->fake_chid[pos]){ expert_add_info(pinfo, channel_type, &ei_mac_faked_logical_channel_id); } }else{ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } channel_type = proto_tree_add_uint(dch_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); /*Transport channel printout*/ channel_type = proto_tree_add_uint(dch_tree, hf_mac_trch_id, tvb, 0, 0, macinf->trchid[pos]); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_dcch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); /*Show logical channel id*/ channel_type = proto_tree_add_uint(dch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos]== 255){ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } channel_type = proto_tree_add_uint(dch_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_ps_dtch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); /*Show logical channel id*/ channel_type = proto_tree_add_uint(dch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos]!= 255){ if(macinf->fake_chid[pos]){ expert_add_info(pinfo, channel_type, &ei_mac_faked_logical_channel_id); } }else{ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } channel_type = proto_tree_add_uint(dch_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); /*Transport channel printout*/ channel_type = proto_tree_add_uint(dch_tree, hf_mac_trch_id, tvb, 0, 0, macinf->trchid[pos]); proto_item_set_generated(channel_type); break; default: proto_item_append_text(ti, " (Unknown DCH Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown DCH Content"); } return tvb_captured_length(tvb); } static void init_frag(tvbuff_t * tvb, body_parts * bp, guint length, guint offset, guint32 frame_num, guint16 tsn, guint8 type) { mac_is_fragment * frag = wmem_new(wmem_file_scope(), mac_is_fragment); frag->type = type; frag->length = length; frag->data = (guint8 *)wmem_alloc(wmem_file_scope(), length); frag->frame_num = frame_num; frag->tsn = tsn; frag->next = NULL; switch (type) { case MAC_IS_HEAD: DISSECTOR_ASSERT(bp->head == NULL); bp->head = frag; break; case MAC_IS_MIDDLE: DISSECTOR_ASSERT(bp->middle == NULL); bp->middle = frag; break; case MAC_IS_TAIL: DISSECTOR_ASSERT(bp->tail == NULL); bp->tail = frag; break; } tvb_memcpy(tvb, frag->data, offset, length); } static void mac_is_copy(mac_is_sdu * sdu, mac_is_fragment * frag, guint total_length, gboolean reverse) { DISSECTOR_ASSERT(sdu->length+frag->length <= total_length); if (reverse) { memcpy(sdu->data+total_length-frag->length-sdu->length, frag->data, frag->length); } else { memcpy(sdu->data+sdu->length, frag->data, frag->length); } sdu->length += frag->length; wmem_free(wmem_file_scope(), frag->data); } /* * @param length Length of whole SDU, it will be verified. */ static tvbuff_t * reassemble(tvbuff_t * tvb, body_parts ** body_parts_array, guint16 head_tsn, guint length, mac_is_channel * ch, guint frame_num) { mac_is_sdu * sdu; mac_is_fragment * f; guint16 i; GHashTable * sdus; /* Find frag->sdu hash table for this channel. */ sdus = (GHashTable *)g_hash_table_lookup(mac_is_sdus, ch); /* If this is the first time we see this channel. */ if (sdus == NULL) { mac_is_channel * channel; sdus = g_hash_table_new(mac_is_fragment_hash, mac_is_fragment_equal); channel = wmem_new(wmem_file_scope(), mac_is_channel); *channel = *ch; g_hash_table_insert(mac_is_sdus, channel, sdus); } sdu = wmem_new(wmem_file_scope(), mac_is_sdu); sdu->length = 0; sdu->data = (guint8 *)wmem_alloc(wmem_file_scope(), length); f = body_parts_array[head_tsn]->head; /* Start from head. */ g_hash_table_insert(sdus, f, sdu); /* Insert head->sdu mapping. */ body_parts_array[head_tsn]->head = NULL; /* Reset head. */ mac_is_copy(sdu, f, length, FALSE); /* Copy head data into SDU. */ sdu->fragments = f; /* Set up fragments list to point at head. */ sdu->frame_num = frame_num; /* Frame number where reassembly is being done. */ for (i = (head_tsn+1)%MAX_TSN; body_parts_array[i]->middle != NULL; i = (i+1)%MAX_TSN) { f = f->next = body_parts_array[i]->middle; /* Iterate through. */ g_hash_table_insert(sdus, f, sdu); /* Insert middle->sdu mapping. */ body_parts_array[i]->middle = NULL; /* Reset. */ mac_is_copy(sdu, f, length, FALSE); /* Copy middle data into SDU. */ } DISSECTOR_ASSERT(body_parts_array[i]->tail != NULL); f->next = body_parts_array[i]->tail; g_hash_table_insert(sdus, f->next, sdu); /* Insert tail->sdu mapping. */ body_parts_array[i]->tail = NULL; /* Reset tail. */ sdu->tsn = i; /* Use TSN of tail as key for the SDU. */ mac_is_copy(sdu, f->next, length, FALSE); /* Copy tail data into SDU. */ return tvb_new_child_real_data(tvb, sdu->data, sdu->length, sdu->length); } static mac_is_sdu * get_sdu(guint frame_num, guint16 tsn, guint8 type, mac_is_channel * ch) { mac_is_sdu * sdu = NULL; GHashTable * sdus = NULL; mac_is_fragment frag_lookup_key; sdus = (GHashTable *)g_hash_table_lookup(mac_is_sdus, ch); if (sdus) { frag_lookup_key.frame_num = frame_num; frag_lookup_key.tsn = tsn; frag_lookup_key.type = type; sdu = (mac_is_sdu *)g_hash_table_lookup(sdus, &frag_lookup_key); return sdu; } return NULL; } static tvbuff_t * add_to_tree(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, mac_is_sdu * sdu, guint offset, guint16 maclength, guint8 type) { tvbuff_t * new_tvb = NULL; if (sdu->frame_num == pinfo->num) { mac_is_fragment * f = sdu->fragments; guint counter = 0; new_tvb = tvb_new_child_real_data(tvb, sdu->data, sdu->length, sdu->length); add_new_data_source(pinfo, new_tvb, "Reassembled MAC-is SDU"); proto_tree_add_expert(tree, pinfo, &ei_mac_macis_sdu_reassembled, new_tvb, 0, -1); while (f) { proto_tree_add_uint_format_value(tree, hf_mac_is_fraglink, new_tvb, counter, f->length, f->frame_num, "%u, payload: %u-%u (%u bytes) (TSN: %u)", f->frame_num, counter, counter+f->length-1, f->length, f->tsn); counter += f->length; f = f->next; } return new_tvb; } else { new_tvb = tvb_new_subset_length_caplen(tvb, offset, maclength, -1); switch (type) { case MAC_IS_HEAD: proto_tree_add_expert(tree, pinfo, &ei_mac_macis_sdu_first, new_tvb, 0, -1); break; case MAC_IS_MIDDLE: proto_tree_add_expert(tree, pinfo, &ei_mac_macis_sdu_middle, new_tvb, 0, -1); break; case MAC_IS_TAIL: proto_tree_add_expert(tree, pinfo, &ei_mac_macis_sdu_last, new_tvb, 0, -1); break; } proto_tree_add_uint(tree, hf_mac_is_reasmin, new_tvb, 0, 0, sdu->frame_num); return NULL; /* No data here. */ } } /* * If return value > 0 then tsn is changed to be tsn of head. * @return return length of sequence tsn-1 to head. */ static guint find_head(body_parts ** body_parts_array, guint16 * tsn) { guint length = 0; *tsn = (*tsn==0)? (guint16)(MAX_TSN-1) : (*tsn)-1; for (; body_parts_array[*tsn]->middle != NULL; *tsn = (*tsn==0)?(guint16)(MAX_TSN-1):(*tsn)-1) length += body_parts_array[*tsn]->middle->length; if (body_parts_array[*tsn]->head != NULL) return length+body_parts_array[*tsn]->head->length; return 0; } /* * @return return length of sequence tsn+1 to tail. */ static guint find_tail(body_parts ** body_parts_array, guint16 tsn) { guint length = 0; for (tsn = (tsn+1)%MAX_TSN; body_parts_array[tsn]->middle != NULL; tsn = (tsn+1)%MAX_TSN) length += body_parts_array[tsn]->middle->length; if (body_parts_array[tsn]->tail != NULL) return length+body_parts_array[tsn]->tail->length; return 0; } /* * @param ch Channel for which body parts are to be fetched. * @return Array of body_part* for channel 'ch'. */ static body_parts ** get_body_parts(mac_is_channel * ch) { body_parts ** bpa = (body_parts **)g_hash_table_lookup(mac_is_fragments, ch); /* If there was no body_part* array for this channel, create one. */ if (bpa == NULL) { mac_is_channel * channel; guint16 i; bpa = wmem_alloc_array(wmem_file_scope(), body_parts*, MAX_TSN); /* Create new body_parts-pointer array */ for (i = 0; i < MAX_TSN; i++) { bpa[i] = wmem_new0(wmem_file_scope(), body_parts); /* Fill it with body_parts. */ } channel = wmem_new(wmem_file_scope(), mac_is_channel); /* Alloc new channel for use in hash table. */ *channel = *ch; g_hash_table_insert(mac_is_fragments, channel, bpa); } return bpa; } static tvbuff_t * mac_is_add_fragment(tvbuff_t * tvb _U_, packet_info *pinfo, proto_tree * tree _U_, guint8 lchid, guint ueid, int offset, guint8 ss, guint16 tsn, int sdu_no, guint8 no_sdus, guint16 maclength) { mac_is_channel ch; /* Channel for looking up in hash tables. */ ch.lchid = lchid; ch.ueid = ueid; /* If in first scan-through. */ if (!PINFO_FD_VISITED(pinfo)) { /* Get body parts array for this channel. */ body_parts ** body_parts_array = get_body_parts(&ch); /* Middle segment */ if (no_sdus == 1 && ss == 3) { guint head_length, tail_length; init_frag(tvb, body_parts_array[tsn], maclength, offset, pinfo->num, tsn, MAC_IS_MIDDLE); tail_length = find_tail(body_parts_array, tsn); if (tail_length > 0) { head_length = find_head(body_parts_array, &tsn); if (head_length > 0) { /* tsn is now TSN of head */ return reassemble(tvb, body_parts_array, tsn, tail_length+head_length+maclength, &ch, pinfo->num); } } /* XXX: haven't confirmed if case when middle segment comes last * actually works or not. */ } /* If first SDU is last segment of previous. A tail. */ else if (sdu_no == 0 && (ss & 1) == 1) { guint length = maclength; init_frag(tvb, body_parts_array[tsn], maclength, offset, pinfo->num, tsn, MAC_IS_TAIL); length += find_head(body_parts_array, &tsn); if (length > maclength) { /* tsn is now TSN of head */ return reassemble(tvb, body_parts_array, tsn, length, &ch, pinfo->num); } } /* If last SDU is first segment of next. A head. */ else if (sdu_no == no_sdus-1 && (ss & 2) == 2) { guint length = maclength; init_frag(tvb, body_parts_array[tsn], maclength, offset, pinfo->num, tsn, MAC_IS_HEAD); length += find_tail(body_parts_array, tsn); if (length > maclength) { return reassemble(tvb, body_parts_array, tsn, length, &ch, pinfo->num); } /* If our SDU is not fragmented. */ } else { DISSECTOR_ASSERT((sdu_no == 0) ? (ss&1) == 0 : ((sdu_no == no_sdus-1) ? (ss&2) == 0 : TRUE)); return tvb_new_subset_length_caplen(tvb, offset, maclength, -1); } /* If clicking on a packet. */ } else { tvbuff_t * new_tvb = NULL; /* Middle segment */ if (no_sdus == 1 && ss == 3) { mac_is_sdu * sdu = get_sdu(pinfo->num, tsn, MAC_IS_MIDDLE, &ch); if (sdu) { return add_to_tree(tvb, pinfo, tree, sdu, offset, maclength, MAC_IS_MIDDLE); } } /* If first SDU is last segment of previous. A tail. */ else if (sdu_no == 0 && (ss & 1) == 1) { mac_is_sdu * sdu = get_sdu(pinfo->num, tsn, MAC_IS_TAIL, &ch); if (sdu) { return add_to_tree(tvb, pinfo, tree, sdu, offset, maclength, MAC_IS_TAIL); } } /* If last SDU is first segment of next. A head. */ else if (sdu_no == no_sdus-1 && (ss & 2) == 2) { mac_is_sdu * sdu = get_sdu(pinfo->num, tsn, MAC_IS_HEAD, &ch); if (sdu) { return add_to_tree(tvb, pinfo, tree, sdu, offset, maclength, MAC_IS_HEAD); } } else { new_tvb = tvb_new_subset_length_caplen(tvb, offset, maclength, -1); proto_tree_add_expert(tree, pinfo, &ei_mac_macis_sdu_complete, new_tvb, 0, -1); proto_tree_add_item(tree, hf_mac_edch_type2_sdu_data, new_tvb, 0, -1, ENC_NA); return new_tvb; } } return NULL; } static void ss_interpretation(tvbuff_t * tvb, proto_tree * tree, guint8 ss, guint number_of_mac_is_sdus, guint offset) { switch (ss) { case 0: if (number_of_mac_is_sdus > 1) { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The first MAC-is SDU of the MAC-is PDU is a complete MAC-d PDU or MAC-c PDU. The last MAC-is SDU of the MAC-is PDU is a complete MAC-d PDU or MAC-c PDU."); } else { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The MAC-is SDU of the MAC-is PDU is a complete MAC-d PDU or MAC-c PDU."); } break; case 1: if (number_of_mac_is_sdus > 1) { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The last MAC-is SDU of the MAC-is PDU is a complete MAC-d PDU or MAC-c PDU. The first MAC-is SDU of the MAC-is PDU is the last segment of a MAC-d PDU or MAC-c PDU."); } else { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The MAC-is SDU of the MAC-is PDU is the last segment of a MAC-d PDU or MAC-c PDU."); } break; case 2: if (number_of_mac_is_sdus > 1) { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The first MAC-is SDU of the MAC-is PDU is a complete MAC-d PDU or MAC-c PDU. The last MAC-is SDU of the MAC-is PDU is the first segment of a MAC-d PDU or MAC-c PDU."); } else { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The MAC-is SDU of the MAC-is PDU is the first segment of a MAC-d PDU or MAC-c PDU."); } break; case 3: if (number_of_mac_is_sdus > 1) { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The first MAC-is SDU of the MAC-is PDU is the last segment of a MAC-d PDU or MAC-c PDU and the last MAC-is SDU of MAC-is PDU is the first segment of a MAC-d PDU or MAC-c PDU."); } else { proto_tree_add_uint_format_value(tree, hf_mac_edch_type2_ss_interpretation, tvb, offset, 1, ss, "The MAC-is SDU is a middle segment of a MAC-d PDU or MAC-c PDU."); } break; } } static void call_rlc(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, proto_item * ti, guint8 lchid, void *data) { switch (lchId_type_table[lchid]) { case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); call_dissector_with_data(rlc_dcch_handle, tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); call_dissector_with_data(rlc_ps_dtch_handle, tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); /* TODO */ break; default: proto_item_append_text(ti, " (Unknown EDCH Content)"); expert_add_info_format(pinfo, ti, &ei_mac_unknown_content, "Unknown EDCH Content"); break; } } /* * Dissect a MAC-is PDU. */ static int dissect_mac_fdd_edch_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint sdu_no, subframe_bytes = 0, offset = 0; guint8 ss; guint16 tsn; proto_item *pi, *temp; proto_tree *macis_pdu_tree, *macis_sdu_tree; umts_mac_is_info * mac_is_info = (umts_mac_is_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); rlc_info * rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); struct fp_info *p_fp_info = (struct fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); DISSECTOR_ASSERT(mac_is_info != NULL && rlcinf != NULL && p_fp_info != NULL); pi = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); macis_pdu_tree = proto_item_add_subtree(pi, ett_mac_edch_type2); /* SS */ ss = (tvb_get_guint8(tvb, offset) & 0xc0) >> 6; proto_tree_add_item(macis_pdu_tree, hf_mac_edch_type2_ss, tvb, offset, 1, ENC_BIG_ENDIAN); ss_interpretation(tvb, macis_pdu_tree, ss, mac_is_info->number_of_mac_is_sdus, offset); /* TSN */ tsn = tvb_get_bits8(tvb, offset*8+2, mac_tsn_size); proto_tree_add_bits_item(macis_pdu_tree, hf_mac_edch_type2_tsn, tvb, offset*8+2, mac_tsn_size, ENC_BIG_ENDIAN); offset += (2+mac_tsn_size)/8; /* MAC-is SDUs (i.e. MACd PDUs) */ for (sdu_no=0; sdu_no < mac_is_info->number_of_mac_is_sdus; sdu_no++) { proto_item *ti; tvbuff_t * asm_tvb; guint8 lchid = mac_is_info->lchid[sdu_no]+1; guint sdulength = mac_is_info->sdulength[sdu_no]; ti = proto_tree_add_item(tree, hf_mac_edch_type2_sdu, tvb, offset, sdulength, ENC_NA); macis_sdu_tree = proto_item_add_subtree(ti, ett_mac_edch_type2_sdu); proto_item_append_text(ti, " (Logical channel=%u, Len=%u)", lchid, sdulength); temp = proto_tree_add_uint(ti, hf_mac_lch_id, tvb, 0, 0, lchid); proto_item_set_generated(temp); /*Set up information needed for MAC and lower layers*/ rlcinf->mode[sdu_no] = lchId_rlc_map[lchid]; /* Set RLC mode by lchid to RLC_MODE map in nbap.h */ rlcinf->ueid[sdu_no] = p_fp_info->com_context_id; rlcinf->rbid[sdu_no] = lchid; rlcinf->li_size[sdu_no] = RLC_LI_7BITS; rlcinf->ciphered[sdu_no] = FALSE; rlcinf->deciphered[sdu_no] = FALSE; asm_tvb = mac_is_add_fragment(tvb, pinfo, macis_sdu_tree, lchid, p_fp_info->com_context_id, offset, ss, tsn, sdu_no, mac_is_info->number_of_mac_is_sdus, sdulength); if (asm_tvb != NULL) { call_rlc(asm_tvb, pinfo, tree, ti, lchid, data); } offset += sdulength; subframe_bytes += sdulength; } proto_item_append_text(pi, "-is PDU (SS=%u, TSN=%u, %u bytes in %u SDU fragments)", ss, tsn, subframe_bytes, mac_is_info->number_of_mac_is_sdus); proto_item_set_len(pi, 1+subframe_bytes); /*total_bytes += subframe_bytes;*/ return tvb_captured_length(tvb); } static int dissect_mac_fdd_edch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *edch_tree = NULL; proto_item *channel_type; umts_mac_info *macinf; fp_info *fpinf; guint16 pos; proto_item *ti = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); edch_tree = proto_item_add_subtree(ti, ett_mac_edch); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); if (!macinf|| !fpinf) { proto_tree_add_expert(edch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return 1; } pos = fpinf->cur_tb; switch (macinf->content[pos]) { case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); /*Show the logical channel id*/ channel_type = proto_tree_add_uint(edch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); channel_type = proto_tree_add_uint(edch_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_dcch_handle, tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); /*Show the logical channel id*/ channel_type = proto_tree_add_uint(edch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); channel_type = proto_tree_add_uint(edch_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_ps_dtch_handle, tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); /* TODO */ break; default: proto_item_append_text(ti, " (Unknown EDCH Content)"); expert_add_info_format(pinfo, ti, &ei_mac_unknown_content, "Unknown EDCH Content"); break; } return tvb_captured_length(tvb); } /** * Dissect hsdsch_common channel. * * This will dissect hsdsch common channels, we handle this separately * since we might have to deal with MAC-ehs and or MAC-c headers * (in the MAC PDU). * * @param tvb * @param pinfo * @param tree * @return Void. */ #if 0 static void dissect_mac_fdd_hsdsch_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *hsdsch_tree = NULL; /*proto_item *channel_type; */ fp_info *fpinf; umts_mac_info *macinf; guint16 pos; /* guint8 bitoffs=0; tvbuff_t *next_tvb; */ proto_item *ti = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); hsdsch_tree = proto_item_add_subtree(ti, ett_mac_hsdsch); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac); if (!macinf) { proto_tree_add_expert(hsdsch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return; } pos = fpinf->cur_tb; switch(macinf->content[pos]){ /*In this case we don't have a MAC-c header 9.2.1.4*/ #if 0 case MAC_CONTENT_CCCH: break; case MAC_CONTENT_PCCH: break; case MAC_CONTENT_BCCH: break; #endif default: proto_item_append_text(ti, " (Unknown HSDSCH-Common Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown HSDSCH-Common Content"); break; } } #endif /* to avoid unnecessary re-alignment, the 4 bit padding prepended to the HSDSCH in FP type 1 * are handled in the MAC layer * If the C/T field is present, 'bitoffs' will be 8 (4 bit padding and 4 bit C/T) and * no re-alignment is necessary * If no C/T is present, the whole payload will be left-shifted by 4 bit */ static int dissect_mac_fdd_hsdsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree *hsdsch_tree = NULL; proto_item *channel_type; fp_info *fpinf; umts_mac_info *macinf; guint16 pos; guint8 bitoffs=0; tvbuff_t *next_tvb; proto_item *ti = NULL; rlc_info * rlcinf; /*struct rrc_info *rrcinf = NULL; */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC"); ti = proto_tree_add_item(tree, proto_umts_mac, tvb, 0, -1, ENC_NA); hsdsch_tree = proto_item_add_subtree(ti, ett_mac_hsdsch); fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0); pos = fpinf->cur_tb; bitoffs = fpinf->hsdsch_entity == ehs ? 0 : 4; /*No MAC-d header for type 2*/ if (!macinf) { proto_tree_add_expert(hsdsch_tree, pinfo, &ei_mac_per_frame_info_missing, tvb, 0, -1); return 1; } if (macinf->ctmux[pos]) { /*The 4'st bits are padding*/ proto_tree_add_bits_item(hsdsch_tree, hf_mac_ct, tvb, bitoffs, 4, ENC_BIG_ENDIAN); /*Sets the proper lchid, for later layers.*/ macinf->lchid[pos] = tvb_get_bits8(tvb,bitoffs,4)+1; macinf->fake_chid[pos] = FALSE; macinf->content[pos] = lchId_type_table[macinf->lchid[pos]]; /*Lookup MAC content*/ rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); rlcinf->rbid[pos] = macinf->lchid[pos]; rlcinf->mode[pos] = lchId_rlc_map[macinf->lchid[pos]]; /*Look up RLC mode*/ bitoffs += 4; } if ((bitoffs % 8) == 0) { next_tvb = tvb_new_subset_remaining(tvb, bitoffs/8); } else { next_tvb = tvb_new_octet_aligned(tvb, bitoffs, macinf->pdu_len); /*Get rid of possible padding in at the end?*/ add_new_data_source(pinfo, next_tvb, "Octet-Aligned HSDSCH Data"); } switch (macinf->content[pos]) { case MAC_CONTENT_CCCH: proto_item_append_text(ti, " (CCCH)"); /*Set the logical channel id if it exists */ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos] != 255){ if(macinf->fake_chid[pos]){ expert_add_info(pinfo, channel_type, &ei_mac_faked_logical_channel_id); } }else{ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } /*Set the type of channel*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); /*Set the MACd-Flow ID*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_macdflowd_id, tvb, 0, 0, macinf->macdflow_id[pos]); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_ccch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_DCCH: proto_item_append_text(ti, " (DCCH)"); /* channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_channel_hsdsch, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type)*/ /*Set the logical channel id if it exists */ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos] != 255){ if(macinf->fake_chid[pos]){ expert_add_info(pinfo, channel_type, &ei_mac_faked_logical_channel_id); } }else{ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } /*Set the type of channel*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_channel, tvb, 0, 0, MAC_DCCH); proto_item_set_generated(channel_type); /*Set the MACd-Flow ID*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_macdflowd_id, tvb, 0, 0, macinf->macdflow_id[pos]); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_dcch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_PS_DTCH: proto_item_append_text(ti, " (PS DTCH)"); /*Set the logical channel id if it exists */ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_lch_id, tvb, 0, 0, macinf->lchid[pos]); proto_item_set_generated(channel_type); if(macinf->lchid[pos] != 255){ if(macinf->fake_chid[pos]){ expert_add_info(pinfo, channel_type, &ei_mac_faked_logical_channel_id); } }else{ expert_add_info(pinfo, channel_type, &ei_mac_no_logical_channel); } /*Sets the channel type*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_channel, tvb, 0, 0, MAC_DTCH); proto_item_set_generated(channel_type); /*Set the MACd-Flow ID*/ channel_type = proto_tree_add_uint(hsdsch_tree, hf_mac_macdflowd_id, tvb, 0, 0, macinf->macdflow_id[pos]); proto_item_set_generated(channel_type); call_dissector_with_data(rlc_ps_dtch_handle, next_tvb, pinfo, tree, data); break; case MAC_CONTENT_CS_DTCH: proto_item_append_text(ti, " (CS DTCH)"); break; default: proto_item_append_text(ti, " (Unknown HSDSCH Content)"); expert_add_info_format(pinfo, NULL, &ei_mac_unknown_content, "Unknown HSDSCH Content"); } return tvb_captured_length(tvb); } static void mac_is_sdus_hash_destroy(gpointer data) { g_hash_table_destroy((GHashTable *)data); } static void mac_init(void) { mac_is_sdus = g_hash_table_new_full(mac_is_channel_hash, mac_is_channel_equal, NULL, mac_is_sdus_hash_destroy); mac_is_fragments = g_hash_table_new_full(mac_is_channel_hash, mac_is_channel_equal, NULL, NULL); if (global_mac_tsn_size == MAC_TSN_6BITS) { MAX_TSN = 64; mac_tsn_size = 6; } else { MAX_TSN = 16384; mac_tsn_size = 14; } } static void mac_cleanup(void) { g_hash_table_destroy(mac_is_sdus); g_hash_table_destroy(mac_is_fragments); } void proto_register_umts_mac(void) { module_t *mac_module; static gint *ett[] = { &ett_mac, &ett_mac_fach, &ett_mac_rach, &ett_mac_dch, &ett_mac_pch, &ett_mac_edch, &ett_mac_hsdsch, &ett_mac_edch_type2, &ett_mac_edch_type2_sdu, &ett_mac_resolved_urnti }; /** XX: Looks like some duplicate filter names ?? **/ /** XX: May be OK: See doc/README.developer **/ static hf_register_info hf[] = { { &hf_mac_rach_fdd_tctf, { "Target Channel Type Field", "mac.tctf", FT_UINT8, BASE_HEX, VALS(rach_fdd_tctf_vals), 0, NULL, HFILL } }, { &hf_mac_fach_fdd_tctf, { "Target Channel Type Field", "mac.tctf", FT_UINT8, BASE_HEX, VALS(fach_fdd_tctf_vals), 0, NULL, HFILL } }, { &hf_mac_ct, { "C/T", "mac.ct", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_mac_ueid_type, { "UEID Type", "mac.ueid_type", FT_UINT8, BASE_DEC, VALS(ueid_type_vals), 0, NULL, HFILL } }, { &hf_mac_crnti, { "C-RNTI (UEID)", "mac.ueid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mac_urnti, { "U-RNTI (UEID)", "mac.ueid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mac_resolved_urnti, { "Resolved U-RNTI", "mac.resolved_urnti", FT_UINT32, BASE_HEX, NULL, 0x0, "The U-RNTI of the UE which is using the C-RNTI seen in this frame", HFILL } }, { &hf_mac_crnti_urnti_match_frame, { "C-RNTI Allocation Frame", "mac.crnti_urnti_match_frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The frame number where the C-RNTI was allocated for the UE", HFILL } }, { &hf_mac_channel, { "Logical Channel Type", "mac.logical_channel", FT_UINT16, BASE_DEC, VALS(mac_logical_channel_vals), 0, NULL, HFILL } }, #if 0 { &hf_mac_channel_str, { "Logical Channel", "mac.logical_channel", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, #endif #if 0 { &hf_mac_channel_hsdsch, { "MACd-FlowID", "mac.macd_flowid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_mac_macdflowd_id, { "MACd-FlowID", "mac.macd_flowid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mac_lch_id, { "Logical Channel ID", "mac.logical_channel_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mac_trch_id, { "Transport Channel ID", "mac.transport_channel_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_mac_edch_type2_descriptors, { "MAC-is Descriptors", "mac.edch.type2.descriptors", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_mac_edch_type2_lchid, { "LCH-ID", "mac.logical_channel_id", FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL } }, #endif #if 0 { &hf_mac_edch_type2_length, { "Length", "mac.edch.type2.length", FT_UINT16, BASE_DEC, NULL, 0x0ffe, NULL, HFILL } }, #endif #if 0 { &hf_mac_edch_type2_flag, { "Flag", "mac.edch.type2.lchid", FT_UINT8, BASE_HEX, NULL, 0x01, "Indicates if another entry follows", HFILL } }, #endif { &hf_mac_edch_type2_ss, { "SS", /* TODO: VALS */ "mac.edch.type2.ss", FT_UINT8, BASE_HEX, NULL, 0xc0, "Segmentation Status", HFILL } }, { &hf_mac_edch_type2_ss_interpretation, { "SS interpretation", "mac.edch.type2.ss_interpretation", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mac_edch_type2_tsn, { "TSN", "mac.edch.type2.tsn", FT_UINT16, BASE_DEC, NULL, 0, "Transmission Sequence Number", HFILL } }, { &hf_mac_edch_type2_sdu, { "MAC-is SDU", "mac.edch.type2.sdu", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mac_edch_type2_sdu_data, { "Data", "mac.edch.type2.sdu.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_mac_edch_type2_subframe_header, { "Subframe header", "mac.edch.type2.subframeheader", FT_STRING, BASE_NONE, NULL, 0x0, "EDCH Subframe header", HFILL } }, #endif { &hf_mac_is_reasmin, { "Reassembled in frame", "mac.is.reasmin", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_mac_is_fraglink, { "Frame", "mac.is.fraglink", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } } }; static ei_register_info ei[] = { { &ei_mac_per_frame_info_missing, { "mac.per_frame_info_missing", PI_MALFORMED, PI_ERROR, "Cannot dissect MAC frame because per-frame info is missing", EXPFILL }}, { &ei_mac_unknown_content, { "mac.unknown_content", PI_MALFORMED, PI_ERROR, "Unknown RACH DCCH/DTCH Content", EXPFILL }}, { &ei_mac_rach_tctf_unknown, { "mac.rach_tctf.unknown", PI_MALFORMED, PI_ERROR, "Unknown RACH TCTF", EXPFILL }}, { &ei_mac_cs_dtch_not_implemented, { "mac.cs_dtch.not_implemented", PI_DEBUG, PI_ERROR, "CS DTCH Is not implemented", EXPFILL }}, { &ei_mac_fach_content_type_unknown, { "mac.fach_content_type.unknown", PI_UNDECODED, PI_WARN, " Unimplemented FACH Content type!", EXPFILL }}, { &ei_mac_no_logical_channel, { "mac.no_logical_channel", PI_PROTOCOL, PI_WARN, "Frame is missing logical channel", EXPFILL }}, { &ei_mac_faked_logical_channel_id, { "mac.faked_logical_channel_id", PI_PROTOCOL, PI_WARN, "This is a faked logical channel id!", EXPFILL }}, { &ei_mac_macis_sdu_reassembled, { "mac.macis_sdu.reassembled", PI_REASSEMBLE, PI_CHAT, "Reassembled MAC-is SDU", EXPFILL }}, { &ei_mac_macis_sdu_first, { "mac.macis_sdu.first", PI_REASSEMBLE, PI_CHAT, "This MAC-is SDU is the first segment of a MAC-d PDU or MAC-c PDU", EXPFILL }}, { &ei_mac_macis_sdu_middle, { "mac.macis_sdu.middle", PI_REASSEMBLE, PI_CHAT, "This MAC-is SDU is a middle segment of a MAC-d PDU or MAC-c PDU", EXPFILL }}, { &ei_mac_macis_sdu_last, { "mac.macis_sdu.last", PI_REASSEMBLE, PI_CHAT, "This MAC-is SDU is the last segment of a MAC-d PDU or MAC-c PDU", EXPFILL }}, { &ei_mac_macis_sdu_complete, { "mac.macis_sdu.complete", PI_REASSEMBLE, PI_CHAT, "This MAC-is SDU is a complete MAC-d PDU or MAC-c PDU", EXPFILL }}, { &ei_mac_reserved_c_t, { "mac.reserved_ct", PI_PROTOCOL, PI_WARN, "C/T has a reserved value, PDU is discarded", EXPFILL }} }; expert_module_t* expert_umts_mac; proto_umts_mac = proto_register_protocol("MAC", "MAC", "mac"); proto_register_field_array(proto_umts_mac, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_umts_mac = expert_register_protocol(proto_umts_mac); expert_register_field_array(expert_umts_mac, ei, array_length(ei)); register_dissector("mac.fdd.rach", dissect_mac_fdd_rach, proto_umts_mac); register_dissector("mac.fdd.fach", dissect_mac_fdd_fach, proto_umts_mac); register_dissector("mac.fdd.pch", dissect_mac_fdd_pch, proto_umts_mac); register_dissector("mac.fdd.dch", dissect_mac_fdd_dch, proto_umts_mac); register_dissector("mac.fdd.edch", dissect_mac_fdd_edch, proto_umts_mac); register_dissector("mac.fdd.edch.type2", dissect_mac_fdd_edch_type2, proto_umts_mac); register_dissector("mac.fdd.hsdsch", dissect_mac_fdd_hsdsch, proto_umts_mac); register_init_routine(mac_init); register_cleanup_routine(mac_cleanup); /* Preferences */ mac_module = prefs_register_protocol(proto_umts_mac, NULL); prefs_register_enum_preference(mac_module, "tsn_size", "TSN size", "TSN size in bits, either 6 or 14 bit", &global_mac_tsn_size, tsn_size_enumvals, FALSE); } void proto_reg_handoff_umts_mac(void) { rlc_pcch_handle = find_dissector_add_dependency("rlc.pcch", proto_umts_mac); rlc_ccch_handle = find_dissector_add_dependency("rlc.ccch", proto_umts_mac); rlc_ctch_handle = find_dissector_add_dependency("rlc.ctch", proto_umts_mac); rlc_dcch_handle = find_dissector_add_dependency("rlc.dcch", proto_umts_mac); rlc_ps_dtch_handle = find_dissector_add_dependency("rlc.ps_dtch", proto_umts_mac); rrc_handle = find_dissector_add_dependency("rrc", proto_umts_mac); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-umts_mac.h
/* packet-umts_mac.h * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_UMTS_MAC_H #define PACKET_UMTS_MAC_H /* Target Channel Type Field (TCTF) values */ #define TCTF_CCCH_RACH_FDD 0x0 #define TCTF_DCCH_DTCH_RACH_FDD 0x1 #define TCTF_BCCH_FACH_FDD 0x0 #define TCTF_DCCH_DTCH_FACH_FDD 0x3 #define TCTF_MTCH_FACH_FDD 0x6 #define TCTF_CCCH_FACH_FDD 0x40 #define TCTF_MCCH_FACH_FDD 0x50 #define TCTF_MSCH_FACH_FDD 0x5f #define TCTF_CTCH_FACH_FDD 0x80 /* UeID Type values */ #define MAC_UEID_TYPE_URNTI 0x0 #define MAC_UEID_TYPE_CRNTI 0x1 enum mac_content_type { MAC_CONTENT_UNKNOWN, MAC_CONTENT_DCCH, MAC_CONTENT_PS_DTCH, MAC_CONTENT_CS_DTCH, MAC_CONTENT_CCCH }; /* Used for mapping id to string names*/ #define MAC_PCCH 0 #define MAC_CCCH 1 #define MAC_CTCH 2 #define MAC_DCCH 3 #define MAC_DTCH 4 #define MAC_BCCH 5 #define MAC_MCCH 6 #define MAC_MSCH 7 #define MAC_MTCH 8 #define MAC_N_A 9 #define MAX_MAC_FRAMES 64 typedef struct umts_mac_info { gboolean ctmux[MAX_MAC_FRAMES]; guint8 content[MAX_MAC_FRAMES]; guint8 lchid[MAX_MAC_FRAMES]; /*Makes displaying logical channel a lot easier*/ guint8 macdflow_id[MAX_MAC_FRAMES]; /*Makes displaying logical channel a lot easier*/ gboolean fake_chid[MAX_MAC_FRAMES]; /*Indicate if the child ID is faked or not*/ guint pdu_len; /*Length of MAC PDU, same for all PDUs in one FP frame*/ guint8 trchid[MAX_MAC_FRAMES]; /*Makes displaying logical channel a lot easier*/ } umts_mac_info; typedef struct { guint number_of_mac_is_sdus; guint8 lchid[MAX_MAC_FRAMES]; gint sdulength[MAX_MAC_FRAMES]; } umts_mac_is_info; enum enum_mac_tsn_size { MAC_TSN_6BITS, MAC_TSN_14BITS }; gint get_mac_tsn_size(void); #endif
C
wireshark/epan/dissectors/packet-umts_rlc.c
/* packet-umts_rlc.c * Routines for UMTS RLC (Radio Link Control) v9.3.0 disassembly * http://www.3gpp.org/ftp/Specs/archive/25_series/25.322/ * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/conversation.h> #include <epan/exceptions.h> #include <epan/expert.h> #include <epan/packet.h> #include <epan/prefs.h> #include <epan/proto_data.h> #include <epan/show_exception.h> #include <wiretap/wtap.h> /* * Optional include, for KASUMI support, * see header file for more information. * */ #include "packet-umts_fp.h" #include "packet-umts_rlc.h" #include "packet-rrc.h" /* TODO: * - distinguish between startpoints and endpoints? * - use sub_num in fragment identification? */ void proto_register_rlc(void); void proto_reg_handoff_rlc(void); int proto_umts_rlc = -1; extern int proto_fp; /* Preference to perform reassembly */ static gboolean global_rlc_perform_reassemby = TRUE; /* Preference to expect RLC headers without payloads */ static gboolean global_rlc_headers_expected = FALSE; /* Preference to expect ONLY ciphered data */ static gboolean global_rlc_ciphered = FALSE; /* Preference to ignore ciphering state reported from RRC */ /* This is important for captures with deciphered traffic AND the original security RRC messages present*/ static gboolean global_ignore_rrc_ciphering_indication = FALSE; /* Preference to try deciphering */ static gboolean global_rlc_try_decipher = FALSE; #ifdef HAVE_UMTS_KASUMI static const char *global_rlc_kasumi_key = NULL; #endif /* LI size preference */ #define RLC_LI_UPPERLAYER 255 /* LI-size comes from rlc_info struct rather than preference */ static gint global_rlc_li_size = RLC_LI_UPPERLAYER; static const enum_val_t li_size_enumvals[] = { {"7 bits", "7 bits", RLC_LI_7BITS}, {"15 bits", "15 bits", RLC_LI_15BITS}, {"Let upper layers decide", "Let upper layers decide", RLC_LI_UPPERLAYER}, {NULL, NULL, -1}}; /* fields */ static int hf_rlc_seq = -1; static int hf_rlc_ext = -1; static int hf_rlc_pad = -1; static int hf_rlc_reassembled_data = -1; static int hf_rlc_frags = -1; static int hf_rlc_frag = -1; static int hf_rlc_duplicate_of = -1; static int hf_rlc_reassembled_in = -1; static int hf_rlc_he = -1; static int hf_rlc_dc = -1; static int hf_rlc_p = -1; static int hf_rlc_li = -1; static int hf_rlc_li_value = -1; static int hf_rlc_li_ext = -1; static int hf_rlc_li_data = -1; static int hf_rlc_data = -1; static int hf_rlc_ciphered_data = -1; static int hf_rlc_ciphered_lis_data = -1; static int hf_rlc_ctrl_type = -1; static int hf_rlc_r1 = -1; static int hf_rlc_rsn = -1; static int hf_rlc_hfni = -1; static int hf_rlc_sufi = -1; static int hf_rlc_sufi_type = -1; static int hf_rlc_sufi_lsn = -1; static int hf_rlc_sufi_wsn = -1; static int hf_rlc_sufi_sn = -1; static int hf_rlc_sufi_l = -1; static int hf_rlc_sufi_fsn = -1; static int hf_rlc_sufi_len = -1; static int hf_rlc_sufi_bitmap = -1; static int hf_rlc_sufi_cw = -1; static int hf_rlc_sufi_n = -1; static int hf_rlc_sufi_sn_ack = -1; static int hf_rlc_sufi_sn_mrw = -1; static int hf_rlc_sufi_poll_sn = -1; static int hf_rlc_header_only = -1; static int hf_rlc_channel = -1; static int hf_rlc_channel_rbid = -1; static int hf_rlc_channel_dir = -1; static int hf_rlc_channel_ueid = -1; static int hf_rlc_sequence_number = -1; static int hf_rlc_length = -1; static int hf_rlc_bitmap_string = -1; /* subtrees */ static int ett_rlc = -1; static int ett_rlc_frag = -1; static int ett_rlc_fragments = -1; static int ett_rlc_sdu = -1; static int ett_rlc_sufi = -1; static int ett_rlc_bitmap = -1; static int ett_rlc_rlist = -1; static int ett_rlc_channel = -1; static expert_field ei_rlc_li_reserved = EI_INIT; static expert_field ei_rlc_he = EI_INIT; static expert_field ei_rlc_li_incorrect_mal = EI_INIT; static expert_field ei_rlc_sufi_cw = EI_INIT; static expert_field ei_rlc_kasumi_implementation_missing = EI_INIT; static expert_field ei_rlc_reassembly_unknown_error = EI_INIT; static expert_field ei_rlc_reassembly_lingering_endpoint = EI_INIT; static expert_field ei_rlc_sufi_len = EI_INIT; static expert_field ei_rlc_reassembly_fail_unfinished_sequence = EI_INIT; static expert_field ei_rlc_reassembly_fail_flag_set = EI_INIT; static expert_field ei_rlc_sufi_type = EI_INIT; static expert_field ei_rlc_reserved_bits_not_zero = EI_INIT; static expert_field ei_rlc_ctrl_type = EI_INIT; static expert_field ei_rlc_li_incorrect_warn = EI_INIT; static expert_field ei_rlc_li_too_many = EI_INIT; static expert_field ei_rlc_header_only = EI_INIT; static expert_field ei_rlc_ciphered_data = EI_INIT; static expert_field ei_rlc_no_per_frame_data = EI_INIT; static expert_field ei_rlc_incomplete_sequence = EI_INIT; static expert_field ei_rlc_unknown_udp_framing_tag = EI_INIT; static expert_field ei_rlc_missing_udp_framing_tag = EI_INIT; static dissector_handle_t ip_handle; static dissector_handle_t rrc_handle; static dissector_handle_t bmc_handle; enum rlc_channel_type { RLC_PCCH, RLC_BCCH, RLC_UL_CCCH, RLC_DL_CCCH, RLC_UL_DCCH, RLC_DL_DCCH, RLC_PS_DTCH, RLC_DL_CTCH, RLC_UNKNOWN_CH }; static const value_string rlc_dir_vals[] = { { P2P_DIR_UL, "Uplink" }, { P2P_DIR_DL, "Downlink" }, { 0, NULL } }; static const true_false_string rlc_header_only_val = { "RLC PDU header only", "RLC PDU header and body present" }; static const true_false_string rlc_ext_val = { "Next field is Length Indicator and E Bit", "Next field is data, piggybacked STATUS PDU or padding" }; static const true_false_string rlc_dc_val = { "Data", "Control" }; static const true_false_string rlc_p_val = { "Request a status report", "Status report not requested" }; static const value_string rlc_he_vals[] = { { 0, "The succeeding octet contains data" }, { 1, "The succeeding octet contains a length indicator and E bit" }, { 2, "The succeeding octet contains data and the last octet of the PDU is the last octet of an SDU" }, { 0, NULL } }; #define RLC_STATUS 0x0 #define RLC_RESET 0x1 #define RLC_RESET_ACK 0x2 static const value_string rlc_ctrl_vals[] = { { RLC_STATUS, "Status" }, { RLC_RESET, "Reset" }, { RLC_RESET_ACK, "Reset Ack" }, { 0, NULL } }; #define RLC_SUFI_NOMORE 0x0 #define RLC_SUFI_WINDOW 0x1 #define RLC_SUFI_ACK 0x2 #define RLC_SUFI_LIST 0x3 #define RLC_SUFI_BITMAP 0x4 #define RLC_SUFI_RLIST 0x5 #define RLC_SUFI_MRW 0x6 #define RLC_SUFI_MRW_ACK 0x7 #define RLC_SUFI_POLL 0x8 static const value_string rlc_sufi_vals[] = { { RLC_SUFI_NOMORE, "No more data" }, { RLC_SUFI_WINDOW, "Window size" }, { RLC_SUFI_ACK, "Acknowledgement" }, { RLC_SUFI_LIST, "List" }, { RLC_SUFI_BITMAP, "Bitmap" }, { RLC_SUFI_RLIST, "Relative list" }, { RLC_SUFI_MRW, "Move receiving window" }, { RLC_SUFI_MRW_ACK, "Move receiving window acknowledgement" }, { RLC_SUFI_POLL, "Poll" }, { 0, NULL } }; /* reassembly related data */ static GHashTable *fragment_table = NULL; /* table of not yet assembled fragments */ static GHashTable *endpoints = NULL; /* List of SDU-endpoints */ static GHashTable *reassembled_table = NULL; /* maps fragment -> complete sdu */ static GHashTable *sequence_table = NULL; /* channel -> seq */ static GHashTable *duplicate_table = NULL; /* duplicates */ /* identify an RLC channel, using one of two options: * - via Radio Bearer ID and unique UE ID * - via Radio Bearer ID and (VPI/VCI/CID) + Link ID */ struct rlc_channel { guint32 ueid; guint16 vpi; guint16 vci; guint8 cid; guint16 link; /* link number */ guint8 rbid; /* radio bearer ID */ guint8 dir; /* direction */ enum rlc_li_size li_size; enum rlc_mode mode; }; /* used for duplicate detection */ struct rlc_seq { guint32 frame_num; nstime_t arrival; guint16 seq; guint16 oc; /* overflow counter, this is not used? */ }; struct rlc_seqlist { struct rlc_channel ch; GList *list; /* We will store one seqlist per channel so this is a good place to indicate * whether or not this channel's reassembly has failed or not. */ guint fail_packet; /* Equal to packet where fail flag was set or 0 otherwise. */ }; /* fragment representation */ struct rlc_frag { guint32 frame_num; struct rlc_channel ch; guint16 seq; /* RLC sequence number */ guint16 li; /* LI within current RLC frame */ guint16 len; /* length of fragment data */ guint8 *data; /* store fragment data here */ struct rlc_frag *next; /* next fragment */ }; struct rlc_sdu { tvbuff_t *tvb; /* contains reassembled tvb */ guint16 len; /* total length of reassembled SDU */ guint16 fragcnt; /* number of fragments within this SDU */ guint8 *data; /* reassembled data buffer */ struct rlc_frag *reassembled_in; struct rlc_frag *frags; /* pointer to list of fragments */ struct rlc_frag *last; /* pointer to last fragment */ }; struct rlc_li { guint16 li; /* original li */ guint16 len; /* length of this data fragment */ guint8 ext; /* extension bit value */ proto_tree *tree; /* subtree for this LI */ }; /*** KASUMI related variables and structs ***/ typedef struct umts_kat_key{ /*Stores 128-bits KASUMI key*/ guint64 high; /*64 MSB*/ guint64 low; /*64 LSB*/ }kasumi_key; /*Counter used as input for confidentiality algorithm*/ static guint32 ps_counter[31][2] ; static gboolean counter_init[31][2]; static guint32 max_counter = 0; static GTree * counter_map; /*Saves the countervalues at first pass through, since they will be update*/ /* hashtable functions for fragment table * rlc_channel -> SDU */ static guint rlc_channel_hash(gconstpointer key) { const struct rlc_channel *ch = (const struct rlc_channel *)key; if (ch->ueid) return ch->ueid | ch->rbid | ch->mode; return (ch->vci << 16) | (ch->link << 16) | ch->vpi | ch->vci; } static gboolean rlc_channel_equal(gconstpointer a, gconstpointer b) { const struct rlc_channel *x = (const struct rlc_channel *)a, *y = (const struct rlc_channel *)b; if (x->ueid || y->ueid) return x->ueid == y->ueid && x->rbid == y->rbid && x->mode == y->mode && x->dir == y->dir ? TRUE : FALSE; return x->vpi == y->vpi && x->vci == y->vci && x->cid == y->cid && x->rbid == y->rbid && x->mode == y->mode && x->dir == y->dir && x->link == y->link ? TRUE : FALSE; } static int rlc_channel_assign(struct rlc_channel *ch, enum rlc_mode mode, packet_info *pinfo, struct atm_phdr *atm) { rlc_info *rlcinf; fp_info *fpinf; fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!fpinf || !rlcinf) return -1; if (rlcinf->ueid[fpinf->cur_tb]) { ch->ueid = rlcinf->ueid[fpinf->cur_tb]; ch->vpi = ch->vci = ch->link = ch->cid = 0; } else { if (!atm) return -1; ch->ueid = 1; ch->vpi = atm->vpi; ch->vci = atm->vci; ch->cid = atm->aal2_cid; ch->link = pinfo->link_number; } ch->rbid = rlcinf->rbid[fpinf->cur_tb]; ch->dir = pinfo->link_dir; ch->mode = mode; ch->li_size = rlcinf->li_size[fpinf->cur_tb]; return 0; } static struct rlc_channel * rlc_channel_create(enum rlc_mode mode, packet_info *pinfo, struct atm_phdr *atm) { struct rlc_channel *ch; int rv; ch = g_new0(struct rlc_channel, 1); rv = rlc_channel_assign(ch, mode, pinfo, atm); if (rv != 0) { /* channel assignment failed */ g_free(ch); ch = NULL; REPORT_DISSECTOR_BUG("Failed to assign channel"); } return ch; } static void rlc_channel_delete(gpointer data) { g_free(data); } /* hashtable functions for reassembled table * fragment -> SDU */ static guint rlc_frag_hash(gconstpointer key) { const struct rlc_frag *frag = (const struct rlc_frag *)key; return (frag->frame_num << 12) | frag->seq; } static gboolean rlc_frag_equal(gconstpointer a, gconstpointer b) { const struct rlc_frag *x = (const struct rlc_frag *)a; const struct rlc_frag *y = (const struct rlc_frag *)b; return rlc_channel_equal(&x->ch, &y->ch) && x->seq == y->seq && x->frame_num == y->frame_num && x->li == y->li ? TRUE : FALSE; } static struct rlc_sdu * rlc_sdu_create(void) { struct rlc_sdu *sdu; sdu = wmem_new0(wmem_file_scope(), struct rlc_sdu); return sdu; } static void rlc_frag_delete(gpointer data) { struct rlc_frag *frag = (struct rlc_frag *)data; if (frag->data) { g_free(frag->data); frag->data = NULL; } } static void rlc_sdu_frags_delete(gpointer data) { struct rlc_sdu *sdu = (struct rlc_sdu *)data; struct rlc_frag *frag; frag = sdu->frags; while (frag) { if (frag->data) { g_free(frag->data); } frag->data = NULL; frag = frag->next; } } static int rlc_frag_assign(struct rlc_frag *frag, enum rlc_mode mode, packet_info *pinfo, guint16 seq, guint16 li, struct atm_phdr *atm) { frag->frame_num = pinfo->num; frag->seq = seq; frag->li = li; frag->len = 0; frag->data = NULL; rlc_channel_assign(&frag->ch, mode, pinfo, atm); return 0; } static int rlc_frag_assign_data(struct rlc_frag *frag, tvbuff_t *tvb, guint16 offset, guint16 length) { frag->len = length; frag->data = (guint8 *)tvb_memdup(wmem_file_scope(), tvb, offset, length); return 0; } static struct rlc_frag * rlc_frag_create(tvbuff_t *tvb, enum rlc_mode mode, packet_info *pinfo, guint16 offset, guint16 length, guint16 seq, guint16 li, struct atm_phdr *atm) { struct rlc_frag *frag; frag = wmem_new0(wmem_file_scope(), struct rlc_frag); rlc_frag_assign(frag, mode, pinfo, seq, li, atm); rlc_frag_assign_data(frag, tvb, offset, length); return frag; } static int rlc_cmp_seq(gconstpointer a, gconstpointer b) { const struct rlc_seq *_a = (const struct rlc_seq *)a, *_b = (const struct rlc_seq *)b; return _a->seq < _b->seq ? -1 : _a->seq > _b->seq ? 1 : 0; } static int moduloCompare(guint16 a, guint16 b, guint16 modulus) { int ret; a = a % modulus; b = b % modulus; if( a <= b ){ ret = a - b; } else { ret = a - (b + modulus); } if( ret == (1 - modulus) ){ ret = 1; } return ret; } static guint16 getChannelSNModulus(struct rlc_channel * ch_lookup) { if( RLC_UM == ch_lookup->mode){ /*FIXME: This is a very heuristic way to determine SN bitwidth. */ return 128; } else { return 4096; } } /* "Value destroy" function called each time an entry is removed * from the sequence_table hash. * It frees the GList pointed to by the entry. */ static void free_sequence_table_entry_data(gpointer data) { struct rlc_seqlist *list = (struct rlc_seqlist *)data; if (list->list != NULL) { g_list_free(list->list); list->list = NULL; /* for good measure */ } } /** Utility functions used for various comparisons/cleanups in tree **/ static gint rlc_simple_key_cmp(gconstpointer b_ptr, gconstpointer a_ptr, gpointer ignore _U_){ if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){ return -1; } return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr); } static void fragment_table_init(void) { int i; fragment_table = g_hash_table_new_full(rlc_channel_hash, rlc_channel_equal, rlc_channel_delete, NULL); endpoints = g_hash_table_new_full(rlc_channel_hash, rlc_channel_equal, rlc_channel_delete, NULL); reassembled_table = g_hash_table_new_full(rlc_frag_hash, rlc_frag_equal, rlc_frag_delete, rlc_sdu_frags_delete); sequence_table = g_hash_table_new_full(rlc_channel_hash, rlc_channel_equal, NULL, free_sequence_table_entry_data); duplicate_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); /*Reset and or clear deciphering variables*/ counter_map = g_tree_new_full(rlc_simple_key_cmp,NULL,NULL,rlc_channel_delete); for(i = 0; i< 31; i++ ){ ps_counter[i][0] = 0; ps_counter[i][1] = 0; counter_init[i][0] = 0; counter_init[i][1] = 0; } max_counter = 0; } static void fragment_table_cleanup(void) { g_tree_destroy(counter_map); g_hash_table_destroy(fragment_table); g_hash_table_destroy(endpoints); g_hash_table_destroy(reassembled_table); g_hash_table_destroy(sequence_table); g_hash_table_destroy(duplicate_table); } /* add the list of fragments for this sdu to 'tree' */ static void tree_add_fragment_list(struct rlc_sdu *sdu, tvbuff_t *tvb,packet_info *pinfo, proto_tree *tree) { proto_item *ti; proto_tree *frag_tree; guint16 offset; struct rlc_frag *sdufrag; ti = proto_tree_add_item(tree, hf_rlc_frags, tvb, 0, -1, ENC_NA); proto_item_set_generated(ti); frag_tree = proto_item_add_subtree(ti, ett_rlc_fragments); proto_item_append_text(ti, " (%u bytes, %u fragments) ", sdu->len, sdu->fragcnt); sdufrag = sdu->frags; offset = 0; while (sdufrag) { if (sdufrag->len > 0) { proto_tree_add_uint_format(frag_tree, hf_rlc_frag, tvb, offset, sdufrag->len, sdufrag->frame_num, "Frame: %u, payload: %u-%u (%u bytes) (Seq: %u)", sdufrag->frame_num, offset, offset + sdufrag->len - 1, sdufrag->len, sdufrag->seq); } else { proto_tree_add_uint_format(frag_tree, hf_rlc_frag, tvb, offset, sdufrag->len, sdufrag->frame_num, "Frame: %u, payload: none (0 bytes) (Seq: %u)", sdufrag->frame_num, sdufrag->seq); } mark_frame_as_depended_upon(pinfo->fd, sdufrag->frame_num); offset += sdufrag->len; sdufrag = sdufrag->next; } ti = proto_tree_add_item(ti, hf_rlc_reassembled_data, tvb, 0, -1, ENC_NA); proto_item_set_generated(ti); } /* add the list of fragments for this sdu to 'tree' */ static void tree_add_fragment_list_incomplete(struct rlc_sdu *sdu, tvbuff_t *tvb, proto_tree *tree) { proto_item *ti; proto_tree *frag_tree; guint16 offset; struct rlc_frag *sdufrag; ti = proto_tree_add_item(tree, hf_rlc_frags, tvb, 0, 0, ENC_NA); proto_item_set_generated(ti); frag_tree = proto_item_add_subtree(ti, ett_rlc_fragments); proto_item_append_text(ti, " (%u bytes, %u fragments) ", sdu->len, sdu->fragcnt); sdufrag = sdu->frags; offset = 0; while (sdufrag) { proto_tree_add_uint_format(frag_tree, hf_rlc_frag, tvb, 0, 0, sdufrag->frame_num, "Frame: %u, payload %u-%u (%u bytes) (Seq: %u)", sdufrag->frame_num, offset, offset + sdufrag->len - 1, sdufrag->len, sdufrag->seq); offset += sdufrag->len; sdufrag = sdufrag->next; } } /* Add the same description to too the two given proto_items */ static void add_description(proto_item *li_ti, proto_item *length_ti, const char *format, ...) G_GNUC_PRINTF(3, 4); static void add_description(proto_item *li_ti, proto_item *length_ti, const char *format, ...) { #define MAX_INFO_BUFFER 256 static char info_buffer[MAX_INFO_BUFFER]; va_list ap; va_start(ap, format); vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); proto_item_append_text(li_ti, " (%s)", info_buffer); proto_item_append_text(length_ti, " (%s)", info_buffer); } /* add information for an LI to 'tree' */ static proto_tree * tree_add_li(enum rlc_mode mode, struct rlc_li *li, guint8 li_idx, guint32 hdr_offs, gboolean li_is_on_2_bytes, tvbuff_t *tvb, proto_tree *tree) { proto_item *root_ti, *ti; proto_tree *li_tree; guint32 li_offs; guint64 length; if (!tree) return NULL; if (li_is_on_2_bytes) { li_offs = hdr_offs + li_idx*2; root_ti = proto_tree_add_item(tree, hf_rlc_li, tvb, li_offs, 2, ENC_NA); li_tree = proto_item_add_subtree(root_ti, ett_rlc_frag); ti = proto_tree_add_bits_ret_val(li_tree, hf_rlc_li_value, tvb, li_offs*8, 15, &length, ENC_BIG_ENDIAN); switch (li->li) { case 0x0000: add_description(root_ti, ti, "The previous RLC PDU was exactly filled with the last segment of an RLC SDU and there is no LI that indicates the end of the RLC SDU in the previous RLC PDU"); break; case 0x7ffa: if (mode == RLC_UM) { add_description(root_ti, ti, "The first data octet in this RLC PDU is the first octet of an RLC SDU and the second last octet in this RLC PDU is the last octet of the same RLC SDU. The remaining octet in the RLC PDU is ignored"); } else { add_description(root_ti, ti, "Reserved"); } break; case 0x7ffb: add_description(root_ti, ti, "The second last octet in the previous RLC PDU is the last octet of an RLC SDU and there is no LI to indicate the end of SDU. The remaining octet in the previous RLC PDU is ignored"); break; case 0x7ffc: if (mode == RLC_UM) { add_description(root_ti, ti, "The first data octet in this RLC PDU is the first octet of an RLC SDU"); } else { add_description(root_ti, ti, "Reserved"); } break; case 0x7ffd: if (mode == RLC_UM) { add_description(root_ti, ti, "The first data octet in this RLC PDU is the first octet of an RLC SDU and the last octet in this RLC PDU is the last octet of the same RLC SDU"); } else { add_description(root_ti, ti, "Reserved"); } break; case 0x7ffe: if (mode == RLC_UM) { add_description(root_ti, ti, "The RLC PDU contains a segment of an SDU but neither the first octet nor the last octet of this SDU"); } else { add_description(root_ti, ti, "The rest of the RLC PDU includes a piggybacked STATUS PDU"); } break; case 0x7fff: add_description(root_ti, ti, "The rest of the RLC PDU is padding"); break; default: add_description(root_ti, ti, "length=%u", (guint16)length); break; } proto_tree_add_bits_item(li_tree, hf_rlc_li_ext, tvb, li_offs*8+15, 1, ENC_BIG_ENDIAN); } else { li_offs = hdr_offs + li_idx; root_ti = proto_tree_add_item(tree, hf_rlc_li, tvb, li_offs, 1, ENC_NA); li_tree = proto_item_add_subtree(root_ti, ett_rlc_frag); ti = proto_tree_add_bits_ret_val(li_tree, hf_rlc_li_value, tvb, li_offs*8, 7, &length, ENC_BIG_ENDIAN); switch (li->li) { case 0x00: add_description(root_ti, ti, "The previous RLC PDU was exactly filled with the last segment of an RLC SDU and there is no LI that indicates the end of the RLC SDU in the previous RLC PDU"); break; case 0x7c: if (mode == RLC_UM) { add_description(root_ti, ti, "The first data octet in this RLC PDU is the first octet of an RLC SDU"); } else { add_description(root_ti, ti, "Reserved"); } break; case 0x7d: if (mode == RLC_UM) { add_description(root_ti, ti, "The first data octet in this RLC PDU is the first octet of an RLC SDU and the last octet in this RLC PDU is the last octet of the same RLC SDU"); } else { add_description(root_ti, ti, "Reserved"); } break; case 0x7e: if (mode == RLC_UM) { add_description(root_ti, ti, "The RLC PDU contains a segment of an SDU but neither the first octet nor the last octet of this SDU"); } else { add_description(root_ti, ti, "The rest of the RLC PDU includes a piggybacked STATUS PDU"); } break; case 0x7f: add_description(root_ti, ti, "The rest of the RLC PDU is padding"); break; default: add_description(root_ti, ti, "length=%u", (guint16)length); break; } proto_tree_add_bits_item(li_tree, hf_rlc_li_ext, tvb, li_offs*8+7, 1, ENC_BIG_ENDIAN); } if (li->len > 0) { if (li->li > tvb_reported_length_remaining(tvb, hdr_offs)) return li_tree; if (li->len > li->li) return li_tree; ti = proto_tree_add_item(li_tree, hf_rlc_li_data, tvb, hdr_offs + li->li - li->len, li->len, ENC_NA); proto_item_set_hidden(ti); } return li_tree; } /* add a fragment to an SDU */ static int rlc_sdu_add_fragment(enum rlc_mode mode, struct rlc_sdu *sdu, struct rlc_frag *frag) { struct rlc_frag *tmp; if (!sdu->frags) { /* insert as first element */ sdu->frags = frag; sdu->last = frag; sdu->fragcnt++; sdu->len += frag->len; return 0; } switch (mode) { case RLC_UM: /* insert as last element */ sdu->last->next = frag; frag->next = NULL; sdu->last = frag; sdu->len += frag->len; break; case RLC_AM: /* insert ordered */ tmp = sdu->frags; /* If receiving exotic border line sequence, e.g. 4094, 4095, 0, 1 */ if (frag->seq+2048 < tmp->seq) { while (tmp->next && frag->seq+2048 < tmp->seq) tmp = tmp->next; if (tmp->next == NULL) { tmp->next = frag; sdu->last = frag; } else { while (tmp->next && tmp->next->seq < frag->seq) tmp = tmp->next; frag->next = tmp->next; tmp->next = frag; if (frag->next == NULL) sdu->last = frag; } } else { /* Receiving ordinary sequence */ if (frag->seq < tmp->seq) { /* insert as first element */ frag->next = tmp; sdu->frags = frag; } else { while (tmp->next && tmp->next->seq < frag->seq) tmp = tmp->next; frag->next = tmp->next; tmp->next = frag; if (frag->next == NULL) sdu->last = frag; } } sdu->len += frag->len; break; default: return -2; } sdu->fragcnt++; return 0; } static void reassemble_data(struct rlc_channel *ch, struct rlc_sdu *sdu, struct rlc_frag *frag) { struct rlc_frag *temp; guint16 offs = 0; if (!sdu || !ch || !sdu->frags) return; if (sdu->data) return; /* already assembled */ if (frag) sdu->reassembled_in = frag; else sdu->reassembled_in = sdu->last; sdu->data = (guint8 *)wmem_alloc(wmem_file_scope(), sdu->len); temp = sdu->frags; while (temp && ((offs + temp->len) <= sdu->len)) { memcpy(sdu->data + offs, temp->data, temp->len); wmem_free(wmem_file_scope(), temp->data); temp->data = NULL; /* mark this fragment in reassembled table */ g_hash_table_insert(reassembled_table, temp, sdu); offs += temp->len; temp = temp->next; } } #define RLC_ADD_FRAGMENT_FAIL_PRINT 0 #define RLC_ADD_FRAGMENT_DEBUG_PRINT 0 #if RLC_ADD_FRAGMENT_DEBUG_PRINT static void printends(GList * list) { if (list == NULL) return; g_print("-> length: %d\n[", g_list_length(list)); while (list) { g_print("%d ", GPOINTER_TO_INT(list->data)); list = list->next; } g_print("]\n"); } #endif static struct rlc_frag ** get_frags(packet_info * pinfo, struct rlc_channel * ch_lookup, struct atm_phdr *atm) { gpointer value = NULL; struct rlc_frag ** frags = NULL; /* Look for already created frags table */ if (g_hash_table_lookup_extended(fragment_table, ch_lookup, NULL, &value)) { frags = (struct rlc_frag **)value; } else if (pinfo != NULL) { struct rlc_channel *ch; ch = rlc_channel_create(ch_lookup->mode, pinfo, atm); frags = (struct rlc_frag **)wmem_alloc0(wmem_file_scope(), sizeof(struct rlc_frag *) * 4096); g_hash_table_insert(fragment_table, ch, frags); } else { return NULL; } return frags; } static struct rlc_seqlist * get_endlist(packet_info * pinfo, struct rlc_channel * ch_lookup, struct atm_phdr *atm) { gpointer value = NULL; struct rlc_seqlist * endlist = NULL; /* If there already exists a frag table for this channel use that one. */ if (g_hash_table_lookup_extended(endpoints, ch_lookup, NULL, &value)) { endlist = (struct rlc_seqlist *)value; } else if (pinfo != NULL) { /* Else create a new one. */ struct rlc_channel * ch; endlist = wmem_new(wmem_file_scope(), struct rlc_seqlist); ch = rlc_channel_create(ch_lookup->mode, pinfo, atm); endlist->fail_packet = 0; endlist->list = NULL; endlist->list = g_list_prepend(endlist->list, GINT_TO_POINTER(-1)); g_hash_table_insert(endpoints, ch, endlist); } else { return NULL; } return endlist; } static void reassemble_sequence(struct rlc_frag ** frags, struct rlc_seqlist * endlist, struct rlc_channel * ch_lookup, guint16 start, guint16 end) { GList * element = NULL; struct rlc_sdu * sdu = rlc_sdu_create(); guint16 snmod = getChannelSNModulus(ch_lookup); /* Insert fragments into SDU. */ for (; moduloCompare(start,end,snmod ) <= 0; start = (start+1)%snmod) { struct rlc_frag * tempfrag = NULL; tempfrag = frags[start]->next; frags[start]->next = NULL; rlc_sdu_add_fragment(ch_lookup->mode, sdu, frags[start]); frags[start] = tempfrag; } /* Remove first endpoint. */ element = g_list_first(endlist->list); if (element) { endlist->list = g_list_remove_link(endlist->list, element); if (frags[end] != NULL) { if (endlist->list) { endlist->list->data = GINT_TO_POINTER((GPOINTER_TO_INT(endlist->list->data) - 1 + snmod) % snmod); } } } reassemble_data(ch_lookup, sdu, NULL); } /* Reset the specified channel's reassembly data, useful for when a sequence * resets on transport channel swap. */ /* TODO: not currently called */ void rlc_reset_channel(enum rlc_mode mode, guint8 rbid, guint8 dir, guint32 ueid, struct atm_phdr *atm) { struct rlc_frag ** frags = NULL; struct rlc_seqlist * endlist = NULL; struct rlc_channel ch_lookup; guint i; ch_lookup.mode = mode; ch_lookup.rbid = rbid; ch_lookup.dir = dir; ch_lookup.ueid = ueid; frags = get_frags(NULL, &ch_lookup, atm); endlist = get_endlist(NULL, &ch_lookup, atm); if (endlist) { endlist->fail_packet = 0; g_list_free(endlist->list); endlist->list = NULL; } if (frags) { for (i = 0; i < 4096; i++) { frags[i] = NULL; } } } /* add a new fragment to an SDU * if length == 0, just finalize the specified SDU */ static struct rlc_frag * add_fragment(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 offset, guint16 seq, guint16 num_li, guint16 len, gboolean final, struct atm_phdr *atm) { struct rlc_channel ch_lookup; struct rlc_frag frag_lookup, *frag = NULL; gpointer orig_key = NULL, value = NULL; struct rlc_sdu *sdu = NULL; struct rlc_frag ** frags = NULL; struct rlc_seqlist * endlist = NULL; GList * element = NULL; int snmod; if (rlc_channel_assign(&ch_lookup, mode, pinfo, atm) == -1) { return NULL; } rlc_frag_assign(&frag_lookup, mode, pinfo, seq, num_li, atm); #if RLC_ADD_FRAGMENT_DEBUG_PRINT g_print("packet: %d, channel (%d %d %d) seq: %u, num_li: %u, offset: %u, \n", pinfo->num, ch_lookup.dir, ch_lookup.rbid, ch_lookup.ueid, seq, num_li, offset); #endif snmod = getChannelSNModulus(&ch_lookup); /* look for an already assembled SDU */ if (g_hash_table_lookup_extended(reassembled_table, &frag_lookup, &orig_key, &value)) { /* this fragment is already reassembled somewhere */ frag = (struct rlc_frag *)orig_key; sdu = (struct rlc_sdu *)value; if (tree) { /* mark the fragment, if reassembly happened somewhere else */ if (frag->seq != sdu->reassembled_in->seq || frag->li != sdu->reassembled_in->li) proto_tree_add_uint(tree, hf_rlc_reassembled_in, tvb, 0, 0, sdu->reassembled_in->frame_num); } return frag; } frags = get_frags(pinfo, &ch_lookup, atm); endlist = get_endlist(pinfo, &ch_lookup, atm); /* If already done reassembly */ if (PINFO_FD_VISITED(pinfo)) { if (tree && len > 0) { if (endlist->list && endlist->list->next) { gint16 start = (GPOINTER_TO_INT(endlist->list->data) + 1) % snmod; gint16 end = GPOINTER_TO_INT(endlist->list->next->data); gint16 missing = start; gboolean wecanreasmmore = TRUE; for (; moduloCompare(missing,end,snmod ) <= 0; missing = (missing+1)%snmod) { if (frags[missing] == NULL) { wecanreasmmore = FALSE; break; } } if (wecanreasmmore) { reassemble_sequence(frags, endlist, &ch_lookup, start, end); } else { if (end >= 0 && end < snmod && frags[end]) { proto_tree_add_expert_format(tree, pinfo, &ei_rlc_reassembly_fail_unfinished_sequence, tvb, 0, 0, "Did not perform reassembly because of unfinished sequence (%d->%d [packet %u]), could not find %d.", start, end, frags[end]->frame_num, missing); } else { proto_tree_add_expert_format(tree, pinfo, &ei_rlc_reassembly_fail_unfinished_sequence, tvb, 0, 0, "Did not perform reassembly because of unfinished sequence (%d->%d [could not determine packet]), could not find %d.", start, end, missing); } } } else if (endlist->list) { if (endlist->fail_packet != 0 && endlist->fail_packet <= pinfo->num) { proto_tree_add_expert_format(tree, pinfo, &ei_rlc_reassembly_fail_flag_set, tvb, 0, 0, "Did not perform reassembly because fail flag was set in packet %u.", endlist->fail_packet); } else { gint16 end = GPOINTER_TO_INT(endlist->list->data); if (end >= 0 && end < snmod && frags[end]) { proto_tree_add_expert_format(tree, pinfo, &ei_rlc_reassembly_lingering_endpoint, tvb, 0, 0, "Did not perform reassembly because of unfinished sequence, found lingering endpoint (%d [packet %d]).", end, frags[end]->frame_num); } else { proto_tree_add_expert_format(tree, pinfo, &ei_rlc_reassembly_lingering_endpoint, tvb, 0, 0, "Did not perform reassembly because of unfinished sequence, found lingering endpoint (%d [could not determine packet]).", end); } } } else { expert_add_info(pinfo, NULL, &ei_rlc_reassembly_unknown_error); } } return NULL; /* If already done reassembly and no SDU found, too bad */ } if (endlist->fail_packet != 0) { /* don't continue after sh*t has hit the fan */ return NULL; } frag = rlc_frag_create(tvb, mode, pinfo, offset, len, seq, num_li, atm); /* If frags[seq] is not NULL then we must have data from several PDUs in the * same RLC packet (using Length Indicators) or something has gone terribly * wrong. */ if (frags[seq] != NULL) { if (num_li > 0) { struct rlc_frag * tempfrag = frags[seq]; while (tempfrag->next != NULL) tempfrag = tempfrag->next; tempfrag->next = frag; } else { /* This should never happen */ endlist->fail_packet = pinfo->num; return NULL; } } else { frags[seq] = frag; } /* It is also possible that frags[seq] is NULL even though we do have data * from several PDUs in the same RLC packet. This is if the reassembly is * not lagging behind at all because of perfectly ordered sequences. */ if (endlist->list && num_li != 0) { gint16 first = GPOINTER_TO_INT(endlist->list->data); if (seq == first) { endlist->list->data = GINT_TO_POINTER(first-1); } } /* If this is an endpoint */ if (final) { endlist->list = g_list_append(endlist->list, GINT_TO_POINTER((gint)seq)); } #if RLC_ADD_FRAGMENT_DEBUG_PRINT printends(endlist->list); #endif /* Try to reassemble SDU. */ if (endlist->list && endlist->list->next) { gint16 start = (GPOINTER_TO_INT(endlist->list->data) + 1) % snmod; gint16 end = GPOINTER_TO_INT(endlist->list->next->data); if (frags[end] == NULL) { #if RLC_ADD_FRAGMENT_FAIL_PRINT proto_tree_add_debug_text(tree, "frag[end] is null, this is probably because end was a startpoint but because of some error ended up being treated as an endpoint, setting fail flag, start %d, end %d, packet %u\n", start, end, pinfo->num); #endif endlist->fail_packet = pinfo->num; return NULL; } /* If our endpoint is a LI=0 with no data. */ if (start == end && frags[start]->len == 0) { element = g_list_first(endlist->list); if (element) { endlist->list = g_list_remove_link(endlist->list, element); } frags[start] = frags[start]->next; /* If frags[start] is not NULL now, then that means that there was * another fragment with the same seq number because of LI. If we * don't decrease the endpoint by 1 then that fragment will be * skipped and all hell will break lose. */ if (frags[start] != NULL) { endlist->list->data = GINT_TO_POINTER(start-1); } /* NOTE: frags[start] is wmem_alloc'ed and will remain until file closes, we would want to free it here maybe. */ return NULL; } #if RLC_ADD_FRAGMENT_DEBUG_PRINT g_print("start: %d, end: %d\n",start, end); #endif for (; moduloCompare(start,end,snmod ) < 0; start = (start+1)%snmod) { if (frags[start] == NULL) { if (MIN((start-seq+snmod)%snmod, (seq-start+snmod)%snmod) >= snmod/4) { #if RLC_ADD_FRAGMENT_FAIL_PRINT proto_tree_add_debug_text(tree, "Packet %u. Setting fail flag because RLC fragment with sequence number %u was \ too far away from an unfinished sequence (%u->%u). The missing sequence number \ is %u. The most recently complete sequence ended in packet %u.", pinfo->num, seq, 0, end, start, 0); #endif endlist->fail_packet = pinfo->num; /* If it has gone too far, give up */ return NULL; } return frag; } } start = (GPOINTER_TO_INT(endlist->list->data) + 1) % snmod; reassemble_sequence(frags, endlist, &ch_lookup, start, end); } else if (endlist->list) { gint16 first = (GPOINTER_TO_INT(endlist->list->data) + 1) % snmod; /* If the distance between the oldest stored endpoint in endlist and * this endpoint is too large, set fail flag. */ if (MIN((first-seq+snmod)%snmod, (seq-first+snmod)%snmod) >= snmod/4) { #if RLC_ADD_FRAGMENT_FAIL_PRINT proto_tree_add_debug_text(tree, "Packet %u. Setting fail flag because RLC fragment with sequence number %u was \ too far away from an unfinished sequence with start %u and without end.", pinfo->num, seq, first); #endif endlist->fail_packet = pinfo->num; /* Give up if things have gone too far. */ return NULL; } } return frag; } /* is_data is used to identify rlc data parts that are not identified by an LI, but are at the end of * the RLC frame * these can be valid reassembly points, but only if the LI of the *next* relevant RLC frame is * set to '0' (this is indicated in the reassembled SDU */ static tvbuff_t * get_reassembled_data(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 seq, guint16 num_li, struct atm_phdr *atm) { gpointer orig_frag, orig_sdu; struct rlc_sdu *sdu; struct rlc_frag lookup, *frag; rlc_frag_assign(&lookup, mode, pinfo, seq, num_li, atm); if (!g_hash_table_lookup_extended(reassembled_table, &lookup, &orig_frag, &orig_sdu)) return NULL; sdu = (struct rlc_sdu *)orig_sdu; if (!sdu || !sdu->data) return NULL; /* TODO */ #if 0 if (!rlc_frag_equal(&lookup, sdu->reassembled_in)) return NULL; #endif frag = sdu->frags; while (frag->next) { if (frag->next->seq - frag->seq > 1) { proto_tree_add_expert(tree, pinfo, &ei_rlc_incomplete_sequence, tvb, 0, 0); tree_add_fragment_list_incomplete(sdu, tvb, tree); return NULL; } frag = frag->next; } sdu->tvb = tvb_new_child_real_data(tvb, sdu->data, sdu->len, sdu->len); add_new_data_source(pinfo, sdu->tvb, "Reassembled RLC Message"); /* reassembly happened here, so create the fragment list */ if (tree && sdu->fragcnt > 1) tree_add_fragment_list(sdu, sdu->tvb, pinfo, tree); return sdu->tvb; } #define RLC_RETRANSMISSION_TIMEOUT 5 /* in seconds */ static gboolean rlc_is_duplicate(enum rlc_mode mode, packet_info *pinfo, guint16 seq, guint32 *original, struct atm_phdr *atm) { GList *element; struct rlc_seqlist lookup, *list; struct rlc_seq seq_item, *seq_new; guint16 snmod; nstime_t delta; gboolean is_duplicate,is_unseen; if (rlc_channel_assign(&lookup.ch, mode, pinfo, atm) == -1) return FALSE; list = (struct rlc_seqlist *)g_hash_table_lookup(sequence_table, &lookup.ch); if (!list) { /* we see this channel for the first time */ list = (struct rlc_seqlist *)wmem_alloc0(wmem_file_scope(), sizeof(*list)); rlc_channel_assign(&list->ch, mode, pinfo, atm); g_hash_table_insert(sequence_table, &list->ch, list); } seq_item.seq = seq; seq_item.frame_num = pinfo->num; /* When seq is 12 bit (in RLC protocol), it will wrap around after 4096. */ /* Window size is at most 4095 so we remove packets further away than that */ element = g_list_first(list->list); snmod = getChannelSNModulus(&lookup.ch); if (element) { seq_new = (struct rlc_seq *)element->data; /* Add SN modulus because %-operation for negative values in C is not equal to mathematical modulus */ if (MIN((seq_new->seq-seq+snmod)%snmod, (seq-seq_new->seq+snmod)%snmod) >= snmod/4) { list->list = g_list_remove_link(list->list, element); } } is_duplicate = FALSE; is_unseen = TRUE; element = g_list_find_custom(list->list, &seq_item, rlc_cmp_seq); while(element) { /* Check if this is a different frame (by comparing frame numbers) which arrived less than */ /* RLC_RETRANSMISSION_TIMEOUT seconds ago */ seq_new = (struct rlc_seq *)element->data; if (seq_new->frame_num < seq_item.frame_num) { nstime_delta(&delta, &pinfo->abs_ts, &seq_new->arrival); if (delta.secs < RLC_RETRANSMISSION_TIMEOUT) { /* This is a duplicate. */ if (original) { /* Save the frame number where our sequence number was previously seen */ *original = seq_new->frame_num; } is_duplicate = TRUE; } } else if (seq_new->frame_num == seq_item.frame_num) { /* Check if our frame is already in the list and this is a secondary check.*/ /* in this case raise a flag so the frame isn't entered more than once to the list */ is_unseen = FALSE; } element = g_list_find_custom(element->next, &seq_item, rlc_cmp_seq); } if(is_unseen) { /* Add to list for the first time this frame is checked */ seq_new = wmem_new0(wmem_file_scope(), struct rlc_seq); *seq_new = seq_item; seq_new->arrival = pinfo->abs_ts; list->list = g_list_append(list->list, seq_new); /* insert in order of arrival */ } return is_duplicate; } static void rlc_call_subdissector(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gboolean is_rrc_payload = TRUE; volatile dissector_handle_t next_dissector = NULL; enum rrc_message_type msgtype; switch (channel) { case RLC_UL_CCCH: msgtype = RRC_MESSAGE_TYPE_UL_CCCH; break; case RLC_DL_CCCH: msgtype = RRC_MESSAGE_TYPE_DL_CCCH; break; case RLC_DL_CTCH: /* Payload of DL CTCH is BMC*/ is_rrc_payload = FALSE; msgtype = RRC_MESSAGE_TYPE_INVALID; next_dissector = bmc_handle; break; case RLC_UL_DCCH: msgtype = RRC_MESSAGE_TYPE_UL_DCCH; break; case RLC_DL_DCCH: msgtype = RRC_MESSAGE_TYPE_DL_DCCH; break; case RLC_PCCH: msgtype = RRC_MESSAGE_TYPE_PCCH; break; case RLC_BCCH: msgtype = RRC_MESSAGE_TYPE_BCCH_FACH; break; case RLC_PS_DTCH: /* Payload of PS DTCH is PDCP or just IP*/ is_rrc_payload = FALSE; msgtype = RRC_MESSAGE_TYPE_INVALID; /* assume transparent PDCP for now */ next_dissector = ip_handle; break; default: return; /* stop dissecting */ } if (is_rrc_payload && msgtype != RRC_MESSAGE_TYPE_INVALID) { /* Passing the RRC sub type in the 'rrc_info' struct */ struct rrc_info *rrcinf; fp_info *fpinf; fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rrc, 0); if (!rrcinf) { rrcinf = (rrc_info *)wmem_alloc0(wmem_file_scope(), sizeof(struct rrc_info)); p_add_proto_data(wmem_file_scope(), pinfo, proto_rrc, 0, rrcinf); } rrcinf->msgtype[fpinf->cur_tb] = msgtype; next_dissector = rrc_handle; } if(next_dissector != NULL) { TRY { call_dissector(next_dissector, tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { /* * Sub dissector threw an exception * Show the exception and continue dissecting other SDUs. */ show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; /* once the packet has been dissected, protect it from further changes using a 'fence' in the INFO column */ col_append_str(pinfo->cinfo, COL_INFO," "); col_set_fence(pinfo->cinfo, COL_INFO); } } static void add_channel_info(packet_info * pinfo, proto_tree * tree, fp_info * fpinf, rlc_info * rlcinf) { proto_item * item; proto_tree * channel_tree ; item = proto_tree_add_item(tree, hf_rlc_channel, NULL, 0, 0, ENC_NA); channel_tree = proto_item_add_subtree(item, ett_rlc_channel); proto_item_append_text(item, " (rbid: %u, dir: %s, uid: 0x%08x)", rlcinf->rbid[fpinf->cur_tb], val_to_str_const(pinfo->link_dir, rlc_dir_vals, "Unknown"), rlcinf->ueid[fpinf->cur_tb]); proto_item_set_generated(item); item = proto_tree_add_uint(channel_tree, hf_rlc_channel_rbid, NULL, 0, 0, rlcinf->rbid[fpinf->cur_tb]); proto_item_set_generated(item); item = proto_tree_add_uint(channel_tree, hf_rlc_channel_dir, NULL, 0, 0, pinfo->link_dir); proto_item_set_generated(item); item = proto_tree_add_uint(channel_tree, hf_rlc_channel_ueid, NULL, 0, 0, rlcinf->ueid[fpinf->cur_tb]); proto_item_set_generated(item); } #ifdef HAVE_UMTS_KASUMI static guint8 * translate_hex_key(gchar * char_key){ int i,j; guint8 * key_in; key_in = wmem_alloc0(pinfo->pool, sizeof(guint8)*16); j= (int)(strlen(char_key)/2)-1; /*Translate "hex-string" into a byte aligned block */ for(i = (int)strlen(char_key); i> 0; i-=2 ){ key_in[j] = ( (guint8) (strtol( &char_key[i-2], NULL, 16 ) )); char_key[i-2] = '\0'; j--; } return key_in; } #endif /** @brief Deciphers a given tvb * * Note that the actual KASUMI implementation needs to be placed into * epan/crypt/kasumi.* by "end users" since due to patents the actual implementation * cannot be distributed openly at the moment. * * Refer to 3GPP TS 35.201 and 3GPP TS 35.202 for further information. * * @param tvb The ciphered data. * @param pinfo Packet info. * @param counter the COUNTER value input * @param rbid the radiobear id * @param dir Direction of the link * @param header_size Size of the unciphered header * @return tvb Returns a deciphered tvb */ static tvbuff_t * #ifndef HAVE_UMTS_KASUMI rlc_decipher_tvb(tvbuff_t *tvb _U_, packet_info *pinfo, guint32 counter _U_, guint8 rbid _U_, gboolean dir _U_, guint8 header_size _U_) { /*Check if we have a KASUMI implementation*/ expert_add_info(pinfo, NULL, &ei_rlc_kasumi_implementation_missing); return NULL; #else rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid, gboolean dir, guint8 header_size) { guint8* out=NULL,*key_in = NULL; tvbuff_t *t; /*Fix the key into a byte block*/ /*TODO: This should be done in a preferences callback function*/ out = wmem_alloc0(pinfo->pool, strlen(global_rlc_kasumi_key)+1); memcpy(out,global_rlc_kasumi_key,strlen(global_rlc_kasumi_key)); /*Copy from prefrence const pointer*/ key_in = translate_hex_key(out); /*Translation*/ /*Location for decrypted data & original RLC header*/ out = tvb_memdup(pinfo->pool, tvb, 0, tvb_captured_length(tvb)); /*Call f8 confidentiality function, note that rbid is zero indexed*/ f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_captured_length(tvb)-header_size)*8 ); /*Create new tvb.*/ t = tvb_new_real_data(out,tvb_captured_length(tvb), tvb_reported_length(tvb)); add_new_data_source(pinfo, t, "Deciphered RLC"); return t; #endif /* HAVE_UMTS_KASUMI */ } /** @brief Checks if an RLC packet is ciphered, according to information reported from the RRC layer * * @param pinfo Packet info. * @param fpinf FP info * @param rlcinf RLC info * @param seq Sequence number of the RLC packet * @return gboolean Returns TRUE if the packet is ciphered and false otherwise */ static gboolean is_ciphered_according_to_rrc(packet_info *pinfo, fp_info *fpinf, rlc_info *rlcinf ,guint16 seq) { gint16 cur_tb; guint32 ueid; rrc_ciphering_info *ciphering_info; guint8 rbid; guint8 direction; guint32 security_mode_frame_num; gint32 ciphering_begin_seq; if(global_ignore_rrc_ciphering_indication) { return FALSE; } cur_tb = fpinf->cur_tb; ueid = rlcinf->ueid[cur_tb]; ciphering_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)ueid)); if(ciphering_info != NULL) { rbid = rlcinf->rbid[cur_tb]; direction = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL; security_mode_frame_num = ciphering_info->setup_frame[direction]; ciphering_begin_seq = ciphering_info->seq_no[rbid][direction]; /* Making sure the rrc security message's frame number makes sense */ if( security_mode_frame_num > 0 && security_mode_frame_num <= pinfo->num) { /* Making sure the sequence number where ciphering starts makes sense */ /* TODO: This check is incorrect if the sequence numbers wrap around */ if(ciphering_begin_seq >= 0 && ciphering_begin_seq <= seq){ /* Finally, make sure the encryption algorithm isn't set to UEA0 (no ciphering)*/ return ciphering_info->ciphering_algorithm != 0; } } } return FALSE; } /* * @param key is created with GINT_TO_POINTER * @param value is a pointer to a guint32 * @param data is a pointer to a guint32 */ static gboolean iter_same(gpointer key, gpointer value, gpointer data) { /*If true we found the correct frame*/ if ((guint32)GPOINTER_TO_INT(key) > *(guint32*)data){ *((guint32*)data) = *((guint32*)value); return TRUE; } *((guint32*)data) = (guint32)GPOINTER_TO_INT(key); return TRUE; } /** * Used for looking up and old ciphering counter value in the counter_map tree. * @param key is created with GINT_TO_POINTER * @param value is pointer to an array of 2 guint32s * @param data is a pointer to an array of 3 guint32s */ static gboolean rlc_find_old_counter(gpointer key, gpointer value, gpointer data) { /*If true we found the correct frame*/ if( (guint32)GPOINTER_TO_INT(key) >= ((guint32 *)data)[0] ){ return TRUE; } /*Overwrite the data since the previous one wasn't correct*/ ((guint32*)data)[1] = ((guint32*)value)[0]; ((guint32*)data)[2] = ((guint32*)value)[1]; return FALSE; } static void rlc_decipher(tvbuff_t *tvb, packet_info * pinfo, proto_tree * tree, fp_info * fpinf, rlc_info * rlcinf, guint16 seq, enum rlc_mode mode) { rrc_ciphering_info *ciphering_info; guint8 indx, header_size, hfn_shift; gint16 pos; guint8 ext; int ciphered_data_hf; indx = fpinf->is_uplink ? P2P_DIR_UL : P2P_DIR_DL; pos = fpinf->cur_tb; if (mode ==RLC_UM) { header_size = 1; hfn_shift = 7; } else { header_size = 2; hfn_shift = 12; } /*Ciphering info singled in RRC by securitymodecommands */ ciphering_info = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_info_tree, GINT_TO_POINTER((gint)rlcinf->ueid[fpinf->cur_tb])); /*TODO: This doesn't really work for all packets..*/ /*Check if we have ciphering info and that this frame is ciphered*/ if(ciphering_info!=NULL && ( (ciphering_info->setup_frame[indx] > 0 && ciphering_info->setup_frame[indx] < pinfo->num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] == -1) || (ciphering_info->setup_frame[indx] < pinfo->num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] >= 0 && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] <= seq) )){ tvbuff_t *t; /*Check if this counter has been initialized*/ if(!counter_init[rlcinf->rbid[pos]][indx] ){ guint32 frame_num = pinfo->num; /*Initializes counter*/ counter_init[rlcinf->rbid[pos]][0] = TRUE; counter_init[rlcinf->rbid[pos]][1] = TRUE; /*Find appropriate start value*/ g_tree_foreach(ciphering_info->start_ps, (GTraverseFunc)iter_same, &frame_num); /*Set COUNTER value accordingly as specified by 6.4.8 in 3GPP TS 33.102 */ if(max_counter +2 > frame_num && ciphering_info->seq_no[rlcinf->rbid[pos]][indx] == -1){ ps_counter[rlcinf->rbid[pos]][0] = (max_counter+2) << hfn_shift; ps_counter[rlcinf->rbid[pos]][1] = (max_counter+2) << hfn_shift; }else{ ps_counter[rlcinf->rbid[pos]][0] = frame_num << hfn_shift; ps_counter[rlcinf->rbid[pos]][1] = frame_num << hfn_shift; } if(!tree){ /*Preserve counter value for next dissection round*/ guint32 * ciph; ciph = g_new(guint32, 2); ciph[0] = ps_counter[rlcinf->rbid[pos]][0]; ciph[1] = ps_counter[rlcinf->rbid[pos]][1]; g_tree_insert(counter_map, GINT_TO_POINTER((gint)pinfo->num), ciph); } } /*Update the maximal COUNTER value seen so far*/ max_counter = MAX(max_counter,((ps_counter[rlcinf->rbid[pos]][indx]) | seq) >> hfn_shift); /*XXX: Since RBID in umts isn't configured properly..*/ if(rlcinf->rbid[pos] == 9 ){ if(tree){ guint32 frame_num[3]; /*Set frame num we will be "searching" around*/ frame_num[0] = pinfo->num; /*Find the correct counter value*/ g_tree_foreach(counter_map, (GTraverseFunc)rlc_find_old_counter, &frame_num[0]); t = rlc_decipher_tvb(tvb, pinfo, (frame_num[indx+1] | seq),16,!fpinf->is_uplink,header_size); }else{ t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][indx]) | seq),16,!fpinf->is_uplink,header_size); } }else{ if(tree){ /*We need to find the original counter value for second dissection pass*/ guint32 frame_num[3]; frame_num[0] = pinfo->num; g_tree_foreach(counter_map, (GTraverseFunc)rlc_find_old_counter, &frame_num[0]); t = rlc_decipher_tvb(tvb, pinfo, (frame_num[indx+1] | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size); }else t = rlc_decipher_tvb(tvb, pinfo, ((ps_counter[rlcinf->rbid[pos]][indx]) | seq),rlcinf->rbid[pos],!fpinf->is_uplink,header_size); } /*Update the hyperframe number*/ if(seq == 4095){ ps_counter[rlcinf->rbid[pos]][indx] += 1 << hfn_shift; if(!tree){/*Preserve counter for second packet analysis run*/ guint32 * ciph; ciph = g_new(guint32, 2); ciph[0] = ps_counter[rlcinf->rbid[pos]][0]; ciph[1] = ps_counter[rlcinf->rbid[pos]][1]; g_tree_insert(counter_map, GINT_TO_POINTER((gint)pinfo->num+1), ciph); } } /*Unable to decipher the packet*/ if(t == NULL){ /* Choosing the right field text ("LIs & Data" or just "Data") based on extension bit / header extension */ ext = tvb_get_guint8(tvb, header_size - 1) & 0x01; ciphered_data_hf = (ext == 1) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data; /* Adding ciphered payload field to tree */ proto_tree_add_item(tree, ciphered_data_hf, tvb, header_size, -1, ENC_NA); proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, header_size, -1); col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]"); return; }else{ col_append_str(pinfo->cinfo, COL_INFO, "[Deciphered Data]"); /*TODO: Old tvb should be freed here?*/ } } } static void dissect_rlc_tm(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_level, proto_tree *tree) { fp_info *fpinf; rlc_info *rlcinf; fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (tree) { if (fpinf && rlcinf) { /* Add "channel" information, very useful for debugging. */ add_channel_info(pinfo, tree, fpinf, rlcinf); } proto_tree_add_item(tree, hf_rlc_data, tvb, 0, -1, ENC_NA); } rlc_call_subdissector(channel, tvb, pinfo, top_level); } static void rlc_um_reassemble(tvbuff_t *tvb, guint16 offs, packet_info *pinfo, proto_tree *tree, proto_tree *top_level, enum rlc_channel_type channel, guint16 seq, struct rlc_li *li, guint16 num_li, gboolean li_is_on_2_bytes, struct atm_phdr *atm) { guint8 i; gboolean dissected = FALSE; gint length; tvbuff_t *next_tvb = NULL; /* perform reassembly now */ for (i = 0; i < num_li; i++) { if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) { /* padding, must be last LI */ if (tree) { proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, tvb_captured_length_remaining(tvb, offs), ENC_NA); } offs += tvb_captured_length_remaining(tvb, offs); } else if ((!li_is_on_2_bytes && (li[i].li == 0x7c)) || (li[i].li == 0x7ffc)) { /* a new SDU starts here, mark this seq as the first PDU. */ struct rlc_channel ch_lookup; struct rlc_seqlist * endlist = NULL; if( -1 != rlc_channel_assign(&ch_lookup, RLC_UM, pinfo, atm ) ){ endlist = get_endlist(pinfo, &ch_lookup, atm); endlist->list->data = GINT_TO_POINTER((gint)seq); endlist->fail_packet=0; } } else if (li[i].li == 0x7ffa) { /* the first data octet in this RLC PDU is the first octet of an RLC SDU and the second last octet in this RLC PDU is the last octet of the same RLC SDU */ length = tvb_reported_length_remaining(tvb, offs); if (length > 1) { length--; if (tree && length) { proto_tree_add_item(tree, hf_rlc_data, tvb, offs, length, ENC_NA); } if (global_rlc_perform_reassemby) { add_fragment(RLC_UM, tvb, pinfo, li[i].tree, offs, seq, i, length, TRUE, atm); next_tvb = get_reassembled_data(RLC_UM, tvb, pinfo, tree, seq, i, atm); } offs += length; } if (tree) { proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, 1, ENC_NA); } offs += 1; } else { if (tree && li[i].len) { proto_tree_add_item(tree, hf_rlc_data, tvb, offs, li[i].len, ENC_NA); } if (global_rlc_perform_reassemby) { add_fragment(RLC_UM, tvb, pinfo, li[i].tree, offs, seq, i, li[i].len, TRUE, atm); next_tvb = get_reassembled_data(RLC_UM, tvb, pinfo, tree, seq, i, atm); } } if (next_tvb) { dissected = TRUE; rlc_call_subdissector(channel, next_tvb, pinfo, top_level); next_tvb = NULL; } offs += li[i].len; } /* is there data left? */ if (tvb_reported_length_remaining(tvb, offs) > 0) { if (tree) { proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA); } if (global_rlc_perform_reassemby) { /* add remaining data as fragment */ add_fragment(RLC_UM, tvb, pinfo, tree, offs, seq, i, tvb_captured_length_remaining(tvb, offs), FALSE, atm); if (dissected == FALSE) col_set_str(pinfo->cinfo, COL_INFO, "[RLC UM Fragment]"); } } if (dissected == FALSE) col_append_fstr(pinfo->cinfo, COL_INFO, "[RLC UM Fragment] SN=%u", seq); else if (channel == RLC_UNKNOWN_CH) col_append_fstr(pinfo->cinfo, COL_INFO, "[RLC UM Data] SN=%u", seq); } static gint16 rlc_decode_li(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, struct rlc_li *li, guint8 max_li, gboolean li_on_2_bytes) { guint32 hdr_len, offs = 0, li_offs; guint8 ext, num_li = 0; guint16 next_bytes, prev_li = 0; proto_item *malformed; guint16 total_len; switch (mode) { case RLC_AM: offs = 1; break; case RLC_UM: offs = 0; break; case RLC_TM: /* fall through */ case RLC_UNKNOWN_MODE: default: return -1; } hdr_len = offs; /* calculate header length */ ext = tvb_get_guint8(tvb, hdr_len++) & 0x01; while (ext) { next_bytes = li_on_2_bytes ? tvb_get_ntohs(tvb, hdr_len) : tvb_get_guint8(tvb, hdr_len); ext = next_bytes & 0x01; hdr_len += li_on_2_bytes ? 2 : 1; } total_len = tvb_captured_length_remaining(tvb, hdr_len); /* do actual evaluation of LIs */ ext = tvb_get_guint8(tvb, offs++) & 0x01; li_offs = offs; while (ext) { if (li_on_2_bytes) { next_bytes = tvb_get_ntohs(tvb, offs); offs += 2; } else { next_bytes = tvb_get_guint8(tvb, offs++); } ext = next_bytes & 0x01; li[num_li].ext = ext; li[num_li].li = next_bytes >> 1; if (li_on_2_bytes) { switch (li[num_li].li) { case 0x0000: /* previous segment was the last one */ case 0x7ffb: /* previous PDU contains last segment of SDU (minus last byte) */ case 0x7ffe: /* contains piggybacked STATUS in AM or segment in UM */ case 0x7fff: /* padding */ li[num_li].len = 0; break; case 0x7ffa: /* contains exactly one SDU (minus last byte), UM only */ case 0x7ffc: /* start of a new SDU, UM only */ case 0x7ffd: /* contains exactly one SDU, UM only */ li[num_li].len = 0; if (mode == RLC_UM) { /* valid for UM */ break; } /*invalid for AM */ /* add malformed LI for investigation */ malformed = tree_add_li(mode, &li[num_li], num_li, li_offs, li_on_2_bytes, tvb, tree); expert_add_info(pinfo, malformed, &ei_rlc_li_reserved); return -1; /* just give up on this */ default: /* since the LI is an offset (from the end of the header), it * may not be larger than the total remaining length and no * LI may be smaller than its preceding one */ if (((li[num_li].li > total_len) && !global_rlc_headers_expected) || (li[num_li].li < prev_li)) { /* add malformed LI for investigation */ li[num_li].len = 0; malformed = tree_add_li(mode, &li[num_li], num_li, li_offs, li_on_2_bytes, tvb, tree); expert_add_info(pinfo, malformed, &ei_rlc_li_incorrect_warn); return -1; /* just give up on this */ } li[num_li].len = li[num_li].li - prev_li; prev_li = li[num_li].li; } } else { switch (li[num_li].li) { case 0x00: /* previous segment was the last one */ case 0x7e: /* contains piggybacked STATUS in AM or segment in UM */ case 0x7f: /* padding */ li[num_li].len = 0; break; case 0x7c: /* start of a new SDU, UM only */ case 0x7d: /* contains exactly one SDU, UM only */ li[num_li].len = 0; if (mode == RLC_UM) { /* valid for UM */ break; } /*invalid for AM */ /* add malformed LI for investigation */ malformed = tree_add_li(mode, &li[num_li], num_li, li_offs, li_on_2_bytes, tvb, tree); expert_add_info(pinfo, malformed, &ei_rlc_li_reserved); return -1; /* just give up on this */ default: /* since the LI is an offset (from the end of the header), it * may not be larger than the total remaining length and no * LI may be smaller than its preceding one */ li[num_li].len = li[num_li].li - prev_li; if (((li[num_li].li > total_len) && !global_rlc_headers_expected) || (li[num_li].li < prev_li)) { /* add malformed LI for investigation */ li[num_li].len = 0; malformed = tree_add_li(mode, &li[num_li], num_li, li_offs, li_on_2_bytes, tvb, tree); expert_add_info_format(pinfo, malformed, &ei_rlc_li_incorrect_mal, "Incorrect LI value 0x%x", li[num_li].li); return -1; /* just give up on this */ } prev_li = li[num_li].li; } } li[num_li].tree = tree_add_li(mode, &li[num_li], num_li, li_offs, li_on_2_bytes, tvb, tree); num_li++; if (num_li >= max_li) { /* OK, so this is not really a malformed packet, but for now, * we will treat it as such, so that it is marked in some way */ expert_add_info(pinfo, li[num_li-1].tree, &ei_rlc_li_too_many); return -1; } } return num_li; } static void dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_level, proto_tree *tree, struct atm_phdr *atm) { #define MAX_LI 16 struct rlc_li li[MAX_LI]; fp_info *fpinf; rlc_info *rlcinf; guint32 orig_num; guint8 seq; guint8 ext; guint8 next_byte; guint16 offs = 0; gint16 cur_tb, num_li = 0; gboolean is_truncated, li_is_on_2_bytes; proto_item *truncated_ti; gboolean ciphered_according_to_rrc = FALSE; gboolean ciphered_flag = FALSE; gboolean deciphered_flag = FALSE; int ciphered_data_hf; next_byte = tvb_get_guint8(tvb, offs++); seq = next_byte >> 1; fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (tree) { if (fpinf && rlcinf) { /* Add "channel" information, very useful for debugging. */ add_channel_info(pinfo, tree, fpinf, rlcinf); } /* show sequence number and extension bit */ proto_tree_add_bits_item(tree, hf_rlc_seq, tvb, 0, 7, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tree, hf_rlc_ext, tvb, 7, 1, ENC_BIG_ENDIAN); } if (!fpinf || !rlcinf) { proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1); return; } cur_tb = fpinf->cur_tb; ciphered_according_to_rrc = is_ciphered_according_to_rrc(pinfo, fpinf, rlcinf, (guint16)seq); ciphered_flag = rlcinf->ciphered[cur_tb]; deciphered_flag = rlcinf->deciphered[cur_tb]; if (((ciphered_according_to_rrc || ciphered_flag) && !deciphered_flag) || global_rlc_ciphered) { if(global_rlc_try_decipher){ rlc_decipher(tvb, pinfo, tree, fpinf, rlcinf, seq, RLC_UM); }else{ /* Choosing the right field text ("LIs & Data" or just "Data") based on extension bit */ ext = tvb_get_guint8(tvb, 0) & 0x01; ciphered_data_hf = (ext == 1) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data; /* Adding ciphered payload field to tree */ proto_tree_add_item(tree, ciphered_data_hf, tvb, offs, -1, ENC_NA); proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, offs, -1); col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]"); return; } } if (global_rlc_li_size == RLC_LI_UPPERLAYER) { if (rlcinf->li_size[cur_tb] == RLC_LI_VARIABLE) { li_is_on_2_bytes = (tvb_reported_length(tvb) > 125) ? TRUE : FALSE; } else { li_is_on_2_bytes = (rlcinf->li_size[cur_tb] == RLC_LI_15BITS) ? TRUE : FALSE; } } else { /* Override rlcinf configuration with preference. */ li_is_on_2_bytes = (global_rlc_li_size == RLC_LI_15BITS) ? TRUE : FALSE; } num_li = rlc_decode_li(RLC_UM, tvb, pinfo, tree, li, MAX_LI, li_is_on_2_bytes); if (num_li == -1) return; /* something went wrong */ offs += ((li_is_on_2_bytes) ? 2 : 1) * num_li; if (global_rlc_headers_expected) { /* There might not be any data, if only header was logged */ is_truncated = (tvb_captured_length_remaining(tvb, offs) == 0); truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0, is_truncated); if (is_truncated) { proto_item_set_generated(truncated_ti); expert_add_info(pinfo, truncated_ti, &ei_rlc_header_only); return; } else { proto_item_set_hidden(truncated_ti); } } /* do not detect duplicates or reassemble, if prefiltering is done */ if (pinfo->num == 0) return; /* check for duplicates */ if (rlc_is_duplicate(RLC_UM, pinfo, seq, &orig_num, atm) == TRUE) { col_add_fstr(pinfo->cinfo, COL_INFO, "[RLC UM Fragment] [Duplicate] SN=%u", seq); proto_tree_add_uint(tree, hf_rlc_duplicate_of, tvb, 0, 0, orig_num); return; } rlc_um_reassemble(tvb, offs, pinfo, tree, top_level, channel, seq, li, num_li, li_is_on_2_bytes, atm); } static void dissect_rlc_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint16 offset) { guint8 sufi_type, bits; guint64 len, sn, wsn, lsn, l; guint16 value, previous_sn; gboolean isErrorBurstInd; gint bit_offset, previous_bit_offset; guint i, j; proto_tree *sufi_tree, *bitmap_tree, *rlist_tree; proto_item *sufi_item, *ti; #define BUFF_SIZE 41 gchar *buff = NULL; guint8 cw[15]; guint8 sufi_start_offset; gboolean seen_last = FALSE; guint16 number_of_bitmap_entries = 0; bit_offset = offset*8 + 4; /* first SUFI type is always 4 bit shifted */ while (!seen_last && tvb_reported_length_remaining(tvb, bit_offset/8) > 0) { /* SUFI */ sufi_type = tvb_get_bits8(tvb, bit_offset, 4); sufi_start_offset = bit_offset/8; sufi_item = proto_tree_add_item(tree, hf_rlc_sufi, tvb, sufi_start_offset, 0, ENC_NA); sufi_tree = proto_item_add_subtree(sufi_item, ett_rlc_sufi); proto_tree_add_bits_item(sufi_tree, hf_rlc_sufi_type, tvb, bit_offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(sufi_item, " (%s)", val_to_str_const(sufi_type, rlc_sufi_vals, "Unknown")); bit_offset += 4; switch (sufi_type) { case RLC_SUFI_NOMORE: seen_last = TRUE; break; case RLC_SUFI_ACK: proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_lsn, tvb, bit_offset, 12, &lsn, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " LSN=%u", (guint16)lsn); proto_item_append_text(sufi_item, " LSN=%u", (guint16)lsn); bit_offset += 12; seen_last = TRUE; break; case RLC_SUFI_WINDOW: proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_wsn, tvb, bit_offset, 12, &wsn, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " WSN=%u", (guint16)wsn); bit_offset += 12; break; case RLC_SUFI_LIST: proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_len, tvb, bit_offset, 4, &len, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " LIST(%u) - ", (guint8)len); bit_offset += 4; if (len) { while (len) { ti = proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_sn, tvb, bit_offset, 12, &sn, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (AMD PDU not correctly received)"); bit_offset += 12; ti = proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_l, tvb, bit_offset, 4, &l, ENC_BIG_ENDIAN); if (l) { proto_item_append_text(ti, " (all consecutive AMD PDUs up to SN %u not correctly received)", (unsigned)(sn+l)&0xfff); col_append_fstr(pinfo->cinfo, COL_INFO, "%u-%u ", (guint16)sn, (unsigned)(sn+l)&0xfff); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", (guint16)sn); } bit_offset += 4; len--; } } else { expert_add_info(pinfo, tree, &ei_rlc_sufi_len); } break; case RLC_SUFI_BITMAP: proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_len, tvb, bit_offset, 4, &len, ENC_BIG_ENDIAN); bit_offset += 4; len++; /* bitmap is len + 1 */ proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_fsn, tvb, bit_offset, 12, &sn, ENC_BIG_ENDIAN); bit_offset += 12; proto_tree_add_item(sufi_tree, hf_rlc_sufi_bitmap, tvb, bit_offset/8, (gint)len, ENC_NA); bitmap_tree = proto_tree_add_subtree(sufi_tree, tvb, bit_offset/8, (gint)len, ett_rlc_bitmap, &ti, "Decoded bitmap:"); col_append_str(pinfo->cinfo, COL_INFO, " BITMAP=("); buff = (gchar *)wmem_alloc(pinfo->pool, BUFF_SIZE); for (i=0; i<len; i++) { bits = tvb_get_bits8(tvb, bit_offset, 8); for (l=0, j=0; l<8; l++) { if ((bits << l) & 0x80) { j += snprintf(&buff[j], BUFF_SIZE-j, "%4u,", (unsigned)(sn+(8*i)+l)&0xfff); col_append_fstr(pinfo->cinfo, COL_INFO, " %u", (unsigned)(sn+(8*i)+l)&0xfff); number_of_bitmap_entries++; } else { j += snprintf(&buff[j], BUFF_SIZE-j, " ,"); } } proto_tree_add_string_format(bitmap_tree, hf_rlc_bitmap_string, tvb, bit_offset/8, 1, buff, "%s", buff); bit_offset += 8; } proto_item_append_text(ti, " (%u SNs)", number_of_bitmap_entries); col_append_str(pinfo->cinfo, COL_INFO, " )"); break; case RLC_SUFI_RLIST: previous_bit_offset = bit_offset; proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_len, tvb, bit_offset, 4, &len, ENC_BIG_ENDIAN); bit_offset += 4; proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_fsn, tvb, bit_offset, 12, &sn, ENC_BIG_ENDIAN); bit_offset += 12; proto_item_append_text(sufi_item, " (%u codewords)", (guint16)len); for (i=0; i<len; i++) { ti = proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_cw, tvb, bit_offset, 4, &l, ENC_BIG_ENDIAN); if (l == 0x01) { proto_item_append_text(ti, " (Error burst indication)"); } bit_offset += 4; cw[i] = (guint8)l; } if (len && (((cw[len-1] & 0x01) == 0) || (cw[len-1] == 0x01))) { expert_add_info(pinfo, tree, &ei_rlc_sufi_cw); } else { rlist_tree = proto_tree_add_subtree(sufi_tree, tvb, previous_bit_offset/8, (bit_offset-previous_bit_offset)/8, ett_rlc_rlist, NULL, "Decoded list:"); proto_tree_add_uint_format_value(rlist_tree, hf_rlc_sequence_number, tvb, (previous_bit_offset+4)/8, 12/8, (guint32)sn, "%u (AMD PDU not correctly received)", (unsigned)sn); col_append_fstr(pinfo->cinfo, COL_INFO, " RLIST=(%u", (unsigned)sn); for (i=0, isErrorBurstInd=FALSE, j=0, previous_sn=(guint16)sn, value=0; i<len; i++) { if (cw[i] == 0x01) { isErrorBurstInd = TRUE; } else { value |= (cw[i] >> 1) << j; j += 3; if (cw[i] & 0x01) { if (isErrorBurstInd) { previous_sn = (previous_sn + value) & 0xfff; ti = proto_tree_add_uint(rlist_tree, hf_rlc_length, tvb, (previous_bit_offset+16+4*i)/8, 1, value); if (value) { proto_item_append_text(ti, " (all consecutive AMD PDUs up to SN %u not correctly received)", previous_sn); col_append_fstr(pinfo->cinfo, COL_INFO, " ->%u", previous_sn); } isErrorBurstInd = FALSE; } else { value = (value + previous_sn) & 0xfff; proto_tree_add_uint_format_value(rlist_tree, hf_rlc_sequence_number, tvb, (previous_bit_offset+16+4*i)/8, 1, value, "%u (AMD PDU not correctly received)",value); col_append_fstr(pinfo->cinfo, COL_INFO, " %u", value); previous_sn = value; } value = j = 0; } } } col_append_str(pinfo->cinfo, COL_INFO, ")"); } break; case RLC_SUFI_MRW_ACK: col_append_str(pinfo->cinfo, COL_INFO, " MRW-ACK"); proto_tree_add_bits_item(sufi_tree, hf_rlc_sufi_n, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset += 4; proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_sn_ack, tvb, bit_offset, 12, &sn, ENC_BIG_ENDIAN); bit_offset += 12; col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%u", (guint16)sn); break; case RLC_SUFI_MRW: col_append_str(pinfo->cinfo, COL_INFO, " MRW"); proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_len, tvb, bit_offset, 4, &len, ENC_BIG_ENDIAN); bit_offset += 4; if (len) { while (len) { proto_tree_add_bits_ret_val(sufi_tree, hf_rlc_sufi_sn_mrw, tvb, bit_offset, 12, &sn, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%u", (guint16)sn); bit_offset += 12; len--; } } else { /* only one SN_MRW field is present */ ti = proto_tree_add_bits_item(sufi_tree, hf_rlc_sufi_sn_mrw, tvb, bit_offset, 12, ENC_BIG_ENDIAN); proto_item_append_text(ti, " (RLC SDU to be discarded in the Receiver extends above the configured transmission window in the Sender)"); bit_offset += 12; } proto_tree_add_bits_item(sufi_tree, hf_rlc_sufi_n, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset += 4; break; case RLC_SUFI_POLL: proto_tree_add_bits_item(sufi_tree, hf_rlc_sufi_poll_sn, tvb, bit_offset, 12, ENC_BIG_ENDIAN); bit_offset += 12; break; default: expert_add_info(pinfo, tree, &ei_rlc_sufi_type); return; /* invalid value, ignore the rest */ } /* Set extent of SUFI root */ proto_item_set_len(sufi_item, ((bit_offset+7)/8) - sufi_start_offset); } } static void dissect_rlc_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 type, next_byte; proto_item *ti; guint64 r1; guint64 rsn, hfn; next_byte = tvb_get_guint8(tvb, 0); type = (next_byte >> 4) & 0x07; ti = proto_tree_add_bits_item(tree, hf_rlc_ctrl_type, tvb, 1, 3, ENC_BIG_ENDIAN); switch (type) { case RLC_STATUS: dissect_rlc_status(tvb, pinfo, tree, 0); break; case RLC_RESET: case RLC_RESET_ACK: col_append_str(pinfo->cinfo, COL_INFO, (type == RLC_RESET) ? " RESET" : " RESET-ACK"); proto_tree_add_bits_ret_val(tree, hf_rlc_rsn, tvb, 4, 1, &rsn, ENC_BIG_ENDIAN); proto_tree_add_bits_ret_val(tree, hf_rlc_r1, tvb, 5, 3, &r1, ENC_BIG_ENDIAN); if (r1) { expert_add_info(pinfo, ti, &ei_rlc_reserved_bits_not_zero); return; } proto_tree_add_bits_ret_val(tree, hf_rlc_hfni, tvb, 8, 20, &hfn, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " RSN=%u HFN=%u", (guint16)rsn, (guint32)hfn); break; default: expert_add_info_format(pinfo, ti, &ei_rlc_ctrl_type, "Invalid RLC AM control type %u", type); return; /* invalid */ } } static void rlc_am_reassemble(tvbuff_t *tvb, guint16 offs, packet_info *pinfo, proto_tree *tree, proto_tree *top_level, enum rlc_channel_type channel, guint16 seq, gboolean poll_set, struct rlc_li *li, guint16 num_li, gboolean final, gboolean li_is_on_2_bytes, struct atm_phdr *atm) { guint8 i; gboolean piggyback = FALSE, dissected = FALSE; tvbuff_t *next_tvb = NULL; struct rlc_channel ch_lookup; struct rlc_seqlist * endlist = NULL; if( 0 == seq ){ /* assuming that a new RRC Connection is established when 0==seq. */ if( -1 != rlc_channel_assign(&ch_lookup, RLC_AM, pinfo, atm ) ){ endlist = get_endlist(pinfo, &ch_lookup, atm); endlist->list->data = GINT_TO_POINTER( -1); } } /* perform reassembly now */ for (i = 0; i < num_li; i++) { if ((!li_is_on_2_bytes && (li[i].li == 0x7e)) || (li[i].li == 0x7ffe)) { /* piggybacked status */ piggyback = TRUE; } else if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) { /* padding, must be last LI */ if (tvb_reported_length_remaining(tvb, offs) > 0) { if (tree) { proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, -1, ENC_NA); } if (i == 0) { /* Insert empty RLC frag so RLC doesn't miss this seq number. */ add_fragment(RLC_AM, tvb, pinfo, li[i].tree, offs, seq, i, 0, TRUE, atm); } } offs += tvb_captured_length_remaining(tvb, offs); } else { if (tree) { proto_tree_add_item(tree, hf_rlc_data, tvb, offs, li[i].len, ENC_NA); } if (global_rlc_perform_reassemby) { add_fragment(RLC_AM, tvb, pinfo, li[i].tree, offs, seq, i, li[i].len, TRUE, atm); next_tvb = get_reassembled_data(RLC_AM, tvb, pinfo, tree, seq, i, atm); } } if (next_tvb) { dissected = TRUE; rlc_call_subdissector(channel, next_tvb, pinfo, top_level); next_tvb = NULL; } offs += li[i].len; } if (piggyback) { dissect_rlc_status(tvb, pinfo, tree, offs); } else { if (tvb_reported_length_remaining(tvb, offs) > 0) { /* we have remaining data, which we need to mark in the tree */ if (tree) { proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA); } if (global_rlc_perform_reassemby) { add_fragment(RLC_AM, tvb, pinfo, tree, offs, seq, i, tvb_captured_length_remaining(tvb,offs), final, atm); if (final) { next_tvb = get_reassembled_data(RLC_AM, tvb, pinfo, tree, seq, i, atm); } } } if (next_tvb) { dissected = TRUE; rlc_call_subdissector(channel, next_tvb, pinfo, top_level); next_tvb = NULL; } } if (dissected == FALSE) col_append_fstr(pinfo->cinfo, COL_INFO, "[RLC AM Fragment] SN=%u %s", seq, poll_set ? "(P)" : ""); else if (channel == RLC_UNKNOWN_CH) col_append_fstr(pinfo->cinfo, COL_INFO, "[RLC AM Data] SN=%u %s", seq, poll_set ? "(P)" : ""); } static void dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_level, proto_tree *tree, struct atm_phdr *atm) { #define MAX_LI 16 struct rlc_li li[MAX_LI]; fp_info *fpinf; rlc_info *rlcinf; guint8 ext, dc; guint8 next_byte; guint32 orig_num = 0; gint16 num_li = 0; gint16 cur_tb; guint16 seq, offs = 0; gboolean is_truncated, li_is_on_2_bytes; proto_item *truncated_ti, *ti; guint64 polling; gboolean ciphered_according_to_rrc = FALSE; gboolean ciphered_flag = FALSE; gboolean deciphered_flag = FALSE; int ciphered_data_hf; fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); next_byte = tvb_get_guint8(tvb, offs++); dc = next_byte >> 7; if (tree) { if (fpinf && rlcinf) { /* Add "channel" information, very useful for debugging. */ add_channel_info(pinfo, tree, fpinf, rlcinf); } proto_tree_add_bits_item(tree, hf_rlc_dc, tvb, 0, 1, ENC_BIG_ENDIAN); } if (dc == 0) { col_set_str(pinfo->cinfo, COL_INFO, "[RLC Control Frame]"); dissect_rlc_control(tvb, pinfo, tree); return; } seq = next_byte & 0x7f; seq <<= 5; next_byte = tvb_get_guint8(tvb, offs++); seq |= (next_byte >> 3); ext = next_byte & 0x03; /* show header fields */ proto_tree_add_bits_item(tree, hf_rlc_seq, tvb, 1, 12, ENC_BIG_ENDIAN); proto_tree_add_bits_ret_val(tree, hf_rlc_p, tvb, 13, 1, &polling, ENC_BIG_ENDIAN); ti = proto_tree_add_bits_item(tree, hf_rlc_he, tvb, 14, 2, ENC_BIG_ENDIAN); /* header extension may only be 00, 01 or 10 */ if (ext > 2) { expert_add_info(pinfo, ti, &ei_rlc_he); return; } if (!fpinf || !rlcinf) { proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1); return; } cur_tb = fpinf->cur_tb; /** * WARNING DECIPHERING IS HIGHLY EXPERIMENTAL!!! * */ ciphered_according_to_rrc = is_ciphered_according_to_rrc(pinfo, fpinf, rlcinf, (guint16)seq); ciphered_flag = rlcinf->ciphered[cur_tb]; deciphered_flag = rlcinf->deciphered[cur_tb]; if (((ciphered_according_to_rrc || ciphered_flag) && !deciphered_flag) || global_rlc_ciphered) { if(global_rlc_try_decipher){ rlc_decipher(tvb, pinfo, tree, fpinf, rlcinf, seq, RLC_AM); }else{ /* Choosing the right field text ("LIs & Data" or just "Data") based on header extension field */ ciphered_data_hf = (ext == 0x01) ? hf_rlc_ciphered_lis_data : hf_rlc_ciphered_data; /* Adding ciphered payload field to tree */ proto_tree_add_item(tree, ciphered_data_hf, tvb, offs, -1, ENC_NA); proto_tree_add_expert(tree, pinfo, &ei_rlc_ciphered_data, tvb, offs, -1); col_append_str(pinfo->cinfo, COL_INFO, "[Ciphered Data]"); return; } } if (global_rlc_li_size == RLC_LI_UPPERLAYER) { if (rlcinf->li_size[cur_tb] == RLC_LI_VARIABLE) { li_is_on_2_bytes = (tvb_reported_length(tvb) > 126) ? TRUE : FALSE; } else { li_is_on_2_bytes = (rlcinf->li_size[cur_tb] == RLC_LI_15BITS) ? TRUE : FALSE; } } else { /* Override rlcinf configuration with preference. */ li_is_on_2_bytes = (global_rlc_li_size == RLC_LI_15BITS) ? TRUE : FALSE; } num_li = rlc_decode_li(RLC_AM, tvb, pinfo, tree, li, MAX_LI, li_is_on_2_bytes); if (num_li == -1) return; /* something went wrong */ offs += ((li_is_on_2_bytes) ? 2 : 1) * num_li; if (global_rlc_headers_expected) { /* There might not be any data, if only header was logged */ is_truncated = (tvb_captured_length_remaining(tvb, offs) == 0); truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0, is_truncated); if (is_truncated) { proto_item_set_generated(truncated_ti); expert_add_info(pinfo, truncated_ti, &ei_rlc_header_only); return; } else { proto_item_set_hidden(truncated_ti); } } /* do not detect duplicates or reassemble, if prefiltering is done */ if (pinfo->num == 0) return; /* check for duplicates, but not if already visited */ if (!PINFO_FD_VISITED(pinfo) && rlc_is_duplicate(RLC_AM, pinfo, seq, &orig_num, atm) == TRUE) { g_hash_table_insert(duplicate_table, GUINT_TO_POINTER(pinfo->num), GUINT_TO_POINTER(orig_num)); return; } else if (PINFO_FD_VISITED(pinfo) && tree) { gpointer value = g_hash_table_lookup(duplicate_table, GUINT_TO_POINTER(pinfo->num)); if (value != NULL) { col_add_fstr(pinfo->cinfo, COL_INFO, "[RLC AM Fragment] [Duplicate] SN=%u %s", seq, (polling != 0) ? "(P)" : ""); proto_tree_add_uint(tree, hf_rlc_duplicate_of, tvb, 0, 0, GPOINTER_TO_UINT(value)); return; } } rlc_am_reassemble(tvb, offs, pinfo, tree, top_level, channel, seq, polling != 0, li, num_li, ext == 2, li_is_on_2_bytes, atm); } /* dissect entry functions */ static int dissect_rlc_pcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *subtree = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); /* PCCH is always RLC TM */ if (tree) { proto_item *ti; ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); proto_item_append_text(ti, " TM (PCCH)"); } dissect_rlc_tm(RLC_PCCH, tvb, pinfo, tree, subtree); return tvb_captured_length(tvb); } static int dissect_rlc_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { fp_info *fpi; proto_item *ti = NULL; proto_tree *subtree = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (!fpi) return 0; /* dissection failure */ if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } proto_item_append_text(ti, " TM (BCCH)"); dissect_rlc_tm(RLC_BCCH, tvb, pinfo, tree, subtree); return tvb_captured_length(tvb); } static int dissect_rlc_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { fp_info *fpi; proto_item *ti = NULL; proto_tree *subtree = NULL; struct atm_phdr *atm = (struct atm_phdr *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (!fpi) return 0; /* dissection failure */ if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } if (fpi->is_uplink) { /* UL CCCH is always RLC TM */ proto_item_append_text(ti, " TM (CCCH)"); dissect_rlc_tm(RLC_UL_CCCH, tvb, pinfo, tree, subtree); } else { /* DL CCCH is always UM */ proto_item_append_text(ti, " UM (CCCH)"); dissect_rlc_um(RLC_DL_CCCH, tvb, pinfo, tree, subtree, atm); } return tvb_captured_length(tvb); } static int dissect_rlc_ctch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { fp_info *fpi; proto_item *ti = NULL; proto_tree *subtree = NULL; struct atm_phdr *atm = (struct atm_phdr *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (!fpi) return 0; /* dissection failure */ if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } /* CTCH is always UM */ proto_item_append_text(ti, " UM (CTCH)"); dissect_rlc_um(RLC_DL_CTCH, tvb, pinfo, tree, subtree, atm); return tvb_captured_length(tvb); } static int dissect_rlc_dcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *ti = NULL; proto_tree *subtree = NULL; fp_info *fpi; rlc_info *rlci; enum rlc_channel_type channel; struct atm_phdr *atm = (struct atm_phdr *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlci = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!fpi || !rlci){ proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1); return 1; } if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } channel = fpi->is_uplink ? RLC_UL_DCCH : RLC_DL_DCCH; switch (rlci->mode[fpi->cur_tb]) { case RLC_UM: proto_item_append_text(ti, " UM (DCCH)"); dissect_rlc_um(channel, tvb, pinfo, tree, subtree, atm); break; case RLC_AM: proto_item_append_text(ti, " AM (DCCH)"); dissect_rlc_am(channel, tvb, pinfo, tree, subtree, atm); break; } return tvb_captured_length(tvb); } static int dissect_rlc_ps_dtch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *ti = NULL; proto_tree *subtree = NULL; fp_info *fpi; rlc_info *rlci; struct atm_phdr *atm = (struct atm_phdr *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlci = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!fpi || !rlci) { proto_tree_add_expert(tree, pinfo, &ei_rlc_no_per_frame_data, tvb, 0, -1); return 1; } if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } switch (rlci->mode[fpi->cur_tb]) { case RLC_UM: proto_item_append_text(ti, " UM (PS DTCH)"); dissect_rlc_um(RLC_PS_DTCH, tvb, pinfo, tree, subtree, atm); break; case RLC_AM: proto_item_append_text(ti, " AM (PS DTCH)"); dissect_rlc_am(RLC_PS_DTCH, tvb, pinfo, tree, subtree, atm); break; case RLC_TM: proto_item_append_text(ti, " TM (PS DTCH)"); dissect_rlc_tm(RLC_PS_DTCH, tvb, pinfo, tree, subtree); break; } return tvb_captured_length(tvb); } static int dissect_rlc_dch_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *ti = NULL; proto_tree *subtree = NULL; fp_info *fpi; rlc_info *rlci; struct atm_phdr *atm = (struct atm_phdr *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); rlci = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (!fpi || !rlci) return 0; if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } switch (rlci->mode[fpi->cur_tb]) { case RLC_UM: proto_item_append_text(ti, " UM (Unknown)"); dissect_rlc_um(RLC_UNKNOWN_CH, tvb, pinfo, tree, subtree, atm); break; case RLC_AM: proto_item_append_text(ti, " AM (Unknown)"); dissect_rlc_am(RLC_UNKNOWN_CH, tvb, pinfo, tree, subtree, atm); break; case RLC_TM: proto_item_append_text(ti, " TM (Unknown)"); dissect_rlc_tm(RLC_UNKNOWN_CH, tvb, pinfo, tree, subtree); break; } return tvb_captured_length(tvb); } static void report_heur_error(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, gint start, gint length) { proto_item *ti; proto_tree *subtree; col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_umts_rlc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); proto_tree_add_expert(subtree, pinfo, eiindex, tvb, start, length); } /* Heuristic dissector looks for supported framing protocol (see wiki page) */ static gboolean dissect_rlc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint offset = 0; fp_info *fpi; rlc_info *rlci; tvbuff_t *rlc_tvb; guint8 tag = 0; guint channelType = UMTS_CHANNEL_TYPE_UNSPECIFIED; gboolean fpInfoAlreadySet = FALSE; gboolean rlcInfoAlreadySet = FALSE; gboolean channelTypePresent = FALSE; gboolean rlcModePresent = FALSE; proto_item *ti = NULL; proto_tree *subtree = NULL; struct atm_phdr *atm = (struct atm_phdr *)data; /* Do this again on re-dissection to re-discover offset of actual PDU */ /* Needs to be at least as long as: - the signature string - conditional header bytes - tag for data - at least one byte of RLC PDU payload */ if (tvb_captured_length_remaining(tvb, offset) < (gint)(strlen(RLC_START_STRING)+2+2)) { return FALSE; } /* OK, compare with signature string */ if (tvb_strneql(tvb, offset, RLC_START_STRING, (gint)strlen(RLC_START_STRING)) != 0) { return FALSE; } offset += (gint)strlen(RLC_START_STRING); /* If redissecting, use previous info struct (if available) */ fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); if (fpi == NULL) { /* Allocate new info struct for this frame */ fpi = wmem_new0(wmem_file_scope(), fp_info); } else { fpInfoAlreadySet = TRUE; } rlci = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0); if (rlci == NULL) { /* Allocate new info struct for this frame */ rlci = wmem_new0(wmem_file_scope(), rlc_info); } else { rlcInfoAlreadySet = TRUE; } /* Setting non-zero UE-ID for RLC reassembly to work, might be * overriden if the optional URNTI tag is present */ rlci->ueid[fpi->cur_tb] = 1; /* Read conditional/optional fields */ while (tag != RLC_PAYLOAD_TAG) { /* Process next tag */ tag = tvb_get_guint8(tvb, offset++); switch (tag) { case RLC_CHANNEL_TYPE_TAG: channelType = tvb_get_guint8(tvb, offset); offset++; channelTypePresent = TRUE; break; case RLC_MODE_TAG: rlci->mode[fpi->cur_tb] = tvb_get_guint8(tvb, offset); offset++; rlcModePresent = TRUE; break; case RLC_DIRECTION_TAG: if (tvb_get_guint8(tvb, offset) == DIRECTION_UPLINK) { fpi->is_uplink = TRUE; pinfo->link_dir = P2P_DIR_UL; } else { fpi->is_uplink = FALSE; pinfo->link_dir = P2P_DIR_DL; } offset++; break; case RLC_URNTI_TAG: rlci->ueid[fpi->cur_tb] = tvb_get_ntohl(tvb, offset); offset += 4; break; case RLC_RADIO_BEARER_ID_TAG: rlci->rbid[fpi->cur_tb] = tvb_get_guint8(tvb, offset); offset++; break; case RLC_LI_SIZE_TAG: rlci->li_size[fpi->cur_tb] = (enum rlc_li_size) tvb_get_guint8(tvb, offset); offset++; break; case RLC_PAYLOAD_TAG: /* Have reached data, so get out of loop */ continue; default: /* It must be a recognised tag */ report_heur_error(tree, pinfo, &ei_rlc_unknown_udp_framing_tag, tvb, offset-1, 1); return TRUE; } } if ((channelTypePresent == FALSE) && (rlcModePresent == FALSE)) { /* Conditional fields are missing */ report_heur_error(tree, pinfo, &ei_rlc_missing_udp_framing_tag, tvb, 0, offset); return TRUE; } /* Store info in packet if needed */ if (!fpInfoAlreadySet) { p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, fpi); } if (!rlcInfoAlreadySet) { p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlci); } /**************************************/ /* OK, now dissect as RLC */ /* Create tvb that starts at actual RLC PDU */ rlc_tvb = tvb_new_subset_remaining(tvb, offset); switch (channelType) { case UMTS_CHANNEL_TYPE_UNSPECIFIED: /* Call relevant dissector according to RLC mode */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC"); col_clear(pinfo->cinfo, COL_INFO); if (tree) { ti = proto_tree_add_item(tree, proto_umts_rlc, rlc_tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_rlc); } if (rlci->mode[fpi->cur_tb] == RLC_AM) { proto_item_append_text(ti, " AM"); dissect_rlc_am(RLC_UNKNOWN_CH, rlc_tvb, pinfo, tree, subtree, atm); } else if (rlci->mode[fpi->cur_tb] == RLC_UM) { proto_item_append_text(ti, " UM"); dissect_rlc_um(RLC_UNKNOWN_CH, rlc_tvb, pinfo, tree, subtree, atm); } else { proto_item_append_text(ti, " TM"); dissect_rlc_tm(RLC_UNKNOWN_CH, rlc_tvb, pinfo, tree, subtree); } break; case UMTS_CHANNEL_TYPE_PCCH: dissect_rlc_pcch(rlc_tvb, pinfo, tree, data); break; case UMTS_CHANNEL_TYPE_CCCH: dissect_rlc_ccch(rlc_tvb, pinfo, tree, data); break; case UMTS_CHANNEL_TYPE_DCCH: dissect_rlc_dcch(rlc_tvb, pinfo, tree, data); break; case UMTS_CHANNEL_TYPE_PS_DTCH: dissect_rlc_ps_dtch(rlc_tvb, pinfo, tree, data); break; case UMTS_CHANNEL_TYPE_CTCH: dissect_rlc_ctch(rlc_tvb, pinfo, tree, data); break; case UMTS_CHANNEL_TYPE_BCCH: dissect_rlc_bcch(rlc_tvb, pinfo, tree, data); break; default: /* Unknown channel type */ return FALSE; } return TRUE; } void proto_register_rlc(void) { module_t *rlc_module; expert_module_t* expert_rlc; static hf_register_info hf[] = { { &hf_rlc_dc, { "D/C Bit", "rlc.dc", FT_BOOLEAN, BASE_NONE, TFS(&rlc_dc_val), 0, NULL, HFILL } }, { &hf_rlc_ctrl_type, { "Control PDU Type", "rlc.ctrl_pdu_type", FT_UINT8, BASE_DEC, VALS(rlc_ctrl_vals), 0, "PDU Type", HFILL } }, { &hf_rlc_r1, { "Reserved 1", "rlc.r1", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_rsn, { "Reset Sequence Number", "rlc.rsn", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_hfni, { "Hyper Frame Number Indicator", "rlc.hfni", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_seq, { "Sequence Number", "rlc.seq", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_ext, { "Extension Bit", "rlc.ext", FT_BOOLEAN, BASE_NONE, TFS(&rlc_ext_val), 0, NULL, HFILL } }, { &hf_rlc_he, { "Header Extension Type", "rlc.he", FT_UINT8, BASE_DEC, VALS(rlc_he_vals), 0, NULL, HFILL } }, { &hf_rlc_p, { "Polling Bit", "rlc.p", FT_BOOLEAN, BASE_NONE, TFS(&rlc_p_val), 0, NULL, HFILL } }, { &hf_rlc_pad, { "Padding", "rlc.padding", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_reassembled_data, { "Reassembled RLC Data", "rlc.reassembled_data", FT_BYTES, BASE_NONE, NULL, 0, "The reassembled payload", HFILL } }, { &hf_rlc_frags, { "Reassembled Fragments", "rlc.fragments", FT_NONE, BASE_NONE, NULL, 0, "Fragments", HFILL } }, { &hf_rlc_frag, { "RLC Fragment", "rlc.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_duplicate_of, { "Duplicate of", "rlc.duplicate_of", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_reassembled_in, { "Reassembled Message in frame", "rlc.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_data, { "Data", "rlc.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_ciphered_data, { "Ciphered Data", "rlc.ciphered_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_ciphered_lis_data, { "Ciphered LIs & Data", "rlc.ciphered_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, /* LI information */ { &hf_rlc_li, { "LI", "rlc.li", FT_NONE, BASE_NONE, NULL, 0, "Length Indicator", HFILL } }, { &hf_rlc_li_value, { "LI value", "rlc.li.value", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_li_ext, { "LI extension bit", "rlc.li.ext", FT_BOOLEAN, BASE_NONE, TFS(&rlc_ext_val), 0, NULL, HFILL } }, { &hf_rlc_li_data, { "LI Data", "rlc.li.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, /* SUFI information */ { &hf_rlc_sufi, { "SUFI", "rlc.sufi", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_type, { "SUFI Type", "rlc.sufi.type", FT_UINT8, BASE_DEC, VALS(rlc_sufi_vals), 0, NULL, HFILL } }, { &hf_rlc_sufi_lsn, { "Last Sequence Number", "rlc.sufi.lsn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_wsn, { "Window Size Number", "rlc.sufi.wsn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_sn, { "Sequence Number", "rlc.sufi.sn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_l, { "Length", "rlc.sufi.l", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_len, { "Length", "rlc.sufi.len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_fsn, { "First Sequence Number", "rlc.sufi.fsn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_bitmap, { "Bitmap", "rlc.sufi.bitmap", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_cw, { "Codeword", "rlc.sufi.cw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_n, { "Nlength", "rlc.sufi.n", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_sn_ack, { "SN ACK", "rlc.sufi.sn_ack", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_sn_mrw, { "SN MRW", "rlc.sufi.sn_mrw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_sufi_poll_sn, { "Poll SN", "rlc.sufi.poll_sn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, /* Other information */ { &hf_rlc_header_only, { "RLC PDU header only", "rlc.header_only", FT_BOOLEAN, BASE_NONE, TFS(&rlc_header_only_val), 0 ,NULL, HFILL } }, { &hf_rlc_channel, { "Channel", "rlc.channel", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_rlc_channel_rbid, { "Radio Bearer ID", "rlc.channel.rbid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_channel_dir, { "Direction", "rlc.channel.dir", FT_UINT8, BASE_DEC, VALS(rlc_dir_vals), 0, NULL, HFILL } }, { &hf_rlc_channel_ueid, { "User Equipment ID", "rlc.channel.ueid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_rlc_sequence_number, { "Sequence Number", "rlc.sequence_number", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_length, { "Length", "rlc.length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_rlc_bitmap_string, { "Bitmap string", "rlc.bitmap_string", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, }; static gint *ett[] = { &ett_rlc, &ett_rlc_frag, &ett_rlc_fragments, &ett_rlc_sdu, &ett_rlc_sufi, &ett_rlc_bitmap, &ett_rlc_rlist, &ett_rlc_channel }; static ei_register_info ei[] = { { &ei_rlc_reassembly_fail_unfinished_sequence, { "rlc.reassembly.fail.unfinished_sequence", PI_REASSEMBLE, PI_ERROR, "Did not perform reassembly because of previous unfinished sequence.", EXPFILL }}, { &ei_rlc_reassembly_fail_flag_set, { "rlc.reassembly.fail.flag_set", PI_REASSEMBLE, PI_ERROR, "Did not perform reassembly because fail flag was set previously.", EXPFILL }}, { &ei_rlc_reassembly_lingering_endpoint, { "rlc.lingering_endpoint", PI_REASSEMBLE, PI_ERROR, "Lingering endpoint.", EXPFILL }}, { &ei_rlc_reassembly_unknown_error, { "rlc.reassembly.unknown_error", PI_REASSEMBLE, PI_ERROR, "Unknown error.", EXPFILL }}, { &ei_rlc_kasumi_implementation_missing, { "rlc.kasumi_implementation_missing", PI_UNDECODED, PI_WARN, "Unable to decipher packet since KASUMI implementation is missing.", EXPFILL }}, { &ei_rlc_li_reserved, { "rlc.li.reserved", PI_PROTOCOL, PI_WARN, "Uses reserved LI", EXPFILL }}, { &ei_rlc_li_incorrect_warn, { "rlc.li.incorrect", PI_PROTOCOL, PI_WARN, "Incorrect LI value", EXPFILL }}, { &ei_rlc_li_incorrect_mal, { "rlc.li.incorrect", PI_MALFORMED, PI_ERROR, "Incorrect LI value 0x%x", EXPFILL }}, { &ei_rlc_li_too_many, { "rlc.li.too_many", PI_MALFORMED, PI_ERROR, "Too many LI entries", EXPFILL }}, { &ei_rlc_header_only, { "rlc.header_only.expert", PI_SEQUENCE, PI_NOTE, "RLC PDU SDUs have been omitted", EXPFILL }}, { &ei_rlc_sufi_len, { "rlc.sufi.len.invalid", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }}, { &ei_rlc_sufi_cw, { "rlc.sufi.cw.invalid", PI_PROTOCOL, PI_WARN, "Invalid last codeword", EXPFILL }}, { &ei_rlc_sufi_type, { "rlc.sufi.type.invalid", PI_PROTOCOL, PI_WARN, "Invalid SUFI type", EXPFILL }}, { &ei_rlc_reserved_bits_not_zero, { "rlc.reserved_bits_not_zero", PI_PROTOCOL, PI_WARN, "reserved bits not zero", EXPFILL }}, { &ei_rlc_ctrl_type, { "rlc.ctrl_pdu_type.invalid", PI_PROTOCOL, PI_WARN, "Invalid RLC AM control type", EXPFILL }}, { &ei_rlc_he, { "rlc.he.invalid", PI_PROTOCOL, PI_WARN, "Incorrect HE value", EXPFILL }}, { &ei_rlc_ciphered_data, { "rlc.ciphered", PI_UNDECODED, PI_WARN, "Cannot dissect RLC frame because it is ciphered", EXPFILL }}, { &ei_rlc_no_per_frame_data, { "rlc.no_per_frame_data", PI_PROTOCOL, PI_WARN, "Can't dissect RLC frame because no per-frame info was attached!", EXPFILL }}, { &ei_rlc_incomplete_sequence, { "rlc.incomplete_sequence", PI_MALFORMED, PI_ERROR, "Error: Incomplete sequence", EXPFILL }}, { &ei_rlc_unknown_udp_framing_tag, { "rlc.unknown_udp_framing_tag", PI_UNDECODED, PI_WARN, "Unknown UDP framing tag, aborting dissection", EXPFILL }}, { &ei_rlc_missing_udp_framing_tag, { "rlc.missing_udp_framing_tag", PI_UNDECODED, PI_WARN, "Missing UDP framing conditional tag, aborting dissection", EXPFILL }} }; proto_umts_rlc = proto_register_protocol("Radio Link Control", "RLC", "rlc"); register_dissector("rlc.bcch", dissect_rlc_bcch, proto_umts_rlc); register_dissector("rlc.pcch", dissect_rlc_pcch, proto_umts_rlc); register_dissector("rlc.ccch", dissect_rlc_ccch, proto_umts_rlc); register_dissector("rlc.ctch", dissect_rlc_ctch, proto_umts_rlc); register_dissector("rlc.dcch", dissect_rlc_dcch, proto_umts_rlc); register_dissector("rlc.ps_dtch", dissect_rlc_ps_dtch, proto_umts_rlc); register_dissector("rlc.dch_unknown", dissect_rlc_dch_unknown, proto_umts_rlc); proto_register_field_array(proto_umts_rlc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_rlc = expert_register_protocol(proto_umts_rlc); expert_register_field_array(expert_rlc, ei, array_length(ei)); /* Preferences */ rlc_module = prefs_register_protocol(proto_umts_rlc, NULL); prefs_register_obsolete_preference(rlc_module, "heuristic_rlc_over_udp"); prefs_register_bool_preference(rlc_module, "perform_reassembly", "Try to reassemble SDUs", "When enabled, try to reassemble SDUs from the various PDUs received", &global_rlc_perform_reassemby); prefs_register_bool_preference(rlc_module, "header_only_mode", "May see RLC headers only", "When enabled, if data is not present, don't report as an error, but instead " "add expert info to indicate that headers were omitted", &global_rlc_headers_expected); prefs_register_bool_preference(rlc_module, "ignore_rrc_cipher_indication", "Ignore ciphering indication from higher layers", "When enabled, RLC will ignore sequence numbers reported in 'Security Mode Command'/'Security Mode Complete' (RRC) messages when checking if frames are ciphered", &global_ignore_rrc_ciphering_indication); prefs_register_bool_preference(rlc_module, "ciphered_data", "All data is ciphered", "When enabled, RLC will assume all payloads in RLC frames are ciphered", &global_rlc_ciphered); #ifdef HAVE_UMTS_KASUMI prefs_register_bool_preference(rlc_module, "try_decipher", "Try to decipher data", "When enabled, RLC will try to decipher data. (Experimental)", &global_rlc_try_decipher); prefs_register_string_preference(rlc_module, "kasumi_key", "KASUMI key", "Key for kasumi 32 characters long hex-string", &global_rlc_kasumi_key); #else /* If Wireshark isn't compiled with KASUMI we still want to register the above preferences * We are doing so for two reasons: * 1. To inform the user about the disabled preferences (using static text preference) * 2. To prevent errors when Wireshark reads a preferences file which includes records for these preferences */ prefs_register_static_text_preference(rlc_module, "try_decipher", "Data deciphering is disabled", "Wireshark was compiled without the KASUMI decryption algorithm"); prefs_register_obsolete_preference(rlc_module, "kasumi_key"); #endif /* HAVE_UMTS_KASUMI */ prefs_register_enum_preference(rlc_module, "li_size", "LI size", "LI size in bits, either 7 or 15 bit", &global_rlc_li_size, li_size_enumvals, FALSE); register_init_routine(fragment_table_init); register_cleanup_routine(fragment_table_cleanup); } void proto_reg_handoff_rlc(void) { rrc_handle = find_dissector_add_dependency("rrc", proto_umts_rlc); ip_handle = find_dissector_add_dependency("ip", proto_umts_rlc); bmc_handle = find_dissector_add_dependency("bmc", proto_umts_rlc); /* Add as a heuristic UDP dissector */ heur_dissector_add("udp", dissect_rlc_heur, "RLC over UDP", "rlc_udp", proto_umts_rlc, HEURISTIC_DISABLE); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-umts_rlc.h
/* packet-umts_rlc.h * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_RLC_H #define PACKET_RLC_H #include <wiretap/wtap.h> /* Do not change enum order and append only to keep backward compatibility with UDP framing format */ enum rlc_mode { RLC_TM, RLC_UM, RLC_AM, RLC_UNKNOWN_MODE }; /* Do not change enum order and append only to keep backward compatibility with UDP framing format */ enum rlc_li_size { RLC_LI_VARIABLE, RLC_LI_7BITS, RLC_LI_15BITS }; #define MAX_RLC_CHANS 64 typedef struct rlc_info { /* Values in the 'ueid' array should identify users exclusively */ /* Preferred content: */ /* 1. U-RNTI */ /* 2. C-RNC Context (from NBAP) */ guint32 ueid[MAX_RLC_CHANS]; guint8 mode[MAX_RLC_CHANS]; guint8 rbid[MAX_RLC_CHANS]; enum rlc_li_size li_size[MAX_RLC_CHANS]; gboolean ciphered[MAX_RLC_CHANS]; gboolean deciphered[MAX_RLC_CHANS]; } rlc_info; /* Reset the specified channel's reassembly data, useful for when a sequence * resets on transport channel swap. */ void rlc_reset_channel(enum rlc_mode mode, guint8 rbid, guint8 dir, guint32 ueid, struct atm_phdr *atm); /*****************************************************************/ /* UDP framing format */ /* ----------------------- */ /* Several people have asked about dissecting RLC by framing */ /* PDUs over IP. A suggested format over UDP has been defined */ /* and implemented by this dissector, using the definitions */ /* below. A link to an example program showing you how to encode */ /* these headers and send RLC PDUs on a UDP socket is provided */ /* at https://gitlab.com/wireshark/wireshark/-/wikis/RLC */ /* */ /* A heuristic dissecter (enabled by a preference) will */ /* recognise a signature at the beginning of these frames. */ /* Until someone is using this format, suggestions for changes */ /* are welcome. */ /*****************************************************************/ /* Signature. Rather than try to define a port for this, or make the port number a preference, frames will start with this string (with no terminating NULL */ #define RLC_START_STRING "umts-rlc" /* Conditional fields. The channel type or RLC mode should be present. If the channel type is present, the RLC mode will be ignored. If none of them is present, the decoding will be skipped. The RLC mode tag uses the values from the rlc_mode enum. */ #define UMTS_CHANNEL_TYPE_UNSPECIFIED 0 #define UMTS_CHANNEL_TYPE_PCCH 1 #define UMTS_CHANNEL_TYPE_CCCH 2 #define UMTS_CHANNEL_TYPE_DCCH 3 #define UMTS_CHANNEL_TYPE_PS_DTCH 4 #define UMTS_CHANNEL_TYPE_CTCH 5 #define UMTS_CHANNEL_TYPE_BCCH 6 #define RLC_CHANNEL_TYPE_TAG 0x02 /* 1 byte */ #define RLC_MODE_TAG 0x03 /* 1 byte, enum rlc_mode value */ /* Optional fields. Attaching this info to frames will allow you to show you display/filter/plot/add-custom-columns on these fields, so should be added if available. The format is to have the tag, followed by the value (there is no length field, it's implicit from the tag) */ #define DIRECTION_UPLINK 0 #define DIRECTION_DOWNLINK 1 #define RLC_DIRECTION_TAG 0x04 /* 1 byte */ #define RLC_URNTI_TAG 0x05 /* 4 bytes, network order */ #define RLC_RADIO_BEARER_ID_TAG 0x06 /* 1 byte */ #define RLC_LI_SIZE_TAG 0x07 /* 1 byte, enum rlc_li_size value */ /* RLC PDU. Following this tag comes the actual RLC PDU (there is no length, the PDU continues until the end of the frame) */ #define RLC_PAYLOAD_TAG 0x01 #endif /* PACKET_RLC_H */
C
wireshark/epan/dissectors/packet-usb-audio.c
/* packet-usb-audio.c * * usb audio dissector * Tomasz Mon 2012 * * SPDX-License-Identifier: GPL-2.0-or-later */ /* the parsing of audio-specific descriptors is based on USB Audio Device Class Specification for Basic Audio Devices, Release 1.0, USB Device Class Definition for Audio Devices, Release 2.0 and USB Device Class Definition for MIDI Devices, Release 1.0 */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/reassemble.h> #include "packet-usb.h" /* XXX - we use the same macro for mpeg sections, can we put this in a common include file? */ #define USB_AUDIO_BCD44_TO_DEC(x) ((((x)&0xf0) >> 4) * 10 + ((x)&0x0f)) void proto_register_usb_audio(void); void proto_reg_handoff_usb_audio(void); /* protocols and header fields */ static int proto_usb_audio = -1; static int hf_midi_cable_number = -1; static int hf_midi_code_index = -1; static int hf_midi_event = -1; static int hf_midi_padding = -1; static int hf_ac_if_desc_subtype = -1; static int hf_ac_if_hdr_ver = -1; static int hf_ac_if_hdr_total_len = -1; static int hf_ac_if_hdr_bInCollection = -1; static int hf_ac_if_hdr_if_num = -1; static int hf_ac_if_hdr_category = -1; static int hf_ac_if_hdr_controls = -1; static int hf_ac_if_hdr_controls_latency = -1; static int hf_ac_if_hdr_controls_rsv = -1; static int hf_ac_if_input_terminalid = -1; static int hf_ac_if_input_terminaltype = -1; static int hf_ac_if_input_assocterminal = -1; static int hf_ac_if_input_csourceid = -1; static int hf_ac_if_input_nrchannels = -1; static int hf_ac_if_input_wchannelconfig = -1; static int hf_ac_if_input_wchannelconfig_d0 = -1; static int hf_ac_if_input_wchannelconfig_d1 = -1; static int hf_ac_if_input_wchannelconfig_d2 = -1; static int hf_ac_if_input_wchannelconfig_d3 = -1; static int hf_ac_if_input_wchannelconfig_d4 = -1; static int hf_ac_if_input_wchannelconfig_d5 = -1; static int hf_ac_if_input_wchannelconfig_d6 = -1; static int hf_ac_if_input_wchannelconfig_d7 = -1; static int hf_ac_if_input_wchannelconfig_d8 = -1; static int hf_ac_if_input_wchannelconfig_d9 = -1; static int hf_ac_if_input_wchannelconfig_d10 = -1; static int hf_ac_if_input_wchannelconfig_d11 = -1; static int hf_ac_if_input_wchannelconfig_rsv = -1; static int hf_ac_if_input_bmchannelconfig = -1; static int hf_ac_if_input_bmchannelconfig_d0 = -1; static int hf_ac_if_input_bmchannelconfig_d1 = -1; static int hf_ac_if_input_bmchannelconfig_d2 = -1; static int hf_ac_if_input_bmchannelconfig_d3 = -1; static int hf_ac_if_input_bmchannelconfig_d4 = -1; static int hf_ac_if_input_bmchannelconfig_d5 = -1; static int hf_ac_if_input_bmchannelconfig_d6 = -1; static int hf_ac_if_input_bmchannelconfig_d7 = -1; static int hf_ac_if_input_bmchannelconfig_d8 = -1; static int hf_ac_if_input_bmchannelconfig_d9 = -1; static int hf_ac_if_input_bmchannelconfig_d10 = -1; static int hf_ac_if_input_bmchannelconfig_d11 = -1; static int hf_ac_if_input_bmchannelconfig_d12 = -1; static int hf_ac_if_input_bmchannelconfig_d13 = -1; static int hf_ac_if_input_bmchannelconfig_d14 = -1; static int hf_ac_if_input_bmchannelconfig_d15 = -1; static int hf_ac_if_input_bmchannelconfig_d16 = -1; static int hf_ac_if_input_bmchannelconfig_d17 = -1; static int hf_ac_if_input_bmchannelconfig_d18 = -1; static int hf_ac_if_input_bmchannelconfig_d19 = -1; static int hf_ac_if_input_bmchannelconfig_d20 = -1; static int hf_ac_if_input_bmchannelconfig_d21 = -1; static int hf_ac_if_input_bmchannelconfig_d22 = -1; static int hf_ac_if_input_bmchannelconfig_d23 = -1; static int hf_ac_if_input_bmchannelconfig_d24 = -1; static int hf_ac_if_input_bmchannelconfig_d25 = -1; static int hf_ac_if_input_bmchannelconfig_d26 = -1; static int hf_ac_if_input_bmchannelconfig_rsv = -1; static int hf_ac_if_input_bmchannelconfig_d31 = -1; static int hf_ac_if_input_channelnames = -1; static int hf_ac_if_input_controls = -1; static int hf_ac_if_input_controls_copy = -1; static int hf_ac_if_input_controls_connector = -1; static int hf_ac_if_input_controls_overload = -1; static int hf_ac_if_input_controls_cluster = -1; static int hf_ac_if_input_controls_underflow = -1; static int hf_ac_if_input_controls_overflow = -1; static int hf_ac_if_input_controls_rsv = -1; static int hf_ac_if_input_terminal = -1; static int hf_ac_if_output_terminalid = -1; static int hf_ac_if_output_terminaltype = -1; static int hf_ac_if_output_assocterminal = -1; static int hf_ac_if_output_sourceid = -1; static int hf_ac_if_output_clk_sourceid = -1; static int hf_ac_if_output_controls = -1; static int hf_ac_if_output_controls_copy = -1; static int hf_ac_if_output_controls_connector = -1; static int hf_ac_if_output_controls_overload = -1; static int hf_ac_if_output_controls_underflow = -1; static int hf_ac_if_output_controls_overflow = -1; static int hf_ac_if_output_controls_rsv = -1; static int hf_ac_if_output_terminal = -1; static int hf_ac_if_fu_unitid = -1; static int hf_ac_if_fu_sourceid = -1; static int hf_ac_if_fu_controlsize = -1; static int hf_ac_if_fu_controls = -1; static int hf_ac_if_fu_control = -1; static int hf_ac_if_fu_controls_d0 = -1; static int hf_ac_if_fu_controls_d1 = -1; static int hf_ac_if_fu_controls_d2 = -1; static int hf_ac_if_fu_controls_d3 = -1; static int hf_ac_if_fu_controls_d4 = -1; static int hf_ac_if_fu_controls_d5 = -1; static int hf_ac_if_fu_controls_d6 = -1; static int hf_ac_if_fu_controls_d7 = -1; static int hf_ac_if_fu_controls_d8 = -1; static int hf_ac_if_fu_controls_d9 = -1; static int hf_ac_if_fu_controls_rsv = -1; static int hf_ac_if_fu_controls_v2 = -1; static int hf_ac_if_fu_control_v2 = -1; static int hf_ac_if_fu_controls_v2_d0 = -1; static int hf_ac_if_fu_controls_v2_d1 = -1; static int hf_ac_if_fu_controls_v2_d2 = -1; static int hf_ac_if_fu_controls_v2_d3 = -1; static int hf_ac_if_fu_controls_v2_d4 = -1; static int hf_ac_if_fu_controls_v2_d5 = -1; static int hf_ac_if_fu_controls_v2_d6 = -1; static int hf_ac_if_fu_controls_v2_d7 = -1; static int hf_ac_if_fu_controls_v2_d8 = -1; static int hf_ac_if_fu_controls_v2_d9 = -1; static int hf_ac_if_fu_controls_v2_d10 = -1; static int hf_ac_if_fu_controls_v2_d11 = -1; static int hf_ac_if_fu_controls_v2_d12 = -1; static int hf_ac_if_fu_controls_v2_d13 = -1; static int hf_ac_if_fu_controls_v2_d14 = -1; static int hf_ac_if_fu_controls_v2_rsv = -1; static int hf_ac_if_fu_ifeature = -1; static int hf_ac_if_su_unitid = -1; static int hf_ac_if_su_nrinpins = -1; static int hf_ac_if_su_sourceids = -1; static int hf_ac_if_su_sourceid = -1; static int hf_ac_if_su_controls = -1; static int hf_ac_if_su_controls_d0 = -1; static int hf_ac_if_su_controls_rsv = -1; static int hf_ac_if_su_iselector = -1; static int hf_ac_if_mu_unitid = -1; static int hf_ac_if_mu_nrinpins = -1; static int hf_ac_if_mu_sourceid = -1; static int hf_ac_if_mu_nrchannels = -1; static int hf_ac_if_mu_channelconfig = -1; static int hf_ac_if_mu_channelconfig_d0 = -1; static int hf_ac_if_mu_channelconfig_d1 = -1; static int hf_ac_if_mu_channelconfig_d2 = -1; static int hf_ac_if_mu_channelconfig_d3 = -1; static int hf_ac_if_mu_channelconfig_d4 = -1; static int hf_ac_if_mu_channelconfig_d5 = -1; static int hf_ac_if_mu_channelconfig_d6 = -1; static int hf_ac_if_mu_channelconfig_d7 = -1; static int hf_ac_if_mu_channelconfig_d8 = -1; static int hf_ac_if_mu_channelconfig_d9 = -1; static int hf_ac_if_mu_channelconfig_d10 = -1; static int hf_ac_if_mu_channelconfig_d11 = -1; static int hf_ac_if_mu_channelconfig_rsv = -1; static int hf_ac_if_mu_channelnames = -1; static int hf_ac_if_mu_controls = -1; static int hf_ac_if_mu_imixer = -1; static int hf_ac_if_clksrc_id = -1; static int hf_ac_if_clksrc_attr = -1; static int hf_ac_if_clksrc_attr_type = -1; static int hf_ac_if_clksrc_attr_d2 = -1; static int hf_ac_if_clksrc_attr_rsv = -1; static int hf_ac_if_clksrc_controls = -1; static int hf_ac_if_clksrc_controls_freq = -1; static int hf_ac_if_clksrc_controls_validity = -1; static int hf_ac_if_clksrc_controls_rsv = -1; static int hf_ac_if_clksrc_assocterminal = -1; static int hf_ac_if_clksrc_clocksource = -1; static int hf_ac_if_clksel_id = -1; static int hf_ac_if_clksel_nrpins = -1; static int hf_ac_if_clksel_sourceid = -1; static int hf_ac_if_clksel_controls = -1; static int hf_ac_if_clksel_controls_clksel = -1; static int hf_ac_if_clksel_controls_rsv = -1; static int hf_ac_if_clksel_clockselector = -1; static int hf_as_if_desc_subtype = -1; static int hf_as_if_gen_term_link = -1; static int hf_as_if_gen_delay = -1; static int hf_as_if_gen_wformattag = -1; static int hf_as_if_gen_controls = -1; static int hf_as_if_gen_controls_active = -1; static int hf_as_if_gen_controls_valid = -1; static int hf_as_if_gen_controls_rsv = -1; static int hf_as_if_gen_formattype = -1; static int hf_as_if_gen_formats = -1; static int hf_as_if_gen_formats_i_d0 = -1; static int hf_as_if_gen_formats_i_d1 = -1; static int hf_as_if_gen_formats_i_d2 = -1; static int hf_as_if_gen_formats_i_d3 = -1; static int hf_as_if_gen_formats_i_d4 = -1; static int hf_as_if_gen_formats_i_rsv = -1; static int hf_as_if_gen_formats_i_d31 = -1; static int hf_as_if_gen_formats_ii_d0 = -1; static int hf_as_if_gen_formats_ii_d1 = -1; static int hf_as_if_gen_formats_ii_d2 = -1; static int hf_as_if_gen_formats_ii_d3 = -1; static int hf_as_if_gen_formats_ii_rsv = -1; static int hf_as_if_gen_formats_ii_d31 = -1; static int hf_as_if_gen_formats_iii_d0 = -1; static int hf_as_if_gen_formats_iii_d1 = -1; static int hf_as_if_gen_formats_iii_d2 = -1; static int hf_as_if_gen_formats_iii_d3 = -1; static int hf_as_if_gen_formats_iii_d4 = -1; static int hf_as_if_gen_formats_iii_d5 = -1; static int hf_as_if_gen_formats_iii_d6 = -1; static int hf_as_if_gen_formats_iii_d7 = -1; static int hf_as_if_gen_formats_iii_d8 = -1; static int hf_as_if_gen_formats_iii_d9 = -1; static int hf_as_if_gen_formats_iii_d10 = -1; static int hf_as_if_gen_formats_iii_d11 = -1; static int hf_as_if_gen_formats_iii_d12 = -1; static int hf_as_if_gen_formats_iii_rsv = -1; static int hf_as_if_gen_formats_iv_d0 = -1; static int hf_as_if_gen_formats_iv_d1 = -1; static int hf_as_if_gen_formats_iv_d2 = -1; static int hf_as_if_gen_formats_iv_d3 = -1; static int hf_as_if_gen_formats_iv_d4 = -1; static int hf_as_if_gen_formats_iv_d5 = -1; static int hf_as_if_gen_formats_iv_d6 = -1; static int hf_as_if_gen_formats_iv_d7 = -1; static int hf_as_if_gen_formats_iv_d8 = -1; static int hf_as_if_gen_formats_iv_d9 = -1; static int hf_as_if_gen_formats_iv_d10 = -1; static int hf_as_if_gen_formats_iv_d11 = -1; static int hf_as_if_gen_formats_iv_d12 = -1; static int hf_as_if_gen_formats_iv_d13 = -1; static int hf_as_if_gen_formats_iv_d14 = -1; static int hf_as_if_gen_formats_iv_d15 = -1; static int hf_as_if_gen_formats_iv_d16 = -1; static int hf_as_if_gen_formats_iv_d17 = -1; static int hf_as_if_gen_formats_iv_d18 = -1; static int hf_as_if_gen_formats_iv_d19 = -1; static int hf_as_if_gen_formats_iv_d20 = -1; static int hf_as_if_gen_formats_iv_d21 = -1; static int hf_as_if_gen_formats_iv_rsv = -1; static int hf_as_if_gen_nrchannels = -1; static int hf_as_if_gen_bmchannelconfig = -1; static int hf_as_if_gen_bmchannelconfig_d0 = -1; static int hf_as_if_gen_bmchannelconfig_d1 = -1; static int hf_as_if_gen_bmchannelconfig_d2 = -1; static int hf_as_if_gen_bmchannelconfig_d3 = -1; static int hf_as_if_gen_bmchannelconfig_d4 = -1; static int hf_as_if_gen_bmchannelconfig_d5 = -1; static int hf_as_if_gen_bmchannelconfig_d6 = -1; static int hf_as_if_gen_bmchannelconfig_d7 = -1; static int hf_as_if_gen_bmchannelconfig_d8 = -1; static int hf_as_if_gen_bmchannelconfig_d9 = -1; static int hf_as_if_gen_bmchannelconfig_d10 = -1; static int hf_as_if_gen_bmchannelconfig_d11 = -1; static int hf_as_if_gen_bmchannelconfig_d12 = -1; static int hf_as_if_gen_bmchannelconfig_d13 = -1; static int hf_as_if_gen_bmchannelconfig_d14 = -1; static int hf_as_if_gen_bmchannelconfig_d15 = -1; static int hf_as_if_gen_bmchannelconfig_d16 = -1; static int hf_as_if_gen_bmchannelconfig_d17 = -1; static int hf_as_if_gen_bmchannelconfig_d18 = -1; static int hf_as_if_gen_bmchannelconfig_d19 = -1; static int hf_as_if_gen_bmchannelconfig_d20 = -1; static int hf_as_if_gen_bmchannelconfig_d21 = -1; static int hf_as_if_gen_bmchannelconfig_d22 = -1; static int hf_as_if_gen_bmchannelconfig_d23 = -1; static int hf_as_if_gen_bmchannelconfig_d24 = -1; static int hf_as_if_gen_bmchannelconfig_d25 = -1; static int hf_as_if_gen_bmchannelconfig_d26 = -1; static int hf_as_if_gen_bmchannelconfig_rsv = -1; static int hf_as_if_gen_bmchannelconfig_d31 = -1; static int hf_as_if_gen_channelnames = -1; static int hf_as_if_ft_formattype = -1; static int hf_as_if_ft_maxbitrate = -1; static int hf_as_if_ft_nrchannels = -1; static int hf_as_if_ft_subframesize = -1; static int hf_as_if_ft_subslotsize = -1; static int hf_as_if_ft_bitresolution = -1; static int hf_as_if_ft_samplesperframe = -1; static int hf_as_if_ft_samfreqtype = -1; static int hf_as_if_ft_lowersamfreq = -1; static int hf_as_if_ft_uppersamfreq = -1; static int hf_as_if_ft_samfreq = -1; static int hf_as_ep_desc_subtype = -1; static int hf_as_ep_gen_bmattributes = -1; static int hf_as_ep_gen_bmattributes_d0 = -1; static int hf_as_ep_gen_bmattributes_d1 = -1; static int hf_as_ep_gen_bmattributes_rsv = -1; static int hf_as_ep_gen_bmattributes_d7 = -1; static int hf_as_ep_gen_controls = -1; static int hf_as_ep_gen_controls_pitch = -1; static int hf_as_ep_gen_controls_data_overrun = -1; static int hf_as_ep_gen_controls_data_underrun = -1; static int hf_as_ep_gen_controls_rsv = -1; static int hf_as_ep_gen_lockdelayunits = -1; static int hf_as_ep_gen_lockdelay = -1; static int hf_ms_if_desc_subtype = -1; static int hf_ms_if_hdr_ver = -1; static int hf_ms_if_hdr_total_len = -1; static int hf_ms_if_midi_in_bjacktype = -1; static int hf_ms_if_midi_in_bjackid = -1; static int hf_ms_if_midi_in_ijack = -1; static int hf_ms_if_midi_out_bjacktype = -1; static int hf_ms_if_midi_out_bjackid = -1; static int hf_ms_if_midi_out_bnrinputpins = -1; static int hf_ms_if_midi_out_basourceid = -1; static int hf_ms_if_midi_out_basourcepin = -1; static int hf_ms_if_midi_out_ijack = -1; static int hf_ms_ep_gen_numjacks = -1; static int hf_ms_ep_gen_baassocjackid = -1; static int hf_ms_ep_desc_subtype = -1; static reassembly_table midi_data_reassembly_table; static gint ett_usb_audio = -1; static gint ett_usb_audio_desc = -1; static gint ett_ac_if_hdr_controls = -1; static gint ett_ac_if_fu_controls = -1; static gint ett_ac_if_fu_controls0 = -1; static gint ett_ac_if_fu_controls1 = -1; static gint ett_ac_if_fu_controls_v2 = -1; static gint ett_ac_if_fu_control_v2 = -1; static gint ett_ac_if_su_sourceids = -1; static gint ett_ac_if_su_controls = -1; static gint ett_ac_if_input_wchannelconfig = -1; static gint ett_ac_if_input_bmchannelconfig = -1; static gint ett_ac_if_input_controls = -1; static gint ett_ac_if_output_controls = -1; static gint ett_ac_if_mu_channelconfig = -1; static gint ett_ac_if_clksrc_attr = -1; static gint ett_ac_if_clksrc_controls = -1; static gint ett_ac_if_clksel_controls = -1; static gint ett_as_if_gen_controls = -1; static gint ett_as_if_gen_formats = -1; static gint ett_as_if_gen_bmchannelconfig = -1; static gint ett_as_ep_gen_attributes = -1; static gint ett_as_ep_gen_controls = -1; static dissector_handle_t sysex_handle; static dissector_handle_t usb_audio_bulk_handle; #define AUDIO_IF_SUBCLASS_UNDEFINED 0x00 #define AUDIO_IF_SUBCLASS_AUDIOCONTROL 0x01 #define AUDIO_IF_SUBCLASS_AUDIOSTREAMING 0x02 #define AUDIO_IF_SUBCLASS_MIDISTREAMING 0x03 static const value_string usb_audio_subclass_vals[] = { {AUDIO_IF_SUBCLASS_UNDEFINED, "Undefined"}, {AUDIO_IF_SUBCLASS_AUDIOCONTROL, "Audio Control"}, {AUDIO_IF_SUBCLASS_AUDIOSTREAMING, "Audio Streaming"}, {AUDIO_IF_SUBCLASS_MIDISTREAMING, "MIDI Streaming"}, {0,NULL} }; value_string_ext ext_usb_audio_subclass_vals = VALUE_STRING_EXT_INIT(usb_audio_subclass_vals); static const value_string code_index_vals[] = { { 0x0, "Miscellaneous (Reserved)" }, { 0x1, "Cable events (Reserved)" }, { 0x2, "Two-byte System Common message" }, { 0x3, "Three-byte System Common message" }, { 0x4, "SysEx starts or continues" }, { 0x5, "SysEx ends with following single byte/Single-byte System Common Message" }, { 0x6, "SysEx ends with following two bytes" }, { 0x7, "SysEx ends with following three bytes" }, { 0x8, "Note-off" }, { 0x9, "Note-on" }, { 0xA, "Poly-KeyPress" }, { 0xB, "Control Change" }, { 0xC, "Program Change" }, { 0xD, "Channel Pressure" }, { 0xE, "PitchBend Change" }, { 0xF, "Single Byte" }, { 0, NULL } }; /* USB audio specification, section A.8 */ #define CS_INTERFACE 0x24 #define CS_ENDPOINT 0x25 static const value_string aud_descriptor_type_vals[] = { {CS_INTERFACE, "audio class interface"}, {CS_ENDPOINT, "audio class endpoint"}, {0,NULL} }; static value_string_ext aud_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(aud_descriptor_type_vals); #define AC_SUBTYPE_HEADER 0x01 #define AC_SUBTYPE_INPUT_TERMINAL 0x02 #define AC_SUBTYPE_OUTPUT_TERMINAL 0x03 #define AC_SUBTYPE_MIXER_UNIT 0x04 #define AC_SUBTYPE_SELECTOR_UNIT 0x05 #define AC_SUBTYPE_FEATURE_UNIT 0x06 #define AC_SUBTYPE_EFFECT_UNIT 0x07 #define AC_SUBTYPE_PROCESSING_UNIT 0x08 #define AC_SUBTYPE_EXTENSION_UNIT 0x09 #define AC_SUBTYPE_CLOCK_SOURCE 0x0A #define AC_SUBTYPE_CLOCK_SELECTOR 0x0B #define AC_SUBTYPE_CLOCK_MULTIPLIER 0x0C #define AC_SUBTYPE_SAMPLE_RATE_CONVERTER 0x0D static const value_string ac_subtype_vals[] = { {AC_SUBTYPE_HEADER, "Header Descriptor"}, {AC_SUBTYPE_INPUT_TERMINAL, "Input terminal descriptor"}, {AC_SUBTYPE_OUTPUT_TERMINAL, "Output terminal descriptor"}, {AC_SUBTYPE_MIXER_UNIT, "Mixer unit descriptor"}, {AC_SUBTYPE_SELECTOR_UNIT, "Selector unit descriptor"}, {AC_SUBTYPE_FEATURE_UNIT, "Feature unit descriptor"}, {AC_SUBTYPE_EFFECT_UNIT, "Effect unit descriptor"}, {AC_SUBTYPE_PROCESSING_UNIT, "Processing unit descriptor"}, {AC_SUBTYPE_EXTENSION_UNIT, "Extension unit descriptor"}, {AC_SUBTYPE_CLOCK_SOURCE, "Clock source descriptor"}, {AC_SUBTYPE_CLOCK_SELECTOR, "Clock selector descriptor"}, {AC_SUBTYPE_CLOCK_MULTIPLIER, "Clock multiplier descriptor"}, {AC_SUBTYPE_SAMPLE_RATE_CONVERTER, "Sample rate converter descriptor"}, {0,NULL} }; static value_string_ext ac_subtype_vals_ext = VALUE_STRING_EXT_INIT(ac_subtype_vals); #define AS_SUBTYPE_GENERAL 0x01 #define AS_SUBTYPE_FORMAT_TYPE 0x02 #define AS_SUBTYPE_ENCODER 0x03 static const value_string as_subtype_vals[] = { {AS_SUBTYPE_GENERAL, "General AS Descriptor"}, {AS_SUBTYPE_FORMAT_TYPE, "Format type descriptor"}, {AS_SUBTYPE_ENCODER, "Encoder descriptor"}, {0,NULL} }; static value_string_ext as_subtype_vals_ext = VALUE_STRING_EXT_INIT(as_subtype_vals); #define AS_EP_SUBTYPE_GENERAL 0x01 static const value_string as_ep_subtype_vals[] = { {AS_EP_SUBTYPE_GENERAL, "General Descriptor"}, {0,NULL} }; #define MS_IF_SUBTYPE_HEADER 0x01 #define MS_IF_SUBTYPE_MIDI_IN_JACK 0x02 #define MS_IF_SUBTYPE_MIDI_OUT_JACK 0x03 #define MS_IF_SUBTYPE_ELEMENT 0x04 static const value_string ms_if_subtype_vals[] = { {MS_IF_SUBTYPE_HEADER, "Header Descriptor"}, {MS_IF_SUBTYPE_MIDI_IN_JACK, "MIDI IN Jack descriptor"}, {MS_IF_SUBTYPE_MIDI_OUT_JACK, "MIDI OUT Jack descriptor"}, {MS_IF_SUBTYPE_ELEMENT, "MIDI Element descriptor"}, {0,NULL} }; static value_string_ext ms_if_subtype_vals_ext = VALUE_STRING_EXT_INIT(ms_if_subtype_vals); #define MS_MIDI_JACK_TYPE_EMBEDDED 0x01 #define MS_MIDI_JACK_TYPE_EXTERNAL 0x02 static const value_string ms_midi_jack_type_vals[] = { {MS_MIDI_JACK_TYPE_EMBEDDED, "Embedded"}, {MS_MIDI_JACK_TYPE_EXTERNAL, "External"}, {0,NULL} }; #define MS_EP_SUBTYPE_GENERAL 0x01 static const value_string ms_ep_subtype_vals[] = { {MS_EP_SUBTYPE_GENERAL, "General Descriptor"}, {0,NULL} }; /* Table A-7: Audio Function Category Codes */ static const value_string audio_function_categories_vals[] = { {0x00, "Undefined"}, {0x01, "Desktop speaker"}, {0x02, "Home theater"}, {0x03, "Microphone"}, {0x04, "Headset"}, {0x05, "Telephone"}, {0x06, "Converter"}, {0x07, "Voice/Sound recorder"}, {0x08, "I/O box"}, {0x09, "Musical instrument"}, {0x0A, "Pro-audio"}, {0x0B, "Audio/Video"}, {0x0C, "Control panel"}, {0xFF, "Other"}, {0,NULL} }; static value_string_ext audio_function_categories_vals_ext = VALUE_STRING_EXT_INIT(audio_function_categories_vals); /* Described in 4.7.2 Class-Specific AC Interface Descriptor */ static const value_string controls_capabilities_vals[] = { {0x00, "Not present"}, {0x01, "Present, read-only"}, {0x02, "Value not allowed"}, {0x03, "Host programmable"}, {0,NULL} }; static value_string_ext controls_capabilities_vals_ext = VALUE_STRING_EXT_INIT(controls_capabilities_vals); /* Described in 4.9.2 Class-Specific AS Interface Descriptor */ static const value_string controls_capabilities_read_only_vals[] = { {0x00, "Not present"}, {0x01, "Present, read-only"}, {0x02, "Value not allowed"}, {0x03, "Value not allowed"}, {0,NULL} }; static value_string_ext controls_capabilities_read_only_vals_ext = VALUE_STRING_EXT_INIT(controls_capabilities_read_only_vals); /* Described in 4.7.2.1 Clock Source Descriptor */ static const value_string clock_types_vals[] = { {0x00, "External clock"}, {0x01, "Internal fixed clock"}, {0x02, "Internal variable clock"}, {0x03, "Internal programmable clock"}, {0,NULL} }; static const value_string clock_sync_vals[] = { {0x00, "Free running"}, {0x01, "Synchronized to the Start of Frame"}, {0,NULL} }; static const value_string lock_delay_unit_vals[] = { {0, "Undefined"}, {1, "Milliseconds"}, {2, "Decoded PCM samples"}, {0,NULL} }; /* From https://www.usb.org/sites/default/files/termt10.pdf */ static const value_string terminal_types_vals[] = { /* USB Terminal Types */ {0x0100, "USB Undefined"}, {0x0101, "USB Streaming"}, {0x01FF, "USB vendor specific"}, /* Input Terminal Tyoes */ {0x0200, "Input Undefined"}, {0x0201, "Microphone"}, {0x0202, "Desktop Microphone"}, {0x0203, "Personal microphone"}, {0x0204, "Omni-directional microphone"}, {0x0205, "Microphone array"}, {0x0206, "Processing microphone array"}, {0x0300, "Output Undefined"}, {0x0301, "Speaker"}, {0x0302, "Headphones"}, {0x0303, "Head Mounted Display Audio"}, {0x0304, "Desktop speaker"}, {0x0305, "Room speaker"}, {0x0306, "Communication speaker"}, {0x0307, "Low frequency effects speaker"}, /* Bi-directional Terminal Types */ {0x0400, "Bi-directional Undefined"}, {0x0401, "Handset"}, {0x0402, "Headset"}, {0x0403, "Speakerphone, no echoreduction"}, {0x0404, "Echo-suppressing speakerphone"}, {0x0405, "Echo-canceling speakerphone"}, /* Telephony Terminal Types */ {0x0500, "Telephony Undefined"}, {0x0501, "Phone line"}, {0x0502, "Telephone"}, {0x0503, "Down Line Pone"}, /* External Terminal Types */ {0x0600, "External Undefined"}, {0x0601, "Analog connector"}, {0x0602, "Digital audio interface"}, {0x0603, "Line connector"}, {0x0604, "Legacy audio connector"}, {0x0605, "S/PDIF interface"}, {0x0606, "1394 DA stream"}, {0x0607, "1394 DV stream soundtrack"}, /* Embedded Function Terminal Types */ {0x0700, "Embedded Undefined"}, {0x0701, "Level Calibration Noise Source"}, {0x0702, "Equalization Noise"}, {0x0703, "CD player"}, {0x0704, "DAT"}, {0x0705, "DCC"}, {0x0706, "MiniDisk"}, {0x0707, "Analog Tape"}, {0x0708, "Phonograph"}, {0x0709, "VCR Audio"}, {0x070A, "Video Disc Audio"}, {0x070B, "DVD Audio"}, {0x070C, "TV Tuner Audio"}, {0x070D, "Satellite Receiver Audio"}, {0x070E, "cable Tuner Audio"}, {0x070F, "DSS Audio"}, {0x0710, "Radio Receiver"}, {0x0711, "Radio Transmitter"}, {0x0712, "Multi-track Recorder"}, {0x0713, "Synthesizer"}, {0,NULL} }; static value_string_ext terminal_types_vals_ext = VALUE_STRING_EXT_INIT(terminal_types_vals); /* From https://usb.org/sites/default/files/frmts10.pdf */ static const value_string audio_data_format_tag_vals[] = { /* Audio Data Format Type I Codes */ {0x0000, "Type I Undefined"}, {0x0001, "PCM"}, {0x0002, "PCM8"}, {0x0003, "IEEE Float"}, {0x0004, "ALAW"}, {0x0005, "MULAW"}, /* Audio Data Format Type II Codes */ {0x1000, "Type II Undefined"}, {0x1001, "MPEG"}, {0x1002, "AC-3"}, /* Audio Data Format Type III Codes */ {0x2000, "Type III Undefined"}, {0x2001, "IEC1937 AC-3"}, {0x2002, "IEC1937 MPEG-1 Layer1"}, {0x2003, "IEC1937 MPEG-1 Layer2/3 or IEC1937 MPEG-2 NOEXT"}, {0x2004, "IEC1937 MPEG-2 EXT"}, {0x2005, "IEC1937 MPEG-2 Layer1 LS"}, {0x2006, "IEC1937 MPEG-2 Layer2/3 LS"}, {0,NULL} }; static value_string_ext audio_data_format_tag_vals_ext = VALUE_STRING_EXT_INIT(audio_data_format_tag_vals); typedef struct _audio_conv_info_t { /* the major version of the USB audio class specification, taken from the AC header descriptor */ guint8 audio_ver_major; /* the major version of the USB Device Class Definition for MIDI Devices, taken from the MS header descriptor */ guint8 midi_ver_major; } audio_conv_info_t; static int hf_sysex_msg_fragments = -1; static int hf_sysex_msg_fragment = -1; static int hf_sysex_msg_fragment_overlap = -1; static int hf_sysex_msg_fragment_overlap_conflicts = -1; static int hf_sysex_msg_fragment_multiple_tails = -1; static int hf_sysex_msg_fragment_too_long_fragment = -1; static int hf_sysex_msg_fragment_error = -1; static int hf_sysex_msg_fragment_count = -1; static int hf_sysex_msg_reassembled_in = -1; static int hf_sysex_msg_reassembled_length = -1; static int hf_sysex_msg_reassembled_data = -1; static gint ett_sysex_msg_fragment = -1; static gint ett_sysex_msg_fragments = -1; static expert_field ei_usb_audio_undecoded = EI_INIT; static expert_field ei_usb_audio_invalid_feature_unit_length = EI_INIT; static expert_field ei_usb_audio_invalid_type_3_ft_nrchannels = EI_INIT; static expert_field ei_usb_audio_invalid_type_3_ft_subframesize = EI_INIT; static expert_field ei_usb_audio_invalid_type_3_ft_bitresolution = EI_INIT; static const fragment_items sysex_msg_frag_items = { /* Fragment subtrees */ &ett_sysex_msg_fragment, &ett_sysex_msg_fragments, /* Fragment fields */ &hf_sysex_msg_fragments, &hf_sysex_msg_fragment, &hf_sysex_msg_fragment_overlap, &hf_sysex_msg_fragment_overlap_conflicts, &hf_sysex_msg_fragment_multiple_tails, &hf_sysex_msg_fragment_too_long_fragment, &hf_sysex_msg_fragment_error, &hf_sysex_msg_fragment_count, /* Reassembled in field */ &hf_sysex_msg_reassembled_in, /* Reassembled length field */ &hf_sysex_msg_reassembled_length, &hf_sysex_msg_reassembled_data, /* Tag */ "Message fragments" }; static gint get_midi_event_size(guint8 code) { switch (code) { case 0x0: /* Miscellaneous function codes. Reserved for future extensions. */ case 0x1: /* Cable events. Reserved for future expansion. */ /* The Event size can be 1, 2 or 3 bytes. Assume 3. */ return 3; case 0x5: /* Single-byte System Common Message or SysEx ends with following single byte. */ case 0xF: /* Single Byte */ return 1; case 0x2: /* 2 Two-byte System Common messages like MTC, SongSelect, etc. */ case 0x6: /* SysEx ends with following two bytes. */ case 0xC: /* Program Change */ case 0xD: /* Channel Pressure */ return 2; case 0x3: /* Three-byte System Common messages like SPP, etc. */ case 0x4: /* SysEx starts or continues */ case 0x7: /* SysEx ends with following three bytes. */ case 0x8: /* Note-off */ case 0x9: /* Note-on */ case 0xA: /* Poly-KeyPress */ case 0xB: /* Control Change */ case 0xE: /* PitchBend Change */ return 3; default: /* Invalid Code Index Number */ return 0; } } static inline gboolean is_sysex_code(guint8 code) { return (code == 0x04 || code == 0x05 || code == 0x06 || code == 0x07); } static gboolean is_last_sysex_packet_in_tvb(tvbuff_t *tvb, gint offset) { gboolean last = TRUE; gint length = tvb_reported_length(tvb); offset += 4; while (offset < length) { guint8 code = tvb_get_guint8(tvb, offset); code &= 0x0F; if (is_sysex_code(code)) { last = FALSE; break; } offset += 4; } return last; } static void dissect_usb_midi_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gint offset) { guint8 code; guint8 cable; gboolean save_fragmented; proto_tree *tree = NULL; code = tvb_get_guint8(tvb, offset); cable = (code & 0xF0) >> 4; code &= 0x0F; if (parent_tree) { proto_item *ti; gint event_size, padding_size; ti = proto_tree_add_protocol_format(parent_tree, proto_usb_audio, tvb, offset, 4, "USB Midi Event Packet: %s", try_val_to_str(code, code_index_vals)); tree = proto_item_add_subtree(ti, ett_usb_audio); proto_tree_add_item(tree, hf_midi_cable_number, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_midi_code_index, tvb, offset, 1, ENC_BIG_ENDIAN); event_size = get_midi_event_size(code); padding_size = 3 - event_size; if (event_size > 0) { /* TODO: Create MIDI dissector and pass the event data to it */ const guint8 *event_data = tvb_get_ptr(tvb, offset+1, event_size); proto_tree_add_bytes(tree, hf_midi_event, tvb, offset+1, event_size, event_data); } if (padding_size > 0) { const guint8 *padding = tvb_get_ptr(tvb, offset+1+event_size, padding_size); proto_tree_add_bytes(tree, hf_midi_padding, tvb, offset+1+event_size, padding_size, padding); } } save_fragmented = pinfo->fragmented; /* Reassemble SysEx commands */ if (is_sysex_code(code)) { tvbuff_t* new_tvb = NULL; fragment_head *frag_sysex_msg = NULL; pinfo->fragmented = TRUE; if (code == 0x04) { frag_sysex_msg = fragment_add_seq_next(&midi_data_reassembly_table, tvb, offset+1, pinfo, cable, /* ID for fragments belonging together */ NULL, 3, TRUE); } else { frag_sysex_msg = fragment_add_seq_next(&midi_data_reassembly_table, tvb, offset+1, pinfo, cable, /* ID for fragments belonging together */ NULL, (gint)(code - 4), FALSE); } if (is_last_sysex_packet_in_tvb(tvb, offset)) { new_tvb = process_reassembled_data(tvb, offset+1, pinfo, "Reassembled Message", frag_sysex_msg, &sysex_msg_frag_items, NULL, tree); if (code != 0x04) { /* Reassembled */ col_append_str(pinfo->cinfo, COL_INFO, " (SysEx Reassembled)"); } else { /* Not last packet of reassembled Short Message */ col_append_str(pinfo->cinfo, COL_INFO, " (SysEx fragment)"); } if (new_tvb) { call_dissector(sysex_handle, new_tvb, pinfo, parent_tree); } } } pinfo->fragmented = save_fragmented; } static audio_conv_info_t* allocate_audio_conv_info(void) { audio_conv_info_t *info = wmem_new(wmem_file_scope(), audio_conv_info_t); info->audio_ver_major = 0; info->midi_ver_major = 0; return info; } /* dissect the body of an AC interface header descriptor return the number of bytes dissected (which may be smaller than the body's length) */ static gint dissect_ac_if_hdr_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { gint offset_start; guint16 bcdADC; guint8 ver_major; double ver; guint8 if_in_collection, i; audio_conv_info_t *audio_conv_info; static int * const bm_controls[] = { &hf_ac_if_hdr_controls_latency, &hf_ac_if_hdr_controls_rsv, NULL }; offset_start = offset; bcdADC = tvb_get_letohs(tvb, offset); ver_major = USB_AUDIO_BCD44_TO_DEC(bcdADC>>8); ver = ver_major + USB_AUDIO_BCD44_TO_DEC(bcdADC&0xFF) / 100.0; proto_tree_add_double_format_value(tree, hf_ac_if_hdr_ver, tvb, offset, 2, ver, "%2.2f", ver); audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if(!audio_conv_info) { audio_conv_info = allocate_audio_conv_info(); usb_conv_info->class_data = audio_conv_info; usb_conv_info->class_data_type = USB_CONV_AUDIO; /* XXX - set reasonable default values for all components that are not filled in by this function */ } else if (usb_conv_info->class_data_type != USB_CONV_AUDIO) { /* Don't dissect if another USB type is in the conversation */ return 0; } audio_conv_info->audio_ver_major = ver_major; offset += 2; /* version 1 refers to the Basic Audio Device specification, version 2 is the Audio Device class specification, see above */ if (ver_major==1) { proto_tree_add_item(tree, hf_ac_if_hdr_total_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if_in_collection = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_ac_if_hdr_bInCollection, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; for (i=0; i<if_in_collection; i++) { proto_tree_add_item(tree, hf_ac_if_hdr_if_num, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; } } else if (ver_major==2) { proto_tree_add_item(tree, hf_ac_if_hdr_category, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_ac_if_hdr_total_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_hdr_controls, ett_ac_if_hdr_controls, bm_controls, ENC_LITTLE_ENDIAN); offset++; } return offset-offset_start; } static gint dissect_ac_if_input_terminal(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { audio_conv_info_t *audio_conv_info; gint offset_start; static int * const input_wchannelconfig[] = { &hf_ac_if_input_wchannelconfig_d0, &hf_ac_if_input_wchannelconfig_d1, &hf_ac_if_input_wchannelconfig_d2, &hf_ac_if_input_wchannelconfig_d3, &hf_ac_if_input_wchannelconfig_d4, &hf_ac_if_input_wchannelconfig_d5, &hf_ac_if_input_wchannelconfig_d6, &hf_ac_if_input_wchannelconfig_d7, &hf_ac_if_input_wchannelconfig_d8, &hf_ac_if_input_wchannelconfig_d9, &hf_ac_if_input_wchannelconfig_d10, &hf_ac_if_input_wchannelconfig_d11, &hf_ac_if_input_wchannelconfig_rsv, NULL }; static int * const input_bmchannelconfig[] = { &hf_ac_if_input_bmchannelconfig_d0, &hf_ac_if_input_bmchannelconfig_d1, &hf_ac_if_input_bmchannelconfig_d2, &hf_ac_if_input_bmchannelconfig_d3, &hf_ac_if_input_bmchannelconfig_d4, &hf_ac_if_input_bmchannelconfig_d5, &hf_ac_if_input_bmchannelconfig_d6, &hf_ac_if_input_bmchannelconfig_d7, &hf_ac_if_input_bmchannelconfig_d8, &hf_ac_if_input_bmchannelconfig_d9, &hf_ac_if_input_bmchannelconfig_d10, &hf_ac_if_input_bmchannelconfig_d11, &hf_ac_if_input_bmchannelconfig_d12, &hf_ac_if_input_bmchannelconfig_d13, &hf_ac_if_input_bmchannelconfig_d14, &hf_ac_if_input_bmchannelconfig_d15, &hf_ac_if_input_bmchannelconfig_d16, &hf_ac_if_input_bmchannelconfig_d17, &hf_ac_if_input_bmchannelconfig_d18, &hf_ac_if_input_bmchannelconfig_d19, &hf_ac_if_input_bmchannelconfig_d20, &hf_ac_if_input_bmchannelconfig_d21, &hf_ac_if_input_bmchannelconfig_d22, &hf_ac_if_input_bmchannelconfig_d23, &hf_ac_if_input_bmchannelconfig_d24, &hf_ac_if_input_bmchannelconfig_d25, &hf_ac_if_input_bmchannelconfig_d26, &hf_ac_if_input_bmchannelconfig_rsv, &hf_ac_if_input_bmchannelconfig_d31, NULL }; static int * const controls[] = { &hf_ac_if_input_controls_copy, &hf_ac_if_input_controls_connector, &hf_ac_if_input_controls_overload, &hf_ac_if_input_controls_cluster, &hf_ac_if_input_controls_underflow, &hf_ac_if_input_controls_overflow, &hf_ac_if_input_controls_rsv, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; /* do not try to dissect unknown versions */ if (!((audio_conv_info->audio_ver_major==1) || (audio_conv_info->audio_ver_major==2))) return 0; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_input_terminalid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_input_terminaltype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_ac_if_input_assocterminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (audio_conv_info->audio_ver_major == 2) { proto_tree_add_item(tree, hf_ac_if_input_csourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } proto_tree_add_item(tree, hf_ac_if_input_nrchannels, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (audio_conv_info->audio_ver_major==1) { proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_input_wchannelconfig, ett_ac_if_input_wchannelconfig, input_wchannelconfig, ENC_LITTLE_ENDIAN); offset += 2; } else if (audio_conv_info->audio_ver_major==2) { proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_input_bmchannelconfig, ett_ac_if_input_bmchannelconfig, input_bmchannelconfig, ENC_LITTLE_ENDIAN); offset += 4; } proto_tree_add_item(tree, hf_ac_if_input_channelnames, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (audio_conv_info->audio_ver_major==2) { proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_input_controls, ett_ac_if_input_controls, controls, ENC_LITTLE_ENDIAN); offset += 2; } proto_tree_add_item(tree, hf_ac_if_input_terminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ac_if_output_terminal(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { audio_conv_info_t *audio_conv_info; gint offset_start; static int * const controls[] = { &hf_ac_if_output_controls_copy, &hf_ac_if_output_controls_connector, &hf_ac_if_output_controls_overload, &hf_ac_if_output_controls_underflow, &hf_ac_if_output_controls_overflow, &hf_ac_if_output_controls_rsv, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; /* do not try to dissect unknown versions */ if (!((audio_conv_info->audio_ver_major==1) || (audio_conv_info->audio_ver_major==2))) return 0; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_output_terminalid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_output_terminaltype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_ac_if_output_assocterminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_output_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (audio_conv_info->audio_ver_major==2) { proto_tree_add_item(tree, hf_ac_if_output_clk_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_output_controls, ett_ac_if_output_controls, controls, ENC_LITTLE_ENDIAN); offset += 2; } proto_tree_add_item(tree, hf_ac_if_output_terminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ac_if_feature_unit(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_, guint8 desc_len) { audio_conv_info_t *audio_conv_info; gint offset_start; gint i; gint ch; guint8 controlsize; proto_tree *bitmap_tree; proto_item *ti; static int * const fu_controls0[] = { &hf_ac_if_fu_controls_d0, &hf_ac_if_fu_controls_d1, &hf_ac_if_fu_controls_d2, &hf_ac_if_fu_controls_d3, &hf_ac_if_fu_controls_d4, &hf_ac_if_fu_controls_d5, &hf_ac_if_fu_controls_d6, &hf_ac_if_fu_controls_d7, NULL }; static int * const fu_controls1[] = { &hf_ac_if_fu_controls_d8, &hf_ac_if_fu_controls_d9, &hf_ac_if_fu_controls_rsv, NULL }; static int * const v2_fu_controls[] = { &hf_ac_if_fu_controls_v2_d0, &hf_ac_if_fu_controls_v2_d1, &hf_ac_if_fu_controls_v2_d2, &hf_ac_if_fu_controls_v2_d3, &hf_ac_if_fu_controls_v2_d4, &hf_ac_if_fu_controls_v2_d5, &hf_ac_if_fu_controls_v2_d6, &hf_ac_if_fu_controls_v2_d7, &hf_ac_if_fu_controls_v2_d8, &hf_ac_if_fu_controls_v2_d9, &hf_ac_if_fu_controls_v2_d10, &hf_ac_if_fu_controls_v2_d11, &hf_ac_if_fu_controls_v2_d12, &hf_ac_if_fu_controls_v2_d13, &hf_ac_if_fu_controls_v2_d14, &hf_ac_if_fu_controls_v2_rsv, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; /* do not try to dissect unknown versions */ if (!((audio_conv_info->audio_ver_major==1) || (audio_conv_info->audio_ver_major==2))) return 0; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_fu_unitid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_fu_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (audio_conv_info->audio_ver_major==1) { proto_tree_add_item(tree, hf_ac_if_fu_controlsize, tvb, offset, 1, ENC_LITTLE_ENDIAN); controlsize = tvb_get_guint8(tvb, offset); offset += 1; /* Descriptor size is 7+(ch+1)*n where n is controlsize, calculate and validate ch */ ch = (controlsize > 0) ? (((desc_len - 7) / (controlsize)) - 1) : 0; if (((7 + ((ch + 1) * controlsize)) != desc_len) || (ch < 0) || (controlsize == 0)){ /* Report malformed packet, do not attempt further dissection */ proto_tree_add_expert(tree, pinfo, &ei_usb_audio_invalid_feature_unit_length, tvb, offset, desc_len-offset); offset += desc_len-offset; return offset-offset_start; } ti = proto_tree_add_item(tree, hf_ac_if_fu_controls, tvb, offset, controlsize * (ch + 1), ENC_NA); bitmap_tree = proto_item_add_subtree(ti, ett_ac_if_fu_controls); /* bmaControls has 1 master channel 0 controls, and variable number of logical channel controls */ for (i = 0; i < (ch + 1); i++) { ti = proto_tree_add_bitmask(bitmap_tree, tvb, offset, hf_ac_if_fu_control, ett_ac_if_fu_controls0, fu_controls0, ENC_LITTLE_ENDIAN); proto_item_prepend_text(ti, "%s channel %d ", (i == 0) ? "Master" : "Logical", i); if (controlsize > 1) { ti = proto_tree_add_bitmask(bitmap_tree, tvb, offset + 1, hf_ac_if_fu_control, ett_ac_if_fu_controls1, fu_controls1, ENC_LITTLE_ENDIAN); proto_item_prepend_text(ti, "%s channel %d", (i == 0) ? "Master" : "Logical", i); } offset += controlsize; } } else if (audio_conv_info->audio_ver_major==2) { /* Descriptor size is 6+(ch+1)*4, calculate and validate ch */ ch = (desc_len - 6) / 4 - 1; if (((6 + (ch + 1) * 4) != desc_len) || (ch < 0)) { /* Report malformed packet, do not attempt further dissection */ proto_tree_add_expert(tree, pinfo, &ei_usb_audio_invalid_feature_unit_length, tvb, offset, desc_len-offset); offset += desc_len-offset; return offset-offset_start; } ti = proto_tree_add_item(tree, hf_ac_if_fu_controls_v2, tvb, offset, 4 * (ch + 1), ENC_NA); bitmap_tree = proto_item_add_subtree(ti, ett_ac_if_fu_controls_v2); for (i = 0; i < (ch + 1); i++) { ti = proto_tree_add_bitmask(bitmap_tree, tvb, offset, hf_ac_if_fu_control_v2, ett_ac_if_fu_control_v2, v2_fu_controls, ENC_LITTLE_ENDIAN); proto_item_prepend_text(ti, "%s channel %d ", (i == 0) ? "Master" : "Logical", i); offset += 4; } } proto_tree_add_item(tree, hf_ac_if_fu_ifeature, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ac_if_selector_unit(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { audio_conv_info_t *audio_conv_info; gint offset_start; guint32 nrinpins,i; guint32 source_id; proto_item *ti; proto_tree *subtree; static int * const controls[] = { &hf_ac_if_su_controls_d0, &hf_ac_if_su_controls_rsv, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; /* do not try to dissect unknown versions */ if (!((audio_conv_info->audio_ver_major==1) || (audio_conv_info->audio_ver_major==2))) return 0; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_su_unitid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item_ret_uint(tree, hf_ac_if_su_nrinpins, tvb, offset, 1, ENC_LITTLE_ENDIAN, &nrinpins); offset += 1; ti = proto_tree_add_bytes_format_value(tree, hf_ac_if_su_sourceids, tvb, offset, nrinpins, NULL, "%s", ""); subtree = proto_item_add_subtree(ti, ett_ac_if_su_sourceids); for (i = 0; i < nrinpins; ++i) { proto_tree_add_item_ret_uint(subtree, hf_ac_if_su_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN, &source_id); offset += 1; proto_item_append_text(ti, "%s%d", (i > 0) ? ", " : "", source_id); } if (audio_conv_info->audio_ver_major==2) { proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_su_controls, ett_ac_if_su_controls, controls, ENC_LITTLE_ENDIAN); offset += 1; } proto_tree_add_item(tree, hf_ac_if_su_iselector, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset - offset_start; } static gint dissect_ac_if_mixed_unit(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start; guint8 nrinpins; static int * const mu_channelconfig[] = { &hf_ac_if_mu_channelconfig_d0, &hf_ac_if_mu_channelconfig_d1, &hf_ac_if_mu_channelconfig_d2, &hf_ac_if_mu_channelconfig_d3, &hf_ac_if_mu_channelconfig_d4, &hf_ac_if_mu_channelconfig_d5, &hf_ac_if_mu_channelconfig_d6, &hf_ac_if_mu_channelconfig_d7, &hf_ac_if_mu_channelconfig_d8, &hf_ac_if_mu_channelconfig_d9, &hf_ac_if_mu_channelconfig_d10, &hf_ac_if_mu_channelconfig_d11, &hf_ac_if_mu_channelconfig_rsv, NULL }; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_mu_unitid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_mu_nrinpins, tvb, offset, 1, ENC_LITTLE_ENDIAN); nrinpins = tvb_get_guint8(tvb, offset); offset += 1; while(nrinpins){ proto_tree_add_item(tree, hf_ac_if_mu_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); nrinpins--; offset += 1; } proto_tree_add_item(tree, hf_ac_if_mu_nrchannels, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_mu_channelconfig, ett_ac_if_mu_channelconfig, mu_channelconfig, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_ac_if_mu_channelnames, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_mu_controls, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_mu_imixer, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ac_if_clock_source(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start; static int * const cs_attributes[] = { &hf_ac_if_clksrc_attr_type, &hf_ac_if_clksrc_attr_d2, &hf_ac_if_clksrc_attr_rsv, NULL }; static int * const cs_controls[] = { &hf_ac_if_clksrc_controls_freq, &hf_ac_if_clksrc_controls_validity, &hf_ac_if_clksrc_controls_rsv, NULL }; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_clksrc_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_clksrc_attr, ett_ac_if_clksrc_attr, cs_attributes, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_clksrc_controls, ett_ac_if_clksrc_controls, cs_controls, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_clksrc_assocterminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_clksrc_clocksource, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ac_if_clock_selector(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start; guint8 nrinpins; static int * const cs_controls[] = { &hf_ac_if_clksel_controls_clksel, &hf_ac_if_clksel_controls_rsv, NULL }; offset_start = offset; proto_tree_add_item(tree, hf_ac_if_clksel_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_clksel_nrpins, tvb, offset, 1, ENC_LITTLE_ENDIAN); nrinpins = tvb_get_guint8(tvb, offset); offset += 1; while (nrinpins) { proto_tree_add_item(tree, hf_ac_if_clksel_sourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); nrinpins--; offset += 1; } proto_tree_add_bitmask(tree, tvb, offset, hf_ac_if_clksel_controls, ett_ac_if_clksel_controls, cs_controls, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ac_if_clksel_clockselector, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_as_if_general_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { audio_conv_info_t *audio_conv_info; gint offset_start; static int * const v2_controls[] = { &hf_as_if_gen_controls_active, &hf_as_if_gen_controls_valid, &hf_as_if_gen_controls_rsv, NULL }; static int * const v2_formats_type_i[] = { &hf_as_if_gen_formats_i_d0, &hf_as_if_gen_formats_i_d1, &hf_as_if_gen_formats_i_d2, &hf_as_if_gen_formats_i_d3, &hf_as_if_gen_formats_i_d4, &hf_as_if_gen_formats_i_rsv, &hf_as_if_gen_formats_i_d31, NULL }; static int * const v2_formats_type_ii[] = { &hf_as_if_gen_formats_ii_d0, &hf_as_if_gen_formats_ii_d1, &hf_as_if_gen_formats_ii_d2, &hf_as_if_gen_formats_ii_d3, &hf_as_if_gen_formats_ii_rsv, &hf_as_if_gen_formats_ii_d31, NULL }; static int * const v2_formats_type_iii[] = { &hf_as_if_gen_formats_iii_d0, &hf_as_if_gen_formats_iii_d1, &hf_as_if_gen_formats_iii_d2, &hf_as_if_gen_formats_iii_d3, &hf_as_if_gen_formats_iii_d4, &hf_as_if_gen_formats_iii_d5, &hf_as_if_gen_formats_iii_d6, &hf_as_if_gen_formats_iii_d7, &hf_as_if_gen_formats_iii_d8, &hf_as_if_gen_formats_iii_d9, &hf_as_if_gen_formats_iii_d10, &hf_as_if_gen_formats_iii_d11, &hf_as_if_gen_formats_iii_d12, &hf_as_if_gen_formats_iii_rsv, NULL }; static int * const v2_formats_type_iv[] = { &hf_as_if_gen_formats_iv_d0, &hf_as_if_gen_formats_iv_d1, &hf_as_if_gen_formats_iv_d2, &hf_as_if_gen_formats_iv_d3, &hf_as_if_gen_formats_iv_d4, &hf_as_if_gen_formats_iv_d5, &hf_as_if_gen_formats_iv_d6, &hf_as_if_gen_formats_iv_d7, &hf_as_if_gen_formats_iv_d8, &hf_as_if_gen_formats_iv_d9, &hf_as_if_gen_formats_iv_d10, &hf_as_if_gen_formats_iv_d11, &hf_as_if_gen_formats_iv_d12, &hf_as_if_gen_formats_iv_d13, &hf_as_if_gen_formats_iv_d14, &hf_as_if_gen_formats_iv_d15, &hf_as_if_gen_formats_iv_d16, &hf_as_if_gen_formats_iv_d17, &hf_as_if_gen_formats_iv_d18, &hf_as_if_gen_formats_iv_d19, &hf_as_if_gen_formats_iv_d20, &hf_as_if_gen_formats_iv_d21, &hf_as_if_gen_formats_iv_rsv, NULL }; static int * const v2_channels[] = { &hf_as_if_gen_bmchannelconfig_d0, &hf_as_if_gen_bmchannelconfig_d1, &hf_as_if_gen_bmchannelconfig_d2, &hf_as_if_gen_bmchannelconfig_d3, &hf_as_if_gen_bmchannelconfig_d4, &hf_as_if_gen_bmchannelconfig_d5, &hf_as_if_gen_bmchannelconfig_d6, &hf_as_if_gen_bmchannelconfig_d7, &hf_as_if_gen_bmchannelconfig_d8, &hf_as_if_gen_bmchannelconfig_d9, &hf_as_if_gen_bmchannelconfig_d10, &hf_as_if_gen_bmchannelconfig_d11, &hf_as_if_gen_bmchannelconfig_d12, &hf_as_if_gen_bmchannelconfig_d13, &hf_as_if_gen_bmchannelconfig_d14, &hf_as_if_gen_bmchannelconfig_d15, &hf_as_if_gen_bmchannelconfig_d16, &hf_as_if_gen_bmchannelconfig_d17, &hf_as_if_gen_bmchannelconfig_d18, &hf_as_if_gen_bmchannelconfig_d19, &hf_as_if_gen_bmchannelconfig_d20, &hf_as_if_gen_bmchannelconfig_d21, &hf_as_if_gen_bmchannelconfig_d22, &hf_as_if_gen_bmchannelconfig_d23, &hf_as_if_gen_bmchannelconfig_d24, &hf_as_if_gen_bmchannelconfig_d25, &hf_as_if_gen_bmchannelconfig_d26, &hf_as_if_gen_bmchannelconfig_rsv, &hf_as_if_gen_bmchannelconfig_d31, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; offset_start = offset; if (audio_conv_info->audio_ver_major==1) { proto_tree_add_item(tree, hf_as_if_gen_term_link, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_as_if_gen_delay, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_as_if_gen_wformattag, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } else if (audio_conv_info->audio_ver_major==2) { guint8 format_type; int * const *formats_bitmask; proto_tree_add_item(tree, hf_as_if_gen_term_link, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_as_if_gen_controls, ett_as_if_gen_controls, v2_controls, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_as_if_gen_formattype, tvb, offset, 1, ENC_LITTLE_ENDIAN); format_type = tvb_get_guint8(tvb, offset); offset++; switch(format_type) { case 1: formats_bitmask = v2_formats_type_i; break; case 2: formats_bitmask = v2_formats_type_ii; break; case 3: formats_bitmask = v2_formats_type_iii; break; case 4: formats_bitmask = v2_formats_type_iv; break; default: formats_bitmask = NULL; break; } if (formats_bitmask) { proto_tree_add_bitmask(tree, tvb, offset, hf_as_if_gen_formats, ett_as_if_gen_formats, formats_bitmask, ENC_LITTLE_ENDIAN); } else { proto_tree_add_item(tree, hf_as_if_gen_formats, tvb, offset, 4, ENC_LITTLE_ENDIAN); } offset += 4; proto_tree_add_item(tree, hf_as_if_gen_nrchannels, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_as_if_gen_bmchannelconfig, ett_as_if_gen_bmchannelconfig, v2_channels, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_as_if_gen_channelnames, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; } return offset-offset_start; } static gint dissect_as_if_format_type_ver1_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, audio_conv_info_t *audio_conv_info _U_) { gint offset_start; guint8 SamFreqType; guint8 format_type; guint32 nrchannels; guint32 subframesize; guint32 bitresolution; proto_item *desc_tree_item; offset_start = offset; proto_tree_add_item(tree, hf_as_if_ft_formattype, tvb, offset, 1, ENC_LITTLE_ENDIAN); format_type = tvb_get_guint8(tvb, offset); offset++; switch(format_type){ case 1: proto_tree_add_item(tree, hf_as_if_ft_nrchannels, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_as_if_ft_subframesize, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_as_if_ft_bitresolution, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_as_if_ft_samfreqtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); SamFreqType = tvb_get_guint8(tvb, offset); offset++; if(SamFreqType == 0){ proto_tree_add_item(tree, hf_as_if_ft_lowersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_as_if_ft_uppersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; }else { while(SamFreqType){ proto_tree_add_item(tree, hf_as_if_ft_samfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; SamFreqType--; } } break; case 2: proto_tree_add_item(tree, hf_as_if_ft_maxbitrate, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_as_if_ft_samplesperframe, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_as_if_ft_samfreqtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); SamFreqType = tvb_get_guint8(tvb, offset); offset++; if(SamFreqType == 0){ proto_tree_add_item(tree, hf_as_if_ft_lowersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_as_if_ft_uppersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; }else { while(SamFreqType){ proto_tree_add_item(tree, hf_as_if_ft_samfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; SamFreqType--; } } break; case 3: desc_tree_item = proto_tree_add_item_ret_uint(tree, hf_as_if_ft_nrchannels, tvb, offset, 1, ENC_LITTLE_ENDIAN, &nrchannels); offset += 1; if(nrchannels != 2){ expert_add_info(pinfo, desc_tree_item, &ei_usb_audio_invalid_type_3_ft_nrchannels); } desc_tree_item = proto_tree_add_item_ret_uint(tree, hf_as_if_ft_subframesize, tvb, offset, 1, ENC_LITTLE_ENDIAN, &subframesize); offset += 1; if(subframesize != 2){ expert_add_info(pinfo, desc_tree_item, &ei_usb_audio_invalid_type_3_ft_subframesize); } desc_tree_item = proto_tree_add_item_ret_uint(tree, hf_as_if_ft_bitresolution, tvb, offset, 1, ENC_LITTLE_ENDIAN, &bitresolution); offset += 1; if(bitresolution != 16){ expert_add_info(pinfo, desc_tree_item, &ei_usb_audio_invalid_type_3_ft_bitresolution); } proto_tree_add_item(tree, hf_as_if_ft_samfreqtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); SamFreqType = tvb_get_guint8(tvb, offset); offset++; if(SamFreqType == 0){ proto_tree_add_item(tree, hf_as_if_ft_lowersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_as_if_ft_uppersamfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; }else { while(SamFreqType){ proto_tree_add_item(tree, hf_as_if_ft_samfreq, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; SamFreqType--; } } break; default: break; } return offset-offset_start; } static gint dissect_as_if_format_type_ver2_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, audio_conv_info_t *audio_conv_info _U_) { gint offset_start; guint8 format_type; offset_start = offset; proto_tree_add_item(tree, hf_as_if_ft_formattype, tvb, offset, 1, ENC_LITTLE_ENDIAN); format_type = tvb_get_guint8(tvb, offset); offset++; if (format_type==1) { proto_tree_add_item(tree, hf_as_if_ft_subslotsize, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_as_if_ft_bitresolution, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } return offset-offset_start; } static gint dissect_as_if_format_type_body(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info) { audio_conv_info_t *audio_conv_info; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; if (audio_conv_info->audio_ver_major==1) { return dissect_as_if_format_type_ver1_body(tvb, offset, pinfo, tree, audio_conv_info); } else if (audio_conv_info->audio_ver_major==2) { return dissect_as_if_format_type_ver2_body(tvb, offset, pinfo, tree, audio_conv_info); } return 0; } static gint dissect_as_ep_general_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { audio_conv_info_t *audio_conv_info; gint offset_start = offset; static int * const v1_attributes[] = { &hf_as_ep_gen_bmattributes_d0, &hf_as_ep_gen_bmattributes_d1, &hf_as_ep_gen_bmattributes_rsv, &hf_as_ep_gen_bmattributes_d7, NULL }; static int * const v2_attributes[] = { &hf_as_ep_gen_bmattributes_d7, NULL }; static int * const controls[] = { &hf_as_ep_gen_controls_pitch, &hf_as_ep_gen_controls_data_overrun, &hf_as_ep_gen_controls_data_underrun, &hf_as_ep_gen_controls_rsv, NULL }; /* the caller has already checked that usb_conv_info!=NULL */ audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if (!audio_conv_info) return 0; /* do not try to dissect unknown versions */ if (!((audio_conv_info->audio_ver_major==1) || (audio_conv_info->audio_ver_major==2))) return 0; if (audio_conv_info->audio_ver_major==1) { proto_tree_add_bitmask(tree, tvb, offset, hf_as_ep_gen_bmattributes, ett_as_ep_gen_attributes, v1_attributes, ENC_LITTLE_ENDIAN); offset++; } else if (audio_conv_info->audio_ver_major==2) { proto_tree_add_bitmask(tree, tvb, offset, hf_as_ep_gen_bmattributes, ett_as_ep_gen_attributes, v2_attributes, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_as_ep_gen_controls, ett_as_ep_gen_controls, controls, ENC_LITTLE_ENDIAN); offset++; } proto_tree_add_item(tree, hf_as_ep_gen_lockdelayunits, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_as_ep_gen_lockdelay, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset-offset_start; } static gint dissect_ms_if_hdr_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info) { gint offset_start; guint16 bcdADC; guint8 ver_major; double ver; audio_conv_info_t *audio_conv_info; offset_start = offset; bcdADC = tvb_get_letohs(tvb, offset); ver_major = USB_AUDIO_BCD44_TO_DEC(bcdADC>>8); ver = ver_major + USB_AUDIO_BCD44_TO_DEC(bcdADC&0xFF) / 100.0; proto_tree_add_double_format_value(tree, hf_ms_if_hdr_ver, tvb, offset, 2, ver, "%2.2f", ver); audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data; if(!audio_conv_info) { audio_conv_info = allocate_audio_conv_info(); usb_conv_info->class_data = audio_conv_info; usb_conv_info->class_data_type = USB_CONV_AUDIO; } else if (usb_conv_info->class_data_type != USB_CONV_AUDIO) { /* Don't dissect if another USB type is in the conversation */ return 0; } audio_conv_info->midi_ver_major = ver_major; offset += 2; proto_tree_add_item(tree, hf_ms_if_hdr_total_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset-offset_start; } static gint dissect_ms_if_midi_in_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start = offset; proto_tree_add_item(tree, hf_ms_if_midi_in_bjacktype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ms_if_midi_in_bjackid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ms_if_midi_in_ijack, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ms_if_midi_out_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start = offset; guint8 nrinputpins; proto_tree_add_item(tree, hf_ms_if_midi_out_bjacktype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ms_if_midi_out_bjackid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ms_if_midi_out_bnrinputpins, tvb, offset, 1, ENC_LITTLE_ENDIAN); nrinputpins = tvb_get_guint8(tvb, offset); offset += 1; while (nrinputpins) { proto_tree_add_item(tree, hf_ms_if_midi_out_basourceid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_ms_if_midi_out_basourcepin, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; nrinputpins--; } proto_tree_add_item(tree, hf_ms_if_midi_out_ijack, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset-offset_start; } static gint dissect_ms_ep_general_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, usb_conv_info_t *usb_conv_info _U_) { gint offset_start = offset; guint8 numjacks; proto_tree_add_item(tree, hf_ms_ep_gen_numjacks, tvb, offset, 1, ENC_LITTLE_ENDIAN); numjacks = tvb_get_guint8(tvb, offset); offset += 1; while (numjacks) { proto_tree_add_item(tree, hf_ms_ep_gen_baassocjackid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; numjacks--; } return offset-offset_start; } static gint dissect_usb_audio_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint offset = 0; gint bytes_dissected = 0; usb_conv_info_t *usb_conv_info; proto_tree *desc_tree = NULL; proto_item *desc_tree_item; guint8 desc_len; guint8 desc_type; guint8 desc_subtype; const gchar *subtype_str; usb_conv_info = (usb_conv_info_t *)data; if (!usb_conv_info || usb_conv_info->interfaceClass!=IF_CLASS_AUDIO) return 0; desc_len = tvb_get_guint8(tvb, offset); desc_type = tvb_get_guint8(tvb, offset+1); if (desc_type==CS_INTERFACE && usb_conv_info->interfaceSubclass==AUDIO_IF_SUBCLASS_AUDIOCONTROL) { desc_tree = proto_tree_add_subtree(tree, tvb, offset, desc_len, ett_usb_audio_desc, &desc_tree_item, "Class-specific Audio Control Interface Descriptor"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &aud_descriptor_type_vals_ext); offset += 2; desc_subtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_ac_if_desc_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); subtype_str = try_val_to_str_ext(desc_subtype, &ac_subtype_vals_ext); if (subtype_str) proto_item_append_text(desc_tree_item, ": %s", subtype_str); offset++; bytes_dissected = offset; switch(desc_subtype) { case AC_SUBTYPE_HEADER: /* these subfunctions return the number of bytes dissected, this is not necessarily the length of the body as some components are not yet dissected we rely on the descriptor's length byte instead */ bytes_dissected += dissect_ac_if_hdr_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_INPUT_TERMINAL: bytes_dissected += dissect_ac_if_input_terminal(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_OUTPUT_TERMINAL: bytes_dissected += dissect_ac_if_output_terminal(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_MIXER_UNIT: bytes_dissected += dissect_ac_if_mixed_unit(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_SELECTOR_UNIT: bytes_dissected += dissect_ac_if_selector_unit(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_FEATURE_UNIT: bytes_dissected += dissect_ac_if_feature_unit(tvb, offset, pinfo, desc_tree, usb_conv_info, desc_len); break; case AC_SUBTYPE_CLOCK_SOURCE: bytes_dissected += dissect_ac_if_clock_source(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AC_SUBTYPE_CLOCK_SELECTOR: bytes_dissected += dissect_ac_if_clock_selector(tvb, offset, pinfo, desc_tree, usb_conv_info); break; default: break; } } else if (desc_type==CS_INTERFACE && usb_conv_info->interfaceSubclass==AUDIO_IF_SUBCLASS_AUDIOSTREAMING) { desc_tree = proto_tree_add_subtree(tree, tvb, offset, desc_len, ett_usb_audio_desc, &desc_tree_item, "Class-specific Audio Streaming Interface Descriptor"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &aud_descriptor_type_vals_ext); offset += 2; desc_subtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_as_if_desc_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); subtype_str = try_val_to_str_ext(desc_subtype, &as_subtype_vals_ext); if (subtype_str) proto_item_append_text(desc_tree_item, ": %s", subtype_str); offset++; bytes_dissected = offset; switch(desc_subtype) { case AS_SUBTYPE_GENERAL: bytes_dissected += dissect_as_if_general_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case AS_SUBTYPE_FORMAT_TYPE: bytes_dissected += dissect_as_if_format_type_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; default: break; } } /* there are no class-specific endpoint descriptors for audio control */ else if (desc_type == CS_ENDPOINT && usb_conv_info->interfaceSubclass==AUDIO_IF_SUBCLASS_AUDIOSTREAMING) { desc_tree = proto_tree_add_subtree(tree, tvb, offset, desc_len, ett_usb_audio_desc, &desc_tree_item, "Class-specific Audio Streaming Endpoint Descriptor"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &aud_descriptor_type_vals_ext); offset += 2; desc_subtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_as_ep_desc_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; bytes_dissected = offset; switch(desc_subtype) { case AS_EP_SUBTYPE_GENERAL: bytes_dissected += dissect_as_ep_general_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; default: break; } } else if (desc_type==CS_INTERFACE && usb_conv_info->interfaceSubclass==AUDIO_IF_SUBCLASS_MIDISTREAMING) { desc_tree = proto_tree_add_subtree(tree, tvb, offset, desc_len, ett_usb_audio_desc, &desc_tree_item, "Class-specific MIDI Streaming Interface Descriptor"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &aud_descriptor_type_vals_ext); offset += 2; desc_subtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_ms_if_desc_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); subtype_str = try_val_to_str_ext(desc_subtype, &ms_if_subtype_vals_ext); if (subtype_str) proto_item_append_text(desc_tree_item, ": %s", subtype_str); offset++; bytes_dissected = offset; switch(desc_subtype) { case MS_IF_SUBTYPE_HEADER: bytes_dissected += dissect_ms_if_hdr_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case MS_IF_SUBTYPE_MIDI_IN_JACK: bytes_dissected += dissect_ms_if_midi_in_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; case MS_IF_SUBTYPE_MIDI_OUT_JACK: bytes_dissected += dissect_ms_if_midi_out_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; default: break; } } else if (desc_type==CS_ENDPOINT && usb_conv_info->interfaceSubclass==AUDIO_IF_SUBCLASS_MIDISTREAMING) { desc_tree = proto_tree_add_subtree(tree, tvb, offset, desc_len, ett_usb_audio_desc, &desc_tree_item, "Class-specific MIDI Streaming Endpoint Descriptor"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &aud_descriptor_type_vals_ext); offset += 2; desc_subtype = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_ms_ep_desc_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; bytes_dissected = offset; switch(desc_subtype) { case MS_EP_SUBTYPE_GENERAL: bytes_dissected += dissect_ms_ep_general_body(tvb, offset, pinfo, desc_tree, usb_conv_info); break; default: break; } } else return 0; if (bytes_dissected < desc_len) { proto_tree_add_expert(desc_tree, pinfo, &ei_usb_audio_undecoded, tvb, bytes_dissected, desc_len-bytes_dissected); } return desc_len; } /* dissector for usb midi bulk data */ static int dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { usb_conv_info_t *usb_conv_info; gint offset, length; gint i; /* Reject the packet if data is NULL */ if (data == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBAUDIO"); length = tvb_reported_length(tvb); offset = 0; switch (usb_conv_info->interfaceSubclass) { case AUDIO_IF_SUBCLASS_MIDISTREAMING: col_set_str(pinfo->cinfo, COL_INFO, "USB-MIDI Event Packets"); for (i = 0; i < length / 4; i++) { dissect_usb_midi_event(tvb, pinfo, parent_tree, offset); offset += 4; } break; default: proto_tree_add_expert(parent_tree, pinfo, &ei_usb_audio_undecoded, tvb, offset, length); } return length; } void proto_register_usb_audio(void) { static hf_register_info hf[] = { { &hf_midi_cable_number, { "Cable Number", "usbaudio.midi.cable_number", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }}, { &hf_midi_code_index, { "Code Index", "usbaudio.midi.code_index", FT_UINT8, BASE_HEX, VALS(code_index_vals), 0x0F, NULL, HFILL }}, { &hf_midi_event, { "MIDI Event", "usbaudio.midi.event", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_midi_padding, { "Padding", "usbaudio.midi.padding", FT_BYTES, BASE_NONE, NULL, 0x0, "Must be zero", HFILL }}, { &hf_ac_if_desc_subtype, { "Subtype", "usbaudio.ac_if_subtype", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ac_subtype_vals_ext, 0x0, "bDescriptorSubtype", HFILL }}, { &hf_ac_if_hdr_ver, { "Version", "usbaudio.ac_if_hdr.bcdADC", FT_DOUBLE, BASE_NONE, NULL, 0, "bcdADC", HFILL }}, { &hf_ac_if_hdr_total_len, { "Total length", "usbaudio.ac_if_hdr.wTotalLength", FT_UINT16, BASE_DEC, NULL, 0x0, "wTotalLength", HFILL }}, { &hf_ac_if_hdr_bInCollection, { "Total number of interfaces", "usbaudio.ac_if_hdr.bInCollection", FT_UINT8, BASE_DEC, NULL, 0x0, "bInCollection", HFILL }}, { &hf_ac_if_hdr_if_num, { "Interface number", "usbaudio.ac_if_hdr.baInterfaceNr", FT_UINT8, BASE_DEC, NULL, 0x0, "baInterfaceNr", HFILL }}, { &hf_ac_if_hdr_category, { "Category", "usbaudio.ac_if_hdr.bCategory", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &audio_function_categories_vals_ext, 0x00, "bCategory", HFILL }}, { &hf_ac_if_hdr_controls, { "Controls", "usbaudio.ac_if_hdr.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_hdr_controls_latency, { "Latency Control", "usbaudio.ac_if_hdr.bmControls.latency", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x03, NULL, HFILL }}, { &hf_ac_if_hdr_controls_rsv, { "Reserved", "usbaudio.ac_if_hdr.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xFC, "Must be zero", HFILL }}, { &hf_ac_if_input_terminalid, { "Terminal ID", "usbaudio.ac_if_input.bTerminalID", FT_UINT8, BASE_DEC, NULL, 0x0, "bTerminalID", HFILL }}, { &hf_ac_if_input_terminaltype, { "Terminal Type", "usbaudio.ac_if_input.wTerminalType", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &terminal_types_vals_ext, 0x00, "wTerminalType", HFILL }}, { &hf_ac_if_input_assocterminal, { "Assoc Terminal", "usbaudio.ac_if_input.bAssocTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "bAssocTerminal", HFILL }}, { &hf_ac_if_input_csourceid, { "Connected Clock Entity", "usbaudio.ac_if_input.bCSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "bCSourceID", HFILL }}, { &hf_ac_if_input_nrchannels, { "Number Channels", "usbaudio.ac_if_input.bNrChannels", FT_UINT8, BASE_DEC, NULL, 0x0, "bNrChannels", HFILL }}, { &hf_ac_if_input_wchannelconfig, { "Channel Config", "usbaudio.ac_if_input.wChannelConfig", FT_UINT16, BASE_HEX, NULL, 0x0, "wChannelConfig", HFILL }}, { &hf_ac_if_input_wchannelconfig_d0, { "Left Front", "usbaudio.ac_if_input.wChannelConfig.d0", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d1, { "Right Front", "usbaudio.ac_if_input.wChannelConfig.d1", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d2, { "Center Front", "usbaudio.ac_if_input.wChannelConfig.d2", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d3, { "Low Frequency Enhancement", "usbaudio.ac_if_input.wChannelConfig.d3", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d4, { "Left Surround", "usbaudio.ac_if_input.wChannelConfig.d4", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d5, { "Right Surround", "usbaudio.ac_if_input.wChannelConfig.d5", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d6, { "Left of Center", "usbaudio.ac_if_input.wChannelConfig.d6", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d7, { "Right of Center", "usbaudio.ac_if_input.wChannelConfig.d7", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d8, { "Surround", "usbaudio.ac_if_input.wChannelConfig.d8", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d9, { "Side Left", "usbaudio.ac_if_input.wChannelConfig.d9", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d10, { "Side Right", "usbaudio.ac_if_input.wChannelConfig.d10", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_d11, { "Top", "usbaudio.ac_if_input.wChannelConfig.d11", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }}, { &hf_ac_if_input_wchannelconfig_rsv, { "Reserved", "usbaudio.ac_if_input.wChannelConfig.rsv", FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig, { "Channel Config", "usbaudio.ac_if_input.bmChannelConfig", FT_UINT32, BASE_HEX, NULL, 0x0, "bmChannelConfig", HFILL }}, { &hf_ac_if_input_bmchannelconfig_d0, { "Front Left", "usbaudio.ac_if_input.bmChannelConfig.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d1, { "Front Right", "usbaudio.ac_if_input.bmChannelConfig.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d2, { "Front Center", "usbaudio.ac_if_input.bmChannelConfig.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d3, { "Low Frequency Effects", "usbaudio.ac_if_input.bmChannelConfig.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d4, { "Back Left", "usbaudio.ac_if_input.bmChannelConfig.d4", FT_BOOLEAN, 32, NULL, (1u << 4), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d5, { "Back Right", "usbaudio.ac_if_input.bmChannelConfig.d5", FT_BOOLEAN, 32, NULL, (1u << 5), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d6, { "Front Left of Center", "usbaudio.ac_if_input.bmChannelConfig.d6", FT_BOOLEAN, 32, NULL, (1u << 6), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d7, { "Front Right of Center", "usbaudio.ac_if_input.bmChannelConfig.d7", FT_BOOLEAN, 32, NULL, (1u << 7), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d8, { "Back Center", "usbaudio.ac_if_input.bmChannelConfig.d8", FT_BOOLEAN, 32, NULL, (1u << 8), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d9, { "Side Left", "usbaudio.ac_if_input.bmChannelConfig.d9", FT_BOOLEAN, 32, NULL, (1u << 9), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d10, { "Side Right", "usbaudio.ac_if_input.bmChannelConfig.d10", FT_BOOLEAN, 32, NULL, (1u << 10), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d11, { "Top Center", "usbaudio.ac_if_input.bmChannelConfig.d11", FT_BOOLEAN, 32, NULL, (1u << 11), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d12, { "Top Front Left", "usbaudio.ac_if_input.bmChannelConfig.d12", FT_BOOLEAN, 32, NULL, (1u << 12), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d13, { "Top Front Center", "usbaudio.ac_if_input.bmChannelConfig.d13", FT_BOOLEAN, 32, NULL, (1u << 13), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d14, { "Top Front Right", "usbaudio.ac_if_input.bmChannelConfig.d14", FT_BOOLEAN, 32, NULL, (1u << 14), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d15, { "Top Back Left", "usbaudio.ac_if_input.bmChannelConfig.d15", FT_BOOLEAN, 32, NULL, (1u << 15), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d16, { "Top Back Center", "usbaudio.ac_if_input.bmChannelConfig.d16", FT_BOOLEAN, 32, NULL, (1u << 16), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d17, { "Top Back Right", "usbaudio.ac_if_input.bmChannelConfig.d17", FT_BOOLEAN, 32, NULL, (1u << 17), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d18, { "Top Front Left of Center", "usbaudio.ac_if_input.bmChannelConfig.d18", FT_BOOLEAN, 32, NULL, (1u << 18), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d19, { "Top Front Right of Center", "usbaudio.ac_if_input.bmChannelConfig.d19", FT_BOOLEAN, 32, NULL, (1u << 19), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d20, { "Left Low Frequency Effects", "usbaudio.ac_if_input.bmChannelConfig.d20", FT_BOOLEAN, 32, NULL, (1u << 20), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d21, { "Right Low Frequency Effects", "usbaudio.ac_if_input.bmChannelConfig.d21", FT_BOOLEAN, 32, NULL, (1u << 21), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d22, { "Top Side Left", "usbaudio.ac_if_input.bmChannelConfig.d22", FT_BOOLEAN, 32, NULL, (1u << 22), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d23, { "Top Side Right", "usbaudio.ac_if_input.bmChannelConfig.d23", FT_BOOLEAN, 32, NULL, (1u << 23), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d24, { "Bottom Center", "usbaudio.ac_if_input.bmChannelConfig.d24", FT_BOOLEAN, 32, NULL, (1u << 24), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d25, { "Back Left of Center", "usbaudio.ac_if_input.bmChannelConfig.d25", FT_BOOLEAN, 32, NULL, (1u << 25), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d26, { "Back Right of Center", "usbaudio.ac_if_input.bmChannelConfig.d26", FT_BOOLEAN, 32, NULL, (1u << 26), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_rsv, { "Reserved", "usbaudio.ac_if_input.bmChannelConfig.rsv", FT_BOOLEAN, 32, NULL, (0xFu << 27), NULL, HFILL }}, { &hf_ac_if_input_bmchannelconfig_d31, { "Raw Data", "usbaudio.ac_if_input.bmChannelConfig.d31", FT_BOOLEAN, 32, NULL, (1u << 31), NULL, HFILL }}, { &hf_ac_if_input_channelnames, { "Channel Names", "usbaudio.ac_if_input.iChannelNames", FT_UINT8, BASE_DEC, NULL, 0x0, "iChannelNames", HFILL }}, { &hf_ac_if_input_controls, { "Controls", "usbaudio.ac_if_input.bmControls", FT_UINT16, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_input_controls_copy, { "Copy Protect Control", "usbaudio.ac_if_input.bmControls.copy", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0003, NULL, HFILL }}, { &hf_ac_if_input_controls_connector, { "Connector Control", "usbaudio.ac_if_input.bmControls.connector", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x000C, NULL, HFILL }}, { &hf_ac_if_input_controls_overload, { "Overload Control", "usbaudio.ac_if_input.bmControls.overload", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0030, NULL, HFILL }}, { &hf_ac_if_input_controls_cluster, { "Cluster Control", "usbaudio.ac_if_input.bmControls.cluster", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x00C0, NULL, HFILL }}, { &hf_ac_if_input_controls_underflow, { "Underflow Control", "usbaudio.ac_if_input.bmControls.underflow", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0300, NULL, HFILL }}, { &hf_ac_if_input_controls_overflow, { "Overflow Control", "usbaudio.ac_if_input.bmControls.overflow", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0C00, NULL, HFILL }}, { &hf_ac_if_input_controls_rsv, { "Reserved", "usbaudio.ac_if_input.bmControls.rsv", FT_UINT16, BASE_HEX, NULL, 0xF000, "Must be zero", HFILL }}, { &hf_ac_if_input_terminal, { "String descriptor index", "usbaudio.ac_if_input.iTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "iTerminal", HFILL }}, { &hf_ac_if_output_terminalid, { "Terminal ID", "usbaudio.ac_if_output.bTerminalID", FT_UINT8, BASE_DEC, NULL, 0x0, "bTerminalID", HFILL }}, { &hf_ac_if_output_terminaltype, { "Terminal Type", "usbaudio.ac_if_output.wTerminalType", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &terminal_types_vals_ext, 0x00, "wTerminalType", HFILL }}, { &hf_ac_if_output_assocterminal, { "Assoc Terminal", "usbaudio.ac_if_output.bAssocTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "bAssocTerminal", HFILL }}, { &hf_ac_if_output_sourceid, { "Source ID", "usbaudio.ac_if_output.bSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "bSourceID", HFILL }}, { &hf_ac_if_output_clk_sourceid, { "Connected Clock Entity", "usbaudio.ac_if_output.bCSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "bCSourceID", HFILL }}, { &hf_ac_if_output_controls, { "Controls", "usbaudio.ac_if_output.bmControls", FT_UINT16, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_output_controls_copy, { "Copy Protect Control", "usbaudio.ac_if_output.bmControls.copy", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0003, NULL, HFILL }}, { &hf_ac_if_output_controls_connector, { "Connector Control", "usbaudio.ac_if_output.bmControls.connector", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x000C, NULL, HFILL }}, { &hf_ac_if_output_controls_overload, { "Overload Control", "usbaudio.ac_if_output.bmControls.overload", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0030, NULL, HFILL }}, { &hf_ac_if_output_controls_underflow, { "Underflow Control", "usbaudio.ac_if_output.bmControls.underflow", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x00C0, NULL, HFILL }}, { &hf_ac_if_output_controls_overflow, { "Overflow Control", "usbaudio.ac_if_output.bmControls.overflow", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0300, NULL, HFILL }}, { &hf_ac_if_output_controls_rsv, { "Reserved", "usbaudio.ac_if_output.bmControls.rsv", FT_UINT16, BASE_HEX, NULL, 0xFC00, "Must be zero", HFILL }}, { &hf_ac_if_output_terminal, { "String descriptor index", "usbaudio.ac_if_output.iTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "iTerminal", HFILL }}, { &hf_ac_if_fu_unitid, { "Unit ID", "usbaudio.ac_if_fu.bUnitID", FT_UINT8, BASE_DEC, NULL, 0x0, "bUnitID", HFILL }}, { &hf_ac_if_fu_sourceid, { "Source ID", "usbaudio.ac_if_fu.bSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "bSourceID", HFILL }}, { &hf_ac_if_fu_controlsize, { "Control Size", "usbaudio.ac_if_fu.bControlSize", FT_UINT8, BASE_DEC, NULL, 0x0, "bControlSize", HFILL }}, { &hf_ac_if_fu_controls, { "Controls", "usbaudio.ac_if_fu.bmaControls", FT_BYTES, BASE_NONE, NULL, 0x0, "bmaControls", HFILL }}, { &hf_ac_if_fu_control, { "Control", "usbaudio.ac_if_fu.bmaControl", FT_UINT8, BASE_HEX, NULL, 0x0, "bmaControls", HFILL }}, { &hf_ac_if_fu_controls_d0, { "Mute", "usbaudio.ac_if_fu.bmaControls.d0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_ac_if_fu_controls_d1, { "Volume", "usbaudio.ac_if_fu.bmaControls.d1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_ac_if_fu_controls_d2, { "Bass", "usbaudio.ac_if_fu.bmaControls.d2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_ac_if_fu_controls_d3, { "Mid", "usbaudio.ac_if_fu.bmaControls.d3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_ac_if_fu_controls_d4, { "Treble", "usbaudio.ac_if_fu.bmaControls.d4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_ac_if_fu_controls_d5, { "Graphic Equalizer", "usbaudio.ac_if_fu.bmaControls.d5", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_ac_if_fu_controls_d6, { "Automatic Gain", "usbaudio.ac_if_fu.bmaControls.d6", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_ac_if_fu_controls_d7, { "Delay", "usbaudio.ac_if_fu.bmaControls.d7", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_ac_if_fu_controls_d8, { "Bass Boost", "usbaudio.ac_if_fu.bmaControls.d8", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_ac_if_fu_controls_d9, { "Loudness", "usbaudio.ac_if_fu.bmaControls.d9", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_ac_if_fu_controls_rsv, { "Reserved", "usbaudio.ac_if_fu.bmaControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xFC, "Must be zero", HFILL }}, { &hf_ac_if_fu_controls_v2, { "Controls", "usbaudio.ac_if_fu.bmaControls_v2", FT_BYTES, BASE_NONE, NULL, 0x0, "bmaControls", HFILL }}, { &hf_ac_if_fu_control_v2, { "Control", "usbaudio.ac_if_fu.bmaControl_v2", FT_UINT32, BASE_HEX, NULL, 0x0, "bmaControls", HFILL }}, { &hf_ac_if_fu_controls_v2_d0, { "Mute", "usbaudio.ac_if_fu.bmaControls_v2.d0", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 0), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d1, { "Volume", "usbaudio.ac_if_fu.bmaControls_v2.d1", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 2), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d2, { "Bass", "usbaudio.ac_if_fu.bmaControls_v2.d2", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 4), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d3, { "Mid", "usbaudio.ac_if_fu.bmaControls_v2.d3", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 6), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d4, { "Treble", "usbaudio.ac_if_fu.bmaControls_v2.d4", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 8), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d5, { "Graphic Equalizer", "usbaudio.ac_if_fu.bmaControls_v2.d5", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 10), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d6, { "Automatic Gain", "usbaudio.ac_if_fu.bmaControls_v2.d6", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 12), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d7, { "Delay", "usbaudio.ac_if_fu.bmaControl_v2s.d7", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 14), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d8, { "Bass Boost", "usbaudio.ac_if_fu.bmaControls_v2.d8", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 16), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d9, { "Loudness", "usbaudio.ac_if_fu.bmaControls_v2.d9", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 18), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d10, { "Input Gain", "usbaudio.ac_if_fu.bmaControls_v2.d10", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 20), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d11, { "Input Gain Pad", "usbaudio.ac_if_fu.bmaControls_v2.d11", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 22), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d12, { "Phase Inverter", "usbaudio.ac_if_fu.bmaControls_v2.d12", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 24), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d13, { "Underflow", "usbaudio.ac_if_fu.bmaControls_v2.d13", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 26), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_d14, { "Overflow", "usbaudio.ac_if_fu.bmaControls_v2.d14", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, (3u << 28), NULL, HFILL }}, { &hf_ac_if_fu_controls_v2_rsv, { "Reserved", "usbaudio.ac_if_fu.bmaControls_v2.rsv", FT_UINT32, BASE_HEX, NULL, (3u << 30), "Must be zero", HFILL }}, { &hf_ac_if_fu_ifeature, { "Feature", "usbaudio.ac_if_fu.iFeature", FT_UINT8, BASE_DEC, NULL, 0x0, "iFeature", HFILL }}, { &hf_ac_if_su_unitid, { "Unit ID", "usbaudio.ac_if_su.bUnitID", FT_UINT8, BASE_DEC, NULL, 0x0, "bUnitID", HFILL }}, { &hf_ac_if_su_nrinpins, { "Input Pins", "usbaudio.ac_if_su.bNrInPins", FT_UINT8, BASE_DEC, NULL, 0x0, "bNrInPins", HFILL }}, { &hf_ac_if_su_sourceids, { "Source IDs", "usbaudio.ac_if_su.baSourceIDs", FT_BYTES, BASE_NONE, NULL, 0x0, "baSourceIDs", HFILL }}, { &hf_ac_if_su_sourceid, { "Source ID", "usbaudio.ac_if_su.baSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "baSourceID", HFILL}}, { &hf_ac_if_su_controls, { "Controls", "usbaudio.ac_if_su.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL}}, { &hf_ac_if_su_controls_d0, { "Selector Control", "usbaudio.ac_if_su.bmControls.d0", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x03, NULL, HFILL}}, { &hf_ac_if_su_controls_rsv, { "Reserved", "usbaudio.ac_if_su.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xFC, "Must be zero", HFILL}}, { &hf_ac_if_su_iselector, { "Selector Index", "usbaudio.ac_if_su.iSelector", FT_UINT8, BASE_DEC, NULL, 0x0, "iSelector", HFILL }}, { &hf_ac_if_mu_unitid, { "Unit ID", "usbaudio.ac_if_mu.bUnitID", FT_UINT8, BASE_DEC, NULL, 0x0, "bUnitID", HFILL }}, { &hf_ac_if_mu_nrinpins, { "Number In Pins", "usbaudio.ac_if_mu.bNrInPins", FT_UINT8, BASE_DEC, NULL, 0x0, "bNrInPins", HFILL }}, { &hf_ac_if_mu_sourceid, { "Source ID", "usbaudio.ac_if_mu.baSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "baSourceID", HFILL }}, { &hf_ac_if_mu_nrchannels, { "Number Channels", "usbaudio.ac_if_mu.bNrChannels", FT_UINT8, BASE_DEC, NULL, 0x0, "bNrChannels", HFILL }}, { &hf_ac_if_mu_channelconfig, { "Channel Config", "usbaudio.ac_if_mu.wChannelConfig", FT_UINT16, BASE_HEX, NULL, 0x0, "wChannelConfig", HFILL }}, { &hf_ac_if_mu_channelconfig_d0, { "Left Front", "usbaudio.ac_if_mu.wChannelConfig.d0", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d1, { "Right Front", "usbaudio.ac_if_mu.wChannelConfig.d1", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d2, { "Center Front", "usbaudio.ac_if_mu.wChannelConfig.d2", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d3, { "Low Frequency Enhancement", "usbaudio.ac_if_mu.wChannelConfig.d3", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d4, { "Left Surround", "usbaudio.ac_if_mu.wChannelConfig.d4", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d5, { "Right Surround", "usbaudio.ac_if_mu.wChannelConfig.d5", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d6, { "Left of Center", "usbaudio.ac_if_mu.wChannelConfig.d6", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d7, { "Right of Center", "usbaudio.ac_if_mu.wChannelConfig.d7", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d8, { "Surround", "usbaudio.ac_if_mu.wChannelConfig.d8", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d9, { "Side Left", "usbaudio.ac_if_mu.wChannelConfig.d9", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d10, { "Side Right", "usbaudio.ac_if_mu.wChannelConfig.d10", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_d11, { "Top", "usbaudio.ac_if_mu.wChannelConfig.d11", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }}, { &hf_ac_if_mu_channelconfig_rsv, { "Reserved", "usbaudio.ac_if_mu.wChannelConfig.rsv", FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL }}, { &hf_ac_if_mu_channelnames, { "Channel Names", "usbaudio.ac_if_mu.iChannelNames", FT_UINT8, BASE_DEC, NULL, 0x0, "iChannelNames", HFILL }}, { &hf_ac_if_mu_controls, { "Controls", "usbaudio.ac_if_mu.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_mu_imixer, { "Mixer", "usbaudio.ac_if_mu.iMixer", FT_UINT8, BASE_DEC, NULL, 0x0, "iMixer", HFILL }}, { &hf_ac_if_clksrc_id, { "Clock Source Entity", "usbaudio.ac_if_clksrc.bClockID", FT_UINT8, BASE_DEC, NULL, 0x0, "bClockID", HFILL }}, { &hf_ac_if_clksrc_attr, { "Attributes", "usbaudio.ac_if_clksrc.bmAttributes", FT_UINT8, BASE_HEX, NULL, 0x0, "bmAttributes", HFILL }}, { &hf_ac_if_clksrc_attr_type, { "Type", "usbaudio.ac_if_clksrc.bmAttributes.type", FT_UINT8, BASE_HEX, VALS(clock_types_vals), 0x03, NULL, HFILL }}, { &hf_ac_if_clksrc_attr_d2, { "Synchronization", "usbaudio.ac_if_clksrc.bmAttributes.d2", FT_UINT8, BASE_HEX, VALS(clock_sync_vals), 0x04, NULL, HFILL }}, { &hf_ac_if_clksrc_attr_rsv, { "Reserved", "usbaudio.ac_if_clksrc.bmAttributes.rsv", FT_UINT8, BASE_HEX, NULL, 0xF8, "Must be zero", HFILL }}, { &hf_ac_if_clksrc_controls, { "Controls", "usbaudio.ac_if_clksrc.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_clksrc_controls_freq, { "Clock Frequency Control", "usbaudio.ac_if_clksrc.bmControls.freq", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x03, NULL, HFILL }}, { &hf_ac_if_clksrc_controls_validity, { "Clock Validity Control", "usbaudio.ac_if_clksrc.bmControls.validity", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x0C, NULL, HFILL }}, { &hf_ac_if_clksrc_controls_rsv, { "Reserved", "usbaudio.ac_if_clksrc.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xF0, "Must be zero", HFILL }}, { &hf_ac_if_clksrc_assocterminal, { "Terminal", "usbaudio.ac_if_clksrc.bAssocTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "bAssocTerminal", HFILL }}, { &hf_ac_if_clksrc_clocksource, { "String descriptor index", "usbaudio.ac_if_clksrc.iClockSource", FT_UINT8, BASE_DEC, NULL, 0x0, "iClockSource", HFILL }}, { &hf_ac_if_clksel_id, { "Clock Selector Entity", "usbaudio.ac_if_clksel.bClockID", FT_UINT8, BASE_DEC, NULL, 0x0, "bClockID", HFILL }}, { &hf_ac_if_clksel_nrpins, { "Number of Input Pins", "usbaudio.ac_if_clksel.bNrInPins", FT_UINT8, BASE_DEC, NULL, 0x0, "bNrInPins", HFILL }}, { &hf_ac_if_clksel_sourceid, { "Connected Clock Entity", "usbaudio.ac_if_clksel.baCSourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "baCSourceID", HFILL }}, { &hf_ac_if_clksel_controls, { "Controls", "usbaudio.ac_if_clksel.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_ac_if_clksel_controls_clksel, { "Clock Selector Control", "usbaudio.ac_if_clksel.bmControls.clksel", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_vals_ext, 0x03, NULL, HFILL }}, { &hf_ac_if_clksel_controls_rsv, { "Reserved", "usbaudio.ac_if_clksel.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xFC, "Must be zero", HFILL }}, { &hf_ac_if_clksel_clockselector, { "String descriptor index", "usbaudio.ac_if_clksel.iClockSelector", FT_UINT8, BASE_DEC, NULL, 0x0, "iClockSelector", HFILL }}, { &hf_as_if_desc_subtype, { "Subtype", "usbaudio.as_if_subtype", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &as_subtype_vals_ext, 0x0, "bDescriptorSubtype", HFILL }}, { &hf_as_if_gen_term_link, { "Connected Terminal ID", "usbaudio.as_if_gen.bTerminalLink", FT_UINT8, BASE_DEC, NULL, 0x0, "bTerminalLink", HFILL }}, { &hf_as_if_gen_delay, { "Interface delay in frames", "usbaudio.as_if_gen.bDelay", FT_UINT8, BASE_DEC, NULL, 0x0, "bDelay", HFILL }}, { &hf_as_if_gen_wformattag, { "Format", "usbaudio.as_if_gen.wFormatTag", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &audio_data_format_tag_vals_ext, 0x0, "wFormatTag", HFILL }}, { &hf_as_if_gen_controls, { "Controls", "usbaudio.as_if_gen.bmControls", FT_UINT8, BASE_HEX, NULL, 0x0, "bmControls", HFILL }}, { &hf_as_if_gen_controls_active, { "Active Alternate Setting Control", "usbaudio.as_if_gen.bmControls.active", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_read_only_vals_ext, 0x03, NULL, HFILL }}, { &hf_as_if_gen_controls_valid, { "Valid Alternate Settings Control", "usbaudio.as_if_gen.bmControls.valid", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_read_only_vals_ext, 0x0C, NULL, HFILL }}, { &hf_as_if_gen_controls_rsv, { "Reserved", "usbaudio.as_if_gen.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xF0, "Must be zero", HFILL }}, { &hf_as_if_gen_formattype, { "Format Type", "usbaudio.as_if_gen.bFormatType", FT_UINT8, BASE_DEC, NULL, 0x0, "bFormatType", HFILL }}, { &hf_as_if_gen_formats, { "Formats", "usbaudio.as_if_gen.bmFormats", FT_UINT32, BASE_HEX, NULL, 0x0, "bmFormats", HFILL }}, { &hf_as_if_gen_formats_i_d0, { "PCM", "usbaudio.as_if_gen.bmFormats.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_if_gen_formats_i_d1, { "PCM8", "usbaudio.as_if_gen.bmFormats.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_if_gen_formats_i_d2, { "IEEE Float", "usbaudio.as_if_gen.bmFormats.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_as_if_gen_formats_i_d3, { "ALAW", "usbaudio.as_if_gen.bmFormats.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_as_if_gen_formats_i_d4, { "MULAW", "usbaudio.as_if_gen.bmFormats.d4", FT_BOOLEAN, 32, NULL, (1u << 4), NULL, HFILL }}, { &hf_as_if_gen_formats_i_rsv, { "Reserved", "usbaudio.as_if_gen.bmFormats.rsv", FT_UINT32, BASE_HEX, NULL, (0x7FFFFFE0u), "Must be zero", HFILL }}, { &hf_as_if_gen_formats_i_d31, { "Type I Raw Data", "usbaudio.as_if_gen.bmFormats.d31", FT_BOOLEAN, 32, NULL, (1u << 31), NULL, HFILL }}, { &hf_as_if_gen_formats_ii_d0, { "MPEG", "usbaudio.as_if_gen.bmFormats.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_if_gen_formats_ii_d1, { "AC-3", "usbaudio.as_if_gen.bmFormats.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_if_gen_formats_ii_d2, { "WMA", "usbaudio.as_if_gen.bmFormats.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_as_if_gen_formats_ii_d3, { "DTS", "usbaudio.as_if_gen.bmFormats.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_as_if_gen_formats_ii_rsv, { "Reserved", "usbaudio.as_if_gen.bmFormats.rsv", FT_UINT32, BASE_HEX, NULL, (0x7FFFFFF0u), "Must be zero", HFILL }}, { &hf_as_if_gen_formats_ii_d31, { "Type II Raw Data", "usbaudio.as_if_gen.bmFormats.d31", FT_BOOLEAN, 32, NULL, (1u << 31), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d0, { "IEC61937 AC-3", "usbaudio.as_if_gen.bmFormats.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d1, { "IEC61937 MPEG-1 Layer1", "usbaudio.as_if_gen.bmFormats.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d2, { "IEC61937 MPEG-1 Layer2/3 or IEC61937 MPEG-2 NOEXT", "usbaudio.as_if_gen.bmFormats.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d3, { "IEC61937 MPEG-2 EXT", "usbaudio.as_if_gen.bmFormats.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d4, { "IEC61937 MPEG-2 AAC ADTS", "usbaudio.as_if_gen.bmFormats.d4", FT_BOOLEAN, 32, NULL, (1u << 4), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d5, { "IEC61937 MPEG-2 Layer1 LS", "usbaudio.as_if_gen.bmFormats.d5", FT_BOOLEAN, 32, NULL, (1u << 5), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d6, { "IEC61937 MPEG-2 Layer2/3 LS", "usbaudio.as_if_gen.bmFormats.d6", FT_BOOLEAN, 32, NULL, (1u << 6), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d7, { "IEC61937 DTS-I", "usbaudio.as_if_gen.bmFormats.d7", FT_BOOLEAN, 32, NULL, (1u << 7), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d8, { "IEC61937 DTS-II", "usbaudio.as_if_gen.bmFormats.d8", FT_BOOLEAN, 32, NULL, (1u << 8), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d9, { "IEC61937 DTS-III", "usbaudio.as_if_gen.bmFormats.d9", FT_BOOLEAN, 32, NULL, (1u << 9), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d10, { "IEC61937 ATRAC", "usbaudio.as_if_gen.bmFormats.d10", FT_BOOLEAN, 32, NULL, (1u << 10), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d11, { "IEC61937 ATRAC2/3", "usbaudio.as_if_gen.bmFormats.d11", FT_BOOLEAN, 32, NULL, (1u << 11), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_d12, { "Type III WMA", "usbaudio.as_if_gen.bmFormats.d12", FT_BOOLEAN, 32, NULL, (1u << 12), NULL, HFILL }}, { &hf_as_if_gen_formats_iii_rsv, { "Reserved", "usbaudio.as_if_gen.bmFormats.rsv", FT_UINT32, BASE_HEX, NULL, (0xFFFFE000u), "Must be zero", HFILL }}, { &hf_as_if_gen_formats_iv_d0, { "PCM", "usbaudio.as_if_gen.bmFormats.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d1, { "PCM8", "usbaudio.as_if_gen.bmFormats.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d2, { "IEEE Float", "usbaudio.as_if_gen.bmFormats.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d3, { "ALAW", "usbaudio.as_if_gen.bmFormats.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d4, { "MULAW", "usbaudio.as_if_gen.bmFormats.d4", FT_BOOLEAN, 32, NULL, (1u << 4), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d5, { "MPEG", "usbaudio.as_if_gen.bmFormats.d5", FT_BOOLEAN, 32, NULL, (1u << 5), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d6, { "AC-3", "usbaudio.as_if_gen.bmFormats.d6", FT_BOOLEAN, 32, NULL, (1u << 6), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d7, { "WMA", "usbaudio.as_if_gen.bmFormats.d7", FT_BOOLEAN, 32, NULL, (1u << 7), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d8, { "IEC61937 AC-3", "usbaudio.as_if_gen.bmFormats.d8", FT_BOOLEAN, 32, NULL, (1u << 8), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d9, { "IEC61937 MPEG-1 Layer1", "usbaudio.as_if_gen.bmFormats.d9", FT_BOOLEAN, 32, NULL, (1u << 9), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d10, { "IEC61937 MPEG-1 Layer2/3 or IEC61937 MPEG-2 NOEXT", "usbaudio.as_if_gen.bmFormats.d10", FT_BOOLEAN, 32, NULL, (1u << 10), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d11, { "IEC61937 MPEG-2 EXT", "usbaudio.as_if_gen.bmFormats.d11", FT_BOOLEAN, 32, NULL, (1u << 11), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d12, { "IEC61937 MPEG-2 AAC ADTS", "usbaudio.as_if_gen.bmFormats.d12", FT_BOOLEAN, 32, NULL, (1u << 12), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d13, { "IEC61937 MPEG-2 Layer1 LS", "usbaudio.as_if_gen.bmFormats.d13", FT_BOOLEAN, 32, NULL, (1u << 13), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d14, { "IEC61937 MPEG-2 Layer2/3 LS", "usbaudio.as_if_gen.bmFormats.d14", FT_BOOLEAN, 32, NULL, (1u << 14), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d15, { "IEC61937 DTS-I", "usbaudio.as_if_gen.bmFormats.d15", FT_BOOLEAN, 32, NULL, (1u << 15), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d16, { "IEC61937 DTS-II", "usbaudio.as_if_gen.bmFormats.d16", FT_BOOLEAN, 32, NULL, (1u << 16), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d17, { "IEC61937 DTS-III", "usbaudio.as_if_gen.bmFormats.d17", FT_BOOLEAN, 32, NULL, (1u << 17), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d18, { "IEC61937 ATRAC", "usbaudio.as_if_gen.bmFormats.d18", FT_BOOLEAN, 32, NULL, (1u << 18), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d19, { "IEC61937 ATRAC2/3", "usbaudio.as_if_gen.bmFormats.d19", FT_BOOLEAN, 32, NULL, (1u << 19), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d20, { "Type III WMA", "usbaudio.as_if_gen.bmFormats.d20", FT_BOOLEAN, 32, NULL, (1u << 20), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_d21, { "IEC60958 PCM", "usbaudio.as_if_gen.bmFormats.d21", FT_BOOLEAN, 32, NULL, (1u << 21), NULL, HFILL }}, { &hf_as_if_gen_formats_iv_rsv, { "Reserved", "usbaudio.as_if_gen.bmFormats.rsv", FT_UINT32, BASE_HEX, NULL, (0xFFE00000u), "Must be zero", HFILL }}, { &hf_as_if_gen_nrchannels, { "Number of channels", "usbaudio.as_if_gen.bNrChannels", FT_UINT8, BASE_DEC, NULL, 0x00, "bNrChannels", HFILL }}, { &hf_as_if_gen_bmchannelconfig, { "Channel Config", "usbaudio.as_if_gen.bmChannelConfig", FT_UINT32, BASE_HEX, NULL, 0x0, "bmChannelConfig", HFILL }}, { &hf_as_if_gen_bmchannelconfig_d0, { "Front Left", "usbaudio.as_if_gen.bmChannelConfig.d0", FT_BOOLEAN, 32, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d1, { "Front Right", "usbaudio.as_if_gen.bmChannelConfig.d1", FT_BOOLEAN, 32, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d2, { "Front Center", "usbaudio.as_if_gen.bmChannelConfig.d2", FT_BOOLEAN, 32, NULL, (1u << 2), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d3, { "Low Frequency Effects", "usbaudio.as_if_gen.bmChannelConfig.d3", FT_BOOLEAN, 32, NULL, (1u << 3), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d4, { "Back Left", "usbaudio.as_if_gen.bmChannelConfig.d4", FT_BOOLEAN, 32, NULL, (1u << 4), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d5, { "Back Right", "usbaudio.as_if_gen.bmChannelConfig.d5", FT_BOOLEAN, 32, NULL, (1u << 5), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d6, { "Front Left of Center", "usbaudio.as_if_gen.bmChannelConfig.d6", FT_BOOLEAN, 32, NULL, (1u << 6), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d7, { "Front Right of Center", "usbaudio.as_if_gen.bmChannelConfig.d7", FT_BOOLEAN, 32, NULL, (1u << 7), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d8, { "Back Center", "usbaudio.as_if_gen.bmChannelConfig.d8", FT_BOOLEAN, 32, NULL, (1u << 8), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d9, { "Side Left", "usbaudio.as_if_gen.bmChannelConfig.d9", FT_BOOLEAN, 32, NULL, (1u << 9), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d10, { "Side Right", "usbaudio.as_if_gen.bmChannelConfig.d10", FT_BOOLEAN, 32, NULL, (1u << 10), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d11, { "Top Center", "usbaudio.as_if_gen.bmChannelConfig.d11", FT_BOOLEAN, 32, NULL, (1u << 11), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d12, { "Top Front Left", "usbaudio.as_if_gen.bmChannelConfig.d12", FT_BOOLEAN, 32, NULL, (1u << 12), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d13, { "Top Front Center", "usbaudio.as_if_gen.bmChannelConfig.d13", FT_BOOLEAN, 32, NULL, (1u << 13), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d14, { "Top Front Right", "usbaudio.as_if_gen.bmChannelConfig.d14", FT_BOOLEAN, 32, NULL, (1u << 14), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d15, { "Top Back Left", "usbaudio.as_if_gen.bmChannelConfig.d15", FT_BOOLEAN, 32, NULL, (1u << 15), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d16, { "Top Back Center", "usbaudio.as_if_gen.bmChannelConfig.d16", FT_BOOLEAN, 32, NULL, (1u << 16), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d17, { "Top Back Right", "usbaudio.as_if_gen.bmChannelConfig.d17", FT_BOOLEAN, 32, NULL, (1u << 17), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d18, { "Top Front Left of Center", "usbaudio.as_if_gen.bmChannelConfig.d18", FT_BOOLEAN, 32, NULL, (1u << 18), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d19, { "Top Front Right of Center", "usbaudio.as_if_gen.bmChannelConfig.d19", FT_BOOLEAN, 32, NULL, (1u << 19), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d20, { "Left Low Frequency Effects", "usbaudio.as_if_gen.bmChannelConfig.d20", FT_BOOLEAN, 32, NULL, (1u << 20), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d21, { "Right Low Frequency Effects", "usbaudio.as_if_gen.bmChannelConfig.d21", FT_BOOLEAN, 32, NULL, (1u << 21), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d22, { "Top Side Left", "usbaudio.as_if_gen.bmChannelConfig.d22", FT_BOOLEAN, 32, NULL, (1u << 22), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d23, { "Top Side Right", "usbaudio.as_if_gen.bmChannelConfig.d23", FT_BOOLEAN, 32, NULL, (1u << 23), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d24, { "Bottom Center", "usbaudio.as_if_gen.bmChannelConfig.d24", FT_BOOLEAN, 32, NULL, (1u << 24), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d25, { "Back Left of Center", "usbaudio.as_if_gen.bmChannelConfig.d25", FT_BOOLEAN, 32, NULL, (1u << 25), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d26, { "Back Right of Center", "usbaudio.as_if_gen.bmChannelConfig.d26", FT_BOOLEAN, 32, NULL, (1u << 26), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_rsv, { "Reserved", "usbaudio.as_if_gen.bmChannelConfig.rsv", FT_BOOLEAN, 32, NULL, (0xFu << 27), NULL, HFILL }}, { &hf_as_if_gen_bmchannelconfig_d31, { "Raw Data", "usbaudio.as_if_gen.bmChannelConfig.d31", FT_BOOLEAN, 32, NULL, (1u << 31), NULL, HFILL }}, { &hf_as_if_gen_channelnames, { "String descriptor index", "usbaudio.as_if_gen.iChannelNames", FT_UINT8, BASE_DEC, NULL, 0x00, "iChannelNames", HFILL }}, { &hf_as_if_ft_formattype, { "FormatType", "usbaudio.as_if_ft.bFormatType", FT_UINT8, BASE_DEC, NULL, 0x00, "wFormatType", HFILL }}, { &hf_as_if_ft_maxbitrate, { "Max Bit Rate", "usbaudio.as_if_ft.wMaxBitRate", FT_UINT16, BASE_DEC, NULL, 0x00, "wMaxBitRate", HFILL }}, { &hf_as_if_ft_nrchannels, { "Number Channels", "usbaudio.as_if_ft.bNrChannels", FT_UINT8, BASE_DEC, NULL, 0x00, "bNrChannels", HFILL }}, { &hf_as_if_ft_subframesize, { "Subframe Size", "usbaudio.as_if_ft.bSubframeSize", FT_UINT8, BASE_DEC, NULL, 0x00, "bSubframeSize", HFILL }}, { &hf_as_if_ft_subslotsize, { "Subslot Size", "usbaudio.as_if_ft.bSubslotSize", FT_UINT8, BASE_DEC, NULL, 0x00, "bSubslotSize", HFILL }}, { &hf_as_if_ft_bitresolution, { "Bit Resolution", "usbaudio.as_if_ft.bBitResolution", FT_UINT8, BASE_DEC, NULL, 0x00, "bBitResolution", HFILL }}, { &hf_as_if_ft_samplesperframe, { "Samples Per Frame", "usbaudio.as_if_ft.wSamplesPerFrame", FT_UINT16, BASE_DEC, NULL, 0x00, "wSamplesPerFrame", HFILL }}, { &hf_as_if_ft_samfreqtype, { "Samples Frequence Type", "usbaudio.as_if_ft.bSamFreqType", FT_UINT8, BASE_DEC, NULL, 0x00, "bSamFreqType", HFILL }}, { &hf_as_if_ft_lowersamfreq, { "Lower Samples Frequence", "usbaudio.as_if_ft.tLowerSamFreq", FT_UINT24, BASE_DEC, NULL, 0x00, "tLowerSamFreq", HFILL }}, { &hf_as_if_ft_uppersamfreq, { "Upper Samples Frequence", "usbaudio.as_if_ft.tUpperSamFreq", FT_UINT24, BASE_DEC, NULL, 0x00, "tUpperSamFreq", HFILL }}, { &hf_as_if_ft_samfreq, { "Samples Frequence", "usbaudio.as_if_ft.tSamFreq", FT_UINT24, BASE_DEC, NULL, 0x00, "tSamFreq", HFILL }}, { &hf_as_ep_desc_subtype, { "Subtype", "usbaudio.as_ep_subtype", FT_UINT8, BASE_HEX, VALS(as_ep_subtype_vals), 0x00, "bDescriptorSubtype", HFILL }}, { &hf_as_ep_gen_bmattributes, { "Attributes", "usbaudio.as_ep_gen.bmAttributes", FT_UINT8, BASE_HEX, NULL, 0x00, "bmAttributes", HFILL }}, { &hf_as_ep_gen_bmattributes_d0, { "Sampling Frequency Control", "usbaudio.as_ep_gen.bmAttributes.d0", FT_BOOLEAN, 8, NULL, (1u << 0), NULL, HFILL }}, { &hf_as_ep_gen_bmattributes_d1, { "Pitch Control", "usbaudio.as_ep_gen.bmAttributes.d1", FT_BOOLEAN, 8, NULL, (1u << 1), NULL, HFILL }}, { &hf_as_ep_gen_bmattributes_rsv, { "Reserved", "usbaudio.as_ep_gen.bmAttributes.rsv", FT_UINT8, BASE_HEX, NULL, 0x7C, NULL, HFILL }}, { &hf_as_ep_gen_bmattributes_d7, { "MaxPacketsOnly", "usbaudio.as_ep_gen.bmAttributes.d7", FT_BOOLEAN, 8, NULL, (1u << 7), NULL, HFILL }}, { &hf_as_ep_gen_controls, { "Controls", "usbaudio.as_ep_gen.bmControls", FT_UINT8, BASE_HEX, NULL, 0x00, "bmControls", HFILL }}, { &hf_as_ep_gen_controls_pitch, { "Pitch Control", "usbaudio.as_ep_gen.bmControls.pitch", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_read_only_vals_ext, 0x03, NULL, HFILL }}, { &hf_as_ep_gen_controls_data_overrun, { "Data Overrun Control", "usbaudio.as_ep_gen.bmControls.overrun", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_read_only_vals_ext, 0x0C, NULL, HFILL }}, { &hf_as_ep_gen_controls_data_underrun, { "Valid Alternate Settings Control", "usbaudio.as_ep_gen.bmControls.underrun", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &controls_capabilities_read_only_vals_ext, 0x30, NULL, HFILL }}, { &hf_as_ep_gen_controls_rsv, { "Reserved", "usbaudio.as_ep_gen.bmControls.bmControls.rsv", FT_UINT8, BASE_HEX, NULL, 0xC0, "Must be zero", HFILL }}, { &hf_as_ep_gen_lockdelayunits, { "Lock Delay Units", "usbaudio.as_ep_gen.bLockDelayUnits", FT_UINT8, BASE_DEC, VALS(lock_delay_unit_vals), 0x00, NULL, HFILL }}, { &hf_as_ep_gen_lockdelay, { "Lock Delay", "usbaudio.as_ep_gen.wLockDelay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ms_if_desc_subtype, { "Subtype", "usbaudio.ms_if_subtype", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ms_if_subtype_vals_ext, 0x0, "bDescriptorSubtype", HFILL }}, { &hf_ms_if_hdr_ver, { "Version", "usbaudio.ms_if_hdr.bcdADC", FT_DOUBLE, BASE_NONE, NULL, 0, "bcdADC", HFILL }}, { &hf_ms_if_hdr_total_len, { "Total length", "usbaudio.ms_if_hdr.wTotalLength", FT_UINT16, BASE_DEC, NULL, 0x00, "wTotalLength", HFILL }}, { &hf_ms_if_midi_in_bjacktype, { "Jack Type", "usbaudio.ms_if_midi_in.bJackType", FT_UINT8, BASE_HEX, VALS(ms_midi_jack_type_vals), 0x00, "bJackType", HFILL }}, { &hf_ms_if_midi_in_bjackid, { "Jack ID", "usbaudio.ms_if_midi_in.bJackID", FT_UINT8, BASE_DEC, NULL, 0x00, "bJackID", HFILL }}, { &hf_ms_if_midi_in_ijack, { "String descriptor index", "usbaudio.ms_if_midi_in.iJack", FT_UINT8, BASE_DEC, NULL, 0x00, "iJack", HFILL }}, { &hf_ms_if_midi_out_bjacktype, { "Jack Type", "usbaudio.ms_if_midi_out.bJackType", FT_UINT8, BASE_HEX, VALS(ms_midi_jack_type_vals), 0x00, "bJackType", HFILL }}, { &hf_ms_if_midi_out_bjackid, { "Jack ID", "usbaudio.ms_if_midi_out.bJackID", FT_UINT8, BASE_DEC, NULL, 0x00, "bJackID", HFILL }}, { &hf_ms_if_midi_out_bnrinputpins, { "Number of Input Pins", "usbaudio.ms_if_midi_out.bNrInputPins", FT_UINT8, BASE_DEC, NULL, 0x00, "bNrInputPins", HFILL }}, { &hf_ms_if_midi_out_basourceid, { "Connected MIDI Entity", "usbaudio.ms_if_midi_out.baSourceID", FT_UINT8, BASE_DEC, NULL, 0x00, "baSourceID", HFILL }}, { &hf_ms_if_midi_out_basourcepin, { "Entity Output Pin", "usbaudio.ms_if_midi_out.BaSourcePin", FT_UINT8, BASE_DEC, NULL, 0x00, "BaSourcePin", HFILL }}, { &hf_ms_if_midi_out_ijack, { "String descriptor index", "usbaudio.ms_if_midi_out.iJack", FT_UINT8, BASE_DEC, NULL, 0x00, "iJack", HFILL }}, { &hf_ms_ep_desc_subtype, { "Subtype", "usbaudio.ms_ep_subtype", FT_UINT8, BASE_HEX, VALS(ms_ep_subtype_vals), 0x00, "bDescriptorSubtype", HFILL }}, { &hf_ms_ep_gen_numjacks, { "Number of Embedded MIDI Jacks", "usbaudio.ms_ep_gen.bNumEmbMIDIJack", FT_UINT8, BASE_DEC, NULL, 0x00, "bNumEmbMIDIJack", HFILL }}, { &hf_ms_ep_gen_baassocjackid, { "Associated Embedded Jack ID", "usbaudio.ms_ep_gen.baAssocJackID", FT_UINT8, BASE_DEC, NULL, 0x00, "baAssocJackID", HFILL }}, { &hf_sysex_msg_fragments, { "Message fragments", "usbaudio.sysex.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment, { "Message fragment", "usbaudio.sysex.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_overlap, { "Message fragment overlap", "usbaudio.sysex.fragment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_overlap_conflicts, { "Message fragment overlapping with conflicting data", "usbaudio.sysex.fragment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_multiple_tails, { "Message has multiple tail fragments", "usbaudio.sysex.fragment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_too_long_fragment, { "Message fragment too long", "usbaudio.sysex.fragment.too_long_fragment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_error, { "Message defragmentation error", "usbaudio.sysex.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_fragment_count, { "Message fragment count", "usbaudio.sysex.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_reassembled_in, { "Reassembled in", "usbaudio.sysex.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_reassembled_length, { "Reassembled length", "usbaudio.sysex.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_sysex_msg_reassembled_data, { "Reassembled data", "usbaudio.sysex.reassembled.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }} }; static gint *usb_audio_subtrees[] = { &ett_usb_audio, &ett_usb_audio_desc, &ett_sysex_msg_fragment, &ett_sysex_msg_fragments, &ett_ac_if_hdr_controls, &ett_ac_if_fu_controls, &ett_ac_if_fu_controls0, &ett_ac_if_fu_controls1, &ett_ac_if_fu_controls_v2, &ett_ac_if_fu_control_v2, &ett_ac_if_su_sourceids, &ett_ac_if_su_controls, &ett_ac_if_input_wchannelconfig, &ett_ac_if_input_bmchannelconfig, &ett_ac_if_input_controls, &ett_ac_if_output_controls, &ett_ac_if_mu_channelconfig, &ett_ac_if_clksrc_attr, &ett_ac_if_clksrc_controls, &ett_ac_if_clksel_controls, &ett_as_if_gen_controls, &ett_as_if_gen_formats, &ett_as_if_gen_bmchannelconfig, &ett_as_ep_gen_attributes, &ett_as_ep_gen_controls }; static ei_register_info ei[] = { { &ei_usb_audio_undecoded, { "usbaudio.undecoded", PI_UNDECODED, PI_WARN, "Not dissected yet (report to wireshark.org)", EXPFILL }}, { &ei_usb_audio_invalid_feature_unit_length, { "usbaudio.ac_if_fu.invalid_length", PI_MALFORMED, PI_ERROR, "Descriptor size is not 7+(ch+1)*n where n=bControlSize", EXPFILL }}, { &ei_usb_audio_invalid_type_3_ft_nrchannels, { "usbaudio.as_if_ft.bNrChannels.invalid_value", PI_MALFORMED, PI_ERROR, "bNrChannels must be 2 for Type III Format Type descriptors", EXPFILL }}, { &ei_usb_audio_invalid_type_3_ft_subframesize, { "usbaudio.as_if_ft.subframesize.invalid_value", PI_MALFORMED, PI_ERROR, "bSubFrameSize must be 2 for Type III Format Type descriptors", EXPFILL }}, { &ei_usb_audio_invalid_type_3_ft_bitresolution, { "usbaudio.hf_as_if_ft_bitresolution.invalid_value", PI_MALFORMED, PI_ERROR, "bBitResolution must be 16 for Type III Format Type descriptors", EXPFILL }}, }; expert_module_t *expert_usb_audio; proto_usb_audio = proto_register_protocol("USB Audio", "USBAUDIO", "usbaudio"); proto_register_field_array(proto_usb_audio, hf, array_length(hf)); proto_register_subtree_array(usb_audio_subtrees, array_length(usb_audio_subtrees)); expert_usb_audio = expert_register_protocol(proto_usb_audio); expert_register_field_array(expert_usb_audio, ei, array_length(ei)); reassembly_table_register(&midi_data_reassembly_table, &addresses_reassembly_table_functions); usb_audio_bulk_handle = register_dissector("usbaudio", dissect_usb_audio_bulk, proto_usb_audio); } void proto_reg_handoff_usb_audio(void) { dissector_handle_t usb_audio_descr_handle; usb_audio_descr_handle = create_dissector_handle( dissect_usb_audio_descriptor, proto_usb_audio); dissector_add_uint("usb.descriptor", IF_CLASS_AUDIO, usb_audio_descr_handle); dissector_add_uint("usb.bulk", IF_CLASS_AUDIO, usb_audio_bulk_handle); sysex_handle = find_dissector_add_dependency("sysex", proto_usb_audio); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-ccid.c
/* packet-usb-ccid.c * Dissector for the Integrated Circuit Card Interface Device Class * * References: * http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110.pdf * * Copyright 2011, Tyson Key <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * */ #include "config.h" #include <epan/decode_as.h> #include <epan/packet.h> #include <epan/prefs.h> #include "packet-usb.h" static int proto_ccid = -1; static dissector_table_t subdissector_table; static int hf_ccid_bMessageType = -1; static int hf_ccid_dwLength = -1; static int hf_ccid_bSlot = -1; static int hf_ccid_bSeq = -1; static int hf_ccid_bStatus = -1; static int hf_ccid_bStatus_bmIccStatus = -1; static int hf_ccid_bStatus_bmCommandStatus = -1; static int hf_ccid_bError = -1; static int hf_ccid_bRFU = -1; static int hf_ccid_abRFU = -1; static int hf_ccid_bChainParameter = -1; static int hf_ccid_bPowerSelect = -1; static int hf_ccid_bClockStatus = -1; static int hf_ccid_bProtocolNum = -1; static int hf_ccid_bBWI = -1; static int hf_ccid_wLevelParameter = -1; static int hf_ccid_bcdCCID = -1; static int hf_ccid_bMaxSlotIndex = -1; static int hf_ccid_bVoltageSupport = -1; static int hf_ccid_bVoltageSupport18 = -1; static int hf_ccid_bVoltageSupport30 = -1; static int hf_ccid_bVoltageSupport50 = -1; static int hf_ccid_dwProtocols = -1; static int hf_ccid_dwProtocols_t0 = -1; static int hf_ccid_dwProtocols_t1 = -1; static int hf_ccid_dwDefaultClock = -1; static int hf_ccid_dwMaximumClock = -1; static int hf_ccid_bNumClockSupported = -1; static int hf_ccid_dwDataRate = -1; static int hf_ccid_dwMaxDataRate = -1; static int hf_ccid_bNumDataRatesSupported = -1; static int hf_ccid_dwMaxIFSD = -1; static int hf_ccid_dwSynchProtocols = -1; static int hf_ccid_dwMechanical = -1; static int hf_ccid_dwFeatures = -1; static int hf_ccid_dwFeatures_autoParam = -1; static int hf_ccid_dwFeatures_autoIccActivation = -1; static int hf_ccid_dwFeatures_autoIccVoltSelect = -1; static int hf_ccid_dwFeatures_autoIccClk = -1; static int hf_ccid_dwFeatures_autoBaudRate = -1; static int hf_ccid_dwFeatures_autoParamNegotiation = -1; static int hf_ccid_dwFeatures_autoPPS = -1; static int hf_ccid_dwFeatures_stopIccClk = -1; static int hf_ccid_dwFeatures_nadValNot0accept = -1; static int hf_ccid_dwFeatures_autoIfsd = -1; static int hf_ccid_dwFeatures_levelExchangeTDPU = -1; static int hf_ccid_dwFeatures_levelExchangeShortAPDU = -1; static int hf_ccid_dwFeatures_levelExchangeShortExtendedAPDU = -1; static int hf_ccid_dwFeatures_UsbWakeUp = -1; static int hf_ccid_dwMaxCCIDMessageLength = -1; static int hf_ccid_bClassGetResponse = -1; static int hf_ccid_bClassEnvelope = -1; static int hf_ccid_wLcdLayout = -1; static int hf_ccid_wLcdLayout_lines = -1; static int hf_ccid_wLcdLayout_chars = -1; static int hf_ccid_bPINSupport = -1; static int hf_ccid_bPINSupport_modify = -1; static int hf_ccid_bPINSupport_vrfy = -1; static int hf_ccid_bMaxCCIDBusySlots = -1; static int hf_ccid_Reserved = -1; static int hf_ccid_bmSlotICCState = -1; static int hf_ccid_bmSlotICCState_slot0Current = -1; static int hf_ccid_bmSlotICCState_slot0Changed = -1; static int hf_ccid_bmSlotICCState_slot1Current = -1; static int hf_ccid_bmSlotICCState_slot1Changed = -1; static int hf_ccid_bmSlotICCState_slot2Current = -1; static int hf_ccid_bmSlotICCState_slot2Changed = -1; static int hf_ccid_bmSlotICCState_slot3Current = -1; static int hf_ccid_bmSlotICCState_slot3Changed = -1; static int hf_ccid_bmSlotICCState_slot4Current = -1; static int hf_ccid_bmSlotICCState_slot4Changed = -1; static int hf_ccid_bmSlotICCState_slot5Current = -1; static int hf_ccid_bmSlotICCState_slot5Changed = -1; static int hf_ccid_bmSlotICCState_slot6Current = -1; static int hf_ccid_bmSlotICCState_slot6Changed = -1; static int hf_ccid_bmSlotICCState_slot7Current = -1; static int hf_ccid_bmSlotICCState_slot7Changed = -1; static int hf_ccid_bHardwareErrorCode = -1; static int hf_ccid_bmFindexDindex = -1; static int hf_ccid_bmTCCKST0 = -1; static int hf_ccid_bmTCCKST1 = -1; static int hf_ccid_bGuardTimeT0 = -1; static int hf_ccid_bGuardTimeT1 = -1; static int hf_ccid_bWaitingIntegerT0 = -1; static int hf_ccid_bmWaitingIntegersT1 = -1; static int hf_ccid_bClockStop = -1; static int hf_ccid_bIFSC = -1; static int hf_ccid_bNadValue = -1; static dissector_handle_t usb_ccid_handle; static int * const bVoltageLevel_fields[] = { &hf_ccid_bVoltageSupport18, &hf_ccid_bVoltageSupport30, &hf_ccid_bVoltageSupport50, NULL }; static int * const dwProtocols_fields[] = { &hf_ccid_dwProtocols_t0, &hf_ccid_dwProtocols_t1, NULL }; static int * const bFeatures_fields[] = { /* XXX - add the missing components */ &hf_ccid_dwFeatures_autoParam, &hf_ccid_dwFeatures_autoIccActivation, &hf_ccid_dwFeatures_autoIccVoltSelect, &hf_ccid_dwFeatures_autoIccClk, &hf_ccid_dwFeatures_autoBaudRate, &hf_ccid_dwFeatures_autoParamNegotiation, &hf_ccid_dwFeatures_autoPPS, &hf_ccid_dwFeatures_stopIccClk, &hf_ccid_dwFeatures_nadValNot0accept, &hf_ccid_dwFeatures_autoIfsd, &hf_ccid_dwFeatures_levelExchangeTDPU, &hf_ccid_dwFeatures_levelExchangeShortAPDU, &hf_ccid_dwFeatures_levelExchangeShortExtendedAPDU, &hf_ccid_dwFeatures_UsbWakeUp, NULL }; static int * const bPINSupport_fields[] = { &hf_ccid_bPINSupport_modify, &hf_ccid_bPINSupport_vrfy, NULL }; static int * const bmSlotICCStateb0_fields[] = { &hf_ccid_bmSlotICCState_slot0Current, &hf_ccid_bmSlotICCState_slot0Changed, &hf_ccid_bmSlotICCState_slot1Current, &hf_ccid_bmSlotICCState_slot1Changed, &hf_ccid_bmSlotICCState_slot2Current, &hf_ccid_bmSlotICCState_slot2Changed, &hf_ccid_bmSlotICCState_slot3Current, &hf_ccid_bmSlotICCState_slot3Changed, NULL }; static int * const bmSlotICCStateb1_fields[] = { &hf_ccid_bmSlotICCState_slot4Current, &hf_ccid_bmSlotICCState_slot4Changed, &hf_ccid_bmSlotICCState_slot5Current, &hf_ccid_bmSlotICCState_slot5Changed, &hf_ccid_bmSlotICCState_slot6Current, &hf_ccid_bmSlotICCState_slot6Changed, &hf_ccid_bmSlotICCState_slot7Current, &hf_ccid_bmSlotICCState_slot7Changed, NULL }; static int * const bStatus_fields[] = { &hf_ccid_bStatus_bmIccStatus, &hf_ccid_bStatus_bmCommandStatus, NULL }; /* smart card descriptor, as defined in section 5.1 of the USB CCID specification */ #define USB_DESC_TYPE_SMARTCARD 0x21 /* Standardised Bulk Out message types */ #define PC_RDR_SET_PARAMS 0x61 #define PC_RDR_ICC_ON 0x62 #define PC_RDR_ICC_OFF 0x63 #define PC_RDR_GET_SLOT_STATUS 0x65 #define PC_RDR_SECURE 0x69 #define PC_RDR_T0APDU 0x6A #define PC_RDR_ESCAPE 0x6B #define PC_RDR_GET_PARAMS 0x6C #define PC_RDR_RESET_PARAMS 0x6D #define PC_RDR_ICC_CLOCK 0x6E #define PC_RDR_XFR_BLOCK 0x6F #define PC_RDR_MECH 0x71 #define PC_RDR_ABORT 0x72 #define PC_RDR_DATA_CLOCK 0x73 /* Standardised Bulk In message types */ #define RDR_PC_DATA_BLOCK 0x80 #define RDR_PC_SLOT_STATUS 0x81 #define RDR_PC_PARAMS 0x82 #define RDR_PC_ESCAPE 0x83 #define RDR_PC_DATA_CLOCK 0x84 /* Standardised Interupt IN message types */ #define RDR_PC_NOTIF_SLOT_CHNG 0x50 #define RDR_PC_HWERROR 0x51 void proto_register_ccid(void); void proto_reg_handoff_ccid(void); static const value_string ccid_descriptor_type_vals[] = { {USB_DESC_TYPE_SMARTCARD, "smart card"}, {0,NULL} }; static value_string_ext ccid_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(ccid_descriptor_type_vals); static const value_string ccid_opcode_vals[] = { /* Standardised Bulk Out message types */ {PC_RDR_SET_PARAMS , "PC_to_RDR_SetParameters"}, {PC_RDR_ICC_ON , "PC_to_RDR_IccPowerOn"}, {PC_RDR_ICC_OFF , "PC_to_RDR_IccPowerOff"}, {PC_RDR_GET_SLOT_STATUS , "PC_to_RDR_GetSlotStatus"}, {PC_RDR_SECURE , "PC_to_RDR_Secure"}, {PC_RDR_T0APDU , "PC_to_RDR_T0APDU"}, {PC_RDR_ESCAPE , "PC_to_RDR_Escape"}, {PC_RDR_GET_PARAMS , "PC_to_RDR_GetParameters"}, {PC_RDR_RESET_PARAMS , "PC_to_RDR_ResetParameters"}, {PC_RDR_ICC_CLOCK , "PC_to_RDR_IccClock"}, {PC_RDR_XFR_BLOCK , "PC_to_RDR_XfrBlock"}, {PC_RDR_MECH , "PC_to_RDR_Mechanical"}, {PC_RDR_ABORT , "PC_to_RDR_Abort"}, {PC_RDR_DATA_CLOCK , "PC_to_RDR_SetDataRateAndClockFrequency"}, /* Standardised Bulk In message types */ {RDR_PC_DATA_BLOCK , "RDR_to_PC_DataBlock"}, {RDR_PC_SLOT_STATUS , "RDR_to_PC_SlotStatus"}, {RDR_PC_PARAMS , "RDR_to_PC_Parameters"}, {RDR_PC_ESCAPE , "RDR_to_PC_Escape"}, {RDR_PC_DATA_CLOCK , "RDR_to_PC_DataRateAndClockFrequency"}, /* Standardised Interupt IN message types */ {RDR_PC_NOTIF_SLOT_CHNG , "RDR_to_PC_NotifySlotChange"}, {RDR_PC_HWERROR , "RDR_to_PC_HardwareError"}, /* End of message types */ {0x00, NULL} }; static const value_string ccid_messagetypes_vals[] = { /* Standardised Bulk Out message types */ {PC_RDR_SET_PARAMS , "PC to Reader: Set Parameters"}, {PC_RDR_ICC_ON , "PC to Reader: ICC Power On"}, {PC_RDR_ICC_OFF , "PC to Reader: ICC Power Off"}, {PC_RDR_GET_SLOT_STATUS , "PC to Reader: Get Slot Status"}, {PC_RDR_SECURE , "PC to Reader: Secure"}, {PC_RDR_T0APDU , "PC to Reader: T=0 APDU"}, {PC_RDR_ESCAPE , "PC to Reader: Escape"}, {PC_RDR_GET_PARAMS , "PC to Reader: Get Parameters"}, {PC_RDR_RESET_PARAMS , "PC to Reader: Reset Parameters"}, {PC_RDR_ICC_CLOCK , "PC to Reader: ICC Clock"}, {PC_RDR_XFR_BLOCK , "PC to Reader: Transfer Block"}, {PC_RDR_MECH , "PC to Reader: Mechanical"}, {PC_RDR_ABORT , "PC to Reader: Abort"}, {PC_RDR_DATA_CLOCK , "PC to Reader: Set Data Rate and Clock Frequency"}, /* Standardised Bulk In message types */ {RDR_PC_DATA_BLOCK , "Reader to PC: Data Block"}, {RDR_PC_SLOT_STATUS , "Reader to PC: Slot Status"}, {RDR_PC_PARAMS , "Reader to PC: Parameters"}, {RDR_PC_ESCAPE , "Reader to PC: Escape"}, {RDR_PC_DATA_CLOCK , "Reader to PC: Data Rate and Clock Frequency"}, /* Standardised Interupt IN message types */ {RDR_PC_NOTIF_SLOT_CHNG , "Reader to PC: Notify Slot Change"}, {RDR_PC_HWERROR , "Reader to PC: Hardware Error"}, /* End of message types */ {0x00, NULL} }; static const value_string ccid_voltage_levels_vals[] = { /* Standardised voltage levels */ {0x00, "Automatic Voltage Selection"}, {0x01, "5.0 volts"}, {0x02, "3.0 volts"}, {0x03, "1.8 volts"}, /* End of voltage levels */ {0x00, NULL} }; static const value_string ccid_clock_states_vals[] = { /* Standardised clock states */ {0x00, "Clock running"}, {0x01, "Clock stopped in state L"}, {0x02, "Clock stopped in state H"}, {0x03, "Clock stopped in an unknown state"}, /* End of clock states */ {0x00, NULL} }; static const value_string ccid_proto_structs_vals[] = { /* Standardised clock states */ {0x00, "Structure for protocol T=0"}, {0x01, "Structure for protocol T=1"}, /* Marked as RFU, but added for completeness: */ {0x80, "Structure for 2-wire protocol"}, {0x81, "Structure for 3-wire protocol"}, {0x82, "Structure for I2C protocol"}, /* End of protocol structures */ {0x00, NULL} }; static const value_string ccid_status_icc_status_vals[] = { /* Standardised icc status */ { 0x00, "An ICC is present and active" }, { 0x01, "An ICC is present and inactive" }, { 0x02, "No ICC is present" }, { 0x03, "RFU" }, /* End of icc status */ { 0x00, NULL } }; static const value_string ccid_status_cmd_status_vals[] = { /* Standardised status values */ { 0x00, "Processed without error " }, { 0x01, "Failed" }, { 0x02, "Time Extension is requested " }, { 0x03, "RFU" }, /* End of status values */ { 0x00, NULL } }; /* Subtree handles: set by register_subtree_array */ static gint ett_ccid = -1; static gint ett_ccid_desc = -1; static gint ett_ccid_protocol_data_structure = -1; static gint ett_ccid_voltage_level = -1; static gint ett_ccid_protocols = -1; static gint ett_ccid_features = -1; static gint ett_ccid_lcd_layout = -1; static gint ett_ccid_pin_support = -1; static gint ett_ccid_slot_change = -1; static gint ett_ccid_status = -1; static gint dissect_usb_ccid_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { gint offset = 0; guint8 descriptor_type; guint8 descriptor_len; proto_item *freq_item; proto_tree *desc_tree; guint8 num_clock_supp; proto_item *lcd_layout_item; proto_tree *lcd_layout_tree; descriptor_len = tvb_get_guint8(tvb, offset); descriptor_type = tvb_get_guint8(tvb, offset+1); if (descriptor_type!=USB_DESC_TYPE_SMARTCARD) return 0; desc_tree = proto_tree_add_subtree(tree, tvb, offset, descriptor_len, ett_ccid_desc, NULL, "SMART CARD DEVICE CLASS DESCRIPTOR"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &ccid_descriptor_type_vals_ext); offset += 2; proto_tree_add_item(desc_tree, hf_ccid_bcdCCID, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(desc_tree, hf_ccid_bMaxSlotIndex, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(desc_tree, tvb, offset, hf_ccid_bVoltageSupport, ett_ccid_voltage_level, bVoltageLevel_fields, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(desc_tree, tvb, offset, hf_ccid_dwProtocols, ett_ccid_protocols, dwProtocols_fields, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwDefaultClock, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwMaximumClock, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; num_clock_supp = tvb_get_guint8(tvb, offset); freq_item = proto_tree_add_item(desc_tree, hf_ccid_bNumClockSupported, tvb, offset, 1, ENC_LITTLE_ENDIAN); if (num_clock_supp==0) proto_item_append_text(freq_item, " (only default and maximum)"); offset++; proto_tree_add_item(desc_tree, hf_ccid_dwDataRate, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwMaxDataRate, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_bNumDataRatesSupported, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(desc_tree, hf_ccid_dwMaxIFSD, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwSynchProtocols, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwMechanical, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_bitmask(desc_tree, tvb, offset, hf_ccid_dwFeatures, ett_ccid_features, bFeatures_fields, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_dwMaxCCIDMessageLength, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(desc_tree, hf_ccid_bClassGetResponse, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(desc_tree, hf_ccid_bClassEnvelope, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; lcd_layout_item = proto_tree_add_item(desc_tree, hf_ccid_wLcdLayout, tvb, offset, 2, ENC_LITTLE_ENDIAN); lcd_layout_tree = proto_item_add_subtree( lcd_layout_item, ett_ccid_lcd_layout); proto_tree_add_item(lcd_layout_tree, hf_ccid_wLcdLayout_lines, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(lcd_layout_tree, hf_ccid_wLcdLayout_chars, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(desc_tree, tvb, offset, hf_ccid_bPINSupport, ett_ccid_pin_support, bPINSupport_fields, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(desc_tree, hf_ccid_bMaxCCIDBusySlots, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; return offset; } static gint dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *item; proto_tree *ccid_tree; guint8 cmd; guint32 payload_len; tvbuff_t *next_tvb; usb_conv_info_t *usb_conv_info; int len_remaining; guint8 bProtocolNum; proto_tree *protocol_tree; /* Reject the packet if data is NULL */ if (data == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCCID"); col_set_str(pinfo->cinfo, COL_INFO, "CCID Packet"); /* Start with a top-level item to add everything else to */ item = proto_tree_add_item(tree, proto_ccid, tvb, 0, 10, ENC_NA); ccid_tree = proto_item_add_subtree(item, ett_ccid); proto_tree_add_item(ccid_tree, hf_ccid_bMessageType, tvb, 0, 1, ENC_LITTLE_ENDIAN); cmd = tvb_get_guint8(tvb, 0); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str_const(cmd, ccid_messagetypes_vals, "Unknown")); switch (cmd) { case PC_RDR_SET_PARAMS: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bProtocolNum, tvb, 7, 1, ENC_LITTLE_ENDIAN); /* Placeholder for abRFU */ proto_tree_add_item(ccid_tree, hf_ccid_Reserved, tvb, 8, 2, ENC_LITTLE_ENDIAN); payload_len = tvb_get_letohl(tvb, 1); /* abProtocolDataStructure */ bProtocolNum = tvb_get_guint8(tvb, 7); switch (bProtocolNum) { case 0: /* T=0 */ protocol_tree = proto_tree_add_subtree(tree, tvb, 10, payload_len, ett_ccid_protocol_data_structure, NULL, "Protocol Data Structure for Protocol T=0"); proto_tree_add_item(protocol_tree, hf_ccid_bmFindexDindex, tvb, 10, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmTCCKST0, tvb, 11, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bGuardTimeT0, tvb, 12, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bWaitingIntegerT0, tvb, 13, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bClockStop, tvb, 14, 1, ENC_LITTLE_ENDIAN); break; case 1: /* T=1 */ protocol_tree = proto_tree_add_subtree(tree, tvb, 10, payload_len, ett_ccid_protocol_data_structure, NULL, "Protocol Data Structure for Protocol T=1"); proto_tree_add_item(protocol_tree, hf_ccid_bmFindexDindex, tvb, 10, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmTCCKST1, tvb, 11, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bGuardTimeT1, tvb, 12, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmWaitingIntegersT1, tvb, 13, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bClockStop, tvb, 14, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bIFSC, tvb, 15, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bNadValue, tvb, 16, 1, ENC_LITTLE_ENDIAN); break; default: next_tvb = tvb_new_subset_remaining(tvb, 10); call_data_dissector(next_tvb, pinfo, tree); } break; case PC_RDR_ICC_ON: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bPowerSelect, tvb, 7, 1, ENC_LITTLE_ENDIAN); /* Placeholder for abRFU */ proto_tree_add_item(ccid_tree, hf_ccid_Reserved, tvb, 8, 2, ENC_LITTLE_ENDIAN); break; case PC_RDR_ICC_OFF: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); /* Placeholder for abRFU */ proto_tree_add_item(ccid_tree, hf_ccid_Reserved, tvb, 7, 3, ENC_LITTLE_ENDIAN); break; case PC_RDR_GET_SLOT_STATUS: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); /* Placeholder for abRFU */ proto_tree_add_item(ccid_tree, hf_ccid_Reserved, tvb, 7, 3, ENC_LITTLE_ENDIAN); break; case PC_RDR_GET_PARAMS: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); /* Placeholder for abRFU */ proto_tree_add_item(ccid_tree, hf_ccid_Reserved, tvb, 7, 3, ENC_LITTLE_ENDIAN); break; case PC_RDR_XFR_BLOCK: case PC_RDR_ESCAPE: proto_tree_add_item_ret_uint(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN, &payload_len); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); if (cmd == PC_RDR_ESCAPE) { proto_tree_add_item(ccid_tree, hf_ccid_abRFU, tvb, 7, 3, ENC_NA); } else { proto_tree_add_item(ccid_tree, hf_ccid_bBWI, tvb, 7, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_wLevelParameter, tvb, 8, 2, ENC_LITTLE_ENDIAN); } if (payload_len == 0) break; next_tvb = tvb_new_subset_length(tvb, 10, payload_len); /* sent/received is from the perspective of the card reader */ pinfo->p2p_dir = P2P_DIR_SENT; if (!dissector_try_payload_new(subdissector_table, next_tvb, pinfo, tree, TRUE, usb_conv_info)) { call_data_dissector(next_tvb, pinfo, tree); } break; case RDR_PC_DATA_BLOCK: case RDR_PC_ESCAPE: proto_tree_add_item_ret_uint(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN, &payload_len); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(ccid_tree, tvb, 7, hf_ccid_bStatus, ett_ccid_status, bStatus_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN); if (cmd == RDR_PC_ESCAPE) proto_tree_add_item(ccid_tree, hf_ccid_bRFU, tvb, 9, 1, ENC_LITTLE_ENDIAN); else proto_tree_add_item(ccid_tree, hf_ccid_bChainParameter, tvb, 9, 1, ENC_LITTLE_ENDIAN); if (payload_len == 0) break; next_tvb = tvb_new_subset_length(tvb, 10, payload_len); pinfo->p2p_dir = P2P_DIR_RECV; if (!dissector_try_payload_new(subdissector_table, next_tvb, pinfo, tree, TRUE, usb_conv_info)) { call_data_dissector(next_tvb, pinfo, tree); } break; case RDR_PC_SLOT_STATUS: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(ccid_tree, tvb, 7, hf_ccid_bStatus, ett_ccid_status, bStatus_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bClockStatus, tvb, 9, 1, ENC_LITTLE_ENDIAN); break; case RDR_PC_PARAMS: proto_tree_add_item(ccid_tree, hf_ccid_dwLength, tvb, 1, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(ccid_tree, tvb, 7, hf_ccid_bStatus, ett_ccid_status, bStatus_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bError, tvb, 8, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bProtocolNum, tvb, 9, 1, ENC_LITTLE_ENDIAN); payload_len = tvb_get_letohl(tvb, 1); /* abProtocolDataStructure */ bProtocolNum = tvb_get_guint8(tvb, 9); switch (bProtocolNum) { case 0: /* T=0 */ protocol_tree = proto_tree_add_subtree(tree, tvb, 10, payload_len, ett_ccid_protocol_data_structure, NULL, "Protocol Data Structure for Protocol T=0"); proto_tree_add_item(protocol_tree, hf_ccid_bmFindexDindex, tvb, 10, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmTCCKST0, tvb, 11, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bGuardTimeT0, tvb, 12, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bWaitingIntegerT0, tvb, 13, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bClockStop, tvb, 14, 1, ENC_LITTLE_ENDIAN); break; case 1: /* T=1 */ protocol_tree = proto_tree_add_subtree(tree, tvb, 10, payload_len, ett_ccid_protocol_data_structure, NULL, "Protocol Data Structure for Protocol T=1"); proto_tree_add_item(protocol_tree, hf_ccid_bmFindexDindex, tvb, 10, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmTCCKST1, tvb, 11, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bGuardTimeT1, tvb, 12, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bmWaitingIntegersT1, tvb, 13, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bClockStop, tvb, 14, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bIFSC, tvb, 15, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(protocol_tree, hf_ccid_bNadValue, tvb, 16, 1, ENC_LITTLE_ENDIAN); break; default: next_tvb = tvb_new_subset_remaining(tvb, 10); call_data_dissector(next_tvb, pinfo, tree); } break; /*Interupt IN*/ case RDR_PC_NOTIF_SLOT_CHNG: proto_tree_add_bitmask(ccid_tree, tvb, 1, hf_ccid_bmSlotICCState, ett_ccid_slot_change, bmSlotICCStateb0_fields, ENC_LITTLE_ENDIAN); len_remaining = tvb_reported_length_remaining (tvb, 2); if (len_remaining <= 0) break; proto_tree_add_bitmask(ccid_tree, tvb, 2, hf_ccid_bmSlotICCState, ett_ccid_slot_change, bmSlotICCStateb1_fields, ENC_LITTLE_ENDIAN); break; case RDR_PC_HWERROR: proto_tree_add_item(ccid_tree, hf_ccid_bSlot, tvb, 1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bSeq, tvb, 2, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ccid_tree, hf_ccid_bHardwareErrorCode, tvb, 3, 1, ENC_LITTLE_ENDIAN); break; } /* TODO: Try use "offset" instead of hardcoded constants */ return tvb_captured_length(tvb); } void proto_register_ccid(void) { static hf_register_info hf[] = { {&hf_ccid_bMessageType, { "Message Type", "usbccid.bMessageType", FT_UINT8, BASE_HEX, VALS(ccid_opcode_vals), 0x0, NULL, HFILL }}, {&hf_ccid_dwLength, { "Packet Length", "usbccid.dwLength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bSlot, { "Slot", "usbccid.bSlot", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bSeq, { "Sequence", "usbccid.bSeq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bStatus, { "Status", "usbccid.bStatus", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bStatus_bmIccStatus, { "Status", "usbccid.bStatus.bmIccStatus", FT_UINT8, BASE_DEC, VALS(ccid_status_icc_status_vals), 0x03, NULL, HFILL }}, {&hf_ccid_bStatus_bmCommandStatus, { "Status", "usbccid.bStatus.bmCommandStatus", FT_UINT8, BASE_DEC, VALS(ccid_status_cmd_status_vals), 0xC0, NULL, HFILL }}, {&hf_ccid_bError, { "Error", "usbccid.bError", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bRFU, { "RFU", "usbccid.bRFU", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_abRFU, { "RFU", "usbccid.abRFU", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bChainParameter, { "Chain Parameter", "usbccid.bChainParameter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bPowerSelect, { "Voltage Level", "usbccid.bPowerSelect", FT_UINT8, BASE_HEX, VALS(ccid_voltage_levels_vals), 0x0, NULL, HFILL }}, {&hf_ccid_bClockStatus, { "Clock Status", "usbccid.bClockStatus", FT_UINT8, BASE_HEX, VALS(ccid_clock_states_vals), 0x0, NULL, HFILL }}, {&hf_ccid_bProtocolNum, { "Data Structure Type", "usbccid.bProtocolNum", FT_UINT8, BASE_HEX, VALS(ccid_proto_structs_vals), 0x0, NULL, HFILL }}, {&hf_ccid_bBWI, { "Block Wait Time Integer", "usbccid.bBWI", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_wLevelParameter, { "Level Parameter", "usbccid.wLevelParameter", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bcdCCID, { "bcdCCID", "usbccid.bcdCCID", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bMaxSlotIndex, { "max slot index", "usbccid.bMaxSlotIndex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bVoltageSupport, { "voltage support", "usbccid.bVoltageSupport", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bVoltageSupport18, { "1.8V", "usbccid.bVoltageSupport.18", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }}, {&hf_ccid_bVoltageSupport30, { "3.0V", "usbccid.bVoltageSupport.30", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, {&hf_ccid_bVoltageSupport50, { "5.0V", "usbccid.bVoltageSupport.50", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL }}, {&hf_ccid_dwProtocols, { "dwProtocols", "usbccid.dwProtocols", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwProtocols_t0, { "T=0", "usbccid.dwProtocols.t0", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001, NULL, HFILL }}, {&hf_ccid_dwProtocols_t1, { "T=1", "usbccid.dwProtocols.t1", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002, NULL, HFILL }}, {&hf_ccid_dwDefaultClock, { "default clock frequency", "usbccid.dwDefaultClock", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_khz, 0x0, NULL, HFILL }}, {&hf_ccid_dwMaximumClock, { "maximum clock frequency", "usbccid.dwMaximumClock", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_khz, 0x0, NULL, HFILL }}, {&hf_ccid_bNumClockSupported, { "number of supported clock frequencies", "usbccid.bNumClockSupported", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwDataRate, { "default ICC I/O data rate in bps", "usbccid.dwDataRate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwMaxDataRate, { "maximum ICC I/O data rate in bps", "usbccid.dwMaxDataRate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bNumDataRatesSupported, { "number of supported data rates", "usbccid.bNumDataRatesSupported", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_ccid_dwMaxIFSD, { "maximum IFSD supported", "usbccid.dwMaxIFSD", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwSynchProtocols, { "supported protocol types", "usbccid.dwSynchProtocols", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwMechanical, { "mechanical characteristics", "usbccid.dwMechanical", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwFeatures, { "intelligent features", "usbccid.dwFeatures", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoIccActivation, { "Automatic activation of ICC on inserting", "usbccid.dwFeatures.autoIccActivation", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoIccVoltSelect, { "Automatic ICC voltage selection", "usbccid.dwFeatures.autoParamNegotiation", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoParam, { "Automatic parameter configuration based on ATR", "usbccid.dwFeatures.autoParam", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoIccClk, { "Automatic ICC clock frequency change", "usbccid.dwFeatures.autoIccClk", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoBaudRate, { "Automatic baud rate change", "usbccid.dwFeatures.autoBaudRate", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoParamNegotiation, { "Automatic parameters negotiation", "usbccid.dwFeatures.autoParamNegotiation", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoPPS, { "Automatic PPS", "usbccid.dwFeatures.autoPPS", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080, NULL, HFILL }}, {&hf_ccid_dwFeatures_stopIccClk, { "CCID can set ICC in clock stop mode", "usbccid.dwFeatures.stopIccClk", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100, NULL, HFILL }}, {&hf_ccid_dwFeatures_nadValNot0accept, { "NAD value other than 00 accepted", "usbccid.dwFeatures.nadValNot0accept", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200, NULL, HFILL }}, {&hf_ccid_dwFeatures_autoIfsd, { "Automatic IFSD exchange as first exchange", "usbccid.dwFeatures.autoIfsd", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400, NULL, HFILL }}, {&hf_ccid_dwFeatures_levelExchangeTDPU, { "TPDU level exchanges", "usbccid.dwFeatures.levelExchangeTDPU", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000, NULL, HFILL }}, {&hf_ccid_dwFeatures_levelExchangeShortAPDU, { "Short APDU level exchange", "usbccid.dwFeatures.levelExchangeShortAPDU", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000, NULL, HFILL }}, {&hf_ccid_dwFeatures_levelExchangeShortExtendedAPDU, { "Short and Extended APDU level exchange", "usbccid.dwFeatures.levelExchangeShortExtendedAPDU", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000, NULL, HFILL }}, {&hf_ccid_dwFeatures_UsbWakeUp, { "USB Wake up signaling supported on card insertion and removal", "usbccid.dwFeatures.UsbWakeUp", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000, NULL, HFILL }}, {&hf_ccid_dwMaxCCIDMessageLength, { "maximum CCID message length", "usbccid.dwMaxCCIDMessageLength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bClassGetResponse, { "default class for Get Response", "usbccid.hf_ccid_bClassGetResponse", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bClassEnvelope, { "default class for Envelope", "usbccid.hf_ccid_bClassEnvelope", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_wLcdLayout, { "LCD layout", "usbccid.hf_ccid_wLcdLayout", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_wLcdLayout_lines, { "Lines", "usbccid.hf_ccid_wLcdLayout.lines", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_wLcdLayout_chars, { "Characters per line", "usbccid.hf_ccid_wLcdLayout.chars", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bPINSupport, { "PIN support", "usbccid.hf_ccid_bPINSupport", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bPINSupport_modify, { "PIN modification", "usbccid.hf_ccid_bPINSupport.modify", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, {&hf_ccid_bPINSupport_vrfy, { "PIN verification", "usbccid.hf_ccid_bPINSupport.verify", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL }}, {&hf_ccid_bMaxCCIDBusySlots, { "maximum number of busy slots", "usbccid.hf_ccid_bMaxCCIDBusySlots", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_Reserved, { "Reserved for Future Use", "usbccid.hf_ccid_Reserved", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_ccid_bmSlotICCState, { "Slot ICC State", "usbccid.hf_ccid_bmSlotICCState", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot0Current, { "Slot 0 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot0Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot0Changed, { "Slot 0 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot0Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot1Current, { "Slot 1 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot1Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot1Changed, { "Slot 1 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot1Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot2Current, { "Slot 2 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot2Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot2Changed, { "Slot 2 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot2Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot3Current, { "Slot 3 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot3Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot3Changed, { "Slot 3 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot3Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot4Current, { "Slot 4 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot4Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot4Changed, { "Slot 4 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot4Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot5Current, { "Slot 5 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot5Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot5Changed, { "Slot 5 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot5Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot6Current, { "Slot 6 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot6Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot6Changed, { "Slot 6 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot6Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot7Current, { "Slot 7 Current Status", "usbccid.hf_ccid_bmSlotICCState.slot7Current", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40, NULL, HFILL } }, { &hf_ccid_bmSlotICCState_slot7Changed, { "Slot 7 Status changed", "usbccid.hf_ccid_bmSlotICCState.slot7Changed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, { &hf_ccid_bHardwareErrorCode, { "Hardware Error Code", "usbccid.hf_ccid_bHardwareErrorCode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_ccid_bmFindexDindex, { "Fi/Di selecting clock rate", "usbccid.bmFindexDindex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bmTCCKST0, { "Convention used", "usbccid.bmTCCKST0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bmTCCKST1, { "Checksum type - Convention used", "usbccid.bmTCCKST1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bGuardTimeT0, { "Extra Guardtime between two characters", "usbccid.bGuardTimeT0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bGuardTimeT1, { "Extra Guardtime", "usbccid.bGuardTimeT1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bmWaitingIntegersT1, { "BWI - CWI", "usbccid.bmWaitingIntegersT1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bClockStop, { "ICC Clock Stop Support", "usbccid.bClockStop", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bIFSC, { "Size of negotiated IFSC", "usbccid.bIFSC", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bNadValue, { "NAD", "usbccid.bNadValue", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, {&hf_ccid_bWaitingIntegerT0, { "WI for T= 0 used to define WWT", "usbccid.bWaitingIntegerT0", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_ccid, &ett_ccid_desc, &ett_ccid_protocol_data_structure, &ett_ccid_voltage_level, &ett_ccid_protocols, &ett_ccid_features, &ett_ccid_lcd_layout, &ett_ccid_pin_support, &ett_ccid_slot_change, &ett_ccid_status }; module_t *pref_mod; proto_ccid = proto_register_protocol("USB CCID", "USBCCID", "usbccid"); proto_register_field_array(proto_ccid, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); pref_mod = prefs_register_protocol_obsolete(proto_ccid); prefs_register_obsolete_preference(pref_mod, "prtype"); usb_ccid_handle = register_dissector("usbccid", dissect_ccid, proto_ccid); subdissector_table = register_decode_as_next_proto(proto_ccid, "usbccid.subdissector", "USB CCID payload", NULL); } /* Handler registration */ void proto_reg_handoff_ccid(void) { dissector_handle_t usb_ccid_descr_handle; usb_ccid_descr_handle = create_dissector_handle( dissect_usb_ccid_descriptor, proto_ccid); dissector_add_uint("usb.descriptor", IF_CLASS_SMART_CARD, usb_ccid_descr_handle); dissector_add_uint("usb.bulk", IF_CLASS_SMART_CARD, usb_ccid_handle); dissector_add_for_decode_as("usb.device", usb_ccid_handle); dissector_add_for_decode_as("usb.product", usb_ccid_handle); dissector_add_for_decode_as("usb.protocol", usb_ccid_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-com.c
/* packet-usb-com.c * Routines for USB Communications and CDC Control dissection * Copyright 2013, Pascal Quantin <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include "packet-usb.h" /* protocols and header fields */ static int proto_usb_com = -1; static int hf_usb_com_descriptor_subtype = -1; static int hf_usb_com_descriptor_cdc = -1; static int hf_usb_com_descriptor_payload = -1; static int hf_usb_com_control_subclass = -1; static int hf_usb_com_control_request_code = -1; static int hf_usb_com_control_value = -1; static int hf_usb_com_control_index = -1; static int hf_usb_com_control_length = -1; static int hf_usb_com_control_response_code = -1; static int hf_usb_com_control_payload = -1; static int hf_usb_com_get_ntb_params_length = -1; static int hf_usb_com_get_ntb_params_ntb_formats_supported = -1; static int hf_usb_com_get_ntb_params_ntb_formats_supported_16bit = -1; static int hf_usb_com_get_ntb_params_ntb_formats_supported_32bit = -1; static int hf_usb_com_get_ntb_params_ntb_in_max_size = -1; static int hf_usb_com_get_ntb_params_ndp_in_divisor = -1; static int hf_usb_com_get_ntb_params_ndp_in_payload_remainder = -1; static int hf_usb_com_get_ntb_params_ndp_in_alignment = -1; static int hf_usb_com_get_ntb_params_reserved = -1; static int hf_usb_com_get_ntb_params_ntb_out_max_size = -1; static int hf_usb_com_get_ntb_params_ndp_out_divisor = -1; static int hf_usb_com_get_ntb_params_ndp_out_payload_remainder = -1; static int hf_usb_com_get_ntb_params_ndp_out_alignment = -1; static int hf_usb_com_get_ntb_params_ntb_out_max_datagrams = -1; static int hf_usb_com_get_net_address_eui48 = -1; static int hf_usb_com_set_net_address_eui48 = -1; static int hf_usb_com_get_ntb_format_ntb_format = -1; static int hf_usb_com_set_ntb_format_ntb_format = -1; static int hf_usb_com_get_ntb_input_size_ntb_in_max_size = -1; static int hf_usb_com_get_ntb_input_size_ntb_in_max_datagrams = -1; static int hf_usb_com_get_ntb_input_size_reserved = -1; static int hf_usb_com_set_ntb_input_size_ntb_in_max_size = -1; static int hf_usb_com_set_ntb_input_size_ntb_in_max_datagrams = -1; static int hf_usb_com_set_ntb_input_size_reserved = -1; static int hf_usb_com_get_max_datagram_size_size = -1; static int hf_usb_com_set_max_datagram_size_size = -1; static int hf_usb_com_get_crc_mode_crc_mode = -1; static int hf_usb_com_set_crc_mode_crc_mode = -1; static int hf_usb_com_capabilities = -1; static int hf_usb_com_descriptor_acm_capabilities_reserved = -1; static int hf_usb_com_descriptor_acm_capabilities_network_connection = -1; static int hf_usb_com_descriptor_acm_capabilities_send_break = -1; static int hf_usb_com_descriptor_acm_capabilities_line_and_state = -1; static int hf_usb_com_descriptor_acm_capabilities_comm_features = -1; static int hf_usb_com_descriptor_control_interface = -1; static int hf_usb_com_descriptor_subordinate_interface = -1; static int hf_usb_com_descriptor_cm_capabilities_reserved = -1; static int hf_usb_com_descriptor_cm_capabilities_call_management_over_data_class_interface = -1; static int hf_usb_com_descriptor_cm_capabilities_call_management = -1; static int hf_usb_com_descriptor_cm_data_interface = -1; static int hf_usb_com_descriptor_ecm_mac_address = -1; static int hf_usb_com_descriptor_ecm_eth_stats = -1; static int hf_usb_com_descriptor_ecm_eth_stats_reserved = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_late_collisions = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_times_crs_lost = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_heartbeat_failure = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_underrun = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rcv_overrun = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_max_collisions = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_deferred = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_more_collisions = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_one_collision = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rcv_error_alignment = -1; static int hf_usb_com_descriptor_ecm_eth_stats_transmit_queue_length = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rcv_crc_error = -1; static int hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_directed_frames_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_rcv = -1; static int hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_directed_frames_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_xmit = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rcv_no_buffer = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rcv_error = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_error = -1; static int hf_usb_com_descriptor_ecm_eth_stats_rvc_ok = -1; static int hf_usb_com_descriptor_ecm_eth_stats_xmit_ok = -1; static int hf_usb_com_descriptor_ecm_max_segment_size = -1; static int hf_usb_com_descriptor_ecm_nb_mc_filters = -1; static int hf_usb_com_descriptor_ecm_nb_mc_filters_mc_address_filtering = -1; static int hf_usb_com_descriptor_ecm_nb_mc_filters_nb_filters_supported = -1; static int hf_usb_com_descriptor_ecm_nb_power_filters = -1; static int hf_usb_com_interrupt_request_type = -1; static int hf_usb_com_interrupt_notif_code = -1; static int hf_usb_com_interrupt_value = -1; static int hf_usb_com_interrupt_value_nw_conn = -1; static int hf_usb_com_interrupt_index = -1; static int hf_usb_com_interrupt_length = -1; static int hf_usb_com_interrupt_dl_bitrate = -1; static int hf_usb_com_interrupt_ul_bitrate = -1; static int hf_usb_com_interrupt_payload = -1; static gint ett_usb_com = -1; static gint ett_usb_com_capabilities = -1; static gint ett_usb_com_bitmap = -1; static gint ett_usb_com_descriptor_ecm_eth_stats = -1; static gint ett_usb_com_descriptor_ecm_nb_mc_filters = -1; static dissector_handle_t mbim_control_handle; static dissector_handle_t mbim_descriptor_handle; static dissector_handle_t mbim_bulk_handle; static dissector_handle_t eth_withoutfcs_handle; static expert_field ei_unexpected_controlling_iface = EI_INIT; static wmem_tree_t* controlling_ifaces = NULL; typedef struct _controlling_iface { guint16 interfaceClass; guint16 interfaceSubclass; guint16 interfaceProtocol; } controlling_iface_t; #define CS_INTERFACE 0x24 #define CS_ENDPOINT 0x25 static const value_string usb_com_descriptor_type_vals[] = { { CS_INTERFACE, "CS_INTERFACE"}, { CS_ENDPOINT, "CS_ENDPOINT"}, { 0, NULL} }; static value_string_ext usb_com_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(usb_com_descriptor_type_vals); static const value_string usb_com_descriptor_subtype_vals[] = { { 0x00, "Header Functional Descriptor"}, { 0x01, "Call Management Functional Descriptor"}, { 0x02, "Abstract Control Management Functional Descriptor"}, { 0x03, "Direct Line Management Functional Descriptor"}, { 0x04, "Telephone Ringer Functional Descriptor"}, { 0x05, "Telephone Call and Line State Reporting Capabilities Functional Descriptor"}, { 0x06, "Union Functional Descriptor"}, { 0x07, "Country Selection Functional Descriptor"}, { 0x08, "Telephone Operational Modes Functional Descriptor"}, { 0x09, "USB Terminal Functional Descriptor"}, { 0x0A, "Network Channel Terminal Descriptor"}, { 0x0B, "Protocol Unit Functional Descriptor"}, { 0x0C, "Extension Unit Functional Descriptor"}, { 0x0D, "Multi-Channel Management Functional Descriptor"}, { 0x0E, "CAPI Control Management Functional Descriptor"}, { 0x0F, "Ethernet Networking Functional Descriptor"}, { 0x10, "ATM Networking Functional Descriptor"}, { 0x11, "Wireless Handset Control Model Functional Descriptor"}, { 0x12, "Mobile Direct Line Model Functional Descriptor"}, { 0x13, "MDLM Detail Functional Descriptor"}, { 0x14, "Device Management Model Functional Descriptor"}, { 0x15, "OBEX Functional Descriptor"}, { 0x16, "Command Set Functional Descriptor"}, { 0x17, "Command Set Detail Functional Descriptor"}, { 0x18, "Telephone Control Model Functional Descriptor"}, { 0x19, "OBEX Service Identifier Functional Descriptor"}, { 0x1A, "NCM Functional Descriptor"}, { 0x1B, "MBIM Functional Descriptor"}, { 0x1C, "MBIM Extended Functional Descriptor"}, { 0, NULL} }; static value_string_ext usb_com_descriptor_subtype_vals_ext = VALUE_STRING_EXT_INIT(usb_com_descriptor_subtype_vals); #define COM_SUBCLASS_RESERVED 0x00 #define COM_SUBCLASS_DLCM 0x01 #define COM_SUBCLASS_ACM 0x02 #define COM_SUBCLASS_TCM 0x03 #define COM_SUBCLASS_MCCM 0x04 #define COM_SUBCLASS_CCM 0x05 #define COM_SUBCLASS_ENCM 0x06 #define COM_SUBCLASS_ANCM 0x07 #define COM_SUBCLASS_WHCM 0x08 #define COM_SUBCLASS_DM 0x09 #define COM_SUBCLASS_MDLM 0x0a #define COM_SUBCLASS_OBEX 0x0b #define COM_SUBCLASS_EEM 0x0c #define COM_SUBCLASS_NCM 0x0d #define COM_SUBCLASS_MBIM 0x0e static const value_string usb_com_subclass_vals[] = { {COM_SUBCLASS_RESERVED, "RESERVED"}, {COM_SUBCLASS_DLCM, "Direct Line Control Model"}, {COM_SUBCLASS_ACM, "Abstract Control Model"}, {COM_SUBCLASS_TCM, "Telephone Control Model"}, {COM_SUBCLASS_MCCM, "Multi-Channel Control Model"}, {COM_SUBCLASS_CCM, "CAPI Control Model"}, {COM_SUBCLASS_ENCM, "Ethernet Networking Control Model"}, {COM_SUBCLASS_ANCM, "ATM Networking Control Model"}, {COM_SUBCLASS_WHCM, "Wireless Handset Control Model"}, {COM_SUBCLASS_DM, "Device Management"}, {COM_SUBCLASS_MDLM, "Mobile Direct Line Model"}, {COM_SUBCLASS_OBEX, "OBEX"}, {COM_SUBCLASS_EEM, "Ethernet Emulation Model"}, {COM_SUBCLASS_NCM, "Network Control Model"}, {COM_SUBCLASS_MBIM, "Mobile Broadband Interface Model"}, {0, NULL} }; value_string_ext ext_usb_com_subclass_vals = VALUE_STRING_EXT_INIT(usb_com_subclass_vals); #define SEND_ENCAPSULATED_COMMAND 0x00 #define GET_ENCAPSULATED_RESPONSE 0x01 #define SET_COMM_FEATURE 0x02 #define GET_COMM_FEATURE 0x03 #define CLEAR_COMM_FEATURE 0x04 #define RESET_FUNCTION 0x05 #define SET_AUX_LINE_STATE 0x10 #define SET_HOOK_STATE 0x11 #define PULSE_SETUP 0x12 #define SEND_PULSE 0x13 #define SET_PULSE_TIME 0x14 #define RING_AUX_JACK 0x15 #define SET_LINE_CODING 0x20 #define GET_LINE_CODING 0x21 #define SET_CONTROL_LINE_STATE 0x22 #define SEND_BREAK 0x23 #define SET_RINGER_PARMS 0x30 #define GET_RINGER_PARMS 0x31 #define SET_OPERATION_PARMS 0x32 #define GET_OPERATION_PARMS 0x33 #define SET_LINE_PARMS 0x34 #define GET_LINE_PARMS 0x35 #define DIAL_DIGITS 0x36 #define SET_UNIT_PARAMETER 0x37 #define GET_UNIT_PARAMETER 0x38 #define CLEAR_UNIT_PARAMETER 0x39 #define GET_PROFILE 0x3a #define SET_ETHERNET_MULTICAST_FILTERS 0x40 #define SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x41 #define GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42 #define SET_ETHERNET_PACKET_FILTER 0x43 #define GET_ETHERNET_STATISTIC 0x44 #define SET_ATM_DATA_FORMAT 0x50 #define GET_ATM_DEVICE_STATISTICS 0x51 #define SET_ATM_DEFAULT_VC 0x52 #define GET_ATM_VC_STATISTICS 0x53 #define GET_NTB_PARAMETERS 0x80 #define GET_NET_ADDRESS 0x81 #define SET_NET_ADDRESS 0x82 #define GET_NTB_FORMAT 0x83 #define SET_NTB_FORMAT 0x84 #define GET_NTB_INPUT_SIZE 0x85 #define SET_NTB_INPUT_SIZE 0x86 #define GET_MAX_DATAGRAM_SIZE 0x87 #define SET_MAX_DATAGRAM_SIZE 0x88 #define GET_CRC_MODE 0x89 #define SET_CRC_MODE 0x8a static const value_string usb_com_setup_request_vals[] = { {SEND_ENCAPSULATED_COMMAND, "SEND ENCAPSULATED COMMAND"}, {GET_ENCAPSULATED_RESPONSE, "GET ENCAPSULATED RESPONSE"}, {SET_COMM_FEATURE, "SET COMM FEATURE"}, {GET_COMM_FEATURE, "GET COMM FEATURE"}, {CLEAR_COMM_FEATURE, "CLEAR COMM FEATURE"}, {RESET_FUNCTION, "RESET FUNCTION"}, {SET_AUX_LINE_STATE, "SET AUX LINE STATE"}, {SET_HOOK_STATE, "SET HOOK STATE"}, {PULSE_SETUP, "PULSE SETUP"}, {SEND_PULSE, "SEND PULSE"}, {SET_PULSE_TIME, "SET PULSE TIME"}, {RING_AUX_JACK, "RING AUX JACK"}, {SET_LINE_CODING, "SET LINE CODING"}, {GET_LINE_CODING, "GET LINE CODING"}, {SET_CONTROL_LINE_STATE, "SET CONTROL LINE STATE"}, {SEND_BREAK, "SEND BREAK"}, {SET_RINGER_PARMS, "SET RINGER PARMS"}, {GET_RINGER_PARMS, "GET RINGER PARMS"}, {SET_OPERATION_PARMS, "SET OPERATION PARMS"}, {GET_OPERATION_PARMS, "GET OPERATION PARMS"}, {SET_LINE_PARMS, "SET LINE PARMS"}, {GET_LINE_PARMS, "GET LINE PARMS"}, {DIAL_DIGITS, "DIAL DIGITS"}, {SET_UNIT_PARAMETER, "SET UNIT PARAMETER"}, {GET_UNIT_PARAMETER, "GET UNIT PARAMETER"}, {CLEAR_UNIT_PARAMETER, "CLEAR UNIT PARAMETER"}, {GET_PROFILE, "GET PROFILE"}, {SET_ETHERNET_MULTICAST_FILTERS, "SET ETHERNET MULTICAST FILTERS"}, {SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER, "SET ETHERNET POWER MANAGEMENT PATTERN FILTER"}, {GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER, "GET ETHERNET POWER MANAGEMENT PATTERN FILTER"}, {SET_ETHERNET_PACKET_FILTER, "SET ETHERNET PACKET FILTER"}, {GET_ETHERNET_STATISTIC, "GET ETHERNET STATISTIC"}, {SET_ATM_DATA_FORMAT, "SET ATM DATA FORMAT"}, {GET_ATM_DEVICE_STATISTICS, "GET ATM DEVICE STATISTICS"}, {SET_ATM_DEFAULT_VC, "SET ATM DEFAULT VC"}, {GET_ATM_VC_STATISTICS, "GET ATM VC STATISTICS"}, {GET_NTB_PARAMETERS, "GET NTB PARAMETERS"}, {GET_NET_ADDRESS, "GET NET ADDRESS"}, {SET_NET_ADDRESS, "SET NET ADDRESS"}, {GET_NTB_FORMAT, "GET NTB FORMAT"}, {SET_NTB_FORMAT, "SET NTB FORMAT"}, {GET_NTB_INPUT_SIZE, "GET NTB INPUT SIZE"}, {SET_NTB_INPUT_SIZE, "SET NTB INPUT SIZE"}, {GET_MAX_DATAGRAM_SIZE, "GET MAX DATAGRAM SIZE"}, {SET_MAX_DATAGRAM_SIZE, "SET MAX DATAGRAM SIZE"}, {GET_CRC_MODE, "GET CRC MODE"}, {SET_CRC_MODE, "SET CRC MODE"}, {0, NULL} }; static value_string_ext usb_com_setup_request_vals_ext = VALUE_STRING_EXT_INIT(usb_com_setup_request_vals); static int * const usb_com_get_ntb_params_ntb_formats_supported_fields[] = { &hf_usb_com_get_ntb_params_ntb_formats_supported_16bit, &hf_usb_com_get_ntb_params_ntb_formats_supported_32bit, NULL }; static const value_string usb_com_ntb_format_vals[] = { { 0x0000, "NTB-16"}, { 0x0001, "NTB-32"}, {0, NULL} }; static const value_string usb_com_crc_mode_vals[] = { { 0x0000, "CRCs shall not be appended"}, { 0x0001, "CRCs shall be appended"}, {0, NULL} }; static int * const ecm_eth_stats[] = { &hf_usb_com_descriptor_ecm_eth_stats_reserved, &hf_usb_com_descriptor_ecm_eth_stats_xmit_late_collisions, &hf_usb_com_descriptor_ecm_eth_stats_xmit_times_crs_lost, &hf_usb_com_descriptor_ecm_eth_stats_xmit_heartbeat_failure, &hf_usb_com_descriptor_ecm_eth_stats_xmit_underrun, &hf_usb_com_descriptor_ecm_eth_stats_rcv_overrun, &hf_usb_com_descriptor_ecm_eth_stats_xmit_max_collisions, &hf_usb_com_descriptor_ecm_eth_stats_xmit_deferred, &hf_usb_com_descriptor_ecm_eth_stats_xmit_more_collisions, &hf_usb_com_descriptor_ecm_eth_stats_xmit_one_collision, &hf_usb_com_descriptor_ecm_eth_stats_rcv_error_alignment, &hf_usb_com_descriptor_ecm_eth_stats_transmit_queue_length, &hf_usb_com_descriptor_ecm_eth_stats_rcv_crc_error, &hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_rcv, &hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_rcv, &hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_rcv, &hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_rcv, &hf_usb_com_descriptor_ecm_eth_stats_directed_frames_rcv, &hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_rcv, &hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_xmit, &hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_xmit, &hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_xmit, &hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_xmit, &hf_usb_com_descriptor_ecm_eth_stats_directed_frames_xmit, &hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_xmit, &hf_usb_com_descriptor_ecm_eth_stats_rcv_no_buffer, &hf_usb_com_descriptor_ecm_eth_stats_rcv_error, &hf_usb_com_descriptor_ecm_eth_stats_xmit_error, &hf_usb_com_descriptor_ecm_eth_stats_rvc_ok, &hf_usb_com_descriptor_ecm_eth_stats_xmit_ok, NULL }; static const true_false_string usb_com_ecm_mc_address_filtering = { "Imperfect", "Perfect" }; static int * const ecm_nb_mc_filters[] = { &hf_usb_com_descriptor_ecm_nb_mc_filters_mc_address_filtering, &hf_usb_com_descriptor_ecm_nb_mc_filters_nb_filters_supported, NULL }; #define NETWORK_CONNECTION 0x00 #define RESPONSE_AVAILABLE 0x01 #define AUX_JACK_HOOK_STATE 0x08 #define RING_DETECT 0x09 #define SERIAL_STATE 0x20 #define CALL_STATE_CHANGE 0x28 #define LINE_STATE_CHANGE 0x29 #define CONNECTION_SPEED_CHANGE 0x2a static const value_string usb_com_interrupt_notif_code_vals[] = { {NETWORK_CONNECTION, "NETWORK CONNECTION"}, {RESPONSE_AVAILABLE, "RESPONSE AVAILABLE"}, {AUX_JACK_HOOK_STATE, "AUX JACK HOOK STATE"}, {RING_DETECT, "RING DETECT"}, {SERIAL_STATE, "SERIAL STATE"}, {CALL_STATE_CHANGE, "CALL STATE CHANGE"}, {LINE_STATE_CHANGE, "LINE STATE CHANGE"}, {CONNECTION_SPEED_CHANGE, "CONNECTION SPEED CHANGE"}, {0, NULL} }; static const value_string usb_com_interrupt_value_nw_conn_vals[] = { {0, "Disconnect"}, {1, "Connected"}, {0, NULL} }; void proto_register_usb_com(void); void proto_reg_handoff_usb_com(void); static int dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; guint8 offset = 0, type, subtype; proto_tree *subtree; proto_tree *subtree_capabilities; proto_item *subitem_capabilities; if (!usb_conv_info) { return 0; } subtree = proto_tree_add_subtree(tree, tvb, offset, tvb_captured_length(tvb), ett_usb_com, NULL, "COMMUNICATIONS DESCRIPTOR"); dissect_usb_descriptor_header(subtree, tvb, offset, &usb_com_descriptor_type_vals_ext); offset += 2; type = tvb_get_guint8(tvb, 1); switch (type) { case CS_INTERFACE: subtype = tvb_get_guint8(tvb, offset); proto_tree_add_uint(subtree, hf_usb_com_descriptor_subtype, tvb, offset, 1, subtype); offset++; switch (subtype) { case 0x00: proto_tree_add_item(subtree, hf_usb_com_descriptor_cdc, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; case 0x01: subitem_capabilities = proto_tree_add_item(subtree, hf_usb_com_capabilities, tvb, 3, 1, ENC_LITTLE_ENDIAN); subtree_capabilities = proto_item_add_subtree(subitem_capabilities, ett_usb_com_capabilities); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_reserved, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_call_management_over_data_class_interface, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_cm_capabilities_call_management, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_usb_com_descriptor_cm_data_interface, tvb, 4, 1, ENC_LITTLE_ENDIAN); offset = 5; break; case 0x02: subitem_capabilities = proto_tree_add_item(subtree, hf_usb_com_capabilities, tvb, 3, 1, ENC_LITTLE_ENDIAN); subtree_capabilities = proto_item_add_subtree(subitem_capabilities, ett_usb_com_capabilities); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_reserved, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_network_connection, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_send_break, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_line_and_state, tvb, 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree_capabilities, hf_usb_com_descriptor_acm_capabilities_comm_features, tvb, 3, 1, ENC_LITTLE_ENDIAN); offset = 4; break; case 0x06: { proto_item *control_item; guint32 k_bus_id; guint32 k_device_address; guint32 k_subordinate_id; guint32 k_frame_number; wmem_tree_key_t key[] = { { .length = 1, .key = &k_bus_id }, { .length = 1, .key = &k_device_address }, { .length = 1, .key = &k_subordinate_id }, { .length = 1, .key = &k_frame_number }, { .length = 0, .key = NULL }, }; controlling_iface_t *master_info = NULL; guint32 master; k_bus_id = usb_conv_info->bus_id; k_device_address = usb_conv_info->device_address; k_frame_number = pinfo->num; control_item = proto_tree_add_item_ret_uint(subtree, hf_usb_com_descriptor_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN, &master); if (master != usb_conv_info->interfaceNum) { expert_add_info(pinfo, control_item, &ei_unexpected_controlling_iface); } else if (!PINFO_FD_VISITED(pinfo)) { master_info = wmem_new(wmem_file_scope(), controlling_iface_t); master_info->interfaceClass = usb_conv_info->interfaceClass; master_info->interfaceSubclass = usb_conv_info->interfaceSubclass; master_info->interfaceProtocol = usb_conv_info->interfaceProtocol; } offset += 1; while (tvb_reported_length_remaining(tvb,offset) > 0) { proto_tree_add_item_ret_uint(subtree, hf_usb_com_descriptor_subordinate_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN, &k_subordinate_id); offset += 1; if (master_info) { wmem_tree_insert32_array(controlling_ifaces, key, master_info); } } break; } case 0x0f: proto_tree_add_item(subtree, hf_usb_com_descriptor_ecm_mac_address, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_bitmask_with_flags(subtree, tvb, offset, hf_usb_com_descriptor_ecm_eth_stats, ett_usb_com_descriptor_ecm_eth_stats, ecm_eth_stats, ENC_LITTLE_ENDIAN, BMT_NO_APPEND); offset += 4; proto_tree_add_item(subtree, hf_usb_com_descriptor_ecm_max_segment_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask_with_flags(subtree, tvb, offset, hf_usb_com_descriptor_ecm_nb_mc_filters, ett_usb_com_descriptor_ecm_nb_mc_filters, ecm_nb_mc_filters, ENC_LITTLE_ENDIAN, BMT_NO_APPEND); offset += 2; proto_tree_add_item(subtree, hf_usb_com_descriptor_ecm_nb_power_filters, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; case 0x1b: case 0x1c: offset = call_dissector_only(mbim_descriptor_handle, tvb, pinfo, subtree, data); break; default: break; } break; case CS_ENDPOINT: default: break; } if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_descriptor_payload, tvb, offset, -1, ENC_NA); } return tvb_captured_length(tvb); } static int dissect_usb_com_get_ntb_params(tvbuff_t *tvb, proto_tree *tree, gint base_offset) { gint offset = base_offset; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_com_get_ntb_params_ntb_formats_supported, ett_usb_com_bitmap, usb_com_get_ntb_params_ntb_formats_supported_fields, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ntb_in_max_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_in_divisor, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_in_payload_remainder, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_in_alignment, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ntb_out_max_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_out_divisor, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_out_payload_remainder, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ndp_out_alignment, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_com_get_ntb_params_ntb_out_max_datagrams, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_com_ntb_input_size(tvbuff_t *tvb, proto_tree *tree, gint base_offset, gboolean is_set) { gint offset = base_offset; proto_tree_add_item(tree, is_set ? hf_usb_com_set_ntb_input_size_ntb_in_max_size : hf_usb_com_get_ntb_input_size_ntb_in_max_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(tree, is_set ? hf_usb_com_set_ntb_input_size_ntb_in_max_datagrams : hf_usb_com_get_ntb_input_size_ntb_in_max_datagrams, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, is_set ? hf_usb_com_set_ntb_input_size_reserved : hf_usb_com_get_ntb_input_size_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } return offset; } static int dissect_usb_com_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; usb_trans_info_t *usb_trans_info; proto_tree *subtree; proto_item *ti; gint offset = 0; gboolean is_request; if (tvb_reported_length(tvb) == 0) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCOM"); ti = proto_tree_add_item(tree, proto_usb_com, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_usb_com); if (usb_conv_info) { usb_trans_info = usb_conv_info->usb_trans_info; ti = proto_tree_add_uint(subtree, hf_usb_com_control_subclass, tvb, 0, 0, usb_conv_info->interfaceSubclass); proto_item_set_generated(ti); is_request = (pinfo->srcport==NO_ENDPOINT); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str_ext(usb_trans_info->setup.request, &usb_com_setup_request_vals_ext, "Unknown type %x"), is_request ? "Request" : "Response"); if (is_request) { proto_tree_add_item(subtree, hf_usb_com_control_request_code, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(subtree, hf_usb_com_control_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_control_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_control_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } else { ti = proto_tree_add_uint(subtree, hf_usb_com_control_response_code, tvb, 0, 0, usb_trans_info->setup.request); proto_item_set_generated(ti); } switch (usb_trans_info->setup.request) { case SEND_ENCAPSULATED_COMMAND: if ((usb_conv_info->interfaceSubclass == COM_SUBCLASS_MBIM) && is_request) { tvbuff_t *mbim_tvb = tvb_new_subset_remaining(tvb, offset); offset += call_dissector_only(mbim_control_handle, mbim_tvb, pinfo, tree, usb_conv_info); } break; case GET_ENCAPSULATED_RESPONSE: if ((usb_conv_info->interfaceSubclass == COM_SUBCLASS_MBIM) && !is_request) { offset += call_dissector_only(mbim_control_handle, tvb, pinfo, tree, usb_conv_info); } break; case GET_NTB_PARAMETERS: if (!is_request) { offset = dissect_usb_com_get_ntb_params(tvb, subtree, offset); } break; case GET_NET_ADDRESS: if (!is_request) { proto_tree_add_item(subtree, hf_usb_com_get_net_address_eui48, tvb, offset, 6, ENC_NA); offset += 6; } break; case SET_NET_ADDRESS: if (is_request) { proto_tree_add_item(subtree, hf_usb_com_set_net_address_eui48, tvb, offset, 6, ENC_NA); offset += 6; } break; case GET_NTB_FORMAT: if (!is_request) { proto_tree_add_item(subtree, hf_usb_com_get_ntb_format_ntb_format, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } break; case SET_NTB_FORMAT: if (is_request) { proto_tree_add_item(subtree, hf_usb_com_set_ntb_format_ntb_format, tvb, offset-6, 2, ENC_LITTLE_ENDIAN); } break; case GET_NTB_INPUT_SIZE: if (!is_request) { offset = dissect_usb_com_ntb_input_size(tvb, subtree, offset, FALSE); } break; case SET_NTB_INPUT_SIZE: if (!is_request) { offset = dissect_usb_com_ntb_input_size(tvb, subtree, offset, TRUE); } break; case GET_MAX_DATAGRAM_SIZE: if (!is_request) { proto_tree_add_item(subtree, hf_usb_com_get_max_datagram_size_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } break; case SET_MAX_DATAGRAM_SIZE: if (is_request) { proto_tree_add_item(subtree, hf_usb_com_set_max_datagram_size_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } break; case GET_CRC_MODE: if (!is_request) { proto_tree_add_item(subtree, hf_usb_com_get_crc_mode_crc_mode, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } break; case SET_CRC_MODE: if (is_request) { proto_tree_add_item(subtree, hf_usb_com_set_crc_mode_crc_mode, tvb, offset-6, 2, ENC_LITTLE_ENDIAN); } break; default: break; } } if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_control_payload, tvb, offset, -1, ENC_NA); } return tvb_captured_length(tvb); } static int dissect_usb_com_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; guint32 k_bus_id; guint32 k_device_address; guint32 k_subordinate_id; wmem_tree_key_t key[] = { { .length = 1, .key = &k_bus_id }, { .length = 1, .key = &k_device_address }, { .length = 1, .key = &k_subordinate_id }, { .length = 0, .key = NULL }, }; wmem_tree_t *wmem_tree; controlling_iface_t *master_iface = NULL; if (!usb_conv_info) { return 0; } if ((usb_conv_info->interfaceClass != IF_CLASS_CDC_DATA) || (usb_conv_info->interfaceSubclass != 0)) { /* As per Communications Device Class Revision 1.2 subclass is currently unused for CDC Data and should be zero * If it is not, then we are either dealing with malformed descriptor or a new CDC Revision. */ return 0; } k_bus_id = usb_conv_info->bus_id; k_device_address = usb_conv_info->device_address; k_subordinate_id = usb_conv_info->interfaceNum; wmem_tree = (wmem_tree_t*)wmem_tree_lookup32_array(controlling_ifaces, key); if (wmem_tree) { master_iface = (controlling_iface_t *)wmem_tree_lookup32_le(wmem_tree, pinfo->num); } if (master_iface) { if (master_iface->interfaceClass == IF_CLASS_COMMUNICATIONS) { if ((master_iface->interfaceSubclass == COM_SUBCLASS_ENCM) && (master_iface->interfaceProtocol == 0) && (usb_conv_info->interfaceProtocol == 0)) { /* Ethernet without FCS */ return call_dissector_only(eth_withoutfcs_handle, tvb, pinfo, tree, NULL); } } } switch (usb_conv_info->interfaceProtocol) { case 0x01: /* Network Transfer Block */ case 0x02: /* Network Transfer Block (IP + DSS) */ return call_dissector_only(mbim_bulk_handle, tvb, pinfo, tree, NULL); default: break; } /* Unknown (class, subclass, protocol) tuple. Do not attempt dissection. */ return 0; } static int dissect_usb_com_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_tree *subtree; proto_item *it; guint32 notif_code; gint offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCOM"); it = proto_tree_add_item(tree, proto_usb_com, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(it, ett_usb_com); proto_tree_add_item(subtree, hf_usb_com_interrupt_request_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item_ret_uint(subtree, hf_usb_com_interrupt_notif_code, tvb, offset, 1, ENC_LITTLE_ENDIAN, &notif_code); offset++; col_add_str(pinfo->cinfo, COL_INFO, val_to_str(notif_code, usb_com_interrupt_notif_code_vals, "Unknown type %x")); switch (notif_code) { case NETWORK_CONNECTION: proto_tree_add_item(subtree, hf_usb_com_interrupt_value_nw_conn, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; case RESPONSE_AVAILABLE: proto_tree_add_item(subtree, hf_usb_com_interrupt_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; case CONNECTION_SPEED_CHANGE: proto_tree_add_item(subtree, hf_usb_com_interrupt_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_usb_com_interrupt_dl_bitrate, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(subtree, hf_usb_com_interrupt_ul_bitrate, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; break; default: break; } if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(subtree, hf_usb_com_interrupt_payload, tvb, offset, -1, ENC_NA); } return tvb_captured_length(tvb); } void proto_register_usb_com(void) { static hf_register_info hf[] = { { &hf_usb_com_descriptor_subtype, { "Descriptor Subtype", "usbcom.descriptor.subtype", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_com_descriptor_subtype_vals_ext, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_cdc, { "CDC", "usbcom.descriptor.cdc", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_payload, { "Payload", "usbcom.descriptor.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_subclass, { "Subclass", "usbcom.control.subclass", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ext_usb_com_subclass_vals, 0, NULL, HFILL }}, { &hf_usb_com_control_request_code, { "Request Code", "usbcom.control.request_code", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_com_setup_request_vals_ext, 0, NULL, HFILL }}, { &hf_usb_com_control_value, { "Value", "usbcom.control.value", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_index, { "Index", "usbcom.control.index", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_length, { "Length", "usbcom.control.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_control_response_code, { "Response Code", "usbcom.control.response_code", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_com_setup_request_vals_ext, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_length, { "Length", "usbcom.control.get_ntb_params.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_formats_supported, { "NTB Formats Supported", "usbcom.control.get_ntb_params.ntb_formats_supported", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_formats_supported_16bit, { "16-bit NTB", "usbcom.control.get_ntb_params.ntb_formats_supported.16bit", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_formats_supported_32bit, { "32-bit NTB", "usbcom.control.get_ntb_params.ntb_formats_supported.32bit", FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_in_max_size, { "NTB IN Max Size", "usbcom.control.get_ntb_params.ntb_in_max_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_in_divisor, { "NDP IN Divisor", "usbcom.control.get_ntb_params.ndp_in_divisor", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_in_payload_remainder, { "NDP IN Payload Remainder", "usbcom.control.get_ntb_params.ndp_in_payload_remainder", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_in_alignment, { "NDP IN Alignment", "usbcom.control.get_ntb_params.ndp_in_alignment", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_reserved, { "Reserved", "usbcom.control.get_ntb_params.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_out_max_size, { "NTB OUT Max Size", "usbcom.control.get_ntb_params.ntb_out_max_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_out_divisor, { "NDP OUT Divisor", "usbcom.control.get_ntb_params.ndp_out_divisor", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_out_payload_remainder, { "NDP OUT Payload Remainder", "usbcom.control.get_ntb_params.ndp_out_payload_remainder", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ndp_out_alignment, { "NDP OUT Alignment", "usbcom.control.get_ntb_params.ndp_out_alignment", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_params_ntb_out_max_datagrams, { "NTB OUT Max Datagrams", "usbcom.control.get_ntb_params.ntb_out_max_datagrams", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_net_address_eui48, { "EUI-48", "usbcom.control.get_net_address.eui48", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usb_com_set_net_address_eui48, { "EUI-48", "usbcom.control.set_net_address.eui48", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_format_ntb_format, { "NTB Format", "usbcom.control.get_net_address.ntb_format", FT_UINT16, BASE_HEX, VALS(usb_com_ntb_format_vals), 0, NULL, HFILL }}, { &hf_usb_com_set_ntb_format_ntb_format, { "NTB Format", "usbcom.control.set_net_address.ntb_format", FT_UINT16, BASE_HEX, VALS(usb_com_ntb_format_vals), 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_input_size_ntb_in_max_size, { "NTB IN Max Size", "usbcom.control.get_ntb_input_size.ntb_in_max_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_input_size_ntb_in_max_datagrams, { "NTB IN Max Datagrams", "usbcom.control.get_ntb_input_size.ntb_in_max_datagrams", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_ntb_input_size_reserved, { "Reserved", "usbcom.control.get_ntb_input_size.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_set_ntb_input_size_ntb_in_max_size, { "NTB IN Max Size", "usbcom.control.set_ntb_input_size.ntb_in_max_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_set_ntb_input_size_ntb_in_max_datagrams, { "NTB IN Max Datagrams", "usbcom.control.set_ntb_input_size.ntb_in_max_datagrams", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_set_ntb_input_size_reserved, { "Reserved", "usbcom.control.set_ntb_input_size.reserved", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_max_datagram_size_size, { "Max Datagram Size", "usbcom.control.get_max_datagram_size.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_set_max_datagram_size_size, { "Max Datagram Size", "usbcom.control.set_max_datagram_size.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_get_crc_mode_crc_mode, { "CRC Mode", "usbcom.control.get_crc_mode.crc_mode", FT_UINT16, BASE_HEX, VALS(usb_com_crc_mode_vals), 0, NULL, HFILL }}, { &hf_usb_com_set_crc_mode_crc_mode, { "CRC Mode", "usbcom.control.set_crc_mode.crc_mode", FT_UINT16, BASE_HEX, VALS(usb_com_crc_mode_vals), 0, NULL, HFILL }}, { &hf_usb_com_control_payload, { "Payload", "usbcom.control.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usb_com_capabilities, { "bmCapabilities", "usbcom.descriptor.capabilities", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_acm_capabilities_reserved, { "Reserved", "usbcom.descriptor.acm.capabilities.reserved", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL }}, { &hf_usb_com_descriptor_acm_capabilities_network_connection, { "Network_Connection", "usbcom.descriptor.acm.capabilities.network_connection", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }}, { &hf_usb_com_descriptor_acm_capabilities_send_break, { "Send_Break", "usbcom.descriptor.acm.capabilities.send_break", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }}, { &hf_usb_com_descriptor_acm_capabilities_line_and_state, { "Line Requests and State Notification", "usbcom.descriptor.acm.capabilities.line_and_state", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, { &hf_usb_com_descriptor_acm_capabilities_comm_features, { "Comm Features Combinations", "usbcom.descriptor.acm.capabilities.comm_features", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL }}, { &hf_usb_com_descriptor_control_interface, { "Control Interface", "usbcom.descriptor.control_interface", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_subordinate_interface, { "Subordinate Interface", "usbcom.descriptor.subordinate_interface", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_cm_capabilities_reserved, { "Reserved", "usbcom.descriptor.cm.capabilities.reserved", FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL }}, { &hf_usb_com_descriptor_cm_capabilities_call_management_over_data_class_interface, { "Call Management over Data Class Interface", "usbcom.descriptor.cm.capabilities.call_management_over_data_class_interface", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, { &hf_usb_com_descriptor_cm_capabilities_call_management, { "Call Management", "usbcom.descriptor.cm.capabilities.call_management", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL }}, { &hf_usb_com_descriptor_cm_data_interface, { "Data Interface", "usbcom.descriptor.cm.data_interface", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_mac_address, { "MAC Address", "usbcom.descriptor.ecm.mac_address", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats, { "Ethernet Statistics", "usbcom.descriptor.ecm.eth_stats", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_reserved, { "Reserved", "usbcom.descriptor.ecm.eth_stats.reserved", FT_UINT32, BASE_HEX, NULL, 0xe0000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_late_collisions, { "XMIT Late Collisions", "usbcom.descriptor.ecm.eth_stats.xmit_late_collisions", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_times_crs_lost, { "XMIT TImes CRS Lost", "usbcom.descriptor.ecm.eth_stats.xmit_times_crs_lost", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x08000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_heartbeat_failure, { "XMIT Heartbeat Failure", "usbcom.descriptor.ecm.eth_stats.xmit_heartbeat_failure", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x04000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_underrun, { "XMIT Underrun", "usbcom.descriptor.ecm.eth_stats.xmit_underrun", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x02000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rcv_overrun, { "RCV Overrun", "usbcom.descriptor.ecm.eth_stats.rcv_overrun", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_max_collisions, { "XMIT Max Collisions", "usbcom.descriptor.ecm.eth_stats.xmit_max_collisions", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_deferred, { "XMIT Deferred", "usbcom.descriptor.ecm.eth_stats.xmit_deferred", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_more_collisions, { "XMIT More Collisions", "usbcom.descriptor.ecm.eth_stats.xmit_more_collisions", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_one_collision, { "XMIT One Collision", "usbcom.descriptor.ecm.eth_stats.xmit_one_collision", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rcv_error_alignment, { "RCV Error Alignment", "usbcom.descriptor.ecm.eth_stats.rcv_error_alignment", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_transmit_queue_length, { "Transmit Queue Length", "usbcom.descriptor.ecm.eth_stats.transmit_queue_length", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rcv_crc_error, { "RCV CRC Error", "usbcom.descriptor.ecm.eth_stats.rcv_crc_error", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_rcv, { "Broadcast Frames RCV", "usbcom.descriptor.ecm.eth_stats.broadcast_frames_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_rcv, { "Broadcast Bytes RCV", "usbcom.descriptor.ecm.eth_stats.broadcast_bytes_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_rcv, { "Multicast Frames RCV", "usbcom.descriptor.ecm.eth_stats.multicast_frames_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_rcv, { "Multicast Bytes RCV", "usbcom.descriptor.ecm.eth_stats.multicast_bytes_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_directed_frames_rcv, { "Directed Frames RCV", "usbcom.descriptor.ecm.eth_stats.directed_frames_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_rcv, { "Directed Bytes RCV", "usbcom.descriptor.ecm.eth_stats.directed_bytes_rcv", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_broadcast_frames_xmit, { "Broadcast Frames XMIT", "usbcom.descriptor.ecm.eth_stats.broadcast_frames_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_broadcast_bytes_xmit, { "Broadcast Bytes XMIT", "usbcom.descriptor.ecm.eth_stats.broadcast_bytes_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_multicast_frames_xmit, { "Multicast Frames XMIT", "usbcom.descriptor.ecm.eth_stats.multicast_frames_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_multicast_bytes_xmit, { "Multicast Bytes XMIT", "usbcom.descriptor.ecm.eth_stats.multicast_bytes_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_directed_frames_xmit, { "Directed Frames XMIT", "usbcom.descriptor.ecm.eth_stats.directed_frames_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_directed_bytes_xmit, { "Directed Bytes XMIT", "usbcom.descriptor.ecm.eth_stats.directed_bytes_xmit", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rcv_no_buffer, { "RCV No Buffer", "usbcom.descriptor.ecm.eth_stats.rcv_no_buffer", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rcv_error, { "RCV Error", "usbcom.descriptor.ecm.eth_stats.rcv_error", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_error, { "XMIT Error", "usbcom.descriptor.ecm.eth_stats.xmit_error", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_rvc_ok, { "RCV OK", "usbcom.descriptor.ecm.eth_stats.rvc_ok", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_eth_stats_xmit_ok, { "XMIT OK", "usbcom.descriptor.ecm.eth_stats.xmit_ok", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_max_segment_size, { "Max Segment Size", "usbcom.descriptor.ecm.max_segment_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_nb_mc_filters, { "Number MC Filters", "usbcom.descriptor.ecm.nb_mc_filters", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_nb_mc_filters_mc_address_filtering, { "Multicast Address Filtering", "usbcom.descriptor.ecm.nb_mc_filters.mc_address_filtering", FT_BOOLEAN, 16, TFS(&usb_com_ecm_mc_address_filtering), 0x8000, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_nb_mc_filters_nb_filters_supported, { "Number of Multicast Address Filters Supported", "usbcom.descriptor.ecm.nb_mc_filters.nb_filters_supported", FT_UINT16, BASE_DEC, NULL, 0x7fff, NULL, HFILL }}, { &hf_usb_com_descriptor_ecm_nb_power_filters, { "Number Power Filters", "usbcom.descriptor.ecm.nb_power_filters", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_request_type, { "Request Type", "usbcom.interrupt.request_type", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_notif_code, { "Notification Code", "usbcom.interrupt.notification_code", FT_UINT8, BASE_HEX, VALS(usb_com_interrupt_notif_code_vals), 0, NULL, HFILL }}, { &hf_usb_com_interrupt_value, { "Value", "usbcom.interrupt.value", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_value_nw_conn, { "Value", "usbcom.interrupt.value", FT_UINT16, BASE_HEX, VALS(usb_com_interrupt_value_nw_conn_vals), 0, NULL, HFILL }}, { &hf_usb_com_interrupt_index, { "Index", "usbcom.interrupt.index", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_length, { "Length", "usbcom.interrupt.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_dl_bitrate, { "DL Bitrate", "usbcom.interrupt.conn_speed_change.dl_bitrate", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_ul_bitrate, { "UL Bitrate", "usbcom.interrupt.conn_speed_change.ul_bitrate", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0, NULL, HFILL }}, { &hf_usb_com_interrupt_payload, { "Payload", "usbcom.interrupt.payload", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }} }; static gint *usb_com_subtrees[] = { &ett_usb_com, &ett_usb_com_capabilities, &ett_usb_com_bitmap, &ett_usb_com_descriptor_ecm_eth_stats, &ett_usb_com_descriptor_ecm_nb_mc_filters }; static ei_register_info ei[] = { { &ei_unexpected_controlling_iface, { "usbcom.descriptor.control_interface.unexpected_iface", PI_MALFORMED, PI_ERROR, "Unexpected controlling interface index (report to wireshark.org)", EXPFILL }}, }; expert_module_t* expert_usb_com; controlling_ifaces = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); proto_usb_com = proto_register_protocol("USB Communications and CDC Control", "USBCOM", "usbcom"); proto_register_field_array(proto_usb_com, hf, array_length(hf)); proto_register_subtree_array(usb_com_subtrees, array_length(usb_com_subtrees)); expert_usb_com = expert_register_protocol(proto_usb_com); expert_register_field_array(expert_usb_com, ei, array_length(ei)); } void proto_reg_handoff_usb_com(void) { dissector_handle_t usb_com_descriptor_handle, usb_com_control_handle, usb_com_bulk_handle, usb_com_interrupt_handle; usb_com_descriptor_handle = create_dissector_handle(dissect_usb_com_descriptor, proto_usb_com); dissector_add_uint("usb.descriptor", IF_CLASS_COMMUNICATIONS, usb_com_descriptor_handle); usb_com_control_handle = create_dissector_handle(dissect_usb_com_control, proto_usb_com); dissector_add_uint("usb.control", IF_CLASS_COMMUNICATIONS, usb_com_control_handle); usb_com_bulk_handle = create_dissector_handle(dissect_usb_com_bulk, proto_usb_com); dissector_add_uint("usb.bulk", IF_CLASS_CDC_DATA, usb_com_bulk_handle); usb_com_interrupt_handle = create_dissector_handle(dissect_usb_com_interrupt, proto_usb_com); dissector_add_uint("usb.interrupt", IF_CLASS_COMMUNICATIONS, usb_com_interrupt_handle); mbim_control_handle = find_dissector_add_dependency("mbim.control", proto_usb_com); mbim_descriptor_handle = find_dissector_add_dependency("mbim.descriptor", proto_usb_com); mbim_bulk_handle = find_dissector_add_dependency("mbim.bulk", proto_usb_com); eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_usb_com); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-dfu.c
/* packet-usbdfu.c * Routines for USB DFU dissection * * Copyright 2014, Michal Labedzki for Tieto Corporation * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> #include "packet-usb.h" static int proto_usb_dfu = -1; static gint hf_setup_command = -1; static gint hf_setup_unused = -1; static gint hf_setup_interface = -1; static gint hf_setup_length = -1; static gint hf_setup_timeout = -1; static gint hf_setup_block_number = -1; static gint hf_response = -1; static gint hf_command_in_frame = -1; static gint hf_state = -1; static gint hf_status = -1; static gint hf_poll_timeout = -1; static gint hf_iString = -1; static gint hf_data = -1; static gint hf_usb_dfu_descriptor = -1; static gint hf_usb_dfu_descriptor_bmAttributes_reserved = -1; static gint hf_usb_dfu_descriptor_bmAttributes_WillDetach = -1; static gint hf_usb_dfu_descriptor_bmAttributes_ManifestationTolerant = -1; static gint hf_usb_dfu_descriptor_bmAttributes_CanUpload = -1; static gint hf_usb_dfu_descriptor_bmAttributes_CanDownload = -1; static gint hf_usb_dfu_descriptor_wDetachTimeOut = -1; static gint hf_usb_dfu_descriptor_wTransferSize = -1; static gint hf_usb_dfu_descriptor_bcdDFUVersion = -1; static gint ett_usb_dfu = -1; static gint ett_usb_dfu_descriptor = -1; static gint ett_command = -1; static expert_field ei_unexpected_response = EI_INIT; static expert_field ei_unknown_data = EI_INIT; static expert_field ei_unexpected_data = EI_INIT; static expert_field ei_descriptor_invalid_length = EI_INIT; static expert_field ei_invalid_command_for_request_type = EI_INIT; static dissector_handle_t usb_dfu_handle; static wmem_tree_t *command_info = NULL; typedef struct _command_data { guint32 bus_id; guint32 device_address; guint16 interface; guint8 command; guint32 command_frame_number; gint32 block_number; } command_data_t; static const value_string command_vals[] = { { 0x00, "Detach" }, { 0x01, "Download" }, { 0x02, "Upload" }, { 0x03, "Get Status" }, { 0x04, "Clear Status" }, { 0x05, "Get State" }, { 0x06, "Abort" }, { 0x00, NULL } }; static value_string_ext(command_vals_ext) = VALUE_STRING_EXT_INIT(command_vals); static const value_string state_vals[] = { { 0, "appIdle" }, { 1, "appDetach" }, { 2, "dfuIdle" }, { 3, "dfuDownloadSync" }, { 4, "dfuDownloadBusy" }, { 5, "dfuDownloadIdle" }, { 6, "dfuManifestSync" }, { 7, "dfuManifest" }, { 8, "dfuManifestWaitReset" }, { 9, "dfuUploadIdle" }, { 10, "dfuError" }, { 0x00, NULL } }; static value_string_ext(state_vals_ext) = VALUE_STRING_EXT_INIT(state_vals); static const value_string status_vals[] = { { 0x00, "OK" }, { 0x01, "errTarget" }, { 0x02, "errFile" }, { 0x03, "errWrite" }, { 0x04, "errErase" }, { 0x05, "errCheckErased" }, { 0x06, "errProg" }, { 0x07, "errVerify" }, { 0x08, "errAddress" }, { 0x09, "errNotDone" }, { 0x0A, "errFirmware" }, { 0x0B, "errVendor" }, { 0x0C, "errUsbReset" }, { 0x0D, "errPowerOnReset" }, { 0x0E, "errUnknown" }, { 0x0F, "errStalledPkt" }, { 0x00, NULL } }; static value_string_ext(status_vals_ext) = VALUE_STRING_EXT_INIT(status_vals); static const value_string descriptor_type_vals[] = { { 0x21, "DFU FUNCTIONAL" }, { 0x00, NULL } }; static value_string_ext(descriptor_type_vals_ext) = VALUE_STRING_EXT_INIT(descriptor_type_vals); void proto_register_usb_dfu(void); void proto_reg_handoff_usb_dfu(void); static gint dissect_usb_dfu_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *main_item; proto_tree *main_tree; proto_item *length_item; gint offset = 0; guint8 descriptor_length; guint8 descriptor_type; usb_conv_info_t *usb_conv_info = (usb_conv_info_t *) data; if (!usb_conv_info) return offset; if (!(usb_conv_info->interfaceClass == IF_CLASS_APPLICATION_SPECIFIC && usb_conv_info->interfaceSubclass == 0x01)) return offset; descriptor_length = tvb_get_guint8(tvb, offset); descriptor_type = tvb_get_guint8(tvb, offset + 1); switch (descriptor_type) { case 0x21: main_item = proto_tree_add_item(tree, hf_usb_dfu_descriptor, tvb, offset, -1, ENC_NA); main_tree = proto_item_add_subtree(main_item, ett_usb_dfu_descriptor); proto_item_append_text(main_item, ": %s", val_to_str_ext_const(descriptor_type, &descriptor_type_vals_ext, "Unknown")); length_item = dissect_usb_descriptor_header(main_tree, tvb, offset, &descriptor_type_vals_ext); if (descriptor_length != 7 && descriptor_length != 9) expert_add_info(pinfo, length_item, &ei_descriptor_invalid_length); offset += 2; proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bmAttributes_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bmAttributes_WillDetach, tvb, offset, 1, ENC_NA); proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bmAttributes_ManifestationTolerant, tvb, offset, 1, ENC_NA); proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bmAttributes_CanUpload, tvb, offset, 1, ENC_NA); proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bmAttributes_CanDownload, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_wDetachTimeOut, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_wTransferSize, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (descriptor_length > 7) { proto_tree_add_item(main_tree, hf_usb_dfu_descriptor_bcdDFUVersion, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } break; } return offset; } static gint dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *main_item; proto_tree *main_tree; proto_item *command_item; proto_item *sub_item; proto_tree *command_tree; gint offset = 0; gint p2p_dir_save; guint8 command; gint16 command_response = -1; command_data_t *command_data = NULL; wmem_tree_t *wmem_tree; wmem_tree_key_t key[5]; guint32 bus_id; guint32 device_address; guint32 k_bus_id; guint32 k_device_address; guint32 k_frame_number; gint32 block_number = -1; usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; if (!usb_conv_info) return offset; bus_id = usb_conv_info->bus_id; device_address = usb_conv_info->device_address; k_bus_id = bus_id; k_device_address = device_address; k_frame_number = pinfo->num; key[0].length = 1; key[0].key = &k_bus_id; key[1].length = 1; key[1].key = &k_device_address; main_item = proto_tree_add_item(tree, proto_usb_dfu, tvb, offset, -1, ENC_NA); main_tree = proto_item_add_subtree(main_item, ett_usb_dfu); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USB DFU"); p2p_dir_save = pinfo->p2p_dir; pinfo->p2p_dir = (usb_conv_info->is_request) ? P2P_DIR_SENT : P2P_DIR_RECV; switch (pinfo->p2p_dir) { case P2P_DIR_SENT: col_set_str(pinfo->cinfo, COL_INFO, "Sent "); break; case P2P_DIR_RECV: col_set_str(pinfo->cinfo, COL_INFO, "Rcvd "); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction "); break; } if (usb_conv_info->is_setup) { guint16 interface; command_item = proto_tree_add_item(main_tree, hf_setup_command, tvb, offset, 1, ENC_LITTLE_ENDIAN); command = tvb_get_guint8(tvb, offset); if (!((usb_conv_info->setup_requesttype == 0x21 && (command == 0x00 || command == 0x01 || command == 0x04 || command == 0x06)) || (usb_conv_info->setup_requesttype == 0xa1 && (command == 0x02 || command == 0x03 || command == 0x05)))) expert_add_info(pinfo, command_item, &ei_invalid_command_for_request_type); offset += 1; col_append_fstr(pinfo->cinfo, COL_INFO, "Command: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown")); if (command == 0x00) { /* Detach */ proto_tree_add_item(main_tree, hf_setup_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " Timeout=%u", tvb_get_letohs(tvb, offset)); } else if (command == 0x01 || command == 0x02) { /* Download || Upload */ proto_tree_add_item(main_tree, hf_setup_block_number, tvb, offset, 2, ENC_LITTLE_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " Block Number=%u", tvb_get_letohs(tvb, offset)); block_number = tvb_get_letohs(tvb, offset); } else { proto_tree_add_item(main_tree, hf_setup_unused, tvb, offset, 2, ENC_LITTLE_ENDIAN); } offset += 2; proto_tree_add_item(main_tree, hf_setup_interface, tvb, offset, 2, ENC_LITTLE_ENDIAN); interface = tvb_get_letohs(tvb, offset); offset += 2; proto_tree_add_item(main_tree, hf_setup_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (command == 0x01) { /* Download */ proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA); offset = tvb_captured_length(tvb); } if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset)); offset = tvb_captured_length(tvb); } /* Save request info (command_data) */ if (!pinfo->fd->visited && command != 21) { key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; command_data = wmem_new(wmem_file_scope(), command_data_t); command_data->bus_id = bus_id; command_data->device_address = device_address; command_data->command = command; command_data->interface = interface; command_data->command_frame_number = pinfo->num; command_data->block_number = block_number; wmem_tree_insert32_array(command_info, key, command_data); } pinfo->p2p_dir = p2p_dir_save; return offset; } /* Get request info (command_data) */ key[2].length = 0; key[2].key = NULL; wmem_tree = (wmem_tree_t *) wmem_tree_lookup32_array(command_info, key); if (wmem_tree) { command_data = (command_data_t *) wmem_tree_lookup32_le(wmem_tree, pinfo->num); if (command_data) { command_response = command_data->command; block_number = command_data->block_number; } } if (!command_data) { col_append_str(pinfo->cinfo, COL_INFO, "Response: Unknown"); proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset)); pinfo->p2p_dir = p2p_dir_save; return tvb_captured_length(tvb); } col_append_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(command_response, &command_vals_ext, "Unknown")); command_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, 0, command_response); command_tree = proto_item_add_subtree(command_item, ett_command); proto_item_set_generated(command_item); command_item = proto_tree_add_uint(main_tree, hf_setup_interface, tvb, offset, 0, command_data->interface); proto_item_set_generated(command_item); command_item = proto_tree_add_uint(main_tree, hf_command_in_frame, tvb, offset, 0, command_data->command_frame_number); proto_item_set_generated(command_item); switch (command_response) { case 0x02: /* Upload */ if (block_number != -1) { sub_item = proto_tree_add_uint(main_tree, hf_setup_block_number, tvb, offset, 0, block_number); proto_item_set_generated(sub_item); col_append_fstr(pinfo->cinfo, COL_INFO, " Block Number=%u", block_number); } proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA); offset = tvb_captured_length(tvb); break; case 0x03: /* Get Status */ col_append_fstr(pinfo->cinfo, COL_INFO, " = Status: %s, PollTimeout: %u ms, State: %s", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &status_vals_ext, "Unknown"), tvb_get_letoh24(tvb, offset + 1), val_to_str_ext_const(tvb_get_guint8(tvb, offset + 4), &state_vals_ext, "Unknown")); proto_tree_add_item(main_tree, hf_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(main_tree, hf_poll_timeout, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(main_tree, hf_state, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(main_tree, hf_iString, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; case 0x05: /* Get State */ proto_tree_add_item(main_tree, hf_state, tvb, offset, 1, ENC_LITTLE_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " = %s", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &state_vals_ext, "Unknown")); offset += 1; break; case 0x00: /* Detach */ case 0x01: /* Download */ case 0x04: /* Clear Status */ case 0x06: /* Abort */ default: proto_tree_add_expert(command_tree, pinfo, &ei_unexpected_response, tvb, offset, 0); if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_expert(main_tree, pinfo, &ei_unknown_data, tvb, offset, -1); offset = tvb_captured_length(tvb); } } pinfo->p2p_dir = p2p_dir_save; return offset; } void proto_register_usb_dfu(void) { module_t *module; expert_module_t *expert_module; static hf_register_info hf[] = { { &hf_setup_command, { "Command", "usbdfu.command", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &command_vals_ext, 0x0, NULL, HFILL } }, { &hf_response, { "Response", "usbdfu.response", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &command_vals_ext, 0x0, NULL, HFILL } }, { &hf_command_in_frame, { "Command Frame", "usbdfu.command_frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_setup_unused, { "Unused", "usbdfu.unused", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_setup_interface, { "Interface", "usbdfu.interface", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_length, { "Length", "usbdfu.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_block_number, { "Block Number", "usbdfu.block_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_setup_timeout, { "Timeout", "usbdfu.timeout", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_state, { "State", "usbdfu.state", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &state_vals_ext, 0x0, NULL, HFILL } }, { &hf_status, { "Status", "usbdfu.status", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &status_vals_ext, 0x0, NULL, HFILL } }, { &hf_iString, { "iString", "usbdfu.iString", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_poll_timeout, { "Poll Timeout", "usbdfu.poll_timeout", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data, { "Data", "usbdfu.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor, { "DFU Descriptor", "usbdfu.descriptor", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_reserved, { "Reserved", "usbdfu.descriptor.bmAttributes.reserved", FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_WillDetach, { "Will Detach", "usbdfu.descriptor.bmAttributes.WillDetach", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_ManifestationTolerant, { "Manifestation Tolerant", "usbdfu.descriptor.bmAttributes.ManifestationTolerant", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_CanUpload, { "Can Upload", "usbdfu.descriptor.bmAttributes.CanUpload", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bmAttributes_CanDownload, { "Can Download", "usbdfu.descriptor.bmAttributes.CanDownload", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_usb_dfu_descriptor_wDetachTimeOut, { "wDetachTimeOut", "usbdfu.descriptor.wDetachTimeOut", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_wTransferSize, { "wTransferSize", "usbdfu.descriptor.wTransferSize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dfu_descriptor_bcdDFUVersion, { "bcdDFUVersion", "usbdfu.descriptor.bcdDFUVersion", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } } }; static ei_register_info ei[] = { { &ei_unexpected_response, { "usb_dfu.unexpected_response", PI_PROTOCOL, PI_ERROR, "Unexpected response for this command", EXPFILL }}, { &ei_unknown_data, { "usb_dfu.unknown_data", PI_PROTOCOL, PI_NOTE, "Unknown data", EXPFILL }}, { &ei_unexpected_data, { "usb_dfu.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }}, { &ei_invalid_command_for_request_type, { "usb_dfu.invalid_command_for_request_type", PI_PROTOCOL, PI_WARN, "Invalid command for this Request Type", EXPFILL }}, { &ei_descriptor_invalid_length, { "usb_dfu.descriptor.invalid_length", PI_PROTOCOL, PI_WARN, "Invalid Length", EXPFILL }}, }; static gint *ett[] = { &ett_usb_dfu, &ett_usb_dfu_descriptor, &ett_command }; command_info = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); proto_usb_dfu = proto_register_protocol("USB Device Firmware Upgrade ", "USB DFU", "usbdfu"); proto_register_field_array(proto_usb_dfu, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); usb_dfu_handle = register_dissector("usb_dfu", dissect_usb_dfu, proto_usb_dfu); expert_module = expert_register_protocol(proto_usb_dfu); expert_register_field_array(expert_module, ei, array_length(ei)); module = prefs_register_protocol(proto_usb_dfu, NULL); prefs_register_static_text_preference(module, "version", "USB DFU Specification 1.1", "Version of protocol supported by this dissector."); } #define RUNTIME_KEY USB_PROTOCOL_KEY(IF_CLASS_APPLICATION_SPECIFIC, IF_SUBCLASS_APP_DFU, IF_PROTOCOL_DFU_RUNTIME) #define DFU_MODE_KEY USB_PROTOCOL_KEY(IF_CLASS_APPLICATION_SPECIFIC, IF_SUBCLASS_APP_DFU, IF_PROTOCOL_DFU_MODE) void proto_reg_handoff_usb_dfu(void) { dissector_handle_t usf_dfu_descriptor_handle; usf_dfu_descriptor_handle = create_dissector_handle(dissect_usb_dfu_descriptor, proto_usb_dfu); dissector_add_uint("usb.descriptor", IF_CLASS_APPLICATION_SPECIFIC, usf_dfu_descriptor_handle); dissector_add_uint("usb.control", RUNTIME_KEY, usb_dfu_handle); dissector_add_uint("usb.control", DFU_MODE_KEY, usb_dfu_handle); dissector_add_uint("usb.product", (0x05ac << 16) | 0x1227, usb_dfu_handle); /* Apple Inc. Mobile Device (DFU Mode) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x1db5, usb_dfu_handle); /* IDBG in DFU mode */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6001, usb_dfu_handle); /* Ubertooth Zero DFU */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6003, usb_dfu_handle); /* Ubertooth One DFU */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x600f, usb_dfu_handle); /* Paparazzi Lisa/M (DFU) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6011, usb_dfu_handle); /* LeoLipo (DFU) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6017, usb_dfu_handle); /* Black Magic Debug Probe (DFU) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6044, usb_dfu_handle); /* Open Source USB CANBUS converter (DFU Mode) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6064, usb_dfu_handle); /* CPC FPGA (DFU) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6069, usb_dfu_handle); /* xser (DFU mode) */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6082, usb_dfu_handle); /* Facecandy *USB DFU loader */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6084, usb_dfu_handle); /* arcin arcade controller (USB DFU loader) */ dissector_add_for_decode_as("usb.device", usb_dfu_handle); dissector_add_for_decode_as("usb.protocol", usb_dfu_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-hid.c
/* packet-usb-hid.c * * USB HID dissector * By Adam Nielsen <[email protected]> 2009 * * SPDX-License-Identifier: GPL-2.0-or-later */ /* See specification at * https://www.usb.org/sites/default/files/hid1_11.pdf * https://www.usb.org/sites/default/files/hut1_22.pdf */ #include "config.h" #include <epan/packet.h> #include "wsutil/sign_ext.h" #include "wsutil/pint.h" #include "packet-usb.h" #include "packet-usb-hid.h" #include "packet-btsdp.h" void proto_register_usb_hid(void); void proto_reg_handoff_usb_hid(void); /* protocols and header fields */ static int proto_usb_hid = -1; static int hf_usb_hid_item_bSize = -1; static int hf_usb_hid_item_bType = -1; static int hf_usb_hid_mainitem_bTag = -1; static int hf_usb_hid_globalitem_bTag = -1; static int hf_usb_hid_localitem_bTag = -1; static int hf_usb_hid_longitem_bTag = -1; static int hf_usb_hid_item_bDataSize = -1; static int hf_usb_hid_item_bLongItemTag = -1; static int hf_usb_hid_item_unk_data = -1; static int hf_usb_hid_mainitem_bit0 = -1; static int hf_usb_hid_mainitem_bit1 = -1; static int hf_usb_hid_mainitem_bit2 = -1; static int hf_usb_hid_mainitem_bit3 = -1; static int hf_usb_hid_mainitem_bit4 = -1; static int hf_usb_hid_mainitem_bit5 = -1; static int hf_usb_hid_mainitem_bit6 = -1; static int hf_usb_hid_mainitem_bit7 = -1; static int hf_usb_hid_mainitem_bit7_input = -1; static int hf_usb_hid_mainitem_bit8 = -1; static int hf_usb_hid_mainitem_colltype = -1; static int hf_usb_hid_globalitem_usage = -1; static int hf_usb_hid_globalitem_log_min = -1; static int hf_usb_hid_globalitem_log_max = -1; static int hf_usb_hid_globalitem_phy_min = -1; static int hf_usb_hid_globalitem_phy_max = -1; static int hf_usb_hid_globalitem_unit_exp = -1; static int hf_usb_hid_globalitem_unit_sys = -1; static int hf_usb_hid_globalitem_unit_len = -1; static int hf_usb_hid_globalitem_unit_mass = -1; static int hf_usb_hid_globalitem_unit_time = -1; static int hf_usb_hid_globalitem_unit_temp = -1; static int hf_usb_hid_globalitem_unit_current = -1; static int hf_usb_hid_globalitem_unit_brightness = -1; static int hf_usb_hid_globalitem_report_size = -1; static int hf_usb_hid_globalitem_report_id = -1; static int hf_usb_hid_globalitem_report_count = -1; static int hf_usb_hid_globalitem_push = -1; static int hf_usb_hid_globalitem_pop = -1; static int hf_usb_hid_localitem_usage = -1; static int hf_usb_hid_localitem_usage_min = -1; static int hf_usb_hid_localitem_usage_max = -1; static int hf_usb_hid_localitem_desig_index = -1; static int hf_usb_hid_localitem_desig_min = -1; static int hf_usb_hid_localitem_desig_max = -1; static int hf_usb_hid_localitem_string_index = -1; static int hf_usb_hid_localitem_string_min = -1; static int hf_usb_hid_localitem_string_max = -1; static int hf_usb_hid_localitem_delimiter = -1; static gint ett_usb_hid_report = -1; static gint ett_usb_hid_item_header = -1; static gint ett_usb_hid_wValue = -1; static gint ett_usb_hid_descriptor = -1; static gint ett_usb_hid_data = -1; static gint ett_usb_hid_unknown_data = -1; static gint ett_usb_hid_array = -1; static int hf_usb_hid_request = -1; static int hf_usb_hid_value = -1; static int hf_usb_hid_index = -1; static int hf_usb_hid_length = -1; static int hf_usb_hid_report_type = -1; static int hf_usb_hid_report_id = -1; static int hf_usb_hid_duration = -1; static int hf_usb_hid_zero = -1; static int hf_usb_hid_bcdHID = -1; static int hf_usb_hid_bCountryCode = -1; static int hf_usb_hid_bNumDescriptors = -1; static int hf_usb_hid_bDescriptorIndex = -1; static int hf_usb_hid_bDescriptorType = -1; static int hf_usb_hid_wInterfaceNumber = -1; static int hf_usb_hid_wDescriptorLength = -1; static int hf_usbhid_boot_report_keyboard_modifier_right_gui = -1; static int hf_usbhid_boot_report_keyboard_modifier_right_alt = -1; static int hf_usbhid_boot_report_keyboard_modifier_right_shift = -1; static int hf_usbhid_boot_report_keyboard_modifier_right_ctrl = -1; static int hf_usbhid_boot_report_keyboard_modifier_left_gui = -1; static int hf_usbhid_boot_report_keyboard_modifier_left_alt = -1; static int hf_usbhid_boot_report_keyboard_modifier_left_shift = -1; static int hf_usbhid_boot_report_keyboard_modifier_left_ctrl = -1; static int hf_usbhid_boot_report_keyboard_reserved = -1; static int hf_usbhid_boot_report_keyboard_keycode_1 = -1; static int hf_usbhid_boot_report_keyboard_keycode_2 = -1; static int hf_usbhid_boot_report_keyboard_keycode_3 = -1; static int hf_usbhid_boot_report_keyboard_keycode_4 = -1; static int hf_usbhid_boot_report_keyboard_keycode_5 = -1; static int hf_usbhid_boot_report_keyboard_keycode_6 = -1; static int hf_usbhid_boot_report_keyboard_leds_constants = -1; static int hf_usbhid_boot_report_keyboard_leds_kana = -1; static int hf_usbhid_boot_report_keyboard_leds_compose = -1; static int hf_usbhid_boot_report_keyboard_leds_scroll_lock = -1; static int hf_usbhid_boot_report_keyboard_leds_caps_lock = -1; static int hf_usbhid_boot_report_keyboard_leds_num_lock = -1; static int hf_usbhid_boot_report_mouse_button_8 = -1; static int hf_usbhid_boot_report_mouse_button_7 = -1; static int hf_usbhid_boot_report_mouse_button_6 = -1; static int hf_usbhid_boot_report_mouse_button_5 = -1; static int hf_usbhid_boot_report_mouse_button_4 = -1; static int hf_usbhid_boot_report_mouse_button_middle = -1; static int hf_usbhid_boot_report_mouse_button_right = -1; static int hf_usbhid_boot_report_mouse_button_left = -1; static int hf_usbhid_boot_report_mouse_x_displacement = -1; static int hf_usbhid_boot_report_mouse_y_displacement = -1; static int hf_usbhid_boot_report_mouse_horizontal_scroll_wheel = -1; static int hf_usbhid_boot_report_mouse_vertical_scroll_wheel = -1; static int hf_usbhid_data = -1; static int hf_usbhid_unknown_data = -1; static int hf_usbhid_vendor_data = -1; static int hf_usbhid_report_id = -1; static int hf_usbhid_padding = -1; static int hf_usbhid_axis_x = -1; static int hf_usbhid_axis_y = -1; static int hf_usbhid_axis_z = -1; static int hf_usbhid_axis_rx = -1; static int hf_usbhid_axis_ry = -1; static int hf_usbhid_axis_rz = -1; static int hf_usbhid_axis_slider = -1; static int hf_usbhid_axis_vx = -1; static int hf_usbhid_axis_vy = -1; static int hf_usbhid_axis_vz = -1; static int hf_usbhid_axis_vbrx = -1; static int hf_usbhid_axis_vbry = -1; static int hf_usbhid_axis_vbrz = -1; static int hf_usbhid_axis_vno = -1; static int hf_usbhid_button = -1; static int hf_usbhid_key = -1; static int hf_usbhid_array = -1; static int hf_usbhid_array_usage = -1; static const true_false_string tfs_mainitem_bit0 = {"Constant", "Data"}; static const true_false_string tfs_mainitem_bit1 = {"Variable", "Array"}; static const true_false_string tfs_mainitem_bit2 = {"Relative", "Absolute"}; static const true_false_string tfs_mainitem_bit3 = {"Wrap", "No Wrap"}; static const true_false_string tfs_mainitem_bit4 = {"Non Linear", "Linear"}; static const true_false_string tfs_mainitem_bit5 = {"No Preferred", "Preferred State"}; static const true_false_string tfs_mainitem_bit6 = {"Null state", "No Null position"}; static const true_false_string tfs_mainitem_bit7 = {"Volatile", "Non Volatile"}; static const true_false_string tfs_mainitem_bit8 = {"Buffered Bytes", "Bit Field"}; struct usb_hid_global_state { unsigned int usage_page; }; static wmem_tree_t *report_descriptors = NULL; /* local items */ #define HID_USAGE_MIN (1 << 0) #define HID_USAGE_MAX (1 << 1) /* global items */ #define HID_REPORT_ID (1 << 2) #define HID_REPORT_COUNT (1 << 3) #define HID_REPORT_SIZE (1 << 4) #define HID_LOGICAL_MIN (1 << 5) #define HID_LOGICAL_MAX (1 << 6) #define HID_USAGE_PAGE (1 << 7) /* main items */ #define HID_INPUT (1 << 8) #define HID_OUTPUT (1 << 9) #define HID_FEATURE (1 << 10) #define HID_EXTENDED_USAGE (1 << 11) /* masks */ #define HID_GLOBAL_MASK (HID_REPORT_ID | \ HID_REPORT_COUNT | \ HID_REPORT_SIZE | \ HID_LOGICAL_MIN | \ HID_LOGICAL_MAX | \ HID_USAGE_PAGE) #define HID_REQUIRED_MASK (HID_REPORT_COUNT | \ HID_REPORT_SIZE | \ HID_LOGICAL_MIN | \ HID_LOGICAL_MAX) #define HID_MAIN_CONSTANT (1 << 0) /* data / constant */ #define HID_MAIN_TYPE (1 << 1) /* array / variable */ #define HID_MAIN_RELATIVE (1 << 2) /* absolute / relative */ #define HID_MAIN_WRAP (1 << 3) /* no wrap / wrap */ #define HID_MAIN_NON_LINEAR (1 << 4) /* linear / non linear */ #define HID_MAIN_NO_PREFERRED (1 << 5) /* preferred state / no preferred */ #define HID_MAIN_NULL_STATE (1 << 6) /* no null position / null state */ #define HID_MAIN_BUFFERED_BYTES (1 << 8) /* bit field / buferred bytes */ #define HID_MAIN_ARRAY (0 << 1) #define HID_MAIN_VARIABLE (1 << 1) #define HID_USAGE_UNSET 0 #define HID_USAGE_SINGLE 1 #define HID_USAGE_RANGE 2 #define USAGE_ID(usage) (usage & 0x0000FFFF) #define USAGE_PAGE(usage) ((usage & 0xFFFF0000) >> 16) typedef struct _hid_field hid_field_t; struct _hid_field { wmem_array_t *usages; guint32 report_id; /* optional */ guint32 report_count; guint32 report_size; gint32 logical_min; gint32 logical_max; guint32 properties; hid_field_t *next; }; typedef struct _report_descriptor report_descriptor_t; struct _report_descriptor { usb_conv_info_t usb_info; int desc_length; guint8 *desc_body; gboolean uses_report_id; wmem_array_t *fields_in; wmem_array_t *fields_out; /* TODO: features */ report_descriptor_t *next; }; #define USBHID_GENERIC_DESKTOP_CONTROLS_X 0x0030 #define USBHID_GENERIC_DESKTOP_CONTROLS_Y 0x0031 #define USBHID_GENERIC_DESKTOP_CONTROLS_Z 0x0032 #define USBHID_GENERIC_DESKTOP_CONTROLS_RX 0x0033 #define USBHID_GENERIC_DESKTOP_CONTROLS_RY 0x0034 #define USBHID_GENERIC_DESKTOP_CONTROLS_RZ 0x0035 #define USBHID_GENERIC_DESKTOP_CONTROLS_SLIDER 0x0036 #define USBHID_GENERIC_DESKTOP_CONTROLS_VX 0x0040 #define USBHID_GENERIC_DESKTOP_CONTROLS_VY 0x0041 #define USBHID_GENERIC_DESKTOP_CONTROLS_VZ 0x0042 #define USBHID_GENERIC_DESKTOP_CONTROLS_VBRX 0x0043 #define USBHID_GENERIC_DESKTOP_CONTROLS_VBRY 0x0044 #define USBHID_GENERIC_DESKTOP_CONTROLS_VBRZ 0x0045 #define USBHID_GENERIC_DESKTOP_CONTROLS_VNO 0x0046 /* HID class specific descriptor types */ #define USB_DT_HID 0x21 #define USB_DT_HID_REPORT 0x22 static const value_string hid_descriptor_type_vals[] = { {USB_DT_HID, "HID"}, {USB_DT_HID_REPORT, "HID Report"}, {0, NULL} }; static value_string_ext hid_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(hid_descriptor_type_vals); #define USBHID_SIZE_MASK 0x03 #define USBHID_TYPE_MASK 0x0C #define USBHID_TAG_MASK 0xF0 static const value_string usb_hid_item_bSize_vals[] = { {0, "0 bytes"}, {1, "1 byte"}, {2, "2 bytes"}, {3, "4 bytes"}, {0, NULL} }; #define USBHID_ITEMTYPE_MAIN 0 #define USBHID_ITEMTYPE_GLOBAL 1 #define USBHID_ITEMTYPE_LOCAL 2 #define USBHID_ITEMTYPE_LONG 3 static const value_string usb_hid_item_bType_vals[] = { {USBHID_ITEMTYPE_MAIN, "Main"}, {USBHID_ITEMTYPE_GLOBAL, "Global"}, {USBHID_ITEMTYPE_LOCAL, "Local"}, {USBHID_ITEMTYPE_LONG, "Long item"}, {0, NULL} }; #define USBHID_MAINITEM_TAG_INPUT 8 #define USBHID_MAINITEM_TAG_OUTPUT 9 #define USBHID_MAINITEM_TAG_FEATURE 11 #define USBHID_MAINITEM_TAG_COLLECTION 10 #define USBHID_MAINITEM_TAG_ENDCOLLECTION 12 static const value_string usb_hid_mainitem_bTag_vals[] = { {USBHID_MAINITEM_TAG_INPUT, "Input"}, {USBHID_MAINITEM_TAG_OUTPUT, "Output"}, {USBHID_MAINITEM_TAG_FEATURE, "Feature"}, {USBHID_MAINITEM_TAG_COLLECTION, "Collection"}, {USBHID_MAINITEM_TAG_ENDCOLLECTION, "End Collection"}, {0, NULL} }; #define USBHID_GLOBALITEM_TAG_USAGE_PAGE 0 #define USBHID_GLOBALITEM_TAG_LOG_MIN 1 #define USBHID_GLOBALITEM_TAG_LOG_MAX 2 #define USBHID_GLOBALITEM_TAG_PHY_MIN 3 #define USBHID_GLOBALITEM_TAG_PHY_MAX 4 #define USBHID_GLOBALITEM_TAG_UNIT_EXP 5 #define USBHID_GLOBALITEM_TAG_UNIT 6 #define USBHID_GLOBALITEM_TAG_REPORT_SIZE 7 #define USBHID_GLOBALITEM_TAG_REPORT_ID 8 #define USBHID_GLOBALITEM_TAG_REPORT_COUNT 9 #define USBHID_GLOBALITEM_TAG_PUSH 10 #define USBHID_GLOBALITEM_TAG_POP 11 static const value_string usb_hid_globalitem_bTag_vals[] = { {USBHID_GLOBALITEM_TAG_USAGE_PAGE, "Usage Page"}, {USBHID_GLOBALITEM_TAG_LOG_MIN, "Logical Minimum"}, {USBHID_GLOBALITEM_TAG_LOG_MAX, "Logical Maximum"}, {USBHID_GLOBALITEM_TAG_PHY_MIN, "Physical Minimum"}, {USBHID_GLOBALITEM_TAG_PHY_MAX, "Physical Maximum"}, {USBHID_GLOBALITEM_TAG_UNIT_EXP, "Unit Exponent"}, {USBHID_GLOBALITEM_TAG_UNIT, "Unit"}, {USBHID_GLOBALITEM_TAG_REPORT_SIZE, "Report Size"}, {USBHID_GLOBALITEM_TAG_REPORT_ID, "Report ID"}, {USBHID_GLOBALITEM_TAG_REPORT_COUNT, "Report Count"}, {USBHID_GLOBALITEM_TAG_PUSH, "Push"}, {USBHID_GLOBALITEM_TAG_POP, "Pop"}, {12, "[Reserved]"}, {13, "[Reserved]"}, {14, "[Reserved]"}, {15, "[Reserved]"}, {0, NULL} }; #define USBHID_LOCALITEM_TAG_USAGE 0 #define USBHID_LOCALITEM_TAG_USAGE_MIN 1 #define USBHID_LOCALITEM_TAG_USAGE_MAX 2 #define USBHID_LOCALITEM_TAG_DESIG_INDEX 3 #define USBHID_LOCALITEM_TAG_DESIG_MIN 4 #define USBHID_LOCALITEM_TAG_DESIG_MAX 5 /* No 6 in spec */ #define USBHID_LOCALITEM_TAG_STRING_INDEX 7 #define USBHID_LOCALITEM_TAG_STRING_MIN 8 #define USBHID_LOCALITEM_TAG_STRING_MAX 9 #define USBHID_LOCALITEM_TAG_DELIMITER 10 /* Also listed as reserved in spec! */ static const value_string usb_hid_localitem_bTag_vals[] = { {USBHID_LOCALITEM_TAG_USAGE, "Usage"}, {USBHID_LOCALITEM_TAG_USAGE_MIN, "Usage Minimum"}, {USBHID_LOCALITEM_TAG_USAGE_MAX, "Usage Maximum"}, {USBHID_LOCALITEM_TAG_DESIG_INDEX, "Designator Index"}, {USBHID_LOCALITEM_TAG_DESIG_MIN, "Designator Minimum"}, {USBHID_LOCALITEM_TAG_DESIG_MAX, "Designator Maximum"}, {USBHID_LOCALITEM_TAG_STRING_INDEX, "String Index"}, {USBHID_LOCALITEM_TAG_STRING_MIN, "String Minimum"}, {USBHID_LOCALITEM_TAG_STRING_MAX, "String Maximum"}, {USBHID_LOCALITEM_TAG_DELIMITER, "Delimiter"}, {11, "[Reserved]"}, {12, "[Reserved]"}, {13, "[Reserved]"}, {14, "[Reserved]"}, {15, "[Reserved]"}, {0, NULL} }; static const value_string usb_hid_longitem_bTag_vals[] = { {15, "Long item"}, {0, NULL} }; static const range_string usb_hid_mainitem_colltype_vals[] = { {0x00, 0x00, "Physical"}, {0x01, 0x01, "Application"}, {0x02, 0x02, "Logical"}, {0x03, 0x03, "Report"}, {0x04, 0x04, "Named array"}, {0x05, 0x05, "Usage switch"}, {0x06, 0x06, "Usage modifier"}, {0x07, 0x7F, "[Reserved]"}, {0x80, 0xFF, "[Vendor-defined]"}, {0, 0, NULL} }; static const value_string usb_hid_globalitem_unit_exp_vals[] = { {0x0, "n^0"}, {0x1, "n^1"}, {0x2, "n^2"}, {0x3, "n^3"}, {0x4, "n^4"}, {0x5, "n^5"}, {0x6, "n^6"}, {0x7, "n^7"}, {0x8, "n^-8"}, {0x9, "n^-7"}, {0xA, "n^-6"}, {0xB, "n^-5"}, {0xC, "n^-4"}, {0xD, "n^-3"}, {0xE, "n^-2"}, {0xF, "n^-1"}, {0, NULL} }; #define GENERIC_DESKTOP_CONTROLS_PAGE 0x01 #define SIMULATION_CONTROLS_PAGE 0x02 #define VR_CONTROLS_PAGE 0x03 #define SPORT_CONTROLS_PAGE 0x04 #define GAME_CONTROLS_PAGE 0x05 #define GENERIC_DEVICE_CONTROLS_PAGE 0x06 #define KEYBOARD_KEYPAD_PAGE 0x07 #define LED_PAGE 0x08 #define BUTTON_PAGE 0x09 #define ORDINAL_PAGE 0x0A #define TELEPHONY_PAGE 0x0B #define CONSUMER_PAGE 0x0C #define DIGITIZER_PAGE 0x0D #define HAPTICS_PAGE 0x0E #define PID_PAGE 0x0F #define UNICODE_PAGE 0x10 #define EYE_AND_HEAD_TRACKER_PAGE 0x12 #define ALPHANUMERIC_DISPLAY_PAGE 0x14 #define SENSOR_PAGE 0x20 #define MEDICAL_INSTRUMENTS_PAGE 0x40 #define BRAILLE_DISPLAY_PAGE 0x41 #define LIGHTING_AND_ILLUMINATION_PAGE 0x59 #define USB_MONITOR_PAGE 0x80 #define USB_ENUMERATED_VALUES_PAGE 0x81 #define VESA_VIRTUAL_CONTROLS_PAGE 0x82 #define POWER_DEVICE_PAGE 0x84 #define BATTERY_SYSTEM_PAGE 0x85 #define BARCODE_SCANNER_PAGE 0x8C #define WEIGHING_PAGE 0x8D #define MSR_PAGE 0x8E #define RESERVED_POS_PAGE 0x8F #define CAMERA_CONTROL_PAGE 0x90 #define ARCADE_PAGE 0x91 #define GAMING_DEVICE_PAGE 0x92 #define FIDO_ALLIANCE_PAGE 0xF1D0 #define VENDOR_PAGE_HBYTE 0xFF00 static const value_string usb_hid_item_usage_page_vals[] = { {0x00, "Undefined"}, {GENERIC_DESKTOP_CONTROLS_PAGE, "Generic Desktop Controls"}, {SIMULATION_CONTROLS_PAGE, "Simulation Controls"}, {VR_CONTROLS_PAGE, "VR Controls"}, {SPORT_CONTROLS_PAGE, "Sport Controls"}, {GAME_CONTROLS_PAGE, "Game Controls"}, {GENERIC_DEVICE_CONTROLS_PAGE, "Generic Device Controls"}, {KEYBOARD_KEYPAD_PAGE, "Keyboard/Keypad"}, {LED_PAGE, "LED"}, {BUTTON_PAGE, "Button"}, {ORDINAL_PAGE, "Ordinal"}, {TELEPHONY_PAGE, "Telephony"}, {CONSUMER_PAGE, "Consumer"}, {DIGITIZER_PAGE, "Digitizer"}, {HAPTICS_PAGE, "Haptics"}, {PID_PAGE, "Physical Interface Device (PID)"}, {UNICODE_PAGE, "Unicode"}, {EYE_AND_HEAD_TRACKER_PAGE, "Eye and Head Tracker"}, {ALPHANUMERIC_DISPLAY_PAGE, "Alphanumeric Display"}, {SENSOR_PAGE, "Sensor"}, {MEDICAL_INSTRUMENTS_PAGE, "Medical Instruments"}, {BRAILLE_DISPLAY_PAGE, "Braille Display"}, {LIGHTING_AND_ILLUMINATION_PAGE, "Lighting and Illumination"}, {USB_MONITOR_PAGE, "USB Monitor"}, {USB_ENUMERATED_VALUES_PAGE, "USB Enumerated Values"}, {VESA_VIRTUAL_CONTROLS_PAGE, "VESA Virtual Controls"}, {POWER_DEVICE_PAGE, "Power Device"}, {BATTERY_SYSTEM_PAGE, "Battery Device"}, {BARCODE_SCANNER_PAGE, "Barcode Scanner"}, {WEIGHING_PAGE, "Weighing"}, {MSR_PAGE, "Magnetic Stripe Reading (MSR) Devices"}, {RESERVED_POS_PAGE, "[Reserved Point of Sale page]"}, {CAMERA_CONTROL_PAGE, "Camera Control Page"}, {ARCADE_PAGE, "Arcade"}, {GAMING_DEVICE_PAGE, "Gaming Device"}, {FIDO_ALLIANCE_PAGE , "FIDO Alliance"}, {0, NULL} }; static const value_string usb_hid_generic_desktop_controls_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Pointer"}, {0x02, "Mouse"}, {0x04, "Joystick"}, {0x05, "Game Pad"}, {0x06, "Keyboard"}, {0x07, "Keypad"}, {0x08, "Multi-axis Controller"}, {0x09, "Tablet PC System Controls"}, {0x0A, "Water Cooling Device"}, {0x0B, "Computer Chassis Device"}, {0x0C, "Wireless Radio Controls"}, {0x0D, "Portable Device Control"}, {0x0E, "System Multi-Axis Controller"}, {0x0F, "Spatial Controller"}, {0x10, "Assistive Control"}, {0x11, "Device Dock"}, {0x12, "Dockable Device"}, {0x30, "X"}, {0x31, "Y"}, {0x32, "Z"}, {0x33, "Rx"}, {0x34, "Ry"}, {0x35, "Rz"}, {0x36, "Slider"}, {0x37, "Dial"}, {0x38, "Wheel"}, {0x39, "Hat switch"}, {0x3A, "Counted Buffer"}, {0x3B, "Byte Count"}, {0x3C, "Motion Wakeup"}, {0x3D, "Start"}, {0x3E, "Select"}, {0x40, "Vx"}, {0x41, "Vy"}, {0x42, "Vz"}, {0x43, "Vbrx"}, {0x44, "Vbry"}, {0x45, "Vbrz"}, {0x46, "Vno"}, {0x47, "Feature Notification"}, {0x48, "Resolution Multiplier"}, {0x49, "Qx"}, {0x4A, "Qy"}, {0x4B, "Qz"}, {0x4C, "Qw"}, {0x80, "System Control"}, {0x81, "System Power Down"}, {0x82, "System Sleep"}, {0x83, "System Wake Up"}, {0x84, "System Context Menu"}, {0x85, "System Main Menu"}, {0x86, "System App Menu"}, {0x87, "System Menu Help"}, {0x88, "System Menu Exit"}, {0x89, "System Menu Select"}, {0x8A, "System Menu Right"}, {0x8B, "System Menu Left"}, {0x8C, "System Menu Up"}, {0x8D, "System Menu Down"}, {0x8E, "System Cold Restart"}, {0x8F, "System Warm Restart"}, {0x90, "D-pad Up"}, {0x91, "D-pad Down"}, {0x92, "D-pad Right"}, {0x93, "D-pad Left"}, {0x94, "Index Trigger"}, {0x95, "Palm Trigger"}, {0x96, "Thumbstick"}, {0x97, "System Function Shift"}, {0x98, "System Function Shift Lock"}, {0x99, "System Function Shift Lock Indicator"}, {0x9A, "System Dismiss Notification"}, {0x9B, "System Do Not Disturb"}, {0xA0, "System Dock"}, {0xA1, "System Undock"}, {0xA2, "System Setup"}, {0xA3, "System Break"}, {0xA4, "System Debugger Break"}, {0xA5, "Application Break"}, {0xA6, "Application Debugger Break"}, {0xA7, "System Speaker Mute"}, {0xA8, "System Hibernate"}, {0xB0, "System Display Invert"}, {0xB1, "System Display Internal"}, {0xB2, "System Display External"}, {0xB3, "System Display Both"}, {0xB4, "System Display Dual"}, {0xB5, "System Display Toggle Int/Ext"}, {0xB6, "System Display Swap Primary/Secondary"}, {0xB7, "System Display LCD Autoscale"}, {0xC0, "Sensor Zone"}, {0xC1, "RPM"}, {0xC2, "Coolant Level"}, {0xC3, "Coolant Critical Level"}, {0xC4, "Coolant Pump"}, {0xC5, "Chassis Enclosure"}, {0xC6, "Wireless Radio Button"}, {0xC7, "Wireless Radio LED"}, {0xC8, "Wireless Radio Slider Switch"}, {0xC9, "System Display Rotation Lock Button"}, {0xCA, "System Display Rotation Lock Slider Switch"}, {0xCB, "Control Enable"}, {0xD0, "Dockable Device Unique ID"}, {0xD1, "Dockable Device Vendor ID"}, {0xD2, "Dockable Device Primary Usage Page"}, {0xD3, "Dockable Device Primary Usage ID"}, {0xD4, "Dockable Device Docking State"}, {0xD5, "Dockable Device Display Occlusion"}, {0xD6, "Dockable Device Object Type"}, {0, NULL} }; static const value_string usb_hid_simulation_control_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Flight Simulation Device"}, {0x02, "Automobile Simulation Device"}, {0x03, "Tank Simulation Device"}, {0x04, "Spaceship Simulation Device"}, {0x05, "Submarine Simulation Device"}, {0x06, "Sailing Simulation Device"}, {0x07, "Motorcycle Simulation Device"}, {0x08, "Sports Simulation Device"}, {0x09, "Airplane Simulation Device"}, {0x0A, "Helicopter Simulation Device"}, {0x0B, "Magic Carpet Simulation Device"}, {0x0C, "Bicycle Simulation Device"}, {0x20, "Flight Control Stick"}, {0x21, "Flight Stick"}, {0x22, "Cyclic Control"}, {0x23, "Cyclic Trim"}, {0x24, "Flight Yoke"}, {0x25, "Track Control"}, {0xB0, "Aileron"}, {0xB1, "Aileron Trim"}, {0xB2, "Anti-Torque Control"}, {0xB3, "Autopilot Enable"}, {0xB4, "Chaff Release"}, {0xB5, "Collective Control"}, {0xB6, "Dive Brake"}, {0xB7, "Electronic Countermeasures"}, {0xB8, "Elevator"}, {0xB9, "Elevator Trim"}, {0xBA, "Rudder"}, {0xBB, "Throttle"}, {0xBC, "Flight Communications"}, {0xBD, "Flare Release"}, {0xBE, "Landing Gear"}, {0xBF, "Toe Brake"}, {0xC0, "Trigger"}, {0xC1, "Weapons Arm"}, {0xC2, "Weapons Select"}, {0xC3, "Wing Flaps"}, {0xC4, "Accelerator"}, {0xC5, "Brake"}, {0xC6, "Clutch"}, {0xC7, "Shifter"}, {0xC8, "Steering"}, {0xC9, "Turret Direction"}, {0xCA, "Barrel Elevation"}, {0xCB, "Dive Plane"}, {0xCC, "Ballast"}, {0xCD, "Bicycle Crank"}, {0xCE, "Handle Bars"}, {0xCF, "Front Brake"}, {0xD0, "Rear Brake"}, {0, NULL} }; static const value_string usb_hid_vr_controls_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Belt"}, {0x02, "Body Suit"}, {0x03, "Flexor"}, {0x04, "Glove"}, {0x05, "Head Tracker"}, {0x06, "Head Mounted Display"}, {0x07, "Hand Tracker"}, {0x08, "Oculometer"}, {0x09, "Vest"}, {0x0A, "Animatronic Device"}, {0x20, "Stereo Enable"}, {0x21, "Display Enable"}, {0, NULL} }; static const value_string usb_hid_sport_controls_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Baseball Bat"}, {0x02, "Golf Club"}, {0x03, "Rowing Machine"}, {0x04, "Treadmill"}, {0x30, "Oar"}, {0x31, "Slope"}, {0x32, "Rate"}, {0x33, "Stick Speed"}, {0x34, "Stick Face Angle"}, {0x35, "Stick Heel/Toe"}, {0x36, "Stick Follow Through"}, {0x37, "Stick Tempo"}, {0x38, "Stick Type"}, {0x39, "Stick Height"}, {0x50, "Putter"}, {0x51, "1 Iron"}, {0x52, "2 Iron"}, {0x53, "3 Iron"}, {0x54, "4 Iron"}, {0x55, "5 Iron"}, {0x56, "6 Iron"}, {0x57, "7 Iron"}, {0x58, "8 Iron"}, {0x59, "9 Iron"}, {0x5A, "10 Iron"}, {0x5B, "11 Iron"}, {0x5C, "Sand Wedge"}, {0x5D, "Loft Wedge"}, {0x5E, "Power Wedge"}, {0x5F, "1 Wood"}, {0x60, "3 Wood"}, {0x61, "5 Wood"}, {0x62, "7 Wood"}, {0x63, "9 Wood"}, {0, NULL} }; static const value_string usb_hid_game_controls_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "3D Game Controller"}, {0x02, "Pinball Device"}, {0x03, "Gun Device"}, {0x20, "Point of View"}, {0x21, "Turn Right/Left"}, {0x22, "Pitch Forward/Backward"}, {0x23, "Roll Right/Left"}, {0x24, "Move Right/Left"}, {0x25, "Move Forward/Backward"}, {0x26, "Move Up/Down"}, {0x27, "Lean Right/Left"}, {0x28, "Lean Forward/Backward"}, {0x29, "Height of POV"}, {0x2A, "Flipper"}, {0x2B, "Secondary Flipper"}, {0x2C, "Bump"}, {0x2D, "New Game"}, {0x2E, "Shoot Ball"}, {0x2F, "Player"}, {0x30, "Gun Bolt"}, {0x31, "Gun Clip"}, {0x32, "Gun Selector"}, {0x33, "Gun Single Shot"}, {0x34, "Gun Burst"}, {0x35, "Gun Automatic"}, {0x36, "Gun Safety"}, {0x37, "Gamepad Fire/Jump"}, {0x39, "Gamepad Trigger"}, {0x3A, "Form-fitting Gamepad"}, {0, NULL} }; static const value_string usb_hid_generic_device_controls_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Background/Nonuser Controls"}, {0x20, "Battery Strength"}, {0x21, "Wireless Channel"}, {0x22, "Wireless ID"}, {0x23, "Discover Wireless Control"}, {0x24, "Security Code Character Entered"}, {0x25, "Security Code Character Erased"}, {0x26, "Security Code Cleared"}, {0x27, "Sequence ID"}, {0x28, "Sequence ID Reset"}, {0x29, "RF Signal Strength"}, {0x2A, "Software Version"}, {0x2B, "Protocol Version"}, {0x2C, "Hardware Version"}, {0x2D, "Major"}, {0x2E, "Minor"}, {0x2F, "Revision"}, {0x30, "Handedness"}, {0x31, "Either Hand"}, {0x32, "Left Hand"}, {0x33, "Right Hand"}, {0x34, "Both Hands"}, {0x40, "Grip Pose Offset"}, {0x41, "Pointer Pose Offset"}, {0, NULL} }; static const value_string usb_hid_keyboard_keypad_usage_page_vals[] = { {0x00, "Reserved (no event indicated)"}, {0x01, "Keyboard ErrorRollOver"}, {0x02, "Keyboard POSTFail"}, {0x03, "Keyboard ErrorUndefined"}, {0x04, "Keyboard a and A"}, {0x05, "Keyboard b and B"}, {0x06, "Keyboard c and C"}, {0x07, "Keyboard d and D"}, {0x08, "Keyboard e and E"}, {0x09, "Keyboard f and F"}, {0x0A, "Keyboard g and G"}, {0x0B, "Keyboard h and H"}, {0x0C, "Keyboard i and I"}, {0x0D, "Keyboard j and J"}, {0x0E, "Keyboard k and K"}, {0x0F, "Keyboard l and L"}, {0x10, "Keyboard m and M"}, {0x11, "Keyboard n and N"}, {0x12, "Keyboard o and O"}, {0x13, "Keyboard p and P"}, {0x14, "Keyboard q and Q"}, {0x15, "Keyboard r and R"}, {0x16, "Keyboard s and S"}, {0x17, "Keyboard t and T"}, {0x18, "Keyboard u and U"}, {0x19, "Keyboard v and V"}, {0x1A, "Keyboard w and W"}, {0x1B, "Keyboard x and X"}, {0x1C, "Keyboard y and Y"}, {0x1D, "Keyboard z and Z"}, {0x1E, "Keyboard 1 and !"}, {0x1F, "Keyboard 2 and @"}, {0x20, "Keyboard 3 and #"}, {0x21, "Keyboard 4 and $"}, {0x22, "Keyboard 5 and %"}, {0x23, "Keyboard 6 and ^"}, {0x24, "Keyboard 7 and &"}, {0x25, "Keyboard 8 and *"}, {0x26, "Keyboard 9 and ("}, {0x27, "Keyboard 0 and )"}, {0x28, "Keyboard Return (ENTER)"}, {0x29, "Keyboard ESCAPE"}, {0x2A, "Keyboard DELETE (Backspace)"}, {0x2B, "Keyboard Tab"}, {0x2C, "Keyboard Spacebar"}, {0x2D, "Keyboard - and (underscore)"}, {0x2E, "Keyboard = and +"}, {0x2F, "Keyboard [ and {"}, {0x30, "Keyboard ] and }"}, {0x31, "Keyboard \\ and |"}, {0x32, "Keyboard Non-US # and ~"}, {0x33, "Keyboard ; and :"}, {0x34, "Keyboard ' and \""}, {0x35, "Keyboard Grave Accent and Tilde"}, {0x36, "Keyboard , and <"}, {0x37, "Keyboard . and >"}, {0x38, "Keyboard / and ?"}, {0x39, "Keyboard Caps Lock"}, {0x3A, "Keyboard F1"}, {0x3B, "Keyboard F2"}, {0x3C, "Keyboard F3"}, {0x3D, "Keyboard F4"}, {0x3E, "Keyboard F5"}, {0x3F, "Keyboard F6"}, {0x40, "Keyboard F7"}, {0x41, "Keyboard F8"}, {0x42, "Keyboard F9"}, {0x43, "Keyboard F10"}, {0x44, "Keyboard F11"}, {0x45, "Keyboard F12"}, {0x46, "Keyboard PrintScreen"}, {0x47, "Keyboard Scroll Lock"}, {0x48, "Keyboard Pause"}, {0x49, "Keyboard Insert"}, {0x4A, "Keyboard Home"}, {0x4B, "Keyboard PageUp"}, {0x4C, "Keyboard Delete Forward"}, {0x4D, "Keyboard End"}, {0x4E, "Keyboard PageDown"}, {0x4F, "Keyboard RightArrow"}, {0x50, "Keyboard LeftArrow"}, {0x51, "Keyboard DownArrow"}, {0x52, "Keyboard UpArrow"}, {0x53, "Keypad Num Lock and Clear"}, {0x54, "Keypad /"}, {0x55, "Keypad *"}, {0x56, "Keypad -"}, {0x57, "Keypad +"}, {0x58, "Keypad ENTER"}, {0x59, "Keypad 1 and End"}, {0x5A, "Keypad 2 and Down Arrow"}, {0x5B, "Keypad 3 and PageDn"}, {0x5C, "Keypad 4 and Left Arrow"}, {0x5D, "Keypad 5"}, {0x5E, "Keypad 6 and Right Arrow"}, {0x5F, "Keypad 7 and Home"}, {0x60, "Keypad 8 and Up Arrow"}, {0x61, "Keypad 9 and PageUp"}, {0x62, "Keypad 0 and Insert"}, {0x63, "Keypad . and Delete"}, {0x64, "Keyboard Non-US \\ and |"}, {0x65, "Keyboard Application"}, {0x66, "Keyboard Power"}, {0x67, "Keypad ="}, {0x68, "Keyboard F13"}, {0x69, "Keyboard F14"}, {0x6A, "Keyboard F15"}, {0x6B, "Keyboard F16"}, {0x6C, "Keyboard F17"}, {0x6D, "Keyboard F18"}, {0x6E, "Keyboard F19"}, {0x6F, "Keyboard F20"}, {0x70, "Keyboard F21"}, {0x71, "Keyboard F22"}, {0x72, "Keyboard F23"}, {0x73, "Keyboard F24"}, {0x74, "Keyboard Execute"}, {0x75, "Keyboard Help"}, {0x76, "Keyboard Menu"}, {0x77, "Keyboard Select"}, {0x78, "Keyboard Stop"}, {0x79, "Keyboard Again"}, {0x7A, "Keyboard Undo"}, {0x7B, "Keyboard Cut"}, {0x7C, "Keyboard Copy"}, {0x7D, "Keyboard Paste"}, {0x7E, "Keyboard Find"}, {0x7F, "Keyboard Mute"}, {0x80, "Keyboard Volume Up"}, {0x81, "Keyboard Volume Down"}, {0x82, "Keyboard Locking Caps Lock"}, {0x83, "Keyboard Locking Num Lock"}, {0x84, "Keyboard Locking Scroll Lock"}, {0x85, "Keypad Comma"}, {0x86, "Keypad Equal Sign"}, {0x87, "Keyboard International1"}, {0x88, "Keyboard International2"}, {0x89, "Keyboard International3"}, {0x8A, "Keyboard International4"}, {0x8B, "Keyboard International5"}, {0x8C, "Keyboard International6"}, {0x8D, "Keyboard International7"}, {0x8E, "Keyboard International8"}, {0x8F, "Keyboard International9"}, {0x90, "Keyboard LANG1"}, {0x91, "Keyboard LANG2"}, {0x92, "Keyboard LANG3"}, {0x93, "Keyboard LANG4"}, {0x94, "Keyboard LANG5"}, {0x95, "Keyboard LANG6"}, {0x96, "Keyboard LANG7"}, {0x97, "Keyboard LANG8"}, {0x98, "Keyboard LANG9"}, {0x99, "Keyboard Alternate Erase"}, {0x9A, "Keyboard SysReq/Attention"}, {0x9B, "Keyboard Cancel"}, {0x9C, "Keyboard Clear"}, {0x9D, "Keyboard Prior"}, {0x9E, "Keyboard Return"}, {0x9F, "Keyboard Separator"}, {0xA0, "Keyboard Out"}, {0xA1, "Keyboard Oper"}, {0xA2, "Keyboard Clear/Again"}, {0xA3, "Keyboard CrSel/Props"}, {0xA4, "Keyboard ExSel"}, {0xB0, "Keypad 00"}, {0xB1, "Keypad 000"}, {0xB2, "Thousands Separator"}, {0xB3, "Decimal Separator"}, {0xB4, "Currency Unit"}, {0xB5, "Currency Sub-unit"}, {0xB6, "Keypad ("}, {0xB7, "Keypad )"}, {0xB8, "Keypad {"}, {0xB9, "Keypad }"}, {0xBA, "Keypad Tab"}, {0xBB, "Keypad Backspace"}, {0xBC, "Keypad A"}, {0xBD, "Keypad B"}, {0xBE, "Keypad C"}, {0xBF, "Keypad D"}, {0xC0, "Keypad E"}, {0xC1, "Keypad F"}, {0xC2, "Keypad XOR"}, {0xC3, "Keypad ^"}, {0xC4, "Keypad %"}, {0xC5, "Keypad <"}, {0xC6, "Keypad >"}, {0xC7, "Keypad &"}, {0xC8, "Keypad &&"}, {0xC9, "Keypad |"}, {0xCA, "Keypad ||"}, {0xCB, "Keypad :"}, {0xCC, "Keypad #"}, {0xCD, "Keypad Space"}, {0xCE, "Keypad @"}, {0xCF, "Keypad !"}, {0xD0, "Keypad Memory Store"}, {0xD1, "Keypad Memory Recall"}, {0xD2, "Keypad Memory Clear"}, {0xD3, "Keypad Memory Add"}, {0xD4, "Keypad Memory Subtract"}, {0xD5, "Keypad Memory Multiply"}, {0xD6, "Keypad Memory Divide"}, {0xD7, "Keypad +/-"}, {0xD8, "Keypad Clear"}, {0xD9, "Keypad Clear Entry"}, {0xDA, "Keypad Binary"}, {0xDB, "Keypad Octal"}, {0xDC, "Keypad Decimal"}, {0xDD, "Keypad Hexadecimal"}, {0xE0, "Keyboard LeftControl"}, {0xE1, "Keyboard LeftShift"}, {0xE2, "Keyboard LeftAlt"}, {0xE3, "Keyboard Left GUI"}, {0xE4, "Keyboard RightControl"}, {0xE5, "Keyboard RightShift"}, {0xE6, "Keyboard RightAlt"}, {0xE7, "Keyboard Right GUI"}, {0, NULL} }; static const value_string usb_hid_led_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Num Lock"}, {0x02, "Caps Lock"}, {0x03, "Scroll Lock"}, {0x04, "Compose"}, {0x05, "Kana"}, {0x06, "Power"}, {0x07, "Shift"}, {0x08, "Do Not Disturb"}, {0x09, "Mute"}, {0x0A, "Tone Enable"}, {0x0B, "High Cut Filter"}, {0x0C, "Low Cut Filter"}, {0x0D, "Equalizer Enable"}, {0x0E, "Sound Field On"}, {0x0F, "Surround On"}, {0x10, "Repeat"}, {0x11, "Stereo"}, {0x12, "Sampling Rate Detect"}, {0x13, "Spinning"}, {0x14, "CAV"}, {0x15, "CLV"}, {0x16, "Recording Format Detect"}, {0x17, "Off-Hook"}, {0x18, "Ring"}, {0x19, "Message Waiting"}, {0x1A, "Data Mode"}, {0x1B, "Battery Operation"}, {0x1C, "Battery OK"}, {0x1D, "Battery Low"}, {0x1E, "Speaker"}, {0x1F, "Head Set"}, {0x20, "Hold"}, {0x21, "Microphone"}, {0x22, "Coverage"}, {0x23, "Night Mode"}, {0x24, "Send Calls"}, {0x25, "Call Pickup"}, {0x26, "Conference"}, {0x27, "Stand-by"}, {0x28, "Camera On"}, {0x29, "Camera Off"}, {0x2A, "On-Line"}, {0x2B, "Off-Line"}, {0x2C, "Busy"}, {0x2D, "Ready"}, {0x2E, "Paper-Out"}, {0x2F, "Paper-Jam"}, {0x30, "Remote"}, {0x31, "Forward"}, {0x32, "Reverse"}, {0x33, "Stop"}, {0x34, "Rewind"}, {0x35, "Fast Forward"}, {0x36, "Play"}, {0x37, "Pause"}, {0x38, "Record"}, {0x39, "Error"}, {0x3A, "Usage Selected Indicator"}, {0x3B, "Usage In Use Indicator"}, {0x3C, "Usage Multi Mode Indicator"}, {0x3D, "Indicator On"}, {0x3E, "Indicator Flash"}, {0x3F, "Indicator Slow Blink"}, {0x40, "Indicator Fast Blink"}, {0x41, "Indicator Off"}, {0x42, "Flash On Time"}, {0x43, "Slow Blink On Time"}, {0x44, "Slow Blink Off Time"}, {0x45, "Fast Blink On Time"}, {0x46, "Fast Blink Off Time"}, {0x47, "Usage Indicator Color"}, {0x48, "Indicator Red"}, {0x49, "Indicator Green"}, {0x4A, "Indicator Amber"}, {0x4B, "Generic Indicator"}, {0x4C, "System Suspend"}, {0x4D, "External Power Connected"}, {0x4E, "Indicator Blue"}, {0x4F, "Indicator Orange"}, {0x50, "Good Status"}, {0x51, "Warning Status"}, {0x52, "RGB LED"}, {0x53, "Red LED Channel"}, {0x54, "Blue LED Channel"}, {0x55, "Green LED Channel"}, {0x56, "LED Intensity"}, {0x60, "Player Indicator"}, {0x61, "Player 1"}, {0x62, "Player 2"}, {0x63, "Player 3"}, {0x64, "Player 4"}, {0x65, "Player 5"}, {0x66, "Player 6"}, {0x67, "Player 7"}, {0x68, "Player 8"}, {0, NULL} }; static const value_string usb_hid_button_usage_page_vals[] = { {0x00, "No button pressed"}, {0x01, "Button 1 (primary/trigger)"}, {0x02, "Button 2 (secondary)"}, {0x03, "Button 3 (tertiary)"}, /* Other Buttons parsed as "Button %u" in get_usage_page_item_string */ {0, NULL} }; static const value_string usb_hid_ordinal_usage_page_vals[] = { {0x00, "Reserved"}, /* Instances parsed as "Instance %u" in get_usage_page_item_string */ {0, NULL} }; static const value_string usb_hid_telephony_device_usage_page_vals[] = { {0x000, "Undefined"}, {0x001, "Phone"}, {0x002, "Answering Machine"}, {0x003, "Message Controls"}, {0x004, "Handset"}, {0x005, "Headset"}, {0x006, "Telephony Key Pad"}, {0x007, "Programmable Button"}, {0x020, "Hook Switch"}, {0x021, "Flash"}, {0x022, "Feature"}, {0x023, "Hold"}, {0x024, "Redial"}, {0x025, "Transfer"}, {0x026, "Drop"}, {0x027, "Park"}, {0x028, "Forward Calls"}, {0x029, "Alternate Function"}, {0x02A, "Line"}, {0x02B, "Speaker Phone"}, {0x02C, "Conference"}, {0x02D, "Ring Enable"}, {0x02E, "Ring Select"}, {0x02F, "Phone Mute"}, {0x030, "Caller ID"}, {0x031, "Send"}, {0x050, "Speed Dial"}, {0x051, "Store Number"}, {0x052, "Recall Number"}, {0x053, "Phone Directory"}, {0x070, "Voice Mail"}, {0x071, "Screen Calls"}, {0x072, "Do Not Disturb"}, {0x073, "Message"}, {0x074, "Answer On/Off"}, {0x090, "Inside Dial Tone"}, {0x091, "Outside Dial Tone"}, {0x092, "Inside Ring Tone"}, {0x093, "Outside Ring Tone"}, {0x094, "Priority Ring Tone"}, {0x095, "Inside Ringback"}, {0x096, "Priority Ringback"}, {0x097, "Line Busy Tone"}, {0x098, "Reorder Tone"}, {0x099, "Call Waiting Tone"}, {0x09A, "Confirmation Tone 1"}, {0x09B, "Confirmation Tone 2"}, {0x09C, "Tones Off"}, {0x09D, "Outside Ringback"}, {0x09E, "Ringer"}, {0x0B0, "Phone Key 0"}, {0x0B1, "Phone Key 1"}, {0x0B2, "Phone Key 2"}, {0x0B3, "Phone Key 3"}, {0x0B4, "Phone Key 4"}, {0x0B5, "Phone Key 5"}, {0x0B6, "Phone Key 6"}, {0x0B7, "Phone Key 7"}, {0x0B8, "Phone Key 8"}, {0x0B9, "Phone Key 9"}, {0x0BA, "Phone Key Star"}, {0x0BB, "Phone Key Pound"}, {0x0BC, "Phone Key A"}, {0x0BD, "Phone Key B"}, {0x0BE, "Phone Key C"}, {0x0BF, "Phone Key D"}, {0x0C0, "Phone Call History Key"}, {0x0C1, "Phone Caller ID Key"}, {0x0C2, "Phone Settings Key"}, {0x0F0, "Host Control"}, {0x0F1, "Host Available"}, {0x0F2, "Host Call Active"}, {0x0F3, "Activate Handset Audio"}, {0x0F4, "Ring Type"}, {0x0F5, "Re-dialable Phone Number"}, {0x0F8, "Stop Ring Tone"}, {0x0F9, "PSTN Ring Tone"}, {0x0FA, "Host Ring Tone"}, {0x0FB, "Alert Sound Error"}, {0x0FC, "Alert Sound Confirm"}, {0x0FD, "Alert Sound Notification"}, {0x0FE, "Silent Ring"}, {0x108, "Email Message Waiting"}, {0x109, "Voicemail Message Waiting"}, {0x10A, "Host Hold"}, {0x110, "Incoming Call History Count"}, {0x111, "Outgoing Call History Count"}, {0x112, "Incoming Call History"}, {0x113, "Outgoing Call History"}, {0x114, "Phone Locale"}, {0x140, "Phone Time Second"}, {0x141, "Phone Time Minute"}, {0x142, "Phone Time Hour"}, {0x143, "Phone Date Day"}, {0x144, "Phone Date Month"}, {0x145, "Phone Date Year"}, {0x146, "Handset Nickname"}, {0x147, "Address Book ID"}, {0x14A, "Call Duration"}, {0x14B, "Dual Mode Phone"}, {0, NULL} }; static const value_string usb_hid_consumer_usage_page_vals[] = { {0x000, "Undefined"}, {0x001, "Consumer Control"}, {0x002, "Numeric Key Pad"}, {0x003, "Programmable Buttons"}, {0x004, "Microphone"}, {0x005, "Headphone"}, {0x006, "Graphic Equalizer"}, {0x020, "+10"}, {0x021, "+100"}, {0x022, "AM/PM"}, {0x030, "Power"}, {0x031, "Reset"}, {0x032, "Sleep"}, {0x033, "Sleep After"}, {0x034, "Sleep Mode"}, {0x035, "Illumination"}, {0x036, "Function Buttons"}, {0x040, "Menu"}, {0x041, "Menu Pick"}, {0x042, "Menu Up"}, {0x043, "Menu Down"}, {0x044, "Menu Left"}, {0x045, "Menu Right"}, {0x046, "Menu Escape"}, {0x047, "Menu Value Increase"}, {0x048, "Menu Value Decrease"}, {0x060, "Data On Screen"}, {0x061, "Closed Caption"}, {0x062, "Closed Caption Select"}, {0x063, "VCR/TV"}, {0x064, "Broadcast Mode"}, {0x065, "Snapshot"}, {0x066, "Still"}, {0x067, "Picture-in-Picture Toggle"}, {0x068, "Picture-in-Picture Swap"}, {0x069, "Red Menu Button"}, {0x06A, "Green Menu Button"}, {0x06B, "Blue Menu Button"}, {0x06C, "Yellow Menu Button"}, {0x06D, "Aspect"}, {0x06E, "3D Mode Select"}, {0x06F, "Display Brightness Increment"}, {0x070, "Display Brightness Decrement"}, {0x071, "Display Brightness"}, {0x072, "Display Backlight Toggle"}, {0x073, "Display Set Brightness to Minimum"}, {0x074, "Display Set Brightness to Maximum"}, {0x075, "Display Set Auto Brightness"}, {0x076, "Camera Access Enabled"}, {0x077, "Camera Access Disabled"}, {0x078, "Camera Access Toggle"}, {0x079, "Keyboard Brightness Increment"}, {0x07A, "Keyboard Brightness Decrement"}, {0x07B, "Keyboard Backlight Set Level"}, {0x07C, "Keyboard Backlight OOC"}, {0x07D, "Keyboard Backlight Set Minimum"}, {0x07E, "Keyboard Backlight Set Maximum"}, {0x07F, "Keyboard Backlight Auto"}, {0x080, "Selection"}, {0x081, "Assign Selection"}, {0x082, "Mode Step"}, {0x083, "Recall Last"}, {0x084, "Enter Channel"}, {0x085, "Order Movie"}, {0x086, "Channel"}, {0x087, "Media Selection"}, {0x088, "Media Select Computer"}, {0x089, "Media Select TV"}, {0x08A, "Media Select WWW"}, {0x08B, "Media Select DVD"}, {0x08C, "Media Select Telephone"}, {0x08D, "Media Select Program Guide"}, {0x08E, "Media Select Video Phone"}, {0x08F, "Media Select Games"}, {0x090, "Media Select Messages"}, {0x091, "Media Select CD"}, {0x092, "Media Select VCR"}, {0x093, "Media Select Tuner"}, {0x094, "Quit"}, {0x095, "Help"}, {0x096, "Media Select Tape"}, {0x097, "Media Select Cable"}, {0x098, "Media Select Satellite"}, {0x099, "Media Select Security"}, {0x09A, "Media Select Home"}, {0x09B, "Media Select Call"}, {0x09C, "Channel Increment"}, {0x09D, "Channel Decrement"}, {0x09E, "Media Select SAP"}, {0x0A0, "VCR Plus"}, {0x0A1, "Once"}, {0x0A2, "Daily"}, {0x0A3, "Weekly"}, {0x0A4, "Monthly"}, {0x0B0, "Play"}, {0x0B1, "Pause"}, {0x0B2, "Record"}, {0x0B3, "Fast Forward"}, {0x0B4, "Rewind"}, {0x0B5, "Scan Next Track"}, {0x0B6, "Scan Previous Track"}, {0x0B7, "Stop"}, {0x0B8, "Eject"}, {0x0B9, "Random Play"}, {0x0BA, "Select Disc"}, {0x0BB, "Enter Disc"}, {0x0BC, "Repeat"}, {0x0BD, "Tracking"}, {0x0BE, "Track Normal"}, {0x0BF, "Slow Tracking"}, {0x0C0, "Frame Forward"}, {0x0C1, "Frame Back"}, {0x0C2, "Mark"}, {0x0C3, "Clear Mark"}, {0x0C4, "Repeat From Mark"}, {0x0C5, "Return To Mark"}, {0x0C6, "Search Mark Forward"}, {0x0C7, "Search Mark Backwards"}, {0x0C8, "Counter Reset"}, {0x0C9, "Show Counter"}, {0x0CA, "Tracking Increment"}, {0x0CB, "Tracking Decrement"}, {0x0CC, "Stop/Eject"}, {0x0CD, "Play/Pause"}, {0x0CE, "Play/Skip"}, {0x0CF, "Voice Command"}, {0x0D0, "Invoke Capture Interface"}, {0x0D1, "Start or Stop Game Recording"}, {0x0D2, "Historical Game Capture"}, {0x0D3, "Capture Game Screenshot"}, {0x0D4, "Show or Hide Recording Indicator"}, {0x0D5, "Start or Stop Microphone Capture"}, {0x0D6, "Start or Stop Camera Capture"}, {0x0D7, "Start or Stop Game Broadcast"}, {0x0D8, "Start or Stop Voice Dictation Session"}, {0x0E0, "Volume"}, {0x0E1, "Balance"}, {0x0E2, "Mute"}, {0x0E3, "Bass"}, {0x0E4, "Treble"}, {0x0E5, "Bass Boost"}, {0x0E6, "Surround Mode"}, {0x0E7, "Loudness"}, {0x0E8, "MPX"}, {0x0E9, "Volume Increment"}, {0x0EA, "Volume Decrement"}, {0x0F0, "Speed Select"}, {0x0F1, "Playback Speed"}, {0x0F2, "Standard Play"}, {0x0F3, "Long Play"}, {0x0F4, "Extended Play"}, {0x0F5, "Slow"}, {0x100, "Fan Enable"}, {0x101, "Fan Speed"}, {0x102, "Light Enable"}, {0x103, "Light Illumination Level"}, {0x104, "Climate Control Enable"}, {0x105, "Room Temperature"}, {0x106, "Security Enable"}, {0x107, "Fire Alarm"}, {0x108, "Police Alarm"}, {0x109, "Proximity"}, {0x10A, "Motion"}, {0x10B, "Duress Alarm"}, {0x10C, "Holdup Alarm"}, {0x10D, "Medical Alarm"}, {0x150, "Balance Right"}, {0x151, "Balance Left"}, {0x152, "Bass Increment"}, {0x153, "Bass Decrement"}, {0x154, "Treble Increment"}, {0x155, "Treble Decrement"}, {0x160, "Speaker System"}, {0x161, "Channel Left"}, {0x162, "Channel Right"}, {0x163, "Channel Center"}, {0x164, "Channel Front"}, {0x165, "Channel Center Front"}, {0x166, "Channel Side"}, {0x167, "Channel Surround"}, {0x168, "Channel Low Frequency Enhancement"}, {0x169, "Channel Top"}, {0x16A, "Channel Unknown"}, {0x170, "Sub-channel"}, {0x171, "Sub-channel Increment"}, {0x172, "Sub-channel Decrement"}, {0x173, "Alternate Audio Increment"}, {0x174, "Alternate Audio Decrement"}, {0x180, "Application Launch Buttons"}, {0x181, "AL Launch Button Configuration Tool"}, {0x182, "AL Programmable Button Configuration"}, {0x183, "AL Consumer Control Configuration"}, {0x184, "AL Word Processor"}, {0x185, "AL Text Editor"}, {0x186, "AL Spreadsheet"}, {0x187, "AL Graphics Editor"}, {0x188, "AL Presentation App"}, {0x189, "AL Database App"}, {0x18A, "AL Email Reader"}, {0x18B, "AL Newsreader"}, {0x18C, "AL Voicemail"}, {0x18D, "AL Contacts/Address Book"}, {0x18E, "AL Calendar/Schedule"}, {0x18F, "AL Task/Project Manager"}, {0x190, "AL Log/Journal/Timecard"}, {0x191, "AL Checkbook/Finance"}, {0x192, "AL Calculator"}, {0x193, "AL A/V Capture/Playback"}, {0x194, "AL Local Machine Browser"}, {0x195, "AL LAN/WAN Browser"}, {0x196, "AL Internet Browser"}, {0x197, "AL Remote Networking/ISP Connect"}, {0x198, "AL Network Conference"}, {0x199, "AL Network Chat"}, {0x19A, "AL Telephony/Dialer"}, {0x19B, "AL Logon"}, {0x19C, "AL Logoff"}, {0x19D, "AL Logon/Logoff"}, {0x19E, "AL Terminal Lock/Screensaver"}, {0x19F, "AL Control Panel"}, {0x1A0, "AL Command Line Processor/Run"}, {0x1A1, "AL Process/Task Manager"}, {0x1A2, "AL Select Task/Application"}, {0x1A3, "AL Next Task/Application"}, {0x1A4, "AL Previous Task/Application"}, {0x1A5, "AL Preemptive Halt Task/Application"}, {0x1A6, "AL Integrated Help Center"}, {0x1A7, "AL Documents"}, {0x1A8, "AL Thesaurus"}, {0x1A9, "AL Dictionary"}, {0x1AA, "AL Desktop"}, {0x1AB, "AL Spell Check"}, {0x1AC, "AL Grammar Check"}, {0x1AD, "AL Wireless Status"}, {0x1AE, "AL Keyboard Layout"}, {0x1AF, "AL Virus Protection"}, {0x1B0, "AL Encryption"}, {0x1B1, "AL Screen Saver"}, {0x1B2, "AL Alarms"}, {0x1B3, "AL Clock"}, {0x1B4, "AL File Browser"}, {0x1B5, "AL Power Status"}, {0x1B6, "AL Image Browser"}, {0x1B7, "AL Audio Browser"}, {0x1B8, "AL Movie Browser"}, {0x1B9, "AL Digital Rights Manager"}, {0x1BA, "AL Digital Wallet"}, {0x1BC, "AL Instant Messaging"}, {0x1BD, "AL OEM Features/ Tips/Tutorial Browser"}, {0x1BE, "AL OEM Help"}, {0x1BF, "AL Online Community"}, {0x1C0, "AL Entertainment Content Browser"}, {0x1C1, "AL Online Shopping Browser"}, {0x1C2, "AL SmartCard Information/Help"}, {0x1C3, "AL Market Monitor/Finance Browser"}, {0x1C4, "AL Customized Corporate News Browser"}, {0x1C5, "AL Online Activity Browser"}, {0x1C6, "AL Research/Search Browser"}, {0x1C7, "AL Audio Player"}, {0x1C8, "AL Message Status"}, {0x1C9, "AL Contact Sync"}, {0x1CA, "AL Navigation"}, {0x1CB, "AL Context-aware Desktop Assistant"}, {0x200, "Generic GUI Application Controls"}, {0x201, "AC New"}, {0x202, "AC Open"}, {0x203, "AC Close"}, {0x204, "AC Exit"}, {0x205, "AC Maximize"}, {0x206, "AC Minimize"}, {0x207, "AC Save"}, {0x208, "AC Print"}, {0x209, "AC Properties"}, {0x21A, "AC Undo"}, {0x21B, "AC Copy"}, {0x21C, "AC Cut"}, {0x21D, "AC Paste"}, {0x21E, "AC Select All"}, {0x21F, "AC Find"}, {0x220, "AC Find and Replace"}, {0x221, "AC Search"}, {0x222, "AC Go To"}, {0x223, "AC Home"}, {0x224, "AC Back"}, {0x225, "AC Forward"}, {0x226, "AC Stop"}, {0x227, "AC Refresh"}, {0x228, "AC Previous Link"}, {0x229, "AC Next Link"}, {0x22A, "AC Bookmarks"}, {0x22B, "AC History"}, {0x22C, "AC Subscriptions"}, {0x22D, "AC Zoom In"}, {0x22E, "AC Zoom Out"}, {0x22F, "AC Zoom"}, {0x230, "AC Full Screen View"}, {0x231, "AC Normal View"}, {0x232, "AC View Toggle"}, {0x233, "AC Scroll Up"}, {0x234, "AC Scroll Down"}, {0x235, "AC Scroll"}, {0x236, "AC Pan Left"}, {0x237, "AC Pan Right"}, {0x238, "AC Pan"}, {0x239, "AC New Window"}, {0x23A, "AC Tile Horizontally"}, {0x23B, "AC Tile Vertically"}, {0x23C, "AC Format"}, {0x23D, "AC Edit"}, {0x23E, "AC Bold"}, {0x23F, "AC Italics"}, {0x240, "AC Underline"}, {0x241, "AC Strikethrough"}, {0x242, "AC Subscript"}, {0x243, "AC Superscript"}, {0x244, "AC All Caps"}, {0x245, "AC Rotate"}, {0x246, "AC Resize"}, {0x247, "AC Flip Horizontal"}, {0x248, "AC Flip Vertical"}, {0x249, "AC Mirror Horizontal"}, {0x24A, "AC Mirror Vertical"}, {0x24B, "AC Font Select"}, {0x24C, "AC Font Color"}, {0x24D, "AC Font Size"}, {0x24E, "AC Justify Left"}, {0x24F, "AC Justify Center H"}, {0x250, "AC Justify Right"}, {0x251, "AC Justify Block H"}, {0x252, "AC Justify Top"}, {0x253, "AC Justify Center V"}, {0x254, "AC Justify Bottom"}, {0x255, "AC Justify Block V"}, {0x256, "AC Indent Decrease"}, {0x257, "AC Indent Increase"}, {0x258, "AC Numbered List"}, {0x259, "AC Restart Numbering"}, {0x25A, "AC Bulleted List"}, {0x25B, "AC Promote"}, {0x25C, "AC Demote"}, {0x25D, "AC Yes"}, {0x25E, "AC No"}, {0x25F, "AC Cancel"}, {0x260, "AC Catalog"}, {0x261, "AC Buy/Checkout"}, {0x262, "AC Add to Cart"}, {0x263, "AC Expand"}, {0x264, "AC Expand All"}, {0x265, "AC Collapse"}, {0x266, "AC Collapse All"}, {0x267, "AC Print Preview"}, {0x268, "AC Paste Special"}, {0x269, "AC Insert Mode"}, {0x26A, "AC Delete"}, {0x26B, "AC Lock"}, {0x26C, "AC Unlock"}, {0x26D, "AC Protect"}, {0x26E, "AC Unprotect"}, {0x26F, "AC Attach Comment"}, {0x270, "AC Delete Comment"}, {0x271, "AC View Comment"}, {0x272, "AC Select Word"}, {0x273, "AC Select Sentence"}, {0x274, "AC Select Paragraph"}, {0x275, "AC Select Column"}, {0x276, "AC Select Row"}, {0x277, "AC Select Table"}, {0x278, "AC Select Object"}, {0x279, "AC Redo/Repeat"}, {0x27A, "AC Sort"}, {0x27B, "AC Sort Ascending"}, {0x27C, "AC Sort Descending"}, {0x27D, "AC Filter"}, {0x27E, "AC Set Clock"}, {0x27F, "AC View Clock"}, {0x280, "AC Select Time Zone"}, {0x281, "AC Edit Time Zones"}, {0x282, "AC Set Alarm"}, {0x283, "AC Clear Alarm"}, {0x284, "AC Snooze Alarm"}, {0x285, "AC Reset Alarm"}, {0x286, "AC Synchronize"}, {0x287, "AC Send/Receive"}, {0x288, "AC Send To"}, {0x289, "AC Reply"}, {0x28A, "AC Reply All"}, {0x28B, "AC Forward Msg"}, {0x28C, "AC Send"}, {0x28D, "AC Attach File"}, {0x28E, "AC Upload"}, {0x28F, "AC Download (Save Target As)"}, {0x290, "AC Set Borders"}, {0x291, "AC Insert Row"}, {0x292, "AC Insert Column"}, {0x293, "AC Insert File"}, {0x294, "AC Insert Picture"}, {0x295, "AC Insert Object"}, {0x296, "AC Insert Symbol"}, {0x297, "AC Save and Close"}, {0x298, "AC Rename"}, {0x299, "AC Merge"}, {0x29A, "AC Split"}, {0x29B, "AC Distribute Horizontally"}, {0x29C, "AC Distribute Vertically"}, {0x29D, "AC Next Keyboard Layout Select"}, {0x29E, "AC Navigation Guidance"}, {0x29F, "AC Desktop Show All Windows"}, {0x2A0, "AC Soft Key Left"}, {0x2A1, "AC Soft Key Right"}, {0x2A2, "AC Desktop Show All Applications"}, {0x2B0, "AC Idle Keep Alive"}, {0x2C0, "Extended Keyboard Attributes Collection"}, {0x2C1, "Keyboard Form Factor"}, {0x2C2, "Keyboard Key Type"}, {0x2C3, "Keyboard Physical Layout"}, {0x2C4, "Vendor-Specific Keyboard Physical Layout"}, {0x2C5, "Keyboard IETF Language Tag Index"}, {0x2C6, "Implemented Keyboard Input Assist Controls"}, {0x2C7, "Keyboard Input Assist Previous"}, {0x2C8, "Keyboard Input Assist Next"}, {0x2C9, "Keyboard Input Assist Previous Group"}, {0x2CA, "Keyboard Input Assist Next Group"}, {0x2CB, "Keyboard Input Assist Accept"}, {0x2CC, "Keyboard Input Assist Cancel"}, {0x2D0, "Privacy Screen Toggle"}, {0x2D1, "Privacy Screen Level Decrement"}, {0x2D2, "Privacy Screen Level Increment"}, {0x2D3, "Privacy Screen Level Minimum"}, {0x2D4, "Privacy Screen Level Maximum"}, {0x500, "Contact Edited"}, {0x501, "Contact Added"}, {0x502, "Contact Record Active"}, {0x503, "Contact Index"}, {0x504, "Contact Nickname"}, {0x505, "Contact First Name"}, {0x506, "Contact Last Name"}, {0x507, "Contact Full Name"}, {0x508, "Contact Phone Number Personal"}, {0x509, "Contact Phone Number Business"}, {0x50A, "Contact Phone Number Mobile"}, {0x50B, "Contact Phone Number Pager"}, {0x50C, "Contact Phone Number Fax"}, {0x50D, "Contact Phone Number Other"}, {0x50E, "Contact Email Personal"}, {0x50F, "Contact Email Business"}, {0x510, "Contact Email Other"}, {0x511, "Contact Email Main"}, {0x512, "Contact Speed Dial Number"}, {0x513, "Contact Status Flag"}, {0x514, "Contact Misc."}, {0, NULL} }; static const value_string usb_hid_digitizers_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Digitizer"}, {0x02, "Pen"}, {0x03, "Light Pen"}, {0x04, "Touch Screen"}, {0x05, "Touch Pad"}, {0x06, "Whiteboard"}, {0x07, "Coordinate Measuring Machine"}, {0x08, "3D Digitizer"}, {0x09, "Stereo Plotter"}, {0x0A, "Articulated Arm"}, {0x0B, "Armature"}, {0x0C, "Multiple Point Digitizer"}, {0x0D, "Free Space Wand"}, {0x0E, "Device Configuration"}, {0x0F, "Capacitive Heat Map Digitizer"}, {0x20, "Stylus"}, {0x21, "Puck"}, {0x22, "Finger"}, {0x23, "Device settings"}, {0x24, "Character Gesture"}, {0x30, "Tip Pressure"}, {0x31, "Barrel Pressure"}, {0x32, "In Range"}, {0x33, "Touch"}, {0x34, "Untouch"}, {0x35, "Tap"}, {0x36, "Quality"}, {0x37, "Data Valid"}, {0x38, "Transducer Index"}, {0x39, "Tablet Function Keys"}, {0x3A, "Program Change Keys"}, {0x3B, "Battery Strength"}, {0x3C, "Invert"}, {0x3D, "X Tilt"}, {0x3E, "Y Tilt"}, {0x3F, "Azimuth"}, {0x40, "Altitude"}, {0x41, "Twist"}, {0x42, "Tip Switch"}, {0x43, "Secondary Tip Switch"}, {0x44, "Barrel Switch"}, {0x45, "Eraser"}, {0x46, "Tablet Pick"}, {0x47, "Touch Valid"}, {0x48, "Width"}, {0x49, "Height"}, {0x51, "Contact Identifier"}, {0x52, "Device Mode"}, {0x53, "Device Identifier"}, {0x54, "Contact Count"}, {0x55, "Contact Count Maximum"}, {0x56, "Scan Time"}, {0x57, "Surface Switch"}, {0x58, "Button Switch"}, {0x59, "Pad Type"}, {0x5A, "Secondary Barrel Switch"}, {0x5B, "Transducer Serial Number"}, {0x5C, "Preferred Color"}, {0x5D, "Preferred Color is Locked"}, {0x5E, "Preferred Line Width"}, {0x5F, "Preferred Line Width is Locked"}, {0x60, "Latency Mode"}, {0x61, "Gesture Character Quality"}, {0x62, "Character Gesture Data Length"}, {0x63, "Character Gesture Data"}, {0x64, "Gesture Character Encoding"}, {0x65, "UTF8 Character Gesture Encoding"}, {0x66, "UTF16 Little Endian Character Gesture Encoding"}, {0x67, "UTF16 Big Endian Character Gesture Encoding"}, {0x68, "UTF32 Little Endian Character Gesture Encoding"}, {0x69, "UTF32 Big Endian Character Gesture Encoding"}, {0x6A, "Capacitive Heat Map Protocol Vendor ID"}, {0x6B, "Capacitive Heat Map Protocol Version"}, {0x6C, "Capacitive Heat Map Frame Data"}, {0x6D, "Gesture Character Enable"}, {0x70, "Preferred Line Style"}, {0x71, "Preferred Line Style is Locked"}, {0x72, "Ink"}, {0x73, "Pencil"}, {0x74, "Highlighter"}, {0x75, "Chisel Marker"}, {0x76, "Brush"}, {0x77, "No Preference"}, {0x80, "Digitizer Diagnostic"}, {0x81, "Digitizer Error"}, {0x82, "Err Normal Status"}, {0x83, "Err Transducers Exceeded"}, {0x84, "Err Full Trans Features Unavailable"}, {0x85, "Err Charge Low"}, {0x90, "Transducer Software Info"}, {0x91, "Transducer Vendor Id"}, {0x92, "Transducer Product Id"}, {0x93, "Device Supported Protocols"}, {0x94, "Transducer Supported Protocols"}, {0x95, "No Protocol"}, {0x96, "Wacom AES Protocol"}, {0x97, "USI Protocol"}, {0x98, "Microsoft Pen Protocol"}, {0xA0, "Supported Report Rates"}, {0xA1, "Report Rate"}, {0xA2, "Transducer Connected"}, {0xA3, "Switch Disabled"}, {0xA4, "Switch Unimplemented"}, {0xA5, "Transducer Switches"}, {0, NULL} }; static const value_string usb_hid_haptic_usage_page_vals[] = { {0x0000, "Undefined"}, {0x0001, "Simple Haptic Controller"}, {0x0010, "Waveform List"}, {0x0011, "Duration List"}, {0x0020, "Auto Trigger"}, {0x0021, "Manual Trigger"}, {0x0022, "Auto Trigger Associated Control"}, {0x0023, "Intensity"}, {0x0024, "Repeat Count"}, {0x0025, "Retrigger Period"}, {0x0026, "Waveform Vendor Page"}, {0x0027, "Waveform Vendor ID"}, {0x0028, "Waveform Cutoff Time"}, {0x1001, "Waveform None"}, {0x1002, "Waveform Stop"}, {0x1003, "Waveform Click"}, {0x1004, "Waveform Buzz Continuous"}, {0x1005, "Waveform Rumble Continuous"}, {0x1006, "Waveform Press"}, {0x1007, "Waveform Release"}, {0, NULL} }; static const value_string usb_hid_physical_input_device_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Physical Interface Device"}, {0x20, "Normal"}, {0x21, "Set Effect Report"}, {0x22, "Effect Block Index"}, {0x23, "Parameter Block Offset"}, {0x24, "ROM Flag"}, {0x25, "Effect Type"}, {0x26, "ET Constant Force"}, {0x27, "ET Ramp"}, {0x28, "ET Custom Force Data"}, {0x30, "ET Square"}, {0x31, "ET Sine"}, {0x32, "ET Triangle"}, {0x33, "ET Sawtooth Up"}, {0x34, "ET Sawtooth Down"}, {0x40, "ET Spring"}, {0x41, "ET Damper"}, {0x42, "ET Inertia"}, {0x43, "ET Friction"}, {0x50, "Duration"}, {0x51, "Sample Period"}, {0x52, "Gain"}, {0x53, "Trigger Button"}, {0x54, "Trigger Repeat Interval"}, {0x55, "Axes Enable"}, {0x56, "Direction Enable"}, {0x57, "Direction"}, {0x58, "Type Specific Block Offset"}, {0x59, "Block Type"}, {0x5A, "Set Envelope Report"}, {0x5B, "Attack Level"}, {0x5C, "Attack Time"}, {0x5D, "Fade Level"}, {0x5E, "Fade Time"}, {0x5F, "Set Condition Report"}, {0x60, "CP Offset"}, {0x61, "Positive Coefficient"}, {0x62, "Negative Coefficient"}, {0x63, "Positive Saturation"}, {0x64, "Negative Saturation"}, {0x65, "Dead Band"}, {0x66, "Download Force Sample"}, {0x67, "Isoch Custom Force Enable"}, {0x68, "Custom Force Data Report"}, {0x69, "Custom Force Data"}, {0x6A, "Custom Force Vendor Defined Data"}, {0x6B, "Set Custom Force Report"}, {0x6C, "Custom Force Data Offset"}, {0x6D, "Sample Count"}, {0x6E, "Set Periodic Report"}, {0x6F, "Offset"}, {0x70, "Magnitude"}, {0x71, "Phase"}, {0x72, "Period"}, {0x73, "Set Constant Force Report"}, {0x74, "Set Ramp Force Report"}, {0x75, "Ramp Start"}, {0x76, "Ramp End"}, {0x77, "Effect Operation Report"}, {0x78, "Effect Operation"}, {0x79, "Op Effect Start"}, {0x7A, "Op Effect Start Solo"}, {0x7B, "Op Effect Stop"}, {0x7C, "Loop Count"}, {0x7D, "Device Gain Report"}, {0x7E, "Device Gain"}, {0x7F, "PID Pool Report"}, {0x80, "RAM Pool Size"}, {0x81, "ROM Pool Size"}, {0x82, "ROM Effect Block Count"}, {0x83, "Simultaneous Effects Max"}, {0x84, "Pool Alignment"}, {0x85, "PID Pool Move Report"}, {0x86, "Move Source"}, {0x87, "Move Destination"}, {0x88, "Move Length"}, {0x89, "PID Block Load Report"}, {0x8B, "Block Load Status"}, {0x8C, "Block Load Success"}, {0x8D, "Block Load Full"}, {0x8E, "Block Load Error"}, {0x8F, "Block Handle"}, {0x90, "PID Block Free Report"}, {0x91, "Type Specific Block Handle"}, {0x92, "PID State Report"}, {0x94, "Effect Playing"}, {0x95, "PID Device Control Report"}, {0x96, "PID Device Control"}, {0x97, "DC Enable Actuators"}, {0x98, "DC Disable Actuators"}, {0x99, "DC Stop All Effects"}, {0x9A, "DC Device Reset"}, {0x9B, "DC Device Pause"}, {0x9C, "DC Device Continue"}, {0x9F, "Device Paused"}, {0xA0, "Actuators Enabled"}, {0xA4, "Safety Switch"}, {0xA5, "Actuator Override Switch"}, {0xA6, "Actuator Power"}, {0xA7, "Start Delay"}, {0xA8, "Parameter Block Size"}, {0xA9, "Device Managed Pool"}, {0xAA, "Shared Parameter Blocks"}, {0xAB, "Create New Effect Report"}, {0xAC, "RAM Pool Available"}, {0, NULL} }; static const value_string usb_hid_eye_and_head_tracker_usage_page_vals[] = { {0x0000, "Undefined"}, {0x0001, "Eye Tracker"}, {0x0002, "Head Tracker"}, {0x0010, "Tracking Data"}, {0x0011, "Capabilities"}, {0x0012, "Configuration"}, {0x0013, "Status"}, {0x0014, "Control"}, {0x0020, "Sensor Timestamp"}, {0x0021, "Position X"}, {0x0022, "Position Y"}, {0x0023, "Position Z"}, {0x0024, "Gaze Point"}, {0x0025, "Left Eye Position"}, {0x0026, "Right Eye Position"}, {0x0027, "Head Position"}, {0x0028, "Head Direction Point"}, {0x0029, "Rotation about X axis"}, {0x002A, "Rotation about Y axis"}, {0x002B, "Rotation about Z axis"}, {0x0100, "Tracker Quality"}, {0x0101, "Minimum Tracking Distance"}, {0x0102, "Optimum Tracking Distance"}, {0x0103, "Maximum Tracking Distance"}, {0x0104, "Maximum Screen Plane Width"}, {0x0105, "Maximum Screen Plane Height"}, {0x0200, "Display Manufacturer ID"}, {0x0201, "Display Product ID"}, {0x0202, "Display Serial Number"}, {0x0203, "Display Manufacturer Date"}, {0x0204, "Calibrated Screen Width"}, {0x0205, "Calibrated Screen Height"}, {0x0300, "Sampling Frequency"}, {0x0301, "Configuration Status"}, {0x0400, "Device Mode Request"}, {0, NULL} }; static const value_string usb_hid_alphanumeric_display_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Alphanumeric Display"}, {0x02, "Auxiliary Display"}, {0x20, "Display Attributes Report"}, {0x21, "ASCII Character Set"}, {0x22, "Data Read Back"}, {0x23, "Font Read Back"}, {0x24, "Display Control Report"}, {0x25, "Clear Display"}, {0x26, "Display Enable"}, {0x27, "Screen Saver Delay"}, {0x28, "Screen Saver Enable"}, {0x29, "Vertical Scroll"}, {0x2A, "Horizontal Scroll"}, {0x2B, "Character Report"}, {0x2C, "Display Data"}, {0x2D, "Display Status"}, {0x2E, "Stat Not Ready"}, {0x2F, "Stat Ready"}, {0x30, "Err Not a loadable character"}, {0x31, "Err Font data cannot be read"}, {0x32, "Cursor Position Report"}, {0x33, "Row"}, {0x34, "Column"}, {0x35, "Rows"}, {0x36, "Columns"}, {0x37, "Cursor Pixel Positioning"}, {0x38, "Cursor Mode"}, {0x39, "Cursor Enable"}, {0x3A, "Cursor Blink"}, {0x3B, "Font Report"}, {0x3C, "Font Data"}, {0x3D, "Character Width"}, {0x3E, "Character Height"}, {0x3F, "Character Spacing Horizontal"}, {0x40, "Character Spacing Vertical"}, {0x41, "Unicode Character Set"}, {0x42, "Font 7-Segment"}, {0x43, "7-Segment Direct Map"}, {0x44, "Font 14-Segment"}, {0x45, "14-Segment Direct Map"}, {0x46, "Display Brightness"}, {0x47, "Display Contrast"}, {0x48, "Character Attribute"}, {0x49, "Attribute Readback"}, {0x4A, "Attribute Data"}, {0x4B, "Char Attr Enhance"}, {0x4C, "Char Attr Underline"}, {0x4D, "Char Attr Blink"}, {0x80, "Bitmap Size X"}, {0x81, "Bitmap Size Y"}, {0x82, "Max Blit Size"}, {0x83, "Bit Depth Format"}, {0x84, "Display Orientation"}, {0x85, "Palette Report"}, {0x86, "Palette Data Size"}, {0x87, "Palette Data Offset"}, {0x88, "Palette Data"}, {0x8A, "Blit Report"}, {0x8B, "Blit Rectangle X1"}, {0x8C, "Blit Rectangle Y1"}, {0x8D, "Blit Rectangle X2"}, {0x8E, "Blit Rectangle Y2"}, {0x8F, "Blit Data"}, {0x90, "Soft Button"}, {0x91, "Soft Button ID"}, {0x92, "Soft Button Side"}, {0x93, "Soft Button Offset 1"}, {0x94, "Soft Button Offset 2"}, {0x95, "Soft Button Report"}, {0xC2, "Soft Keys"}, {0xCC, "Display Data Extensions"}, {0xCF, "Character Mapping"}, {0xDD, "Unicode Equivalent"}, {0xDF, "Character Page Mapping"}, {0xFF, "Request Report"}, {0, NULL} }; static const value_string usb_hid_sensor_usage_page_vals[] = { {0x0000, "Undefined"}, {0x0001, "Sensor"}, {0x0010, "Biometric"}, {0x0011, "Biometric: Human Presence"}, {0x0012, "Biometric: Human Proximity"}, {0x0013, "Biometric: Human Touch"}, {0x0014, "Biometric: Blood Pressure"}, {0x0015, "Biometric: Body Temperature"}, {0x0016, "Biometric: Heart Rate"}, {0x0017, "Biometric: Heart Rate Variability"}, {0x0018, "Biometric: Peripheral Oxygen Saturation"}, {0x0019, "Biometric: Respiratory Rate"}, {0x0020, "Electrical"}, {0x0021, "Electrical: Capacitance"}, {0x0022, "Electrical: Current"}, {0x0023, "Electrical: Power"}, {0x0024, "Electrical: Inductance"}, {0x0025, "Electrical: Resistance"}, {0x0026, "Electrical: Voltage"}, {0x0027, "Electrical: Potentiometer"}, {0x0028, "Electrical: Frequency"}, {0x0029, "Electrical: Period"}, {0x0030, "Environmental"}, {0x0031, "Environmental: Atmospheric Pressure"}, {0x0032, "Environmental: Humidity"}, {0x0033, "Environmental: Temperature"}, {0x0034, "Environmental: Wind Direction"}, {0x0035, "Environmental: Wind Speed"}, {0x0036, "Environmental: Air Quality"}, {0x0037, "Environmental: Heat Index"}, {0x0038, "Environmental: Surface Temperature"}, {0x0039, "Environmental: Volatile Organic Compounds"}, {0x003A, "Environmental: Object Presence"}, {0x003B, "Environmental: Object Proximity"}, {0x0040, "Light"}, {0x0041, "Light: Ambient Light"}, {0x0042, "Light: Consumer Infrared"}, {0x0043, "Light: Infrared Light"}, {0x0044, "Light: Visible Light"}, {0x0045, "Light: Ultraviolet Light"}, {0x0050, "Location"}, {0x0051, "Location: Broadcast"}, {0x0052, "Location: Dead Reckoning"}, {0x0053, "Location: GPS (Global Positioning System)"}, {0x0054, "Location: Lookup"}, {0x0055, "Location: Other"}, {0x0056, "Location: Static"}, {0x0057, "Location: Triangulation"}, {0x0060, "Mechanical"}, {0x0061, "Mechanical: Boolean Switch"}, {0x0062, "Mechanical: Boolean Switch Array"}, {0x0063, "Mechanical: Multivalue Switch"}, {0x0064, "Mechanical: Force"}, {0x0065, "Mechanical: Pressure"}, {0x0066, "Mechanical: Strain"}, {0x0067, "Mechanical: Weight"}, {0x0068, "Mechanical: Haptic Vibrator"}, {0x0069, "Mechanical: Hall Effect Switch"}, {0x0070, "Motion"}, {0x0071, "Motion: Accelerometer 1D"}, {0x0072, "Motion: Accelerometer 2D"}, {0x0073, "Motion: Accelerometer 3D"}, {0x0074, "Motion: Gyrometer 1D"}, {0x0075, "Motion: Gyrometer 2D"}, {0x0076, "Motion: Gyrometer 3D"}, {0x0077, "Motion: Motion Detector"}, {0x0078, "Motion: Speedometer"}, {0x0079, "Motion: Accelerometer"}, {0x007A, "Motion: Gyrometer"}, {0x007B, "Motion: Gravity Vector"}, {0x007C, "Motion: Linear Accelerometer"}, {0x0080, "Orientation"}, {0x0081, "Orientation: Compass 1D"}, {0x0082, "Orientation: Compass 2D"}, {0x0083, "Orientation: Compass 3D"}, {0x0084, "Orientation: Inclinometer 1D"}, {0x0085, "Orientation: Inclinometer 2D"}, {0x0086, "Orientation: Inclinometer 3D"}, {0x0087, "Orientation: Distance 1D"}, {0x0088, "Orientation: Distance 2D"}, {0x0089, "Orientation: Distance 3D"}, {0x008A, "Orientation: Device Orientation"}, {0x008B, "Orientation: Compass"}, {0x008C, "Orientation: Inclinometer"}, {0x008D, "Orientation: Distance"}, {0x008E, "Orientation: Relative Orientation"}, {0x008F, "Orientation: Simple Orientation"}, {0x0090, "Scanner"}, {0x0091, "Scanner: Barcode"}, {0x0092, "Scanner: RFID"}, {0x0093, "Scanner: NFC"}, {0x00A0, "Time"}, {0x00A1, "Time: Alarm Timer"}, {0x00A2, "Time: Real Time Clock"}, {0x00B0, "Personal Activity"}, {0x00B1, "Personal Activity: Activity Detection"}, {0x00B2, "Personal Activity: Device Position"}, {0x00B3, "Personal Activity: Pedometer"}, {0x00B4, "Personal Activity: Step Detection"}, {0x00C0, "Orientation Extended"}, {0x00C1, "Orientation Extended: Geomagnetic Orientation"}, {0x00C2, "Orientation Extended: Magnetometer"}, {0x00D0, "Gesture"}, {0x00D1, "Gesture: Chassis Flip Gesture"}, {0x00D2, "Gesture: Hinge Fold Gesture"}, {0x00E0, "Other"}, {0x00E1, "Other: Custom"}, {0x00E2, "Other: Generic"}, {0x00E3, "Other: Generic Enumerator"}, {0x00E4, "Other: Hinge Angle"}, {0x0200, "Event"}, {0x0201, "Event: Sensor State"}, {0x0202, "Event: Sensor Event"}, {0x0300, "Property"}, {0x0301, "Property: Friendly Name"}, {0x0302, "Property: Persistent Unique ID"}, {0x0303, "Property: Sensor Status"}, {0x0304, "Property: Minimum Report Interval"}, {0x0305, "Property: Sensor Manufacturer"}, {0x0306, "Property: Sensor Model"}, {0x0307, "Property: Sensor Serial Number"}, {0x0308, "Property: Sensor Description"}, {0x0309, "Property: Sensor Connection Type"}, {0x030A, "Property: Sensor Device Path"}, {0x030B, "Property: Hardware Revision"}, {0x030C, "Property: Firmware Version"}, {0x030D, "Property: Release Date"}, {0x030E, "Property: Report Interval"}, {0x030F, "Property: Change Sensitivity Absolute"}, {0x0310, "Property: Change Sensitivity Percent of Range"}, {0x0311, "Property: Change Sensitivity Percent Relative"}, {0x0312, "Property: Accuracy"}, {0x0313, "Property: Resolution"}, {0x0314, "Property: Maximum"}, {0x0315, "Property: Minimum"}, {0x0316, "Property: Reporting State"}, {0x0317, "Property: Sampling Rate"}, {0x0318, "Property: Response Curve"}, {0x0319, "Property: Power State"}, {0x031A, "Property: Maximum FIFO Events"}, {0x031B, "Property: Report Latency"}, {0x031C, "Property: Flush FIFO Events"}, {0x031D, "Property: Maximum Power Consumption"}, {0x031E, "Property: Is Primary"}, {0x0400, "Data Field: Location"}, {0x0401, "Reserved (Data Field: Location)"}, {0x0402, "Data Field: Altitude Antenna Sea Level"}, {0x0403, "Data Field: Differential Reference Station ID"}, {0x0404, "Data Field: Altitude Ellipsoid Error"}, {0x0405, "Data Field: Altitude Ellipsoid"}, {0x0406, "Data Field: Altitude Sea Level Error"}, {0x0407, "Data Field: Altitude Sea Level"}, {0x0408, "Data Field: Differential GPS Data Age"}, {0x0409, "Data Field: Error Radius"}, {0x040A, "Data Field: Fix Quality"}, {0x040B, "Data Field: Fix Type"}, {0x040C, "Data Field: Geoidal Separation"}, {0x040D, "Data Field: GPS Operation Mode"}, {0x040E, "Data Field: GPS Selection Mode"}, {0x040F, "Data Field: GPS Status"}, {0x0410, "Data Field: Position Dilution of Precision"}, {0x0411, "Data Field: Horizontal Dilution of Precision"}, {0x0412, "Data Field: Vertical Dilution of Precision"}, {0x0413, "Data Field: Latitude"}, {0x0414, "Data Field: Longitude"}, {0x0415, "Data Field: True Heading"}, {0x0416, "Data Field: Magnetic Heading"}, {0x0417, "Data Field: Magnetic Variation"}, {0x0418, "Data Field: Speed"}, {0x0419, "Data Field: Satellites in View"}, {0x041A, "Data Field: Satellites in View Azimuth"}, {0x041B, "Data Field: Satellites in View Elevation"}, {0x041C, "Data Field: Satellites in View IDs"}, {0x041D, "Data Field: Satellites in View PRNs"}, {0x041E, "Data Field: Satellites in View S/N Ratios"}, {0x041F, "Data Field: Satellites Used Count"}, {0x0420, "Data Field: Satellites Used PRNs"}, {0x0421, "Data Field: NMEA Sentence"}, {0x0422, "Data Field: Address Line 1"}, {0x0423, "Data Field: Address Line 2"}, {0x0424, "Data Field: City"}, {0x0425, "Data Field: State or Province"}, {0x0426, "Data Field: Country or Region"}, {0x0427, "Data Field: Postal Code"}, {0x042A, "Property: Location"}, {0x042B, "Property: Location Desired Accuracy"}, {0x0430, "Data Field: Environmental"}, {0x0431, "Data Field: Atmospheric Pressure"}, {0x0432, "Reserved (Data Field: Environmental)"}, {0x0433, "Data Field: Relative Humidity"}, {0x0434, "Data Field: Temperature"}, {0x0435, "Data Field: Wind Direction"}, {0x0436, "Data Field: Wind Speed"}, {0x0437, "Data Field: Air Quality Index"}, {0x0438, "Data Field: Equivalent CO2"}, {0x0439, "Data Field: Volatile Organic Compound Concentration"}, {0x043A, "Data Field: Object Presence"}, {0x043B, "Data Field: Object Proximity Range"}, {0x043C, "Data Field: Object Proximity Out of Range"}, {0x0440, "Property: Environmental"}, {0x0441, "Property: Reference Pressure"}, {0x0450, "Data Field: Motion"}, {0x0451, "Data Field: Motion State"}, {0x0452, "Data Field: Acceleration"}, {0x0453, "Data Field: Acceleration Axis X"}, {0x0454, "Data Field: Acceleration Axis Y"}, {0x0455, "Data Field: Acceleration Axis Z"}, {0x0456, "Data Field: Angular Velocity"}, {0x0457, "Data Field: Angular Velocity about X Axis"}, {0x0458, "Data Field: Angular Velocity about Y Axis"}, {0x0459, "Data Field: Angular Velocity about Z Axis"}, {0x045A, "Data Field: Angular Position"}, {0x045B, "Data Field: Angular Position about X Axis"}, {0x045C, "Data Field: Angular Position about Y Axis"}, {0x045D, "Data Field: Angular Position about Z Axis"}, {0x045E, "Data Field: Motion Speed"}, {0x045F, "Data Field: Motion Intensity"}, {0x0470, "Data Field: Orientation"}, {0x0471, "Data Field: Heading"}, {0x0472, "Data Field: Heading X Axis"}, {0x0473, "Data Field: Heading Y Axis"}, {0x0474, "Data Field: Heading Z Axis"}, {0x0475, "Data Field: Heading Compensated Magnetic North"}, {0x0476, "Data Field: Heading Compensated True North"}, {0x0477, "Data Field: Heading Magnetic North"}, {0x0478, "Data Field: Heading True North"}, {0x0479, "Data Field: Distance"}, {0x047A, "Data Field: Distance X Axis"}, {0x047B, "Data Field: Distance Y Axis"}, {0x047C, "Data Field: Distance Z Axis"}, {0x047D, "Data Field: Distance Out-of-Range"}, {0x047E, "Data Field: Tilt"}, {0x047F, "Data Field: Tilt X Axis"}, {0x0480, "Data Field: Tilt Y Axis"}, {0x0481, "Data Field: Tilt Z Axis"}, {0x0482, "Data Field: Rotation Matrix"}, {0x0483, "Data Field: Quaternion"}, {0x0484, "Data Field: Magnetic Flux"}, {0x0485, "Data Field: Magnetic Flux X Axis"}, {0x0486, "Data Field: Magnetic Flux Y Axis"}, {0x0487, "Data Field: Magnetic Flux Z Axis"}, {0x0488, "Data Field: Magnetometer Accuracy"}, {0x0489, "Data Field: Simple Orientation Direction"}, {0x0490, "Data Field: Mechanical"}, {0x0491, "Data Field: Boolean Switch State"}, {0x0492, "Data Field: Boolean Switch Array States"}, {0x0493, "Data Field: Multivalue Switch Value"}, {0x0494, "Data Field: Force"}, {0x0495, "Data Field: Absolute Pressure"}, {0x0496, "Data Field: Gauge Pressure"}, {0x0497, "Data Field: Strain"}, {0x0498, "Data Field: Weight"}, {0x04A0, "Property: Mechanical"}, {0x04A1, "Property: Vibration State"}, {0x04A2, "Property: Forward Vibration Speed"}, {0x04A3, "Property: Backward Vibration Speed"}, {0x04B0, "Data Field: Biometric"}, {0x04B1, "Data Field: Human Presence"}, {0x04B2, "Data Field: Human Proximity Range"}, {0x04B3, "Data Field: Human Proximity Out of Range"}, {0x04B4, "Data Field: Human Touch State"}, {0x04B5, "Data Field: Blood Pressure"}, {0x04B6, "Data Field: Blood Pressure Diastolic"}, {0x04B7, "Data Field: Blood Pressure Systolic"}, {0x04B8, "Data Field: Heart Rate"}, {0x04B9, "Data Field: Resting Heart Rate"}, {0x04BA, "Data Field: Heartbeat Interval"}, {0x04BB, "Data Field: Respiratory Rate"}, {0x04BC, "Data Field: SpO2"}, {0x04D0, "Data Field: Light"}, {0x04D1, "Data Field: Illuminance"}, {0x04D2, "Data Field: Color Temperature"}, {0x04D3, "Data Field: Chromaticity"}, {0x04D4, "Data Field: Chromaticity X"}, {0x04D5, "Data Field: Chromaticity Y"}, {0x04D6, "Data Field: Consumer IR Sentence Receive"}, {0x04D7, "Data Field: Infrared Light"}, {0x04D8, "Data Field: Red Light"}, {0x04D9, "Data Field: Green Light"}, {0x04DA, "Data Field: Blue Light"}, {0x04DB, "Data Field: Ultraviolet A Light"}, {0x04DC, "Data Field: Ultraviolet B Light"}, {0x04DD, "Data Field: Ultraviolet Index"}, {0x04DE, "Data Field: Near Infrared Light"}, {0x04DF, "Property: Light"}, {0x04E0, "Property: Consumer IR Sentence Send"}, {0x04E2, "Property: Auto Brightness Preferred"}, {0x04E3, "Property: Auto Color Preferred"}, {0x04F0, "Data Field: Scanner"}, {0x04F1, "Data Field: RFID Tag 40 Bit"}, {0x04F2, "Data Field: NFC Sentence Receive"}, {0x04F8, "Property: Scanner"}, {0x04F9, "Property: NFC Sentence Send"}, {0x0500, "Data Field: Electrical"}, {0x0501, "Data Field: Capacitance"}, {0x0502, "Data Field: Current"}, {0x0503, "Data Field: Electrical Power"}, {0x0504, "Data Field: Inductance"}, {0x0505, "Data Field: Resistance"}, {0x0506, "Data Field: Voltage"}, {0x0507, "Data Field: Frequency"}, {0x0508, "Data Field: Period"}, {0x0509, "Data Field: Percent of Range"}, {0x0520, "Data Field: Time"}, {0x0521, "Data Field: Year"}, {0x0522, "Data Field: Month"}, {0x0523, "Data Field: Day"}, {0x0524, "Data Field: Day of Week"}, {0x0525, "Data Field: Hour"}, {0x0526, "Data Field: Minute"}, {0x0527, "Data Field: Second"}, {0x0528, "Data Field: Millisecond"}, {0x0529, "Data Field: Timestamp"}, {0x052A, "Data Field: Julian Day of Year"}, {0x052B, "Data Field: Time Since System Boot"}, {0x0530, "Property: Time"}, {0x0531, "Property: Time Zone Offset from UTC"}, {0x0532, "Property: Time Zone Name"}, {0x0533, "Property: Daylight Savings Time Observed"}, {0x0534, "Property: Time Trim Adjustment"}, {0x0535, "Property: Arm Alarm"}, {0x0540, "Data Field: Custom"}, {0x0541, "Data Field: Custom Usage"}, {0x0542, "Data Field: Custom Boolean Array"}, {0x0543, "Data Field: Custom Value"}, {0x0544, "Data Field: Custom Value 1"}, {0x0545, "Data Field: Custom Value 2"}, {0x0546, "Data Field: Custom Value 3"}, {0x0547, "Data Field: Custom Value 4"}, {0x0548, "Data Field: Custom Value 5"}, {0x0549, "Data Field: Custom Value 6"}, {0x054A, "Data Field: Custom Value 7"}, {0x054B, "Data Field: Custom Value 8"}, {0x054C, "Data Field: Custom Value 9"}, {0x054D, "Data Field: Custom Value 10"}, {0x054E, "Data Field: Custom Value 11"}, {0x054F, "Data Field: Custom Value 12"}, {0x0550, "Data Field: Custom Value 13"}, {0x0551, "Data Field: Custom Value 14"}, {0x0552, "Data Field: Custom Value 15"}, {0x0553, "Data Field: Custom Value 16"}, {0x0554, "Data Field: Custom Value 17"}, {0x0555, "Data Field: Custom Value 18"}, {0x0556, "Data Field: Custom Value 19"}, {0x0557, "Data Field: Custom Value 20"}, {0x0558, "Data Field: Custom Value 21"}, {0x0559, "Data Field: Custom Value 22"}, {0x055A, "Data Field: Custom Value 23"}, {0x055B, "Data Field: Custom Value 24"}, {0x055C, "Data Field: Custom Value 25"}, {0x055D, "Data Field: Custom Value 26"}, {0x055E, "Data Field: Custom Value 27"}, {0x055F, "Data Field: Custom Value 28"}, {0x0560, "Data Field: Generic"}, {0x0561, "Data Field: Generic GUID or PROPERTYKEY"}, {0x0562, "Data Field: Generic Category GUID"}, {0x0563, "Data Field: Generic Type GUID"}, {0x0564, "Data Field: Generic Event PROPERTYKEY"}, {0x0565, "Data Field: Generic Property PROPERTYKEY"}, {0x0566, "Data Field: Generic Data Field PROPERTYKEY"}, {0x0567, "Data Field: Generic Event"}, {0x0568, "Data Field: Generic Property"}, {0x0569, "Data Field: Generic Data Field"}, {0x056A, "Data Field: Enumerator Table Row Index"}, {0x056B, "Data Field: Enumerator Table Row Count"}, {0x056C, "Data Field: Generic GUID or PROPERTYKEY kind"}, {0x056D, "Data Field: Generic GUID"}, {0x056E, "Data Field: Generic PROPERTYKEY"}, {0x056F, "Data Field: Generic Top Level Collection ID"}, {0x0570, "Data Field: Generic Report ID"}, {0x0571, "Data Field: Generic Report Item Position Index"}, {0x0572, "Data Field: Generic Firmware VARTYPE"}, {0x0573, "Data Field: Generic Unit of Measure"}, {0x0574, "Data Field: Generic Unit Exponent"}, {0x0575, "Data Field: Generic Report Size"}, {0x0576, "Data Field: Generic Report Count"}, {0x0580, "Property: Generic"}, {0x0581, "Property: Enumerator Table Row Index"}, {0x0582, "Property: Enumerator Table Row Count"}, {0x0590, "Data Field: Personal Activity"}, {0x0591, "Data Field: Activity Type"}, {0x0592, "Data Field: Activity State"}, {0x0593, "Data Field: Device Position"}, {0x0594, "Data Field: Step Count"}, {0x0595, "Data Field: Step Count Reset"}, {0x0596, "Data Field: Step Duration"}, {0x0597, "Data Field: Step Type"}, {0x05A0, "Property: Minimum Activity Detection Interval"}, {0x05A1, "Property: Supported Activity Types"}, {0x05A2, "Property: Subscribed Activity Types"}, {0x05A3, "Property: Supported Step Types"}, {0x05A4, "Property: Subscribed Step Types"}, {0x05A5, "Property: Floor Height"}, {0x05B0, "Data Field: Custom Type ID"}, {0x05C0, "Property: Custom"}, {0x05C1, "Property: Custom Value 1"}, {0x05C2, "Property: Custom Value 2"}, {0x05C3, "Property: Custom Value 3"}, {0x05C4, "Property: Custom Value 4"}, {0x05C5, "Property: Custom Value 5"}, {0x05C6, "Property: Custom Value 6"}, {0x05C7, "Property: Custom Value 7"}, {0x05C8, "Property: Custom Value 8"}, {0x05C9, "Property: Custom Value 9"}, {0x05CA, "Property: Custom Value 10"}, {0x05CB, "Property: Custom Value 11"}, {0x05CC, "Property: Custom Value 12"}, {0x05CD, "Property: Custom Value 13"}, {0x05CE, "Property: Custom Value 14"}, {0x05CF, "Property: Custom Value 15"}, {0x05D0, "Property: Custom Value 16"}, {0x05E0, "Data Field: Hinge"}, {0x05E1, "Data Field: Hinge Angle"}, {0x05F0, "Data Field: Gesture Sensor"}, {0x05F1, "Data Field: Gesture State"}, {0x05F2, "Data Field: Hinge Fold Initial Angle"}, {0x05F3, "Data Field: Hinge Fold Final Angle"}, {0x05F4, "Data Field: Hinge Fold Contributing Panel"}, {0x05F5, "Data Field: Hinge Fold Type"}, {0x0800, "Sensor State: Undefined"}, {0x0801, "Sensor State: Ready"}, {0x0802, "Sensor State: Not Available"}, {0x0803, "Sensor State: No Data"}, {0x0804, "Sensor State: Initializing"}, {0x0805, "Sensor State: Access Denied"}, {0x0806, "Sensor State: Error"}, {0x0810, "Sensor Event: Unknown"}, {0x0811, "Sensor Event: State Changed"}, {0x0812, "Sensor Event: Property Changed"}, {0x0813, "Sensor Event: Data Updated"}, {0x0814, "Sensor Event: Poll Response"}, {0x0815, "Sensor Event: Change Sensitivity"}, {0x0816, "Sensor Event: Range Maximum Reached"}, {0x0817, "Sensor Event: Range Minimum Reached"}, {0x0818, "Sensor Event: High Threshold Cross Upward"}, {0x0819, "Sensor Event: High Threshold Cross Downward"}, {0x081A, "Sensor Event: Low Threshold Cross Upward"}, {0x081B, "Sensor Event: Low Threshold Cross Downward"}, {0x081C, "Sensor Event: Zero Threshold Cross Upward"}, {0x081D, "Sensor Event: Zero Threshold Cross Downward"}, {0x081E, "Sensor Event: Period Exceeded"}, {0x081F, "Sensor Event: Frequency Exceeded"}, {0x0820, "Sensor Event: Complex Trigger"}, {0x0830, "Connection Type: PC Integrated"}, {0x0831, "Connection Type: PC Attached"}, {0x0832, "Connection Type: PC External"}, {0x0840, "Reporting State: Report No Events"}, {0x0841, "Reporting State: Report All Events"}, {0x0842, "Reporting State: Report Threshold Events"}, {0x0843, "Reporting State: Wake On No Events"}, {0x0844, "Reporting State: Wake On All Events"}, {0x0845, "Reporting State: Wake On Threshold Events"}, {0x0850, "Power State: Undefined"}, {0x0851, "Power State: D0 Full Power"}, {0x0852, "Power State: D1 Low Power"}, {0x0853, "Power State: D2 Standby Power with Wakeup"}, {0x0854, "Power State: D3 Sleep with Wakeup"}, {0x0855, "Power State: D4 Power Off"}, {0x0860, "Accuracy: Default"}, {0x0861, "Accuracy: High"}, {0x0862, "Accuracy: Medium"}, {0x0863, "Accuracy: Low"}, {0x0870, "Fix Quality: No Fix"}, {0x0871, "Fix Quality: GPS"}, {0x0872, "Fix Quality: DGPS"}, {0x0880, "Fix Type: No Fix"}, {0x0881, "Fix Type: GPS SPS Mode, Fix Valid"}, {0x0882, "Fix Type: DGPS SPS Mode, Fix Valid"}, {0x0883, "Fix Type: GPS PPS Mode, Fix Valid"}, {0x0884, "Fix Type: Real Time Kinematic"}, {0x0885, "Fix Type: Float RTK"}, {0x0886, "Fix Type: Estimated (dead reckoned)"}, {0x0887, "Fix Type: Manual Input Mode"}, {0x0888, "Fix Type: Simulator Mode"}, {0x0890, "GPS Operation Mode: Manual"}, {0x0891, "GPS Operation Mode: Automatic"}, {0x08A0, "GPS Selection Mode: Autonomous"}, {0x08A1, "GPS Selection Mode: DGPS"}, {0x08A2, "GPS Selection Mode: Estimated (dead reckoned)"}, {0x08A3, "GPS Selection Mode: Manual Input"}, {0x08A4, "GPS Selection Mode: Simulator"}, {0x08A5, "GPS Selection Mode: Data Not Valid"}, {0x08B0, "GPS Status Data: Valid"}, {0x08B1, "GPS Status Data: Not Valid"}, {0x08C0, "Day of Week: Sunday"}, {0x08C1, "Day of Week: Monday"}, {0x08C2, "Day of Week: Tuesday"}, {0x08C3, "Day of Week: Wednesday"}, {0x08C4, "Day of Week: Thursday"}, {0x08C5, "Day of Week: Friday"}, {0x08C6, "Day of Week: Saturday"}, {0x08D0, "Kind: Category"}, {0x08D1, "Kind: Type"}, {0x08D2, "Kind: Event"}, {0x08D3, "Kind: Property"}, {0x08D4, "Kind: Data Field"}, {0x08E0, "Magnetometer Accuracy: Low"}, {0x08E1, "Magnetometer Accuracy: Medium"}, {0x08E2, "Magnetometer Accuracy: High"}, {0x08F0, "Simple Orientation Direction: Not Rotated"}, {0x08F1, "Simple Orientation Direction: Rotated 90 Degrees CCW"}, {0x08F2, "Simple Orientation Direction: Rotated 180 Degrees CCW"}, {0x08F3, "Simple Orientation Direction: Rotated 270 Degrees CCW"}, {0x08F4, "Simple Orientation Direction: Face Up"}, {0x08F5, "Simple Orientation Direction: Face Down"}, {0x0900, "VT_NULL: Empty"}, {0x0901, "VT_BOOL: Boolean"}, {0x0902, "VT_UI1: Byte"}, {0x0903, "VT_I1: Character"}, {0x0904, "VT_UI2: Unsigned Short"}, {0x0905, "VT_I2: Short"}, {0x0906, "VT_UI4: Unsigned Long"}, {0x0907, "VT_I4: Long"}, {0x0908, "VT_UI8: Unsigned Long Long"}, {0x0909, "VT_I8: Long Long"}, {0x090A, "VT_R4: Float"}, {0x090B, "VT_R8: Double"}, {0x090C, "VT_WSTR: Wide String"}, {0x090D, "VT_STR: Narrow String"}, {0x090E, "VT_CLSID: Guid"}, {0x090F, "VT_VECTOR|VT_UI1: Opaque Structure"}, {0x0910, "VT_F16E0: HID 16-bit Float with Unit Exponent 0"}, {0x0911, "VT_F16E1: HID 16-bit Float with Unit Exponent 1"}, {0x0912, "VT_F16E2: HID 16-bit Float with Unit Exponent 2"}, {0x0913, "VT_F16E3: HID 16-bit Float with Unit Exponent 3"}, {0x0914, "VT_F16E4: HID 16-bit Float with Unit Exponent 4"}, {0x0915, "VT_F16E5: HID 16-bit Float with Unit Exponent 5"}, {0x0916, "VT_F16E6: HID 16-bit Float with Unit Exponent 6"}, {0x0917, "VT_F16E7: HID 16-bit Float with Unit Exponent 7"}, {0x0918, "VT_F16E8: HID 16-bit Float with Unit Exponent 8"}, {0x0919, "VT_F16E9: HID 16-bit Float with Unit Exponent 9"}, {0x091A, "VT_F16EA: HID 16-bit Float with Unit Exponent A"}, {0x091B, "VT_F16EB: HID 16-bit Float with Unit Exponent B"}, {0x091C, "VT_F16EC: HID 16-bit Float with Unit Exponent C"}, {0x091D, "VT_F16ED: HID 16-bit Float with Unit Exponent D"}, {0x091E, "VT_F16EE: HID 16-bit Float with Unit Exponent E"}, {0x091F, "VT_F16EF: HID 16-bit Float with Unit Exponent F"}, {0x0920, "VT_F32E0: HID 32-bit Float with Unit Exponent 0"}, {0x0921, "VT_F32E1: HID 32-bit Float with Unit Exponent 1"}, {0x0922, "VT_F32E2: HID 32-bit Float with Unit Exponent 2"}, {0x0923, "VT_F32E3: HID 32-bit Float with Unit Exponent 3"}, {0x0924, "VT_F32E4: HID 32-bit Float with Unit Exponent 4"}, {0x0925, "VT_F32E5: HID 32-bit Float with Unit Exponent 5"}, {0x0926, "VT_F32E6: HID 32-bit Float with Unit Exponent 6"}, {0x0927, "VT_F32E7: HID 32-bit Float with Unit Exponent 7"}, {0x0928, "VT_F32E8: HID 32-bit Float with Unit Exponent 8"}, {0x0929, "VT_F32E9: HID 32-bit Float with Unit Exponent 9"}, {0x092A, "VT_F32EA: HID 32-bit Float with Unit Exponent A"}, {0x092B, "VT_F32EB: HID 32-bit Float with Unit Exponent B"}, {0x092C, "VT_F32EC: HID 32-bit Float with Unit Exponent C"}, {0x092D, "VT_F32ED: HID 32-bit Float with Unit Exponent D"}, {0x092E, "VT_F32EE: HID 32-bit Float with Unit Exponent E"}, {0x092F, "VT_F32EF: HID 32-bit Float with Unit Exponent F"}, {0x0930, "Activity Type: Unknown"}, {0x0931, "Activity Type: Stationary"}, {0x0932, "Activity Type: Fidgeting"}, {0x0933, "Activity Type: Walking"}, {0x0934, "Activity Type: Running"}, {0x0935, "Activity Type: In Vehicle"}, {0x0936, "Activity Type: Biking"}, {0x0937, "Activity Type: Idle"}, {0x0940, "Unit: Not Specified"}, {0x0941, "Unit: Lux"}, {0x0942, "Unit: Degrees Kelvin"}, {0x0943, "Unit: Degrees Celsius"}, {0x0944, "Unit: Pascal"}, {0x0945, "Unit: Newton"}, {0x0946, "Unit: Meters/Second"}, {0x0947, "Unit: Kilogram"}, {0x0948, "Unit: Meter"}, {0x0949, "Unit: Meters/Second/Second"}, {0x094A, "Unit: Farad"}, {0x094B, "Unit: Ampere"}, {0x094C, "Unit: Watt"}, {0x094D, "Unit: Henry"}, {0x094E, "Unit: Ohm"}, {0x094F, "Unit: Volt"}, {0x0950, "Unit: Hertz"}, {0x0951, "Unit: Bar"}, {0x0952, "Unit: Degrees Anti-clockwise"}, {0x0953, "Unit: Degrees Clockwise"}, {0x0954, "Unit: Degrees"}, {0x0955, "Unit: Degrees/Second"}, {0x0956, "Unit: Degrees/Second/Second"}, {0x0957, "Unit: Knot"}, {0x0958, "Unit: Percent"}, {0x0959, "Unit: Second"}, {0x095A, "Unit: Millisecond"}, {0x095B, "Unit: G"}, {0x095C, "Unit: Bytes"}, {0x095D, "Unit: Milligauss"}, {0x095E, "Unit: Bits"}, {0x0960, "Activity State: No State Change"}, {0x0961, "Activity State: Start Activity"}, {0x0962, "Activity State: End Activity"}, {0x0970, "Exponent 0: 1"}, {0x0971, "Exponent 1: 10"}, {0x0972, "Exponent 2: 100"}, {0x0973, "Exponent 3: 1 000"}, {0x0974, "Exponent 4: 10 000"}, {0x0975, "Exponent 5: 100 000"}, {0x0976, "Exponent 6: 1 000 000"}, {0x0977, "Exponent 7: 10 000 000"}, {0x0978, "Exponent 8: 0.00 000 001"}, {0x0979, "Exponent 9: 0.0 000 001"}, {0x097A, "Exponent A: 0.000 001"}, {0x097B, "Exponent B: 0.00 001"}, {0x097C, "Exponent C: 0.0 001"}, {0x097D, "Exponent D: 0.001"}, {0x097E, "Exponent E: 0.01"}, {0x097F, "Exponent F: 0.1"}, {0x0980, "Device Position: Unknown"}, {0x0981, "Device Position: Unchanged"}, {0x0982, "Device Position: On Desk"}, {0x0983, "Device Position: In Hand"}, {0x0984, "Device Position: Moving in Bag"}, {0x0985, "Device Position: Stationary in Bag"}, {0x0990, "Step Type: Unknown"}, {0x0991, "Step Type: Running"}, {0x0992, "Step Type: Walking"}, {0x09A0, "Gesture State: Unknown"}, {0x09A1, "Gesture State: Started"}, {0x09A2, "Gesture State: Completed"}, {0x09A3, "Gesture State: Cancelled"}, {0x09B0, "Hinge Fold Contributing Panel: Unknown"}, {0x09B1, "Hinge Fold Contributing Panel: Panel 1"}, {0x09B2, "Hinge Fold Contributing Panel: Panel 2"}, {0x09B3, "Hinge Fold Contributing Panel: Both"}, {0x09B4, "Hinge Fold Type: Unknown"}, {0x09B5, "Hinge Fold Type: Increasing"}, {0x09B6, "Hinge Fold Type: Decreasing"}, {0x1000, "Modifier: Change Sensitivity Absolute"}, {0x2000, "Modifier: Maximum"}, {0x3000, "Modifier: Minimum"}, {0x4000, "Modifier: Accuracy"}, {0x5000, "Modifier: Resolution"}, {0x6000, "Modifier: Threshold High"}, {0x7000, "Modifier: Threshold Low"}, {0x8000, "Modifier: Calibration Offset"}, {0x9000, "Modifier: Calibration Multiplier"}, {0xA000, "Modifier: Report Interval"}, {0xB000, "Modifier: Frequency Max"}, {0xC000, "Modifier: Period Max"}, {0xD000, "Modifier: Change Sensitivity Percent of Range"}, {0xE000, "Modifier: Change Sensitivity Percent Relative"}, {0xF000, "Modifier: Vendor Reserved"}, {0, NULL} }; static const range_string usb_hid_sensor_usage_page_ranges[] = { {0x001A, 0x001F, "Reserved (Biometric)"}, {0x002A, 0x002F, "Reserved (Electrical)"}, {0x003C, 0x003F, "Reserved (Environmental)"}, {0x0046, 0x004F, "Reserved (Light)"}, {0x0058, 0x005F, "Reserved (Location)"}, {0x006A, 0x006F, "Reserved (Mechanical)"}, {0x007D, 0x007F, "Reserved (Motion)"}, {0x0094, 0x009F, "Reserved (Scanner)"}, {0x00A3, 0x00AF, "Reserved (Time)"}, {0x00B5, 0x00BF, "Reserved (Personal Activity)"}, {0x00C3, 0x00CF, "Reserved (Orientation Extended)"}, {0x00D3, 0x00DF, "Reserved (Gesture)"}, {0x00E5, 0x00EF, "Reserved (Other)"}, {0x00F0, 0x00FF, "Reserved for Vendors/OEMs"}, {0x031F, 0x03FF, "Reserved (Property)"}, {0x0428, 0x0429, "Reserved (Data Field: Location)"}, {0x042C, 0x042F, "Reserved (Property: Location)"}, {0x043D, 0x043F, "Reserved (Data Field: Environmental)"}, {0x0442, 0x044F, "Reserved (Property: Environmental)"}, {0x0460, 0x046F, "Reserved (Data Field: Motion)"}, {0x048A, 0x048F, "Reserved (Data Field: Orientation)"}, {0x0499, 0x049F, "Reserved (Data Field: Mechanical)"}, {0x04A4, 0x04AF, "Reserved (Property: Mechanical)"}, {0x04BD, 0x04CF, "Reserved (Data Field: Biometric)"}, {0x04E4, 0x04EF, "Reserved (Property: Light)"}, {0x04F3, 0x04F7, "Reserved (Data Field: Scanner)"}, {0x04FA, 0x04FF, "Reserved (Property: Scanner)"}, {0x050A, 0x051F, "Reserved (Data Field: Electrical)"}, {0x052C, 0x052F, "Reserved (Data Field: Time)"}, {0x0536, 0x053F, "Reserved (Property: Time)"}, {0x0577, 0x057F, "Reserved (Data Field: Generic)"}, {0x0583, 0x058F, "Reserved (Property: Generic)"}, {0x0598, 0x059F, "Reserved (Data Field: Personal Activity)"}, {0x05A6, 0x05AF, "Reserved (Property: Personal Activity)"}, {0x05B1, 0x05BF, "Reserved (Data Field: Custom)"}, {0x05C0, 0x07FF, "Reserved for future use as Sensor Types, Data Fields and Properties"}, {0x0800, 0x09FF, "Reserved for use as Selection Values"}, {0x1100, 0x17FF, "Reserved for use as Change Sensitivity Absolute modifier range"}, {0x2100, 0x27FF, "Reserved for use as Maximum modifier range"}, {0x3100, 0x37FF, "Reserved for use as Minimum modifier range"}, {0x4100, 0x47FF, "Reserved for use as Accuracy modifier range"}, {0x5100, 0x57FF, "Reserved for use as Resolution modifier range"}, {0x6100, 0x67FF, "Reserved for use as Threshold High modifier range"}, {0x7100, 0x77FF, "Reserved for use as Threshold Low modifier range"}, {0x8100, 0x87FF, "Reserved for use as Calibration Offset modifier range"}, {0x9100, 0x97FF, "Reserved for use as Calibration Multiplier modifier range"}, {0xA100, 0xA7FF, "Reserved for use as Report Interval modifier range"}, {0xB100, 0xB7FF, "Reserved for use as Frequency Max modifier range"}, {0xC100, 0xC7FF, "Reserved for use as Period Max modifier range"}, {0xD100, 0xD7FF, "Reserved for use as Change Sensitivity Percent modifier range"}, {0xE100, 0xE7FF, "Reserved for use as Change Sensitivity Percent modifier range"}, {0xF100, 0xF7FF, "Reserved for use as Vendor Reserved modifier range"}, /* More generic (and overlapping) ranges in case a better match isn't found above */ {0x1000, 0xEFFF, "Reserved for use as \"Data Fields with Modifiers\""}, {0xF000, 0xFFFF, "Reserved for Vendors/OEMs"}, {0, 0, NULL} }; static const value_string usb_hid_medical_instrument_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Medical Ultrasound"}, {0x20, "VCR/Acquisition"}, {0x21, "Freeze/Thaw"}, {0x22, "Clip Store"}, {0x23, "Update"}, {0x24, "Next"}, {0x25, "Save"}, {0x26, "Print"}, {0x27, "Microphone Enable"}, {0x40, "Cine"}, {0x41, "Transmit Power"}, {0x42, "Volume"}, {0x43, "Focus"}, {0x44, "Depth"}, {0x60, "Soft Step - Primary"}, {0x61, "Soft Step - Secondary"}, {0x70, "Depth Gain Compensation"}, {0x80, "Zoom Select"}, {0x81, "Zoom Adjust"}, {0x82, "Spectral Doppler Mode Select"}, {0x83, "Spectral Doppler Adjust"}, {0x84, "Color Doppler Mode Select"}, {0x85, "Color Doppler Adjust"}, {0x86, "Motion Mode Select"}, {0x87, "Motion Mode Adjust"}, {0x88, "2-D Mode Select"}, {0x89, "2-D Mode Adjust"}, {0xA0, "Soft Control Select"}, {0xA1, "Soft Control Adjust"}, {0, NULL} }; static const value_string usb_hid_braille_dispaly_usage_page_vals[] = { {0x000, "Undefined"}, {0x001, "Braille Display"}, {0x002, "Braille Row"}, {0x003, "8 Dot Braille Cell"}, {0x004, "6 Dot Braille Cell"}, {0x005, "Number of Braille Cells"}, {0x006, "Screen Reader Control"}, {0x007, "Screen Reader Identifier"}, {0x0FA, "Router Set 1"}, {0x0FB, "Router Set 2"}, {0x0FC, "Router Set 3"}, {0x100, "Router Key"}, {0x101, "Row Router Key"}, {0x200, "Braille Buttons"}, {0x201, "Braille Keyboard Dot 1"}, {0x202, "Braille Keyboard Dot 2"}, {0x203, "Braille Keyboard Dot 3"}, {0x204, "Braille Keyboard Dot 4"}, {0x205, "Braille Keyboard Dot 5"}, {0x206, "Braille Keyboard Dot 6"}, {0x207, "Braille Keyboard Dot 7"}, {0x208, "Braille Keyboard Dot 8"}, {0x209, "Braille Keyboard Space"}, {0x20A, "Braille Keyboard Left Space"}, {0x20B, "Braille Keyboard Right Space"}, {0x20C, "Braille Face Controls"}, {0x20D, "Braille Left Controls"}, {0x20E, "Braille Right Controls"}, {0x20F, "Braille Top Controls"}, {0x210, "Braille Joystick Center"}, {0x211, "Braille Joystick Up"}, {0x212, "Braille Joystick Down"}, {0x213, "Braille Joystick Left"}, {0x214, "Braille Joystick Right"}, {0x215, "Braille D-Pad Center"}, {0x216, "Braille D-Pad Up"}, {0x217, "Braille D-Pad Down"}, {0x218, "Braille D-Pad Left"}, {0x219, "Braille D-Pad Right"}, {0x21A, "Braille Pan Left"}, {0x21B, "Braille Pan Right"}, {0x21C, "Braille Rocker Up"}, {0x21D, "Braille Rocker Down"}, {0x21E, "Braille Rocker Press"}, {0, NULL} }; static const value_string usb_hid_lighting_and_illumination_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "LampArray"}, {0x02, "LampArrayAttributesReport"}, {0x03, "LampCount"}, {0x04, "BoundingBoxWidthInMicrometers"}, {0x05, "BoundingBoxHeightInMicrometers"}, {0x06, "BoundingBoxDepthInMicrometers"}, {0x07, "LampArrayKind"}, {0x08, "MinUpdateIntervalInMicroseconds"}, {0x20, "LampAttributesRequestReport"}, {0x21, "LampId"}, {0x22, "LampAttributesResponseReport"}, {0x23, "PositionXInMicrometers"}, {0x24, "PositionYInMicrometers"}, {0x25, "PositionZInMicrometers"}, {0x26, "LampPurposes"}, {0x27, "UpdateLatencyInMicroseconds"}, {0x28, "RedLevelCount"}, {0x29, "GreenLevelCount"}, {0x2A, "BlueLevelCount"}, {0x2B, "IntensityLevelCount"}, {0x2C, "IsProgrammable"}, {0x2D, "InputBinding"}, {0x50, "LampMultiUpdateReport"}, {0x51, "RedUpdateChannel"}, {0x52, "GreenUpdateChannel"}, {0x53, "BlueUpdateChannel"}, {0x54, "IntensityUpdateChannel"}, {0x55, "LampUpdateFlags"}, {0x60, "LampRangeUpdateReport"}, {0x61, "LampIdStart"}, {0x62, "LampIdEnd"}, {0x70, "LampArrayControlReport"}, {0x71, "AutonomousMode"}, {0, NULL} }; static const value_string usb_hid_monitor_usage_page_vals[] = { {0x00, "Reserved"}, {0x01, "Monitor Control"}, {0x02, "EDID Information"}, {0x03, "VDIF Information"}, {0x04, "VESA Version"}, {0, NULL} }; static const value_string usb_hid_vesa_virtual_control_usage_page_vals[] = { /* Contiguous Controls */ {0x10, "Brightness"}, {0x12, "Contrast"}, {0x16, "Red Video Gain"}, {0x18, "Green Video Gain"}, {0x1A, "Blue Video Gain"}, {0x1C, "Focus"}, {0x20, "Horizontal Position"}, {0x22, "Horizontal Size"}, {0x24, "Horizontal Pincushion"}, {0x26, "Horizontal Pincushion Balance"}, {0x28, "Horizontal Misconvergence"}, {0x2A, "Horizontal Linearity"}, {0x2C, "Horizontal Linearity Balance"}, {0x30, "Vertical Position"}, {0x32, "Vertical Size"}, {0x34, "Vertical Pincushion"}, {0x36, "Vertical Pincushion Balance"}, {0x38, "Vertical Misconvergence"}, {0x3A, "Vertical Linearity"}, {0x3C, "Vertical Linearity Balance"}, {0x40, "Parallelogram Distortion (Key Balance)"}, {0x42, "Trapezoidal Distortion (Key)"}, {0x44, "Tilt (Rotation)"}, {0x46, "Top Corner Distortion Control"}, {0x48, "Top Corner Distortion Balance"}, {0x4A, "Bottom Corner Distortion Control"}, {0x4C, "Bottom Corner Distortion Balance"}, {0x56, "Horizontal Moire"}, {0x58, "Vertical Moire"}, {0x6C, "Red Video Black Level"}, {0x6E, "Green Video Black Level"}, {0x70, "Blue Video Black Level"}, /* Non-contiguous Controls (Read/Write) */ {0x5E, "Input Level Select"}, {0x60, "Input Source Select"}, {0xCA, "On Screen Display"}, {0xD4, "StereoMode"}, /* Non-contiguous Controls (Read-only) */ {0xA2, "Auto Size Center"}, {0xA4, "Polarity Horizontal Synchronization"}, {0xA6, "Polarity Vertical Synchronization"}, {0xA8, "Synchronization Type"}, {0xAA, "Screen Orientation"}, {0xAC, "Horizontal Frequency"}, {0xAE, "Vertical Frequency"}, /* Non-contiguous Controls (Write-only) */ {0x01, "Degauss"}, {0xB0, "Settings"}, {0, NULL} }; static const value_string usb_hid_power_device_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "iName"}, {0x02, "PresentStatus"}, {0x03, "ChangedStatus"}, {0x04, "UPS"}, {0x05, "PowerSupply"}, {0x10, "BatterySystem"}, {0x11, "BatterySystemID"}, {0x12, "Battery"}, {0x13, "BatteryID"}, {0x14, "Charger"}, {0x15, "ChargerID"}, {0x16, "PowerConverter"}, {0x17, "PowerConverterID"}, {0x18, "OutletSystem"}, {0x19, "OutletSystemID"}, {0x1A, "Input"}, {0x1B, "InputID"}, {0x1C, "Output"}, {0x1D, "OutputID"}, {0x1E, "Flow"}, {0x1F, "FlowID"}, {0x20, "Outlet"}, {0x21, "OutletID"}, {0x22, "Gang"}, {0x23, "GangID"}, {0x24, "PowerSummary"}, {0x25, "PowerSummaryID"}, {0x30, "Voltage"}, {0x31, "Current"}, {0x32, "Frequency"}, {0x33, "ApparentPower"}, {0x34, "ActivePower"}, {0x35, "PercentLoad"}, {0x36, "Temperature"}, {0x37, "Humidity"}, {0x38, "BadCount"}, {0x40, "ConfigVoltage"}, {0x41, "ConfigCurrent"}, {0x42, "ConfigFrequency"}, {0x43, "ConfigApparentPower"}, {0x44, "ConfigActivePower"}, {0x45, "ConfigPercentLoad"}, {0x46, "ConfigTemperature"}, {0x47, "ConfigHumidity"}, {0x50, "SwitchOnControl"}, {0x51, "SwitchOffControl"}, {0x52, "ToggleControl"}, {0x53, "LowVoltageTransfer"}, {0x54, "HighVoltageTransfer"}, {0x55, "DelayBeforeReboot"}, {0x56, "DelayBeforeStartup"}, {0x57, "DelayBeforeShutdown"}, {0x58, "Test"}, {0x59, "ModuleReset"}, {0x5A, "AudibleAlarmControl"}, {0x60, "Present"}, {0x61, "Good"}, {0x62, "InternalFailure"}, {0x63, "VoltageOutOfRange"}, {0x64, "FrequencyOutOfRange"}, {0x65, "Overload"}, {0x66, "OverCharged"}, {0x67, "OverTemperature"}, {0x68, "ShutdownRequested"}, {0x69, "ShutdownImminent"}, {0x6B, "SwitchOn/Off"}, {0x6C, "Switchable"}, {0x6D, "Used"}, {0x6E, "Boost"}, {0x6F, "Buck"}, {0x70, "Initialized"}, {0x71, "Tested"}, {0x72, "AwaitingPower"}, {0x73, "CommunicationLost"}, {0xFD, "iManufacturer"}, {0xFE, "iProduct"}, {0xFF, "iserialNumber"}, {0, NULL} }; static const value_string usb_hid_battery_system_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "SMBBatteryMode"}, {0x02, "SMBBatteryStatus"}, {0x03, "SMBAlarmWarning"}, {0x04, "SMBChargerMode"}, {0x05, "SMBChargerStatus"}, {0x06, "SMBChargerSpecInfo"}, {0x07, "SMBSelectorState"}, {0x08, "SMBSelectorPresets"}, {0x09, "SMBSelectorInfo"}, {0x10, "OptionalMfgFunction1"}, {0x11, "OptionalMfgFunction2"}, {0x12, "OptionalMfgFunction3"}, {0x13, "OptionalMfgFunction4"}, {0x14, "OptionalMfgFunction5"}, {0x15, "ConnectionToSMBus"}, {0x16, "OutputConnection"}, {0x17, "ChargerConnection"}, {0x18, "BatteryInsertion"}, {0x19, "Usenext"}, {0x1A, "OKToUse"}, {0x1B, "BatterySupported"}, {0x1C, "SelectorRevision"}, {0x1D, "ChargingIndicator"}, {0x28, "ManufacturerAccess"}, {0x29, "RemainingCapacityLimit"}, {0x2A, "RemainingTimeLimit"}, {0x2B, "AtRate"}, {0x2C, "CapacityMode"}, {0x2D, "BroadcastToCharger"}, {0x2E, "PrimaryBattery"}, {0x2F, "ChargeController"}, {0x40, "TerminateCharge"}, {0x41, "TerminateDischarge"}, {0x42, "BelowRemainingCapacityLimit"}, {0x43, "RemainingTimeLimitExpired"}, {0x44, "Charging"}, {0x45, "Discharging"}, {0x46, "FullyCharged"}, {0x47, "FullyDischarged"}, {0x48, "ConditioningFlag"}, {0x49, "AtRateOK"}, {0x4A, "SMBErrorCode"}, {0x4B, "NeedReplacement"}, {0x60, "AtRateTimeToFull"}, {0x61, "AtRateTimeToEmpty"}, {0x62, "AverageCurrent"}, {0x63, "Maxerror"}, {0x64, "RelativeStateOfCharge"}, {0x65, "AbsoluteStateOfCharge"}, {0x66, "RemainingCapacity"}, {0x67, "FullChargeCapacity"}, {0x68, "RunTimeToEmpty"}, {0x69, "AverageTimeToEmpty"}, {0x6A, "AverageTimeToFull"}, {0x6B, "CycleCount"}, {0x80, "BattPackModelLevel"}, {0x81, "InternalChargeController"}, {0x82, "PrimaryBatterySupport"}, {0x83, "DesignCapacity"}, {0x84, "SpecificationInfo"}, {0x85, "ManufacturerDate"}, {0x86, "SerialNumber"}, {0x87, "iManufacturerName"}, {0x88, "iDevicename"}, {0x89, "iDeviceChemistery"}, {0x8A, "ManufacturerData"}, {0x8B, "Rechargable"}, {0x8C, "WarningCapacityLimit"}, {0x8D, "CapacityGranularity1"}, {0x8E, "CapacityGranularity2"}, {0x8F, "iOEMInformation"}, {0xC0, "InhibitCharge"}, {0xC1, "EnablePolling"}, {0xC2, "ResetToZero"}, {0xD0, "ACPresent"}, {0xD1, "BatteryPresent"}, {0xD2, "PowerFail"}, {0xD3, "AlarmInhibited"}, {0xD4, "ThermistorUnderRange"}, {0xD5, "ThermistorHot"}, {0xD6, "ThermistorCold"}, {0xD7, "ThermistorOverRange"}, {0xD8, "VoltageOutOfRange"}, {0xD9, "CurrentOutOfRange"}, {0xDA, "CurrentNotRegulated"}, {0xDB, "VoltageNotRegulated"}, {0xDC, "MasterMode"}, {0xF0, "ChargerSelectorSupport"}, {0xF1, "ChargerSpec"}, {0xF2, "Level2"}, {0xF3, "Level3"}, {0, NULL} }; static const value_string usb_hid_barcode_scanner_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Bar Code Badge Reader"}, {0x02, "Bar Code Scanner"}, {0x03, "Dumb Bar Code Scanner"}, {0x04, "Cordless Scanner Base"}, {0x05, "Bar Code Scanner Cradle"}, {0x10, "Attribute Report"}, {0x11, "Settings Report"}, {0x12, "Scanned Data Report"}, {0x13, "Raw Scanned Data Report"}, {0x14, "Trigger Report"}, {0x15, "Status Report"}, {0x16, "UPC/EAN Control Report"}, {0x17, "EAN 2/3 Label Control Report"}, {0x18, "Code 39 Control Report"}, {0x19, "Interleaved 2 of 5 Control Report"}, {0x1A, "Standard 2 of 5 Control Report"}, {0x1B, "MSI Plessey Control Report"}, {0x1C, "Codabar Control Report"}, {0x1D, "Code 128 Control Report"}, {0x1E, "Misc 1D Control Report"}, {0x1F, "2D Control Report"}, {0x30, "Aiming/Pointer Mode"}, {0x31, "Bar Code Present Sensor"}, {0x32, "Class 1A Laser"}, {0x33, "Class 2 Laser"}, {0x34, "Heater Present"}, {0x35, "Contact Scanner"}, {0x36, "Electronic Article Surveillance Notification"}, {0x37, "Constant Electronic Article Surveillance"}, {0x38, "Error Indication"}, {0x39, "Fixed Beeper"}, {0x3A, "Good Decode Indication"}, {0x3B, "Hands Free Scanning"}, {0x3C, "Intrinsically Safe"}, {0x3D, "Klasse Eins Laser"}, {0x3E, "Long Range Scanner"}, {0x3F, "Mirror Speed Control"}, {0x40, "Not On File Indication"}, {0x41, "Programmable Beeper"}, {0x42, "Triggerless"}, {0x43, "Wand"}, {0x44, "Water Resistant"}, {0x45, "Multi-Range Scanner"}, {0x46, "Proximity Sensor"}, {0x4D, "Fragment Decoding"}, {0x4E, "Scanner Read Confidence"}, {0x4F, "Data Prefix"}, {0x50, "Prefix AIMI"}, {0x51, "Prefix None"}, {0x52, "Prefix Proprietary"}, {0x55, "Active Time"}, {0x56, "Aiming Laser Pattern"}, {0x57, "Bar Code Present"}, {0x58, "Beeper State"}, {0x59, "Laser On Time"}, {0x5A, "Laser State"}, {0x5B, "Lockout Time"}, {0x5C, "Motor State"}, {0x5D, "Motor Timeout"}, {0x5E, "Power On Reset Scanner"}, {0x5F, "Prevent Read of Barcodes"}, {0x60, "Initiate Barcode Read"}, {0x61, "Trigger State"}, {0x62, "Trigger Mode"}, {0x63, "Trigger Mode Blinking Laser On"}, {0x64, "Trigger Mode Continuous Laser On"}, {0x65, "Trigger Mode Laser on while Pulled"}, {0x66, "Trigger Mode Laser stays on after Trigger release"}, {0x6D, "Commit Parameters to NVM"}, {0x6E, "Parameter Scanning"}, {0x6F, "Parameters Changed"}, {0x70, "Set parameter default values"}, {0x75, "Scanner In Cradle"}, {0x76, "Scanner In Range"}, {0x7A, "Aim Duration"}, {0x7B, "Good Read Lamp Duration"}, {0x7C, "Good Read Lamp Intensity"}, {0x7D, "Good Read LED"}, {0x7E, "Good Read Tone Frequency"}, {0x7F, "Good Read Tone Length"}, {0x80, "Good Read Tone Volume"}, {0x82, "No Read Message"}, {0x83, "Not on File Volume"}, {0x84, "Powerup Beep"}, {0x85, "Sound Error Beep"}, {0x86, "Sound Good Read Beep"}, {0x87, "Sound Not On File Beep"}, {0x88, "Good Read When to Write"}, {0x89, "GRWTI After Decode"}, {0x8A, "GRWTI Beep/Lamp after transmit"}, {0x8B, "GRWTI No Beep/Lamp use at all"}, {0x91, "Bookland EAN"}, {0x92, "Convert EAN 8 to 13 Type"}, {0x93, "Convert UPC A to EAN-13"}, {0x94, "Convert UPC-E to A"}, {0x95, "EAN-13"}, {0x96, "EAN-8"}, {0x97, "EAN-99 128_Mandatory"}, {0x98, "EAN-99 P5/128_Optional"}, {0x9A, "UPC/EAN"}, {0x9B, "UPC/EAN Coupon Code"}, {0x9C, "UPC/EAN Periodicals"}, {0x9D, "UPC-A"}, {0x9E, "UPC-A with 128 Mandatory"}, {0x9F, "UPC-A with 128 Optional"}, {0xA0, "UPC-A with P5 Optional"}, {0xA1, "UPC-E"}, {0xA2, "UPC-E1"}, {0xA9, "Periodical"}, {0xAA, "Periodical Auto-Discriminate + 2"}, {0xAB, "Periodical Only Decode with + 2"}, {0xAC, "Periodical Ignore + 2"}, {0xAD, "Periodical Auto-Discriminate + 5"}, {0xAE, "Periodical Only Decode with + 5"}, {0xAF, "Periodical Ignore + 5"}, {0xB0, "Check"}, {0xB1, "Check Disable Price"}, {0xB2, "Check Enable 4 digit Price"}, {0xB3, "Check Enable 5 digit Price"}, {0xB4, "Check Enable European 4 digit Price"}, {0xB5, "Check Enable European 5 digit Price"}, {0xB7, "EAN Two Label"}, {0xB8, "EAN Three Label"}, {0xB9, "EAN 8 Flag Digit 1"}, {0xBA, "EAN 8 Flag Digit 2"}, {0xBB, "EAN 8 Flag Digit 3"}, {0xBC, "EAN 13 Flag Digit 1"}, {0xBD, "EAN 13 Flag Digit 2"}, {0xBE, "EAN 13 Flag Digit 3"}, {0xBF, "Add EAN 2/3 Label Definition"}, {0xC0, "Clear all EAN 2/3 Label Definitions"}, {0xC3, "Codabar"}, {0xC4, "Code 128"}, {0xC7, "Code 39"}, {0xC8, "Code 93 "}, {0xC9, "Full ASCII Conversion"}, {0xCA, "Interleaved 2 of 5"}, {0xCB, "Italian Pharmacy Code"}, {0xCC, "MSI/Plessey"}, {0xCD, "Standard 2 of 5 IATA"}, {0xCE, "Standard 2 of 5"}, {0xD3, "Transmit Start/Stop"}, {0xD4, "Tri-Optic"}, {0xD5, "UCC/EAN-128"}, {0xD6, "Check Digit"}, {0xD7, "Check Digit Disable"}, {0xD8, "Check Digit Enable Interleaved 2 of 5 OPCC"}, {0xD9, "Check Digit Enable Interleaved 2 of 5 USS"}, {0xDA, "Check Digit Enable Standard 2 of 5 OPCC"}, {0xDB, "Check Digit Enable Standard 2 of 5 USS"}, {0xDC, "Check Digit Enable One MSI Plessey"}, {0xDD, "Check Digit Enable Two MSI Plessey"}, {0xDE, "Check Digit Codabar Enable"}, {0xDF, "Check Digit Code 39 Enable"}, {0xF0, "Transmit Check Digit"}, {0xF1, "Disable Check Digit Transmit"}, {0xF2, "Enable Check Digit Transmit"}, {0xFB, "Symbology Identifier 1"}, {0xFC, "Symbology Identifier 2"}, {0xFD, "Symbology Identifier 3"}, {0xFE, "Decoded Data"}, {0xFF, "Decode Data Continued"}, {0x00, "Bar Space Data"}, {0x01, "Scanner Data Accuracy"}, {0x02, "Raw Data Polarity"}, {0x03, "Polarity Inverted Bar Code"}, {0x04, "Polarity Normal Bar Code"}, {0x06, "Minimum Length to Decode"}, {0x07, "Maximum Length to Decode"}, {0x08, "First Discrete Length to Decode"}, {0x09, "Second Discrete Length to Decode"}, {0x0A, "Data Length Method"}, {0x0B, "DL Method Read any"}, {0x0C, "DL Method Check in Range"}, {0x0D, "DL Method Check for Discrete"}, {0x10, "Aztec Code"}, {0x11, "BC412"}, {0x12, "Channel Code"}, {0x13, "Code 16"}, {0x14, "Code 32"}, {0x15, "Code 49"}, {0x16, "Code One"}, {0x17, "Colorcode"}, {0x18, "Data Matrix"}, {0x19, "MaxiCode"}, {0x1A, "MicroPDF"}, {0x1B, "PDF-417"}, {0x1C, "PosiCode"}, {0x1D, "QR Code"}, {0x1E, "SuperCode"}, {0x1F, "UltraCode"}, {0x20, "USD-5 (Slug Code)"}, {0x21, "VeriCode"}, {0, NULL} }; static const value_string usb_hid_weighing_devices_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "Weighing Device"}, {0x20, "Scale Device"}, {0x21, "Scale Class I Metric"}, {0x22, "Scale Class I Metric"}, {0x23, "Scale Class II Metric"}, {0x24, "Scale Class III Metric"}, {0x25, "Scale Class IIIL Metric"}, {0x26, "Scale Class IV Metric"}, {0x27, "Scale Class III English"}, {0x28, "Scale Class IIIL English"}, {0x29, "Scale Class IV English"}, {0x2A, "Scale Class Generic"}, {0x30, "Scale Attribute Report"}, {0x31, "Scale Control Report"}, {0x32, "Scale Data Report"}, {0x33, "Scale Status Report"}, {0x34, "Scale Weight Limit Report"}, {0x35, "Scale Statistics Report"}, {0x40, "Data Weight"}, {0x41, "Data Scaling"}, {0x50, "Weight Unit"}, {0x51, "Weight Unit Milligram"}, {0x52, "Weight Unit Gram"}, {0x53, "Weight Unit Kilogram"}, {0x54, "Weight Unit Carats"}, {0x55, "Weight Unit Taels"}, {0x56, "Weight Unit Grains"}, {0x57, "Weight Unit Pennyweights"}, {0x58, "Weight Unit Metric Ton"}, {0x59, "Weight Unit Avoir Ton"}, {0x5A, "Weight Unit Troy Ounce"}, {0x5B, "Weight Unit Ounce"}, {0x5C, "Weight Unit Pound"}, {0x60, "Calibration Count"}, {0x61, "Re-Zero Count"}, {0x70, "Scale Status"}, {0x71, "Scale Status Fault"}, {0x72, "Scale Status Stable at Center of Zero"}, {0x73, "Scale Status In Motion"}, {0x74, "Scale Status Weight Stable"}, {0x75, "Scale Status Under Zero"}, {0x76, "Scale Status Over Weight Limit"}, {0x77, "Scale Status Requires Calibration"}, {0x78, "Scale Status Requires Re- zeroing"}, {0x80, "Zero Scale"}, {0x81, "Enforced Zero Return"}, {0, NULL} }; static const value_string usb_hid_magnetic_stripe_reader_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "MSR Device Read-Only"}, {0x11, "Track 1 Length"}, {0x12, "Track 2 Length"}, {0x13, "Track 3 Length"}, {0x14, "Track JIS Length"}, {0x20, "Track Data"}, {0x21, "Track 1 Data"}, {0x22, "Track 2 Data"}, {0x23, "Track 3 Data"}, {0x24, "Track JIS Data"}, {0, NULL} }; static const value_string usb_hid_camera_control_usage_page_vals[] = { {0x00, "Undefined"}, {0x20, "Camera Auto-focus"}, {0x21, "Camera Shutter"}, {0, NULL} }; static const value_string usb_hid_arcade_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "General Purpose IO Card"}, {0x02, "Coin Door"}, {0x03, "Watchdog Timer"}, {0x30, "General Purpose Analog Input State"}, {0x31, "General Purpose Digital Input State"}, {0x32, "General Purpose Optical Input State"}, {0x33, "General Purpose Digital Output State"}, {0x34, "Number of Coin Doors"}, {0x35, "Coin Drawer Drop Count"}, {0x36, "Coin Drawer Start"}, {0x37, "Coin Drawer Service"}, {0x38, "Coin Drawer Tilt"}, {0x39, "Coin Door Test"}, {0x3F, "[Undefined]"}, {0x40, "Coin Door Lockout"}, {0x41, "Watchdog Timeout"}, {0x42, "Watchdog Action"}, {0x43, "Watchdog Reboot"}, {0x44, "Watchdog Restart"}, {0x45, "Alarm Input"}, {0x46, "Coin Door Counter"}, {0x47, "I/O Direction Mapping"}, {0x48, "Set I/O Direction"}, {0x49, "Extended Optical Input State"}, {0x4A, "Pin Pad Input State"}, {0x4B, "Pin Pad Status"}, {0x4C, "Pin Pad Output"}, {0x4D, "Pin Pad Command"}, {0, NULL} }; static const value_string usb_hid_fido_alliance_usage_page_vals[] = { {0x00, "Undefined"}, {0x01, "U2F Authenticator Device"}, {0x20, "Input Report Data"}, {0x21, "Output Report Data"}, {0, NULL} }; static const value_string keycode_vals[] = { {0x00, "<ACTION KEY UP>"}, {0x01, "ErrorRollOver"}, {0x02, "POSTFail"}, {0x03, "ErrorUndefined"}, {0x04, "a"}, {0x05, "b"}, {0x06, "c"}, {0x07, "d"}, {0x08, "e"}, {0x09, "f"}, {0x0A, "g"}, {0x0B, "h"}, {0x0C, "i"}, {0x0D, "j"}, {0x0E, "k"}, {0x0F, "l"}, {0x10, "m"}, {0x11, "n"}, {0x12, "o"}, {0x13, "p"}, {0x14, "q"}, {0x15, "r"}, {0x16, "s"}, {0x17, "t"}, {0x18, "u"}, {0x19, "v"}, {0x1A, "w"}, {0x1B, "x"}, {0x1C, "y"}, {0x1D, "z"}, {0x1E, "1"}, {0x1F, "2"}, {0x20, "3"}, {0x21, "4"}, {0x22, "5"}, {0x23, "6"}, {0x24, "7"}, {0x25, "8"}, {0x26, "9"}, {0x27, "0"}, {0x28, "ENTER"}, {0x29, "Escape"}, {0x2A, "Backspace"}, {0x2B, "Tab"}, {0x2C, "Spacebar"}, {0x2D, "-"}, {0x2E, "="}, {0x2F, "["}, {0x30, "]"}, {0x31, "\\"}, {0x32, "NonUS #/~"}, {0x33, ";"}, {0x34, "'"}, {0x35, "`"}, {0x36, ","}, {0x37, "."}, {0x38, "/"}, {0x39, "CapsLock"}, {0x3A, "F1"}, {0x3B, "F2"}, {0x3C, "F3"}, {0x3D, "F4"}, {0x3E, "F5"}, {0x3F, "F6"}, {0x40, "F7"}, {0x41, "F8"}, {0x42, "F9"}, {0x43, "F10"}, {0x44, "F11"}, {0x45, "F12"}, {0x46, "PrintScreen"}, {0x47, "ScrollLock"}, {0x48, "Pause"}, {0x49, "Insert"}, {0x4A, "Home"}, {0x4B, "PageUp"}, {0x4C, "DeleteForward"}, {0x4D, "End"}, {0x4E, "PageDown"}, {0x4F, "RightArrow"}, {0x50, "LeftArrow"}, {0x51, "DownArrow"}, {0x52, "UpArrow"}, {0x53, "NumLock"}, /* Keypad */ {0x54, "Keypad /"}, {0x55, "Keypad *"}, {0x56, "Keypad -"}, {0x57, "Keypad +"}, {0x58, "Keypad ENTER"}, {0x59, "Keypad 1"}, {0x5A, "Keypad 2"}, {0x5B, "Keypad 3"}, {0x5C, "Keypad 4"}, {0x5D, "Keypad 5"}, {0x5E, "Keypad 6"}, {0x5F, "Keypad 7"}, {0x60, "Keypad 8"}, {0x61, "Keypad 9"}, {0x62, "Keypad 0"}, {0x63, "Keypad ."}, /* non PC AT */ {0x64, "NonUS \\/|"}, {0x65, "Application"}, {0x66, "Power"}, {0x67, "Keypad ="}, {0x68, "F13"}, {0x69, "F14"}, {0x6A, "F15"}, {0x6B, "F16"}, {0x6C, "F17"}, {0x6D, "F18"}, {0x6E, "F19"}, {0x6F, "F20"}, {0x70, "F21"}, {0x71, "F22"}, {0x72, "F23"}, {0x73, "F24"}, {0x74, "Execute"}, {0x75, "Help"}, {0x76, "Menu"}, {0x77, "Select"}, {0x78, "Stop"}, {0x79, "Again"}, {0x7A, "Undo"}, {0x7B, "Cut"}, {0x7C, "Copy"}, {0x7D, "Paste"}, {0x7E, "Find"}, {0x7F, "Mute"}, {0x80, "VolumeUp"}, {0x81, "VolumeDown"}, {0x82, "Locking CapsLock"}, {0x83, "Locking NumLock"}, {0x84, "Locking ScrollLock"}, {0x85, "Keypad Comma"}, {0x86, "Keypad EqualSign"}, {0x87, "International1"}, {0x88, "International2"}, {0x89, "International3"}, {0x8A, "International4"}, {0x8B, "International5"}, {0x8C, "International6"}, {0x8D, "International7"}, {0x8E, "International8"}, {0x8F, "International9"}, {0x90, "LANG1"}, {0x91, "LANG2"}, {0x92, "LANG3"}, {0x93, "LANG4"}, {0x94, "LANG5"}, {0x95, "LANG6"}, {0x96, "LANG7"}, {0x97, "LANG8"}, {0x98, "LANG9"}, {0x99, "AlternateErase"}, {0x9A, "SysReq/Attention"}, {0x9B, "Cancel"}, {0x9C, "Clear"}, {0x9D, "Prior"}, {0x9E, "Return"}, {0x9F, "Separator"}, {0xA0, "Out"}, {0xA1, "Oper"}, {0xA2, "Clear/Again"}, {0xA3, "CrSel/Props"}, {0xA4, "ExSel"}, /* 0xA5..0xAF - reserved */ {0xB0, "Keypad 00"}, {0xB1, "Keypad 000"}, {0xB2, "ThousandsSeparator"}, {0xB3, "DecimalSeparator"}, {0xB4, "CurrencyUnit"}, {0xB5, "CurrencySubunit"}, {0xB6, "Keypad ("}, {0xB7, "Keypad )"}, {0xB8, "Keypad {"}, {0xB9, "Keypad }"}, {0xBA, "Keypad Tab"}, {0xBB, "Keypad Backspace"}, {0xBC, "Keypad A"}, {0xBD, "Keypad B"}, {0xBE, "Keypad C"}, {0xBF, "Keypad D"}, {0xC0, "Keypad E"}, {0xC1, "Keypad F"}, {0xC2, "Keypad XOR"}, {0xC3, "Keypad ^"}, {0xC4, "Keypad %"}, {0xC5, "Keypad <"}, {0xC6, "Keypad >"}, {0xC7, "Keypad &"}, {0xC8, "Keypad &&"}, {0xC9, "Keypad |"}, {0xCA, "Keypad ||"}, {0xCB, "Keypad :"}, {0xCC, "Keypad #"}, {0xCD, "Keypad Space"}, {0xCE, "Keypad @"}, {0xCF, "Keypad !"}, {0xD0, "Keypad Memory Store"}, {0xD1, "Keypad Memory Recall"}, {0xD2, "Keypad Memory Clear"}, {0xD3, "Keypad Memory Add"}, {0xD4, "Keypad Memory Subtract"}, {0xD5, "Keypad Memory Multiply"}, {0xD6, "Keypad Memory Divide"}, {0xD7, "Keypad +/-"}, {0xD8, "Keypad Clear"}, {0xD9, "Keypad Clear Entry"}, {0xDA, "Keypad Binary"}, {0xDB, "Keypad Octal"}, {0xDC, "Keypad Decimal"}, {0xDD, "Keypad Hexadecimal"}, /* 0xDE..0xDF - reserved, */ {0xE0, "LeftControl"}, {0xE1, "LeftShift"}, {0xE2, "LeftAlt"}, {0xE3, "LeftGUI"}, {0xE4, "RightControl"}, {0xE5, "RightShift"}, {0xE6, "RightAlt"}, {0xE7, "RightGUI"}, {0, NULL} }; static value_string_ext keycode_vals_ext = VALUE_STRING_EXT_INIT(keycode_vals); static guint32 hid_unpack_value(guint8 *data, unsigned int idx, unsigned int size) { guint32 value = 0; for(unsigned int i = 1; i <= size; i++) value |= data[idx + i] << (8 * (i - 1)); return value; } static gboolean hid_unpack_signed(guint8 *data, unsigned int idx, unsigned int size, gint32 *value) { if (size == 1) *value = (gint8) hid_unpack_value(data, idx, size); else if (size == 2) *value = (gint16) hid_unpack_value(data, idx, size); else if (size == 4) *value = (gint32) hid_unpack_value(data, idx, size); else return TRUE; return FALSE; } static gboolean parse_report_descriptor(report_descriptor_t *rdesc) { hid_field_t field; guint8 *data = rdesc->desc_body; unsigned int tag, type, size; guint8 prefix; guint32 defined = 0, usage_page = 0, usage = 0, usage_min = 0, usage_max = 0; wmem_allocator_t *scope = wmem_file_scope(); gboolean first_item = TRUE; memset(&field, 0, sizeof(field)); field.usages = wmem_array_new(scope, sizeof(guint32)); rdesc->fields_in = wmem_array_new(scope, sizeof(hid_field_t)); rdesc->fields_out = wmem_array_new(scope, sizeof(hid_field_t)); int i = 0; while (i < rdesc->desc_length) { prefix = data[i]; tag = (prefix & 0b11110000) >> 4; type = (prefix & 0b00001100) >> 2; size = prefix & 0b00000011; if (size == 3) /* HID spec: 6.2.2.2 - Short Items */ size = 4; switch (type) { case USBHID_ITEMTYPE_MAIN: switch (tag) { case USBHID_MAINITEM_TAG_INPUT: field.properties = hid_unpack_value(data, i, size); if ((defined & HID_REQUIRED_MASK) != HID_REQUIRED_MASK) goto err; /* new field */ wmem_array_append_one(rdesc->fields_in, field); field.usages = wmem_array_new(scope, sizeof(guint32)); first_item = FALSE; /* only keep the global items */ defined &= HID_GLOBAL_MASK; break; case USBHID_MAINITEM_TAG_OUTPUT: field.properties = hid_unpack_value(data, i, size); if ((defined & HID_REQUIRED_MASK) != HID_REQUIRED_MASK) goto err; /* new field */ wmem_array_append_one(rdesc->fields_out, field); field.usages = wmem_array_new(scope, sizeof(guint32)); first_item = FALSE; defined &= HID_GLOBAL_MASK; break; case USBHID_MAINITEM_TAG_FEATURE: /* field.properties = hid_unpack_value(data, i, size); TODO */ break; case USBHID_MAINITEM_TAG_COLLECTION: /* clear usages */ wmem_free(scope, field.usages); field.usages = wmem_array_new(scope, sizeof(guint32)); break; default: break; } break; case USBHID_ITEMTYPE_GLOBAL: switch (tag) { case USBHID_GLOBALITEM_TAG_USAGE_PAGE: usage_page = hid_unpack_value(data, i, size); if (usage_page > G_MAXUINT16) goto err; defined |= HID_USAGE_PAGE; break; case USBHID_GLOBALITEM_TAG_LOG_MIN: if (hid_unpack_signed(data, i, size, &field.logical_min)) goto err; defined |= HID_LOGICAL_MIN; break; case USBHID_GLOBALITEM_TAG_LOG_MAX: if (hid_unpack_signed(data, i, size, &field.logical_max)) goto err; defined |= HID_LOGICAL_MAX; break; case USBHID_GLOBALITEM_TAG_REPORT_SIZE: field.report_size = hid_unpack_value(data, i, size); defined |= HID_REPORT_SIZE; break; case USBHID_GLOBALITEM_TAG_REPORT_ID: if (!first_item && !rdesc->uses_report_id) goto err; rdesc->uses_report_id = TRUE; field.report_id = hid_unpack_value(data, i, size); defined |= HID_REPORT_ID; break; case USBHID_GLOBALITEM_TAG_REPORT_COUNT: field.report_count = hid_unpack_value(data, i, size); defined |= HID_REPORT_COUNT; break; case USBHID_GLOBALITEM_TAG_PUSH: case USBHID_GLOBALITEM_TAG_POP: /* TODO */ goto err; default: break; } break; case USBHID_ITEMTYPE_LOCAL: switch (tag) { case USBHID_LOCALITEM_TAG_USAGE: usage = hid_unpack_value(data, i, size); /* Extended usage (size 4) combines both usage page and id */ if (size != 4) { if (!(defined & HID_USAGE_PAGE)) goto err; usage |= usage_page << 16; } wmem_array_append_one(field.usages, usage); break; case USBHID_LOCALITEM_TAG_USAGE_MIN: usage_min = hid_unpack_value(data, i, size); if (size == 4) { /* Usage max must be extended as well */ defined |= HID_EXTENDED_USAGE; } else { if (!(defined & HID_USAGE_PAGE)) goto err; usage_min |= usage_page << 16; } defined |= HID_USAGE_MIN; break; case USBHID_LOCALITEM_TAG_USAGE_MAX: if (!(defined & HID_USAGE_MIN)) goto err; usage_max = hid_unpack_value(data, i, size); if (defined & HID_EXTENDED_USAGE) { /* Fail if max is not extended usage (HID spec 6.2.2.8) */ if (size != 4) goto err; } else if (size == 4) { /* Fail because min wasn't extended, but max is */ goto err; } else { if (!(defined & HID_USAGE_PAGE)) goto err; usage_max |= usage_page << 16; } /* Usage min and max must be on the same page */ if (USAGE_PAGE(usage_min) != USAGE_PAGE(usage_max)) { goto err; } if (usage_min > usage_max) { goto err; } /* min and max are inclusive */ wmem_array_grow(field.usages, usage_max - usage_min + 1); for (guint32 j = usage_min; j <= usage_max; j++) { wmem_array_append_one(field.usages, j); } defined &= ~(HID_USAGE_MIN | HID_EXTENDED_USAGE); break; default: /* TODO */ goto err; } break; default: /* reserved */ goto err; } i += size + 1; } return TRUE; err: for (unsigned int j = 0; j < wmem_array_get_count(rdesc->fields_in); j++) wmem_free(scope, ((hid_field_t*) wmem_array_index(rdesc->fields_in, j))->usages); for (unsigned int j = 0; j < wmem_array_get_count(rdesc->fields_out); j++) wmem_free(scope, ((hid_field_t*) wmem_array_index(rdesc->fields_out, j))->usages); wmem_free(scope, rdesc->fields_in); wmem_free(scope, rdesc->fields_out); return FALSE; } static gboolean is_correct_interface(usb_conv_info_t *info1, usb_conv_info_t *info2) { return (info1->bus_id == info2->bus_id) && (info1->device_address == info2->device_address) && (info1->interfaceNum == info2->interfaceNum); } /* Returns the report descriptor */ static report_descriptor_t _U_ * get_report_descriptor(packet_info *pinfo _U_, usb_conv_info_t *usb_info) { guint32 bus_id = usb_info->bus_id; guint32 device_address = usb_info->device_address; guint32 interface = usb_info->interfaceNum; wmem_tree_key_t key[] = { {1, &bus_id}, {1, &device_address}, {1, &interface}, {1, &pinfo->num}, {0, NULL} }; report_descriptor_t *data = NULL; data = (report_descriptor_t*) wmem_tree_lookup32_array_le(report_descriptors, key); if (data && is_correct_interface(usb_info, &data->usb_info)) return data; return NULL; } /* Inserts the report descriptor */ static void insert_report_descriptor(packet_info *pinfo, report_descriptor_t *data) { guint32 bus_id = data->usb_info.bus_id; guint32 device_address = data->usb_info.device_address; guint32 interface = data->usb_info.interfaceNum; wmem_tree_key_t key[] = { {1, &bus_id}, {1, &device_address}, {1, &interface}, {1, &pinfo->num}, {0, NULL} }; wmem_tree_insert32_array(report_descriptors, key, data); } /* Returns usage page string */ static const char* get_usage_page_string(guint32 usage_page) { const char *str; str = try_val_to_str(usage_page, usb_hid_item_usage_page_vals); if (!str) { if ((usage_page & VENDOR_PAGE_HBYTE) == VENDOR_PAGE_HBYTE) str = "Vendor"; else str = "Reserved"; } return str; } /* Returns usage page item string */ static gchar* get_usage_page_item_string(wmem_allocator_t *pool, guint32 usage_page, guint32 id) { const char *str = NULL; const char *fmt_str = NULL; switch (usage_page) { case GENERIC_DESKTOP_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_generic_desktop_controls_usage_page_vals); break; case SIMULATION_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_simulation_control_usage_page_vals); break; case VR_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_vr_controls_usage_page_vals); break; case SPORT_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_sport_controls_usage_page_vals); break; case GAME_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_game_controls_usage_page_vals); break; case GENERIC_DEVICE_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_generic_device_controls_usage_page_vals); break; case KEYBOARD_KEYPAD_PAGE: str = try_val_to_str(id, usb_hid_keyboard_keypad_usage_page_vals); break; case LED_PAGE: str = try_val_to_str(id, usb_hid_led_usage_page_vals); break; case BUTTON_PAGE: str = try_val_to_str(id, usb_hid_button_usage_page_vals); if (!str) fmt_str = "Button %u"; break; case ORDINAL_PAGE: str = try_val_to_str(id, usb_hid_ordinal_usage_page_vals); break; case TELEPHONY_PAGE: str = try_val_to_str(id, usb_hid_telephony_device_usage_page_vals); break; case CONSUMER_PAGE: str = try_val_to_str(id, usb_hid_consumer_usage_page_vals); if (!str) fmt_str = "Instance %u"; break; case DIGITIZER_PAGE: str = try_val_to_str(id, usb_hid_digitizers_usage_page_vals); break; case HAPTICS_PAGE: str = try_val_to_str(id, usb_hid_haptic_usage_page_vals); if (id >= 0x2001 && id <= 0x2FFF) str = "Vendor Waveforms"; break; case PID_PAGE: str = try_val_to_str(id, usb_hid_physical_input_device_usage_page_vals); break; case UNICODE_PAGE: fmt_str = "Character U+%04X"; break; case EYE_AND_HEAD_TRACKER_PAGE: str = try_val_to_str(id, usb_hid_eye_and_head_tracker_usage_page_vals); break; case ALPHANUMERIC_DISPLAY_PAGE: str = try_val_to_str(id, usb_hid_alphanumeric_display_usage_page_vals); break; case SENSOR_PAGE: str = try_val_to_str(id, usb_hid_sensor_usage_page_vals); if (!str) str = try_rval_to_str(id, usb_hid_sensor_usage_page_ranges); break; case MEDICAL_INSTRUMENTS_PAGE: str = try_val_to_str(id, usb_hid_medical_instrument_usage_page_vals); break; case BRAILLE_DISPLAY_PAGE: str = try_val_to_str(id, usb_hid_braille_dispaly_usage_page_vals); break; case LIGHTING_AND_ILLUMINATION_PAGE: str = try_val_to_str(id, usb_hid_lighting_and_illumination_usage_page_vals); break; case USB_MONITOR_PAGE: str = try_val_to_str(id, usb_hid_monitor_usage_page_vals); break; case USB_ENUMERATED_VALUES_PAGE: fmt_str = "ENUM_%u"; break; case VESA_VIRTUAL_CONTROLS_PAGE: str = try_val_to_str(id, usb_hid_vesa_virtual_control_usage_page_vals); break; case POWER_DEVICE_PAGE: str = try_val_to_str(id, usb_hid_power_device_usage_page_vals); break; case BATTERY_SYSTEM_PAGE: str = try_val_to_str(id, usb_hid_battery_system_usage_page_vals); break; case BARCODE_SCANNER_PAGE: str = try_val_to_str(id, usb_hid_barcode_scanner_usage_page_vals); break; case WEIGHING_PAGE: str = try_val_to_str(id, usb_hid_weighing_devices_usage_page_vals); break; case MSR_PAGE: str = try_val_to_str(id, usb_hid_magnetic_stripe_reader_usage_page_vals); break; case CAMERA_CONTROL_PAGE: str = try_val_to_str(id, usb_hid_camera_control_usage_page_vals); break; case ARCADE_PAGE: str = try_val_to_str(id, usb_hid_arcade_usage_page_vals); break; case FIDO_ALLIANCE_PAGE: str = try_val_to_str(id, usb_hid_fido_alliance_usage_page_vals); break; default: if ((usage_page & VENDOR_PAGE_HBYTE) == VENDOR_PAGE_HBYTE) str = "Vendor"; break; } if (fmt_str) { return wmem_strdup_printf(pool, fmt_str, id); } if (!str) { str = "Reserved"; } return wmem_strdup_printf(pool, "%s", str); } /* Dissector for the data in a HID main report. */ static int dissect_usb_hid_report_mainitem_data(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, unsigned int bSize, unsigned int bTag) { proto_item *ti = proto_tree_get_parent(tree); guint32 val = 0; switch (bTag) { case USBHID_MAINITEM_TAG_INPUT: case USBHID_MAINITEM_TAG_OUTPUT: case USBHID_MAINITEM_TAG_FEATURE: proto_tree_add_item(tree, hf_usb_hid_mainitem_bit0, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit1, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit2, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit3, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit4, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit5, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_mainitem_bit6, tvb, offset, bSize, ENC_LITTLE_ENDIAN); if (bTag == USBHID_MAINITEM_TAG_INPUT) proto_tree_add_item(tree, hf_usb_hid_mainitem_bit7_input, tvb, offset, bSize, ENC_LITTLE_ENDIAN); else proto_tree_add_item(tree, hf_usb_hid_mainitem_bit7, tvb, offset, bSize, ENC_LITTLE_ENDIAN); if (bSize > 1) proto_tree_add_item(tree, hf_usb_hid_mainitem_bit8, tvb, offset, bSize, ENC_LITTLE_ENDIAN); else proto_tree_add_boolean_format_value(tree, hf_usb_hid_mainitem_bit8, tvb, offset, 0, FALSE, "Buffered bytes (default, no second byte present)"); val = tvb_get_guint8(tvb, offset); if (val & (1 << 0)) proto_item_append_text(ti, " (Const,"); else proto_item_append_text(ti, " (Data,"); if (val & (1 << 1)) proto_item_append_text(ti, "Var,"); else proto_item_append_text(ti, "Array,"); if (val & (1 << 2)) proto_item_append_text(ti, "Rel"); else proto_item_append_text(ti, "Abs"); if (val & (1 << 3)) proto_item_append_text(ti, ",Wrap"); if (val & (1 << 4)) proto_item_append_text(ti, ",NonLinear"); if (val & (1 << 5)) proto_item_append_text(ti, ",NoPref"); if (val & (1 << 6)) proto_item_append_text(ti, ",Null"); if ((bTag == USBHID_MAINITEM_TAG_OUTPUT || bTag == USBHID_MAINITEM_TAG_FEATURE) && val & (1 << 7)) proto_item_append_text(ti, ",Volatile"); if (val & (1 << 8)) proto_item_append_text(ti, ",BuffBytes"); proto_item_append_text(ti, ")"); break; case USBHID_MAINITEM_TAG_COLLECTION: proto_tree_add_item_ret_uint(tree, hf_usb_hid_mainitem_colltype, tvb, offset, 1, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (%s)", rval_to_str_const(val, usb_hid_mainitem_colltype_vals, "Unknown")); break; case USBHID_MAINITEM_TAG_ENDCOLLECTION: /* No item data */ break; default: proto_tree_add_item(tree, hf_usb_hid_item_unk_data, tvb, offset, bSize, ENC_NA); proto_item_append_text(ti, " (Unknown)"); break; } offset += bSize; return offset; } /* Dissector for the data in a HID main report. */ static int dissect_usb_hid_report_globalitem_data(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, unsigned int bSize, unsigned int bTag, struct usb_hid_global_state *global) { const char *str = NULL; proto_item *ti = proto_tree_get_parent(tree); guint32 val = 0; gint32 val_sig = 0; switch (bTag) { case USBHID_GLOBALITEM_TAG_USAGE_PAGE: switch (bSize) { case 1: global->usage_page = tvb_get_guint8(tvb, offset); break; case 2: global->usage_page = tvb_get_letohs(tvb, offset); break; case 3: global->usage_page = tvb_get_letoh24(tvb, offset); break; case 4: global->usage_page = tvb_get_letohl(tvb, offset); break; default: global->usage_page = 0; break; } str = get_usage_page_string(global->usage_page); proto_tree_add_uint_format(tree, hf_usb_hid_globalitem_usage, tvb, offset, bSize, global->usage_page, "Usage Page: %s (0x%02x)", str, global->usage_page); proto_item_append_text(ti, " (%s)", str); break; case USBHID_GLOBALITEM_TAG_LOG_MIN: proto_tree_add_item_ret_int(tree, hf_usb_hid_globalitem_log_min, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val_sig); proto_item_append_text(ti, " (%d)", val_sig); break; case USBHID_GLOBALITEM_TAG_LOG_MAX: proto_tree_add_item_ret_int(tree, hf_usb_hid_globalitem_log_max, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val_sig); proto_item_append_text(ti, " (%d)", val_sig); break; case USBHID_GLOBALITEM_TAG_PHY_MIN: proto_tree_add_item_ret_int(tree, hf_usb_hid_globalitem_phy_min, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val_sig); proto_item_append_text(ti, " (%d)", val_sig); break; case USBHID_GLOBALITEM_TAG_PHY_MAX: proto_tree_add_item_ret_int(tree, hf_usb_hid_globalitem_phy_max, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val_sig); proto_item_append_text(ti, " (%d)", val_sig); break; case USBHID_GLOBALITEM_TAG_UNIT_EXP: proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_unit_exp, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); if (val >= 7) proto_item_append_text(ti, " (%u)", val); else proto_item_append_text(ti, " (%d)", -(16 - (int) val)); break; case USBHID_GLOBALITEM_TAG_UNIT: proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_sys, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_len, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_mass, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_time, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_temp, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_current, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_globalitem_unit_brightness, tvb, offset, bSize, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, " (0x%02x)", tvb_get_guint8(tvb, offset)); break; case USBHID_GLOBALITEM_TAG_REPORT_SIZE: proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_report_size, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (%u)", val); break; case USBHID_GLOBALITEM_TAG_REPORT_ID: proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_report_id, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_GLOBALITEM_TAG_REPORT_COUNT: proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_report_count, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (%u)", val); break; case USBHID_GLOBALITEM_TAG_PUSH: // Push and Pop have no data, but the HID spec 6.2.2.7 doesn't prohibit it. if(bSize > 0) { proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_push, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (%u)", val); } break; case USBHID_GLOBALITEM_TAG_POP: // Push and Pop have no data, but the HID spec 6.2.2.7 doesn't prohibit it. if(bSize > 0) { proto_tree_add_item_ret_uint(tree, hf_usb_hid_globalitem_pop, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (%u)", val); } break; default: proto_tree_add_item(tree, hf_usb_hid_item_unk_data, tvb, offset, bSize, ENC_NA); proto_item_append_text(ti, " (Unknown)"); break; } offset += bSize; return offset; } /* Dissector for the data in a HID main report. */ static int dissect_usb_hid_report_localitem_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, unsigned int bSize, unsigned int bTag, struct usb_hid_global_state *global) { guint32 id = 0xffff; proto_item *ti = proto_tree_get_parent(tree); gchar *str = NULL; guint32 val = 0; switch (bTag) { case USBHID_LOCALITEM_TAG_USAGE: if (bSize > 2) { /* Full page ID */ proto_tree_add_item(tree, hf_usb_hid_localitem_usage, tvb, offset, bSize, ENC_LITTLE_ENDIAN); } else { /* Only lower few bits given, need to combine with last global ID */ if (bSize == 1) id = tvb_get_guint8(tvb, offset); else if (bSize == 2) id = tvb_get_ntohs(tvb, offset); str = get_usage_page_item_string(pinfo->pool, global->usage_page, id); proto_tree_add_uint_format(tree, hf_usb_hid_localitem_usage, tvb, offset, bSize, id, "Usage: %s (0x%02x)", str, id); proto_item_append_text(ti, " (%s)", str); } break; case USBHID_LOCALITEM_TAG_USAGE_MIN: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_usage_min, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_USAGE_MAX: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_usage_max, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_DESIG_INDEX: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_desig_index, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_DESIG_MIN: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_desig_min, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_DESIG_MAX: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_desig_max, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_STRING_INDEX: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_string_index, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_STRING_MIN: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_string_min, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_STRING_MAX: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_string_max, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; case USBHID_LOCALITEM_TAG_DELIMITER: proto_tree_add_item_ret_uint(tree, hf_usb_hid_localitem_delimiter, tvb, offset, bSize, ENC_LITTLE_ENDIAN, &val); proto_item_append_text(ti, " (0x%02x)", val); break; default: proto_tree_add_item(tree, hf_usb_hid_item_unk_data, tvb, offset, bSize, ENC_NA); proto_item_append_text(ti, " (Unknown)"); break; } offset += bSize; return offset; } /* Dissector for individual HID report items. Recursive. */ static int dissect_usb_hid_report_item(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_, const struct usb_hid_global_state *global) { proto_item *subitem; proto_tree *tree, *subtree; int old_offset; unsigned int tmp; unsigned int bSize, bType, bTag; const value_string *usb_hid_cur_bTag_vals; int hf_usb_hid_curitem_bTag; struct usb_hid_global_state cur_global; memcpy(&cur_global, global, sizeof(struct usb_hid_global_state)); while (tvb_reported_length_remaining(tvb, offset) > 0) { old_offset=offset; tmp = tvb_get_guint8(tvb, offset); bSize = tmp & USBHID_SIZE_MASK; if (bSize == 3) bSize++; /* 3 == four bytes */ bType = (tmp & USBHID_TYPE_MASK) >> 2; bTag = (tmp & USBHID_TAG_MASK) >> 4; switch (bType) { case USBHID_ITEMTYPE_MAIN: hf_usb_hid_curitem_bTag = hf_usb_hid_mainitem_bTag; usb_hid_cur_bTag_vals = usb_hid_mainitem_bTag_vals; break; case USBHID_ITEMTYPE_GLOBAL: hf_usb_hid_curitem_bTag = hf_usb_hid_globalitem_bTag; usb_hid_cur_bTag_vals = usb_hid_globalitem_bTag_vals; break; case USBHID_ITEMTYPE_LOCAL: hf_usb_hid_curitem_bTag = hf_usb_hid_localitem_bTag; usb_hid_cur_bTag_vals = usb_hid_localitem_bTag_vals; break; default: /* Only USBHID_ITEMTYPE_LONG, but keep compiler happy */ hf_usb_hid_curitem_bTag = hf_usb_hid_longitem_bTag; usb_hid_cur_bTag_vals = usb_hid_longitem_bTag_vals; break; } subtree = proto_tree_add_subtree_format(parent_tree, tvb, offset, bSize + 1, ett_usb_hid_item_header, &subitem, "%s", val_to_str(bTag, usb_hid_cur_bTag_vals, "Unknown/%u tag")); tree = proto_tree_add_subtree(subtree, tvb, offset, 1, ett_usb_hid_item_header, NULL, "Header"); proto_tree_add_item(tree, hf_usb_hid_item_bSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_item_bType, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_hid_curitem_bTag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; if ((bType == 3) && (bTag == 16)) { /* Long item */ bSize = tvb_get_guint8(tvb, offset); proto_tree_add_item(subtree, hf_usb_hid_item_bDataSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_item_bLongItemTag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_item_unk_data, tvb, offset, bSize, ENC_NA); offset += bSize; } else { /* Short item */ switch (bType) { case USBHID_ITEMTYPE_MAIN: offset = dissect_usb_hid_report_mainitem_data(pinfo, subtree, tvb, offset, bSize, bTag); break; case USBHID_ITEMTYPE_GLOBAL: offset = dissect_usb_hid_report_globalitem_data(pinfo, subtree, tvb, offset, bSize, bTag, &cur_global); break; case USBHID_ITEMTYPE_LOCAL: offset = dissect_usb_hid_report_localitem_data(pinfo, subtree, tvb, offset, bSize, bTag, &cur_global); break; default: /* Only USBHID_ITEMTYPE_LONG, but keep compiler happy */ proto_tree_add_item(subtree, hf_usb_hid_item_unk_data, tvb, offset, bSize, ENC_NA); offset += bSize; break; } } if (bType == USBHID_ITEMTYPE_MAIN) { if (bTag == USBHID_MAINITEM_TAG_COLLECTION) { /* Begin collection, nest following elements under us */ offset = dissect_usb_hid_report_item(pinfo, subtree, tvb, offset, usb_conv_info, &cur_global); proto_item_set_len(subitem, offset-old_offset); } else if (bTag == USBHID_MAINITEM_TAG_ENDCOLLECTION) { /* End collection, break out to parent tree item */ break; } } } return offset; } /* Dissector for HID "GET DESCRIPTOR" subtype. */ int dissect_usb_hid_get_report_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; int old_offset=offset; struct usb_hid_global_state initial_global; memset(&initial_global, 0, sizeof(struct usb_hid_global_state)); item = proto_tree_add_protocol_format(parent_tree, proto_usb_hid, tvb, offset, -1, "HID Report"); tree = proto_item_add_subtree(item, ett_usb_hid_report); offset = dissect_usb_hid_report_item(pinfo, tree, tvb, offset, usb_conv_info, &initial_global); /* only insert report descriptor the first time we parse it */ if (!PINFO_FD_VISITED(pinfo) && usb_conv_info) { wmem_allocator_t *scope = wmem_file_scope(); report_descriptor_t *data = wmem_new0(scope, report_descriptor_t); data->usb_info = *usb_conv_info; data->desc_length = offset - old_offset; data->desc_body = (guint8*) tvb_memdup(scope, tvb, old_offset, data->desc_length); if (parse_report_descriptor(data)) { insert_report_descriptor(pinfo, data); } else { wmem_free(scope, data->desc_body); wmem_free(scope, data); } } proto_item_set_len(item, offset-old_offset); return offset; } /* Dissector for HID GET_REPORT request. See USBHID 1.11, Chapter 7.2.1 Get_Report Request */ static void dissect_usb_hid_get_report(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *subtree; if (!is_request) return; item = proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hid_wValue); /* Report Type in the high byte, Report ID in the low byte */ proto_tree_add_item(subtree, hf_usb_hid_report_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } /* Dissector for HID SET_REPORT request. See USBHID 1.11, Chapter 7.2.2 Set_Report Request */ static void dissect_usb_hid_set_report(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *subtree; if (!is_request) return; item = proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hid_wValue); proto_tree_add_item(subtree, hf_usb_hid_report_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } /* Dissector for HID GET_IDLE request. See USBHID 1.11, Chapter 7.2.3 Get_Idle Request */ static void dissect_usb_hid_get_idle(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *subtree; if (!is_request) return; item = proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hid_wValue); proto_tree_add_item(subtree, hf_usb_hid_report_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_zero, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } /* Dissector for HID SET_IDLE request. See USBHID 1.11, Chapter 7.2.4 Set_Idle Request */ static void dissect_usb_hid_set_idle(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *subtree; if (!is_request) return; item = proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hid_wValue); /* Duration in the high byte, Report ID in the low byte */ proto_tree_add_item(subtree, hf_usb_hid_report_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hid_duration, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } /* Dissector for HID GET_PROTOCOL request. See USBHID 1.11, Chapter 7.2.5 Get_Protocol Request */ static void dissect_usb_hid_get_protocol(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { if (!is_request) return; proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } /* Dissector for HID SET_PROTOCOL request. See USBHID 1.11, Chapter 7.2.6 Set_Protocol Request */ static void dissect_usb_hid_set_protocol(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info _U_) { if (!is_request) return; proto_tree_add_item(tree, hf_usb_hid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } typedef void (*usb_setup_dissector)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_conv_info_t *usb_conv_info); typedef struct _usb_setup_dissector_table_t { guint8 request; usb_setup_dissector dissector; } usb_setup_dissector_table_t; /* USBHID 1.11, Chapter 7.2 Class-Specific Requests */ #define USB_HID_SETUP_GET_REPORT 0x01 #define USB_HID_SETUP_GET_IDLE 0x02 #define USB_HID_SETUP_GET_PROTOCOL 0x03 /* 0x04..0x08: Reserved */ #define USB_HID_SETUP_SET_REPORT 0x09 #define USB_HID_SETUP_SET_IDLE 0x0A #define USB_HID_SETUP_SET_PROTOCOL 0x0B static const usb_setup_dissector_table_t setup_dissectors[] = { { USB_HID_SETUP_GET_REPORT, dissect_usb_hid_get_report }, { USB_HID_SETUP_GET_IDLE, dissect_usb_hid_get_idle }, { USB_HID_SETUP_GET_PROTOCOL, dissect_usb_hid_get_protocol }, { USB_HID_SETUP_SET_REPORT, dissect_usb_hid_set_report }, { USB_HID_SETUP_SET_IDLE, dissect_usb_hid_set_idle }, { USB_HID_SETUP_SET_PROTOCOL, dissect_usb_hid_set_protocol }, { 0, NULL } }; static const value_string setup_request_names_vals[] = { { USB_HID_SETUP_GET_REPORT, "GET_REPORT" }, { USB_HID_SETUP_GET_IDLE, "GET_IDLE" }, { USB_HID_SETUP_GET_PROTOCOL, "GET_PROTOCOL" }, { USB_HID_SETUP_SET_REPORT, "SET_REPORT" }, { USB_HID_SETUP_SET_IDLE, "SET_IDLE" }, { USB_HID_SETUP_SET_PROTOCOL, "SET_PROTOCOL" }, { 0, NULL } }; static const value_string usb_hid_report_type_vals[] = { { 1, "Input" }, { 2, "Output" }, { 3, "Feature" }, { 0, NULL } }; static gint dissect_usb_hid_boot_keyboard_input_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; gboolean shortcut_helper = FALSE; guint modifier; guint keycode; proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_right_gui, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_right_alt, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_right_shift, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_right_ctrl, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_left_gui, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_left_alt, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_left_shift, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_modifier_left_ctrl, tvb, offset, 1, ENC_BIG_ENDIAN); modifier = tvb_get_guint8(tvb, offset); col_append_str(pinfo->cinfo, COL_INFO, " - "); if (modifier & 0x80) { col_append_str(pinfo->cinfo, COL_INFO, "RIGHT GUI"); shortcut_helper = TRUE; } if (modifier & 0x40) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "RIGHT ALT"); shortcut_helper = TRUE; } if (modifier & 0x20) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "RIGHT SHIFT"); shortcut_helper = TRUE; } if (modifier & 0x10) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "RIGHT CTRL"); shortcut_helper = TRUE; } if (modifier & 0x08) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "LEFT GUI"); shortcut_helper = TRUE; } if (modifier & 0x04) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "LEFT ALT"); shortcut_helper = TRUE; } if (modifier & 0x02) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "LEFT SHIFT"); shortcut_helper = TRUE; } if (modifier & 0x01) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "LEFT CTRL"); shortcut_helper = TRUE; } offset += 1; proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_1, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_2, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_3, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_4, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_5, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_keycode_6, tvb, offset, 1, ENC_BIG_ENDIAN); keycode = tvb_get_guint8(tvb, offset); offset += 1; if (keycode) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(keycode, &keycode_vals_ext, "Unknown")); shortcut_helper = TRUE; } if (shortcut_helper == FALSE) { col_append_str(pinfo->cinfo, COL_INFO, "<action key up>"); } return offset; } static gint dissect_usb_hid_boot_keyboard_output_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; gboolean shortcut_helper = FALSE; guint leds; proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_constants, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_kana, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_compose, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_scroll_lock, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_caps_lock, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_keyboard_leds_num_lock, tvb, offset, 1, ENC_BIG_ENDIAN); leds = tvb_get_guint8(tvb, offset); col_append_str(pinfo->cinfo, COL_INFO, " - LEDs: "); if (leds & 0x01) { col_append_str(pinfo->cinfo, COL_INFO, "NumLock"); shortcut_helper = TRUE; } if (leds & 0x02) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "CapsLock"); shortcut_helper = TRUE; } if (leds & 0x04) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "ScrollLock"); shortcut_helper = TRUE; } if (leds & 0x08) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "Compose"); shortcut_helper = TRUE; } if (leds & 0x10) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "Kana"); shortcut_helper = TRUE; } if (leds & 0x20) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "Constant1"); shortcut_helper = TRUE; } if (leds & 0x40) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "Constant2"); shortcut_helper = TRUE; } if (leds & 0x80) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_str(pinfo->cinfo, COL_INFO, "Constant3"); /*shortcut_helper = TRUE;*/ } if (!leds) { col_append_str(pinfo->cinfo, COL_INFO, "none"); } offset += 1; return offset; } static gint dissect_usb_hid_boot_mouse_input_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; gboolean shortcut_helper = FALSE; guint buttons; proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_8, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_7, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_middle, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_right, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_button_left, tvb, offset, 1, ENC_BIG_ENDIAN); buttons = tvb_get_guint8(tvb, offset); offset += 1; if (buttons) col_append_str(pinfo->cinfo, COL_INFO, " - "); if (buttons & 0x01) { col_append_str(pinfo->cinfo, COL_INFO, "Button LEFT"); shortcut_helper = TRUE; } if (buttons & 0x02) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button RIGHT"); shortcut_helper = TRUE; } if (buttons & 0x04) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button MIDDLE"); } if (buttons & 0x08) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button 4"); shortcut_helper = TRUE; } if (buttons & 0x10) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button 5"); shortcut_helper = TRUE; } if (buttons & 0x20) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button 6"); shortcut_helper = TRUE; } if (buttons & 0x40) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button 7"); shortcut_helper = TRUE; } if (buttons & 0x80) { if (shortcut_helper) col_append_str(pinfo->cinfo, COL_INFO, " + "); col_append_str(pinfo->cinfo, COL_INFO, "Button 8"); /* Not necessary, this is the last case where it is used * shortcut_helper = TRUE; */ } proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_x_displacement, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_y_displacement, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* not really in HID Specification */ if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_horizontal_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } /* not really in HID Specification */ if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(tree, hf_usbhid_boot_report_mouse_vertical_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(tree, hf_usbhid_data, tvb, offset, -1, ENC_NA); offset += tvb_captured_length_remaining(tvb, offset); } return offset; } /* dissect a "standard" control message that's sent to an interface */ static gint dissect_usb_hid_control_std_intf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info) { gint offset = 0; usb_trans_info_t *usb_trans_info; guint8 req; usb_trans_info = usb_conv_info->usb_trans_info; /* XXX - can we do some plausibility checks here? */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBHID"); /* we can't use usb_conv_info->is_request since usb_conv_info was replaced with the interface conversation */ if (usb_trans_info->request_in == pinfo->num) { /* the tvb that we see here is the setup packet without the request type byte */ req = tvb_get_guint8(tvb, offset); if (req != USB_SETUP_GET_DESCRIPTOR) return offset; col_clear(pinfo->cinfo, COL_INFO); col_append_str(pinfo->cinfo, COL_INFO, "GET DESCRIPTOR Request"); offset += 1; proto_tree_add_item(tree, hf_usb_hid_bDescriptorIndex, tvb, offset, 1, ENC_LITTLE_ENDIAN); usb_trans_info->u.get_descriptor.usb_index = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_item(tree, hf_usb_hid_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN); usb_trans_info->u.get_descriptor.type = tvb_get_guint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(usb_trans_info->u.get_descriptor.type, &hid_descriptor_type_vals_ext, "Unknown type %u")); offset += 1; proto_tree_add_item(tree, hf_usb_hid_wInterfaceNumber, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hid_wDescriptorLength, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } else { col_clear(pinfo->cinfo, COL_INFO); col_append_str(pinfo->cinfo, COL_INFO, "GET DESCRIPTOR Response"); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(usb_trans_info->u.get_descriptor.type, &hid_descriptor_type_vals_ext, "Unknown type %u")); if (usb_trans_info->u.get_descriptor.type == USB_DT_HID_REPORT) offset = dissect_usb_hid_get_report_descriptor(pinfo, tree, tvb, offset, usb_conv_info); } return offset; } /* dissect a class-specific control message that's sent to an interface */ static gint dissect_usb_hid_control_class_intf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info) { usb_trans_info_t *usb_trans_info; gboolean is_request; int offset = 0; usb_setup_dissector dissector = NULL; const usb_setup_dissector_table_t *tmp; usb_trans_info = usb_conv_info->usb_trans_info; is_request = (pinfo->srcport==NO_ENDPOINT); /* Check valid values for bmRequestType. See Chapter 7.2 in USBHID 1.11 */ for (tmp = setup_dissectors; tmp->dissector; tmp++) { if (tmp->request == usb_trans_info->setup.request) { dissector = tmp->dissector; break; } } /* No, we could not find any class specific dissector for this request * return 0 and let USB try any of the standard requests. */ if (!dissector) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBHID"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"), is_request ? "Request" : "Response"); if (is_request) { proto_tree_add_item(tree, hf_usb_hid_request, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } dissector(pinfo, tree, tvb, offset, is_request, usb_conv_info); return tvb_captured_length(tvb); } /* unpack a HID logical report field */ static int hid_unpack_logical(tvbuff_t *tvb, int bit_offset, guint32 size, gint32 min, gint32 *val) { if (size > 32) return -1; *val = tvb_get_bits32(tvb, bit_offset, size, ENC_LITTLE_ENDIAN); if (min < 0) *val = ws_sign_ext32(*val, size); return 0; } static gint dissect_usb_hid_int_dynamic_value_variable(tvbuff_t *tvb, proto_tree *tree, hid_field_t *field, int bit_offset, int hf) { gint32 val = 0; if (hid_unpack_logical(tvb, bit_offset, field->report_size, field->logical_min, &val)) return -1; proto_tree_add_int_bits_format_value(tree, hf, tvb, bit_offset, field->report_size, val, ENC_LITTLE_ENDIAN, "%d", val); return 0; } /* dissect the Generic Desktop Controls (0x0001) usage page */ static gint dissect_usb_hid_generic_desktop_controls_page(tvbuff_t *tvb, packet_info _U_ *pinfo, proto_tree *tree, hid_field_t *field, guint usage, int bit_offset) { gint ret = 0; DISSECTOR_ASSERT(USAGE_PAGE(usage) == GENERIC_DESKTOP_CONTROLS_PAGE); usage = USAGE_ID(usage); switch (usage) { case USBHID_GENERIC_DESKTOP_CONTROLS_X: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_x); break; case USBHID_GENERIC_DESKTOP_CONTROLS_Y: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_y); break; case USBHID_GENERIC_DESKTOP_CONTROLS_Z: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_z); break; case USBHID_GENERIC_DESKTOP_CONTROLS_RX: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_rx); break; case USBHID_GENERIC_DESKTOP_CONTROLS_RY: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_ry); break; case USBHID_GENERIC_DESKTOP_CONTROLS_RZ: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_rz); break; case USBHID_GENERIC_DESKTOP_CONTROLS_SLIDER: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_slider); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VX: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vx); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VY: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vy); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VZ: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vz); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VBRX: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vbrx); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VBRY: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vbry); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VBRZ: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vbrz); break; case USBHID_GENERIC_DESKTOP_CONTROLS_VNO: ret = dissect_usb_hid_int_dynamic_value_variable(tvb, tree, field, bit_offset, hf_usbhid_axis_vno); break; default: ret = -1; break; } return ret; } /* dissect the Keyboard/Keypad (0x0007) usage page */ static gint dissect_usb_hid_keyboard_page(tvbuff_t *tvb, packet_info _U_ *pinfo, proto_tree *tree, hid_field_t *field, guint32 usage, int bit_offset) { gint32 val = 0; /* the data is a boolean state for the usage (eg. KEY_SHIFT = 1, KEY_CONTROL = 0) */ if (hid_unpack_logical(tvb, bit_offset, field->report_size, field->logical_min, &val)) return -1; DISSECTOR_ASSERT(USAGE_PAGE(usage) == KEYBOARD_KEYPAD_PAGE); usage = USAGE_ID(usage); proto_tree_add_boolean_bits_format_value(tree, hf_usbhid_key, tvb, bit_offset, field->report_size, val, ENC_LITTLE_ENDIAN, "%s (0x%02x): %s", val_to_str_ext_const(usage, &keycode_vals_ext, "Unknown"), usage, val ? "DOWN" : "UP"); return 0; } /* dissect the Button (0x0009) usage page */ static gint dissect_usb_hid_button_page(tvbuff_t *tvb, packet_info _U_ *pinfo, proto_tree *tree, hid_field_t *field, guint32 usage, int bit_offset) { gint32 val = 0; proto_item *ti; DISSECTOR_ASSERT(USAGE_PAGE(usage) == BUTTON_PAGE); usage = USAGE_ID(usage); if (hid_unpack_logical(tvb, bit_offset, field->report_size, field->logical_min, &val)) return -1; ti = proto_tree_add_boolean_bits_format_value(tree, hf_usbhid_button, tvb, bit_offset, field->report_size, val, ENC_LITTLE_ENDIAN, "%u", usage); if (usage == 0) proto_item_append_text(ti, " (No button pressed)"); else if (usage == 1) proto_item_append_text(ti, " (primary/trigger)"); else if (usage == 2) proto_item_append_text(ti, " (secondary)"); else if (usage == 3) proto_item_append_text(ti, " (tertiary)"); proto_item_append_text(ti, ": %s", val ? "DOWN" : "UP"); return 0; } static void dissect_hid_variable(tvbuff_t* tvb, packet_info _U_* pinfo, proto_tree* tree, hid_field_t* field, guint32 usage, int bit_offset) { gint ret = 0; /* vendor data (0xff00 - 0xffff) */ if ((USAGE_PAGE(usage) & 0xff00) == 0xff00) { proto_tree_add_bits_item(tree, hf_usbhid_vendor_data, tvb, bit_offset, field->report_size, ENC_LITTLE_ENDIAN); return; } switch (USAGE_PAGE(usage)) { case GENERIC_DESKTOP_CONTROLS_PAGE: ret = dissect_usb_hid_generic_desktop_controls_page(tvb, pinfo, tree, field, usage, bit_offset); break; case KEYBOARD_KEYPAD_PAGE: ret = dissect_usb_hid_keyboard_page(tvb, pinfo, tree, field, usage, bit_offset); break; case BUTTON_PAGE: ret = dissect_usb_hid_button_page(tvb, pinfo, tree, field, usage, bit_offset); break; default: ret = -1; break; } if (ret) { guint32 val = 0; proto_item *ti = proto_tree_add_uint_bits_format_value(tree, hf_usb_hid_localitem_usage, tvb, bit_offset, field->report_size, usage, ENC_LITTLE_ENDIAN, "%s", get_usage_page_item_string(pinfo->pool, USAGE_PAGE(usage), USAGE_ID(usage))); if (0 == hid_unpack_logical(tvb, bit_offset, field->report_size, field->logical_min, &val)) proto_item_append_text(ti, ": %d", val); } } static gboolean hid_get_usage_from_array(hid_field_t *field, gint32 idx, guint32 *out) { if ((idx >= field->logical_min) && (idx <= field->logical_max)) { idx -= field->logical_min; if ((guint32)idx < wmem_array_get_count(field->usages)) { *out = (*((guint32*) wmem_array_index(field->usages, idx))); return TRUE; } } return FALSE; } static gint dissect_hid_field(tvbuff_t *tvb, packet_info _U_ *pinfo, proto_tree *tree, hid_field_t *field, int bit_offset) { gint start_offset = bit_offset; if ((field->properties & HID_MAIN_TYPE) == HID_MAIN_ARRAY) { proto_item *array_ti; proto_tree *array_tree; array_ti = proto_tree_add_bits_item(tree, hf_usbhid_array, tvb, bit_offset, field->report_size * field->report_count, ENC_LITTLE_ENDIAN); array_tree = proto_item_add_subtree(array_ti, ett_usb_hid_array); for(unsigned int j = 0; j < field->report_count; j++) { guint32 val = 0; gboolean in_range; if (hid_unpack_logical(tvb, bit_offset, field->report_size, field->logical_min, &val)) { in_range = FALSE; } else { in_range = hid_get_usage_from_array(field, val, &val); } if (in_range) { proto_tree_add_boolean_bits_format_value(array_tree, hf_usbhid_array_usage, tvb, bit_offset, field->report_size, val, ENC_LITTLE_ENDIAN, "%s (0x%04x, 0x%04x)", get_usage_page_item_string(pinfo->pool, USAGE_PAGE(val), USAGE_ID(val)), USAGE_PAGE(val), USAGE_ID(val)); } else { proto_tree_add_boolean_bits_format_value(array_tree, hf_usbhid_array_usage, tvb, bit_offset, field->report_size, val, ENC_LITTLE_ENDIAN, "No controls asserted"); } bit_offset += field->report_size; } } else { unsigned int i; unsigned int count = wmem_array_get_count(field->usages); if (count > field->report_count) { count = field->report_count; } for(i = 0; i < count; i++) { guint32 usage = *((guint32*) wmem_array_index(field->usages, i)); dissect_hid_variable(tvb, pinfo, tree, field, usage, bit_offset); bit_offset += field->report_size; } if (field->report_count > count) { gint remaining_bits = (field->report_count - count) * field->report_size; proto_tree_add_bits_item(tree, hf_usbhid_padding, tvb, bit_offset, remaining_bits, ENC_LITTLE_ENDIAN); bit_offset += remaining_bits; } } return bit_offset - start_offset; } /* Dissect USB HID data/reports */ static gint dissect_usb_hid_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint offset = 0, hid_bit_offset; proto_item *hid_ti; proto_tree *hid_tree; wmem_array_t *fields; usb_conv_info_t *usb_data = (usb_conv_info_t*) data; report_descriptor_t *rdesc = get_report_descriptor(pinfo, usb_data); guint remaining = tvb_reported_length_remaining(tvb, offset); if (remaining) { hid_ti = proto_tree_add_item(tree, hf_usbhid_data, tvb, offset, -1, ENC_NA); hid_tree = proto_item_add_subtree(hid_ti, ett_usb_hid_data); hid_bit_offset = offset * 8; offset += remaining; guint8 report_id = tvb_get_bits8(tvb, hid_bit_offset, 8); if (rdesc) { if (rdesc->uses_report_id) { proto_tree_add_item(hid_tree, hf_usbhid_report_id, tvb, hid_bit_offset / 8, 1, ENC_NA); hid_bit_offset += 8; } if (usb_data->direction == P2P_DIR_RECV) fields = rdesc->fields_in; else fields = rdesc->fields_out; for(unsigned int i = 0; i < wmem_array_get_count(fields); i++) { hid_field_t *field = (hid_field_t*) wmem_array_index(fields, i); unsigned int data_size = field->report_size * field->report_count; /* skip items with invalid report IDs */ if (rdesc->uses_report_id && field->report_id != report_id) continue; /* if the item has no usages, it is padding - HID spec 6.2.2.9 */ if (wmem_array_get_count(field->usages) == 0) { proto_tree_add_bits_item(hid_tree, hf_usbhid_padding, tvb, hid_bit_offset, data_size, ENC_LITTLE_ENDIAN); hid_bit_offset += data_size; continue; } hid_bit_offset += dissect_hid_field(tvb, pinfo, hid_tree, field, hid_bit_offset); } } } return offset; } /* Dissector for HID class-specific control request as defined in * USBHID 1.11, Chapter 7.2. * returns the number of bytes consumed */ static gint dissect_usb_hid_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info; usb_trans_info_t *usb_trans_info; guint8 type, recip; usb_conv_info = (usb_conv_info_t *)data; if (!usb_conv_info) return 0; usb_trans_info = usb_conv_info->usb_trans_info; if (!usb_trans_info) return 0; type = USB_TYPE(usb_trans_info->setup.requesttype); recip = USB_RECIPIENT(usb_trans_info->setup.requesttype); if (recip == RQT_SETUP_RECIPIENT_INTERFACE) { if (type == RQT_SETUP_TYPE_STANDARD) return dissect_usb_hid_control_std_intf(tvb, pinfo, tree, usb_conv_info); else if (type == RQT_SETUP_TYPE_CLASS) return dissect_usb_hid_control_class_intf(tvb, pinfo, tree, usb_conv_info); } return dissect_usb_hid_data(tvb, pinfo, tree, data); } /* dissect a descriptor that is specific to the HID class */ static gint dissect_usb_hid_class_descriptors(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { guint8 type; gint offset = 0; proto_item *ti; proto_tree *desc_tree; guint8 num_desc; guint i; type = tvb_get_guint8(tvb, 1); /* for now, we only handle the HID descriptor here */ if (type != USB_DT_HID) return 0; desc_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_usb_hid_descriptor, &ti, "HID DESCRIPTOR"); dissect_usb_descriptor_header(desc_tree, tvb, offset, &hid_descriptor_type_vals_ext); offset += 2; proto_tree_add_item(desc_tree, hf_usb_hid_bcdHID, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(desc_tree, hf_usb_hid_bCountryCode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; num_desc = tvb_get_guint8(tvb, offset); proto_tree_add_item(desc_tree, hf_usb_hid_bNumDescriptors, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; for (i=0;i<num_desc;i++) { proto_tree_add_item(desc_tree, hf_usb_hid_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(desc_tree, hf_usb_hid_wDescriptorLength, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } proto_item_set_len(ti, offset); return offset; } void proto_register_usb_hid(void) { static hf_register_info hf[] = { { &hf_usb_hid_item_bSize, { "bSize", "usbhid.item.bSize", FT_UINT8, BASE_DEC, VALS(usb_hid_item_bSize_vals), USBHID_SIZE_MASK, NULL, HFILL }}, { &hf_usb_hid_item_bType, { "bType", "usbhid.item.bType", FT_UINT8, BASE_DEC, VALS(usb_hid_item_bType_vals), USBHID_TYPE_MASK, NULL, HFILL }}, { &hf_usb_hid_mainitem_bTag, { "bTag", "usbhid.item.bTag", FT_UINT8, BASE_HEX, VALS(usb_hid_mainitem_bTag_vals), USBHID_TAG_MASK, NULL, HFILL }}, { &hf_usb_hid_globalitem_bTag, { "bTag", "usbhid.item.bTag", FT_UINT8, BASE_HEX, VALS(usb_hid_globalitem_bTag_vals), USBHID_TAG_MASK, NULL, HFILL }}, { &hf_usb_hid_localitem_bTag, { "bTag", "usbhid.item.bTag", FT_UINT8, BASE_HEX, VALS(usb_hid_localitem_bTag_vals), USBHID_TAG_MASK, NULL, HFILL }}, { &hf_usb_hid_longitem_bTag, { "bTag", "usbhid.item.bTag", FT_UINT8, BASE_HEX, VALS(usb_hid_longitem_bTag_vals), USBHID_TAG_MASK, NULL, HFILL }}, { &hf_usb_hid_item_bDataSize, { "bDataSize", "usbhid.item.bDataSize", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_item_bLongItemTag, { "bTag", "usbhid.item.bLongItemTag", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, /* Main-report item data */ { &hf_usb_hid_mainitem_bit0, { "Data/constant", "usbhid.item.main.readonly", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit0), 1<<0, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit1, { "Data type", "usbhid.item.main.variable", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit1), 1<<1, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit2, { "Coordinates", "usbhid.item.main.relative", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit2), 1<<2, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit3, { "Min/max wraparound", "usbhid.item.main.wrap", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit3), 1<<3, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit4, { "Physical relationship to data", "usbhid.item.main.nonlinear", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit4), 1<<4, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit5, { "Preferred state", "usbhid.item.main.no_preferred_state", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit5), 1<<5, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit6, { "Has null position", "usbhid.item.main.nullstate", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit6), 1<<6, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit7, { "(Non)-volatile", "usbhid.item.main.volatile", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit7), 1<<7, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit7_input, { "[Reserved]", "usbhid.item.main.reserved", FT_BOOLEAN, 9, NULL, 1<<7, NULL, HFILL }}, { &hf_usb_hid_mainitem_bit8, { "Bits or bytes", "usbhid.item.main.buffered_bytes", FT_BOOLEAN, 9, TFS(&tfs_mainitem_bit8), 1<<8, NULL, HFILL }}, { &hf_usb_hid_mainitem_colltype, { "Collection type", "usbhid.item.main.colltype", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(usb_hid_mainitem_colltype_vals), 0, NULL, HFILL }}, /* Global-report item data */ { &hf_usb_hid_globalitem_usage, { "Usage page", "usbhid.item.global.usage", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_log_min, { "Logical minimum", "usbhid.item.global.log_min", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_log_max, { "Logical maximum", "usbhid.item.global.log_max", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_phy_min, { "Physical minimum", "usbhid.item.global.phy_min", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_phy_max, { "Physical maximum", "usbhid.item.global.phy_max", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_exp, { "Unit exponent", "usbhid.item.global.unit_exp", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_sys, { "System", "usbhid.item.global.unit.system", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x0000000F, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_len, { "Length", "usbhid.item.global.unit.length", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x000000F0, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_mass, { "Mass", "usbhid.item.global.unit.mass", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x00000F00, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_time, { "Time", "usbhid.item.global.unit.time", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x0000F000, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_temp, { "Temperature", "usbhid.item.global.unit.temperature", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x000F0000, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_current, { "Current", "usbhid.item.global.unit.current", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x00F00000, NULL, HFILL }}, { &hf_usb_hid_globalitem_unit_brightness, { "Luminous intensity", "usbhid.item.global.unit.brightness", FT_UINT32, BASE_HEX, VALS(usb_hid_globalitem_unit_exp_vals), 0x0F000000, NULL, HFILL }}, { &hf_usb_hid_globalitem_report_size, { "Report size", "usbhid.item.global.report_size", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_report_id, { "Report ID", "usbhid.item.global.report_id", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_report_count, { "Report count", "usbhid.item.global.report_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_push, { "Push", "usbhid.item.global.push", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_globalitem_pop, { "Pop", "usbhid.item.global.pop", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, /* Local-report item data */ { &hf_usb_hid_localitem_usage, { "Usage", "usbhid.item.local.usage", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_usage_min, { "Usage minimum", "usbhid.item.local.usage_min", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_usage_max, { "Usage maximum", "usbhid.item.local.usage_max", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_desig_index, { "Designator index", "usbhid.item.local.desig_index", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_desig_min, { "Designator minimum", "usbhid.item.local.desig_min", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_desig_max, { "Designator maximum", "usbhid.item.local.desig_max", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_string_index, { "String index", "usbhid.item.local.string_index", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_string_min, { "String minimum", "usbhid.item.local.string_min", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_string_max, { "String maximum", "usbhid.item.local.string_max", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_localitem_delimiter, { "Delimiter", "usbhid.item.local.delimiter", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hid_item_unk_data, { "Item data", "usbhid.item.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, /* USB HID specific requests */ { &hf_usb_hid_request, { "bRequest", "usbhid.setup.bRequest", FT_UINT8, BASE_HEX, VALS(setup_request_names_vals), 0x0, NULL, HFILL }}, { &hf_usb_hid_value, { "wValue", "usbhid.setup.wValue", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_index, { "wIndex", "usbhid.setup.wIndex", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_length, { "wLength", "usbhid.setup.wLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_report_type, { "ReportType", "usbhid.setup.ReportType", FT_UINT8, BASE_DEC, VALS(usb_hid_report_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_hid_report_id, { "ReportID", "usbhid.setup.ReportID", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_duration, { "Duration", "usbhid.setup.Duration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_zero, { "(zero)", "usbhid.setup.zero", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* components of the HID descriptor */ { &hf_usb_hid_bcdHID, { "bcdHID", "usbhid.descriptor.hid.bcdHID", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_bCountryCode, { "bCountryCode", "usbhid.descriptor.hid.bCountryCode", FT_UINT8, BASE_HEX, VALS(hid_country_code_vals), 0x0, NULL, HFILL }}, { &hf_usb_hid_bNumDescriptors, { "bNumDescriptors", "usbhid.descriptor.hid.bNumDescriptors", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_bDescriptorIndex, { "bDescriptorIndex", "usbhid.descriptor.hid.bDescriptorIndex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_bDescriptorType, { "bDescriptorType", "usbhid.descriptor.hid.bDescriptorType", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &hid_descriptor_type_vals_ext, 0x00, NULL, HFILL }}, { &hf_usb_hid_wInterfaceNumber, { "wInterfaceNumber", "usbhid.descriptor.hid.wInterfaceNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hid_wDescriptorLength, { "wDescriptorLength", "usbhid.descriptor.hid.wDescriptorLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_reserved, { "Reserved", "usbhid.boot_report.keyboard.reserved", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_1, { "Keycode 1", "usbhid.boot_report.keyboard.keycode_1", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_2, { "Keycode 2", "usbhid.boot_report.keyboard.keycode_2", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_3, { "Keycode 3", "usbhid.boot_report.keyboard.keycode_3", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_4, { "Keycode 4", "usbhid.boot_report.keyboard.keycode_4", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_5, { "Keycode 5", "usbhid.boot_report.keyboard.keycode_5", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_keycode_6, { "Keycode 6", "usbhid.boot_report.keyboard.keycode_6", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &keycode_vals_ext, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_right_gui, { "Modifier: RIGHT GUI", "usbhid.boot_report.keyboard.modifier.right_gui", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_right_alt, { "Modifier: RIGHT ALT", "usbhid.boot_report.keyboard.modifier.right_alt", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_right_shift, { "Modifier: RIGHT SHIFT", "usbhid.boot_report.keyboard.modifier.right_shift", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_right_ctrl, { "Modifier: RIGHT CTRL", "usbhid.boot_report.keyboard.modifier.right_ctrl", FT_BOOLEAN, 8, NULL, 0x10,NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_left_gui, { "Modifier: LEFT GUI", "usbhid.boot_report.keyboard.modifier.left_gui", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_left_alt, { "Modifier: LEFT ALT", "usbhid.boot_report.keyboard.modifier.left_alt", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_usbhid_boot_report_keyboard_modifier_left_shift, { "Modifier: LEFT SHIFT", "usbhid.boot_report.keyboard.modifier.left_shift", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_modifier_left_ctrl, { "Modifier: LEFT CTRL", "usbhid.boot_report.keyboard.modifier.left_ctrl", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_constants, { "Constants", "usbhid.boot_report.keyboard.leds.constants", FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_kana, { "KANA", "usbhid.boot_report.keyboard.leds.kana", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_compose, { "COMPOSE", "usbhid.boot_report.keyboard.leds.compose", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_scroll_lock, { "SCROLL LOCK", "usbhid.boot_report.keyboard.leds.scroll_lock", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_caps_lock, { "CAPS LOCK", "usbhid.boot_report.keyboard.leds.caps_lock", FT_BOOLEAN, 8, NULL, 0x02,NULL, HFILL }}, { &hf_usbhid_boot_report_keyboard_leds_num_lock, { "NUM LOCK", "usbhid.boot_report.keyboard.leds.num_lock", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_8, { "Button 8", "usbhid.boot_report.mouse.button.8", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_7, { "Button 7", "usbhid.boot_report.mouse.button.7", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_6, { "Button 6", "usbhid.boot_report.mouse.button.6", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_5, { "Button 5", "usbhid.boot_report.mouse.button.5", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_4, { "Button 4", "usbhid.boot_report.mouse.button.4", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_middle, { "Button Middle", "usbhid.boot_report.mouse.button.middle", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_right, { "Button Right", "usbhid.boot_report.mouse.button.right", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_button_left, { "Button Left", "usbhid.boot_report.mouse.button.left", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_x_displacement, { "X Displacement", "usbhid.boot_report.mouse.x_displacement", FT_INT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_y_displacement, { "Y Displacement", "usbhid.boot_report.mouse.y_displacement", FT_INT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_horizontal_scroll_wheel, { "Horizontal Scroll Wheel", "usbhid.boot_report.mouse.scroll_wheel.horizontal", FT_INT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_boot_report_mouse_vertical_scroll_wheel, { "Vertical Scroll Wheel", "usbhid.boot_report.mouse.scroll_wheel.vertical", FT_INT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_data, { "HID Data", "usbhid.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_unknown_data, { "Unknown", "usbhid.data.unknown", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_vendor_data, { "Vendor Data", "usbhid.data.vendor", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_report_id, { "Report ID", "usbhid.data.report_id", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_padding, { "Padding", "usbhid.data.padding", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_x, { "X Axis", "usbhid.data.axis.x", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_y, { "Y Axis", "usbhid.data.axis.y", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_z, { "Z Axis", "usbhid.data.axis.z", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_rx, { "Rx Axis", "usbhid.data.axis.rx", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_ry, { "Ry Axis", "usbhid.data.axis.ry", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_rz, { "Rz Axis", "usbhid.data.axis.rz", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_slider, { "Slider Axis", "usbhid.data.axis.slider", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vx, { "Vx Axis", "usbhid.data.axis.vx", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vy, { "Vy Axis", "usbhid.data.axis.vy", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vz, { "Vz Axis", "usbhid.data.axis.vz", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vbrx, { "Vbrx Axis", "usbhid.data.axis.vbrx", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vbry, { "Vbry Axis", "usbhid.data.axis.vbry", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vbrz, { "Vbrz Axis", "usbhid.data.axis.vbrz", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_axis_vno, { "Vno Axis", "usbhid.data.axis.vno", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_button, { "Button", "usbhid.data.button", FT_BOOLEAN, 1, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_key, { "Key", "usbhid.data.key.variable", FT_BOOLEAN, 1, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_array, { "Array", "usbhid.data.array", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbhid_array_usage, { "Usage", "usbhid.data.array.usage", FT_BOOLEAN, 1, NULL, 0x00, NULL, HFILL }}, }; static gint *usb_hid_subtrees[] = { &ett_usb_hid_report, &ett_usb_hid_item_header, &ett_usb_hid_wValue, &ett_usb_hid_descriptor, &ett_usb_hid_data, &ett_usb_hid_unknown_data, &ett_usb_hid_array }; report_descriptors = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); proto_usb_hid = proto_register_protocol("USB HID", "USBHID", "usbhid"); proto_register_field_array(proto_usb_hid, hf, array_length(hf)); proto_register_subtree_array(usb_hid_subtrees, array_length(usb_hid_subtrees)); /*usb_hid_boot_keyboard_input_report_handle =*/ register_dissector("usbhid.boot_report.keyboard.input", dissect_usb_hid_boot_keyboard_input_report, proto_usb_hid); /*usb_hid_boot_keyboard_output_report_handle =*/ register_dissector("usbhid.boot_report.keyboard.output", dissect_usb_hid_boot_keyboard_output_report, proto_usb_hid); /*usb_hid_boot_mouse_input_report_handle =*/ register_dissector("usbhid.boot_report.mouse.input", dissect_usb_hid_boot_mouse_input_report, proto_usb_hid); } void proto_reg_handoff_usb_hid(void) { dissector_handle_t usb_hid_control_handle, usb_hid_interrupt_handle, usb_hid_descr_handle; usb_hid_control_handle = create_dissector_handle(dissect_usb_hid_control, proto_usb_hid); dissector_add_uint("usb.control", IF_CLASS_HID, usb_hid_control_handle); dissector_add_for_decode_as("usb.device", usb_hid_control_handle); usb_hid_interrupt_handle = create_dissector_handle(dissect_usb_hid_data, proto_usb_hid); dissector_add_uint("usb.interrupt", IF_CLASS_HID, usb_hid_interrupt_handle); usb_hid_descr_handle = create_dissector_handle(dissect_usb_hid_class_descriptors, proto_usb_hid); dissector_add_uint("usb.descriptor", IF_CLASS_HID, usb_hid_descr_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-usb-hid.h
/* packet-usb-hid.h * * USB HID dissector * By Adam Nielsen <[email protected]> 2009 * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_USB_HID_H__ #define __PACKET_USB_HID_H__ int dissect_usb_hid_get_report_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_); #endif
C
wireshark/epan/dissectors/packet-usb-hub.c
/* packet-usb-hub.c * Routines for USB HUB dissection * Copyright 2009, Marton Nemeth <[email protected]> * * USB HUB Specification can be found in the Universal Serial Bus * Specification 2.0, Chapter 11 Hub Specification. * http://www.usb.org/developers/docs/usb_20_052709.zip * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-usb.h" void proto_register_usb_hub(void); void proto_reg_handoff_usb_hub(void); /* protocols and header fields */ static int proto_usb_hub = -1; /* USB 2.0, Chapter 11.24.2 Class-Specific Requests */ static int hf_usb_hub_request = -1; static int hf_usb_hub_value = -1; static int hf_usb_hub_index = -1; static int hf_usb_hub_length = -1; static int hf_usb_hub_hub_feature_selector = -1; static int hf_usb_hub_port_feature_selector = -1; static int hf_usb_hub_dev_addr = -1; static int hf_usb_hub_ep_num = -1; static int hf_usb_hub_descriptor_type = -1; static int hf_usb_hub_descriptor_index = -1; static int hf_usb_hub_zero = -1; static int hf_usb_hub_tt_flags = -1; static int hf_usb_hub_tt_port = -1; static int hf_usb_hub_tt_state_length = -1; static int hf_usb_hub_port = -1; static int hf_usb_hub_port_selector = -1; static int hf_usb_hub_port_status = -1; static int hf_usb_hub_port_change = -1; static int hf_usb_hub_port_status_connection = -1; static int hf_usb_hub_port_status_enable = -1; static int hf_usb_hub_port_status_suspend = -1; static int hf_usb_hub_port_status_overcurrent = -1; static int hf_usb_hub_port_status_reset = -1; static int hf_usb_hub_port_status_power = -1; static int hf_usb_hub_port_status_low_speed = -1; static int hf_usb_hub_port_status_high_speed = -1; static int hf_usb_hub_port_status_test = -1; static int hf_usb_hub_port_status_indicator = -1; static int hf_usb_hub_port_change_connection = -1; static int hf_usb_hub_port_change_enable = -1; static int hf_usb_hub_port_change_suspend = -1; static int hf_usb_hub_port_change_overcurrent = -1; static int hf_usb_hub_port_change_reset = -1; static int hf_usb_hub_descriptor_length = -1; static gint ett_usb_hub_wValue = -1; static gint ett_usb_hub_wIndex = -1; static gint ett_usb_hub_wLength = -1; static gint ett_usb_hub_port_status = -1; static gint ett_usb_hub_port_change = -1; /* Table 11-16. Hub Class Request Codes */ #define USB_HUB_REQUEST_GET_STATUS 0 #define USB_HUB_REQUEST_CLEAR_FEATURE 1 #define USB_HUB_REQUEST_SET_FEATURE 3 #define USB_HUB_REQUEST_GET_DESCRIPTOR 6 #define USB_HUB_REQUEST_SET_DESCRIPTOR 7 #define USB_HUB_REQUEST_CLEAR_TT_BUFFER 8 #define USB_HUB_REQUEST_RESET_TT 9 #define USB_HUB_REQUEST_GET_TT_STATE 10 #define USB_HUB_REQUEST_STOP_TT 11 static const value_string setup_request_names_vals[] = { { USB_HUB_REQUEST_GET_STATUS, "GET_STATUS" }, { USB_HUB_REQUEST_CLEAR_FEATURE, "CLEAR_FEATURE" }, { USB_HUB_REQUEST_SET_FEATURE, "SET_FEATURE" }, { USB_HUB_REQUEST_GET_DESCRIPTOR, "GET_DESCRIPTOR" }, { USB_HUB_REQUEST_SET_DESCRIPTOR, "SET_DESCRIPTOR" }, { USB_HUB_REQUEST_CLEAR_TT_BUFFER, "CLEAR_TT_BUFFER" }, { USB_HUB_REQUEST_GET_TT_STATE, "GET_TT_STATE" }, { USB_HUB_REQUEST_STOP_TT, "STOP_TT" }, { 0, NULL } }; /* Table 11-17 Hub Class Feature Selectors */ #define USB_HUB_FEATURE_C_HUB_LOCAL_POWER 0 #define USB_HUB_FEATURE_C_HUB_OVER_CURRENT 1 #define USB_HUB_FEATURE_PORT_CONNECTION 0 #define USB_HUB_FEATURE_PORT_ENABLE 1 #define USB_HUB_FEATURE_PORT_SUSPEND 2 #define USB_HUB_FEATURE_PORT_OVER_CURRENT 3 #define USB_HUB_FEATURE_PORT_RESET 4 #define USB_HUB_FEATURE_PORT_POWER 8 #define USB_HUB_FEATURE_PORT_LOW_SPEED 9 #define USB_HUB_FEATURE_C_PORT_CONNECTION 16 #define USB_HUB_FEATURE_C_PORT_ENABLE 17 #define USB_HUB_FEATURE_C_PORT_SUSPEND 18 #define USB_HUB_FEATURE_C_PORT_OVER_CURRENT 19 #define USB_HUB_FEATURE_C_PORT_RESET 20 #define USB_HUB_FEATURE_PORT_TEST 21 #define USB_HUB_FEATURE_PORT_INDICATOR 22 /* Table 10-9 Hub Class Feature Selectors (USB3) */ #define USB_HUB_FEATURE_PORT_U1_TIMEOUT 23 #define USB_HUB_FEATURE_PORT_U2_TIMEOUT 24 #define USB_HUB_FEATURE_C_PORT_LINK_STATE 25 #define USB_HUB_FEATURE_C_PORT_CONFIG_ERROR 26 #define USB_HUB_FEATURE_PORT_REMOTE_WAKE_MASK 27 #define USB_HUB_FEATURE_BH_PORT_RESET 28 #define USB_HUB_FEATURE_C_BH_PORT_RESET 29 #define USB_HUB_FEATURE_FORCE_LINKPM_ACCEPT 30 static const value_string hub_class_feature_selectors_recipient_hub_vals[] = { { USB_HUB_FEATURE_C_HUB_LOCAL_POWER, "C_HUB_LOCAL_POWER" }, { USB_HUB_FEATURE_C_HUB_OVER_CURRENT, "C_HUB_OVER_CURRENT" }, { 0, NULL } }; static const value_string hub_class_feature_selectors_recipient_port_vals[] = { { USB_HUB_FEATURE_PORT_CONNECTION, "PORT_CONNECTION" }, { USB_HUB_FEATURE_PORT_ENABLE, "PORT_ENABLE" }, { USB_HUB_FEATURE_PORT_SUSPEND, "PORT_SUSPEND" }, { USB_HUB_FEATURE_PORT_OVER_CURRENT, "PORT_OVER_CURRENT" }, { USB_HUB_FEATURE_PORT_RESET, "PORT_RESET" }, { USB_HUB_FEATURE_PORT_POWER, "PORT_POWER" }, { USB_HUB_FEATURE_PORT_LOW_SPEED, "PORT_LOW_SPEED" }, { USB_HUB_FEATURE_C_PORT_CONNECTION, "C_PORT_CONNECTION" }, { USB_HUB_FEATURE_C_PORT_ENABLE, "C_PORT_ENABLE" }, { USB_HUB_FEATURE_C_PORT_SUSPEND, "C_PORT_SUSPEND" }, { USB_HUB_FEATURE_C_PORT_OVER_CURRENT, "C_PORT_OVER_CURRENT" }, { USB_HUB_FEATURE_C_PORT_RESET, "C_PORT_RESET" }, { USB_HUB_FEATURE_PORT_TEST, "PORT_TEST" }, { USB_HUB_FEATURE_PORT_INDICATOR, "PORT_INDICATOR" }, { USB_HUB_FEATURE_PORT_U1_TIMEOUT, "PORT_U1_TIMEOUT" }, { USB_HUB_FEATURE_PORT_U2_TIMEOUT, "PORT_U2_TIMEOUT" }, { USB_HUB_FEATURE_C_PORT_LINK_STATE, "C_PORT_LINK_STATE" }, { USB_HUB_FEATURE_C_PORT_CONFIG_ERROR, "C_PORT_CONFIG_ERROR" }, { USB_HUB_FEATURE_PORT_REMOTE_WAKE_MASK,"PORT_REMOTE_WAKE_MASK" }, { USB_HUB_FEATURE_BH_PORT_RESET, "BH_PORT_RESET" }, { USB_HUB_FEATURE_C_BH_PORT_RESET, "C_BH_PORT_RESET" }, { USB_HUB_FEATURE_FORCE_LINKPM_ACCEPT, "FORCE_LINKPM_ACCEPT" }, { 0, NULL } }; static const true_false_string hub_port_status_indicator_meaning = { "Software-controlled color", "Default colors" }; /* Dissector for ClearHubFeature, Chapter 11.24.2.1 Clear Hub Feature */ static void dissect_usb_hub_clear_hub_feature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; const gchar* feature_name; feature_name = val_to_str(usb_trans_info->setup.wValue, hub_class_feature_selectors_recipient_hub_vals, "UNKNOWN (0x%x)"); col_append_fstr(pinfo->cinfo, COL_INFO, " [Hub: %s]", feature_name); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_hub_feature_selector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for ClearPortFeature, Chapter 11.24.2.2 Clear Port Feature */ static void dissect_usb_hub_clear_port_feature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; const gchar* feature_name; feature_name = val_to_str(usb_trans_info->setup.wValue, hub_class_feature_selectors_recipient_port_vals, "UNKNOWN (0x%x)"); col_append_fstr(pinfo->cinfo, COL_INFO, " [Port %u: %s]", usb_trans_info->setup.wIndex, feature_name); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_port_feature_selector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_port, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hub_port_selector, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for ClearTTBuffer, Chapter 11.24.2.3 Clear TT Buffer */ static void dissect_usb_hub_clear_tt_buffer(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_ep_num, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hub_dev_addr, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_tt_port, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for GetHubDescriptor, Chapter 11.24.2.5 Get Hub Descriptor */ static void dissect_usb_hub_get_hub_descriptor(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_descriptor_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hub_descriptor_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_descriptor_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for GetHubStatus, Chapter 11.24.2.6 Get Hub Status */ static void dissect_usb_hub_get_hub_status(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; col_append_str(pinfo->cinfo, COL_INFO, " [Hub]"); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /* length shall always contain 4 */ /*offset += 2;*/ } else { } } /* Dissector for GetPortStatus, Chapter 11.24.2.7 Get Port Status */ static void dissect_usb_hub_get_port_status(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; col_append_fstr(pinfo->cinfo, COL_INFO, " [Port %u]", usb_trans_info->setup.wIndex); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_port, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /* length shall always contain 4 */ /*offset += 2;*/ } else { static int * const status_fields[] = { &hf_usb_hub_port_status_connection, &hf_usb_hub_port_status_enable, &hf_usb_hub_port_status_suspend, &hf_usb_hub_port_status_overcurrent, &hf_usb_hub_port_status_reset, &hf_usb_hub_port_status_power, &hf_usb_hub_port_status_low_speed, &hf_usb_hub_port_status_high_speed, &hf_usb_hub_port_status_test, &hf_usb_hub_port_status_indicator, NULL }; static int * const change_fields[] = { &hf_usb_hub_port_change_connection, &hf_usb_hub_port_change_enable, &hf_usb_hub_port_change_suspend, &hf_usb_hub_port_change_overcurrent, &hf_usb_hub_port_change_reset, NULL }; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_hub_port_status, ett_usb_hub_port_status, status_fields, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_hub_port_change, ett_usb_hub_port_change, change_fields, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } } /* Dissector for GetTTState, Chapter 11.24.2.8 Get_TT_State */ static void dissect_usb_hub_get_tt_state(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_tt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_tt_port, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_tt_state_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for ResetTT, Chapter 11.24.2.9 Reset_TT */ static void dissect_usb_hub_reset_tt(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_tt_port, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 1, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for SetHubDescriptor, Chapter 11.24.2.10 Set Hub Descriptor */ static void dissect_usb_hub_set_hub_descriptor(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_descriptor_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hub_descriptor_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_descriptor_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for StopTT, Chapter 11.24.2.11 Stop TT */ static void dissect_usb_hub_stop_tt(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_tt_port, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for SetHubFeature, Chapter 11.24.2.12 Set Hub Feature */ static void dissect_usb_hub_set_hub_feature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; const gchar* feature_name; feature_name = val_to_str(usb_trans_info->setup.wValue, hub_class_feature_selectors_recipient_hub_vals, "UNKNOWN (0x%x)"); col_append_fstr(pinfo->cinfo, COL_INFO, " [Hub: %s]", feature_name); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_hub_feature_selector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wIndex); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } /* Dissector for SetPortFeature, Chapter 11.24.2.13 Set Port Feature */ static void dissect_usb_hub_set_port_feature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info _U_) { proto_item *item = NULL; proto_tree *subtree = NULL; const gchar* feature_name; feature_name = val_to_str(usb_trans_info->setup.wValue, hub_class_feature_selectors_recipient_port_vals, "UNKNOWN (0x%x)"); col_append_fstr(pinfo->cinfo, COL_INFO, " [Port %u: %s]", usb_trans_info->setup.wIndex, feature_name); if (is_request) { item = proto_tree_add_item(tree, hf_usb_hub_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_port_feature_selector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; item = proto_tree_add_item(tree, hf_usb_hub_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wValue); proto_tree_add_item(subtree, hf_usb_hub_port, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(subtree, hf_usb_hub_port_selector, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; item = proto_tree_add_item(tree, hf_usb_hub_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); subtree = proto_item_add_subtree(item, ett_usb_hub_wLength); proto_tree_add_item(subtree, hf_usb_hub_zero, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { } } typedef void (*usb_setup_dissector)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info); typedef struct _usb_setup_dissector_table_t { guint8 request_type; guint8 request; usb_setup_dissector dissector; } usb_setup_dissector_table_t; /* USB 2.0, Table 11-15 Hub Class Requests */ static const usb_setup_dissector_table_t setup_dissectors[] = { { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE, dissect_usb_hub_clear_hub_feature }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE, dissect_usb_hub_clear_port_feature }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_CLEAR_TT_BUFFER, dissect_usb_hub_clear_tt_buffer }, { USB_DIR_IN | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR, dissect_usb_hub_get_hub_descriptor }, { USB_DIR_IN | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_DEVICE, USB_HUB_REQUEST_GET_STATUS, dissect_usb_hub_get_hub_status }, { USB_DIR_IN | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_GET_STATUS, dissect_usb_hub_get_port_status }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_RESET_TT, dissect_usb_hub_reset_tt }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_DEVICE, USB_HUB_REQUEST_SET_DESCRIPTOR, dissect_usb_hub_set_hub_descriptor }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_DEVICE, USB_HUB_REQUEST_SET_FEATURE, dissect_usb_hub_set_hub_feature }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_SET_FEATURE, dissect_usb_hub_set_port_feature }, { USB_DIR_IN | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_GET_TT_STATE, dissect_usb_hub_get_tt_state }, { USB_DIR_OUT | (RQT_SETUP_TYPE_CLASS << 5) | RQT_SETUP_RECIPIENT_OTHER, USB_HUB_REQUEST_STOP_TT, dissect_usb_hub_stop_tt }, { 0, 0, NULL } }; /* Dissector for USB HUB class-specific control request as defined in * USB 2.0, Chapter 11.24.2 Class-specific Requests * Returns tvb_captured_length(tvb) if a class specific dissector was found * and 0 otherwise. */ static gint dissect_usb_hub_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gboolean is_request; usb_conv_info_t *usb_conv_info; usb_trans_info_t *usb_trans_info; int offset = 0; usb_setup_dissector dissector; const usb_setup_dissector_table_t *tmp; /* Reject the packet if data or usb_trans_info are NULL */ if (data == NULL || ((usb_conv_info_t *)data)->usb_trans_info == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; usb_trans_info = usb_conv_info->usb_trans_info; is_request = (pinfo->srcport==NO_ENDPOINT); /* See if we can find a class specific dissector for this request */ dissector = NULL; /* Check valid values for bmRequestType and bRequest */ for (tmp = setup_dissectors; tmp->dissector; tmp++) { if (tmp->request_type == usb_trans_info->setup.requesttype && tmp->request == usb_trans_info->setup.request) { dissector = tmp->dissector; break; } } /* No, we could not find any class specific dissector for this request * return 0 and let USB try any of the standard requests. */ if (!dissector) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBHUB"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"), is_request ? "Request " : "Response"); if (is_request) { proto_tree_add_item(tree, hf_usb_hub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info); return tvb_captured_length(tvb); } void proto_register_usb_hub(void) { static hf_register_info hf[] = { /* USB HUB specific requests */ { &hf_usb_hub_request, { "bRequest", "usbhub.setup.bRequest", FT_UINT8, BASE_HEX, VALS(setup_request_names_vals), 0x0, NULL, HFILL }}, { &hf_usb_hub_value, { "wValue", "usbhub.setup.wValue", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_index, { "wIndex", "usbhub.setup.wIndex", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_length, { "wLength", "usbhub.setup.wLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_hub_feature_selector, { "HubFeatureSelector", "usbhub.setup.HubFeatureSelector", FT_UINT16, BASE_DEC, VALS(hub_class_feature_selectors_recipient_hub_vals), 0x0, NULL, HFILL }}, { &hf_usb_hub_port_feature_selector, { "PortFeatureSelector", "usbhub.setup.PortFeatureSelector", FT_UINT16, BASE_DEC, VALS(hub_class_feature_selectors_recipient_port_vals), 0x0, NULL, HFILL }}, { &hf_usb_hub_dev_addr, { "Dev_Addr", "usbhub.setup.Dev_Addr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_ep_num, { "EP_Num", "usbhub.setup.EP_Num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_descriptor_type, { "DescriptorType", "usbhub.setup.DescriptorType", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_descriptor_index, { "DescriptorIndex", "usbhub.setup.DescriptorIndex", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_descriptor_length, { "DescriptorLength", "usbhub.setup.DescriptorLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_zero, { "(zero)", "usbhub.setup.zero", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_tt_flags, { "TT_Flags", "usbhub.setup.TT_Flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_tt_port, { "TT_Port", "usbhub.setup.TT_Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_tt_state_length, { "TT State Length", "usbhub.setup.TT_StateLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_port_selector, { "PortSelector", "usbhub.setup.PortSelector", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_port, { "Port", "usbhub.setup.Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_hub_port_status, { "Port Status", "usbhub.status.port", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hub_port_change, { "Port Change", "usbhub.change.port", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_usb_hub_port_status_connection, { "PORT_CONNECTION", "usbhub.status.port.connection", FT_BOOLEAN, 16, NULL, (1<<0), NULL, HFILL }}, { &hf_usb_hub_port_status_enable, { "PORT_ENABLE", "usbhub.status.port.enable", FT_BOOLEAN, 16, NULL, (1<<1), NULL, HFILL }}, { &hf_usb_hub_port_status_suspend, { "PORT_SUSPEND", "usbhub.status.port.suspend", FT_BOOLEAN, 16, NULL, (1<<2), NULL, HFILL }}, { &hf_usb_hub_port_status_overcurrent, { "PORT_OVER_CURRENT", "usbhub.status.port.overcurrent", FT_BOOLEAN, 16, NULL, (1<<3), NULL, HFILL }}, { &hf_usb_hub_port_status_reset, { "PORT_RESET", "usbhub.status.port.reset", FT_BOOLEAN, 16, NULL, (1<<4), NULL, HFILL }}, { &hf_usb_hub_port_status_power, { "PORT_POWER", "usbhub.status.port.power", FT_BOOLEAN, 16, NULL, (1<<8), NULL, HFILL }}, { &hf_usb_hub_port_status_low_speed, { "PORT_LOW_SPEED", "usbhub.status.port.low_speed", FT_BOOLEAN, 16, NULL, (1<<9), NULL, HFILL }}, { &hf_usb_hub_port_status_high_speed, { "PORT_HIGH_SPEED", "usbhub.status.port.high_speed", FT_BOOLEAN, 16, NULL, (1<<10), NULL, HFILL }}, { &hf_usb_hub_port_status_test, { "PORT_TEST", "usbhub.status.port.test", FT_BOOLEAN, 16, NULL, (1<<11), NULL, HFILL }}, { &hf_usb_hub_port_status_indicator, { "PORT_INDICATOR", "usbhub.status.port.indicator", FT_BOOLEAN, 16, TFS(&hub_port_status_indicator_meaning), (1<<12), NULL, HFILL }}, { &hf_usb_hub_port_change_connection, { "C_PORT_CONNECTION", "usbhub.change.port.connection", FT_BOOLEAN, 16, NULL, (1<<0), NULL, HFILL }}, { &hf_usb_hub_port_change_enable, { "C_PORT_ENABLE", "usbhub.change.port.enable", FT_BOOLEAN, 16, NULL, (1<<1), NULL, HFILL }}, { &hf_usb_hub_port_change_suspend, { "C_PORT_SUSPEND", "usbhub.status.port.suspend", FT_BOOLEAN, 16, NULL, (1<<2), NULL, HFILL }}, { &hf_usb_hub_port_change_overcurrent, { "C_PORT_OVER_CURRENT", "usbhub.status.port.overcurrent", FT_BOOLEAN, 16, NULL, (1<<3), NULL, HFILL }}, { &hf_usb_hub_port_change_reset, { "C_PORT_RESET", "usbhub.status.port.reset", FT_BOOLEAN, 16, NULL, (1<<4), NULL, HFILL }} }; static gint *usb_hub_subtrees[] = { &ett_usb_hub_wValue, &ett_usb_hub_wIndex, &ett_usb_hub_wLength, &ett_usb_hub_port_status, &ett_usb_hub_port_change }; proto_usb_hub = proto_register_protocol("USB HUB", "USBHUB", "usbhub"); proto_register_field_array(proto_usb_hub, hf, array_length(hf)); proto_register_subtree_array(usb_hub_subtrees, array_length(usb_hub_subtrees)); } void proto_reg_handoff_usb_hub(void) { dissector_handle_t usb_hub_control_handle; usb_hub_control_handle = create_dissector_handle(dissect_usb_hub_control, proto_usb_hub); dissector_add_uint("usb.control", IF_CLASS_HUB, usb_hub_control_handle); dissector_add_uint("usb.control", IF_CLASS_UNKNOWN, usb_hub_control_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-usb-i1d3.c
/* packet-usb-i1d3.c * Dissects the X-Rite i1 Display Pro (and derivatives) USB protocol * Copyright 2016, Etienne Dechamps <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This code dissects the USB protocol used for communicating with a * X-Rite i1 Display Pro colorimeter, as well as similar hardware such * as ColorMunki Display. * * Note that this protocol is proprietary and no public specification * exists. This code is largely based on Graeme Gill's reverse * engineering work for ArgyllCMS (see spectro/i1d3.c in the ArgyllCMS * source code). * * Because some aspects of the protocol are not yet fully understood, * this dissector might fail to properly parse some packets, especially * in unusual scenarios such as error conditions and the like. */ #include <config.h> #include <epan/conversation.h> #include <epan/packet.h> #include <epan/expert.h> void proto_register_usb_i1d3(void); void proto_reg_handoff_usb_i1d3(void); #define USB_I1D3_PACKET_LENGTH (64) #define USB_I1D3_CLOCK_FREQUENCY (12e6) // 12 MHz #define USB_I1D3_LED_OFFTIME_FACTOR (USB_I1D3_CLOCK_FREQUENCY / (1 << 19)) #define USB_I1D3_LED_ONTIME_FACTOR (USB_I1D3_CLOCK_FREQUENCY / (1 << 19)) #define USB_I1D3_LED_ONTIME_FADE_FACTOR (USB_I1D3_CLOCK_FREQUENCY / (1 << 23)) static int proto_usb_i1d3 = -1; static int ett_usb_i1d3 = -1; static int ett_usb_i1d3_measured_duration = -1; static int ett_usb_i1d3_requested_edge_count = -1; static int hf_usb_i1d3_challenge_response = -1; static int hf_usb_i1d3_challenge_data = -1; static int hf_usb_i1d3_challenge_decode_key = -1; static int hf_usb_i1d3_challenge_encode_key = -1; static int hf_usb_i1d3_command_code = -1; static int hf_usb_i1d3_diffuser_position = -1; static int hf_usb_i1d3_echoed_command_code = -1; static int hf_usb_i1d3_firmdate = -1; static int hf_usb_i1d3_firmver = -1; static int hf_usb_i1d3_information = -1; static int hf_usb_i1d3_measured_duration = -1; static int hf_usb_i1d3_measured_duration_red = -1; static int hf_usb_i1d3_measured_duration_green = -1; static int hf_usb_i1d3_measured_duration_blue = -1; static int hf_usb_i1d3_measured_edge_count = -1; static int hf_usb_i1d3_measured_edge_count_red = -1; static int hf_usb_i1d3_measured_edge_count_green = -1; static int hf_usb_i1d3_measured_edge_count_blue = -1; static int hf_usb_i1d3_led_mode = -1; static int hf_usb_i1d3_led_offtime = -1; static int hf_usb_i1d3_led_ontime = -1; static int hf_usb_i1d3_led_pulse_count = -1; static int hf_usb_i1d3_locked = -1; static int hf_usb_i1d3_prodname = -1; static int hf_usb_i1d3_prodtype = -1; static int hf_usb_i1d3_request_in = -1; static int hf_usb_i1d3_requested_edge_count = -1; static int hf_usb_i1d3_requested_edge_count_red = -1; static int hf_usb_i1d3_requested_edge_count_green = -1; static int hf_usb_i1d3_requested_edge_count_blue = -1; static int hf_usb_i1d3_requested_integration_time = -1; static int hf_usb_i1d3_response_code = -1; static int hf_usb_i1d3_response_in = -1; static int hf_usb_i1d3_readextee_data = -1; static int hf_usb_i1d3_readextee_offset = -1; static int hf_usb_i1d3_readextee_length = -1; static int hf_usb_i1d3_readintee_data = -1; static int hf_usb_i1d3_readintee_offset = -1; static int hf_usb_i1d3_readintee_length = -1; static int hf_usb_i1d3_status = -1; static int hf_usb_i1d3_unlock_result = -1; static expert_field ei_usb_i1d3_echoed_command_code_mismatch = EI_INIT; static expert_field ei_usb_i1d3_error = EI_INIT; static expert_field ei_usb_i1d3_unexpected_response = EI_INIT; static expert_field ei_usb_i1d3_unknown_command = EI_INIT; static expert_field ei_usb_i1d3_unknown_diffuser_position = EI_INIT; static expert_field ei_usb_i1d3_unlock_failed = EI_INIT; static expert_field ei_usb_i1d3_unusual_length = EI_INIT; // Derived from ArgyllCMS spectro/i1d3.c. typedef enum _usb_i1d3_command_code { USB_I1D3_GET_INFO = 0x0000, USB_I1D3_STATUS = 0x0001, USB_I1D3_PRODNAME = 0x0010, USB_I1D3_PRODTYPE = 0x0011, USB_I1D3_FIRMVER = 0x0012, USB_I1D3_FIRMDATE = 0x0013, USB_I1D3_LOCKED = 0x0020, USB_I1D3_MEASURE1 = 0x0100, USB_I1D3_MEASURE2 = 0x0200, USB_I1D3_READINTEE = 0x0800, USB_I1D3_READEXTEE = 0x1200, USB_I1D3_SETLED = 0x2100, USB_I1D3_RD_SENSOR = 0x9300, USB_I1D3_GET_DIFF = 0x9400, USB_I1D3_LOCKCHAL = 0x9900, USB_I1D3_LOCKRESP = 0x9a00, USB_I1D3_RELOCK = 0x9b00, } usb_i1d3_command_code; static const value_string usb_i1d3_command_code_strings[] = { {USB_I1D3_GET_INFO, "Get information"}, {USB_I1D3_STATUS, "Get status"}, {USB_I1D3_PRODNAME, "Get product name"}, {USB_I1D3_PRODTYPE, "Get product type"}, {USB_I1D3_FIRMVER, "Get firmware version"}, {USB_I1D3_FIRMDATE, "Get firmware date"}, {USB_I1D3_LOCKED, "Get locked status"}, {USB_I1D3_MEASURE1, "Make measurement (fixed integration time)"}, {USB_I1D3_MEASURE2, "Make measurement (fixed edge count)"}, {USB_I1D3_READINTEE, "Read internal EEPROM"}, {USB_I1D3_READEXTEE, "Read external EEPROM"}, {USB_I1D3_SETLED, "Set LED state"}, {USB_I1D3_RD_SENSOR, "Read analog sensor"}, {USB_I1D3_GET_DIFF, "Get diffuser position"}, {USB_I1D3_LOCKCHAL, "Request lock challenge"}, {USB_I1D3_LOCKRESP, "Unlock"}, {USB_I1D3_RELOCK, "Relock"}, {0, NULL} }; typedef enum _usb_i1d3_led_mode { USB_I1D3_LED_BLINK = 1, USB_I1D3_LED_BLINK_FADE_ON = 3, } usb_i1d3_led_mode; static const value_string usb_i1d3_led_mode_strings[] = { {USB_I1D3_LED_BLINK, "Blink"}, {USB_I1D3_LED_BLINK_FADE_ON, "Blink, fade on"}, {0, NULL} }; typedef enum _usb_i1d3_diffuser_position { USB_I1D3_DIFFUSER_DISPLAY = 0, USB_I1D3_DIFFUSER_AMBIENT = 1, } usb_i1d3_diffuser_position; static const value_string usb_i1d3_diffuser_position_strings[] = { {USB_I1D3_DIFFUSER_DISPLAY, "Display"}, {USB_I1D3_DIFFUSER_AMBIENT, "Ambient"}, {0, NULL} }; typedef struct _usb_i1d3_transaction_t { guint32 request; guint32 response; guint32 command_code; guint32 offset; guint32 length; } usb_i1d3_transaction_t; typedef struct _usb_i1d3_conversation_t { wmem_map_t *request_to_transaction; wmem_map_t *response_to_transaction; guint32 previous_packet; } usb_i1d3_conversation_t; static const unit_name_string units_cycle_cycles = { " cycle", " cycles" }; static const unit_name_string units_edge_edges = { " edge", " edges" }; static const unit_name_string units_pulse_pulses = { " pulse", " pulses" }; static usb_i1d3_conversation_t *usb_i1d3_get_conversation(packet_info *pinfo) { conversation_t *conversation = find_or_create_conversation(pinfo); usb_i1d3_conversation_t* i1d3_conversation = (usb_i1d3_conversation_t *)conversation_get_proto_data( conversation, proto_usb_i1d3); if (!i1d3_conversation) { i1d3_conversation = wmem_new0( wmem_file_scope(), usb_i1d3_conversation_t); i1d3_conversation->request_to_transaction = wmem_map_new( wmem_file_scope(), g_direct_hash, g_direct_equal); i1d3_conversation->response_to_transaction = wmem_map_new( wmem_file_scope(), g_direct_hash, g_direct_equal); conversation_add_proto_data( conversation, proto_usb_i1d3, i1d3_conversation); } return i1d3_conversation; } static usb_i1d3_transaction_t *usb_i1d3_create_transaction( usb_i1d3_conversation_t *conversation, guint32 request) { usb_i1d3_transaction_t *transaction = wmem_new0( wmem_file_scope(), usb_i1d3_transaction_t); transaction->request = request; wmem_map_insert( conversation->request_to_transaction, GUINT_TO_POINTER(transaction->request), (void *)transaction); return transaction; } static void dissect_usb_i1d3_command( tvbuff_t *tvb, packet_info *pinfo, usb_i1d3_conversation_t *conversation, proto_tree *tree) { // Parsing the command code is a bit tricky: if the most significant // byte is non-zero, the command code is the most significant byte, // *and* the next byte is the first byte of the payload. guint32 command_code = tvb_get_ntohs(tvb, 0); guint32 command_code_msb = command_code & 0xff00; gint command_code_length = 2; if (command_code_msb) { command_code = command_code_msb; command_code_length = 1; } proto_item *command_code_item = proto_tree_add_uint( tree, hf_usb_i1d3_command_code, tvb, 0, command_code_length, command_code); usb_i1d3_transaction_t *transaction; if (!PINFO_FD_VISITED(pinfo)) { transaction = usb_i1d3_create_transaction(conversation, pinfo->num); transaction->command_code = command_code; } else { transaction = (usb_i1d3_transaction_t *)wmem_map_lookup( conversation->request_to_transaction, GUINT_TO_POINTER(pinfo->num)); } DISSECTOR_ASSERT(transaction); if (transaction->response != 0) { proto_item *response_item = proto_tree_add_uint( tree, hf_usb_i1d3_response_in, tvb, 0, 0, transaction->response); proto_item_set_generated(response_item); } const gchar *command_code_string = try_val_to_str( command_code, usb_i1d3_command_code_strings); if (command_code_string) { col_set_str(pinfo->cinfo, COL_INFO, command_code_string); } else { expert_add_info(pinfo, command_code_item, &ei_usb_i1d3_unknown_command); col_set_str(pinfo->cinfo, COL_INFO, "Unknown command"); } switch (command_code) { case USB_I1D3_LOCKRESP: { // TODO: verify that the challenge response is correct proto_tree_add_item( tree, hf_usb_i1d3_challenge_response, tvb, 24, 16, ENC_NA); break; } case USB_I1D3_READINTEE: { guint32 offset, length; proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_readintee_offset, tvb, 1, 1, ENC_NA, &offset); proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_readintee_length, tvb, 2, 1, ENC_NA, &length); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (offset: %u, length: %u)", command_code_string, offset, length); if (!PINFO_FD_VISITED(pinfo)) { transaction->offset = offset; transaction->length = length; } break; } case USB_I1D3_READEXTEE: { guint32 offset, length; proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_readextee_offset, tvb, 1, 2, ENC_BIG_ENDIAN, &offset); proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_readextee_length, tvb, 3, 1, ENC_NA, &length); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (offset: %u, length: %u)", command_code_string, offset, length); if (!PINFO_FD_VISITED(pinfo)) { transaction->offset = offset; transaction->length = length; } break; } case USB_I1D3_MEASURE1: { guint32 integration_time; proto_item *integration_time_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_requested_integration_time, tvb, 1, 4, ENC_LITTLE_ENDIAN, &integration_time); double integration_time_seconds = integration_time / USB_I1D3_CLOCK_FREQUENCY; proto_item_append_text( integration_time_item, " [%.6f seconds]", integration_time_seconds); col_add_fstr(pinfo->cinfo, COL_INFO, "Measure for %.6fs", integration_time_seconds); break; } case USB_I1D3_MEASURE2: { proto_item *edge_count_item = proto_tree_add_item( tree, hf_usb_i1d3_requested_edge_count, tvb, 1, 6, ENC_NA); proto_tree *edge_count_tree = proto_item_add_subtree( edge_count_item, ett_usb_i1d3_requested_edge_count); guint32 edge_count_red, edge_count_green, edge_count_blue; proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_requested_edge_count_red, tvb, 1, 2, ENC_LITTLE_ENDIAN, &edge_count_red); proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_requested_edge_count_green, tvb, 3, 2, ENC_LITTLE_ENDIAN, &edge_count_green); proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_requested_edge_count_blue, tvb, 5, 2, ENC_LITTLE_ENDIAN, &edge_count_blue); proto_item_append_text( edge_count_item, ": R%u G%u B%u", edge_count_red, edge_count_green, edge_count_blue); col_add_fstr(pinfo->cinfo, COL_INFO, "Measure R%u G%u B%u edges", edge_count_red, edge_count_green, edge_count_blue); break; } case USB_I1D3_SETLED: { guint32 led_mode, led_offtime, led_ontime, pulse_count; proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_led_mode, tvb, 1, 1, ENC_NA, &led_mode); proto_item *led_offtime_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_led_offtime, tvb, 2, 1, ENC_NA, &led_offtime); double led_offtime_seconds = led_offtime / USB_I1D3_LED_OFFTIME_FACTOR; proto_item_append_text( led_offtime_item, " [%.6f seconds]", led_offtime_seconds); proto_item *led_ontime_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_led_ontime, tvb, 3, 1, ENC_NA, &led_ontime); double led_ontime_seconds = led_ontime / ((led_mode == USB_I1D3_LED_BLINK) ? USB_I1D3_LED_ONTIME_FACTOR : USB_I1D3_LED_ONTIME_FADE_FACTOR); proto_item_append_text( led_ontime_item, " [%.6f seconds]", led_ontime_seconds); proto_item *pulse_count_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_led_pulse_count, tvb, 4, 1, ENC_NA, &pulse_count); if (pulse_count == 0x80) { proto_item_append_text(pulse_count_item, " [infinity]"); col_add_fstr(pinfo->cinfo, COL_INFO, "Pulse LED off (%.6fs) and on (%.6fs%s) " "indefinitely", led_offtime_seconds, led_ontime_seconds, (led_mode == USB_I1D3_LED_BLINK_FADE_ON) ? " fading" : ""); } else { col_add_fstr(pinfo->cinfo, COL_INFO, "Pulse LED off (%.6fs) and on (%.6fs%s) " "%u times", led_offtime_seconds, led_ontime_seconds, (led_mode == USB_I1D3_LED_BLINK_FADE_ON) ? " fading" : "", pulse_count); } } } } static void dissect_usb_i1d3_response( tvbuff_t *tvb, packet_info *pinfo, usb_i1d3_conversation_t *conversation, proto_tree *tree) { // The response packet does not contain any information about the command // it is a response to, so we need to reconstruct this information using the // previous packet that we saw. // // Note: currently, for simplicity's sake, this assumes that there is only // one inflight request at any given time - in other words, that there is no // pipelining going on. It is not clear if the device would even be able to // service more than one request at the same time in the first place. usb_i1d3_transaction_t *transaction; if (!PINFO_FD_VISITED(pinfo)) { transaction = (usb_i1d3_transaction_t *)wmem_map_lookup( conversation->request_to_transaction, GUINT_TO_POINTER(conversation->previous_packet)); if (transaction) { DISSECTOR_ASSERT(transaction->response == 0); transaction->response = pinfo->num; wmem_map_insert( conversation->response_to_transaction, GUINT_TO_POINTER(transaction->response), (void *)transaction); } } else { // After the first pass, we can't use previous_packet anymore since // there is no guarantee the dissector is called in order, so we use // the reverse mapping that we populated above. transaction = (usb_i1d3_transaction_t *)wmem_map_lookup( conversation->response_to_transaction, GUINT_TO_POINTER(pinfo->num)); } if (transaction) { DISSECTOR_ASSERT(transaction->response == pinfo->num); DISSECTOR_ASSERT(transaction->request != 0); } proto_item *request_item = proto_tree_add_uint( tree, hf_usb_i1d3_request_in, tvb, 0, 0, transaction ? transaction->request : 0); proto_item_set_generated(request_item); if (!transaction) { expert_add_info(pinfo, request_item, &ei_usb_i1d3_unexpected_response); } else { proto_item *command_code_item = proto_tree_add_uint( tree, hf_usb_i1d3_command_code, tvb, 0, 0, transaction->command_code); proto_item_set_generated(command_code_item); } const gchar *command_string = transaction ? try_val_to_str( transaction->command_code, usb_i1d3_command_code_strings) : NULL; if (!command_string) command_string = "unknown"; guint32 response_code; proto_item *response_code_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_response_code, tvb, 0, 1, ENC_NA, &response_code); proto_item_append_text( response_code_item, " (%s)", (response_code == 0) ? "OK" : "error"); if (response_code != 0) { col_add_fstr( pinfo->cinfo, COL_INFO, "Error code %u (%s)", response_code, command_string); expert_add_info(pinfo, response_code_item, &ei_usb_i1d3_error); return; } col_add_fstr(pinfo->cinfo, COL_INFO, "OK (%s)", command_string); if (!transaction) return; // As mentioned in ArgyllCMS spectro/i1d3.c, the second byte is usually the // first byte of the command code, except for GET_DIFF. if (transaction->command_code != USB_I1D3_GET_DIFF) { guint32 echoed_command_code; proto_item *echoed_command_code_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_echoed_command_code, tvb, 1, 1, ENC_NA, &echoed_command_code); guint8 expected_command_code = transaction->command_code >> 8; proto_item_append_text( echoed_command_code_item, " [expected 0x%02x]", expected_command_code); if (echoed_command_code != expected_command_code) { expert_add_info( pinfo, echoed_command_code_item, &ei_usb_i1d3_echoed_command_code_mismatch); } } switch (transaction->command_code) { case USB_I1D3_GET_INFO: { const guint8 *information; proto_tree_add_item_ret_string( tree, hf_usb_i1d3_information, tvb, 2, -1, ENC_ASCII | ENC_NA, pinfo->pool, &information); col_add_fstr( pinfo->cinfo, COL_INFO, "Information: %s", information); break; } case USB_I1D3_STATUS: { guint32 status; proto_item *status_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_status, tvb, 2, 3, ENC_BIG_ENDIAN, &status); const gchar *status_string = ((status & 0xff00ff) != 0 || (status & 0x00ff00) >= 5) ? "OK" : "Bad"; proto_item_append_text(status_item, " [%s]", status_string); col_add_fstr( pinfo->cinfo, COL_INFO, "Status: 0x%06x (%s)", status, status_string); break; } case USB_I1D3_PRODNAME: { const guint8 *prodname; proto_tree_add_item_ret_string( tree, hf_usb_i1d3_prodname, tvb, 2, -1, ENC_ASCII | ENC_NA, pinfo->pool, &prodname); col_add_fstr(pinfo->cinfo, COL_INFO, "Product name: %s", prodname); break; } case USB_I1D3_PRODTYPE: { guint32 prodtype; proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_prodtype, tvb, 3, 2, ENC_BIG_ENDIAN, &prodtype); col_add_fstr( pinfo->cinfo, COL_INFO, "Product type: 0x%04x", prodtype); break; } case USB_I1D3_FIRMVER: { const guint8 *firmver; proto_tree_add_item_ret_string( tree, hf_usb_i1d3_firmver, tvb, 2, -1, ENC_ASCII | ENC_NA, pinfo->pool, &firmver); col_add_fstr( pinfo->cinfo, COL_INFO, "Firmware version: %s", firmver); break; } case USB_I1D3_FIRMDATE: { const guint8 *firmdate; proto_tree_add_item_ret_string( tree, hf_usb_i1d3_firmdate, tvb, 2, -1, ENC_ASCII | ENC_NA, pinfo->pool, &firmdate); col_add_fstr(pinfo->cinfo, COL_INFO, "Firmware date: %s", firmdate); break; } case USB_I1D3_LOCKED: { guint32 locked; proto_item *locked_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_locked, tvb, 2, 2, ENC_BIG_ENDIAN, &locked); const gchar *locked_string = ((locked & 0xff00) != 0 || (locked & 0x00ff) == 0) ? "Unlocked" : "Locked"; proto_item_append_text(locked_item, " [%s]", locked_string); col_add_fstr( pinfo->cinfo, COL_INFO, "Locked status: 0x%04x (%s)", locked, locked_string); break; } case USB_I1D3_MEASURE1: { proto_item *edge_count_item = proto_tree_add_item( tree, hf_usb_i1d3_measured_edge_count, tvb, 2, 12, ENC_NA); proto_tree *edge_count_tree = proto_item_add_subtree( edge_count_item, ett_usb_i1d3_requested_edge_count); guint32 edge_count_red, edge_count_green, edge_count_blue; proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_measured_edge_count_red, tvb, 2, 4, ENC_LITTLE_ENDIAN, &edge_count_red); proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_measured_edge_count_green, tvb, 6, 4, ENC_LITTLE_ENDIAN, &edge_count_green); proto_tree_add_item_ret_uint( edge_count_tree, hf_usb_i1d3_measured_edge_count_blue, tvb, 10, 4, ENC_LITTLE_ENDIAN, &edge_count_blue); proto_item_append_text( edge_count_item, ": R%u G%u B%u", edge_count_red, edge_count_green, edge_count_blue); col_add_fstr(pinfo->cinfo, COL_INFO, "Measured R%u G%u B%u edges", edge_count_red, edge_count_green, edge_count_blue); break; } case USB_I1D3_MEASURE2: { proto_item *duration_item = proto_tree_add_item( tree, hf_usb_i1d3_measured_duration, tvb, 2, 12, ENC_NA); proto_tree *duration_tree = proto_item_add_subtree( duration_item, ett_usb_i1d3_measured_duration); guint32 duration_red, duration_green, duration_blue; proto_item *duration_red_item = proto_tree_add_item_ret_uint( duration_tree, hf_usb_i1d3_measured_duration_red, tvb, 2, 4, ENC_LITTLE_ENDIAN, &duration_red); double duration_red_seconds = duration_red / USB_I1D3_CLOCK_FREQUENCY; proto_item_append_text( duration_red_item, " [%.6f seconds]", duration_red_seconds); proto_item *duration_green_item = proto_tree_add_item_ret_uint( duration_tree, hf_usb_i1d3_measured_duration_green, tvb, 6, 4, ENC_LITTLE_ENDIAN, &duration_green); double duration_green_seconds = duration_green / USB_I1D3_CLOCK_FREQUENCY; proto_item_append_text( duration_green_item, " [%.6f seconds]", duration_green_seconds); proto_item *duration_blue_item = proto_tree_add_item_ret_uint( duration_tree, hf_usb_i1d3_measured_duration_blue, tvb, 10, 4, ENC_LITTLE_ENDIAN, &duration_blue); double duration_blue_seconds = duration_blue / USB_I1D3_CLOCK_FREQUENCY; proto_item_append_text( duration_blue_item, " [%.6f seconds]", duration_blue_seconds); proto_item_append_text( duration_item, ": R%.6fs G%.6fs B%.6fs", duration_red_seconds, duration_green_seconds, duration_blue_seconds); col_add_fstr(pinfo->cinfo, COL_INFO, "Measured R%.6fs G%.6fs B%.6fs", duration_red_seconds, duration_green_seconds, duration_blue_seconds); break; } case USB_I1D3_READINTEE: { proto_item *offset_item = proto_tree_add_uint( tree, hf_usb_i1d3_readintee_offset, tvb, 0, 0, transaction->offset); proto_item_set_generated(offset_item); proto_item *length_item = proto_tree_add_uint( tree, hf_usb_i1d3_readintee_length, tvb, 0, 0, transaction->length); proto_item_set_generated(length_item); proto_tree_add_item( tree, hf_usb_i1d3_readintee_data, tvb, 4, transaction->length, ENC_NA); col_add_fstr( pinfo->cinfo, COL_INFO, "Internal EEPROM data (offset: %u, length: %u)", transaction->offset, transaction->length); break; } case USB_I1D3_READEXTEE: { proto_item *offset_item = proto_tree_add_uint( tree, hf_usb_i1d3_readextee_offset, tvb, 0, 0, transaction->offset); proto_item_set_generated(offset_item); proto_item *length_item = proto_tree_add_uint( tree, hf_usb_i1d3_readextee_length, tvb, 0, 0, transaction->length); proto_item_set_generated(length_item); proto_tree_add_item( tree, hf_usb_i1d3_readextee_data, tvb, 5, transaction->length, ENC_NA); col_add_fstr( pinfo->cinfo, COL_INFO, "External EEPROM data (offset: %u, length: %u)", transaction->offset, transaction->length); break; } case USB_I1D3_GET_DIFF: { guint32 diffuser_position; proto_item *diffuser_position_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_diffuser_position, tvb, 1, 1, ENC_NA, &diffuser_position); const char *diffuser_position_string = try_val_to_str( diffuser_position, usb_i1d3_diffuser_position_strings); if (!diffuser_position_string) { expert_add_info( pinfo, diffuser_position_item, &ei_usb_i1d3_unknown_diffuser_position); } col_add_fstr( pinfo->cinfo, COL_INFO, "Diffuser position: %s", diffuser_position_string ? diffuser_position_string : "unknown"); break; } case USB_I1D3_LOCKCHAL: { proto_tree_add_item( tree, hf_usb_i1d3_challenge_encode_key, tvb, 2, 1, ENC_NA); proto_tree_add_item( tree, hf_usb_i1d3_challenge_decode_key, tvb, 3, 1, ENC_NA); proto_tree_add_item( tree, hf_usb_i1d3_challenge_data, tvb, 35, 8, ENC_NA); break; } case USB_I1D3_LOCKRESP: { guint32 unlock_result; proto_item *unlock_result_item = proto_tree_add_item_ret_uint( tree, hf_usb_i1d3_unlock_result, tvb, 2, 1, ENC_NA, &unlock_result); int unlock_successful = unlock_result == 0x77; const gchar *unlock_result_string = unlock_successful ? "Successfully unlocked" : "Failed to unlock"; proto_item_append_text( unlock_result_item, " [%s]", unlock_result_string); if (!unlock_successful) { expert_add_info( pinfo, unlock_result_item, &ei_usb_i1d3_unlock_failed); } col_add_fstr(pinfo->cinfo, COL_INFO, "%s", unlock_result_string); break; } } } static int dissect_usb_i1d3( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if ((pinfo->p2p_dir == P2P_DIR_SENT && pinfo->destport == 0) || (pinfo->p2p_dir == P2P_DIR_RECV && pinfo->srcport == 0)) { // The device describes itself as HID class, even though the actual // protocol doesn't seem to be based on HID at all. However that means // the device will receive (and respond) to some basic HID requests, // such as GET_DESCRIPTOR. These HID requests will go to endpoint 0, // while actual communication takes place on endpoint 1. Therefore, if // we get handed a packet going to/from endpoint 0, reject it and let // the HID dissector handle it. return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "i1d3"); proto_item *usb_i1d3_item = proto_tree_add_item( tree, proto_usb_i1d3, tvb, 0, -1, ENC_NA); proto_tree *usb_i1d3_tree = proto_item_add_subtree( usb_i1d3_item, ett_usb_i1d3); // All i1d3 packets seen in the while are fixed-length, with padding added // as necessary. It is not clear if using a different length is valid or // not. if (tvb_reported_length(tvb) != USB_I1D3_PACKET_LENGTH) { expert_add_info(pinfo, usb_i1d3_item, &ei_usb_i1d3_unusual_length); } col_clear(pinfo->cinfo, COL_INFO); usb_i1d3_conversation_t *conversation = usb_i1d3_get_conversation(pinfo); if (pinfo->p2p_dir == P2P_DIR_SENT) { dissect_usb_i1d3_command(tvb, pinfo, conversation, usb_i1d3_tree); } else if (pinfo->p2p_dir == P2P_DIR_RECV) { dissect_usb_i1d3_response(tvb, pinfo, conversation, usb_i1d3_tree); } else { DISSECTOR_ASSERT(0); } conversation->previous_packet = pinfo->num; return tvb_captured_length(tvb); } void proto_register_usb_i1d3(void) { proto_usb_i1d3 = proto_register_protocol( "X-Rite i1 Display Pro (and derivatives) USB protocol", "X-Rite i1 Display Pro", "i1d3"); static gint *ett[] = { &ett_usb_i1d3, &ett_usb_i1d3_measured_duration, &ett_usb_i1d3_requested_edge_count, }; static hf_register_info hf[] = { { &hf_usb_i1d3_challenge_response, { "Challenge response", "i1d3.challenge_response", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_challenge_data, { "Challenge data", "i1d3.challenge_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_challenge_decode_key, { "Challenge decode XOR value", "i1d3.challenge_decode_key", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_challenge_encode_key, { "Challenge encode XOR value", "i1d3.challenge_encode_key", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_command_code, { "Command code", "i1d3.command.code", FT_UINT16, BASE_HEX, VALS(usb_i1d3_command_code_strings), 0, NULL, HFILL }, }, { &hf_usb_i1d3_diffuser_position, { "Diffuser position", "i1d3.diffuser_position", FT_UINT8, BASE_DEC, VALS(usb_i1d3_diffuser_position_strings), 0, NULL, HFILL }, }, { &hf_usb_i1d3_echoed_command_code, { "Echoed command code", "i1d3.echoed_command.code", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_firmdate, { "Firmware date", "i1d3.firmdate", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_firmver, { "Firmware version", "i1d3.firmver", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_information, { "Information", "i1d3.information", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_duration, { "Measured duration", "i1d3.measured_duration", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_duration_red, { "Red channel", "i1d3.measured_duration.red", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_cycle_cycles, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_duration_green, { "Green channel", "i1d3.measured_duration.green", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_cycle_cycles, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_duration_blue, { "Blue channel", "i1d3.measured_duration.blue", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_cycle_cycles, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_edge_count, { "Measured edge count", "i1d3.measured_edge_count", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_edge_count_red, { "Red channel", "i1d3.measured_edge_count.red", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_edge_count_green, { "Green channel", "i1d3.measured_edge_count.green", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_measured_edge_count_blue, { "Blue channel", "i1d3.measured_edge_count.blue", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_led_mode, { "LED mode", "i1d3.led_mode", FT_UINT8, BASE_DEC, VALS(usb_i1d3_led_mode_strings), 0, NULL, HFILL }, }, { &hf_usb_i1d3_led_offtime, { "LED off time", "i1d3.led_offtime", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_led_ontime, { "LED on time", "i1d3.led_ontime", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_led_pulse_count, { "LED pulse count", "i1d3.led_pulse_count", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_pulse_pulses, 0, NULL, HFILL }, }, { &hf_usb_i1d3_locked, { "Lock status", "i1d3.locked", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_prodname, { "Product name", "i1d3.prodname", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_prodtype, { "Product type", "i1d3.prodtype", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_request_in, { "Request in frame", "i1d3.request_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0, NULL, HFILL } }, { &hf_usb_i1d3_requested_edge_count, { "Requested edge count", "i1d3.requested_edge_count", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_requested_edge_count_red, { "Red channel", "i1d3.requested_edge_count.red", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_requested_edge_count_green, { "Green channel", "i1d3.requested_edge_count.green", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_requested_edge_count_blue, { "Blue channel", "i1d3.requested_edge_count.blue", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_edge_edges, 0, NULL, HFILL }, }, { &hf_usb_i1d3_requested_integration_time, { "Requested integration time", "i1d3.requested_integration_time", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_cycle_cycles, 0, NULL, HFILL }, }, { &hf_usb_i1d3_response_code, { "Response code", "i1d3.response_code", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_response_in, { "Response in frame", "i1d3.response_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0, NULL, HFILL } }, { &hf_usb_i1d3_readintee_data, { "Internal EEPROM data", "i1d3.readintee_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_readintee_offset, { "Internal EEPROM read offset", "i1d3.readintee_offset", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0, NULL, HFILL }, }, { &hf_usb_i1d3_readintee_length, { "Internal EEPROM read length", "i1d3.readintee_length", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0, NULL, HFILL }, }, { &hf_usb_i1d3_readextee_data, { "External EEPROM data", "i1d3.readextee_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_readextee_offset, { "External EEPROM read offset", "i1d3.readextee_offset", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0, NULL, HFILL }, }, { &hf_usb_i1d3_readextee_length, { "External EEPROM read length", "i1d3.readextee_length", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0, NULL, HFILL }, }, { &hf_usb_i1d3_status, { "Status", "i1d3.status", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }, }, { &hf_usb_i1d3_unlock_result, { "Unlock result", "i1d3.unlock_result", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }, }, }; static ei_register_info ei[] = { { &ei_usb_i1d3_echoed_command_code_mismatch, { "i1d3.echoed_command_code_mismatch", PI_PROTOCOL, PI_ERROR, "Echoed command code does not match request", EXPFILL } }, { &ei_usb_i1d3_error, { "i1d3.error", PI_RESPONSE_CODE, PI_NOTE, "Error response code", EXPFILL } }, { &ei_usb_i1d3_unexpected_response, { "i1d3.unexpected_response", PI_SEQUENCE, PI_WARN, "Could not match response to a request", EXPFILL } }, { &ei_usb_i1d3_unknown_command, { "i1d3.unknown_command", PI_MALFORMED, PI_ERROR, "Unknown command code", EXPFILL } }, { &ei_usb_i1d3_unknown_diffuser_position, { "i1d3.unknown_diffuser_position", PI_MALFORMED, PI_ERROR, "Unknown diffuser position code", EXPFILL } }, { &ei_usb_i1d3_unlock_failed, { "i1d3.unlock_failed", PI_RESPONSE_CODE, PI_NOTE, "Failed to unlock device", EXPFILL } }, { &ei_usb_i1d3_unusual_length, { "i1d3.unusual_length", PI_PROTOCOL, PI_WARN, "Packet has unusual length", EXPFILL } }, }; proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_usb_i1d3, hf, array_length(hf)); expert_module_t *expert_usb_i1d3 = expert_register_protocol( proto_usb_i1d3); expert_register_field_array(expert_usb_i1d3, ei, array_length(ei)); } void proto_reg_handoff_usb_i1d3(void) { dissector_handle_t usb_i1d3_dissector = create_dissector_handle( dissect_usb_i1d3, proto_usb_i1d3); dissector_add_for_decode_as("usb.device", usb_i1d3_dissector); dissector_add_uint("usb.product", 0x7655020, usb_i1d3_dissector); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-masstorage.c
/* packet-usb-masstorage.c * USB Mass Storage class stub dissector * Copyright 2021, Aidan MacDonald <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-usb.h" static int proto_usb_ms = -1; static dissector_table_t usb_ms_bulk_dissector_table; static dissector_table_t usb_ms_control_dissector_table; static dissector_table_t usb_ms_interrupt_dissector_table; static dissector_table_t usb_ms_descriptor_dissector_table; void proto_register_usb_ms(void); void proto_reg_handoff_usb_ms(void); #define MSC_SUBCLASS_SCSI_COMMAND_SET_NOT_REPORTED 0x00 #define MSC_SUBCLASS_RBC 0x01 #define MSC_SUBCLASS_MMC_5_ATAPI 0x02 #define MSC_SUBCLASS_OBSOLETE_QIC_157 0x03 #define MSC_SUBCLASS_UFI 0x04 #define MSC_SUBCLASS_OBSOLETE_SFF_8070I 0x05 #define MSC_SUBCLASS_SCSI_TRANSPARENT_COMMAND_SET 0x06 #define MSC_SUBCLASS_LSD_FS 0x07 #define MSC_SUBCLASS_IEEE_1667 0x08 #define MSC_SUBCLASS_VENDOR 0xFF static const value_string usb_massstorage_subclass_vals[] = { {MSC_SUBCLASS_SCSI_COMMAND_SET_NOT_REPORTED, "SCSI command set not reported"}, {MSC_SUBCLASS_RBC, "RBC"}, {MSC_SUBCLASS_MMC_5_ATAPI, "MMC-5 (ATAPI)"}, {MSC_SUBCLASS_OBSOLETE_QIC_157, "Obsolete (was QIC-157)"}, {MSC_SUBCLASS_UFI, "UFI"}, {MSC_SUBCLASS_OBSOLETE_SFF_8070I, "Obsolete (was SFF-8070i)"}, {MSC_SUBCLASS_SCSI_TRANSPARENT_COMMAND_SET, "SCSI transparent command set"}, {MSC_SUBCLASS_LSD_FS, "LSD FS"}, {MSC_SUBCLASS_IEEE_1667, "IEEE 1667"}, {MSC_SUBCLASS_VENDOR, "Specific to device vendor"}, {0, NULL} }; value_string_ext ext_usb_massstorage_subclass_vals = VALUE_STRING_EXT_INIT(usb_massstorage_subclass_vals); #define MSC_PROTOCOL_CBI_NO_INTERRUPT 0x00 #define MSC_PROTOCOL_CBI_WITH_INTERRUPT 0x01 #define MSC_PROTOCOL_OBSOLETE 0x02 #define MSC_PROTOCOL_BULK_ONLY 0x50 #define MSC_PROTOCOL_UAS 0x62 #define MSC_PROTOCOL_VENDOR 0xFF static const value_string usb_massstorage_protocol_vals[] = { {MSC_PROTOCOL_CBI_NO_INTERRUPT, "Control/Bulk/Interrupt (CBI) Transport with command completion interrupt"}, {MSC_PROTOCOL_CBI_WITH_INTERRUPT, "Control/Bulk/Interrupt (CBI) Transport with no command completion interrupt"}, {MSC_PROTOCOL_OBSOLETE, "Obsolete"}, {MSC_PROTOCOL_BULK_ONLY, "Bulk-Only (BBB) Transport"}, {MSC_PROTOCOL_UAS, "UAS"}, {MSC_PROTOCOL_VENDOR, "Specific to device vendor"}, {0, NULL} }; value_string_ext usb_massstorage_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_massstorage_protocol_vals); static int dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { usb_conv_info_t *usb_conv_info; usb_conv_info = (usb_conv_info_t *)data; return dissector_try_uint_new(usb_ms_bulk_dissector_table, usb_conv_info->interfaceProtocol, tvb, pinfo, parent_tree, TRUE, usb_conv_info); } static int dissect_usb_ms_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { usb_conv_info_t *usb_conv_info; usb_conv_info = (usb_conv_info_t *)data; return dissector_try_uint_new(usb_ms_control_dissector_table, usb_conv_info->interfaceProtocol, tvb, pinfo, parent_tree, TRUE, usb_conv_info); } static int dissect_usb_ms_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { usb_conv_info_t *usb_conv_info; usb_conv_info = (usb_conv_info_t *)data; return dissector_try_uint_new(usb_ms_interrupt_dissector_table, usb_conv_info->interfaceProtocol, tvb, pinfo, parent_tree, TRUE, usb_conv_info); } static int dissect_usb_ms_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { usb_conv_info_t *usb_conv_info; usb_conv_info = (usb_conv_info_t *)data; return dissector_try_uint_new(usb_ms_descriptor_dissector_table, usb_conv_info->interfaceProtocol, tvb, pinfo, parent_tree, TRUE, usb_conv_info); } void proto_register_usb_ms(void) { proto_usb_ms = proto_register_protocol("USB Mass Storage Class", "USBMSClass", "usbmsclass"); usb_ms_bulk_dissector_table = register_dissector_table("usbms.bulk", "USBMS bulk endpoint", proto_usb_ms, FT_UINT8, BASE_HEX); usb_ms_control_dissector_table = register_dissector_table("usbms.control", "USBMS control endpoint", proto_usb_ms, FT_UINT8, BASE_HEX); usb_ms_interrupt_dissector_table = register_dissector_table("usbms.interrupt", "USBMS interrupt endpoint", proto_usb_ms, FT_UINT8, BASE_HEX); usb_ms_descriptor_dissector_table = register_dissector_table("usbms.descriptor", "USBMS descriptor", proto_usb_ms, FT_UINT8, BASE_HEX); } void proto_reg_handoff_usb_ms(void) { dissector_handle_t usb_ms_bulk_handle; dissector_handle_t usb_ms_control_handle; dissector_handle_t usb_ms_interrupt_handle; dissector_handle_t usb_ms_descriptor_handle; usb_ms_bulk_handle = create_dissector_handle(dissect_usb_ms_bulk, proto_usb_ms); usb_ms_control_handle = create_dissector_handle(dissect_usb_ms_control, proto_usb_ms); usb_ms_interrupt_handle = create_dissector_handle(dissect_usb_ms_interrupt, proto_usb_ms); usb_ms_descriptor_handle = create_dissector_handle(dissect_usb_ms_descriptor, proto_usb_ms); dissector_add_uint("usb.bulk", IF_CLASS_MASS_STORAGE, usb_ms_bulk_handle); dissector_add_uint("usb.control", IF_CLASS_MASS_STORAGE, usb_ms_control_handle); dissector_add_uint("usb.interrupt", IF_CLASS_MASS_STORAGE, usb_ms_interrupt_handle); dissector_add_uint("usb.descriptor", IF_CLASS_MASS_STORAGE, usb_ms_descriptor_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-printer.c
/* packet-usb-printer.c * * Copyright 2020, Martin Kaiser <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * References: * * USB printer class specification * https://www.usb.org/sites/default/files/usbprint11a021811.pdf * * IEEE 1284 (parallel peripheral interface for personal computers) * http://kazus.ru/nuke/modules/Downloads/pub/148/0/IEEE%201284-2000.pdf */ #include "config.h" #include <epan/packet.h> #include <epan/proto.h> #include "packet-usb.h" #include <epan/value_string.h> static int proto_usb_printer = -1; static int hf_usb_printer_req = -1; static int hf_usb_printer_cfg_idx = -1; static int hf_usb_printer_intf = -1; static int hf_usb_printer_alt_set = -1; static int hf_usb_printer_max_len = -1; static int hf_usb_printer_dev_id_len = -1; static int hf_usb_printer_dev_id = -1; static gint ett_usb_printer = -1; void proto_register_usb_printer(void); void proto_reg_handoff_usb_printer(void); #define REQ_GET_DEV_ID 0 #define REQ_GET_PORT_STAT 1 #define REQ_GET_SOFT_RST 2 static const value_string usb_printer_req[] = { { REQ_GET_DEV_ID, "GET_DEVICE_ID" }, { REQ_GET_PORT_STAT, "GET_PORT_STATUS" }, { REQ_GET_SOFT_RST, "SOFT_RESET" }, { 0, NULL } }; static gint dissect_usb_printer_ctl( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gboolean is_request = (pinfo->srcport == NO_ENDPOINT); usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; usb_trans_info_t *usb_trans_info; gint offset = 0; guint8 bReq; guint32 dev_id_len; if (!usb_conv_info) return 0; usb_trans_info = usb_conv_info->usb_trans_info; if (!usb_trans_info) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBPRINTER"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(usb_trans_info->setup.request, usb_printer_req, "Invalid")); if (is_request) { col_append_fstr(pinfo->cinfo, COL_INFO, " request"); bReq = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_printer_req, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; if (bReq == REQ_GET_DEV_ID) { /* Generally, fields in USB messages are little endian. */ proto_tree_add_item(tree, hf_usb_printer_cfg_idx, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_printer_intf, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_printer_alt_set, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_printer_max_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } } else { col_append_fstr(pinfo->cinfo, COL_INFO, " response"); if (usb_trans_info->setup.request == REQ_GET_DEV_ID) { /* * A printer's Device ID is defined in IEEE 1284, section 7.6. * It starts with a 16-bit length field in big endian encoding. * The length field includes the two bytes for itself. Therefore, * we can't use an FT_UINT_STRING for the entire Device ID. * The actual Device ID string consists of ASCII characters. */ proto_tree_add_item_ret_uint(tree, hf_usb_printer_dev_id_len, tvb, offset, 2, ENC_BIG_ENDIAN, &dev_id_len); offset += 2; if (dev_id_len > 2) { proto_tree_add_item(tree, hf_usb_printer_dev_id, tvb, offset, dev_id_len-2, ENC_ASCII); offset += dev_id_len-2; } /* XXX - expert info for invalid dev_id_len */ } } return offset; } void proto_register_usb_printer(void) { static hf_register_info hf[] = { { &hf_usb_printer_req, { "bRequest", "usbprinter.bRequest", FT_UINT8, BASE_HEX, VALS(usb_printer_req), 0x0, NULL, HFILL } }, { &hf_usb_printer_cfg_idx, { "Config index", "usbprinter.config_index", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usb_printer_intf, { "Interface", "usbprinter.interface", FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL } }, { &hf_usb_printer_alt_set, { "Alternate setting", "usbprinter.alt_set", FT_UINT16, BASE_HEX, NULL, 0x00FF, NULL, HFILL } }, { &hf_usb_printer_max_len, { "Maximum length", "usbprinter.max_len", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_printer_dev_id_len, { "Device ID length", "usbprinter.device_id_len", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_printer_dev_id, { "Device ID", "usbprinter.device_id", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } } }; static gint *ett[] = { &ett_usb_printer }; proto_usb_printer = proto_register_protocol( "USB Printer", "USBPRINTER", "usbprinter"); proto_register_field_array(proto_usb_printer, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_usb_printer(void) { dissector_handle_t usb_printer_ctl_handle; usb_printer_ctl_handle = create_dissector_handle( dissect_usb_printer_ctl, proto_usb_printer); dissector_add_uint("usb.control", IF_CLASS_PRINTER, usb_printer_ctl_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb-video.c
/* packet-usb-video.c * * Forked from packet-usb-masstorage.c 35224 2010-12-20 05:35:29Z guy * which was authored by Ronnie Sahlberg (2006) * * usb video dissector * Steven J. Magnani 2013 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include "packet-usb.h" void proto_register_usb_vid(void); void proto_reg_handoff_usb_vid(void); /* References are to sections in USB Video Class specifications - * specifically V1.5, but versions have tended to keep * the same numbering (as of this writing). * * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_5.zip */ /* Table 2-1. Interrupt originators */ #define INT_VIDEOCONTROL 1 #define INT_VIDEOSTREAMING 2 #define INT_ORIGINATOR_MASK 0xF /* Table 2-2. Video Control Status Packet bAttribute */ #define CONTROL_CHANGE_VALUE 0x00 #define CONTROL_CHANGE_INFO 0x01 #define CONTROL_CHANGE_FAILURE 0x02 #define CONTROL_CHANGE_MIN 0x03 /* UVC 1.5+ */ #define CONTROL_CHANGE_MAX 0x04 /* UVC 1.5+ */ /* A.2 Video Interface Subclass Codes */ #define SC_UNDEFINED 0 #define SC_VIDEOCONTROL 1 #define SC_VIDEOSTREAMING 2 #define SC_VIDEO_INTERFACE_COLLECTION 3 /* A.4. Video Class-Specific Descriptor Types */ #define CS_INTERFACE 0x24 #define CS_ENDPOINT 0x25 /* A.5 Video Class-Specific VC Interface Descriptor Subtypes */ #define VC_HEADER 1 #define VC_INPUT_TERMINAL 2 #define VC_OUTPUT_TERMINAL 3 #define VC_SELECTOR_UNIT 4 #define VC_PROCESSING_UNIT 5 #define VC_EXTENSION_UNIT 6 #define VC_ENCODING_UNIT 7 /* A.6 Video Class-Specific VS Interface Descriptor Subtypes */ #define VS_UNDEFINED 0x00 #define VS_INPUT_HEADER 0x01 #define VS_OUTPUT_HEADER 0x02 #define VS_STILL_IMAGE_FRAME 0x03 #define VS_FORMAT_UNCOMPRESSED 0x04 #define VS_FRAME_UNCOMPRESSED 0x05 #define VS_FORMAT_MJPEG 0x06 #define VS_FRAME_MJPEG 0x07 #define VS_FORMAT_MPEG1 0x08 /* Pre-UVC 1.1 */ #define VS_FORMAT_MPEG2PS 0x09 /* Pre-UVC 1.1 */ #define VS_FORMAT_MPEG2TS 0x0A #define VS_FORMAT_MPEG4SL 0x0B /* Pre-UVC 1.1 */ #define VS_FORMAT_DV 0x0C #define VS_COLORFORMAT 0x0D #define VS_FORMAT_VENDOR 0x0E /* Pre-UVC 1.1 */ #define VS_FRAME_VENDOR 0x0F /* Pre-UVC 1.1 */ #define VS_FORMAT_FRAME_BASED 0x10 #define VS_FRAME_FRAME_BASED 0x11 #define VS_FORMAT_STREAM_BASED 0x12 #define VS_FORMAT_H264 0x13 /* UVC 1.5 */ #define VS_FRAME_H264 0x14 /* UVC 1.5 */ #define VS_FORMAT_H264_SIMULCAST 0x15 /* UVC 1.5 */ #define VS_FORMAT_VP8 0x16 /* UVC 1.5 */ #define VS_FRAME_VP8 0x17 /* UVC 1.5 */ #define VS_FORMAT_VP8_SIMULCAST 0x18 /* UVC 1.5 */ /* A.7 Video Class-Specific Endpoint Descriptor Subtypes */ #define EP_INTERRUPT 0x03 /* A.9.1 Video Control Interface Control Selectors */ #define VC_CONTROL_UNDEFINED 0x00 #define VC_VIDEO_POWER_MODE_CONTROL 0x01 #define VC_REQUEST_ERROR_CODE_CONTROL 0x02 #define VC_REQUEST_INDICATE_HOST_CLOCK_CONTROL 0x03 /* Pre-UVC 1.1 */ /* A.9.3 Selector Unit Control Selectors */ #define SU_CONTROL_UNDEFINED 0x00 #define SU_INPUT_SELECT_CONTROL 0x01 /* A.9.4 Camera Terminal Control Selectors */ #define CT_CONTROL_UNDEFINED 0x00 #define CT_SCANNING_MODE_CONTROL 0x01 #define CT_AE_MODE_CONTROL 0x02 #define CT_AE_PRIORITY_CONTROL 0x03 #define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04 #define CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05 #define CT_FOCUS_ABSOLUTE_CONTROL 0x06 #define CT_FOCUS_RELATIVE_CONTROL 0x07 #define CT_FOCUS_AUTO_CONTROL 0x08 #define CT_IRIS_ABSOLUTE_CONTROL 0x09 #define CT_IRIS_RELATIVE_CONTROL 0x0A #define CT_ZOOM_ABSOLUTE_CONTROL 0x0B #define CT_ZOOM_RELATIVE_CONTROL 0x0C #define CT_PANTILT_ABSOLUTE_CONTROL 0x0D #define CT_PANTILT_RELATIVE_CONTROL 0x0E #define CT_ROLL_ABSOLUTE_CONTROL 0x0F #define CT_ROLL_RELATIVE_CONTROL 0x10 #define CT_PRIVACY_CONTROL 0x11 #define CT_FOCUS_SIMPLE_CONTROL 0x12 /* UVC 1.5 */ #define CT_WINDOW_CONTROL 0x13 /* UVC 1.5 */ #define CT_REGION_OF_INTEREST_CONTROL 0x14 /* UVC 1.5 */ /* A.9.5 Processing Unit Control Selectors */ #define PU_CONTROL_UNDEFINED 0x00 #define PU_BACKLIGHT_COMPENSATION_CONTROL 0x01 #define PU_BRIGHTNESS_CONTROL 0x02 #define PU_CONTRAST_CONTROL 0x03 #define PU_GAIN_CONTROL 0x04 #define PU_POWER_LINE_FREQUENCY_CONTROL 0x05 #define PU_HUE_CONTROL 0x06 #define PU_SATURATION_CONTROL 0x07 #define PU_SHARPNESS_CONTROL 0x08 #define PU_GAMMA_CONTROL 0x09 #define PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0A #define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0B #define PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0C #define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0D #define PU_DIGITAL_MULTIPLIER_CONTROL 0x0E #define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0F #define PU_HUE_AUTO_CONTROL 0x10 #define PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11 #define PU_ANALOG_LOCK_STATUS_CONTROL 0x12 #define PU_CONTRAST_AUTO_CONTROL 0x13 /* A.9.7 VideoStreaming Interface Control Selectors */ #define VS_CONTROL_UNDEFINED 0x00 #define VS_PROBE_CONTROL 0x01 #define VS_COMMIT_CONTROL 0x02 #define VS_STILL_PROBE_CONTROL 0x03 #define VS_STILL_COMMIT_CONTROL 0x04 #define VS_STILL_IMAGE_TRIGGER_CONTROL 0x05 #define VS_STREAM_ERROR_CODE_CONTROL 0x06 #define VS_GENERATE_KEY_FRAME_CONTROL 0x07 #define VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08 #define VS_SYNCH_DELAY_CONTROL 0x09 /* Appendix B Terminal Types */ #define TT_VENDOR_SPECIFIC 0x100 #define TT_STREAMING 0x101 #define ITT_VENDOR_SPECIFIC 0x200 #define ITT_CAMERA 0x201 #define ITT_MEDIA_TRANSPORT_INPUT 0x202 #define OTT_VENDOR_SPECIFIC 0x300 #define OTT_DISPLAY 0x301 #define OTT_MEDIA_TRANSPORT_OUTPUT 0x302 #define EXTERNAL_VENDOR_SPECIFIC 0x400 #define COMPOSITE_CONNECTOR 0x401 #define SVIDEO_CONNECTOR 0x402 #define COMPONENT_CONNECTOR 0x403 /* Table 2-2 Status Packet Format (VideoControl Interface as the Originator) */ #define CONTROL_INTERRUPT_EVENT_CONTROL_CHANGE 0 /* Table 4-7 Request Error Code Control bRequestErrorCode */ #define UVC_ERROR_NONE 0 #define UVC_ERROR_NOT_READY 1 #define UVC_ERROR_WRONG_STATE 2 #define UVC_ERROR_POWER 3 #define UVC_ERROR_OUT_OF_RANGE 4 #define UVC_ERROR_INVALID_UNIT 5 #define UVC_ERROR_INVALID_CONTROL 6 #define UVC_ERROR_INVALID_REQUEST 7 #define UVC_ERROR_INVALID_VALUE 8 #define UVC_ERROR_UNKNOWN 255 /* A.8 Video Class-Specific Request Codes */ #define USB_SETUP_SET_CUR 0x01 #define USB_SETUP_SET_CUR_ALL 0x11 /* UVC 1.5 */ #define USB_SETUP_GET_CUR 0x81 #define USB_SETUP_GET_MIN 0x82 #define USB_SETUP_GET_MAX 0x83 #define USB_SETUP_GET_RES 0x84 #define USB_SETUP_GET_LEN 0x85 #define USB_SETUP_GET_INFO 0x86 #define USB_SETUP_GET_DEF 0x87 #define USB_SETUP_GET_CUR_ALL 0x91 /* UVC 1.5 */ #define USB_SETUP_GET_MIN_ALL 0x92 /* UVC 1.5 */ #define USB_SETUP_GET_MAX_ALL 0x93 /* UVC 1.5 */ #define USB_SETUP_GET_RES_ALL 0x94 /* UVC 1.5 */ #define USB_SETUP_GET_DEF_ALL 0x97 /* UVC 1.5 */ /* protocols and header fields */ static int proto_usb_vid = -1; static int hf_usb_vid_control_entity = -1; static int hf_usb_vid_control_interface = -1; static int hf_usb_vid_control_selector = -1; static int hf_usb_vid_epdesc_subtype = -1; static int hf_usb_vid_epdesc_max_transfer_sz = -1; static int hf_usb_vid_control_ifdesc_subtype = -1; static int hf_usb_vid_control_ifdesc_terminal_id = -1; static int hf_usb_vid_control_ifdesc_terminal_type = -1; static int hf_usb_vid_control_ifdesc_assoc_terminal = -1; static int hf_usb_vid_streaming_ifdesc_subtype = -1; static int hf_usb_vid_streaming_ifdesc_bNumFormats = -1; static int hf_usb_vid_control_ifdesc_unit_id = -1; static int hf_usb_vid_request = -1; static int hf_usb_vid_length = -1; static int hf_usb_vid_interrupt_bStatusType = -1; static int hf_usb_vid_interrupt_bOriginator = -1; static int hf_usb_vid_interrupt_bAttribute = -1; static int hf_usb_vid_control_interrupt_bEvent = -1; static int hf_usb_vid_control_ifdesc_bcdUVC = -1; static int hf_usb_vid_ifdesc_wTotalLength = -1; static int hf_usb_vid_control_ifdesc_dwClockFrequency = -1; static int hf_usb_vid_control_ifdesc_bInCollection = -1; static int hf_usb_vid_control_ifdesc_baInterfaceNr = -1; static int hf_usb_vid_control_ifdesc_iTerminal = -1; static int hf_usb_vid_control_ifdesc_src_id = -1; static int hf_usb_vid_cam_objective_focal_len_min = -1; static int hf_usb_vid_cam_objective_focal_len_max = -1; static int hf_usb_vid_cam_ocular_focal_len = -1; static int hf_usb_vid_bControlSize = -1; static int hf_usb_vid_bmControl = -1; static int hf_usb_vid_bmControl_bytes = -1; static int hf_usb_vid_control_default = -1; static int hf_usb_vid_control_min = -1; static int hf_usb_vid_control_max = -1; static int hf_usb_vid_control_res = -1; static int hf_usb_vid_control_cur = -1; static int hf_usb_vid_control_info = -1; static int hf_usb_vid_control_info_D[7] = { -1, -1, -1, -1, -1, -1, -1 }; static int hf_usb_vid_control_length = -1; static int hf_usb_vid_cam_control_D[22] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; static int hf_usb_vid_proc_control_D[19] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; static int hf_usb_vid_proc_standards_D[6] = { -1, -1, -1, -1, -1, -1 }; static int hf_usb_vid_exten_guid = -1; static int hf_usb_vid_exten_num_controls = -1; static int hf_usb_vid_num_inputs = -1; static int hf_usb_vid_sources = -1; static int hf_usb_vid_streaming_bmInfo = -1; static int hf_usb_vid_streaming_info_D[1] = { -1 }; static int hf_usb_vid_streaming_terminal_link = -1; static int hf_usb_vid_streaming_still_capture_method = -1; static int hf_usb_vid_streaming_trigger_support = -1; static int hf_usb_vid_streaming_trigger_usage = -1; static int hf_usb_vid_streaming_control_D[6] = { -1, -1, -1, -1, -1, -1 }; static int hf_usb_vid_format_index = -1; static int hf_usb_vid_format_num_frame_descriptors = -1; static int hf_usb_vid_format_guid = -1; static int hf_usb_vid_format_bits_per_pixel = -1; static int hf_usb_vid_default_frame_index = -1; static int hf_usb_vid_aspect_ratio_x = -1; static int hf_usb_vid_aspect_ratio_y = -1; static int hf_usb_vid_interlace_flags = -1; static int hf_usb_vid_is_interlaced = -1; static int hf_usb_vid_interlaced_fields = -1; static int hf_usb_vid_field_1_first = -1; static int hf_usb_vid_field_pattern = -1; static int hf_usb_vid_copy_protect = -1; static int hf_usb_vid_variable_size = -1; static int hf_usb_vid_frame_index = -1; static int hf_usb_vid_frame_capabilities = -1; static int hf_usb_vid_frame_stills_supported = -1; static int hf_usb_vid_frame_fixed_frame_rate = -1; static int hf_usb_vid_frame_width = -1; static int hf_usb_vid_frame_height = -1; static int hf_usb_vid_frame_min_bit_rate = -1; static int hf_usb_vid_frame_max_bit_rate = -1; static int hf_usb_vid_frame_max_frame_sz = -1; static int hf_usb_vid_frame_default_interval = -1; static int hf_usb_vid_frame_bytes_per_line = -1; static int hf_usb_vid_mjpeg_flags = -1; static int hf_usb_vid_mjpeg_fixed_samples = -1; static int hf_usb_vid_probe_hint = -1; static int hf_usb_vid_probe_hint_D[5] = { -1, -1, -1, -1, -1 }; static int hf_usb_vid_frame_interval = -1; static int hf_usb_vid_probe_key_frame_rate = -1; static int hf_usb_vid_probe_p_frame_rate = -1; static int hf_usb_vid_probe_comp_quality = -1; static int hf_usb_vid_probe_comp_window = -1; static int hf_usb_vid_probe_delay = -1; static int hf_usb_vid_probe_max_frame_sz = -1; static int hf_usb_vid_probe_max_payload_sz = -1; static int hf_usb_vid_probe_clock_freq = -1; static int hf_usb_vid_probe_framing = -1; static int hf_usb_vid_probe_framing_D[2] = { -1, -1 }; static int hf_usb_vid_probe_preferred_ver = -1; static int hf_usb_vid_probe_min_ver = -1; static int hf_usb_vid_probe_max_ver = -1; static int hf_usb_vid_frame_interval_type = -1; static int hf_usb_vid_frame_min_interval = -1; static int hf_usb_vid_frame_max_interval = -1; static int hf_usb_vid_frame_step_interval = -1; static int hf_usb_vid_color_primaries = -1; static int hf_usb_vid_transfer_characteristics = -1; static int hf_usb_vid_matrix_coefficients = -1; static int hf_usb_vid_max_multiplier = -1; static int hf_usb_vid_iProcessing = -1; static int hf_usb_vid_iExtension = -1; static int hf_usb_vid_iSelector = -1; static int hf_usb_vid_proc_standards = -1; static int hf_usb_vid_request_error = -1; static int hf_usb_vid_descriptor_data = -1; static int hf_usb_vid_control_data = -1; static int hf_usb_vid_control_value = -1; static int hf_usb_vid_value_data = -1; /* Subtrees */ static gint ett_usb_vid = -1; static gint ett_descriptor_video_endpoint = -1; static gint ett_descriptor_video_control = -1; static gint ett_descriptor_video_streaming = -1; static gint ett_camera_controls = -1; static gint ett_processing_controls = -1; static gint ett_streaming_controls = -1; static gint ett_streaming_info = -1; static gint ett_interlace_flags = -1; static gint ett_frame_capability_flags = -1; static gint ett_mjpeg_flags = -1; static gint ett_video_probe = -1; static gint ett_probe_hint = -1; static gint ett_probe_framing = -1; static gint ett_video_standards = -1; static gint ett_control_capabilities = -1; static expert_field ei_usb_vid_subtype_unknown = EI_INIT; static expert_field ei_usb_vid_bitmask_len = EI_INIT; /* Lookup tables */ static const value_string vc_ep_descriptor_subtypes[] = { { EP_INTERRUPT, "Interrupt" }, { 0, NULL } }; static const value_string vid_descriptor_type_vals[] = { {CS_INTERFACE, "video class interface"}, {CS_ENDPOINT, "video class endpoint"}, {0,NULL} }; static value_string_ext vid_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(vid_descriptor_type_vals); static const value_string vc_if_descriptor_subtypes[] = { { VC_HEADER, "Header" }, { VC_INPUT_TERMINAL, "Input Terminal" }, { VC_OUTPUT_TERMINAL, "Output Terminal" }, { VC_SELECTOR_UNIT, "Selector Unit" }, { VC_PROCESSING_UNIT, "Processing Unit" }, { VC_EXTENSION_UNIT, "Extension Unit" }, { VC_ENCODING_UNIT, "Encoding Unit" }, { 0, NULL } }; static value_string_ext vc_if_descriptor_subtypes_ext = VALUE_STRING_EXT_INIT(vc_if_descriptor_subtypes); static const value_string cs_control_interface[] = { { VC_CONTROL_UNDEFINED, "Undefined" }, { VC_VIDEO_POWER_MODE_CONTROL, "Video Power Mode" }, { VC_REQUEST_ERROR_CODE_CONTROL, "Request Error Code" }, { VC_REQUEST_INDICATE_HOST_CLOCK_CONTROL, "Request Indicate Host Clock" }, { 0, NULL } }; static value_string_ext cs_control_interface_ext = VALUE_STRING_EXT_INIT(cs_control_interface); static const value_string cs_streaming_interface[] = { { VS_CONTROL_UNDEFINED, "Undefined" }, { VS_PROBE_CONTROL, "Probe" }, { VS_COMMIT_CONTROL, "Commit" }, { VS_STILL_PROBE_CONTROL, "Still Probe" }, { VS_STILL_COMMIT_CONTROL, "Still Commit" }, { VS_STILL_IMAGE_TRIGGER_CONTROL, "Still Image Trigger" }, { VS_STREAM_ERROR_CODE_CONTROL, "Stream Error Code" }, { VS_GENERATE_KEY_FRAME_CONTROL, "Generate Key Frame" }, { VS_UPDATE_FRAME_SEGMENT_CONTROL, "Update Frame Segment" }, { VS_SYNCH_DELAY_CONTROL, "Synch Delay" }, { 0, NULL } }; static value_string_ext cs_streaming_interface_ext = VALUE_STRING_EXT_INIT(cs_streaming_interface); static const value_string cs_selector_unit[] = { { SU_CONTROL_UNDEFINED, "Undefined" }, { SU_INPUT_SELECT_CONTROL, "Input Select" }, { 0, NULL } }; static value_string_ext cs_selector_unit_ext = VALUE_STRING_EXT_INIT(cs_selector_unit); static const value_string cs_camera_terminal[] = { { CT_CONTROL_UNDEFINED, "Undefined" }, { CT_SCANNING_MODE_CONTROL, "Scanning Mode" }, { CT_AE_MODE_CONTROL, "Auto-Exposure Mode" }, { CT_AE_PRIORITY_CONTROL, "Auto-Exposure Priority" }, { CT_EXPOSURE_TIME_ABSOLUTE_CONTROL, "Exposure Time (Absolute)" }, { CT_EXPOSURE_TIME_RELATIVE_CONTROL, "Exposure Time (Relative)" }, { CT_FOCUS_ABSOLUTE_CONTROL, "Focus (Absolute)" }, { CT_FOCUS_RELATIVE_CONTROL, "Focus (Relative)" }, { CT_FOCUS_AUTO_CONTROL, "Focus, Auto" }, { CT_IRIS_ABSOLUTE_CONTROL, "Iris (Absolute)" }, { CT_IRIS_RELATIVE_CONTROL, "Iris (Relative)" }, { CT_ZOOM_ABSOLUTE_CONTROL, "Zoom (Absolute)" }, { CT_ZOOM_RELATIVE_CONTROL, "Zoom (Relative)" }, { CT_PANTILT_ABSOLUTE_CONTROL, "PanTilt (Absolute)" }, { CT_PANTILT_RELATIVE_CONTROL, "PanTilt (Relative)" }, { CT_ROLL_ABSOLUTE_CONTROL, "Roll (Absolute)" }, { CT_ROLL_RELATIVE_CONTROL, "Roll (Relative)" }, { CT_PRIVACY_CONTROL, "Privacy" }, { CT_FOCUS_SIMPLE_CONTROL, "Focus (Simple)" }, { CT_WINDOW_CONTROL, "Window" }, { CT_REGION_OF_INTEREST_CONTROL, "Region of Interest" }, { 0, NULL } }; static value_string_ext cs_camera_terminal_ext = VALUE_STRING_EXT_INIT(cs_camera_terminal); static const value_string cs_processing_unit[] = { { PU_CONTROL_UNDEFINED, "Undefined" }, { PU_BACKLIGHT_COMPENSATION_CONTROL, "Backlight Compensation" }, { PU_BRIGHTNESS_CONTROL, "Brightness" }, { PU_CONTRAST_CONTROL, "Contrast" }, { PU_GAIN_CONTROL, "Gain" }, { PU_POWER_LINE_FREQUENCY_CONTROL, "Power Line Frequency" }, { PU_HUE_CONTROL, "Hue" }, { PU_SATURATION_CONTROL, "Saturation" }, { PU_SHARPNESS_CONTROL, "Sharpness" }, { PU_GAMMA_CONTROL, "Gamma" }, { PU_WHITE_BALANCE_TEMPERATURE_CONTROL, "White Balance Temperature" }, { PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,"White Balance Temperature Auto" }, { PU_WHITE_BALANCE_COMPONENT_CONTROL, "White Balance Component" }, { PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL, "White Balance Component Auto" }, { PU_DIGITAL_MULTIPLIER_CONTROL, "Digital Multiplier" }, { PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL, "Digital Multiplier Limit" }, { PU_HUE_AUTO_CONTROL, "Hue Auto" }, { PU_ANALOG_VIDEO_STANDARD_CONTROL, "Video Standard" }, { PU_ANALOG_LOCK_STATUS_CONTROL, "Analog Lock Status" }, { PU_CONTRAST_AUTO_CONTROL, "Contrast Auto" }, { 0, NULL } }; static value_string_ext cs_processing_unit_ext = VALUE_STRING_EXT_INIT(cs_processing_unit); static const value_string vc_terminal_types[] = { { TT_VENDOR_SPECIFIC, "Vendor Specific", }, { TT_STREAMING, "Streaming" }, { ITT_VENDOR_SPECIFIC, "Vendor Specific Input" }, { ITT_CAMERA, "Camera Input" }, { ITT_MEDIA_TRANSPORT_INPUT, "Media Transport Input" }, { OTT_VENDOR_SPECIFIC, "Vendor Specific Output" }, { OTT_DISPLAY, "Display Output" }, { OTT_MEDIA_TRANSPORT_OUTPUT, "Media Transport Output" }, { EXTERNAL_VENDOR_SPECIFIC, "Vendor Specific External" }, { COMPOSITE_CONNECTOR, "Composite Connector" }, { SVIDEO_CONNECTOR, "SVideo Connector" }, { COMPONENT_CONNECTOR, "Component Connector" }, { 0, NULL } }; static value_string_ext vc_terminal_types_ext = VALUE_STRING_EXT_INIT(vc_terminal_types); static const value_string vs_if_descriptor_subtypes[] = { { VS_UNDEFINED, "Undefined" }, { VS_INPUT_HEADER, "Input Header" }, { VS_OUTPUT_HEADER, "Output Header" }, { VS_STILL_IMAGE_FRAME, "Still Image Frame" }, { VS_FORMAT_UNCOMPRESSED, "Format Uncompressed" }, { VS_FRAME_UNCOMPRESSED, "Frame Uncompressed" }, { VS_FORMAT_MJPEG, "Format MJPEG" }, { VS_FRAME_MJPEG, "Frame MJPEG" }, { VS_FORMAT_MPEG1, "Format MPEG1" }, { VS_FORMAT_MPEG2PS, "Format MPEG2-PS" }, { VS_FORMAT_MPEG2TS, "Format MPEG2-TS" }, { VS_FORMAT_MPEG4SL, "Format MPEG4-SL" }, { VS_FORMAT_DV, "Format DV" }, { VS_COLORFORMAT, "Colorformat" }, { VS_FORMAT_VENDOR, "Format Vendor" }, { VS_FRAME_VENDOR, "Frame Vendor" }, { VS_FORMAT_FRAME_BASED, "Format Frame-Based" }, { VS_FRAME_FRAME_BASED, "Frame Frame-Based" }, { VS_FORMAT_STREAM_BASED, "Format Stream Based" }, { VS_FORMAT_H264, "Format H.264" }, { VS_FRAME_H264, "Frame H.264" }, { VS_FORMAT_H264_SIMULCAST, "Format H.264 Simulcast" }, { VS_FORMAT_VP8, "Format VP8" }, { VS_FRAME_VP8, "Frame VP8" }, { VS_FORMAT_VP8_SIMULCAST, "Format VP8 Simulcast" }, { 0, NULL } }; static value_string_ext vs_if_descriptor_subtypes_ext = VALUE_STRING_EXT_INIT(vs_if_descriptor_subtypes); static const value_string interrupt_status_types[] = { { INT_VIDEOCONTROL, "VideoControl Interface" }, { INT_VIDEOSTREAMING, "VideoStreaming Interface" }, { 0, NULL } }; static const value_string control_change_types[] = { { CONTROL_CHANGE_VALUE, "Value" }, { CONTROL_CHANGE_INFO, "Info" }, { CONTROL_CHANGE_FAILURE, "Failure" }, { CONTROL_CHANGE_MIN, "Min" }, { CONTROL_CHANGE_MAX, "Max" }, { 0, NULL } }; static value_string_ext control_change_types_ext = VALUE_STRING_EXT_INIT(control_change_types); static const value_string control_interrupt_events[] = { { CONTROL_INTERRUPT_EVENT_CONTROL_CHANGE, "Control Change" }, { 0, NULL } }; /* Table 3-13 VS Interface Input Header Descriptor - bStillCaptureMethod field */ static const value_string vs_still_capture_methods[] = { { 0, "None" }, { 1, "Uninterrupted streaming" }, { 2, "Suspended streaming" }, { 3, "Dedicated pipe" }, { 0, NULL } }; static value_string_ext vs_still_capture_methods_ext = VALUE_STRING_EXT_INIT(vs_still_capture_methods); /* Table 3-13 VS Interface Input Header Descriptor - bTriggerUsage field */ static const value_string vs_trigger_usage[] = { { 0, "Initiate still image capture" }, { 1, "General purpose button event" }, { 0, NULL } }; /* bmInterlaceFlags for format descriptors */ static const true_false_string is_interlaced_meaning = { "Interlaced", "Non-interlaced" }; /* bmInterlaceFlags for format descriptors */ static const true_false_string interlaced_fields_meaning = { "1 field", "2 fields" }; /* bmInterlaceFlags for format descriptors */ static const value_string field_pattern_meaning[] = { { 0, "Field 1 only" }, { 1, "Field 2 only" }, { 2, "Regular pattern of fields 1 and 2" }, { 3, "Random pattern of fields 1 and 2" }, {0, NULL}, }; static value_string_ext field_pattern_meaning_ext = VALUE_STRING_EXT_INIT(field_pattern_meaning); /* bCopyProtect for format descriptors */ static const value_string copy_protect_meaning[] = { { 0, "No restrictions" }, { 1, "Restrict duplication" }, {0, NULL}, }; /* Table 4-46 Video Probe and Commit Controls - bmHint field */ static const true_false_string probe_hint_meaning = { "Constant", "Variable" }; /* Table 3-19 Color Matching Descriptor - bColorPrimaries field */ static const value_string color_primaries_meaning[] = { { 0, "Unspecified" }, { 1, "BT.709, sRGB" }, { 2, "BT.470-2 (M)" }, { 3, "BT.470-2 (B,G)" }, { 4, "SMPTE 170M" }, { 5, "SMPTE 240M" }, {0, NULL}, }; static value_string_ext color_primaries_meaning_ext = VALUE_STRING_EXT_INIT(color_primaries_meaning); /* Table 3-19 Color Matching Descriptor - bTransferCharacteristics field */ static const value_string color_transfer_characteristics[] = { { 0, "Unspecified" }, { 1, "BT.709" }, { 2, "BT.470-2 (M)" }, { 3, "BT.470-2 (B,G)" }, { 4, "SMPTE 170M" }, { 5, "SMPTE 240M" }, { 6, "Linear (V=Lc)" }, { 7, "sRGB" }, {0, NULL}, }; static value_string_ext color_transfer_characteristics_ext = VALUE_STRING_EXT_INIT(color_transfer_characteristics); /* Table 3-19 Color Matching Descriptor - bMatrixCoefficients field */ static const value_string matrix_coefficients_meaning[] = { { 0, "Unspecified" }, { 1, "BT.709" }, { 2, "FCC" }, { 3, "BT.470-2 (B,G)" }, { 4, "SMPTE 170M (BT.601)" }, { 5, "SMPTE 240M" }, {0, NULL}, }; static value_string_ext matrix_coefficients_meaning_ext = VALUE_STRING_EXT_INIT(matrix_coefficients_meaning); static const value_string request_error_codes[] = { { UVC_ERROR_NONE, "No error" }, { UVC_ERROR_NOT_READY, "Not ready" }, { UVC_ERROR_WRONG_STATE, "Wrong state" }, { UVC_ERROR_POWER, "Insufficient power" } , { UVC_ERROR_OUT_OF_RANGE, "Out of range" }, { UVC_ERROR_INVALID_UNIT, "Invalid unit" }, { UVC_ERROR_INVALID_CONTROL, "Invalid control" }, { UVC_ERROR_INVALID_REQUEST, "Invalid request" }, { UVC_ERROR_INVALID_VALUE, "Invalid value within range" }, { UVC_ERROR_UNKNOWN, "Unknown" }, {0, NULL}, }; static value_string_ext request_error_codes_ext = VALUE_STRING_EXT_INIT(request_error_codes); /* There is one such structure per terminal or unit per interface */ typedef struct { guint8 entityID; guint8 subtype; guint16 terminalType; } video_entity_t; /* video_entity_t's (units/terminals) associated with each video interface */ /* There is one such structure for each video conversation (interface) */ typedef struct _video_conv_info_t { wmem_tree_t* entities; /* indexed by entity ID */ } video_conv_info_t; /*****************************************************************************/ /* UTILITY FUNCTIONS */ /*****************************************************************************/ /** * Dissector for variable-length bmControl bitmask / bControlSize pair. * * Creates an item for bControlSize, and a subtree for the bmControl bitmask. * * @param tree protocol tree to be the parent of the bitmask subtree * @param tvb the tv_buff with the (remaining) packet data * @param offset where in tvb to find bControlSize field * @param ett_subtree index of the subtree to use for this bitmask * @param bm_items NULL-terminated array of pointers that lists all the fields * of the bitmask * * @return offset within tvb at which dissection should continue */ static int dissect_bmControl(proto_tree *tree, tvbuff_t *tvb, int offset, gint ett_subtree, int * const *bm_items) { guint8 bm_size = 0; bm_size = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_bControlSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (bm_size > 0) { proto_tree_add_bitmask_len(tree, tvb, offset, bm_size, hf_usb_vid_bmControl, ett_subtree, bm_items, &ei_usb_vid_bitmask_len, ENC_LITTLE_ENDIAN); offset += bm_size; } return offset; } /*****************************************************************************/ /* VIDEO CONTROL DESCRIPTORS */ /*****************************************************************************/ /* Dissect a Camera Terminal descriptor */ static int dissect_usb_video_camera_terminal(proto_tree *tree, tvbuff_t *tvb, int offset) { static int * const control_bits[] = { &hf_usb_vid_cam_control_D[0], &hf_usb_vid_cam_control_D[1], &hf_usb_vid_cam_control_D[2], &hf_usb_vid_cam_control_D[3], &hf_usb_vid_cam_control_D[4], &hf_usb_vid_cam_control_D[5], &hf_usb_vid_cam_control_D[6], &hf_usb_vid_cam_control_D[7], &hf_usb_vid_cam_control_D[8], &hf_usb_vid_cam_control_D[9], &hf_usb_vid_cam_control_D[10], &hf_usb_vid_cam_control_D[11], &hf_usb_vid_cam_control_D[12], &hf_usb_vid_cam_control_D[13], &hf_usb_vid_cam_control_D[14], &hf_usb_vid_cam_control_D[15], &hf_usb_vid_cam_control_D[16], &hf_usb_vid_cam_control_D[17], &hf_usb_vid_cam_control_D[18], &hf_usb_vid_cam_control_D[19], &hf_usb_vid_cam_control_D[20], &hf_usb_vid_cam_control_D[21], NULL }; DISSECTOR_ASSERT(array_length(control_bits) == (1+array_length(hf_usb_vid_cam_control_D))); proto_tree_add_item(tree, hf_usb_vid_cam_objective_focal_len_min, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_vid_cam_objective_focal_len_max, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_vid_cam_ocular_focal_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; offset = dissect_bmControl(tree, tvb, offset, ett_camera_controls, control_bits); return offset; } /* Dissect a Processing Unit descriptor */ static int dissect_usb_video_processing_unit(proto_tree *tree, tvbuff_t *tvb, int offset) { static int * const control_bits[] = { &hf_usb_vid_proc_control_D[0], &hf_usb_vid_proc_control_D[1], &hf_usb_vid_proc_control_D[2], &hf_usb_vid_proc_control_D[3], &hf_usb_vid_proc_control_D[4], &hf_usb_vid_proc_control_D[5], &hf_usb_vid_proc_control_D[6], &hf_usb_vid_proc_control_D[7], &hf_usb_vid_proc_control_D[8], &hf_usb_vid_proc_control_D[9], &hf_usb_vid_proc_control_D[10], &hf_usb_vid_proc_control_D[11], &hf_usb_vid_proc_control_D[12], &hf_usb_vid_proc_control_D[13], &hf_usb_vid_proc_control_D[14], &hf_usb_vid_proc_control_D[15], &hf_usb_vid_proc_control_D[16], &hf_usb_vid_proc_control_D[17], &hf_usb_vid_proc_control_D[18], NULL }; DISSECTOR_ASSERT(array_length(control_bits) == (1+array_length(hf_usb_vid_proc_control_D))); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_src_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_max_multiplier, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); offset += 3; offset = dissect_bmControl(tree, tvb, offset, ett_processing_controls, control_bits); proto_tree_add_item(tree, hf_usb_vid_iProcessing, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; /* UVC 1.1 added bmVideoStandards */ if (tvb_reported_length_remaining(tvb, offset) > 0) { static int * const standard_bits[] = { &hf_usb_vid_proc_standards_D[0], &hf_usb_vid_proc_standards_D[1], &hf_usb_vid_proc_standards_D[2], &hf_usb_vid_proc_standards_D[3], &hf_usb_vid_proc_standards_D[4], &hf_usb_vid_proc_standards_D[5], NULL }; DISSECTOR_ASSERT(array_length(standard_bits) == (1+array_length(hf_usb_vid_proc_standards_D))); proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_proc_standards, ett_video_standards, standard_bits, ENC_NA); ++offset; } return offset; } /* Dissect a Selector Unit descriptor */ static int dissect_usb_video_selector_unit(proto_tree *tree, tvbuff_t *tvb, int offset) { guint8 num_inputs; num_inputs = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_num_inputs, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (num_inputs > 0) { proto_tree_add_item(tree, hf_usb_vid_sources, tvb, offset, num_inputs, ENC_NA); offset += num_inputs; } proto_tree_add_item(tree, hf_usb_vid_iSelector, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; return offset; } /* Dissect an Extension Unit descriptor */ static int dissect_usb_video_extension_unit(proto_tree *tree, tvbuff_t *tvb, int offset) { guint8 num_inputs; guint8 control_size; proto_tree_add_item(tree, hf_usb_vid_exten_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_exten_num_controls, tvb, offset+16, 1, ENC_LITTLE_ENDIAN); offset += 17; num_inputs = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_num_inputs, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (num_inputs > 0) { proto_tree_add_item(tree, hf_usb_vid_sources, tvb, offset, num_inputs, ENC_NA); offset += num_inputs; } control_size = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_bControlSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (control_size > 0) { if (control_size <= proto_registrar_get_length(hf_usb_vid_bmControl)) { proto_tree_add_item(tree, hf_usb_vid_bmControl, tvb, offset, control_size, ENC_LITTLE_ENDIAN); } else { /* Too big to display as integer */ /* @todo Display as FT_BYTES with a big-endian disclaimer? * See https://gitlab.com/wireshark/wireshark/-/issues/7933 */ proto_tree_add_bytes_format(tree, hf_usb_vid_bmControl_bytes, tvb, offset, control_size, NULL, "bmControl"); } offset += control_size; } proto_tree_add_item(tree, hf_usb_vid_iExtension, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; return offset; } /** * Dissector for video class control interface descriptors * * @param parent_tree the protocol tree to be the parent of the descriptor subtree * @param tvb the tv_buff with the (remaining) packet data * On entry the gaze is set to the descriptor length field. * @param descriptor_len Length of the descriptor to dissect * @param pinfo Information associated with the packet being dissected * * @return offset within tvb at which dissection should continue */ static int dissect_usb_video_control_interface_descriptor(proto_tree *parent_tree, tvbuff_t *tvb, guint8 descriptor_len, packet_info *pinfo, usb_conv_info_t *usb_conv_info) { video_conv_info_t *video_conv_info = NULL; video_entity_t *entity = NULL; proto_item *item = NULL; proto_item *subtype_item = NULL; proto_tree *tree = NULL; guint8 entity_id = 0; guint16 terminal_type = 0; int offset = 0; guint8 subtype; subtype = tvb_get_guint8(tvb, offset+2); if (parent_tree) { const gchar *subtype_str; subtype_str = val_to_str_ext(subtype, &vc_if_descriptor_subtypes_ext, "Unknown (0x%x)"); tree = proto_tree_add_subtree_format(parent_tree, tvb, offset, descriptor_len, ett_descriptor_video_control, &item, "VIDEO CONTROL INTERFACE DESCRIPTOR [%s]", subtype_str); } /* Common fields */ dissect_usb_descriptor_header(tree, tvb, offset, &vid_descriptor_type_vals_ext); subtype_item = proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_subtype, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; if (subtype == VC_HEADER) { guint8 num_vs_interfaces; proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_bcdUVC, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_ifdesc_wTotalLength, tvb, offset+2, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_dwClockFrequency, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); num_vs_interfaces = tvb_get_guint8(tvb, offset+8); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_bInCollection, tvb, offset+8, 1, ENC_LITTLE_ENDIAN); if (num_vs_interfaces > 0) { proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_baInterfaceNr, tvb, offset+9, num_vs_interfaces, ENC_NA); } offset += 9 + num_vs_interfaces; } else if ((subtype == VC_INPUT_TERMINAL) || (subtype == VC_OUTPUT_TERMINAL)) { /* Fields common to input and output terminals */ entity_id = tvb_get_guint8(tvb, offset); terminal_type = tvb_get_letohs(tvb, offset+1); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_terminal_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_terminal_type, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_assoc_terminal, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); offset += 4; if (subtype == VC_OUTPUT_TERMINAL) { proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_src_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; } proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_iTerminal, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (subtype == VC_INPUT_TERMINAL) { if (terminal_type == ITT_CAMERA) { offset = dissect_usb_video_camera_terminal(tree, tvb, offset); } else if (terminal_type == ITT_MEDIA_TRANSPORT_INPUT) { /* @todo */ } } if (subtype == VC_OUTPUT_TERMINAL) { if (terminal_type == OTT_MEDIA_TRANSPORT_OUTPUT) { /* @todo */ } } } else { /* Field common to extension / processing / selector / encoding units */ entity_id = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_control_ifdesc_unit_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (subtype == VC_PROCESSING_UNIT) { offset = dissect_usb_video_processing_unit(tree, tvb, offset); } else if (subtype == VC_SELECTOR_UNIT) { offset = dissect_usb_video_selector_unit(tree, tvb, offset); } else if (subtype == VC_EXTENSION_UNIT) { offset = dissect_usb_video_extension_unit(tree, tvb, offset); } else if (subtype == VC_ENCODING_UNIT) { /* @todo UVC 1.5 */ } else { expert_add_info_format(pinfo, subtype_item, &ei_usb_vid_subtype_unknown, "Unknown VC subtype %u", subtype); } } /* Soak up descriptor bytes beyond those we know how to dissect */ if (offset < descriptor_len) { proto_tree_add_item(tree, hf_usb_vid_descriptor_data, tvb, offset, descriptor_len-offset, ENC_NA); /* offset = descriptor_len; */ } if (entity_id != 0) proto_item_append_text(item, " (Entity %d)", entity_id); if (subtype != VC_HEADER && usb_conv_info) { /* Switch to the usb_conv_info of the Video Control interface */ usb_conv_info = get_usb_iface_conv_info(pinfo, usb_conv_info->interfaceNum); video_conv_info = (video_conv_info_t *)usb_conv_info->class_data; if (!video_conv_info) { video_conv_info = wmem_new(wmem_file_scope(), video_conv_info_t); video_conv_info->entities = wmem_tree_new(wmem_file_scope()); usb_conv_info->class_data = video_conv_info; usb_conv_info->class_data_type = USB_CONV_VIDEO; } else if (usb_conv_info->class_data_type != USB_CONV_VIDEO) { /* Stop dissection if another USB type is in the conversation */ return descriptor_len; } entity = (video_entity_t*) wmem_tree_lookup32(video_conv_info->entities, entity_id); if (!entity) { entity = wmem_new(wmem_file_scope(), video_entity_t); entity->entityID = entity_id; entity->subtype = subtype; entity->terminalType = terminal_type; wmem_tree_insert32(video_conv_info->entities, entity_id, entity); } } return descriptor_len; } /*****************************************************************************/ /* VIDEO STREAMING DESCRIPTORS */ /*****************************************************************************/ /* Dissect a Video Streaming Input Header descriptor */ static int dissect_usb_video_streaming_input_header(proto_tree *tree, tvbuff_t *tvb, int offset) { guint8 num_formats; guint8 bm_size; static int * const info_bits[] = { &hf_usb_vid_streaming_info_D[0], NULL }; static int * const control_bits[] = { &hf_usb_vid_streaming_control_D[0], &hf_usb_vid_streaming_control_D[1], &hf_usb_vid_streaming_control_D[2], &hf_usb_vid_streaming_control_D[3], &hf_usb_vid_streaming_control_D[4], &hf_usb_vid_streaming_control_D[5], NULL }; DISSECTOR_ASSERT(array_length(control_bits) == (1+array_length(hf_usb_vid_streaming_control_D))); num_formats = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_streaming_ifdesc_bNumFormats, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_ifdesc_wTotalLength, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); offset += 3; dissect_usb_endpoint_address(tree, tvb, offset); offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_streaming_bmInfo, ett_streaming_info, info_bits, ENC_NA); proto_tree_add_item(tree, hf_usb_vid_streaming_terminal_link, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_streaming_still_capture_method, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_usb_vid_streaming_trigger_support, tvb, offset, 1, ENC_NA); if (tvb_get_guint8(tvb, offset) > 0) { proto_tree_add_item(tree, hf_usb_vid_streaming_trigger_usage, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); } else { proto_tree_add_uint_format_value(tree, hf_usb_vid_streaming_trigger_usage, tvb, offset+1, 1, 0, "Not applicable"); } offset += 2; /* NOTE: Can't use dissect_bmControl here because there's only one size * field for (potentially) multiple bmControl fields */ bm_size = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_bControlSize, tvb, offset, 1, ENC_LITTLE_ENDIAN); ++offset; if (bm_size > 0) { guint8 i; for (i=0; i<num_formats; ++i) { proto_tree_add_bitmask_len(tree, tvb, offset, bm_size, hf_usb_vid_bmControl, ett_streaming_controls, control_bits, &ei_usb_vid_bitmask_len, ENC_LITTLE_ENDIAN); offset += bm_size; } } return offset; } /** * Dissect a known Video Payload Format descriptor. * * @param tree protocol tree to which fields should be added * @param tvb the tv_buff with the (remaining) packet data * @param offset where in tvb to begin dissection. * On entry this refers to the bFormatIndex field. * @param subtype Type of format descriptor, from the * bDescriptorSubtype field * * @return offset within tvb at which dissection should continue */ static int dissect_usb_video_format(proto_tree *tree, tvbuff_t *tvb, int offset, guint8 subtype) { static int * const interlace_bits[] = { &hf_usb_vid_is_interlaced, &hf_usb_vid_interlaced_fields, &hf_usb_vid_field_1_first, &hf_usb_vid_field_pattern, NULL }; proto_item *desc_item; guint8 format_index; /* Augment the descriptor root item with the index of this descriptor */ format_index = tvb_get_guint8(tvb, offset); desc_item = proto_tree_get_parent(tree); proto_item_append_text(desc_item, " (Format %u)", format_index); proto_tree_add_item(tree, hf_usb_vid_format_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_format_num_frame_descriptors, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); offset += 2; if ((subtype == VS_FORMAT_UNCOMPRESSED) || (subtype == VS_FORMAT_FRAME_BASED)) { /* Augment the descriptor root item with the format's four-character-code */ proto_item_append_text(desc_item, ": %s", tvb_format_text(wmem_packet_scope(), tvb, offset, 4)); proto_tree_add_item(tree, hf_usb_vid_format_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_format_bits_per_pixel, tvb, offset+16, 1, ENC_LITTLE_ENDIAN); offset += 17; } else if (subtype == VS_FORMAT_MJPEG) { static int * const flags[] = { &hf_usb_vid_mjpeg_fixed_samples, NULL }; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_mjpeg_flags, ett_mjpeg_flags, flags, ENC_NA); offset++; } else { /* We should only be called for known format descriptor subtypes */ DISSECTOR_ASSERT_NOT_REACHED(); } proto_tree_add_item(tree, hf_usb_vid_default_frame_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_aspect_ratio_x, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_aspect_ratio_y, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; #if 0 /* @todo Display "N/A" if Camera Terminal does not support scanning mode control */ if (something) proto_tree_add_uint_format_value(tree, hf_usb_vid_interlace_flags, tvb, offset, 1, tvb_get_guint8(tvb, offset), "Not applicable"); #endif proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_interlace_flags, ett_interlace_flags, interlace_bits, ENC_NA); offset++; proto_tree_add_item(tree, hf_usb_vid_copy_protect, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; if (subtype == VS_FORMAT_FRAME_BASED) { proto_tree_add_item(tree, hf_usb_vid_variable_size, tvb, offset, 1, ENC_NA); offset++; } return offset; } /** * Dissect a known Video Frame descriptor. * * @param tree protocol tree to which fields should be added * @param tvb the tv_buff with the (remaining) packet data * @param offset where in tvb to begin dissection. * On entry this refers to the bFrameIndex field. * @param subtype Type of frame descriptor, from the * bDescriptorSubtype field * * @return offset within tvb at which dissection should continue */ static int dissect_usb_video_frame(proto_tree *tree, tvbuff_t *tvb, int offset, guint8 subtype) { static int * const capability_bits[] = { &hf_usb_vid_frame_stills_supported, &hf_usb_vid_frame_fixed_frame_rate, NULL }; proto_item *desc_item; guint8 bFrameIntervalType; guint8 frame_index; guint16 frame_width; guint16 frame_height; frame_index = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_frame_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_frame_capabilities, ett_frame_capability_flags, capability_bits, ENC_NA); offset++; proto_tree_add_item(tree, hf_usb_vid_frame_width, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_height, tvb, offset+2, 2, ENC_LITTLE_ENDIAN); /* Augment the descriptor root item with useful information */ frame_width = tvb_get_letohs(tvb, offset); frame_height = tvb_get_letohs(tvb, offset+2); desc_item = proto_tree_get_parent(tree); proto_item_append_text(desc_item, " (Index %2u): %4u x %4u", frame_index, frame_width, frame_height); proto_tree_add_item(tree, hf_usb_vid_frame_min_bit_rate, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_max_bit_rate, tvb, offset+8, 4, ENC_LITTLE_ENDIAN); offset += 12; if (subtype != VS_FRAME_FRAME_BASED) { proto_tree_add_item(tree, hf_usb_vid_frame_max_frame_sz, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } proto_tree_add_item(tree, hf_usb_vid_frame_default_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; bFrameIntervalType = tvb_get_guint8(tvb, offset); if (bFrameIntervalType == 0) { proto_tree_add_uint_format_value(tree, hf_usb_vid_frame_interval_type, tvb, offset, 1, bFrameIntervalType, "Continuous (0)"); offset++; if (subtype == VS_FRAME_FRAME_BASED) { proto_tree_add_item(tree, hf_usb_vid_frame_bytes_per_line, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } proto_tree_add_item(tree, hf_usb_vid_frame_min_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_max_interval, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_step_interval, tvb, offset+8, 4, ENC_LITTLE_ENDIAN); offset += 12; } else { guint8 i; proto_tree_add_uint_format_value(tree, hf_usb_vid_frame_interval_type, tvb, offset, 1, bFrameIntervalType, "Discrete (%u choice%s)", bFrameIntervalType, (bFrameIntervalType > 1) ? "s" : ""); offset++; if (subtype == VS_FRAME_FRAME_BASED) { proto_tree_add_item(tree, hf_usb_vid_frame_bytes_per_line, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } for (i=0; i<bFrameIntervalType; ++i) { proto_tree_add_item(tree, hf_usb_vid_frame_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } } return offset; } /* Dissect a Color Matching descriptor */ static int dissect_usb_video_colorformat(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, hf_usb_vid_color_primaries, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_transfer_characteristics, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_matrix_coefficients, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset +=3; return offset; } /** * Dissector for video class streaming interface descriptors. * * @param parent_tree the protocol tree to be the parent of the descriptor subtree * @param tvb the tv_buff with the (remaining) packet data * On entry the gaze is set to the descriptor length field. * @param descriptor_len Length of the descriptor to dissect * * @return offset within tvb at which dissection should continue */ static int dissect_usb_video_streaming_interface_descriptor(proto_tree *parent_tree, tvbuff_t *tvb, guint8 descriptor_len) { proto_tree *tree; int offset = 0; const gchar *subtype_str; guint8 subtype; subtype = tvb_get_guint8(tvb, offset+2); subtype_str = val_to_str_ext(subtype, &vs_if_descriptor_subtypes_ext, "Unknown (0x%x)"); tree = proto_tree_add_subtree_format(parent_tree, tvb, offset, descriptor_len, ett_descriptor_video_streaming, NULL, "VIDEO STREAMING INTERFACE DESCRIPTOR [%s]", subtype_str); dissect_usb_descriptor_header(tree, tvb, offset, &vid_descriptor_type_vals_ext); proto_tree_add_item(tree, hf_usb_vid_streaming_ifdesc_subtype, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; switch (subtype) { case VS_INPUT_HEADER: offset = dissect_usb_video_streaming_input_header(tree, tvb, offset); break; case VS_FORMAT_UNCOMPRESSED: case VS_FORMAT_MJPEG: case VS_FORMAT_FRAME_BASED: offset = dissect_usb_video_format(tree, tvb, offset, subtype); break; /* @todo MPEG2, H.264, VP8, Still Image Frame */ /* @todo Obsolete UVC-1.0 descriptors? */ case VS_FRAME_UNCOMPRESSED: case VS_FRAME_MJPEG: case VS_FRAME_FRAME_BASED: offset = dissect_usb_video_frame(tree, tvb, offset, subtype); break; case VS_COLORFORMAT: offset = dissect_usb_video_colorformat(tree, tvb, offset); break; default: break; } /* Soak up descriptor bytes beyond those we know how to dissect */ if (offset < descriptor_len) proto_tree_add_item(tree, hf_usb_vid_descriptor_data, tvb, offset, descriptor_len-offset, ENC_NA); return descriptor_len; } /*****************************************************************************/ /** * Dissector for video class-specific endpoint descriptor. * * @param parent_tree the protocol tree to be the parent of the descriptor subtree * @param tvb the tv_buff with the (remaining) packet data * On entry the gaze is set to the descriptor length field. * @param descriptor_len Length of the descriptor to dissect * * @return offset within tvb at which dissection should continue */ static int dissect_usb_video_endpoint_descriptor(proto_tree *parent_tree, tvbuff_t *tvb, guint8 descriptor_len) { proto_tree *tree = NULL; int offset = 0; guint8 subtype; subtype = tvb_get_guint8(tvb, offset+2); if (parent_tree) { const gchar* subtype_str; subtype_str = val_to_str(subtype, vc_ep_descriptor_subtypes, "Unknown (0x%x)"); tree = proto_tree_add_subtree_format(parent_tree, tvb, offset, descriptor_len, ett_descriptor_video_endpoint, NULL, "VIDEO CONTROL ENDPOINT DESCRIPTOR [%s]", subtype_str); } dissect_usb_descriptor_header(tree, tvb, offset, &vid_descriptor_type_vals_ext); proto_tree_add_item(tree, hf_usb_vid_epdesc_subtype, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; if (subtype == EP_INTERRUPT) { proto_tree_add_item(tree, hf_usb_vid_epdesc_max_transfer_sz, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } /* Soak up descriptor bytes beyond those we know how to dissect */ if (offset < descriptor_len) proto_tree_add_item(tree, hf_usb_vid_descriptor_data, tvb, offset, descriptor_len-offset, ENC_NA); return descriptor_len; } /** * Registered dissector for video class-specific descriptors * * @param tvb the tv_buff with the (remaining) packet data * On entry the gaze is set to the descriptor length field. * @param pinfo the packet info of this packet (additional info) * @param tree the protocol tree to be built or NULL * @param data Not used * * @return 0 no class specific dissector was found * @return <0 not enough data * @return >0 amount of data in the descriptor */ static int dissect_usb_vid_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { int offset = 0; guint8 descriptor_len; guint8 descriptor_type; gint bytes_available; usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; tvbuff_t *desc_tvb; descriptor_len = tvb_get_guint8(tvb, offset); descriptor_type = tvb_get_guint8(tvb, offset+1); bytes_available = tvb_captured_length_remaining(tvb, offset); desc_tvb = tvb_new_subset_length_caplen(tvb, 0, bytes_available, descriptor_len); if (descriptor_type == CS_ENDPOINT) { offset = dissect_usb_video_endpoint_descriptor(tree, desc_tvb, descriptor_len); } else if (descriptor_type == CS_INTERFACE) { if (usb_conv_info && usb_conv_info->interfaceSubclass == SC_VIDEOCONTROL) { offset = dissect_usb_video_control_interface_descriptor(tree, desc_tvb, descriptor_len, pinfo, usb_conv_info); } else if (usb_conv_info && usb_conv_info->interfaceSubclass == SC_VIDEOSTREAMING) { offset = dissect_usb_video_streaming_interface_descriptor(tree, desc_tvb, descriptor_len); } } /* else not something we recognize, just return offset = 0 */ return offset; } /*****************************************************************************/ /* CONTROL TRANSFERS */ /*****************************************************************************/ /** * Dissect GET/SET transactions on the Video Probe and Commit controls. * * @param parent_tree protocol tree to which the probe/commit subtree should be added * @param tvb the tv_buff with the (remaining) packet data * @param offset where in tvb to begin dissection. * On entry this refers to the probe/commit bmHint field. * * @return offset within tvb at which dissection should continue */ static int dissect_usb_vid_probe(proto_tree *parent_tree, tvbuff_t *tvb, int offset) { proto_tree *tree; static int * const hint_bits[] = { &hf_usb_vid_probe_hint_D[0], &hf_usb_vid_probe_hint_D[1], &hf_usb_vid_probe_hint_D[2], &hf_usb_vid_probe_hint_D[3], &hf_usb_vid_probe_hint_D[4], NULL }; DISSECTOR_ASSERT(array_length(hint_bits) == (1+array_length(hf_usb_vid_probe_hint_D))); tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_video_probe, NULL, "Probe/Commit Info"); proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_probe_hint, ett_probe_hint, hint_bits, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_format_index, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_index, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_frame_interval, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_key_frame_rate, tvb, offset+8, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_p_frame_rate, tvb, offset+10, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_comp_quality, tvb, offset+12, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_comp_window, tvb, offset+14, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_delay, tvb, offset+16, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_max_frame_sz, tvb, offset+18, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_max_payload_sz, tvb, offset+22, 4, ENC_LITTLE_ENDIAN); offset += 26; /* UVC 1.1 fields */ if (tvb_reported_length_remaining(tvb, offset) > 0) { static int * const framing_bits[] = { &hf_usb_vid_probe_framing_D[0], &hf_usb_vid_probe_framing_D[1], NULL }; DISSECTOR_ASSERT(array_length(framing_bits) == (1+array_length(hf_usb_vid_probe_framing_D))); proto_tree_add_item(tree, hf_usb_vid_probe_clock_freq, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_probe_framing, ett_probe_framing, framing_bits, ENC_NA); offset++; proto_tree_add_item(tree, hf_usb_vid_probe_preferred_ver, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_min_ver, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_vid_probe_max_ver, tvb, offset+2, 1, ENC_LITTLE_ENDIAN); offset += 3; } return offset; } /** * Fetch the table that describes known control selectors for the specified unit/terminal. * * @param entity_id Unit or terminal of interest * @param usb_conv_info Information about the interface the entity is part of * * @return Table describing control selectors for the specified entity (may be NULL) */ static value_string_ext* get_control_selector_values(guint8 entity_id, usb_conv_info_t *usb_conv_info) { video_conv_info_t *video_conv_info; video_entity_t *entity = NULL; value_string_ext *selectors = NULL; if (usb_conv_info == NULL) return NULL; video_conv_info = (video_conv_info_t *)usb_conv_info->class_data; if (video_conv_info) entity = (video_entity_t*) wmem_tree_lookup32(video_conv_info->entities, entity_id); if (entity_id == 0) { /* Interface Request*/ switch (usb_conv_info->interfaceSubclass) { case SC_VIDEOCONTROL: selectors = &cs_control_interface_ext; break; case SC_VIDEOSTREAMING: selectors = &cs_streaming_interface_ext; break; default: break; } } else if (entity) { switch (entity->subtype) { case VC_INPUT_TERMINAL: if (entity->terminalType == ITT_CAMERA) { selectors = &cs_camera_terminal_ext; } break; case VC_PROCESSING_UNIT: selectors = &cs_processing_unit_ext; break; case VC_SELECTOR_UNIT: selectors = &cs_selector_unit_ext; break; default: break; } } return selectors; } /** * Fetch the name of an entity's control. * * @param entity_id Unit or terminal of interest * @param control_sel Control of interest * @param usb_conv_info Information about the interface the entity is part of * * @return Table describing control selectors for the specified entity (may be NULL) */ static const gchar* get_control_selector_name(guint8 entity_id, guint8 control_sel, usb_conv_info_t *usb_conv_info) { const gchar *control_name = NULL; value_string_ext *selectors = NULL; selectors = get_control_selector_values(entity_id, usb_conv_info); if (selectors) control_name = try_val_to_str_ext(control_sel, selectors); return control_name; } /* Dissect the response to a GET INFO request */ static int dissect_usb_vid_control_info(proto_tree *tree, tvbuff_t *tvb, int offset) { static int * const capability_bits[] = { &hf_usb_vid_control_info_D[0], &hf_usb_vid_control_info_D[1], &hf_usb_vid_control_info_D[2], &hf_usb_vid_control_info_D[3], &hf_usb_vid_control_info_D[4], &hf_usb_vid_control_info_D[5], &hf_usb_vid_control_info_D[6], NULL }; DISSECTOR_ASSERT(array_length(capability_bits) == (1+array_length(hf_usb_vid_control_info_D))); proto_tree_add_bitmask(tree, tvb, offset, hf_usb_vid_control_info, ett_control_capabilities, capability_bits, ENC_NA); return offset+1; } /* Dissect all remaining bytes in the tvb as a specified type of UVC value. * These are displayed as an unsigned integer where possible, otherwise just as * a text item. * * @param tree the protocol tree to which an item will be added * @param tvb the tv_buff with the (remaining) packet data * @param offset How far into tvb the value data begins * @param request Identifies type of value - either bRequest from a CONTROL * transfer (i.e., USB_SETUP_GET_MAX), or bValue from an * INTERRUPT transfer (i.e., CONTROL_CHANGE_MAX). */ static void dissect_usb_vid_control_value(proto_tree *tree, tvbuff_t *tvb, int offset, guint8 request) { gint value_size; const char *fallback_name; int hf; switch (request) { case USB_SETUP_GET_DEF: hf = hf_usb_vid_control_default; fallback_name = "Default Value"; break; case USB_SETUP_GET_MIN: case CONTROL_CHANGE_MIN: hf = hf_usb_vid_control_min; fallback_name = "Min Value"; break; case USB_SETUP_GET_MAX: case CONTROL_CHANGE_MAX: hf = hf_usb_vid_control_max; fallback_name = "Max Value"; break; case USB_SETUP_GET_RES: hf = hf_usb_vid_control_res; fallback_name = "Resolution"; break; case USB_SETUP_GET_CUR: case USB_SETUP_SET_CUR: case CONTROL_CHANGE_VALUE: hf = hf_usb_vid_control_cur; fallback_name = "Current Value"; break; /* @todo UVC 1.5 USB_SETUP_x_ALL? * They are poorly specified. */ default: hf = -1; fallback_name = "Value"; break; } value_size = tvb_reported_length_remaining(tvb, offset); if (hf != -1) { header_field_info *hfinfo; hfinfo = proto_registrar_get_nth(hf); DISSECTOR_ASSERT(FT_IS_INT(hfinfo->type) || FT_IS_UINT(hfinfo->type)); } if ((hf != -1) && (value_size <= 4)) { proto_tree_add_item(tree, hf, tvb, offset, value_size, ENC_LITTLE_ENDIAN); } else { /* @todo Display as FT_BYTES with a big-endian disclaimer? * See https://gitlab.com/wireshark/wireshark/-/issues/7933 */ proto_tree_add_bytes_format(tree, hf_usb_vid_control_value, tvb, offset, value_size, NULL, "%s", fallback_name); } } /** * Dissect video class GET/SET transactions. * * @param pinfo Information associated with the packet being dissected * @param tree protocol tree to which fields should be added * @param tvb the tv_buff with the (remaining) packet data * @param offset where in tvb to begin dissection. * On entry this refers to the bRequest field of the SETUP * transaction. * @param is_request true if the packet is host-to-device, * false if device-to-host * @param usb_trans_info Information specific to this request/response pair * @param usb_conv_info Information about the conversation with the host */ static int dissect_usb_vid_get_set(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info) { const gchar *short_name = NULL; guint8 control_sel; guint8 entity_id; entity_id = usb_trans_info->setup.wIndex >> 8; control_sel = usb_trans_info->setup.wValue >> 8; /* Display something informative in the INFO column */ col_append_str(pinfo->cinfo, COL_INFO, " ["); short_name = get_control_selector_name(entity_id, control_sel, usb_conv_info); if (short_name) col_append_str(pinfo->cinfo, COL_INFO, short_name); else { short_name = "Unknown"; if (entity_id == 0) { col_append_fstr(pinfo->cinfo, COL_INFO, "Interface %u control 0x%x", usb_conv_info->interfaceNum, control_sel); } else { col_append_fstr(pinfo->cinfo, COL_INFO, "Unit %u control 0x%x", entity_id, control_sel); } } col_append_str(pinfo->cinfo, COL_INFO, "]"); col_set_fence(pinfo->cinfo, COL_INFO); /* Add information on request context, * as GENERATED fields if not directly available (for filtering) */ if (is_request) { /* Move gaze to control selector (MSB of wValue) */ offset++; proto_tree_add_uint_format_value(tree, hf_usb_vid_control_selector, tvb, offset, 1, control_sel, "%s (0x%02x)", short_name, control_sel); offset++; proto_tree_add_item(tree, hf_usb_vid_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_vid_control_entity, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_usb_vid_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } else { proto_item *ti; ti = proto_tree_add_uint(tree, hf_usb_vid_control_interface, tvb, 0, 0, usb_trans_info->setup.wIndex & 0xFF); proto_item_set_generated(ti); ti = proto_tree_add_uint(tree, hf_usb_vid_control_entity, tvb, 0, 0, entity_id); proto_item_set_generated(ti); ti = proto_tree_add_uint_format_value(tree, hf_usb_vid_control_selector, tvb, 0, 0, control_sel, "%s (0x%02x)", short_name, control_sel); proto_item_set_generated(ti); } if (!is_request || (usb_trans_info->setup.request == USB_SETUP_SET_CUR)) { gint value_size = tvb_reported_length_remaining(tvb, offset); if (value_size != 0) { if ((entity_id == 0) && (usb_conv_info->interfaceSubclass == SC_VIDEOSTREAMING)) { if ((control_sel == VS_PROBE_CONTROL) || (control_sel == VS_COMMIT_CONTROL)) { int old_offset = offset; offset = dissect_usb_vid_probe(tree, tvb, offset); value_size -= (offset - old_offset); } } else { if (usb_trans_info->setup.request == USB_SETUP_GET_INFO) { dissect_usb_vid_control_info(tree, tvb, offset); offset++; value_size--; } else if (usb_trans_info->setup.request == USB_SETUP_GET_LEN) { proto_tree_add_item(tree, hf_usb_vid_control_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; value_size -= 2; } else if ( (usb_trans_info->setup.request == USB_SETUP_GET_CUR) && (entity_id == 0) && (usb_conv_info->interfaceSubclass == SC_VIDEOCONTROL) && (control_sel == VC_REQUEST_ERROR_CODE_CONTROL)) { proto_tree_add_item(tree, hf_usb_vid_request_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; value_size--; } else { dissect_usb_vid_control_value(tree, tvb, offset, usb_trans_info->setup.request); offset += value_size; value_size = 0; } } if (value_size > 0) { proto_tree_add_item(tree, hf_usb_vid_control_data, tvb, offset, -1, ENC_NA); offset += value_size; } } } return offset; } /* Table for dispatch of video class SETUP transactions based on bRequest. * At the moment this is overkill since the same function handles all defined * requests. */ typedef int (*usb_setup_dissector)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info); typedef struct _usb_setup_dissector_table_t { guint8 request; usb_setup_dissector dissector; } usb_setup_dissector_table_t; static const usb_setup_dissector_table_t setup_dissectors[] = { {USB_SETUP_SET_CUR, dissect_usb_vid_get_set}, {USB_SETUP_SET_CUR_ALL, dissect_usb_vid_get_set}, {USB_SETUP_GET_CUR, dissect_usb_vid_get_set}, {USB_SETUP_GET_MIN, dissect_usb_vid_get_set}, {USB_SETUP_GET_MAX, dissect_usb_vid_get_set}, {USB_SETUP_GET_RES, dissect_usb_vid_get_set}, {USB_SETUP_GET_LEN, dissect_usb_vid_get_set}, {USB_SETUP_GET_INFO, dissect_usb_vid_get_set}, {USB_SETUP_GET_DEF, dissect_usb_vid_get_set}, {USB_SETUP_GET_CUR_ALL, dissect_usb_vid_get_set}, {USB_SETUP_GET_MIN_ALL, dissect_usb_vid_get_set}, {USB_SETUP_GET_MAX_ALL, dissect_usb_vid_get_set}, {USB_SETUP_GET_RES_ALL, dissect_usb_vid_get_set}, {0, NULL} }; static const value_string setup_request_names_vals[] = { {USB_SETUP_SET_CUR, "SET CUR"}, {USB_SETUP_SET_CUR_ALL, "SET CUR ALL"}, {USB_SETUP_GET_CUR, "GET CUR"}, {USB_SETUP_GET_MIN, "GET MIN"}, {USB_SETUP_GET_MAX, "GET MAX"}, {USB_SETUP_GET_RES, "GET RES"}, {USB_SETUP_GET_LEN, "GET LEN"}, {USB_SETUP_GET_INFO, "GET INFO"}, {USB_SETUP_GET_DEF, "GET DEF"}, {USB_SETUP_GET_CUR_ALL, "GET CUR ALL"}, {USB_SETUP_GET_MIN_ALL, "GET MIN ALL"}, {USB_SETUP_GET_MAX_ALL, "GET MAX ALL"}, {USB_SETUP_GET_RES_ALL, "GET RES ALL"}, {USB_SETUP_GET_DEF_ALL, "GET DEF ALL"}, {0, NULL} }; /* Registered dissector for video class-specific control requests. * Dispatch to an appropriate dissector function. * * @param tvb the tv_buff with the (remaining) packet data. * On entry, the gaze is set to SETUP bRequest field. * @param pinfo the packet info of this packet (additional info) * @param tree the protocol tree to be built or NULL * @param data Not used * * @return 0 no class specific dissector was found * @return <0 not enough data * @return >0 amount of data in the descriptor */ static int dissect_usb_vid_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gboolean is_request = (pinfo->srcport == NO_ENDPOINT); usb_conv_info_t *usb_conv_info; usb_trans_info_t *usb_trans_info; int offset = 0; usb_setup_dissector dissector = NULL; const usb_setup_dissector_table_t *tmp; /* Reject the packet if data or usb_trans_info are NULL */ if (data == NULL || ((usb_conv_info_t *)data)->usb_trans_info == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; usb_trans_info = usb_conv_info->usb_trans_info; /* See if we can find a class specific dissector for this request */ for (tmp=setup_dissectors; tmp->dissector; tmp++) { if (tmp->request == usb_trans_info->setup.request) { dissector = tmp->dissector; break; } } /* No we could not find any class specific dissector for this request * return FALSE and let USB try any of the standard requests. */ if (!dissector) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBVIDEO"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"), is_request?"Request ":"Response"); if (is_request) { proto_tree_add_item(tree, hf_usb_vid_request, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } offset = dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info); return offset; } /* Registered dissector for video class-specific URB_INTERRUPT * * @param tvb the tv_buff with the (remaining) packet data * @param pinfo the packet info of this packet (additional info) * @param tree the protocol tree to be built or NULL * @param data Unused API parameter * * @return 0 no class specific dissector was found * @return <0 not enough data * @return >0 amount of data in the descriptor */ static int dissect_usb_vid_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { usb_conv_info_t *usb_conv_info; gint bytes_available; int offset = 0; usb_conv_info = (usb_conv_info_t *)data; bytes_available = tvb_reported_length_remaining(tvb, offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBVIDEO"); if (bytes_available > 0) { guint8 originating_interface; guint8 originating_entity; originating_interface = tvb_get_guint8(tvb, offset) & INT_ORIGINATOR_MASK; proto_tree_add_item(tree, hf_usb_vid_interrupt_bStatusType, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; originating_entity = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_interrupt_bOriginator, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; if (originating_interface == INT_VIDEOCONTROL) { guint8 control_sel; guint8 attribute; const gchar *control_name; proto_tree_add_item(tree, hf_usb_vid_control_interrupt_bEvent, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; control_sel = tvb_get_guint8(tvb, offset); control_name = get_control_selector_name(originating_entity, control_sel, usb_conv_info); if (!control_name) control_name = "Unknown"; proto_tree_add_uint_format_value(tree, hf_usb_vid_control_selector, tvb, offset, 1, control_sel, "%s (0x%02x)", control_name, control_sel); offset++; attribute = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_vid_interrupt_bAttribute, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; switch (attribute) { case CONTROL_CHANGE_FAILURE: proto_tree_add_item(tree, hf_usb_vid_request_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; break; case CONTROL_CHANGE_INFO: offset = dissect_usb_vid_control_info(tree, tvb, offset); break; case CONTROL_CHANGE_VALUE: case CONTROL_CHANGE_MIN: case CONTROL_CHANGE_MAX: dissect_usb_vid_control_value(tree, tvb, offset, attribute); offset += tvb_reported_length_remaining(tvb, offset); break; default: proto_tree_add_item(tree, hf_usb_vid_value_data, tvb, offset, -1, ENC_NA); offset += tvb_reported_length_remaining(tvb, offset); break; } } else if (originating_interface == INT_VIDEOSTREAMING) { /* @todo */ } } else offset = -2; return offset; } void proto_register_usb_vid(void) { static hf_register_info hf[] = { /***** Setup *****/ { &hf_usb_vid_request, { "bRequest", "usbvideo.setup.bRequest", FT_UINT8, BASE_HEX, VALS(setup_request_names_vals), 0x0, NULL, HFILL } }, { &hf_usb_vid_length, { "wLength", "usbvideo.setup.wLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /***** Request Error Control *****/ { &hf_usb_vid_request_error, { "bRequestErrorCode", "usbvideo.reqerror.code", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &request_error_codes_ext, 0, "Request Error Code", HFILL } }, /***** Unit/Terminal Controls *****/ { &hf_usb_vid_control_selector, { "Control Selector", "usbvideo.control.selector", FT_UINT8, BASE_HEX, NULL, 0x0, "ID of the control within its entity", HFILL } }, { &hf_usb_vid_control_entity, { "Entity", "usbvideo.control.entity", FT_UINT8, BASE_HEX, NULL, 0x0, "Unit or terminal to which the control belongs", HFILL } }, { &hf_usb_vid_control_interface, { "Interface", "usbvideo.control.interface", FT_UINT8, BASE_HEX, NULL, 0x0, "Interface to which the control belongs", HFILL } }, { &hf_usb_vid_control_info, { "Info (Capabilities/State)", "usbvideo.control.info", FT_UINT8, BASE_HEX, NULL, 0, "Control capabilities and current state", HFILL } }, { &hf_usb_vid_control_info_D[0], { "Supports GET", "usbvideo.control.info.D0", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, { &hf_usb_vid_control_info_D[1], { "Supports SET", "usbvideo.control.info.D1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_control_info_D[2], { "Disabled due to automatic mode", "usbvideo.control.info.D2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<2), NULL, HFILL } }, { &hf_usb_vid_control_info_D[3], { "Autoupdate", "usbvideo.control.info.D3", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<3), NULL, HFILL } }, { &hf_usb_vid_control_info_D[4], { "Asynchronous", "usbvideo.control.info.D4", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<4), NULL, HFILL } }, { &hf_usb_vid_control_info_D[5], { "Disabled due to incompatibility with Commit state", "usbvideo.control.info.D5", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<5), NULL, HFILL } }, { &hf_usb_vid_control_info_D[6], { "Reserved", "usbvideo.control.info.D6", FT_UINT8, BASE_HEX, NULL, (3<<6), NULL, HFILL } }, { &hf_usb_vid_control_length, { "Control Length", "usbvideo.control.len", FT_UINT16, BASE_DEC, NULL, 0, "Control size in bytes", HFILL } }, { &hf_usb_vid_control_default, { "Default value", "usbvideo.control.value.default", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_control_min, { "Minimum value", "usbvideo.control.value.min", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_control_max, { "Maximum value", "usbvideo.control.value.max", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_control_res, { "Resolution", "usbvideo.control.value.res", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_control_cur, { "Current value", "usbvideo.control.value.cur", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, /***** Terminal Descriptors *****/ /* @todo Decide whether to unify .name fields */ { &hf_usb_vid_control_ifdesc_iTerminal, { "iTerminal", "usbvideo.terminal.name", FT_UINT8, BASE_DEC, NULL, 0x0, "String Descriptor describing this terminal", HFILL } }, /* @todo Decide whether to unify .terminal.id and .unit.id under .entityID */ { &hf_usb_vid_control_ifdesc_terminal_id, { "bTerminalID", "usbvideo.terminal.id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_control_ifdesc_terminal_type, { "wTerminalType", "usbvideo.terminal.type", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &vc_terminal_types_ext, 0, NULL, HFILL } }, { &hf_usb_vid_control_ifdesc_assoc_terminal, { "bAssocTerminal", "usbvideo.terminal.assocTerminal", FT_UINT8, BASE_DEC, NULL, 0x0, "Associated Terminal", HFILL } }, /***** Camera Terminal Descriptor *****/ { &hf_usb_vid_cam_objective_focal_len_min, { "wObjectiveFocalLengthMin", "usbvideo.camera.objectiveFocalLengthMin", FT_UINT16, BASE_DEC, NULL, 0, "Minimum Focal Length for Optical Zoom", HFILL } }, { &hf_usb_vid_cam_objective_focal_len_max, { "wObjectiveFocalLengthMax", "usbvideo.camera.objectiveFocalLengthMax", FT_UINT16, BASE_DEC, NULL, 0, "Minimum Focal Length for Optical Zoom", HFILL } }, { &hf_usb_vid_cam_ocular_focal_len, { "wOcularFocalLength", "usbvideo.camera.ocularFocalLength", FT_UINT16, BASE_DEC, NULL, 0, "Ocular Focal Length for Optical Zoom", HFILL } }, { &hf_usb_vid_cam_control_D[0], { "Scanning Mode", "usbvideo.camera.control.D0", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[1], { "Auto Exposure Mode", "usbvideo.camera.control.D1", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[2], { "Auto Exposure Priority", "usbvideo.camera.control.D2", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<2), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[3], { "Exposure Time (Absolute)", "usbvideo.camera.control.D3", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<3), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[4], { "Exposure Time (Relative)", "usbvideo.camera.control.D4", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<4), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[5], { "Focus (Absolute)", "usbvideo.camera.control.D5", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<5), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[6], { "Focus (Relative)", "usbvideo.camera.control.D6", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<6), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[7], { "Iris (Absolute)", "usbvideo.camera.control.D7", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<7), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[8], { "Iris (Relative)", "usbvideo.camera.control.D8", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<8), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[9], { "Zoom (Absolute)", "usbvideo.camera.control.D9", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<9), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[10], { "Zoom (Relative)", "usbvideo.camera.control.D10", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<10), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[11], { "PanTilt (Absolute)", "usbvideo.camera.control.D11", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<11), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[12], { "PanTilt (Relative)", "usbvideo.camera.control.D12", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<12), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[13], { "Roll (Absolute)", "usbvideo.camera.control.D13", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<13), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[14], { "Roll (Relative)", "usbvideo.camera.control.D14", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<14), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[15], { "D15", "usbvideo.camera.control.D15", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<15), "Reserved", HFILL } }, { &hf_usb_vid_cam_control_D[16], { "D16", "usbvideo.camera.control.D16", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<16), "Reserved", HFILL } }, { &hf_usb_vid_cam_control_D[17], { "Auto Focus", "usbvideo.camera.control.D17", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<17), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[18], { "Privacy", "usbvideo.camera.control.D18", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<18), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[19], { "Focus (Simple)", "usbvideo.camera.control.D19", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<19), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[20], { "Window", "usbvideo.camera.control.D20", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<20), NULL, HFILL } }, { &hf_usb_vid_cam_control_D[21], { "Region of Interest", "usbvideo.camera.control.D21", FT_BOOLEAN, array_length(hf_usb_vid_cam_control_D), TFS(&tfs_yes_no), (1<<21), NULL, HFILL } }, /***** Unit Descriptors *****/ { &hf_usb_vid_control_ifdesc_unit_id, { "bUnitID", "usbvideo.unit.id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_num_inputs, { "bNrInPins", "usbvideo.unit.numInputs", FT_UINT8, BASE_DEC, NULL, 0, "Number of input pins", HFILL } }, { &hf_usb_vid_sources, { "baSourceID", "usbvideo.unit.sources", FT_BYTES, BASE_NONE, NULL, 0, "Input entity IDs", HFILL } }, /***** Processing Unit Descriptor *****/ { &hf_usb_vid_iProcessing, { "iProcessing", "usbvideo.processor.name", FT_UINT8, BASE_DEC, NULL, 0x0, "String Descriptor describing this terminal", HFILL } }, { &hf_usb_vid_proc_control_D[0], { "Brightness", "usbvideo.processor.control.D0", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[1], { "Contrast", "usbvideo.processor.control.D1", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[2], { "Hue", "usbvideo.processor.control.D2", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<2), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[3], { "Saturation", "usbvideo.processor.control.D3", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<3), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[4], { "Sharpness", "usbvideo.processor.control.D4", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<4), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[5], { "Gamma", "usbvideo.processor.control.D5", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<5), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[6], { "White Balance Temperature", "usbvideo.processor.control.D6", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<6), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[7], { "White Balance Component", "usbvideo.processor.control.D7", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<7), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[8], { "Backlight Compensation", "usbvideo.processor.control.D8", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<8), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[9], { "Gain", "usbvideo.processor.control.D9", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<9), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[10], { "Power Line Frequency", "usbvideo.processor.control.D10", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<10), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[11], { "Hue, Auto", "usbvideo.processor.control.D11", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<11), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[12], { "White Balance Temperature, Auto", "usbvideo.processor.control.D12", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<12), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[13], { "White Balance Component, Auto", "usbvideo.processor.control.D13", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<13), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[14], { "Digital Multiplier", "usbvideo.processor.control.D14", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<14), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[15], { "Digital Multiplier Limit", "usbvideo.processor.control.D15", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<15), "Reserved", HFILL } }, { &hf_usb_vid_proc_control_D[16], { "Analog Video Standard", "usbvideo.processor.control.D16", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<16), "Reserved", HFILL } }, { &hf_usb_vid_proc_control_D[17], { "Analog Video Lock Status", "usbvideo.processor.control.D17", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<17), NULL, HFILL } }, { &hf_usb_vid_proc_control_D[18], { "Contrast, Auto", "usbvideo.processor.control.D18", FT_BOOLEAN, 24, TFS(&tfs_yes_no), (1<<18), NULL, HFILL } }, { &hf_usb_vid_proc_standards, { "bmVideoStandards", "usbvideo.processor.standards", FT_UINT8, BASE_HEX, NULL, 0, "Supported analog video standards", HFILL } }, { &hf_usb_vid_proc_standards_D[0], { "None", "usbvideo.processor.standards.D0", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, { &hf_usb_vid_proc_standards_D[1], { "NTSC - 525/60", "usbvideo.processor.standards.D1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_proc_standards_D[2], { "PAL - 625/50", "usbvideo.processor.standards.D2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<2), NULL, HFILL } }, { &hf_usb_vid_proc_standards_D[3], { "SECAM - 625/50", "usbvideo.processor.standards.D3", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<3), NULL, HFILL } }, { &hf_usb_vid_proc_standards_D[4], { "NTSC - 625/50", "usbvideo.processor.standards.D4", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<4), NULL, HFILL } }, { &hf_usb_vid_proc_standards_D[5], { "PAL - 525/60", "usbvideo.processor.standards.D5", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<5), NULL, HFILL } }, { &hf_usb_vid_max_multiplier, { "wMaxMultiplier", "usbvideo.processor.maxMultiplier", FT_UINT16, BASE_DEC, NULL, 0, "100 x max digital multiplication", HFILL } }, /***** Selector Unit Descriptor *****/ { &hf_usb_vid_iSelector, { "iSelector", "usbvideo.selector.name", FT_UINT8, BASE_DEC, NULL, 0x0, "String Descriptor describing this terminal", HFILL } }, /***** Extension Unit Descriptor *****/ { &hf_usb_vid_iExtension, { "iExtension", "usbvideo.extension.name", FT_UINT8, BASE_DEC, NULL, 0x0, "String Descriptor describing this terminal", HFILL } }, { &hf_usb_vid_exten_guid, { "guid", "usbvideo.extension.guid", FT_GUID, BASE_NONE, NULL, 0, "Identifier", HFILL } }, { &hf_usb_vid_exten_num_controls, { "bNumControls", "usbvideo.extension.numControls", FT_UINT8, BASE_DEC, NULL, 0, "Number of controls", HFILL } }, /***** Probe/Commit *****/ { &hf_usb_vid_probe_hint, { "bmHint", "usbvideo.probe.hint", FT_UINT16, BASE_HEX, NULL, 0, "Fields to hold constant during negotiation", HFILL } }, { &hf_usb_vid_probe_hint_D[0], { "dwFrameInterval", "usbvideo.probe.hint.D0", FT_BOOLEAN, 5, TFS(&probe_hint_meaning), (1<<0), "Frame Rate", HFILL } }, { &hf_usb_vid_probe_hint_D[1], { "wKeyFrameRate", "usbvideo.probe.hint.D1", FT_BOOLEAN, 5, TFS(&probe_hint_meaning), (1<<1), "Key Frame Rate", HFILL } }, { &hf_usb_vid_probe_hint_D[2], { "wPFrameRate", "usbvideo.probe.hint.D2", FT_BOOLEAN, 5, TFS(&probe_hint_meaning), (1<<2), "P-Frame Rate", HFILL } }, { &hf_usb_vid_probe_hint_D[3], { "wCompQuality", "usbvideo.probe.hint.D3", FT_BOOLEAN, 5, TFS(&probe_hint_meaning), (1<<3), "Compression Quality", HFILL } }, { &hf_usb_vid_probe_hint_D[4], { "wCompWindowSize", "usbvideo.probe.hint.D4", FT_BOOLEAN, 5, TFS(&probe_hint_meaning), (1<<4), "Compression Window Size", HFILL } }, { &hf_usb_vid_probe_key_frame_rate, { "wKeyFrameRate", "usbvideo.probe.keyFrameRate", FT_UINT16, BASE_DEC, NULL, 0, "Key frame rate", HFILL } }, { &hf_usb_vid_probe_p_frame_rate, { "wPFrameRate", "usbvideo.probe.pFrameRate", FT_UINT16, BASE_DEC, NULL, 0, "P frame rate", HFILL } }, { &hf_usb_vid_probe_comp_quality, { "wCompQuality", "usbvideo.probe.compQuality", FT_UINT16, BASE_DEC, NULL, 0, "Compression quality [0-10000]", HFILL } }, { &hf_usb_vid_probe_comp_window, { "wCompWindow", "usbvideo.probe.compWindow", FT_UINT16, BASE_DEC, NULL, 0, "Window size for average bit rate control", HFILL } }, { &hf_usb_vid_probe_delay, { "wDelay", "usbvideo.probe.delay", FT_UINT16, BASE_DEC, NULL, 0, "Latency in ms from capture to USB", HFILL } }, { &hf_usb_vid_probe_max_frame_sz, { "dwMaxVideoFrameSize", "usbvideo.probe.maxVideoFrameSize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_probe_max_payload_sz, { "dwMaxPayloadTransferSize", "usbvideo.probe.maxPayloadTransferSize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_probe_clock_freq, { "dwClockFrequency", "usbvideo.probe.clockFrequency", FT_UINT32, BASE_DEC, NULL, 0, "Device clock frequency in Hz", HFILL } }, { &hf_usb_vid_probe_framing, { "bmFramingInfo", "usbvideo.probe.framing", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_usb_vid_probe_framing_D[0], { "Frame ID required", "usbvideo.probe.framing.D0", FT_BOOLEAN, 2, TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, { &hf_usb_vid_probe_framing_D[1], { "EOF utilized", "usbvideo.probe.framing.D1", FT_BOOLEAN, 2, TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_probe_preferred_ver, { "bPreferredVersion", "usbvideo.probe.preferredVersion", FT_UINT8, BASE_DEC, NULL, 0, "Preferred payload format version", HFILL } }, { &hf_usb_vid_probe_min_ver, { "bMinVersion", "usbvideo.probe.minVersion", FT_UINT8, BASE_DEC, NULL, 0, "Min supported payload format version", HFILL } }, { &hf_usb_vid_probe_max_ver, { "bMaxVersion", "usbvideo.probe.maxVer", FT_UINT8, BASE_DEC, NULL, 0, "Max supported payload format version", HFILL } }, { &hf_usb_vid_control_ifdesc_dwClockFrequency, { "dwClockFrequency", "usbvideo.probe.clockFrequency", FT_UINT32, BASE_DEC, NULL, 0, "Device clock frequency (Hz) for selected format", HFILL } }, /***** Format Descriptors *****/ { &hf_usb_vid_format_index, { "bFormatIndex", "usbvideo.format.index", FT_UINT8, BASE_DEC, NULL, 0, "Index of this format descriptor", HFILL } }, { &hf_usb_vid_format_num_frame_descriptors, { "bNumFrameDescriptors", "usbvideo.format.numFrameDescriptors", FT_UINT8, BASE_DEC, NULL, 0, "Number of frame descriptors for this format", HFILL } }, { &hf_usb_vid_format_guid, { "guidFormat", "usbvideo.format.guid", FT_GUID, BASE_NONE, NULL, 0, "Stream encoding format", HFILL } }, { &hf_usb_vid_format_bits_per_pixel, { "bBitsPerPixel", "usbvideo.format.bitsPerPixel", FT_UINT8, BASE_DEC, NULL, 0, "Bits per pixel", HFILL } }, { &hf_usb_vid_default_frame_index, { "bDefaultFrameIndex", "usbvideo.format.defaultFrameIndex", FT_UINT8, BASE_DEC, NULL, 0, "Optimum frame index for this stream", HFILL } }, { &hf_usb_vid_aspect_ratio_x, { "bAspectRatioX", "usbvideo.format.aspectRatioX", FT_UINT8, BASE_DEC, NULL, 0, "X dimension of picture aspect ratio", HFILL } }, { &hf_usb_vid_aspect_ratio_y, { "bAspectRatioY", "usbvideo.format.aspectRatioY", FT_UINT8, BASE_DEC, NULL, 0, "Y dimension of picture aspect ratio", HFILL } }, { &hf_usb_vid_interlace_flags, { "bmInterlaceFlags", "usbvideo.format.interlace", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_is_interlaced, { "Interlaced stream", "usbvideo.format.interlace.D0", FT_BOOLEAN, 8, TFS(&is_interlaced_meaning), (1<<0), NULL, HFILL } }, { &hf_usb_vid_interlaced_fields, { "Fields per frame", "usbvideo.format.interlace.D1", FT_BOOLEAN, 8, TFS(&interlaced_fields_meaning), (1<<1), NULL, HFILL } }, { &hf_usb_vid_field_1_first, { "Field 1 first", "usbvideo.format.interlace.D2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<2), NULL, HFILL } }, { &hf_usb_vid_field_pattern, { "Field pattern", "usbvideo.format.interlace.pattern", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &field_pattern_meaning_ext, (3<<4), NULL, HFILL } }, { &hf_usb_vid_copy_protect, { "bCopyProtect", "usbvideo.format.copyProtect", FT_UINT8, BASE_DEC, VALS(copy_protect_meaning), 0, NULL, HFILL } }, { &hf_usb_vid_variable_size, { "Variable size", "usbvideo.format.variableSize", FT_BOOLEAN, BASE_DEC, NULL, 0, NULL, HFILL } }, /***** MJPEG Format Descriptor *****/ { &hf_usb_vid_mjpeg_flags, { "bmFlags", "usbvideo.mjpeg.flags", FT_UINT8, BASE_HEX, NULL, 0, "Characteristics", HFILL } }, { &hf_usb_vid_mjpeg_fixed_samples, { "Fixed size samples", "usbvideo.mjpeg.fixed_size", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<0), NULL, HFILL } }, /***** Frame Descriptors *****/ { &hf_usb_vid_frame_index, { "bFrameIndex", "usbvideo.frame.index", FT_UINT8, BASE_DEC, NULL, 0, "Index of this frame descriptor", HFILL } }, { &hf_usb_vid_frame_capabilities, { "bmCapabilities", "usbvideo.frame.capabilities", FT_UINT8, BASE_HEX, NULL, 0, "Capabilities", HFILL } }, { &hf_usb_vid_frame_stills_supported, { "Still image", "usbvideo.frame.stills", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), (1<<0), NULL, HFILL } }, { &hf_usb_vid_frame_interval, { "dwFrameInterval", "usbvideo.frame.interval", FT_UINT32, BASE_DEC, NULL, 0, "Frame interval multiple of 100 ns", HFILL } }, { &hf_usb_vid_frame_fixed_frame_rate, { "Fixed frame rate", "usbvideo.frame.fixedRate", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<1), NULL, HFILL } }, { &hf_usb_vid_frame_width, { "wWidth", "usbvideo.frame.width", FT_UINT16, BASE_DEC, NULL, 0, "Width of frame in pixels", HFILL } }, { &hf_usb_vid_frame_height, { "wHeight", "usbvideo.frame.height", FT_UINT16, BASE_DEC, NULL, 0, "Height of frame in pixels", HFILL } }, { &hf_usb_vid_frame_min_bit_rate, { "dwMinBitRate", "usbvideo.frame.minBitRate", FT_UINT32, BASE_DEC, NULL, 0, "Minimum bit rate in bps", HFILL } }, { &hf_usb_vid_frame_max_bit_rate, { "dwMaxBitRate", "usbvideo.frame.maxBitRate", FT_UINT32, BASE_DEC, NULL, 0, "Maximum bit rate in bps", HFILL } }, { &hf_usb_vid_frame_max_frame_sz, { "dwMaxVideoFrameBufferSize", "usbvideo.frame.maxBuffer", FT_UINT32, BASE_DEC, NULL, 0, "Maximum bytes per frame", HFILL } }, { &hf_usb_vid_frame_default_interval, { "dwDefaultFrameInterval", "usbvideo.frame.interval.default", FT_UINT32, BASE_DEC, NULL, 0, "Suggested default", HFILL } }, { &hf_usb_vid_frame_interval_type, { "bFrameIntervalType", "usbvideo.frame.interval.type", FT_UINT8, BASE_DEC, NULL, 0, "Frame rate control (continuous/discrete)", HFILL } }, { &hf_usb_vid_frame_min_interval, { "dwMinFrameInterval", "usbvideo.frame.interval.min", FT_UINT32, BASE_DEC, NULL, 0, "Shortest frame interval (* 100 ns)", HFILL } }, { &hf_usb_vid_frame_max_interval, { "dwMaxFrameInterval", "usbvideo.frame.interval.max", FT_UINT32, BASE_DEC, NULL, 0, "Longest frame interval (* 100 ns)", HFILL } }, { &hf_usb_vid_frame_step_interval, { "dwMinFrameInterval", "usbvideo.frame.interval.step", FT_UINT32, BASE_DEC, NULL, 0, "Granularity of frame interval (* 100 ns)", HFILL } }, { &hf_usb_vid_frame_bytes_per_line, { "dwBytesPerLine", "usbvideo.frame.bytesPerLine", FT_UINT32, BASE_DEC, NULL, 0, "Fixed number of bytes per video line", HFILL } }, /***** Colorformat Descriptor *****/ { &hf_usb_vid_color_primaries, { "bColorPrimaries", "usbvideo.color.primaries", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &color_primaries_meaning_ext, 0, NULL, HFILL } }, { &hf_usb_vid_transfer_characteristics, { "bTransferCharacteristics", "usbvideo.color.transferCharacteristics", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &color_transfer_characteristics_ext, 0, NULL, HFILL } }, { &hf_usb_vid_matrix_coefficients, { "bMatrixCoefficients", "usbvideo.color.matrixCoefficients", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &matrix_coefficients_meaning_ext, 0, NULL, HFILL } }, /***** Video Control Header Descriptor *****/ { &hf_usb_vid_control_ifdesc_bcdUVC, { "bcdUVC", "usbvideo.bcdUVC", FT_UINT16, BASE_HEX, NULL, 0, "Video Device Class Specification release number", HFILL } }, { &hf_usb_vid_control_ifdesc_bInCollection, { "bInCollection", "usbvideo.numStreamingInterfaces", FT_UINT8, BASE_DEC, NULL, 0, "Number of VideoStreaming interfaces", HFILL } }, { &hf_usb_vid_control_ifdesc_baInterfaceNr, { "baInterfaceNr", "usbvideo.streamingInterfaceNumbers", FT_BYTES, BASE_NONE, NULL, 0, "Interface numbers of VideoStreaming interfaces", HFILL }}, /***** Video Streaming Input Header Descriptor *****/ { &hf_usb_vid_streaming_ifdesc_bNumFormats, { "bNumFormats", "usbvideo.streaming.numFormats", FT_UINT8, BASE_DEC, NULL, 0, "Number of video payload format descriptors", HFILL } }, { &hf_usb_vid_streaming_bmInfo, { "bmInfo", "usbvideo.streaming.info", FT_UINT8, BASE_HEX, NULL, 0, "Capabilities", HFILL } }, { &hf_usb_vid_streaming_info_D[0], { "Dynamic Format Change", "usbvideo.streaming.info.D0", FT_BOOLEAN, 8, TFS(&tfs_yes_no), (1<<0), "Dynamic Format Change", HFILL } }, { &hf_usb_vid_streaming_control_D[0], { "wKeyFrameRate", "usbvideo.streaming.control.D0", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<0), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_control_D[1], { "wPFrameRate", "usbvideo.streaming.control.D1", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<1), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_control_D[2], { "wCompQuality", "usbvideo.streaming.control.D2", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<2), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_control_D[3], { "wCompWindowSize", "usbvideo.streaming.control.D3", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<3), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_control_D[4], { "Generate Key Frame", "usbvideo.streaming.control.D4", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<4), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_control_D[5], { "Update Frame Segment", "usbvideo.streaming.control.D5", FT_BOOLEAN, 6, TFS(&tfs_yes_no), (1<<5), "Probe and Commit support", HFILL } }, { &hf_usb_vid_streaming_terminal_link, { "bTerminalLink", "usbvideo.streaming.terminalLink", FT_UINT8, BASE_DEC, NULL, 0x0, "Output terminal ID", HFILL } }, { &hf_usb_vid_streaming_still_capture_method, { "bStillCaptureMethod", "usbvideo.streaming.stillCaptureMethod", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &vs_still_capture_methods_ext, 0, "Method of Still Image Capture", HFILL } }, { &hf_usb_vid_streaming_trigger_support, { "HW Triggering", "usbvideo.streaming.triggerSupport", FT_BOOLEAN, BASE_DEC, TFS(&tfs_supported_not_supported), 0, "Is HW triggering supported", HFILL } }, { &hf_usb_vid_streaming_trigger_usage, { "bTriggerUsage", "usbvideo.streaming.triggerUsage", FT_UINT8, BASE_DEC, VALS(vs_trigger_usage), 0, "How host SW should respond to trigger", HFILL } }, /***** Interrupt URB *****/ { &hf_usb_vid_interrupt_bStatusType, { "Status Type", "usbvideo.interrupt.statusType", FT_UINT8, BASE_HEX, VALS(interrupt_status_types), 0xF, NULL, HFILL } }, { &hf_usb_vid_interrupt_bAttribute, { "Change Type", "usbvideo.interrupt.attribute", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &control_change_types_ext, 0, "Type of control change", HFILL } }, { &hf_usb_vid_interrupt_bOriginator, { "Originator", "usbvideo.interrupt.originator", FT_UINT8, BASE_DEC, NULL, 0, "ID of the entity that reports this interrupt", HFILL } }, { &hf_usb_vid_control_interrupt_bEvent, { "Event", "usbvideo.interrupt.controlEvent", FT_UINT8, BASE_HEX, VALS(control_interrupt_events), 0, "Type of event", HFILL } }, /***** Video Control Endpoint Descriptor *****/ { &hf_usb_vid_epdesc_subtype, { "Subtype", "usbvideo.ep.descriptorSubType", FT_UINT8, BASE_DEC, VALS(vc_ep_descriptor_subtypes), 0, "Descriptor Subtype", HFILL } }, { &hf_usb_vid_epdesc_max_transfer_sz, { "wMaxTransferSize", "usbvideo.ep.maxInterruptSize", FT_UINT16, BASE_DEC, NULL, 0x0, "Max interrupt structure size", HFILL } }, /***** Fields used in multiple contexts *****/ { &hf_usb_vid_ifdesc_wTotalLength, { "wTotalLength", "usbvideo.totalLength", FT_UINT16, BASE_DEC, NULL, 0, "Video interface descriptor size", HFILL } }, { &hf_usb_vid_bControlSize, { "bControlSize", "usbvideo.bmcontrolSize", FT_UINT8, BASE_DEC, NULL, 0, "Size of bmControls field", HFILL } }, { &hf_usb_vid_bmControl, { "bmControl", "usbvideo.availableControls", FT_UINT32, BASE_HEX, NULL, 0, "Available controls", HFILL } }, { &hf_usb_vid_bmControl_bytes, { "bmControl", "usbvideo.availableControls.bytes", FT_BYTES, BASE_NONE, NULL, 0, "Available controls", HFILL } }, { &hf_usb_vid_control_ifdesc_src_id, { "bSourceID", "usbvideo.sourceID", FT_UINT8, BASE_DEC, NULL, 0x0, "Entity to which this terminal/unit is connected", HFILL } }, /**********/ { &hf_usb_vid_control_ifdesc_subtype, { "Subtype", "usbvideo.control.descriptorSubType", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &vc_if_descriptor_subtypes_ext, 0, "Descriptor Subtype", HFILL } }, { &hf_usb_vid_streaming_ifdesc_subtype, { "Subtype", "usbvideo.streaming.descriptorSubType", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &vs_if_descriptor_subtypes_ext, 0, "Descriptor Subtype", HFILL } }, { &hf_usb_vid_descriptor_data, { "Descriptor data", "usbvideo.descriptor_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_control_data, { "Control data", "usbvideo.control_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_control_value, { "Control value", "usbvideo.control_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_vid_value_data, { "Value data", "usbvideo.value_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *usb_vid_subtrees[] = { &ett_usb_vid, &ett_descriptor_video_endpoint, &ett_descriptor_video_control, &ett_descriptor_video_streaming, &ett_camera_controls, &ett_processing_controls, &ett_streaming_controls, &ett_streaming_info, &ett_interlace_flags, &ett_frame_capability_flags, &ett_mjpeg_flags, &ett_video_probe, &ett_probe_hint, &ett_probe_framing, &ett_video_standards, &ett_control_capabilities }; static ei_register_info ei[] = { { &ei_usb_vid_subtype_unknown, { "usbvideo.subtype.unknown", PI_UNDECODED, PI_WARN, "Unknown VC subtype", EXPFILL }}, { &ei_usb_vid_bitmask_len, { "usbvideo.bitmask_len_error", PI_UNDECODED, PI_WARN, "Only least-significant bytes decoded", EXPFILL }}, }; expert_module_t* expert_usb_vid; proto_usb_vid = proto_register_protocol("USB Video", "USBVIDEO", "usbvideo"); proto_register_field_array(proto_usb_vid, hf, array_length(hf)); proto_register_subtree_array(usb_vid_subtrees, array_length(usb_vid_subtrees)); expert_usb_vid = expert_register_protocol(proto_usb_vid); expert_register_field_array(expert_usb_vid, ei, array_length(ei)); } void proto_reg_handoff_usb_vid(void) { dissector_handle_t usb_vid_control_handle; dissector_handle_t usb_vid_descriptor_handle; dissector_handle_t usb_vid_interrupt_handle; usb_vid_control_handle = create_dissector_handle(dissect_usb_vid_control, proto_usb_vid); dissector_add_uint("usb.control", IF_CLASS_VIDEO, usb_vid_control_handle); usb_vid_descriptor_handle = create_dissector_handle(dissect_usb_vid_descriptor, proto_usb_vid); dissector_add_uint("usb.descriptor", IF_CLASS_VIDEO, usb_vid_descriptor_handle); usb_vid_interrupt_handle = create_dissector_handle(dissect_usb_vid_interrupt, proto_usb_vid); dissector_add_uint("usb.interrupt", IF_CLASS_VIDEO, usb_vid_interrupt_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usb.c
/* packet-usb.c * * USB basic dissector * By Paolo Abeni <[email protected]> * Ronnie Sahlberg 2006 * * http://www.usb.org/developers/docs/usb_20_122909-2.zip * * https://github.com/torvalds/linux/blob/master/Documentation/usb/usbmon.rst * * http://desowin.org/usbpcap/captureformat.html * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/addr_resolv.h> #include <epan/address_types.h> #include <epan/conversation_table.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/decode_as.h> #include <epan/proto_data.h> #include <wsutil/pint.h> #include <wsutil/ws_roundup.h> #include "packet-usb.h" #include "packet-mausb.h" #include "packet-usbip.h" #include "packet-netmon.h" /* protocols and header fields */ static int proto_usb = -1; static int proto_usbport = -1; /* USB pseudoheader fields, both FreeBSD and Linux */ static int hf_usb_totlen = -1; static int hf_usb_busunit = -1; static int hf_usb_address = -1; static int hf_usb_mode = -1; static int hf_usb_freebsd_urb_type = -1; static int hf_usb_freebsd_transfer_type = -1; static int hf_usb_xferflags = -1; static int hf_usb_xferflags_force_short_xfer = -1; static int hf_usb_xferflags_short_xfer_ok = -1; static int hf_usb_xferflags_short_frames_ok = -1; static int hf_usb_xferflags_pipe_bof = -1; static int hf_usb_xferflags_proxy_buffer = -1; static int hf_usb_xferflags_ext_buffer = -1; static int hf_usb_xferflags_manual_status = -1; static int hf_usb_xferflags_no_pipe_ok = -1; static int hf_usb_xferflags_stall_pipe = -1; static int hf_usb_xferstatus = -1; static int hf_usb_xferstatus_open = -1; static int hf_usb_xferstatus_transferring = -1; static int hf_usb_xferstatus_did_dma_delay = -1; static int hf_usb_xferstatus_did_close = -1; static int hf_usb_xferstatus_draining = -1; static int hf_usb_xferstatus_started = -1; static int hf_usb_xferstatus_bw_reclaimed = -1; static int hf_usb_xferstatus_control_xfr = -1; static int hf_usb_xferstatus_control_hdr = -1; static int hf_usb_xferstatus_control_act = -1; static int hf_usb_xferstatus_control_stall = -1; static int hf_usb_xferstatus_short_frames_ok = -1; static int hf_usb_xferstatus_short_xfer_ok = -1; static int hf_usb_xferstatus_bdma_enable = -1; static int hf_usb_xferstatus_bdma_no_post_sync = -1; static int hf_usb_xferstatus_bdma_setup = -1; static int hf_usb_xferstatus_isochronous_xfr = -1; static int hf_usb_xferstatus_curr_dma_set = -1; static int hf_usb_xferstatus_can_cancel_immed = -1; static int hf_usb_xferstatus_doing_callback = -1; static int hf_usb_error = -1; static int hf_usb_interval = -1; static int hf_usb_nframes = -1; static int hf_usb_packet_size = -1; static int hf_usb_packet_count = -1; static int hf_usb_speed = -1; static int hf_usb_frame_length = -1; static int hf_usb_frame_flags = -1; static int hf_usb_frame_flags_read = -1; static int hf_usb_frame_flags_data_follows = -1; static int hf_usb_frame_data = -1; static int hf_usb_urb_id = -1; static int hf_usb_linux_urb_type = -1; static int hf_usb_linux_transfer_type = -1; static int hf_usb_endpoint_address = -1; static int hf_usb_endpoint_direction = -1; static int hf_usb_endpoint_number = -1; static int hf_usb_device_address = -1; static int hf_usb_bus_id = -1; static int hf_usb_setup_flag = -1; static int hf_usb_data_flag = -1; static int hf_usb_urb_ts_sec = -1; static int hf_usb_urb_ts_usec = -1; static int hf_usb_urb_status = -1; static int hf_usb_urb_len = -1; static int hf_usb_urb_data_len = -1; static int hf_usb_urb_unused_setup_header = -1; static int hf_usb_urb_interval = -1; static int hf_usb_urb_start_frame = -1; static int hf_usb_urb_copy_of_transfer_flags = -1; /* transfer_flags */ static int hf_short_not_ok = -1; static int hf_iso_asap = -1; static int hf_no_transfer_dma_map = -1; static int hf_no_fsbr = -1; static int hf_zero_packet = -1; static int hf_no_interrupt = -1; static int hf_free_buffer = -1; static int hf_dir_in = -1; static int hf_dma_map_single = -1; static int hf_dma_map_page = -1; static int hf_dma_map_sg = -1; static int hf_map_local = -1; static int hf_setup_map_single = -1; static int hf_setup_map_local = -1; static int hf_dma_sg_combined = -1; static int hf_aligned_temp_buffer = -1; static int * const transfer_flags_fields[] = { &hf_short_not_ok, &hf_iso_asap, &hf_no_transfer_dma_map, &hf_no_fsbr, &hf_zero_packet, &hf_no_interrupt, &hf_free_buffer, &hf_dir_in, &hf_dma_map_single, &hf_dma_map_page, &hf_dma_map_sg, &hf_map_local, &hf_setup_map_single, &hf_setup_map_local, &hf_dma_sg_combined, &hf_aligned_temp_buffer, NULL }; /* Win32 USBPcap pseudoheader fields */ static int hf_usb_win32_header_len = -1; static int hf_usb_irp_id = -1; static int hf_usb_usbd_status = -1; static int hf_usb_function = -1; static int hf_usb_info = -1; static int hf_usb_usbpcap_info_reserved = -1; static int hf_usb_usbpcap_info_direction = -1; static int hf_usb_win32_device_address = -1; static int hf_usb_win32_transfer_type = -1; /* hf_usb_bus_id, hf_usb_endpoint_address, hf_usb_endpoint_direction, * hf_usb_endpoint_number are common with * FreeBSD and Linux pseudoheaders */ static int hf_usb_win32_data_len = -1; static int hf_usb_win32_control_stage = -1; static int hf_usb_win32_iso_start_frame = -1; static int hf_usb_win32_iso_num_packets = -1; static int hf_usb_win32_iso_error_count = -1; static int hf_usb_win32_iso_offset = -1; static int hf_usb_win32_iso_length = -1; static int hf_usb_win32_iso_status = -1; static int hf_usb_request = -1; static int hf_usb_request_unknown_class = -1; static int hf_usb_value = -1; static int hf_usb_index = -1; static int hf_usb_length = -1; /* static int hf_usb_data_len = -1; */ static int hf_usb_capdata = -1; static int hf_usb_device_wFeatureSelector = -1; static int hf_usb_interface_wFeatureSelector = -1; static int hf_usb_endpoint_wFeatureSelector = -1; static int hf_usb_wInterface = -1; static int hf_usb_wEndpoint = -1; static int hf_usb_wStatus = -1; static int hf_usb_wFrameNumber = -1; static int hf_usb_iso_error_count = -1; static int hf_usb_iso_numdesc = -1; static int hf_usb_iso_status = -1; static int hf_usb_iso_off = -1; static int hf_usb_iso_len = -1; static int hf_usb_iso_actual_len = -1; static int hf_usb_iso_pad = -1; static int hf_usb_iso_data = -1; static int hf_usb_bmRequestType = -1; static int hf_usb_control_response_generic = -1; static int hf_usb_bmRequestType_direction = -1; static int hf_usb_bmRequestType_type = -1; static int hf_usb_bmRequestType_recipient = -1; static int hf_usb_bDescriptorType = -1; static int hf_usb_get_descriptor_resp_generic = -1; static int hf_usb_descriptor_index = -1; static int hf_usb_language_id = -1; static int hf_usb_bLength = -1; static int hf_usb_bcdUSB = -1; static int hf_usb_bDeviceClass = -1; static int hf_usb_bDeviceSubClass = -1; static int hf_usb_bDeviceProtocol = -1; static int hf_usb_bMaxPacketSize0 = -1; static int hf_usb_idVendor = -1; static int hf_usb_idProduct = -1; static int hf_usb_bcdDevice = -1; static int hf_usb_iManufacturer = -1; static int hf_usb_iProduct = -1; static int hf_usb_iSerialNumber = -1; static int hf_usb_bNumConfigurations = -1; static int hf_usb_wLANGID = -1; static int hf_usb_bString = -1; static int hf_usb_bInterfaceNumber = -1; static int hf_usb_bAlternateSetting = -1; static int hf_usb_bNumEndpoints = -1; static int hf_usb_bInterfaceClass = -1; static int hf_usb_bInterfaceSubClass = -1; static int hf_usb_bInterfaceSubClass_audio = -1; static int hf_usb_bInterfaceSubClass_cdc = -1; static int hf_usb_bInterfaceSubClass_massstorage = -1; static int hf_usb_bInterfaceSubClass_hid = -1; static int hf_usb_bInterfaceSubClass_misc = -1; static int hf_usb_bInterfaceSubClass_app = -1; static int hf_usb_bInterfaceProtocol = -1; static int hf_usb_bInterfaceProtocol_cdc = -1; static int hf_usb_bInterfaceProtocol_massstorage = -1; static int hf_usb_bInterfaceProtocol_cdc_data = -1; static int hf_usb_bInterfaceProtocol_hid_boot = -1; static int hf_usb_bInterfaceProtocol_app_dfu = -1; static int hf_usb_bInterfaceProtocol_app_irda = -1; static int hf_usb_bInterfaceProtocol_app_usb_test_and_measurement = -1; static int hf_usb_iInterface = -1; static int hf_usb_bEndpointAddress = -1; static int hf_usb_bmAttributes = -1; static int hf_usb_bEndpointAttributeTransfer = -1; static int hf_usb_bEndpointAttributeSynchonisation = -1; static int hf_usb_bEndpointAttributeBehaviour = -1; static int hf_usb_wMaxPacketSize = -1; static int hf_usb_wMaxPacketSize_size = -1; static int hf_usb_wMaxPacketSize_slots = -1; static int hf_usb_bInterval = -1; static int hf_usb_bMaxBurst = -1; static int hf_usb_audio_bRefresh = -1; static int hf_usb_audio_bSynchAddress = -1; static int hf_usb_bSSEndpointAttributeBulkMaxStreams = -1; static int hf_usb_bSSEndpointAttributeIsoMult = -1; static int hf_usb_wBytesPerInterval = -1; static int hf_usb_wTotalLength = -1; static int hf_usb_bNumInterfaces = -1; static int hf_usb_bConfigurationValue = -1; static int hf_usb_iConfiguration = -1; static int hf_usb_bMaxPower = -1; static int hf_usb_configuration_bmAttributes = -1; static int hf_usb_configuration_legacy10buspowered = -1; static int hf_usb_configuration_selfpowered = -1; static int hf_usb_configuration_remotewakeup = -1; static int hf_usb_bEndpointAddress_direction = -1; static int hf_usb_bEndpointAddress_number = -1; static int hf_usb_response_in = -1; static int hf_usb_time = -1; static int hf_usb_request_in = -1; static int hf_usb_bFirstInterface = -1; static int hf_usb_bInterfaceCount = -1; static int hf_usb_bFunctionClass = -1; static int hf_usb_bFunctionSubClass = -1; static int hf_usb_bFunctionProtocol = -1; static int hf_usb_iFunction = -1; static int hf_usb_bNumDeviceCaps = -1; static int hf_usb_bDevCapabilityType = -1; static int hf_usb_usb20ext_bmAttributes = -1; static int hf_usb_usb20ext_LPM = -1; static int hf_usb_usb20ext_BESL_HIRD = -1; static int hf_usb_usb20ext_baseline_BESL_valid = -1; static int hf_usb_usb20ext_deep_BESL_valid = -1; static int hf_usb_usb20ext_baseline_BESL = -1; static int hf_usb_usb20ext_deep_BESL = -1; static int hf_usb_bReserved = -1; static int hf_usb_PlatformCapabilityUUID = -1; static int hf_usb_webusb_bcdVersion = -1; static int hf_usb_webusb_bVendorCode = -1; static int hf_usb_webusb_iLandingPage = -1; static int hf_usb_msos20_dwWindowsVersion = -1; static int hf_usb_msos20_wMSOSDescriptorSetTotalLength = -1; static int hf_usb_msos20_bMS_VendorCode = -1; static int hf_usb_msos20_bAltEnumCode = -1; static int hf_usb_data_fragment = -1; static int hf_usb_src = -1; static int hf_usb_dst = -1; static int hf_usb_addr = -1; /* macOS */ static int hf_usb_darwin_bcd_version = -1; static int hf_usb_darwin_header_len = -1; static int hf_usb_darwin_request_type = -1; static int hf_usb_darwin_io_len = -1; static int hf_usb_darwin_io_status = -1; static int hf_usb_darwin_iso_num_packets = -1; static int hf_usb_darwin_io_id = -1; static int hf_usb_darwin_device_location = -1; static int hf_usb_darwin_speed = -1; static int hf_usb_darwin_device_address = -1; static int hf_usb_darwin_endpoint_address = -1; static int hf_usb_darwin_endpoint_type = -1; static int hf_usb_darwin_iso_status = -1; static int hf_usb_darwin_iso_frame_number = -1; static int hf_usb_darwin_iso_timestamp = -1; /* NetMon */ static int hf_usbport_event_id = -1; static int hf_usbport_device_object = -1; static int hf_usbport_pci_bus = -1; static int hf_usbport_pci_device = -1; static int hf_usbport_pci_function = -1; static int hf_usbport_pci_vendor_id = -1; static int hf_usbport_pci_device_id = -1; static int hf_usbport_port_path_depth = -1; static int hf_usbport_port_path0 = -1; static int hf_usbport_port_path1 = -1; static int hf_usbport_port_path2 = -1; static int hf_usbport_port_path3 = -1; static int hf_usbport_port_path4 = -1; static int hf_usbport_port_path5 = -1; static int hf_usbport_device_handle = -1; static int hf_usbport_device_speed = -1; static int hf_usbport_endpoint = -1; static int hf_usbport_pipehandle = -1; static int hf_usbport_endpoint_desc_length = -1; static int hf_usbport_endpoint_desc_type = -1; static int hf_usbport_endpoint_address = -1; static int hf_usbport_bm_attributes = -1; static int hf_usbport_max_packet_size = -1; static int hf_usbport_interval = -1; static int hf_usbport_irp = -1; static int hf_usbport_urb = -1; static int hf_usbport_urb_transfer_data = -1; static int hf_usbport_urb_header_length = -1; static int hf_usbport_urb_header_function = -1; static int hf_usbport_urb_header_status = -1; static int hf_usbport_urb_header_usbddevice_handle = -1; static int hf_usbport_urb_header_usbdflags = -1; static int hf_usbport_urb_configuration_desc = -1; static int hf_usbport_urb_configuration_handle = -1; static int hf_usbport_urb_pipe_handle = -1; static int hf_usbport_urb_xferflags = -1; static int hf_usbport_urb_transfer_buffer_length = -1; static int hf_usbport_urb_transfer_buffer = -1; static int hf_usbport_urb_transfer_buffer_mdl = -1; static int hf_usbport_urb_reserved_mbz = -1; static int hf_usbport_urb_reserved_hcd = -1; static int hf_usbport_urb_reserved = -1; static int hf_usbport_keyword = -1; static int hf_usbport_keyword_diagnostic = -1; static int hf_usbport_keyword_power_diagnostics = -1; static int hf_usbport_keyword_perf_diagnostics = -1; static int hf_usbport_keyword_reserved1 = -1; static gint ett_usb_hdr = -1; static gint ett_usb_setup_hdr = -1; static gint ett_usb_isodesc = -1; static gint ett_usb_win32_iso_packet = -1; static gint ett_usb_endpoint = -1; static gint ett_usb_setup_bmrequesttype = -1; static gint ett_usb_usbpcap_info = -1; static gint ett_descriptor_device = -1; static gint ett_configuration_bmAttributes = -1; static gint ett_configuration_bEndpointAddress = -1; static gint ett_endpoint_bmAttributes = -1; static gint ett_endpoint_wMaxPacketSize = -1; static gint ett_usb_xferflags = -1; static gint ett_usb_xferstatus = -1; static gint ett_usb_frame = -1; static gint ett_usb_frame_flags = -1; static gint ett_usbport = -1; static gint ett_usbport_host_controller = -1; static gint ett_usbport_path = -1; static gint ett_usbport_device = -1; static gint ett_usbport_endpoint = -1; static gint ett_usbport_endpoint_desc = -1; static gint ett_usbport_urb = -1; static gint ett_usbport_keyword = -1; static gint ett_transfer_flags = -1; static gint ett_usb20ext_bmAttributes = -1; static expert_field ei_usb_undecoded = EI_INIT; static expert_field ei_usb_bLength_even = EI_INIT; static expert_field ei_usb_bLength_too_short = EI_INIT; static expert_field ei_usb_desc_length_invalid = EI_INIT; static expert_field ei_usb_invalid_setup = EI_INIT; static expert_field ei_usb_ss_ep_companion_before_ep = EI_INIT; static expert_field ei_usb_usbpcap_unknown_urb = EI_INIT; static expert_field ei_usb_bad_length = EI_INIT; static expert_field ei_usb_invalid_max_packet_size = EI_INIT; static expert_field ei_usb_invalid_max_packet_size0 = EI_INIT; static expert_field ei_usb_invalid_endpoint_type = EI_INIT; static expert_field ei_usb_unexpected_desc_type = EI_INIT; static expert_field ei_usbport_invalid_path_depth = EI_INIT; static int usb_address_type = -1; static int * const usb_endpoint_fields[] = { &hf_usb_endpoint_direction, &hf_usb_endpoint_number, NULL }; static int * const usb_usbpcap_info_fields[] = { &hf_usb_usbpcap_info_reserved, &hf_usb_usbpcap_info_direction, NULL }; static int usb_tap = -1; static gboolean try_heuristics = TRUE; static dissector_table_t usb_bulk_dissector_table; static dissector_table_t usb_control_dissector_table; static dissector_table_t usb_interrupt_dissector_table; static dissector_table_t usb_descriptor_dissector_table; static heur_dissector_list_t heur_bulk_subdissector_list; static heur_dissector_list_t heur_control_subdissector_list; static heur_dissector_list_t heur_interrupt_subdissector_list; static wmem_tree_t *device_to_protocol_table = NULL; static wmem_tree_t *device_to_product_table = NULL; static wmem_tree_t *usbpcap_setup_data = NULL; static dissector_table_t device_to_dissector; static dissector_table_t protocol_to_dissector; static dissector_table_t product_to_dissector; typedef struct _device_product_data_t { guint16 vendor; guint16 product; guint16 device; guint bus_id; guint device_address; } device_product_data_t; typedef struct _device_protocol_data_t { guint32 protocol; guint bus_id; guint device_address; } device_protocol_data_t; typedef struct _usb_alt_setting_t { guint8 altSetting; guint8 interfaceClass; guint8 interfaceSubclass; guint8 interfaceProtocol; guint8 interfaceNum; } usb_alt_setting_t; typedef struct { guint64 usb_id; guint8 setup_data[8]; } usbpcap_setup_data_t; static const value_string usb_speed_vals[] = { {USB_SPEED_UNKNOWN, "Unknown Speed"}, {USB_SPEED_LOW, "Low-Speed"}, {USB_SPEED_FULL, "Full-Speed"}, {USB_SPEED_HIGH, "High-Speed"}, {0, NULL} }; /* http://www.usb.org/developers/docs/USB_LANGIDs.pdf */ static const value_string usb_langid_vals[] = { {0x0000, "no language specified"}, {0x0401, "Arabic (Saudi Arabia)"}, {0x0402, "Bulgarian"}, {0x0403, "Catalan"}, {0x0404, "Chinese (Taiwan)"}, {0x0405, "Czech"}, {0x0406, "Danish"}, {0x0407, "German (Standard)"}, {0x0408, "Greek"}, {0x0409, "English (United States)"}, {0x040a, "Spanish (Traditional Sort)"}, {0x040b, "Finnish"}, {0x040c, "French (Standard)"}, {0x040d, "Hebrew"}, {0x040e, "Hungarian"}, {0x040f, "Icelandic"}, {0x0410, "Italian (Standard)"}, {0x0411, "Japanese"}, {0x0412, "Korean"}, {0x0413, "Dutch (Netherlands)"}, {0x0414, "Norwegian (Bokmal)"}, {0x0415, "Polish"}, {0x0416, "Portuguese (Brazil)"}, {0x0418, "Romanian"}, {0x0419, "Russian"}, {0x041a, "Croatian"}, {0x041b, "Slovak"}, {0x041c, "Albanian"}, {0x041d, "Swedish"}, {0x041e, "Thai"}, {0x041f, "Turkish"}, {0x0420, "Urdu (Pakistan)"}, {0x0421, "Indonesian"}, {0x0422, "Ukrainian"}, {0x0423, "Belarussian"}, {0x0424, "Slovenian"}, {0x0425, "Estonian"}, {0x0426, "Latvian"}, {0x0427, "Lithuanian"}, {0x0429, "Farsi"}, {0x042a, "Vietnamese"}, {0x042b, "Armenian"}, {0x042c, "Azeri (Latin)"}, {0x042d, "Basque"}, {0x042f, "Macedonian"}, {0x0430, "Sutu"}, {0x0436, "Afrikaans"}, {0x0437, "Georgian"}, {0x0438, "Faeroese"}, {0x0439, "Hindi"}, {0x043e, "Malay (Malaysian)"}, {0x043f, "Kazakh"}, {0x0441, "Swahili (Kenya)"}, {0x0443, "Uzbek (Latin)"}, {0x0444, "Tatar (Tatarstan)"}, {0x0445, "Bengali"}, {0x0446, "Punjabi"}, {0x0447, "Gujarati"}, {0x0448, "Oriya"}, {0x0449, "Tamil"}, {0x044a, "Telugu"}, {0x044b, "Kannada"}, {0x044c, "Malayalam"}, {0x044d, "Assamese"}, {0x044e, "Marathi"}, {0x044f, "Sanskrit"}, {0x0455, "Burmese"}, {0x0457, "Konkani"}, {0x0458, "Manipuri"}, {0x0459, "Sindhi"}, {0x04ff, "HID (Usage Data Descriptor)"}, {0x0801, "Arabic (Iraq)"}, {0x0804, "Chinese (PRC)"}, {0x0807, "German (Switzerland)"}, {0x0809, "English (United Kingdom)"}, {0x080a, "Spanish (Mexican)"}, {0x080c, "French (Belgian)"}, {0x0810, "Italian (Switzerland)"}, {0x0812, "Korean (Johab)"}, {0x0813, "Dutch (Belgium)"}, {0x0814, "Norwegian (Nynorsk)"}, {0x0816, "Portuguese (Standard)"}, {0x081a, "Serbian (Latin)"}, {0x081d, "Swedish (Finland)"}, {0x0820, "Urdu (India)"}, {0x0827, "Lithuanian (Classic)"}, {0x082c, "Azeri (Cyrillic)"}, {0x083e, "Malay (Brunei Darussalam)"}, {0x0843, "Uzbek (Cyrillic)"}, {0x0860, "Kashmiri (India)"}, {0x0861, "Nepali (India)"}, {0x0c01, "Arabic (Egypt)"}, {0x0c04, "Chinese (Hong Kong SAR, PRC)"}, {0x0c07, "German (Austria)"}, {0x0c09, "English (Australian)"}, {0x0c0a, "Spanish (Modern Sort)"}, {0x0c0c, "French (Canadian)"}, {0x0c1a, "Serbian (Cyrillic)"}, {0x1001, "Arabic (Libya)"}, {0x1004, "Chinese (Singapore)"}, {0x1007, "German (Luxembourg)"}, {0x1009, "English (Canadian)"}, {0x100a, "Spanish (Guatemala)"}, {0x100c, "French (Switzerland)"}, {0x1401, "Arabic (Algeria)"}, {0x1404, "Chinese (Macau SAR)"}, {0x1407, "German (Liechtenstein)"}, {0x1409, "English (New Zealand)"}, {0x140a, "Spanish (Costa Rica)"}, {0x140c, "French (Luxembourg)"}, {0x1801, "Arabic (Morocco)"}, {0x1809, "English (Ireland)"}, {0x180a, "Spanish (Panama)"}, {0x180c, "French (Monaco)"}, {0x1c01, "Arabic (Tunisia)"}, {0x1c09, "English (South Africa)"}, {0x1c0a, "Spanish (Dominican Republic)"}, {0x2001, "Arabic (Oman)"}, {0x2009, "English (Jamaica)"}, {0x200a, "Spanish (Venezuela)"}, {0x2401, "Arabic (Yemen)"}, {0x2409, "English (Caribbean)"}, {0x240a, "Spanish (Colombia)"}, {0x2801, "Arabic (Syria)"}, {0x2809, "English (Belize)"}, {0x280a, "Spanish (Peru)"}, {0x2c01, "Arabic (Jordan)"}, {0x2c09, "English (Trinidad)"}, {0x2c0a, "Spanish (Argentina)"}, {0x3001, "Arabic (Lebanon)"}, {0x3009, "English (Zimbabwe)"}, {0x300a, "Spanish (Ecuador)"}, {0x3401, "Arabic (Kuwait)"}, {0x3409, "English (Philippines)"}, {0x340a, "Spanish (Chile)"}, {0x3801, "Arabic (U.A.E.)"}, {0x380a, "Spanish (Uruguay)"}, {0x3c01, "Arabic (Bahrain)"}, {0x3c0a, "Spanish (Paraguay)"}, {0x4001, "Arabic (Qatar)"}, {0x400a, "Spanish (Bolivia)"}, {0x440a, "Spanish (El Salvador)"}, {0x480a, "Spanish (Honduras)"}, {0x4c0a, "Spanish (Nicaragua)"}, {0x500a, "Spanish (Puerto Rico)"}, {0xf0ff, "HID (Vendor Defined 1)"}, {0xf4ff, "HID (Vendor Defined 2)"}, {0xf8ff, "HID (Vendor Defined 3)"}, {0xfcff, "HID (Vendor Defined 4)"}, {0, NULL} }; value_string_ext usb_langid_vals_ext = VALUE_STRING_EXT_INIT(usb_langid_vals); static const value_string usb_class_vals[] = { {IF_CLASS_DEVICE, "Device"}, {IF_CLASS_AUDIO, "Audio"}, {IF_CLASS_COMMUNICATIONS, "Communications and CDC Control"}, {IF_CLASS_HID, "HID"}, {IF_CLASS_PHYSICAL, "Physical"}, {IF_CLASS_IMAGE, "Imaging"}, {IF_CLASS_PRINTER, "Printer"}, {IF_CLASS_MASS_STORAGE, "Mass Storage"}, {IF_CLASS_HUB, "Hub"}, {IF_CLASS_CDC_DATA, "CDC-Data"}, {IF_CLASS_SMART_CARD, "Smart Card"}, {IF_CLASS_CONTENT_SECURITY, "Content Security"}, {IF_CLASS_VIDEO, "Video"}, {IF_CLASS_PERSONAL_HEALTHCARE, "Personal Healthcare"}, {IF_CLASS_AUDIO_VIDEO, "Audio/Video Devices"}, {IF_CLASS_DIAGNOSTIC_DEVICE, "Diagnostic Device"}, {IF_CLASS_WIRELESS_CONTROLLER, "Wireless Controller"}, {IF_CLASS_MISCELLANEOUS, "Miscellaneous"}, {IF_CLASS_APPLICATION_SPECIFIC, "Application Specific"}, {IF_CLASS_VENDOR_SPECIFIC, "Vendor Specific"}, {0, NULL} }; value_string_ext usb_class_vals_ext = VALUE_STRING_EXT_INIT(usb_class_vals); /* use usb class, subclass and protocol id together http://www.usb.org/developers/defined_class USB Class Definitions for Communications Devices, Revision 1.2 December 6, 2012 */ static const value_string usb_protocols[] = { {0x000000, "Use class code info from Interface Descriptors"}, {0x060101, "Still Imaging"}, {0x090000, "Full speed Hub"}, {0x090001, "Hi-speed hub with single TT"}, {0x090002, "Hi-speed hub with multiple TTs"}, {0x0D0000, "Content Security"}, {0x100100, "AVControl Interface"}, {0x100200, "AVData Video Streaming Interface"}, {0x100300, "AVData Audio Streaming Interface"}, {0xDC0101, "USB2 Compliance Device"}, {0xE00101, "Bluetooth Programming Interface"}, {0xE00102, "UWB Radio Control Interface"}, {0xE00103, "Remote NDIS"}, {0xE00104, "Bluetooth AMP Controller"}, {0xE00201, "Host Wire Adapter Control/Data interface"}, {0xE00202, "Device Wire Adapter Control/Data interface"}, {0xE00203, "Device Wire Adapter Isochronous interface"}, {0xEF0101, "Active Sync device"}, {0xEF0102, "Palm Sync"}, {0xEF0201, "Interface Association Descriptor"}, {0xEF0202, "Wire Adapter Multifunction Peripheral programming interface"}, {0xEF0301, "Cable Based Association Framework"}, {0xFE0101, "Device Firmware Upgrade"}, {0xFE0200, "IRDA Bridge device"}, {0xFE0300, "USB Test and Measurement Device"}, {0xFE0301, "USB Test and Measurement Device conforming to the USBTMC USB488"}, {0, NULL} }; static value_string_ext usb_protocols_ext = VALUE_STRING_EXT_INIT(usb_protocols); /* BOS Descriptor Device Capability Type Codes https://www.usb.org/bos-descriptor-types */ #define BOS_CAP_WIRELESS_USB 0x01 #define BOS_CAP_USB_20_EXTENSION 0x02 #define BOS_CAP_SUPERSPEED_USB 0x03 #define BOS_CAP_CONTAINER_ID 0x04 #define BOS_CAP_PLATFORM 0x05 #define BOS_CAP_POWER_DELIVERY 0x06 #define BOS_CAP_BATTERY_INFO 0x07 #define BOS_CAP_PD_CONSUMER_PORT 0x08 #define BOS_CAP_PD_PROVIDER_PORT 0x09 #define BOS_CAP_SUPERSPEED_PLUS 0x0A #define BOS_CAP_PRECISION_TIME_MEAS 0x0B #define BOS_CAP_WIRELESS_USB_EXT 0x0C #define BOS_CAP_BILLBOARD 0x0D #define BOS_CAP_AUTHENTICATION 0x0E #define BOS_CAP_BILLBOARD_EX 0x0F #define BOS_CAP_CONFIGURATION_SUMMARY 0x10 #define BOS_CAP_FWSTATUS 0x11 #define BOS_CAP_USB3_GEN_T 0x13 static const value_string usb_capability_vals[] = { {BOS_CAP_WIRELESS_USB, "Wireless USB"}, {BOS_CAP_USB_20_EXTENSION, "USB 2.0 Extension Descriptor"}, {BOS_CAP_SUPERSPEED_USB, "SuperSpeed USB"}, {BOS_CAP_CONTAINER_ID, "Container ID"}, {BOS_CAP_PLATFORM, "Platform"}, {BOS_CAP_POWER_DELIVERY, "Power Delivery Capability"}, {BOS_CAP_BATTERY_INFO, "Battery Info Capability"}, {BOS_CAP_PD_CONSUMER_PORT, "PD Consumer Port Capability"}, {BOS_CAP_PD_PROVIDER_PORT, "PD Provider Port Capability"}, {BOS_CAP_SUPERSPEED_PLUS, "SuperSpeed Plus"}, {BOS_CAP_PRECISION_TIME_MEAS, "Precision Time Measurement"}, {BOS_CAP_WIRELESS_USB_EXT, "Wireless USB Ext"}, {BOS_CAP_BILLBOARD, "Billboard Capability"}, {BOS_CAP_AUTHENTICATION, "Authentication Capability Descriptor"}, {BOS_CAP_BILLBOARD_EX, "Billboard Ex capability"}, {BOS_CAP_CONFIGURATION_SUMMARY, "Configuration Summary"}, {BOS_CAP_FWSTATUS, "Firmware Status"}, {0x12, "TBD (reserved for USB Audio 4.0)"}, {BOS_CAP_USB3_GEN_T, "USB 3 Gen T Capability"}, {0x14, "TBD (reserved for USB PD)"}, {0, NULL} }; static value_string_ext usb_capability_vals_ext = VALUE_STRING_EXT_INIT(usb_capability_vals); /* FreeBSD header */ /* Transfer mode */ #define FREEBSD_MODE_HOST 0 #define FREEBSD_MODE_DEVICE 1 static const value_string usb_freebsd_transfer_mode_vals[] = { {FREEBSD_MODE_HOST, "Host"}, {FREEBSD_MODE_DEVICE, "Device"}, {0, NULL} }; /* Type */ #define FREEBSD_URB_SUBMIT 0 #define FREEBSD_URB_COMPLETE 1 static const value_string usb_freebsd_urb_type_vals[] = { {FREEBSD_URB_SUBMIT, "URB_SUBMIT"}, {FREEBSD_URB_COMPLETE, "URB_COMPLETE"}, {0, NULL} }; /* Transfer type */ #define FREEBSD_URB_CONTROL 0 #define FREEBSD_URB_ISOCHRONOUS 1 #define FREEBSD_URB_BULK 2 #define FREEBSD_URB_INTERRUPT 3 static const value_string usb_freebsd_transfer_type_vals[] = { {FREEBSD_URB_CONTROL, "URB_CONTROL"}, {FREEBSD_URB_ISOCHRONOUS, "URB_ISOCHRONOUS"}, {FREEBSD_URB_BULK, "URB_BULK"}, {FREEBSD_URB_INTERRUPT, "URB_INTERRUPT"}, {0, NULL} }; /* Transfer flags */ #define FREEBSD_FLAG_FORCE_SHORT_XFER 0x00000001 #define FREEBSD_FLAG_SHORT_XFER_OK 0x00000002 #define FREEBSD_FLAG_SHORT_FRAMES_OK 0x00000004 #define FREEBSD_FLAG_PIPE_BOF 0x00000008 #define FREEBSD_FLAG_PROXY_BUFFER 0x00000010 #define FREEBSD_FLAG_EXT_BUFFER 0x00000020 #define FREEBSD_FLAG_MANUAL_STATUS 0x00000040 #define FREEBSD_FLAG_NO_PIPE_OK 0x00000080 #define FREEBSD_FLAG_STALL_PIPE 0x00000100 static int * const usb_xferflags_fields[] = { &hf_usb_xferflags_force_short_xfer, &hf_usb_xferflags_short_xfer_ok, &hf_usb_xferflags_short_frames_ok, &hf_usb_xferflags_pipe_bof, &hf_usb_xferflags_proxy_buffer, &hf_usb_xferflags_ext_buffer, &hf_usb_xferflags_manual_status, &hf_usb_xferflags_no_pipe_ok, &hf_usb_xferflags_stall_pipe, NULL }; /* Transfer status */ #define FREEBSD_STATUS_OPEN 0x00000001 #define FREEBSD_STATUS_TRANSFERRING 0x00000002 #define FREEBSD_STATUS_DID_DMA_DELAY 0x00000004 #define FREEBSD_STATUS_DID_CLOSE 0x00000008 #define FREEBSD_STATUS_DRAINING 0x00000010 #define FREEBSD_STATUS_STARTED 0x00000020 #define FREEBSD_STATUS_BW_RECLAIMED 0x00000040 #define FREEBSD_STATUS_CONTROL_XFR 0x00000080 #define FREEBSD_STATUS_CONTROL_HDR 0x00000100 #define FREEBSD_STATUS_CONTROL_ACT 0x00000200 #define FREEBSD_STATUS_CONTROL_STALL 0x00000400 #define FREEBSD_STATUS_SHORT_FRAMES_OK 0x00000800 #define FREEBSD_STATUS_SHORT_XFER_OK 0x00001000 #define FREEBSD_STATUS_BDMA_ENABLE 0x00002000 #define FREEBSD_STATUS_BDMA_NO_POST_SYNC 0x00004000 #define FREEBSD_STATUS_BDMA_SETUP 0x00008000 #define FREEBSD_STATUS_ISOCHRONOUS_XFR 0x00010000 #define FREEBSD_STATUS_CURR_DMA_SET 0x00020000 #define FREEBSD_STATUS_CAN_CANCEL_IMMED 0x00040000 #define FREEBSD_STATUS_DOING_CALLBACK 0x00080000 static int * const usb_xferstatus_fields[] = { &hf_usb_xferstatus_open, &hf_usb_xferstatus_transferring, &hf_usb_xferstatus_did_dma_delay, &hf_usb_xferstatus_did_close, &hf_usb_xferstatus_draining, &hf_usb_xferstatus_started, &hf_usb_xferstatus_bw_reclaimed, &hf_usb_xferstatus_control_xfr, &hf_usb_xferstatus_control_hdr, &hf_usb_xferstatus_control_act, &hf_usb_xferstatus_control_stall, &hf_usb_xferstatus_short_frames_ok, &hf_usb_xferstatus_short_xfer_ok, &hf_usb_xferstatus_bdma_enable, &hf_usb_xferstatus_bdma_no_post_sync, &hf_usb_xferstatus_bdma_setup, &hf_usb_xferstatus_isochronous_xfr, &hf_usb_xferstatus_curr_dma_set, &hf_usb_xferstatus_can_cancel_immed, &hf_usb_xferstatus_doing_callback, NULL }; /* USB errors */ #define FREEBSD_ERR_NORMAL_COMPLETION 0 #define FREEBSD_ERR_PENDING_REQUESTS 1 #define FREEBSD_ERR_NOT_STARTED 2 #define FREEBSD_ERR_INVAL 3 #define FREEBSD_ERR_NOMEM 4 #define FREEBSD_ERR_CANCELLED 5 #define FREEBSD_ERR_BAD_ADDRESS 6 #define FREEBSD_ERR_BAD_BUFSIZE 7 #define FREEBSD_ERR_BAD_FLAG 8 #define FREEBSD_ERR_NO_CALLBACK 9 #define FREEBSD_ERR_IN_USE 10 #define FREEBSD_ERR_NO_ADDR 11 #define FREEBSD_ERR_NO_PIPE 12 #define FREEBSD_ERR_ZERO_NFRAMES 13 #define FREEBSD_ERR_ZERO_MAXP 14 #define FREEBSD_ERR_SET_ADDR_FAILED 15 #define FREEBSD_ERR_NO_POWER 16 #define FREEBSD_ERR_TOO_DEEP 17 #define FREEBSD_ERR_IOERROR 18 #define FREEBSD_ERR_NOT_CONFIGURED 19 #define FREEBSD_ERR_TIMEOUT 20 #define FREEBSD_ERR_SHORT_XFER 21 #define FREEBSD_ERR_STALLED 22 #define FREEBSD_ERR_INTERRUPTED 23 #define FREEBSD_ERR_DMA_LOAD_FAILED 24 #define FREEBSD_ERR_BAD_CONTEXT 25 #define FREEBSD_ERR_NO_ROOT_HUB 26 #define FREEBSD_ERR_NO_INTR_THREAD 27 #define FREEBSD_ERR_NOT_LOCKED 28 static const value_string usb_freebsd_err_vals[] = { {FREEBSD_ERR_NORMAL_COMPLETION, "Normal completion"}, {FREEBSD_ERR_PENDING_REQUESTS, "Pending requests"}, {FREEBSD_ERR_NOT_STARTED, "Not started"}, {FREEBSD_ERR_INVAL, "Invalid"}, {FREEBSD_ERR_NOMEM, "No memory"}, {FREEBSD_ERR_CANCELLED, "Cancelled"}, {FREEBSD_ERR_BAD_ADDRESS, "Bad address"}, {FREEBSD_ERR_BAD_BUFSIZE, "Bad buffer size"}, {FREEBSD_ERR_BAD_FLAG, "Bad flag"}, {FREEBSD_ERR_NO_CALLBACK, "No callback"}, {FREEBSD_ERR_IN_USE, "In use"}, {FREEBSD_ERR_NO_ADDR, "No address"}, {FREEBSD_ERR_NO_PIPE, "No pipe"}, {FREEBSD_ERR_ZERO_NFRAMES, "Number of frames is zero"}, {FREEBSD_ERR_ZERO_MAXP, "MAXP is zero"}, {FREEBSD_ERR_SET_ADDR_FAILED, "Set address failed"}, {FREEBSD_ERR_NO_POWER, "No power"}, {FREEBSD_ERR_TOO_DEEP, "Too deep"}, {FREEBSD_ERR_IOERROR, "I/O error"}, {FREEBSD_ERR_NOT_CONFIGURED, "Not configured"}, {FREEBSD_ERR_TIMEOUT, "Timeout"}, {FREEBSD_ERR_SHORT_XFER, "Short transfer"}, {FREEBSD_ERR_STALLED, "Stalled"}, {FREEBSD_ERR_INTERRUPTED, "Interrupted"}, {FREEBSD_ERR_DMA_LOAD_FAILED, "DMA load failed"}, {FREEBSD_ERR_BAD_CONTEXT, "Bad context"}, {FREEBSD_ERR_NO_ROOT_HUB, "No root hub"}, {FREEBSD_ERR_NO_INTR_THREAD, "No interrupt thread"}, {FREEBSD_ERR_NOT_LOCKED, "Not locked"}, {0, NULL} }; /* USB speeds */ #define FREEBSD_SPEED_VARIABLE 0 #define FREEBSD_SPEED_LOW 1 #define FREEBSD_SPEED_FULL 2 #define FREEBSD_SPEED_HIGH 3 #define FREEBSD_SPEED_SUPER 4 static const value_string usb_freebsd_speed_vals[] = { {FREEBSD_SPEED_VARIABLE, "Variable"}, {FREEBSD_SPEED_LOW, "Low"}, {FREEBSD_SPEED_FULL, "Full"}, {FREEBSD_SPEED_HIGH, "High"}, {FREEBSD_SPEED_SUPER, "Super"}, {0, NULL} }; /* Frame flags */ #define FREEBSD_FRAMEFLAG_READ 0x00000001 #define FREEBSD_FRAMEFLAG_DATA_FOLLOWS 0x00000002 static int * const usb_frame_flags_fields[] = { &hf_usb_frame_flags_read, &hf_usb_frame_flags_data_follows, NULL }; static const value_string usb_linux_urb_type_vals[] = { {URB_SUBMIT, "URB_SUBMIT"}, {URB_COMPLETE, "URB_COMPLETE"}, {URB_ERROR, "URB_ERROR"}, {0, NULL} }; static const value_string usb_linux_transfer_type_vals[] = { {URB_CONTROL, "URB_CONTROL"}, {URB_ISOCHRONOUS, "URB_ISOCHRONOUS"}, {URB_INTERRUPT, "URB_INTERRUPT"}, {URB_BULK, "URB_BULK"}, {0, NULL} }; static const value_string usb_transfer_type_and_direction_vals[] = { {URB_CONTROL, "URB_CONTROL out"}, {URB_ISOCHRONOUS, "URB_ISOCHRONOUS out"}, {URB_INTERRUPT, "URB_INTERRUPT out"}, {URB_BULK, "URB_BULK out"}, {URB_CONTROL | URB_TRANSFER_IN, "URB_CONTROL in"}, {URB_ISOCHRONOUS | URB_TRANSFER_IN, "URB_ISOCHRONOUS in"}, {URB_INTERRUPT | URB_TRANSFER_IN, "URB_INTERRUPT in"}, {URB_BULK | URB_TRANSFER_IN, "URB_BULK in"}, {0, NULL} }; static const value_string usb_endpoint_direction_vals[] = { {0, "OUT"}, {1, "IN"}, {0, NULL} }; static const range_string usb_setup_flag_rvals[] = { {0, 0, "relevant"}, {1, 255, "not relevant"}, {0, 0, NULL} }; static const range_string usb_data_flag_rvals[] = { {0, 0, "present"}, {1, 255, "not present"}, {0, 0, NULL} }; extern value_string_ext ext_usb_vendors_vals; extern value_string_ext ext_usb_products_vals; extern value_string_ext ext_usb_audio_subclass_vals; extern value_string_ext ext_usb_com_subclass_vals; extern value_string_ext ext_usb_massstorage_subclass_vals; extern value_string_ext linux_negative_errno_vals_ext; /* * Standard descriptor types. * * all class specific descriptor types were removed from this list * a descriptor type is not globally unique * dissectors for the USB classes should provide their own value string * and pass it to dissect_usb_descriptor_header() * */ #define USB_DT_DEVICE 1 #define USB_DT_CONFIG 2 #define USB_DT_STRING 3 #define USB_DT_INTERFACE 4 #define USB_DT_ENDPOINT 5 #define USB_DT_DEVICE_QUALIFIER 6 #define USB_DT_OTHER_SPEED_CONFIG 7 #define USB_DT_INTERFACE_POWER 8 /* these are from a minor usb 2.0 revision (ECN) */ #define USB_DT_OTG 9 #define USB_DT_DEBUG 10 #define USB_DT_INTERFACE_ASSOCIATION 11 /* these are from usb 3.0 specification */ #define USB_DT_BOS 0x0F #define USB_DT_DEVICE_CAPABILITY 0x10 #define USB_DT_SUPERSPEED_EP_COMPANION 0x30 /* these are from usb 3.1 specification */ #define USB_DT_SUPERSPEED_ISO_EP_COMPANION 0x31 /* There are only Standard Descriptor Types, Class-specific types are provided by "usb.descriptor" descriptors table*/ static const value_string std_descriptor_type_vals[] = { {USB_DT_DEVICE, "DEVICE"}, {USB_DT_CONFIG, "CONFIGURATION"}, {USB_DT_STRING, "STRING"}, {USB_DT_INTERFACE, "INTERFACE"}, {USB_DT_ENDPOINT, "ENDPOINT"}, {USB_DT_DEVICE_QUALIFIER, "DEVICE QUALIFIER"}, {USB_DT_OTHER_SPEED_CONFIG, "OTHER SPEED CONFIG"}, {USB_DT_INTERFACE_POWER, "INTERFACE POWER"}, {USB_DT_OTG, "OTG"}, {USB_DT_DEBUG, "DEBUG"}, {USB_DT_INTERFACE_ASSOCIATION, "INTERFACE ASSOCIATION"}, {USB_DT_BOS, "BOS"}, {USB_DT_DEVICE_CAPABILITY, "DEVICE CAPABILITY"}, {USB_DT_SUPERSPEED_EP_COMPANION, "SUPERSPEED USB ENDPOINT COMPANION"}, {USB_DT_SUPERSPEED_ISO_EP_COMPANION, "SUPERSPEED PLUS ISOCHRONOUS ENDPOINT COMPANION"}, {0,NULL} }; static value_string_ext std_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(std_descriptor_type_vals); /* * Feature selectors. * Per USB 3.1 spec, Table 9-7 */ #define USB_FS_ENDPOINT_HALT 0 #define USB_FS_FUNCTION_SUSPEND 0 /* same as ENDPOINT_HALT */ #define USB_FS_DEVICE_REMOTE_WAKEUP 1 #define USB_FS_TEST_MODE 2 #define USB_FS_B_HNP_ENABLE 3 #define USB_FS_A_HNP_SUPPORT 4 #define USB_FS_A_ALT_HNP_SUPPORT 5 #define USB_FS_WUSB_DEVICE 6 #define USB_FS_U1_ENABLE 48 #define USB_FS_U2_ENABLE 49 #define USB_FS_LTM_ENABLE 50 #define USB_FS_B3_NTF_HOST_REL 51 #define USB_FS_B3_RSP_ENABLE 52 #define USB_FS_LDM_ENABLE 53 static const value_string usb_endpoint_feature_selector_vals[] = { {USB_FS_ENDPOINT_HALT, "ENDPOINT HALT"}, {0, NULL} }; static const value_string usb_interface_feature_selector_vals[] = { {USB_FS_FUNCTION_SUSPEND, "FUNCTION SUSPEND"}, {0, NULL} }; static const value_string usb_device_feature_selector_vals[] = { {USB_FS_DEVICE_REMOTE_WAKEUP, "DEVICE REMOTE WAKEUP"}, {USB_FS_TEST_MODE, "TEST MODE"}, {USB_FS_B_HNP_ENABLE, "B HNP ENABLE"}, {USB_FS_A_HNP_SUPPORT, "A HNP SUPPORT"}, {USB_FS_A_ALT_HNP_SUPPORT, "A ALT HNP SUPPORT"}, {USB_FS_WUSB_DEVICE, "WUSB DEVICE"}, {USB_FS_U1_ENABLE, "U1 ENABLE"}, {USB_FS_U2_ENABLE, "U2 ENABLE"}, {USB_FS_LTM_ENABLE, "LTM ENABLE"}, {USB_FS_B3_NTF_HOST_REL, "B3 NTF HOST REL"}, {USB_FS_B3_RSP_ENABLE, "B3 RSP ENABLE"}, {USB_FS_LDM_ENABLE, "LDM ENABLE"}, {0, NULL} }; /* the transfer type in the endpoint descriptor, i.e. the type of the endpoint (this is not the same as the URB transfer type) */ #define USB_EP_CONTROL 0x00 #define USB_EP_ISOCHRONOUS 0x01 #define USB_EP_BULK 0x02 #define USB_EP_INTERRUPT 0x03 static const value_string usb_bmAttributes_transfer_vals[] = { {USB_EP_CONTROL, "Control-Transfer"}, {USB_EP_ISOCHRONOUS, "Isochronous-Transfer"}, {USB_EP_BULK, "Bulk-Transfer"}, {USB_EP_INTERRUPT, "Interrupt-Transfer"}, {0, NULL} }; static const value_string usb_bmAttributes_sync_vals[] = { {0x00, "No Sync"}, {0x01, "Asynchronous"}, {0x02, "Adaptive"}, {0x03, "Synchronous"}, {0, NULL} }; static const value_string usb_bmAttributes_behaviour_vals[] = { {0x00, "Data-Endpoint"}, {0x01, "Explicit Feedback-Endpoint"}, {0x02, "Implicit Feedback-Data-Endpoint"}, {0x03, "Reserved"}, {0, NULL} }; static const value_string usb_wMaxPacketSize_slots_vals[] = { {0x00, "1"}, {0x01, "2"}, {0x02, "3"}, {0x03, "Reserved"}, {0, NULL} }; /* USBPcap versions up to 1.4.1.0 captures USB control as 2 or 3 packets: * * SETUP with 8 bytes of Setup data * * DATA with optional data (either OUT or IN) * * STATUS without any USB payload, only the pseudoheader * * USBPcap versions 1.5.0.0 and up captures USB control as 2 packets: * * SETUP with 8 bytes of Setup data and optional DATA OUT * * COMPLETE with optional DATA IN * * The SETUP/COMPLETE matches the way control transfers are captured by * usbmon on Linux. */ #define USB_CONTROL_STAGE_SETUP 0x00 #define USB_CONTROL_STAGE_DATA 0x01 #define USB_CONTROL_STAGE_STATUS 0x02 #define USB_CONTROL_STAGE_COMPLETE 0x03 static const value_string usb_control_stage_vals[] = { {USB_CONTROL_STAGE_SETUP, "Setup"}, {USB_CONTROL_STAGE_DATA, "Data"}, {USB_CONTROL_STAGE_STATUS, "Status"}, {USB_CONTROL_STAGE_COMPLETE, "Complete"}, {0, NULL} }; /* Extra URB code to indicate relevant USB IRPs that don't directly * have any matching USB transfer. */ #define USBPCAP_URB_IRP_INFO 0xFE static const value_string win32_usb_transfer_type_vals[] = { {URB_CONTROL, "URB_CONTROL"}, {URB_ISOCHRONOUS, "URB_ISOCHRONOUS"}, {URB_INTERRUPT, "URB_INTERRUPT"}, {URB_BULK, "URB_BULK"}, {USBPCAP_URB_IRP_INFO, "USB IRP Info"}, {0, NULL} }; static const value_string win32_urb_function_vals[] = { {0x0000, "URB_FUNCTION_SELECT_CONFIGURATION"}, {0x0001, "URB_FUNCTION_SELECT_INTERFACE"}, {0x0002, "URB_FUNCTION_ABORT_PIPE"}, {0x0003, "URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL"}, {0x0004, "URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL"}, {0x0005, "URB_FUNCTION_GET_FRAME_LENGTH"}, {0x0006, "URB_FUNCTION_SET_FRAME_LENGTH"}, {0x0007, "URB_FUNCTION_GET_CURRENT_FRAME_NUMBER"}, {0x0008, "URB_FUNCTION_CONTROL_TRANSFER"}, {0x0009, "URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER"}, {0x000A, "URB_FUNCTION_ISOCH_TRANSFER"}, {0x000B, "URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE"}, {0x000C, "URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE"}, {0x000D, "URB_FUNCTION_SET_FEATURE_TO_DEVICE"}, {0x000E, "URB_FUNCTION_SET_FEATURE_TO_INTERFACE"}, {0x000F, "URB_FUNCTION_SET_FEATURE_TO_ENDPOINT"}, {0x0010, "URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE"}, {0x0011, "URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE"}, {0x0012, "URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT"}, {0x0013, "URB_FUNCTION_GET_STATUS_FROM_DEVICE"}, {0x0014, "URB_FUNCTION_GET_STATUS_FROM_INTERFACE"}, {0x0015, "URB_FUNCTION_GET_STATUS_FROM_ENDPOINT"}, {0x0016, "URB_FUNCTION_RESERVED_0X0016"}, {0x0017, "URB_FUNCTION_VENDOR_DEVICE"}, {0x0018, "URB_FUNCTION_VENDOR_INTERFACE"}, {0x0019, "URB_FUNCTION_VENDOR_ENDPOINT"}, {0x001A, "URB_FUNCTION_CLASS_DEVICE"}, {0x001B, "URB_FUNCTION_CLASS_INTERFACE"}, {0x001C, "URB_FUNCTION_CLASS_ENDPOINT"}, {0x001D, "URB_FUNCTION_RESERVE_0X001D"}, {0x001E, "URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL"}, {0x001F, "URB_FUNCTION_CLASS_OTHER"}, {0x0020, "URB_FUNCTION_VENDOR_OTHER"}, {0x0021, "URB_FUNCTION_GET_STATUS_FROM_OTHER"}, {0x0022, "URB_FUNCTION_CLEAR_FEATURE_TO_OTHER"}, {0x0023, "URB_FUNCTION_SET_FEATURE_TO_OTHER"}, {0x0024, "URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT"}, {0x0025, "URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT"}, {0x0026, "URB_FUNCTION_GET_CONFIGURATION"}, {0x0027, "URB_FUNCTION_GET_INTERFACE"}, {0x0028, "URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE"}, {0x0029, "URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE"}, {0x002A, "URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR"}, {0x002B, "URB_FUNCTION_RESERVE_0X002B"}, {0x002C, "URB_FUNCTION_RESERVE_0X002C"}, {0x002D, "URB_FUNCTION_RESERVE_0X002D"}, {0x002E, "URB_FUNCTION_RESERVE_0X002E"}, {0x002F, "URB_FUNCTION_RESERVE_0X002F"}, {0x0030, "URB_FUNCTION_SYNC_RESET_PIPE"}, {0x0031, "URB_FUNCTION_SYNC_CLEAR_STALL"}, {0x0032, "URB_FUNCTION_CONTROL_TRANSFER_EX"}, {0x0033, "URB_FUNCTION_RESERVE_0X0033"}, {0x0034, "URB_FUNCTION_RESERVE_0X0034"}, {0, NULL} }; static value_string_ext win32_urb_function_vals_ext = VALUE_STRING_EXT_INIT(win32_urb_function_vals); static const value_string win32_usbd_status_vals[] = { {0x00000000, "USBD_STATUS_SUCCESS"}, {0x40000000, "USBD_STATUS_PENDING"}, {0x80000200, "USBD_STATUS_INVALID_URB_FUNCTION"}, {0x80000300, "USBD_STATUS_INVALID_PARAMETER"}, {0x80000400, "USBD_STATUS_ERROR_BUSY"}, {0x80000600, "USBD_STATUS_INVALID_PIPE_HANDLE"}, {0x80000700, "USBD_STATUS_NO_BANDWIDTH"}, {0x80000800, "USBD_STATUS_INTERNAL_HC_ERROR"}, {0x80000900, "USBD_STATUS_ERROR_SHORT_TRANSFER"}, {0xC0000001, "USBD_STATUS_CRC"}, {0xC0000002, "USBD_STATUS_BTSTUFF"}, {0xC0000003, "USBD_STATUS_DATA_TOGGLE_MISMATCH"}, {0xC0000004, "USBD_STATUS_STALL_PID"}, {0xC0000005, "USBD_STATUS_DEV_NOT_RESPONDING"}, {0xC0000006, "USBD_STATUS_PID_CHECK_FAILURE"}, {0xC0000007, "USBD_STATUS_UNEXPECTED_PID"}, {0xC0000008, "USBD_STATUS_DATA_OVERRUN"}, {0xC0000009, "USBD_STATUS_DATA_UNDERRUN"}, {0xC000000A, "USBD_STATUS_RESERVED1"}, {0xC000000B, "USBD_STATUS_RESERVED2"}, {0xC000000C, "USBD_STATUS_BUFFER_OVERRUN"}, {0xC000000D, "USBD_STATUS_BUFFER_UNDERRUN"}, {0xC000000F, "USBD_STATUS_NOT_ACCESSED"}, {0xC0000010, "USBD_STATUS_FIFO"}, {0xC0000011, "USBD_STATUS_XACT_ERROR"}, {0xC0000012, "USBD_STATUS_BABBLE_DETECTED"}, {0xC0000013, "USBD_STATUS_DATA_BUFFER_ERROR"}, {0xC0000030, "USBD_STATUS_ENDPOINT_HALTED"}, {0xC0000A00, "USBD_STATUS_BAD_START_FRAME"}, {0xC0000B00, "USBD_STATUS_ISOCH_REQUEST_FAILED"}, {0xC0000C00, "USBD_STATUS_FRAME_CONTROL_OWNED"}, {0xC0000D00, "USBD_STATUS_FRAME_CONTROL_NOT_OWNED"}, {0xC0000E00, "USBD_STATUS_NOT_SUPPORTED"}, {0xC0000F00, "USBD_STATUS_INVALID_CONFIGURATION_DESCRIPTOR"}, {0xC0001000, "USBD_STATUS_INSUFFICIENT_RESOURCES"}, {0xC0002000, "USBD_STATUS_SET_CONFIG_FAILED"}, {0xC0003000, "USBD_STATUS_BUFFER_TOO_SMALL"}, {0xC0004000, "USBD_STATUS_INTERFACE_NOT_FOUND"}, {0xC0005000, "USBD_STATUS_INVALID_PIPE_FLAGS"}, {0xC0006000, "USBD_STATUS_TIMEOUT"}, {0xC0007000, "USBD_STATUS_DEVICE_GONE"}, {0xC0008000, "USBD_STATUS_STATUS_NOT_MAPPED"}, {0xC0009000, "USBD_STATUS_HUB_INTERNAL_ERROR"}, {0xC0010000, "USBD_STATUS_CANCELED"}, {0xC0020000, "USBD_STATUS_ISO_NOT_ACCESSED_BY_HW"}, {0xC0030000, "USBD_STATUS_ISO_TD_ERROR"}, {0xC0040000, "USBD_STATUS_ISO_NA_LATE_USBPORT"}, {0xC0050000, "USBD_STATUS_ISO_NOT_ACCESSED_LATE"}, {0xC0100000, "USBD_STATUS_BAD_DESCRIPTOR"}, {0xC0100001, "USBD_STATUS_BAD_DESCRIPTOR_BLEN"}, {0xC0100002, "USBD_STATUS_BAD_DESCRIPTOR_TYPE"}, {0xC0100003, "USBD_STATUS_BAD_INTERFACE_DESCRIPTOR"}, {0xC0100004, "USBD_STATUS_BAD_ENDPOINT_DESCRIPTOR"}, {0xC0100005, "USBD_STATUS_BAD_INTERFACE_ASSOC_DESCRIPTOR"}, {0xC0100006, "USBD_STATUS_BAD_CONFIG_DESC_LENGTH"}, {0xC0100007, "USBD_STATUS_BAD_NUMBER_OF_INTERFACES"}, {0xC0100008, "USBD_STATUS_BAD_NUMBER_OF_ENDPOINTS"}, {0xC0100009, "USBD_STATUS_BAD_ENDPOINT_ADDRESS"}, {0, NULL} }; static value_string_ext win32_usbd_status_vals_ext = VALUE_STRING_EXT_INIT(win32_usbd_status_vals); static const value_string win32_usb_info_direction_vals[] = { {0, "FDO -> PDO"}, {1, "PDO -> FDO"}, {0, NULL} }; static const value_string usb_cdc_protocol_vals[] = { {0x00, "No class specific protocol required"}, {0x01, "AT Commands: V.250 etc"}, {0x02, "AT Commands defined by PCCA-101"}, {0x03, "AT Commands defined by PCCA-101 & Annex O"}, {0x04, "AT Commands defined by GSM 07.07"}, {0x05, "AT Commands defined by 3GPP 27.007"}, {0x06, "AT Commands defined by TIA for CDMA"}, {0x07, "Ethernet Emulation Model"}, {0xFE, "External Protocol: Commands defined by Command Set Functional Descriptor"}, {0xFF, "Vendor-specific"}, {0, NULL} }; static value_string_ext usb_cdc_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_cdc_protocol_vals); extern value_string_ext usb_massstorage_protocol_vals_ext; static const value_string usb_cdc_data_protocol_vals[] = { {0x00, "No class specific protocol required"}, {0x01, "Network Transfer Block"}, {0x02, "Network Transfer Block (IP + DSS)"}, {0x30, "Physical interface protocol for ISDN BRI"}, {0x31, "HDLC"}, {0x32, "Transparent"}, {0x50, "Management protocol for Q.921 data link protocol"}, {0x51, "Data link protocol for Q.931"}, {0x52, "TEI-multiplexor for Q.921 data link protocol"}, {0x90, "Data compression procedures"}, {0x91, "Euro-ISDN protocol control"}, {0x92, "V.24 rate adaptation to ISDN"}, {0x93, "CAPI Commands"}, {0xFE, "The protocol(s) are described using a Protocol Unit Functional Descriptors on Communications Class Interface"}, {0xFF, "Vendor-specific"}, {0, NULL} }; static value_string_ext usb_cdc_data_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_cdc_data_protocol_vals); static const value_string usb_hid_subclass_vals[] = { {0, "No Subclass"}, {1, "Boot Interface"}, {0, NULL} }; static value_string_ext usb_hid_subclass_vals_ext = VALUE_STRING_EXT_INIT(usb_hid_subclass_vals); static const value_string usb_hid_boot_protocol_vals[] = { {0, "None"}, {1, "Keyboard"}, {2, "Mouse"}, {0, NULL} }; static value_string_ext usb_hid_boot_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_hid_boot_protocol_vals); static const value_string usb_misc_subclass_vals[] = { {0x03, "Cable Based Association Framework"}, {0x04, "RNDIS"}, {IF_SUBCLASS_MISC_U3V, "USB3 Vision"}, {0x06, "Stream Transport Efficient Protocol"}, {0, NULL} }; static value_string_ext usb_misc_subclass_vals_ext = VALUE_STRING_EXT_INIT(usb_misc_subclass_vals); static const value_string usb_app_subclass_vals[] = { {0x01, "Device Firmware Upgrade"}, {0x02, "IRDA Bridge"}, {0x03, "USB Test and Measurement Device"}, {0, NULL} }; static value_string_ext usb_app_subclass_vals_ext = VALUE_STRING_EXT_INIT(usb_app_subclass_vals); static const value_string usb_app_dfu_protocol_vals[] = { {0x01, "Runtime protocol"}, {0x02, "DFU mode protocol"}, {0, NULL} }; static value_string_ext usb_app_dfu_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_app_dfu_protocol_vals); static const value_string usb_app_irda_protocol_vals[] = { {0x00, "IRDA Bridge device"}, {0, NULL} }; static value_string_ext usb_app_irda_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_app_irda_protocol_vals); static const value_string usb_app_usb_test_and_measurement_protocol_vals[] = { {0x00, "USB Test and Measurement Device"}, {0x01, "USB Test and Measurement Device conforming to the USBTMC USB488 Subclass Specification"}, {0, NULL} }; static value_string_ext usb_app_usb_test_and_measurement_protocol_vals_ext = VALUE_STRING_EXT_INIT(usb_app_usb_test_and_measurement_protocol_vals); /* macOS */ /* Request Type */ #define DARWIN_IO_SUBMIT 0 #define DARWIN_IO_COMPLETE 1 static const value_string usb_darwin_request_type_vals[] = { {DARWIN_IO_SUBMIT, "SUBMIT"}, {DARWIN_IO_COMPLETE, "COMPLETE"}, {0, NULL} }; /* Transfer type */ static const value_string usb_darwin_endpoint_type_vals[] = { {USB_EP_CONTROL, "Control"}, {USB_EP_ISOCHRONOUS, "Isochronous"}, {USB_EP_BULK, "Bulk"}, {USB_EP_INTERRUPT, "Interrupt"}, {0, NULL} }; /* USB speeds */ #define DARWIN_SPEED_LOW 0 #define DARWIN_SPEED_FULL 1 #define DARWIN_SPEED_HIGH 2 #define DARWIN_SPEED_SUPER 3 #define DARWIN_SPEED_SUPERPLUS 4 static const value_string usb_darwin_speed_vals[] = { {DARWIN_SPEED_LOW, "Low"}, {DARWIN_SPEED_FULL, "Full"}, {DARWIN_SPEED_HIGH, "High"}, {DARWIN_SPEED_SUPER, "Super"}, {DARWIN_SPEED_SUPERPLUS, "Super+"}, {0, NULL} }; static const value_string darwin_usb_status_vals[] = { {0x00000000, "kIOReturnSuccess"}, {0xe00002bc, "kIOReturnError"}, {0xe00002bd, "kIOReturnNoMemory"}, {0xe00002be, "kIOReturnNoResources"}, {0xe00002bf, "kIOReturnIPCError"}, {0xe00002c0, "kIOReturnNoDevice"}, {0xe00002c1, "kIOReturnNotPrivileged"}, {0xe00002c2, "kIOReturnBadArgument"}, {0xe00002c3, "kIOReturnLockedRead"}, {0xe00002c4, "kIOReturnLockedWrite"}, {0xe00002c5, "kIOReturnExclusiveAccess"}, {0xe00002c6, "kIOReturnBadMessageID"}, {0xe00002c7, "kIOReturnUnsupported"}, {0xe00002c8, "kIOReturnVMError"}, {0xe00002c9, "kIOReturnInternalError"}, {0xe00002ca, "kIOReturnIOError"}, {0xe00002cc, "kIOReturnCannotLock"}, {0xe00002cd, "kIOReturnNotOpen"}, {0xe00002ce, "kIOReturnNotReadable"}, {0xe00002cf, "kIOReturnNotWritable"}, {0xe00002d0, "kIOReturnNotAligned"}, {0xe00002d1, "kIOReturnBadMedia"}, {0xe00002d2, "kIOReturnStillOpen"}, {0xe00002d3, "kIOReturnRLDError"}, {0xe00002d4, "kIOReturnDMAError"}, {0xe00002d5, "kIOReturnBusy"}, {0xe00002d6, "kIOReturnTimeout"}, {0xe00002d7, "kIOReturnOffline"}, {0xe00002d8, "kIOReturnNotReady"}, {0xe00002d9, "kIOReturnNotAttached"}, {0xe00002da, "kIOReturnNoChannels"}, {0xe00002db, "kIOReturnNoSpace"}, {0xe00002dd, "kIOReturnPortExists"}, {0xe00002de, "kIOReturnCannotWire"}, {0xe00002df, "kIOReturnNoInterrupt"}, {0xe00002e0, "kIOReturnNoFrames"}, {0xe00002e1, "kIOReturnMessageTooLarge"}, {0xe00002e2, "kIOReturnNotPermitted"}, {0xe00002e3, "kIOReturnNoPower"}, {0xe00002e4, "kIOReturnNoMedia"}, {0xe00002e5, "kIOReturnUnformattedMedia"}, {0xe00002e6, "kIOReturnUnsupportedMode"}, {0xe00002e7, "kIOReturnUnderrun"}, {0xe00002e8, "kIOReturnOverrun"}, {0xe00002e9, "kIOReturnDeviceError"}, {0xe00002ea, "kIOReturnNoCompletion"}, {0xe00002eb, "kIOReturnAborted"}, {0xe00002ec, "kIOReturnNoBandwidth"}, {0xe00002ed, "kIOReturnNotResponding"}, {0xe00002ee, "kIOReturnIsoTooOld"}, {0xe00002ef, "kIOReturnIsoTooNew"}, {0xe00002f0, "kIOReturnNotFound"}, {0, NULL} }; static const guint32 darwin_endpoint_to_linux[] = { URB_CONTROL, URB_ISOCHRONOUS, URB_BULK, URB_INTERRUPT, URB_UNKNOWN }; static value_string_ext usb_darwin_status_vals_ext = VALUE_STRING_EXT_INIT(darwin_usb_status_vals); static const value_string netmon_event_id_vals[] = { {1, "USBPORT_ETW_EVENT_HC_ADD USBPORT_ETW_EVENT_HC_ADD"}, {2, "USBPORT_ETW_EVENT_HC_REMOVAL USBPORT_ETW_EVENT_HC_REMOVAL"}, {3, "USBPORT_ETW_EVENT_HC_INFORMATION USBPORT_ETW_EVENT_HC_INFORMATION"}, {4, "USBPORT_ETW_EVENT_HC_START USBPORT_ETW_EVENT_HC_START"}, {5, "USBPORT_ETW_EVENT_HC_STOP USBPORT_ETW_EVENT_HC_STOP"}, {6, "USBPORT_ETW_EVENT_HC_SUSPEND USBPORT_ETW_EVENT_HC_SUSPEND"}, {7, "USBPORT_ETW_EVENT_HC_RESUME USBPORT_ETW_EVENT_HC_RESUME"}, {8, "USBPORT_ETW_EVENT_HC_ASYNC_SCHEDULE_ENABLE"}, {9, "USBPORT_ETW_EVENT_HC_ASYNC_SCHEDULE_DISABLE"}, {10, "USBPORT_ETW_EVENT_HC_PERIODIC_SCHEDULE_ENABLE"}, {11, "USBPORT_ETW_EVENT_HC_PERIODIC_SCHEDULE_DISABLE"}, {12, "USBPORT_ETW_EVENT_DEVICE_CREATE"}, {13, "USBPORT_ETW_EVENT_DEVICE_INITIALIZE"}, {14, "USBPORT_ETW_EVENT_DEVICE_REMOVAL"}, {15, "USBPORT_ETW_EVENT_DEVICE_INFORMATION"}, {16, "USBPORT_ETW_EVENT_DEVICE_IDLE_STATE_SET"}, {17, "USBPORT_ETW_EVENT_DEVICE_IDLE_STATE_CLEAR"}, {18, "USBPORT_ETW_EVENT_ENDPOINT_OPEN"}, {19, "USBPORT_ETW_EVENT_ENDPOINT_CLOSE USBPORT_ETW_EVENT_ENDPOINT_CLOSE"}, {20, "USBPORT_ETW_EVENT_ENDPOINT_INFORMATION"}, {21, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SELECT_CONFIGURATION"}, {22, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SELECT_INTERFACE"}, {23, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_CURRENT_FRAME_NUMBER"}, {24, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CONTROL_TRANSFER"}, {25, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CONTROL_TRANSFER_EX"}, {26, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER"}, {27, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_ISOCH_TRANSFER"}, {28, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE"}, {29, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE"}, {30, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT"}, {31, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT"}, {32, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE"}, {33, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE"}, {34, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_FEATURE_TO_DEVICE"}, {35, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_FEATURE_TO_INTERFACE"}, {36, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_FEATURE_TO_ENDPOINT"}, {37, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE"}, {38, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE"}, {39, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT"}, {40, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLEAR_FEATURE_TO_OTHER"}, {41, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_FEATURE_TO_OTHER"}, {42, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_STATUS_FROM_DEVICE"}, {43, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_STATUS_FROM_INTERFACE"}, {44, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_STATUS_FROM_ENDPOINT"}, {45, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_STATUS_FROM_OTHER"}, {46, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_VENDOR_DEVICE"}, {47, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_VENDOR_INTERFACE"}, {48, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_VENDOR_ENDPOINT"}, {49, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLASS_DEVICE"}, {50, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLASS_INTERFACE"}, {51, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLASS_ENDPOINT"}, {52, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_CLASS_OTHER"}, {53, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_VENDOR_OTHER"}, {54, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_ABORT_PIPE"}, {55, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL"}, {56, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SYNC_RESET_PIPE"}, {57, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SYNC_CLEAR_STALL"}, {58, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_CONFIGURATION"}, {59, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_INTERFACE"}, {60, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR"}, {61, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL"}, {62, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL"}, {63, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_GET_FRAME_LENGTH"}, {64, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_SET_FRAME_LENGTH"}, {65, "USBPORT_ETW_EVENT_DISPATCH_URB_FUNCTION_RESERVED"}, {66, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_CONTROL_TRANSFER"}, {67, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_CONTROL_TRANSFER_EX"}, {68, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_CONTROL_TRANSFER_DATA"}, {69, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_CONTROL_TRANSFER_EX_DATA"}, {70, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER"}, {71, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER_DATA"}, {72, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_ISOCH_TRANSFER"}, {73, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_ISOCH_TRANSFER_DATA"}, {74, "USBPORT_ETW_EVENT_INTERNAL_URB_FUNCTION_CONTROL_TRANSFER"}, {75, "USBPORT_ETW_EVENT_COMPLETE_INTERNAL_URB_FUNCTION_CONTROL_TRANSFER"}, {76, "USBPORT_ETW_EVENT_COMPLETE_INTERNAL_URB_FUNCTION_CONTROL_TRANSFER_DATA"}, {77, "USBPORT_ETW_EVENT_COMPLETE_URB_FUNCTION_ABORT_PIPE"}, {78, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_HEADER_LENGTH_WARNING"}, {79, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_FUNCTION"}, {80, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_HEADER_LENGTH"}, {81, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_DEVICE_HANDLE"}, {82, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_FUNCTION_NOT_SUPPORTED"}, {83, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_FUNCTION_RESERVED"}, {84, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_DUE_TO_HC_SUSPEND"}, {85, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_URB_LINK"}, {86, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_PIPE_HANDLE"}, {87, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_ZERO_BW_PIPE_HANDLE"}, {88, "USBPORT_ETW_EVENT_DISPATCH_URB_NOP_ZERO_BW_PIPE_HANDLE_REQUEST"}, {89, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_CONTROL_TRANSFER_ENDPOINT"}, {90, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_CONTROL_TRANSFER_BUFFER_LENGTH"}, {91, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_BULK_OR_INTERRUPT_TRANSFER_ENDPOINT"}, {92, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_BULK_OR_INTERRUPT_TRANSFER_BUFFER_LENGTH"}, {93, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_ISOCHRONOUS_TRANSFER_ENDPOINT"}, {94, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_NULL_TRANSFER_BUFFER_AND_MDL"}, {95, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_NON_NULL_TRANSFER_BUFFER_MDL"}, {96, "USBPORT_ETW_EVENT_DISPATCH_URB_ALLOCATE_MDL_FAILURE"}, {97, "USBPORT_ETW_EVENT_DISPATCH_URB_ALLOCATE_TRANSFER_CONTEXT_FAILURE"}, {98, "USBPORT_ETW_EVENT_DISPATCH_URB_NOP_ROOTHUB_PIPE_HANDLE_REQUEST"}, {99, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_ISOCHRONOUS_ZERO_LENGTH"}, {100, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_ISOCHRONOUS_NUM_PACKETS"}, {101, "USBPORT_ETW_EVENT_DISPATCH_URB_INVALID_ISOCHRONOUS_START_FRAME"}, {102, "USBPORT_ETW_EVENT_IRP_CANCEL"}, {103, "USBPORT_ETW_EVENT_USBUSER_OP_RAW_RESET_PORT_DISPATCH"}, {104, "USBPORT_ETW_EVENT_USBUSER_OP_RAW_RESET_PORT_STATUS1"}, {105, "USBPORT_ETW_EVENT_USBUSER_OP_RAW_RESET_PORT_STATUS2"}, {106, "USBPORT_ETW_EVENT_USBUSER_OP_RAW_RESET_PORT_STATUS3"}, {107, "USBPORT_ETW_EVENT_USBUSER_OP_RAW_RESET_PORT_COMPLETE"}, {108, "USBPORT_ETW_EVENT_USBUSER_OP_SEND_ONE_PACKET_DISPATCH"}, {109, "USBPORT_ETW_EVENT_USBUSER_OP_SEND_ONE_PACKET_DISPATCH_DATA"}, {110, "USBPORT_ETW_EVENT_USBUSER_OP_SEND_ONE_PACKET_TIMEOUT"}, {111, "USBPORT_ETW_EVENT_USBUSER_OP_SEND_ONE_PACKET_COMPLETE"}, {112, "USBPORT_ETW_EVENT_USBUSER_OP_SEND_ONE_PACKET_COMPLETE_DATA"}, {113, "USBPORT_ETW_EVENT_CODE_EXECUTION_TIME"}, {114, "USBPORT_ETW_EVENT_PUT_SGLIST_EXECUTION_TIME"}, {115, "USBPORT_ETW_EVENT_BUILD_SGLIST_EXECUTION_TIME"}, {1024, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_DISPATCH"}, {1025, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE"}, {1026, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE_ERROR_1"}, {1027, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE_ERROR_2"}, {1028, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE_ERROR_3"}, {1029, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE_ERROR_4"}, {1030, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_START_COMPLETE_ERROR_5"}, {1031, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_STOP_DISPATCH"}, {1032, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_STOP_COMPLETE"}, {1033, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_SUSPEND_DISPATCH"}, {1034, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_SUSPEND_COMPLETE"}, {1035, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_DISPATCH"}, {1036, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE"}, {1037, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_1"}, {1038, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_2"}, {1039, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_3"}, {1040, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_4"}, {1041, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_5"}, {1042, "USBPORT_ETW_EVENT_HC_EHCI_MINIPORT_RESUME_COMPLETE_ERROR_6"}, {2048, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_DISPATCH"}, {2049, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE"}, {2050, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE_ERROR_1"}, {2051, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE_ERROR_2"}, {2052, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE_ERROR_3"}, {2053, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE_ERROR_4"}, {2054, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_START_COMPLETE_ERROR_5"}, {2055, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_STOP_DISPATCH"}, {2056, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_STOP_COMPLETE"}, {2057, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_SUSPEND_DISPATCH"}, {2058, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_SUSPEND_COMPLETE"}, {2059, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_DISPATCH"}, {2060, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE"}, {2061, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE_ERROR_1"}, {2062, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE_ERROR_2"}, {2063, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE_ERROR_3"}, {2064, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE_ERROR_4"}, {2065, "USBPORT_ETW_EVENT_HC_OHCI_MINIPORT_RESUME_COMPLETE_ERROR_5"}, {3072, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_DISPATCH"}, {3073, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_COMPLETE"}, {3074, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_COMPLETE_ERROR_1"}, {3075, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_COMPLETE_ERROR_2"}, {3076, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_COMPLETE_ERROR_3"}, {3077, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_START_COMPLETE_ERROR_4"}, {3078, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_STOP_DISPATCH"}, {3079, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_STOP_COMPLETE"}, {3080, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_SUSPEND_DISPATCH"}, {3081, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_SUSPEND_COMPLETE"}, {3082, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_DISPATCH"}, {3083, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE"}, {3084, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE_ERROR_1"}, {3085, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE_ERROR_2"}, {3086, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE_ERROR_3"}, {3087, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE_ERROR_4"}, {3088, "USBPORT_ETW_EVENT_HC_UHCI_MINIPORT_RESUME_COMPLETE_ERROR_5"}, {3089, "USBPORT_ETW_EVENT_RTPM_TRANSITION"}, {3090, "USBPORT_ETW_EVENT_DISPATCH_WAIT_WAKE"}, {3091, "USBPORT_ETW_EVENT_COMPLETE_WAIT_WAKE"}, {0, NULL} }; static value_string_ext netmon_event_id_vals_ext = VALUE_STRING_EXT_INIT(netmon_event_id_vals); static const value_string netmon_urb_function_vals[] = { {0x0000, "SELECT_CONFIGURATION"}, {0x0001, "SELECT_INTERFACE"}, {0x0002, "ABORT_PIPE"}, {0x0003, "TAKE_FRAME_LENGTH_CONTROL"}, {0x0004, "RELEASE_FRAME_LENGTH_CONTROL"}, {0x0005, "GET_FRAME_LENGTH"}, {0x0006, "SET_FRAME_LENGTH"}, {0x0007, "GET_CURRENT_FRAME_NUMBER"}, {0x0008, "CONTROL_TRANSFER"}, {0x0009, "BULK_OR_INTERRUPT_TRANSFER"}, {0x000A, "ISOCH_TRANSFER"}, {0x000B, "GET_DESCRIPTOR_FROM_DEVICE"}, {0x000C, "SET_DESCRIPTOR_TO_DEVICE"}, {0x000D, "SET_FEATURE_TO_DEVICE"}, {0x000E, "SET_FEATURE_TO_INTERFACE"}, {0x000F, "SET_FEATURE_TO_ENDPOINT"}, {0x0010, "CLEAR_FEATURE_TO_DEVICE"}, {0x0011, "CLEAR_FEATURE_TO_INTERFACE"}, {0x0012, "CLEAR_FEATURE_TO_ENDPOINT"}, {0x0013, "GET_STATUS_FROM_DEVICE"}, {0x0014, "GET_STATUS_FROM_INTERFACE"}, {0x0015, "GET_STATUS_FROM_ENDPOINT"}, {0x0016, "RESERVED"}, {0x0017, "VENDOR_DEVICE"}, {0x0018, "VENDOR_INTERFACE"}, {0x0019, "VENDOR_ENDPOINT"}, {0x001A, "CLASS_DEVICE"}, {0x001B, "CLASS_INTERFACE"}, {0x001C, "CLASS_ENDPOINT"}, {0x001D, "RESERVE_0X001D"}, {0x001E, "SYNC_RESET_PIPE_AND_CLEAR_STALL"}, {0x001F, "CLASS_OTHER"}, {0x0020, "VENDOR_OTHER"}, {0x0021, "GET_STATUS_FROM_OTHER"}, {0x0022, "CLEAR_FEATURE_TO_OTHER"}, {0x0023, "SET_FEATURE_TO_OTHER"}, {0x0024, "GET_DESCRIPTOR_FROM_ENDPOINT"}, {0x0025, "SET_DESCRIPTOR_TO_ENDPOINT"}, {0x0026, "GET_CONFIGURATION"}, {0x0027, "GET_INTERFACE"}, {0x0028, "GET_DESCRIPTOR_FROM_INTERFACE"}, {0x0029, "SET_DESCRIPTOR_TO_INTERFACE"}, {0x002A, "GET_MS_FEATURE_DESCRIPTOR"}, {0x0030, "SYNC_RESET_PIPE"}, {0x0031, "SYNC_CLEAR_STALL"}, {0x0032, "CONTROL_TRANSFER_EX"}, {0x0035, "OPEN_STATIC_STREAMS"}, {0x0036, "CLOSE_STATIC_STREAMS"}, {0x0037, "BULK_OR_INTERRUPT_TRANSFER_USING_CHAINED_MDL"}, {0x0038, "ISOCH_TRANSFER_USING_CHAINED_MDL"}, {0, NULL} }; static value_string_ext netmon_urb_function_vals_ext = VALUE_STRING_EXT_INIT(netmon_urb_function_vals); void proto_register_usb(void); void proto_reg_handoff_usb(void); /* USB address handling */ static int usb_addr_to_str(const address* addr, gchar *buf, int buf_len _U_) { const guint8 *addrp = (const guint8 *)addr->data; if(pletoh32(&addrp[0])==0xffffffff){ (void) g_strlcpy(buf, "host", buf_len); } else { snprintf(buf, buf_len, "%d.%d.%d", pletoh16(&addrp[8]), pletoh32(&addrp[0]), pletoh32(&addrp[4])); } return (int)(strlen(buf)+1); } static int usb_addr_str_len(const address* addr _U_) { return 50; } /* This keys provide information for DecodeBy and other dissector via per packet data: p_get_proto_data()/p_add_proto_data() */ #define USB_BUS_ID 0 #define USB_DEVICE_ADDRESS 1 #define USB_VENDOR_ID 2 #define USB_PRODUCT_ID 3 #define USB_DEVICE_CLASS 4 #define USB_DEVICE_SUBCLASS 5 #define USB_DEVICE_PROTOCOL 6 static void usb_device_prompt(packet_info *pinfo, gchar* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Bus ID %u \nDevice Address %u\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_BUS_ID)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_ADDRESS))); } static gpointer usb_device_value(packet_info *pinfo) { guint32 value = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_BUS_ID)) << 16; value |= GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_ADDRESS)); return GUINT_TO_POINTER(value); } static void usb_product_prompt(packet_info *pinfo, gchar* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor ID 0x%04x \nProduct ID 0x%04x\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_VENDOR_ID)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_PRODUCT_ID))); } static gpointer usb_product_value(packet_info *pinfo) { guint32 value = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_VENDOR_ID)) << 16; value |= GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_PRODUCT_ID)); return GUINT_TO_POINTER(value); } static void usb_protocol_prompt(packet_info *pinfo, gchar* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Class ID 0x%04x \nSubclass ID 0x%04x\nProtocol 0x%04x\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_CLASS)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_SUBCLASS)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_PROTOCOL))); } static gpointer usb_protocol_value(packet_info *pinfo) { guint32 value = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_CLASS)) << 16; value |= GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_SUBCLASS)) << 8; value |= GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_PROTOCOL)); return GUINT_TO_POINTER(value); } static build_valid_func usb_product_da_build_value[1] = {usb_product_value}; static decode_as_value_t usb_product_da_values = {usb_product_prompt, 1, usb_product_da_build_value}; static decode_as_t usb_product_da = { "usb", "usb.product", 1, 0, &usb_product_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; static build_valid_func usb_device_da_build_value[1] = {usb_device_value}; static decode_as_value_t usb_device_da_values = {usb_device_prompt, 1, usb_device_da_build_value}; static decode_as_t usb_device_da = { "usb", "usb.device", 1, 0, &usb_device_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; static build_valid_func usb_protocol_da_build_value[1] = {usb_protocol_value}; static decode_as_value_t usb_protocol_da_values = {usb_protocol_prompt, 1, usb_protocol_da_build_value}; static decode_as_t usb_protocol_da = { "usb", "usb.protocol", 1, 0, &usb_protocol_da_values, NULL, NULL, decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL}; static usb_conv_info_t * get_usb_conv_info(conversation_t *conversation) { usb_conv_info_t *usb_conv_info; /* do we have conversation specific data ? */ usb_conv_info = (usb_conv_info_t *)conversation_get_proto_data(conversation, proto_usb); if (!usb_conv_info) { /* no not yet so create some */ usb_conv_info = wmem_new0(wmem_file_scope(), usb_conv_info_t); usb_conv_info->interfaceClass = IF_CLASS_UNKNOWN; usb_conv_info->interfaceSubclass = IF_SUBCLASS_UNKNOWN; usb_conv_info->interfaceProtocol = IF_PROTOCOL_UNKNOWN; usb_conv_info->deviceVendor = DEV_VENDOR_UNKNOWN; usb_conv_info->deviceProduct = DEV_PRODUCT_UNKNOWN; usb_conv_info->deviceVersion = DEV_VERSION_UNKNOWN; usb_conv_info->alt_settings = wmem_array_new(wmem_file_scope(), sizeof(usb_alt_setting_t)); usb_conv_info->transactions = wmem_tree_new(wmem_file_scope()); usb_conv_info->descriptor_transfer_type = URB_UNKNOWN; usb_conv_info->max_packet_size = 0; conversation_add_proto_data(conversation, proto_usb, usb_conv_info); } return usb_conv_info; } /* usb_conv_info_t contains some components that are valid only for one specific packet clear_usb_conv_tmp_data() clears these components, it should be called before we dissect a new packet */ static void clear_usb_conv_tmp_data(usb_conv_info_t *usb_conv_info) { /* caller must have checked that usb_conv_info!= NULL */ usb_conv_info->direction = P2P_DIR_UNKNOWN; usb_conv_info->transfer_type = URB_UNKNOWN; usb_conv_info->is_request = FALSE; usb_conv_info->is_setup = FALSE; usb_conv_info->setup_requesttype = 0; usb_conv_info->speed = USB_SPEED_UNKNOWN; /* when we parse the configuration, interface and endpoint descriptors, we store the current interface class in endpoint 0's conversation this must be cleared since endpoint 0 does not belong to any interface class we used to clear these info in dissect_usb_configuration_descriptor() this doesn't work when the descriptor parsing throws an exception */ if (usb_conv_info->endpoint==0) { usb_conv_info->interfaceClass = IF_CLASS_UNKNOWN; usb_conv_info->interfaceSubclass = IF_SUBCLASS_UNKNOWN; usb_conv_info->interfaceProtocol = IF_PROTOCOL_UNKNOWN; } } static conversation_t * get_usb_conversation(packet_info *pinfo, address *src_addr, address *dst_addr, guint32 src_endpoint, guint32 dst_endpoint) { conversation_t *conversation; /* * Do we have a conversation for this connection? */ conversation = find_conversation(pinfo->num, src_addr, dst_addr, conversation_pt_to_conversation_type(pinfo->ptype), src_endpoint, dst_endpoint, 0); if (conversation) { return conversation; } /* We don't yet have a conversation, so create one. */ conversation = conversation_new(pinfo->num, src_addr, dst_addr, conversation_pt_to_conversation_type(pinfo->ptype), src_endpoint, dst_endpoint, 0); return conversation; } /* Fetch or create usb_conv_info for a specified interface. */ usb_conv_info_t * get_usb_iface_conv_info(packet_info *pinfo, guint8 interface_num) { conversation_t *conversation; guint32 if_port; if_port = GUINT32_TO_LE(INTERFACE_PORT | interface_num); if (pinfo->srcport == NO_ENDPOINT) { conversation = get_usb_conversation(pinfo, &pinfo->src, &pinfo->dst, pinfo->srcport, if_port); } else { conversation = get_usb_conversation(pinfo, &pinfo->src, &pinfo->dst, if_port, pinfo->destport); } return get_usb_conv_info(conversation); } /* Fetch usb_conv_info for specified endpoint, return NULL if not found */ usb_conv_info_t * get_existing_usb_ep_conv_info(packet_info* pinfo, guint16 bus_id, guint16 device_address, int endpoint) { usb_address_t *src_addr = wmem_new0(pinfo->pool, usb_address_t), *dst_addr = wmem_new0(pinfo->pool, usb_address_t); address src, dst; conversation_t *conversation; usb_conv_info_t *usb_conv_info = NULL; src_addr->bus_id = GUINT16_TO_LE(bus_id); src_addr->device = GUINT16_TO_LE(device_address); src_addr->endpoint = GUINT32_TO_LE(endpoint); dst_addr->bus_id = GUINT16_TO_LE(bus_id); dst_addr->device = 0xffffffff; dst_addr->endpoint = NO_ENDPOINT; set_address(&src, usb_address_type, USB_ADDR_LEN, (char *)src_addr); set_address(&dst, usb_address_type, USB_ADDR_LEN, (char *)dst_addr); conversation = find_conversation(pinfo->num, &src, &dst, conversation_pt_to_conversation_type(PT_USB), src_addr->endpoint, dst_addr->endpoint, 0); if (conversation) { usb_conv_info = (usb_conv_info_t *)conversation_get_proto_data(conversation, proto_usb); } return usb_conv_info; } static const char* usb_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) { if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == usb_address_type)) return "usb.src"; if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == usb_address_type)) return "usb.dst"; if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == usb_address_type)) return "usb.addr"; return CONV_FILTER_INVALID; } static ct_dissector_info_t usb_ct_dissector_info = {&usb_conv_get_filter_type}; static tap_packet_status usb_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pct; hash->flags = flags; add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &usb_ct_dissector_info, CONVERSATION_NONE); return TAP_PACKET_REDRAW; } static const char* usb_endpoint_get_filter_type(endpoint_item_t* endpoint, conv_filter_type_e filter) { if ((filter == CONV_FT_ANY_ADDRESS) && (endpoint->myaddress.type == usb_address_type)) return "usb.addr"; return CONV_FILTER_INVALID; } static const char* usb_col_filter_str(const address* addr _U_, gboolean is_src) { return is_src ? "usb.src" : "usb.dst"; } static et_dissector_info_t usb_endpoint_dissector_info = {&usb_endpoint_get_filter_type}; static tap_packet_status usb_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags) { conv_hash_t *hash = (conv_hash_t*) pit; hash->flags = flags; /* Take two "add" passes per packet, adding for each direction, ensures that all packets are counted properly (even if address is sending to itself) XXX - this could probably be done more efficiently inside endpoint_table */ add_endpoint_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &usb_endpoint_dissector_info, ENDPOINT_NONE); add_endpoint_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &usb_endpoint_dissector_info, ENDPOINT_NONE); return TAP_PACKET_REDRAW; } /* SETUP dissectors */ /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / CLEAR FEATURE */ /* 9.4.1 */ static int dissect_usb_setup_clear_feature_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { guint8 recip; if (usb_conv_info) { recip = USB_RECIPIENT(usb_conv_info->usb_trans_info->setup.requesttype); /* feature selector, zero/interface/endpoint */ switch (recip) { case RQT_SETUP_RECIPIENT_DEVICE: proto_tree_add_item(tree, hf_usb_device_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_INTERFACE: proto_tree_add_item(tree, hf_usb_interface_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_wInterface, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_ENDPOINT: proto_tree_add_item(tree, hf_usb_endpoint_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_wEndpoint, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_OTHER: default: proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } } else { /* No conversation information, so recipient type is unknown */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); } offset += 2; /* length */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_clear_feature_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / GET CONFIGURATION */ /* 9.4.2 */ static int dissect_usb_setup_get_configuration_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_tree_add_item(tree, hf_usb_bConfigurationValue, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / GET DESCRIPTOR */ proto_item * dissect_usb_descriptor_header(proto_tree *tree, tvbuff_t *tvb, int offset, value_string_ext *type_val_str) { guint8 desc_type; proto_item *length_item; length_item = proto_tree_add_item(tree, hf_usb_bLength, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; desc_type = tvb_get_guint8(tvb, offset); /* if the caller provided no class specific value string, we're * using the standard descriptor types */ if (!type_val_str) type_val_str = &std_descriptor_type_vals_ext; proto_tree_add_uint_format_value(tree, hf_usb_bDescriptorType, tvb, offset, 1, desc_type, "0x%02x (%s)", desc_type, val_to_str_ext_const(desc_type, type_val_str, "unknown")); return length_item; } static void dissect_max_packet_size0(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, gboolean other_speed) { proto_item *item; guint32 max_packet_size; unsigned int sanitized_max_packet_size; usb_speed_t speed = usb_conv_info->speed; item = proto_tree_add_item_ret_uint(tree, hf_usb_bMaxPacketSize0, tvb, offset, 1, ENC_LITTLE_ENDIAN, &max_packet_size); if (other_speed) { if (speed == USB_SPEED_FULL) speed = USB_SPEED_HIGH; else if (speed == USB_SPEED_HIGH) speed = USB_SPEED_FULL; } sanitized_max_packet_size = sanitize_usb_max_packet_size(ENDPOINT_TYPE_CONTROL, speed, max_packet_size); if (sanitized_max_packet_size != max_packet_size) { expert_add_info_format(pinfo, item, &ei_usb_invalid_max_packet_size0, "%s endpoint zero max packet size cannot be %u, using %d instead.", try_val_to_str(speed, usb_speed_vals), max_packet_size, sanitized_max_packet_size); } } /* 9.6.2 */ static int dissect_usb_device_qualifier_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; proto_item *nitem; int old_offset = offset; guint32 protocol; const gchar *description; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "DEVICE QUALIFIER DESCRIPTOR"); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* bcdUSB */ proto_tree_add_item(tree, hf_usb_bcdUSB, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; protocol = tvb_get_ntoh24(tvb, offset); description = val_to_str_ext_const(protocol, &usb_protocols_ext, ""); /* bDeviceClass */ proto_tree_add_item(tree, hf_usb_bDeviceClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bDeviceSubClass */ proto_tree_add_item(tree, hf_usb_bDeviceSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bDeviceProtocol */ nitem = proto_tree_add_item(tree, hf_usb_bDeviceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); if (*description) proto_item_append_text(nitem, " (%s)", description); offset += 1; if (!pinfo->fd->visited) { guint k_bus_id; guint k_device_address; guint k_frame_number; wmem_tree_key_t key[4]; device_protocol_data_t *device_protocol_data; k_frame_number = pinfo->num; k_device_address = usb_conv_info->device_address; k_bus_id = usb_conv_info->bus_id; key[0].length = 1; key[0].key = &k_device_address; key[1].length = 1; key[1].key = &k_bus_id; key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; device_protocol_data = wmem_new(wmem_file_scope(), device_protocol_data_t); device_protocol_data->protocol = protocol; device_protocol_data->bus_id = usb_conv_info->bus_id; device_protocol_data->device_address = usb_conv_info->device_address; wmem_tree_insert32_array(device_to_protocol_table, key, device_protocol_data); } /* bMaxPacketSize0 */ dissect_max_packet_size0(pinfo, tree, tvb, offset, usb_conv_info, TRUE); offset += 1; /* bNumConfigurations */ proto_tree_add_item(tree, hf_usb_bNumConfigurations, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* one reserved byte */ offset += 1; proto_item_set_len(item, offset-old_offset); return offset; } /* 9.6.1 */ static int dissect_usb_device_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; proto_item *nitem; int old_offset = offset; guint32 protocol; const gchar *description; guint32 vendor_id; guint32 product; guint16 product_id; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "DEVICE DESCRIPTOR"); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* bcdUSB */ proto_tree_add_item(tree, hf_usb_bcdUSB, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; protocol = tvb_get_ntoh24(tvb, offset); description = val_to_str_ext_const(protocol, &usb_protocols_ext, ""); /* bDeviceClass */ proto_tree_add_item(tree, hf_usb_bDeviceClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bDeviceSubClass */ proto_tree_add_item(tree, hf_usb_bDeviceSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bDeviceProtocol */ nitem = proto_tree_add_item(tree, hf_usb_bDeviceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); if (*description) proto_item_append_text(nitem, " (%s)", description); offset += 1; /* bMaxPacketSize0 */ dissect_max_packet_size0(pinfo, tree, tvb, offset, usb_conv_info, FALSE); offset += 1; /* if request was only for the first 8 bytes */ /* per 5.5.3 of USB2.0 Spec */ if (8 == usb_conv_info->usb_trans_info->setup.wLength) { proto_item_set_len(item, offset-old_offset); return offset; } /* idVendor */ proto_tree_add_item_ret_uint(tree, hf_usb_idVendor, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vendor_id); usb_conv_info->deviceVendor = (guint16)vendor_id; offset += 2; /* idProduct */ product_id = tvb_get_letohs(tvb, offset); usb_conv_info->deviceProduct = product_id; product = (guint16)vendor_id << 16 | product_id; proto_tree_add_uint_format_value(tree, hf_usb_idProduct, tvb, offset, 2, product_id, "%s (0x%04x)", val_to_str_ext_const(product, &ext_usb_products_vals, "Unknown"), product_id); offset += 2; /* bcdDevice */ usb_conv_info->deviceVersion = tvb_get_letohs(tvb, offset); proto_tree_add_item(tree, hf_usb_bcdDevice, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (!pinfo->fd->visited) { guint k_bus_id; guint k_device_address; guint k_frame_number; wmem_tree_key_t key[4]; device_product_data_t *device_product_data; device_protocol_data_t *device_protocol_data; k_frame_number = pinfo->num; k_device_address = usb_conv_info->device_address; k_bus_id = usb_conv_info->bus_id; key[0].length = 1; key[0].key = &k_device_address; key[1].length = 1; key[1].key = &k_bus_id; key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; device_product_data = wmem_new(wmem_file_scope(), device_product_data_t); device_product_data->vendor = vendor_id; device_product_data->product = product_id; device_product_data->device = usb_conv_info->deviceVersion; device_product_data->bus_id = usb_conv_info->bus_id; device_product_data->device_address = usb_conv_info->device_address; wmem_tree_insert32_array(device_to_product_table, key, device_product_data); device_protocol_data = wmem_new(wmem_file_scope(), device_protocol_data_t); device_protocol_data->protocol = protocol; device_protocol_data->bus_id = usb_conv_info->bus_id; device_protocol_data->device_address = usb_conv_info->device_address; wmem_tree_insert32_array(device_to_protocol_table, key, device_protocol_data); } /* iManufacturer */ proto_tree_add_item(tree, hf_usb_iManufacturer, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* iProduct */ proto_tree_add_item(tree, hf_usb_iProduct, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* iSerialNumber */ usb_conv_info->iSerialNumber = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_iSerialNumber, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bNumConfigurations */ proto_tree_add_item(tree, hf_usb_bNumConfigurations, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_item_set_len(item, offset-old_offset); return offset; } /* 9.6.7 */ static int dissect_usb_string_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; int old_offset = offset; guint8 len; proto_item *len_item; usb_trans_info_t *usb_trans_info; usb_trans_info = usb_conv_info->usb_trans_info; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "STRING DESCRIPTOR"); len = tvb_get_guint8(tvb, offset); /* The USB spec says that the languages / the string are UTF16 and not 0-terminated, i.e. the length field must contain an even number */ if (len & 0x1) { /* bLength */ len_item = proto_tree_add_item(tree, hf_usb_bLength, tvb, offset, 1, ENC_LITTLE_ENDIAN); expert_add_info(pinfo, len_item, &ei_usb_bLength_even); /* bDescriptorType */ proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); } else len_item = dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* Report an error, and give up, if the length is < 2 */ if (len < 2) { expert_add_info(pinfo, len_item, &ei_usb_bLength_too_short); return offset; } if (!usb_trans_info->u.get_descriptor.usb_index) { /* list of languanges */ while (offset >= old_offset && len > (offset - old_offset)) { /* wLANGID */ proto_tree_add_item(tree, hf_usb_wLANGID, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; } } else { /* UTF-16 string */ /* handle case of host requesting only substring */ guint8 len_str = MIN(len-2, usb_trans_info->setup.wLength -2); proto_tree_add_item(tree, hf_usb_bString, tvb, offset, len_str, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len_str; } proto_item_set_len(item, offset-old_offset); return offset; } /* 9.6.5 */ static int dissect_usb_interface_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; const char *class_str = NULL; int old_offset = offset; guint8 len; guint8 interface_num; guint8 alt_setting; usb_trans_info_t *usb_trans_info; usb_trans_info = usb_conv_info->usb_trans_info; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "INTERFACE DESCRIPTOR"); len = tvb_get_guint8(tvb, offset); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* bInterfaceNumber */ interface_num = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_bInterfaceNumber, tvb, offset, 1, ENC_LITTLE_ENDIAN); usb_conv_info->interfaceNum = interface_num; offset += 1; /* bAlternateSetting */ alt_setting = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_usb_bAlternateSetting, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bNumEndpoints */ proto_tree_add_item(tree, hf_usb_bNumEndpoints, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bInterfaceClass */ proto_tree_add_item(tree, hf_usb_bInterfaceClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); /* save the class so we can access it later in the endpoint descriptor */ usb_conv_info->interfaceClass = tvb_get_guint8(tvb, offset); class_str = val_to_str_ext(usb_conv_info->interfaceClass, &usb_class_vals_ext, "unknown (0x%X)"); proto_item_append_text(item, " (%u.%u): class %s", interface_num, alt_setting, class_str); if (!pinfo->fd->visited) { usb_alt_setting_t alternate_setting; /* Register conversation for this interface in case CONTROL messages are sent to it */ usb_trans_info->interface_info = get_usb_iface_conv_info(pinfo, interface_num); usb_trans_info->interface_info->bus_id = usb_conv_info->bus_id; usb_trans_info->interface_info->device_address = usb_conv_info->device_address; alternate_setting.altSetting = alt_setting; alternate_setting.interfaceClass = tvb_get_guint8(tvb, offset); alternate_setting.interfaceSubclass = tvb_get_guint8(tvb, offset+1); alternate_setting.interfaceProtocol = tvb_get_guint8(tvb, offset+2); alternate_setting.interfaceNum = interface_num; wmem_array_append_one(usb_trans_info->interface_info->alt_settings, alternate_setting); if (alt_setting == 0) { /* By default let's assume alternate setting 0 will be used */ /* in interface conversations, endpoint has no meaning */ usb_trans_info->interface_info->endpoint = NO_ENDPOINT8; usb_trans_info->interface_info->interfaceClass = alternate_setting.interfaceClass; usb_trans_info->interface_info->interfaceSubclass = alternate_setting.interfaceSubclass; usb_trans_info->interface_info->interfaceProtocol = alternate_setting.interfaceProtocol; usb_trans_info->interface_info->interfaceNum = alternate_setting.interfaceNum; usb_trans_info->interface_info->deviceVendor = usb_conv_info->deviceVendor; usb_trans_info->interface_info->deviceProduct = usb_conv_info->deviceProduct; usb_trans_info->interface_info->deviceVersion = usb_conv_info->deviceVersion; } } offset += 1; /* bInterfaceSubClass */ switch (usb_conv_info->interfaceClass) { case IF_CLASS_AUDIO: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_audio, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_COMMUNICATIONS: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_cdc, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_MASS_STORAGE: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_massstorage, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_HID: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_hid, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_MISCELLANEOUS: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_misc, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_APPLICATION_SPECIFIC: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass_app, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; default: proto_tree_add_item(tree, hf_usb_bInterfaceSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); } /* save the subclass so we can access it later in class-specific descriptors */ usb_conv_info->interfaceSubclass = tvb_get_guint8(tvb, offset); offset += 1; /* bInterfaceProtocol */ switch (usb_conv_info->interfaceClass) { case IF_CLASS_COMMUNICATIONS: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_cdc, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_MASS_STORAGE: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_massstorage, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_CDC_DATA: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_cdc_data, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case IF_CLASS_APPLICATION_SPECIFIC: switch (usb_conv_info->interfaceSubclass) { case 0x01: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_app_dfu, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case 0x02: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_app_irda, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case 0x03: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_app_usb_test_and_measurement, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; default: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); } break; case IF_CLASS_HID: if (usb_conv_info->interfaceSubclass == 1) { proto_tree_add_item(tree, hf_usb_bInterfaceProtocol_hid_boot, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; } proto_tree_add_item(tree, hf_usb_bInterfaceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; default: proto_tree_add_item(tree, hf_usb_bInterfaceProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); } usb_conv_info->interfaceProtocol = tvb_get_guint8(tvb, offset); offset += 1; /* iInterface */ proto_tree_add_item(tree, hf_usb_iInterface, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_item_set_len(item, len); if (offset < old_offset+len) { /* skip unknown records */ offset = old_offset + len; } return offset; } /* 9.6.6 */ const true_false_string tfs_endpoint_direction = { "IN Endpoint", "OUT Endpoint" }; void dissect_usb_endpoint_address(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *endpoint_item; proto_tree *endpoint_tree; guint8 endpoint; endpoint_item = proto_tree_add_item(tree, hf_usb_bEndpointAddress, tvb, offset, 1, ENC_LITTLE_ENDIAN); endpoint_tree = proto_item_add_subtree(endpoint_item, ett_configuration_bEndpointAddress); endpoint = tvb_get_guint8(tvb, offset)&0x0f; proto_tree_add_item(endpoint_tree, hf_usb_bEndpointAddress_direction, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(endpoint_item, " %s", (tvb_get_guint8(tvb, offset)&0x80)?"IN":"OUT"); proto_tree_add_item(endpoint_tree, hf_usb_bEndpointAddress_number, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(endpoint_item, " Endpoint:%d", endpoint); } unsigned int sanitize_usb_max_packet_size(guint8 ep_type, usb_speed_t speed, unsigned int max_packet_size) { unsigned int sanitized = max_packet_size; switch (speed) { case USB_SPEED_LOW: switch (ep_type) { case ENDPOINT_TYPE_CONTROL: /* 8 is the only allowed value */ sanitized = 8; break; case ENDPOINT_TYPE_INTERRUPT: if (max_packet_size > 8) sanitized = 8; break; default: /* Not allowed */ break; } break; case USB_SPEED_FULL: switch (ep_type) { case ENDPOINT_TYPE_CONTROL: case ENDPOINT_TYPE_BULK: /* Allowed values are: 8, 16, 32 and 64 */ if (max_packet_size > 32) sanitized = 64; else if (max_packet_size > 16) sanitized = 32; else if (max_packet_size > 8) sanitized = 16; else sanitized = 8; break; case ENDPOINT_TYPE_INTERRUPT: if (max_packet_size > 64) sanitized = 64; break; case ENDPOINT_TYPE_ISOCHRONOUS: if (max_packet_size > 1023) sanitized = 1023; break; default: break; } break; case USB_SPEED_HIGH: switch (ep_type) { case ENDPOINT_TYPE_CONTROL: /* 64 is the only allowed value */ sanitized = 64; break; case ENDPOINT_TYPE_BULK: /* 512 is the only allowed value */ sanitized = 512; break; case ENDPOINT_TYPE_INTERRUPT: case ENDPOINT_TYPE_ISOCHRONOUS: if (max_packet_size > 1024) sanitized = 1024; break; default: break; } break; case USB_SPEED_UNKNOWN: default: break; } return sanitized; } int dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, guint8 *out_ep_type, usb_speed_t speed) { proto_item *item; proto_tree *tree; proto_item *ep_attrib_item; proto_tree *ep_attrib_tree; proto_item *ep_type_item; proto_item *ep_pktsize_item; proto_tree *ep_pktsize_tree; int old_offset = offset; guint8 endpoint; guint8 ep_type; guint8 len; guint32 max_packet_size; unsigned int sanitized_max_packet_size; usb_trans_info_t *usb_trans_info = NULL; conversation_t *conversation = NULL; if (usb_conv_info) usb_trans_info = usb_conv_info->usb_trans_info; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "ENDPOINT DESCRIPTOR"); len = tvb_get_guint8(tvb, offset); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; endpoint = tvb_get_guint8(tvb, offset)&0x0f; dissect_usb_endpoint_address(tree, tvb, offset); offset += 1; /* Together with class from the interface descriptor we know what kind * of class the device at endpoint is. * Make sure a conversation exists for this endpoint and attach a * usb_conv_into_t structure to it. * * All endpoints for the same interface descriptor share the same * usb_conv_info structure. */ if ((!pinfo->fd->visited) && usb_trans_info && usb_trans_info->interface_info) { if (pinfo->destport == NO_ENDPOINT) { address tmp_addr; usb_address_t *usb_addr = wmem_new0(pinfo->pool, usb_address_t); /* packet is sent from a USB device's endpoint 0 to the host * replace endpoint 0 with the endpoint of this descriptor * and find the corresponding conversation */ usb_addr->bus_id = ((const usb_address_t *)(pinfo->src.data))->bus_id; usb_addr->device = ((const usb_address_t *)(pinfo->src.data))->device; usb_addr->endpoint = GUINT32_TO_LE(endpoint); set_address(&tmp_addr, usb_address_type, USB_ADDR_LEN, (char *)usb_addr); conversation = get_usb_conversation(pinfo, &tmp_addr, &pinfo->dst, usb_addr->endpoint, pinfo->destport); } if (conversation) { usb_trans_info->interface_info->endpoint = endpoint; conversation_add_proto_data(conversation, proto_usb, usb_trans_info->interface_info); } } /* bmAttributes */ ep_type = ENDPOINT_TYPE(tvb_get_guint8(tvb, offset)); if (out_ep_type) { *out_ep_type = ep_type; } ep_attrib_item = proto_tree_add_item(tree, hf_usb_bmAttributes, tvb, offset, 1, ENC_LITTLE_ENDIAN); ep_attrib_tree = proto_item_add_subtree(ep_attrib_item, ett_endpoint_bmAttributes); ep_type_item = proto_tree_add_item(ep_attrib_tree, hf_usb_bEndpointAttributeTransfer, tvb, offset, 1, ENC_LITTLE_ENDIAN); if (ep_type==USB_EP_ISOCHRONOUS) { proto_tree_add_item(ep_attrib_tree, hf_usb_bEndpointAttributeSynchonisation, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ep_attrib_tree, hf_usb_bEndpointAttributeBehaviour, tvb, offset, 1, ENC_LITTLE_ENDIAN); } /* At Low-Speed, only control and interrupt transfers are allowed */ if ((speed == USB_SPEED_LOW) && !((ep_type == USB_EP_CONTROL) || (ep_type == USB_EP_INTERRUPT))) { expert_add_info(pinfo, ep_type_item, &ei_usb_invalid_endpoint_type); } offset += 1; /* wMaxPacketSize */ ep_pktsize_item = proto_tree_add_item(tree, hf_usb_wMaxPacketSize, tvb, offset, 2, ENC_LITTLE_ENDIAN); ep_pktsize_tree = proto_item_add_subtree(ep_pktsize_item, ett_endpoint_wMaxPacketSize); if ((ep_type == ENDPOINT_TYPE_INTERRUPT) || (ep_type == ENDPOINT_TYPE_ISOCHRONOUS)) { proto_tree_add_item(ep_pktsize_tree, hf_usb_wMaxPacketSize_slots, tvb, offset, 2, ENC_LITTLE_ENDIAN); } proto_tree_add_item_ret_uint(ep_pktsize_tree, hf_usb_wMaxPacketSize_size, tvb, offset, 2, ENC_LITTLE_ENDIAN, &max_packet_size); sanitized_max_packet_size = sanitize_usb_max_packet_size(ep_type, speed, max_packet_size); if (sanitized_max_packet_size != max_packet_size) { expert_add_info_format(pinfo, ep_pktsize_item, &ei_usb_invalid_max_packet_size, "%s %s endpoint max packet size cannot be %u, using %d instead.", try_val_to_str(speed, usb_speed_vals), try_val_to_str(ep_type, usb_bmAttributes_transfer_vals), max_packet_size, sanitized_max_packet_size); max_packet_size = sanitized_max_packet_size; } offset+=2; if (conversation) { usb_conv_info_t* endpoint_conv_info = get_usb_conv_info(conversation); guint8 transfer_type; switch(ep_type) { case ENDPOINT_TYPE_CONTROL: transfer_type = URB_CONTROL; break; case ENDPOINT_TYPE_ISOCHRONOUS: transfer_type = URB_ISOCHRONOUS; break; case ENDPOINT_TYPE_BULK: transfer_type = URB_BULK; break; case ENDPOINT_TYPE_INTERRUPT: transfer_type = URB_INTERRUPT; break; default: transfer_type = URB_UNKNOWN; break; } endpoint_conv_info->descriptor_transfer_type = transfer_type; endpoint_conv_info->max_packet_size = max_packet_size; } /* bInterval */ proto_tree_add_item(tree, hf_usb_bInterval, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bRefresh and bSynchAddress are present only in the Audio 1.0 * Endpoint Descriptors, so observe the descriptor size */ if (usb_conv_info && (usb_conv_info->interfaceClass == IF_CLASS_AUDIO) && (len >= 9)) { proto_tree_add_item(tree, hf_usb_audio_bRefresh, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_usb_audio_bSynchAddress, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } proto_item_set_len(item, len); if (offset < old_offset+len) { /* mark unknown records as undecoded */ proto_tree_add_expert(tree, pinfo, &ei_usb_undecoded, tvb, offset, old_offset + len - offset); offset = old_offset + len; } return offset; } static int dissect_usb_endpoint_companion_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_, guint8 ep_type) { proto_item *item; proto_tree *tree; proto_item *ep_attrib_item; proto_tree *ep_attrib_tree; int old_offset = offset; guint8 len; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "SUPERSPEED ENDPOINT COMPANION DESCRIPTOR"); len = tvb_get_guint8(tvb, offset); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* bMaxBurst */ proto_tree_add_item(tree, hf_usb_bMaxBurst, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bmAttributes */ ep_attrib_item = proto_tree_add_item(tree, hf_usb_bmAttributes, tvb, offset, 1, ENC_LITTLE_ENDIAN); switch (ep_type) { case ENDPOINT_TYPE_CONTROL: break; case ENDPOINT_TYPE_ISOCHRONOUS: ep_attrib_tree = proto_item_add_subtree(ep_attrib_item, ett_endpoint_bmAttributes); proto_tree_add_item(ep_attrib_tree, hf_usb_bSSEndpointAttributeIsoMult, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case ENDPOINT_TYPE_BULK: ep_attrib_tree = proto_item_add_subtree(ep_attrib_item, ett_endpoint_bmAttributes); proto_tree_add_item(ep_attrib_tree, hf_usb_bSSEndpointAttributeBulkMaxStreams, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case ENDPOINT_TYPE_INTERRUPT: break; default: expert_add_info(pinfo, ep_attrib_item, &ei_usb_ss_ep_companion_before_ep); break; } offset += 1; /* wBytesPerInterval */ proto_tree_add_item(tree, hf_usb_wBytesPerInterval, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_item_set_len(item, len); if (offset < old_offset + len) { /* mark unknown records as undecoded */ proto_tree_add_expert(tree, pinfo, &ei_usb_undecoded, tvb, offset, old_offset + len - offset); offset = old_offset + len; } return offset; } /* ECN */ static int dissect_usb_interface_assn_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *tree; int old_offset = offset; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "INTERFACE ASSOCIATION DESCRIPTOR"); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* bFirstInterface */ proto_tree_add_item(tree, hf_usb_bFirstInterface, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bInterfaceCount */ proto_tree_add_item(tree, hf_usb_bInterfaceCount, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bFunctionClass */ proto_tree_add_item(tree, hf_usb_bFunctionClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bFunctionSubclass */ proto_tree_add_item(tree, hf_usb_bFunctionSubClass, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bFunctionProtocol */ proto_tree_add_item(tree, hf_usb_bFunctionProtocol, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* iFunction */ proto_tree_add_item(tree, hf_usb_iFunction, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_item_set_len(item, offset-old_offset); return offset; } int dissect_usb_unknown_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_item *item; proto_tree *tree; guint8 bLength; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "UNKNOWN DESCRIPTOR"); bLength = tvb_get_guint8(tvb, offset); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += bLength; proto_item_set_len(item, bLength); return offset; } /* 9.6.3 */ static const true_false_string tfs_mustbeone = { "Must be 1 for USB 1.1 and higher", "FIXME: Is this a USB 1.0 device" }; static const true_false_string tfs_selfpowered = { "This device is SELF-POWERED", "This device is powered from the USB bus" }; static const true_false_string tfs_remotewakeup = { "This device supports REMOTE WAKEUP", "This device does NOT support remote wakeup" }; static int dissect_usb_configuration_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, usb_speed_t speed) { proto_item *item; proto_tree *tree; int old_offset = offset; guint16 len; proto_item *flags_item; proto_tree *flags_tree; guint8 flags; guint8 last_ep_type = ENDPOINT_TYPE_NOT_SET; proto_item *power_item; guint8 power; gboolean truncation_expected; usb_trans_info_t *usb_trans_info; usb_trans_info = usb_conv_info->usb_trans_info; usb_conv_info->interfaceClass = IF_CLASS_UNKNOWN; usb_conv_info->interfaceSubclass = IF_SUBCLASS_UNKNOWN; usb_conv_info->interfaceProtocol = IF_PROTOCOL_UNKNOWN; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "CONFIGURATION DESCRIPTOR"); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* wTotalLength */ proto_tree_add_item(tree, hf_usb_wTotalLength, tvb, offset, 2, ENC_LITTLE_ENDIAN); len = tvb_get_letohs(tvb, offset); offset+=2; /* bNumInterfaces */ proto_tree_add_item(tree, hf_usb_bNumInterfaces, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bConfigurationValue */ proto_tree_add_item(tree, hf_usb_bConfigurationValue, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* iConfiguration */ proto_tree_add_item(tree, hf_usb_iConfiguration, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; /* bmAttributes */ flags_item = proto_tree_add_item(tree, hf_usb_configuration_bmAttributes, tvb, offset, 1, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(flags_item, ett_configuration_bmAttributes); flags = tvb_get_guint8(tvb, offset); proto_tree_add_item(flags_tree, hf_usb_configuration_legacy10buspowered, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(flags_tree, hf_usb_configuration_selfpowered, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(flags_item, " %sSELF-POWERED", (flags&0x40)?"":"NOT "); proto_tree_add_item(flags_tree, hf_usb_configuration_remotewakeup, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(flags_item, " %sREMOTE-WAKEUP", (flags&0x20)?"":"NO "); offset += 1; /* bMaxPower */ power_item = proto_tree_add_item(tree, hf_usb_bMaxPower, tvb, offset, 1, ENC_LITTLE_ENDIAN); power = tvb_get_guint8(tvb, offset); proto_item_append_text(power_item, " (%dmA)", power*2); offset += 1; /* initialize interface_info to NULL */ usb_trans_info->interface_info = NULL; truncation_expected = (usb_trans_info->setup.wLength < len); /* decode any additional interface and endpoint descriptors */ while(len>(offset-old_offset)) { guint8 next_type; guint8 next_len = 0; gint remaining_tvb, remaining_len; tvbuff_t *next_tvb = NULL; /* Handle truncated descriptors appropriately */ remaining_tvb = tvb_reported_length_remaining(tvb, offset); if (remaining_tvb > 0) { next_len = tvb_get_guint8(tvb, offset); remaining_len = len - (offset - old_offset); if ((next_len < 3) || (next_len > remaining_len)) { proto_tree_add_expert_format(parent_tree, pinfo, &ei_usb_desc_length_invalid, tvb, offset, 1, "Invalid descriptor length: %u", next_len); item = NULL; break; } } if ((remaining_tvb == 0) || (next_len > remaining_tvb)) { if (truncation_expected) break; } next_type = tvb_get_guint8(tvb, offset+1); switch(next_type) { case USB_DT_INTERFACE: offset = dissect_usb_interface_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info); break; case USB_DT_ENDPOINT: offset = dissect_usb_endpoint_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info, &last_ep_type, speed); break; case USB_DT_INTERFACE_ASSOCIATION: offset = dissect_usb_interface_assn_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info); break; case USB_DT_SUPERSPEED_EP_COMPANION: offset = dissect_usb_endpoint_companion_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info, last_ep_type); break; default: next_tvb = tvb_new_subset_length(tvb, offset, next_len); if (dissector_try_uint_new(usb_descriptor_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent_tree, TRUE, usb_conv_info)) { offset += next_len; } else { offset = dissect_usb_unknown_descriptor(pinfo, parent_tree, tvb, offset, usb_conv_info); } break; /* was: return offset; */ } } proto_item_set_len(item, offset-old_offset); return offset; } /* https://wicg.github.io/webusb/#webusb-platform-capability-descriptor */ static int dissect_webusb_platform_descriptor(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_tree_add_item(tree, hf_usb_webusb_bcdVersion, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_webusb_bVendorCode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_usb_webusb_iLandingPage, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; } /* Microsoft OS 2.0 Descriptors Specification */ static int dissect_msos20_platform_descriptor(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_tree_add_item(tree, hf_usb_msos20_dwWindowsVersion, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usb_msos20_wMSOSDescriptorSetTotalLength, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_msos20_bMS_VendorCode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_usb_msos20_bAltEnumCode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; } static struct { e_guid_t uuid; const gchar *text; int (*dissect)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info); } bos_platform_uuids[] = { { {0x3408b638, 0x09a9, 0x47a0, {0x8b, 0xfd, 0xa0, 0x76, 0x88, 0x15, 0xb6, 0x65}}, "WebUSB Platform Capability descriptor", dissect_webusb_platform_descriptor }, { {0xd8dd60df, 0x4589, 0x4cc7, {0x9c, 0xd2, 0x65, 0x9d, 0x9e, 0x64, 0x8a, 0x9f}}, "Microsoft OS 2.0 Platform Capability descriptor", dissect_msos20_platform_descriptor }, }; /* USB 3.2 Specification Table 9-13. Format of a Device Capability Descriptor */ static int dissect_usb_device_capability_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { guint8 cap_type; const gchar *cap_text; e_guid_t uuid; unsigned int i; proto_tree_add_item(tree, hf_usb_bDevCapabilityType, tvb, offset, 1, ENC_LITTLE_ENDIAN); cap_type = tvb_get_guint8(tvb, offset); offset += 1; cap_text = try_val_to_str_ext(cap_type, &usb_capability_vals_ext); if (cap_type == BOS_CAP_USB_20_EXTENSION) { /* USB 2.0 ECN Errata for Link Power Management */ static int * const usb20ext_fields[] = { &hf_usb_usb20ext_LPM, &hf_usb_usb20ext_BESL_HIRD, &hf_usb_usb20ext_baseline_BESL_valid, &hf_usb_usb20ext_deep_BESL_valid, &hf_usb_usb20ext_baseline_BESL, &hf_usb_usb20ext_deep_BESL, NULL }; proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_usb_usb20ext_bmAttributes, ett_usb20ext_bmAttributes, usb20ext_fields, ENC_LITTLE_ENDIAN, BMT_NO_APPEND); offset += 4; } else if (cap_type == BOS_CAP_PLATFORM) { proto_tree_add_item(tree, hf_usb_bReserved, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; tvb_get_letohguid(tvb, offset, &uuid); proto_tree_add_guid(tree, hf_usb_PlatformCapabilityUUID, tvb, offset, 16, &uuid); offset += 16; for (i = 0; i < array_length(bos_platform_uuids); i++) { if (guid_cmp(&bos_platform_uuids[i].uuid, &uuid) == 0) { offset = bos_platform_uuids[i].dissect(pinfo, tree, tvb, offset, usb_conv_info); cap_text = bos_platform_uuids[i].text; break; } } } if (cap_text) { proto_item_append_text(tree, ": %s", cap_text); } return offset; } /* USB 3.2 Specification 9.6.2 Binary Device Object Store (BOS) */ static int dissect_usb_bos_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { proto_item *item; proto_tree *tree; int old_offset = offset; guint16 total_len; usb_trans_info_t *usb_trans_info; usb_trans_info = usb_conv_info->usb_trans_info; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &item, "BOS DESCRIPTOR"); dissect_usb_descriptor_header(tree, tvb, offset, NULL); offset += 2; /* wTotalLength */ proto_tree_add_item(tree, hf_usb_wTotalLength, tvb, offset, 2, ENC_LITTLE_ENDIAN); total_len = tvb_get_letohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_usb_bNumDeviceCaps, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (offset - old_offset >= usb_trans_info->setup.wLength) { /* Do not report the most common case where host finds out about * wTotalLength by requesting just BOS descriptor as Malformed Packet. * TODO: Generic handling of "host requested too few bytes" (which is * perfectly fine, but complicates dissection) because host is allowed * to request any number of bytes. */ return offset; } /* Dissect capabilities */ while (total_len > (offset - old_offset)) { proto_item *desc_item; int prev_offset = offset; guint8 desc_len, desc_type; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_descriptor_device, &desc_item, "DEVICE CAPABILITY DESCRIPTOR"); item = proto_tree_add_item(tree, hf_usb_bLength, tvb, offset, 1, ENC_LITTLE_ENDIAN); desc_len = tvb_get_guint8(tvb, offset); offset += 1; if (desc_len < 3) { expert_add_info_format(pinfo, item, &ei_usb_bLength_too_short, "Invalid Length (must be 3 or larger)"); break; } item = proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN); desc_type = tvb_get_guint8(tvb, offset); offset += 1; if (desc_type == USB_DT_DEVICE_CAPABILITY) { tvbuff_t *desc_tvb = tvb_new_subset_length(tvb, offset, desc_len - 2); offset += dissect_usb_device_capability_descriptor(pinfo, tree, desc_tvb, 0, usb_conv_info); } else { expert_add_info(pinfo, item, &ei_usb_unexpected_desc_type); /* Already reported unexpected type, do not mark rest as undecoded */ offset = prev_offset + desc_len; } if (offset < prev_offset + desc_len) { proto_tree_add_expert(tree, pinfo, &ei_usb_undecoded, tvb, offset, prev_offset + desc_len - offset); offset = prev_offset + desc_len; } proto_item_set_len(item, offset - prev_offset); } proto_item_set_len(item, offset - old_offset); return offset; } /* 9.4.3 */ static int dissect_usb_setup_get_descriptor_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { usb_trans_info_t *usb_trans_info, trans_info; if (usb_conv_info) usb_trans_info = usb_conv_info->usb_trans_info; else usb_trans_info = &trans_info; /* descriptor index */ proto_tree_add_item(tree, hf_usb_descriptor_index, tvb, offset, 1, ENC_LITTLE_ENDIAN); usb_trans_info->u.get_descriptor.usb_index = tvb_get_guint8(tvb, offset); offset += 1; /* descriptor type */ proto_tree_add_item(tree, hf_usb_bDescriptorType, tvb, offset, 1, ENC_LITTLE_ENDIAN); usb_trans_info->u.get_descriptor.type = tvb_get_guint8(tvb, offset); offset += 1; col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(usb_trans_info->u.get_descriptor.type, &std_descriptor_type_vals_ext, "Unknown type %u")); /* language id */ proto_tree_add_item(tree, hf_usb_language_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; /* length */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_get_descriptor_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { usb_trans_info_t *usb_trans_info; usb_speed_t speed; usb_trans_info = usb_conv_info->usb_trans_info; speed = usb_conv_info->speed; col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(usb_trans_info->u.get_descriptor.type, &std_descriptor_type_vals_ext, "Unknown type %u")); switch(usb_trans_info->u.get_descriptor.type) { case USB_DT_INTERFACE: case USB_DT_ENDPOINT: /* an interface or an endpoint descriptor can only be accessed as part of a configuration descriptor */ break; case USB_DT_DEVICE: offset = dissect_usb_device_descriptor(pinfo, tree, tvb, offset, usb_conv_info); break; case USB_DT_OTHER_SPEED_CONFIG: /* USB 2.0 Specification: 9.2.6.6 Speed Dependent Descriptors */ if (speed == USB_SPEED_FULL) speed = USB_SPEED_HIGH; else if (speed == USB_SPEED_HIGH) speed = USB_SPEED_FULL; /* fall-through */ case USB_DT_CONFIG: offset = dissect_usb_configuration_descriptor(pinfo, tree, tvb, offset, usb_conv_info, speed); break; case USB_DT_STRING: offset = dissect_usb_string_descriptor(pinfo, tree, tvb, offset, usb_conv_info); break; case USB_DT_DEVICE_QUALIFIER: offset = dissect_usb_device_qualifier_descriptor(pinfo, tree, tvb, offset, usb_conv_info); break; case USB_DT_BOS: offset = dissect_usb_bos_descriptor(pinfo, tree, tvb, offset, usb_conv_info); break; default: /* XXX dissect the descriptor coming back from the device */ { guint len = tvb_reported_length_remaining(tvb, offset); proto_tree_add_bytes_format(tree, hf_usb_get_descriptor_resp_generic, tvb, offset, len, NULL, "GET DESCRIPTOR Response data (unknown descriptor type %u): %s", usb_trans_info->u.get_descriptor.type, tvb_bytes_to_str(pinfo->pool, tvb, offset, len)); offset = offset + len; } break; } return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / GET INTERFACE */ /* 9.4.4 */ static int dissect_usb_setup_get_interface_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* interface */ proto_tree_add_item(tree, hf_usb_wInterface, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* length */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_get_interface_response(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* alternate setting */ proto_tree_add_item(tree, hf_usb_bAlternateSetting, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / GET STATUS */ /* 9.4.5 */ static int dissect_usb_setup_get_status_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* zero/interface/endpoint */ if (usb_conv_info) { guint8 recip; recip = USB_RECIPIENT(usb_conv_info->usb_trans_info->setup.requesttype); switch (recip) { case RQT_SETUP_RECIPIENT_INTERFACE: proto_tree_add_item(tree, hf_usb_wInterface, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_ENDPOINT: proto_tree_add_item(tree, hf_usb_wEndpoint, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_DEVICE: case RQT_SETUP_RECIPIENT_OTHER: default: proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } } else { proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); } offset += 2; /* length */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_get_status_response(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* status */ /* XXX - show bits */ proto_tree_add_item(tree, hf_usb_wStatus, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / SET ADDRESS */ /* 9.4.6 */ static int dissect_usb_setup_set_address_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* device address */ proto_tree_add_item(tree, hf_usb_device_address, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_set_address_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / SET CONFIGURATION */ /* 9.4.7 */ static int dissect_usb_setup_set_configuration_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* configuration value */ proto_tree_add_item(tree, hf_usb_bConfigurationValue, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_set_configuration_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / SET FEATURE */ /* 9.4.9 */ static int dissect_usb_setup_set_feature_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { guint8 recip; if (usb_conv_info) { recip = USB_RECIPIENT(usb_conv_info->usb_trans_info->setup.requesttype); /* feature selector, zero/interface/endpoint */ switch (recip) { case RQT_SETUP_RECIPIENT_DEVICE: proto_tree_add_item(tree, hf_usb_device_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_INTERFACE: proto_tree_add_item(tree, hf_usb_interface_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_wInterface, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_ENDPOINT: proto_tree_add_item(tree, hf_usb_endpoint_wFeatureSelector, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_wEndpoint, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case RQT_SETUP_RECIPIENT_OTHER: default: proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } } else { /* No conversation information, so recipient type is unknown */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); } offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_set_feature_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / SET INTERFACE */ /* 9.4.10 */ static int dissect_usb_setup_set_interface_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { guint8 alt_setting, interface_num; /* alternate setting */ alt_setting = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_usb_bAlternateSetting, tvb, offset, 2, alt_setting); offset += 2; /* interface */ interface_num = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_usb_wInterface, tvb, offset, 2, interface_num); offset += 2; /* zero */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (!PINFO_FD_VISITED(pinfo)) { guint i, count; usb_conv_info_t *iface_conv_info = get_usb_iface_conv_info(pinfo, interface_num); /* update the conversation info with the selected alternate setting */ count = wmem_array_get_count(iface_conv_info->alt_settings); for (i = 0; i < count; i++) { usb_alt_setting_t *alternate_setting = (usb_alt_setting_t *)wmem_array_index(iface_conv_info->alt_settings, i); if (alternate_setting->altSetting == alt_setting) { iface_conv_info->interfaceClass = alternate_setting->interfaceClass; iface_conv_info->interfaceSubclass = alternate_setting->interfaceSubclass; iface_conv_info->interfaceProtocol = alternate_setting->interfaceProtocol; iface_conv_info->interfaceNum = alternate_setting->interfaceNum; break; } } } return offset; } static int dissect_usb_setup_set_interface_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { return offset; } /* * These dissectors are used to dissect the setup part and the data * for URB_CONTROL_INPUT / SYNCH FRAME */ /* 9.4.11 */ static int dissect_usb_setup_synch_frame_request(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { /* zero */ proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* endpoint */ proto_tree_add_item(tree, hf_usb_wEndpoint, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; /* two */ proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_usb_setup_synch_frame_response(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset, usb_conv_info_t *usb_conv_info _U_) { /* frame number */ proto_tree_add_item(tree, hf_usb_wFrameNumber, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } /* Dissector used for unknown USB setup request/responses */ static int dissect_usb_setup_generic(packet_info *pinfo _U_, proto_tree *tree , tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_) { proto_tree_add_item(tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } typedef int (*usb_setup_dissector)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info); typedef struct _usb_setup_dissector_table_t { guint8 request; usb_setup_dissector dissector; } usb_setup_dissector_table_t; static const usb_setup_dissector_table_t setup_request_dissectors[] = { {USB_SETUP_GET_STATUS, dissect_usb_setup_get_status_request}, {USB_SETUP_CLEAR_FEATURE, dissect_usb_setup_clear_feature_request}, {USB_SETUP_SET_FEATURE, dissect_usb_setup_set_feature_request}, {USB_SETUP_SET_ADDRESS, dissect_usb_setup_set_address_request}, {USB_SETUP_GET_DESCRIPTOR, dissect_usb_setup_get_descriptor_request}, {USB_SETUP_SET_CONFIGURATION, dissect_usb_setup_set_configuration_request}, {USB_SETUP_GET_INTERFACE, dissect_usb_setup_get_interface_request}, {USB_SETUP_SET_INTERFACE, dissect_usb_setup_set_interface_request}, {USB_SETUP_SYNCH_FRAME, dissect_usb_setup_synch_frame_request}, {0, NULL} }; static const usb_setup_dissector_table_t setup_response_dissectors[] = { {USB_SETUP_GET_STATUS, dissect_usb_setup_get_status_response}, {USB_SETUP_CLEAR_FEATURE, dissect_usb_setup_clear_feature_response}, {USB_SETUP_SET_FEATURE, dissect_usb_setup_set_feature_response}, {USB_SETUP_SET_ADDRESS, dissect_usb_setup_set_address_response}, {USB_SETUP_GET_DESCRIPTOR, dissect_usb_setup_get_descriptor_response}, {USB_SETUP_GET_CONFIGURATION, dissect_usb_setup_get_configuration_response}, {USB_SETUP_SET_CONFIGURATION, dissect_usb_setup_set_configuration_response}, {USB_SETUP_GET_INTERFACE, dissect_usb_setup_get_interface_response}, {USB_SETUP_SET_INTERFACE, dissect_usb_setup_set_interface_response}, {USB_SETUP_SYNCH_FRAME, dissect_usb_setup_synch_frame_response}, {0, NULL} }; static const value_string setup_request_names_vals[] = { {USB_SETUP_GET_STATUS, "GET STATUS"}, {USB_SETUP_CLEAR_FEATURE, "CLEAR FEATURE"}, {USB_SETUP_SET_FEATURE, "SET FEATURE"}, {USB_SETUP_SET_ADDRESS, "SET ADDRESS"}, {USB_SETUP_GET_DESCRIPTOR, "GET DESCRIPTOR"}, {USB_SETUP_SET_DESCRIPTOR, "SET DESCRIPTOR"}, {USB_SETUP_GET_CONFIGURATION, "GET CONFIGURATION"}, {USB_SETUP_SET_CONFIGURATION, "SET CONFIGURATION"}, {USB_SETUP_GET_INTERFACE, "GET INTERFACE"}, {USB_SETUP_SET_INTERFACE, "SET INTERFACE"}, {USB_SETUP_SYNCH_FRAME, "SYNCH FRAME"}, {USB_SETUP_SET_SEL, "SET SEL"}, {USB_SETUP_SET_ISOCH_DELAY, "SET ISOCH DELAY"}, {0, NULL} }; static value_string_ext setup_request_names_vals_ext = VALUE_STRING_EXT_INIT(setup_request_names_vals); static const true_false_string tfs_bmrequesttype_direction = { "Device-to-host", "Host-to-device" }; static const value_string bmrequesttype_type_vals[] = { {RQT_SETUP_TYPE_STANDARD, "Standard"}, {RQT_SETUP_TYPE_CLASS, "Class"}, {RQT_SETUP_TYPE_VENDOR, "Vendor"}, {0, NULL} }; static const value_string bmrequesttype_recipient_vals[] = { {RQT_SETUP_RECIPIENT_DEVICE, "Device" }, {RQT_SETUP_RECIPIENT_INTERFACE, "Interface" }, {RQT_SETUP_RECIPIENT_ENDPOINT, "Endpoint" }, {RQT_SETUP_RECIPIENT_OTHER, "Other" }, {0, NULL } }; /* Dissector used for standard usb setup requests */ static int dissect_usb_standard_setup_request(packet_info *pinfo, proto_tree *tree , tvbuff_t *tvb, usb_conv_info_t *usb_conv_info, usb_trans_info_t *usb_trans_info) { gint offset = 0; const usb_setup_dissector_table_t *tmp; usb_setup_dissector dissector; proto_tree_add_item(tree, hf_usb_request, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request", val_to_str_ext(usb_trans_info->setup.request, &setup_request_names_vals_ext, "Unknown type %x")); dissector = NULL; for(tmp = setup_request_dissectors;tmp->dissector;tmp++) { if (tmp->request == usb_trans_info->setup.request) { dissector = tmp->dissector; break; } } if (!dissector) { dissector = &dissect_usb_setup_generic; } offset = dissector(pinfo, tree, tvb, offset, usb_conv_info); return offset; } /* Dissector used for standard usb setup responses */ static int dissect_usb_standard_setup_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info) { const usb_setup_dissector_table_t *tmp; usb_setup_dissector dissector; gint length_remaining; col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response", val_to_str_ext(usb_conv_info->usb_trans_info->setup.request, &setup_request_names_vals_ext, "Unknown type %x")); dissector = NULL; for(tmp = setup_response_dissectors;tmp->dissector;tmp++) { if (tmp->request == usb_conv_info->usb_trans_info->setup.request) { dissector = tmp->dissector; break; } } length_remaining = tvb_reported_length_remaining(tvb, offset); if (length_remaining <= 0) return offset; if (dissector) { offset = dissector(pinfo, tree, tvb, offset, usb_conv_info); } else { proto_tree_add_item(tree, hf_usb_control_response_generic, tvb, offset, length_remaining, ENC_NA); offset += length_remaining; } return offset; } static void usb_tap_queue_packet(packet_info *pinfo, guint8 urb_type, usb_conv_info_t *usb_conv_info) { usb_tap_data_t *tap_data; tap_data = wmem_new(pinfo->pool, usb_tap_data_t); tap_data->urb_type = urb_type; tap_data->transfer_type = (guint8)(usb_conv_info->transfer_type); tap_data->conv_info = usb_conv_info; tap_data->trans_info = usb_conv_info->usb_trans_info; tap_queue_packet(usb_tap, pinfo, tap_data); } static gboolean is_usb_standard_setup_request(usb_trans_info_t *usb_trans_info) { guint8 type, recip; type = USB_TYPE(usb_trans_info->setup.requesttype); recip = USB_RECIPIENT(usb_trans_info->setup.requesttype); if (type != RQT_SETUP_TYPE_STANDARD) return FALSE; /* the USB standards defines the GET_DESCRIPTOR request only as a request to a device if it's not aimed at a device, it's a non-standard request that should be handled by a class-specific dissector */ if (usb_trans_info->setup.request == USB_SETUP_GET_DESCRIPTOR && recip != RQT_SETUP_RECIPIENT_DEVICE) { return FALSE; } return TRUE; } static gint try_dissect_next_protocol(proto_tree *tree, tvbuff_t *next_tvb, packet_info *pinfo, usb_conv_info_t *usb_conv_info, guint8 urb_type, proto_tree *urb_tree, proto_tree *setup_tree) { int ret; wmem_tree_key_t key[4]; guint32 k_frame_number; guint32 k_device_address; guint32 k_bus_id; usb_conv_info_t *old_conv_info = usb_conv_info; usb_trans_info_t *usb_trans_info; heur_dtbl_entry_t *hdtbl_entry; heur_dissector_list_t heur_subdissector_list = NULL; dissector_table_t usb_dissector_table = NULL; proto_item *sub_item; device_product_data_t *device_product_data; device_protocol_data_t *device_protocol_data; guint8 ctrl_recip; /* if we select the next dissector based on a class, this is the (device or interface) class we're using */ guint32 usb_class; guint8 transfer_type; gboolean use_setup_tree = FALSE; if (!usb_conv_info) { /* * Not enough information to choose the next protocol. * XXX - is there something we can still do here? */ if (tvb_reported_length(next_tvb) > 0) call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(next_tvb); } /* try dissect by "usb.device" */ ret = dissector_try_uint_new(device_to_dissector, (guint32)(usb_conv_info->bus_id<<16 | usb_conv_info->device_address), next_tvb, pinfo, tree, TRUE, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); k_frame_number = pinfo->num; k_device_address = usb_conv_info->device_address; k_bus_id = usb_conv_info->bus_id; key[0].length = 1; key[0].key = &k_device_address; key[1].length = 1; key[1].key = &k_bus_id; key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; /* try dissect by "usb.protocol" */ device_protocol_data = (device_protocol_data_t *)wmem_tree_lookup32_array_le(device_to_protocol_table, key); if (device_protocol_data && device_protocol_data->bus_id == usb_conv_info->bus_id && device_protocol_data->device_address == usb_conv_info->device_address) { ret = dissector_try_uint_new(protocol_to_dissector, (guint32)device_protocol_data->protocol, next_tvb, pinfo, tree, TRUE, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); } device_product_data = (device_product_data_t *)wmem_tree_lookup32_array_le(device_to_product_table, key); if (device_product_data && device_product_data->bus_id == usb_conv_info->bus_id && device_product_data->device_address == usb_conv_info->device_address) { ret = dissector_try_uint_new(product_to_dissector, (guint32)(device_product_data->vendor<<16 | device_product_data->product), next_tvb, pinfo, tree, TRUE, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); } transfer_type = usb_conv_info->transfer_type; if (transfer_type == URB_UNKNOWN) transfer_type = usb_conv_info->descriptor_transfer_type; switch(transfer_type) { case URB_BULK: heur_subdissector_list = heur_bulk_subdissector_list; usb_dissector_table = usb_bulk_dissector_table; break; case URB_INTERRUPT: heur_subdissector_list = heur_interrupt_subdissector_list; usb_dissector_table = usb_interrupt_dissector_table; break; case URB_CONTROL: usb_trans_info = usb_conv_info->usb_trans_info; if (!usb_trans_info) break; /* for standard control requests and responses, there's no need to query dissector tables */ if (is_usb_standard_setup_request(usb_trans_info)) break; /* When dissecting requests, and Setup Data tree is created, pass it to next dissector instead of parent. */ if (usb_conv_info->is_request && setup_tree) use_setup_tree = TRUE; ctrl_recip = USB_RECIPIENT(usb_trans_info->setup.requesttype); if (ctrl_recip == RQT_SETUP_RECIPIENT_INTERFACE) { guint8 interface_num = usb_trans_info->setup.wIndex & 0xff; heur_subdissector_list = heur_control_subdissector_list; usb_dissector_table = usb_control_dissector_table; usb_conv_info = get_usb_iface_conv_info(pinfo, interface_num); usb_conv_info->usb_trans_info = usb_trans_info; } else if (ctrl_recip == RQT_SETUP_RECIPIENT_ENDPOINT) { address endpoint_addr; gint endpoint; guint32 src_endpoint, dst_endpoint; conversation_t *conversation; heur_subdissector_list = heur_control_subdissector_list; usb_dissector_table = usb_control_dissector_table; endpoint = usb_trans_info->setup.wIndex & 0x0f; if (usb_conv_info->is_request) { usb_address_t *dst_addr = wmem_new0(pinfo->pool, usb_address_t); dst_addr->bus_id = usb_conv_info->bus_id; dst_addr->device = usb_conv_info->device_address; dst_addr->endpoint = dst_endpoint = GUINT32_TO_LE(endpoint); set_address(&endpoint_addr, usb_address_type, USB_ADDR_LEN, (char *)dst_addr); conversation = get_usb_conversation(pinfo, &pinfo->src, &endpoint_addr, pinfo->srcport, dst_endpoint); } else { usb_address_t *src_addr = wmem_new0(pinfo->pool, usb_address_t); src_addr->bus_id = usb_conv_info->bus_id; src_addr->device = usb_conv_info->device_address; src_addr->endpoint = src_endpoint = GUINT32_TO_LE(endpoint); set_address(&endpoint_addr, usb_address_type, USB_ADDR_LEN, (char *)src_addr); conversation = get_usb_conversation(pinfo, &endpoint_addr, &pinfo->dst, src_endpoint, pinfo->destport); } usb_conv_info = get_usb_conv_info(conversation); usb_conv_info->usb_trans_info = usb_trans_info; } else { /* the recipient is "device" or "other" or "reserved" there's no way for us to determine the interfaceClass we set the usb_dissector_table anyhow as some dissectors register for control messages to IF_CLASS_UNKNOWN (this should be fixed) */ heur_subdissector_list = heur_control_subdissector_list; usb_dissector_table = usb_control_dissector_table; } if (old_conv_info != usb_conv_info) { /* Preserve URB specific information */ usb_conv_info->is_setup = old_conv_info->is_setup; usb_conv_info->is_request = old_conv_info->is_request; usb_conv_info->setup_requesttype = old_conv_info->setup_requesttype; usb_conv_info->speed = old_conv_info->speed; } usb_tap_queue_packet(pinfo, urb_type, usb_conv_info); sub_item = proto_tree_add_uint(urb_tree, hf_usb_bInterfaceClass, next_tvb, 0, 0, usb_conv_info->interfaceClass); proto_item_set_generated(sub_item); break; default: break; } if (try_heuristics && heur_subdissector_list) { ret = dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, use_setup_tree ? setup_tree : tree, &hdtbl_entry, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); } if (usb_dissector_table) { /* we prefer the interface class unless it says we should refer to the device class XXX - use the device class if the interface class is unknown */ if (usb_conv_info->interfaceClass == IF_CLASS_DEVICE) { usb_class = (usb_conv_info->device_protocol>>16) & 0xFF; } else { usb_class = usb_conv_info->interfaceClass; } ret = dissector_try_uint_new(usb_dissector_table, usb_class, next_tvb, pinfo, use_setup_tree ? setup_tree : tree, TRUE, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); /* try protocol specific dissector if there is one */ usb_class = USB_PROTOCOL_KEY(usb_conv_info->interfaceClass, usb_conv_info->interfaceSubclass, usb_conv_info->interfaceProtocol); ret = dissector_try_uint_new(usb_dissector_table, usb_class, next_tvb, pinfo, use_setup_tree ? setup_tree : tree, TRUE, usb_conv_info); if (ret) return tvb_captured_length(next_tvb); } return 0; } static int dissect_usb_setup_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 urb_type, usb_conv_info_t *usb_conv_info) { proto_tree *parent; tvbuff_t *next_tvb = NULL; gint length_remaining; parent = proto_tree_get_parent_tree(tree); if (usb_conv_info) { if (usb_conv_info->usb_trans_info && is_usb_standard_setup_request(usb_conv_info->usb_trans_info)) { offset = dissect_usb_standard_setup_response(pinfo, parent, tvb, offset, usb_conv_info); } else { next_tvb = tvb_new_subset_remaining(tvb, offset); offset += try_dissect_next_protocol(parent, next_tvb, pinfo, usb_conv_info, urb_type, tree, NULL); length_remaining = tvb_reported_length_remaining(tvb, offset); if (length_remaining > 0) { proto_tree_add_item(parent, hf_usb_control_response_generic, tvb, offset, length_remaining, ENC_NA); offset += length_remaining; } } } else { /* no matching request available */ length_remaining = tvb_reported_length_remaining(tvb, offset); if (length_remaining > 0) { proto_tree_add_item(parent, hf_usb_control_response_generic, tvb, offset, length_remaining, ENC_NA); offset += length_remaining; } } return offset; } static int dissect_usb_bmrequesttype(proto_tree *parent_tree, tvbuff_t *tvb, int offset, guint8 *byte) { guint64 val; static int * const bmRequestType_bits[] = { &hf_usb_bmRequestType_direction, &hf_usb_bmRequestType_type, &hf_usb_bmRequestType_recipient, NULL }; proto_tree_add_bitmask_with_flags_ret_uint64(parent_tree, tvb, offset, hf_usb_bmRequestType, ett_usb_setup_bmrequesttype, bmRequestType_bits, ENC_LITTLE_ENDIAN, BMT_NO_APPEND, &val); *byte = (guint8) val; return ++offset; } int dissect_urb_transfer_flags(tvbuff_t *tvb, int offset, proto_tree* tree, int hf, int endian) { proto_tree_add_bitmask(tree, tvb, offset, hf, ett_transfer_flags, transfer_flags_fields, endian); return 4; } static int dissect_linux_usb_pseudo_header_ext(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(tree, hf_usb_urb_interval, tvb, offset, 4, ENC_HOST_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usb_urb_start_frame, tvb, offset, 4, ENC_HOST_ENDIAN); offset += 4; dissect_urb_transfer_flags(tvb, offset, tree, hf_usb_urb_copy_of_transfer_flags, ENC_HOST_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usb_iso_numdesc, tvb, offset, 4, ENC_HOST_ENDIAN); offset += 4; return offset; } /* Dissector used for usb setup requests */ static int dissect_usb_setup_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 urb_type, usb_conv_info_t *usb_conv_info, usb_header_t header_type, guint64 usb_id) { gint setup_offset; gint req_type; gint ret; proto_tree *parent, *setup_tree; usb_trans_info_t *usb_trans_info, trans_info; tvbuff_t *next_tvb, *data_tvb = NULL; guint8 bm_request_type; /* we should do the NULL check in all non-static functions */ if (usb_conv_info) usb_trans_info = usb_conv_info->usb_trans_info; else usb_trans_info = &trans_info; parent = proto_tree_get_parent_tree(tree); setup_tree = proto_tree_add_subtree(parent, tvb, offset, 8, ett_usb_setup_hdr, NULL, "Setup Data"); req_type = USB_TYPE(tvb_get_guint8(tvb, offset)); usb_trans_info->setup.requesttype = tvb_get_guint8(tvb, offset); if (usb_conv_info) { usb_conv_info->setup_requesttype = tvb_get_guint8(tvb, offset); if (req_type != RQT_SETUP_TYPE_CLASS) usb_tap_queue_packet(pinfo, urb_type, usb_conv_info); } offset = dissect_usb_bmrequesttype(setup_tree, tvb, offset, &bm_request_type); /* as we're going through the data, we build a next_tvb that contains the the setup packet without the request type and request-specific data all subsequent dissection routines work on this tvb */ setup_offset = offset; usb_trans_info->setup.request = tvb_get_guint8(tvb, offset); offset++; usb_trans_info->setup.wValue = tvb_get_letohs(tvb, offset); offset += 2; usb_trans_info->setup.wIndex = tvb_get_letohs(tvb, offset); offset += 2; usb_trans_info->setup.wLength = tvb_get_letohs(tvb, offset); offset += 2; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, tree); } else if (header_type == USB_HEADER_USBPCAP) { if ((bm_request_type & 0x80) == 0 && usb_trans_info->setup.wLength > 0 && tvb_reported_length_remaining(tvb, offset) == 0) { /* UPBPcap older than 1.5.0.0 packet, save setup data and do not call subdissector */ if (!PINFO_FD_VISITED(pinfo)) { wmem_tree_key_t key[3]; usbpcap_setup_data_t *setup_data = wmem_new(wmem_file_scope(), usbpcap_setup_data_t); setup_data->usb_id = usb_id; tvb_memcpy(tvb, setup_data->setup_data, setup_offset-1, 8); key[0].length = 2; key[0].key = (guint32 *)&usb_id; key[1].length = 1; key[1].key = &pinfo->num; key[2].length = 0; key[2].key = NULL; wmem_tree_insert32_array(usbpcap_setup_data, key, setup_data); } proto_tree_add_item(setup_tree, hf_usb_request_unknown_class, tvb, setup_offset, 1, ENC_LITTLE_ENDIAN); dissect_usb_setup_generic(pinfo, setup_tree, tvb, setup_offset+1, usb_conv_info); return offset; } } if (tvb_captured_length_remaining(tvb, offset) > 0) { next_tvb = tvb_new_composite(); tvb_composite_append(next_tvb, tvb_new_subset_length_caplen(tvb, setup_offset, 7, 7)); data_tvb = tvb_new_subset_remaining(tvb, offset); tvb_composite_append(next_tvb, data_tvb); offset += tvb_captured_length(data_tvb); tvb_composite_finalize(next_tvb); next_tvb = tvb_new_child_real_data(tvb, (const guint8 *) tvb_memdup(pinfo->pool, next_tvb, 0, tvb_captured_length(next_tvb)), tvb_captured_length(next_tvb), tvb_captured_length(next_tvb)); add_new_data_source(pinfo, next_tvb, "USB Control"); } else { next_tvb = tvb_new_subset_length_caplen(tvb, setup_offset, 7, 7); } /* at this point, offset contains the number of bytes that we dissected */ if (is_usb_standard_setup_request(usb_trans_info)) { /* there's no point in checking the return value as there's no fallback for standard setup requests */ dissect_usb_standard_setup_request(pinfo, setup_tree, next_tvb, usb_conv_info, usb_trans_info); } else { /* no standard request - pass it on to class-specific dissectors */ ret = try_dissect_next_protocol( parent, next_tvb, pinfo, usb_conv_info, urb_type, tree, setup_tree); if (ret <= 0) { /* no class-specific dissector could handle it, dissect it as generic setup request */ proto_tree_add_item(setup_tree, hf_usb_request_unknown_class, next_tvb, 0, 1, ENC_LITTLE_ENDIAN); dissect_usb_setup_generic(pinfo, setup_tree, next_tvb, 1, usb_conv_info); } /* at this point, non-standard request has been dissectored */ } if (data_tvb) proto_tree_add_item(setup_tree, hf_usb_data_fragment, data_tvb, 0, -1, ENC_NA); return offset; } /* dissect the linux-specific USB pseudo header and fill the conversation struct return the number of dissected bytes */ static gint dissect_linux_usb_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info, guint64 *urb_id) { guint8 transfer_type; guint8 endpoint_byte; guint8 transfer_type_and_direction; guint8 urb_type; guint32 flag; guint32 bus_id; *urb_id = tvb_get_guint64(tvb, 0, ENC_HOST_ENDIAN); proto_tree_add_uint64(tree, hf_usb_urb_id, tvb, 0, 8, *urb_id); /* show the urb type of this URB as string and as a character */ urb_type = tvb_get_guint8(tvb, 8); usb_conv_info->is_request = (urb_type==URB_SUBMIT); proto_tree_add_uint(tree, hf_usb_linux_urb_type, tvb, 8, 1, urb_type); proto_tree_add_item(tree, hf_usb_linux_transfer_type, tvb, 9, 1, ENC_LITTLE_ENDIAN); transfer_type = tvb_get_guint8(tvb, 9); usb_conv_info->transfer_type = transfer_type; endpoint_byte = tvb_get_guint8(tvb, 10); /* direction bit | endpoint */ usb_conv_info->endpoint = endpoint_byte & 0x7F; if (endpoint_byte & URB_TRANSFER_IN) usb_conv_info->direction = P2P_DIR_RECV; else usb_conv_info->direction = P2P_DIR_SENT; transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_byte & 0x80); col_append_str(pinfo->cinfo, COL_INFO, val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x")); proto_tree_add_bitmask(tree, tvb, 10, hf_usb_endpoint_address, ett_usb_endpoint, usb_endpoint_fields, ENC_NA); proto_tree_add_item(tree, hf_usb_device_address, tvb, 11, 1, ENC_LITTLE_ENDIAN); usb_conv_info->device_address = (guint16)tvb_get_guint8(tvb, 11); proto_tree_add_item_ret_uint(tree, hf_usb_bus_id, tvb, 12, 2, ENC_HOST_ENDIAN, &bus_id); usb_conv_info->bus_id = (guint16) bus_id; /* Right after the pseudo header we always have * sizeof(struct usb_device_setup_hdr) bytes. The content of these * bytes only have meaning in case setup_flag == 0. */ proto_tree_add_item_ret_uint(tree, hf_usb_setup_flag, tvb, 14, 1, ENC_NA, &flag); if (flag == 0) { usb_conv_info->is_setup = TRUE; if (usb_conv_info->transfer_type!=URB_CONTROL) proto_tree_add_expert(tree, pinfo, &ei_usb_invalid_setup, tvb, 14, 1); } else { usb_conv_info->is_setup = FALSE; } proto_tree_add_item(tree, hf_usb_data_flag, tvb, 15, 1, ENC_NA); proto_tree_add_item(tree, hf_usb_urb_ts_sec, tvb, 16, 8, ENC_HOST_ENDIAN); proto_tree_add_item(tree, hf_usb_urb_ts_usec, tvb, 24, 4, ENC_HOST_ENDIAN); proto_tree_add_item(tree, hf_usb_urb_status, tvb, 28, 4, ENC_HOST_ENDIAN); proto_tree_add_item(tree, hf_usb_urb_len, tvb, 32, 4, ENC_HOST_ENDIAN); proto_tree_add_item(tree, hf_usb_urb_data_len, tvb, 36, 4, ENC_HOST_ENDIAN); return 40; } /* dissect the usbpcap_buffer_packet_header and fill the conversation struct this function does not handle the transfer-specific headers return the number of bytes processed */ static gint dissect_usbpcap_buffer_packet_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info, guint32 *win32_data_len, guint64 *irp_id) { proto_item *item; guint32 function_code; guint8 transfer_type; guint8 endpoint_byte; guint8 transfer_type_and_direction; guint8 tmp_val8; proto_tree_add_item(tree, hf_usb_win32_header_len, tvb, 0, 2, ENC_LITTLE_ENDIAN); *irp_id = tvb_get_guint64(tvb, 2, ENC_LITTLE_ENDIAN); proto_tree_add_uint64(tree, hf_usb_irp_id, tvb, 2, 8, *irp_id); proto_tree_add_item(tree, hf_usb_usbd_status, tvb, 10, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item_ret_uint(tree, hf_usb_function, tvb, 14, 2, ENC_LITTLE_ENDIAN, &function_code); proto_tree_add_bitmask(tree, tvb, 16, hf_usb_info, ett_usb_usbpcap_info, usb_usbpcap_info_fields, ENC_LITTLE_ENDIAN); tmp_val8 = tvb_get_guint8(tvb, 16); /* TODO: Handle errors */ if (tmp_val8 & 0x01) { usb_conv_info->is_request = FALSE; } else { usb_conv_info->is_request = TRUE; } proto_tree_add_item(tree, hf_usb_bus_id, tvb, 17, 2, ENC_LITTLE_ENDIAN); usb_conv_info->bus_id = tvb_get_letohs(tvb, 17); proto_tree_add_item(tree, hf_usb_win32_device_address, tvb, 19, 2, ENC_LITTLE_ENDIAN); usb_conv_info->device_address = tvb_get_letohs(tvb, 19); endpoint_byte = tvb_get_guint8(tvb, 21); usb_conv_info->direction = endpoint_byte&URB_TRANSFER_IN ? P2P_DIR_RECV : P2P_DIR_SENT; usb_conv_info->endpoint = endpoint_byte&0x7F; proto_tree_add_bitmask(tree, tvb, 21, hf_usb_endpoint_address, ett_usb_endpoint, usb_endpoint_fields, ENC_LITTLE_ENDIAN); transfer_type = tvb_get_guint8(tvb, 22); usb_conv_info->transfer_type = transfer_type; item = proto_tree_add_item(tree, hf_usb_win32_transfer_type, tvb, 22, 1, ENC_LITTLE_ENDIAN); if (transfer_type == URB_UNKNOWN) { expert_add_info(pinfo, item, &ei_usb_usbpcap_unknown_urb); } /* Workaround bug in captures created with USBPcap earlier than 1.3.0.0 */ if ((endpoint_byte == 0x00) && (transfer_type == URB_CONTROL) && (tvb_get_guint8(tvb, 27) == USB_CONTROL_STAGE_DATA)) { usb_conv_info->is_request = TRUE; } if (transfer_type != USBPCAP_URB_IRP_INFO) { transfer_type_and_direction = (transfer_type & 0x7F) | (endpoint_byte & 0x80); col_append_str(pinfo->cinfo, COL_INFO, val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x")); } else { col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext(function_code, &win32_urb_function_vals_ext, "Unknown function %x")); } *win32_data_len = tvb_get_letohl(tvb, 23); proto_tree_add_item(tree, hf_usb_win32_data_len, tvb, 23, 4, ENC_LITTLE_ENDIAN); /* by default, we assume it's no setup packet the correct values will be set when we parse the control header */ usb_conv_info->is_setup = FALSE; usb_conv_info->setup_requesttype = 0; /* we don't handle the transfer-specific headers here */ return 27; } static gint dissect_darwin_buffer_packet_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info_t *usb_conv_info, guint64 *id) { guint8 transfer_type; guint8 request_type; guint8 endpoint_byte; guint8 transfer_type_and_direction; guint8 header_length; proto_tree_add_item(tree, hf_usb_darwin_bcd_version, tvb, 0, 2, ENC_LITTLE_ENDIAN); header_length = tvb_get_guint8(tvb, 2); proto_tree_add_item(tree, hf_usb_darwin_header_len, tvb, 2, 1, ENC_LITTLE_ENDIAN); request_type = tvb_get_guint8(tvb, 3); usb_conv_info->is_request = (request_type == DARWIN_IO_SUBMIT); proto_tree_add_uint(tree, hf_usb_darwin_request_type, tvb, 3, 1, request_type); proto_tree_add_item(tree, hf_usb_darwin_io_len, tvb, 4, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_darwin_io_status, tvb, 8, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_darwin_iso_num_packets, tvb, 12, 4, ENC_LITTLE_ENDIAN); *id = tvb_get_guint64(tvb, 16, ENC_LITTLE_ENDIAN); proto_tree_add_uint64(tree, hf_usb_darwin_io_id, tvb, 16, 8, *id); proto_tree_add_item(tree, hf_usb_darwin_device_location, tvb, 24, 4, ENC_LITTLE_ENDIAN); usb_conv_info->bus_id = tvb_get_letohl(tvb, 24) >> 24; proto_tree_add_item(tree, hf_usb_darwin_speed, tvb, 28, 1, ENC_LITTLE_ENDIAN); usb_conv_info->device_address = (guint16)tvb_get_guint8(tvb, 29); proto_tree_add_uint(tree, hf_usb_darwin_device_address, tvb, 29, 1, usb_conv_info->device_address); endpoint_byte = tvb_get_guint8(tvb, 30); /* direction bit | endpoint */ usb_conv_info->endpoint = endpoint_byte & 0x7F; if (endpoint_byte & URB_TRANSFER_IN) { usb_conv_info->direction = P2P_DIR_RECV; } else { usb_conv_info->direction = P2P_DIR_SENT; } proto_tree_add_uint(tree, hf_usb_darwin_endpoint_address, tvb, 30, 1, endpoint_byte); proto_tree_add_bitmask(tree, tvb, 30, hf_usb_endpoint_number, ett_usb_endpoint, usb_endpoint_fields, ENC_LITTLE_ENDIAN); transfer_type = MIN(tvb_get_guint8(tvb, 31), G_N_ELEMENTS(darwin_endpoint_to_linux) - 1); usb_conv_info->transfer_type = darwin_endpoint_to_linux[transfer_type]; proto_tree_add_uint(tree, hf_usb_darwin_endpoint_type, tvb, 31, 1, transfer_type); transfer_type_and_direction = (darwin_endpoint_to_linux[transfer_type] & 0x7F) | (endpoint_byte & 0x80); col_append_str(pinfo->cinfo, COL_INFO, val_to_str(transfer_type_and_direction, usb_transfer_type_and_direction_vals, "Unknown type %x")); col_append_str(pinfo->cinfo, COL_INFO, usb_conv_info->is_request == TRUE ? " (submitted)" : " (completed)"); usb_conv_info->is_setup = FALSE; if ((usb_conv_info->is_request == TRUE) && (usb_conv_info->transfer_type == URB_CONTROL)) { usb_conv_info->is_setup = TRUE; } usb_conv_info->setup_requesttype = 0; /* we don't handle the transfer-specific headers here */ return header_length; } /* Set the usb_address_t fields based on the direction of the urb */ static void usb_set_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint16 bus_id, guint16 device_address, int endpoint, gboolean req) { proto_item *sub_item; usb_address_t *src_addr = wmem_new0(pinfo->pool, usb_address_t), *dst_addr = wmem_new0(pinfo->pool, usb_address_t); guint8 *str_src_addr; guint8 *str_dst_addr; if (req) { /* request */ src_addr->device = 0xffffffff; src_addr->endpoint = NO_ENDPOINT; dst_addr->device = GUINT16_TO_LE(device_address); dst_addr->endpoint = GUINT32_TO_LE(endpoint); } else { /* response */ src_addr->device = GUINT16_TO_LE(device_address); src_addr->endpoint = GUINT32_TO_LE(endpoint); dst_addr->device = 0xffffffff; dst_addr->endpoint = NO_ENDPOINT; } src_addr->bus_id = GUINT16_TO_LE(bus_id); dst_addr->bus_id = GUINT16_TO_LE(bus_id); set_address(&pinfo->net_src, usb_address_type, USB_ADDR_LEN, (char *)src_addr); copy_address_shallow(&pinfo->src, &pinfo->net_src); set_address(&pinfo->net_dst, usb_address_type, USB_ADDR_LEN, (char *)dst_addr); copy_address_shallow(&pinfo->dst, &pinfo->net_dst); pinfo->ptype = PT_USB; pinfo->srcport = src_addr->endpoint; pinfo->destport = dst_addr->endpoint; /* sent/received is from the perspective of the USB host */ pinfo->p2p_dir = req ? P2P_DIR_SENT : P2P_DIR_RECV; str_src_addr = address_to_str(pinfo->pool, &pinfo->src); str_dst_addr = address_to_str(pinfo->pool, &pinfo->dst); sub_item = proto_tree_add_string(tree, hf_usb_src, tvb, 0, 0, str_src_addr); proto_item_set_generated(sub_item); sub_item = proto_tree_add_string(tree, hf_usb_addr, tvb, 0, 0, str_src_addr); proto_item_set_hidden(sub_item); sub_item = proto_tree_add_string(tree, hf_usb_dst, tvb, 0, 0, str_dst_addr); proto_item_set_generated(sub_item); sub_item = proto_tree_add_string(tree, hf_usb_addr, tvb, 0, 0, str_dst_addr); proto_item_set_hidden(sub_item); } /* Gets the transfer info for a given packet * Generates transfer info if none exists yet * Also adds request/response info to the tree for the given packet */ static usb_trans_info_t *usb_get_trans_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_header_t header_type, usb_conv_info_t *usb_conv_info, guint64 usb_id) { usb_trans_info_t *usb_trans_info; proto_item *ti; nstime_t t, deltat; wmem_tree_key_t key[3]; /* request/response matching so we can keep track of transaction specific * data. */ key[0].length = 2; key[0].key = (guint32 *)&usb_id; key[1].length = 1; key[1].key = &pinfo->num; key[2].length = 0; key[2].key = NULL; if (usb_conv_info->is_request) { /* this is a request */ usb_trans_info = (usb_trans_info_t *)wmem_tree_lookup32_array(usb_conv_info->transactions, key); if (!usb_trans_info) { usb_trans_info = wmem_new0(wmem_file_scope(), usb_trans_info_t); usb_trans_info->request_in = pinfo->num; usb_trans_info->req_time = pinfo->abs_ts; usb_trans_info->header_type = header_type; usb_trans_info->usb_id = usb_id; wmem_tree_insert32_array(usb_conv_info->transactions, key, usb_trans_info); } if (usb_trans_info->response_in) { ti = proto_tree_add_uint(tree, hf_usb_response_in, tvb, 0, 0, usb_trans_info->response_in); proto_item_set_generated(ti); } } else { /* this is a response */ if (pinfo->fd->visited) { usb_trans_info = (usb_trans_info_t *)wmem_tree_lookup32_array(usb_conv_info->transactions, key); } else { usb_trans_info = (usb_trans_info_t *)wmem_tree_lookup32_array_le(usb_conv_info->transactions, key); if (usb_trans_info) { if (usb_trans_info->usb_id == usb_id) { if (usb_trans_info->response_in == 0) { /* USBPcap generates 2 frames for response; store the first one */ usb_trans_info->response_in = pinfo->num; } wmem_tree_insert32_array(usb_conv_info->transactions, key, usb_trans_info); } else { usb_trans_info = NULL; } } } if (usb_trans_info && usb_trans_info->request_in) { ti = proto_tree_add_uint(tree, hf_usb_request_in, tvb, 0, 0, usb_trans_info->request_in); proto_item_set_generated(ti); t = pinfo->abs_ts; nstime_delta(&deltat, &t, &usb_trans_info->req_time); ti = proto_tree_add_time(tree, hf_usb_time, tvb, 0, 0, &deltat); proto_item_set_generated(ti); } } return usb_trans_info; } /* dissect a group of isochronous packets inside an usb packet in usbpcap format */ #define MAX_ISO_PACKETS 100000 // Arbitrary static gint dissect_usbpcap_iso_packets(packet_info *pinfo _U_, proto_tree *urb_tree, guint8 urb_type, tvbuff_t *tvb, gint offset, guint32 win32_data_len, usb_conv_info_t *usb_conv_info) { guint32 i; guint32 num_packets; int data_start_offset; proto_item *num_packets_ti, *urb_tree_ti; proto_tree_add_item(urb_tree, hf_usb_win32_iso_start_frame, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; num_packets = tvb_get_letohl(tvb, offset); num_packets_ti = proto_tree_add_item(urb_tree, hf_usb_win32_iso_num_packets, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(urb_tree, hf_usb_win32_iso_error_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (num_packets > MAX_ISO_PACKETS) { expert_add_info_format(pinfo, num_packets_ti, &ei_usb_bad_length, "Too many isochronous transfer packets (%u)", num_packets); return tvb_captured_length(tvb); } data_start_offset = offset + 12 * num_packets; urb_tree_ti = proto_tree_get_parent(urb_tree); proto_item_set_len(urb_tree_ti, data_start_offset); for (i = 0; i < num_packets; i++) { guint32 this_offset; guint32 next_offset; guint32 iso_len; proto_item *iso_packet_ti, *ti; proto_tree *iso_packet_tree; iso_packet_ti = proto_tree_add_protocol_format( proto_tree_get_root(urb_tree), proto_usb, tvb, offset, 12, "USB isochronous packet"); iso_packet_tree = proto_item_add_subtree(iso_packet_ti, ett_usb_win32_iso_packet); this_offset = tvb_get_letohl(tvb, offset); if (num_packets - i == 1) { /* this is the last packet */ next_offset = win32_data_len; } else { /* there is next packet */ next_offset = tvb_get_letohl(tvb, offset + 12); } if (next_offset > this_offset) { iso_len = next_offset - this_offset; } else { iso_len = 0; } /* If this packet does not contain isochrounous data, do not try to display it */ if (!((usb_conv_info->is_request && usb_conv_info->direction==P2P_DIR_SENT) || (!usb_conv_info->is_request && usb_conv_info->direction==P2P_DIR_RECV))) { iso_len = 0; } proto_tree_add_item(iso_packet_tree, hf_usb_win32_iso_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; ti = proto_tree_add_item(iso_packet_tree, hf_usb_win32_iso_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); if (usb_conv_info->direction==P2P_DIR_SENT) { /* Isochronous OUT transfer */ proto_item_append_text(ti, " (not used)"); } else { /* Isochronous IN transfer. * Length field is being set by host controller. */ if (usb_conv_info->is_request) { /* Length was not yet set */ proto_item_append_text(ti, " (irrelevant)"); } else { /* Length was set and (should be) valid */ proto_item_append_text(ti, " (relevant)"); iso_len = tvb_get_letohl(tvb, offset); } } offset += 4; ti = proto_tree_add_item(iso_packet_tree, hf_usb_win32_iso_status, tvb, offset, 4, ENC_LITTLE_ENDIAN); if (urb_type == URB_SUBMIT) { proto_item_append_text(ti, " (irrelevant)"); } else { proto_item_append_text(ti, " (relevant)"); } offset += 4; if (iso_len && data_start_offset + this_offset + iso_len <= tvb_captured_length(tvb)) { proto_tree_add_item(iso_packet_tree, hf_usb_iso_data, tvb, (gint)(data_start_offset + this_offset), (gint)iso_len, ENC_NA); proto_tree_set_appendix(iso_packet_tree, tvb, (gint)(data_start_offset + this_offset), (gint)iso_len); } } if ((usb_conv_info->is_request && usb_conv_info->direction==P2P_DIR_SENT) || (!usb_conv_info->is_request && usb_conv_info->direction==P2P_DIR_RECV)) { /* We have dissected all the isochronous data */ offset += win32_data_len; } return offset; } static gint dissect_linux_usb_iso_transfer(packet_info *pinfo _U_, proto_tree *urb_tree, usb_header_t header_type, tvbuff_t *tvb, gint offset, usb_conv_info_t *usb_conv_info) { guint32 iso_numdesc = 0; proto_item *tii; guint32 i; guint data_base; guint32 iso_status; guint32 iso_off = 0; guint32 iso_len = 0; tii = proto_tree_add_uint(urb_tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->interfaceClass); proto_item_set_generated(tii); /* All fields which belong to Linux usbmon headers are in host-endian * byte order. The fields coming from the USB communication are in little * endian format (see usb_20.pdf, chapter 8.1 Byte/Bit ordering). * * When a capture file is transferred to a host with different endianness * than packet was captured then the necessary swapping happens in * wiretap/pcap-common.c, pcap_byteswap_linux_usb_pseudoheader(). */ /* iso urbs on linux can't possibly contain a setup packet see mon_bin_event() in the linux kernel */ proto_tree_add_item(urb_tree, hf_usb_iso_error_count, tvb, offset, 4, ENC_HOST_ENDIAN); offset += 4; proto_tree_add_item_ret_uint(urb_tree, hf_usb_iso_numdesc, tvb, offset, 4, ENC_HOST_ENDIAN, &iso_numdesc); offset += 4; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, urb_tree); } data_base = offset + iso_numdesc*16; for (i = 0; i<iso_numdesc; i++) { proto_item *iso_desc_ti; proto_tree *iso_desc_tree; iso_desc_ti = proto_tree_add_protocol_format(urb_tree, proto_usb, tvb, offset, 16, "USB isodesc %u", i); iso_desc_tree = proto_item_add_subtree(iso_desc_ti, ett_usb_isodesc); proto_tree_add_item_ret_int(iso_desc_tree, hf_usb_iso_status, tvb, offset, 4, ENC_HOST_ENDIAN, &iso_status); proto_item_append_text(iso_desc_ti, " [%s]", val_to_str_ext(iso_status, &linux_negative_errno_vals_ext, "Error %d")); offset += 4; proto_tree_add_item_ret_uint(iso_desc_tree, hf_usb_iso_off, tvb, offset, 4, ENC_HOST_ENDIAN, &iso_off); offset += 4; proto_tree_add_item_ret_uint(iso_desc_tree, hf_usb_iso_len, tvb, offset, 4, ENC_HOST_ENDIAN, &iso_len); if (iso_len != 0) proto_item_append_text(iso_desc_ti, " (%u bytes)", iso_len); offset += 4; /* Show the ISO data if we captured them and either the status is OK or the packet is sent from host to device. The Linux kernel sets the status field in outgoing isochronous URBs to -EXDEV and fills the data part with valid data. */ if ((pinfo->p2p_dir==P2P_DIR_SENT || !iso_status) && iso_len && data_base + iso_off + iso_len <= tvb_captured_length(tvb)) { proto_tree_add_item(iso_desc_tree, hf_usb_iso_data, tvb, data_base + iso_off, iso_len, ENC_NA); proto_tree_set_appendix(iso_desc_tree, tvb, (gint)(data_base+iso_off), (gint)iso_len); } proto_tree_add_item(iso_desc_tree, hf_usb_iso_pad, tvb, offset, 4, ENC_HOST_ENDIAN); offset += 4; } /* we jump to the end of the last iso data chunk this assumes that the iso data starts immediately after the iso descriptors we have to use the offsets from the last iso descriptor, we can't keep track of the offset ourselves as there may be gaps between data packets in the transfer buffer */ return data_base+iso_off+iso_len; } static gint dissect_usbip_iso_transfer(packet_info *pinfo _U_, proto_tree *urb_tree, tvbuff_t *tvb, gint offset, guint32 iso_numdesc, guint32 desc_offset, usb_conv_info_t *usb_conv_info) { proto_item *tii; guint32 i; guint data_base; guint32 iso_off = 0; guint32 iso_len = 0; tii = proto_tree_add_uint(urb_tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->interfaceClass); proto_item_set_generated(tii); /* All fields which belong to usbip are in big-endian byte order. * unlike the linux kernel, the usb isoc descriptor is appended at * the end of the isoc data. We have to reassemble the pdus and jump * to the end (actual_length) and the remaining data is the isoc * descriptor. */ data_base = offset; for (i = 0; i<iso_numdesc; i++) { proto_item *iso_desc_ti; proto_tree *iso_desc_tree; gint32 iso_status; iso_desc_ti = proto_tree_add_protocol_format(urb_tree, proto_usb, tvb, desc_offset, 16, "USB isodesc %u", i); iso_desc_tree = proto_item_add_subtree(iso_desc_ti, ett_usb_isodesc); proto_tree_add_item_ret_uint(iso_desc_tree, hf_usb_iso_off, tvb, desc_offset, 4, ENC_BIG_ENDIAN, &iso_off); desc_offset += 4; proto_tree_add_item(iso_desc_tree, hf_usb_iso_len, tvb, desc_offset, 4, ENC_BIG_ENDIAN); desc_offset += 4; proto_tree_add_item_ret_uint(iso_desc_tree, hf_usb_iso_actual_len, tvb, desc_offset, 4, ENC_BIG_ENDIAN, &iso_len); desc_offset += 4; proto_tree_add_item_ret_int(iso_desc_tree, hf_usb_iso_status, tvb, desc_offset, 4, ENC_BIG_ENDIAN, &iso_status); proto_item_append_text(iso_desc_ti, " [%s]", val_to_str_ext(iso_status, &linux_negative_errno_vals_ext, "Error %d")); desc_offset += 4; if (iso_len > 0) proto_item_append_text(iso_desc_ti, " (%u bytes)", iso_len); /* Show the ISO data if we captured them and either the status is OK or the packet is sent from host to device. The Linux kernel sets the status field in outgoing isochronous URBs to -EXDEV and fills the data part with valid data. */ if ((pinfo->p2p_dir==P2P_DIR_SENT || !iso_status) && iso_len && data_base + iso_off + iso_len <= tvb_reported_length(tvb)) { proto_tree_add_item(iso_desc_tree, hf_usb_iso_data, tvb, (guint) data_base + iso_off, iso_len, ENC_NA); proto_tree_set_appendix(iso_desc_tree, tvb, (guint) data_base + iso_off, (gint)iso_len); } } return desc_offset; } static gint dissect_darwin_usb_iso_transfer(packet_info *pinfo _U_, proto_tree *tree, usb_header_t header_type _U_, guint8 urb_type _U_, tvbuff_t *tvb, gint32 offset, usb_conv_info_t *usb_conv_info) { guint32 frame_length; guint32 frame_header_length; guint32 status; guint32 iso_tree_start; guint32 i; guint32 iso_numdesc; guint32 len; proto_item *tii; len = (gint32)tvb_captured_length(tvb); len -= offset; tii = proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->interfaceClass); proto_item_set_generated(tii); status = tvb_get_guint32(tvb, 8, ENC_LITTLE_ENDIAN); iso_numdesc = tvb_get_guint32(tvb, 12, ENC_LITTLE_ENDIAN); iso_tree_start = offset; for (i = 0; (i < iso_numdesc) && (len > 8 /* header len + frame len */); i++) { proto_item *iso_desc_ti; proto_tree *iso_desc_tree; /* Fetch ISO descriptor fields stored in little-endian byte order. */ frame_header_length = tvb_get_guint32(tvb, offset, ENC_LITTLE_ENDIAN); frame_length = tvb_get_guint32(tvb, offset + 4, ENC_LITTLE_ENDIAN); if ((len < frame_header_length) || (frame_header_length < 20)) { break; } iso_desc_ti = proto_tree_add_protocol_format(tree, proto_usb, tvb, offset, 20, "Frame %u", i); iso_desc_tree = proto_item_add_subtree(iso_desc_ti, ett_usb_isodesc); proto_tree_add_item(iso_desc_tree, hf_usb_darwin_iso_frame_number, tvb, offset + 12, 8, ENC_LITTLE_ENDIAN); proto_tree_add_item(iso_desc_tree, hf_usb_iso_len, tvb, offset + 4, 4, ENC_LITTLE_ENDIAN); if (usb_conv_info->is_request == FALSE) { proto_tree_add_item(iso_desc_tree, hf_usb_darwin_iso_timestamp, tvb, offset + 20, 8, ENC_LITTLE_ENDIAN); proto_tree_add_item_ret_uint(iso_desc_tree, hf_usb_darwin_iso_status, tvb, offset + 8, 4, ENC_LITTLE_ENDIAN, &status); proto_item_append_text(iso_desc_ti, " [%s]", val_to_str_ext(status, &usb_darwin_status_vals_ext, "Error %d")); /* Data */ if (frame_length > len) { frame_length = len; } proto_tree_add_item(iso_desc_tree, hf_usb_iso_data, tvb, offset + frame_header_length, frame_length, ENC_NA); proto_tree_set_appendix(iso_desc_tree, tvb, (gint)iso_tree_start, (gint)(offset - iso_tree_start)); len -= frame_length; offset += frame_length; } /* Padding to align the next header */ offset += frame_header_length; offset = WS_ROUNDUP_4(offset); iso_tree_start = offset; len -= frame_header_length; } return offset; } static gint dissect_usb_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, proto_tree *tree, usb_conv_info_t *usb_conv_info, guint8 urb_type, gint offset, guint16 device_address) { wmem_tree_key_t key[4]; guint32 k_frame_number; guint32 k_device_address; guint32 k_bus_id; device_product_data_t *device_product_data = NULL; device_protocol_data_t *device_protocol_data = NULL; tvbuff_t *next_tvb = NULL; k_frame_number = pinfo->num; k_device_address = device_address; k_bus_id = usb_conv_info->bus_id; key[0].length = 1; key[0].key = &k_device_address; key[1].length = 1; key[1].key = &k_bus_id; key[2].length = 1; key[2].key = &k_frame_number; key[3].length = 0; key[3].key = NULL; device_product_data = (device_product_data_t *) wmem_tree_lookup32_array_le(device_to_product_table, key); if (device_product_data && device_product_data->bus_id == usb_conv_info->bus_id && device_product_data->device_address == device_address) { p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_VENDOR_ID, GUINT_TO_POINTER((guint)device_product_data->vendor)); p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_PRODUCT_ID, GUINT_TO_POINTER((guint)device_product_data->product)); usb_conv_info->deviceVendor = device_product_data->vendor; usb_conv_info->deviceProduct = device_product_data->product; usb_conv_info->deviceVersion = device_product_data->device; } device_protocol_data = (device_protocol_data_t *) wmem_tree_lookup32_array_le(device_to_protocol_table, key); if (device_protocol_data && device_protocol_data->bus_id == usb_conv_info->bus_id && device_protocol_data->device_address == device_address) { p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_CLASS, GUINT_TO_POINTER(device_protocol_data->protocol >> 16)); p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_SUBCLASS, GUINT_TO_POINTER((device_protocol_data->protocol >> 8) & 0xFF)); p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_PROTOCOL, GUINT_TO_POINTER(device_protocol_data->protocol & 0xFF)); usb_conv_info->device_protocol = device_protocol_data->protocol; } p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_BUS_ID, GUINT_TO_POINTER((guint)usb_conv_info->bus_id)); p_add_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_ADDRESS, GUINT_TO_POINTER((guint)device_address)); if (tvb_captured_length_remaining(tvb, offset) > 0) { next_tvb = tvb_new_subset_remaining(tvb, offset); offset += try_dissect_next_protocol(parent, next_tvb, pinfo, usb_conv_info, urb_type, tree, NULL); } if (tvb_captured_length_remaining(tvb, offset) > 0) { /* There is still leftover capture data to add (padding?) */ proto_tree_add_item(parent, hf_usb_capdata, tvb, offset, -1, ENC_NA); } return offset; } static int dissect_freebsd_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void *data _U_) { int offset = 0; proto_item *ti; proto_tree *tree = NULL, *frame_tree = NULL; guint32 nframes; guint32 i; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USB"); /* add usb hdr*/ if (parent) { ti = proto_tree_add_protocol_format(parent, proto_usb, tvb, 0, 128, "USB URB"); tree = proto_item_add_subtree(ti, ett_usb_hdr); } proto_tree_add_item(tree, hf_usb_totlen, tvb, 0, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_busunit, tvb, 4, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_address, tvb, 8, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_mode, tvb, 9, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_freebsd_urb_type, tvb, 10, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_freebsd_transfer_type, tvb, 11, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, 12, hf_usb_xferflags, ett_usb_xferflags, usb_xferflags_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, 16, hf_usb_xferstatus, ett_usb_xferstatus, usb_xferstatus_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_error, tvb, 20, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_interval, tvb, 24, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item_ret_uint(tree, hf_usb_nframes, tvb, 28, 4, ENC_LITTLE_ENDIAN, &nframes); proto_tree_add_item(tree, hf_usb_packet_size, tvb, 32, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usb_packet_count, tvb, 36, 4, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, 40, hf_usb_endpoint_address, ett_usb_endpoint, usb_endpoint_fields, ENC_NA); proto_tree_add_item(tree, hf_usb_speed, tvb, 44, 1, ENC_LITTLE_ENDIAN); offset += 128; for (i = 0; i < nframes; i++) { guint32 framelen; guint64 frameflags; frame_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_usb_frame, &ti, "Frame %u", i); proto_tree_add_item_ret_uint(frame_tree, hf_usb_frame_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &framelen); offset += 4; proto_tree_add_bitmask_ret_uint64(frame_tree, tvb, offset, hf_usb_frame_flags, ett_usb_frame_flags, usb_frame_flags_fields, ENC_LITTLE_ENDIAN, &frameflags); offset += 4; if (frameflags & FREEBSD_FRAMEFLAG_DATA_FOLLOWS) { /* * XXX - ultimately, we should dissect this data. */ proto_tree_add_item(frame_tree, hf_usb_frame_data, tvb, offset, framelen, ENC_NA); offset += WS_ROUNDUP_4(framelen); } proto_item_set_end(ti, tvb, offset); } return tvb_captured_length(tvb); } static int netmon_HostController2(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 flags) { proto_tree *host_tree; host_tree = proto_tree_add_subtree(tree, tvb, offset, (flags & EVENT_HEADER_FLAG_64_BIT_HEADER) ? 20 : 16, ett_usbport_host_controller, NULL, "HostController"); netmon_etl_field(host_tree, tvb, &offset, hf_usbport_device_object, flags); proto_tree_add_item(host_tree, hf_usbport_pci_bus, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(host_tree, hf_usbport_pci_device, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(host_tree, hf_usbport_pci_function, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(host_tree, hf_usbport_pci_vendor_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(host_tree, hf_usbport_pci_device_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int netmon_UsbPortPath(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo) { proto_item *path_item, *depth_item; proto_tree *path_tree; guint32 path_depth, path0, path1, path2, path3, path4, path5; path_tree = proto_tree_add_subtree(tree, tvb, offset, 28, ett_usbport_path, &path_item, "PortPath: "); depth_item = proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path_depth, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path_depth); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path0, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path0); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path1, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path1); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path2, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path2); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path3, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path3); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path4, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path4); offset += 4; proto_tree_add_item_ret_uint(path_tree, hf_usbport_port_path5, tvb, offset, 4, ENC_LITTLE_ENDIAN, &path5); offset += 4; if (path_depth == 0) { proto_item_append_text(path_item, "-"); } if (path_depth > 0) { proto_item_append_text(path_item, "%d", path0); } if (path_depth > 1) { proto_item_append_text(path_item, ",%d", path1); } if (path_depth > 2) { proto_item_append_text(path_item, ",%d", path2); } if (path_depth > 3) { proto_item_append_text(path_item, ",%d", path3); } if (path_depth > 4) { proto_item_append_text(path_item, ",%d", path4); } if (path_depth > 5) { proto_item_append_text(path_item, ",%d", path5); } if (path_depth > 6) { expert_add_info(pinfo, depth_item, &ei_usbport_invalid_path_depth); } return offset; } static int netmon_fid_USBPORT_Device(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 flags, packet_info *pinfo) { proto_item *device_item; proto_tree *device_tree; device_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_usbport_device, &device_item, "Device"); netmon_etl_field(device_tree, tvb, &offset, hf_usbport_device_handle, flags); proto_tree_add_item(device_tree, hf_usb_idVendor, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(device_tree, hf_usb_idProduct, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; offset = netmon_UsbPortPath(device_tree, tvb, offset, pinfo); proto_tree_add_item(device_tree, hf_usbport_device_speed, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(device_tree, hf_usb_device_address, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; return offset; } static int netmon_fid_USBPORT_Endpoint(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 flags) { proto_tree *endpoint_tree; endpoint_tree = proto_tree_add_subtree(tree, tvb, offset, (flags & EVENT_HEADER_FLAG_64_BIT_HEADER) ? 24 : 12, ett_usbport_endpoint, NULL, "Endpoint"); netmon_etl_field(endpoint_tree, tvb, &offset, hf_usbport_endpoint, flags); netmon_etl_field(endpoint_tree, tvb, &offset, hf_usbport_pipehandle, flags); netmon_etl_field(endpoint_tree, tvb, &offset, hf_usbport_device_handle, flags); return offset; } static int netmon_fid_USBPORT_Endpoint_Descriptor(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *endpoint_desc_tree; endpoint_desc_tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_usbport_endpoint_desc, NULL, "Endpoint Descriptor"); proto_tree_add_item(endpoint_desc_tree, hf_usbport_endpoint_desc_length, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(endpoint_desc_tree, hf_usbport_endpoint_desc_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(endpoint_desc_tree, hf_usbport_endpoint_address, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(endpoint_desc_tree, hf_usbport_bm_attributes, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(endpoint_desc_tree, hf_usbport_max_packet_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(endpoint_desc_tree, hf_usbport_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return offset; } static int netmon_URB(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 flags) { proto_item *urb_item; proto_tree *urb_tree; guint32 func; int i, start_offset = offset; urb_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_usbport_urb, &urb_item, "URB"); proto_tree_add_item(urb_tree, hf_usbport_urb_header_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item_ret_uint(urb_tree, hf_usbport_urb_header_function, tvb, offset, 2, ENC_LITTLE_ENDIAN, &func); proto_item_append_text(urb_item, ": %s", val_to_str_ext_const(func, &netmon_urb_function_vals_ext, "Unknown")); offset += 2; proto_tree_add_item(urb_tree, hf_usbport_urb_header_status, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_header_usbddevice_handle, flags); netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_header_usbdflags, flags); switch (func) { case 0x0000: netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_configuration_desc, flags); netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_configuration_handle, flags); break; case 0x0008: //URB_FUNCTION_CONTROL_TRANSFER case 0x0009: //URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER case 0x000A: //URB_FUNCTION_ISOCH_TRANSFER case 0x000B: //URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE case 0x000C: //URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE case 0x000D: //URB_FUNCTION_SET_FEATURE_TO_DEVICE case 0x000E: //URB_FUNCTION_SET_FEATURE_TO_INTERFACE case 0x000F: //URB_FUNCTION_SET_FEATURE_TO_ENDPOINT case 0x0010: //URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE case 0x0011: //URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE case 0x0012: //URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT case 0x0013: //URB_FUNCTION_GET_STATUS_FROM_DEVICE case 0x0014: //URB_FUNCTION_GET_STATUS_FROM_INTERFACE case 0x0015: //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT case 0x0017: //URB_FUNCTION_VENDOR_DEVICE case 0x0018: //URB_FUNCTION_VENDOR_INTERFACE case 0x0019: //URB_FUNCTION_VENDOR_ENDPOINT case 0x001A: //URB_FUNCTION_CLASS_DEVICE case 0x001B: //URB_FUNCTION_CLASS_INTERFACE case 0x001C: //URB_FUNCTION_CLASS_ENDPOINT case 0x001F: //URB_FUNCTION_CLASS_OTHER case 0x0020: //URB_FUNCTION_VENDOR_OTHER case 0x0021: //URB_FUNCTION_GET_STATUS_FROM_OTHER case 0x0022: //URB_FUNCTION_CLEAR_FEATURE_TO_OTHER case 0x0023: //URB_FUNCTION_SET_FEATURE_TO_OTHER case 0x0024: //URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT case 0x0025: //URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT case 0x0026: //URB_FUNCTION_GET_CONFIGURATION case 0x0027: //URB_FUNCTION_GET_INTERFACE case 0x0028: //URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE case 0x0029: //URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE case 0x002A: //URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR case 0x0032: //URB_FUNCTION_CONTROL_TRANSFER_EX case 0x0037: //URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER_USING_CHAINED_MDL case 0x0038: //URB_FUNCTION_ISOCH_TRANSFER_USING_CHAINED_MDL netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_pipe_handle, flags); proto_tree_add_bitmask(urb_tree, tvb, offset, hf_usbport_urb_xferflags, ett_usb_xferflags, usb_xferflags_fields, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(urb_tree, hf_usbport_urb_transfer_buffer_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_transfer_buffer, flags); netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_transfer_buffer_mdl, flags); netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_reserved_mbz, flags); for (i = 0; i < 8; i++) { netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_reserved_hcd, flags); } break; case 0x0002: //URB_FUNCTION_ABORT_PIPE case 0x001E: //URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL case 0x0030: //URB_FUNCTION_SYNC_RESET_PIPE case 0x0031: //URB_FUNCTION_SYNC_CLEAR_STALL case 0x0036: //URB_FUNCTION_CLOSE_STATIC_STREAMS netmon_etl_field(urb_tree, tvb, &offset, hf_usbport_urb_pipe_handle, flags); proto_tree_add_item(urb_tree, hf_usbport_urb_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; break; } proto_item_set_len(urb_item, offset-start_offset); return offset; } #define USBPORT_KEYWORD_DIAGNOSTIC G_GUINT64_CONSTANT(0x0000000000000001) #define USBPORT_KEYWORD_POWER_DIAGNOSTICS G_GUINT64_CONSTANT(0x0000000000000002) #define USBPORT_KEYWORD_PERF_DIAGNOSTICS G_GUINT64_CONSTANT(0x0000000000000004) #define USBPORT_KEYWORD_RESERVED1 G_GUINT64_CONSTANT(0xFFFFFFFFFFFFFFF8) static int dissect_netmon_usb_port(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data) { proto_item *ti, *generated; proto_tree *usb_port_tree; int offset = 0; struct netmon_provider_id_data *provider_id_data = (struct netmon_provider_id_data*)data; static int * const keyword_fields[] = { &hf_usbport_keyword_diagnostic, &hf_usbport_keyword_power_diagnostics, &hf_usbport_keyword_perf_diagnostics, &hf_usbport_keyword_reserved1, NULL }; DISSECTOR_ASSERT(provider_id_data != NULL); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBPort"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(parent, proto_usbport, tvb, 0, -1, ENC_NA); usb_port_tree = proto_item_add_subtree(ti, ett_usbport); generated = proto_tree_add_uint(usb_port_tree, hf_usbport_event_id, tvb, 0, 0, provider_id_data->event_id); proto_item_set_generated(generated); generated = proto_tree_add_bitmask_value(usb_port_tree, tvb, 0, hf_usbport_keyword, ett_usbport_keyword, keyword_fields, provider_id_data->keyword); proto_item_set_generated(generated); switch (provider_id_data->event_id) { case 71: offset = netmon_HostController2(usb_port_tree, tvb, offset, provider_id_data->event_flags); offset = netmon_fid_USBPORT_Device(usb_port_tree, tvb, offset, provider_id_data->event_flags, pinfo); offset = netmon_fid_USBPORT_Endpoint(usb_port_tree, tvb, offset, provider_id_data->event_flags); offset = netmon_fid_USBPORT_Endpoint_Descriptor(usb_port_tree, tvb, offset); netmon_etl_field(usb_port_tree, tvb, &offset, hf_usbport_irp, provider_id_data->event_flags); netmon_etl_field(usb_port_tree, tvb, &offset, hf_usbport_urb, provider_id_data->event_flags); offset = netmon_URB(usb_port_tree, tvb, offset, provider_id_data->event_flags); proto_tree_add_item(usb_port_tree, hf_usbport_urb_transfer_data, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; } return tvb_captured_length(tvb); } void dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, usb_header_t header_type, void *extra_data) { gint offset = 0; int endpoint; guint8 urb_type; guint32 win32_data_len = 0; guint32 iso_numdesc = 0; guint32 desc_offset = 0; guint32 location = 0; proto_item *urb_tree_ti; proto_tree *tree; proto_item *item; usb_conv_info_t *usb_conv_info; conversation_t *conversation; guint16 device_address; guint16 bus_id; guint8 usbpcap_control_stage = 0; guint64 usb_id; struct mausb_header *ma_header = NULL; struct usbip_header *ip_header = NULL; usb_pseudo_urb_t *pseudo_urb = NULL; /* the goal is to get the conversation struct as early as possible and store all status values in this struct at first, we read the fields required to create/identify the right conversation struct */ switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: urb_type = tvb_get_guint8(tvb, 8); endpoint = tvb_get_guint8(tvb, 10) & 0x7F; device_address = (guint16)tvb_get_guint8(tvb, 11); bus_id = tvb_get_letohs(tvb, 12); break; case USB_HEADER_USBPCAP: urb_type = tvb_get_guint8(tvb, 16) & 0x01 ? URB_COMPLETE : URB_SUBMIT; device_address = tvb_get_letohs(tvb, 19); endpoint = tvb_get_guint8(tvb, 21); if ((endpoint == 0x00) && (tvb_get_guint8(tvb, 22) == URB_CONTROL) && (tvb_get_guint8(tvb, 27) == USB_CONTROL_STAGE_DATA)) { /* USBPcap before 1.3.0.0 DATA OUT packet (the info at offset 16 is wrong) */ urb_type = URB_SUBMIT; } endpoint &= 0x7F; /* Clear the direction flag */ bus_id = tvb_get_letohs(tvb, 17); break; case USB_HEADER_MAUSB: ma_header = (struct mausb_header *) extra_data; urb_type = mausb_is_from_host(ma_header) ? URB_SUBMIT : URB_COMPLETE; device_address = mausb_ep_handle_dev_addr(ma_header->handle); endpoint = mausb_ep_handle_ep_num(ma_header->handle); bus_id = mausb_ep_handle_bus_num(ma_header->handle); break; case USB_HEADER_USBIP: ip_header = (struct usbip_header *) extra_data; urb_type = tvb_get_ntohl(tvb, 0) == 1 ? URB_SUBMIT : URB_COMPLETE; device_address = ip_header->devid; bus_id = ip_header->busid; endpoint = ip_header->ep; break; case USB_HEADER_DARWIN: urb_type = tvb_get_guint8(tvb, 3) ? URB_COMPLETE : URB_SUBMIT; endpoint = tvb_get_guint8(tvb, 30) & 0x7F; device_address = (guint16)tvb_get_guint8(tvb, 29); location = tvb_get_letohl(tvb, 24); bus_id = location >> 24; break; case USB_HEADER_PSEUDO_URB: pseudo_urb = (usb_pseudo_urb_t *) extra_data; urb_type = pseudo_urb->from_host ? URB_SUBMIT : URB_COMPLETE; device_address = pseudo_urb->device_address; endpoint = pseudo_urb->endpoint; bus_id = pseudo_urb->bus_id; break; default: return; /* invalid USB pseudo header */ } col_set_str(pinfo->cinfo, COL_PROTOCOL, "USB"); urb_tree_ti = proto_tree_add_protocol_format(parent, proto_usb, tvb, 0, -1, "USB URB"); tree = proto_item_add_subtree(urb_tree_ti, ett_usb_hdr); usb_set_addr(tree, tvb, pinfo, bus_id, device_address, endpoint, (urb_type == URB_SUBMIT)); conversation = get_usb_conversation(pinfo, &pinfo->src, &pinfo->dst, pinfo->srcport, pinfo->destport); usb_conv_info = get_usb_conv_info(conversation); clear_usb_conv_tmp_data(usb_conv_info); switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: proto_item_set_len(urb_tree_ti, (header_type == USB_HEADER_LINUX_64_BYTES) ? 64 : 48); offset = dissect_linux_usb_pseudo_header(tvb, pinfo, tree, usb_conv_info, &usb_id); break; case USB_HEADER_USBPCAP: offset = dissect_usbpcap_buffer_packet_header(tvb, pinfo, tree, usb_conv_info, &win32_data_len, &usb_id); /* the length that we're setting here might have to be corrected if there's a transfer-specific pseudo-header following */ proto_item_set_len(urb_tree_ti, offset); break; case USB_HEADER_MAUSB: /* MA USB header gets dissected earlier, just set conversation variables */ offset = MAUSB_DPH_LENGTH; mausb_set_usb_conv_info(usb_conv_info, ma_header); usb_id = 0; break; case USB_HEADER_USBIP: iso_numdesc = tvb_get_ntohl(tvb, 0x20); usb_conv_info->transfer_type = endpoint == 0 ? URB_CONTROL : (iso_numdesc != 0xffffffff ? URB_ISOCHRONOUS : URB_UNKNOWN); usb_conv_info->direction = ip_header->dir == USBIP_DIR_OUT ? P2P_DIR_SENT : P2P_DIR_RECV; usb_conv_info->is_setup = endpoint == 0 ? (tvb_get_ntoh64(tvb, 0x28) != G_GUINT64_CONSTANT(0)) : FALSE; usb_conv_info->is_request = (urb_type==URB_SUBMIT); offset = usb_conv_info->is_setup ? USBIP_HEADER_WITH_SETUP_LEN : USBIP_HEADER_LEN; /* The ISOC descriptor is located at the end of the isoc frame behind the isoc data. */ if ((usb_conv_info->is_request && usb_conv_info->direction == USBIP_DIR_OUT) || (!usb_conv_info->is_request && usb_conv_info->direction == USBIP_DIR_IN)) { desc_offset += tvb_get_ntohl(tvb, 0x18); } desc_offset += offset; usb_id = 0; break; case USB_HEADER_DARWIN: offset = dissect_darwin_buffer_packet_header(tvb, pinfo, tree, usb_conv_info, &usb_id); proto_item_set_len(urb_tree_ti, offset); break; case USB_HEADER_PSEUDO_URB: usb_conv_info->transfer_type = pseudo_urb->transfer_type; usb_conv_info->direction = pseudo_urb->from_host ? P2P_DIR_SENT : P2P_DIR_RECV; usb_conv_info->is_setup = pseudo_urb->from_host && (pseudo_urb->transfer_type == URB_CONTROL); usb_conv_info->is_request = pseudo_urb->from_host; usb_conv_info->speed = pseudo_urb->speed; usb_id = 0; break; default: usb_id = 0; break; } usb_conv_info->usb_trans_info = usb_get_trans_info(tvb, pinfo, tree, header_type, usb_conv_info, usb_id); if (usb_conv_info->transfer_type != URB_CONTROL) { usb_tap_queue_packet(pinfo, urb_type, usb_conv_info); } switch(usb_conv_info->transfer_type) { case URB_BULK: case URB_INTERRUPT: item = proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, 0, 0, usb_conv_info->interfaceClass); proto_item_set_generated(item); switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: /* bulk and interrupt transfers never contain a setup packet */ proto_tree_add_item(tree, hf_usb_urb_unused_setup_header, tvb, offset, 8, ENC_NA); offset += 8; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, tree); } break; case USB_HEADER_USBPCAP: break; case USB_HEADER_MAUSB: break; case USB_HEADER_USBIP: break; case USB_HEADER_DARWIN: break; case USB_HEADER_PSEUDO_URB: break; } break; case URB_CONTROL: if (header_type == USB_HEADER_USBPCAP) { proto_tree_add_item(tree, hf_usb_win32_control_stage, tvb, offset, 1, ENC_LITTLE_ENDIAN); usbpcap_control_stage = tvb_get_guint8(tvb, offset); offset++; proto_item_set_len(urb_tree_ti, offset); if (usbpcap_control_stage == USB_CONTROL_STAGE_SETUP) { usb_conv_info->is_setup = TRUE; } else if (usbpcap_control_stage == USB_CONTROL_STAGE_DATA && urb_type == URB_SUBMIT) { /* USBPcap before 1.5.0.0 */ wmem_tree_key_t key[3]; key[0].length = 2; key[0].key = (guint32 *)&usb_id; key[1].length = 1; key[1].key = &pinfo->num; key[2].length = 0; key[2].key = NULL; usbpcap_setup_data_t *setup_data = (usbpcap_setup_data_t *)wmem_tree_lookup32_array_le(usbpcap_setup_data, key); if (setup_data && setup_data->usb_id == usb_id) { tvbuff_t *reassembled_tvb = tvb_new_composite(); tvb_composite_append(reassembled_tvb, tvb_new_child_real_data(tvb, setup_data->setup_data, 8, 8)); tvb_composite_append(reassembled_tvb, tvb_new_subset_remaining(tvb, offset)); tvb_composite_finalize(reassembled_tvb); add_new_data_source(pinfo, reassembled_tvb, "USBPcap reassembled setup"); usb_conv_info->is_setup = TRUE; tvb = reassembled_tvb; offset = 0; } } } if (usb_conv_info->is_request) { if (usb_conv_info->is_setup) { offset = dissect_usb_setup_request(pinfo, tree, tvb, offset, urb_type, usb_conv_info, header_type, usb_id); } else { switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: proto_tree_add_item(tree, hf_usb_urb_unused_setup_header, tvb, offset, 8, ENC_NA); offset += 8; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, tree); } break; case USB_HEADER_USBPCAP: break; case USB_HEADER_MAUSB: break; case USB_HEADER_USBIP: break; case USB_HEADER_DARWIN: break; case USB_HEADER_PSEUDO_URB: break; } } } else { /* this is a response */ switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: /* Skip setup header - it's never applicable for responses */ proto_tree_add_item(tree, hf_usb_urb_unused_setup_header, tvb, offset, 8, ENC_NA); offset += 8; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, tree); } break; case USB_HEADER_USBPCAP: /* Check if this is status stage */ if ((usb_conv_info->usb_trans_info) && (usbpcap_control_stage == USB_CONTROL_STAGE_STATUS)) { const gchar *description; if (USB_TYPE(usb_conv_info->usb_trans_info->setup.requesttype) == RQT_SETUP_TYPE_STANDARD) { description = val_to_str_ext(usb_conv_info->usb_trans_info->setup.request, &setup_request_names_vals_ext, "Unknown type %x") ; } else { description = "URB_CONTROL"; } col_add_fstr(pinfo->cinfo, COL_INFO, "%s status", description); /* There is no data to dissect */ return; } break; case USB_HEADER_MAUSB: break; case USB_HEADER_USBIP: break; case USB_HEADER_DARWIN: break; case USB_HEADER_PSEUDO_URB: break; } offset = dissect_usb_setup_response(pinfo, tree, tvb, offset, urb_type, usb_conv_info); } break; case URB_ISOCHRONOUS: switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: offset = dissect_linux_usb_iso_transfer(pinfo, tree, header_type, tvb, offset, usb_conv_info); break; case USB_HEADER_USBPCAP: offset = dissect_usbpcap_iso_packets(pinfo, tree, urb_type, tvb, offset, win32_data_len, usb_conv_info); break; case USB_HEADER_MAUSB: break; case USB_HEADER_USBIP: offset = dissect_usbip_iso_transfer(pinfo, tree, tvb, offset, iso_numdesc, desc_offset, usb_conv_info); break; case USB_HEADER_DARWIN: offset = dissect_darwin_usb_iso_transfer(pinfo, tree, header_type, urb_type, tvb, offset, usb_conv_info); break; case USB_HEADER_PSEUDO_URB: break; } break; default: /* unknown transfer type */ switch (header_type) { case USB_HEADER_LINUX_48_BYTES: case USB_HEADER_LINUX_64_BYTES: proto_tree_add_item(tree, hf_usb_urb_unused_setup_header, tvb, offset, 8, ENC_NA); offset += 8; if (header_type == USB_HEADER_LINUX_64_BYTES) { offset = dissect_linux_usb_pseudo_header_ext(tvb, offset, pinfo, tree); } break; case USB_HEADER_USBPCAP: break; case USB_HEADER_MAUSB: break; case USB_HEADER_USBIP: break; case USB_HEADER_DARWIN: break; case USB_HEADER_PSEUDO_URB: break; } break; } dissect_usb_payload(tvb, pinfo, parent, tree, usb_conv_info, urb_type, offset, device_address); } static int dissect_linux_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_) { dissect_usb_common(tvb, pinfo, parent, USB_HEADER_LINUX_48_BYTES, NULL); return tvb_captured_length(tvb); } static int dissect_linux_usb_mmapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_) { dissect_usb_common(tvb, pinfo, parent, USB_HEADER_LINUX_64_BYTES, NULL); return tvb_captured_length(tvb); } static int dissect_win32_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_) { dissect_usb_common(tvb, pinfo, parent, USB_HEADER_USBPCAP, NULL); return tvb_captured_length(tvb); } static int dissect_darwin_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, void* data _U_) { dissect_usb_common(tvb, pinfo, parent, USB_HEADER_DARWIN, NULL); return tvb_captured_length(tvb); } void proto_register_usb(void) { module_t *usb_module; static hf_register_info hf[] = { /* USB packet pseudoheader members */ { &hf_usb_totlen, { "Total length", "usb.totlen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_busunit, { "Host controller unit number", "usb.busunit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_address, { "USB device index", "usb.address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_mode, { "Mode of transfer", "usb.transfer_mode", FT_UINT8, BASE_DEC, VALS(usb_freebsd_transfer_mode_vals), 0x0, NULL, HFILL }}, { &hf_usb_freebsd_urb_type, { "URB type", "usb.freebsd_type", FT_UINT8, BASE_DEC, VALS(usb_freebsd_urb_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_freebsd_transfer_type, { "URB transfer type", "usb.freebsd_transfer_type", FT_UINT8, BASE_HEX, VALS(usb_freebsd_transfer_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_xferflags, { "Transfer flags", "usb.xferflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_xferflags_force_short_xfer, { "Force short transfer", "usb.xferflags.force_short_xfer", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_FORCE_SHORT_XFER, NULL, HFILL }}, { &hf_usb_xferflags_short_xfer_ok, { "Short transfer OK", "usb.xferflags.short_xfer_ok", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_SHORT_XFER_OK, NULL, HFILL }}, { &hf_usb_xferflags_short_frames_ok, { "Short frames OK", "usb.xferflags.short_frames_ok", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_SHORT_FRAMES_OK, NULL, HFILL }}, { &hf_usb_xferflags_pipe_bof, { "Pipe BOF", "usb.xferflags.pipe_bof", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_PIPE_BOF, NULL, HFILL }}, { &hf_usb_xferflags_proxy_buffer, { "Proxy buffer", "usb.xferflags.proxy_buffer", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_PROXY_BUFFER, NULL, HFILL }}, { &hf_usb_xferflags_ext_buffer, { "External buffer", "usb.xferflags.ext_buffer", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_EXT_BUFFER, NULL, HFILL }}, { &hf_usb_xferflags_manual_status, { "Manual status", "usb.xferflags.manual_status", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_MANUAL_STATUS, NULL, HFILL }}, { &hf_usb_xferflags_no_pipe_ok, { "No pipe OK", "usb.xferflags.no_pipe_ok", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_NO_PIPE_OK, NULL, HFILL }}, { &hf_usb_xferflags_stall_pipe, { "Stall pipe", "usb.xferflags.stall_pipe", FT_BOOLEAN, 32, NULL, FREEBSD_FLAG_STALL_PIPE, NULL, HFILL }}, { &hf_usb_xferstatus, { "Transfer status", "usb.xferstatus", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_xferstatus_open, { "Pipe has been opened", "usb.xferstatus.open", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_OPEN, NULL, HFILL }}, { &hf_usb_xferstatus_transferring, { "Transfer in progress", "usb.xferstatus.transferring", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_TRANSFERRING, NULL, HFILL }}, { &hf_usb_xferstatus_did_dma_delay, { "Waited for hardware DMA", "usb.xferstatus.did_dma_delay", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_DID_DMA_DELAY, NULL, HFILL }}, { &hf_usb_xferstatus_did_close, { "Transfer closed", "usb.xferstatus.did_close", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_DID_CLOSE, NULL, HFILL }}, { &hf_usb_xferstatus_draining, { "Draining transfer", "usb.xferstatus.draining", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_DRAINING, NULL, HFILL }}, { &hf_usb_xferstatus_started, { "Transfer started", "usb.xferstatus.started", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_STARTED, "Whether the transfer is started or stopped", HFILL }}, { &hf_usb_xferstatus_bw_reclaimed, { "Bandwidth reclaimed", "usb.xferstatus.bw_reclaimed", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_BW_RECLAIMED, NULL, HFILL }}, { &hf_usb_xferstatus_control_xfr, { "Control transfer", "usb.xferstatus.control_xfr", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_CONTROL_XFR, NULL, HFILL }}, { &hf_usb_xferstatus_control_hdr, { "Control header being sent", "usb.xferstatus.control_hdr", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_CONTROL_HDR, NULL, HFILL }}, { &hf_usb_xferstatus_control_act, { "Control transfer active", "usb.xferstatus.control_act", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_CONTROL_ACT, NULL, HFILL }}, { &hf_usb_xferstatus_control_stall, { "Control transfer should be stalled", "usb.xferstatus.control_stall", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_CONTROL_STALL, NULL, HFILL }}, { &hf_usb_xferstatus_short_frames_ok, { "Short frames OK", "usb.xferstatus.short_frames_ok", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_SHORT_FRAMES_OK, NULL, HFILL }}, { &hf_usb_xferstatus_short_xfer_ok, { "Short transfer OK", "usb.xferstatus.short_xfer_ok", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_SHORT_XFER_OK, NULL, HFILL }}, { &hf_usb_xferstatus_bdma_enable, { "BUS-DMA enabled", "usb.xferstatus.bdma_enable", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_BDMA_ENABLE, NULL, HFILL }}, { &hf_usb_xferstatus_bdma_no_post_sync, { "BUS-DMA post sync op not done", "usb.xferstatus.bdma_no_post_sync", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_BDMA_NO_POST_SYNC, NULL, HFILL }}, { &hf_usb_xferstatus_bdma_setup, { "BUS-DMA set up", "usb.xferstatus.bdma_setup", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_BDMA_SETUP, NULL, HFILL }}, { &hf_usb_xferstatus_isochronous_xfr, { "Isochronous transfer", "usb.xferstatus.isochronous_xfr", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_ISOCHRONOUS_XFR, NULL, HFILL }}, { &hf_usb_xferstatus_curr_dma_set, { "Current DMA set", "usb.xferstatus.curr_dma_set", FT_UINT32, BASE_DEC, NULL, FREEBSD_STATUS_CURR_DMA_SET, NULL, HFILL }}, { &hf_usb_xferstatus_can_cancel_immed, { "Transfer can be cancelled immediately", "usb.xferstatus.can_cancel_immed", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_CAN_CANCEL_IMMED, NULL, HFILL }}, { &hf_usb_xferstatus_doing_callback, { "Executing the callback", "usb.xferstatus.doing_callback", FT_BOOLEAN, 32, NULL, FREEBSD_STATUS_DOING_CALLBACK, NULL, HFILL }}, { &hf_usb_error, { "Error", "usb.error", FT_UINT32, BASE_DEC, VALS(usb_freebsd_err_vals), 0x0, NULL, HFILL }}, { &hf_usb_interval, { "Interval", "usb.interval", FT_UINT32, BASE_DEC, NULL, 0x0, "Interval (ms)", HFILL }}, { &hf_usb_nframes, { "Number of following frames", "usb.nframes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_packet_size, { "Packet size used", "usb.packet_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_packet_count, { "Packet count used", "usb.packet_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_speed, { "Speed", "usb.speed", FT_UINT8, BASE_DEC, VALS(usb_freebsd_speed_vals), 0x0, NULL, HFILL }}, { &hf_usb_frame_length, { "Frame length", "usb.frame.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_frame_flags, { "Frame flags", "usb.frame.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_frame_flags_read, { "Data direction is read", "usb.frame.read", FT_BOOLEAN, 32, NULL, FREEBSD_FRAMEFLAG_READ, NULL, HFILL }}, { &hf_usb_frame_flags_data_follows, { "Frame contains data", "usb.frame.data_follows", FT_BOOLEAN, 32, NULL, FREEBSD_FRAMEFLAG_DATA_FOLLOWS, NULL, HFILL }}, { &hf_usb_frame_data, { "Frame data", "usb.frame.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_id, { "URB id", "usb.urb_id", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_linux_urb_type, { "URB type", "usb.urb_type", FT_CHAR, BASE_HEX, VALS(usb_linux_urb_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_linux_transfer_type, { "URB transfer type", "usb.transfer_type", FT_UINT8, BASE_HEX, VALS(usb_linux_transfer_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_endpoint_address, { "Endpoint", "usb.endpoint_address", FT_UINT8, BASE_HEX, NULL, 0x0, "USB endpoint address", HFILL }}, { &hf_usb_endpoint_direction, { "Direction", "usb.endpoint_address.direction", FT_UINT8, BASE_DEC, VALS(usb_endpoint_direction_vals), 0x80, "USB endpoint direction", HFILL }}, { &hf_usb_endpoint_number, { "Endpoint number", "usb.endpoint_address.number", FT_UINT8, BASE_DEC, NULL, 0x0F, "USB endpoint number", HFILL }}, { &hf_usb_device_address, { "Device", "usb.device_address", FT_UINT32, BASE_DEC, NULL, 0x0, "USB device address", HFILL }}, { &hf_usb_bus_id, { "URB bus id", "usb.bus_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_setup_flag, { "Device setup request", "usb.setup_flag", FT_CHAR, BASE_HEX|BASE_RANGE_STRING, RVALS(usb_setup_flag_rvals), 0x0, "USB device setup request is relevant (0) or not", HFILL }}, { &hf_usb_data_flag, { "Data", "usb.data_flag", FT_CHAR, BASE_HEX|BASE_RANGE_STRING, RVALS(usb_data_flag_rvals), 0x0, "USB data is present (0) or not", HFILL }}, { &hf_usb_urb_ts_sec, { "URB sec", "usb.urb_ts_sec", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_ts_usec, { "URB usec", "usb.urb_ts_usec", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_status, { "URB status", "usb.urb_status", FT_INT32, BASE_DEC|BASE_EXT_STRING, &linux_negative_errno_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_urb_len, { "URB length [bytes]", "usb.urb_len", FT_UINT32, BASE_DEC, NULL, 0x0, "URB length in bytes", HFILL }}, { &hf_usb_urb_data_len, { "Data length [bytes]", "usb.data_len", FT_UINT32, BASE_DEC, NULL, 0x0, "URB data length in bytes", HFILL }}, { &hf_usb_urb_unused_setup_header, { "Unused Setup Header", "usb.unused_setup_header", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_interval, { "Interval", "usb.interval", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_start_frame, { "Start frame", "usb.start_frame", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_urb_copy_of_transfer_flags, { "Copy of Transfer Flags", "usb.copy_of_transfer_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_short_not_ok, { "Short not OK", "usb.transfer_flags.short_not_ok", FT_BOOLEAN, 32, NULL, URB_SHORT_NOT_OK, NULL, HFILL }}, { &hf_iso_asap, { "ISO ASAP", "usb.transfer_flags.iso_asap", FT_BOOLEAN, 32, NULL, URB_ISO_ASAP, NULL, HFILL }}, { &hf_no_transfer_dma_map, { "No transfer DMA map", "usb.transfer_flags.no_transfer_dma_map", FT_BOOLEAN, 32, NULL, URB_NO_TRANSFER_DMA_MAP, NULL, HFILL }}, { &hf_no_fsbr, { "No FSBR", "usb.transfer_flags.no_fsbr", FT_BOOLEAN, 32, NULL, URB_NO_FSBR, NULL, HFILL }}, { &hf_zero_packet, { "Zero Packet", "usb.transfer_flags.zero_packet", FT_BOOLEAN, 32, NULL, URB_ZERO_PACKET, NULL, HFILL }}, { &hf_no_interrupt, { "No Interrupt", "usb.transfer_flags.no_interrupt", FT_BOOLEAN, 32, NULL, URB_NO_INTERRUPT, NULL, HFILL }}, { &hf_free_buffer, { "Free Buffer", "usb.transfer_flags.free_buffer", FT_BOOLEAN, 32, NULL, URB_FREE_BUFFER, NULL, HFILL }}, { &hf_dir_in, { "Dir IN", "usb.transfer_flags.dir_in", FT_BOOLEAN, 32, NULL, URB_DIR_IN, NULL, HFILL }}, { &hf_dma_map_single, { "DMA Map Single", "usb.transfer_flags.dma_map_single", FT_BOOLEAN, 32, NULL, URB_DMA_MAP_SINGLE, NULL, HFILL }}, { &hf_dma_map_page, { "DMA Map Page", "usb.transfer_flags.dma_map_page", FT_BOOLEAN, 32, NULL, URB_DMA_MAP_PAGE, NULL, HFILL }}, { &hf_dma_map_sg, { "DMA Map SG", "usb.transfer_flags.dma_map_sg", FT_BOOLEAN, 32, NULL, URB_DMA_MAP_SG, NULL, HFILL }}, { &hf_map_local, { "Map Local", "usb.transfer_flags.map_local", FT_BOOLEAN, 32, NULL, URB_MAP_LOCAL, NULL, HFILL }}, { &hf_setup_map_single, { "Setup Map Single", "usb.transfer_flags.setup_map_single", FT_BOOLEAN, 32, NULL, URB_SETUP_MAP_SINGLE, NULL, HFILL }}, { &hf_setup_map_local, { "Setup Map Local", "usb.transfer_flags.setup_map_local", FT_BOOLEAN, 32, NULL, URB_SETUP_MAP_LOCAL, NULL, HFILL }}, { &hf_dma_sg_combined, { "DMA S-G Combined", "usb.transfer_flags.dma_sg_combined", FT_BOOLEAN, 32, NULL, URB_DMA_SG_COMBINED, NULL, HFILL }}, { &hf_aligned_temp_buffer, { "Aligned Temp Buffer", "usb.transfer_flags.aligned_temp_buffer", FT_BOOLEAN, 32, NULL, URB_ALIGNED_TEMP_BUFFER, NULL, HFILL }}, /* Win32 USBPcap pseudoheader */ { &hf_usb_win32_header_len, { "USBPcap pseudoheader length", "usb.usbpcap_header_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_irp_id, { "IRP ID", "usb.irp_id", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_usbd_status, { "IRP USBD_STATUS", "usb.usbd_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &win32_usbd_status_vals_ext, 0x0, "USB request status value", HFILL }}, { &hf_usb_function, { "URB Function", "usb.function", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &win32_urb_function_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_info, { "IRP information", "usb.irp_info", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_usbpcap_info_reserved, { "Reserved", "usb.irp_info.reserved", FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL }}, { &hf_usb_usbpcap_info_direction, { "Direction", "usb.irp_info.direction", FT_UINT8, BASE_HEX, VALS(win32_usb_info_direction_vals), 0x01, NULL, HFILL }}, { &hf_usb_win32_device_address, { "Device address", "usb.device_address", FT_UINT16, BASE_DEC, NULL, 0x0, "Windows USB device address", HFILL }}, { &hf_usb_win32_transfer_type, { "URB transfer type", "usb.transfer_type", FT_UINT8, BASE_HEX, VALS(win32_usb_transfer_type_vals), 0x0, NULL, HFILL } }, { &hf_usb_win32_data_len, { "Packet Data Length", "usb.data_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_control_stage, { "Control transfer stage", "usb.control_stage", FT_UINT8, BASE_DEC, VALS(usb_control_stage_vals), 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_start_frame, { "Isochronous transfer start frame", "usb.win32.iso_frame", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_num_packets, { "Isochronous transfer number of packets", "usb.win32.iso_num_packets", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_error_count, { "Isochronous transfer error count", "usb.win32.iso_error_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_offset, { "ISO Data offset", "usb.win32.iso_offset", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_length, { "ISO Data length", "usb.win32.iso_data_len", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_win32_iso_status, { "ISO USBD status", "usb.win32.iso_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &win32_usbd_status_vals_ext, 0x0, NULL, HFILL }}, /* macOS usbdump pseudoheader */ { &hf_usb_darwin_bcd_version, { "Darwin header bcdVersion", "usb.darwin.bcdVersion", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_header_len, { "Darwin header length", "usb.darwin.header_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_request_type, { "Request type", "usb.darwin.request_type", FT_UINT8, BASE_DEC, VALS(usb_darwin_request_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_darwin_io_len, { "I/O length [bytes]", "usb.darwin.io_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Request length in bytes", HFILL }}, { &hf_usb_darwin_io_status, { "Request status", "usb.darwin.io_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &usb_darwin_status_vals_ext, 0x0, "USB request status", HFILL }}, { &hf_usb_darwin_iso_num_packets, { "Isochronous transfer number of frames", "usb.darwin.io_frame_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_io_id, { "I/O ID", "usb.darwin.io_id", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_device_location, { "Device location ID", "usb.darwin.location_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_speed, { "Device speed", "usb.darwin_device_speed", FT_UINT8, BASE_DEC, VALS(usb_darwin_speed_vals), 0x0, NULL, HFILL }}, { &hf_usb_darwin_device_address, { "USB device index", "usb.darwin.device_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_endpoint_address, { "Endpoint address", "usb.darwin.endpoint_address", FT_UINT8, BASE_HEX, NULL, 0x0, "Endpoint address and direction", HFILL }}, { &hf_usb_darwin_endpoint_type, { "Endpoint transfer type", "usb.darwin.endpoint_type", FT_UINT8, BASE_DEC, VALS(usb_darwin_endpoint_type_vals), 0x0, NULL, HFILL }}, { &hf_usb_darwin_iso_status, { "Frame status", "usb.darwin.iso.status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &usb_darwin_status_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_darwin_iso_timestamp, { "Frame timestamp", "usb.darwin.iso.timestamp", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_darwin_iso_frame_number, { "Frame number", "usb.darwin.iso.frame_number", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bmRequestType, { "bmRequestType", "usb.bmRequestType", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, /* Only used when response type cannot be determined */ { &hf_usb_control_response_generic, { "CONTROL response data", "usb.control.Response", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_request, { "bRequest", "usb.setup.bRequest", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &setup_request_names_vals_ext, 0x0, NULL, HFILL }}, /* Same as hf_usb_request but no descriptive text */ { &hf_usb_request_unknown_class, { "bRequest", "usb.setup.bRequest", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_value, { "wValue", "usb.setup.wValue", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_index, { "wIndex", "usb.setup.wIndex", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_length, { "wLength", "usb.setup.wLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_device_wFeatureSelector, { "wFeatureSelector", "usb.setup.wFeatureSelector", FT_UINT16, BASE_DEC, VALS(usb_device_feature_selector_vals), 0x0, NULL, HFILL }}, { &hf_usb_interface_wFeatureSelector, { "wFeatureSelector", "usb.setup.wFeatureSelector", FT_UINT16, BASE_DEC, VALS(usb_interface_feature_selector_vals), 0x0, NULL, HFILL }}, { &hf_usb_endpoint_wFeatureSelector, { "wFeatureSelector", "usb.setup.wFeatureSelector", FT_UINT16, BASE_DEC, VALS(usb_endpoint_feature_selector_vals), 0x0, NULL, HFILL }}, { &hf_usb_wInterface, { "wInterface", "usb.setup.wInterface", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_wEndpoint, { "wEndpoint", "usb.setup.wEndpoint", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_wStatus, { "wStatus", "usb.setup.wStatus", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_wFrameNumber, { "wFrameNumber", "usb.setup.wFrameNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* --------------------------------- */ { &hf_usb_iso_error_count, /* host endian byte order */ { "ISO error count", "usb.iso.error_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iso_numdesc, { "Number of ISO descriptors", "usb.iso.numdesc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* fields of struct mon_bin_isodesc from linux/drivers/usb/mon/mon_bin.c */ { &hf_usb_iso_status, { "Status", "usb.iso.iso_status", FT_INT32, BASE_DEC|BASE_EXT_STRING, &linux_negative_errno_vals_ext, 0x0, "ISO descriptor status", HFILL }}, { &hf_usb_iso_off, { "Offset [bytes]", "usb.iso.iso_off", FT_UINT32, BASE_DEC, NULL, 0x0, "ISO data offset in bytes starting from the end of the last ISO descriptor", HFILL }}, { &hf_usb_iso_len, { "Length [bytes]", "usb.iso.iso_len", FT_UINT32, BASE_DEC, NULL, 0x0, "ISO data length in bytes", HFILL }}, { &hf_usb_iso_actual_len, { "Actual Length [bytes]", "usb.iso.iso_actual_len", FT_UINT32, BASE_DEC, NULL, 0x0, "ISO data actual length in bytes", HFILL }}, { &hf_usb_iso_pad, /* host endian byte order */ { "Padding", "usb.iso.pad", FT_UINT32, BASE_HEX, NULL, 0x0, "Padding field of ISO descriptor structure", HFILL }}, { &hf_usb_iso_data, {"ISO Data", "usb.iso.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* --------------------------------- */ #if 0 { &hf_usb_data_len, {"Application Data Length", "usb.data.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #endif { &hf_usb_capdata, {"Leftover Capture Data", "usb.capdata", FT_BYTES, BASE_NONE, NULL, 0x0, "Padding added by the USB capture system", HFILL }}, { &hf_usb_bmRequestType_direction, { "Direction", "usb.bmRequestType.direction", FT_BOOLEAN, 8, TFS(&tfs_bmrequesttype_direction), USB_DIR_IN, NULL, HFILL }}, { &hf_usb_bmRequestType_type, { "Type", "usb.bmRequestType.type", FT_UINT8, BASE_HEX, VALS(bmrequesttype_type_vals), USB_TYPE_MASK, NULL, HFILL }}, { &hf_usb_bmRequestType_recipient, { "Recipient", "usb.bmRequestType.recipient", FT_UINT8, BASE_HEX, VALS(bmrequesttype_recipient_vals), 0x1f, NULL, HFILL }}, { &hf_usb_bDescriptorType, { "bDescriptorType", "usb.bDescriptorType", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &std_descriptor_type_vals_ext, 0x0, NULL, HFILL }}, /* Only used when descriptor type cannot be determined */ { &hf_usb_get_descriptor_resp_generic, { "GET DESCRIPTOR Response data", "usb.getDescriptor.Response", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_descriptor_index, { "Descriptor Index", "usb.DescriptorIndex", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_language_id, { "Language Id", "usb.LanguageId", FT_UINT16, BASE_HEX|BASE_EXT_STRING,&usb_langid_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bLength, { "bLength", "usb.bLength", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bcdUSB, { "bcdUSB", "usb.bcdUSB", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bDeviceClass, { "bDeviceClass", "usb.bDeviceClass", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_class_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bDeviceSubClass, { "bDeviceSubClass", "usb.bDeviceSubClass", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bDeviceProtocol, { "bDeviceProtocol", "usb.bDeviceProtocol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bMaxPacketSize0, { "bMaxPacketSize0", "usb.bMaxPacketSize0", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_idVendor, { "idVendor", "usb.idVendor", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &ext_usb_vendors_vals, 0x0, NULL, HFILL }}, { &hf_usb_idProduct, { "idProduct", "usb.idProduct", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bcdDevice, { "bcdDevice", "usb.bcdDevice", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iManufacturer, { "iManufacturer", "usb.iManufacturer", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iProduct, { "iProduct", "usb.iProduct", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iSerialNumber, { "iSerialNumber", "usb.iSerialNumber", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bNumConfigurations, { "bNumConfigurations", "usb.bNumConfigurations", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_wLANGID, { "wLANGID", "usb.wLANGID", FT_UINT16, BASE_HEX|BASE_EXT_STRING,&usb_langid_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bString, { "bString", "usb.bString", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceNumber, { "bInterfaceNumber", "usb.bInterfaceNumber", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bAlternateSetting, { "bAlternateSetting", "usb.bAlternateSetting", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bNumEndpoints, { "bNumEndpoints", "usb.bNumEndpoints", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceClass, { "bInterfaceClass", "usb.bInterfaceClass", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_class_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_audio, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ext_usb_audio_subclass_vals, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_cdc, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ext_usb_com_subclass_vals, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_massstorage , { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &ext_usb_massstorage_subclass_vals, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_hid, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_hid_subclass_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_misc, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_misc_subclass_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceSubClass_app, { "bInterfaceSubClass", "usb.bInterfaceSubClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_app_subclass_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_cdc, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_cdc_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_massstorage, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_massstorage_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_cdc_data, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_cdc_data_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_hid_boot, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_hid_boot_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_app_dfu, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_app_dfu_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_app_irda, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_app_irda_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceProtocol_app_usb_test_and_measurement, { "bInterfaceProtocol", "usb.bInterfaceProtocol", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_app_usb_test_and_measurement_protocol_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_iInterface, { "iInterface", "usb.iInterface", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bEndpointAddress, { "bEndpointAddress", "usb.bEndpointAddress", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_configuration_bmAttributes, { "Configuration bmAttributes", "usb.configuration.bmAttributes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bmAttributes, { "bmAttributes", "usb.bmAttributes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bEndpointAttributeTransfer, { "Transfertype", "usb.bmAttributes.transfer", FT_UINT8, BASE_HEX, VALS(usb_bmAttributes_transfer_vals), 0x03, NULL, HFILL }}, { &hf_usb_bEndpointAttributeSynchonisation, { "Synchronisationtype", "usb.bmAttributes.sync", FT_UINT8, BASE_HEX, VALS(usb_bmAttributes_sync_vals), 0x0c, NULL, HFILL }}, { &hf_usb_bEndpointAttributeBehaviour, { "Behaviourtype", "usb.bmAttributes.behaviour", FT_UINT8, BASE_HEX, VALS(usb_bmAttributes_behaviour_vals), 0x30, NULL, HFILL }}, { &hf_usb_wMaxPacketSize, { "wMaxPacketSize", "usb.wMaxPacketSize", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_wMaxPacketSize_size, { "Maximum Packet Size", "usb.wMaxPacketSize.size", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL }}, { &hf_usb_wMaxPacketSize_slots, { "Transactions per microframe", "usb.wMaxPacketSize.slots", FT_UINT16, BASE_DEC, VALS(usb_wMaxPacketSize_slots_vals), (3<<11), NULL, HFILL }}, { &hf_usb_bInterval, { "bInterval", "usb.bInterval", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bMaxBurst, { "bMaxBurst", "usb.bMaxBurst", FT_UINT8, BASE_DEC, NULL, 0x0, "Valid values are from 0 to 15. For control endpoints this value shall be 0.", HFILL }}, { &hf_usb_audio_bRefresh, { "bRefresh", "usb.audio.bRefresh", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usb_audio_bSynchAddress, { "bSynchAddress", "usb.audio.bSynchAddress", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usb_bSSEndpointAttributeBulkMaxStreams, { "MaxStreams", "usb.bmAttributes.MaxStreams", FT_UINT8, BASE_DEC, NULL, 0x0F, "Number of streams = 2 to the power MaxStreams", HFILL }}, { &hf_usb_bSSEndpointAttributeIsoMult, { "Mult", "usb.bmAttributes.Mult", FT_UINT8, BASE_DEC, NULL, 0x03, "Maximum number of packets = bMaxBurst * (Mult + 1)", HFILL } }, { &hf_usb_wBytesPerInterval, { "wBytesPerInterval", "usb.wBytesPerInterval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usb_wTotalLength, { "wTotalLength", "usb.wTotalLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bNumInterfaces, { "bNumInterfaces", "usb.bNumInterfaces", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bConfigurationValue, { "bConfigurationValue", "usb.bConfigurationValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iConfiguration, { "iConfiguration", "usb.iConfiguration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bMaxPower, { "bMaxPower", "usb.bMaxPower", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_configuration_legacy10buspowered, { "Must be 1", "usb.configuration.legacy10buspowered", FT_BOOLEAN, 8, TFS(&tfs_mustbeone), 0x80, "Legacy USB 1.0 bus powered", HFILL }}, { &hf_usb_configuration_selfpowered, { "Self-Powered", "usb.configuration.selfpowered", FT_BOOLEAN, 8, TFS(&tfs_selfpowered), 0x40, NULL, HFILL }}, { &hf_usb_configuration_remotewakeup, { "Remote Wakeup", "usb.configuration.remotewakeup", FT_BOOLEAN, 8, TFS(&tfs_remotewakeup), 0x20, NULL, HFILL }}, { &hf_usb_bEndpointAddress_number, { "Endpoint Number", "usb.bEndpointAddress.number", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL }}, { &hf_usb_bEndpointAddress_direction, { "Direction", "usb.bEndpointAddress.direction", FT_BOOLEAN, 8, TFS(&tfs_endpoint_direction), 0x80, NULL, HFILL }}, { &hf_usb_request_in, { "Request in", "usb.request_in", FT_FRAMENUM, BASE_NONE, NULL, 0, "The request to this packet is in this packet", HFILL }}, { &hf_usb_time, { "Time from request", "usb.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0, "Time between Request and Response for USB cmds", HFILL }}, { &hf_usb_response_in, { "Response in", "usb.response_in", FT_FRAMENUM, BASE_NONE, NULL, 0, "The response to this packet is in this packet", HFILL }}, { &hf_usb_bFirstInterface, { "bFirstInterface", "usb.bFirstInterface", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bInterfaceCount, { "bInterfaceCount", "usb.bInterfaceCount", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bFunctionClass, { "bFunctionClass", "usb.bFunctionClass", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_class_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_bFunctionSubClass, { "bFunctionSubClass", "usb.bFunctionSubClass", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bFunctionProtocol, { "bFunctionProtocol", "usb.bFunctionProtocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_iFunction, { "iFunction", "usb.iFunction", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bNumDeviceCaps, { "bNumDeviceCaps", "usb.bNumDeviceCaps", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_bDevCapabilityType, { "bDevCapabilityType", "usb.bDevCapabilityType", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_capability_vals_ext, 0x0, NULL, HFILL }}, { &hf_usb_usb20ext_bmAttributes, { "bmAttributes", "usb.usb20ext.bmAttributes", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_usb20ext_LPM, { "LPM", "usb.usb20ext.bmAttributes.LPM", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }}, { &hf_usb_usb20ext_BESL_HIRD, { "BESL & Alternate HIRD", "usb.usb20ext.bmAttributes.BESL", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL }}, { &hf_usb_usb20ext_baseline_BESL_valid, { "Baseline BESL valid", "usb.usb20ext.bmAttributes.baseline_BESL_valid", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL }}, { &hf_usb_usb20ext_deep_BESL_valid, { "Deep BESL valid", "usb.usb20ext.bmAttributes.deep_BESL_valid", FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL }}, { &hf_usb_usb20ext_baseline_BESL, { "Recommended Baseline BESL", "usb.usb20ext.bmAttributes.baseline_BESL", FT_UINT32, BASE_CUSTOM, CF_FUNC(usb_lpm_besl_str), 0x00000F00, NULL, HFILL }}, { &hf_usb_usb20ext_deep_BESL, { "Recommended Deep BESL", "usb.usb20ext.bmAttributes.deep_BESL", FT_UINT32, BASE_CUSTOM, CF_FUNC(usb_lpm_besl_str), 0x0000F000, NULL, HFILL }}, { &hf_usb_bReserved, { "bReserved", "usb.bReserved", FT_UINT8, BASE_DEC, NULL, 0x0, "This field is reserved and shall be set to zero", HFILL }}, { &hf_usb_PlatformCapabilityUUID, { "PlatformCapabilityUUID", "usb.PlatformCapabilityUUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_webusb_bcdVersion, { "bcdVersion", "usb.webusb.bcdVersion", FT_UINT16, BASE_HEX, NULL, 0x0, "WebUSB descriptor version", HFILL }}, { &hf_usb_webusb_bVendorCode, { "bVendorCode", "usb.webusb.bVendorCode", FT_UINT8, BASE_DEC, NULL, 0x0, "bRequest value for WebUSB", HFILL }}, { &hf_usb_webusb_iLandingPage, { "iLandingPage", "usb.webusb.iLandingPage", FT_UINT8, BASE_DEC, NULL, 0x0, "URL for landing page", HFILL }}, { &hf_usb_msos20_dwWindowsVersion, { "dwWindowsVersion", "usb.msos20.dwWindowsVersion", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usb_msos20_wMSOSDescriptorSetTotalLength, { "wMSOSDescriptorSetTotalLength", "usb.msos20.wMSOSDescriptorSetTotalLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_msos20_bMS_VendorCode, { "bMS_VendorCode", "usb.msos20.bMS_VendorCode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_msos20_bAltEnumCode, { "bAltEnumCode", "usb.msos20.bAltEnumCode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usb_data_fragment, { "Data Fragment", "usb.data_fragment", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usb_src, { "Source", "usb.src", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_dst, { "Destination", "usb.dst", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usb_addr, { "Source or Destination", "usb.addr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static hf_register_info hf_usbport[] = { { &hf_usbport_event_id, { "Event ID", "usbport.event_id", FT_UINT32, BASE_DEC_HEX|BASE_EXT_STRING, &netmon_event_id_vals_ext, 0x0, NULL, HFILL } }, { &hf_usbport_device_object, { "Device Object", "usbport.device_object", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pci_bus, { "PCI Bus", "usbport.pci_bus", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pci_device, { "PCI Bus", "usbport.pci_device", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pci_function, { "PCI Function", "usbport.pci_function", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pci_vendor_id, { "PCI Vendor ID", "usbport.pci_vendor_id", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pci_device_id, { "PCI Device ID", "usbport.pci_device_id", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path_depth, { "Path Depth", "usbport.port_path_depth", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path0, { "Path0", "usbport.port_path0", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path1, { "Path1", "usbport.port_path1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path2, { "Path2", "usbport.port_path2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path3, { "Path3", "usbport.port_path3", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path4, { "Path4", "usbport.port_path4", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_port_path5, { "Path5", "usbport.port_path5", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_device_handle, { "Device Handle", "usbport.device_handle", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_device_speed, { "Device Speed", "usbport.device_speed", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_endpoint, { "Endpoint", "usbport.endpoint", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_pipehandle, { "Pipe Handle", "usbport.pipehandle", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_endpoint_desc_length, { "Length", "usbport.endpoint_desc_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_endpoint_desc_type, { "Description Type", "usbport.endpoint_desc_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_endpoint_address, { "Endpoint Address", "usbport.endpoint_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_bm_attributes, { "bmAttributes", "usbport.bm_attributes", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_max_packet_size, { "Max Packet Size", "usbport.max_packet_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_interval, { "Interval", "usbport.interval", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_irp, { "IRP", "usbport.irp", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb, { "URB", "usbport.urb", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_transfer_data, { "URB Transfer data", "usbport.urb_transfer_data", FT_UINT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_header_length, { "URB Header Length", "usbport.urb_header_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_header_function, { "URB Header Function", "usbport.urb_header_function", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &netmon_urb_function_vals_ext, 0x0, NULL, HFILL } }, { &hf_usbport_urb_header_status, { "URB Header Status", "usbport.urb_header_status", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_header_usbddevice_handle, { "URB Header Device Handle", "usbport.urb_header_usbddevice_handle", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_header_usbdflags, { "URB Header Flags", "usbport.urb_header_usbdflags", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_configuration_desc, { "URB Configuration Description", "usbport.urb_configuration_desc", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_configuration_handle, { "URB Configuration Handle", "usbport.urb_configuration_handle", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_pipe_handle, { "URB Pipe Handle", "usbport.urb_pipe_handle", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_xferflags, { "URB Transfer Flags", "usbport.urb_xferflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_transfer_buffer_length, { "URB Transfer Buffer Length", "usbport.urb_transfer_buffer_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_transfer_buffer, { "URB Transfer Buffer", "usbport.urb_transfer_buffer", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_transfer_buffer_mdl, { "URB Transfer Buffer MDL", "usbport.urb_transfer_buffer_mdl", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_reserved_mbz, { "URB Reserved MBZ", "usbport.urb_reserved_mbz", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_reserved_hcd, { "URB Reserved HCD", "usbport.urb_reserved_hcd", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_urb_reserved, { "URB Reserved", "usbport.urb_reserved", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_keyword, { "Keyword", "usbport.keyword", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_usbport_keyword_diagnostic, { "USBPORT_ETW_KEYWORD_DIAGNOSTIC", "usbport.keyword.diagnostic", FT_BOOLEAN, 64, NULL, USBPORT_KEYWORD_DIAGNOSTIC, NULL, HFILL } }, { &hf_usbport_keyword_power_diagnostics, { "USBPORT_ETW_KEYWORD_POWER_DIAGNOSTICS", "usbport.keyword.power_diagnostics", FT_BOOLEAN, 64, NULL, USBPORT_KEYWORD_POWER_DIAGNOSTICS, NULL, HFILL } }, { &hf_usbport_keyword_perf_diagnostics, { "USBPORT_ETW_KEYWORD_PERF_DIAGNOSTICS", "usbport.keyword.perf_diagnostics", FT_BOOLEAN, 64, NULL, USBPORT_KEYWORD_PERF_DIAGNOSTICS, NULL, HFILL } }, { &hf_usbport_keyword_reserved1, { "Reserved1", "usbport.keyword.reserved1", FT_UINT64, BASE_HEX, NULL, USBPORT_KEYWORD_RESERVED1, NULL, HFILL } }, }; static gint *usb_subtrees[] = { &ett_usb_hdr, &ett_usb_setup_hdr, &ett_usb_isodesc, &ett_usb_win32_iso_packet, &ett_usb_endpoint, &ett_usb_xferflags, &ett_usb_xferstatus, &ett_usb_frame, &ett_usb_frame_flags, &ett_usb_setup_bmrequesttype, &ett_usb_usbpcap_info, &ett_descriptor_device, &ett_configuration_bmAttributes, &ett_configuration_bEndpointAddress, &ett_endpoint_bmAttributes, &ett_endpoint_wMaxPacketSize, &ett_transfer_flags, &ett_usb20ext_bmAttributes, }; static gint *usbport_subtrees[] = { &ett_usbport, &ett_usbport_host_controller, &ett_usbport_path, &ett_usbport_device, &ett_usbport_endpoint, &ett_usbport_endpoint_desc, &ett_usbport_urb, &ett_usbport_keyword, }; static ei_register_info ei[] = { { &ei_usb_undecoded, { "usb.undecoded", PI_UNDECODED, PI_WARN, "Not dissected yet (report to wireshark.org)", EXPFILL }}, { &ei_usb_bLength_even, { "usb.bLength.even", PI_PROTOCOL, PI_WARN, "Invalid STRING DESCRIPTOR Length (must be even)", EXPFILL }}, { &ei_usb_bLength_too_short, { "usb.bLength.too_short", PI_MALFORMED, PI_ERROR, "Invalid STRING DESCRIPTOR Length (must be 2 or larger)", EXPFILL }}, { &ei_usb_desc_length_invalid, { "usb.desc_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid descriptor length", EXPFILL }}, { &ei_usb_invalid_setup, { "usb.setup.invalid", PI_MALFORMED, PI_ERROR, "Only control URBs may contain a setup packet", EXPFILL }}, { &ei_usb_ss_ep_companion_before_ep, { "usb.bmAttributes.invalid_order", PI_MALFORMED, PI_ERROR, "SuperSpeed Endpoint Companion must come after Endpoint Descriptor", EXPFILL }}, { &ei_usb_usbpcap_unknown_urb, { "usb.usbpcap.unknown_urb", PI_MALFORMED, PI_ERROR, "USBPcap did not recognize URB Function code (report to desowin.org/USBPcap)", EXPFILL }}, { &ei_usb_bad_length, { "usb.bad_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }}, { &ei_usb_invalid_max_packet_size, { "usb.wMaxPacketSize.invalid", PI_PROTOCOL, PI_WARN, "Invalid Max Packet Size", EXPFILL }}, { &ei_usb_invalid_max_packet_size0, { "usb.bMaxPacketSize0.invalid", PI_PROTOCOL, PI_WARN, "Invalid Max Packet Size", EXPFILL }}, { &ei_usb_invalid_endpoint_type, { "usb.bmAttributes.transfer.invalid", PI_PROTOCOL, PI_WARN, "Transfer type not allowed at Low-Speed", EXPFILL }}, { &ei_usb_unexpected_desc_type, { "usb.bDescriptorType.unexpected", PI_MALFORMED, PI_ERROR, "Unexpected descriptor type", EXPFILL }}, }; static ei_register_info ei_usbport[] = { { &ei_usbport_invalid_path_depth, { "usbport.path_depth.invalid", PI_PROTOCOL, PI_WARN, "Invalid path depth", EXPFILL }}, }; expert_module_t *expert_usb, *expert_usbport; proto_usb = proto_register_protocol("USB", "USB", "usb"); proto_usbport = proto_register_protocol("USBPort", "USBPort", "usbport"); proto_register_field_array(proto_usb, hf, array_length(hf)); proto_register_field_array(proto_usbport, hf_usbport, array_length(hf_usbport)); proto_register_subtree_array(usb_subtrees, array_length(usb_subtrees)); proto_register_subtree_array(usbport_subtrees, array_length(usbport_subtrees)); expert_usb = expert_register_protocol(proto_usb); expert_register_field_array(expert_usb, ei, array_length(ei)); expert_usbport = expert_register_protocol(proto_usbport); expert_register_field_array(expert_usbport, ei_usbport, array_length(ei_usbport)); device_to_product_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); device_to_protocol_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); usbpcap_setup_data = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); device_to_dissector = register_dissector_table("usb.device", "USB device", proto_usb, FT_UINT32, BASE_HEX); protocol_to_dissector = register_dissector_table("usb.protocol", "USB protocol", proto_usb, FT_UINT32, BASE_HEX); product_to_dissector = register_dissector_table("usb.product", "USB product", proto_usb, FT_UINT32, BASE_HEX); usb_bulk_dissector_table = register_dissector_table("usb.bulk", "USB bulk endpoint", proto_usb, FT_UINT32, BASE_HEX); heur_bulk_subdissector_list = register_heur_dissector_list("usb.bulk", proto_usb); usb_control_dissector_table = register_dissector_table("usb.control", "USB control endpoint", proto_usb, FT_UINT32, BASE_HEX); heur_control_subdissector_list = register_heur_dissector_list("usb.control", proto_usb); usb_interrupt_dissector_table = register_dissector_table("usb.interrupt", "USB interrupt endpoint", proto_usb, FT_UINT32, BASE_HEX); heur_interrupt_subdissector_list = register_heur_dissector_list("usb.interrupt", proto_usb); usb_descriptor_dissector_table = register_dissector_table("usb.descriptor", "USB descriptor", proto_usb, FT_UINT8, BASE_DEC); usb_module = prefs_register_protocol(proto_usb, NULL); prefs_register_bool_preference(usb_module, "try_heuristics", "Try heuristic sub-dissectors", "Try to decode a packet using a heuristic sub-dissector before " "attempting to dissect the packet using the \"usb.bulk\", \"usb.interrupt\" or " "\"usb.control\" dissector tables.", &try_heuristics); usb_tap = register_tap("usb"); register_decode_as(&usb_protocol_da); register_decode_as(&usb_product_da); register_decode_as(&usb_device_da); usb_address_type = address_type_dissector_register("AT_USB", "USB Address", usb_addr_to_str, usb_addr_str_len, NULL, usb_col_filter_str, NULL, NULL, NULL); register_conversation_table(proto_usb, TRUE, usb_conversation_packet, usb_endpoint_packet); } void proto_reg_handoff_usb(void) { dissector_handle_t linux_usb_handle; dissector_handle_t linux_usb_mmapped_handle; dissector_handle_t win32_usb_handle; dissector_handle_t freebsd_usb_handle; dissector_handle_t darwin_usb_handle; dissector_handle_t netmon_usb_port_handle; static guid_key usb_port_key = {{ 0xc88a4ef5, 0xd048, 0x4013, { 0x94, 0x08, 0xe0, 0x4b, 0x7d, 0xb2, 0x81, 0x4a }}, 0 }; linux_usb_handle = create_dissector_handle(dissect_linux_usb, proto_usb); linux_usb_mmapped_handle = create_dissector_handle(dissect_linux_usb_mmapped, proto_usb); win32_usb_handle = create_dissector_handle(dissect_win32_usb, proto_usb); freebsd_usb_handle = create_dissector_handle(dissect_freebsd_usb, proto_usb); darwin_usb_handle = create_dissector_handle(dissect_darwin_usb, proto_usb); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_LINUX, linux_usb_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_LINUX_MMAPPED, linux_usb_mmapped_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USBPCAP, win32_usb_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_FREEBSD, freebsd_usb_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_DARWIN, darwin_usb_handle); netmon_usb_port_handle = create_dissector_handle( dissect_netmon_usb_port, proto_usbport); dissector_add_guid( "netmon.provider_id", &usb_port_key, netmon_usb_port_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-usb.h
/* packet-usb.h * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_USB_H__ #define __PACKET_USB_H__ #include <epan/value_string.h> #include <epan/wmem_scopes.h> #include <epan/conversation.h> typedef struct _usb_address_t { guint32 device; guint32 endpoint; guint16 bus_id; } usb_address_t; #define USB_ADDR_LEN (sizeof(usb_address_t)) /* Flag used to mark usb_address_t.endpoint as an interface * address instead of the normal endpoint address. */ #define INTERFACE_PORT 0x80000000 typedef struct _usb_conv_info_t usb_conv_info_t; /* Wireshark specific (i.e. numeric values are arbitrary) enum representing * USB device speed. */ typedef enum { USB_SPEED_UNKNOWN, /* Unknown, skip speed specific processing */ USB_SPEED_LOW, USB_SPEED_FULL, USB_SPEED_HIGH, } usb_speed_t; /* header type */ typedef enum { USB_HEADER_LINUX_48_BYTES, USB_HEADER_LINUX_64_BYTES, USB_HEADER_USBPCAP, USB_HEADER_MAUSB, USB_HEADER_USBIP, USB_HEADER_DARWIN, USB_HEADER_PSEUDO_URB, } usb_header_t; #define USB_HEADER_IS_LINUX(type) \ ((type) == USB_HEADER_LINUX_48_BYTES || (type) == USB_HEADER_LINUX_64_BYTES) typedef struct _usb_pseudo_urb_t { gboolean from_host; guint8 transfer_type; guint8 device_address; guint8 endpoint; guint16 bus_id; usb_speed_t speed; } usb_pseudo_urb_t; /* there is one such structure for each request/response */ typedef struct _usb_trans_info_t { guint32 request_in; guint32 response_in; nstime_t req_time; usb_header_t header_type; /* Valid only for SETUP transactions */ struct _usb_setup { guint8 requesttype; guint8 request; guint16 wValue; guint16 wIndex; guint16 wLength; } setup; /* Valid only during GET DESCRIPTOR transactions */ union { struct { guint8 type; guint8 usb_index; } get_descriptor; } u; /* used to pass the interface class from the * interface descriptor onto the endpoint * descriptors so that we can create a * conversation with the appropriate class * once we know the endpoint. * Valid only during GET CONFIGURATION response. */ usb_conv_info_t *interface_info; guint64 usb_id; } usb_trans_info_t; enum usb_conv_class_data_type { USB_CONV_UNKNOWN = 0, USB_CONV_U3V, USB_CONV_AUDIO, USB_CONV_VIDEO, USB_CONV_MASS_STORAGE_BOT, USB_CONV_MASS_STORAGE_UASP, }; /* Conversation Structure * there is one such structure for each device/endpoint conversation */ struct _usb_conv_info_t { guint16 bus_id; guint16 device_address; guint8 endpoint; gint direction; guint8 transfer_type; /* transfer type from URB */ guint8 descriptor_transfer_type; /* transfer type lifted from the configuration descriptor */ guint16 max_packet_size; /* max packet size from configuration descriptor */ guint32 device_protocol; gboolean is_request; gboolean is_setup; guint8 setup_requesttype; usb_speed_t speed; guint16 interfaceClass; /* Interface Descriptor - class */ guint16 interfaceSubclass; /* Interface Descriptor - subclass */ guint16 interfaceProtocol; /* Interface Descriptor - protocol */ guint8 interfaceNum; /* Most recent interface number */ guint16 deviceVendor; /* Device Descriptor - USB Vendor ID */ guint32 deviceProduct; /* Device Descriptor - USB Product ID - MSBs only for encoding unknown */ guint16 deviceVersion; /* Device Descriptor - USB device version number BCD */ guint8 iSerialNumber; /* Device Descriptor - iSerialNumber (0 if no serial number available) */ wmem_tree_t *transactions; usb_trans_info_t *usb_trans_info; /* pointer to the current transaction */ void *class_data; /* private class/id decode data */ enum usb_conv_class_data_type class_data_type; wmem_array_t *alt_settings; }; /* This is what a tap will tap */ typedef struct _usb_tap_data_t { guint8 urb_type; guint8 transfer_type; usb_conv_info_t *conv_info; usb_trans_info_t *trans_info; } usb_tap_data_t; /* the value for "no endpoint" that's used usb_addr_t, e.g. for the address of the host */ #define NO_ENDPOINT 0xffffffff /* the 8bit version of NO_ENDPOINT, it's used in usb_conv_info_t 0xff would be an invalid endpoint number (reserved bits are 1) */ #define NO_ENDPOINT8 ((guint8)(NO_ENDPOINT& G_MAXUINT8)) /* * Values from the Linux USB pseudo-header. */ /* * event_type values */ #define URB_SUBMIT 'S' #define URB_COMPLETE 'C' #define URB_ERROR 'E' /* * URB transfer_type values */ #define URB_ISOCHRONOUS 0x0 #define URB_INTERRUPT 0x1 #define URB_CONTROL 0x2 #define URB_BULK 0x3 #define URB_UNKNOWN 0xFF #define URB_TRANSFER_IN 0x80 /* to host */ /* http://www.usb.org/developers/defined_class */ #define IF_CLASS_DEVICE 0x00 #define IF_CLASS_AUDIO 0x01 #define IF_CLASS_COMMUNICATIONS 0x02 #define IF_CLASS_HID 0x03 #define IF_CLASS_PHYSICAL 0x05 #define IF_CLASS_IMAGE 0x06 #define IF_CLASS_PRINTER 0x07 #define IF_CLASS_MASS_STORAGE 0x08 #define IF_CLASS_HUB 0x09 #define IF_CLASS_CDC_DATA 0x0a #define IF_CLASS_SMART_CARD 0x0b #define IF_CLASS_CONTENT_SECURITY 0x0d #define IF_CLASS_VIDEO 0x0e #define IF_CLASS_PERSONAL_HEALTHCARE 0x0f #define IF_CLASS_AUDIO_VIDEO 0x10 #define IF_CLASS_DIAGNOSTIC_DEVICE 0xdc #define IF_CLASS_WIRELESS_CONTROLLER 0xe0 #define IF_CLASS_MISCELLANEOUS 0xef #define IF_CLASS_APPLICATION_SPECIFIC 0xfe #define IF_CLASS_VENDOR_SPECIFIC 0xff #define IF_CLASS_UNKNOWN 0xffff #define IF_SUBCLASS_UNKNOWN 0xffff #define IF_PROTOCOL_UNKNOWN 0xffff #define DEV_VENDOR_UNKNOWN 0x0000 /* this id is unassigned */ #define DEV_PRODUCT_UNKNOWN 0xfffffff /* 0x0000 and 0xffff are used values by vendors, so MSBs encode unknown */ #define DEV_VERSION_UNKNOWN 0xffff #define IF_SUBCLASS_MISC_U3V 0x05 #define IF_SUBCLASS_APP_DFU 0x01 #define IF_PROTOCOL_DFU_RUNTIME 0x01 #define IF_PROTOCOL_DFU_MODE 0x02 /* Key to be used with "usb.control", "usb.bulk" and/or "usb.interrupt" * dissector tables when the dissector only applies to specific triple. * Use class code directly if the code is not shared with other specifications. * * MSB (bit 31) is arbitrarily chosen to ensure class registered dissectors * won't clash with protocol key. */ #define USB_PROTOCOL_KEY(class, subclass, protocol) \ (1u << 31 | (class & 0xff) << 16 | (subclass & 0xff) << 8 | (protocol & 0xff)) /* bmRequestType values */ #define USB_DIR_OUT 0 /* to device */ #define USB_DIR_IN 0x80 /* to host */ #define USB_TYPE_MASK (0x03 << 5) #define USB_TYPE(type) (((type) & USB_TYPE_MASK) >> 5) #define RQT_SETUP_TYPE_STANDARD 0 #define RQT_SETUP_TYPE_CLASS 1 #define RQT_SETUP_TYPE_VENDOR 2 #define USB_RECIPIENT_MASK 0x1F #define USB_RECIPIENT(type) ((type) & USB_RECIPIENT_MASK) #define RQT_SETUP_RECIPIENT_DEVICE 0 #define RQT_SETUP_RECIPIENT_INTERFACE 1 #define RQT_SETUP_RECIPIENT_ENDPOINT 2 #define RQT_SETUP_RECIPIENT_OTHER 3 /* Endpoint descriptor bmAttributes */ #define ENDPOINT_TYPE(ep_attrib) ((ep_attrib) & 0x03) #define ENDPOINT_TYPE_CONTROL 0 #define ENDPOINT_TYPE_ISOCHRONOUS 1 #define ENDPOINT_TYPE_BULK 2 #define ENDPOINT_TYPE_INTERRUPT 3 #define ENDPOINT_TYPE_NOT_SET 255 #define USB_SETUP_GET_STATUS 0 #define USB_SETUP_CLEAR_FEATURE 1 #define USB_SETUP_SET_FEATURE 3 #define USB_SETUP_SET_ADDRESS 5 #define USB_SETUP_GET_DESCRIPTOR 6 #define USB_SETUP_SET_DESCRIPTOR 7 #define USB_SETUP_GET_CONFIGURATION 8 #define USB_SETUP_SET_CONFIGURATION 9 #define USB_SETUP_GET_INTERFACE 10 #define USB_SETUP_SET_INTERFACE 11 #define USB_SETUP_SYNCH_FRAME 12 #define USB_SETUP_SET_SEL 48 #define USB_SETUP_SET_ISOCH_DELAY 49 /* transfer_flags */ #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ #define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired * slot in the schedule */ #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ #define URB_NO_FSBR 0x0020 /* UHCI-specific */ #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt * needed */ #define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ /* The following flags are used internally by usbcore and HCDs */ #define URB_DIR_IN 0x0200 /* Transfer from device to host */ #define URB_DIR_OUT 0 #define URB_DIR_MASK URB_DIR_IN #define URB_DMA_MAP_SINGLE 0x00010000 /* Non-scatter-gather mapping */ #define URB_DMA_MAP_PAGE 0x00020000 /* HCD-unsupported S-G */ #define URB_DMA_MAP_SG 0x00040000 /* HCD-supported S-G */ #define URB_MAP_LOCAL 0x00080000 /* HCD-local-memory mapping */ #define URB_SETUP_MAP_SINGLE 0x00100000 /* Setup packet DMA mapped */ #define URB_SETUP_MAP_LOCAL 0x00200000 /* HCD-local setup packet */ #define URB_DMA_SG_COMBINED 0x00400000 /* S-G entries were combined */ #define URB_ALIGNED_TEMP_BUFFER 0x00800000 /* Temp buffer was alloc'd */ /* 9.6.6 */ extern const true_false_string tfs_endpoint_direction; extern value_string_ext usb_class_vals_ext; usb_conv_info_t *get_usb_iface_conv_info(packet_info *pinfo, guint8 interface_num); usb_conv_info_t *get_existing_usb_ep_conv_info(packet_info *pinfo, guint16 bus_id, guint16 device_address, int endpoint); proto_item * dissect_usb_descriptor_header(proto_tree *tree, tvbuff_t *tvb, int offset, value_string_ext *type_val_str); void dissect_usb_endpoint_address(proto_tree *tree, tvbuff_t *tvb, int offset); unsigned int sanitize_usb_max_packet_size(guint8 ep_type, usb_speed_t speed, unsigned int max_packet_size); int dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, guint8 *out_ep_type, usb_speed_t speed); int dissect_usb_unknown_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info _U_); int dissect_urb_transfer_flags(tvbuff_t *tvb, int offset, proto_tree* tree, int hf, int endian); struct mausb_header; void dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, usb_header_t header_type, void *extra_data); void usb_lpm_besl_str(gchar *buf, guint32 value); #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usbip.c
/* packet-usbip.c * Routines for USB/IP dissection * Copyright 2016, Christian Lamparter <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * The USB/IP protocol follows a server/client architecture. It runs * on top of TCP/IP. The server exports the USB devices and the * clients imports them. The device driver for the exported USB * device runs on the client machine. * * See * * https://www.kernel.org/doc/Documentation/usb/usbip_protocol.txt */ #include <config.h> #include <epan/packet.h> #include <epan/expert.h> #include <epan/etypes.h> #include <epan/conversation.h> #include "packet-usbip.h" #include "packet-usb.h" #include "packet-tcp.h" void proto_register_usbip(void); void proto_reg_handoff_usbip(void); /* Initialize the protocol and registered fields */ static int proto_usbip = -1; static int hf_usbip_version = -1; static int hf_usbip_operation = -1; static int hf_usbip_command = -1; static int hf_usbip_status = -1; static int hf_usbip_number_devices = -1; static int hf_usbip_path = -1; static int hf_usbip_devid = -1; static int hf_usbip_busid = -1; static int hf_usbip_busnum = -1; static int hf_usbip_devnum = -1; static int hf_usbip_speed = -1; static int hf_usbip_idVendor = -1; static int hf_usbip_idProduct = -1; static int hf_usbip_bcdDevice = -1; static int hf_usbip_bDeviceClass = -1; static int hf_usbip_bDeviceSubClass = -1; static int hf_usbip_bDeviceProtocol = -1; static int hf_usbip_bConfigurationValue = -1; static int hf_usbip_bNumConfigurations = -1; static int hf_usbip_bNumInterfaces = -1; static int hf_usbip_bInterfaceClass = -1; static int hf_usbip_bInterfaceSubClass = -1; static int hf_usbip_bInterfaceProtocol = -1; static int hf_usbip_padding = -1; static int hf_usbip_device = -1; static int hf_usbip_interface = -1; static int hf_usbip_interval = -1; static int hf_usbip_actual_length = -1; static int hf_usbip_error_count = -1; static int hf_usbip_seqnum = -1; static int hf_usbip_cmd_frame = -1; static int hf_usbip_ret_frame = -1; static int hf_usbip_vic_frame = -1; static int hf_usbip_direction = -1; static int hf_usbip_ep = -1; static int hf_usbip_transfer_flags = -1; static int hf_usbip_transfer_buffer_length = -1; static int hf_usbip_start_frame = -1; static int hf_usbip_number_of_packets = -1; static int hf_usbip_setup = -1; static int hf_usbip_urb_data = -1; /* Initialize the subtree pointers */ static gint ett_usbip = -1; static gint ett_usbip_dev = -1; static gint ett_usbip_intf = -1; enum usb_device_speed { USBIP_SPEED_UNKNOWN = 0, /* enumerating */ USBIP_SPEED_LOW, /* usb 1.0 */ USBIP_SPEED_FULL, /* usb 1.1 */ USBIP_SPEED_HIGH, /* usb 2.0 */ USBIP_SPEED_WIRELESS, /* wireless (usb 2.5) */ USBIP_SPEED_SUPER, /* usb 3.0 */ }; #define USBIP_SUPPORTED_VERSION 0x111 #define OP_REQUEST (0x80 << 8) #define OP_REPLY (0x00 << 8) /* ---------------------------------------------------------------------- * Import a remote USB device. */ #define OP_IMPORT 0x03 #define OP_REQ_IMPORT (OP_REQUEST | OP_IMPORT) #define OP_REP_IMPORT (OP_REPLY | OP_IMPORT) /* ---------------------------------------------------------------------- * Retrieve the list of exported USB devices. */ #define OP_DEVLIST 0x05 #define OP_REQ_DEVLIST (OP_REQUEST | OP_DEVLIST) #define OP_REP_DEVLIST (OP_REPLY | OP_DEVLIST) #define OP_CMD_SUBMIT 0x0001 #define OP_CMD_UNLINK 0x0002 #define OP_RET_SUBMIT 0x0003 #define OP_RET_UNLINK 0x0004 static const value_string usbip_operation_vals[] = { {OP_REP_IMPORT, "OP_REP_IMPORT" }, {OP_REP_DEVLIST, "OP_REP_DEVLIST" }, {OP_REQ_IMPORT, "OP_REQ_IMPORT" }, {OP_REQ_DEVLIST, "OP_REQ_DEVLIST" }, {0, NULL } }; static const value_string usbip_urb_vals[] = { {OP_CMD_SUBMIT, "OP_CMD_SUBMIT" }, {OP_CMD_UNLINK, "OP_CMD_UNLINK" }, {OP_RET_SUBMIT, "OP_RET_SUBMIT" }, {OP_RET_UNLINK, "OP_RET_UNLINK" }, {0, NULL } }; static const value_string usbip_speed_vals[] = { {USBIP_SPEED_UNKNOWN, "Speed Unknown" }, {USBIP_SPEED_LOW, "Low Speed" }, {USBIP_SPEED_FULL, "Full Speed" }, {USBIP_SPEED_HIGH, "High Speed" }, {USBIP_SPEED_WIRELESS, "Wireless Speed" }, {USBIP_SPEED_SUPER, "Super Speed" }, {0, NULL } }; static value_string_ext usbip_speed_vals_ext = VALUE_STRING_EXT_INIT(usbip_speed_vals); static value_string_ext usbip_operation_vals_ext = VALUE_STRING_EXT_INIT(usbip_operation_vals); static value_string_ext usbip_urb_vals_ext = VALUE_STRING_EXT_INIT(usbip_urb_vals); extern value_string_ext ext_usb_vendors_vals; extern value_string_ext ext_usb_products_vals; extern value_string_ext linux_negative_errno_vals_ext; static const value_string usb_endpoint_direction_vals[] = { {USBIP_DIR_OUT, "OUT" }, {USBIP_DIR_IN, "IN" }, {0, NULL } }; static expert_field ei_usbip = EI_INIT; typedef struct _usbip_transaction_t { guint32 seqnum; guint32 devid; guint32 ep; guint32 dir; guint32 cmd_frame; guint32 ret_frame; guint32 unlink_seqnum; } usbip_transaction_t; typedef struct _usbip_conv_info_t { /* holds OP_{CMD|RET}_{SUBMIT|UNLINK} */ wmem_tree_t *pdus; } usbip_conv_info_t; static int dissect_device_list_request(packet_info *pinfo) { col_set_str(pinfo->cinfo, COL_INFO, "Device List Request"); return 0; } static int dissect_device(proto_tree *tree, tvbuff_t *tvb, int offset) { guint32 product; guint32 vendor_id; guint32 product_id; /* Device path on host (usually /sys/devices/usb/... */ proto_tree_add_item(tree, hf_usbip_path, tvb, offset, 256, ENC_ASCII | ENC_NA); offset += 256; /* Bus id string - Id of the bus the device is connected to */ proto_tree_add_item(tree, hf_usbip_busid, tvb, offset, 32, ENC_ASCII | ENC_NA); offset += 32; /* bus number */ proto_tree_add_item(tree, hf_usbip_busnum, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* device number */ proto_tree_add_item(tree, hf_usbip_devnum, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* USB Speed */ proto_tree_add_item(tree, hf_usbip_speed, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* idVendor */ proto_tree_add_item_ret_uint(tree, hf_usbip_idVendor, tvb, offset, 2, ENC_BIG_ENDIAN, &vendor_id); offset += 2; /* idProduct */ product_id = tvb_get_ntohs(tvb, offset); product = vendor_id << 16 | product_id; proto_tree_add_uint_format_value(tree, hf_usbip_idProduct, tvb, offset, 2, product_id, "%s (0x%04x)", val_to_str_ext_const(product, &ext_usb_products_vals, "Unknown"), product_id); offset += 2; /* bcdDevice */ proto_tree_add_item(tree, hf_usbip_bcdDevice, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* Device Class */ proto_tree_add_item(tree, hf_usbip_bDeviceClass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Device Sub Class */ proto_tree_add_item(tree, hf_usbip_bDeviceSubClass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Device Protocol */ proto_tree_add_item(tree, hf_usbip_bDeviceProtocol, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Current Configuration */ proto_tree_add_item(tree, hf_usbip_bConfigurationValue, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Number of Configurations */ proto_tree_add_item(tree, hf_usbip_bNumConfigurations, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* Number of Interfaces */ proto_tree_add_item(tree, hf_usbip_bNumInterfaces, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static int dissect_device_list_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *ti_intf; proto_item *ti_dev; proto_tree *intf_tree = NULL; proto_tree *dev_tree = NULL; guint32 num_of_devs; guint32 i; guint8 num_of_intf; guint8 j; col_set_str(pinfo->cinfo, COL_INFO, "Device List Response"); proto_tree_add_item_ret_uint(tree, hf_usbip_number_devices, tvb, offset, 4, ENC_BIG_ENDIAN, &num_of_devs); offset += 4; for (i = 0; i < num_of_devs; i++) { num_of_intf = tvb_get_guint8(tvb, offset + 0x137); ti_dev = proto_tree_add_uint(tree, hf_usbip_device, tvb, offset, 0x138 + 4 * num_of_intf, i + 1); proto_item_set_generated(ti_dev); dev_tree = proto_item_add_subtree(ti_dev, ett_usbip_dev); offset = dissect_device(dev_tree, tvb, offset); for (j = 0; j < num_of_intf; j++) { ti_intf = proto_tree_add_uint(dev_tree, hf_usbip_interface, tvb, offset, 3, j + 1); intf_tree = proto_item_add_subtree(ti_intf, ett_usbip_intf); proto_tree_add_item(intf_tree, hf_usbip_bInterfaceClass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(intf_tree, hf_usbip_bInterfaceSubClass, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(intf_tree, hf_usbip_bInterfaceProtocol, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(intf_tree, hf_usbip_padding, tvb, offset, 1, ENC_NA); offset += 1; } } return offset; } static int dissect_import_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { col_set_str(pinfo->cinfo, COL_INFO, "Import Request"); proto_tree_add_item(tree, hf_usbip_busid, tvb, offset, 32, ENC_ASCII | ENC_NA); return offset + 32; } static int dissect_import_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32 status) { col_set_str(pinfo->cinfo, COL_INFO, "Import Response"); if (status == 0) offset = dissect_device(tree, tvb, offset); return offset; } static int dissect_cmd_submit(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { col_set_str(pinfo->cinfo, COL_INFO, "URB Submit"); dissect_urb_transfer_flags(tvb, offset, tree, hf_usbip_transfer_flags, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_transfer_buffer_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_start_frame, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_number_of_packets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_interval, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_setup, tvb, offset, 8, ENC_NA); offset += 8; return offset; } static int dissect_ret_submit(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { col_set_str(pinfo->cinfo, COL_INFO, "URB Response"); proto_tree_add_item(tree, hf_usbip_status, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_actual_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_start_frame, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_number_of_packets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_error_count, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_setup, tvb, offset, 8, ENC_NA); offset += 8; return offset; } static int dissect_cmd_unlink(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usbip_conv_info_t *usbip_info, usbip_transaction_t *trans) { usbip_transaction_t *victim; guint32 seqnum; col_set_str(pinfo->cinfo, COL_INFO, "URB Unlink"); proto_tree_add_item_ret_uint(tree, hf_usbip_seqnum, tvb, offset, 4, ENC_BIG_ENDIAN, &seqnum); trans->unlink_seqnum = seqnum; offset += 4; victim = (usbip_transaction_t *) wmem_tree_lookup32(usbip_info->pdus, seqnum); if (victim) { proto_item *ti; ti = proto_tree_add_uint(tree, hf_usbip_vic_frame, NULL, 0, 0, victim->cmd_frame); proto_item_set_generated(ti); } return offset; } static int dissect_ret_unlink(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, usbip_conv_info_t *usbip_info, guint32 seqnum) { usbip_transaction_t *victim; col_set_str(pinfo->cinfo, COL_INFO, "URB Unlink Response"); victim = (usbip_transaction_t *) wmem_tree_lookup32(usbip_info->pdus, seqnum); if (victim) { proto_item *ti; victim->ret_frame = pinfo->num; ti = proto_tree_add_uint(tree, hf_usbip_vic_frame, NULL, 0, 0, victim->cmd_frame); proto_item_set_generated(ti); } proto_tree_add_item(tree, hf_usbip_status, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } static usbip_conv_info_t * usbip_get_usbip_conv(packet_info *pinfo) { conversation_t *conversation; usbip_conv_info_t *usbip_info; conversation = find_or_create_conversation(pinfo); usbip_info = (usbip_conv_info_t *) conversation_get_proto_data(conversation, proto_usbip); if (!usbip_info) { usbip_info = wmem_new(wmem_file_scope(), usbip_conv_info_t); usbip_info->pdus = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(conversation, proto_usbip, usbip_info); } return usbip_info; } static int usbip_dissect_op(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int offset) { proto_item *ti = NULL; guint32 operation; gint32 status; proto_tree_add_item(tree, hf_usbip_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item_ret_uint(tree, hf_usbip_operation, tvb, offset, 2, ENC_BIG_ENDIAN, &operation); offset += 2; proto_tree_add_item_ret_int(tree, hf_usbip_status, tvb, offset, 4, ENC_BIG_ENDIAN, &status); offset += 4; switch (operation) { case OP_REQ_IMPORT: offset = dissect_import_request(pinfo, tree, tvb, offset); break; case OP_REP_IMPORT: offset = dissect_import_response(pinfo, tree, tvb, offset, status); break; case OP_REQ_DEVLIST: offset = dissect_device_list_request(pinfo); break; case OP_REP_DEVLIST: offset = dissect_device_list_response(pinfo, tree, tvb, offset); break; default: proto_tree_add_item(tree, hf_usbip_urb_data, tvb, offset, -1, ENC_NA); offset = tvb_reported_length_remaining(tvb, offset); expert_add_info_format( pinfo, ti, &ei_usbip, "Dissector for USBIP Operation" " (%x) code not implemented, Contact" " Wireshark developers if you want this supported", operation); proto_item_append_text(ti, ": Undecoded"); break; } return offset; } static int usbip_dissect_urb(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, proto_tree *orig, int offset, usbip_conv_info_t *usbip_info) { proto_item *ti = NULL; usbip_transaction_t *usbip_trans; guint32 command; guint32 devid; guint32 seqnum; guint32 dir; guint32 ep; struct usbip_header header; proto_tree_add_item_ret_uint(tree, hf_usbip_command, tvb, offset, 4, ENC_BIG_ENDIAN, &command); offset += 4; proto_tree_add_item_ret_uint(tree, hf_usbip_seqnum, tvb, offset, 4, ENC_BIG_ENDIAN, &seqnum); offset += 4; dir = tvb_get_ntohl(tvb, offset + 4); ep = tvb_get_ntohl(tvb, offset + 8); devid = tvb_get_ntohl(tvb, offset); if (!PINFO_FD_VISITED(pinfo)) { if (command == OP_CMD_SUBMIT || command == OP_CMD_UNLINK) { usbip_trans = wmem_new(wmem_file_scope(), usbip_transaction_t); usbip_trans->devid = devid; usbip_trans->dir = dir; usbip_trans->ep = ep; usbip_trans->seqnum = seqnum; usbip_trans->cmd_frame = pinfo->num; usbip_trans->ret_frame = 0; usbip_trans->unlink_seqnum = 0; wmem_tree_insert32(usbip_info->pdus, seqnum, (void *) usbip_trans); } else { usbip_trans = (usbip_transaction_t *) wmem_tree_lookup32(usbip_info->pdus, seqnum); if (usbip_trans) usbip_trans->ret_frame = pinfo->num; } } else { usbip_trans = (usbip_transaction_t *) wmem_tree_lookup32(usbip_info->pdus, seqnum); } if (!usbip_trans) { usbip_trans = wmem_new(pinfo->pool, usbip_transaction_t); usbip_trans->cmd_frame = 0; usbip_trans->ret_frame = 0; usbip_trans->devid = 0; usbip_trans->unlink_seqnum = 0; usbip_trans->seqnum = seqnum; } /* only the OP_CMD_SUBMIT has a valid devid - in all other case we have to restore it from the transaction */ if (command == OP_RET_SUBMIT || command == OP_RET_UNLINK) { devid = usbip_trans->devid; ep = usbip_trans->ep; dir = usbip_trans->dir; } ti = proto_tree_add_uint(tree, hf_usbip_cmd_frame, NULL, 0, 0, usbip_trans->cmd_frame); proto_item_set_generated(ti); ti = proto_tree_add_uint(tree, hf_usbip_ret_frame, NULL, 0, 0, usbip_trans->ret_frame); proto_item_set_generated(ti); ti = proto_tree_add_uint(tree, hf_usbip_devid, NULL, 0, 0, devid); proto_item_set_generated(ti); ti = proto_tree_add_uint(tree, hf_usbip_direction, NULL, 0, 0, dir); proto_item_set_generated(ti); ti = proto_tree_add_uint(tree, hf_usbip_ep, NULL, 0, 0, ep); proto_item_set_generated(ti); proto_tree_add_item(tree, hf_usbip_devid, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_direction, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_usbip_ep, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; header.ep = ep; header.dir = dir; header.devid = devid & 0x00ff; header.busid = devid >> 16; switch (command) { case OP_CMD_SUBMIT: offset = dissect_cmd_submit(pinfo, tree, tvb, offset); dissect_usb_common(tvb, pinfo, orig, USB_HEADER_USBIP, &header); break; case OP_CMD_UNLINK: offset = dissect_cmd_unlink(pinfo, tree, tvb, offset, usbip_info, usbip_trans); break; case OP_RET_SUBMIT: { guint32 status; status = tvb_get_ntohl(tvb, offset); offset = dissect_ret_submit(pinfo, tree, tvb, offset); if (status == 0) dissect_usb_common(tvb, pinfo, orig, USB_HEADER_USBIP, &header); break; } case OP_RET_UNLINK: offset = dissect_ret_unlink(pinfo, tree, tvb, offset, usbip_info, usbip_trans->unlink_seqnum); break; default: proto_tree_add_item(tree, hf_usbip_urb_data, tvb, offset, -1, ENC_NA); offset = tvb_reported_length_remaining(tvb, offset); expert_add_info_format( pinfo, ti, &ei_usbip, "Dissector for USBIP Command" " (%x) code not implemented, Contact" " Wireshark developers if you want this supported", command); proto_item_append_text(ti, ": Undecoded"); break; } return offset; } static int dissect_usbip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint16 version; int offset = 0; proto_item *ti = NULL; proto_tree *usbip_tree = NULL; usbip_conv_info_t *usbip_info; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBIP"); col_clear(pinfo->cinfo, COL_INFO); usbip_info = usbip_get_usbip_conv(pinfo); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_usbip, tvb, 0, -1, ENC_NA); usbip_tree = proto_item_add_subtree(ti, ett_usbip); /* Get some values from the packet header */ version = tvb_get_ntohs(tvb, 0); /* check if this is a operation code by checking the version. */ if (version == USBIP_SUPPORTED_VERSION) { offset = usbip_dissect_op(pinfo, tvb, usbip_tree, offset); } else if (version == 0x0000) { offset = usbip_dissect_urb(pinfo, tvb, usbip_tree, tree, offset, usbip_info); } else { proto_tree_add_item(usbip_tree, hf_usbip_urb_data, tvb, offset, -1, ENC_NA); offset = tvb_reported_length_remaining(tvb, offset); expert_add_info_format( pinfo, ti, &ei_usbip, "Dissector for USBIP Version" " (%d.%d) not implemented, Contact" " Wireshark developers if you want this supported", version >> 8, version & 0xff); proto_item_append_text(ti, ": Undecoded"); } return offset; } #define FRAME_HEADER_LEN 8 static unsigned int get_usbip_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint16 version; /* Get some values from the packet header */ version = tvb_get_ntohs(tvb, offset); /* The USBIP's is split in two parts. * There's an userspace portion which consists of the usbipd daemon * and usbip tool. * The kernel part is done by two modules usbip-host.ko and vhci-hcd.ko (client). * * The userspace programs are generating and parsing the OP_REQ_* and OP_REP_* * data packets. They have all have a proper protocol version field. But data * can be split up in multiple packages, so reassembly is required. There's no * session id or sequence number to track packages. * * The kernel modules are handling the OP_CMD_* and OP_RET_* data packets. * There's no protocol version (The version is simply always 0x0000, because * the OP_CMD|RET are 4-Bytes long, whereas OP_REQ/OP_REP are only 2-Bytes). * data frames can be split into multiple packages. But it also can happen that * multiple data frames are aggregated into a single package. The OP_CMD_* and * OP_RET_* frames have a 4-Byte sequence number to track individual URBs. The * sequence counter will wrap around eventually. */ if (version == USBIP_SUPPORTED_VERSION) { guint16 op = tvb_get_ntohs(tvb, offset + 2); switch (op) { case OP_REQ_IMPORT: return 40; case OP_REP_IMPORT: if (tvb_get_ntohl(tvb, offset + 4) == 0) { /* Status: OK */ return 0x140; } else { /* Status: Error */ return 0x8; } case OP_REQ_DEVLIST: return 8; case OP_REP_DEVLIST: { unsigned int expected_size = 0xc; unsigned int num_of_devs; unsigned int i; if (tvb_captured_length(tvb) < 0xc) { /* not enough segments to calculate the size */ return 0x0; } offset += 8; num_of_devs = tvb_get_ntohl(tvb, offset); offset += 4; if (num_of_devs == 0) return expected_size; if (tvb_captured_length_remaining(tvb, offset) < (gint) (0x138 * num_of_devs)) return 0; for (i = 0; i < num_of_devs; i++) { guint8 num_of_intf = tvb_get_guint8(tvb, offset + 0x137); int skip = num_of_intf * 4; expected_size += 0x138 + skip; offset += 0x138 + skip; } return expected_size; } } } else if (version == 0x0000) { guint32 cmd = tvb_get_ntohl(tvb, offset); if (tvb_captured_length_remaining(tvb, offset) < USBIP_HEADER_LEN) return 0; switch (cmd) { case OP_RET_UNLINK: return USBIP_HEADER_LEN; case OP_CMD_UNLINK: return USBIP_HEADER_LEN; case OP_CMD_SUBMIT: { int expected_size = USBIP_HEADER_LEN; int actual_length = tvb_get_ntohl(tvb, offset + 0x18); int dir = tvb_get_ntohl(tvb, offset + 0xc); int n_iso = tvb_get_ntohl(tvb, offset + 0x20); if (dir == USBIP_DIR_OUT) expected_size += actual_length; if (n_iso > 0) expected_size += n_iso * 4 * 4; return expected_size; } case OP_RET_SUBMIT: { int expected_size = USBIP_HEADER_LEN; int actual_length = tvb_get_ntohl(tvb, offset + 0x18); int n_iso = tvb_get_ntohl(tvb, offset + 0x20); usbip_transaction_t *usbip_trans = NULL; usbip_conv_info_t *usbip_info = usbip_get_usbip_conv(pinfo); guint32 status = tvb_get_ntohl(tvb, offset + 0x14); if (usbip_info) { usbip_trans = (usbip_transaction_t *) wmem_tree_lookup32( usbip_info->pdus, tvb_get_ntohl(tvb, offset + 4)); if (usbip_trans && usbip_trans->dir == USBIP_DIR_IN && status == 0) expected_size += actual_length; } if (status == 0) { if (n_iso >= 0) expected_size += n_iso * 4 * 4; } else expected_size = tvb_captured_length(tvb); return expected_size; } } } return tvb_captured_length(tvb); } static int dissect_usbip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { tcp_dissect_pdus(tvb, pinfo, tree, TRUE, FRAME_HEADER_LEN, get_usbip_message_len, dissect_usbip_common, data); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_usbip(void) { /* Setup list of header fields */ static hf_register_info hf[] = { {&hf_usbip_version, {"Version", "usbip.version", FT_UINT16, BASE_HEX, NULL, 0x0, "Version of the protocol", HFILL}}, {&hf_usbip_operation, {"Operation", "usbip.operation", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &usbip_operation_vals_ext, 0x0, "USBIP Operation", HFILL}}, {&hf_usbip_command, {"Command", "usbip.urb", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &usbip_urb_vals_ext, 0x0, "USBIP URB Transaction", HFILL}}, {&hf_usbip_status, {"Status", "usbip.status", FT_INT32, BASE_DEC | BASE_EXT_STRING, &linux_negative_errno_vals_ext, 0, "USBIP Status", HFILL}}, {&hf_usbip_number_devices, {"Number of exported Devices", "usbip.number_of_devices", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_path, {"System Path", "usbip.system_path", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_devid, {"Devid", "usbip.devid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_busid, {"Busid", "usbip.busid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_busnum, {"Bus number", "usbip.bus_num", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_devnum, {"Device Number", "usbip.dev_num", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_speed, {"Connected Speed", "usbip.speed", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &usbip_speed_vals_ext, 0, NULL, HFILL}}, {&hf_usbip_idVendor, {"idVendor", "usbip.idVendor", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &ext_usb_vendors_vals, 0x0, NULL, HFILL}}, {&hf_usbip_idProduct, {"idProduct", "usbip.idProduct", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_bcdDevice, {"bcdDevice", "usbip.bcdDevice", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_bDeviceClass, {"bDeviceClass", "usbip.bDeviceClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_class_vals_ext, 0x0, NULL, HFILL}}, {&hf_usbip_bDeviceSubClass, {"bDeviceSubClass", "usbip.bDeviceSubClass", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_bDeviceProtocol, {"bDeviceProtocol", "usbip.bDeviceProtocol", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_bConfigurationValue, {"bConfigurationValue", "usbip.bConfigurationValue", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_bNumConfigurations, {"bNumConfigurations", "usbip.bNumConfigurations", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_bNumInterfaces, {"bNumInterfaces", "usbip.bNumInterfaces", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_bInterfaceClass, {"bInterfaceClass", "usbip.bInterfaceClass", FT_UINT8, BASE_HEX | BASE_EXT_STRING, &usb_class_vals_ext, 0x0, NULL, HFILL}}, {&hf_usbip_bInterfaceSubClass, {"bInterfaceSubClass", "usbip.bInterfaceSubClass", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_bInterfaceProtocol, {"bInterfaceProtocol", "usbip.bInterfaceProtocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_usbip_padding, {"Padding", "usbip.padding", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_device, {"Device", "usbip.device", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_interface, {"Interface", "usbip.interface", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_interval, {"Interval", "usbip.interval", FT_UINT32, BASE_DEC, NULL, 0, "maximum time for the request on the server-side host controller", HFILL}}, {&hf_usbip_actual_length, {"Actual length", "usbip.actual_length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_error_count, {"ISO error count", "usbip.iso.error_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_seqnum, {"Sequence", "usbip.sequence_no", FT_UINT32, BASE_DEC, NULL, 0, "Sequence number", HFILL}}, {&hf_usbip_cmd_frame, {"Command frame", "usbip.cmd_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_ret_frame, {"Return frame", "usbip.ret_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_vic_frame, {"Victim frame", "usbip.vic_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "Frame which was forcefully cancelled", HFILL}}, {&hf_usbip_direction, {"Direction", "usbip.endpoint_number.direction", FT_UINT32, BASE_HEX, VALS(usb_endpoint_direction_vals), 0x00000001, "USB endpoint direction", HFILL}}, {&hf_usbip_ep, {"Endpoint", "usbip.endpoint_number", FT_UINT32, BASE_HEX, NULL, 0x0000000f, "USB endpoint number", HFILL}}, {&hf_usbip_transfer_flags, {"Transfer flags", "usbip.transfer_flags", FT_UINT32, BASE_HEX, NULL, 0x0, "USBIP Transferflag", HFILL}}, {&hf_usbip_transfer_buffer_length, {"Transfer buffer length [bytes]", "usbip.transfer_buffer_length", FT_UINT32, BASE_DEC, NULL, 0, "Data length in bytes", HFILL}}, {&hf_usbip_start_frame, {"ISO Start frame", "usbip.iso.start_frame", FT_INT32, BASE_DEC, NULL, 0, "For an ISO frame the actually selected frame to transmit", HFILL}}, {&hf_usbip_number_of_packets, {"Number of ISO descriptors", "usbip.iso.num_of_packets", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_usbip_setup, {"Setup Data", "usbip.setup", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}}, {&hf_usbip_urb_data, {"Data", "usbip.data", FT_BYTES, BASE_NONE, NULL, 0, "Raw Data", HFILL}}, }; static gint *ett[] = { &ett_usbip, &ett_usbip_dev, &ett_usbip_intf, }; static ei_register_info ei[] = { {&ei_usbip, { "usbip.unsupported_version", PI_MALFORMED, PI_ERROR, "Unsupported element", EXPFILL}}, }; expert_module_t *expert_usbip; proto_usbip = proto_register_protocol("USBIP Protocol", "USBIP", "usbip"); proto_register_field_array(proto_usbip, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_usbip = expert_register_protocol(proto_usbip); expert_register_field_array(expert_usbip, ei, array_length(ei)); } void proto_reg_handoff_usbip(void) { dissector_handle_t usbip_handle; usbip_handle = create_dissector_handle(dissect_usbip, proto_usbip); dissector_add_for_decode_as_with_preference("tcp.port", usbip_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-usbip.h
/* packet-usbip.h * Definitions for USBIP dissection * Copyright 2016, Christian Lamparter <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_USBIP_H__ #define __PACKET_USBIP_H__ #define USBIP_HEADER_WITH_SETUP_LEN 0x28 #define USBIP_HEADER_LEN 0x30 #define USBIP_DIR_OUT 0x00 #define USBIP_DIR_IN 0x01 struct usbip_header { guint8 devid; guint8 busid; guint32 ep; guint32 dir; }; #endif /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usbll.c
/* packet-usbll.c * * 2019 Tomasz Mon <[email protected]> * * USB link layer dissector * * This code is separated from packet-usb.c on purpose. * It is important to note that packet-usb.c operates on the USB URB level. * The idea behind this file is to transform low level link layer data * (captured by hardware sniffers) into structures that resemble URB and pass * such URB to the URB common dissection code. * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/crc16-tvb.h> #include <wsutil/crc5.h> #include <epan/address_types.h> #include <epan/to_str.h> #include <epan/proto_data.h> #include <epan/reassemble.h> #include <wiretap/wtap.h> #include "packet-usb.h" void proto_register_usbll(void); void proto_reg_handoff_usbll(void); static int proto_usbll = -1; /* Fields defined by USB 2.0 standard */ static int hf_usbll_pid = -1; static int hf_usbll_device_addr = -1; static int hf_usbll_endp = -1; static int hf_usbll_crc5 = -1; static int hf_usbll_crc5_status = -1; static int hf_usbll_data = -1; static int hf_usbll_data_crc = -1; static int hf_usbll_data_crc_status = -1; static int hf_usbll_sof_framenum = -1; static int hf_usbll_split_hub_addr = -1; static int hf_usbll_split_sc = -1; static int hf_usbll_split_port = -1; static int hf_usbll_split_s = -1; static int hf_usbll_split_e = -1; static int hf_usbll_split_u = -1; static int hf_usbll_split_iso_se = -1; static int hf_usbll_split_et = -1; static int hf_usbll_split_crc5 = -1; static int hf_usbll_split_crc5_status = -1; static int hf_usbll_src = -1; static int hf_usbll_dst = -1; static int hf_usbll_addr = -1; static int hf_usbll_transfer_fragments = -1; static int hf_usbll_transfer_fragment = -1; static int hf_usbll_transfer_fragment_overlap = -1; static int hf_usbll_transfer_fragment_overlap_conflicts = -1; static int hf_usbll_transfer_fragment_multiple_tails = -1; static int hf_usbll_transfer_fragment_too_long_fragment = -1; static int hf_usbll_transfer_fragment_error = -1; static int hf_usbll_transfer_fragment_count = -1; static int hf_usbll_transfer_reassembled_in = -1; static int hf_usbll_transfer_reassembled_length = -1; /* Fields defined by USB 2.0 ECN: Link Power Management (LPM) and * USB 2.0 ECN Errata for Link Power Management 9/28/2011 */ static int hf_usbll_subpid = -1; static int hf_usbll_lpm_link_state = -1; static int hf_usbll_lpm_besl = -1; static int hf_usbll_lpm_remote_wake = -1; static int hf_usbll_lpm_reserved = -1; static int ett_usbll = -1; static int ett_usbll_transfer_fragment = -1; static int ett_usbll_transfer_fragments = -1; static const fragment_items usbll_frag_items = { /* Fragment subtrees */ &ett_usbll_transfer_fragment, &ett_usbll_transfer_fragments, /* Fragment Fields */ &hf_usbll_transfer_fragments, &hf_usbll_transfer_fragment, &hf_usbll_transfer_fragment_overlap, &hf_usbll_transfer_fragment_overlap_conflicts, &hf_usbll_transfer_fragment_multiple_tails, &hf_usbll_transfer_fragment_too_long_fragment, &hf_usbll_transfer_fragment_error, &hf_usbll_transfer_fragment_count, /* Reassembled in field */ &hf_usbll_transfer_reassembled_in, /* Reassembled length field */ &hf_usbll_transfer_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "USB transfer fragments" }; static expert_field ei_invalid_pid = EI_INIT; static expert_field ei_invalid_subpid = EI_INIT; static expert_field ei_conflicting_subpid = EI_INIT; static expert_field ei_undecoded = EI_INIT; static expert_field ei_wrong_crc5 = EI_INIT; static expert_field ei_wrong_split_crc5 = EI_INIT; static expert_field ei_wrong_crc16 = EI_INIT; static expert_field ei_invalid_s = EI_INIT; static expert_field ei_invalid_e_u = EI_INIT; static expert_field ei_invalid_pid_sequence = EI_INIT; static expert_field ei_invalid_setup_data = EI_INIT; static int usbll_address_type = -1; static reassembly_table usbll_reassembly_table; static wmem_map_t *transfer_info; static const enum_val_t dissect_unknown_speed_as[] = { { "unk", "Unknown", USB_SPEED_UNKNOWN }, { "low", "Low-Speed", USB_SPEED_LOW }, { "full", "Full-Speed", USB_SPEED_FULL }, { "high", "High-Speed", USB_SPEED_HIGH }, { NULL, NULL, 0 } }; static gint global_dissect_unknown_speed_as = USB_SPEED_UNKNOWN; /* USB packet ID is 4-bit. It is send in octet alongside complemented form. * The list of PIDs is available in Universal Serial Bus Specification Revision 2.0, * Table 8-1. PID Types * Packets here are sorted by the complemented form (high nibble). */ #define USB_PID_DATA_MDATA 0x0F #define USB_PID_HANDSHAKE_STALL 0x1E #define USB_PID_TOKEN_SETUP 0x2D #define USB_PID_SPECIAL_PRE_OR_ERR 0x3C #define USB_PID_DATA_DATA1 0x4B #define USB_PID_HANDSHAKE_NAK 0x5A #define USB_PID_TOKEN_IN 0x69 #define USB_PID_SPECIAL_SPLIT 0x78 #define USB_PID_DATA_DATA2 0x87 #define USB_PID_HANDSHAKE_NYET 0x96 #define USB_PID_TOKEN_SOF 0xA5 #define USB_PID_SPECIAL_PING 0xB4 #define USB_PID_DATA_DATA0 0xC3 #define USB_PID_HANDSHAKE_ACK 0xD2 #define USB_PID_TOKEN_OUT 0xE1 #define USB_PID_SPECIAL_EXT 0xF0 static const value_string usb_packetid_vals[] = { {USB_PID_DATA_MDATA, "MDATA"}, {USB_PID_HANDSHAKE_STALL, "STALL"}, {USB_PID_TOKEN_SETUP, "SETUP"}, {USB_PID_SPECIAL_PRE_OR_ERR, "PRE/ERR"}, {USB_PID_DATA_DATA1, "DATA1"}, {USB_PID_HANDSHAKE_NAK, "NAK"}, {USB_PID_TOKEN_IN, "IN"}, {USB_PID_SPECIAL_SPLIT, "SPLIT"}, {USB_PID_DATA_DATA2, "DATA2"}, {USB_PID_HANDSHAKE_NYET, "NYET"}, {USB_PID_TOKEN_SOF, "SOF"}, {USB_PID_SPECIAL_PING, "PING"}, {USB_PID_DATA_DATA0, "DATA0"}, {USB_PID_HANDSHAKE_ACK, "ACK"}, {USB_PID_TOKEN_OUT, "OUT"}, {USB_PID_SPECIAL_EXT, "EXT"}, {0, NULL} }; static value_string_ext usb_packetid_vals_ext = VALUE_STRING_EXT_INIT(usb_packetid_vals); /* EXT PID and SubPIDs are defined in USB 2.0 ECN: Link Power Management (LPM) * Currently only LPM SubPID is defined, all other are reserved. The reserved * PIDs are either conflicting with USB 2.0 Token PIDs (and can not be reused * as SubPID in order to maintain backwards compatibility) or not yet defined * (reserved for future use, because old devices will simply reject them). */ #define USB_SUBPID_RESERVED_MDATA 0x0F #define USB_SUBPID_RESERVED_STALL 0x1E #define USB_SUBPID_CONFLICT_SETUP 0x2D #define USB_SUBPID_CONFLICT_PRE 0x3C #define USB_SUBPID_RESERVED_DATA1 0x4B #define USB_SUBPID_RESERVED_NAK 0x5A #define USB_SUBPID_CONFLICT_IN 0x69 #define USB_SUBPID_CONFLICT_SPLIT 0x78 #define USB_SUBPID_RESERVED_DATA2 0x87 #define USB_SUBPID_RESERVED_NYET 0x96 #define USB_SUBPID_CONFLICT_SOF 0xA5 #define USB_SUBPID_CONFLICT_PING 0xB4 #define USB_SUBPID_LPM 0xC3 #define USB_SUBPID_RESERVED_ACK 0xD2 #define USB_SUBPID_CONFLICT_OUT 0xE1 #define USB_SUBPID_RESERVED_EXT 0xF0 static const value_string usb_subpid_vals[] = { {USB_SUBPID_RESERVED_MDATA, "Reserved (MDATA)"}, {USB_SUBPID_RESERVED_STALL, "Reserved (STALL)"}, {USB_SUBPID_CONFLICT_SETUP, "Reserved (conflict with SETUP)"}, {USB_SUBPID_CONFLICT_PRE, "Reserved (conflict with PRE)"}, {USB_SUBPID_RESERVED_DATA1, "Reserved (DATA1)"}, {USB_SUBPID_RESERVED_NAK, "Reserved (NAK)"}, {USB_SUBPID_CONFLICT_IN, "Reserved (conflict with IN)"}, {USB_SUBPID_CONFLICT_SPLIT, "Reserved (conflict with SPLIT)"}, {USB_SUBPID_RESERVED_DATA2, "Reserved (DATA2)"}, {USB_SUBPID_RESERVED_NYET, "Reserved (NYET)"}, {USB_SUBPID_CONFLICT_SOF, "Reserved (conflict with SOF)"}, {USB_SUBPID_CONFLICT_PING, "Reserved (conflict with PING)"}, {USB_SUBPID_LPM, "LPM"}, {USB_SUBPID_RESERVED_ACK, "Reserved (ACK)"}, {USB_SUBPID_CONFLICT_OUT, "Reserved (conflict with OUT)"}, {USB_SUBPID_RESERVED_EXT, "Reserved (EXT)"}, {0, NULL} }; static value_string_ext usb_subpid_vals_ext = VALUE_STRING_EXT_INIT(usb_subpid_vals); static void lpm_link_state_str(gchar *buf, guint32 value) { if (value == 0x01) { snprintf(buf, ITEM_LABEL_LENGTH, "L1 (Sleep)"); } else { snprintf(buf, ITEM_LABEL_LENGTH, "Reserved for future use"); } } static guint besl_to_us(guint8 besl) { unsigned int us; if (besl == 0) { us = 125; } else if (besl == 1) { us = 150; } else if (besl <= 5) { us = 100 * besl; } else { us = 1000 * (besl - 5); } return us; } void usb_lpm_besl_str(gchar *buf, guint32 value) { snprintf(buf, ITEM_LABEL_LENGTH, "%d us (%d)", besl_to_us(value), value); } static const value_string usb_lpm_remote_wake_vals[] = { {0, "Disable"}, {1, "Enable"}, {0, NULL}, }; static const value_string usb_start_complete_vals[] = { {0, "Start"}, {1, "Complete"}, {0, NULL} }; static const value_string usb_split_speed_vals[] = { {0, "Full"}, {1, "Low"}, {0, NULL} }; static const value_string usb_split_iso_se_vals[] = { {0, "High-speed data is the middle of the fullspeed data payload"}, {1, "High-speed data is the beginning of the full-speed data payload"}, {2, "High-speed data is the end of the full-speed data payload"}, {3, "High-speed data is all of the full-speed data payload"}, {0, NULL} }; #define USB_EP_TYPE_CONTROL 0 #define USB_EP_TYPE_ISOCHRONOUS 1 #define USB_EP_TYPE_BULK 2 #define USB_EP_TYPE_INTERRUPT 3 static const value_string usb_endpoint_type_vals[] = { {USB_EP_TYPE_CONTROL, "Control"}, {USB_EP_TYPE_ISOCHRONOUS, "Isochronous"}, {USB_EP_TYPE_BULK, "Bulk"}, {USB_EP_TYPE_INTERRUPT, "Interrupt"}, {0, NULL} }; /* Macros for Token Packets. */ #define TOKEN_BITS_GET_ADDRESS(bits) (bits & 0x007F) #define TOKEN_BITS_GET_ENDPOINT(bits) ((bits & 0x0780) >> 7) /* Macros for Split Packets. */ #define SPLIT_BITS_GET_HUB_ADDRESS(bits) (guint8)(bits & 0x007F) #define SPLIT_BITS_GET_HUB_PORT(bits) (guint8)((bits & 0x7F00) >> 8) #define SPLIT_BITS_GET_ENDPOINT_TYPE(bits) ((bits & 0x060000) >> 17) #define SPLIT_BIT_SPEED 0x8000 #define SPLIT_BIT_E_U 0x10000 #define SPLIT_BIT_START_COMPLETE 0x0080 /* Bitmasks definitions for usbll_address_t flags * and 'flags' parameter of usbll_set_address function. */ #define USBLL_ADDRESS_STANDARD 0 #define USBLL_ADDRESS_HOST 0x01 #define USBLL_ADDRESS_HUB_PORT 0x02 #define USBLL_ADDRESS_BROADCAST 0x04 #define USBLL_ADDRESS_HOST_TO_DEV 0 #define USBLL_ADDRESS_DEV_TO_HOST 0x08 #define USBLL_ADDRESS_IS_DEV_TO_HOST(flags) \ (flags & USBLL_ADDRESS_DEV_TO_HOST) #define USBLL_ADDRESS_IS_HOST_TO_DEV(flags) \ (!USBLL_ADDRESS_IS_DEV_TO_HOST(flags)) typedef enum usbll_state { STATE_IDLE, /* No transaction, e.g. after SOF */ STATE_INVALID, /* Invalid PID sequence, e.g. ACK without transaction */ STATE_IN, STATE_IN_DATA0, STATE_IN_DATA1, STATE_IN_HS_ISOCHRONOUS_DATA2, STATE_IN_ACK, STATE_IN_NAK, STATE_IN_STALL, STATE_OUT, STATE_OUT_DATA0, STATE_OUT_DATA1, STATE_OUT_HS_ISOCHRONOUS_DATA2, STATE_OUT_HS_ISOCHRONOUS_MDATA, STATE_OUT_ACK, STATE_OUT_NAK, STATE_OUT_STALL, STATE_OUT_NYET, STATE_PING, STATE_PING_ACK, STATE_PING_NAK, STATE_PING_STALL, STATE_SETUP, STATE_SETUP_DATA0, STATE_SETUP_ACK, /* LS/FS Control transactions via HS hub */ STATE_SSPLIT_CONTROL, STATE_SSPLIT_CONTROL_SETUP, STATE_SSPLIT_CONTROL_SETUP_DATA0, STATE_SSPLIT_CONTROL_SETUP_ACK, STATE_SSPLIT_CONTROL_SETUP_NAK, STATE_SSPLIT_CONTROL_OUT, STATE_SSPLIT_CONTROL_OUT_DATA0, STATE_SSPLIT_CONTROL_OUT_DATA1, STATE_SSPLIT_CONTROL_OUT_ACK, STATE_SSPLIT_CONTROL_OUT_NAK, STATE_SSPLIT_CONTROL_IN, STATE_SSPLIT_CONTROL_IN_ACK, STATE_SSPLIT_CONTROL_IN_NAK, STATE_CSPLIT_CONTROL, STATE_CSPLIT_CONTROL_SETUP, STATE_CSPLIT_CONTROL_SETUP_ACK, STATE_CSPLIT_CONTROL_SETUP_NYET, STATE_CSPLIT_CONTROL_OUT, STATE_CSPLIT_CONTROL_OUT_ACK, STATE_CSPLIT_CONTROL_OUT_NAK, STATE_CSPLIT_CONTROL_OUT_STALL, STATE_CSPLIT_CONTROL_OUT_NYET, STATE_CSPLIT_CONTROL_IN, STATE_CSPLIT_CONTROL_IN_DATA0, STATE_CSPLIT_CONTROL_IN_DATA1, STATE_CSPLIT_CONTROL_IN_NAK, STATE_CSPLIT_CONTROL_IN_STALL, STATE_CSPLIT_CONTROL_IN_NYET, /* LS/FS Bulk transactions via HS hub */ STATE_SSPLIT_BULK, STATE_SSPLIT_BULK_OUT, STATE_SSPLIT_BULK_OUT_DATA0, STATE_SSPLIT_BULK_OUT_DATA1, STATE_SSPLIT_BULK_OUT_ACK, STATE_SSPLIT_BULK_OUT_NAK, STATE_SSPLIT_BULK_IN, STATE_SSPLIT_BULK_IN_ACK, STATE_SSPLIT_BULK_IN_NAK, STATE_CSPLIT_BULK, STATE_CSPLIT_BULK_OUT, STATE_CSPLIT_BULK_OUT_ACK, STATE_CSPLIT_BULK_OUT_NAK, STATE_CSPLIT_BULK_OUT_STALL, STATE_CSPLIT_BULK_OUT_NYET, STATE_CSPLIT_BULK_IN, STATE_CSPLIT_BULK_IN_DATA0, STATE_CSPLIT_BULK_IN_DATA1, STATE_CSPLIT_BULK_IN_NAK, STATE_CSPLIT_BULK_IN_STALL, STATE_CSPLIT_BULK_IN_NYET, /* LS/FS Interrupt transactions via HS hub */ STATE_SSPLIT_INTERRUPT, STATE_SSPLIT_INTERRUPT_OUT, STATE_SSPLIT_INTERRUPT_OUT_DATA0, STATE_SSPLIT_INTERRUPT_OUT_DATA1, STATE_SSPLIT_INTERRUPT_IN, STATE_CSPLIT_INTERRUPT, STATE_CSPLIT_INTERRUPT_OUT, STATE_CSPLIT_INTERRUPT_OUT_ACK, STATE_CSPLIT_INTERRUPT_OUT_NAK, STATE_CSPLIT_INTERRUPT_OUT_STALL, STATE_CSPLIT_INTERRUPT_OUT_ERR, STATE_CSPLIT_INTERRUPT_OUT_NYET, STATE_CSPLIT_INTERRUPT_IN, STATE_CSPLIT_INTERRUPT_IN_MDATA, STATE_CSPLIT_INTERRUPT_IN_DATA0, STATE_CSPLIT_INTERRUPT_IN_DATA1, STATE_CSPLIT_INTERRUPT_IN_NAK, STATE_CSPLIT_INTERRUPT_IN_STALL, STATE_CSPLIT_INTERRUPT_IN_ERR, STATE_CSPLIT_INTERRUPT_IN_NYET, /* FS Isochronous transactions via HS hub */ STATE_SSPLIT_ISOCHRONOUS, STATE_SSPLIT_ISOCHRONOUS_OUT, STATE_SSPLIT_ISOCHRONOUS_OUT_DATA0, STATE_SSPLIT_ISOCHRONOUS_IN, STATE_CSPLIT_ISOCHRONOUS, STATE_CSPLIT_ISOCHRONOUS_IN, STATE_CSPLIT_ISOCHRONOUS_IN_DATA0, STATE_CSPLIT_ISOCHRONOUS_IN_MDATA, STATE_CSPLIT_ISOCHRONOUS_IN_ERR, STATE_CSPLIT_ISOCHRONOUS_IN_NYET, /* USB 2.0 ECN: Link Power Management (LPM) */ STATE_EXT, STATE_SUBPID_INVALID, STATE_SUBPID_NOT_REUSABLE, STATE_SUBPID_LPM, STATE_SUBPID_LPM_ACK, STATE_SUBPID_LPM_NYET, STATE_SUBPID_LPM_STALL, STATE_SUBPID_RESERVED, } usbll_state_t; typedef enum usbll_ep_type { USBLL_EP_UNKNOWN, USBLL_EP_CONTROL, USBLL_EP_BULK, USBLL_EP_INTERRUPT, USBLL_EP_ISOCHRONOUS, } usbll_ep_type_t; /* usbll_address_t represents the address * of Host, Hub and Devices. */ typedef struct { guint8 flags; /* flags - Contains information if address is * Host, Hub, Device or Broadcast. */ guint8 device; /* device - Device or Hub Address */ guint8 endpoint; /* endpoint - It represents endpoint number for * Device and port number for Hub. */ } usbll_address_t; typedef struct usbll_transaction_info { guint32 starts_in; guint8 pid; guint8 address; guint8 endpoint; usb_speed_t speed; struct usbll_transaction_info *split_start; struct usbll_transaction_info *split_complete; } usbll_transaction_info_t; typedef struct usbll_transfer_info { /* First data packet number, used as reassembly key */ guint32 first_packet; /* Offset this packet starts at */ guint32 offset; usbll_ep_type_t type; /* TRUE if data from host to device, FALSE when from device to host */ gboolean from_host; /* FALSE if this is the last packet */ gboolean more_frags; } usbll_transfer_info_t; /* USB is a stateful protocol. The addresses of Data Packets * and Handshake Packets depend on the packets before them. * * We maintain a static global pointer of the type usbll_data_t. * Maintaining a pointer instead of a conversation helps in reducing * memory usage, taking the following advantages: * 1. Packets are always ordered. * 2. Addresses of packets only up to last 3 packets are required. * * Previous pointer is used in the initial pass to link packets * into transactions. */ typedef struct usbll_data { usbll_state_t transaction_state; usbll_transaction_info_t *transaction; struct usbll_data *prev; struct usbll_data *next; } usbll_data_t; static usbll_data_t *usbll_data_ptr = NULL; /* Transaction Translator arrays used only during first pass. */ static usbll_transaction_info_t ***tt_non_periodic; static usbll_transaction_info_t ***tt_periodic; typedef enum usbll_transfer_data { USBLL_TRANSFER_NORMAL, USBLL_TRANSFER_GET_DEVICE_DESCRIPTOR, } usbll_transfer_data_t; typedef struct usbll_endpoint_info { usbll_ep_type_t type; usbll_transfer_data_t data; /* Maximum packet size, 0 if not known */ guint16 max_packet_size; /* DATA0/DATA1 tracking to detect retransmissions */ guint8 last_data_pid; /* TRUE if last data packet was acknowledged */ gboolean last_data_acked; /* Current transfer key, 0 if no transfer in progress */ guint32 active_transfer_key; /* Offset where next packet should start at */ guint32 transfer_offset; /* Last data packet length that was part of transfer */ guint32 last_data_len; /* Transfer length if known, 0 if unknown */ guint32 requested_transfer_length; } usbll_endpoint_info_t; /* Endpoint info arrays used only during first pass. */ static usbll_endpoint_info_t **ep_info_in; static usbll_endpoint_info_t **ep_info_out; static guint usbll_fragment_key_hash(gconstpointer k) { return GPOINTER_TO_UINT(k); } static gint usbll_fragment_key_equal(gconstpointer k1, gconstpointer k2) { return GPOINTER_TO_UINT(k1) == GPOINTER_TO_UINT(k2); } static gpointer usbll_fragment_key(const packet_info *pinfo _U_, const guint32 id, const void *data _U_) { return GUINT_TO_POINTER(id); } static void usbll_fragment_free_key(gpointer ptr _U_) { /* there's nothing to be freed */ } static const reassembly_table_functions usbll_reassembly_table_functions = { .hash_func = usbll_fragment_key_hash, .equal_func = usbll_fragment_key_equal, .temporary_key_func = usbll_fragment_key, .persistent_key_func = usbll_fragment_key, .free_temporary_key_func = usbll_fragment_free_key, .free_persistent_key_func = usbll_fragment_free_key, }; static usbll_state_t usbll_next_state(usbll_state_t state, guint8 pid) { if (state == STATE_EXT) { switch (pid) { case USB_SUBPID_RESERVED_MDATA: return STATE_SUBPID_RESERVED; case USB_SUBPID_RESERVED_STALL: return STATE_SUBPID_RESERVED; case USB_SUBPID_CONFLICT_SETUP: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_CONFLICT_PRE: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_RESERVED_DATA1: return STATE_SUBPID_RESERVED; case USB_SUBPID_RESERVED_NAK: return STATE_SUBPID_RESERVED; case USB_SUBPID_CONFLICT_IN: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_CONFLICT_SPLIT: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_RESERVED_DATA2: return STATE_SUBPID_RESERVED; case USB_SUBPID_RESERVED_NYET: return STATE_SUBPID_RESERVED; case USB_SUBPID_CONFLICT_SOF: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_CONFLICT_PING: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_LPM: return STATE_SUBPID_LPM; case USB_SUBPID_RESERVED_ACK: return STATE_SUBPID_RESERVED; case USB_SUBPID_CONFLICT_OUT: return STATE_SUBPID_NOT_REUSABLE; case USB_SUBPID_RESERVED_EXT: return STATE_SUBPID_RESERVED; default: return STATE_SUBPID_INVALID; } } else if (pid == USB_PID_SPECIAL_EXT) { return STATE_EXT; } else if (pid == USB_PID_TOKEN_SOF) { return STATE_IDLE; } else if (pid == USB_PID_SPECIAL_PING) { return STATE_PING; } else if (pid == USB_PID_TOKEN_SETUP) { switch (state) { case STATE_SSPLIT_CONTROL: return STATE_SSPLIT_CONTROL_SETUP; case STATE_CSPLIT_CONTROL: return STATE_CSPLIT_CONTROL_SETUP; default: return STATE_SETUP; } } else if (pid == USB_PID_TOKEN_OUT) { switch (state) { case STATE_SSPLIT_CONTROL: return STATE_SSPLIT_CONTROL_OUT; case STATE_CSPLIT_CONTROL: return STATE_CSPLIT_CONTROL_OUT; case STATE_SSPLIT_BULK: return STATE_SSPLIT_BULK_OUT; case STATE_CSPLIT_BULK: return STATE_CSPLIT_BULK_OUT; case STATE_SSPLIT_INTERRUPT: return STATE_SSPLIT_INTERRUPT_OUT; case STATE_CSPLIT_INTERRUPT: return STATE_CSPLIT_INTERRUPT_OUT; case STATE_SSPLIT_ISOCHRONOUS: return STATE_SSPLIT_ISOCHRONOUS_OUT; default: return STATE_OUT; } } else if (pid == USB_PID_TOKEN_IN) { switch (state) { case STATE_SSPLIT_CONTROL: return STATE_SSPLIT_CONTROL_IN; case STATE_CSPLIT_CONTROL: return STATE_CSPLIT_CONTROL_IN; case STATE_SSPLIT_BULK: return STATE_SSPLIT_BULK_IN; case STATE_CSPLIT_BULK: return STATE_CSPLIT_BULK_IN; case STATE_SSPLIT_INTERRUPT: return STATE_SSPLIT_INTERRUPT_IN; case STATE_CSPLIT_INTERRUPT: return STATE_CSPLIT_INTERRUPT_IN; case STATE_SSPLIT_ISOCHRONOUS: return STATE_SSPLIT_ISOCHRONOUS_IN; case STATE_CSPLIT_ISOCHRONOUS: return STATE_CSPLIT_ISOCHRONOUS_IN; default: return STATE_IN; } } else if (pid == USB_PID_DATA_DATA0) { switch (state) { case STATE_IN: return STATE_IN_DATA0; case STATE_OUT: return STATE_OUT_DATA0; case STATE_SETUP: return STATE_SETUP_DATA0; case STATE_SSPLIT_CONTROL_SETUP: return STATE_SSPLIT_CONTROL_SETUP_DATA0; case STATE_SSPLIT_CONTROL_OUT: return STATE_SSPLIT_CONTROL_OUT_DATA0; case STATE_CSPLIT_CONTROL_IN: return STATE_CSPLIT_CONTROL_IN_DATA0; case STATE_SSPLIT_BULK_OUT: return STATE_SSPLIT_BULK_OUT_DATA0; case STATE_CSPLIT_BULK_IN: return STATE_CSPLIT_BULK_IN_DATA0; case STATE_SSPLIT_INTERRUPT_OUT: return STATE_SSPLIT_INTERRUPT_OUT_DATA0; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_DATA0; case STATE_SSPLIT_ISOCHRONOUS_OUT: return STATE_SSPLIT_ISOCHRONOUS_OUT_DATA0; case STATE_CSPLIT_ISOCHRONOUS_IN: return STATE_CSPLIT_ISOCHRONOUS_IN_DATA0; default: return STATE_INVALID; } } else if (pid == USB_PID_DATA_DATA1) { switch (state) { case STATE_IN: return STATE_IN_DATA1; case STATE_OUT: return STATE_OUT_DATA1; case STATE_SSPLIT_CONTROL_OUT: return STATE_SSPLIT_CONTROL_OUT_DATA1; case STATE_CSPLIT_CONTROL_IN: return STATE_CSPLIT_CONTROL_IN_DATA1; case STATE_SSPLIT_BULK_OUT: return STATE_SSPLIT_BULK_OUT_DATA1; case STATE_CSPLIT_BULK_IN: return STATE_CSPLIT_BULK_IN_DATA1; case STATE_SSPLIT_INTERRUPT_OUT: return STATE_SSPLIT_INTERRUPT_OUT_DATA1; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_DATA1; default: return STATE_INVALID; } } else if (pid == USB_PID_DATA_DATA2) { switch (state) { case STATE_IN: return STATE_IN_HS_ISOCHRONOUS_DATA2; default: return STATE_INVALID; } } else if (pid == USB_PID_DATA_MDATA) { switch (state) { case STATE_OUT: return STATE_OUT_HS_ISOCHRONOUS_MDATA; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_MDATA; case STATE_CSPLIT_ISOCHRONOUS_IN: return STATE_CSPLIT_ISOCHRONOUS_IN_MDATA; default: return STATE_INVALID; } } else if (pid == USB_PID_HANDSHAKE_ACK) { switch (state) { case STATE_IN_DATA0: return STATE_IN_ACK; case STATE_IN_DATA1: return STATE_IN_ACK; case STATE_OUT_DATA0: return STATE_OUT_ACK; case STATE_OUT_DATA1: return STATE_OUT_ACK; case STATE_PING: return STATE_PING_ACK; case STATE_SETUP_DATA0: return STATE_SETUP_ACK; case STATE_SSPLIT_CONTROL_SETUP_DATA0: return STATE_SSPLIT_CONTROL_SETUP_ACK; case STATE_CSPLIT_CONTROL_SETUP: return STATE_CSPLIT_CONTROL_SETUP_ACK; case STATE_SSPLIT_CONTROL_OUT_DATA0: return STATE_SSPLIT_CONTROL_OUT_ACK; case STATE_SSPLIT_CONTROL_OUT_DATA1: return STATE_SSPLIT_CONTROL_OUT_ACK; case STATE_CSPLIT_CONTROL_OUT: return STATE_CSPLIT_CONTROL_OUT_ACK; case STATE_SSPLIT_CONTROL_IN: return STATE_SSPLIT_CONTROL_IN_ACK; case STATE_SSPLIT_BULK_OUT_DATA0: return STATE_SSPLIT_BULK_OUT_ACK; case STATE_SSPLIT_BULK_OUT_DATA1: return STATE_SSPLIT_BULK_OUT_ACK; case STATE_SSPLIT_BULK_IN: return STATE_SSPLIT_BULK_IN_ACK; case STATE_CSPLIT_BULK_OUT: return STATE_CSPLIT_BULK_OUT_ACK; case STATE_CSPLIT_INTERRUPT_OUT: return STATE_CSPLIT_INTERRUPT_OUT_ACK; case STATE_SUBPID_LPM: return STATE_SUBPID_LPM_ACK; default: return STATE_INVALID; } } else if (pid == USB_PID_HANDSHAKE_NAK) { switch (state) { case STATE_IN: return STATE_IN_NAK; case STATE_OUT_DATA0: return STATE_OUT_NAK; case STATE_OUT_DATA1: return STATE_OUT_NAK; case STATE_PING: return STATE_PING_NAK; case STATE_SSPLIT_CONTROL_SETUP_DATA0: return STATE_SSPLIT_CONTROL_SETUP_NAK; case STATE_SSPLIT_CONTROL_OUT_DATA0: return STATE_SSPLIT_CONTROL_OUT_NAK; case STATE_SSPLIT_CONTROL_OUT_DATA1: return STATE_SSPLIT_CONTROL_OUT_NAK; case STATE_SSPLIT_CONTROL_IN: return STATE_SSPLIT_CONTROL_IN_NAK; case STATE_CSPLIT_CONTROL_OUT: return STATE_CSPLIT_CONTROL_OUT_NAK; case STATE_CSPLIT_CONTROL_IN: return STATE_CSPLIT_CONTROL_IN_NAK; case STATE_SSPLIT_BULK_OUT_DATA0: return STATE_SSPLIT_BULK_OUT_NAK; case STATE_SSPLIT_BULK_OUT_DATA1: return STATE_SSPLIT_BULK_OUT_NAK; case STATE_SSPLIT_BULK_IN: return STATE_SSPLIT_BULK_IN_NAK; case STATE_CSPLIT_BULK_OUT: return STATE_CSPLIT_BULK_OUT_NAK; case STATE_CSPLIT_BULK_IN: return STATE_CSPLIT_BULK_IN_NAK; case STATE_CSPLIT_INTERRUPT_OUT: return STATE_CSPLIT_INTERRUPT_OUT_NAK; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_NAK; default: return STATE_INVALID; } } else if (pid == USB_PID_HANDSHAKE_STALL) { switch (state) { case STATE_IN: return STATE_IN_STALL; case STATE_OUT_DATA0: return STATE_OUT_STALL; case STATE_OUT_DATA1: return STATE_OUT_STALL; case STATE_PING: return STATE_PING_STALL; case STATE_CSPLIT_CONTROL_OUT: return STATE_CSPLIT_CONTROL_OUT_STALL; case STATE_CSPLIT_CONTROL_IN: return STATE_CSPLIT_CONTROL_IN_STALL; case STATE_CSPLIT_BULK_OUT: return STATE_CSPLIT_BULK_OUT_STALL; case STATE_CSPLIT_BULK_IN: return STATE_CSPLIT_BULK_IN_STALL; case STATE_CSPLIT_INTERRUPT_OUT: return STATE_CSPLIT_INTERRUPT_OUT_STALL; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_STALL; case STATE_SUBPID_LPM: return STATE_SUBPID_LPM_STALL; default: return STATE_INVALID; } } else if (pid == USB_PID_HANDSHAKE_NYET) { /* Allowed only in High-Speed */ switch (state) { case STATE_OUT_DATA0: return STATE_OUT_NYET; case STATE_OUT_DATA1: return STATE_OUT_NYET; case STATE_CSPLIT_CONTROL_SETUP: return STATE_CSPLIT_CONTROL_SETUP_NYET; case STATE_CSPLIT_CONTROL_OUT: return STATE_CSPLIT_CONTROL_OUT_NYET; case STATE_CSPLIT_CONTROL_IN: return STATE_CSPLIT_CONTROL_IN_NYET; case STATE_CSPLIT_BULK_OUT: return STATE_CSPLIT_BULK_OUT_NYET; case STATE_CSPLIT_BULK_IN: return STATE_CSPLIT_BULK_IN_NYET; case STATE_CSPLIT_INTERRUPT_OUT: return STATE_CSPLIT_INTERRUPT_OUT_NYET; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_NYET; case STATE_CSPLIT_ISOCHRONOUS_IN: return STATE_CSPLIT_ISOCHRONOUS_IN_NYET; case STATE_SUBPID_LPM: return STATE_SUBPID_LPM_NYET; default: return STATE_INVALID; } } else if (pid == USB_PID_SPECIAL_PRE_OR_ERR) { switch (state) { case STATE_CSPLIT_INTERRUPT_OUT: return STATE_CSPLIT_INTERRUPT_OUT_ERR; case STATE_CSPLIT_INTERRUPT_IN: return STATE_CSPLIT_INTERRUPT_IN_ERR; case STATE_CSPLIT_ISOCHRONOUS_IN: return STATE_CSPLIT_ISOCHRONOUS_IN_ERR; default: return STATE_IDLE; } } /* SPLIT is not suitable for this function as the state cannot be * determined by looking solely at PID. */ DISSECTOR_ASSERT(pid != USB_PID_SPECIAL_SPLIT); return STATE_IDLE; } static gboolean usbll_is_non_periodic_split_start_token(usbll_state_t state) { switch (state) { case STATE_SSPLIT_CONTROL_SETUP: case STATE_SSPLIT_CONTROL_OUT: case STATE_SSPLIT_CONTROL_IN: case STATE_SSPLIT_BULK_OUT: case STATE_SSPLIT_BULK_IN: return TRUE; default: return FALSE; } } static gboolean usbll_is_periodic_split_start_token(usbll_state_t state) { switch (state) { case STATE_SSPLIT_INTERRUPT_OUT: case STATE_SSPLIT_INTERRUPT_IN: case STATE_SSPLIT_ISOCHRONOUS_OUT: case STATE_SSPLIT_ISOCHRONOUS_IN: return TRUE; default: return FALSE; } } static gboolean usbll_is_split_start_token(usbll_state_t state) { return usbll_is_non_periodic_split_start_token(state) || usbll_is_periodic_split_start_token(state); } static gboolean usbll_is_non_periodic_split_complete_token(usbll_state_t state) { switch (state) { case STATE_CSPLIT_CONTROL_SETUP: case STATE_CSPLIT_CONTROL_OUT: case STATE_CSPLIT_CONTROL_IN: case STATE_CSPLIT_BULK_OUT: case STATE_CSPLIT_BULK_IN: return TRUE; default: return FALSE; } } static gboolean usbll_is_periodic_split_complete_token(usbll_state_t state) { switch (state) { case STATE_CSPLIT_INTERRUPT_OUT: case STATE_CSPLIT_INTERRUPT_IN: case STATE_CSPLIT_ISOCHRONOUS_IN: return TRUE; default: return FALSE; } } static gboolean usbll_is_split_complete_token(usbll_state_t state) { return usbll_is_non_periodic_split_complete_token(state) || usbll_is_periodic_split_complete_token(state); } static gboolean usbll_is_split_token(usbll_state_t state) { return usbll_is_split_start_token(state) || usbll_is_split_complete_token(state); } static gboolean usbll_is_non_split_token(usbll_state_t state) { switch (state) { case STATE_IN: case STATE_OUT: case STATE_PING: case STATE_SETUP: case STATE_EXT: return TRUE; default: return FALSE; } } static gboolean usbll_is_extended_subpid(usbll_state_t state) { switch (state) { case STATE_SUBPID_INVALID: case STATE_SUBPID_NOT_REUSABLE: case STATE_SUBPID_LPM: case STATE_SUBPID_RESERVED: return TRUE; default: return FALSE; } } static gboolean usbll_is_setup_data(usbll_state_t state) { switch (state) { case STATE_SETUP_DATA0: case STATE_SSPLIT_CONTROL_SETUP_DATA0: return TRUE; default: return FALSE; } } static gboolean usbll_is_data_from_host(usbll_state_t state) { switch (state) { case STATE_OUT_DATA0: case STATE_OUT_DATA1: case STATE_OUT_HS_ISOCHRONOUS_DATA2: case STATE_OUT_HS_ISOCHRONOUS_MDATA: case STATE_SETUP_DATA0: case STATE_SSPLIT_CONTROL_SETUP_DATA0: case STATE_SSPLIT_CONTROL_OUT_DATA0: case STATE_SSPLIT_CONTROL_OUT_DATA1: case STATE_SSPLIT_BULK_OUT_DATA0: case STATE_SSPLIT_BULK_OUT_DATA1: case STATE_SSPLIT_INTERRUPT_OUT_DATA0: case STATE_SSPLIT_INTERRUPT_OUT_DATA1: case STATE_SSPLIT_ISOCHRONOUS_OUT_DATA0: return TRUE; case STATE_IN_DATA0: case STATE_IN_DATA1: case STATE_IN_HS_ISOCHRONOUS_DATA2: case STATE_CSPLIT_CONTROL_IN_DATA0: case STATE_CSPLIT_CONTROL_IN_DATA1: case STATE_CSPLIT_BULK_IN_DATA0: case STATE_CSPLIT_BULK_IN_DATA1: case STATE_CSPLIT_INTERRUPT_IN_MDATA: case STATE_CSPLIT_INTERRUPT_IN_DATA0: case STATE_CSPLIT_INTERRUPT_IN_DATA1: case STATE_CSPLIT_ISOCHRONOUS_IN_DATA0: case STATE_CSPLIT_ISOCHRONOUS_IN_MDATA: return FALSE; default: DISSECTOR_ASSERT_NOT_REACHED(); } } static gboolean usbll_is_split_data_from_device(usbll_state_t state) { switch (state) { case STATE_CSPLIT_CONTROL_IN_DATA0: case STATE_CSPLIT_CONTROL_IN_DATA1: case STATE_CSPLIT_BULK_IN_DATA0: case STATE_CSPLIT_BULK_IN_DATA1: case STATE_CSPLIT_INTERRUPT_IN_MDATA: case STATE_CSPLIT_INTERRUPT_IN_DATA0: case STATE_CSPLIT_INTERRUPT_IN_DATA1: case STATE_CSPLIT_ISOCHRONOUS_IN_DATA0: case STATE_CSPLIT_ISOCHRONOUS_IN_MDATA: return TRUE; default: return FALSE; } } static gboolean usbll_is_setup_ack(usbll_state_t state) { switch (state) { case STATE_SETUP_ACK: case STATE_CSPLIT_CONTROL_SETUP_ACK: return TRUE; default: return FALSE; } } static gboolean usbll_is_data_ack(usbll_state_t state) { switch (state) { case STATE_IN_ACK: case STATE_OUT_ACK: case STATE_OUT_NYET: case STATE_CSPLIT_CONTROL_OUT_ACK: case STATE_CSPLIT_BULK_OUT_ACK: case STATE_CSPLIT_INTERRUPT_OUT_ACK: return TRUE; default: return FALSE; } } static gboolean usbll_is_acked_data_from_host(usbll_state_t state) { switch (state) { case STATE_OUT_ACK: case STATE_OUT_NYET: case STATE_CSPLIT_CONTROL_OUT_ACK: case STATE_CSPLIT_BULK_OUT_ACK: case STATE_CSPLIT_INTERRUPT_OUT_ACK: return TRUE; case STATE_IN_ACK: return FALSE; default: DISSECTOR_ASSERT_NOT_REACHED(); } } static gboolean usbll_is_endpoint_stall(usbll_state_t state) { switch (state) { case STATE_IN_STALL: case STATE_OUT_STALL: case STATE_PING_STALL: case STATE_CSPLIT_CONTROL_OUT_STALL: case STATE_CSPLIT_CONTROL_IN_STALL: case STATE_CSPLIT_BULK_OUT_STALL: case STATE_CSPLIT_BULK_IN_STALL: case STATE_CSPLIT_INTERRUPT_OUT_STALL: case STATE_CSPLIT_INTERRUPT_IN_STALL: return TRUE; default: return FALSE; } } static gboolean usbll_is_stalled_data_from_host(usbll_state_t state) { switch (state) { case STATE_OUT_STALL: case STATE_PING_STALL: case STATE_CSPLIT_CONTROL_OUT_STALL: case STATE_CSPLIT_BULK_OUT_STALL: case STATE_CSPLIT_INTERRUPT_OUT_STALL: return TRUE; case STATE_IN_STALL: case STATE_CSPLIT_CONTROL_IN_STALL: case STATE_CSPLIT_BULK_IN_STALL: case STATE_CSPLIT_INTERRUPT_IN_STALL: return FALSE; default: DISSECTOR_ASSERT_NOT_REACHED(); } } static usb_speed_t usbll_get_data_transaction_speed(usbll_data_t *data) { switch (data->transaction_state) { case STATE_IN_DATA0: case STATE_IN_DATA1: case STATE_IN_HS_ISOCHRONOUS_DATA2: case STATE_IN_STALL: case STATE_OUT_DATA0: case STATE_OUT_DATA1: case STATE_OUT_HS_ISOCHRONOUS_DATA2: case STATE_OUT_HS_ISOCHRONOUS_MDATA: case STATE_OUT_STALL: case STATE_PING_STALL: case STATE_SETUP_DATA0: DISSECTOR_ASSERT(data->transaction != NULL); return data->transaction->speed; case STATE_SSPLIT_CONTROL_SETUP_DATA0: case STATE_SSPLIT_CONTROL_OUT_DATA0: case STATE_SSPLIT_CONTROL_OUT_DATA1: case STATE_SSPLIT_BULK_OUT_DATA0: case STATE_SSPLIT_BULK_OUT_DATA1: case STATE_SSPLIT_INTERRUPT_OUT_DATA0: case STATE_SSPLIT_INTERRUPT_OUT_DATA1: case STATE_SSPLIT_ISOCHRONOUS_OUT_DATA0: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_start != NULL); return data->transaction->split_start->speed; case STATE_CSPLIT_CONTROL_OUT_STALL: case STATE_CSPLIT_CONTROL_IN_DATA0: case STATE_CSPLIT_CONTROL_IN_DATA1: case STATE_CSPLIT_CONTROL_IN_STALL: case STATE_CSPLIT_BULK_OUT_STALL: case STATE_CSPLIT_BULK_IN_DATA0: case STATE_CSPLIT_BULK_IN_DATA1: case STATE_CSPLIT_BULK_IN_STALL: case STATE_CSPLIT_INTERRUPT_OUT_STALL: case STATE_CSPLIT_INTERRUPT_IN_MDATA: case STATE_CSPLIT_INTERRUPT_IN_DATA0: case STATE_CSPLIT_INTERRUPT_IN_DATA1: case STATE_CSPLIT_INTERRUPT_IN_STALL: case STATE_CSPLIT_ISOCHRONOUS_IN_DATA0: case STATE_CSPLIT_ISOCHRONOUS_IN_MDATA: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_complete != NULL); return data->transaction->split_complete->speed; default: DISSECTOR_ASSERT_NOT_REACHED(); } } static int usbll_addr_to_str(const address* addr, gchar *buf, int buf_len) { const usbll_address_t *addrp = (const usbll_address_t *)addr->data; if (addrp->flags & USBLL_ADDRESS_HOST) { (void) g_strlcpy(buf, "host", buf_len); } else if (addrp->flags & USBLL_ADDRESS_BROADCAST) { (void) g_strlcpy(buf, "broadcast", buf_len); } else if (addrp->flags & USBLL_ADDRESS_HUB_PORT) { /* * In split transaction we use : to mark that the last part is port not * endpoint. */ snprintf(buf, buf_len, "%d:%d", addrp->device, addrp->endpoint); } else { /* Just a standard address.endpoint notation. */ snprintf(buf, buf_len, "%d.%d", addrp->device, addrp->endpoint); } return (int)(strlen(buf)+1); } static int usbll_addr_str_len(const address* addr _U_) { return 50; /* The same as for usb. */ } static void usbll_set_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint8 device, guint8 endpoint, guint8 flags) { proto_item *sub_item; usbll_address_t *src_addr, *dst_addr; guint8 *str_src_addr, *str_dst_addr; src_addr = wmem_new0(pinfo->pool, usbll_address_t); dst_addr = wmem_new0(pinfo->pool, usbll_address_t); if (USBLL_ADDRESS_IS_HOST_TO_DEV(flags)) { src_addr->flags = USBLL_ADDRESS_HOST; if (flags & USBLL_ADDRESS_BROADCAST) { dst_addr->flags = USBLL_ADDRESS_BROADCAST; pinfo->ptype = PT_NONE; } else { dst_addr->device = device; dst_addr->endpoint = endpoint; if (flags & USBLL_ADDRESS_HUB_PORT) { dst_addr->flags = USBLL_ADDRESS_HUB_PORT; pinfo->ptype = PT_NONE; } else { pinfo->ptype = PT_USB; pinfo->destport = dst_addr->endpoint; } } } else { dst_addr->flags = USBLL_ADDRESS_HOST; src_addr->device = device; src_addr->endpoint = endpoint; if (flags & USBLL_ADDRESS_HUB_PORT) { src_addr->flags = USBLL_ADDRESS_HUB_PORT; pinfo->ptype = PT_NONE; } else { pinfo->ptype = PT_USB; pinfo->srcport = src_addr->endpoint; pinfo->destport = NO_ENDPOINT; } } pinfo->p2p_dir = USBLL_ADDRESS_IS_HOST_TO_DEV(flags) ? P2P_DIR_SENT : P2P_DIR_RECV; set_address(&pinfo->net_src, usbll_address_type, sizeof(usbll_address_t), (char *)src_addr); copy_address_shallow(&pinfo->src, &pinfo->net_src); set_address(&pinfo->net_dst, usbll_address_type, sizeof(usbll_address_t), (char *)dst_addr); copy_address_shallow(&pinfo->dst, &pinfo->net_dst); str_src_addr = address_to_str(pinfo->pool, &pinfo->src); str_dst_addr = address_to_str(pinfo->pool, &pinfo->dst); sub_item = proto_tree_add_string(tree, hf_usbll_src, tvb, 0, 0, str_src_addr); proto_item_set_generated(sub_item); sub_item = proto_tree_add_string(tree, hf_usbll_addr, tvb, 0, 0, str_src_addr); proto_item_set_hidden(sub_item); sub_item = proto_tree_add_string(tree, hf_usbll_dst, tvb, 0, 0, str_dst_addr); proto_item_set_generated(sub_item); sub_item = proto_tree_add_string(tree, hf_usbll_addr, tvb, 0, 0, str_dst_addr); proto_item_set_hidden(sub_item); } static void usbll_generate_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, usbll_data_t *data) { switch (data->transaction_state) { case STATE_IDLE: case STATE_INVALID: /* Do not set address if we are not sure about it */ break; case STATE_IN: case STATE_IN_ACK: case STATE_OUT: case STATE_OUT_DATA0: case STATE_OUT_DATA1: case STATE_OUT_HS_ISOCHRONOUS_DATA2: case STATE_OUT_HS_ISOCHRONOUS_MDATA: case STATE_PING: case STATE_SETUP: case STATE_SETUP_DATA0: case STATE_EXT: case STATE_SUBPID_INVALID: case STATE_SUBPID_NOT_REUSABLE: case STATE_SUBPID_LPM: case STATE_SUBPID_RESERVED: DISSECTOR_ASSERT(data->transaction != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_HOST_TO_DEV); break; case STATE_IN_DATA0: case STATE_IN_DATA1: case STATE_IN_HS_ISOCHRONOUS_DATA2: case STATE_IN_NAK: case STATE_IN_STALL: case STATE_OUT_ACK: case STATE_OUT_NAK: case STATE_OUT_STALL: case STATE_OUT_NYET: case STATE_PING_ACK: case STATE_PING_NAK: case STATE_PING_STALL: case STATE_SETUP_ACK: case STATE_SUBPID_LPM_ACK: case STATE_SUBPID_LPM_NYET: case STATE_SUBPID_LPM_STALL: DISSECTOR_ASSERT(data->transaction != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_DEV_TO_HOST); break; case STATE_SSPLIT_CONTROL: case STATE_CSPLIT_CONTROL: case STATE_SSPLIT_BULK: case STATE_CSPLIT_BULK: case STATE_SSPLIT_INTERRUPT: case STATE_CSPLIT_INTERRUPT: case STATE_SSPLIT_ISOCHRONOUS: case STATE_CSPLIT_ISOCHRONOUS: DISSECTOR_ASSERT(data->transaction != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_HOST_TO_DEV | USBLL_ADDRESS_HUB_PORT); break; case STATE_SSPLIT_CONTROL_SETUP: case STATE_SSPLIT_CONTROL_SETUP_DATA0: case STATE_SSPLIT_CONTROL_OUT: case STATE_SSPLIT_CONTROL_OUT_DATA0: case STATE_SSPLIT_CONTROL_OUT_DATA1: case STATE_SSPLIT_CONTROL_IN: case STATE_SSPLIT_BULK_OUT: case STATE_SSPLIT_BULK_OUT_DATA0: case STATE_SSPLIT_BULK_OUT_DATA1: case STATE_SSPLIT_BULK_IN: case STATE_SSPLIT_INTERRUPT_OUT: case STATE_SSPLIT_INTERRUPT_OUT_DATA0: case STATE_SSPLIT_INTERRUPT_OUT_DATA1: case STATE_SSPLIT_INTERRUPT_IN: case STATE_SSPLIT_ISOCHRONOUS_OUT: case STATE_SSPLIT_ISOCHRONOUS_OUT_DATA0: case STATE_SSPLIT_ISOCHRONOUS_IN: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_start != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_HOST_TO_DEV); break; case STATE_SSPLIT_CONTROL_SETUP_ACK: case STATE_SSPLIT_CONTROL_SETUP_NAK: case STATE_SSPLIT_CONTROL_OUT_ACK: case STATE_SSPLIT_CONTROL_OUT_NAK: case STATE_SSPLIT_CONTROL_IN_ACK: case STATE_SSPLIT_CONTROL_IN_NAK: case STATE_SSPLIT_BULK_OUT_ACK: case STATE_SSPLIT_BULK_OUT_NAK: case STATE_SSPLIT_BULK_IN_ACK: case STATE_SSPLIT_BULK_IN_NAK: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_start != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->split_start->address, data->transaction->split_start->endpoint, USBLL_ADDRESS_DEV_TO_HOST | USBLL_ADDRESS_HUB_PORT); break; case STATE_CSPLIT_CONTROL_SETUP: case STATE_CSPLIT_CONTROL_OUT: case STATE_CSPLIT_CONTROL_IN: case STATE_CSPLIT_BULK_OUT: case STATE_CSPLIT_BULK_IN: case STATE_CSPLIT_INTERRUPT_OUT: case STATE_CSPLIT_INTERRUPT_IN: case STATE_CSPLIT_ISOCHRONOUS_IN: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_complete != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_HOST_TO_DEV); break; case STATE_CSPLIT_CONTROL_SETUP_ACK: case STATE_CSPLIT_CONTROL_OUT_ACK: case STATE_CSPLIT_CONTROL_OUT_NAK: case STATE_CSPLIT_CONTROL_OUT_STALL: case STATE_CSPLIT_CONTROL_IN_DATA0: case STATE_CSPLIT_CONTROL_IN_DATA1: case STATE_CSPLIT_CONTROL_IN_NAK: case STATE_CSPLIT_CONTROL_IN_STALL: case STATE_CSPLIT_BULK_OUT_ACK: case STATE_CSPLIT_BULK_OUT_NAK: case STATE_CSPLIT_BULK_OUT_STALL: case STATE_CSPLIT_BULK_IN_DATA0: case STATE_CSPLIT_BULK_IN_DATA1: case STATE_CSPLIT_BULK_IN_NAK: case STATE_CSPLIT_BULK_IN_STALL: case STATE_CSPLIT_INTERRUPT_OUT_ACK: case STATE_CSPLIT_INTERRUPT_OUT_NAK: case STATE_CSPLIT_INTERRUPT_OUT_STALL: case STATE_CSPLIT_INTERRUPT_IN_MDATA: case STATE_CSPLIT_INTERRUPT_IN_DATA0: case STATE_CSPLIT_INTERRUPT_IN_DATA1: case STATE_CSPLIT_INTERRUPT_IN_NAK: case STATE_CSPLIT_INTERRUPT_IN_STALL: case STATE_CSPLIT_ISOCHRONOUS_IN_DATA0: case STATE_CSPLIT_ISOCHRONOUS_IN_MDATA: DISSECTOR_ASSERT(data->transaction != NULL); DISSECTOR_ASSERT(data->transaction->split_complete != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_DEV_TO_HOST); break; case STATE_CSPLIT_CONTROL_SETUP_NYET: case STATE_CSPLIT_CONTROL_OUT_NYET: case STATE_CSPLIT_CONTROL_IN_NYET: case STATE_CSPLIT_BULK_OUT_NYET: case STATE_CSPLIT_BULK_IN_NYET: case STATE_CSPLIT_INTERRUPT_OUT_ERR: case STATE_CSPLIT_INTERRUPT_OUT_NYET: case STATE_CSPLIT_INTERRUPT_IN_ERR: case STATE_CSPLIT_INTERRUPT_IN_NYET: case STATE_CSPLIT_ISOCHRONOUS_IN_ERR: case STATE_CSPLIT_ISOCHRONOUS_IN_NYET: DISSECTOR_ASSERT(data->transaction != NULL); usbll_set_address(tree, tvb, pinfo, data->transaction->address, data->transaction->endpoint, USBLL_ADDRESS_DEV_TO_HOST | USBLL_ADDRESS_HUB_PORT); break; default: DISSECTOR_ASSERT_NOT_REACHED(); } } static usbll_transaction_info_t * tt_restore_transaction(packet_info *pinfo, usbll_state_t state, guint8 hub_address, guint8 port) { /* The buffer is simply updated with each subsequent packet, this is fine * if and only if we access it only during first pass. */ DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); DISSECTOR_ASSERT(usbll_is_split_complete_token(state)); DISSECTOR_ASSERT(hub_address <= 127); DISSECTOR_ASSERT(port <= 127); if (!tt_periodic || !tt_non_periodic) { /* No transaciton has been registered yet */ return NULL; } if (usbll_is_periodic_split_complete_token(state)) { return tt_periodic[hub_address][port]; } else { DISSECTOR_ASSERT(usbll_is_non_periodic_split_complete_token(state)); return tt_non_periodic[hub_address][port]; } } static void tt_store_transaction(packet_info *pinfo, usbll_state_t state, guint8 hub_address, guint8 port, usbll_transaction_info_t *transaction) { DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); DISSECTOR_ASSERT(usbll_is_split_start_token(state)); DISSECTOR_ASSERT(hub_address <= 127); DISSECTOR_ASSERT(port <= 127); if (!tt_periodic || !tt_non_periodic) { /* Lazy allocate lookup table. Both address and port are 7 bit numbers, * so simply allocate buffers capable to hold all possible combinations. */ int i; tt_periodic = wmem_alloc_array(wmem_file_scope(), usbll_transaction_info_t **, 128); for (i = 0; i < 128; i++) { tt_periodic[i] = wmem_alloc0_array(wmem_file_scope(), usbll_transaction_info_t *, 128); } tt_non_periodic = wmem_alloc_array(wmem_file_scope(), usbll_transaction_info_t **, 128); for (i = 0; i < 128; i++) { tt_non_periodic[i] = wmem_alloc0_array(wmem_file_scope(), usbll_transaction_info_t *, 128); } } if (usbll_is_periodic_split_start_token(state)) { tt_periodic[hub_address][port] = transaction; } else { DISSECTOR_ASSERT(usbll_is_non_periodic_split_start_token(state)); tt_non_periodic[hub_address][port] = transaction; } } static usbll_ep_type_t usbll_ep_type_from_urb_type(guint8 urb_type) { switch (urb_type) { case URB_ISOCHRONOUS: return USBLL_EP_ISOCHRONOUS; case URB_INTERRUPT: return USBLL_EP_INTERRUPT; case URB_CONTROL: return USBLL_EP_CONTROL; case URB_BULK: return USBLL_EP_BULK; default: return USBLL_EP_UNKNOWN; } } static void usbll_reset_endpoint_info(usbll_endpoint_info_t *info, usbll_ep_type_t type, guint16 max_packet_size) { info->type = type; info->data = USBLL_TRANSFER_NORMAL; info->max_packet_size = max_packet_size; info->last_data_pid = 0; info->last_data_acked = FALSE; info->active_transfer_key = 0; info->transfer_offset = 0; info->last_data_len = 0; info->requested_transfer_length = 0; } static void usbll_reset_device_endpoints(int addr) { int ep; DISSECTOR_ASSERT((addr >= 0) && (addr <= 127)); /* Endpoint 0 is always control type */ usbll_reset_endpoint_info(&ep_info_in[addr][0], USBLL_EP_CONTROL, 0); usbll_reset_endpoint_info(&ep_info_out[addr][0], USBLL_EP_CONTROL, 0); for (ep = 1; ep < 16; ep++) { usbll_reset_endpoint_info(&ep_info_in[addr][ep], USBLL_EP_UNKNOWN, 0); usbll_reset_endpoint_info(&ep_info_out[addr][ep], USBLL_EP_UNKNOWN, 0); } } static void usbll_init_endpoint_tables(void) { /* Address is 7 bits (0 - 127), while endpoint is 4 bits (0 - 15) */ int addr; ep_info_in = wmem_alloc_array(wmem_file_scope(), usbll_endpoint_info_t *, 128); for (addr = 0; addr < 128; addr++) { ep_info_in[addr] = wmem_alloc_array(wmem_file_scope(), usbll_endpoint_info_t, 16); } ep_info_out = wmem_alloc_array(wmem_file_scope(), usbll_endpoint_info_t *, 128); for (addr = 0; addr < 128; addr++) { ep_info_out[addr] = wmem_alloc_array(wmem_file_scope(), usbll_endpoint_info_t, 16); } for (addr = 0; addr < 128; addr++) { usbll_reset_device_endpoints(addr); } } static usbll_endpoint_info_t * usbll_get_endpoint_info(packet_info *pinfo, guint8 addr, guint8 ep, gboolean from_host) { usbll_endpoint_info_t *info; DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); DISSECTOR_ASSERT(addr <= 127); DISSECTOR_ASSERT(ep <= 15); if (!ep_info_in || !ep_info_out) { usbll_init_endpoint_tables(); DISSECTOR_ASSERT(ep_info_in != NULL); DISSECTOR_ASSERT(ep_info_out != NULL); } if (from_host) { info = &ep_info_out[addr][ep]; } else { info = &ep_info_in[addr][ep]; } if (ep != 0) { /* Get endpoint type and max packet size from USB dissector * USB dissector gets the information from CONFIGURATION descriptor * * TODO: Reorganize USB dissector to call us whenever selected * configuration and/or interface changes. USB dissector * currently assumes only one configuration and that all * alternate interface settings have matching endpoint * information. This should be fixed but is good for now * as most devices fullfills this (wrong) assumption. */ usb_conv_info_t *usb_conv_info; usbll_ep_type_t type = USBLL_EP_UNKNOWN; guint16 max_packet_size = 0; usb_conv_info = get_existing_usb_ep_conv_info(pinfo, 0, addr, ep); if (usb_conv_info && usb_conv_info->max_packet_size) { type = usbll_ep_type_from_urb_type(usb_conv_info->descriptor_transfer_type); max_packet_size = usb_conv_info->max_packet_size; } /* Reset endpoint info if endpoint parameters changed */ if ((info->type != type) || (info->max_packet_size != max_packet_size)) { usbll_reset_endpoint_info(info, type, max_packet_size); } } return info; } static gint dissect_usbll_sof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { guint32 frame; /* SOF Packets are broadcasted from Host to all devices. */ usbll_set_address(tree, tvb, pinfo, 0, 0, USBLL_ADDRESS_HOST_TO_DEV | USBLL_ADDRESS_BROADCAST); proto_tree_add_item_ret_uint(tree, hf_usbll_sof_framenum, tvb, offset, 2, ENC_LITTLE_ENDIAN, &frame); proto_tree_add_checksum(tree, tvb, offset, hf_usbll_crc5, hf_usbll_crc5_status, &ei_wrong_crc5, pinfo, crc5_usb_11bit_input(frame), ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 2; return offset; } static gint dissect_usbll_token(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint8 pid, usbll_data_t *data, usb_speed_t speed) { guint8 device_address; guint8 endpoint; guint16 address_bits; static int * const address_fields[] = { &hf_usbll_device_addr, &hf_usbll_endp, NULL }; address_bits = tvb_get_letohs(tvb, offset); device_address = TOKEN_BITS_GET_ADDRESS(address_bits); endpoint = TOKEN_BITS_GET_ENDPOINT(address_bits); proto_tree_add_bitmask_list_value(tree, tvb, offset, 2, address_fields, address_bits); proto_tree_add_checksum(tree, tvb, offset, hf_usbll_crc5, hf_usbll_crc5_status, &ei_wrong_crc5, pinfo, crc5_usb_11bit_input(address_bits), ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 2; if (!PINFO_FD_VISITED(pinfo)) { usbll_state_t prev_state; usbll_transaction_info_t *transaction = NULL; usbll_transaction_info_t *split_transaction = NULL; prev_state = data->prev ? data->prev->transaction_state : STATE_IDLE; data->transaction_state = usbll_next_state(prev_state, pid); DISSECTOR_ASSERT(usbll_is_non_split_token(data->transaction_state) || usbll_is_split_token(data->transaction_state)); if (usbll_is_split_complete_token(data->transaction_state)) { DISSECTOR_ASSERT(data->prev != NULL); DISSECTOR_ASSERT(data->prev->transaction != NULL); DISSECTOR_ASSERT(data->prev->transaction->pid == USB_PID_SPECIAL_SPLIT); split_transaction = data->prev->transaction; transaction = tt_restore_transaction(pinfo, data->transaction_state, split_transaction->address, split_transaction->endpoint); if (transaction == NULL) { /* Most likely capture simply misses Split Start */ transaction = wmem_new0(wmem_file_scope(), usbll_transaction_info_t); transaction->pid = pid; transaction->address = device_address; transaction->endpoint = endpoint; transaction->speed = speed; } transaction->split_complete = data->prev->transaction; } else { transaction = wmem_new0(wmem_file_scope(), usbll_transaction_info_t); transaction->starts_in = pinfo->num; transaction->pid = pid; transaction->address = device_address; transaction->endpoint = endpoint; transaction->speed = speed; } if (usbll_is_split_start_token(data->transaction_state)) { DISSECTOR_ASSERT(data->prev != NULL); DISSECTOR_ASSERT(data->prev->transaction != NULL); DISSECTOR_ASSERT(data->prev->transaction->pid == USB_PID_SPECIAL_SPLIT); transaction->split_start = data->prev->transaction; tt_store_transaction(pinfo, data->transaction_state, transaction->split_start->address, transaction->split_start->endpoint, transaction); } data->transaction = transaction; } return offset; } static gboolean packet_ends_transfer(usbll_endpoint_info_t *ep_info, guint32 offset, gint data_size) { DISSECTOR_ASSERT(ep_info->type != USBLL_EP_UNKNOWN); if (ep_info->requested_transfer_length != 0) { /* We know requested transfer length */ if (offset + data_size >= ep_info->requested_transfer_length) { /* No more data needed */ return TRUE; } /* else check max packet size as transfer can end prematurely */ } else { DISSECTOR_ASSERT(ep_info->type != USBLL_EP_CONTROL); DISSECTOR_ASSERT(ep_info->max_packet_size != 0); /* We don't know requested transfer length, for bulk transfers * assume that transfer can be larger than max packet length, * for periodic transfers assume transfer is not larger than * max packet length. */ if (ep_info->type != USBLL_EP_BULK) { return TRUE; } } if (ep_info->max_packet_size) { return data_size < ep_info->max_packet_size; } DISSECTOR_ASSERT(ep_info->type == USBLL_EP_CONTROL); /* This code is valid only for high-speed control endpoints */ if (data_size < 64) { return TRUE; } return FALSE; } static gboolean is_get_device_descriptor(guint8 setup[8]) { guint16 lang_id = setup[4] | (setup[5] << 8); guint16 length = setup[6] | (setup[7] << 8); return (setup[0] == USB_DIR_IN) && (setup[1] == USB_SETUP_GET_DESCRIPTOR) && (setup[2] == 0x00) && /* Descriptor Index */ (setup[3] == 0x01) && /* DEVICE descriptor */ (lang_id == 0x00) && /* no language specified */ (length >= 8); /* atleast 8 bytes needed to get bMaxPacketSize0 */ } static gboolean is_set_address(guint8 setup[8]) { guint16 addr = setup[2] | (setup[3] << 8); guint16 idx = setup[4] | (setup[5] << 8); guint16 length = setup[6] | (setup[7] << 8); return (setup[0] == USB_DIR_OUT) && (setup[1] == USB_SETUP_SET_ADDRESS) && (addr <= 127) && (idx == 0x00) && (length == 0x00); } static void usbll_construct_urb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int data_offset, int data_size, usbll_data_t *data) { usbll_transfer_info_t *transfer = NULL; transfer = (usbll_transfer_info_t *)wmem_map_lookup(transfer_info, GUINT_TO_POINTER(pinfo->num)); if (transfer) { tvbuff_t *transfer_tvb; if ((transfer->first_packet == pinfo->num) && (!transfer->more_frags) && (((transfer->type == USBLL_EP_CONTROL) && (transfer->from_host)) || (transfer->type == USBLL_EP_ISOCHRONOUS))) { /* No multi-packet reassembly needed, simply construct tvb */ transfer_tvb = tvb_new_subset_length(tvb, data_offset, data_size); add_new_data_source(pinfo, transfer_tvb, "USB transfer"); } else { fragment_head *head; head = fragment_add_check_with_fallback(&usbll_reassembly_table, tvb, data_offset, pinfo, transfer->first_packet, NULL, transfer->offset, data_size, transfer->more_frags, transfer->first_packet); transfer_tvb = process_reassembled_data(tvb, data_offset, pinfo, "USB transfer", head, &usbll_frag_items, NULL, tree); } if (transfer_tvb != NULL) { usb_pseudo_urb_t pseudo_urb; pseudo_urb.from_host = transfer->from_host; switch (transfer->type) { case USBLL_EP_UNKNOWN: pseudo_urb.transfer_type = URB_UNKNOWN; break; case USBLL_EP_CONTROL: pseudo_urb.transfer_type = URB_CONTROL; break; case USBLL_EP_BULK: pseudo_urb.transfer_type = URB_BULK; break; case USBLL_EP_INTERRUPT: pseudo_urb.transfer_type = URB_INTERRUPT; break; case USBLL_EP_ISOCHRONOUS: pseudo_urb.transfer_type = URB_ISOCHRONOUS; break; default: DISSECTOR_ASSERT_NOT_REACHED(); } pseudo_urb.device_address = data->transaction->address; pseudo_urb.endpoint = data->transaction->endpoint; pseudo_urb.bus_id = 0; pseudo_urb.speed = usbll_get_data_transaction_speed(data); dissect_usb_common(transfer_tvb, pinfo, proto_tree_get_parent_tree(tree), USB_HEADER_PSEUDO_URB, &pseudo_urb); } } } static gint dissect_usbll_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 pid, usbll_data_t *data) { /* TODO: How to determine the expected DATA size? */ guint16 computed_crc, actual_crc; gint data_offset = offset; gint data_size = tvb_reported_length_remaining(tvb, offset) - 2; proto_item *data_item = NULL; usbll_transfer_info_t *transfer = NULL; if (data_size > 0) { data_item = proto_tree_add_item(tree, hf_usbll_data, tvb, offset, data_size, ENC_NA); offset += data_size; } actual_crc = tvb_get_letohs(tvb, offset); computed_crc = crc16_usb_tvb_offset(tvb, 1, offset - 1); proto_tree_add_checksum(tree, tvb, offset, hf_usbll_data_crc, hf_usbll_data_crc_status, &ei_wrong_crc16, pinfo, computed_crc, ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 2; if (!PINFO_FD_VISITED(pinfo)) { usbll_state_t prev_state; prev_state = data->prev ? data->prev->transaction_state : STATE_IDLE; data->transaction_state = usbll_next_state(prev_state, pid); if (data->transaction_state != STATE_INVALID) { DISSECTOR_ASSERT(data->prev != NULL); DISSECTOR_ASSERT(data->prev->transaction != NULL); data->transaction = data->prev->transaction; } } if (actual_crc != computed_crc) { /* Do not reassemble on CRC error */ return offset; } if (usbll_is_setup_data(data->transaction_state)) { if (data_size != 8) { expert_add_info(pinfo, data_item, &ei_invalid_setup_data); } else if (!PINFO_FD_VISITED(pinfo)) { usbll_endpoint_info_t *ep_out, *ep_in; ep_out = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, TRUE); ep_in = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, FALSE); /* Check if SETUP data is indeed to control endpoint (discard if targtet endpoint is not control). * Practically all control transfers are to endpoint 0 which is always control endpoint. */ if ((ep_out->type == USBLL_EP_CONTROL) && (ep_in->type == USBLL_EP_CONTROL)) { guint8 setup[8]; gboolean data_stage_from_host; guint16 requested_length; tvb_memcpy(tvb, setup, data_offset, 8); /* bmRequestType D7 0 = Host-to-device, 1 = Device-to-host */ data_stage_from_host = (setup[0] & 0x80) ? FALSE : TRUE; /* wLength */ requested_length = setup[6] | (setup[7] << 8); usbll_reset_endpoint_info(ep_out, USBLL_EP_CONTROL, ep_out->max_packet_size); usbll_reset_endpoint_info(ep_in, USBLL_EP_CONTROL, ep_in->max_packet_size); transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = pinfo->num; transfer->offset = 0; transfer->type = USBLL_EP_CONTROL; transfer->from_host = TRUE; /* SETUP is always from host to sevice */ if (requested_length > 0) { if (data_stage_from_host) { /* Merge SETUP data with OUT Data to pass to USB dissector */ transfer->more_frags = TRUE; ep_out->active_transfer_key = pinfo->num; ep_out->requested_transfer_length = requested_length; ep_out->transfer_offset = 8; ep_out->last_data_pid = pid; ep_out->last_data_acked = FALSE; /* If SETUP is sent again, it always starts a new transfer. * If we receive DATA0 next then it is really a host failure. * Do not "overwrite" the 8 SETUP bytes in such case. */ ep_out->last_data_len = 0; } else { transfer->more_frags = FALSE; /* Expect requested_length when reading from control endpoint. * The data should start with DATA1. If we receive DATA0 then * this is really device failure. */ ep_in->requested_transfer_length = requested_length; ep_in->last_data_pid = pid; ep_in->last_data_acked = FALSE; ep_in->last_data_len = 0; } } if (is_get_device_descriptor(setup)) { ep_in->data = USBLL_TRANSFER_GET_DEVICE_DESCRIPTOR; } else if (is_set_address(setup)) { int addr = setup[2]; if (addr > 0) { /* Prevent transfer reassembly across reset boundary. * Do not reset for default address (0) because there * can only be control transfers to default address * and we don't want to lose max packet size info. */ usbll_reset_device_endpoints(addr); } } wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); } } } else if ((!PINFO_FD_VISITED(pinfo)) && (data->transaction_state != STATE_INVALID)) { usbll_endpoint_info_t *ep_info; gboolean from_host; from_host = usbll_is_data_from_host(data->transaction_state); ep_info = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, from_host); if (ep_info->type == USBLL_EP_CONTROL) { if (ep_info->requested_transfer_length > 0) { if (pid == ep_info->last_data_pid) { if (ep_info->last_data_len == 0) { /* We received DATA0 immediately after SETUP (as response to OUT or IN) * Do not reassemble the data, instead mark it as unexpected PID. */ data->transaction_state = STATE_INVALID; } else { /* Retransmission */ transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = ep_info->active_transfer_key; transfer->offset = ep_info->transfer_offset - ep_info->last_data_len; transfer->type = USBLL_EP_CONTROL; transfer->from_host = from_host; transfer->more_frags = !packet_ends_transfer(ep_info, transfer->offset, data_size); wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); /* Do not update endpoint info, previously transferred packet must have * the same data length as retransmitted packet. */ } } else if ((pid == USB_PID_DATA_DATA0) || (pid == USB_PID_DATA_DATA1)) { if (ep_info->active_transfer_key == 0) { /* This is allowed only when Data stage is from device to host */ DISSECTOR_ASSERT(!from_host); DISSECTOR_ASSERT(ep_info->transfer_offset == 0); DISSECTOR_ASSERT(ep_info->last_data_len == 0); ep_info->active_transfer_key = pinfo->num; if ((ep_info->data == USBLL_TRANSFER_GET_DEVICE_DESCRIPTOR) && (data_size >= 8)) { usbll_endpoint_info_t *ep_out; usb_speed_t speed; guint16 max_packet_size; ep_out = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, TRUE); max_packet_size = tvb_get_guint8(tvb, data_offset + 7); speed = usbll_get_data_transaction_speed(data); max_packet_size = sanitize_usb_max_packet_size(ENDPOINT_TYPE_CONTROL, speed, max_packet_size); ep_info->max_packet_size = ep_out->max_packet_size = max_packet_size; } } transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = ep_info->active_transfer_key; transfer->offset = ep_info->transfer_offset; transfer->type = USBLL_EP_CONTROL; transfer->from_host = from_host; transfer->more_frags = !packet_ends_transfer(ep_info, transfer->offset, data_size); wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); ep_info->last_data_pid = pid; ep_info->last_data_acked = usbll_is_split_data_from_device(data->transaction_state); ep_info->transfer_offset += data_size; ep_info->last_data_len = data_size; } else { /* Only DATA0 and DATA1 are allowed in Control transfers */ data->transaction_state = STATE_INVALID; } } else { /* We don't know anything about the control transfer. * Most likely the capture is incomplete, there's nothing to be done here. */ } } else if ((ep_info->type == USBLL_EP_BULK) || (ep_info->type == USBLL_EP_INTERRUPT)) { if (pid == ep_info->last_data_pid) { /* Retransmission */ DISSECTOR_ASSERT(ep_info->active_transfer_key != 0); transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = ep_info->active_transfer_key; transfer->offset = ep_info->transfer_offset - ep_info->last_data_len; transfer->type = ep_info->type; transfer->from_host = from_host; transfer->more_frags = !packet_ends_transfer(ep_info, transfer->offset, data_size); wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); /* Do not update endpoint info, previously transferred packet must have * the same data length as retransmitted packet. */ } else if ((ep_info->active_transfer_key == 0) || packet_ends_transfer(ep_info, ep_info->transfer_offset, ep_info->last_data_len)) { /* Packet starts new transfer */ transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = pinfo->num; transfer->offset = 0; transfer->type = ep_info->type; transfer->from_host = from_host; transfer->more_frags = !packet_ends_transfer(ep_info, transfer->offset, data_size); wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); ep_info->last_data_pid = pid; ep_info->last_data_acked = usbll_is_split_data_from_device(data->transaction_state); ep_info->active_transfer_key = pinfo->num; ep_info->transfer_offset = data_size; ep_info->last_data_len = data_size; } else { transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = ep_info->active_transfer_key; transfer->offset = ep_info->transfer_offset; transfer->type = ep_info->type; transfer->from_host = from_host; transfer->more_frags = !packet_ends_transfer(ep_info, transfer->offset, data_size); wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); ep_info->last_data_pid = pid; ep_info->last_data_acked = usbll_is_split_data_from_device(data->transaction_state); ep_info->transfer_offset += data_size; ep_info->last_data_len = data_size; } } else if (ep_info->type == USBLL_EP_ISOCHRONOUS) { /* TODO: Reassemble high-bandwidth endpoints data */ transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = pinfo->num; transfer->offset = 0; transfer->type = ep_info->type; transfer->from_host = from_host; transfer->more_frags = FALSE; wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); } } usbll_construct_urb(tvb, pinfo, tree, data_offset, data_size, data); return offset; } static gint dissect_usbll_split(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint8 pid, usbll_data_t *data) { guint8 hub_address; guint8 hub_port; proto_item *split_e_u; proto_item *split_s; gint32 tmp = tvb_get_gint24(tvb, offset, ENC_LITTLE_ENDIAN); hub_address = SPLIT_BITS_GET_HUB_ADDRESS(tmp); hub_port = SPLIT_BITS_GET_HUB_PORT(tmp); col_append_str(pinfo->cinfo, COL_INFO, (tmp & SPLIT_BIT_START_COMPLETE) ? " Complete" : " Start"); proto_tree_add_uint(tree, hf_usbll_split_hub_addr, tvb, offset, 3, tmp); proto_tree_add_uint(tree, hf_usbll_split_sc, tvb, offset, 3, tmp); proto_tree_add_uint(tree, hf_usbll_split_port, tvb, offset, 3, tmp); if (tmp & SPLIT_BIT_START_COMPLETE) { proto_tree_add_uint(tree, hf_usbll_split_s, tvb, offset, 3, tmp); split_e_u = proto_tree_add_uint(tree, hf_usbll_split_u, tvb, offset, 3, tmp); if (tmp & SPLIT_BIT_E_U) expert_add_info(pinfo, split_e_u, &ei_invalid_e_u); } else { /* S/E fields have special meaning for Isochronous OUT transfers. */ if (data->next && data->next->transaction_state == STATE_SSPLIT_ISOCHRONOUS_OUT) { DISSECTOR_ASSERT(SPLIT_BITS_GET_ENDPOINT_TYPE(tmp) == USB_EP_TYPE_ISOCHRONOUS); proto_tree_add_uint(tree, hf_usbll_split_iso_se, tvb, offset, 3, tmp); } else if (SPLIT_BITS_GET_ENDPOINT_TYPE(tmp) != USB_EP_TYPE_ISOCHRONOUS) { split_s = proto_tree_add_uint(tree, hf_usbll_split_s, tvb, offset, 3, tmp); split_e_u = proto_tree_add_uint(tree, hf_usbll_split_e, tvb, offset, 3, tmp); if ((SPLIT_BITS_GET_ENDPOINT_TYPE(tmp) == USB_EP_TYPE_BULK) && (tmp & SPLIT_BIT_SPEED)) expert_add_info(pinfo, split_s, &ei_invalid_s); if (tmp & SPLIT_BIT_E_U) expert_add_info(pinfo, split_e_u, &ei_invalid_e_u); } else if (data->next && (data->next->transaction_state == STATE_SSPLIT_ISOCHRONOUS_IN || data->next->transaction_state == STATE_CSPLIT_ISOCHRONOUS_IN)) { DISSECTOR_ASSERT(SPLIT_BITS_GET_ENDPOINT_TYPE(tmp) == USB_EP_TYPE_ISOCHRONOUS); split_s = proto_tree_add_uint(tree, hf_usbll_split_s, tvb, offset, 3, tmp); split_e_u = proto_tree_add_uint(tree, hf_usbll_split_e, tvb, offset, 3, tmp); if (tmp & SPLIT_BIT_SPEED) expert_add_info(pinfo, split_s, &ei_invalid_s); if (tmp & SPLIT_BIT_E_U) expert_add_info(pinfo, split_e_u, &ei_invalid_e_u); } } proto_tree_add_uint(tree, hf_usbll_split_et, tvb, offset, 3, tmp); proto_tree_add_checksum(tree, tvb, offset, hf_usbll_split_crc5, hf_usbll_split_crc5_status, &ei_wrong_split_crc5, pinfo, crc5_usb_19bit_input(tmp), ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 3; if (!PINFO_FD_VISITED(pinfo)) { usbll_transaction_info_t *transaction; transaction = wmem_new0(wmem_file_scope(), usbll_transaction_info_t); transaction->starts_in = pinfo->num; transaction->pid = pid; transaction->address = hub_address; transaction->endpoint = hub_port; if (SPLIT_BITS_GET_ENDPOINT_TYPE(tmp) == USB_EP_TYPE_ISOCHRONOUS) transaction->speed = USB_SPEED_FULL; else transaction->speed = (tmp & SPLIT_BIT_SPEED) ? USB_SPEED_LOW : USB_SPEED_FULL; data->transaction = transaction; if (tmp & SPLIT_BIT_START_COMPLETE) { switch (SPLIT_BITS_GET_ENDPOINT_TYPE(tmp)) { case USB_EP_TYPE_CONTROL: data->transaction_state = STATE_CSPLIT_CONTROL; break; case USB_EP_TYPE_ISOCHRONOUS: data->transaction_state = STATE_CSPLIT_ISOCHRONOUS; break; case USB_EP_TYPE_BULK: data->transaction_state = STATE_CSPLIT_BULK; break; case USB_EP_TYPE_INTERRUPT: data->transaction_state = STATE_CSPLIT_INTERRUPT; break; } } else { switch (SPLIT_BITS_GET_ENDPOINT_TYPE(tmp)) { case USB_EP_TYPE_CONTROL: data->transaction_state = STATE_SSPLIT_CONTROL; break; case USB_EP_TYPE_ISOCHRONOUS: data->transaction_state = STATE_SSPLIT_ISOCHRONOUS; break; case USB_EP_TYPE_BULK: data->transaction_state = STATE_SSPLIT_BULK; break; case USB_EP_TYPE_INTERRUPT: data->transaction_state = STATE_SSPLIT_INTERRUPT; break; } } } return offset; } static gint dissect_usbll_handshake(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int offset, guint8 pid, usbll_data_t *data) { if (!PINFO_FD_VISITED(pinfo)) { usbll_state_t prev_state; prev_state = data->prev ? data->prev->transaction_state : STATE_IDLE; data->transaction_state = usbll_next_state(prev_state, pid); if (data->transaction_state != STATE_INVALID) { DISSECTOR_ASSERT(data->prev != NULL); DISSECTOR_ASSERT(data->prev->transaction != NULL); data->transaction = data->prev->transaction; } if (usbll_is_setup_ack(data->transaction_state)) { usbll_endpoint_info_t *ep_out, *ep_in; ep_out = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, TRUE); ep_in = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, FALSE); if ((ep_out->type == USBLL_EP_CONTROL) && (ep_in->type == USBLL_EP_CONTROL)) { if (ep_out->active_transfer_key != 0) { DISSECTOR_ASSERT(ep_in->active_transfer_key == 0); ep_out->last_data_acked = TRUE; } else if (ep_in->active_transfer_key != 0) { DISSECTOR_ASSERT(ep_out->active_transfer_key == 0); ep_in->last_data_acked = TRUE; } } } if (usbll_is_data_ack(data->transaction_state)) { usbll_endpoint_info_t *ep_info; gboolean from_host; from_host = usbll_is_acked_data_from_host(data->transaction_state); ep_info = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, from_host); ep_info->last_data_acked = TRUE; } if (usbll_is_endpoint_stall(data->transaction_state)) { usbll_endpoint_info_t *ep_info; usbll_transfer_info_t *transfer; guint32 last_offset; gboolean from_host; from_host = usbll_is_stalled_data_from_host(data->transaction_state); ep_info = usbll_get_endpoint_info(pinfo, data->transaction->address, data->transaction->endpoint, from_host); last_offset = ep_info->transfer_offset - ep_info->last_data_len; if (ep_info->active_transfer_key && !packet_ends_transfer(ep_info, last_offset, ep_info->last_data_len)) { /* STALL terminates ongoing transfer. While the STALL packet is * always sent by device, the transfer can be either IN or OUT. * For IN usbll source and destination will match usb source * and destination. For OUT the source and destination will be * swapped in usb dissector. */ transfer = wmem_new0(wmem_file_scope(), usbll_transfer_info_t); transfer->first_packet = ep_info->active_transfer_key; if (!from_host) { /* Data is from device, all reassembled data is in URB */ transfer->offset = ep_info->transfer_offset; } else if (data->transaction_state == STATE_PING_STALL) { if (ep_info->last_data_acked) { /* Last DATA packet was acknowledged with NYET */ transfer->offset = ep_info->transfer_offset; } else { /* Last DATA packet was NAKed. Drop it from URB. */ transfer->offset = last_offset; } } else { /* Last DATA packet was not acknowledged by device because * endpoint was STALLed. Drop last DATA packet from URB. */ transfer->offset = last_offset; } transfer->type = ep_info->type; transfer->from_host = from_host; transfer->more_frags = FALSE; wmem_map_insert(transfer_info, GUINT_TO_POINTER(pinfo->num), transfer); } /* Transfers cannot span across STALL handshake */ ep_info->last_data_pid = 0; ep_info->last_data_acked = FALSE; ep_info->active_transfer_key = 0; ep_info->transfer_offset = 0; ep_info->last_data_len = 0; ep_info->requested_transfer_length = 0; } } usbll_construct_urb(tvb, pinfo, tree, offset, 0, data); return offset; } static void check_for_extended_subpid(guint8 pid, usbll_data_t *data) { if (data->prev && data->prev->transaction_state == STATE_EXT) { data->transaction_state = usbll_next_state(STATE_EXT, pid); if (data->transaction_state != STATE_SUBPID_INVALID) { DISSECTOR_ASSERT(data->prev != NULL); DISSECTOR_ASSERT(data->prev->transaction != NULL); data->transaction = data->prev->transaction; } } } static gint dissect_usbll_lpm_token(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { guint16 attributes_bits; static int * const attributes_fields[] = { &hf_usbll_lpm_link_state, &hf_usbll_lpm_besl, &hf_usbll_lpm_remote_wake, &hf_usbll_lpm_reserved, NULL }; attributes_bits = tvb_get_letohs(tvb, offset); proto_tree_add_bitmask_list_value(tree, tvb, offset, 2, attributes_fields, attributes_bits); proto_tree_add_checksum(tree, tvb, offset, hf_usbll_crc5, hf_usbll_crc5_status, &ei_wrong_crc5, pinfo, crc5_usb_11bit_input(attributes_bits), ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); offset += 2; return offset; } static usbll_data_t * usbll_restore_data(packet_info *pinfo) { return (usbll_data_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_usbll, pinfo->num); } static usbll_data_t * usbll_create_data(packet_info *pinfo) { /* allocate a data structure, as it is the first call on this frame. */ usbll_data_t *n_data_ptr = wmem_new0(wmem_file_scope(), usbll_data_t); p_add_proto_data(wmem_file_scope(), pinfo, proto_usbll, pinfo->num, n_data_ptr); if (usbll_data_ptr) *n_data_ptr = *usbll_data_ptr; n_data_ptr->transaction_state = STATE_IDLE; n_data_ptr->prev = usbll_data_ptr; if (n_data_ptr->prev) { n_data_ptr->prev->next = n_data_ptr; } return n_data_ptr; } static void usbll_cleanup_data(void) { usbll_data_ptr = NULL; tt_non_periodic = NULL; tt_periodic = NULL; ep_info_in = NULL; ep_info_out = NULL; } static int dissect_usbll_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, usb_speed_t speed) { proto_item *item; proto_tree *tree; gint offset = 0; guint8 pid; gboolean is_subpid; const gchar *str; usbll_data_t *data; item = proto_tree_add_item(parent_tree, proto_usbll, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_usbll); pid = tvb_get_guint8(tvb, offset); if (PINFO_FD_VISITED(pinfo)) { data = usbll_restore_data(pinfo); } else { data = usbll_data_ptr = usbll_create_data(pinfo); check_for_extended_subpid(pid, data); } is_subpid = usbll_is_extended_subpid(data->transaction_state); if (is_subpid) { proto_tree_add_item(tree, hf_usbll_subpid, tvb, offset, 1, ENC_LITTLE_ENDIAN); str = try_val_to_str(pid, usb_subpid_vals); } else { proto_tree_add_item(tree, hf_usbll_pid, tvb, offset, 1, ENC_LITTLE_ENDIAN); str = try_val_to_str(pid, usb_packetid_vals); } offset++; col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBLL"); if (str) { col_set_str(pinfo->cinfo, COL_INFO, str); } else if (is_subpid) { col_add_fstr(pinfo->cinfo, COL_INFO, "Invalid SubPID (0x%02x)", pid); expert_add_info(pinfo, item, &ei_invalid_subpid); } else { col_add_fstr(pinfo->cinfo, COL_INFO, "Invalid Packet ID (0x%02x)", pid); expert_add_info(pinfo, item, &ei_invalid_pid); } if (is_subpid) { switch (pid) { case USB_SUBPID_LPM: offset = dissect_usbll_lpm_token(tvb, pinfo, tree, offset); break; default: break; } } else { switch (pid) { case USB_PID_TOKEN_SETUP: case USB_PID_TOKEN_OUT: case USB_PID_TOKEN_IN: case USB_PID_SPECIAL_PING: case USB_PID_SPECIAL_EXT: offset = dissect_usbll_token(tvb, pinfo, tree, offset, pid, data, speed); break; case USB_PID_DATA_DATA0: case USB_PID_DATA_DATA1: case USB_PID_DATA_DATA2: case USB_PID_DATA_MDATA: offset = dissect_usbll_data(tvb, pinfo, tree, offset, pid, data); break; case USB_PID_HANDSHAKE_ACK: case USB_PID_HANDSHAKE_NAK: case USB_PID_HANDSHAKE_NYET: case USB_PID_HANDSHAKE_STALL: offset = dissect_usbll_handshake(tvb, pinfo, tree, offset, pid, data); break; case USB_PID_TOKEN_SOF: offset = dissect_usbll_sof(tvb, pinfo, tree, offset); break; case USB_PID_SPECIAL_SPLIT: offset = dissect_usbll_split(tvb, pinfo, tree, offset, pid, data); break; case USB_PID_SPECIAL_PRE_OR_ERR: break; default: break; } } usbll_generate_address(tree, tvb, pinfo, data); if (data->transaction_state == STATE_INVALID) { expert_add_info(pinfo, item, &ei_invalid_pid_sequence); } else if (data->transaction_state == STATE_SUBPID_NOT_REUSABLE) { expert_add_info(pinfo, item, &ei_conflicting_subpid); } if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_expert(tree, pinfo, &ei_undecoded, tvb, offset, -1); offset += tvb_captured_length_remaining(tvb, offset); } return offset; } static int dissect_usbll_unknown_speed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { return dissect_usbll_packet(tvb, pinfo, parent_tree, global_dissect_unknown_speed_as); } static int dissect_usbll_low_speed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { return dissect_usbll_packet(tvb, pinfo, parent_tree, USB_SPEED_LOW); } static int dissect_usbll_full_speed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { return dissect_usbll_packet(tvb, pinfo, parent_tree, USB_SPEED_FULL); } static int dissect_usbll_high_speed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { return dissect_usbll_packet(tvb, pinfo, parent_tree, USB_SPEED_HIGH); } void proto_register_usbll(void) { module_t *usbll_module; expert_module_t *expert_module; static hf_register_info hf[] = { /* Common header fields */ { &hf_usbll_pid, { "PID", "usbll.pid", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_packetid_vals_ext, 0x00, "USB Packet ID", HFILL }}, { &hf_usbll_src, { "Source", "usbll.src", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usbll_dst, { "Destination", "usbll.dst", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_usbll_addr, { "Source or Destination", "usbll.addr", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* Token header fields */ { &hf_usbll_device_addr, { "Address", "usbll.device_addr", FT_UINT16, BASE_DEC, NULL, 0x007F, NULL, HFILL }}, { &hf_usbll_endp, { "Endpoint", "usbll.endp", FT_UINT16, BASE_DEC, NULL, 0x0780, NULL, HFILL }}, /*SOF header field */ { &hf_usbll_sof_framenum, { "Frame Number", "usbll.frame_num", FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL }}, /* Token and SOF header fields */ { &hf_usbll_crc5, { "CRC5", "usbll.crc5", FT_UINT16, BASE_HEX, NULL, 0xF800, NULL, HFILL }}, { &hf_usbll_crc5_status, { "CRC5 Status", "usbll.crc5.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0, NULL, HFILL }}, /* Data header fields */ { &hf_usbll_data, { "Data", "usbll.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_usbll_data_crc, { "CRC", "usbll.crc16", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbll_data_crc_status, { "CRC Status", "usbll.crc16.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0, NULL, HFILL }}, /* Split header fields */ { &hf_usbll_split_hub_addr, { "Hub Address", "usbll.split_hub_addr", FT_UINT24, BASE_DEC, NULL, 0x00007F, NULL, HFILL }}, { &hf_usbll_split_sc, { "SC", "usbll.split_sc", FT_UINT24, BASE_DEC, VALS(usb_start_complete_vals), 0x000080, NULL, HFILL }}, { &hf_usbll_split_port, { "Port", "usbll.split_port", FT_UINT24, BASE_DEC, NULL, 0x007F00, NULL, HFILL }}, { &hf_usbll_split_s, { "Speed", "usbll.split_s", FT_UINT24, BASE_DEC, VALS(usb_split_speed_vals), 0x008000, NULL, HFILL }}, { &hf_usbll_split_e, { "E", "usbll.split_e", FT_UINT24, BASE_DEC, NULL, 0x010000, "Unused. Must be 0.", HFILL }}, { &hf_usbll_split_u, { "U", "usbll.split_u", FT_UINT24, BASE_DEC, NULL, 0x010000, "Unused. Must be 0.", HFILL }}, { &hf_usbll_split_iso_se, { "Start and End", "usbll.split_se", FT_UINT24, BASE_DEC, VALS(usb_split_iso_se_vals), 0x018000, NULL, HFILL }}, { &hf_usbll_split_et, { "Endpoint Type", "usbll.split_et", FT_UINT24, BASE_DEC, VALS(usb_endpoint_type_vals), 0x060000, NULL, HFILL }}, { &hf_usbll_split_crc5, { "CRC5", "usbll.split_crc5", FT_UINT24, BASE_HEX, NULL, 0xF80000, NULL, HFILL }}, { &hf_usbll_split_crc5_status, { "CRC5 Status", "usbll.split_crc5.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0, NULL, HFILL }}, { &hf_usbll_transfer_fragments, { "Transfer fragments", "usbll.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment, {"Transfer fragment", "usbll.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_overlap, {"Transfer fragment overlap", "usbll.fragment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_overlap_conflicts, {"Transfer fragment overlapping with conflicting data", "usbll.fragment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_multiple_tails, {"Transfer has multiple tail fragments", "usbll.fragment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_too_long_fragment, {"Transfer fragment too long", "usbll.fragment.too_long_fragment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_error, {"Transfer defragmentation error", "usbll.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_fragment_count, {"Transfer fragment count", "usbll.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_reassembled_in, {"Reassembled in", "usbll.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_usbll_transfer_reassembled_length, {"Reassembled length", "usbll.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, /* USB 2.0 Link Power Management Addendum */ { &hf_usbll_subpid, { "SubPID", "usbll.subpid", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &usb_subpid_vals_ext, 0x00, "Extended Token Packet SubPID", HFILL }}, { &hf_usbll_lpm_link_state, { "bLinkState", "usbll.lpm_link_state", FT_UINT16, BASE_CUSTOM, CF_FUNC(lpm_link_state_str), 0x000F, NULL, HFILL }}, { &hf_usbll_lpm_besl, { "BESL", "usbll.lpm_besl", FT_UINT16, BASE_CUSTOM, CF_FUNC(usb_lpm_besl_str), 0x00F0, "Best Effort Service Latency", HFILL}}, { &hf_usbll_lpm_remote_wake, { "bRemoteWake", "usbll.lpm_remote_wake", FT_UINT16, BASE_DEC, VALS(usb_lpm_remote_wake_vals), 0x0100, NULL, HFILL }}, { &hf_usbll_lpm_reserved, { "Reserved", "usbll.lpm_reserved", FT_UINT16, BASE_DEC, NULL, 0x0600, NULL, HFILL }}, }; static ei_register_info ei[] = { { &ei_invalid_pid, { "usbll.invalid_pid", PI_MALFORMED, PI_ERROR, "Invalid USB Packet ID", EXPFILL }}, { &ei_invalid_subpid, { "usbll.invalid_subpid", PI_MALFORMED, PI_ERROR, "Invalid SubPID", EXPFILL }}, { &ei_conflicting_subpid, { "usbll.conflicting_subpid", PI_MALFORMED, PI_ERROR, "Token PID cannot be reused as SubPID", EXPFILL }}, { &ei_undecoded, { "usbll.undecoded", PI_UNDECODED, PI_WARN, "Not dissected yet (report to wireshark.org)", EXPFILL }}, { &ei_wrong_crc5, { "usbll.crc5.wrong", PI_PROTOCOL, PI_WARN, "Wrong CRC", EXPFILL }}, { &ei_wrong_split_crc5, { "usbll.split_crc5.wrong", PI_PROTOCOL, PI_WARN, "Wrong CRC", EXPFILL }}, { &ei_wrong_crc16, { "usbll.crc16.wrong", PI_PROTOCOL, PI_WARN, "Wrong CRC", EXPFILL }}, { &ei_invalid_s, { "usbll.invalid_s", PI_MALFORMED, PI_ERROR, "Invalid bit (Must be 0)", EXPFILL }}, { &ei_invalid_e_u, { "usbll.invalid_e_u", PI_MALFORMED, PI_ERROR, "Invalid bit (Must be 0)", EXPFILL }}, { &ei_invalid_pid_sequence, {"usbll.invalid_pid_sequence", PI_MALFORMED, PI_ERROR, "Invalid PID Sequence",EXPFILL }}, { &ei_invalid_setup_data, {"usbll.invalid_setup_data", PI_MALFORMED, PI_ERROR, "Invalid data length (Must be 8 bytes)", EXPFILL }}, }; static gint *ett[] = { &ett_usbll, &ett_usbll_transfer_fragment, &ett_usbll_transfer_fragments, }; transfer_info = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal); proto_usbll = proto_register_protocol("USB Link Layer", "USBLL", "usbll"); proto_register_field_array(proto_usbll, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_module = expert_register_protocol(proto_usbll); expert_register_field_array(expert_module, ei, array_length(ei)); usbll_module = prefs_register_protocol(proto_usbll, NULL); prefs_register_enum_preference(usbll_module, "global_pref_dissect_unknown_speed_as", "Decode unknown speed packets as", "Use specified speed if speed is not indicated in capture", &global_dissect_unknown_speed_as, dissect_unknown_speed_as, FALSE); register_dissector("usbll", dissect_usbll_unknown_speed, proto_usbll); register_cleanup_routine(usbll_cleanup_data); usbll_address_type = address_type_dissector_register("AT_USBLL", "USBLL Address", usbll_addr_to_str, usbll_addr_str_len, NULL, NULL, NULL, NULL, NULL); reassembly_table_register(&usbll_reassembly_table, &usbll_reassembly_table_functions); } void proto_reg_handoff_usbll(void) { dissector_handle_t unknown_speed_handle = create_dissector_handle(dissect_usbll_unknown_speed, proto_usbll); dissector_handle_t low_speed_handle = create_dissector_handle(dissect_usbll_low_speed, proto_usbll); dissector_handle_t full_speed_handle = create_dissector_handle(dissect_usbll_full_speed, proto_usbll); dissector_handle_t high_speed_handle = create_dissector_handle(dissect_usbll_high_speed, proto_usbll); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_2_0, unknown_speed_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_2_0_LOW_SPEED, low_speed_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_2_0_FULL_SPEED, full_speed_handle); dissector_add_uint("wtap_encap", WTAP_ENCAP_USB_2_0_HIGH_SPEED, high_speed_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usbms-bot.c
/* packet-usbms-bot.c * * usb mass storage (bulk-only transport) dissector * Ronnie Sahlberg 2006 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include "packet-usb.h" #include "packet-scsi.h" void proto_register_usbms_bot(void); void proto_reg_handoff_usbms_bot(void); #define IF_PROTOCOL_BULK_ONLY 0x50 /* protocols and header fields */ static int proto_usbms_bot = -1; static int hf_usbms_bot_dCBWSignature = -1; static int hf_usbms_bot_dCBWTag = -1; static int hf_usbms_bot_dCBWDataTransferLength = -1; static int hf_usbms_bot_dCBWFlags = -1; static int hf_usbms_bot_dCBWTarget = -1; static int hf_usbms_bot_dCBWLUN = -1; static int hf_usbms_bot_dCBWCBLength = -1; static int hf_usbms_bot_dCSWSignature = -1; static int hf_usbms_bot_dCSWDataResidue = -1; static int hf_usbms_bot_dCSWStatus = -1; static int hf_usbms_bot_request = -1; static int hf_usbms_bot_value = -1; static int hf_usbms_bot_index = -1; static int hf_usbms_bot_length = -1; static int hf_usbms_bot_maxlun = -1; static gint ett_usbms_bot = -1; static dissector_handle_t usbms_bot_bulk_handle; /* there is one such structure for each masstorage conversation */ typedef struct _usbms_bot_conv_info_t { wmem_tree_t *itl; /* indexed by LUN */ wmem_tree_t *itlq; /* pinfo->num */ } usbms_bot_conv_info_t; static const value_string status_vals[] = { {0x00, "Command Passed"}, {0x01, "Command Failed"}, {0x02, "Phase Error"}, {0, NULL} }; static void dissect_usbms_bot_reset(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { if(is_request){ proto_tree_add_item(tree, hf_usbms_bot_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usbms_bot_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usbms_bot_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { /* no data in reset response */ } } static void dissect_usbms_bot_get_max_lun(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info _U_, usb_conv_info_t *usb_conv_info _U_) { if(is_request){ proto_tree_add_item(tree, hf_usbms_bot_value, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usbms_bot_index, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_usbms_bot_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); /*offset += 2;*/ } else { proto_tree_add_item(tree, hf_usbms_bot_maxlun, tvb, offset, 1, ENC_LITTLE_ENDIAN); /*offset++;*/ } } typedef void (*usb_setup_dissector)(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_request, usb_trans_info_t *usb_trans_info, usb_conv_info_t *usb_conv_info); typedef struct _usb_setup_dissector_table_t { guint8 request; usb_setup_dissector dissector; } usb_setup_dissector_table_t; #define USB_SETUP_RESET 0xff #define USB_SETUP_GET_MAX_LUN 0xfe static const usb_setup_dissector_table_t setup_dissectors[] = { {USB_SETUP_RESET, dissect_usbms_bot_reset}, {USB_SETUP_GET_MAX_LUN, dissect_usbms_bot_get_max_lun}, {0, NULL} }; static const value_string setup_request_names_vals[] = { {USB_SETUP_RESET, "RESET"}, {USB_SETUP_GET_MAX_LUN, "GET MAX LUN"}, {0, NULL} }; /* Dissector for mass storage control . * Returns tvb_captured_length(tvb) if a class specific dissector was found * and 0 othervise. */ static gint dissect_usbms_bot_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { gboolean is_request; usb_conv_info_t *usb_conv_info; usb_trans_info_t *usb_trans_info; int offset=0; usb_setup_dissector dissector = NULL; const usb_setup_dissector_table_t *tmp; proto_tree *tree; proto_item *ti; /* Reject the packet if data or usb_trans_info are NULL */ if (data == NULL || ((usb_conv_info_t *)data)->usb_trans_info == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; usb_trans_info = usb_conv_info->usb_trans_info; is_request=(pinfo->srcport==NO_ENDPOINT); /* See if we can find a class specific dissector for this request */ for(tmp=setup_dissectors;tmp->dissector;tmp++){ if (tmp->request == usb_trans_info->setup.request){ dissector=tmp->dissector; break; } } /* No we could not find any class specific dissector for this request * return 0 and let USB try any of the standard requests. */ if(!dissector){ return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBMS"); ti = proto_tree_add_protocol_format(parent_tree, proto_usbms_bot, tvb, 0, -1, "USB Mass Storage"); tree = proto_item_add_subtree(ti, ett_usbms_bot); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", val_to_str(usb_trans_info->setup.request, setup_request_names_vals, "Unknown type %x"), is_request?"Request":"Response"); if(is_request){ proto_tree_add_item(tree, hf_usbms_bot_request, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; } dissector(pinfo, tree, tvb, offset, is_request, usb_trans_info, usb_conv_info); return tvb_captured_length(tvb); } static proto_tree * create_usbms_bot_protocol_tree(tvbuff_t *tvb, proto_tree *parent_tree) { proto_tree *tree; proto_item *ti; ti = proto_tree_add_protocol_format(parent_tree, proto_usbms_bot, tvb, 0, -1, "USB Mass Storage"); tree = proto_item_add_subtree(ti, ett_usbms_bot); return tree; } static int dissect_usbms_bot_cbw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, usbms_bot_conv_info_t *usbms_bot_conv_info) { proto_tree *tree = create_usbms_bot_protocol_tree(tvb, parent_tree); tvbuff_t *cdb_tvb; int offset=0; int cdbrlen, cdblen; guint8 lun, flags; guint32 datalen; itl_nexus_t *itl; itlq_nexus_t *itlq; /* dCBWSignature */ proto_tree_add_item(tree, hf_usbms_bot_dCBWSignature, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; /* dCBWTag */ proto_tree_add_item(tree, hf_usbms_bot_dCBWTag, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; /* dCBWDataTransferLength */ proto_tree_add_item(tree, hf_usbms_bot_dCBWDataTransferLength, tvb, offset, 4, ENC_LITTLE_ENDIAN); datalen=tvb_get_letohl(tvb, offset); offset+=4; /* dCBWFlags */ proto_tree_add_item(tree, hf_usbms_bot_dCBWFlags, tvb, offset, 1, ENC_LITTLE_ENDIAN); flags=tvb_get_guint8(tvb, offset); offset+=1; /* dCBWLUN */ proto_tree_add_item(tree, hf_usbms_bot_dCBWTarget, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_usbms_bot_dCBWLUN, tvb, offset, 1, ENC_LITTLE_ENDIAN); lun=tvb_get_guint8(tvb, offset)&0x0f; offset+=1; /* make sure we have a ITL structure for this LUN */ itl=(itl_nexus_t *)wmem_tree_lookup32(usbms_bot_conv_info->itl, lun); if(!itl){ itl=wmem_new(wmem_file_scope(), itl_nexus_t); itl->cmdset=0xff; itl->conversation=NULL; wmem_tree_insert32(usbms_bot_conv_info->itl, lun, itl); } /* make sure we have an ITLQ structure for this LUN/transaction */ itlq=(itlq_nexus_t *)wmem_tree_lookup32(usbms_bot_conv_info->itlq, pinfo->num); if(!itlq){ itlq=wmem_new(wmem_file_scope(), itlq_nexus_t); itlq->lun=lun; itlq->scsi_opcode=0xffff; itlq->task_flags=0; if(datalen){ if(flags&0x80){ itlq->task_flags|=SCSI_DATA_READ; } else { itlq->task_flags|=SCSI_DATA_WRITE; } } itlq->data_length=datalen; itlq->bidir_data_length=0; itlq->fc_time=pinfo->abs_ts; itlq->first_exchange_frame=pinfo->num; itlq->last_exchange_frame=0; itlq->flags=0; itlq->alloc_len=0; itlq->extra_data=NULL; wmem_tree_insert32(usbms_bot_conv_info->itlq, pinfo->num, itlq); } /* dCBWCBLength */ proto_tree_add_item(tree, hf_usbms_bot_dCBWCBLength, tvb, offset, 1, ENC_LITTLE_ENDIAN); cdbrlen=tvb_get_guint8(tvb, offset)&0x1f; offset+=1; cdblen=cdbrlen; if(cdblen>tvb_captured_length_remaining(tvb, offset)){ cdblen=tvb_captured_length_remaining(tvb, offset); } if(cdblen){ cdb_tvb=tvb_new_subset_length_caplen(tvb, offset, cdblen, cdbrlen); dissect_scsi_cdb(cdb_tvb, pinfo, parent_tree, SCSI_DEV_UNKNOWN, itlq, itl); } return tvb_captured_length(tvb); } static int dissect_usbms_bot_csw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, usbms_bot_conv_info_t *usbms_bot_conv_info) { proto_tree *tree = create_usbms_bot_protocol_tree(tvb, parent_tree); int offset=0; guint8 status; itl_nexus_t *itl; itlq_nexus_t *itlq; /* dCSWSignature */ proto_tree_add_item(tree, hf_usbms_bot_dCSWSignature, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; /* dCSWTag */ proto_tree_add_item(tree, hf_usbms_bot_dCBWTag, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; /* dCSWDataResidue */ proto_tree_add_item(tree, hf_usbms_bot_dCSWDataResidue, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; /* dCSWStatus */ proto_tree_add_item(tree, hf_usbms_bot_dCSWStatus, tvb, offset, 1, ENC_LITTLE_ENDIAN); status=tvb_get_guint8(tvb, offset); /*offset+=1;*/ itlq=(itlq_nexus_t *)wmem_tree_lookup32_le(usbms_bot_conv_info->itlq, pinfo->num); if(!itlq){ return tvb_captured_length(tvb); } itlq->last_exchange_frame=pinfo->num; itl=(itl_nexus_t *)wmem_tree_lookup32(usbms_bot_conv_info->itl, itlq->lun); if(!itl){ return tvb_captured_length(tvb); } if(!status){ dissect_scsi_rsp(tvb, pinfo, parent_tree, itlq, itl, 0); } else { /* just send "check condition" */ dissect_scsi_rsp(tvb, pinfo, parent_tree, itlq, itl, 0x02); } return tvb_captured_length(tvb); } static gboolean usbms_bot_bulk_is_cbw(tvbuff_t *tvb, int offset, gboolean is_request) { return is_request && (tvb_reported_length(tvb)==(guint)offset+31) && tvb_get_letohl(tvb, offset) == 0x43425355; } static gboolean usbms_bot_bulk_is_csw(tvbuff_t *tvb, int offset, gboolean is_request) { return !is_request && (tvb_reported_length(tvb)==(guint)offset+13) && tvb_get_letohl(tvb, offset) == 0x53425355; } /* dissector for mass storage bulk data */ static int dissect_usbms_bot_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { usb_conv_info_t *usb_conv_info; usbms_bot_conv_info_t *usbms_bot_conv_info; int offset=0; gboolean is_request; itl_nexus_t *itl; itlq_nexus_t *itlq; tvbuff_t *payload_tvb; /* Reject the packet if data is NULL */ if (data == NULL) return 0; usb_conv_info = (usb_conv_info_t *)data; /* verify that we do have a usbms_bot_conv_info */ usbms_bot_conv_info=(usbms_bot_conv_info_t *)usb_conv_info->class_data; if(!usbms_bot_conv_info){ usbms_bot_conv_info=wmem_new(wmem_file_scope(), usbms_bot_conv_info_t); usbms_bot_conv_info->itl=wmem_tree_new(wmem_file_scope()); usbms_bot_conv_info->itlq=wmem_tree_new(wmem_file_scope()); usb_conv_info->class_data=usbms_bot_conv_info; usb_conv_info->class_data_type = USB_CONV_MASS_STORAGE_BOT; } else if (usb_conv_info->class_data_type != USB_CONV_MASS_STORAGE_BOT) { /* Don't dissect if another USB type is in the conversation */ return 0; } is_request=(pinfo->srcport==NO_ENDPOINT); col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBMS"); col_clear(pinfo->cinfo, COL_INFO); /* * SCSI CDB inside CBW */ if (usbms_bot_bulk_is_cbw(tvb, offset, is_request)) { return dissect_usbms_bot_cbw(tvb, pinfo, parent_tree, usbms_bot_conv_info); } /* * SCSI RESPONSE inside CSW */ if (usbms_bot_bulk_is_csw(tvb, offset, is_request)) { return dissect_usbms_bot_csw(tvb, pinfo, parent_tree, usbms_bot_conv_info); } /* * Ok it was neither CDB not STATUS so just assume it is either data in/out */ itlq=(itlq_nexus_t *)wmem_tree_lookup32_le(usbms_bot_conv_info->itlq, pinfo->num-1); if(!itlq){ create_usbms_bot_protocol_tree(tvb, parent_tree); return tvb_captured_length(tvb); } itl=(itl_nexus_t *)wmem_tree_lookup32(usbms_bot_conv_info->itl, itlq->lun); if(!itl){ create_usbms_bot_protocol_tree(tvb, parent_tree); return tvb_captured_length(tvb); } /* * Workaround USBLL reassembly limitations by anticipating concatenated * SCSI Data IN with CSW and SCSI Data OUT with next CBW. Proper would * involve implementing a framework to allow USB class dissectors to signal * expected transfer length on Bulk IN or Bulk OUT endpoint whenever CBW is * encountered. */ payload_tvb = tvb_new_subset_length(tvb, 0, itlq->data_length); if (usbms_bot_bulk_is_cbw(tvb, itlq->data_length, is_request)) { tvbuff_t *cbw_tvb = tvb_new_subset_length(tvb, itlq->data_length, 31); dissect_scsi_payload(payload_tvb, pinfo, parent_tree, is_request, itlq, itl, 0); dissect_usbms_bot_cbw(cbw_tvb, pinfo, parent_tree, usbms_bot_conv_info); return tvb_captured_length(tvb); } else if (usbms_bot_bulk_is_csw(tvb, itlq->data_length, is_request)) { tvbuff_t *csw_tvb = tvb_new_subset_length(tvb, itlq->data_length, 13); dissect_scsi_payload(payload_tvb, pinfo, parent_tree, is_request, itlq, itl, 0); dissect_usbms_bot_csw(csw_tvb, pinfo, parent_tree, usbms_bot_conv_info); return tvb_captured_length(tvb); } /* Create empty protocol tree so "usbms" filter displays this packet */ create_usbms_bot_protocol_tree(tvb, parent_tree); dissect_scsi_payload(payload_tvb, pinfo, parent_tree, is_request, itlq, itl, 0); return tvb_captured_length(payload_tvb); } static gboolean dissect_usbms_bot_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { const guchar usbc[] = {0x55, 0x53, 0x42, 0x43}; const guchar usbs[] = {0x55, 0x53, 0x42, 0x53}; if (tvb_reported_length(tvb) < 4) return FALSE; if (tvb_memeql(tvb, 0, usbc, sizeof(usbc)) == 0 || tvb_memeql(tvb, 0, usbs, sizeof(usbs)) == 0) { dissect_usbms_bot_bulk(tvb, pinfo, tree, data); return TRUE; } return FALSE; } void proto_register_usbms_bot(void) { static hf_register_info hf[] = { { &hf_usbms_bot_dCBWSignature, { "Signature", "usbms.dCBWSignature", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCBWTag, { "Tag", "usbms.dCBWTag", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCBWDataTransferLength, { "DataTransferLength", "usbms.dCBWDataTransferLength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCBWFlags, { "Flags", "usbms.dCBWFlags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCBWTarget, { "Target", "usbms.dCBWTarget", FT_UINT8, BASE_HEX_DEC, NULL, 0x70, "Target Number when enabling multi-target mode", HFILL }}, { &hf_usbms_bot_dCBWLUN, { "LUN", "usbms.dCBWLUN", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL }}, { &hf_usbms_bot_dCBWCBLength, { "CDB Length", "usbms.dCBWCBLength", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL }}, { &hf_usbms_bot_dCSWSignature, { "Signature", "usbms.dCSWSignature", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCSWDataResidue, { "DataResidue", "usbms.dCSWDataResidue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_dCSWStatus, { "Status", "usbms.dCSWStatus", FT_UINT8, BASE_HEX, VALS(status_vals), 0x0, NULL, HFILL }}, { &hf_usbms_bot_request, { "bRequest", "usbms.setup.bRequest", FT_UINT8, BASE_HEX, VALS(setup_request_names_vals), 0x0, NULL, HFILL }}, { &hf_usbms_bot_value, { "wValue", "usbms.setup.wValue", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_index, { "wIndex", "usbms.setup.wIndex", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_length, { "wLength", "usbms.setup.wLength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_usbms_bot_maxlun, { "Max LUN", "usbms.setup.maxlun", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *usbms_bot_subtrees[] = { &ett_usbms_bot, }; proto_usbms_bot = proto_register_protocol("USB Mass Storage", "USBMS", "usbms"); proto_register_field_array(proto_usbms_bot, hf, array_length(hf)); proto_register_subtree_array(usbms_bot_subtrees, array_length(usbms_bot_subtrees)); usbms_bot_bulk_handle = register_dissector("usbms", dissect_usbms_bot_bulk, proto_usbms_bot); } void proto_reg_handoff_usbms_bot(void) { dissector_handle_t usbms_bot_control_handle; dissector_add_uint("usbms.bulk", IF_PROTOCOL_BULK_ONLY, usbms_bot_bulk_handle); usbms_bot_control_handle = create_dissector_handle(dissect_usbms_bot_control, proto_usbms_bot); dissector_add_uint("usbms.control", IF_PROTOCOL_BULK_ONLY, usbms_bot_control_handle); heur_dissector_add("usb.bulk", dissect_usbms_bot_bulk_heur, "Mass Storage USB Bulk-Only Transport bulk endpoint", "ms_usb_bulk", proto_usbms_bot, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-usbms-uasp.c
/* packet-usbms-uasp.c * Routines for USB Attached SCSI dissection * Copyright 2021, Aidan MacDonald <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include <config.h> #include <epan/packet.h> #include "packet-usb.h" #include "packet-scsi.h" void proto_register_uasp(void); void proto_reg_handoff_uasp(void); #define IF_PROTOCOL_UAS 0x62 static int proto_uasp = -1; static int hf_pipe_usage_descr_pipe_id = -1; static int hf_uas_iu_id = -1; static int hf_uas_tag = -1; static int hf_uas_cmd_command_priority = -1; static int hf_uas_cmd_task_attribute = -1; static int hf_uas_cmd_additional_cdb_length = -1; static int hf_uas_sense_status_qualifier = -1; static int hf_uas_sense_status = -1; static int hf_uas_sense_length = -1; static int hf_uas_response_additional_info = -1; static int hf_uas_response_code = -1; static int hf_uas_taskmgmt_function = -1; static int hf_uas_taskmgmt_tag_of_managed_task = -1; static int hf_uas_tag_started_frame = -1; static int hf_uas_tag_completed_frame = -1; static int hf_uas_tag_read_ready_frame = -1; static int hf_uas_tag_write_ready_frame = -1; static int hf_uas_tag_data_recv_frame = -1; static int hf_uas_tag_data_sent_frame = -1; static int ett_uasp = -1; static int ett_uasp_desc = -1; #define DT_PIPE_USAGE 0x24 static const value_string uasp_descriptor_type_vals[] = { {DT_PIPE_USAGE, "Pipe Usage"}, {0, NULL} }; static value_string_ext uasp_descriptor_type_vals_ext = VALUE_STRING_EXT_INIT(uasp_descriptor_type_vals); #define COMMAND_PIPE_ID 0x01 #define STATUS_PIPE_ID 0x02 #define DATA_IN_PIPE_ID 0x03 #define DATA_OUT_PIPE_ID 0x04 static const value_string uasp_pipe_id_vals[] = { {COMMAND_PIPE_ID, "Command"}, {STATUS_PIPE_ID, "Status"}, {DATA_IN_PIPE_ID, "Data-In"}, {DATA_OUT_PIPE_ID, "Data-Out"}, {0, NULL} }; #define COMMAND_IU_ID 0x01 #define SENSE_IU_ID 0x03 #define RESPONSE_IU_ID 0x04 #define TASK_MGMT_IU_ID 0x05 #define READ_READY_IU_ID 0x06 #define WRITE_READY_IU_ID 0x07 static const value_string uasp_iu_id_vals[] = { {COMMAND_IU_ID, "Command IU"}, {SENSE_IU_ID, "Sense IU"}, {RESPONSE_IU_ID, "Response IU"}, {TASK_MGMT_IU_ID, "Task Management IU"}, {READ_READY_IU_ID, "Read Ready IU"}, {WRITE_READY_IU_ID, "Write Ready IU"}, {0, NULL}, }; typedef struct _uasp_itlq_nexus_t { guint16 tag; /* tag for this ITLQ nexus */ guint32 started_frame; /* when tag was first seen */ guint32 completed_frame; /* when tag was completed */ guint32 read_ready_frame; /* when read ready was issued for tag */ guint32 write_ready_frame; /* when write ready was issued for tag */ guint32 data_recv_frame; /* when read data was received for tag */ guint32 data_sent_frame; /* when write data was sent for tag */ itl_nexus_t* itl; itlq_nexus_t itlq; } uasp_itlq_nexus_t; typedef struct _uasp_conv_info_t { /* for keeping track of what endpoint is used for what */ guint8 command_endpoint; guint8 status_endpoint; guint8 data_in_endpoint; guint8 data_out_endpoint; /* tag of each read/write ready IU; indexed by pinfo->num */ wmem_tree_t* read_ready; wmem_tree_t* write_ready; /* ITL nexus; indexed by LUN */ wmem_tree_t* itl; /* UASP ITLQ nexus per command; multi part key * [0] = UAS tag * [1] = pinfo->num */ wmem_tree_t* itlq; } uasp_conv_info_t; static uasp_conv_info_t* get_uasp_conv_info(usb_conv_info_t *usb_conv_info) { uasp_conv_info_t *uasp_conv_info = (uasp_conv_info_t *)usb_conv_info->class_data; if (!uasp_conv_info) { uasp_conv_info = wmem_new(wmem_file_scope(), uasp_conv_info_t); uasp_conv_info->command_endpoint = 0; uasp_conv_info->status_endpoint = 0; uasp_conv_info->data_in_endpoint = 0; uasp_conv_info->data_out_endpoint = 0; uasp_conv_info->read_ready = wmem_tree_new(wmem_file_scope()); uasp_conv_info->write_ready = wmem_tree_new(wmem_file_scope()); uasp_conv_info->itl = wmem_tree_new(wmem_file_scope()); uasp_conv_info->itlq = wmem_tree_new(wmem_file_scope()); usb_conv_info->class_data = uasp_conv_info; usb_conv_info->class_data_type = USB_CONV_MASS_STORAGE_UASP; } else if (usb_conv_info->class_data_type != USB_CONV_MASS_STORAGE_UASP) { return NULL; } return uasp_conv_info; } static guint16 get_scsi_lun(tvbuff_t* tvb, int offset) { guint16 lun; /* Copied from packet-iscsi.c - not really correct but good enough... */ if (tvb_get_guint8(tvb, offset) & 0x40) { /* volume set addressing */ lun = tvb_get_guint8(tvb, offset) & 0x3f; lun <<= 8; lun |= tvb_get_guint8(tvb,offset + 1); } else { lun = tvb_get_guint8(tvb, offset + 1); } return lun; } static uasp_itlq_nexus_t* create_itlq_nexus(packet_info *pinfo, uasp_conv_info_t *uasp_conv_info, guint16 lun, guint16 tag) { wmem_tree_key_t key[3]; guint32 tag32 = tag; itl_nexus_t *itl; uasp_itlq_nexus_t *uitlq; /* ensure ITL nexus exists */ itl = (itl_nexus_t *)wmem_tree_lookup32(uasp_conv_info->itl, lun); if(!itl) { itl = wmem_new(wmem_file_scope(), itl_nexus_t); itl->cmdset = 0xff; itl->conversation = NULL; wmem_tree_insert32(uasp_conv_info->itl, lun, itl); } /* ensure ITLQ nexus exists */ key[0].length = 1; key[0].key = &tag32; key[1].length = 1; key[1].key = &pinfo->num; key[2].length = 0; uitlq = (uasp_itlq_nexus_t *)wmem_tree_lookup32_array(uasp_conv_info->itlq, key); if(!uitlq) { uitlq = wmem_new(wmem_file_scope(), uasp_itlq_nexus_t); uitlq->tag = tag; uitlq->started_frame = pinfo->num; uitlq->completed_frame = 0; uitlq->read_ready_frame = 0; uitlq->write_ready_frame = 0; uitlq->data_sent_frame = 0; uitlq->data_recv_frame = 0; uitlq->itl = itl; uitlq->itlq.lun = lun; uitlq->itlq.scsi_opcode = 0xffff; uitlq->itlq.task_flags = 0; uitlq->itlq.data_length = 0; uitlq->itlq.bidir_data_length = 0; uitlq->itlq.fc_time = pinfo->abs_ts; uitlq->itlq.first_exchange_frame = pinfo->num; uitlq->itlq.last_exchange_frame = 0; uitlq->itlq.flags = 0; uitlq->itlq.alloc_len = 0; uitlq->itlq.extra_data = NULL; wmem_tree_insert32_array(uasp_conv_info->itlq, key, uitlq); } return uitlq; } static uasp_itlq_nexus_t* get_itlq_nexus(packet_info* pinfo, uasp_conv_info_t *uasp_conv_info, guint16 tag) { guint32 tag32 = tag; wmem_tree_key_t key[3]; uasp_itlq_nexus_t *uitlq; key[0].length = 1; key[0].key = &tag32; key[1].length = 1; key[1].key = &pinfo->num; key[2].length = 0; uitlq = (uasp_itlq_nexus_t *)wmem_tree_lookup32_array_le(uasp_conv_info->itlq, key); if(!uitlq || uitlq->tag != tag) return NULL; return uitlq; } static void create_ready_iu(wmem_tree_t* tree, packet_info* pinfo, guint16 tag) { wmem_tree_insert32(tree, pinfo->num, GUINT_TO_POINTER(tag)); } static guint16 get_ready_iu(wmem_tree_t* tree, packet_info* pinfo) { return GPOINTER_TO_UINT(wmem_tree_lookup32_le(tree, pinfo->num)); } #define DATA_WRITE (-1) #define DATA_READ (-2) static void add_uasp_tag_links(tvbuff_t *tvb, proto_tree *uasp_tree, uasp_itlq_nexus_t *uitlq, int kind) { proto_item *ti; if (!uitlq) return; if (uitlq->started_frame && kind != COMMAND_IU_ID && kind != TASK_MGMT_IU_ID) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_started_frame, tvb, 0, 0, uitlq->started_frame); proto_item_set_generated(ti); } if (uitlq->read_ready_frame && kind != READ_READY_IU_ID) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_read_ready_frame, tvb, 0, 0, uitlq->read_ready_frame); proto_item_set_generated(ti); } if (uitlq->write_ready_frame && kind != WRITE_READY_IU_ID) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_write_ready_frame, tvb, 0, 0, uitlq->write_ready_frame); proto_item_set_generated(ti); } if (uitlq->data_recv_frame && kind != DATA_READ) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_data_recv_frame, tvb, 0, 0, uitlq->data_recv_frame); proto_item_set_generated(ti); } if (uitlq->data_sent_frame && kind != DATA_WRITE) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_data_sent_frame, tvb, 0, 0, uitlq->data_sent_frame); proto_item_set_generated(ti); } if (uitlq->completed_frame && kind != SENSE_IU_ID && kind != RESPONSE_IU_ID) { ti = proto_tree_add_uint(uasp_tree, hf_uas_tag_completed_frame, tvb, 0, 0, uitlq->completed_frame); proto_item_set_generated(ti); } } static int dissect_uasp_iu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *uasp_tree, usb_conv_info_t *usb_conv_info _U_, uasp_conv_info_t *uasp_conv_info) { guint8 iu_id; guint8 status; guint16 tag; guint16 lun; uasp_itlq_nexus_t *uitlq = NULL; int rlen, len; tvbuff_t *cdb_tvb; /* an IU header is 4 bytes */ if (tvb_reported_length(tvb) < 4) return 0; iu_id = tvb_get_guint8(tvb, 0); tag = tvb_get_ntohs(tvb, 2); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(iu_id, uasp_iu_id_vals, "Unknown IU [0x%02x]")); proto_tree_add_item(uasp_tree, hf_uas_iu_id, tvb, 0, 1, ENC_NA); proto_tree_add_item(uasp_tree, hf_uas_tag, tvb, 2, 2, ENC_BIG_ENDIAN); switch(iu_id) { case COMMAND_IU_ID: proto_tree_add_item(uasp_tree, hf_uas_cmd_command_priority, tvb, 4, 1, ENC_NA); proto_tree_add_item(uasp_tree, hf_uas_cmd_task_attribute, tvb, 4, 1, ENC_NA); proto_tree_add_item(uasp_tree, hf_uas_cmd_additional_cdb_length, tvb, 6, 1, ENC_NA); dissect_scsi_lun(uasp_tree, tvb, 8); lun = get_scsi_lun(tvb, 8); uitlq = create_itlq_nexus(pinfo, uasp_conv_info, lun, tag); rlen = 16 + tvb_get_guint8(tvb, 6); len = rlen; if (len > tvb_captured_length_remaining(tvb, 16)) len = tvb_captured_length_remaining(tvb, 16); if (len) { cdb_tvb = tvb_new_subset_length_caplen(tvb, 16, len, rlen); dissect_scsi_cdb(cdb_tvb, pinfo, parent_tree, SCSI_DEV_UNKNOWN, &uitlq->itlq, uitlq->itl); } break; case SENSE_IU_ID: proto_tree_add_item(uasp_tree, hf_uas_sense_status_qualifier, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(uasp_tree, hf_uas_sense_status, tvb, 6, 1, ENC_NA); proto_tree_add_item(uasp_tree, hf_uas_sense_length, tvb, 14, 2, ENC_BIG_ENDIAN); uitlq = get_itlq_nexus(pinfo, uasp_conv_info, tag); if (uitlq) { uitlq->completed_frame = pinfo->num; uitlq->itlq.last_exchange_frame = pinfo->num; status = tvb_get_guint8(tvb, 6); dissect_scsi_rsp(tvb, pinfo, parent_tree, &uitlq->itlq, uitlq->itl, status); /* dissect sense info, if any */ rlen = tvb_get_ntohs(tvb, 14); if (rlen) { dissect_scsi_snsinfo(tvb, pinfo, parent_tree, 16, rlen, &uitlq->itlq, uitlq->itl); } } break; case RESPONSE_IU_ID: proto_tree_add_item(uasp_tree, hf_uas_response_additional_info, tvb, 4, 3, ENC_BIG_ENDIAN); proto_tree_add_item(uasp_tree, hf_uas_response_code, tvb, 7, 1, ENC_NA); break; case TASK_MGMT_IU_ID: proto_tree_add_item(uasp_tree, hf_uas_taskmgmt_function, tvb, 4, 1, ENC_NA); proto_tree_add_item(uasp_tree, hf_uas_taskmgmt_tag_of_managed_task, tvb, 6, 2, ENC_BIG_ENDIAN); dissect_scsi_lun(uasp_tree, tvb, 8); break; case READ_READY_IU_ID: uitlq = get_itlq_nexus(pinfo, uasp_conv_info, tag); if (uitlq) uitlq->read_ready_frame = pinfo->num; create_ready_iu(uasp_conv_info->read_ready, pinfo, tag); break; case WRITE_READY_IU_ID: uitlq = get_itlq_nexus(pinfo, uasp_conv_info, tag); if (uitlq) uitlq->write_ready_frame = pinfo->num; create_ready_iu(uasp_conv_info->write_ready, pinfo, tag); break; } add_uasp_tag_links(tvb, uasp_tree, uitlq, iu_id); return tvb_captured_length(tvb); } static int dissect_uasp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, proto_tree *uasp_tree, usb_conv_info_t *usb_conv_info, uasp_conv_info_t *uasp_conv_info) { proto_item *ti; guint16 tag; uasp_itlq_nexus_t *uitlq; gboolean is_request; is_request = (usb_conv_info->direction == P2P_DIR_SENT) ? TRUE : FALSE; /* TODO - fetch tag from USB 3.0 Bulk Streams. * * It seems Wireshark doesn't track the stream ID so we can't yet * dissect UASP over USB 3.0 traffic. (The Linux kernel doesn't even * export an URB's stream ID, so OS support for this might be spotty * or even non-existent...) */ if (is_request) tag = get_ready_iu(uasp_conv_info->write_ready, pinfo); else tag = get_ready_iu(uasp_conv_info->read_ready, pinfo); /* add tag to tree */ ti = proto_tree_add_uint(uasp_tree, hf_uas_tag, tvb, 0, 0, tag); proto_item_set_generated(ti); uitlq = get_itlq_nexus(pinfo, uasp_conv_info, tag); if (uitlq) { if (is_request) uitlq->data_sent_frame = pinfo->num; else uitlq->data_recv_frame = pinfo->num; add_uasp_tag_links(tvb, uasp_tree, uitlq, is_request ? DATA_WRITE : DATA_READ); dissect_scsi_payload(tvb, pinfo, parent_tree, is_request, &uitlq->itlq, uitlq->itl, 0); } return tvb_captured_length(tvb); } static int dissect_uasp_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data) { typedef int(*uasp_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, proto_tree *, usb_conv_info_t *, uasp_conv_info_t *); proto_tree *uasp_tree; proto_item *ti; uasp_dissector_t dissector = NULL; guint8 endpoint; usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; uasp_conv_info_t *uasp_conv_info = get_uasp_conv_info(usb_conv_info); if (!uasp_conv_info) return 0; endpoint = usb_conv_info->endpoint; if (endpoint == uasp_conv_info->command_endpoint || endpoint == uasp_conv_info->status_endpoint) dissector = dissect_uasp_iu; else if (endpoint == uasp_conv_info->data_in_endpoint || endpoint == uasp_conv_info->data_out_endpoint) dissector = dissect_uasp_data; else return 0; col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "UASP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_protocol_format(parent_tree, proto_uasp, tvb, 0, -1, "USB Attached SCSI"); uasp_tree = proto_item_add_subtree(ti, ett_uasp); return dissector(tvb, pinfo, parent_tree, uasp_tree, usb_conv_info, uasp_conv_info); } static int dissect_uasp_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree, void *data _U_) { guint8 desc_type; guint8 desc_len; proto_tree *desc_tree; proto_tree *desc_tree_item; usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data; usb_trans_info_t *usb_trans_info = NULL; uasp_conv_info_t *uasp_conv_info; if (usb_conv_info) usb_trans_info = usb_conv_info->usb_trans_info; /* Descriptor must have a length and type field. */ if (tvb_reported_length(tvb) < 2) return 0; desc_len = tvb_get_guint8(tvb, 0); desc_type = tvb_get_guint8(tvb, 1); if (desc_type != DT_PIPE_USAGE) return 0; desc_tree = proto_tree_add_subtree(parent_tree, tvb, 0, desc_len, ett_uasp_desc, &desc_tree_item, "UAS PIPE USAGE DESCRIPTOR"); dissect_usb_descriptor_header(desc_tree, tvb, 0, &uasp_descriptor_type_vals_ext); proto_tree_add_item(desc_tree, hf_pipe_usage_descr_pipe_id, tvb, 2, 1, ENC_NA); /* The pipe usage descriptor should follow the endpoint descriptor * of the endpoint it applies to. Keep track of the pipe ID for the * endpoint so the bulk dissector can distinguish between commands * and data reliably */ if (!pinfo->fd->visited && usb_trans_info && usb_trans_info->interface_info) { guint8 endpoint = usb_trans_info->interface_info->endpoint; guint8 pipe_id = tvb_get_guint8(tvb, 2); uasp_conv_info = get_uasp_conv_info(usb_trans_info->interface_info); if (uasp_conv_info) { switch (pipe_id) { case COMMAND_PIPE_ID: uasp_conv_info->command_endpoint = endpoint; break; case STATUS_PIPE_ID: uasp_conv_info->status_endpoint = endpoint; break; case DATA_IN_PIPE_ID: uasp_conv_info->data_in_endpoint = endpoint; break; case DATA_OUT_PIPE_ID: uasp_conv_info->data_out_endpoint = endpoint; break; } } } return desc_len; } void proto_register_uasp(void) { static hf_register_info hf[] = { { &hf_pipe_usage_descr_pipe_id, { "bPipeID", "uasp.pipe_usage.bPipeID", FT_UINT8, BASE_HEX, VALS(uasp_pipe_id_vals), 0x00, NULL, HFILL } }, { &hf_uas_iu_id, { "IU ID", "uasp.iu_id", FT_UINT8, BASE_HEX, VALS(uasp_iu_id_vals), 0x00, NULL, HFILL } }, { &hf_uas_tag, { "Tag", "uasp.tag", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_uas_cmd_command_priority, { "Command Priority", "uasp.command.priority", FT_UINT8, BASE_DEC, NULL, 0x78, NULL, HFILL } }, { &hf_uas_cmd_task_attribute, { "Task Attribute", "uasp.command.task_attr", FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL } }, { &hf_uas_cmd_additional_cdb_length, { "Additional CDB Length", "uasp.command.add_cdb_length", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_uas_sense_status_qualifier, { "Status Qualifier", "uasp.sense.status_qualifier", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_uas_sense_status, { "Status", "uasp.sense.status", FT_UINT8, BASE_DEC, VALS(scsi_status_val), 0x00, NULL, HFILL } }, { &hf_uas_sense_length, { "Length", "uasp.sense.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_uas_response_additional_info, { "Additional Response Info", "uasp.response.add_info", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_uas_response_code, { "Response Code", "uasp.response.code", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_uas_taskmgmt_function, { "Task Management Function", "uasp.task_mgmt.function", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_uas_taskmgmt_tag_of_managed_task, { "Tag of Managed Task", "uasp.task_mgmt.managed_tag", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_uas_tag_started_frame, { "Tag started in", "uasp.tag_started_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The command with this tag was started in this frame", HFILL } }, { &hf_uas_tag_completed_frame, { "Tag completed in", "uasp.tag_completed_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The command with this tag was completed in this frame", HFILL } }, { &hf_uas_tag_read_ready_frame, { "Tag read ready in", "uasp.tag_read_ready_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The request data for the tag became ready in this frame", HFILL } }, { &hf_uas_tag_write_ready_frame, { "Tag write ready in", "uasp.tag_write_ready_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The request data for the tag became ready in this frame", HFILL } }, { &hf_uas_tag_data_recv_frame, { "Tag data received in", "uasp.tag_data_recv_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The response data for the tag was transmitted in this frame", HFILL } }, { &hf_uas_tag_data_sent_frame, { "Tag data sent in", "uasp.tag_data_sent_frame", FT_FRAMENUM, BASE_NONE, NULL, 0, "The request data for the tag was transmitted in this frame", HFILL } }, }; static gint *uasp_subtrees[] = { &ett_uasp, &ett_uasp_desc, }; proto_uasp = proto_register_protocol("USB Attached SCSI", "UASP", "uasp"); proto_register_field_array(proto_uasp, hf, array_length(hf)); proto_register_subtree_array(uasp_subtrees, array_length(uasp_subtrees)); } void proto_reg_handoff_uasp(void) { dissector_handle_t uasp_descriptor_handle; dissector_handle_t uasp_bulk_handle; uasp_descriptor_handle = create_dissector_handle(dissect_uasp_descriptor, proto_uasp); dissector_add_uint("usbms.descriptor", IF_PROTOCOL_UAS, uasp_descriptor_handle); uasp_bulk_handle = create_dissector_handle(dissect_uasp_bulk, proto_uasp); dissector_add_uint("usbms.bulk", IF_PROTOCOL_UAS, uasp_bulk_handle); }
C
wireshark/epan/dissectors/packet-userlog.c
/* packet-userlog.c * Routines for userlog protocol packet disassembly * Copyright 2016, Jun Wang <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Userlog is user flow logs of H3C device. * Flow logging records users' access to the extranet. The device classifies and * calculates flows through the 5-tuple information, which includes source IP address, * destination IP address, source port, destination port, and protocol number, * and generates user flow logs. Flow logging records the 5-tuple information of * the packets and number of the bytes received and sent. With flow logs, administrators * can track and record accesses to the network, facilitating the availability and * security of the network. * */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/ipproto.h> void proto_register_userlog(void); void proto_reg_handoff_userlog(void); static int proto_userlog = -1; static int hf_userlog_version = -1; static int hf_userlog_logtype = -1; static int hf_userlog_count = -1; static int hf_userlog_timestamp = -1; static int hf_userlog_header_reserved = -1; static int hf_userlog_proto = -1; static int hf_userlog_Operator = -1; static int hf_userlog_IPVerion = -1; static int hf_userlog_IPToS = -1; static int hf_userlog_SourceIP = -1; static int hf_userlog_SrcNatIP = -1; static int hf_userlog_DestIP = -1; static int hf_userlog_DestNatIP = -1; static int hf_userlog_SrcPort = -1; static int hf_userlog_SrcNatPort = -1; static int hf_userlog_DestPort = -1; static int hf_userlog_DestNatPort = -1; static int hf_userlog_StartTime = -1; static int hf_userlog_EndTime = -1; static int hf_userlog_InTotalPkg = -1; static int hf_userlog_InTotalByte = -1; static int hf_userlog_OutTotalPkg = -1; static int hf_userlog_OutTotalByte = -1; static int hf_userlog_Reserved1 = -1; static int hf_userlog_Reserved2 = -1; static int hf_userlog_Reserved3 = -1; static gint ett_userlog = -1; static gint ett_userlog_header = -1; static gint ett_userlog_log = -1; static const value_string version[] = { { 1, "V1" }, { 3, "V3" }, { 0, NULL } }; static const value_string logtype[] = { { 1, "NAT" }, { 2, "BAS" }, { 4, "Flow" }, { 0, NULL } }; static const value_string Operator[] = { { 1, "normal close flow" }, { 2, "timeout" }, { 3, "clear flow" }, { 4, "overflow" }, { 5, "nat static" }, { 6, "time data threshold" }, { 7, "flow delete" }, { 8, "flow create" }, { 0, NULL } }; /* Minimum length (in bytes) of the protocol data. */ #define USERLOG_MIN_LENGTH 8 /* Code to actually dissect the packets */ static int dissect_userlog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *userlog_header, *userlog_tree; proto_tree *userlog_log; /* Other misc. local variables. */ gint offset = 0; guint log_count = 1; guint log_type, log_max; /* Check that the packet is long enough for it to belong to us. */ if (tvb_reported_length(tvb) < USERLOG_MIN_LENGTH) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "UserLog"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); ti = proto_tree_add_item(tree, proto_userlog, tvb, 0, -1, ENC_NA); userlog_tree = proto_item_add_subtree(ti, ett_userlog); userlog_header = proto_tree_add_subtree(userlog_tree, tvb, 0, 16, ett_userlog_header, NULL, "UserLog Header"); proto_tree_add_item(userlog_header, hf_userlog_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item_ret_uint(userlog_header, hf_userlog_logtype, tvb, offset, 1, ENC_BIG_ENDIAN, &log_type); col_add_fstr(pinfo->cinfo, COL_INFO, "LogType = %s", val_to_str(log_type, logtype, "Unknown (0x%02x)")); offset += 1; proto_tree_add_item_ret_uint(userlog_header, hf_userlog_count, tvb, offset, 2, ENC_BIG_ENDIAN, &log_max); proto_item_append_text(ti, ", Log Count = %d", log_max); offset += 2; proto_tree_add_item(userlog_header, hf_userlog_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* XXX - 8 bytes unaccounted for */ proto_tree_add_item(userlog_header, hf_userlog_header_reserved, tvb, offset, 8, ENC_NA); offset += 8; if (userlog_tree) { /* we are being asked for details */ while ( log_count <= log_max) { userlog_log = proto_tree_add_subtree_format(userlog_tree, tvb, offset, 64, ett_userlog_log, NULL, "UserLog No.%d", log_count); proto_tree_add_item(userlog_log, hf_userlog_proto, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(userlog_log, hf_userlog_Operator, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(userlog_log, hf_userlog_IPVerion, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(userlog_log, hf_userlog_IPToS, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(userlog_log, hf_userlog_SourceIP, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_SrcNatIP, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_DestIP, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_DestNatIP, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_SrcPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(userlog_log, hf_userlog_SrcNatPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(userlog_log, hf_userlog_DestPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(userlog_log, hf_userlog_DestNatPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(userlog_log, hf_userlog_StartTime, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_EndTime, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_InTotalPkg, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_InTotalByte, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_OutTotalPkg, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_OutTotalByte, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_Reserved1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_Reserved2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(userlog_log, hf_userlog_Reserved3, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; log_count++; } } return tvb_captured_length(tvb); } void proto_register_userlog(void) { static hf_register_info hf[] = { { &hf_userlog_version, { "Version", "userlog.version", FT_UINT8, BASE_DEC, VALS(version), 0x0, NULL, HFILL } }, { &hf_userlog_logtype, { "LogType", "userlog.logtype", FT_UINT8, BASE_DEC, VALS(logtype), 0x0, NULL, HFILL } }, { &hf_userlog_count, { "LogCount", "userlog.count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_timestamp, { "TimeStamp", "userlog.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_header_reserved, { "Reserved", "userlog.header_reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_proto, { "Protocol", "userlog.proto", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ipproto_val_ext, 0x0, NULL, HFILL } }, { &hf_userlog_Operator, { "Operator", "userlog.Operator", FT_UINT8, BASE_DEC, VALS(Operator), 0x0, NULL, HFILL } }, { &hf_userlog_IPVerion, { "IP Version", "userlog.IPVersion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_IPToS, { "IP ToS", "userlog.IPToS", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_SourceIP, { "Source-IP", "userlog.SourceIP", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_SrcNatIP, { "Source-NAT-IP", "userlog.Source-NAT-IP", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_DestIP, { "Destination-IP", "userlog.Destination-IP", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_DestNatIP, { "Destination-NAT-IP", "userlog.Destination-NAT-IP", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_SrcPort, { "Source-Port", "userlog.Source-Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_SrcNatPort, { "Source-NAT-Port", "userlog.Source-NAT-Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_DestPort, { "Destination-Port", "userlog.Destination-Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_DestNatPort, { "Destination-NAT-Port", "userlog.Destination-NAT-Port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_StartTime, { "StartTime", "userlog.StartTime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_EndTime, { "EndTime", "userlog.EndTime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_InTotalPkg, { "InTotalPkg", "userlog.InTotalPkg", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_InTotalByte, { "InTotalByte", "userlog.InTotalByte", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_OutTotalPkg, { "OutTotalPkg", "userlog.OutTotalPkg", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_OutTotalByte, { "OutTotalByte", "userlog.OutTotalByte", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_Reserved1, { "Reserved1", "userlog.Reserved1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_Reserved2, { "Reserved2", "userlog.Reserved2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_userlog_Reserved3, { "Reserved3", "userlog.Reserved3", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_userlog, &ett_userlog_header, &ett_userlog_log }; proto_userlog = proto_register_protocol("UserLog Protocol", "UserLog", "userlog"); proto_register_field_array(proto_userlog, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_userlog(void) { dissector_handle_t userlog_handle; userlog_handle = create_dissector_handle(dissect_userlog, proto_userlog); dissector_add_for_decode_as_with_preference("udp.port", userlog_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-user_encap.c
/* packet-user_encap.c * Allow users to specify the dissectors for DLTs * Luis E. Garcia Ontanon <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/uat.h> #include <epan/exported_pdu.h> #include <epan/tap.h> #include <wiretap/wtap.h> #ifdef _MSC_VER /* disable: warning C4090: 'XY' : different 'const' qualifiers */ #pragma warning(disable:4090) #endif void proto_register_user_encap(void); void proto_reg_handoff_user_encap(void); typedef struct _user_encap_t { guint encap; char* payload_proto_name; dissector_handle_t payload_proto; char* header_proto_name; dissector_handle_t header_proto; char* trailer_proto_name; dissector_handle_t trailer_proto; guint header_size; guint trailer_size; } user_encap_t; #define ENCAP0_STR "User 0 (DLT=147)" static const value_string user_dlts[] = { { WTAP_ENCAP_USER0, ENCAP0_STR}, { WTAP_ENCAP_USER1, "User 1 (DLT=148)"}, { WTAP_ENCAP_USER2, "User 2 (DLT=149)"}, { WTAP_ENCAP_USER3, "User 3 (DLT=150)"}, { WTAP_ENCAP_USER4, "User 4 (DLT=151)"}, { WTAP_ENCAP_USER5, "User 5 (DLT=152)"}, { WTAP_ENCAP_USER6, "User 6 (DLT=153)"}, { WTAP_ENCAP_USER7, "User 7 (DLT=154)"}, { WTAP_ENCAP_USER8, "User 8 (DLT=155)"}, { WTAP_ENCAP_USER9, "User 9 (DLT=156)"}, { WTAP_ENCAP_USER10, "User 10 (DLT=157)"}, { WTAP_ENCAP_USER11, "User 11 (DLT=158)"}, { WTAP_ENCAP_USER12, "User 12 (DLT=159)"}, { WTAP_ENCAP_USER13, "User 13 (DLT=160)"}, { WTAP_ENCAP_USER14, "User 14 (DLT=161)"}, { WTAP_ENCAP_USER15, "User 15 (DLT=162)"}, { 0, NULL } }; static int proto_user_encap = -1; static expert_field ei_user_encap_not_handled = EI_INIT; static user_encap_t* encaps = NULL; static guint num_encaps = 0; static uat_t* encaps_uat; static gint exported_pdu_tap = -1; static dissector_handle_t user_encap_handle; /* * Use this for DLT_USER2 if we don't have an encapsulation for it. */ static user_encap_t user2_encap = {WTAP_ENCAP_USER2, "pktap", NULL, "", NULL, "", NULL, 0, 0}; static void export_pdu(tvbuff_t *tvb, packet_info* pinfo, char *proto_name) { if (have_tap_listener(exported_pdu_tap)) { static const exp_pdu_data_item_t *user_encap_exp_pdu_items[] = { &exp_pdu_data_orig_frame_num, NULL }; exp_pdu_data_t *exp_pdu_data = export_pdu_create_tags(pinfo, proto_name, EXP_PDU_TAG_DISSECTOR_NAME, user_encap_exp_pdu_items); exp_pdu_data->tvb_captured_length = tvb_captured_length(tvb); exp_pdu_data->tvb_reported_length = tvb_reported_length(tvb); exp_pdu_data->pdu_tvb = tvb; tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data); } } static int dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { user_encap_t* encap = NULL; tvbuff_t* payload_tvb; proto_item* item; gint len, reported_len; guint i; for (i = 0; i < num_encaps; i++) { if (encaps[i].encap == pinfo->match_uint) { encap = &(encaps[i]); break; } } item = proto_tree_add_item(tree,proto_user_encap,tvb,0,-1,ENC_NA); if (!encap && pinfo->match_uint == WTAP_ENCAP_USER2) { /* * Special-case DLT_USER2 - Apple hijacked it for use as DLT_PKTAP. * The user hasn't assigned anything to it, so default it to * the PKTAP dissector. */ encap = &user2_encap; } if (!encap) { char* msg = wmem_strdup_printf(pinfo->pool, "User encapsulation not handled: DLT=%d, " "check your Preferences->Protocols->DLT_USER", pinfo->match_uint + 147 - WTAP_ENCAP_USER0); proto_item_set_text(item,"%s",msg); expert_add_info_format(pinfo, item, &ei_user_encap_not_handled, "%s", msg); call_data_dissector(tvb, pinfo, tree); return tvb_captured_length(tvb); } if (encap->payload_proto == NULL) { char* msg = wmem_strdup_printf(pinfo->pool, "User encapsulation's protocol %s not found: " "DLT=%d, check your Preferences->Protocols->DLT_USER", encap->payload_proto_name, pinfo->match_uint + 147 - WTAP_ENCAP_USER0); proto_item_set_text(item,"%s",msg); expert_add_info_format(pinfo, item, &ei_user_encap_not_handled, "%s", msg); call_data_dissector(tvb, pinfo, tree); return tvb_captured_length(tvb); } proto_item_set_text(item,"DLT: %d",pinfo->match_uint + 147 - WTAP_ENCAP_USER0); if (encap->header_size) { tvbuff_t* hdr_tvb = tvb_new_subset_length(tvb, 0, encap->header_size); export_pdu(hdr_tvb, pinfo, encap->header_proto_name); call_dissector(encap->header_proto, hdr_tvb, pinfo, tree); if (encap->header_proto_name) { const char *proto_name = dissector_handle_get_protocol_long_name(encap->header_proto); if (proto_name) { proto_item_append_text(item, ", Header: %s (%s)", encap->header_proto_name, proto_name); } } } len = tvb_captured_length(tvb) - (encap->header_size + encap->trailer_size); reported_len = tvb_reported_length(tvb) - (encap->header_size + encap->trailer_size); payload_tvb = tvb_new_subset_length_caplen(tvb, encap->header_size, len, reported_len); export_pdu(payload_tvb, pinfo, encap->payload_proto_name); call_dissector(encap->payload_proto, payload_tvb, pinfo, tree); if (encap->payload_proto_name) { const char *proto_name = dissector_handle_get_protocol_long_name(encap->payload_proto); if (proto_name) { proto_item_append_text(item, ", Payload: %s (%s)", encap->payload_proto_name, proto_name); } } if (encap->trailer_size) { tvbuff_t* trailer_tvb = tvb_new_subset_length(tvb, encap->header_size + len, encap->trailer_size); export_pdu(trailer_tvb, pinfo, encap->trailer_proto_name); call_dissector(encap->trailer_proto, trailer_tvb, pinfo, tree); if (encap->trailer_proto_name) { const char *proto_name = dissector_handle_get_protocol_long_name(encap->trailer_proto); if (proto_name) { proto_item_append_text(item, ", Trailer: %s (%s)", encap->trailer_proto_name, proto_name); } } } return tvb_captured_length(tvb); } static void* user_copy_cb(void* dest, const void* orig, size_t len _U_) { const user_encap_t *o = (const user_encap_t *)orig; user_encap_t *d = (user_encap_t *)dest; d->encap = o->encap; d->payload_proto_name = g_strdup(o->payload_proto_name); d->payload_proto = o->payload_proto; d->header_proto_name = g_strdup(o->header_proto_name); d->header_proto = o->header_proto; d->trailer_proto_name = g_strdup(o->trailer_proto_name); d->trailer_proto = o->trailer_proto; d->header_size = o->header_size; d->trailer_size = o->trailer_size; return d; } static void user_free_cb(void* record) { user_encap_t *u = (user_encap_t *)record; g_free(u->payload_proto_name); g_free(u->header_proto_name); g_free(u->trailer_proto_name); } UAT_VS_DEF(user_encap, encap, user_encap_t, guint, WTAP_ENCAP_USER0, ENCAP0_STR) UAT_DISSECTOR_DEF(user_encap, payload_proto, payload_proto, payload_proto_name, user_encap_t) UAT_DEC_CB_DEF(user_encap, header_size, user_encap_t) UAT_DISSECTOR_DEF(user_encap, header_proto, header_proto, header_proto_name, user_encap_t) UAT_DEC_CB_DEF(user_encap, trailer_size, user_encap_t) UAT_DISSECTOR_DEF(user_encap, trailer_proto, trailer_proto, trailer_proto_name, user_encap_t) void proto_reg_handoff_user_encap(void) { guint i; user2_encap.payload_proto = find_dissector("pktap"); for (i = WTAP_ENCAP_USER0; i <= WTAP_ENCAP_USER15; i++) dissector_add_uint("wtap_encap", i, user_encap_handle); } void proto_register_user_encap(void) { module_t *module; expert_module_t* expert_user_encap; static uat_field_t user_flds[] = { UAT_FLD_VS(user_encap,encap,"DLT",user_dlts,"The DLT"), UAT_FLD_DISSECTOR(user_encap,payload_proto,"Payload dissector", "Dissector to be used for the payload of this DLT"), UAT_FLD_DEC(user_encap,header_size,"Header size", "Size of an eventual header that precedes the actual payload, 0 means none"), UAT_FLD_DISSECTOR(user_encap,header_proto,"Header dissector", "Dissector to be used for the header (empty = data)"), UAT_FLD_DEC(user_encap,trailer_size,"Trailer size", "Size of an eventual trailer that follows the actual payload, 0 means none"), UAT_FLD_DISSECTOR(user_encap,trailer_proto,"Trailer dissector", "Dissector to be used for the trailer (empty = data)"), UAT_END_FIELDS }; static ei_register_info ei[] = { { &ei_user_encap_not_handled, { "user_dlt.not_handled", PI_UNDECODED, PI_WARN, "Formatted text", EXPFILL }}, }; proto_user_encap = proto_register_protocol("DLT User","DLT_USER","user_dlt"); expert_user_encap = expert_register_protocol(proto_user_encap); expert_register_field_array(expert_user_encap, ei, array_length(ei)); module = prefs_register_protocol(proto_user_encap, NULL); encaps_uat = uat_new("User DLTs Table", sizeof(user_encap_t), "user_dlts", TRUE, &encaps, &num_encaps, UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ "ChUserDLTsSection", user_copy_cb, NULL, user_free_cb, NULL, NULL, user_flds ); prefs_register_uat_preference(module, "encaps_table", "Encapsulations Table", "A table that enumerates the various protocols to be used against a certain user DLT", encaps_uat); user_encap_handle = register_dissector("user_dlt",dissect_user,proto_user_encap); /* prefs_register_protocol_obsolete(proto_register_protocol("DLT User A","DLT_USER_A","user_dlt_a")); prefs_register_protocol_obsolete(proto_register_protocol("DLT User B","DLT_USER_B","user_dlt_b")); prefs_register_protocol_obsolete(proto_register_protocol("DLT User C","DLT_USER_C","user_dlt_c")); prefs_register_protocol_obsolete(proto_register_protocol("DLT User D","DLT_USER_D","user_dlt_d")); */ exported_pdu_tap = register_export_pdu_tap("DLT User"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-uts.c
/* packet-uts.c * Routines for UTS WAN protocol dissection * Copyright 2007, Fulko Hew, SITA INC Canada, Inc. * * Copied from packet-ipars.c * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Use tabstops = 4 */ #include "config.h" #include <epan/packet.h> #include <wiretap/wtap.h> #include <wsutil/str_util.h> #define SOH (0x01) #define STX (0x02) #define ETX (0x03) #define EOT (0x04) #define ENQ (0x05) #define BEL (0x07) #define NAK (0x15) #define DLE (0x10) #define GRID (0x20) #define GSID (0x50) #define GDID (0x70) #define MAX_POLL_TYPE_MSG_SIZE (50) void proto_register_uts(void); static int proto_uts = -1; static gint ett_uts = -1; static gint ett_header_uts = -1; static gint ett_trailer_uts = -1; static int hf_rid = -1; static int hf_sid = -1; static int hf_did = -1; static int hf_retxrequest = -1; static int hf_ack = -1; static int hf_replyrequest = -1; static int hf_busy = -1; static int hf_notbusy = -1; static int hf_msgwaiting = -1; static int hf_function = -1; static int hf_data = -1; #define MATCH (1) #define FETCH (2) #define SRC (1) #define DST (2) static int testchar(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, int op, gchar match, gchar *storage) { gchar temp; if (tvb_bytes_exist(tvb, offset, 1)) { temp = tvb_get_guint8(tvb, offset) & 0x7f; if (op == FETCH || (op == MATCH && temp == match)) { if (storage != NULL) *storage = temp; return 1; } else { return 0; } } else { col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message Format"); return 0; } } static void set_addr(packet_info *pinfo _U_ , int field, gchar rid, gchar sid, gchar did) { if (field == SRC) { col_append_fstr(pinfo->cinfo, COL_DEF_SRC, " %2.2X:%2.2X:%2.2X", rid, sid, did); } else { col_append_fstr(pinfo->cinfo, COL_DEF_DST, " %2.2X:%2.2X:%2.2X", rid, sid, did); } } static int dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void* data _U_) { proto_tree *uts_tree = NULL; proto_tree *uts_header_tree = NULL; proto_tree *uts_trailer_tree = NULL; proto_item *ti; int length; gchar rid = 0, sid = 0, did = 0; int offset = 0; int header_length = -1; int ack_start = 0; int busy_start = 0; int notbusy_start = 0; int replyrequest_start = 0; int function_start = 0; int msgwaiting_start = 0; int nak_start = 0; int etx_start = 0; int bcc_start = 0; int stx_start = 0; gchar function_code; guint8 *data_ptr; enum { NOTRAFFIC, OTHER } msg_type = OTHER; col_set_str(pinfo->cinfo, COL_PROTOCOL, "UTS"); if (testchar(tvb, pinfo, 0, MATCH, EOT, NULL) && testchar(tvb, pinfo, 1, MATCH, EOT, NULL) && testchar(tvb, pinfo, 2, MATCH, ETX, NULL)) { msg_type = NOTRAFFIC; col_set_str(pinfo->cinfo, COL_INFO, "No Traffic"); } else { if (testchar(tvb, pinfo, 0, MATCH, SOH, NULL) && testchar(tvb, pinfo, 1, FETCH, 0, (gchar *)&rid) && testchar(tvb, pinfo, 2, FETCH, 0, (gchar *)&sid) && testchar(tvb, pinfo, 3, FETCH, 0, (gchar *)&did)) { offset = 4; if (testchar(tvb, pinfo, offset, MATCH, ETX, NULL)) { col_set_str(pinfo->cinfo, COL_INFO, "General Poll"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { ack_start = offset; if (sid == GSID && did == GDID) { col_set_str(pinfo->cinfo, COL_INFO, "General Poll + ACK"); set_addr(pinfo, DST, rid, sid, did); } else if (sid != GSID && did == GDID) { col_set_str(pinfo->cinfo, COL_INFO, "Specific Poll + ACK"); set_addr(pinfo, DST, rid, sid, did); } else if (sid != GSID && did != GDID) { col_set_str(pinfo->cinfo, COL_INFO, "No Traffic + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else { col_set_str(pinfo->cinfo, COL_INFO, "Unknown Message Format"); if ((pinfo->pseudo_header->sita.sita_flags & SITA_FRAME_DIR) == SITA_FRAME_DIR_TXED) { set_addr(pinfo, DST, rid, sid, did); /* if the ACN sent it, the address is of the destination... the terminal */ } else { set_addr(pinfo, SRC, rid, sid, did); /* if the ACN received it, the address if of the source... the terminal */ } } } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, NAK, NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL) && sid != GSID && did == GDID) { nak_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Retransmit Request"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, BEL, NULL) && testchar(tvb, pinfo, offset+1, MATCH, STX, NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { header_length = offset+2; msgwaiting_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Message Waiting"); set_addr(pinfo, DST, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && testchar(tvb, pinfo, offset+2, MATCH, STX, NULL)) { ack_start = offset; header_length = offset+3; stx_start = offset+2; col_set_str(pinfo->cinfo, COL_INFO, "Text + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, STX, NULL)) { header_length = offset+1; stx_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Text"); if ((pinfo->pseudo_header->sita.sita_flags & SITA_FRAME_DIR) == SITA_FRAME_DIR_TXED) { set_addr(pinfo, DST, rid, sid, did); /* if the ACN sent it, the address is of the destination... the terminal */ } else { set_addr(pinfo, SRC, rid, sid, did); /* if the ACN received it, the address if of the source... the terminal */ } } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, ENQ, NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { replyrequest_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Reply Request"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '?', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { busy_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Busy"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, ';', NULL) && testchar(tvb, pinfo, offset+2, MATCH, ETX, NULL)) { notbusy_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Not Busy"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && testchar(tvb, pinfo, offset+2, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+3, MATCH, ';', NULL) && testchar(tvb, pinfo, offset+4, MATCH, ETX, NULL)) { notbusy_start = offset+2; ack_start = offset; col_set_str(pinfo->cinfo, COL_INFO, "Not Busy + ACK"); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, MATCH, DLE, NULL) && testchar(tvb, pinfo, offset+1, MATCH, '1', NULL) && testchar(tvb, pinfo, offset+2, FETCH, 0, &function_code) && testchar(tvb, pinfo, offset+3, MATCH, ETX, NULL)) { ack_start = offset; function_start = offset + 2; col_add_fstr(pinfo->cinfo, COL_INFO, "Function Message '%c' + ACK", function_code); set_addr(pinfo, SRC, rid, sid, did); } else if (testchar(tvb, pinfo, offset, FETCH, 0, &function_code) && testchar(tvb, pinfo, offset+1, MATCH, ETX, NULL)) { function_start = offset; col_add_fstr(pinfo->cinfo, COL_INFO, "Function Message '%c'", function_code); set_addr(pinfo, SRC, rid, sid, did); } } } while (tvb_reported_length_remaining(tvb, offset) > 0) { /* now look for the ETX */ if ((tvb_get_guint8(tvb, offset) & 0x7f) == ETX) { if (header_length == -1) header_length = offset; /* the header ends at an STX, or if not found, the ETX */ etx_start = offset; offset++; break; } offset++; } if (tvb_reported_length_remaining(tvb, offset)) /* if there is anything left, it could be the BCC and pads */ bcc_start = offset; if (tree) { ti = proto_tree_add_protocol_format(tree, proto_uts, tvb, 0, -1, "UTS"); uts_tree = proto_item_add_subtree(ti, ett_uts); if (msg_type == NOTRAFFIC) { proto_tree_add_protocol_format(uts_tree, proto_uts, tvb, 0, 2, "No Traffic"); proto_tree_add_protocol_format(uts_tree, proto_uts, tvb, 2, -1, "ETX + padding"); } else { uts_header_tree = proto_tree_add_subtree(uts_tree, tvb, 0, header_length, ett_header_uts, NULL, "Header"); proto_tree_add_protocol_format(uts_header_tree, proto_uts, tvb, 0, 1, "SOH"); if (rid == GRID) proto_tree_add_uint_format(uts_header_tree, hf_rid, tvb, 1, 1, rid, "RID (%02X) (General)", rid); else proto_tree_add_uint_format(uts_header_tree, hf_rid, tvb, 1, 1, rid, "RID (%02X)", rid); if (sid == GSID) proto_tree_add_uint_format(uts_header_tree, hf_sid, tvb, 2, 1, sid, "SID (%02X) (General)", sid); else proto_tree_add_uint_format(uts_header_tree, hf_sid, tvb, 2, 1, sid, "SID (%02X)", sid); if (did == GDID) proto_tree_add_uint_format(uts_header_tree, hf_did, tvb, 3, 1, did, "DID (%02X) (General)", did); else proto_tree_add_uint_format(uts_header_tree, hf_did, tvb, 3, 1, did, "DID (%02X)", did); if (nak_start) proto_tree_add_boolean_format(uts_header_tree, hf_retxrequest, tvb, nak_start, 2, 1, "Re-transmit Request"); if (ack_start) proto_tree_add_boolean_format(uts_header_tree, hf_ack, tvb, ack_start, 2, 1, "Ack"); if (replyrequest_start) proto_tree_add_boolean_format(uts_header_tree, hf_replyrequest, tvb, replyrequest_start, 2, 1, "Reply Request"); if (busy_start) proto_tree_add_boolean_format(uts_header_tree, hf_busy, tvb, busy_start, 2, 1, "Busy"); if (notbusy_start) proto_tree_add_boolean_format(uts_header_tree, hf_notbusy, tvb, notbusy_start, 2, 1, "Not Busy"); if (msgwaiting_start) proto_tree_add_boolean_format(uts_header_tree, hf_msgwaiting, tvb, msgwaiting_start, 1, 1, "Message Waiting"); if (function_start) proto_tree_add_uint_format(uts_header_tree, hf_function, tvb, function_start, 1, function_code, "Function '%c'", function_code ); if (stx_start) { proto_tree_add_protocol_format(uts_header_tree, proto_uts, tvb, stx_start, 1, "Start of Text"); length = tvb_captured_length_remaining(tvb, stx_start+1); /* find out how much message remains */ if (etx_start) length = (etx_start - stx_start - 1); /* and the data part is the rest... */ /* whatever preceeds the ETX if it exists */ data_ptr = tvb_get_string_enc(pinfo->pool, tvb, stx_start+1, length, ENC_ASCII); /* copy the string for dissecting */ proto_tree_add_string_format(uts_tree, hf_data, tvb, stx_start + 1, length, data_ptr, "Text (%d byte%s)", length, plurality(length, "", "s")); } if (etx_start) { uts_trailer_tree = proto_tree_add_subtree(uts_tree, tvb, etx_start, -1, ett_trailer_uts, NULL, "Trailer"); if (etx_start) proto_tree_add_protocol_format(uts_trailer_tree, proto_uts, tvb, etx_start, 1, "ETX"); if (bcc_start) proto_tree_add_protocol_format(uts_trailer_tree, proto_uts, tvb, bcc_start, -1, "CCC + padding"); } } } return tvb_captured_length(tvb); } void proto_register_uts(void) { static hf_register_info hf[] = { { &hf_rid, { "RID", "uts.rid", FT_UINT8, BASE_HEX, NULL, 0, "Remote Identifier address", HFILL }}, { &hf_sid, { "SID", "uts.sid", FT_UINT8, BASE_HEX, NULL, 0, "Site Identifier address", HFILL }}, { &hf_did, { "DID", "uts.did", FT_UINT8, BASE_HEX, NULL, 0, "Device Identifier address", HFILL }}, { &hf_retxrequest, { "ReTxRequest", "uts.retxrequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Re-transmit Request", HFILL }}, { &hf_ack, { "Ack", "uts.ack", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Ack", HFILL }}, { &hf_replyrequest, { "ReplyRequest", "uts.replyrequest", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Reply Request", HFILL }}, { &hf_busy, { "Busy", "uts.busy", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Busy", HFILL }}, { &hf_notbusy, { "NotBusy", "uts.notbusy", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Not Busy", HFILL }}, { &hf_msgwaiting, { "MsgWaiting", "uts.msgwaiting", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "TRUE if Message Waiting", HFILL }}, { &hf_function, { "Function", "uts.function", FT_UINT8, BASE_HEX, NULL, 0, "Function Code value", HFILL }}, { &hf_data, { "Data", "uts.data", FT_STRING, BASE_NONE, NULL, 0, "User Data Message", HFILL }}, }; static gint *ett[] = { &ett_uts, &ett_header_uts, &ett_trailer_uts, }; proto_uts = proto_register_protocol("Unisys Transmittal System", "UTS", "uts"); /* name, short name, abbrev */ proto_register_field_array(proto_uts, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("uts", dissect_uts, proto_uts); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-v120.c
/* packet-v120.c * Routines for v120 frame disassembly * Bert Driehuis <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/xdlc.h> void proto_register_v120(void); static int proto_v120 = -1; static int hf_v120_address = -1; static int hf_v120_rc = -1; static int hf_v120_lli = -1; static int hf_v120_ea0 = -1; static int hf_v120_ea1 = -1; static int hf_v120_control = -1; static int hf_v120_n_r = -1; static int hf_v120_n_s = -1; static int hf_v120_p = -1; static int hf_v120_p_ext = -1; static int hf_v120_f = -1; static int hf_v120_f_ext = -1; static int hf_v120_s_ftype = -1; static int hf_v120_u_modifier_cmd = -1; static int hf_v120_u_modifier_resp = -1; static int hf_v120_ftype_i = -1; static int hf_v120_ftype_s_u = -1; static int hf_v120_ftype_s_u_ext = -1; static int hf_v120_header8 = -1; static int hf_v120_header_ext8 = -1; static int hf_v120_header_break8 = -1; static int hf_v120_header_error_control8 = -1; static int hf_v120_header_segb8 = -1; static int hf_v120_header_segf8 = -1; static int hf_v120_header16 = -1; static int hf_v120_header_ext16 = -1; static int hf_v120_header_break16 = -1; static int hf_v120_header_error_control16 = -1; static int hf_v120_header_segb16 = -1; static int hf_v120_header_segf16 = -1; static int hf_v120_header_e = -1; static int hf_v120_header_dr = -1; static int hf_v120_header_sr = -1; static int hf_v120_header_rr = -1; static gint ett_v120 = -1; static gint ett_v120_address = -1; static gint ett_v120_control = -1; static gint ett_v120_header = -1; static int dissect_v120_header(tvbuff_t *tvb, int offset, proto_tree *tree); /* Used only for U frames */ static const xdlc_cf_items v120_cf_items = { NULL, NULL, &hf_v120_p, &hf_v120_f, NULL, &hf_v120_u_modifier_cmd, &hf_v120_u_modifier_resp, NULL, &hf_v120_ftype_s_u }; /* Used only for I and S frames */ static const xdlc_cf_items v120_cf_items_ext = { &hf_v120_n_r, &hf_v120_n_s, &hf_v120_p_ext, &hf_v120_f_ext, &hf_v120_s_ftype, NULL, NULL, &hf_v120_ftype_i, &hf_v120_ftype_s_u_ext }; static int dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *v120_tree, *address_tree; proto_item *ti, *tc; int is_response; int v120len; guint8 byte0, byte1; guint16 control; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "V.120"); col_clear(pinfo->cinfo, COL_INFO); byte0 = tvb_get_guint8(tvb, 0); col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "0x%02X", byte0); byte1 = tvb_get_guint8(tvb, 1); if ( ((byte0 & 0x01) != 0x00) && ((byte1 & 0x01) != 0x01) ) { col_set_str(pinfo->cinfo, COL_INFO, "Invalid V.120 frame"); if (tree) proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, -1, "Invalid V.120 frame"); return 2; } if (pinfo->p2p_dir == P2P_DIR_SENT) { is_response = (byte0 & 0x02) ? FALSE: TRUE; col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DCE"); col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DTE"); } else { /* XXX - what if the direction is unknown? */ is_response = (byte0 & 0x02) ? TRUE : FALSE; col_set_str(pinfo->cinfo, COL_RES_DL_DST, "DTE"); col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "DCE"); } ti = proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, -1, "V.120"); v120_tree = proto_item_add_subtree(ti, ett_v120); tc = proto_tree_add_item(v120_tree, hf_v120_address, tvb, 0, 2, ENC_BIG_ENDIAN); proto_item_append_text(tc, "LLI: %d C/R: %s", ((byte0 & 0xfc) << 5) | ((byte1 & 0xfe) >> 1), byte0 & 0x02 ? "R" : "C"); address_tree = proto_item_add_subtree(tc, ett_v120_address); proto_tree_add_item(address_tree, hf_v120_rc, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(address_tree, hf_v120_lli, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(address_tree, hf_v120_ea0, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(address_tree, hf_v120_ea1, tvb, 0, 2, ENC_BIG_ENDIAN); control = dissect_xdlc_control(tvb, 2, pinfo, v120_tree, hf_v120_control, ett_v120_control, &v120_cf_items, &v120_cf_items_ext, NULL, NULL, is_response, TRUE, FALSE); v120len = 2 + XDLC_CONTROL_LEN(control, TRUE); if (tvb_bytes_exist(tvb, v120len, 1)) v120len += dissect_v120_header(tvb, v120len, v120_tree); proto_item_set_len(ti, v120len); next_tvb = tvb_new_subset_remaining(tvb, v120len); call_data_dissector(next_tvb, pinfo, v120_tree); return tvb_captured_length(tvb); } static int dissect_v120_header(tvbuff_t *tvb, int offset, proto_tree *tree) { int header_len; guint8 byte0; proto_tree *h_tree; proto_item *tc; byte0 = tvb_get_guint8(tvb, offset); if (byte0 & 0x80) { header_len = 1; tc = proto_tree_add_item(tree, hf_v120_header8, tvb, 0, 1, ENC_BIG_ENDIAN); h_tree = proto_item_add_subtree(tc, ett_v120_header); proto_tree_add_item(h_tree, hf_v120_header_ext8, tvb, 0, 1, ENC_NA); proto_tree_add_item(h_tree, hf_v120_header_break8, tvb, 0, 1, ENC_NA); proto_tree_add_item(h_tree, hf_v120_header_error_control8, tvb, 0, 1, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_segb8, tvb, 0, 1, ENC_NA); proto_tree_add_item(h_tree, hf_v120_header_segf8, tvb, 0, 1, ENC_NA); } else { header_len = 2; tc = proto_tree_add_item(tree, hf_v120_header16, tvb, 0, 2, ENC_BIG_ENDIAN); h_tree = proto_item_add_subtree(tc, ett_v120_header); proto_tree_add_item(h_tree, hf_v120_header_ext16, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_break16, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_error_control16, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_segb16, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_segf16, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_e, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_dr, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_sr, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(h_tree, hf_v120_header_rr, tvb, 0, 2, ENC_BIG_ENDIAN); } proto_item_append_text(tc, " B: %d F: %d", byte0 & 0x02 ? 1:0, byte0 & 0x01 ? 1:0); return header_len; } void proto_register_v120(void) { static hf_register_info hf[] = { { &hf_v120_address, { "Link Address", "v120.address", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_v120_rc, { "R/C", "v120.rc", FT_BOOLEAN, 16, TFS(&tfs_response_command), 0x0002, NULL, HFILL }}, { &hf_v120_lli, { "LLI", "v120.lli", FT_UINT16, BASE_HEX, NULL, 0xfefc, NULL, HFILL }}, { &hf_v120_ea0, { "EA0", "v120.ea0", FT_BOOLEAN, 16, TFS(&tfs_error_ok), 0x0001, NULL, HFILL }}, { &hf_v120_ea1, { "EA1", "v120.ea1", FT_BOOLEAN, 16, TFS(&tfs_ok_error), 0x0100, NULL, HFILL }}, { &hf_v120_control, { "Control Field", "v120.control", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_v120_n_r, { "N(R)", "v120.control.n_r", FT_UINT16, BASE_DEC, NULL, XDLC_N_R_EXT_MASK, NULL, HFILL }}, { &hf_v120_n_s, { "N(S)", "v120.control.n_s", FT_UINT16, BASE_DEC, NULL, XDLC_N_S_EXT_MASK, NULL, HFILL }}, { &hf_v120_p, { "Poll", "v120.control.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_v120_p_ext, { "Poll", "v120.control.p", FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }}, { &hf_v120_f, { "Final", "v120.control.f", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_v120_f_ext, { "Final", "v120.control.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }}, { &hf_v120_s_ftype, { "Supervisory frame type", "v120.control.s_ftype", FT_UINT16, BASE_HEX, VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL }}, { &hf_v120_u_modifier_cmd, { "Command", "v120.control.u_modifier_cmd", FT_UINT8, BASE_HEX, VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_v120_u_modifier_resp, { "Response", "v120.control.u_modifier_resp", FT_UINT8, BASE_HEX, VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_v120_ftype_i, { "Frame type", "v120.control.ftype", FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL }}, { &hf_v120_ftype_s_u, { "Frame type", "v120.control.ftype", FT_UINT8, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }}, { &hf_v120_ftype_s_u_ext, { "Frame type", "v120.control.ftype", FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }}, { &hf_v120_header8, { "Header", "v120.header", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_v120_header_ext8, { "Extension octet", "v120.header.ext", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }}, { &hf_v120_header_break8, { "Break condition", "v120.header.break", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }}, { &hf_v120_header_error_control8, { "Error control C1/C2", "v120.error_control", FT_UINT8, BASE_HEX, NULL, 0x0C, NULL, HFILL }}, { &hf_v120_header_segb8, { "Bit B", "v120.header.segb", FT_BOOLEAN, 8, TFS(&tfs_segmentation_no_segmentation), 0x02, NULL, HFILL }}, { &hf_v120_header_segf8, { "Bit F", "v120.header.segf", FT_BOOLEAN, 8, TFS(&tfs_segmentation_no_segmentation), 0x01, NULL, HFILL }}, { &hf_v120_header16, { "Header", "v120.header", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_v120_header_ext16, { "Extension octet", "v120.header.ext", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080, NULL, HFILL }}, { &hf_v120_header_break16, { "Break condition", "v120.header.break", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0040, NULL, HFILL }}, { &hf_v120_header_error_control16, { "Error control C1/C2", "v120.error_control", FT_UINT16, BASE_HEX, NULL, 0x0C, NULL, HFILL }}, { &hf_v120_header_segb16, { "Bit B", "v120.header.segb", FT_BOOLEAN, 16, TFS(&tfs_segmentation_no_segmentation), 0x0002, NULL, HFILL }}, { &hf_v120_header_segf16, { "Bit F", "v120.header.segf", FT_BOOLEAN, 16, TFS(&tfs_segmentation_no_segmentation), 0x0001, NULL, HFILL }}, { &hf_v120_header_e, { "E", "v120.header.e", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000, NULL, HFILL }}, { &hf_v120_header_dr, { "DR", "v120.header.dr", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000, NULL, HFILL }}, { &hf_v120_header_sr, { "SR", "v120.header.sr", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000, NULL, HFILL }}, { &hf_v120_header_rr, { "RR", "v120.header.rr", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000, NULL, HFILL }}, }; static gint *ett[] = { &ett_v120, &ett_v120_address, &ett_v120_control, &ett_v120_header, }; proto_v120 = proto_register_protocol("Async data over ISDN (V.120)", "V.120", "v120"); proto_register_field_array (proto_v120, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("v120", dissect_v120, proto_v120); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-v150fw.c
/* packet-v150fw.c * * v150fw = v.150.1 SSE messages, contained in RTP packets * * Written by Jamison Adcock <[email protected]> * for Sparta Inc., dba Cobham Analytic Solutions * This code is largely based on the RTP parsing code * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> void proto_register_v150fw(void); /* Initialize the protocol & registered fields * Look familiar? This is in the same format as an NTE (named telephone event) from RFC 2833: */ static int proto_v150fw = -1; static int hf_v150fw_event_id = -1; /* 6 bits */ static int hf_v150fw_force_response_bit = -1; static int hf_v150fw_extension_bit = -1; static int hf_v150fw_reason_id_code = -1; /* value & string */ static int hf_v150fw_reason_id_code_info = -1; /* 16 bits */ static int hf_v150fw_ric_info_mod_avail = -1; /* ric = 1,2 */ static int hf_v150fw_cm_jm_mod_avail_pcm_mode = -1; static int hf_v150fw_cm_jm_mod_avail_v34_duplex = -1; static int hf_v150fw_cm_jm_mod_avail_v34_half_duplex = -1; static int hf_v150fw_cm_jm_mod_avail_v32_v32bis = -1; static int hf_v150fw_cm_jm_mod_avail_v22_v22bis = -1; static int hf_v150fw_cm_jm_mod_avail_v17 = -1; static int hf_v150fw_cm_jm_mod_avail_v29_half_duplex = -1; static int hf_v150fw_cm_jm_mod_avail_v27ter = -1; static int hf_v150fw_cm_jm_mod_avail_v26ter = -1; static int hf_v150fw_cm_jm_mod_avail_v26bis = -1; static int hf_v150fw_cm_jm_mod_avail_v23_duplex = -1; static int hf_v150fw_cm_jm_mod_avail_v23_half_duplex = -1; static int hf_v150fw_cm_jm_mod_avail_v21 = -1; static int hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog = -1; static int hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital = -1; static int hf_v150fw_cm_jm_mod_avail_v91 = -1; static int hf_v150fw_ric_info_timeout = -1; /* ric= 18 */ static int hf_v150fw_ric_info_timeout_vendor = -1; static int hf_v150fw_ric_info_cleardown = -1; /* ric = 20 */ static int hf_v150fw_ric_info_cleardown_reserved = -1; static int hf_v150fw_ric_info_cleardown_vendor_tag = -1; /* extension fields */ static int hf_v150fw_ric_info_cleardown_vendor_info = -1; static int hf_v150fw_reserved = -1; /* 5 bits */ static int hf_v150fw_extension_len = -1; /* 11 bits */ static int hf_v150fw_remainder = -1; /* initialize the subtree pointers */ static gint ett_v150fw = -1; static gint ett_available_modulations = -1; /* for some "range_string"s, there's only one value in the range */ #define V150FW_VALUE_RANGE(a) a,a /* V.150.1 State Signalling Events (SSE): */ #define V150FW_EVENT_RESERVED1 0 #define V150FW_EVENT_INITIAL_AUDIO 1 #define V150FW_EVENT_VOICEBAND_DATA 2 #define V150FW_EVENT_MODEM_RELAY 3 #define V150FW_EVENT_FAX_RELAY 4 #define V150FW_EVENT_TEXT_RELAY 5 #define V150FW_EVENT_TEXT_PROBE 6 /* new in ITU-T Rec. V.150.1 (2003)/Amd.2 (05/2006) */ /* 7 - 31 reserved for future use */ #define V150FW_EVENT_RESERVED2_START 7 #define V150FW_EVENT_RESERVED2_END 31 /* 32 - 63 vendor-defined */ #define V150FW_EVENT_VENDOR_START 32 #define V150FW_EVENT_VENDOR_END 63 /* V.150.1 SSE reason ID codes: */ #define V150FW_RIC_NULL 0 #define V150FW_RIC_CM 1 #define V150FW_RIC_JM 2 #define V150FW_RIC_AA 3 #define V150FW_RIC_AC 4 #define V150FW_RIC_USB1 5 #define V150FW_RIC_SB1 6 #define V150FW_RIC_S1 7 #define V150FW_RIC_V21_CH2 8 #define V150FW_RIC_V21_CH1 9 #define V150FW_RIC_V23_HIGH_CHANNEL 10 #define V150FW_RIC_V23_LOW_CHANNEL 11 #define V150FW_RIC_TONE_2225_HZ 12 #define V150FW_RIC_V21_CH2_HDLC_FLAGS 13 #define V150FW_RIC_INDETERMINATE_SIGNAL 14 #define V150FW_RIC_SILENCE 15 #define V150FW_RIC_CNG 16 #define V150FW_RIC_VOICE 17 #define V150FW_RIC_TIMEOUT 18 #define V150FW_RIC_P_STATE_TRANS 19 #define V150FW_RIC_CLEARDOWN 20 #define V150FW_RIC_ANS_CED_2100_HZ 21 #define V150FW_RIC_ANSAM 22 #define V150FW_RIC_SLASH_ANS 23 #define V150FW_RIC_SLASH_ANSAM 24 #define V150FW_RIC_QC1A 25 #define V150FW_RIC_QC1D 26 #define V150FW_RIC_QC2A 27 #define V150FW_RIC_QC2D 28 #define V150FW_RIC_CRE 29 #define V150FW_RIC_CRD 30 /* new from ITU-T V.150.1 Amendment 1: */ #define V150FW_RIC_TIA_825A_45 31 #define V150FW_RIC_TIA_825A_50 32 #define V150FW_RIC_EDT 33 #define V150FW_RIC_BELL_103_MODEM 34 #define V150FW_RIC_V21_TEXT_PHONE_T50 35 #define V150FW_RIC_V23_TEXT_MINITEL 36 #define V150FW_RIC_V18_TEXT_PHONE_T140 37 #define V150FW_RIC_DTMF_BASED_TEXT_RELAY 38 #define V150FW_RIC_CTM 39 /* 40 - 127 reserved */ #define V150FW_RIC_RESERVED_START 40 #define V150FW_RIC_RESERVED_END 127 /* 128 - 255 for vendor use */ #define V150FW_RIC_VENDOR_START 128 #define V150FW_RIC_VENDOR_END 255 /* Timeout (V150FW_RIC_TIMEOUT) reason info: */ #define V150FW_RIC_INFO_TIMEOUT_NULL 0 #define V150FW_RIC_INFO_TIMEOUT_CALL_DISCRIMINATION_TIMEOUT 1 #define V150FW_RIC_INFO_TIMEOUT_IP_TLP_TIMEOUT 2 #define V150FW_RIC_INFO_TIMEOUT_SSE_EXPLICIT_ACK_TIMEOUT 3 /* Cleardown (V150FW_RIC_CLEARDOWN) reason info: */ #define V150FW_RIC_INFO_CLEARDOWN_UNKNOWN 0 #define V150FW_RIC_INFO_CLEARDOWN_PHYSICAL_LAYER_RELEASE 1 #define V150FW_RIC_INFO_CLEARDOWN_LINK_LAYER_DISCONNECT 2 #define V150FW_RIC_INFO_CLEARDOWN_DATA_COMPRESSION_DISCONNECT 3 #define V150FW_RIC_INFO_CLEARDOWN_ABORT 4 #define V150FW_RIC_INFO_CLEARDOWN_ON_HOOK 5 #define V150FW_RIC_INFO_CLEARDOWN_NETWORK_LAYER_TERMINATION 6 #define V150FW_RIC_INFO_CLEARDOWN_ADMINISTRATIVE 7 /* value strings & range strings */ static const range_string v150fw_event_id_name[] = { { V150FW_VALUE_RANGE(V150FW_EVENT_RESERVED1), "Event ID reserved" }, { V150FW_VALUE_RANGE(V150FW_EVENT_INITIAL_AUDIO), "Initial audio" }, { V150FW_VALUE_RANGE(V150FW_EVENT_VOICEBAND_DATA), "Voice band data" }, { V150FW_VALUE_RANGE(V150FW_EVENT_MODEM_RELAY), "Modem relay" }, { V150FW_VALUE_RANGE(V150FW_EVENT_FAX_RELAY), "Fax relay" }, { V150FW_VALUE_RANGE(V150FW_EVENT_TEXT_RELAY), "Text relay" }, { V150FW_VALUE_RANGE(V150FW_EVENT_TEXT_PROBE), "Text probe" }, { V150FW_EVENT_RESERVED2_START, V150FW_EVENT_RESERVED2_END, "Reserved for ITU_T" }, { V150FW_EVENT_VENDOR_START, V150FW_EVENT_VENDOR_END, "Vendor-defined event" }, { 0, 0, NULL } }; static const range_string v150fw_ric_name[] = { { V150FW_VALUE_RANGE(V150FW_RIC_NULL), "None" }, { V150FW_VALUE_RANGE(V150FW_RIC_CM), "CM" }, { V150FW_VALUE_RANGE(V150FW_RIC_JM), "JM" }, { V150FW_VALUE_RANGE(V150FW_RIC_AA), "AA" }, { V150FW_VALUE_RANGE(V150FW_RIC_AC), "AC" }, { V150FW_VALUE_RANGE(V150FW_RIC_USB1), "USB1" }, { V150FW_VALUE_RANGE(V150FW_RIC_SB1), "SB1" }, { V150FW_VALUE_RANGE(V150FW_RIC_S1), "S1" }, { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH2), "V.21 Ch2" }, { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH1), "V.21 Ch1" }, { V150FW_VALUE_RANGE(V150FW_RIC_V23_HIGH_CHANNEL), "V.23 High Channel" }, { V150FW_VALUE_RANGE(V150FW_RIC_V23_LOW_CHANNEL), "V.23 Low Channel" }, { V150FW_VALUE_RANGE(V150FW_RIC_TONE_2225_HZ), "Tone (2225 Hz)" }, { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH2_HDLC_FLAGS), "V.21 Ch2 HDLC Flags" }, { V150FW_VALUE_RANGE(V150FW_RIC_INDETERMINATE_SIGNAL), "Indeterminate signal" }, { V150FW_VALUE_RANGE(V150FW_RIC_SILENCE), "Silence" }, { V150FW_VALUE_RANGE(V150FW_RIC_CNG), "CNG" }, { V150FW_VALUE_RANGE(V150FW_RIC_VOICE), "Voice" }, { V150FW_VALUE_RANGE(V150FW_RIC_TIMEOUT), "Timeout" }, { V150FW_VALUE_RANGE(V150FW_RIC_P_STATE_TRANS), "p' State Transition" }, { V150FW_VALUE_RANGE(V150FW_RIC_CLEARDOWN), "Cleardown" }, { V150FW_VALUE_RANGE(V150FW_RIC_ANS_CED_2100_HZ), "ANS/CED (2100Hz)" }, { V150FW_VALUE_RANGE(V150FW_RIC_ANSAM), "ANSam" }, { V150FW_VALUE_RANGE(V150FW_RIC_SLASH_ANS), "/ANS" }, { V150FW_VALUE_RANGE(V150FW_RIC_SLASH_ANSAM), "/ANSam" }, { V150FW_VALUE_RANGE(V150FW_RIC_QC1A), "QC1a" }, { V150FW_VALUE_RANGE(V150FW_RIC_QC1D), "QC1d" }, { V150FW_VALUE_RANGE(V150FW_RIC_QC2A), "QC2a" }, { V150FW_VALUE_RANGE(V150FW_RIC_QC2D), "QC2d" }, { V150FW_VALUE_RANGE(V150FW_RIC_CRE), "Cre" }, { V150FW_VALUE_RANGE(V150FW_RIC_CRD), "CRd" }, { V150FW_VALUE_RANGE(V150FW_RIC_TIA_825A_45), "TIA-825A (45.45 bit/s)" }, { V150FW_VALUE_RANGE(V150FW_RIC_TIA_825A_50), "TIA-825A (50 bit/s)" }, { V150FW_VALUE_RANGE(V150FW_RIC_EDT), "EDT (European Deaf Telephone)" }, { V150FW_VALUE_RANGE(V150FW_RIC_BELL_103_MODEM), "Bell 103 Modem" }, { V150FW_VALUE_RANGE(V150FW_RIC_V21_TEXT_PHONE_T50), "V.21 text telephone, T-50 encoding" }, { V150FW_VALUE_RANGE(V150FW_RIC_V23_TEXT_MINITEL), "V.23 text (Minitel)" }, { V150FW_VALUE_RANGE(V150FW_RIC_V18_TEXT_PHONE_T140), "V.18 text telephone, T-140 encoding" }, { V150FW_VALUE_RANGE(V150FW_RIC_DTMF_BASED_TEXT_RELAY), "DTMF based Text Relay (Annex B/V.18)" }, { V150FW_VALUE_RANGE(V150FW_RIC_CTM), "CTM" }, { V150FW_RIC_RESERVED_START, V150FW_RIC_RESERVED_END, "Reserved for use by ITU-T" }, { V150FW_RIC_VENDOR_START, V150FW_RIC_VENDOR_END, "For use by vendor" }, { 0, 0, NULL } }; static const value_string v150fw_ric_info_timeout_type[] = { { V150FW_RIC_INFO_TIMEOUT_NULL, "Null" }, { V150FW_RIC_INFO_TIMEOUT_CALL_DISCRIMINATION_TIMEOUT, "Call discrimination timeout" }, { V150FW_RIC_INFO_TIMEOUT_IP_TLP_TIMEOUT, "IP TLP timeout" }, { V150FW_RIC_INFO_TIMEOUT_SSE_EXPLICIT_ACK_TIMEOUT, "Explicit acknowledgement timeout" }, { 0, NULL } }; static const value_string v150fw_ric_info_cleardown_type[] = { { V150FW_RIC_INFO_CLEARDOWN_UNKNOWN, "Unknown/unspecified" }, { V150FW_RIC_INFO_CLEARDOWN_PHYSICAL_LAYER_RELEASE, "Physical layer release" }, { V150FW_RIC_INFO_CLEARDOWN_LINK_LAYER_DISCONNECT, "Link layer disconnect" }, { V150FW_RIC_INFO_CLEARDOWN_DATA_COMPRESSION_DISCONNECT, "Data compression disconnect" }, { V150FW_RIC_INFO_CLEARDOWN_ABORT, "Abort" }, { V150FW_RIC_INFO_CLEARDOWN_ON_HOOK, "On hook" }, { V150FW_RIC_INFO_CLEARDOWN_NETWORK_LAYER_TERMINATION, "Network layer termination" }, { V150FW_RIC_INFO_CLEARDOWN_ADMINISTRATIVE, "Administrative" }, { 0, NULL } }; #if 0 /* XXX: The following doesn't actually dissect anything. Is dissect_v150fw() supposed to be called ? */ static gboolean dissect_v150fw_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_) { guint8 octet1; guint8 extb, ric; guint16 ric_info; gint payload_length = tvb_captured_length(tvb); unsigned int offset = 0; /* see appendix C (State Signalling Events) in ITU-T Rec. V.150.1 for details */ /* Get the fields */ octet1 = tvb_get_guint8(tvb, offset); extb = octet1 & 0x01; ric = tvb_get_guint8(tvb, offset + 1) & 0xFF; ric_info = tvb_get_ntohs(tvb, offset + 2); /* minimum lengths */ if(!extb && payload_length <= 4) /* extb is not set, so minimum length is 4 bytes */ return FALSE; if(extb && payload_length <= 6) /* ext bit is set, but no extension found? */ return FALSE; if(ric == 0 || (ric >= 6 && ric <= 31)) /* values reserved for future use */ return FALSE; switch(ric) { case 0: if(ric_info != 0) /* ric_info must be NULL if ric is NULL */ return FALSE; case V150FW_RIC_CM: case V150FW_RIC_JM: if(!extb && payload_length > 4) /* payload too long */ return FALSE; break; case V150FW_RIC_TIMEOUT: case V150FW_RIC_CLEARDOWN: break; default: if(ric < 31 && ric_info != 0) /* ric_info is zero unless ric is CM, JM, TIMEOUT ro CLEARDOWN */ return FALSE; if(ric >= 31 && ric <= 127) /* 31 - 127 are reserved for future use */ return FALSE; /* 128 - 255 are vendor-specific */ break; } return TRUE; } #endif static int dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *v150fw_tree, *field_tree; guint8 extb, ric; gint payload_length; unsigned int offset = 0; if(tree) { /* create the trees */ ti = proto_tree_add_item(tree, proto_v150fw, tvb, 0, -1, ENC_NA); v150fw_tree = proto_item_add_subtree(ti, ett_v150fw); payload_length = tvb_reported_length(tvb); /* Get fields needed for further dissection */ extb = tvb_get_guint8(tvb, offset) & 0x01; /* extension bit */ ric = tvb_get_guint8(tvb, offset + 1); proto_tree_add_item(v150fw_tree, hf_v150fw_event_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(v150fw_tree, hf_v150fw_force_response_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(v150fw_tree, hf_v150fw_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(v150fw_tree, hf_v150fw_reason_id_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* reason identifier code information */ switch(ric) { case V150FW_RIC_CM: case V150FW_RIC_JM: ti = proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_mod_avail, tvb, offset, 2, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree(ti, ett_available_modulations); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_pcm_mode, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v34_duplex, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v34_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v32_v32bis, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v22_v22bis, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v17, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v29_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v27ter, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v26ter, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v26bis, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v23_duplex, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v23_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v21, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v91, tvb, offset, 2, ENC_BIG_ENDIAN); break; case V150FW_RIC_TIMEOUT: proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_timeout, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_timeout_vendor, tvb, offset + 1, 1, ENC_BIG_ENDIAN); break; case V150FW_RIC_CLEARDOWN: proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_reserved, tvb, offset + 1, 1, ENC_BIG_ENDIAN); break; default: proto_tree_add_item(v150fw_tree, hf_v150fw_reason_id_code_info, tvb, offset, 2, ENC_BIG_ENDIAN); break; } /* switch(ric) */ offset += 2; if(extb && payload_length >= 6) /* display optional extension fields */ { proto_tree_add_item(v150fw_tree, hf_v150fw_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); /* TODO ext field len doesn't match actual len (ext_len != (payload_length - 6)), * that isn't illegal, but is perhaps worth noting */ proto_tree_add_item(v150fw_tree, hf_v150fw_extension_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; /* display optional extension fields */ switch(ric) { case V150FW_RIC_CLEARDOWN: /* show vendor tag & vendor-specific info */ proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_vendor_tag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_vendor_info, tvb, offset+1, 1, ENC_BIG_ENDIAN); break; default: /* just dump the bytes for now */ proto_tree_add_item(v150fw_tree, hf_v150fw_remainder, tvb, offset, (payload_length - 6), ENC_NA); break; } } } return tvb_captured_length(tvb); } void proto_register_v150fw(void) { /* set up header fields */ static hf_register_info hf[] = { { &hf_v150fw_event_id, { "Event ID", "v150fw.event", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(v150fw_event_id_name), 0xFC, NULL, HFILL } }, { &hf_v150fw_force_response_bit, { "Force response", "v150fw.frb", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL } }, { &hf_v150fw_extension_bit, { "Payload extension", "v150fw.extb", FT_BOOLEAN, 8, TFS(&tfs_present_absent), 0x01, NULL, HFILL } }, { &hf_v150fw_reason_id_code, /* ric value + string */ { "Reason ID", "v150fw.ric", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(v150fw_ric_name), 0x0, NULL, HFILL } }, { &hf_v150fw_reason_id_code_info, { "Info", "v150fw.ricinfo", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v150fw_ric_info_timeout, { "Timeout type", "v150fw.ricinfo.timeout", FT_UINT16, BASE_HEX, VALS(v150fw_ric_info_timeout_type), 0xFF00, NULL, HFILL } }, { &hf_v150fw_ric_info_timeout_vendor, { "Vendor-specific timeout info", "v150fw.ricinfo.timeout_vendor", FT_UINT16, BASE_HEX, NULL, 0x00FF, NULL, HFILL } }, { &hf_v150fw_ric_info_cleardown, { "Cleardown type", "v150fw.ricinfo.cleardown", FT_UINT16, BASE_HEX, VALS(v150fw_ric_info_cleardown_type), 0xFF00, NULL, HFILL } }, { &hf_v150fw_ric_info_cleardown_reserved, { "Reserved for use by the ITU-T", "v150fw.ricinfo.cleardown_reserved", FT_UINT16, BASE_HEX, NULL, 0x00FF, NULL, HFILL } }, { &hf_v150fw_ric_info_cleardown_vendor_tag, { "Vendor tag", "v150fw.cleardown_vendor_tag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v150fw_ric_info_cleardown_vendor_info, { "Vendor-specific info", "v150fw.cleardown_vendor_info", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v150fw_ric_info_mod_avail, { "Modulation availability", "v150fw.rinfo.mod_avail", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_pcm_mode, { "PCM mode", "v150fw.rinfo.mod_avail.pcm_mode", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x8000, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v34_duplex, { "V.34 duplex", "v150fw.rinfo.mod_avail.v34_duplex", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x4000, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v34_half_duplex, { "V.34 half-duplex", "v150fw.rinfo.mod_avail.v34_half_duplex", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x2000, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v32_v32bis, { "V.32/V.32bis", "v150fw.rinfo.mod_avail.v32_v32bis", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x1000, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v22_v22bis, { "V.22/V.22bis", "v150fw.rinfo.mod_avail.v22_v22bis", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0800, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v17, { "V.17", "v150fw.rinfo.mod_avail.v17", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0400, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v29_half_duplex, { "V.29 half-duplex", "v150fw.rinfo.mod_avail.v29_half_duplex", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0200, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v27ter, { "V.27ter", "v150fw.rinfo.mod_avail.v27ter", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0100, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v26ter, { "V.26ter", "v150fw.rinfo.mod_avail.v26ter", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0080, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v26bis, { "V.26bis", "v150fw.rinfo.mod_avail.v26bis", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0040, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v23_duplex, { "V.23 duplex", "v150fw.rinfo.mod_avail.v23_duplex", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0020, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v23_half_duplex, { "V.23 half-duplex", "v150fw.rinfo.mod_avail.half_duplex", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0010, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v21, { "V.21", "v150fw.rinfo.mod_avail.v21", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0008, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog, { "V.90 or V.92 analog", "v150fw.rinfo.mod_avail.v90_or_v92_analog", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0004, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital, { "V.90 or V.92 digital", "v150fw.rinfo.mod_avail.v90_or_v92_digital", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0002, NULL, HFILL } }, { &hf_v150fw_cm_jm_mod_avail_v91, { "V.91", "v150fw.rinfo.mod_avail.v91", FT_BOOLEAN, 16, TFS(&tfs_available_not_available), 0x0001, NULL, HFILL } }, { &hf_v150fw_reserved, { "Reserved", "v150fw.reserved", FT_UINT16, BASE_HEX, NULL, 0xF800, NULL, HFILL } }, { &hf_v150fw_extension_len, { "Extension field length", "v150fw.eflen", FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL } }, /* dump remaining bytes: */ { &hf_v150fw_remainder, { "Remaining bytes", "v150fw.remainder", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; /* hf_register_info hf[] */ /* setup protocol subtree array */ static gint *ett[] = { &ett_v150fw, &ett_available_modulations }; /* register protocol name & description */ proto_v150fw = proto_register_protocol("V.150.1 State Signaling Event", "V.150.1 SSE", "v150fw"); /* required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_v150fw, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* register the dissector */ register_dissector("v150fw", dissect_v150fw, proto_v150fw); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-v52.c
/* packet-v52.c * Implementation for V5.2 Interface dissection * References: * ETSI EN 300 324-1 V2.1.1 (2000-04) * ETSI EN 300 347-1 V2.2.2 (1999-12) * * Copyright 2009 * * ISKRATEL d.o.o. | 4S d.o.o. * http://www.iskratel.si/ | http://www.4es.si/ * <[email protected]> | <[email protected]> * Vladimir Smrekar <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> void proto_register_v52(void); static int proto_v52 = -1; static int hf_v52_discriminator = -1; static gint ett_v52 = -1; static gint ett_v52_info = -1; /* static int hf_v52_address = -1; */ /* static int hf_v52_low_address = -1; */ static int hf_v52_msg_type = -1; static int hf_v52_info_element = -1; static int hf_v52_isdn_address = -1; static int hf_v52_isdn_low_address = -1; static int hf_v52_pstn_address = -1; static int hf_v52_pstn_low_address = -1; static int hf_v52_link_address = -1; static int hf_v52_link_low_address = -1; static int hf_v52_bcc_address = -1; static int hf_v52_bcc_low_address = -1; static int hf_v52_prot_address = -1; static int hf_v52_prot_low_address = -1; /* static int hf_v52_ctrl_address = -1; */ /* static int hf_v52_ctrl_low_address = -1; */ static int hf_v52_cadenced_ring = -1; static int hf_v52_pulse_notification = -1; static int hf_v52_info_length = -1; /*PSTN Message*/ static int hf_v52_line_info = -1; static int hf_v52_pulse_type = -1; static int hf_v52_suppression_indicator = -1; static int hf_v52_pulse_duration = -1; static int hf_v52_ack_request_indicator = -1; static int hf_v52_number_of_pulses = -1; static int hf_v52_steady_signal = -1; static int hf_v52_auto_signalling_sequence = -1; static int hf_v52_sequence_response = -1; static int hf_v52_digit_ack = -1; static int hf_v52_digit_spare = -1; static int hf_v52_digit_info = -1; static int hf_v52_res_unavailable = -1; static int hf_v52_state = -1; static int hf_v52_cause_type = -1; static int hf_v52_pstn_sequence_number = -1; static int hf_v52_duration_type = -1; /*Link control*/ static int hf_v52_link_control_function = -1; /*Protection protocol*/ static int hf_v52_rejection_cause = -1; static int hf_v52_error_cause = -1; static int hf_v52_diagnostic_msg = -1; static int hf_v52_diagnostic_element = -1; /*BCC protocol*/ static int hf_v52_pstn_user_port_id = -1; static int hf_v52_pstn_user_port_id_lower = -1; static int hf_v52_isdn_user_port_id = -1; static int hf_v52_isdn_user_port_id_lower = -1; static int hf_v52_isdn_user_port_ts_num = -1; static int hf_v52_override = -1; static int hf_v52_reject_cause_type = -1; static int hf_v52_bcc_protocol_error_cause = -1; static int hf_v52_connection_incomplete_reason = -1; static int hf_v52_diagnostic_message = -1; static int hf_v52_diagnostic_information = -1; /*Control protocol*/ static int hf_v52_control_function_element = -1; static int hf_v52_control_function_id = -1; static int hf_v52_variant = -1; static int hf_v52_if_up_id = -1; static int hf_v52_if_id = -1; static int hf_v52_if_low_id = -1; static int hf_v52_if_all_id = -1; static int hf_v52_performance_grading = -1; static int hf_v52_cp_rejection_cause = -1; static int hf_v52_v5_link_id = -1; static int hf_v52_v5_time_slot = -1; static int hf_v52_sequence_number = -1; static int hf_v52_v5_multi_slot_elements = -1; static int message_type_tmp = -1; static void dissect_v52_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree) { unsigned int discriminator = tvb_get_guint8(tvb, offset); if (discriminator == 0x48) { proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator, "V5.2 (0x%02X)", discriminator); } else { proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator, "Reserved (0x%02X)", discriminator); } } /*============================*/ /* V52 MESSAGE TYPE START */ /*============================*/ /* message types of PSTN */ #define ESTABLISH 0x00 #define ESTABLISH_ACK 0x01 #define SIGNAL 0x02 #define SIGNAL_ACK 0x03 #define DISCONNECT 0x08 #define DISCONNECT_COMPLETE 0x09 #define STATUS_ENQUIRY 0x0c #define STATUS 0x0d #define PROTOCOL_PARAMETER 0x0e /* message types of Control protocol */ #define PORT_CONTROL 0x10 #define PORT_CONTROL_ACK 0x11 #define COMMON_CONTROL 0x12 #define COMMON_CONTROL_ACK 0x13 /* message types of PROT protocol */ #define SWITCH_OVER_REQ 0x18 #define SWITCH_OVER_COM 0x19 #define OS_SWITCH_OVER_COM 0x1a #define SWITCH_OVER_ACK 0x1b #define SWITCH_OVER_REJECT 0x1c #define PROT_PROTOCOL_ERROR 0x1d #define RESET_SN_COM 0x1e #define RESET_SN_ACK 0x1f /* message types of BCC */ #define ALLOCATION 0x20 #define ALLOCATION_COMPLETE 0x21 #define ALLOCATION_REJECT 0x22 #define DE_ALLOCATION 0x23 #define DE_ALLOCATION_COMPLETE 0x24 #define DE_ALLOCATION_REJECT 0x25 #define AUDIT 0x26 #define AUDIT_COMPLETE 0x27 #define AN_FAULT 0x28 #define AN_FAULT_ACKNOWLEDGE 0x29 #define BCC_PROTOCOL_ERROR 0x2a /* message types of Link Control protocol */ #define LINK_CONTROL 0x30 #define LINK_CONTROL_ACK 0x31 static const value_string msg_type_values [] = { { ESTABLISH, "Establish" }, { ESTABLISH_ACK, "Establish Ack" }, { SIGNAL, "Signal" }, { SIGNAL_ACK, "Signal Ack" }, { DISCONNECT, "Disconnect" }, { DISCONNECT_COMPLETE, "Disconnect Complete" }, { STATUS_ENQUIRY, "Status Enquiry" }, { STATUS, "Status" }, { PROTOCOL_PARAMETER, "Protocol Parameter" }, { PORT_CONTROL, "Port Control" }, { PORT_CONTROL_ACK, "Port Control Ack" }, { COMMON_CONTROL, "Common Control" }, { COMMON_CONTROL_ACK, "Common Control Ack" }, { SWITCH_OVER_REQ, "Switch-Over Request" }, { SWITCH_OVER_COM, "Switch-Over Com" }, { OS_SWITCH_OVER_COM, "OS-Switch-Over Com" }, { SWITCH_OVER_ACK, "Switch-Over Ack" }, { SWITCH_OVER_REJECT, "Switch-Over Reject" }, { PROT_PROTOCOL_ERROR, "Protocol Error" }, { RESET_SN_COM, "Reset SN Com" }, { RESET_SN_ACK, "Reset SN Ack" }, { ALLOCATION, "Allocation" }, { ALLOCATION_COMPLETE, "Allocation Complete" }, { ALLOCATION_REJECT, "Allocation Reject" }, { DE_ALLOCATION, "DE Allocation" }, { DE_ALLOCATION_COMPLETE, "DE Allocation Complete" }, { DE_ALLOCATION_REJECT, "DE Allocation Reject" }, { AUDIT, "Audit" }, { AUDIT_COMPLETE, "Audit Complete" }, { AN_FAULT, "AN Fault" }, { AN_FAULT_ACKNOWLEDGE, "AN Fault Ack" }, { BCC_PROTOCOL_ERROR, "Protocol Error" }, { LINK_CONTROL, "Link Control" }, { LINK_CONTROL_ACK, "Link Control Ack" }, { 0, NULL } }; static value_string_ext msg_type_values_ext = VALUE_STRING_EXT_INIT(msg_type_values); /* SHORT */ static const value_string msg_type_values_short [] = { { ESTABLISH, "Establish" }, { ESTABLISH_ACK, "Establish Ack" }, { SIGNAL, "Signal" }, { SIGNAL_ACK, "Signal Ack" }, { DISCONNECT, "Disconnect" }, { DISCONNECT_COMPLETE, "Disconnect Com" }, { STATUS_ENQUIRY, "Status Enq" }, { STATUS, "Status" }, { PROTOCOL_PARAMETER, "Prot Para" }, { PORT_CONTROL, "PortCtrl" }, { PORT_CONTROL_ACK, "PortCtrl Ack" }, { COMMON_CONTROL, "CCtrl" }, { COMMON_CONTROL_ACK, "CCtrl Ack" }, { SWITCH_OVER_REQ, "SO Req" }, { SWITCH_OVER_COM, "SO Com" }, { OS_SWITCH_OVER_COM, "OS SO Com" }, { SWITCH_OVER_ACK, "SO Ack" }, { SWITCH_OVER_REJECT, "SO Rej" }, { PROT_PROTOCOL_ERROR, "Prot Err" }, { RESET_SN_COM, "Res SN Com" }, { RESET_SN_ACK, "Res SN Ack" }, { ALLOCATION, "BCC Alloc" }, { ALLOCATION_COMPLETE, "BCC Alloc Comp" }, { ALLOCATION_REJECT, "BCC Allo Rej" }, { DE_ALLOCATION, "BCC DE-Alloc" }, { DE_ALLOCATION_COMPLETE, "BCC DE-Alloc Comp" }, { DE_ALLOCATION_REJECT, "BCC DE-Alloc Rej" }, { AUDIT, "BCC Audit" }, { AUDIT_COMPLETE, "BCC Audit Comp" }, { AN_FAULT, "BCC AN Fault" }, { AN_FAULT_ACKNOWLEDGE, "BCC AN Fault Ack" }, { BCC_PROTOCOL_ERROR, "BCC Prot Error" }, { LINK_CONTROL, "LinkCtrl" }, { LINK_CONTROL_ACK, "LinkCtrl Ack" }, { 0, NULL } }; static value_string_ext msg_type_values_short_ext = VALUE_STRING_EXT_INIT(msg_type_values_short); static const value_string pulse_type_values [] = { { 0xeb, "Pulsed b-wire disconnected" }, { 0xec, "Pulsed a-wire disconnected" }, { 0xed, "Pulsed normal battery" }, { 0xee, "Pulsed c-wire disconnected" }, { 0xef, "Pulsed c-wire connected to earth" }, { 0xf0, "Pulsed a-wire connected to battery" }, { 0xf1, "Pulsed a-wire connected to earth" }, { 0xf2, "Pulsed b-wire connected to battery" }, { 0xf3, "Earth loop pulse" }, { 0xf4, "Pulsed b-wire connected to earth" }, { 0xf5, "Pulsed off hook (pulsed loop closed)" }, { 0xf6, "Register recall (timed loop open)" }, { 0xf7, "50 Hz pulse" }, { 0xf8, "Meter pulse" }, { 0xf9, "Initial ring" }, { 0xfa, "Pulsed no battery" }, { 0xfb, "Pulsed reduced battery" }, { 0xfc, "Pulsed on hook" }, { 0xfd, "Pulsed battery on c-wire" }, { 0xfe, "Pulsed reversed polarity" }, { 0xff, "Pulsed normal polarity" }, { 0, NULL } }; static value_string_ext pulse_type_values_ext = VALUE_STRING_EXT_INIT(pulse_type_values); static const value_string suppression_indication_values [] = { { 0x0, "No suppression" }, { 0x1, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE" }, { 0x2, "Suppression allowed by pre-defined line signal from TE" }, { 0x3, "Suppression allowed by pre-defined V5.1 SIGNAL msg from LE or line signal from TE" }, { 0, NULL } }; static const value_string ack_request_indication_values [] = { { 0x0, "No acknowledgement requested" }, { 0x1, "Ending acknowledgement requested when finished each pulses" }, { 0x2, "Ending acknowledgement requested when finished all pulses" }, { 0x3, "Start of pulse acknowledgement requested" }, { 0, NULL } }; static const value_string steady_signal_values [] = { { 0x00, "Normal polarity" }, { 0x01, "Reversed polarity" }, { 0x02, "Battery on c-wire" }, { 0x03, "No battery on c-wire" }, { 0x04, "Off hook (loop closed)" }, { 0x05, "On hook (loop open)" }, { 0x06, "Battery on a-wire" }, { 0x07, "A-wire on earth" }, { 0x08, "No battery on a-wire" }, { 0x09, "No battery on b-wire" }, { 0x0a, "Reduced battery" }, { 0x0b, "No battery" }, { 0x0c, "Alternate reduced power / no power" }, { 0x0d, "Normal battery" }, { 0x0e, "Stop ringing" }, { 0x0f, "Start pilot frequency" }, { 0x10, "Stop pilot frequency" }, { 0x11, "Low impedance on b-wire" }, { 0x12, "B-wire connected to earth" }, { 0x13, "B-wire disconnected from earth" }, { 0x14, "Battery on b-wire" }, { 0x15, "Low loop impedance" }, { 0x16, "High loop impedance" }, { 0x17, "Anomalous loop impedance" }, { 0x18, "A-wire disconnected from earth" }, { 0x19, "C-wire on earth" }, { 0x1a, "C-wire disconnected from earth" }, { 0x1d, "Ramp to reverse polarity" }, { 0x1e, "Ramp to normal polarity" }, { 0, NULL } }; static value_string_ext steady_signal_values_ext = VALUE_STRING_EXT_INIT(steady_signal_values); static const true_false_string tfs_digit_ack_values = { "Ending acknowledgement requested when digit transmission is finished", "No ending acknowledgement requested" }; static const value_string line_info_values [] = { { 0x00, "Impedance marker reset" }, { 0x01, "Impedance marker set" }, { 0x02, "Low loop impedance" }, { 0x03, "Anomalous loop impedance" }, { 0x04, "Anomalous line condition received"}, { 0, NULL } }; static const value_string state_values [] = { { 0x00, "AN0" }, { 0x01, "AN1" }, { 0x02, "AN2" }, { 0x03, "AN3" }, { 0x04, "AN4" }, { 0x05, "AN5" }, { 0x06, "AN6" }, { 0x07, "AN7" }, { 0x0f, "Not applicable" }, { 0, NULL } }; static const value_string control_function_element_values [] = { { 0x01, "FE101 (activate access)" }, { 0x02, "FE102 (activation initiated by user)" }, { 0x03, "FE103 (DS activated)" }, { 0x04, "FE104 (access activated)" }, { 0x05, "FE105 (deactivate access)" }, { 0x06, "FE106 (access deactivated)" }, { 0x11, "FE201/202 (unblock)" }, { 0x13, "FE203/204 (block)" }, { 0x15, "FE205 (block request)" }, { 0x16, "FE206 (performance grading)" }, { 0x17, "FE207 (D-channel block)" }, { 0x18, "FE208 (D-channel unblock)" }, { 0x19, "FE209 (TE out of service)" }, { 0x1A, "FE210 (failure inside network)" }, { 0, NULL } }; static const value_string control_function_id_values [] = { { 0x00, "Verify re-provisioning" }, { 0x01, "Ready for re-provisioning" }, { 0x02, "Not ready for re-provisioning" }, { 0x03, "Switch-over to new variant" }, { 0x04, "Re-provisioning started" }, { 0x05, "Cannot re-provision" }, { 0x06, "Request variant and interface ID" }, { 0x07, "Variant and interface ID" }, { 0x08, "Blocking started" }, { 0x10, "Restart request" }, { 0x11, "Restart complete" }, { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" }, { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" }, { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" }, { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" }, { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" }, { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" }, { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" }, { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" }, { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" }, { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" }, { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" }, { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" }, { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" }, { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" }, { 0x20, "BLOCK ALL PSTN PORTS REJECTED" }, { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" }, { 0x22, "BLOCK ALL ISDN PORTS REQUEST" }, { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" }, { 0x24, "BLOCK ALL ISDN PORTS REJECTED" }, { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" }, { 0, NULL } }; static value_string_ext control_function_id_values_ext = VALUE_STRING_EXT_INIT(control_function_id_values); static const value_string control_function_id_values_short [] = { { 0x00, "VerifyRe-pro" }, { 0x01, "ReadyForRe-pro" }, { 0x02, "NotReadyForRe-pro" }, { 0x03, "SO ToNewVar" }, { 0x04, "Re-pro Started" }, { 0x05, "CannotRe-pro" }, { 0x06, "ReqVar & intf ID" }, { 0x07, "Var & intf ID" }, { 0x08, "BlockStarted" }, { 0x10, "RestartReq" }, { 0x11, "RestartCompl" }, { 0x12, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REQUEST" }, { 0x13, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS ACCEPTED" }, { 0x14, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS REJECTED" }, { 0x15, "UNBLOCK ALL RELEVANT PSTN AND ISDN PORTS COMPLETED" }, { 0x16, "UNBLOCK ALL RELEVANT PSTN PORTS REQUEST" }, { 0x17, "UNBLOCK ALL RELEVANT PSTN PORTS ACCEPTED" }, { 0x18, "UNBLOCK ALL RELEVANT PSTN PORTS REJECTED" }, { 0x19, "UNBLOCK ALL RELEVANT PSTN PORTS COMPLETED" }, { 0x1a, "UNBLOCK ALL RELEVANT ISDN PORTS REQUEST" }, { 0x1b, "UNBLOCK ALL RELEVANT ISDN PORTS ACCEPTED" }, { 0x1c, "UNBLOCK ALL RELEVANT ISDN PORTS REJECTED" }, { 0x1d, "UNBLOCK ALL RELEVANT ISDN PORTS COMPLETED" }, { 0x1e, "BLOCK ALL PSTN PORTS REQUEST" }, { 0x1f, "BLOCK ALL PSTN PORTS ACCEPTED" }, { 0x20, "BLOCK ALL PSTN PORTS REJECTED" }, { 0x21, "BLOCK ALL PSTN PORTS COMPLETED" }, { 0x22, "BLOCK ALL ISDN PORTS REQUEST" }, { 0x23, "BLOCK ALL ISDN PORTS ACCEPTED" }, { 0x24, "BLOCK ALL ISDN PORTS REJECTED" }, { 0x25, "BLOCK ALL ISDN PORTS COMPLETED" }, { 0, NULL } }; static value_string_ext control_function_id_values_short_ext = VALUE_STRING_EXT_INIT(control_function_id_values_short); static const value_string rejection_cause_values [] = { { 0x00, "No standby C-channel available" }, { 0x01, "Target physical C-channel not operational" }, { 0x02, "Target physical C-channel not provisioned" }, { 0x03, "Protection switching impossible (AN/LE failure)" }, { 0x04, "Protection group mismatch" }, { 0x05, "Requested allocation exists already" }, { 0x06, "Target physical C-channel already has logical C-channel" }, { 0, NULL } }; static const value_string error_cause_values [] = { { 0x01, "Protocol discriminator error" }, { 0x04, "Message type unrecognized" }, { 0x07, "Mandatory information element missing" }, { 0x08, "Unrecognized information element" }, { 0x09, "Mandatory information element content error" }, { 0x0b, "Message not compatible with protection protocol state" }, { 0x0c, "Repeated mandatory information element" }, { 0x0d, "Too many information elements" }, { 0x0f, "Logical C-Channel identification error" }, { 0, NULL } }; static const value_string performance_grading_values [] = { { 0x00, "normal grade" }, { 0x01, "degraded" }, { 0, NULL } }; static const value_string cp_rejection_cause_values [] = { { 0x00, "variant unknown" }, { 0x01, "variant known, not ready" }, { 0x02, "re-provisioning in progress (re-pro)" }, { 0, NULL } }; static const value_string reject_cause_type_values [] = { { 0x00, "Unspecified" }, { 0x01, "Access network fault" }, { 0x02, "Access network blocked (internally)" }, { 0x03, "Connection already present at the PSTN user port to a different V5 time slot" }, { 0x04, "Connection already present at the V5 time slot(s) to a different port or ISDN user port time slot(s)" }, { 0x05, "Connection already present at the ISDN user port time slot(s) to a different V5 time slot(s)" }, { 0x06, "User port unavailable (blocked)" }, { 0x07, "De-allocation cannot be completed due to incompatible data content" }, { 0x08, "De-allocation cannot be completed due to V5 time slot(s) data incompatibility" }, { 0x09, "De-allocation cannot be completed due to port data incompatibility" }, { 0x0a, "De-allocation cannot be completed due to user port time slot(s) data incompatibility" }, { 0x0b, "User port not provisioned" }, { 0x0c, "Invalid V5 time slot(s) indication(s)" }, { 0x0d, "Invalid V5 2048 kbit/s link indication" }, { 0x0e, "Invalid user time slot(s) indication(s)" }, { 0x0f, "V5 time slot(s) being used as physical C-channel(s)" }, { 0x10, "V5 link unavailable (blocked)" }, { 0, NULL } }; static const value_string bcc_protocol_error_cause_type_values [] = { { 0x01, "Protocol discriminator error" }, { 0x04, "Message type unrecognized" }, { 0x05, "Out of sequence information element" }, { 0x06, "Repeated optional information element" }, { 0x07, "Mandatory information element missing" }, { 0x08, "Unrecognized information element" }, { 0x09, "Mandatory information element content error" }, { 0x0a, "Optional information element content error" }, { 0x0b, "Message not compatible with the BCC protocol state" }, { 0x0c, "Repeated mandatory information element" }, { 0x0d, "Too many information element" }, { 0x0f, "BCC Reference Number coding error" }, { 0, NULL } }; static const value_string connection_incomplete_reason_values [] = { { 0x00, "Incomplete normal" }, { 0x01, "Access network fault" }, { 0x02, "User port not provisioned" }, { 0x03, "Invalid V5 time slot identification" }, { 0x04, "Invalid V5 2048 kbit/s link identification" }, { 0x05, "Time slot being used as physical C-channel" }, { 0, NULL } }; static const value_string link_control_function_values [] = { { 0x00, "FE-IDReq" }, { 0x01, "FE-IDAck" }, { 0x02, "FE-IDRel" }, { 0x03, "FE-IDRej" }, { 0x04, "FE301/302 (link unblock)" }, { 0x05, "FE303/304 (link block)" }, { 0x06, "FE305 (deferred link block request" }, { 0x07, "FE306 (non-deferred link block request)" }, { 0, NULL } }; static const value_string cause_type_values [] = { { 0x00, "Response to STATUS ENQUIRY" }, { 0x01, "Not used" }, { 0x03, "L3 address error" }, { 0x04, "Message type unrecognized" }, { 0x05, "Out of sequence information element" }, { 0x06, "Repeated optional information element" }, { 0x07, "Mandatory information element missing" }, { 0x08, "Unrecognized information element" }, { 0x09, "Mandatory information element content error" }, { 0x0a, "Optional information element content error" }, { 0x0b, "Message not compatible with path state" }, { 0x0c, "Repeated mandatory information element" }, { 0x0d, "Too many information elements" }, { 0, NULL } }; /* protocol message info elements */ #define PSTN_SEQUENCE_NUMBER 0x00 /* PSTN */ #define CADENCED_RINGING 0x01 /* PSTN */ #define PULSED_SIGNAL 0x02 /* PSTN */ #define STEADY_SIGNAL 0x03 /* PSTN */ #define DIGIT_SIGNAL 0x04 /* PSTN */ #define RECOGNITION_TIME 0x10 /* PSTN */ #define ENABLE_AUTO_ACK 0x11 /* PSTN */ #define DISABLE_AUTO_ACK 0x12 /* PSTN */ #define CAUSE 0x13 /* PSTN */ #define RESOURCE_UNAVAILABLE 0x14 /* PSTN */ #define CONTROL_FUNCTION_ELEMENT 0x20 /* Control */ #define CONTROL_FUNCTION_ID 0x21 /* Control */ #define ENABLE_METERING 0x22 /* PSTN */ #define VARIANT 0x22 /* Control */ #define METERING_REPORT 0x23 /* PSTN */ #define INTERFACE_ID 0x23 /* Control */ #define ATTENUATION 0x24 /* PSTN */ #define LINK_CONTROL_FUNCTION 0x30 /* Link Control */ #define USER_PORT_ID 0x40 /* BCC */ #define ISDN_PORT_TS_ID 0x41 /* BCC */ #define V5_TIME_SLOT_ID 0x42 /* BCC */ #define MULTI_SLOT_MAP 0x43 /* BCC */ #define BCC_REJECT_CAUSE 0x44 /* BCC */ #define BCC_PROTOCOL_ERROR_CAUSE 0x45 /* BCC */ #define CONNECTION_INCOMPLETE 0x46 /* BCC */ #define SEQUENCE_NUMBER 0x50 /* Protection */ #define C_CHANNEL_ID 0x51 /* Protection */ #define PP_REJECTION_CAUSE 0x52 /* Protection */ #define PROTOCOL_ERROR 0x53 /* Protection */ #define LINE_INFORMATION 0x80 /* PSTN */ #define STATE 0x90 /* PSTN */ #define AUTO_SIG_SEQUENCE 0xa0 /* PSTN */ #define SEQUENCE_RESPONSE 0xb0 /* PSTN */ #define PULSE_NOTIFICATION 0xc0 /* PSTN */ #define PERFORMANCE_GRADING 0xe0 /* Control */ #define CP_REJECTION_CAUSE 0xf0 /* Control */ static const value_string info_element_values [] = { { PSTN_SEQUENCE_NUMBER, "Sequence number" }, { CADENCED_RINGING, "Cadenced ringing" }, { PULSED_SIGNAL, "Pulsed signal" }, { STEADY_SIGNAL, "Steady signal" }, { DIGIT_SIGNAL, "Digit signal" }, { RECOGNITION_TIME, "Recognition time" }, { ENABLE_AUTO_ACK, "Enable autonomous acknowledge" }, { DISABLE_AUTO_ACK, "Disable autonomous acknowledge" }, { CAUSE, "Cause" }, { RESOURCE_UNAVAILABLE, "Resource unavailable" }, { CONTROL_FUNCTION_ELEMENT, "Control function element" }, { CONTROL_FUNCTION_ID, "Control function ID" }, { ENABLE_METERING, "Enable metering" }, /* { VARIANT, "Variant" }, XXX - Duplicate value of ENABLE_METERING */ { METERING_REPORT, "Metering report" }, /* { INTERFACE_ID, "Interface ID" }, XXX - Duplicate value of METERING_REPORT */ { ATTENUATION, "Attenuation" }, { LINK_CONTROL_FUNCTION, "Link control function" }, { USER_PORT_ID, "User port ID" }, { ISDN_PORT_TS_ID, "ISDN port TS ID" }, { V5_TIME_SLOT_ID, "V5 TS ID" }, { MULTI_SLOT_MAP, "Multi-Slot map" }, { BCC_REJECT_CAUSE, "Reject cause" }, { BCC_PROTOCOL_ERROR_CAUSE, "Protocol error cause" }, { CONNECTION_INCOMPLETE, "Connection incomplete" }, { SEQUENCE_NUMBER, "Sequence number" }, { C_CHANNEL_ID, "Physical C-Channel ID" }, { PP_REJECTION_CAUSE, "Rejection cause" }, { PROTOCOL_ERROR, "Protocol error cause" }, { LINE_INFORMATION, "Line information" }, { STATE, "State" }, { AUTO_SIG_SEQUENCE, "Autonomous signal sequence" }, { SEQUENCE_RESPONSE, "Sequence response" }, { PULSE_NOTIFICATION, "Pulse notification" }, { PERFORMANCE_GRADING, "Performance grading" }, { CP_REJECTION_CAUSE, "Rejection cause" }, { 0, NULL } }; static value_string_ext info_element_values_ext = VALUE_STRING_EXT_INIT(info_element_values); static const value_string info_element_values_short [] = { { PSTN_SEQUENCE_NUMBER, "SN" }, { CADENCED_RINGING, "CR" }, { PULSED_SIGNAL, "PS" }, { STEADY_SIGNAL, "SS" }, { DIGIT_SIGNAL, "DS" }, { RECOGNITION_TIME, "RT" }, { ENABLE_AUTO_ACK, "EAA" }, { DISABLE_AUTO_ACK, "DAA" }, { CAUSE, "CA" }, { RESOURCE_UNAVAILABLE, "RU" }, { CONTROL_FUNCTION_ELEMENT, "CF element" }, { CONTROL_FUNCTION_ID, "CF ID" }, { ENABLE_METERING, "EM" }, { VARIANT, "Var" }, { METERING_REPORT, "MR" }, { INTERFACE_ID, "Interface ID" }, { ATTENUATION, "ATT" }, { LINK_CONTROL_FUNCTION, "LC F" }, { USER_PORT_ID, "UP ID" }, { ISDN_PORT_TS_ID, "ISDNP TS ID" }, { V5_TIME_SLOT_ID, "V5 TS ID" }, { MULTI_SLOT_MAP, "MS map" }, { BCC_REJECT_CAUSE, "RC" }, { BCC_PROTOCOL_ERROR_CAUSE, "PEC" }, { CONNECTION_INCOMPLETE, "CI" }, { SEQUENCE_NUMBER, "SN" }, { C_CHANNEL_ID, "Phy CChannel ID" }, { PP_REJECTION_CAUSE, "RC" }, { PROTOCOL_ERROR, "PEC" }, { LINE_INFORMATION, "LI" }, { STATE, "ST" }, { AUTO_SIG_SEQUENCE, "ASS" }, { SEQUENCE_RESPONSE, "SR" }, { PULSE_NOTIFICATION, "PN" }, { PERFORMANCE_GRADING, "PG" }, { CP_REJECTION_CAUSE, "RC" }, { 0, NULL } }; static value_string_ext info_element_values_short_ext = VALUE_STRING_EXT_INIT(info_element_values_short); #define ADDRESS_OFFSET 1 #define ADDRESS_LENGTH 1 #define LOW_ADDRESS_OFFSET 2 #define LOW_ADDRESS_LENGTH 1 #define MSG_TYPE_OFFSET 3 #define MSG_TYPE_LENGTH 1 #define INFO_ELEMENT_OFFSET 4 #define INFO_ELEMENT_LENGTH 1 static void dissect_pstn_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 pstn_sequence_number_tmp; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); pstn_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_fstr(pinfo->cinfo, COL_INFO, " | SN: %u", pstn_sequence_number_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pstn_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_cadenced_ring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 cadenced_ring_tmp; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); cadenced_ring_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", cadenced_ring_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cadenced_ring, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_pulsed_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2), &pulse_type_values_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); if (data_length > 3) { proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); } if (data_length > 4) { proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); } } } static void dissect_steady_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, &steady_signal_values_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); } } static void dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 buffer; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, ENC_NA); buffer = tvb_get_guint8(info_tvb, info_offset+2)>>4; buffer = buffer&0x03; proto_tree_add_item(info_tree, hf_v52_digit_spare, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_digit_info, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", buffer); } static void dissect_recognition_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; /*Signal = Coding of pulse type*/ if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); /*Signal = Coding of steady signal type*/ else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_duration_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); } } static void dissect_enable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; /*Signal*/ if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); buffer = tvb_get_guint8(info_tvb, info_offset+3)&0x7f; /*Response*/ if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+4)) { proto_tree_add_item(info_tree, hf_v52_suppression_indicator, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_pulse_duration, info_tvb, info_offset+4, 1, ENC_BIG_ENDIAN); } if (tvb_reported_length_remaining(info_tvb, info_offset+5)) { proto_tree_add_item(info_tree, hf_v52_ack_request_indicator, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_number_of_pulses, info_tvb, info_offset+5, 1, ENC_BIG_ENDIAN); } } } static void dissect_disable_auto_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { guint8 buffer; proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x7f; if (buffer >= 0x6b) proto_tree_add_item(info_tree, hf_v52_pulse_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); else if (buffer <= 0x1a) proto_tree_add_item(info_tree, hf_v52_steady_signal, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); } } static void dissect_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); col_append_str(pinfo->cinfo, COL_INFO, ": "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, cause_type_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cause_type, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_uint_format(info_tree, hf_v52_msg_type, info_tvb, info_offset+3, 1, tvb_get_guint8(info_tvb, info_offset+3), "Diagnostic: %s", val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+3), &msg_type_values_ext, "unknown")); } } static void dissect_resource_unavailable(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_res_unavailable, info_tvb, info_offset+2, info_element_length, ENC_ASCII); } } static void dissect_pulse_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_pulse_notification, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_line_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_line_info, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_state(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_state, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_auto_sig_sequence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_auto_signalling_sequence, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_sequence_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_sequence_response, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_control_function_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); if (message_type_tmp != 0x11) { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, control_function_element_values, "Unknown element")); } if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_control_function_element, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_control_function_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); if (message_type_tmp != 0x13) { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, &control_function_id_values_short_ext, "Unknown layer3 element")); } if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_control_function_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_variant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 variantValue; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); variantValue = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_fstr(pinfo->cinfo, COL_INFO, " | Var: %u", variantValue); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_variant, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_interface_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 interfaceAllIdValue; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); interfaceAllIdValue = (tvb_get_guint8(info_tvb, info_offset+2)<<16)+(tvb_get_guint8(info_tvb, info_offset+3)<<8)+(tvb_get_guint8(info_tvb, info_offset+4)); col_append_fstr(pinfo->cinfo, COL_INFO, " | Intf. ID: %u", interfaceAllIdValue); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_if_up_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_if_id, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_if_low_id, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_if_all_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_sequence_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 hf_v52_sequence_number_tmp; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(info_tvb, info_offset), &info_element_values_short_ext, "Unknown element")); hf_v52_sequence_number_tmp = tvb_get_guint8(info_tvb, info_offset+2)-0x80; col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", hf_v52_sequence_number_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_sequence_number, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_physical_c_channel_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_fstr(pinfo->cinfo, COL_INFO, " | Phy C-ch: %u, %u", tvb_get_guint8(info_tvb, info_offset+2), tvb_get_guint8(info_tvb, info_offset+3)); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_pp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, rejection_cause_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_rejection_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_protocol_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, error_cause_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_diagnostic_msg, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_diagnostic_element, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_performance_grading(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, performance_grading_values, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_performance_grading, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_cp_rejection_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = 1; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset)-0xe0, cp_rejection_cause_values, "Unknown element")); if (info_tree != NULL) { proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_cp_rejection_cause, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_user_port_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 buffer; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); buffer = tvb_get_guint8(info_tvb, info_offset+2)&0x01; if (buffer == 0x01) { proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_pstn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN port: %u", (((tvb_get_guint8(info_tvb, info_offset+2)>>1)<<8)+(tvb_get_guint8(info_tvb, info_offset+3)))); } else if (buffer == 0x00) { proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id, info_tvb, info_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_isdn_user_port_id_lower, info_tvb, info_offset+3, 1, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", (((tvb_get_guint8(info_tvb, info_offset+2)>>2)<<7)+((tvb_get_guint8( info_tvb, info_offset+3)>>1)))); } } static void dissect_isdn_port_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 isdn_user_port_ts_num_tmp; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); isdn_user_port_ts_num_tmp = (tvb_get_guint8(info_tvb, info_offset+2)) - 128; col_append_str(pinfo->cinfo, COL_INFO, ", "); col_append_fstr(pinfo->cinfo, COL_INFO, "%x", isdn_user_port_ts_num_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_isdn_user_port_ts_num, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_v5_time_slot_identification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint8 v5_link_id_tmp; guint8 v5_time_slot_tmp; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); v5_link_id_tmp = tvb_get_guint8(info_tvb, info_offset+2); v5_time_slot_tmp = tvb_get_guint8(info_tvb, info_offset+3); if (v5_time_slot_tmp >= 64) { v5_time_slot_tmp = v5_time_slot_tmp - 64; } if (v5_time_slot_tmp >= 32) { v5_time_slot_tmp = v5_time_slot_tmp - 32; } col_append_fstr(pinfo->cinfo, COL_INFO, " | V5 Link: %u, %u ", v5_link_id_tmp, v5_time_slot_tmp); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_override, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_v5_time_slot, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_multi_slot_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_fstr(pinfo->cinfo, COL_INFO, " | V5MSlink ID:%u", tvb_get_guint8(info_tvb, info_offset+2)); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_v5_link_id, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+4)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+5)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+5, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+6)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+6, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+7)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+7, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+8)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+8, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+9)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+9, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+10)) proto_tree_add_item(info_tree, hf_v52_v5_multi_slot_elements, info_tvb, info_offset+10, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_bcc_rejct_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, reject_cause_type_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_reject_cause_type, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_bcc_protocol_error_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, bcc_protocol_error_cause_type_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_bcc_protocol_error_cause, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+3)) proto_tree_add_item(info_tree, hf_v52_diagnostic_message, info_tvb, info_offset+3, info_element_length, ENC_BIG_ENDIAN); if (tvb_reported_length_remaining(info_tvb, info_offset+4)) proto_tree_add_item(info_tree, hf_v52_diagnostic_information, info_tvb, info_offset+4, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_connection_incomplete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1)+2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2) & 0x80, connection_incomplete_reason_values, "Unknown element")); if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_connection_incomplete_reason, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_link_control_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_tree *info_tree; proto_item *ti_info; const guint8 info_element_length = 1; guint8 info_element; guint16 data_length; tvbuff_t *info_tvb; const int info_offset = 0; info_element = tvb_get_guint8(tvb, offset); data_length = tvb_get_guint8(tvb, offset+1) + 2; info_tvb = tvb_new_subset_length(tvb, offset, data_length); info_tree = proto_tree_add_subtree(tree, info_tvb, info_offset, -1, ett_v52_info, &ti_info, "Info Element:"); if (message_type_tmp != 0x31) { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(info_tvb, info_offset+2)-0x80, link_control_function_values, "Unknown element")); } if (info_tree != NULL) { proto_tree_add_item(info_tree, hf_v52_info_element, info_tvb, info_offset, info_element_length, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN); proto_item_append_text(ti_info, " %s (0x%x)", val_to_str_ext_const(info_element, &info_element_values_ext, "unknown info element"), info_element); proto_tree_add_item(info_tree, hf_v52_link_control_function, info_tvb, info_offset+2, info_element_length, ENC_BIG_ENDIAN); } } static void dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 4; guint8 info_element, info_element_length; /*int old_offset;*/ int singleoctet; while (tvb_reported_length_remaining(tvb, offset) > 0) { singleoctet = 0; /* old_offset = offset; */ info_element = tvb_get_guint8(tvb, offset); switch (info_element) { case PSTN_SEQUENCE_NUMBER: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pstn_sequence_number(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case CADENCED_RINGING: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_cadenced_ring(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case PULSED_SIGNAL: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pulsed_signal(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case STEADY_SIGNAL: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_steady_signal(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case DIGIT_SIGNAL: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_digit_signal(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case RECOGNITION_TIME: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_recognition_time(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case ENABLE_AUTO_ACK: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_enable_auto_ack(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case DISABLE_AUTO_ACK: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_disable_auto_ack(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case CAUSE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_cause(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case RESOURCE_UNAVAILABLE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_resource_unavailable(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case PULSE_NOTIFICATION: dissect_pulse_notification(tvb, pinfo, tree, offset); singleoctet = 1; break; case LINE_INFORMATION: dissect_line_information(tvb, pinfo, tree, offset); singleoctet = 1; break; case STATE: dissect_state(tvb, pinfo, tree, offset); singleoctet = 1; break; case AUTO_SIG_SEQUENCE: dissect_auto_sig_sequence(tvb, pinfo, tree, offset); singleoctet = 1; break; case SEQUENCE_RESPONSE: dissect_sequence_response(tvb, pinfo, tree, offset); singleoctet = 1; break; case CONTROL_FUNCTION_ELEMENT: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_control_function_element(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case CONTROL_FUNCTION_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_control_function_id(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case VARIANT: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_variant(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case INTERFACE_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_interface_id(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case SEQUENCE_NUMBER: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_sequence_number(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case C_CHANNEL_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_physical_c_channel_id(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case PP_REJECTION_CAUSE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_pp_rejection_cause(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case PROTOCOL_ERROR: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_protocol_error(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case PERFORMANCE_GRADING: dissect_performance_grading(tvb, pinfo, tree, offset); singleoctet = 1; break; case CP_REJECTION_CAUSE: dissect_cp_rejection_cause(tvb, pinfo, tree, offset); singleoctet = 1; break; case USER_PORT_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_user_port_identification(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case ISDN_PORT_TS_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_isdn_port_time_slot_identification(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case V5_TIME_SLOT_ID: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_v5_time_slot_identification(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case MULTI_SLOT_MAP: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_multi_slot_map(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case BCC_REJECT_CAUSE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_bcc_rejct_cause(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case BCC_PROTOCOL_ERROR_CAUSE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_bcc_protocol_error_cause(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case CONNECTION_INCOMPLETE: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_connection_incomplete(tvb, pinfo, tree, offset); offset += info_element_length+2; break; case LINK_CONTROL_FUNCTION: info_element_length = tvb_get_guint8(tvb, offset+1); dissect_link_control_function(tvb, pinfo, tree, offset); offset += info_element_length+2; break; default: offset += 1; break; } if (singleoctet == 1) { offset += 1; } #if 0 if (old_offset <= offset) { expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_WARN, "Zero-length information element"); return; } #endif } } static void dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; proto_tree *v52_tree = NULL; gboolean addr = FALSE; guint8 bcc_all_address_tmp_up = -1; guint16 pstn_all_address_tmp, isdn_all_address_tmp, bcc_all_address_tmp; guint16 prot_all_address_tmp, link_all_address_tmp; col_set_str(pinfo->cinfo, COL_PROTOCOL, "V52"); if (tree) { proto_item *ti; ti = proto_tree_add_item(tree, proto_v52, tvb, offset, -1, ENC_NA); v52_tree = proto_item_add_subtree(ti, ett_v52); dissect_v52_protocol_discriminator(tvb, offset, v52_tree); } /* if (v52_tree != NULL) */ { message_type_tmp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET); if ((message_type_tmp >= 0x00) && (message_type_tmp <= 0x0e)) { addr = TRUE; proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET))); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp); } if ((message_type_tmp >= 0x10) && (message_type_tmp <= 0x13)) { addr = TRUE; if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) { pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET))); proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp); } else { isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1))); proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp); } } if ((message_type_tmp == 0x30) || (message_type_tmp == 0x31)) { addr = TRUE; link_all_address_tmp = tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET); proto_tree_add_item(v52_tree, hf_v52_link_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_link_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | LinkId: %u", link_all_address_tmp); } if ((message_type_tmp >= 0x20) && (message_type_tmp <= 0x2a)) { addr = TRUE; proto_tree_add_item(v52_tree, hf_v52_bcc_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_bcc_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); bcc_all_address_tmp_up = tvb_get_guint8(tvb, ADDRESS_OFFSET); if (bcc_all_address_tmp_up >= 128) { bcc_all_address_tmp_up = bcc_all_address_tmp_up - 128; } bcc_all_address_tmp = (bcc_all_address_tmp_up<<6) + tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET); col_append_fstr(pinfo->cinfo, COL_INFO, " | ref: %u", bcc_all_address_tmp); } if ((message_type_tmp >= 0x18) && (message_type_tmp <= 0x1f)) { addr = TRUE; prot_all_address_tmp = (tvb_get_guint8(tvb, ADDRESS_OFFSET)<<8) + (tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)); proto_tree_add_item(v52_tree, hf_v52_prot_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_prot_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); if ((message_type_tmp == 0x1e) || (message_type_tmp == 0x1f)) {} else { col_append_fstr(pinfo->cinfo, COL_INFO, " | Log C-ch: %u", prot_all_address_tmp); } } if (addr == FALSE) { if ((tvb_get_guint8(tvb, ADDRESS_OFFSET)&0x01) == 0x1) { pstn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>1)<<8)+(tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET))); proto_tree_add_item(v52_tree, hf_v52_pstn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_pstn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | PSTN: %u", pstn_all_address_tmp); } else { isdn_all_address_tmp = (((tvb_get_guint8(tvb, ADDRESS_OFFSET)>>2)<<7)+((tvb_get_guint8(tvb, LOW_ADDRESS_OFFSET)>>1))); proto_tree_add_item(v52_tree, hf_v52_isdn_address, tvb, ADDRESS_OFFSET, ADDRESS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(v52_tree, hf_v52_isdn_low_address, tvb, LOW_ADDRESS_OFFSET, LOW_ADDRESS_LENGTH, ENC_BIG_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", isdn_all_address_tmp); } } proto_tree_add_item(v52_tree, hf_v52_msg_type, tvb, MSG_TYPE_OFFSET, MSG_TYPE_LENGTH, ENC_BIG_ENDIAN); col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(tvb_get_guint8(tvb, MSG_TYPE_OFFSET), &msg_type_values_short_ext, "Unknown msg type")); dissect_v52_info(tvb, pinfo, v52_tree); } } static int dissect_v52(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_v52_message(tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_v52(void) { static hf_register_info hf[] = { { &hf_v52_discriminator, { "Protocol discriminator", "v52.disc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_v52_address, { "Address", "v52.address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_v52_low_address, { "Address Low", "v52.low_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif /* ISDN */ { &hf_v52_isdn_address, { "Address isdn", "v52.isdn_address", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL } }, { &hf_v52_isdn_low_address, { "Address isdn Low", "v52.isdn_low_address", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, /* PSTN */ { &hf_v52_pstn_address, { "Address pstn", "v52.pstn_address", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, { &hf_v52_pstn_low_address, { "Address pstn Low", "v52.pstn_low_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* LINK */ { &hf_v52_link_address, { "Address link", "v52.link_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v52_link_low_address, { "Address link Low", "v52.link_low_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* BCC */ { &hf_v52_bcc_address, { "Address bcc", "v52.bcc_address", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, { &hf_v52_bcc_low_address, { "Address bcc Low", "v52.bcc_low_address", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL } }, /* PROTECTION */ { &hf_v52_prot_address, { "Address prot", "v52.prot_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_v52_prot_low_address, { "Address prot Low", "v52.prot_low_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* CONTROL */ #if 0 { &hf_v52_ctrl_address, { "Address ctrl", "v52.ctrl_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_v52_ctrl_low_address, { "Address ctrl Low", "v52.ctrl_low_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, #endif /* OTHER */ {&hf_v52_msg_type, { "Message type", "v52.msg_type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &msg_type_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_info_element, { "Information element", "v52.info_element", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &info_element_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_info_length, { "Information length", "v52.info_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_v52_pulse_notification, { "Pulse notification", "v52.pulse_notification", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_pstn_sequence_number, { "Sequence number", "v52.pstn_sequence_number", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_cadenced_ring, { "Cadenced ring", "v52.cadenced_ring", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_pulse_type, { "Pulse Type", "v52.pulse_type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &pulse_type_values_ext, 0x0, NULL, HFILL } }, {&hf_v52_suppression_indicator, { "Suppression indicator", "v52.suppression_indicator", FT_UINT8, BASE_HEX, VALS(suppression_indication_values), 0x60, NULL, HFILL } }, {&hf_v52_pulse_duration, { "Pulse duration type", "v52.pulse_duration", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL } }, {&hf_v52_ack_request_indicator, { "Ack request indicator", "v52.ack_request_indicator", FT_UINT8, BASE_HEX, VALS(ack_request_indication_values), 0x60, NULL, HFILL } }, {&hf_v52_number_of_pulses, { "Number of pulses", "v52.number_of_pulses", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, {&hf_v52_steady_signal, { "Steady Signal", "v52.steady_signal", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &steady_signal_values_ext, 0x7f, NULL, HFILL } }, {&hf_v52_digit_ack, { "Digit ack request indication", "v52.digit_ack", FT_BOOLEAN, 8, TFS(&tfs_digit_ack_values), 0x40, NULL, HFILL } }, {&hf_v52_digit_spare, { "Digit spare", "v52.digit_spare", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL } }, {&hf_v52_digit_info, { "Digit information", "v52.digit_info", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, {&hf_v52_duration_type, { "Duration Type", "v52.duration_type", FT_UINT8, BASE_HEX, NULL, 0x3f, NULL, HFILL } }, {&hf_v52_res_unavailable, { "Resource unavailable", "v52.res_unavailable", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, {&hf_v52_line_info, { "Line_Information", "v52.line_info", FT_UINT8, BASE_HEX, VALS(line_info_values), 0x0f, NULL, HFILL } }, {&hf_v52_state, { "PSTN FSM state", "v52.state", FT_UINT8, BASE_HEX, VALS(state_values), 0x0f, NULL, HFILL } }, {&hf_v52_auto_signalling_sequence, { "Autonomous signalling sequence", "v52.auto_signalling_sequence", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, {&hf_v52_sequence_response, { "Sequence response", "v52.sequence_response", FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL } }, {&hf_v52_control_function_element, { "Control function element", "v52.control_function_element", FT_UINT8, BASE_HEX, VALS(control_function_element_values), 0x7f, NULL, HFILL } }, {&hf_v52_control_function_id, { "Control function ID", "v52.control_function", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &control_function_id_values_ext, 0x7f, NULL, HFILL } }, {&hf_v52_variant, { "Variant", "v52.variant", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_if_up_id, { "Interface up ID", "v52.interface_up_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_if_id, { "Interface ID", "v52.interface_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_if_low_id, { "Interface down ID", "v52.interface_low_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_if_all_id, { "Interface all ID", "v52.interface_all_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, {&hf_v52_sequence_number, { "Sequence number", "v52.sequence_number", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_v5_link_id, { "V5 2048 kbit/s Link Identifier", "v52.V5_ln_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_v5_multi_slot_elements, { "Additional MS ID", "v52.add_ms_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_v5_time_slot, { "V5 Time Slot Number", "v52.v5_time_slot", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, {&hf_v52_rejection_cause, { "Rejection cause", "v52.rejection_cause", FT_UINT8, BASE_HEX, VALS(rejection_cause_values), 0x7f, NULL, HFILL } }, {&hf_v52_error_cause, { "Protocol Error Cause type", "v52.error_cause", FT_UINT8, BASE_HEX, VALS(error_cause_values), 0x7f, NULL, HFILL } }, {&hf_v52_diagnostic_msg, { "Diagnostic message", "v52.diagnostic_message", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_diagnostic_element, { "Diagnostic element", "v52.diagnostic_element", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_performance_grading, { "Performance grading", "v52.performance_grading", FT_UINT8, BASE_HEX, VALS(performance_grading_values), 0x0f, NULL, HFILL } }, {&hf_v52_cp_rejection_cause, { "Rejection cp cause", "v52.cp_rejection_cause", FT_UINT8, BASE_HEX, VALS(cp_rejection_cause_values), 0x0f, NULL, HFILL } }, {&hf_v52_pstn_user_port_id, { "PSTN User Port identification Value", "v52.pstn_user_port_id", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, {&hf_v52_pstn_user_port_id_lower, { "PSTN User Port Identification Value (lower)", "v52.pstn_user_port_id_lower", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_isdn_user_port_id, { "ISDN User Port Identification Value", "v52.isdn_user_port_id", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL } }, {&hf_v52_isdn_user_port_id_lower, { "ISDN User Port Identification Value (lower)", "v52.user_port_id_lower", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, {&hf_v52_isdn_user_port_ts_num, { "ISDN user port time slot number", "v52.isdn_user_port_ts_num", FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL } }, {&hf_v52_override, { "Override", "v52.override", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, {&hf_v52_reject_cause_type, { "Reject cause type", "v52.reject_cause_type", FT_UINT8, BASE_HEX, VALS(reject_cause_type_values), 0x7f, NULL, HFILL } }, {&hf_v52_bcc_protocol_error_cause, { "Protocol error cause type", "v52.bcc_protocol_cause", FT_UINT8, BASE_HEX, VALS(bcc_protocol_error_cause_type_values), 0x7f, NULL, HFILL } }, {&hf_v52_diagnostic_message, { "Diagnostic message", "v52.diagnostic_message", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL } }, {&hf_v52_diagnostic_information, { "Diagnostic information", "v52.diagnostic_information", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, {&hf_v52_connection_incomplete_reason, { "Reason", "v52.connection_incomplete_reason", FT_UINT8, BASE_HEX, VALS(connection_incomplete_reason_values), 0x0, NULL, HFILL } }, {&hf_v52_link_control_function, { "Link control function", "v52.link_control_function", FT_UINT8, BASE_HEX, VALS(link_control_function_values), 0x7f, NULL, HFILL } }, {&hf_v52_cause_type, { "Cause type", "v52.cause_type", FT_UINT8, BASE_HEX, VALS(cause_type_values), 0x7f, NULL, HFILL } } }; static gint *ett[] = { &ett_v52, &ett_v52_info, }; proto_v52 = proto_register_protocol("V5.2", "V5.2", "v52"); proto_register_field_array (proto_v52, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("v52", dissect_v52, proto_v52); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-v5dl.c
/* packet-v5dl.c * Routines for V5 data link frame disassembly * Rolf Fiedler <[email protected]> using the LAPD code of * Gilbert Ramirez <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * V5 Data Link Layer * * V5 references: * ETS 300 324-1 * ETS 300 347-1 * */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/xdlc.h> void proto_register_v5dl(void); static int proto_v5dl = -1; static int hf_v5dl_direction = -1; /* static int hf_v5dl_address = -1; */ static int hf_v5dl_ef = -1; static int hf_v5dl_eah = -1; static int hf_v5dl_cr = -1; static int hf_v5dl_ea1 = -1; static int hf_v5dl_eal = -1; static int hf_v5dl_ea2 = -1; static int hf_v5dl_control = -1; static int hf_v5dl_n_r = -1; static int hf_v5dl_n_s = -1; static int hf_v5dl_p = -1; static int hf_v5dl_p_ext = -1; static int hf_v5dl_f = -1; static int hf_v5dl_f_ext = -1; static int hf_v5dl_s_ftype = -1; static int hf_v5dl_u_modifier_cmd = -1; static int hf_v5dl_u_modifier_resp = -1; static int hf_v5dl_ftype_i = -1; static int hf_v5dl_ftype_s_u = -1; static int hf_v5dl_ftype_s_u_ext = -1; #if 0 static int hf_v5dl_checksum = -1; static int hf_v5dl_checksum_status = -1; #endif static gint ett_v5dl = -1; static gint ett_v5dl_address = -1; static gint ett_v5dl_control = -1; /* static gint ett_v5dl_checksum = -1; */ static expert_field ei_v5dl_checksum = EI_INIT; static dissector_handle_t v52_handle; /* * Bits in the address field. */ #define V5DL_EAH 0xfc00 /* Service Access Point Identifier */ #define V5DL_EAH_SHIFT 10 #define V5DL_CR 0x0200 /* Command/Response bit */ #define V5DL_EA1 0x0100 /* First Address Extension bit */ #define V5DL_EAL 0x00fe /* Terminal Endpoint Identifier */ #define V5DL_EAL_SHIFT 1 #define V5DL_EA2 0x0001 /* Second Address Extension bit */ static const value_string v5dl_direction_vals[] = { { P2P_DIR_RECV, "Network->User"}, { P2P_DIR_SENT, "User->Network"}, { 0, NULL } }; static const value_string v5dl_addr_vals[] = { { 8175, "ISDN Protocol" }, { 8176, "PSTN Protocol" }, { 8177, "CONTROL Protocol" }, { 8178, "BCC Protocol" }, { 8179, "PROT Protocol" }, { 8180, "Link Control Protocol" }, { 8191, "VALUE RESERVED" }, { 0, NULL } }; /* Used only for U frames */ static const xdlc_cf_items v5dl_cf_items = { NULL, NULL, &hf_v5dl_p, &hf_v5dl_f, NULL, &hf_v5dl_u_modifier_cmd, &hf_v5dl_u_modifier_resp, NULL, &hf_v5dl_ftype_s_u }; /* Used only for I and S frames */ static const xdlc_cf_items v5dl_cf_items_ext = { &hf_v5dl_n_r, &hf_v5dl_n_s, &hf_v5dl_p_ext, &hf_v5dl_f_ext, &hf_v5dl_s_ftype, NULL, NULL, &hf_v5dl_ftype_i, &hf_v5dl_ftype_s_u_ext }; #define MAX_V5DL_PACKET_LEN 1024 static int dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *v5dl_tree, *addr_tree; proto_item *v5dl_ti, *addr_ti; int direction; guint v5dl_header_len; guint16 control; #if 0 proto_tree *checksum_tree; proto_item *checksum_ti; guint16 checksum, checksum_calculated; guint checksum_offset; #endif guint16 addr, cr, eah, eal, v5addr; gboolean is_response = 0; #if 0 guint length, reported_length; #endif tvbuff_t *next_tvb; const char *srcname = "?"; const char *dstname = "?"; col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5DL"); col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_ntohs(tvb, 0); cr = addr & V5DL_CR; eal = (addr & V5DL_EAL) >> V5DL_EAL_SHIFT; eah = (addr & V5DL_EAH) >> V5DL_EAH_SHIFT; v5addr = (eah << 7) + eal; v5dl_header_len = 2; /* addr */ direction = pinfo->p2p_dir; if (pinfo->p2p_dir == P2P_DIR_RECV) { is_response = cr ? FALSE : TRUE; srcname = "Network"; dstname = "User"; } else if (pinfo->p2p_dir == P2P_DIR_SENT) { is_response = cr ? TRUE : FALSE; srcname = "User"; dstname = "Network"; } col_set_str(pinfo->cinfo, COL_RES_DL_SRC, srcname); col_set_str(pinfo->cinfo, COL_RES_DL_DST, dstname); if (tree) { proto_item *direction_ti; v5dl_ti = proto_tree_add_item(tree, proto_v5dl, tvb, 0, -1, ENC_NA); v5dl_tree = proto_item_add_subtree(v5dl_ti, ett_v5dl); /* * Don't show the direction if we don't know it. */ if (direction != P2P_DIR_UNKNOWN) { direction_ti = proto_tree_add_uint(v5dl_tree, hf_v5dl_direction, tvb, 0, 0, pinfo->p2p_dir); proto_item_set_generated(direction_ti); } addr_ti = proto_tree_add_uint(v5dl_tree, hf_v5dl_ef, tvb, 0, 2, v5addr); addr_tree = proto_item_add_subtree(addr_ti, ett_v5dl_address); proto_tree_add_uint(addr_tree, hf_v5dl_eah, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5dl_cr, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5dl_ea1, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5dl_eal, tvb, 1, 1, addr); proto_tree_add_uint(addr_tree, hf_v5dl_ea2, tvb, 1, 1, addr); } else { v5dl_ti = NULL; v5dl_tree = NULL; } control = dissect_xdlc_control(tvb, 2, pinfo, v5dl_tree, hf_v5dl_control, ett_v5dl_control, &v5dl_cf_items, &v5dl_cf_items_ext, NULL, NULL, is_response, TRUE, FALSE); v5dl_header_len += XDLC_CONTROL_LEN(control, TRUE); if (tree) proto_item_set_len(v5dl_ti, v5dl_header_len); /* * XXX - the sample capture supplied with bug 7027 does not * appear to include checksums in the packets. */ #if 0 /* * Check the checksum, if available. * The checksum is a CCITT CRC-16 at the end of the packet, so * if we don't have the entire packet in the capture - i.e., if * tvb_captured_length(tvb) != tvb_reported_length(tvb) we can't check it. */ length = tvb_captured_length(tvb); reported_length = tvb_reported_length(tvb); /* * If the reported length isn't big enough for the V5DL header * and 2 bytes of checksum, the packet is malformed, as the * checksum overlaps the header. */ if (reported_length < v5dl_header_len + 2) return; if (length == reported_length) { /* * There's no snapshot length cutting off any of the * packet. */ checksum_offset = reported_length - 2; checksum_calculated = crc16_ccitt_tvb(tvb, checksum_offset); checksum_calculated = g_htons(checksum_calculated); /* Note: g_htons() macro may eval arg multiple times */ proto_tree_add_checksum(v5dl_tree, tvb, checksum_offset, hf_v5dl_checksum, hf_v5dl_checksum_status, &ei_v5dl_checksum, pinfo, checksum_calculated, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY); /* * Remove the V5DL header *and* the checksum. */ next_tvb = tvb_new_subset_length_caplen(tvb, v5dl_header_len, tvb_captured_length_remaining(tvb, v5dl_header_len) - 2, tvb_reported_length_remaining(tvb, v5dl_header_len) - 2); } else { /* * Some or all of the packet is cut off by a snapshot * length. */ if (length == reported_length - 1) { /* * One byte is cut off, so there's only one * byte of checksum in the captured data. * Remove that byte from the captured length * and both bytes from the reported length. */ next_tvb = tvb_new_subset_length_caplen(tvb, v5dl_header_len, tvb_captured_length_remaining(tvb, v5dl_header_len) - 1, tvb_reported_length_remaining(tvb, v5dl_header_len) - 2); } else { /* * Two or more bytes are cut off, so there are * no bytes of checksum in the captured data. * Just remove the checksum from the reported * length. */ next_tvb = tvb_new_subset_length_caplen(tvb, v5dl_header_len, tvb_captured_length_remaining(tvb, v5dl_header_len), tvb_reported_length_remaining(tvb, v5dl_header_len) - 2); } } #else next_tvb = tvb_new_subset_remaining(tvb, v5dl_header_len); #endif if (XDLC_IS_INFORMATION(control)) { /* call V5.2 dissector */ call_dissector(v52_handle, next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } void proto_reg_handoff_v5dl(void); void proto_register_v5dl(void) { static hf_register_info hf[] = { { &hf_v5dl_direction, { "Direction", "v5dl.direction", FT_UINT8, BASE_DEC, VALS(v5dl_direction_vals), 0x0, NULL, HFILL }}, #if 0 { &hf_v5dl_address, { "Address Field", "v5dl.address", FT_UINT16, BASE_HEX, NULL, 0x0, "Address", HFILL }}, #endif { &hf_v5dl_ef, { "EF", "v5dl.ef", FT_UINT16, BASE_DEC, VALS(v5dl_addr_vals), 0x0, "Envelope Function Address", HFILL }}, { &hf_v5dl_eah, { "EAH", "v5dl.eah", FT_UINT16, BASE_DEC, NULL, V5DL_EAH, "Envelope Address High", HFILL }}, { &hf_v5dl_cr, { "C/R", "v5dl.cr", FT_UINT16, BASE_DEC, NULL, V5DL_CR, "Command/Response bit", HFILL }}, { &hf_v5dl_ea1, { "EA1", "v5dl.ea1", FT_UINT16, BASE_DEC, NULL, V5DL_EA1, "First Address Extension bit", HFILL }}, { &hf_v5dl_eal, { "EAL", "v5dl.eal", FT_UINT16, BASE_DEC, NULL, V5DL_EAL, "Envelope Address Low", HFILL }}, { &hf_v5dl_ea2, { "EA2", "v5dl.ea2", FT_UINT16, BASE_DEC, NULL, V5DL_EA2, "Second Address Extension bit", HFILL }}, { &hf_v5dl_control, { "Control Field", "v5dl.control", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_v5dl_n_r, { "N(R)", "v5dl.control.n_r", FT_UINT16, BASE_DEC, NULL, XDLC_N_R_EXT_MASK, NULL, HFILL }}, { &hf_v5dl_n_s, { "N(S)", "v5dl.control.n_s", FT_UINT16, BASE_DEC, NULL, XDLC_N_S_EXT_MASK, NULL, HFILL }}, { &hf_v5dl_p, { "Poll", "v5dl.control.p", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_v5dl_p_ext, { "Poll", "v5dl.control.p", FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }}, { &hf_v5dl_f, { "Final", "v5dl.control.f", FT_BOOLEAN, 8, TFS(&tfs_set_notset), XDLC_P_F, NULL, HFILL }}, { &hf_v5dl_f_ext, { "Final", "v5dl.control.f", FT_BOOLEAN, 16, TFS(&tfs_set_notset), XDLC_P_F_EXT, NULL, HFILL }}, { &hf_v5dl_s_ftype, { "Supervisory frame type", "v5dl.control.s_ftype", FT_UINT16, BASE_HEX, VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL }}, { &hf_v5dl_u_modifier_cmd, { "Command", "v5dl.control.u_modifier_cmd", FT_UINT8, BASE_HEX, VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_v5dl_u_modifier_resp, { "Response", "v5dl.control.u_modifier_resp", FT_UINT8, BASE_HEX, VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL }}, { &hf_v5dl_ftype_i, { "Frame type", "v5dl.control.ftype", FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL }}, { &hf_v5dl_ftype_s_u, { "Frame type", "v5dl.control.ftype", FT_UINT8, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }}, { &hf_v5dl_ftype_s_u_ext, { "Frame type", "v5dl.control.ftype", FT_UINT16, BASE_HEX, VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL }}, #if 0 { &hf_v5dl_checksum, { "Checksum", "v5dl.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "Details at: https://www.wireshark.org/docs/wsug_html_chunked/ChAdvChecksums.html", HFILL }}, { &hf_v5dl_checksum_status, { "Checksum Status", "v5dl.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL }}, #endif }; static gint *ett[] = { &ett_v5dl, &ett_v5dl_address, &ett_v5dl_control, /* &ett_v5dl_checksum */ }; static ei_register_info ei[] = { { &ei_v5dl_checksum, { "v5dl.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }}, }; expert_module_t* expert_v5dl; proto_v5dl = proto_register_protocol("V5 Data Link Layer", "V5DL", "v5dl"); proto_register_field_array (proto_v5dl, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_v5dl = expert_register_protocol(proto_v5dl); expert_register_field_array(expert_v5dl, ei, array_length(ei)); register_dissector("v5dl", dissect_v5dl, proto_v5dl); } void proto_reg_handoff_v5dl(void) { v52_handle = find_dissector_add_dependency("v52", proto_v5dl); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-v5ef.c
/* packet-v5ef.c * Routines for V5 envelope function frame disassembly * Rolf Fiedler <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * V5 bitstream over HDLC handling * * V5 references: * * ETS 300 324-1 * ETS 300 347-1 */ #include "config.h" #include <epan/packet.h> #include <wiretap/wtap.h> void proto_register_v5ef(void); void proto_reg_handoff_v5ef(void); static int proto_v5ef = -1; static int hf_v5ef_direction = -1; static int hf_v5ef_address = -1; static int hf_v5ef_eah = -1; static int hf_v5ef_ea1 = -1; static int hf_v5ef_eal = -1; static int hf_v5ef_ea2 = -1; static gint ett_v5ef = -1; static gint ett_v5ef_address = -1; static dissector_handle_t v5dl_handle, lapd_phdr_handle, v5ef_handle; /* * Bits in the address field. */ #define V5EF_EAH 0xfc00 /* Service Access Point Identifier */ #define V5EF_EAH_SHIFT 10 #define V5EF_EA1 0x0100 /* First Address Extension bit */ #define V5EF_EAL 0x00fe /* Terminal Endpoint Identifier */ #define V5EF_EAL_SHIFT 1 #define V5EF_EA2 0x0001 /* Second Address Extension bit */ static const value_string v5ef_direction_vals[] = { { 0, "AN->LE"}, { 1, "LE->AN"}, { 0, NULL } }; #define MAX_V5EF_PACKET_LEN 1024 static int dissect_v5ef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { struct isdn_phdr *isdn = (struct isdn_phdr *)data; proto_tree *v5ef_tree, *addr_tree; proto_item *v5ef_ti, *addr_ti; int direction; int v5ef_header_len; guint16 addr, eah, eal, efaddr; tvbuff_t *next_tvb; const char *srcname = "src"; const char *dstname = "dst"; col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5-EF"); col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_ntohs(tvb, 0); eah = (addr & V5EF_EAH) >> V5EF_EAH_SHIFT; eal = (addr & V5EF_EAL) >> V5EF_EAL_SHIFT; efaddr = (eah << 7) + eal; v5ef_header_len = 2; /* addr */ direction = isdn->uton; if (direction==0) { srcname = "LE"; dstname = "AN"; } else if (direction > 0) { srcname = "AN"; dstname = "LE"; } col_set_str(pinfo->cinfo, COL_RES_DL_SRC, srcname); col_set_str(pinfo->cinfo, COL_RES_DL_DST, dstname); if (tree) { proto_item *direction_ti; v5ef_ti = proto_tree_add_item(tree, proto_v5ef, tvb, 0, -1, ENC_NA); v5ef_tree = proto_item_add_subtree(v5ef_ti, ett_v5ef); /* * Don't show the direction if we don't know it. */ if (direction != P2P_DIR_UNKNOWN) { direction_ti = proto_tree_add_uint(v5ef_tree, hf_v5ef_direction, tvb, 0, 0, direction); proto_item_set_generated(direction_ti); } addr_ti = proto_tree_add_uint(v5ef_tree, hf_v5ef_address, tvb, 0, 2, addr); addr_tree = proto_item_add_subtree(addr_ti, ett_v5ef_address); proto_tree_add_uint(addr_tree, hf_v5ef_eah, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_ea1, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_eal, tvb, 1, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_ea2, tvb, 1, 1, addr); } else { v5ef_ti = NULL; v5ef_tree = NULL; } if (tree) proto_item_set_len(v5ef_ti, v5ef_header_len); next_tvb = tvb_new_subset_remaining(tvb, v5ef_header_len); if (efaddr>8175) call_dissector(v5dl_handle,next_tvb, pinfo, tree); else call_dissector_with_data(lapd_phdr_handle, next_tvb, pinfo, tree, isdn); return tvb_captured_length(tvb); } void proto_register_v5ef(void) { static hf_register_info hf[] = { { &hf_v5ef_direction, { "Direction", "v5ef.direction", FT_UINT8, BASE_DEC, VALS(v5ef_direction_vals), 0x0, NULL, HFILL }}, { &hf_v5ef_address, { "Address Field", "v5ef.address", FT_UINT16, BASE_HEX, NULL, 0x0, "Address", HFILL }}, { &hf_v5ef_eah, { "EAH", "v5ef.eah", FT_UINT16, BASE_DEC, NULL, V5EF_EAH, "Envelope Address High Part", HFILL }}, { &hf_v5ef_ea1, { "EA1", "v5ef.ea1", FT_UINT16, BASE_DEC, NULL, V5EF_EA1, "First Address Extension bit", HFILL }}, { &hf_v5ef_eal, { "EAL", "v5ef.eal", FT_UINT16, BASE_DEC, NULL, V5EF_EAL, "Envelope Address Low Part", HFILL }}, { &hf_v5ef_ea2, { "EA2", "v5ef.ea2", FT_UINT16, BASE_DEC, NULL, V5EF_EA2, "Second Address Extension bit", HFILL }}, }; static gint *ett[] = { &ett_v5ef, &ett_v5ef_address, }; proto_v5ef = proto_register_protocol("V5 Envelope Function (v5ef)", "v5ef", "v5ef"); proto_register_field_array (proto_v5ef, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); v5ef_handle = register_dissector("v5ef", dissect_v5ef, proto_v5ef); } void proto_reg_handoff_v5ef(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_V5_EF, v5ef_handle); lapd_phdr_handle = find_dissector_add_dependency("lapd-phdr", proto_v5ef); v5dl_handle = find_dissector_add_dependency("v5dl", proto_v5ef); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-v5ua.c
/* packet-v5ua.c * * Extension of all V5.2-User Adaptation Layer dissection elements * References: * RFC 3807 * RFC 4233 * RFC 5133 * * Copyright 2009 * * ISKRATEL d.o.o. | 4S d.o.o. * http://www.iskratel.si/ | http://www.4es.si/ * <[email protected]> | <[email protected]> * Vladimir Smrekar <[email protected]> * * Routines for V5.2-User Adaptation Layer dissection * * Extension of ISDN Q.921-User Adaptation Layer dissection * Copyright 2002, Michael Tuexen <Michael.Tuexen[AT]siemens.com> * * Christoph Neusch <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/sctpppids.h> /* include V5UA payload protocol ID */ #include <wsutil/str_util.h> #include <wsutil/ws_roundup.h> void proto_register_v5ua(void); void proto_reg_handoff_v5ua(void); static int paddingl = 0; static int dlci_efa = -1; /* Initialize the protocol and registered fields */ static int proto_v5ua = -1; static dissector_handle_t q931_handle; static dissector_handle_t v52_handle; /* common msg-header */ static int hf_version = -1; static int hf_reserved = -1; static int hf_msg_class = -1; static int hf_msg_type = -1; /* static int hf_msg_type_id = -1; */ static int hf_msg_length = -1; /* V5UA message header */ static int hf_link_id = -1; static int hf_chnl_id = -1; static int hf_adaptation_layer_id = -1; static int hf_text_if_id = -1; static int hf_scn_protocol_id = -1; static int hf_info_string = -1; static int hf_asp_identifier = -1; static int hf_dlci_zero_bit = -1; static int hf_dlci_spare_bit = -1; static int hf_dlci_sapi = -1; static int hf_dlci_one_bit = -1; static int hf_dlci_tei = -1; static int hf_efa = -1; /* static int hf_spare_efa = -1; */ /* variable length parameter (msg) */ static int hf_parameter_tag = -1; static int hf_parameter_tag_draft = -1; static int hf_parameter_length = -1; static int hf_parameter_value = -1; static int hf_parameter_padding = -1; /* parameter fields */ static int hf_link_status = -1; static int hf_sa_bit_id = -1; static int hf_sa_bit_value = -1; static int hf_diagnostic_info = -1; static int hf_if_range_start = -1; static int hf_if_range_end = -1; static int hf_heartbeat_data = -1; static int hf_traffic_mode_type = -1; static int hf_error_code = -1; static int hf_draft_error_code = -1; static int hf_status_type = -1; static int hf_status_id = -1; static int hf_error_reason = -1; static int hf_asp_reason = -1; static int hf_tei_status = -1; static int hf_tei_draft_status = -1; static int hf_release_reason = -1; /* Initialize the subtree pointers */ static gint ett_v5ua = -1; static gint ett_v5ua_common_header= -1; static gint ett_v5ua_parameter = -1; static gint ett_v5ua_layer3 = -1; #define RFC 0x1 #define DRAFT 0x2 /* Version of IUA */ static int iua_version = RFC; /* Variables necessary for dissection of draft messages */ static int msg_class = -1; static int msg_type = -1; static int msg_length = -1; static int messageclassCopy = -1; static int sa_bit_id = -1; static int link_status_operational = -1; /* Code to actually dissect the packets */ /* define the parameters for the Tags: Tag-Type,Tag-Length,Tag-Value (Payload) */ #define PARAMETER_TAG_OFFSET 0 #define PARAMETER_TAG_LENGTH 2 #define PARAMETER_LENGTH_OFFSET (PARAMETER_TAG_OFFSET + PARAMETER_TAG_LENGTH) #define PARAMETER_LENGTH_LENGTH 2 #define PARAMETER_VALUE_OFFSET (PARAMETER_LENGTH_OFFSET + PARAMETER_LENGTH_LENGTH) #define PARAMETER_HEADER_OFFSET PARAMETER_TAG_OFFSET #define PARAMETER_HEADER_LENGTH (PARAMETER_TAG_LENGTH + PARAMETER_LENGTH_LENGTH) /*----------------------V5UA Interface Identifier (int) (Draft,RFC)------------*/ /* define parameter for the format of the integer formatted Interface Identifier */ #define INT_IF_ID_LINK_OFFSET PARAMETER_VALUE_OFFSET #define INT_IF_ID_LINK_LENGTH 4 #define INT_IF_ID_CHNL_OFFSET INT_IF_ID_LINK_OFFSET #define INT_IF_ID_CHNL_LENGTH 1 #define INT_INTERFACE_ID_LENGTH 4 static int linkIdentifier = -1; static void dissect_int_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint32 identifier; guint16 number_of_ids, id_number; gint offset; number_of_ids= (tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH) / INT_INTERFACE_ID_LENGTH; offset = INT_IF_ID_LINK_OFFSET; proto_item_append_text(parameter_item, "("); for (id_number = 0; id_number < number_of_ids; id_number++) { proto_tree_add_item(parameter_tree, hf_link_id, parameter_tvb, offset, INT_IF_ID_LINK_LENGTH, ENC_BIG_ENDIAN); identifier = tvb_get_ntohl(parameter_tvb,offset)>>5; if (id_number < 1) { proto_item_append_text(parameter_item, "L:%d",identifier); } else { proto_item_append_text(parameter_item, " | L:%d",identifier); } linkIdentifier = identifier; proto_tree_add_item(parameter_tree, hf_chnl_id, parameter_tvb, offset+3, INT_IF_ID_CHNL_LENGTH, ENC_BIG_ENDIAN); identifier = tvb_get_guint8(parameter_tvb,offset+3)&0x1f; proto_item_append_text(parameter_item, " C:%d", identifier); offset += INT_INTERFACE_ID_LENGTH; } proto_item_append_text(parameter_item, ")"); } /*----------------------V5UA Interface Identifier (int) (Draft,RFC)------------*/ /*----------------------Text Interface Identifier (RFC)------------------------*/ #define TEXT_IF_ID_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define TEXT_IF_ID_VALUE_OFFSET PARAMETER_VALUE_OFFSET #define TEXT_IF_ID_HEADER_LENGTH PARAMETER_HEADER_LENGTH static void dissect_text_interface_identifier_parameter(packet_info *pinfo, tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 if_id_length; const guint8* str; if_id_length = tvb_get_ntohs(parameter_tvb, TEXT_IF_ID_LENGTH_OFFSET) - TEXT_IF_ID_HEADER_LENGTH; proto_tree_add_item_ret_string(parameter_tree, hf_text_if_id, parameter_tvb, TEXT_IF_ID_VALUE_OFFSET, if_id_length, ENC_ASCII, pinfo->pool, &str); proto_item_append_text(parameter_item, " (0x%s)", str); } /*----------------------Text Interface Identifier (RFC)------------------------*/ /*----------------------DLCI & Envelope Function Address------------------------*/ /* interpretation of EFA-values */ static const value_string efa_values[] = { { 8175, "ISDN Protocol" }, { 8176, "PSTN Protocol" }, { 8177, "CONTROL Protocol" }, { 8178, "BCC Protocol" }, { 8179, "PROT Protocol" }, { 8180, "Link Control Protocol" }, { 8191, "VALUE RESERVED" }, { 0, NULL } }; #define DLCI_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define DLCI_SAPI_OFFSET PARAMETER_VALUE_OFFSET #define DLCI_HEADER_LENGTH PARAMETER_HEADER_LENGTH #define DLCI_SAPI_LENGTH 1 #define DLCI_TEI_LENGTH 1 #define EFA_LENGTH 2 static void dissect_dlci_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, packet_info *pinfo) { guint16 efa = 0, offset = 0; guint8 sapi = -1; guint8 tei = -1; if (iua_version == RFC) offset = DLCI_SAPI_OFFSET; else if(iua_version == DRAFT) offset = DLCI_HEADER_LENGTH + tvb_get_ntohs(parameter_tvb, DLCI_LENGTH_OFFSET); proto_tree_add_item(parameter_tree, hf_dlci_zero_bit, parameter_tvb, offset, DLCI_SAPI_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_dlci_spare_bit, parameter_tvb, offset, DLCI_SAPI_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_dlci_sapi, parameter_tvb, offset, DLCI_SAPI_LENGTH, ENC_BIG_ENDIAN); offset += DLCI_SAPI_LENGTH; proto_tree_add_item(parameter_tree, hf_dlci_one_bit, parameter_tvb, offset, DLCI_TEI_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_dlci_tei, parameter_tvb, offset, DLCI_TEI_LENGTH, ENC_BIG_ENDIAN); sapi = tvb_get_ntohs(parameter_tvb, offset-DLCI_TEI_LENGTH-DLCI_SAPI_LENGTH)>>2; tei = tvb_get_ntohs(parameter_tvb, offset-DLCI_TEI_LENGTH)>>1; offset += DLCI_TEI_LENGTH; efa = tvb_get_ntohs(parameter_tvb, offset); dlci_efa = tvb_get_ntohs(parameter_tvb, offset); if (dlci_efa >= 0 && dlci_efa <= 8175) { col_append_fstr(pinfo->cinfo, COL_INFO, " | ISDN: %u", dlci_efa); } else if (dlci_efa == 8176) { col_append_str(pinfo->cinfo, COL_INFO, " | PSTN"); } else if (dlci_efa == 8177) { col_append_str(pinfo->cinfo, COL_INFO, " | Ctrl"); } else if (dlci_efa == 8178) { col_append_str(pinfo->cinfo, COL_INFO, " | BCC"); } else if (dlci_efa == 8179) { col_append_str(pinfo->cinfo, COL_INFO, " | ProtProt"); } else if (dlci_efa == 8180) { col_append_str(pinfo->cinfo, COL_INFO, " | LinkCtrl"); } if(efa <= 8175) { proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa, "ISDN (%u)", efa); proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:ISDN (%u))",sapi,tei,efa); } else if (efa <= 8180){ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa, "%s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset)); proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str_const(efa, efa_values, "unknown EFA-value"),efa); } else { proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa, "RESERVED (%u)", efa); proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:RESERVED (%u))",sapi,tei,efa); } } /*----------------------DLCI & Envelope Function Address------------------------*/ /*----------------------Error Indication (Draft)-------------------------------*/ /* define Error Code Parameter for Layer Management (MGMT) Messages */ #define MGMT_ERROR_INVALID_TEI_DRAFT 0x00 #define MGMT_ERROR_INVALID_IFID_DRAFT 0x01 #define MGMT_ERROR_UNDEFINIED_MSG_DRAFT 0x02 #define MGMT_ERROR_VERSION_ERR_DRAFT 0x03 #define MGMT_ERROR_INVALID_STID_DRAFT 0x04 #define MGMT_ERROR_INVALID_SCNV_DRAFT 0x05 #define MGMT_ERROR_INVALID_ALI_DRAFT 0x06 static const value_string draft_error_code_values[] = { { MGMT_ERROR_INVALID_TEI_DRAFT, "Invalid TEI" }, { MGMT_ERROR_INVALID_IFID_DRAFT, "Invalid interface ID" }, { MGMT_ERROR_UNDEFINIED_MSG_DRAFT, "An unexpected message was received" }, { MGMT_ERROR_VERSION_ERR_DRAFT, "The IUA layers are of different version" }, { MGMT_ERROR_INVALID_STID_DRAFT, "Invalid SCTP stream identifier" }, { MGMT_ERROR_INVALID_SCNV_DRAFT, "Invalid SCN version" }, { MGMT_ERROR_INVALID_ALI_DRAFT, "Invalid Adaptation Layer Identifier" }, { 0, NULL } }; #define MGMT_ERROR_MSG_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define MGMT_ERROR_MSG_HEADER_LENGTH PARAMETER_HEADER_LENGTH #define MGMT_ERROR_CODE_LENGTH 4 static void dissect_draft_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree) { guint16 offset = MGMT_ERROR_MSG_HEADER_LENGTH + tvb_get_ntohs(parameter_tvb, MGMT_ERROR_MSG_LENGTH_OFFSET) + 4; proto_tree_add_item(parameter_tree, hf_draft_error_code, parameter_tvb, offset, MGMT_ERROR_CODE_LENGTH, ENC_BIG_ENDIAN); offset += MGMT_ERROR_CODE_LENGTH ; if( tvb_reported_length_remaining(parameter_tvb,offset) > 0 ) proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, offset, msg_length - offset,ENC_ASCII); } /*----------------------Error Indication (Draft)-------------------------------*/ /*----------------------Error Indication (RFC)---------------------------------*/ /* define Error Code Parameter for Layer Management (MGMT) Messages */ #define MGMT_ERROR_INVALID_VERSION 0x01 #define MGMT_ERROR_INVALID_IF_ID 0x02 #define MGMT_ERROR_UNSUPPORTED_MSG_CLASS 0x03 #define MGMT_ERROR_UNSUPPORTED_MSG_TYPE 0x04 #define MGMT_ERROR_UNSUPPORTED_TRAFFIC_HANDLING_MODE 0x05 #define MGMT_ERROR_UNEXPECTED_MSG 0x06 #define MGMT_ERROR_PROTOCOL_ERROR 0x07 #define MGMT_ERROR_UNSUPPORTED_IF_ID_TYPE 0x08 #define MGMT_ERROR_INVALID_STREAM_ID 0x09 #define MGMT_ERROR_UNASSIGNED_TEI 0x0a #define MGMT_ERROR_UNRECOGNIZED_SAPI 0x0b #define MGMT_ERROR_INVALID_TEI_SAPI_COMBINATION 0x0c static const value_string error_code_values[] = { { MGMT_ERROR_INVALID_VERSION, "Invalid version" }, { MGMT_ERROR_INVALID_IF_ID, "Invalid interface identifier" }, { MGMT_ERROR_UNSUPPORTED_MSG_CLASS, "Unsupported message class" }, { MGMT_ERROR_UNSUPPORTED_MSG_TYPE, "Unsupported message type" }, { MGMT_ERROR_UNSUPPORTED_TRAFFIC_HANDLING_MODE, "Unsupported traffic handling mode" }, { MGMT_ERROR_UNEXPECTED_MSG, "Unexpected message" }, { MGMT_ERROR_PROTOCOL_ERROR, "Protocol error" }, { MGMT_ERROR_UNSUPPORTED_IF_ID_TYPE, "Unsupported interface identifier type" }, { MGMT_ERROR_INVALID_STREAM_ID, "Invalid stream identifier" }, { MGMT_ERROR_UNASSIGNED_TEI, "Unassigned TEI" }, { MGMT_ERROR_UNRECOGNIZED_SAPI, "Unrecognized SAPI" }, { MGMT_ERROR_INVALID_TEI_SAPI_COMBINATION, "Invalid TEI/SAPI combination" }, { 0, NULL } }; #define MGMT_ERROR_CODE_OFFSET PARAMETER_VALUE_OFFSET static void dissect_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_error_code, parameter_tvb, MGMT_ERROR_CODE_OFFSET, MGMT_ERROR_CODE_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, MGMT_ERROR_CODE_OFFSET), error_code_values, "Unknown error code")); } static void dissect_diagnostic_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 diag_info_length; diag_info_length = tvb_get_ntohs(parameter_tvb, MGMT_ERROR_MSG_LENGTH_OFFSET) - MGMT_ERROR_MSG_HEADER_LENGTH; proto_tree_add_item(parameter_tree, hf_diagnostic_info, parameter_tvb, PARAMETER_VALUE_OFFSET, diag_info_length, ENC_NA); proto_item_append_text(parameter_item, " (%u byte%s)", diag_info_length, plurality(diag_info_length, "", "s")); } /*----------------------Error Indication (RFC)---------------------------------*/ /*----------------------Notify (RFC)-------------------------------------------*/ /* define Status Type parameters for Notify (NTFY) Messages */ #define NTFY_STATUS_TYPE_AS_STATE_CHANGE 0x01 #define NTFY_STATUS_TYPE_OTHER 0x02 static const value_string status_type_values[] = { { NTFY_STATUS_TYPE_AS_STATE_CHANGE, "Application server state change" }, { NTFY_STATUS_TYPE_OTHER, "Other" }, { 0, NULL } }; /* define Status Identification parameters for NTFY Messages (AS state change)*/ #define NTFY_STATUS_IDENT_AS_DOWN 0x01 #define NTFY_STATUS_IDENT_AS_INACTIVE 0x02 #define NTFY_STATUS_IDENT_AS_ACTIVE 0x03 #define NTFY_STATUS_IDENT_AS_PENDING 0x04 /* define Status Identification parameters for NTFY Messages (Other)*/ #define NTFY_STATUS_INSUFFICIENT_ASP_RES_ACTIVE 0x01 #define NTFY_STATUS_ALTERNATE_ASP_ACTIVE 0x02 static const value_string status_type_id_values[] = { { NTFY_STATUS_TYPE_AS_STATE_CHANGE * 256 * 256 + NTFY_STATUS_IDENT_AS_DOWN, "Application server down" }, { NTFY_STATUS_TYPE_AS_STATE_CHANGE * 256 * 256 + NTFY_STATUS_IDENT_AS_INACTIVE, "Application server inactive" }, { NTFY_STATUS_TYPE_AS_STATE_CHANGE * 256 * 256 + NTFY_STATUS_IDENT_AS_ACTIVE, "Application server active" }, { NTFY_STATUS_TYPE_AS_STATE_CHANGE * 256 * 256 + NTFY_STATUS_IDENT_AS_PENDING, "Application server pending" }, { NTFY_STATUS_TYPE_OTHER * 256 * 256 + NTFY_STATUS_INSUFFICIENT_ASP_RES_ACTIVE, "Insufficient ASP resources active in AS" }, { NTFY_STATUS_TYPE_OTHER * 256 * 256 + NTFY_STATUS_ALTERNATE_ASP_ACTIVE, "Alternate ASP active" }, { 0, NULL } }; #define NTFY_STATUS_TYPE_OFFSET PARAMETER_VALUE_OFFSET #define NTFY_STATUS_TYPE_LENGTH 2 #define NTFY_STATUS_IDENT_OFFSET (NTFY_STATUS_TYPE_OFFSET + NTFY_STATUS_TYPE_LENGTH) #define NTFY_STATUS_IDENT_LENGTH 2 static void dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 status_type, status_id; status_type = tvb_get_ntohs(parameter_tvb, NTFY_STATUS_TYPE_OFFSET); status_id = tvb_get_ntohs(parameter_tvb, NTFY_STATUS_IDENT_OFFSET); proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, NTFY_STATUS_TYPE_OFFSET, NTFY_STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(parameter_tree, hf_status_id, parameter_tvb, NTFY_STATUS_IDENT_OFFSET, NTFY_STATUS_IDENT_LENGTH, status_id, "%u (%s)", status_id, val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown")); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "Unknown status information")); } /*----------------------Notify (RFC)-------------------------------------------*/ /*----------------------TEI Status Indication,Confirm (RFC)--------------------*/ /* define parameters for TEI Status (Indication,Confirm) Messages */ #define TEI_STATUS_ASSIGNED 0x0 #define TEI_STATUS_UNASSIGNED 0x1 static const value_string tei_status_values[] = { { TEI_STATUS_ASSIGNED, "TEI is considered assigned by Q.921" }, { TEI_STATUS_UNASSIGNED, "TEI is considered unassigned by Q.921" }, { 0, NULL } }; #define TEI_STATUS_OFFSET PARAMETER_VALUE_OFFSET #define TEI_STATUS_LENGTH 4 static void dissect_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_tei_status, parameter_tvb, TEI_STATUS_OFFSET, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TEI_STATUS_OFFSET), tei_status_values, "Unknown TEI status")); } /*----------------------TEI Status (RFC)---------------------------------------*/ /*----------------------TEI Status Indication,Confirm (Draft)------------------*/ #define TEI_DRAFT_IN_SERVICE 0x0 #define TEI_DRAFT_OUT_OF_SERVICE 0x1 static const value_string tei_draft_status_values[] = { { TEI_DRAFT_IN_SERVICE, "TEI is in service" }, { TEI_DRAFT_OUT_OF_SERVICE,"TEI is out of service" }, { 0, NULL } }; #define TEI_STATUS_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET static void dissect_draft_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { gint offset; offset = tvb_get_ntohs(parameter_tvb, TEI_STATUS_LENGTH_OFFSET) + 8; if(tvb_reported_length_remaining(parameter_tvb, offset) > 0 ){ proto_tree_add_item(parameter_tree, hf_tei_draft_status, parameter_tvb, offset, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), tei_draft_status_values, "Unknown TEI Status")); } } /*----------------------TEI Status (Draft)-------------------------------------*/ /*----------------------ASP Up,Down,Active,Inactive (Draft)--------------------*/ static void dissect_asp_msg_parameter(packet_info *pinfo, tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { const guint8* str; guint16 adaptation_layer_id_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); proto_tree_add_item_ret_string(parameter_tree, hf_adaptation_layer_id, parameter_tvb, PARAMETER_VALUE_OFFSET, adaptation_layer_id_length, ENC_ASCII, pinfo->pool, &str); proto_item_append_text(parameter_item, " (%s)", str); } static void dissect_scn_protocol_id_parameter(packet_info *pinfo, tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { const guint8* str; guint16 id_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); proto_tree_add_item_ret_string(parameter_tree, hf_scn_protocol_id, parameter_tvb, PARAMETER_VALUE_OFFSET, id_length, ENC_ASCII, pinfo->pool, &str); proto_item_append_text(parameter_item, " (%s)", str); } /*----------------------ASP (Draft)--------------------------------------------*/ /*----------------------ASP Down + Ack (RFC)--------------------------------*/ /* define reason parameter for Application Server Process Maintenance (ASPM) Messages */ #define ASP_REASON_MGMT 1 static const value_string asp_reason_values[] = { { ASP_REASON_MGMT, "Management inhibit" }, { 0, NULL } }; #define ASP_REASON_OFFSET PARAMETER_VALUE_OFFSET #define ASP_REASON_LENGTH 4 static void dissect_asp_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_asp_reason, parameter_tvb, ASP_REASON_OFFSET, ASP_REASON_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ASP_REASON_OFFSET), asp_reason_values, "Unknown ASP down reason")); } /*----------------------ASP (RFC)----------------------------------------------*/ /*----------------------Heartbeat Data + Ack (RFC)-----------------------------*/ #define HEARTBEAT_MSG_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define HEARTBEAT_DATA_OFFSET PARAMETER_VALUE_OFFSET #define HEARTBEAT_MSG_HEADER_LENGTH PARAMETER_HEADER_LENGTH static void dissect_heartbeat_data_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 heartbeat_data_length; heartbeat_data_length = tvb_get_ntohs(parameter_tvb, HEARTBEAT_MSG_LENGTH_OFFSET) - HEARTBEAT_MSG_HEADER_LENGTH; proto_tree_add_item(parameter_tree, hf_heartbeat_data, parameter_tvb, HEARTBEAT_DATA_OFFSET, heartbeat_data_length, ENC_NA); proto_item_append_text(parameter_item, " (%u byte%s)", heartbeat_data_length, plurality(heartbeat_data_length, "", "s")); } /*----------------------Heartbeat Data (RFC)-----------------------------------*/ /*----------------------ASP Active,Inactive + Ack (RFC)------------------------*/ #define OVER_RIDE_TRAFFIC_MODE_TYPE 1 #define LOAD_SHARE_TRAFFIC_MODE_TYPE 2 static const value_string traffic_mode_type_values[] = { { OVER_RIDE_TRAFFIC_MODE_TYPE, "Over-ride" }, { LOAD_SHARE_TRAFFIC_MODE_TYPE, "Load-share" }, { 0, NULL } }; #define TRAFFIC_MODE_TYPE_LENGTH 4 #define TRAFFIC_MODE_TYPE_OFFSET PARAMETER_VALUE_OFFSET static void dissect_traffic_mode_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_traffic_mode_type, parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET, TRAFFIC_MODE_TYPE_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, TRAFFIC_MODE_TYPE_OFFSET), traffic_mode_type_values, "Unknown traffic mode type")); } #define INT_RANGE_START_OFFSET PARAMETER_VALUE_OFFSET #define INT_RANGE_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define INT_RANGE_HEADER_LENGTH PARAMETER_HEADER_LENGTH #define IF_ID_START_OFFSET 0 #define IF_ID_START_LENGTH 4 #define IF_ID_END_OFFSET (IF_ID_START_OFFSET + IF_ID_START_LENGTH) #define IF_ID_END_LENGTH 4 #define IF_ID_INTERVAL_LENGTH (IF_ID_START_LENGTH + IF_ID_END_LENGTH) static void dissect_integer_range_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 number_of_ranges, range_number, offset; number_of_ranges = (tvb_get_ntohs(parameter_tvb, INT_RANGE_LENGTH_OFFSET) - INT_RANGE_HEADER_LENGTH) / IF_ID_INTERVAL_LENGTH; offset = INT_RANGE_START_OFFSET; for(range_number = 0; range_number < number_of_ranges; range_number++) { proto_tree_add_item(parameter_tree, hf_if_range_start, parameter_tvb, offset + IF_ID_START_OFFSET, IF_ID_START_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_if_range_end, parameter_tvb, offset + IF_ID_END_OFFSET, IF_ID_END_LENGTH, ENC_BIG_ENDIAN); offset += IF_ID_INTERVAL_LENGTH; }; proto_item_append_text(parameter_item, " (%u range%s)", number_of_ranges, plurality(number_of_ranges, "", "s")); } /*----------------------ASP Active,Inactive (RFC)------------------------------*/ /*----------------------Data Request,Indication (Draft,RFC)--------------------*/ #define DISCRIMINATOR_OFFSET 0 #define DISCRIMINATOR_LENGTH 1 #define ADDRESS_OFFSET 1 #define ADDRESS_LENGTH 1 #define LOW_ADDRESS_OFFSET 2 #define LOW_ADDRESS_LENGTH 1 #define ALL_ADDRESS_OFFSET 1 #define ALL_ADDRESS_LENGTH 2 #define MSG_TYPE_OFFSET 3 #define MSG_TYPE_LENGTH 1 #define MSG_HEADER_LENGTH 4 #define INFO_ELEMENT_OFFSET 4 #define INFO_ELEMENT_LENGTH 1 static void dissect_layer3_message(tvbuff_t *layer3_data_tvb, proto_tree *v5ua_tree,proto_item *parameter_item, packet_info *pinfo) { guint16 discriminator_offset; if(iua_version == DRAFT){ discriminator_offset = DISCRIMINATOR_OFFSET; } else{ discriminator_offset = DISCRIMINATOR_OFFSET + PARAMETER_HEADER_LENGTH; } if (tvb_get_guint8(layer3_data_tvb, discriminator_offset) == 0x48){ guint16 protocol_data_length; tvbuff_t *protocol_data_tvb; protocol_data_length = tvb_get_ntohs(layer3_data_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; protocol_data_tvb = tvb_new_subset_length(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length); call_dissector(v52_handle, protocol_data_tvb, pinfo, v5ua_tree); proto_item_append_text(parameter_item, " (%u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s")); } else{ guint16 protocol_data_length; tvbuff_t *protocol_data_tvb; protocol_data_length = tvb_get_ntohs(layer3_data_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; protocol_data_tvb = tvb_new_subset_length(layer3_data_tvb, PARAMETER_VALUE_OFFSET, protocol_data_length); call_dissector(q931_handle, protocol_data_tvb, pinfo, v5ua_tree); proto_item_append_text(parameter_item, " (%u byte%s)", protocol_data_length, plurality(protocol_data_length, "", "s")); } } /*----------------------Data Request,Indication (Draft,RFC)------------------------*/ /*----------------------Establish Request,Confirm,Indication (Draft,RFC)-------*/ /* * no additional parameter */ /*----------------------Establish Request,Confirm,Indication (Draft,RFC)-------*/ /*----------------------Release Indication, Request (Draft,RFC)----------------*/ /* define parameters for Release Request and Indication Messages */ #define RELEASE_MGMT 0x0 #define RELEASE_PHYS 0x1 #define RELEASE_DM 0x2 #define RELEASE_OTHER 0x3 static const value_string release_reason_values[] = { { RELEASE_MGMT, "Management layer generated release" }, { RELEASE_PHYS, "Physical layer alarm generated release" }, { RELEASE_DM, "Specific to a request" }, { RELEASE_OTHER, "Other reason" }, { 0, NULL } }; #define RELEASE_REASON_LENGTH_OFFSET PARAMETER_LENGTH_OFFSET #define RELEASE_REASON_OFFSET PARAMETER_VALUE_OFFSET #define RELEASE_REASON_LENGTH 4 static void dissect_release_reason_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { gint offset = RELEASE_REASON_OFFSET; if(iua_version == DRAFT) offset = tvb_get_ntohs(parameter_tvb, RELEASE_REASON_LENGTH_OFFSET)+8; proto_tree_add_item(parameter_tree, hf_release_reason, parameter_tvb, offset, RELEASE_REASON_LENGTH, ENC_BIG_ENDIAN); if(iua_version != DRAFT) proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), release_reason_values, "Unknown release reason")); } /*----------------------Release Indication,Request (Draft,RFC)-----------------*/ /*----------------------Link Status Start,Stop Report (Draft,RFC)--------------*/ /* * No additional Parameter */ /*----------------------Link Status Start,Stop Report (Draft,RFC)--------------*/ /*----------------------Link Status Indication (Draft,RFC)---------------------*/ /* define parameters for Link Status Indication */ #define LINK_STATUS_OPERTIONAL 0x0 #define LINK_STATUS_NON_OPERTIONAL 0x1 static const value_string link_status_values[] = { { LINK_STATUS_OPERTIONAL, "Link operational" }, { LINK_STATUS_NON_OPERTIONAL, "Link not operational" }, { 0, NULL } }; #define LINK_STATUS_OFFSET PARAMETER_VALUE_OFFSET #define LINK_STATUS_LENGTH 4 static void dissect_link_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_link_status, parameter_tvb, LINK_STATUS_OFFSET, LINK_STATUS_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, LINK_STATUS_OFFSET),link_status_values, "Unknown Link status")); link_status_operational = tvb_get_ntohl(parameter_tvb, LINK_STATUS_OFFSET); } /*----------------------Link Status Indication (Draft,RFC)---------------------*/ /*----------------------Sa-Bit (Draft,RFC)-------------------------------------*/ /* define parameter for sa-bit message */ #define SA_BIT_ID_ZERO 0x0 #define SA_BIT_ID_ONE 0x1 #define SA_BIT_VALUE_SA7 0x7 static const value_string sa_bit_values[] = { { SA_BIT_ID_ZERO, "set value ZERO" }, { SA_BIT_ID_ONE, "set value ONE" }, { SA_BIT_VALUE_SA7, "Addresses the Sa7 Bit" }, { 0, NULL } }; #define SA_BIT_ID_OFFSET PARAMETER_VALUE_OFFSET #define SA_BIT_ID_LENGTH 2 #define SA_BIT_VALUE_OFFSET (SA_BIT_ID_OFFSET + SA_BIT_ID_LENGTH) #define SA_BIT_VALUE_LENGTH 2 static void dissect_sa_bit_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_sa_bit_id, parameter_tvb, SA_BIT_ID_OFFSET, SA_BIT_ID_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(parameter_tree, hf_sa_bit_value, parameter_tvb, SA_BIT_VALUE_OFFSET, SA_BIT_VALUE_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s %s)", val_to_str_const(tvb_get_ntohs(parameter_tvb, SA_BIT_ID_OFFSET), sa_bit_values, "unknown"), val_to_str_const(tvb_get_ntohs(parameter_tvb, SA_BIT_VALUE_OFFSET), sa_bit_values, "unknown Bit")); sa_bit_id = tvb_get_ntohs(parameter_tvb, SA_BIT_VALUE_OFFSET); } /*----------------------Sa-Bit (Draft,RFC)-------------------------------------*/ /*----------------------Error Indication (RFC)---------------------------------*/ #define ERROR_REASON_OVERLOAD 0x1 static const value_string error_reason_values[] = { { ERROR_REASON_OVERLOAD, "C-Channel is in overload state" }, { 0, NULL } }; #define ERROR_REASON_LENGTH 4 #define ERROR_REASON_OFFSET PARAMETER_VALUE_OFFSET static void dissect_error_indication_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_error_reason, parameter_tvb, ERROR_REASON_OFFSET, ERROR_REASON_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%s)", val_to_str_const(tvb_get_ntohl(parameter_tvb, ERROR_REASON_OFFSET), error_reason_values, "unknown")); } /*----------------------Error Indication (RFC)---------------------------------*/ /*--------------------------ASP identifier-------------------------------------*/ #define ASP_IDENTIFIER_LENGTH 4 #define ASP_IDENTIFIER_OFFSET PARAMETER_VALUE_OFFSET static void dissect_asp_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { proto_tree_add_item(parameter_tree, hf_asp_identifier, parameter_tvb, ASP_IDENTIFIER_OFFSET, ASP_IDENTIFIER_LENGTH, ENC_BIG_ENDIAN); proto_item_append_text(parameter_item, " (%d) ",tvb_get_ntohl(parameter_tvb,ASP_IDENTIFIER_OFFSET)); } /*--------------------------ASP identifier-------------------------------------*/ #define INFO_STRING_OFFSET PARAMETER_VALUE_OFFSET static void dissect_info_string_parameter(packet_info *pinfo, tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 info_string_length; const guint8* str; info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); if(iua_version == DRAFT) info_string_length += 4; if(info_string_length > 4){ info_string_length -= PARAMETER_HEADER_LENGTH; proto_tree_add_item_ret_string(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII, pinfo->pool, &str); proto_item_append_text(parameter_item, " (%s)", str); } } static void dissect_unknown_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 parameter_value_length; parameter_value_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; if (parameter_value_length > 0) proto_tree_add_item(parameter_tree, hf_parameter_value, parameter_tvb, PARAMETER_VALUE_OFFSET, parameter_value_length, ENC_NA); proto_item_append_text(parameter_item, " with tag %u and %u byte%s value", tvb_get_ntohs(parameter_tvb, PARAMETER_TAG_OFFSET), parameter_value_length, plurality(parameter_value_length, "", "s")); } #define Reserved_TAG 0x00 #define INT_INTERFACE_IDENTIFIER_PARAMETER_TAG 0x01 #define ASP_MSG_PARAMETER_TAG 0x02 #define TEXT_INTERFACE_IDENTIFIER_PARAMETER_TAG 0x03 #define INFO_PARAMETER_TAG 0x04 #define DLCI_PARAMETER_TAG 0x81 #define DIAGNOSTIC_INFORMATION_PARAMETER_TAG 0x07 #define INTEGER_RANGE_INTERFACE_IDENTIFIER_PARAMETER_TAG 0x08 #define HEARTBEAT_DATA_PARAMETER_TAG 0x09 #define ASP_DOWN_REASON_PARAMETER_TAG 0x0a #define TRAFFIC_MODE_TYPE_PARAMETER_TAG 0x0b #define ERROR_CODE_PARAMETER_TAG 0x0c #define STATUS_TYPE_INDENTIFICATION_PARAMETER_TAG 0x0d #define PROTOCOL_DATA_PARAMETER_TAG 0x0e #define RELEASE_REASON_PARAMETER_TAG 0x0f #define TEI_STATUS_PARAMETER_TAG 0x10 #define ASP_IDENTIFIER_PARAMETER_TAG 0x11 #define NOT_USED_IN_IUA_PARAMETER_TAG 0x12 #define LINK_STATUS_PARAMETER_TAG 0x82 #define SA_BIT_STATUS_PARAMETER_TAG 0x83 #define ERROR_INDICATION_PARAMETER_TAG 0x84 static const value_string parameter_tag_values[] = { { Reserved_TAG, "Reserved" }, { INT_INTERFACE_IDENTIFIER_PARAMETER_TAG, "Interface Identifier (integer)" }, { TEXT_INTERFACE_IDENTIFIER_PARAMETER_TAG, "Interface Identifier (text)" }, { INFO_PARAMETER_TAG, "Info string" }, { DLCI_PARAMETER_TAG, "DLCI" }, { DIAGNOSTIC_INFORMATION_PARAMETER_TAG, "Diagnostic information" }, { INTEGER_RANGE_INTERFACE_IDENTIFIER_PARAMETER_TAG, "Interface Identifier Range" }, { HEARTBEAT_DATA_PARAMETER_TAG, "Hearbeat data" }, { ASP_DOWN_REASON_PARAMETER_TAG, "ASP DOWN Reason" }, { TRAFFIC_MODE_TYPE_PARAMETER_TAG, "Traffic mode type" }, { ERROR_CODE_PARAMETER_TAG, "Error code" }, { STATUS_TYPE_INDENTIFICATION_PARAMETER_TAG, "Status type/identification" }, { PROTOCOL_DATA_PARAMETER_TAG, "Protocol Data" }, { RELEASE_REASON_PARAMETER_TAG, "Release Reason" }, { TEI_STATUS_PARAMETER_TAG, "TEI status" }, { ASP_IDENTIFIER_PARAMETER_TAG, "ASP Identifier" }, { NOT_USED_IN_IUA_PARAMETER_TAG, "Not used in IUA" }, { LINK_STATUS_PARAMETER_TAG, "Link status" }, { SA_BIT_STATUS_PARAMETER_TAG, "SA-Bit status" }, { ERROR_INDICATION_PARAMETER_TAG, "Error reason" }, { 0, NULL } }; static const value_string parameter_tag_draft_values[] = { { INT_INTERFACE_IDENTIFIER_PARAMETER_TAG, "V5UA Interface Identifier (int)" }, { ASP_MSG_PARAMETER_TAG, "ASP Adaption Layer ID" }, { TEXT_INTERFACE_IDENTIFIER_PARAMETER_TAG, "SCN Protocol Identifier" }, { INFO_PARAMETER_TAG, "Info" }, { PROTOCOL_DATA_PARAMETER_TAG, "Protocol Data" }, { LINK_STATUS_PARAMETER_TAG, "Link status" }, { SA_BIT_STATUS_PARAMETER_TAG, "SA-Bit status" }, { ERROR_INDICATION_PARAMETER_TAG, "Error reason" }, { 0, NULL } }; static void dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_tree) { guint16 tag, length, padding_length; proto_item *parameter_item; proto_tree *parameter_tree; /* extract tag and length from the parameter */ tag = tvb_get_ntohs(parameter_tvb, PARAMETER_TAG_OFFSET); length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET); /* on IUA-Draft messages the message length not including the message header */ if((iua_version==DRAFT)&&(tag<=0x4)){ /* at V5UA Header, length of header and length of DLCI+EFA must be added */ if(tag==0x1) length += 8; /* at ASP message tags only length of header must be added */ else if(tag<=0x4) length += PARAMETER_HEADER_LENGTH; /* for following message-tags are no length information available. Only in common msg header */ if((msg_class==0 || msg_class==1 || msg_class==9) && msg_type<=10) length = msg_length; } padding_length = tvb_reported_length(parameter_tvb) - length; paddingl = padding_length; /* create proto_tree stuff */ switch(iua_version){ case RFC: parameter_tree = proto_tree_add_subtree(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, -1, ett_v5ua_parameter, &parameter_item, val_to_str_const(tag, parameter_tag_values, "Unknown parameter")); /* add tag to the v5ua tree */ proto_tree_add_item(parameter_tree, hf_parameter_tag, parameter_tvb, PARAMETER_TAG_OFFSET, PARAMETER_TAG_LENGTH, ENC_BIG_ENDIAN); break; case DRAFT: default: parameter_tree = proto_tree_add_subtree(v5ua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, -1, ett_v5ua_parameter, &parameter_item, val_to_str_const(tag, parameter_tag_draft_values, "Unknown parameter")); /* add tag to the v5ua tree */ proto_tree_add_item(parameter_tree, hf_parameter_tag_draft, parameter_tvb, PARAMETER_TAG_OFFSET, PARAMETER_TAG_LENGTH, ENC_BIG_ENDIAN); break; }; /* add length to the v5ua tree */ proto_tree_add_item(parameter_tree, hf_parameter_length, parameter_tvb, PARAMETER_LENGTH_OFFSET, PARAMETER_LENGTH_LENGTH, ENC_BIG_ENDIAN); switch(tag) { case INT_INTERFACE_IDENTIFIER_PARAMETER_TAG: if(iua_version == RFC) dissect_int_interface_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); if(iua_version == DRAFT){ dissect_int_interface_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); dissect_dlci_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo); /* for the following parameters no tag- and length-informations available. Parameters must be dissect with info from common msg header */ if(msg_class==0 && msg_type==0) dissect_draft_error_code_parameter(parameter_tvb, parameter_tree); if(msg_class==1) dissect_draft_tei_status_parameter(parameter_tvb, parameter_tree, parameter_item); if(msg_class==9){ if(msg_type==1||msg_type==2||msg_type==3||msg_type==4){ guint16 length_2, offset; tvbuff_t *layer3_data_tvb; offset = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) + 8; length_2 = msg_length - offset; if(length_2 > 0){ if(tvb_get_guint8(parameter_tvb, offset) == 0x48){ layer3_data_tvb = tvb_new_subset_length(parameter_tvb, offset, length_2); dissect_layer3_message(layer3_data_tvb, v5ua_tree, parameter_item, pinfo); } } } else if(msg_type==8||msg_type==10) dissect_release_reason_parameter(parameter_tvb, parameter_tree, parameter_item); } } break; case ASP_MSG_PARAMETER_TAG: dissect_asp_msg_parameter(pinfo, parameter_tvb, parameter_tree, parameter_item); break; case TEXT_INTERFACE_IDENTIFIER_PARAMETER_TAG: if(iua_version == RFC) dissect_text_interface_identifier_parameter(pinfo, parameter_tvb, parameter_tree, parameter_item); if(iua_version == DRAFT) dissect_scn_protocol_id_parameter(pinfo, parameter_tvb, parameter_tree, parameter_item); break; case INFO_PARAMETER_TAG: dissect_info_string_parameter(pinfo, parameter_tvb, parameter_tree, parameter_item); break; case DLCI_PARAMETER_TAG: dissect_dlci_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo); break; case DIAGNOSTIC_INFORMATION_PARAMETER_TAG: dissect_diagnostic_information_parameter(parameter_tvb, parameter_tree, parameter_item); break; case INTEGER_RANGE_INTERFACE_IDENTIFIER_PARAMETER_TAG: dissect_integer_range_interface_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); break; case HEARTBEAT_DATA_PARAMETER_TAG: dissect_heartbeat_data_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ASP_DOWN_REASON_PARAMETER_TAG: dissect_asp_reason_parameter(parameter_tvb, parameter_tree, parameter_item); break; case TRAFFIC_MODE_TYPE_PARAMETER_TAG: dissect_traffic_mode_type_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ERROR_CODE_PARAMETER_TAG: dissect_error_code_parameter(parameter_tvb, parameter_tree, parameter_item); break; case STATUS_TYPE_INDENTIFICATION_PARAMETER_TAG: dissect_status_type_identification_parameter(parameter_tvb, parameter_tree, parameter_item); break; case PROTOCOL_DATA_PARAMETER_TAG: dissect_layer3_message(parameter_tvb, v5ua_tree, parameter_item, pinfo); break; case RELEASE_REASON_PARAMETER_TAG: dissect_release_reason_parameter(parameter_tvb, parameter_tree, parameter_item); break; case TEI_STATUS_PARAMETER_TAG: dissect_tei_status_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ASP_IDENTIFIER_PARAMETER_TAG: dissect_asp_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); break; case LINK_STATUS_PARAMETER_TAG: dissect_link_status_parameter(parameter_tvb, parameter_tree, parameter_item); break; case SA_BIT_STATUS_PARAMETER_TAG: dissect_sa_bit_status_parameter(parameter_tvb, parameter_tree, parameter_item); break; case ERROR_INDICATION_PARAMETER_TAG: dissect_error_indication_parameter( parameter_tvb, parameter_tree, parameter_item); break; default: dissect_unknown_parameter(parameter_tvb, parameter_tree, parameter_item); break; }; if (padding_length > 0){ proto_tree_add_item(parameter_tree, hf_parameter_padding, parameter_tvb, PARAMETER_HEADER_OFFSET + length, padding_length, ENC_NA); } } /* dissect the V5UA-Parameters into subsets which are separated by Tag-Length-Header and call up the dissector for the subsets */ static void dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tree _U_, proto_tree *v5ua_tree) { gint tag, offset, length, total_length, remaining_length; tvbuff_t *parameter_tvb; offset = 0; while((remaining_length = tvb_reported_length_remaining(parameters_tvb, offset))) { tag = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_TAG_OFFSET); length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET); if(iua_version==DRAFT){ if(tag==0x1) length += 8; /* V5UA Header */ else if(tag<=0x4) length += PARAMETER_HEADER_LENGTH; /* ASP MSGs */ /* add the parameters which are not separated by tag-length-header to the V5UA header */ if((msg_class==0 || msg_class==1 || msg_class==9)&&msg_type<=10) length = msg_length; } total_length = WS_ROUNDUP_4(length); if (remaining_length >= length) total_length = MIN(total_length, remaining_length); /* create a tvb for the parameter including the padding bytes */ parameter_tvb = tvb_new_subset_length(parameters_tvb, offset, total_length); dissect_parameter(parameter_tvb, pinfo, v5ua_tree); /* get rid of the handled parameter */ offset += total_length; } } /* define the common header fields of V5UA MSG */ #define COMMON_HEADER_VERSION_LENGTH 1 #define COMMON_HEADER_RESERVED_LENGTH 1 #define COMMON_HEADER_MSG_CLASS_LENGTH 1 #define COMMON_HEADER_MSG_TYPE_LENGTH 1 #define COMMON_HEADER_MSG_LENGTH_LENGTH 4 #define COMMON_HEADER_LENGTH (COMMON_HEADER_VERSION_LENGTH + COMMON_HEADER_RESERVED_LENGTH +\ COMMON_HEADER_MSG_CLASS_LENGTH + COMMON_HEADER_MSG_TYPE_LENGTH +\ COMMON_HEADER_MSG_LENGTH_LENGTH) /* define the offsets of common header */ #define COMMON_HEADER_OFFSET 0 #define COMMON_HEADER_VERSION_OFFSET COMMON_HEADER_OFFSET #define COMMON_HEADER_RESERVED_OFFSET (COMMON_HEADER_VERSION_OFFSET + COMMON_HEADER_VERSION_LENGTH) #define COMMON_HEADER_MSG_CLASS_OFFSET (COMMON_HEADER_RESERVED_OFFSET + COMMON_HEADER_RESERVED_LENGTH) #define COMMON_HEADER_MSG_TYPE_OFFSET (COMMON_HEADER_MSG_CLASS_OFFSET + COMMON_HEADER_MSG_CLASS_LENGTH) #define COMMON_HEADER_MSG_LENGTH_OFFSET (COMMON_HEADER_MSG_TYPE_OFFSET + COMMON_HEADER_MSG_TYPE_LENGTH) #define COMMON_HEADER_PARAMETERS_OFFSET (COMMON_HEADER_OFFSET + COMMON_HEADER_LENGTH) /* version of V5UA protocol */ #define V5UA_PROTOCOL_VERSION_RELEASE_1 1 static const value_string v5ua_protocol_version_values[] = { { V5UA_PROTOCOL_VERSION_RELEASE_1, "Release 1.0" }, { 0, NULL } }; /* define V5UA MSGs */ #define MSG_CLASS_MGMT_MSG 0 #define MSG_CLASS_MGMT_MSG_DRAFT 1 #define MSG_CLASS_ASPSM_MSG 3 #define MSG_CLASS_ASPTM_MSG 4 #define MSG_CLASS_V5PTM_MSG_DRAFT 9 #define MSG_CLASS_V5PTM_MSG 14 static const value_string msg_class_values[] = { { MSG_CLASS_MGMT_MSG, "Management Messages" }, { MSG_CLASS_MGMT_MSG_DRAFT,"Management Messages"}, { MSG_CLASS_ASPSM_MSG, "ASP State Maintenance Message" }, { MSG_CLASS_ASPTM_MSG, "ASP Traffic Maintenance Message" }, { MSG_CLASS_V5PTM_MSG_DRAFT, "V5 Boundary Primitives Transport Message" }, { MSG_CLASS_V5PTM_MSG, "V5 Boundary Primitives Transport Message" }, { 0, NULL } }; /* message types for MGMT messages */ #define MGMT_MSG_TYPE_ERR 0 #define MGMT_MSG_TYPE_NTFY 1 #define MGMT_MSG_TYPE_TEI_STATUS_REQ 2 #define MGMT_MSG_TYPE_TEI_STATUS_CON 3 #define MGMT_MSG_TYPE_TEI_STATUS_IND 4 #define MGMT_MSG_TYPE_TEI_QUERY_REQUEST5 5 #define MGMT_MSG_TYPE_TEI_QUERY_REQUEST 8 /* end */ /* MGMT messages for Nortel draft version*/ #define MGMT_MSG_DRAFT_TYPE_TEI_STATUS_REQ 1 #define MGMT_MSG_DRAFT_TYPE_TEI_STATUS_CON 2 #define MGMT_MSG_DRAFT_TYPE_TEI_STATUS_IND 3 #define MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST5 5 #define MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST 8 /* end */ /* message types for ASPSM messages */ #define ASPSM_MSG_TYPE_Reserved 0 #define ASPSM_MSG_TYPE_UP 1 #define ASPSM_MSG_TYPE_DOWN 2 #define ASPSM_MSG_TYPE_BEAT 3 #define ASPSM_MSG_TYPE_UP_ACK 4 #define ASPSM_MSG_TYPE_DOWN_ACK 5 #define ASPSM_MSG_TYPE_BEAT_ACK 6 /* message types for ASPTM messages */ #define ASPTM_MSG_TYPE_Reserved 0 #define ASPTM_MSG_TYPE_ACTIVE 1 #define ASPTM_MSG_TYPE_INACTIVE 2 #define ASPTM_MSG_TYPE_ACTIVE_ACK 3 #define ASPTM_MSG_TYPE_INACTIVE_ACK 4 /* message types for V5PTM messages */ #define V5PTM_MSG_TYPE_Reserved 0 #define V5PTM_MSG_TYPE_DATA_REQUEST 1 #define V5PTM_MSG_TYPE_DATA_INDICATION 2 #define V5PTM_MSG_TYPE_UNIT_DATA_REQUEST 3 #define V5PTM_MSG_TYPE_UNIT_DATA_INDICATION 4 #define V5PTM_MSG_TYPE_ESTABLISH_REQUEST 5 #define V5PTM_MSG_TYPE_ESTABLISH_CONFIRM 6 #define V5PTM_MSG_TYPE_ESTABLISH_INDICATION 7 #define V5PTM_MSG_TYPE_RELEASE_REQUEST 8 #define V5PTM_MSG_TYPE_RELEASE_CONFIRM 9 #define V5PTM_MSG_TYPE_RELEASE_INDICATION 10 #define V5PTM_MSG_TYPE_LINK_STATUS_START_REPORTING 11 #define V5PTM_MSG_TYPE_LINK_STATUS_STOP_REPORTING 12 #define V5PTM_MSG_TYPE_LINK_STATUS_INDICATION 13 #define V5PTM_MSG_TYPE_SA_BIT_SET_REQUEST 14 #define V5PTM_MSG_TYPE_SA_BIT_SET_CONFIRM 15 #define V5PTM_MSG_TYPE_SA_BIT_STATUS_REQUEST 16 #define V5PTM_MSG_TYPE_SA_BIT_STATUS_INDICATION 17 #define V5PTM_MSG_TYPE_ERROR_INDICATION 18 #define MGMT_MSG_TYPE_TEI_STATUS_REQUEST5 5 #define MGMT_MSG_TYPE_TEI_STATUS_REQUEST 8 static const value_string msg_class_type_values[] = { { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_ERR, "Error" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_NTFY, "Notify" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_REQ, "TEI status request" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_CON, "TEI status confirmation" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_IND, "TEI status indication" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_QUERY_REQUEST, "TEI query request" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_QUERY_REQUEST5, "TEI query request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_REQ, "TEI status request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_CON, "TEI status confirmation" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_IND, "TEI status indication" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST, "TEI query request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST5, "TEI query request" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_UP, "ASP up" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_DOWN, "ASP down" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_BEAT, "Heartbeat" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_UP_ACK, "ASP up ack" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_DOWN_ACK, "ASP down ack" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_BEAT_ACK, "Heartbeat ack" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_Reserved , "Reserved" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_ACTIVE , "ASP active" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_INACTIVE , "ASP inactive" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_ACTIVE_ACK , "ASP active ack" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_INACTIVE_ACK , "ASP inactive ack" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_DATA_REQUEST, "Data request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_DATA_INDICATION, "Data indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_UNIT_DATA_REQUEST, "Unit data request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_UNIT_DATA_INDICATION, "Unit data indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_REQUEST, "Establish request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_CONFIRM, "Establish confirmation" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_INDICATION, "Establish indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_REQUEST, "Release request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_CONFIRM, "Release confirmation" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_INDICATION, "Release indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_START_REPORTING,"Link status start reporting" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_STOP_REPORTING, "Link status stop reporting" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_INDICATION, "Link status indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_REQUEST, "Sa-Bit set request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_CONFIRM, "Sa-Bit set confirm" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_REQUEST, "Sa-Bit status request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_INDICATION, "Sa-Bit status indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ERROR_INDICATION, "Error indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_DATA_REQUEST, "Data request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_DATA_INDICATION, "Data indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_UNIT_DATA_REQUEST, "Unit data request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_UNIT_DATA_INDICATION, "Unit data indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_REQUEST, "Establish request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_CONFIRM, "Establish confirmation" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_INDICATION, "Establish indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_REQUEST, "Release request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_CONFIRM, "Release confirmation" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_INDICATION, "Release indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_START_REPORTING,"Link status start reporting" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_STOP_REPORTING, "Link status stop reporting" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_INDICATION, "Link status indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_REQUEST, "Sa-Bit set request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_CONFIRM, "Sa-Bit set confirm" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_REQUEST, "Sa-Bit status request" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_INDICATION, "Sa-Bit status indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ERROR_INDICATION, "Error indication" }, { 0, NULL } }; static const value_string msg_class_type_values_short[] = { { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_ERR, "Error" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_NTFY, "Notify" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_REQ, "TEI status request" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_CON, "TEI status confirmation" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_STATUS_IND, "TEI status indication" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_QUERY_REQUEST, "TEI query request" }, { MSG_CLASS_MGMT_MSG * 256 + MGMT_MSG_TYPE_TEI_QUERY_REQUEST5, "TEI query request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_REQ, "TEI status request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_CON, "TEI status confirmation" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_STATUS_IND, "TEI status indication" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST, "TEI query request" }, { MSG_CLASS_MGMT_MSG_DRAFT * 256 + MGMT_MSG_DRAFT_TYPE_TEI_QUERY_REQUEST5, "TEI query request" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_UP, "ASP up" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_DOWN, "ASP down" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_BEAT, "Heartbeat" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_UP_ACK, "ASP up ack" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_DOWN_ACK, "ASP down ack" }, { MSG_CLASS_ASPSM_MSG * 256 + ASPSM_MSG_TYPE_BEAT_ACK, "Heartbeat ack" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_Reserved , "Reserved" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_ACTIVE , "ASP active" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_INACTIVE , "ASP inactive" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_ACTIVE_ACK , "ASP active ack" }, { MSG_CLASS_ASPTM_MSG * 256 + ASPTM_MSG_TYPE_INACTIVE_ACK , "ASP inactive ack" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_DATA_REQUEST, "Data request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_DATA_INDICATION, "Data indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_UNIT_DATA_REQUEST, "Unit data request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_UNIT_DATA_INDICATION, "Unit data indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_REQUEST, "Establish request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_CONFIRM, "Establish confirmation" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ESTABLISH_INDICATION, "Establish indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_REQUEST, "Release request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_CONFIRM, "Release confirmation" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_RELEASE_INDICATION, "Release indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_START_REPORTING,"Link status start reporting" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_STOP_REPORTING, "Link status stop reporting" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_LINK_STATUS_INDICATION, "Link status indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_REQUEST, "Sa-Bit set request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_CONFIRM, "Sa-Bit set confirm" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_REQUEST, "Sa-Bit status request" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_INDICATION, "Sa-Bit status indication" }, { MSG_CLASS_V5PTM_MSG_DRAFT * 256 + V5PTM_MSG_TYPE_ERROR_INDICATION, "Error indication" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_Reserved, "Reserved" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_DATA_REQUEST, "Data Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_DATA_INDICATION, "Data Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_UNIT_DATA_REQUEST, "U Data Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_UNIT_DATA_INDICATION, "U Data Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_REQUEST, "Est Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_CONFIRM, "Est Conf" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ESTABLISH_INDICATION, "Est Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_REQUEST, "Rel Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_CONFIRM, "Rel Con" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_RELEASE_INDICATION, "Rel Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_START_REPORTING,"Link Status Start Rep" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_STOP_REPORTING, "Link Status Stop Rep" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_LINK_STATUS_INDICATION, "Link Status Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_REQUEST, "Sa-Bit Set Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_SET_CONFIRM, "Sa-Bit set Conf" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_REQUEST, "Sa-Bit Status Req" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_SA_BIT_STATUS_INDICATION, "Sa-Bit Status Ind" }, { MSG_CLASS_V5PTM_MSG * 256 + V5PTM_MSG_TYPE_ERROR_INDICATION, "Error Ind" }, { 0, NULL } }; static void dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tree *v5ua_tree) { proto_item *common_header_item; proto_tree *common_header_tree; guint8 message_class, message_type; message_class = tvb_get_guint8(common_header_tvb, COMMON_HEADER_MSG_CLASS_OFFSET); message_type = tvb_get_guint8(common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET); /* Add message type into info column */ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_class * 256 + message_type, msg_class_type_values_short, "UNKNOWN")); if (v5ua_tree) { /* create proto_tree stuff */ common_header_tree = proto_tree_add_subtree(v5ua_tree, common_header_tvb, COMMON_HEADER_OFFSET, -1, ett_v5ua_common_header, &common_header_item, "Common Msg-Header"); /* add the components of the common header to the protocol tree */ proto_tree_add_item(common_header_tree, hf_version, common_header_tvb, COMMON_HEADER_VERSION_OFFSET, COMMON_HEADER_VERSION_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(common_header_tree, hf_reserved, common_header_tvb, COMMON_HEADER_RESERVED_OFFSET, COMMON_HEADER_RESERVED_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(common_header_tree, hf_msg_class, common_header_tvb, COMMON_HEADER_MSG_CLASS_OFFSET, COMMON_HEADER_MSG_CLASS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(common_header_tree, hf_msg_type, common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET, COMMON_HEADER_MSG_TYPE_LENGTH, message_type, "%s ( %u )", val_to_str_const(message_class * 256 + message_type, msg_class_type_values, "reserved"), message_type); proto_tree_add_item(common_header_tree, hf_msg_length, common_header_tvb, COMMON_HEADER_MSG_LENGTH_OFFSET, COMMON_HEADER_MSG_LENGTH_LENGTH, ENC_BIG_ENDIAN); /* Add message type to the Common Msg-Header line */ proto_item_append_text(common_header_item, " (%s)",val_to_str_const(message_class * 256 + message_type, msg_class_type_values, "Unknown Msg-Type")); messageclassCopy = message_class; } /* the following info are required to dissect IUA-Draft messages. In the DRAFT-Specification V5UA-Parameters are not separated by Tag-Length-Header (as defined in RFC-Spec) */ if (iua_version == DRAFT){ msg_class = message_class; msg_type = message_type; msg_length = tvb_get_ntohl (common_header_tvb, COMMON_HEADER_MSG_LENGTH_OFFSET); } } /* dissect the V5UA-packet in two subsets: Common Msg-Header (used by all msgs) and V5UA-parameter */ static void dissect_v5ua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *v5ua_tree) { tvbuff_t *common_header_tvb, *parameters_tvb; common_header_tvb = tvb_new_subset_length(tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH); dissect_common_header(common_header_tvb, pinfo, v5ua_tree); parameters_tvb = tvb_new_subset_remaining(tvb, COMMON_HEADER_LENGTH); dissect_parameters(parameters_tvb, pinfo, tree, v5ua_tree); if (dlci_efa >= 0 && dlci_efa <= 8175) { if ((messageclassCopy == 0) || (messageclassCopy == 3) || (messageclassCopy == 4)) { messageclassCopy = -1; } else { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_fstr(pinfo->cinfo, COL_INFO, "LinkId: %u", linkIdentifier); } } if (sa_bit_id > -1) { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_fstr(pinfo->cinfo, COL_INFO, "SA7bit: %u", sa_bit_id); sa_bit_id = -1; } if (link_status_operational > -1) { if (link_status_operational == 0) { col_append_str(pinfo->cinfo, COL_INFO, " | operational"); } else if (link_status_operational == 1) { col_append_str(pinfo->cinfo, COL_INFO, " | non-operational"); } link_status_operational = -1; } } static int dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gint offset, remaining_length, length, tag, one_bit; /* Set up structures needed to add the protocol subtree and manage it */ proto_tree *v5ua_tree; proto_item *ti; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5UA"); /* end */ col_clear(pinfo->cinfo, COL_INFO); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_v5ua, tvb, 0, -1, ENC_NA); v5ua_tree = proto_item_add_subtree(ti, ett_v5ua); /* detect version of IUA */ iua_version = RFC; offset = COMMON_HEADER_LENGTH; remaining_length = tvb_reported_length_remaining(tvb, offset); while(remaining_length) { tag = tvb_get_ntohs(tvb, offset); /*0x01,0x03: Inerface Id (draft&RFC)*/ if(tag==0x1){ length = tvb_get_ntohs(tvb, offset+2); tag = tvb_get_ntohs(tvb, offset+length); /* tag 0x5 indicates the DLCI in the V5UA-Header accoriding to RFC spec */ if(tag==0x81){ remaining_length = FALSE; } else{ one_bit = tvb_get_guint8(tvb, offset+4+length+1); /* no indication from DLCI by tag (in the V5UA-Header according DRAFT). Thus the ONE-Bit within DLCI have to compare */ if((one_bit & 0x01) == 0x01){ iua_version = DRAFT; remaining_length = FALSE; } /* an indication to incorrect bit in DLCI. Must be include to decode an incorrect implemented message on Nortels PVG*/ else{ proto_item_append_text(v5ua_tree, " !! DLCI INCORRECT !!"); iua_version = DRAFT; remaining_length = FALSE; } } } /*0x02: AL Id (draft) following after common msg header without V5UA header*/ else if(tag==0x02){ iua_version = DRAFT; remaining_length = FALSE; } /*0x03: Text formatted IId SHALL not be supported by draft*/ else if(tag==0x03){ iua_version = RFC; remaining_length = FALSE; } else if(tag==0x11){ remaining_length = FALSE; } /*ASP, Notify and Error messages (RFC) only contain common msg header followed by parameter*/ else if(tag==0x04 || tag == 0x0a || tag == 0x0b || tag == 0x0c || tag == 0x0d){ remaining_length = FALSE; } else{ offset+=2; remaining_length = tvb_reported_length_remaining(tvb, offset); } /* add a notice for the draft version */ if(iua_version == DRAFT){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5UA (draft)"); } } /* dissect the message */ dissect_v5ua_message(tvb, pinfo, tree, v5ua_tree); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ /* this format is require because a script is used to build the C function that calls all the protocol registration. */ void proto_register_v5ua(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_version, { "Version", "v5ua.version", FT_UINT8, BASE_DEC, VALS(v5ua_protocol_version_values), 0x0, NULL, HFILL } }, { &hf_reserved, { "Reserved", "v5ua.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_msg_class, { "Message class", "v5ua.msg_class", FT_UINT8, BASE_DEC, VALS(msg_class_values), 0x0, NULL, HFILL } }, { &hf_msg_type, { "Message Type", "v5ua.msg_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_msg_type_id, { "Message Type ID", "v5ua.msg_type_id", FT_UINT8, BASE_DEC, VALS(msg_class_type_values), 0x0, NULL, HFILL } }, #endif { &hf_msg_length, { "Message length", "v5ua.msg_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_link_id, { "Link Identifier", "v5ua.link_id", FT_UINT32, BASE_DEC, NULL, 0xffffffe0, NULL, HFILL } }, { &hf_chnl_id, { "Channel Identifier", "v5ua.channel_id", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, { &hf_adaptation_layer_id, { "Adaptation Layer ID", "v5ua.adaptation_layer_id", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_text_if_id, { "Text interface identifier","v5ua.text_interface_id", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_scn_protocol_id, { "SCN Protocol Identifier","v5ua.scn_protocol_id", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_info_string, { "Info String", "v5ua.info_string", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_asp_identifier, { "ASP Identifier", "v5ua.asp_identifier", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_dlci_zero_bit, { "Zero bit", "v5ua.dlci_zero_bit", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_dlci_spare_bit, { "Spare bit", "v5ua.dlci_spare_bit", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_dlci_sapi, { "SAPI", "v5ua.dlci_sapi", FT_UINT8, BASE_HEX, NULL, 0xfc, NULL, HFILL } }, { &hf_dlci_one_bit, { "One bit", "v5ua.dlci_one_bit", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_dlci_tei, { "TEI", "v5ua.dlci_tei", FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL } }, { &hf_efa, { "Envelope Function Address","v5ua.efa", FT_UINT16, BASE_DEC, VALS(efa_values), 0x0, NULL, HFILL } }, #if 0 { &hf_spare_efa, { "Envelope Function Address (spare)","v5ua.efa", FT_UINT16, BASE_DEC, NULL, ~7, NULL, HFILL } }, #endif { &hf_asp_reason, { "Reason", "v5ua.asp_reason", FT_UINT32, BASE_HEX, VALS(asp_reason_values), 0x0, NULL, HFILL } }, { &hf_release_reason, { "Release Reason", "v5ua.release_reason", FT_UINT32, BASE_HEX, VALS(release_reason_values), 0x0, NULL, HFILL } }, { &hf_tei_status, { "TEI status", "v5ua.tei_status", FT_UINT32, BASE_HEX, VALS(tei_status_values), 0x0, NULL, HFILL } }, { &hf_tei_draft_status, { "TEI status", "v5ua.tei_draft_status", FT_UINT32, BASE_HEX, VALS(tei_draft_status_values), 0x0, NULL, HFILL } }, { &hf_link_status, { "Link Status", "v5ua.link_status", FT_UINT32, BASE_HEX, VALS(link_status_values), 0x0, NULL, HFILL } }, { &hf_sa_bit_id, { "BIT ID", "v5ua.sa_bit_id", FT_UINT16, BASE_HEX, VALS(sa_bit_values), 0x0, NULL, HFILL } }, { &hf_sa_bit_value, { "Bit Value", "v5ua.sa_bit_value", FT_UINT16, BASE_HEX, VALS(sa_bit_values), 0x0, NULL, HFILL } }, { &hf_parameter_tag, { "Parameter Tag", "v5ua.parameter_tag", FT_UINT16, BASE_HEX, VALS(parameter_tag_values), 0x0, NULL, HFILL } }, { &hf_parameter_tag_draft, { "Parameter Tag", "v5ua.parameter_tag", FT_UINT16, BASE_HEX, VALS(parameter_tag_draft_values), 0x0, NULL, HFILL } }, { &hf_parameter_length, { "Parameter length", "v5ua.parameter_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_parameter_value, { "Parameter value", "v5ua.parameter_value", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_parameter_padding, { "Parameter padding", "v5ua.parameter_padding", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_diagnostic_info, { "Diagnostic Information", "v5ua.diagnostic_info", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_if_range_start, { "Interface range Start", "v5ua.interface_range_start", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_if_range_end, { "Interface range End", "v5ua.interface_range_end", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_heartbeat_data, { "Heartbeat data", "v5ua.heartbeat_data", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } }, { &hf_traffic_mode_type, { "Traffic mode type", "v5ua.traffic_mode_type", FT_UINT32, BASE_HEX, VALS(traffic_mode_type_values), 0x0, NULL, HFILL } }, { &hf_error_code, { "Error code", "v5ua.error_code", FT_UINT32, BASE_HEX, VALS(error_code_values), 0x0, NULL, HFILL } }, { &hf_draft_error_code, { "Error code (draft)", "v5ua.draft_error_code", FT_UINT32, BASE_HEX, VALS(draft_error_code_values), 0x0, NULL, HFILL } }, { &hf_status_type, { "Status type", "v5ua.status_type", FT_UINT16, BASE_DEC, VALS(status_type_values), 0x0, NULL, HFILL } }, { &hf_status_id, { "Status identification", "v5ua.status_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_error_reason, { "Error Reason", "v5ua.error_reason", FT_UINT32, BASE_HEX, VALS(error_reason_values), 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_v5ua, &ett_v5ua_common_header, &ett_v5ua_parameter, &ett_v5ua_layer3 }; /* Register the protocol name and description */ proto_v5ua = proto_register_protocol("V5.2-User Adaptation Layer", "V5UA", "v5ua"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_v5ua, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* In RFC specification the SCTP registered User Port Number Assignment for V5UA is 5675 */ #define SCTP_PORT_V5UA_RFC 5675 #define SCTP_PORT_V5UA_DRAFT 10001 void proto_reg_handoff_v5ua(void) { dissector_handle_t v5ua_handle; v5ua_handle = create_dissector_handle(dissect_v5ua, proto_v5ua); q931_handle = find_dissector_add_dependency("q931", proto_v5ua); v52_handle = find_dissector_add_dependency("v52", proto_v5ua); dissector_add_uint("sctp.port", SCTP_PORT_V5UA_DRAFT, v5ua_handle); dissector_add_uint("sctp.port", SCTP_PORT_V5UA_RFC, v5ua_handle); dissector_add_uint("sctp.ppi", V5UA_PAYLOAD_PROTOCOL_ID, v5ua_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vcdu.c
/* packet-vcdu.c * Routines for VCDU dissection * Copyright 2000, Scott Hovis [email protected] * Enhanced 2008, Matt Dunkle [email protected] * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/uat.h> void proto_register_vcdu(void); void proto_reg_handoff_vcdu(void); /* Initialize the protocol and registered fields */ static int proto_vcdu = -1; static int hf_smex_gsc = -1; /* static int hf_smex_unused = -1; */ static int hf_smex_version = -1; static int hf_smex_framelen = -1; static int hf_smex_rs_error = -1; static int hf_smex_rs_enable = -1; static int hf_smex_crc_enable = -1; static int hf_smex_crc_error = -1; static int hf_smex_mcs_enable = -1; static int hf_smex_mcs_num_error = -1; static int hf_smex_data_inv = -1; static int hf_smex_frame_sync = -1; static int hf_smex_data_dir = -1; static int hf_smex_data_class = -1; static int hf_smex_pb5 = -1; static int hf_smex_jday = -1; static int hf_smex_seconds = -1; static int hf_smex_msec = -1; /* static int hf_smex_spare = -1; */ static int hf_vcdu_version = -1; static int hf_vcdu_sp_id = -1; static int hf_vcdu_vc_id = -1; static int hf_vcdu_seq = -1; static int hf_vcdu_replay = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_vcdu_data = -1; static int hf_vcdu_ground_receipt_time = -1; static int hf_vcdu_ccsds_all_fill = -1; static int hf_vcdu_bitream_all_fill = -1; static int hf_vcdu_bitream_all_data = -1; static int hf_vcdu_bitream_all_data_anomaly = -1; static int hf_vcdu_ccsds_continuation_packet = -1; /* although technically not part of the vcdu header, the * first header pointer (for ccsds), and the last bit * pointer (for bitstream), are more easily processed by * simply adding them to the tail end of the vcdu header * branch rather than creating a distinct branch for them */ static int hf_vcdu_fhp = -1; static int hf_vcdu_lbp = -1; static dissector_handle_t vcdu_handle; static dissector_handle_t ccsds_handle; /* Initialize the subtree pointers */ static gint ett_vcdu = -1; static gint ett_smex = -1; static gint ett_vcduh = -1; static expert_field ei_vcdu_fhp_too_close_to_end_of_vcdu = EI_INIT; /* * Bits in the first 16-bit header word */ #define SMEX_VERSION 0xc000 #define SMEX_FRAMELEN 0x3fff /* some basic sizing parameters */ #define IP_HEADER_LENGTH 48 #define SMEX_HEADER_LENGTH 20 #define VCDU_HEADER_LENGTH 6 #define CCSDS_PRIMARY_HEADER_LENGTH 6 #define CCSDS_SECONDARY_HEADER_LENGTH 10 #define PB5_JULIAN_DAY_MASK 0x7ffe #define PB5_SECONDS_MASK 0x01ffff #define PB5_MILLISECONDS_MASK 0xffc0 #define LBP_ALL_DATA 0x3fff #define LBP_ALL_DATA_ANOMALY 0x7ff #define LBP_ALL_FILL 0x3ffe #define FHP_ALL_FILL 0x7fe #define FHP_CONTINUATION 0x7ff #define LBP_MASK 0x3fff #define FHP_MASK 0x07ff /* leap year macro */ #ifndef Leap # define Leap(yr) ( ( 0 == (yr)%4 && 0 != (yr)%100 ) || ( 0 == (yr)%400 ) ) #endif static const value_string smex_data_inversion_type[] = { { 0, "Data True (not inverted)" }, { 1, "Data Inverted (not corrected)" }, { 2, "Data Inversion State UNDEFINED" }, { 3, "Data Inverted (and corrected)" }, { 0, NULL } }; static const value_string smex_frame_sync_mode[] = { { 0, "Search" }, { 1, "Check" }, { 2, "Lock" }, { 3, "Flywheel" }, { 0, NULL } }; static const value_string smex_data_direction[] = { { 0, "Forward" }, { 1, "Reverse" }, { 0, NULL } }; static const value_string smex_data_class[] = { { 0, "Data Class UNDEFINED" }, { 1, "CCSDS Frame" }, { 2, "CCSDS Packet" }, { 3, "TDM Frame" }, { 4, "Stopped TDM Frame" }, { 0, NULL } }; /* default bitstream channel assignments: * the audio channels 4-6 are designated as bitstream channels * the standard bitstream channels are 12 through 19 * the video channels 28-30 are designated as bitstream channels * the fill channel 63 is designated as bitstream */ static int bitstream_channels[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* channels 0-9 */ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, /* channels 10-19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* channels 20-29 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* channels 30-39 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* channels 40-49 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* channels 50-59 */ 0, 0, 0, 1 /* channels 60-63 */ }; typedef struct { guint channel; } uat_channel_t; static uat_channel_t *uat_bitchannels = NULL; static uat_t *vcdu_uat = NULL; static guint num_channels_uat = 0; UAT_DEC_CB_DEF(uat_bitchannels, channel, uat_channel_t) static gboolean vcdu_uat_data_update_cb(void *p, char **err) { uat_channel_t *ud = (uat_channel_t *)p; if (ud->channel >= 64) { *err = g_strdup("Channel must be between 0-63."); return FALSE; } return TRUE; } static void vcdu_prefs_apply_cb(void) { guint i; if (num_channels_uat > 0) { memset(bitstream_channels, 0, sizeof(bitstream_channels)); for (i = 0; i < num_channels_uat; i++) { bitstream_channels[uat_bitchannels[i].channel] = 1; } } } /* convert smex PB5 header time to a human readable string - NOT THREAD SAFE * * note: this is not true PB5 time either, but a tsi specific version, although it is similar */ static const char * smex_time_to_string (wmem_allocator_t *pool, int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, int pb5_milliseconds) { static int utcdiff = 0; nstime_t t; static int Days[2][13] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; int yr; int ix, days, month; /* compute the static constant difference in seconds * between midnight 9-10 October 1995 (PB5 time) and * seconds since 1/1/1970 (UTC time) just this once */ if (0 == utcdiff) { for (yr=1970; yr < 1995; ++yr) { utcdiff += (Leap(yr) ? 366 : 365) * 24 * 60 * 60; } days = 0; ix = (Leap(1995) ? 1 : 0); for (month=1; month < 10; ++month) { days += Days[ix][month]; } days += 9; /* this gets us up to midnight october 9-10 */ utcdiff += days * 24 * 60 * 60; /* add days in 1995 prior to October 10 */ } t.secs = (pb5_days_since_midnight_9_10_oct_1995 * 86400) + pb5_seconds + utcdiff; t.nsecs = pb5_milliseconds*1000000; /* msecs to nsecs */ return abs_time_to_str(pool, &t, ABSOLUTE_TIME_DOY_UTC, TRUE); } static int dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; gboolean ccsds_tree_added = FALSE; proto_item *smex_header; proto_tree *smex_tree; proto_tree *vcdu_tree; proto_item *vcdu_item; guint16 first_word; guint32 long_word; int vcid, pb5_days, pb5_seconds, pb5_milliseconds; const char *time_string; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VCDU"); col_set_str(pinfo->cinfo, COL_INFO, "Virtual Channel Data Unit"); /* build the smex header tree */ smex_tree = proto_tree_add_subtree(tree, tvb, offset, SMEX_HEADER_LENGTH, ett_smex, &smex_header, "SMEX Header"); proto_tree_add_item(smex_tree, hf_smex_gsc, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; /* proto_tree_add_item(smex_tree, hf_smex_unused, tvb, offset, 2, ENC_BIG_ENDIAN); */ offset += 2; first_word = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(smex_tree, hf_smex_version, tvb, offset, 2, first_word); proto_tree_add_uint(smex_tree, hf_smex_framelen, tvb, offset, 2, first_word); offset += 2; proto_tree_add_item(smex_tree, hf_smex_rs_enable, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_rs_error, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_crc_enable, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_crc_error, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_mcs_enable, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_mcs_num_error, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_data_inv, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(smex_tree, hf_smex_frame_sync, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_data_dir, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_data_class, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* extract smex ground receipt time tag */ long_word = tvb_get_ntohl(tvb, offset); pb5_days = (long_word >> 17) & PB5_JULIAN_DAY_MASK; pb5_seconds = (long_word & PB5_SECONDS_MASK); first_word = tvb_get_ntohs(tvb, offset+4); pb5_milliseconds = (first_word & PB5_MILLISECONDS_MASK) >> 6; proto_tree_add_item(smex_tree, hf_smex_pb5, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(smex_tree, hf_smex_jday, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(smex_tree, hf_smex_seconds, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(smex_tree, hf_smex_msec, tvb, offset, 2, ENC_BIG_ENDIAN); /* proto_tree_add_item(smex_tree, hf_smex_spare, tvb, offset, 2, ENC_BIG_ENDIAN); */ offset += 2; /* format ground receipt time into human readable time format for display */ time_string = smex_time_to_string(pinfo->pool, pb5_days, pb5_seconds, pb5_milliseconds); proto_tree_add_string(smex_tree, hf_vcdu_ground_receipt_time, tvb, offset-6, 6, time_string); proto_item_set_end(smex_header, tvb, offset); /* build the vcdu header tree */ vcdu_tree = proto_tree_add_subtree(tree, tvb, offset, VCDU_HEADER_LENGTH, ett_vcdu, &vcdu_item, "VCDU Header"); /* extract the virtual channel for use later on */ first_word = tvb_get_ntohs(tvb, offset); vcid = first_word & 0x3f; proto_tree_add_item(vcdu_tree, hf_vcdu_version, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vcdu_tree, hf_vcdu_sp_id, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vcdu_tree, hf_vcdu_vc_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vcdu_tree, hf_vcdu_seq, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(vcdu_tree, hf_vcdu_replay, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* extract mpdu/bpdu header word */ first_word = tvb_get_ntohs(tvb, offset); /* do bitstream channel processing */ if (bitstream_channels[vcid]) { guint16 new_ptr; /* extract last bit pointer for bitstream channels */ new_ptr = first_word & LBP_MASK; /* add last bit pointer to display tree */ proto_tree_add_item(vcdu_tree, hf_vcdu_lbp, tvb, offset, 2, ENC_BIG_ENDIAN); switch (new_ptr) { case LBP_ALL_DATA: proto_tree_add_item(vcdu_tree, hf_vcdu_bitream_all_data, tvb, 0, -1, ENC_NA); break; case LBP_ALL_DATA_ANOMALY: proto_tree_add_item(vcdu_tree, hf_vcdu_bitream_all_data_anomaly, tvb, 0, -1, ENC_NA); break; case LBP_ALL_FILL: proto_tree_add_item(vcdu_tree, hf_vcdu_bitream_all_fill, tvb, 0, -1, ENC_NA); break; default: break; } } /* end of bitstream channel processing */ /* do ccsds channel processing */ else { guint16 new_ptr; /* extract first header pointer for ccsds channels */ new_ptr = first_word & FHP_MASK; /* add first header pointer to display tree */ proto_tree_add_item(vcdu_tree, hf_vcdu_fhp, tvb, offset, 2, ENC_BIG_ENDIAN); /* process special cases of first header pointer */ if (FHP_ALL_FILL == new_ptr) { proto_tree_add_item(vcdu_tree, hf_vcdu_ccsds_all_fill, tvb, 0, -1, ENC_NA); } else if (FHP_CONTINUATION == new_ptr) { proto_tree_add_item(vcdu_tree, hf_vcdu_ccsds_continuation_packet, tvb, 0, -1, ENC_NA); } /* process as many ccsds packet headers as we can using the ccsds packet dissector */ else { int packet_boundary; int new_offset; /* compute offset and packet boundary lengths for ccsds dissector loop */ new_offset = offset + 2 + new_ptr; packet_boundary = tvb_reported_length(tvb) - VCDU_HEADER_LENGTH - CCSDS_PRIMARY_HEADER_LENGTH - CCSDS_SECONDARY_HEADER_LENGTH; while ( ((new_offset-offset+2) < packet_boundary) && ((new_offset-offset+2) >= 4) ) { int ccsds_len; tvbuff_t *new_tvb; ccsds_tree_added = TRUE; ccsds_len = tvb_get_ntohs(tvb, new_offset+4); new_tvb = tvb_new_subset_remaining(tvb, new_offset); call_dissector(ccsds_handle, new_tvb, pinfo, vcdu_tree); new_offset = new_offset + ccsds_len + 7; } if (! ccsds_tree_added) { proto_tree_add_expert(vcdu_tree, pinfo, &ei_vcdu_fhp_too_close_to_end_of_vcdu, tvb, 0, -1); } } } /* end of ccsds channel processing */ /* don't include the mpdu/bpdu header in the vcdu header highlighting. * by skipping the offset bump the vcdu header highlighting will show * just 6 bytes as it really should, and the fhp/lbp will be included * in the data zone, which is technically more correct. */ /* offset += 2; */ proto_item_set_end(vcdu_item, tvb, offset); if (! ccsds_tree_added) { /* add "Data" section if ccsds parsing did not do so already */ proto_tree_add_item(vcdu_tree, hf_vcdu_data, tvb, offset, -1, ENC_NA); } return tvb_captured_length(tvb); } void proto_register_vcdu(void) { module_t *vcdu_module; /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_smex_gsc, { "Ground Sequence Counter", "vcdu.smex.gsc", FT_UINT64, BASE_DEC, NULL, 0x0, "SMEX Ground Sequence Counter", HFILL } }, #if 0 { &hf_smex_unused, { "Unused", "vcdu.smex.unused", FT_UINT16, BASE_DEC, NULL, 0x0, "SMEX Unused", HFILL } }, #endif { &hf_smex_version, { "Version", "vcdu.smex.version", FT_UINT16, BASE_DEC, NULL, SMEX_VERSION, "SMEX Version", HFILL } }, { &hf_smex_framelen, { "Frame Length", "vcdu.smex.frame_len", FT_UINT16, BASE_DEC, NULL, SMEX_FRAMELEN, "SMEX Frame Length", HFILL } }, { &hf_smex_rs_enable, { "RS Enable", "vcdu.smex.rs_enable", FT_BOOLEAN, 8, NULL, 0x80, "SMEX RS Enable", HFILL } }, { &hf_smex_rs_error, { "RS Error", "vcdu.smex.rs_error", FT_BOOLEAN, 8, NULL, 0x40, "SMEX RS Error", HFILL } }, { &hf_smex_crc_enable, { "CRC Enable", "vcdu.smex.crc_enable", FT_BOOLEAN, 8, NULL, 0x20, "SMEX CRC Enable", HFILL } }, { &hf_smex_crc_error, { "CRC Error", "vcdu.smex.crc_error", FT_BOOLEAN, 8, NULL, 0x10, "SMEX CRC Error", HFILL } }, { &hf_smex_mcs_enable, { "MCS Enable", "vcdu.smex.mcs_enable", FT_BOOLEAN, 8, NULL, 0x08, "SMEX MCS Enable", HFILL } }, { &hf_smex_mcs_num_error, { "MCS Number Error", "vcdu.smex.mcs_numerr", FT_BOOLEAN, 8, NULL, 0x04, "SMEX MCS Number Error", HFILL } }, { &hf_smex_data_inv, { "Data Inversion", "vcdu.smex.data_inv", FT_UINT16, BASE_DEC, VALS(smex_data_inversion_type), 0x03, "SMEX Data Inversion", HFILL } }, { &hf_smex_frame_sync, { "Frame Sync", "vcdu.smex.frame_sync", FT_UINT16, BASE_DEC, VALS(smex_frame_sync_mode), 0xc0, "SMEX Frame Sync Flag", HFILL } }, { &hf_smex_data_dir, { "Data Direction", "vcdu.smex.data_dir", FT_UINT16, BASE_DEC, VALS(smex_data_direction), 0x20, "SMEX Data Direction flag", HFILL } }, { &hf_smex_data_class, { "Data Class", "vcdu.smex.data_class", FT_UINT16, BASE_DEC, VALS(smex_data_class), 0x1f, "SMEX Data Class", HFILL } }, { &hf_smex_pb5, { "PB5 Flag", "vcdu.smex.pb5", FT_UINT16, BASE_DEC, NULL, 0x8000, "SMEX PB5 Flag", HFILL } }, { &hf_smex_jday, { "Julian Day", "vcdu.smex.jday", FT_UINT16, BASE_DEC, NULL, PB5_JULIAN_DAY_MASK, "SMEX Julian Day", HFILL } }, { &hf_smex_seconds, { "Seconds", "vcdu.smex.seconds", FT_UINT24, BASE_DEC, NULL, PB5_SECONDS_MASK, "SMEX Seconds", HFILL } }, { &hf_smex_msec, { "Milliseconds", "vcdu.smex.msec", FT_UINT16, BASE_DEC, NULL, PB5_MILLISECONDS_MASK, "SMEX Milliseconds", HFILL } }, #if 0 { &hf_smex_spare, { "Spare", "vcdu.smex.spare", FT_UINT16, BASE_DEC, NULL, 0x003f, "SMEX Spare", HFILL } }, #endif { &hf_vcdu_version, { "Version", "vcdu.version", FT_UINT16, BASE_DEC, NULL, 0xc0, "VCDU Version", HFILL } }, { &hf_vcdu_sp_id, { "Space Craft ID", "vcdu.spid", FT_UINT16, BASE_DEC, NULL, 0x3fc0, "VCDU Space Craft ID", HFILL } }, { &hf_vcdu_vc_id, { "Virtual Channel ID", "vcdu.vcid", FT_UINT16, BASE_DEC, NULL, 0x3f, "VCDU Virtual Channel ID", HFILL } }, { &hf_vcdu_seq, { "Sequence Count", "vcdu.seq", FT_UINT24, BASE_DEC, NULL, 0x0, "VCDU Sequence Count", HFILL } }, { &hf_vcdu_replay, { "Replay Flag", "vcdu.replay", FT_BOOLEAN, 8, NULL, 0x80, "VCDU Replay Flag", HFILL } }, /* Generated from convert_proto_tree_add_text.pl */ { &hf_vcdu_ground_receipt_time, { "Ground Receipt Time", "vcdu.ground_receipt_time", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_bitream_all_data, { "Bitream ALL Data", "vcdu.bitream.all_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_bitream_all_data_anomaly, { "Bitream ALL Data (Anomaly)", "vcdu.bitream.all_data_anomaly", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_bitream_all_fill, { "Bitream ALL Fill", "vcdu.bitream.all_fill", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_ccsds_all_fill, { "Ccsds ALL Fill", "vcdu.ccsds.all_fill", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_ccsds_continuation_packet, { "Ccsds Continuation Packet", "vcdu.ccsds_continuation_packet", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vcdu_data, { "Data", "vcdu.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, /* not really part of the vcdu header, but it's easier this way */ { &hf_vcdu_fhp, { "First Header Pointer", "vcdu.fhp", FT_UINT16, BASE_DEC, NULL, FHP_MASK, "VCDU/MPDU First Header Pointer", HFILL } }, { &hf_vcdu_lbp, { "Last Bit Pointer", "vcdu.lbp", FT_UINT16, BASE_DEC, NULL, LBP_MASK, "VCDU/BPDU Last Bit Pointer", HFILL } } }; static uat_field_t vcdu_uat_flds[] = { UAT_FLD_DEC(uat_bitchannels, channel, "Bitstream Channel", "Bitstream Channel"), UAT_END_FIELDS }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_vcdu, &ett_smex, &ett_vcduh, }; static ei_register_info ei[] = { { &ei_vcdu_fhp_too_close_to_end_of_vcdu, { "vcdu.fhp_too_close_to_end_of_vcdu", PI_PROTOCOL, PI_WARN, "FHP too close to end of VCDU. Incomplete Hdr Info Available - Unable to format CCSDS Hdr(s).", EXPFILL }}, }; expert_module_t* expert_vcdu; /* Register the protocol name and description */ proto_vcdu = proto_register_protocol("VCDU", "VCDU", "vcdu"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_vcdu, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vcdu = expert_register_protocol(proto_vcdu); expert_register_field_array(expert_vcdu, ei, array_length(ei)); /* XX: Does this dissector need to be publicly registered ?? */ vcdu_handle = register_dissector("vcdu", dissect_vcdu, proto_vcdu); vcdu_module = prefs_register_protocol(proto_vcdu, vcdu_prefs_apply_cb); vcdu_uat = uat_new("Bitstream Channel Table", sizeof(uat_channel_t), "vcdu_bitstream_channels", TRUE, &uat_bitchannels, &num_channels_uat, UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ NULL, NULL, vcdu_uat_data_update_cb, NULL, NULL, NULL, vcdu_uat_flds); prefs_register_uat_preference(vcdu_module, "bitstream_channels", "Bitstream Channel Table", "Bitstream Channel Table", vcdu_uat); } void proto_reg_handoff_vcdu(void) { dissector_add_for_decode_as_with_preference("udp.port", vcdu_handle); ccsds_handle = find_dissector_add_dependency("ccsds", proto_vcdu); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vicp.c
/* packet-vicp.c * LeCroy VICP (GPIB-over-Ethernet-but-lets-not-do-LXI) dissector * * Written by Frank Kingswood <[email protected]> * Copyright 2008, Artimi Ltd. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/ptvcursor.h> /* registration object IDs */ static int proto_vicp = -1; static int hf_vicp_operation = -1; static int hf_vicp_version = -1; static int hf_vicp_sequence = -1; static int hf_vicp_unused = -1; static int hf_vicp_length = -1; static int hf_vicp_data = -1; static gint ett_vicp = -1; #define VICP_PORT 1861 void proto_register_vicp(void); void proto_reg_handoff_vicp(void); static int dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *vicp_tree; ptvcursor_t* cursor; guint len; if (tvb_reported_length_remaining(tvb, 0) < 8) { /* Payload too small for VICP */ return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "VICP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vicp, tvb, 0, -1, ENC_NA); vicp_tree = proto_item_add_subtree(ti, ett_vicp); cursor = ptvcursor_new(pinfo->pool, vicp_tree, tvb, 0); ptvcursor_add(cursor, hf_vicp_operation, 1, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_vicp_version, 1, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_vicp_sequence, 1, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_vicp_unused, 1, ENC_BIG_ENDIAN); len=tvb_get_ntohl(tvb, ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_vicp_length, 4, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_vicp_data, len, ENC_NA); ptvcursor_free(cursor); return tvb_captured_length(tvb); } void proto_register_vicp(void) { static hf_register_info hf[] = { { &hf_vicp_operation, { "Operation","vicp.operation",FT_UINT8,BASE_HEX,NULL,0x0,NULL,HFILL } }, { &hf_vicp_version, { "Protocol version","vicp.version",FT_UINT8,BASE_DEC,NULL,0x0,NULL,HFILL } }, { &hf_vicp_sequence, { "Sequence number","vicp.sequence",FT_UINT8,BASE_DEC,NULL,0x0,NULL,HFILL } }, { &hf_vicp_unused, { "Unused","vicp.unused",FT_UINT8,BASE_HEX,NULL,0x0,NULL,HFILL } }, { &hf_vicp_length, { "Data length","vicp.length",FT_UINT32,BASE_DEC,NULL,0x0,NULL,HFILL } }, { &hf_vicp_data, { "Data","vicp.data",FT_BYTES,BASE_NONE,NULL,0x0,NULL,HFILL } } }; static gint *ett[] = { &ett_vicp }; proto_vicp = proto_register_protocol("LeCroy VICP", "VICP", "vicp"); proto_register_field_array(proto_vicp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vicp(void) { dissector_handle_t vicp_handle; vicp_handle = create_dissector_handle(dissect_vicp, proto_vicp); dissector_add_uint_with_preference("tcp.port", VICP_PORT, vicp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 3 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=3 tabstop=8 expandtab: * :indentSize=3:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vines.c
/* packet-vines.c * Routines for Banyan VINES protocol packet disassembly * * Don Lafontaine <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * Joerg Mayer (see AUTHORS file) * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Information about VINES can be found in * * VINES Protocol Definition * Order Number: DA254-00 * Banyan Systems incorporated * February 1990 * Part Number: 092093-000 * * Banyan Systems are no longer in business, so that document cannot be * ordered from them. An online copy appears to be available at * * http://banyan-vines.bamertal.com/Banyan-supplier-help/ProtoDef/ProtoDefMain.htm * * along with the VINES Architecture Definition at * * http://banyan-vines.bamertal.com/Banyan-supplier-help/ArchDef/ArchDefMain.htm * * and other VINES documentation linked to from * * http://banyan-vines.bamertal.com/Banyan-supplier-help/banyan.htm * * Some information can also be found in * * http://docwiki.cisco.com/wiki/Banyan_VINES * * and at * * http://www.banalyzer.de/ban/HTML/P_VINES/Eng/P_vines.html * * The document at * * http://www.watersprings.org/pub/id/draft-ietf-rmonmib-rmonprot-v2-00.txt * * lists a bunch of values of protocol identifier fields for various * protocols. It speaks of the Vines Fragmentation Protocol, * the "Vines Token Ring Protocol" which appears to be the same as the * "Vines LLC" protocol here, the Vines echo protocol, Vines IP, and * protocols running atop Vines IP. * * The LLC values it describes are: * * 0xbc (SAP_VINES2) Vines Token Ring a/k/a Vines LLC * * It doesn't mention 0xba (SAP_VINES1). * * The Vines Token Ring/Vines LLC protocol identifier values it * describes are: * * 0xba Vines IP * 0xbb Vines Echo * * The Ethernet type values it describes are: * * 0x0bad (ETHERTYPE_VINES) Vines IP * 0x0baf Vines Echo */ #include "config.h" #include <epan/packet.h> #include <epan/capture_dissectors.h> #include <epan/etypes.h> #include <epan/ppptypes.h> #include <epan/ipproto.h> #include <epan/arcnet_pids.h> #include <epan/llcsaps.h> #include <epan/to_str.h> #include <epan/address_types.h> #include <wsutil/pint.h> void proto_register_vines_frp(void); void proto_reg_handoff_vines_frp(void); void proto_register_vines_llc(void); void proto_reg_handoff_vines_llc(void); void proto_register_vines_ip(void); void proto_reg_handoff_vines_ip(void); void proto_register_vines_echo(void); void proto_reg_handoff_vines_echo(void); void proto_register_vines_ipc(void); void proto_reg_handoff_vines_ipc(void); void proto_register_vines_spp(void); void proto_reg_handoff_vines_spp(void); void proto_register_vines_arp(void); void proto_reg_handoff_vines_arp(void); void proto_register_vines_rtp(void); void proto_reg_handoff_vines_rtp(void); void proto_register_vines_icp(void); void proto_reg_handoff_vines_icp(void); #define UDP_PORT_VINES 573 static int proto_vines_frp = -1; static int hf_vines_frp_flags = -1; static int hf_vines_frp_flags_first_fragment = -1; static int hf_vines_frp_flags_last_fragment = -1; static int hf_vines_frp_sequence_number = -1; static gint ett_vines_frp = -1; static gint ett_vines_frp_flags = -1; static int proto_vines_llc = -1; static int hf_vines_llc_packet_type = -1; static gint ett_vines_llc = -1; static int proto_vines_ip = -1; static int hf_vines_ip_protocol = -1; static int hf_vines_ip_checksum = -1; static int hf_vines_ip_length = -1; static int hf_vines_ip_source = -1; static int hf_vines_ip_destination = -1; static int hf_vines_tctl = -1; static int hf_vines_tctl_node = -1; static int hf_vines_tctl_class = -1; static int hf_vines_tctl_forward_router = -1; static int hf_vines_tctl_metric = -1; static int hf_vines_tctl_notif_packet = -1; static int hf_vines_tctl_hop_count = -1; static gint ett_vines_ip = -1; static gint ett_vines_ip_tctl = -1; static int proto_vines_echo = -1; static gint hf_vines_echo_data = -1; static gint ett_vines_echo = -1; static int proto_vines_ipc = -1; static int hf_vines_ipc_src_port = -1; static int hf_vines_ipc_dest_port = -1; static int hf_vines_ipc_packet_type = -1; static int hf_vines_ipc_control = -1; static int hf_vines_ipc_control_ack = -1; static int hf_vines_ipc_control_end_msg = -1; static int hf_vines_ipc_control_beg_msg = -1; static int hf_vines_ipc_control_abort_msg = -1; static int hf_vines_ipc_local_connection_id = -1; static int hf_vines_ipc_sequence_number = -1; static int hf_vines_ipc_length = -1; static int hf_vines_ipc_remote_connection_id = -1; static int hf_vines_ipc_ack_number = -1; static int hf_vines_ipc_error = -1; static gint ett_vines_ipc = -1; static gint ett_vines_ipc_control = -1; static int proto_vines_spp = -1; static int hf_vines_spp_src_port = -1; static int hf_vines_spp_dest_port = -1; static int hf_vines_spp_packet_type = -1; static int hf_vines_spp_control = -1; static int hf_vines_spp_control_ack = -1; static int hf_vines_spp_control_end_msg = -1; static int hf_vines_spp_control_beg_msg = -1; static int hf_vines_spp_control_abort_msg = -1; static int hf_vines_spp_local_id = -1; static int hf_vines_spp_remote_id = -1; static int hf_vines_spp_seq_num = -1; static int hf_vines_spp_ack_num = -1; static int hf_vines_spp_window = -1; static gint ett_vines_spp = -1; static gint ett_vines_spp_control = -1; static int proto_vines_arp = -1; static int hf_vines_arp_address = -1; static int hf_vines_arp_version = -1; static int hf_vines_arp_packet_type = -1; static int hf_vines_arp_interface_metric = -1; static int hf_vines_arp_sequence_number = -1; static gint ett_vines_arp = -1; static int proto_vines_rtp = -1; static int hf_vines_rtp_comp_flag = -1; static int hf_vines_rtp_comp_flag_neighbor_router = -1; static int hf_vines_rtp_comp_flag_sequence_rtp = -1; static int hf_vines_rtp_comp_flag_sequence_rtp_version = -1; static int hf_vines_rtp_control = -1; static int hf_vines_rtp_control_sync_broadcast = -1; static int hf_vines_rtp_control_topology_update = -1; static int hf_vines_rtp_control_specific_request = -1; static int hf_vines_rtp_control_end_msg = -1; static int hf_vines_rtp_control_beg_msg = -1; static int hf_vines_rtp_machine_rtp = -1; static int hf_vines_rtp_machine_tcpip = -1; static int hf_vines_rtp_machine_bus = -1; static int hf_vines_rtp_flag_sequence_rtp = -1; static int hf_vines_rtp_flag_network_p2p = -1; static int hf_vines_rtp_flag_data_link_p2p = -1; static int hf_vines_rtp_flag_broadcast_medium = -1; static int hf_vines_rtp_metric_to_preferred_gateway = -1; static int hf_vines_rtp_requested_info = -1; static int hf_vines_rtp_metric_to_destination = -1; static int hf_vines_rtp_source_route_length = -1; static int hf_vines_rtp_router_sequence_number = -1; static int hf_vines_rtp_sequence_number = -1; static int hf_vines_rtp_data_offset = -1; static int hf_vines_rtp_preferred_gateway_sequence_number = -1; static int hf_vines_rtp_preferred_gateway_node_type = -1; static int hf_vines_rtp_metric = -1; static int hf_vines_rtp_destination_sequence_number = -1; static int hf_vines_rtp_link_address_length = -1; static int hf_vines_rtp_controller_type = -1; static int hf_vines_rtp_destination_node_type = -1; static int hf_vines_rtp_information_type = -1; static int hf_vines_rtp_version = -1; static int hf_vines_rtp_preferred_gateway = -1; static int hf_vines_rtp_neighbor_metric = -1; static int hf_vines_rtp_destination = -1; static int hf_vines_rtp_node_type = -1; static int hf_vines_rtp_operation_type = -1; static int hf_vines_rtp_packet_id = -1; static int hf_vines_rtp_network_number = -1; static int hf_vines_rtp_machine_type = -1; static int hf_vines_rtp_destination_controller_type = -1; static int hf_vines_rtp_destination_machine = -1; static int hf_vines_rtp_pref_gateway_controller_type = -1; static int hf_vines_rtp_pref_gateway_machine = -1; static int hf_vines_rtp_network_flags = -1; static int hf_vines_rtp_destination_flags = -1; static int hf_vines_rtp_preferred_gateway_flags = -1; static int hf_vines_rtp_preferred_gateway_data_link_address_ether = -1; static int hf_vines_rtp_preferred_gateway_data_link_address_bytes = -1; static int hf_vines_rtp_preferred_gateway_source_route = -1; static gint ett_vines_rtp = -1; static gint ett_vines_rtp_compatibility_flags = -1; static gint ett_vines_rtp_req_info = -1; static gint ett_vines_rtp_control_flags = -1; static gint ett_vines_rtp_mtype = -1; static gint ett_vines_rtp_flags = -1; static int proto_vines = -1; static int proto_vines_icp = -1; static int hf_vines_icp_exception_code = -1; static int hf_vines_icp_metric = -1; static int hf_vines_icp_packet_type = -1; static gint ett_vines_icp = -1; /* VINES IP structs and definitions */ enum { VIP_PROTO_IPC = 1, /* Interprocess Communications Protocol (IPC) */ VIP_PROTO_SPP = 2, /* Sequenced Packet Protocol (SPP) */ VIP_PROTO_ARP = 4, /* Address Resolution Protocol (ARP) */ VIP_PROTO_RTP = 5, /* Routing Update Protocol (RTP) / SRTP (Sequenced RTP) */ VIP_PROTO_ICP = 6 /* Internet Control Protocol (ICP) */ }; /* VINES SPP and IPC structs and definitions */ enum { PKTTYPE_DGRAM = 0, /* Unreliable datagram */ PKTTYPE_DATA = 1, /* User Data */ PKTTYPE_ERR = 2, /* Error */ PKTTYPE_DISC = 3, /* Diconnect Request */ PKTTYPE_PROBE = 4, /* Probe (retransmit) */ PKTTYPE_ACK = 5 /* Acknowledgement */ }; typedef struct _e_vspp { guint16 vspp_sport; guint16 vspp_dport; guint8 vspp_pkttype; guint8 vspp_control; guint16 vspp_lclid; /* Local Connection ID */ guint16 vspp_rmtid; /* Remote Connection ID */ guint16 vspp_seqno; /* Sequence Number */ guint16 vspp_ack; /* Acknowledgement Number */ guint16 vspp_win; } e_vspp; typedef struct _e_vipc { guint16 vipc_sport; guint16 vipc_dport; guint8 vipc_pkttype; guint8 vipc_control; guint16 vipc_lclid; /* Local Connection ID */ guint16 vipc_rmtid; /* Remote Connection ID */ guint16 vipc_seqno; /* Sequence Number */ guint16 vipc_ack; /* Acknowledgement Number */ guint16 vipc_err_len; } e_vipc; static gboolean capture_vines(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) { capture_dissector_increment_count(cpinfo, proto_vines); return TRUE; } static dissector_handle_t vines_ip_handle; /* Control flags */ #define VINES_FRP_FIRST_FRAGMENT 0x01 #define VINES_FRP_LAST_FRAGMENT 0x02 /* AFAIK Vines FRP (Fragmentation Protocol) is used on all media except * Ethernet and TR (and probably FDDI) - Fragmentation on these media types * is not possible * FIXME: Do we need to use this header with PPP too? */ static int dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *vines_frp_tree; proto_item *ti; proto_tree *flags_tree; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines FRP"); col_clear(pinfo->cinfo, COL_INFO); if (tree) { ti = proto_tree_add_item(tree, proto_vines_frp, tvb, 0, 2, ENC_NA); vines_frp_tree = proto_item_add_subtree(ti, ett_vines_frp); ti = proto_tree_add_item(vines_frp_tree, hf_vines_frp_flags, tvb, 0, 1, ENC_NA); flags_tree = proto_item_add_subtree(ti, ett_vines_frp_flags); proto_tree_add_item(flags_tree, hf_vines_frp_flags_first_fragment, tvb, 0, 1, ENC_NA); proto_tree_add_item(flags_tree, hf_vines_frp_flags_last_fragment, tvb, 0, 1, ENC_NA); proto_tree_add_item(vines_frp_tree, hf_vines_frp_sequence_number, tvb, 1, 1, ENC_LITTLE_ENDIAN); } /* Decode the "real" Vines now */ next_tvb = tvb_new_subset_remaining(tvb, 2); call_dissector(vines_ip_handle, next_tvb, pinfo, tree); return tvb_captured_length(tvb); } static int dissect_vines_frp_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *params _U_) { if (pinfo->srcport != pinfo->destport) { /* Require that the source and destination ports be the * port for Vines FRP. */ return 0; } if (!tvb_bytes_exist(tvb, 0, 1)) { /* Too short to check the flags value. */ return 0; } if ((tvb_get_guint8(tvb, 0) & ~(VINES_FRP_FIRST_FRAGMENT|VINES_FRP_LAST_FRAGMENT)) != 0) { /* Those are the only flags; if anything else is set, this * is presumably not Vines FRP. */ return 0; } dissect_vines_frp(tvb, pinfo, tree, params); return tvb_captured_length(tvb); } void proto_register_vines_frp(void) { static hf_register_info hf[] = { { &hf_vines_frp_flags, { "Control Flags", "vines_frp.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_frp_flags_first_fragment, { "First fragment", "vines_frp.flags.first_fragment", FT_BOOLEAN, 8, NULL, VINES_FRP_FIRST_FRAGMENT, NULL, HFILL }}, { &hf_vines_frp_flags_last_fragment, { "Last fragment", "vines_frp.flags.last_fragment", FT_BOOLEAN, 8, NULL, VINES_FRP_LAST_FRAGMENT, NULL, HFILL }}, { &hf_vines_frp_sequence_number, { "Sequence Number", "vines_frp.sequence_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_frp, &ett_vines_frp_flags }; proto_vines_frp = proto_register_protocol( "Banyan Vines Fragmentation Protocol", "Vines FRP", "vines_frp"); proto_register_field_array(proto_vines_frp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vines_frp(void) { dissector_handle_t vines_frp_handle, vines_frp_new_handle; vines_frp_handle = create_dissector_handle(dissect_vines_frp, proto_vines_frp); dissector_add_uint("ip.proto", IP_PROTO_VINES, vines_frp_handle); vines_frp_new_handle = create_dissector_handle(dissect_vines_frp_new, proto_vines_frp); dissector_add_uint_with_preference("udp.port", UDP_PORT_VINES, vines_frp_new_handle); } static dissector_table_t vines_llc_dissector_table; #define VINES_LLC_IP 0xba #define VINES_LLC_ECHO 0xbb static const value_string vines_llc_ptype_vals[] = { { VINES_LLC_IP, "Vines IP" }, { VINES_LLC_ECHO, "Vines Echo" }, { 0, NULL } }; static int dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint8 ptype; proto_tree *vines_llc_tree; proto_item *ti; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines LLC"); col_clear(pinfo->cinfo, COL_INFO); ptype = tvb_get_guint8(tvb, 0); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ptype, vines_llc_ptype_vals, "Unknown protocol 0x%02x")); if (tree) { ti = proto_tree_add_item(tree, proto_vines_llc, tvb, 0, 1, ENC_NA); vines_llc_tree = proto_item_add_subtree(ti, ett_vines_llc); proto_tree_add_item(vines_llc_tree, hf_vines_llc_packet_type, tvb, 0, 1, ENC_NA); } next_tvb = tvb_new_subset_remaining(tvb, 1); if (!dissector_try_uint(vines_llc_dissector_table, ptype, next_tvb, pinfo, tree)) call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_vines_llc(void) { static hf_register_info hf[] = { { &hf_vines_llc_packet_type, { "Packet Type", "vines_llc.packet_type", FT_UINT8, BASE_HEX, VALS(vines_llc_ptype_vals), 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_llc, }; proto_vines_llc = proto_register_protocol( "Banyan Vines LLC", "Vines LLC", "vines_llc"); proto_register_field_array(proto_vines_llc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* subdissector code */ vines_llc_dissector_table = register_dissector_table("vines_llc.ptype", "Vines LLC protocol", proto_vines_llc, FT_UINT8, BASE_HEX); } void proto_reg_handoff_vines_llc(void) { dissector_handle_t vines_llc_handle; vines_llc_handle = create_dissector_handle(dissect_vines_llc, proto_vines_llc); dissector_add_uint("llc.dsap", SAP_VINES2, vines_llc_handle); } static dissector_table_t vines_ip_dissector_table; static const value_string class_vals[] = { { 0x00, "Regardless of cost" }, { 0x10, "Without cost" }, { 0x20, "With low cost (>= 4800 bps)" }, { 0x30, "Via LAN" }, { 0, NULL } }; static const value_string proto_vals[] = { { VIP_PROTO_IPC, "IPC" }, { VIP_PROTO_SPP, "SPP" }, { VIP_PROTO_ARP, "ARP" }, { VIP_PROTO_RTP, "RTP" }, { VIP_PROTO_ICP, "ICP" }, { 0, NULL } }; static const guint8 bcast_addr[VINES_ADDR_LEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const true_false_string tfs_vine_tctl_router_all = { "Router nodes", "All nodes" }; static const true_false_string tfs_vine_tctl_forward_router = { "Can handle redirect packets", "Cannot handle redirect packets" }; static const true_false_string tfs_vine_tctl_return_not_return = { "Return", "Do not return" }; static int dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint16 vip_pktlen; guint8 vip_tctl; /* Transport Control */ guint8 vip_proto; proto_tree *vip_tree, *tctl_tree; proto_item *ti; gboolean is_broadcast = FALSE; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines IP"); col_clear(pinfo->cinfo, COL_INFO); /* To do: check for runts, errs, etc. */ /* capture the necessary parts of the header */ vip_pktlen = tvb_get_ntohs(tvb, offset+2); vip_tctl = tvb_get_guint8(tvb, offset+3); vip_proto = tvb_get_guint8(tvb, offset+4); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%02x)", val_to_str_const(vip_tctl, proto_vals, "Unknown VIP protocol"), vip_tctl); set_address_tvb(&pinfo->net_src, AT_VINES, VINES_ADDR_LEN, tvb, offset+12); copy_address_shallow(&pinfo->src, &pinfo->net_src); set_address_tvb(&pinfo->net_dst, AT_VINES, VINES_ADDR_LEN, tvb, offset+6); copy_address_shallow(&pinfo->dst, &pinfo->net_dst); /* helpers to transport control */ if (tvb_memeql(tvb, offset+6, bcast_addr, VINES_ADDR_LEN) == 0) is_broadcast = TRUE; /* * Adjust the length of this tvbuff to include only the Vines IP * datagram. */ set_actual_length(tvb, vip_pktlen < 18 ? 18 : vip_pktlen); if (tree) { ti = proto_tree_add_item(tree, proto_vines_ip, tvb, offset, vip_pktlen, ENC_NA); vip_tree = proto_item_add_subtree(ti, ett_vines_ip); proto_tree_add_checksum(vip_tree, tvb, offset, hf_vines_ip_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); offset += 2; proto_tree_add_item(vip_tree, hf_vines_ip_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; ti = proto_tree_add_item(vip_tree, hf_vines_tctl, tvb, offset, 1, ENC_BIG_ENDIAN); tctl_tree = proto_item_add_subtree(ti, ett_vines_ip_tctl); /* * XXX - bit 0x80 is "Normal" if 0; what is it if 1? */ if (is_broadcast) { proto_tree_add_item(tctl_tree, hf_vines_tctl_node, tvb, offset, 1, ENC_NA); proto_tree_add_item(tctl_tree, hf_vines_tctl_class, tvb, offset, 1, ENC_NA); } else { proto_tree_add_item(tctl_tree, hf_vines_tctl_forward_router, tvb, offset, 1, ENC_NA); proto_tree_add_item(tctl_tree, hf_vines_tctl_metric, tvb, offset, 1, ENC_NA); proto_tree_add_item(tctl_tree, hf_vines_tctl_notif_packet, tvb, offset, 1, ENC_NA); } proto_tree_add_item(tctl_tree, hf_vines_tctl_hop_count, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vip_tree, hf_vines_ip_protocol, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vip_tree, hf_vines_ip_destination, tvb, offset, VINES_ADDR_LEN, ENC_NA); offset += 6; proto_tree_add_item(vip_tree, hf_vines_ip_source, tvb, offset, VINES_ADDR_LEN, ENC_NA); offset += 6; } else { offset += 18; } next_tvb = tvb_new_subset_remaining(tvb, offset); if (!dissector_try_uint(vines_ip_dissector_table, vip_proto, next_tvb, pinfo, tree)) call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_vines_ip(void) { static gint *ett[] = { &ett_vines_ip, &ett_vines_ip_tctl, }; static hf_register_info hf[] = { { &hf_vines_ip_protocol, { "Protocol", "vines_ip.protocol", FT_UINT8, BASE_HEX, VALS(proto_vals), 0x0, "Vines protocol", HFILL }}, { &hf_vines_ip_checksum, { "Packet checksum", "vines_ip.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ip_length, { "Packet length", "vines_ip.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_tctl, { "Transport control", "vines_ip.tctl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_tctl_node, { "Nodes", "vines_ip.tctl.node", FT_BOOLEAN, 8, TFS(&tfs_vine_tctl_router_all), 0x40, NULL, HFILL }}, { &hf_vines_tctl_class, { "Reachable", "vines_ip.tctl.class", FT_UINT8, BASE_DEC, VALS(class_vals), 0x30, NULL, HFILL }}, { &hf_vines_tctl_forward_router, { "Forwarding Router", "vines_ip.tctl.forward_router", FT_BOOLEAN, 8, TFS(&tfs_vine_tctl_forward_router), 0x40, NULL, HFILL }}, { &hf_vines_tctl_metric, { "Metric notification packet", "vines_ip.tctl.metric", FT_BOOLEAN, 8, TFS(&tfs_vine_tctl_return_not_return), 0x20, NULL, HFILL }}, { &hf_vines_tctl_notif_packet, { "Exception notification packet", "vines_ip.tctl.notif_packet", FT_BOOLEAN, 8, TFS(&tfs_vine_tctl_return_not_return), 0x10, NULL, HFILL }}, { &hf_vines_tctl_hop_count, { "Hop count remaining", "vines_ip.tctl.hop_count", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, { &hf_vines_ip_destination, { "Destination", "vines_ip.destination", FT_VINES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ip_source, { "Source", "vines_ip.source", FT_VINES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; proto_vines_ip = proto_register_protocol("Banyan Vines IP", "Vines IP", "vines_ip"); proto_register_field_array(proto_vines_ip, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* subdissector code */ vines_ip_dissector_table = register_dissector_table("vines_ip.protocol", "Vines protocol", proto_vines_ip, FT_UINT8, BASE_HEX); vines_ip_handle = create_dissector_handle(dissect_vines_ip, proto_vines_ip); } void proto_reg_handoff_vines_ip(void) { dissector_add_uint("ethertype", ETHERTYPE_VINES_IP, vines_ip_handle); dissector_add_uint("ppp.protocol", PPP_VINES, vines_ip_handle); dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_BANYAN, vines_ip_handle); dissector_add_uint("vines_llc.ptype", VINES_LLC_IP, vines_ip_handle); } static int dissect_vines_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *vines_echo_tree = NULL; proto_item *ti; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines Echo"); col_clear(pinfo->cinfo, COL_INFO); if (tree) { ti = proto_tree_add_item(tree, proto_vines_echo, tvb, 0, -1, ENC_NA); vines_echo_tree = proto_item_add_subtree(ti, ett_vines_echo); proto_tree_add_item(vines_echo_tree, hf_vines_echo_data, tvb, 0, -1, ENC_NA); } return tvb_captured_length(tvb); } void proto_register_vines_echo(void) { static hf_register_info hf[] = { { &hf_vines_echo_data, { "Data", "vines_echo.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_echo, }; proto_vines_echo = proto_register_protocol( "Banyan Vines Echo", "Vines Echo", "vines_echo"); proto_register_field_array(proto_vines_echo, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vines_echo(void) { dissector_handle_t vines_echo_handle; vines_echo_handle = create_dissector_handle(dissect_vines_echo, proto_vines_echo); dissector_add_uint("vines_llc.ptype", VINES_LLC_ECHO, vines_echo_handle); dissector_add_uint("ethertype", ETHERTYPE_VINES_ECHO, vines_echo_handle); } static const value_string pkttype_vals[] = { { PKTTYPE_DGRAM, "Datagram" }, { PKTTYPE_DATA, "Data" }, { PKTTYPE_ERR, "Error" }, { PKTTYPE_DISC, "Disconnect" }, { PKTTYPE_PROBE, "Probe" }, { PKTTYPE_ACK, "Ack" }, { 0, NULL } }; static heur_dissector_list_t vines_ipc_heur_subdissector_list; static const value_string vipc_err_vals[] = { { 151, "Bad socket descriptor" }, { 152, "Address already in use" }, { 153, "Invalid operation" }, { 154, "User address parameter fault" }, { 155, "Net/host unreachable" }, { 156, "Message overflow error" }, { 157, "Destination socket does not exist" }, { 158, "Address family does not exist" }, { 159, "Socket type does not exist" }, { 160, "Protocol does not exist" }, { 161, "No more sockets available" }, { 162, "No buffer space available" }, { 163, "Timeout event" }, { 164, "Operation not supported" }, { 165, "Resource not available" }, { 166, "Internal communication service failure" }, { 167, "Controller reset failure" }, { 0, NULL } }; static const true_false_string tfs_vine_ipc_send_not_send = { "Send", "Do not Send" }; static const true_false_string tfs_vine_ipc_abort_not_abort = { "Abort", "Do not abort" }; static int dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; e_vipc viph; proto_tree *vipc_tree = NULL, *control_tree; proto_item *ti; tvbuff_t *next_tvb; heur_dtbl_entry_t *hdtbl_entry; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VIPC"); col_clear(pinfo->cinfo, COL_INFO); /* To do: check for runts, errs, etc. */ /* Avoids alignment problems on many architectures. */ tvb_memcpy(tvb, (guint8 *)&viph, offset, sizeof(e_vipc)); viph.vipc_sport = g_ntohs(viph.vipc_sport); viph.vipc_dport = g_ntohs(viph.vipc_dport); viph.vipc_lclid = g_ntohs(viph.vipc_lclid); viph.vipc_rmtid = g_ntohs(viph.vipc_rmtid); viph.vipc_seqno = g_ntohs(viph.vipc_seqno); viph.vipc_ack = g_ntohs(viph.vipc_ack); viph.vipc_err_len = g_ntohs(viph.vipc_err_len); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines IPC"); switch (viph.vipc_pkttype) { case PKTTYPE_DGRAM: col_add_fstr(pinfo->cinfo, COL_INFO, "%s D=%04x S=%04x", val_to_str(viph.vipc_pkttype, pkttype_vals, "Unknown packet type (0x%02x)"), viph.vipc_dport, viph.vipc_sport); break; case PKTTYPE_ERR: col_add_fstr(pinfo->cinfo, COL_INFO, "%s NS=%u NR=%u Err=%s RID=%04x LID=%04x D=%04x S=%04x", val_to_str(viph.vipc_pkttype, pkttype_vals, "Unknown packet type (0x%02x)"), viph.vipc_seqno, viph.vipc_ack, val_to_str(viph.vipc_err_len, vipc_err_vals, "Unknown (%u)"), viph.vipc_rmtid, viph.vipc_lclid, viph.vipc_dport, viph.vipc_sport); break; default: col_add_fstr(pinfo->cinfo, COL_INFO, "%s NS=%u NR=%u Len=%u RID=%04x LID=%04x D=%04x S=%04x", val_to_str(viph.vipc_pkttype, pkttype_vals, "Unknown packet type (0x%02x)"), viph.vipc_seqno, viph.vipc_ack, viph.vipc_err_len, viph.vipc_rmtid, viph.vipc_lclid, viph.vipc_dport, viph.vipc_sport); break; } ti = proto_tree_add_item(tree, proto_vines_ipc, tvb, offset, sizeof(viph), ENC_NA); vipc_tree = proto_item_add_subtree(ti, ett_vines_ipc); proto_tree_add_item(vipc_tree, hf_vines_ipc_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vipc_tree, hf_vines_ipc_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vipc_tree, hf_vines_ipc_packet_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (viph.vipc_pkttype != PKTTYPE_DGRAM) { ti = proto_tree_add_item(vipc_tree, hf_vines_ipc_control, tvb, offset, 1, ENC_BIG_ENDIAN); control_tree = proto_item_add_subtree(ti, ett_vines_ipc_control); /* * XXX - do reassembly based on BOM/EOM bits. */ proto_tree_add_item(control_tree, hf_vines_ipc_control_ack, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_ipc_control_end_msg, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_ipc_control_beg_msg, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_ipc_control_abort_msg, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; if (viph.vipc_pkttype != PKTTYPE_DGRAM) { proto_tree_add_item(vipc_tree, hf_vines_ipc_local_connection_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vipc_tree, hf_vines_ipc_remote_connection_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vipc_tree, hf_vines_ipc_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vipc_tree, hf_vines_ipc_ack_number, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (viph.vipc_pkttype == PKTTYPE_ERR) { proto_tree_add_item(vipc_tree, hf_vines_ipc_error, tvb, offset, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(vipc_tree, hf_vines_ipc_length, tvb, offset, 2, ENC_BIG_ENDIAN); } offset += 2; } /* * For data packets, try the heuristic dissectors for Vines SPP; * if none of them accept the packet, or if it's not a data packet, * dissect it as data. */ next_tvb = tvb_new_subset_remaining(tvb, offset); if (viph.vipc_pkttype != PKTTYPE_DATA || !dissector_try_heuristic(vines_ipc_heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_vines_ipc(void) { static hf_register_info hf[] = { { &hf_vines_ipc_src_port, { "Source port", "vines_ipc.src_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_dest_port, { "Destination port", "vines_ipc.dest_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_packet_type, { "Packet type", "vines_ipc.packet_type", FT_UINT8, BASE_HEX, VALS(pkttype_vals), 0x0, NULL, HFILL }}, { &hf_vines_ipc_control, { "Control", "vines_ipc.control", FT_UINT8, BASE_HEX, VALS(pkttype_vals), 0x0, NULL, HFILL }}, { &hf_vines_ipc_control_ack, { "Immediate acknowledgment", "vines_ipc.control.ack", FT_BOOLEAN, 8, TFS(&tfs_vine_ipc_send_not_send), 0x80, NULL, HFILL }}, { &hf_vines_ipc_control_end_msg, { "End of message", "vines_ipc.control.end_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }}, { &hf_vines_ipc_control_beg_msg, { "Beginning of message", "vines_ipc.control.beg_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }}, { &hf_vines_ipc_control_abort_msg, { "Current message", "vines_ipc.control.abort_msg", FT_BOOLEAN, 8, TFS(&tfs_vine_ipc_abort_not_abort), 0x10, NULL, HFILL }}, { &hf_vines_ipc_local_connection_id, { "Local Connection ID", "vines_ipc.local_connection_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_remote_connection_id, { "Remote Connection ID", "vines_ipc.remote_connection_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_sequence_number, { "Sequence number", "vines_ipc.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_ack_number, { "Ack number", "vines_ipc.ack_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_ipc_error, { "Error", "vines_ipc.error", FT_UINT16, BASE_DEC, VALS(vipc_err_vals), 0x0, NULL, HFILL }}, { &hf_vines_ipc_length, { "Length", "vines_ipc.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_ipc, &ett_vines_ipc_control, }; proto_vines_ipc = proto_register_protocol("Banyan Vines IPC", "Vines IPC", "vines_ipc"); proto_register_field_array(proto_vines_ipc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vines_ipc_heur_subdissector_list = register_heur_dissector_list("vines_ipc", proto_vines_ipc); } void proto_reg_handoff_vines_ipc(void) { dissector_handle_t vines_ipc_handle; vines_ipc_handle = create_dissector_handle(dissect_vines_ipc, proto_vines_ipc); dissector_add_uint("vines_ip.protocol", VIP_PROTO_IPC, vines_ipc_handle); } static heur_dissector_list_t vines_spp_heur_subdissector_list; static int dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; e_vspp viph; proto_tree *vspp_tree, *control_tree; proto_item *ti; tvbuff_t *next_tvb; heur_dtbl_entry_t *hdtbl_entry; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSPP"); col_clear(pinfo->cinfo, COL_INFO); /* To do: check for runts, errs, etc. */ /* Avoids alignment problems on many architectures. */ tvb_memcpy(tvb, (guint8 *)&viph, offset, sizeof(e_vspp)); viph.vspp_sport = g_ntohs(viph.vspp_sport); viph.vspp_dport = g_ntohs(viph.vspp_dport); viph.vspp_lclid = g_ntohs(viph.vspp_lclid); viph.vspp_rmtid = g_ntohs(viph.vspp_rmtid); viph.vspp_seqno = g_ntohs(viph.vspp_seqno); viph.vspp_ack = g_ntohs(viph.vspp_ack); viph.vspp_win = g_ntohs(viph.vspp_win); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SPP"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s NS=%u NR=%u Window=%u RID=%04x LID=%04x D=%04x S=%04x", val_to_str(viph.vspp_pkttype, pkttype_vals, "Unknown packet type (0x%02x)"), viph.vspp_seqno, viph.vspp_ack, viph.vspp_win, viph.vspp_rmtid, viph.vspp_lclid, viph.vspp_dport, viph.vspp_sport); if (tree) { ti = proto_tree_add_item(tree, proto_vines_spp, tvb, offset, sizeof(viph), ENC_NA); vspp_tree = proto_item_add_subtree(ti, ett_vines_spp); proto_tree_add_item(vspp_tree, hf_vines_spp_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_dest_port, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_packet_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); ti = proto_tree_add_item(vspp_tree, hf_vines_spp_control, tvb, offset+5, 1, ENC_BIG_ENDIAN); control_tree = proto_item_add_subtree(ti, ett_vines_spp_control); /* * XXX - do reassembly based on BOM/EOM bits. */ proto_tree_add_item(control_tree, hf_vines_spp_control_ack, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_spp_control_end_msg, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_spp_control_beg_msg, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(control_tree, hf_vines_spp_control_abort_msg, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_local_id, tvb, offset+6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_remote_id, tvb, offset+8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_seq_num, tvb, offset+10, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_ack_num, tvb, offset+12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(vspp_tree, hf_vines_spp_window, tvb, offset+14, 2, ENC_BIG_ENDIAN); } else { offset += 16; /* sizeof SPP */ } /* * For data packets, try the heuristic dissectors for Vines SPP; * if none of them accept the packet, or if it's not a data packet, * dissect it as data. */ next_tvb = tvb_new_subset_remaining(tvb, offset); if (viph.vspp_pkttype != PKTTYPE_DATA || !dissector_try_heuristic(vines_spp_heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) call_data_dissector(next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_vines_spp(void) { static hf_register_info hf[] = { { &hf_vines_spp_src_port, { "Source port", "vines_spp.src_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_dest_port, { "Destination port", "vines_spp.dest_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_packet_type, { "Packet type", "vines_spp.packet_type", FT_UINT8, BASE_HEX, VALS(pkttype_vals), 0x0, NULL, HFILL }}, { &hf_vines_spp_control, { "Control", "vines_spp.control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_control_ack, { "Immediate acknowledgment", "vines_spp.control.ack", FT_BOOLEAN, 8, TFS(&tfs_vine_ipc_send_not_send), 0x80, NULL, HFILL }}, { &hf_vines_spp_control_end_msg, { "End of message", "vines_spp.control.end_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }}, { &hf_vines_spp_control_beg_msg, { "Beginning of message", "vines_spp.control.beg_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }}, { &hf_vines_spp_control_abort_msg, { "Current message", "vines_spp.control.abort_msg", FT_BOOLEAN, 8, TFS(&tfs_vine_ipc_abort_not_abort), 0x10, NULL, HFILL }}, { &hf_vines_spp_local_id, { "Local Connection ID", "vines_spp.local_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_remote_id, { "Remote Connection ID", "vines_spp.remote_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_seq_num, { "Sequence number", "vines_spp.seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_ack_num, { "Ack number", "vines_spp.ack_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_spp_window, { "Window", "vines_spp.window", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_vines_spp, &ett_vines_spp_control, }; proto_vines_spp = proto_register_protocol("Banyan Vines SPP", "Vines SPP", "vines_spp"); proto_register_field_array(proto_vines_spp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vines_spp_heur_subdissector_list = register_heur_dissector_list("vines_spp", proto_vines_spp); } void proto_reg_handoff_vines_spp(void) { dissector_handle_t vines_spp_handle; vines_spp_handle = create_dissector_handle(dissect_vines_spp, proto_vines_spp); dissector_add_uint("vines_ip.protocol", VIP_PROTO_SPP, vines_spp_handle); } #define VINES_VERS_PRE_5_5 0x00 #define VINES_VERS_5_5 0x01 static const value_string vines_version_vals[] = { { VINES_VERS_PRE_5_5, "Pre-5.50" }, { VINES_VERS_5_5, "5.50" }, { 0, NULL } }; #define VARP_QUERY_REQ 0x00 #define VARP_SERVICE_RESP 0x01 #define VARP_ASSIGNMENT_REQ 0x02 #define VARP_ASSIGNMENT_RESP 0x03 static const value_string vines_arp_packet_type_vals[] = { { VARP_QUERY_REQ, "Query request" }, { VARP_SERVICE_RESP, "Service response" }, { VARP_ASSIGNMENT_REQ, "Assignment request" }, { VARP_ASSIGNMENT_RESP, "Assignment response" }, { 0, NULL } }; static int dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *vines_arp_tree; proto_item *ti; guint8 version; guint16 packet_type; guint16 metric; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines ARP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vines_arp, tvb, 0, -1, ENC_NA); vines_arp_tree = proto_item_add_subtree(ti, ett_vines_arp); version = tvb_get_guint8(tvb, 0); proto_tree_add_item(vines_arp_tree, hf_vines_arp_version, tvb, 0, 1, ENC_NA); if (version == VINES_VERS_5_5) { /* * Sequenced ARP. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SARP"); packet_type = tvb_get_guint8(tvb, 1); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, vines_arp_packet_type_vals, "Unknown (0x%02x)")); proto_tree_add_item(vines_arp_tree, hf_vines_arp_packet_type, tvb, 1, 1, ENC_NA); if (packet_type == VARP_ASSIGNMENT_RESP) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Address = %s", tvb_address_to_str(pinfo->pool, tvb, AT_VINES, 2)); proto_tree_add_item(vines_arp_tree, hf_vines_arp_address, tvb, 2, VINES_ADDR_LEN, ENC_NA); } proto_tree_add_item(vines_arp_tree, hf_vines_arp_sequence_number, tvb, 2+VINES_ADDR_LEN, 4, ENC_BIG_ENDIAN); metric = tvb_get_ntohs(tvb, 2+VINES_ADDR_LEN+4); proto_tree_add_uint_format_value(vines_arp_tree, hf_vines_arp_interface_metric, tvb, 2+VINES_ADDR_LEN+4, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); } else { /* * Non-sequenced ARP. */ packet_type = (guint8) tvb_get_ntohs(tvb, 0); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, vines_arp_packet_type_vals, "Unknown (0x%02x)")); proto_tree_add_item(vines_arp_tree, hf_vines_arp_packet_type, tvb, 0, 2, ENC_BIG_ENDIAN); if (packet_type == VARP_ASSIGNMENT_RESP) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Address = %s", tvb_address_to_str(pinfo->pool, tvb, AT_VINES, 2)); proto_tree_add_item(vines_arp_tree, hf_vines_arp_address, tvb, 2, VINES_ADDR_LEN, ENC_NA); } } return tvb_captured_length(tvb); } void proto_register_vines_arp(void) { static hf_register_info hf[] = { { &hf_vines_arp_version, { "Version", "vines_arp.version", FT_UINT8, BASE_HEX, VALS(vines_version_vals), 0x0, NULL, HFILL }}, { &hf_vines_arp_packet_type, { "Packet Type", "vines_arp.packet_type", FT_UINT16, BASE_HEX, VALS(vines_arp_packet_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_arp_address, { "Address", "vines_arp.address", FT_VINES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_arp_sequence_number, { "Sequence Number", "vines_arp.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_arp_interface_metric, { "Interface Metric", "vines_arp.interface_metric", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_arp, }; proto_vines_arp = proto_register_protocol( "Banyan Vines ARP", "Vines ARP", "vines_arp"); proto_register_field_array(proto_vines_arp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vines_arp(void) { dissector_handle_t vines_arp_handle; vines_arp_handle = create_dissector_handle(dissect_vines_arp, proto_vines_arp); dissector_add_uint("vines_ip.protocol", VIP_PROTO_ARP, vines_arp_handle); } #define VRTP_OP_REQUEST 0x01 #define VRTP_OP_UPDATE_RESPONSE 0x02 #define VRTP_OP_REDIRECT 0x03 #define VRTP_OP_REINITIALIZE 0x04 #define VRTP_OP_REDIRECT2 0x06 static const value_string vines_rtp_operation_type_vals[] = { { VRTP_OP_REQUEST, "Request" }, { VRTP_OP_UPDATE_RESPONSE, "Update/response" }, { VRTP_OP_REDIRECT, "Redirect" }, { VRTP_OP_REINITIALIZE, "Reinitialize" }, { VRTP_OP_REDIRECT2, "Redirect" }, { 0, NULL } }; static const value_string vines_rtp_node_type_vals[] = { { 0x01, "Host" }, { 0x02, "Router" }, { 0, NULL } }; static const value_string vines_rtp_controller_type_vals[] = { { 0x00, "Default Card" }, { 0x01, "Multibuffer" }, { 0, NULL } }; static const value_string vines_rtp_info_type_vals[] = { { 0x00, "Update" }, { 0x01, "Update" }, { 0x02, "Response" }, { 0, NULL } }; static const true_false_string tfs_vine_auto_config_not_auto_config = { "Auto-configured", "Not an auto-configured" }; static const true_false_string tfs_vine_rtp_not_all_neighbor_all_neighbor = { "Not all neighbor routers support", "All neighbor routers support" }; static const true_false_string tfs_vine_rtp_sequenced_not_sequenced = { "Sequenced", "Not Sequenced" }; static const true_false_string tfs_part_not_part = { "Part of", "Not part of" }; static const true_false_string tfs_fast_bus_slow_bus = { "Fast bus", "Slow bus" }; static void rtp_show_machine_type(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_machine) { proto_item *ti; proto_tree *subtree; ti = proto_tree_add_item(tree, hf_machine, tvb, offset, 1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_vines_rtp_mtype); proto_tree_add_item(subtree, hf_vines_rtp_machine_rtp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_machine_tcpip, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_machine_bus, tvb, offset, 1, ENC_BIG_ENDIAN); } static void rtp_show_flags(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_flag) { proto_item *ti; proto_tree *flags_tree; ti = proto_tree_add_item(tree, hf_flag, tvb, offset, 1, ENC_NA); flags_tree = proto_item_add_subtree(ti, ett_vines_rtp_flags); proto_tree_add_item(flags_tree, hf_vines_rtp_flag_sequence_rtp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_vines_rtp_flag_network_p2p, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_vines_rtp_flag_data_link_p2p, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_vines_rtp_flag_broadcast_medium, tvb, offset, 1, ENC_BIG_ENDIAN); } static int srtp_show_machine_info(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_vines, int hf_metric, int hf_nodetype, int hf_controller_type, int hf_machine) { guint16 metric; proto_tree_add_item(tree, hf_vines, tvb, offset, VINES_ADDR_LEN, ENC_NA); offset += VINES_ADDR_LEN; metric = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(tree, hf_metric, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); offset += 2; proto_tree_add_item(tree, hf_nodetype, tvb, offset, 1, ENC_NA); offset += 1; rtp_show_machine_type(tree, tvb, offset, hf_machine); offset += 1; proto_tree_add_item(tree, hf_controller_type, tvb, offset, 1, ENC_NA); offset += 1; return offset; } static int rtp_show_gateway_info(proto_tree *tree, tvbuff_t *tvb, int offset, guint8 link_addr_length, guint8 source_route_length) { if (link_addr_length != 0) { proto_tree_add_item( tree, link_addr_length == 6 ? hf_vines_rtp_preferred_gateway_data_link_address_ether : hf_vines_rtp_preferred_gateway_data_link_address_bytes, tvb, offset, link_addr_length, ENC_NA); offset += link_addr_length; } if (source_route_length != 0) { proto_tree_add_item(tree, hf_vines_rtp_preferred_gateway_source_route, tvb, offset, source_route_length, ENC_NA); offset += source_route_length; } return offset; } static int dissect_vines_rtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_tree *vines_rtp_tree = NULL; proto_item *ti; proto_tree *subtree; guint8 operation_type; guint8 link_addr_length; guint8 source_route_length; guint16 metric; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines RTP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vines_rtp, tvb, 0, -1, ENC_NA); vines_rtp_tree = proto_item_add_subtree(ti, ett_vines_rtp); if (tvb_get_guint8(tvb, 0) != 0) { /* * Non-sequenced RTP. */ operation_type = tvb_get_guint8(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(operation_type, vines_rtp_operation_type_vals, "Unknown (0x%02x)")); if (tree) { proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_operation_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_node_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_controller_type, tvb, offset, 1, ENC_NA); offset += 1; rtp_show_machine_type(vines_rtp_tree, tvb, offset, hf_vines_rtp_machine_type); offset += 1; switch (operation_type) { case VRTP_OP_REDIRECT: case VRTP_OP_REDIRECT2: proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; link_addr_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_link_address_length, tvb, offset, 1, ENC_NA); offset += 1; source_route_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_source_route_length, tvb, offset, 1, ENC_NA); offset += 1; offset = srtp_show_machine_info(vines_rtp_tree, tvb, offset, hf_vines_rtp_destination, hf_vines_rtp_metric_to_destination, hf_vines_rtp_destination_node_type, hf_vines_rtp_destination_controller_type, hf_vines_rtp_destination_machine); offset += 1; offset = srtp_show_machine_info(vines_rtp_tree, tvb, offset, hf_vines_rtp_preferred_gateway, hf_vines_rtp_metric_to_preferred_gateway, hf_vines_rtp_preferred_gateway_node_type, hf_vines_rtp_pref_gateway_controller_type, hf_vines_rtp_pref_gateway_machine); offset += 1; rtp_show_gateway_info(vines_rtp_tree, tvb,offset, link_addr_length, source_route_length); break; default: while (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_network_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; metric = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_neighbor_metric, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); offset += 2; } break; } } } else { col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines SRTP"); proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; operation_type = tvb_get_guint8(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(operation_type, vines_rtp_operation_type_vals, "Unknown (0x%02x)")); if (tree) { proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_operation_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_node_type, tvb, offset, 1, ENC_NA); offset += 1; ti = proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_comp_flag, tvb, offset, 1, ENC_BIG_ENDIAN); subtree = proto_item_add_subtree(ti, ett_vines_rtp_compatibility_flags); proto_tree_add_item(subtree, hf_vines_rtp_comp_flag_neighbor_router, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_comp_flag_sequence_rtp, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_comp_flag_sequence_rtp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset += 1; /* reserved */ switch (operation_type) { case VRTP_OP_REQUEST: proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_requested_info, tvb, offset, 1, ENC_NA); break; case VRTP_OP_UPDATE_RESPONSE: proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_information_type, tvb, offset, 1, ENC_NA); offset += 1; ti = proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_control, tvb, offset, 1, ENC_BIG_ENDIAN); subtree = proto_item_add_subtree(ti, ett_vines_rtp_control_flags); proto_tree_add_item(subtree, hf_vines_rtp_control_sync_broadcast, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_control_topology_update, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_control_specific_request, tvb, offset, 1, ENC_BIG_ENDIAN); /* XXX - need reassembly? */ proto_tree_add_item(subtree, hf_vines_rtp_control_end_msg, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_vines_rtp_control_beg_msg, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_packet_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_data_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_router_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; metric = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_metric, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); offset += 2; while (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_network_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; metric = tvb_get_ntohs(tvb, offset); if (metric == 0xffff) { proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_neighbor_metric, tvb, offset, 2, 0xffff, "Unreachable"); } else { proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_neighbor_metric, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); } offset += 2; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; rtp_show_flags(vines_rtp_tree, tvb, offset, hf_vines_rtp_network_flags); offset += 1; offset += 1; /* reserved */ } break; case VRTP_OP_REDIRECT: link_addr_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_link_address_length, tvb, offset, 1, ENC_NA); offset += 1; source_route_length = tvb_get_guint8(tvb, offset); proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_source_route_length, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_destination, tvb, offset, VINES_ADDR_LEN, ENC_NA); offset += VINES_ADDR_LEN; metric = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_metric_to_destination, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); offset += 2; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_destination_node_type, tvb, offset, 1, ENC_NA); offset += 1; rtp_show_flags(vines_rtp_tree, tvb, offset, hf_vines_rtp_destination_flags); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_destination_sequence_number, tvb, ENC_BIG_ENDIAN, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_preferred_gateway, tvb, offset, VINES_ADDR_LEN, ENC_NA); offset += VINES_ADDR_LEN; metric = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format_value(vines_rtp_tree, hf_vines_rtp_metric_to_preferred_gateway, tvb, offset, 2, metric, "%u ticks (%g seconds)", metric, metric*.2); offset += 2; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_preferred_gateway_node_type, tvb, offset, 1, ENC_NA); offset += 1; rtp_show_flags(vines_rtp_tree, tvb, offset, hf_vines_rtp_preferred_gateway_flags); offset += 1; proto_tree_add_item(vines_rtp_tree, hf_vines_rtp_preferred_gateway_sequence_number, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; rtp_show_gateway_info(vines_rtp_tree, tvb,offset, link_addr_length, source_route_length); break; case VRTP_OP_REINITIALIZE: break; } } } return tvb_captured_length(tvb); } void proto_register_vines_rtp(void) { static hf_register_info hf[] = { { &hf_vines_rtp_comp_flag, { "Compatibility Flags", "vines_rtp.comp_flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_comp_flag_neighbor_router, { "non-Vines-reachable neighbor router", "vines_rtp.comp_flag.neighbor_router", FT_BOOLEAN, 8, TFS(&tfs_vine_auto_config_not_auto_config), 0x04, NULL, HFILL }}, { &hf_vines_rtp_comp_flag_sequence_rtp, { "Sequenced RTP", "vines_rtp.comp_flag.sequence_rtp", FT_BOOLEAN, 8, TFS(&tfs_vine_rtp_not_all_neighbor_all_neighbor), 0x02, NULL, HFILL }}, { &hf_vines_rtp_comp_flag_sequence_rtp_version, { "RTP version mismatch", "vines_rtp.comp_flag.rtp_version", FT_BOOLEAN, 8, TFS(&tfs_vine_rtp_sequenced_not_sequenced), 0x01, NULL, HFILL }}, { &hf_vines_rtp_control, { "Control Flags", "vines_rtp.control", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_control_sync_broadcast, { "Routing table synchronization broadcast", "vines_rtp.control.sync_broadcast", FT_BOOLEAN, 8, TFS(&tfs_part_not_part), 0x10, NULL, HFILL }}, { &hf_vines_rtp_control_topology_update, { "Full topology update", "vines_rtp.control.topology_update", FT_BOOLEAN, 8, TFS(&tfs_part_not_part), 0x08, NULL, HFILL }}, { &hf_vines_rtp_control_specific_request, { "Contains info specifically requested", "vines_rtp.control.specific_request", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }}, { &hf_vines_rtp_control_end_msg, { "End of message", "vines_rtp.control.end_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, { &hf_vines_rtp_control_beg_msg, { "Beginning of message", "vines_rtp.control.beg_msg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, { &hf_vines_rtp_machine_rtp, { "Sequenced RTP", "vines_rtp.machine.rtp", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }}, { &hf_vines_rtp_machine_tcpip, { "TCP/IP", "vines_rtp.machine.tcpip", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }}, { &hf_vines_rtp_machine_bus, { "Bus", "vines_rtp.machine.bus", FT_BOOLEAN, 8, TFS(&tfs_fast_bus_slow_bus), 0x01, NULL, HFILL }}, { &hf_vines_rtp_flag_sequence_rtp, { "Network supports Sequenced RTP", "vines_rtp.flag.sequence_rtp", FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x08, NULL, HFILL }}, { &hf_vines_rtp_flag_network_p2p, { "Network accessed point-to-point on non-Vines network", "vines_rtp.flag.network_p2p", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }}, { &hf_vines_rtp_flag_data_link_p2p, { "Data link to network uses point-to-point connection", "vines_rtp.flag.data_link_p2p", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, { &hf_vines_rtp_flag_broadcast_medium, { "Network accessed across broadcast medium", "vines_rtp.flag.broadcast_medium", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, { &hf_vines_rtp_operation_type, { "Operation Type", "vines_rtp.operation_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_operation_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_node_type, { "Node Type", "vines_rtp.node_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_node_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_controller_type, { "Controller Type", "vines_rtp.controller_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_controller_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_version, { "Version", "vines_rtp.version", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_link_address_length, { "Link Address Length", "vines_rtp.link_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_source_route_length, { "Source Route Length", "vines_rtp.source_route_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_network_number, { "Network Number", "vines_rtp.network_number", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_neighbor_metric, { "Neighbor Metric", "vines_rtp.neighbor_metric", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_requested_info, { "Requested Info", "vines_rtp.requested_info", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_information_type, { "Information Type", "vines_rtp.information_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_info_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_packet_id, { "Packet ID", "vines_rtp.packet_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_data_offset, { "Data Offset", "vines_rtp.data_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_router_sequence_number, { "Router Sequence Number", "vines_rtp.router_sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_metric, { "Metric", "vines_rtp.metric", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_sequence_number, { "Sequence Number", "vines_rtp.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination, { "Destination", "vines_rtp.destination", FT_VINES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_metric_to_destination, { "Metric to Destination", "vines_rtp.metric_to_destination", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination_node_type, { "Destination Node Type", "vines_rtp.destination_node_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_node_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination_sequence_number, { "Destination Sequence Number", "vines_rtp.destination_sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway, { "Preferred Gateway", "vines_rtp.preferred_gateway", FT_VINES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_metric_to_preferred_gateway, { "Metric to Preferred Gateway", "vines_rtp.metric_to_preferred_gateway", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_node_type, { "Preferred Gateway Node Type", "vines_rtp.preferred_gateway_node_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_node_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_sequence_number, { "Preferred Gateway Sequence Number", "vines_rtp.preferred_gateway_sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_machine_type, { "Machine Type", "vines_rtp.machine_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination_machine, { "Destination Machine Type", "vines_rtp.destination_machine_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_pref_gateway_machine, { "Preferred Gateway Machine Type", "vines_rtp.preferred_gateway_machine_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination_controller_type, { "Destination Controller Type", "vines_rtp.destination_controller_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_controller_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_pref_gateway_controller_type, { "Preferred Gateway Controller Type", "vines_rtp.preferred_gateway_controller_type", FT_UINT8, BASE_HEX, VALS(vines_rtp_controller_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_rtp_network_flags, { "Network Flags", "vines_rtp.network_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_destination_flags, { "Destination Flags", "vines_rtp.destination_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_flags, { "Preferred Gateway Flags", "vines_rtp.preferred_gateway_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_data_link_address_ether, { "Preferred Gateway Data Link Address", "vines_rtp.preferred_gateway_data_link_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_data_link_address_bytes, { "Preferred Gateway Data Link Address", "vines_rtp.preferred_gateway_data_link_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vines_rtp_preferred_gateway_source_route, { "Preferred Gateway Source Route", "vines_rtp.preferred_gateway_source_route", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_rtp, &ett_vines_rtp_compatibility_flags, &ett_vines_rtp_req_info, &ett_vines_rtp_control_flags, &ett_vines_rtp_mtype, &ett_vines_rtp_flags, }; proto_vines_rtp = proto_register_protocol( "Banyan Vines RTP", "Vines RTP", "vines_rtp"); proto_register_field_array(proto_vines_rtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vines_rtp(void) { dissector_handle_t vines_rtp_handle; vines_rtp_handle = create_dissector_handle(dissect_vines_rtp, proto_vines_rtp); dissector_add_uint("vines_ip.protocol", VIP_PROTO_RTP, vines_rtp_handle); } #define VICP_EXCEPTION_NOTIFICATION 0x0000 #define VICP_METRIC_NOTIFICATION 0x0001 static const value_string vines_icp_packet_type_vals[] = { { VICP_EXCEPTION_NOTIFICATION, "Exception notification" }, { VICP_METRIC_NOTIFICATION, "Metric notification" }, { 0, NULL } }; static int dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_tree *vines_icp_tree; proto_item *ti; guint16 packet_type; guint16 exception_code; guint16 metric; gboolean save_in_error_pkt; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vines ICP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vines_icp, tvb, 0, -1, ENC_NA); vines_icp_tree = proto_item_add_subtree(ti, ett_vines_icp); packet_type = tvb_get_ntohs(tvb, offset); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(packet_type, vines_icp_packet_type_vals, "Unknown (0x%02x)")); proto_tree_add_item(vines_icp_tree, hf_vines_icp_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (packet_type) { case VICP_EXCEPTION_NOTIFICATION: exception_code = tvb_get_ntohs(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(exception_code, vipc_err_vals, "Unknown exception code (%u)")); proto_tree_add_item(vines_icp_tree, hf_vines_icp_exception_code, tvb, offset, 2, ENC_BIG_ENDIAN); break; case VICP_METRIC_NOTIFICATION: metric = tvb_get_ntohs(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", metric %u", metric); proto_tree_add_item(vines_icp_tree, hf_vines_icp_metric, tvb, offset, 2, ENC_BIG_ENDIAN); break; } offset += 2; /* * Save the current value of the "we're inside an error packet" * flag, and set that flag; subdissectors may treat packets * that are the payload of error packets differently from * "real" packets. */ save_in_error_pkt = pinfo->flags.in_error_pkt; pinfo->flags.in_error_pkt = TRUE; /* Decode the first 40 bytes of the original VIP datagram. */ next_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(vines_ip_handle, next_tvb, pinfo, vines_icp_tree); /* Restore the "we're inside an error packet" flag. */ pinfo->flags.in_error_pkt = save_in_error_pkt; return tvb_captured_length(tvb); } void proto_register_vines_icp(void) { static hf_register_info hf[] = { { &hf_vines_icp_packet_type, { "Packet Type", "vines_icp.packet_type", FT_UINT16, BASE_HEX, VALS(vines_icp_packet_type_vals), 0x0, NULL, HFILL }}, { &hf_vines_icp_exception_code, { "Exception Code", "vines_icp.exception_code", FT_UINT16, BASE_DEC, VALS(vipc_err_vals), 0x0, NULL, HFILL }}, { &hf_vines_icp_metric, { "Metric", "vines_icp.metric", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vines_icp, }; proto_vines_icp = proto_register_protocol( "Banyan Vines ICP", "Vines ICP", "vines_icp"); /* Placeholder for capture statistics */ proto_vines = proto_register_protocol("VINES", "VINES", "vines"); proto_register_field_array(proto_vines_icp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vines_icp(void) { dissector_handle_t vines_icp_handle; capture_dissector_handle_t vines_echo_cap_handle; capture_dissector_handle_t vines_ip_cap_handle; vines_icp_handle = create_dissector_handle(dissect_vines_icp, proto_vines_icp); dissector_add_uint("vines_ip.protocol", VIP_PROTO_ICP, vines_icp_handle); vines_ip_cap_handle = create_capture_dissector_handle(capture_vines, proto_vines_ip); capture_dissector_add_uint("ethertype", ETHERTYPE_VINES_IP, vines_ip_cap_handle); vines_echo_cap_handle = create_capture_dissector_handle(capture_vines, proto_vines_echo); capture_dissector_add_uint("ethertype", ETHERTYPE_VINES_ECHO, vines_echo_cap_handle); capture_dissector_add_uint("ppp_hdlc", PPP_VINES, vines_echo_cap_handle); capture_dissector_add_uint("ip.proto", PPP_VINES, vines_echo_cap_handle); capture_dissector_add_uint("llc.dsap", SAP_VINES1, vines_echo_cap_handle); capture_dissector_add_uint("llc.dsap", SAP_VINES2, vines_echo_cap_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-vj-comp.c
/* packet-vj-comp.c * Routines for decompression of PPP Van Jacobson compression * RFC 1144 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * * SPDX-License-Identifier: GPL-2.0-or-later */ /* The routines in this file were created by reading the description of * RFC 1144 available here: ftp://ftp.rfc-editor.org/in-notes/rfc1144.pdf * ONLY the description of the protocol in section 3.2 was used. * Notably, the sample implementation in Appendix A was NOT read by this file's * author, due to the questionable legality of using it in Wireshark. * For details on this issue, see: * https://gitlab.com/wireshark/wireshark/-/issues/12138 */ /* Currently hard-coded to assume TCP over IPv4. * Nothing in the standard explicitly prevents an IPv6 implementation... */ #include "config.h" #include <glib.h> #include <epan/tvbuff.h> #include <epan/conversation.h> #include <epan/in_cksum.h> #include <epan/proto.h> #include <epan/expert.h> #include <epan/packet.h> #include <epan/ipproto.h> #include <epan/ppptypes.h> #include <wsutil/str_util.h> #include "packet-ip.h" #include "packet-ppp.h" /* Shorthand macros for reading/writing 16/32 bit values from * possibly-unaligned indexes into a guint8[] */ #define GET_16(p,i) (guint16)(((p)[(i)] << 8) | ((p)[(i)+1])) #define GET_32(p,i) (guint32)(((p)[(i)] << 24) | ((p)[(i)+1] << 16) | ((p)[(i)+2] << 8) | ((p)[(i)+3])) #define PUT_16(p,i,v) G_STMT_START { \ (p)[(i)] = ((v) & 0xFF00) >> 8; \ (p)[(i)+1] = ((v) & 0x00FF); \ } G_STMT_END #define PUT_32(p,i,v) G_STMT_START { \ (p)[(i)] = ((v) & 0xFF000000) >> 24; \ (p)[(i)+1] = ((v) & 0x00FF0000) >> 16; \ (p)[(i)+2] = ((v) & 0x0000FF00) >> 8; \ (p)[(i)+3] = ((v) & 0x000000FF); \ } G_STMT_END /* Store the last connection number we've seen. * Only used on the first pass, in case the connection number itself * gets compressed out. */ #define CNUM_INVALID G_MAXUINT16 static guint16 last_cnum = CNUM_INVALID; /* Location in an IPv4 packet of the IP Next Protocol field * (which VJC replaces with the connection ID in uncompressed packets) */ #define VJC_CONNID_OFFSET 9 /* Minimum TCP header length. We get compression data from the TCP header, * and also store it for future use. */ #define VJC_TCP_HDR_LEN 20 /* Structure for tracking the changeable parts of a packet header */ typedef struct vjc_hdr_s { guint16 tcp_chksum; guint16 urg; guint16 win; guint32 seq; guint32 ack; guint32 ip_id; gboolean psh; } vjc_hdr_t; /* The structure used in a wireshark "conversation" */ typedef struct vjc_conv_s { guint32 last_frame; // On first pass, where to get the previous info guint32 last_frame_len; // On first pass, length of prev. frame (for SAWU/SWU) guint8 *frame_headers; // Full copy of the IP header guint8 header_len; // Length of the stored IP header wmem_map_t *vals; // Hash of frame_number => vjc_hdr_t* } vjc_conv_t; static dissector_handle_t ip_handle; void proto_register_vjc(void); void proto_reg_handoff_vjc(void); static int proto_vjc = -1; static gint ett_vjc = -1; static gint ett_vjc_change_mask = -1; static expert_field ei_vjc_sawu = EI_INIT; static expert_field ei_vjc_swu = EI_INIT; static expert_field ei_vjc_no_cnum = EI_INIT; static expert_field ei_vjc_no_conversation = EI_INIT; static expert_field ei_vjc_no_direction = EI_INIT; static expert_field ei_vjc_no_conv_data = EI_INIT; static expert_field ei_vjc_undecoded = EI_INIT; static expert_field ei_vjc_bad_data = EI_INIT; static expert_field ei_vjc_error = EI_INIT; #define VJC_FLAG_R 0x80 #define VJC_FLAG_C 0x40 #define VJC_FLAG_I 0x20 #define VJC_FLAG_P 0x10 #define VJC_FLAG_S 0x08 #define VJC_FLAG_A 0x04 #define VJC_FLAG_W 0x02 #define VJC_FLAG_U 0x01 #define VJC_FLAGS_SAWU 0x0F #define VJC_FLAGS_SWU 0x0B static int hf_vjc_comp = -1; static int hf_vjc_cnum = -1; static int hf_vjc_change_mask = -1; static int hf_vjc_change_mask_r = -1; static int hf_vjc_change_mask_c = -1; static int hf_vjc_change_mask_i = -1; static int hf_vjc_change_mask_p = -1; static int hf_vjc_change_mask_s = -1; static int hf_vjc_change_mask_a = -1; static int hf_vjc_change_mask_w = -1; static int hf_vjc_change_mask_u = -1; static int hf_vjc_chksum = -1; static int hf_vjc_urg = -1; static int hf_vjc_d_win = -1; static int hf_vjc_d_ack = -1; static int hf_vjc_d_seq = -1; static int hf_vjc_d_ipid = -1; static int hf_vjc_tcpdata = -1; static int * const vjc_change_mask_fields[] = { &hf_vjc_change_mask_r, &hf_vjc_change_mask_c, &hf_vjc_change_mask_i, &hf_vjc_change_mask_p, &hf_vjc_change_mask_s, &hf_vjc_change_mask_a, &hf_vjc_change_mask_w, &hf_vjc_change_mask_u, NULL }; /* Initialization routine. Called at start of dissection. * Registered in proto_register_vjc() below. */ static void vjc_init_protocol(void) { last_cnum = CNUM_INVALID; } /* Cleanup routine. Called at close of file. * Registered in proto_register_vjc() below. */ static void vjc_cleanup_protocol(void) { last_cnum = CNUM_INVALID; } /* Find (or optionally create) a VJC conversation. */ static conversation_t * vjc_find_conversation(packet_info *pinfo, guint32 vjc_cnum, gboolean create) { /* PPP gives us almost nothing to hook a conversation on; just whether * the packet is considered to be P2P_DIR_RECV or P2P_DIR_SENT. * Ideally we should also be distinguishing conversations based on the * capture interface, VLAN ID, MPLS tags, etc., etc. but that's beyond * the scope of this dissector, and a perennial problem in Wireshark anyway. * See <https://gitlab.com/wireshark/wireshark/-/issues/4561> */ conversation_t *conv = (conversation_t *)NULL; switch (pinfo->p2p_dir) { case P2P_DIR_RECV: vjc_cnum |= 0x0100; break; case P2P_DIR_SENT: vjc_cnum |= 0x0200; break; default: return conv; } conv = find_conversation_by_id(pinfo->num, CONVERSATION_NONE, vjc_cnum); if (!conv && create) { conv = conversation_new_by_id(pinfo->num, CONVERSATION_NONE, vjc_cnum); } return conv; } /* RFC 1144 section 3.2.2 says that "deltas" are sent for many values in the * header. If the initial byte is 0, that means the following 2 bytes are the * 16-bit value of the delta. Otherwise, the initial byte is the 8-bit value. */ static guint32 vjc_delta_uint(proto_tree *tree, int hf, tvbuff_t *tvb, guint *offset) { guint32 ret_val; if (0 != tvb_get_guint8(tvb, *offset)) { proto_tree_add_item_ret_uint(tree, hf, tvb, *offset, 1, ENC_BIG_ENDIAN, &ret_val); (*offset)++; } else { (*offset)++; proto_tree_add_item_ret_uint(tree, hf, tvb, *offset, 2, ENC_BIG_ENDIAN, &ret_val); *offset += 2; } return ret_val; } /* Same thing but signed, since the TCP window delta can be negative */ static gint32 vjc_delta_int(proto_tree *tree, int hf, tvbuff_t *tvb, guint *offset) { gint32 ret_val; if (0 != tvb_get_gint8(tvb, *offset)) { proto_tree_add_item_ret_int(tree, hf, tvb, *offset, 1, ENC_BIG_ENDIAN, &ret_val); (*offset)++; } else { (*offset)++; proto_tree_add_item_ret_int(tree, hf, tvb, *offset, 2, ENC_BIG_ENDIAN, &ret_val); *offset += 2; } return ret_val; } /* Main dissection routine for uncompressed VJC packets. * Registered in proto_reg_handoff_vjc() below. */ static int dissect_vjc_uncomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { /* A Van Jacobson uncompressed packet contains a standard TCP/IP header, with * the IP next protocol ID replaced with the connection number. * It's meant to signify a new TCP connection, or refresh an existing one, * which will have subsequent compressed packets. */ proto_tree *subtree = NULL; proto_item *ti = NULL; guint8 ip_ver = 0; guint8 ip_len = 0; guint tcp_len = 0; guint32 vjc_cnum = 0; tvbuff_t *tcpip_tvb = NULL; tvbuff_t *sub_tvb = NULL; conversation_t *conv = NULL; vjc_hdr_t *this_hdr = NULL; vjc_conv_t *pkt_data = NULL; guint8 *pdata = NULL; static guint8 real_proto = IP_PROTO_TCP; ti = proto_tree_add_item(tree, proto_vjc, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_vjc); proto_item_set_text(subtree, "PPP Van Jacobson uncompressed TCP/IP"); /* Start with some sanity checks */ if (VJC_CONNID_OFFSET+1 > tvb_captured_length(tvb)) { proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_bad_data, tvb, 0, -1, "Packet truncated before Connection ID field"); return tvb_captured_length(tvb); } ip_ver = (tvb_get_guint8(tvb, 0) & 0xF0) >> 4; ip_len = (tvb_get_guint8(tvb, 0) & 0x0F) << 2; tcp_len = ip_len + VJC_TCP_HDR_LEN; if (4 != ip_ver) { proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_bad_data, tvb, 0, 1, "IPv%d unsupported for VJC compression", ip_ver); return tvb_captured_length(tvb); } /* So far so good, continue the dissection */ ti = proto_tree_add_boolean(subtree, hf_vjc_comp, tvb, 0, 0, FALSE); proto_item_set_generated(ti); proto_tree_add_item_ret_uint(subtree, hf_vjc_cnum, tvb, VJC_CONNID_OFFSET, 1, ENC_BIG_ENDIAN, &vjc_cnum); /* Build a composite TVB containing the original TCP/IP data. * This is easy for uncompressed VJC packets because only one byte * is different from the on-the-wire data. */ sub_tvb = tvb_new_child_real_data(tvb, &real_proto, 1, 1); tvb_set_free_cb(sub_tvb, NULL); tcpip_tvb = tvb_new_composite(); tvb_composite_append(tcpip_tvb, tvb_new_subset_length(tvb, 0, VJC_CONNID_OFFSET)); tvb_composite_append(tcpip_tvb, sub_tvb); if (0 < tvb_captured_length_remaining(tvb, VJC_CONNID_OFFSET+1)) { tvb_composite_append(tcpip_tvb, tvb_new_subset_length(tvb, VJC_CONNID_OFFSET+1, -1)); } tvb_composite_finalize(tcpip_tvb); add_new_data_source(pinfo, tcpip_tvb, "Original TCP/IP data"); if (!(pinfo->p2p_dir == P2P_DIR_RECV || pinfo->p2p_dir == P2P_DIR_SENT)) { /* We can't make a proper conversation if we don't know the endpoints */ proto_tree_add_expert(subtree, pinfo, &ei_vjc_no_direction, tvb, 0, 0); } else if (tcp_len > tvb_captured_length(tvb)) { /* Not enough data. We can still pass this packet onward (though probably * to no benefit), but can't base future decompression off of it. */ proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_bad_data, tvb, 0, -1, "Packet truncated before end of TCP/IP headers"); } else if (!pinfo->fd->visited) { /* If this is our first time visiting this packet, set things up for * decompressing future packets. */ last_cnum = vjc_cnum; conv = vjc_find_conversation(pinfo, vjc_cnum, TRUE); pkt_data = (vjc_conv_t *)conversation_get_proto_data(conv, proto_vjc); if (NULL == pkt_data) { pkt_data = wmem_new0(wmem_file_scope(), vjc_conv_t); pkt_data->vals = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); conversation_add_proto_data(conv, proto_vjc, (void *)pkt_data); } pdata = // shorthand pkt_data->frame_headers = (guint8 *)tvb_memdup(wmem_file_scope(), tcpip_tvb, 0, tcp_len); pkt_data->last_frame = pinfo->num; pkt_data->header_len = tcp_len; // This value is used for re-calculating seq/ack numbers pkt_data->last_frame_len = tvb_reported_length(tvb) - ip_len; this_hdr = wmem_new0(wmem_file_scope(), vjc_hdr_t); this_hdr->ip_id = GET_16(pdata, 4); this_hdr->seq = GET_32(pdata, ip_len + 4); this_hdr->ack = GET_32(pdata, ip_len + 8); this_hdr->psh = (pdata[ip_len + 13] & 0x08) == 0x08; this_hdr->win = GET_16(pdata, ip_len + 14); this_hdr->tcp_chksum = GET_16(pdata, ip_len + 16); this_hdr->urg = GET_16(pdata, ip_len + 18); wmem_map_insert(pkt_data->vals, GUINT_TO_POINTER(pinfo->num), this_hdr); } else { /* We've already visited this packet, we should have all the info we need. */ } return call_dissector_with_data(ip_handle, tcpip_tvb, pinfo, tree, data); } /* Main dissection routine for compressed VJC packets. * Registered in proto_reg_handoff_vjc() below. */ static int dissect_vjc_comp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { /* A Van Jacobson compressed packet contains a change mask, which indicates * possible fields that may be present. */ proto_tree *subtree = NULL; proto_item *ti = NULL; guint hdr_len = 3; // See below gboolean hdr_error = FALSE; guint ip_len = 0; guint pkt_len = 0; guint d_ipid = 0; guint d_seq = 0; guint d_ack = 0; gint d_win = 0; guint8 flags = 0; guint offset = 0; guint32 urg = 0; guint32 ip_chksum = 0; guint32 tcp_chksum = 0; guint32 vjc_cnum = 0; conversation_t *conv = NULL; vjc_hdr_t *this_hdr = NULL; vjc_hdr_t *last_hdr = NULL; vjc_conv_t *pkt_data = NULL; guint8 *pdata = NULL; tvbuff_t *tcpip_tvb = NULL; tvbuff_t *sub_tvb = NULL; /* Calculate the length of the VJC header, * accounting for extensions in the delta fields. * We start with a value of 3, because we'll always have * an 8-bit change mask and a 16-bit TCP checksum. */ #define TEST_HDR_LEN \ if (hdr_len > tvb_captured_length(tvb)) { hdr_error = TRUE; goto done_header_len; } TEST_HDR_LEN; flags = tvb_get_guint8(tvb, offset); if (flags & VJC_FLAG_C) { // have connection number hdr_len++; TEST_HDR_LEN; } if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SAWU) { /* Special case for "unidirectional data transfer". * No change to header size; d_ack = 0, and * we're to calculate d_seq ourselves. */ } else if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SWU) { /* Special case for "echoed interactive traffic". * No change to header size; we're to calculate d_seq and d_ack. */ } else { /* Not a special case, determine the header size by * testing the SAWU flags individually. */ if (flags & VJC_FLAG_U) { // have urgent pointer hdr_len += 2; TEST_HDR_LEN; } if (flags & VJC_FLAG_W) { // have d_win if (0 == tvb_get_gint8(tvb, offset + hdr_len)) hdr_len += 3; else hdr_len++; TEST_HDR_LEN; } if (flags & VJC_FLAG_A) { // have d_ack if (0 == tvb_get_guint8(tvb, offset + hdr_len)) hdr_len += 3; else hdr_len++; TEST_HDR_LEN; } if (flags & VJC_FLAG_S) { // have d_seq if (0 == tvb_get_guint8(tvb, offset + hdr_len)) hdr_len += 3; else hdr_len++; TEST_HDR_LEN; } } if (flags & VJC_FLAG_I) { // have IP ID if (0 == tvb_get_guint8(tvb, offset + hdr_len)) hdr_len += 3; else hdr_len++; TEST_HDR_LEN; } /* Now that we have the header length, use it when assigning the * protocol item. */ #undef TEST_HDR_LEN done_header_len: ti = proto_tree_add_item(tree, proto_vjc, tvb, 0, MIN(hdr_len, tvb_captured_length(tvb)), ENC_NA); subtree = proto_item_add_subtree(ti, ett_vjc); proto_item_set_text(subtree, "PPP Van Jacobson compressed TCP/IP"); if (hdr_error) { proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_bad_data, tvb, 0, -1, "Packet truncated, compression header incomplete"); return tvb_captured_length(tvb); } ti = proto_tree_add_boolean(subtree, hf_vjc_comp, tvb, 0, 0, TRUE); proto_item_set_generated(ti); proto_tree_add_bitmask(subtree, tvb, 0, hf_vjc_change_mask, ett_vjc_change_mask, vjc_change_mask_fields, ENC_NA); if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SAWU) { proto_tree_add_expert(subtree, pinfo, &ei_vjc_sawu, tvb, 0, 1); } else if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SWU) { proto_tree_add_expert(subtree, pinfo, &ei_vjc_swu, tvb, 0, 1); } offset++; if (flags & VJC_FLAG_C) { proto_tree_add_item_ret_uint(subtree, hf_vjc_cnum, tvb, offset, 1, ENC_BIG_ENDIAN, &vjc_cnum); last_cnum = vjc_cnum; offset++; } else { vjc_cnum = last_cnum; if (vjc_cnum != CNUM_INVALID) { ti = proto_tree_add_uint(subtree, hf_vjc_cnum, tvb, offset, 0, vjc_cnum); proto_item_set_generated(ti); } else { proto_tree_add_expert(subtree, pinfo, &ei_vjc_no_cnum, tvb, 0, 0); } } conv = vjc_find_conversation(pinfo, vjc_cnum, FALSE); if (NULL != conv) { pkt_data = (vjc_conv_t *)conversation_get_proto_data(conv, proto_vjc); // Will be testing that pkt_data exists below } else { proto_tree_add_expert(subtree, pinfo, &ei_vjc_no_conversation, tvb, 1, (flags & VJC_FLAG_C) ? 1 : 0); } proto_tree_add_item_ret_uint(subtree, hf_vjc_chksum, tvb, offset, 2, ENC_BIG_ENDIAN, &tcp_chksum); offset += 2; if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SAWU) { /* Special case for "unidirectional data transfer". * d_ack is 0, and d_seq changed by the amount of data in the previous packet. */ flags &= ~VJC_FLAGS_SAWU; d_ack = 0; if (NULL != pkt_data) { d_seq = pkt_data->last_frame_len; } ti = proto_tree_add_uint(subtree, hf_vjc_d_ack, tvb, offset, 0, d_ack); proto_item_set_generated(ti); ti = proto_tree_add_uint(subtree, hf_vjc_d_seq, tvb, offset, 0, d_seq); proto_item_set_generated(ti); } else if ((flags & VJC_FLAGS_SAWU) == VJC_FLAGS_SWU) { /* Special case for "echoed interactive traffic". * d_seq and d_ack changed by the amount of user data in the * previous packet. */ flags &= ~VJC_FLAGS_SAWU; if (NULL != pkt_data) { d_seq = d_ack = pkt_data->last_frame_len; } ti = proto_tree_add_uint(subtree, hf_vjc_d_ack, tvb, offset, 0, d_ack); proto_item_set_generated(ti); ti = proto_tree_add_uint(subtree, hf_vjc_d_seq, tvb, offset, 0, d_seq); proto_item_set_generated(ti); } else { /* Not a special case, read the SAWU flags individually */ if (flags & VJC_FLAG_U) { /* "The packet’s urgent pointer is sent if URG is set ..." * I assume that means the full 16-bit value here. */ proto_tree_add_item_ret_uint(subtree, hf_vjc_urg, tvb, offset, 2, ENC_BIG_ENDIAN, &urg); offset += 2; } else { urg = 0; } if (flags & VJC_FLAG_W) { /* "The number sent for the window is also the difference between the current * and previous values. However, either positive or negative changes are * allowed since the window is a 16-bit field." */ d_win = vjc_delta_int(subtree, hf_vjc_d_win, tvb, &offset); } else { d_win = 0; } /* The rest of the deltas can only be positive. */ if (flags & VJC_FLAG_A) { d_ack = vjc_delta_uint(subtree, hf_vjc_d_ack, tvb, &offset); } else { d_ack = 0; } if (flags & VJC_FLAG_S) { d_seq = vjc_delta_uint(subtree, hf_vjc_d_seq, tvb, &offset); } else { d_seq = 0; } } if (flags & VJC_FLAG_I) { d_ipid = vjc_delta_uint(subtree, hf_vjc_d_ipid, tvb, &offset); } else { /* "However, unlike the rest of the compressed fields, the assumed * change when I is clear is one, not zero." - section 3.2.2 */ d_ipid = 1; ti = proto_tree_add_uint(subtree, hf_vjc_d_ipid, tvb, offset, 0, d_ipid); proto_item_set_generated(ti); } if (!(pinfo->p2p_dir == P2P_DIR_RECV || pinfo->p2p_dir == P2P_DIR_SENT)) { /* We can't make a proper conversation if we don't know the endpoints */ proto_tree_add_expert(subtree, pinfo, &ei_vjc_no_direction, tvb, offset, tvb_captured_length_remaining(tvb, offset)); return tvb_captured_length(tvb); } if (NULL == conv) { proto_tree_add_expert(subtree, pinfo, &ei_vjc_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset)); return tvb_captured_length(tvb); } if (NULL == pkt_data) { proto_tree_add_expert(subtree, pinfo, &ei_vjc_no_conv_data, tvb, offset, tvb_captured_length_remaining(tvb, offset)); return tvb_captured_length(tvb); } if (!pinfo->fd->visited) { /* We haven't visited this packet before. * Form its vjc_hdr_t from the deltas and the info from the previous frame. */ last_hdr = (vjc_hdr_t *)wmem_map_lookup(pkt_data->vals, GUINT_TO_POINTER(pkt_data->last_frame)); if (NULL != last_hdr) { this_hdr = wmem_new0(wmem_file_scope(), vjc_hdr_t); this_hdr->tcp_chksum = (guint16)tcp_chksum; this_hdr->urg = (guint16)urg; this_hdr->win = last_hdr->win + d_win; this_hdr->seq = last_hdr->seq + d_seq; this_hdr->ack = last_hdr->ack + d_ack; this_hdr->ip_id = last_hdr->ip_id + d_ipid; this_hdr->psh = (flags & VJC_FLAG_P) == VJC_FLAG_P; wmem_map_insert(pkt_data->vals, GUINT_TO_POINTER(pinfo->num), this_hdr); // This frame is the next frame's last frame pkt_data->last_frame = pinfo->num; pkt_data->last_frame_len = tvb_reported_length_remaining(tvb, offset); } else { proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_error, tvb, 0, 0, "Dissector error: unable to find headers for prior frame %d", pkt_data->last_frame); return tvb_captured_length(tvb); } // if last_hdr is null, then this_hdr will stay null and be handled below } else { /* We have visited this packet before. * Get the values we saved the first time. */ this_hdr = (vjc_hdr_t *)wmem_map_lookup(pkt_data->vals, GUINT_TO_POINTER(pinfo->num)); } if (NULL != this_hdr) { /* pkt_data->frame_headers is our template packet header data. * Apply changes to it as needed. * The changes are intentionally done in the template before copying. */ pkt_len = pkt_data->header_len + tvb_reported_length_remaining(tvb, offset); pdata = pkt_data->frame_headers; /* shorthand */ ip_len = (pdata[0] & 0x0F) << 2; /* IP length */ PUT_16(pdata, 2, pkt_len); /* IP ID */ PUT_16(pdata, 4, this_hdr->ip_id); /* IP checksum */ PUT_16(pdata, 10, 0x0000); ip_chksum = ip_checksum(pdata, ip_len); PUT_16(pdata, 10, g_htons(ip_chksum)); /* TCP seq */ PUT_32(pdata, ip_len + 4, this_hdr->seq); /* TCP ack */ PUT_32(pdata, ip_len + 8, this_hdr->ack); /* TCP window */ PUT_16(pdata, ip_len + 14, this_hdr->win); /* TCP push */ if (this_hdr->psh) { pdata[ip_len + 13] |= 0x08; } else { pdata[ip_len + 13] &= ~0x08; } /* TCP checksum */ PUT_16(pdata, ip_len + 16, this_hdr->tcp_chksum); /* TCP urg */ if (this_hdr->urg) { pdata[ip_len + 13] |= 0x20; PUT_16(pdata, ip_len + 18, this_hdr->urg); } else { pdata[ip_len + 13] &= ~0x20; PUT_16(pdata, ip_len + 18, 0x0000); } /* Now that we're done manipulating the packet header, stick it into * a TVB for sub-dissectors to use. */ sub_tvb = tvb_new_child_real_data(tvb, pdata, pkt_data->header_len, pkt_data->header_len); tvb_set_free_cb(sub_tvb, NULL); // Reuse pkt_len pkt_len = tvb_captured_length_remaining(tvb, offset); if (0 < pkt_len) { tcpip_tvb = tvb_new_composite(); tvb_composite_append(tcpip_tvb, sub_tvb); tvb_composite_append(tcpip_tvb, tvb_new_subset_remaining(tvb, offset)); tvb_composite_finalize(tcpip_tvb); ti = proto_tree_add_item(subtree, hf_vjc_tcpdata, tvb, offset, pkt_len, ENC_NA); proto_item_set_text(ti, "TCP data (%d byte%s)", pkt_len, plurality(pkt_len, "", "s")); } else { tcpip_tvb = sub_tvb; } add_new_data_source(pinfo, tcpip_tvb, "Decompressed TCP/IP data"); return offset + call_dissector_with_data(ip_handle, tcpip_tvb, pinfo, tree, data); } else { proto_tree_add_expert_format(subtree, pinfo, &ei_vjc_error, tvb, 0, 0, "Dissector error: unable to find headers for current frame %d", pinfo->num); } return tvb_captured_length(tvb); } void proto_register_vjc(void) { static hf_register_info hf[] = { { &hf_vjc_comp, { "Is compressed", "vjc.compressed", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vjc_cnum, { "Connection number", "vjc.connection_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vjc_change_mask, { "Change mask", "vjc.change_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vjc_change_mask_r, { "Reserved", "vjc.change_mask.reserved", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_R, "Undefined bit", HFILL }}, { &hf_vjc_change_mask_c, { "Connection number flag", "vjc.change_mask.connection_number", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_C, "Whether connection number is present", HFILL }}, { &hf_vjc_change_mask_i, { "IP ID flag", "vjc.change_mask.ip_id", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_I, "Whether IP ID is present", HFILL }}, { &hf_vjc_change_mask_p, { "TCP PSH flag", "vjc.change_mask.psh", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_P, "Whether to set TCP PSH", HFILL }}, { &hf_vjc_change_mask_s, { "TCP Sequence flag", "vjc.change_mask.seq", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_S, "Whether TCP SEQ is present", HFILL }}, { &hf_vjc_change_mask_a, { "TCP Acknowledgement flag", "vjc.change_mask.ack", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_A, "Whether TCP ACK is present", HFILL }}, { &hf_vjc_change_mask_w, { "TCP Window flag", "vjc.change_mask.win", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_W, "Whether TCP Window is present", HFILL }}, { &hf_vjc_change_mask_u, { "TCP Urgent flag", "vjc.change_mask.urg", FT_BOOLEAN, 8, TFS(&tfs_set_notset), VJC_FLAG_U, "Whether TCP URG pointer is present", HFILL }}, { &hf_vjc_chksum, { "TCP Checksum", "vjc.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "TCP checksum of original packet", HFILL}}, { &hf_vjc_urg, { "Urgent pointer", "vjc.urgent_pointer", FT_UINT16, BASE_DEC, NULL, 0x0, "TCP urgent pointer of original packet", HFILL}}, { &hf_vjc_d_win, { "Delta window", "vjc.delta_window", FT_INT16, BASE_DEC, NULL, 0x0, "Change in TCP window size from previous packet", HFILL}}, { &hf_vjc_d_ack, { "Delta ack", "vjc.delta_ack", FT_UINT16, BASE_DEC, NULL, 0x0, "Change in TCP acknowledgement number from previous packet", HFILL}}, { &hf_vjc_d_seq, { "Delta seq", "vjc.delta_seq", FT_UINT16, BASE_DEC, NULL, 0x0, "Change in TCP sequence number from previous packet", HFILL}}, { &hf_vjc_d_ipid, { "Delta IP ID", "vjc.delta_ipid", FT_UINT16, BASE_DEC, NULL, 0x0, "Change in IP Identification number from previous packet", HFILL}}, { &hf_vjc_tcpdata, { "TCP data", "vjc.tcp_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Original TCP payload", HFILL}}, }; static gint *ett[] = { &ett_vjc, &ett_vjc_change_mask, }; expert_module_t* expert_vjc; static ei_register_info ei[] = { { &ei_vjc_sawu, { "vjc.special.sawu", PI_PROTOCOL, PI_CHAT, ".... 1111 = special case for \"unidirectional data transfer\"", EXPFILL }}, { &ei_vjc_swu, { "vjc.special.swu", PI_PROTOCOL, PI_CHAT, ".... 1011 = special case for \"echoed interactive traffic\"", EXPFILL }}, { &ei_vjc_no_cnum, { "vjc.no_connection_id", PI_PROTOCOL, PI_WARN, "No connection ID and no prior connection (common at capture start)", EXPFILL }}, { &ei_vjc_no_conversation, { "vjc.no_connection", PI_PROTOCOL, PI_WARN, "No saved connection found (common at capture start)", EXPFILL }}, { &ei_vjc_no_direction, { "vjc.no_direction", PI_UNDECODED, PI_WARN, "Connection has no direction info, cannot decompress", EXPFILL }}, { &ei_vjc_no_conv_data, { "vjc.no_connection_data", PI_UNDECODED, PI_WARN, "Could not find saved connection data", EXPFILL }}, { &ei_vjc_undecoded, { "vjc.no_decompress", PI_UNDECODED, PI_WARN, "Undecoded data (impossible due to missing information)", EXPFILL }}, { &ei_vjc_bad_data, { "vjc.bad_data", PI_PROTOCOL, PI_ERROR, "Non-compliant packet data", EXPFILL }}, { &ei_vjc_error, { "vjc.error", PI_MALFORMED, PI_ERROR, "Unrecoverable dissector error", EXPFILL }}, }; proto_vjc = proto_register_protocol("Van Jacobson PPP compression", "VJC", "vjc"); proto_register_field_array(proto_vjc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vjc = expert_register_protocol(proto_vjc); expert_register_field_array(expert_vjc, ei, array_length(ei)); register_init_routine(&vjc_init_protocol); register_cleanup_routine(&vjc_cleanup_protocol); } void proto_reg_handoff_vjc(void) { dissector_handle_t vjcu_handle; dissector_handle_t vjcc_handle; ip_handle = find_dissector("ip"); vjcc_handle = create_dissector_handle(dissect_vjc_comp, proto_vjc); dissector_add_uint("ppp.protocol", PPP_VJC_COMP, vjcc_handle); vjcu_handle = create_dissector_handle(dissect_vjc_uncomp, proto_vjc); dissector_add_uint("ppp.protocol", PPP_VJC_UNCOMP, vjcu_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vlan.c
/* packet-vlan.c * Routines for VLAN 802.1Q ethernet header disassembly * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/capture_dissectors.h> #include <wsutil/pint.h> #include <epan/expert.h> #include "packet-ieee8023.h" #include "packet-ipx.h" #include "packet-llc.h" #include <epan/etypes.h> #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/addr_resolv.h> #include <epan/proto_data.h> void proto_register_vlan(void); void proto_reg_handoff_vlan(void); static unsigned int q_in_q_ethertype = ETHERTYPE_QINQ_OLD; static gboolean vlan_summary_in_tree = TRUE; enum version_value { IEEE_8021Q_1998, IEEE_8021Q_2005, IEEE_8021Q_2011 }; static gint vlan_version = (gint)IEEE_8021Q_2011; enum priority_drop_value { Priority_Drop_8P0D, Priority_Drop_7P1D, Priority_Drop_6P2D, Priority_Drop_5P3D, }; static gint vlan_priority_drop = (gint)Priority_Drop_8P0D; static dissector_handle_t vlan_handle; static dissector_handle_t ethertype_handle; static capture_dissector_handle_t llc_cap_handle; static capture_dissector_handle_t ipx_cap_handle; static int proto_vlan; static int hf_vlan_cfi = -1; static int hf_vlan_dei = -1; static int hf_vlan_etype = -1; static int hf_vlan_id = -1; static int hf_vlan_id_name = -1; static int hf_vlan_len = -1; static int hf_vlan_priority = -1; static int hf_vlan_priority_5 = -1; static int hf_vlan_priority_6 = -1; static int hf_vlan_priority_7 = -1; static int hf_vlan_priority_old = -1; static int hf_vlan_trailer = -1; static gint ett_vlan = -1; static expert_field ei_vlan_len = EI_INIT; static expert_field ei_vlan_too_many_tags = EI_INIT; /* From Table G-2 of IEEE standard 802.1D-2004 */ /* Note that 0 is the default priority, but is above 1 and 2. * Priority order from lowest to highest is 1,2,0,3,4,5,6,7 */ static const value_string pri_vals_old[] = { { 0, "Best Effort (default)" }, { 1, "Background" }, { 2, "Spare" }, { 3, "Excellent Effort" }, { 4, "Controlled Load" }, { 5, "Video, < 100ms latency and jitter" }, { 6, "Voice, < 10ms latency and jitter" }, { 7, "Network Control" }, { 0, NULL } }; /* From Table G-2 of IEEE standard 802.1Q-2005 (and I-2 of 2011 and 2014 revisions) */ /* Note that 0 is still the default, but priority 2 was moved from below 0 to * above it. The new order from lowest to highest is 1,0,2,3,4,5,6,7 */ static const value_string pri_vals[] = { { 0, "Best Effort (default)" }, { 1, "Background" }, { 2, "Excellent Effort" }, { 3, "Critical Applications" }, { 4, "Video, < 100ms latency and jitter" }, { 5, "Voice, < 10ms latency and jitter" }, { 6, "Internetwork Control" }, { 7, "Network Control" }, { 0, NULL } }; /* From Tables G-2,3 of IEEE standard 802.1Q-2005 (and I-2,3,7 of 2011 and 2014 revisions) */ static const value_string pri_vals_7[] = { { 0, "Best Effort (default)" }, { 1, "Background" }, { 2, "Excellent Effort" }, { 3, "Critical Applications" }, { 4, "Voice, < 10ms latency and jitter, Drop Eligible" }, { 5, "Voice, < 10ms latency and jitter" }, { 6, "Internetwork Control" }, { 7, "Network Control" }, { 0, NULL } }; /* From Tables G-2,3 of IEEE standard 802.1Q-2005 (and I-2,3,7 of 2011 and 2015 revisions) */ static const value_string pri_vals_6[] = { { 0, "Best Effort (default)" }, { 1, "Background" }, { 2, "Critical Applications, Drop Eligible" }, { 3, "Critical Applications" }, { 4, "Voice, < 10ms latency and jitter, Drop Eligible" }, { 5, "Voice, < 10ms latency and jitter" }, { 6, "Internetwork Control" }, { 7, "Network Control" }, { 0, NULL } }; /* From Tables G-2,3 of IEEE standard 802.1Q-2005 (and I-2,3,7 of 2011 and 2015 revisions) */ static const value_string pri_vals_5[] = { { 0, "Best Effort (default), Drop Eligible" }, { 1, "Best Effort (default)" }, { 2, "Critical Applications, Drop Eligible" }, { 3, "Critical Applications" }, { 4, "Voice, < 10ms latency and jitter, Drop Eligible" }, { 5, "Voice, < 10ms latency and jitter" }, { 6, "Internetwork Control" }, { 7, "Network Control" }, { 0, NULL } }; /* True is non-canonical (i.e., bit-reversed MACs like Token Ring) since usually 0 and canonical. */ static const true_false_string tfs_noncanonical_canonical = { "Non-canonical", "Canonical" }; static const true_false_string tfs_eligible_ineligible = { "Eligible", "Ineligible" }; #define VLAN_MAX_NESTED_TAGS 20 static gboolean capture_vlan(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ ) { guint16 encap_proto; if ( !BYTES_ARE_IN_FRAME(offset,len,5) ) return FALSE; encap_proto = pntoh16( &pd[offset+2] ); if ( encap_proto <= IEEE_802_3_MAX_LEN) { if ( pd[offset+4] == 0xff && pd[offset+5] == 0xff ) { return call_capture_dissector(ipx_cap_handle, pd,offset+4,len, cpinfo, pseudo_header); } else { return call_capture_dissector(llc_cap_handle, pd,offset+4,len, cpinfo, pseudo_header); } } return try_capture_dissector("ethertype", encap_proto, pd, offset+4, len, cpinfo, pseudo_header); } static void columns_set_vlan(column_info *cinfo, guint16 tci) { char id_str[16]; guint32_to_str_buf(tci & 0xFFF, id_str, sizeof(id_str)); if (vlan_version < IEEE_8021Q_2011) { col_add_fstr(cinfo, COL_INFO, "PRI: %d CFI: %d ID: %s", (tci >> 13), ((tci >> 12) & 1), id_str); } else { col_add_fstr(cinfo, COL_INFO, "PRI: %d DEI: %d ID: %s", (tci >> 13), ((tci >> 12) & 1), id_str); } } static int dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; guint16 tci, vlan_id; guint16 encap_proto; gboolean is_802_2; proto_tree *vlan_tree; proto_item *item; guint vlan_nested_count; int hf1, hf2; int * const flags[] = { &hf1, &hf2, &hf_vlan_id, NULL }; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VLAN"); col_clear(pinfo->cinfo, COL_INFO); tci = tvb_get_ntohs( tvb, 0 ); vlan_id = tci & 0xFFF; /* Add the VLAN Id if it's the first one*/ if (pinfo->vlan_id == 0) { pinfo->vlan_id = vlan_id; } columns_set_vlan(pinfo->cinfo, tci); vlan_tree = NULL; ti = proto_tree_add_item(tree, proto_vlan, tvb, 0, 4, ENC_NA); vlan_nested_count = p_get_proto_depth(pinfo, proto_vlan); if (++vlan_nested_count > VLAN_MAX_NESTED_TAGS) { expert_add_info(pinfo, ti, &ei_vlan_too_many_tags); return tvb_captured_length(tvb); } p_set_proto_depth(pinfo, proto_vlan, vlan_nested_count); if (tree) { if (vlan_summary_in_tree) { if (vlan_version < IEEE_8021Q_2011) { proto_item_append_text(ti, ", PRI: %u, CFI: %u, ID: %u", (tci >> 13), ((tci >> 12) & 1), vlan_id); } else { proto_item_append_text(ti, ", PRI: %u, DEI: %u, ID: %u", (tci >> 13), ((tci >> 12) & 1), vlan_id); } } vlan_tree = proto_item_add_subtree(ti, ett_vlan); if (vlan_version == IEEE_8021Q_1998) { hf1 = hf_vlan_priority_old; hf2 = hf_vlan_cfi; } else { switch (vlan_priority_drop) { case Priority_Drop_8P0D: hf1 = hf_vlan_priority; break; case Priority_Drop_7P1D: hf1 = hf_vlan_priority_7; break; case Priority_Drop_6P2D: hf1 = hf_vlan_priority_6; break; case Priority_Drop_5P3D: hf1 = hf_vlan_priority_5; break; } if (vlan_version == IEEE_8021Q_2005) { hf2 = hf_vlan_cfi; } else { hf2 = hf_vlan_dei; } } proto_tree_add_bitmask_list(vlan_tree, tvb, 0, 2, flags, ENC_BIG_ENDIAN); if (gbl_resolv_flags.vlan_name) { item = proto_tree_add_string(vlan_tree, hf_vlan_id_name, tvb, 0, 2, get_vlan_name(pinfo->pool, vlan_id)); proto_item_set_generated(item); } /* TODO: If the CFI is set on Ethernet (or FDDI MAC and not source routed, * i.e. the RII bit in the source MAC address is 0, then a E-RIF follows. * Only true before version 2011 since the CFI was replaced with DEI * (Since who needs VLANs that bridge Token Ring and FDDI these days?) */ } encap_proto = tvb_get_ntohs(tvb, 2); if (encap_proto <= IEEE_802_3_MAX_LEN) { /* Is there an 802.2 layer? I can tell by looking at the first 2 bytes after the VLAN header. If they are 0xffff, then what follows the VLAN header is an IPX payload, meaning no 802.2. (IPX/SPX is they only thing that can be contained inside a straight 802.3 packet, so presumably the same applies for Ethernet VLAN packets). A non-0xffff value means that there's an 802.2 layer inside the VLAN layer */ is_802_2 = TRUE; /* Don't throw an exception for this check (even a BoundsError) */ if (tvb_captured_length_remaining(tvb, 4) >= 2) { if (tvb_get_ntohs(tvb, 4) == 0xffff) { is_802_2 = FALSE; } } dissect_802_3(encap_proto, is_802_2, tvb, 4, pinfo, tree, vlan_tree, hf_vlan_len, hf_vlan_trailer, &ei_vlan_len, 0); } else { ethertype_data_t ethertype_data; proto_tree_add_uint(vlan_tree, hf_vlan_etype, tvb, 2, 2, encap_proto); ethertype_data.etype = encap_proto; ethertype_data.payload_offset = 4; ethertype_data.fh_tree = vlan_tree; ethertype_data.trailer_id = hf_vlan_trailer; ethertype_data.fcs_len = 0; call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data); } return tvb_captured_length(tvb); } void proto_register_vlan(void) { static hf_register_info hf[] = { { &hf_vlan_priority_old, { "Priority", "vlan.priority", FT_UINT16, BASE_DEC, VALS(pri_vals_old), 0xE000, "Descriptions are recommendations from IEEE standard 802.1D-2004", HFILL } }, { &hf_vlan_priority, { "Priority", "vlan.priority", FT_UINT16, BASE_DEC, VALS(pri_vals), 0xE000, "Descriptions are recommendations from IEEE standard 802.1Q-2014", HFILL } }, { &hf_vlan_priority_7, { "Priority", "vlan.priority", FT_UINT16, BASE_DEC, VALS(pri_vals_7), 0xE000, "Descriptions are recommendations from IEEE standard 802.1Q-2014", HFILL } }, { &hf_vlan_priority_6, { "Priority", "vlan.priority", FT_UINT16, BASE_DEC, VALS(pri_vals_6), 0xE000, "Descriptions are recommendations from IEEE standard 802.1Q-2014", HFILL } }, { &hf_vlan_priority_5, { "Priority", "vlan.priority", FT_UINT16, BASE_DEC, VALS(pri_vals_5), 0xE000, "Descriptions are recommendations from IEEE standard 802.1Q-2014", HFILL } }, { &hf_vlan_cfi, { "CFI", "vlan.cfi", FT_BOOLEAN, 16, TFS(&tfs_noncanonical_canonical), 0x1000, "Canonical Format Identifier", HFILL } }, { &hf_vlan_dei, { "DEI", "vlan.dei", FT_BOOLEAN, 16, TFS(&tfs_eligible_ineligible), 0x1000, "Drop Eligible Indicator", HFILL } }, { &hf_vlan_id, { "ID", "vlan.id", FT_UINT16, BASE_DEC, NULL, 0x0FFF, "VLAN ID", HFILL } }, { &hf_vlan_id_name, { "Name", "vlan.id_name", FT_STRING, BASE_NONE, NULL, 0x0, "VLAN ID Name", HFILL } }, { &hf_vlan_etype, { "Type", "vlan.etype", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, "Ethertype", HFILL } }, { &hf_vlan_len, { "Length", "vlan.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vlan_trailer, { "Trailer", "vlan.trailer", FT_BYTES, BASE_NONE, NULL, 0x0, "VLAN Trailer", HFILL } }, }; static gint *ett[] = { &ett_vlan }; static ei_register_info ei[] = { { &ei_vlan_len, { "vlan.len.past_end", PI_MALFORMED, PI_ERROR, "Length field value goes past the end of the payload", EXPFILL }}, { &ei_vlan_too_many_tags, { "vlan.too_many_tags", PI_UNDECODED, PI_WARN, "Too many nested VLAN tags", EXPFILL }}, }; static const enum_val_t version_vals[] = { {"1998", "IEEE 802.1Q-1998", IEEE_8021Q_1998}, {"2005", "IEEE 802.1Q-2005", IEEE_8021Q_2005}, {"2011", "IEEE 802.1Q-2011", IEEE_8021Q_2011}, {NULL, NULL, -1} }; static const enum_val_t priority_drop_vals[] = { {"8p0d", "8 Priorities, 0 Drop Eligible", Priority_Drop_8P0D}, {"7p1d", "7 Priorities, 1 Drop Eligible", Priority_Drop_7P1D}, {"6p2d", "6 Priorities, 2 Drop Eligible", Priority_Drop_6P2D}, {"5p3d", "5 Priorities, 3 Drop Eligible", Priority_Drop_5P3D}, {NULL, NULL, -1} }; module_t *vlan_module; expert_module_t* expert_vlan; proto_vlan = proto_register_protocol("802.1Q Virtual LAN", "VLAN", "vlan"); proto_register_field_array(proto_vlan, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vlan = expert_register_protocol(proto_vlan); expert_register_field_array(expert_vlan, ei, array_length(ei)); vlan_module = prefs_register_protocol(proto_vlan, proto_reg_handoff_vlan); prefs_register_bool_preference(vlan_module, "summary_in_tree", "Show vlan summary in protocol tree", "Whether the vlan summary line should be shown in the protocol tree", &vlan_summary_in_tree); prefs_register_uint_preference(vlan_module, "qinq_ethertype", "802.1QinQ Ethertype (in hex)", "The (hexadecimal) Ethertype used to indicate 802.1QinQ VLAN in VLAN tunneling.", 16, &q_in_q_ethertype); prefs_register_enum_preference(vlan_module, "version", "IEEE 802.1Q version", "IEEE 802.1Q specification version used (802.1Q-1998 uses 802.1D-2004 for PRI values)", &vlan_version, version_vals, TRUE); prefs_register_enum_preference(vlan_module, "priority_drop", "Priorities and drop eligibility", "Number of priorities supported, and number of those drop eligible (not used for 802.1Q-1998)", &vlan_priority_drop, priority_drop_vals, FALSE); vlan_handle = register_dissector("vlan", dissect_vlan, proto_vlan); } void proto_reg_handoff_vlan(void) { static gboolean prefs_initialized = FALSE; static unsigned int old_q_in_q_ethertype; capture_dissector_handle_t vlan_cap_handle; if (!prefs_initialized) { dissector_add_uint("ethertype", ETHERTYPE_VLAN, vlan_handle); vlan_cap_handle = create_capture_dissector_handle(capture_vlan, proto_vlan); capture_dissector_add_uint("ethertype", ETHERTYPE_VLAN, vlan_cap_handle); prefs_initialized = TRUE; } else { dissector_delete_uint("ethertype", old_q_in_q_ethertype, vlan_handle); } old_q_in_q_ethertype = q_in_q_ethertype; ethertype_handle = find_dissector_add_dependency("ethertype", proto_vlan); dissector_add_uint("ethertype", q_in_q_ethertype, vlan_handle); llc_cap_handle = find_capture_dissector("llc"); ipx_cap_handle = find_capture_dissector("ipx"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vmlab.c
/* packet-vmlab.c * Routines for VMware Lab Manager Frame Dis-assembly * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* History * * Apr 4, 2010 - David Aggeler * * - Initial version based on packet-vlan.c * * VMware Lab Manager is using this encapsulation directly as Ethernet Frames * or inside VLANs. The Ethernet type was originally registered to Akimbi, but VMware * acquired this company in 2006. No public information found, so the decoding here * is an educated guess. Since one of the features of Lab Manager is to separate * VMs with equal host name, IP and MAC Address, I expect the upper layer dissectors * (namely ARP, ICMP, IP, TCP) to create false alerts, since identical configurations * may communicate at the same time. The main goal of this dissector is to be able * to troubleshoot connectivity, preferably pings. It's also a little to understand * as to how host spanning fenced configurations actually talk. * */ #include "config.h" #include <epan/packet.h> #include <epan/addr_resolv.h> #include <epan/etypes.h> void proto_register_vmlab(void); void proto_reg_handoff_vmlab(void); static dissector_handle_t ethertype_handle; static int proto_vmlab = -1; static int hf_vmlab_flags_part1 = -1; /* Unknown so far */ static int hf_vmlab_flags_fragment = -1; static int hf_vmlab_flags_part2 = -1; /* Unknown so far */ static int hf_vmlab_portgroup = -1; static int hf_vmlab_eth_src = -1; static int hf_vmlab_eth_dst = -1; static int hf_vmlab_eth_addr = -1; static int hf_vmlab_etype = -1; static int hf_vmlab_trailer = -1; static gint ett_vmlab = -1; static int dissect_vmlab(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree* vmlab_tree; proto_item* ti; guint32 offset=0; guint8 attributes; guint8 portgroup; ethertype_data_t ethertype_data; guint16 encap_proto; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VMLAB"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vmlab, tvb, 0, 24, ENC_NA); vmlab_tree = proto_item_add_subtree(ti, ett_vmlab); /* Flags*/ attributes = tvb_get_guint8(tvb, offset); proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vmlab_tree, hf_vmlab_flags_fragment, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vmlab_tree, hf_vmlab_flags_part2, tvb, offset, 1, ENC_BIG_ENDIAN); if (attributes & 0x04) { proto_item_append_text(ti, ", Fragment"); } offset += 1; /* Portgroup*/ portgroup = tvb_get_guint8(tvb, offset); proto_tree_add_uint(vmlab_tree, hf_vmlab_portgroup, tvb, offset, 1, portgroup); proto_item_append_text(ti, ", Portgroup: %d", portgroup); offset += 1; /* The next two bytes were always 0x0000 as far as I could tell*/ offset += 2; /* Not really clear, what the difference between this and the next MAC address is Both are usually equal*/ proto_tree_add_item(vmlab_tree, hf_vmlab_eth_addr, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(vmlab_tree, hf_vmlab_eth_dst, tvb, offset, 6, ENC_NA); offset += 6; /* Source MAC*/ proto_tree_add_item(vmlab_tree, hf_vmlab_eth_src, tvb, offset, 6, ENC_NA); offset += 6; proto_item_append_text(ti, ", Src: %s, Dst: %s", tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset-6), tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset-12)); /* Encapsulated Ethertype is also part of the block*/ encap_proto = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(vmlab_tree, hf_vmlab_etype, tvb, offset, 2, encap_proto); offset += 2; /* Now call whatever was encapsulated*/ ethertype_data.etype = encap_proto; ethertype_data.payload_offset = offset; ethertype_data.fh_tree = vmlab_tree; ethertype_data.trailer_id = hf_vmlab_trailer; ethertype_data.fcs_len = 0; call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data); return tvb_captured_length(tvb); } void proto_register_vmlab(void) { static hf_register_info hf[] = { { &hf_vmlab_flags_part1, { "Unknown", "vmlab.unknown1", FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL }}, { &hf_vmlab_flags_fragment, { "More Fragments", "vmlab.fragment", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }}, { &hf_vmlab_flags_part2, { "Unknown", "vmlab.unknown2", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }}, { &hf_vmlab_portgroup, { "Portgroup", "vmlab.pgrp", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_vmlab_eth_src, { "Source", "vmlab.src", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vmlab_eth_dst, { "Destination", "vmlab.dst", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vmlab_eth_addr, { "Address", "vmlab.addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vmlab_etype, { "Encapsulated Type", "vmlab.subtype", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, NULL, HFILL }}, { &hf_vmlab_trailer, { "Trailer", "vmlab.trailer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_vmlab }; proto_vmlab = proto_register_protocol("VMware Lab Manager", "VMLAB", "vmlab"); proto_register_field_array(proto_vmlab, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vmlab(void) { dissector_handle_t vmlab_handle; vmlab_handle = create_dissector_handle(dissect_vmlab, proto_vmlab); dissector_add_uint("ethertype", ETHERTYPE_VMLAB, vmlab_handle); ethertype_handle = find_dissector_add_dependency("ethertype", proto_vmlab); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vnc.c
/* packet-vnc.c * Routines for VNC dissection (Virtual Network Computing) * Copyright 2005, Ulf Lamping <[email protected]> * Copyright 2006-2007, Stephen Fisher (see AUTHORS file) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Dissection of the VNC (Virtual Network Computing) network traffic. * * All versions of RealVNC and TightVNC are supported. * Note: The addition of TightVNC support is not yet complete. * * Several VNC implementations available, see: * http://www.realvnc.com/ * http://www.tightvnc.com/ * http://ultravnc.sourceforge.net/ * [Fedora TigerVNC] * ... * * The protocol itself is known as RFB - Remote Frame Buffer Protocol. * * This code is based on the protocol specification: * http://www.realvnc.com/docs/rfbproto.pdf * and the RealVNC free edition & TightVNC source code * Note: rfbproto.rst [ https://github.com/svn2github/tigervnc/blob/master/rfbproto/rfbproto.rst ] * seems to have additional information over rfbproto.pdf. */ /* XXX: * This dissector adds items to the protocol tree before completing re-assembly * of a VNC PDU which extends over more than one TCP segment. * This is not correct. As noted in Bug #5366 (and elsewhere), the correct method * is that: * "one must walk over all the message first, to determine its exact length * (one of the characteristics of the protocol, hard to determine prior to * going over the message what its final size would be)". * * The original method of reassembly: * When more data is needed to continue dissecting a PDU, repeatedly request * a few additional bytes (for one or a few more fields of the PDU). * This resulted in 'one-pass' tshark dissection redissecting * the PDU repeatedly many, many times with each time dissecting * the PDU with one or a few more additional fields. * This generated *lots* of (repeated) output since a reassembled * VNC PDU can contain many fields (each of short length). * It also resulted in the fragment table containing many, many small fragments * for VNC PDUS containing many small fields. * * The current reassembly method: * Use DESEGMENT_ONE_MORE_SEGMENT when requesting additional data for a PDU. * This significantly reduces the amount of repeated data in a dissection, * but will still result in "partial" repeated dissection output in some cases. */ /* (Somewhat random notes while reviewing the code): Check types, etc against IANA list Optimize: Do col_set(..., COL_INFO) once (after fetching message type & before dispatching ?) Dispatch via a message table (instead of using a switch(...) Worry about globals (vnc_bytes_per_pixel & nc_depth): "Global so they keep their value between packets" Msg type 150: client-server: enable/disable (1+9 bytes); server-client: endofContinousUpdates(1+0 bytes) ? */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/proto_data.h> #include "packet-x11.h" /* This contains the extern for the X11 value_string_ext * "x11_keysym_vals_source_ext" that VNC uses. */ void proto_register_vnc(void); typedef enum { VNC_SECURITY_TYPE_INVALID = 0, VNC_SECURITY_TYPE_NONE = 1, VNC_SECURITY_TYPE_VNC = 2, VNC_SECURITY_TYPE_RA2 = 5, VNC_SECURITY_TYPE_RA2ne = 6, VNC_SECURITY_TYPE_TIGHT = 16, VNC_SECURITY_TYPE_ULTRA = 17, VNC_SECURITY_TYPE_TLS = 18, VNC_SECURITY_TYPE_VENCRYPT = 19, VNC_SECURITY_TYPE_GTK_VNC_SASL = 20, VNC_SECURITY_TYPE_MD5_HASH_AUTH = 21, VNC_SECURITY_TYPE_XVP = 22, VNC_SECURITY_TYPE_ARD = 30, VNC_TIGHT_AUTH_TGHT_ULGNAUTH = 119, VNC_TIGHT_AUTH_TGHT_XTRNAUTH = 130, VNC_VENCRYPT_AUTH_PLAIN = 256, VNC_VENCRYPT_AUTH_TLSNONE = 257, VNC_VENCRYPT_AUTH_TLSVNC = 258, VNC_VENCRYPT_AUTH_TLSPLAIN = 259, VNC_VENCRYPT_AUTH_X509_NONE = 260, VNC_VENCRYPT_AUTH_X509_VNC = 261, VNC_VENCRYPT_AUTH_X509_PLAIN = 262, VNC_VENCRYPT_AUTH_TLSSASL = 263, VNC_VENCRYPT_AUTH_X509_SASL = 264 } vnc_security_types_e; static const value_string vnc_security_types_vs[] = { { VNC_SECURITY_TYPE_INVALID, "Invalid" }, { VNC_SECURITY_TYPE_NONE, "None" }, { VNC_SECURITY_TYPE_VNC, "VNC" }, { VNC_SECURITY_TYPE_RA2, "RA2" }, { VNC_SECURITY_TYPE_RA2ne, "RA2ne" }, { VNC_SECURITY_TYPE_TIGHT, "Tight" }, { VNC_SECURITY_TYPE_ULTRA, "Ultra" }, { VNC_SECURITY_TYPE_TLS, "TLS" }, { VNC_SECURITY_TYPE_VENCRYPT, "VeNCrypt" }, { VNC_SECURITY_TYPE_GTK_VNC_SASL, "GTK-VNC SASL" }, { VNC_SECURITY_TYPE_ARD, "Apple Remote Desktop" }, { 0, NULL } }; static const value_string vnc_vencrypt_auth_types_vs[] = { { VNC_SECURITY_TYPE_NONE, "None" }, { VNC_SECURITY_TYPE_VNC, "VNC" }, { VNC_VENCRYPT_AUTH_PLAIN, "Plain" }, { VNC_VENCRYPT_AUTH_TLSNONE, "TLS None" }, { VNC_VENCRYPT_AUTH_TLSVNC, "TLS VNC" }, { VNC_VENCRYPT_AUTH_TLSPLAIN, "TLS Plain" }, { VNC_VENCRYPT_AUTH_X509_NONE, "X.509 None" }, { VNC_VENCRYPT_AUTH_X509_VNC, "X.509 VNC" }, { VNC_VENCRYPT_AUTH_X509_PLAIN, "X.509 Plain" }, { VNC_VENCRYPT_AUTH_TLSSASL, "TLS SASL" }, { VNC_VENCRYPT_AUTH_X509_SASL, "X.509 SASL" }, { 0, NULL } }; static const true_false_string auth_result_tfs = { "Failed", "OK" }; typedef enum { /* Required */ VNC_CLIENT_MESSAGE_TYPE_SET_PIXEL_FORMAT = 0, VNC_CLIENT_MESSAGE_TYPE_SET_ENCODINGS = 2, VNC_CLIENT_MESSAGE_TYPE_FRAMEBUF_UPDATE_REQ = 3, VNC_CLIENT_MESSAGE_TYPE_KEY_EVENT = 4, VNC_CLIENT_MESSAGE_TYPE_POINTER_EVENT = 5, VNC_CLIENT_MESSAGE_TYPE_CLIENT_CUT_TEXT = 6, /* Optional */ VNC_CLIENT_MESSAGE_TYPE_MIRRORLINK = 128, VNC_CLIENT_MESSAGE_TYPE_ENABLE_CONTINUOUS_UPDATES = 150, /* TightVNC */ VNC_CLIENT_MESSAGE_TYPE_FENCE = 248, /* TigerVNC */ VNC_CLIENT_MESSAGE_TYPE_XVP = 250, VNC_CLIENT_MESSAGE_TYPE_SETR_DESKTOP_SIZE = 251, VNC_CLIENT_MESSAGE_TYPE_TIGHT = 252, VNC_CLIENT_MESSAGE_TYPE_GII = 253, VNC_CLIENT_MESSAGE_TYPE_QEMU = 255 } vnc_client_message_types_e; static const value_string vnc_client_message_types_vs[] = { /* Required */ { VNC_CLIENT_MESSAGE_TYPE_SET_PIXEL_FORMAT, "Set Pixel Format" }, { VNC_CLIENT_MESSAGE_TYPE_SET_ENCODINGS, "Set Encodings" }, { VNC_CLIENT_MESSAGE_TYPE_FRAMEBUF_UPDATE_REQ, "Framebuffer Update Request" }, { VNC_CLIENT_MESSAGE_TYPE_KEY_EVENT, "Key Event" }, { VNC_CLIENT_MESSAGE_TYPE_POINTER_EVENT, "Pointer Event" }, { VNC_CLIENT_MESSAGE_TYPE_CLIENT_CUT_TEXT, "Cut Text" }, /* Optional */ { VNC_CLIENT_MESSAGE_TYPE_MIRRORLINK, "MirrorLink" }, { VNC_CLIENT_MESSAGE_TYPE_ENABLE_CONTINUOUS_UPDATES, "Enable Continuous Updates" }, { VNC_CLIENT_MESSAGE_TYPE_FENCE, "Fence" }, { VNC_CLIENT_MESSAGE_TYPE_XVP, "Xvp" }, { VNC_CLIENT_MESSAGE_TYPE_SETR_DESKTOP_SIZE, "Setr Desktop Size" }, { VNC_CLIENT_MESSAGE_TYPE_TIGHT, "Tight" }, { VNC_CLIENT_MESSAGE_TYPE_GII, "Gii" }, { VNC_CLIENT_MESSAGE_TYPE_QEMU, "Qemu" }, { 0, NULL } }; typedef enum { VNC_SERVER_MESSAGE_TYPE_FRAMEBUFFER_UPDATE = 0, VNC_SERVER_MESSAGE_TYPE_SET_COLORMAP_ENTRIES = 1, VNC_SERVER_MESSAGE_TYPE_RING_BELL = 2, VNC_SERVER_MESSAGE_TYPE_CUT_TEXT = 3, VNC_SERVER_MESSAGE_TYPE_MIRRORLINK = 128, VNC_SERVER_MESSAGE_TYPE_END_CONTINUOUS_UPDATES = 150, /* TightVNC */ VNC_SERVER_MESSAGE_TYPE_FENCE = 248, /* TigerVNC */ VNC_SERVER_MESSAGE_TYPE_XVP = 250, VNC_SERVER_MESSAGE_TYPE_TIGHT = 252, VNC_SERVER_MESSAGE_TYPE_GII = 253, VNC_SERVER_MESSAGE_TYPE_QEMU = 255 } vnc_server_message_types_e; static const value_string vnc_server_message_types_vs[] = { { VNC_SERVER_MESSAGE_TYPE_FRAMEBUFFER_UPDATE, "Framebuffer Update" }, { VNC_SERVER_MESSAGE_TYPE_SET_COLORMAP_ENTRIES, "Set Colormap Entries" }, { VNC_SERVER_MESSAGE_TYPE_RING_BELL, "Ring Bell" }, { VNC_SERVER_MESSAGE_TYPE_CUT_TEXT, "Cut Text" }, { VNC_SERVER_MESSAGE_TYPE_MIRRORLINK, "MirrorLink" }, { VNC_SERVER_MESSAGE_TYPE_END_CONTINUOUS_UPDATES, "End Continuous Updates" }, { VNC_SERVER_MESSAGE_TYPE_FENCE, "Fence" }, { VNC_SERVER_MESSAGE_TYPE_XVP, "Xvp" }, { VNC_SERVER_MESSAGE_TYPE_TIGHT, "Tight" }, { VNC_SERVER_MESSAGE_TYPE_GII, "Gii" }, { VNC_SERVER_MESSAGE_TYPE_QEMU, "Qemu" }, { 0, NULL } }; #define VNC_ENCODING_TYPE_DESKTOP_SIZE 0xFFFFFF21 #define VNC_ENCODING_TYPE_LAST_RECT 0xFFFFFF20 #define VNC_ENCODING_TYPE_POINTER_POS 0xFFFFFF18 #define VNC_ENCODING_TYPE_RICH_CURSOR 0xFFFFFF11 #define VNC_ENCODING_TYPE_X_CURSOR 0xFFFFFF10 #define VNC_ENCODING_TYPE_RAW 0 #define VNC_ENCODING_TYPE_COPY_RECT 1 #define VNC_ENCODING_TYPE_RRE 2 #define VNC_ENCODING_TYPE_CORRE 4 #define VNC_ENCODING_TYPE_HEXTILE 5 #define VNC_ENCODING_TYPE_ZLIB 6 #define VNC_ENCODING_TYPE_TIGHT 7 #define VNC_ENCODING_TYPE_ZLIBHEX 8 #define VNC_ENCODING_TYPE_ULTRA 9 #define VNC_ENCODING_TYPE_TRLE 15 #define VNC_ENCODING_TYPE_RLE 16 #define VNC_ENCODING_TYPE_HITACHI_ZYWRLE 17 #define VNC_ENCODING_TYPE_JPEG_0 -32 #define VNC_ENCODING_TYPE_JPEG_1 -31 #define VNC_ENCODING_TYPE_JPEG_2 -30 #define VNC_ENCODING_TYPE_JPEG_3 -29 #define VNC_ENCODING_TYPE_JPEG_4 -28 #define VNC_ENCODING_TYPE_JPEG_5 -27 #define VNC_ENCODING_TYPE_JPEG_6 -26 #define VNC_ENCODING_TYPE_JPEG_7 -25 #define VNC_ENCODING_TYPE_JPEG_8 -24 #define VNC_ENCODING_TYPE_JPEG_9 -23 #define VNC_ENCODING_TYPE_COMPRESSION_0 0xFFFFFF00 #define VNC_ENCODING_TYPE_COMPRESSION_1 0xFFFFFF01 #define VNC_ENCODING_TYPE_COMPRESSION_2 0xFFFFFF02 #define VNC_ENCODING_TYPE_COMPRESSION_3 0xFFFFFF03 #define VNC_ENCODING_TYPE_COMPRESSION_4 0xFFFFFF04 #define VNC_ENCODING_TYPE_COMPRESSION_5 0xFFFFFF05 #define VNC_ENCODING_TYPE_COMPRESSION_6 0xFFFFFF06 #define VNC_ENCODING_TYPE_COMPRESSION_7 0xFFFFFF07 #define VNC_ENCODING_TYPE_COMPRESSION_8 0xFFFFFF08 #define VNC_ENCODING_TYPE_COMPRESSION_9 0xFFFFFF09 #define VNC_ENCODING_TYPE_WMVi 0x574D5669 #define VNC_ENCODING_TYPE_CACHE 0xFFFF0000 #define VNC_ENCODING_TYPE_CACHE_ENABLE 0xFFFF0001 #define VNC_ENCODING_TYPE_XOR_ZLIB 0xFFFF0002 #define VNC_ENCODING_TYPE_XOR_MONO_ZLIB 0xFFFF0003 #define VNC_ENCODING_TYPE_XOR_MULTI_ZLIB 0xFFFF0004 #define VNC_ENCODING_TYPE_SOLID_COLOR 0xFFFF0005 #define VNC_ENCODING_TYPE_XOR_ENABLE 0xFFFF0006 #define VNC_ENCODING_TYPE_CACHE_ZIP 0xFFFF0007 #define VNC_ENCODING_TYPE_SOL_MONO_ZIP 0xFFFF0008 #define VNC_ENCODING_TYPE_ULTRA_ZIP 0xFFFF0009 #define VNC_ENCODING_TYPE_SERVER_STATE 0xFFFF8000 #define VNC_ENCODING_TYPE_ENABLE_KEEP_ALIVE 0xFFFF8001 #define VNC_ENCODING_TYPE_FTP_PROTO_VER 0xFFFF8002 #define VNC_ENCODING_TYPE_POINTER_CHANGE -257 #define VNC_ENCODING_TYPE_EXT_KEY_EVENT -258 #define VNC_ENCODING_TYPE_AUDIO 259 #define VNC_ENCODING_TYPE_DESKTOP_NAME -307 #define VNC_ENCODING_TYPE_EXTENDED_DESK_SIZE -308 #define VNC_ENCODING_TYPE_KEYBOARD_LED_STATE 0XFFFE0000 #define VNC_ENCODING_TYPE_SUPPORTED_MESSAGES 0XFFFE0001 #define VNC_ENCODING_TYPE_SUPPORTED_ENCODINGS 0XFFFE0002 #define VNC_ENCODING_TYPE_SERVER_IDENTITY 0XFFFE0003 #define VNC_ENCODING_TYPE_MIRRORLINK 0xFFFFFDF5 #define VNC_ENCODING_TYPE_CONTEXT_INFORMATION 0xFFFFFDF4 #define VNC_ENCODING_TYPE_SLRLE 0xFFFFFDF3 #define VNC_ENCODING_TYPE_TRANSFORM 0xFFFFFDF2 #define VNC_ENCODING_TYPE_HSML 0xFFFFFDF1 #define VNC_ENCODING_TYPE_H264 0X48323634 static const value_string encoding_types_vs[] = { { VNC_ENCODING_TYPE_DESKTOP_SIZE, "DesktopSize (pseudo)" }, { VNC_ENCODING_TYPE_LAST_RECT, "LastRect (pseudo)" }, { VNC_ENCODING_TYPE_POINTER_POS, "Pointer pos (pseudo)" }, { VNC_ENCODING_TYPE_RICH_CURSOR, "Rich Cursor (pseudo)" }, { VNC_ENCODING_TYPE_X_CURSOR, "X Cursor (pseudo)" }, { VNC_ENCODING_TYPE_RAW, "Raw" }, { VNC_ENCODING_TYPE_COPY_RECT, "CopyRect" }, { VNC_ENCODING_TYPE_RRE, "RRE" }, { VNC_ENCODING_TYPE_CORRE, "CoRRE" }, { VNC_ENCODING_TYPE_HEXTILE, "Hextile" }, { VNC_ENCODING_TYPE_ZLIB, "Zlib" }, { VNC_ENCODING_TYPE_TIGHT, "Tight" }, { VNC_ENCODING_TYPE_ZLIBHEX, "ZlibHex" }, { VNC_ENCODING_TYPE_ULTRA, "Ultra" }, { VNC_ENCODING_TYPE_RLE, "ZRLE" }, { VNC_ENCODING_TYPE_HITACHI_ZYWRLE, "Hitachi ZYWRLE" }, { VNC_ENCODING_TYPE_JPEG_0, "JPEG quality level 0" }, { VNC_ENCODING_TYPE_JPEG_1, "JPEG quality level 1" }, { VNC_ENCODING_TYPE_JPEG_2, "JPEG quality level 2" }, { VNC_ENCODING_TYPE_JPEG_3, "JPEG quality level 3" }, { VNC_ENCODING_TYPE_JPEG_4, "JPEG quality level 4" }, { VNC_ENCODING_TYPE_JPEG_5, "JPEG quality level 5" }, { VNC_ENCODING_TYPE_JPEG_6, "JPEG quality level 6" }, { VNC_ENCODING_TYPE_JPEG_7, "JPEG quality level 7" }, { VNC_ENCODING_TYPE_JPEG_8, "JPEG quality level 8" }, { VNC_ENCODING_TYPE_JPEG_9, "JPEG quality level 9" }, { VNC_ENCODING_TYPE_COMPRESSION_0, "Compression level 0" }, { VNC_ENCODING_TYPE_COMPRESSION_1, "Compression level 1" }, { VNC_ENCODING_TYPE_COMPRESSION_2, "Compression level 2" }, { VNC_ENCODING_TYPE_COMPRESSION_3, "Compression level 3" }, { VNC_ENCODING_TYPE_COMPRESSION_4, "Compression level 4" }, { VNC_ENCODING_TYPE_COMPRESSION_5, "Compression level 5" }, { VNC_ENCODING_TYPE_COMPRESSION_6, "Compression level 6" }, { VNC_ENCODING_TYPE_COMPRESSION_7, "Compression level 7" }, { VNC_ENCODING_TYPE_COMPRESSION_8, "Compression level 8" }, { VNC_ENCODING_TYPE_COMPRESSION_9, "Compression level 9" }, /* FIXME understand for real what the below mean. Taken from Ultra VNC source code */ /* { VNC_ENCODING_TYPE_CACHE, */ { VNC_ENCODING_TYPE_CACHE_ENABLE, "Enable Caching"}, /* { VNC_ENCODING_TYPE_XOR_ZLIB, { VNC_ENCODING_TYPE_XOR_MONO_ZLIB, { VNC_ENCODING_TYPE_XOR_MULTI_ZLIB, { VNC_ENCODING_TYPE_SOLID_COLOR, { VNC_ENCODING_TYPE_XOR_ENABLE, { VNC_ENCODING_TYPE_CACHE_ZIP, { VNC_ENCODING_TYPE_SOL_MONO_ZIP, { VNC_ENCODING_TYPE_ULTRA_ZIP, */ { VNC_ENCODING_TYPE_SERVER_STATE, "Server State" }, { VNC_ENCODING_TYPE_ENABLE_KEEP_ALIVE, "Enable Keep Alive" }, { VNC_ENCODING_TYPE_FTP_PROTO_VER, "FTP protocol version" }, { VNC_ENCODING_TYPE_EXTENDED_DESK_SIZE, "Extended Desktop Size"}, { VNC_ENCODING_TYPE_DESKTOP_NAME, "Desktop Name" }, { VNC_ENCODING_TYPE_KEYBOARD_LED_STATE, "Keyboard LED State" }, { VNC_ENCODING_TYPE_SUPPORTED_MESSAGES, "Supported Messages" }, { VNC_ENCODING_TYPE_SUPPORTED_ENCODINGS, "Supported Encodings" }, { VNC_ENCODING_TYPE_SERVER_IDENTITY, "Server Identity" }, { VNC_ENCODING_TYPE_MIRRORLINK, "MirrorLink" }, { VNC_ENCODING_TYPE_CONTEXT_INFORMATION, "Context Information" }, { VNC_ENCODING_TYPE_SLRLE, "SLRLE" }, { VNC_ENCODING_TYPE_TRANSFORM, "Transform" }, { VNC_ENCODING_TYPE_HSML, "HSML" }, { VNC_ENCODING_TYPE_H264, "H264" }, { 0, NULL } }; /* Rectangle types for Tight encoding. These come in the "control byte" at the * start of a rectangle's payload. Note that these are with respect to the most * significant bits 4-7 of the control byte, so you must shift it to the right 4 * bits before comparing against these values. */ #define TIGHT_RECT_FILL 0x08 #define TIGHT_RECT_JPEG 0x09 #define TIGHT_RECT_MAX_VALUE 0x09 #define TIGHT_RECT_EXPLICIT_FILTER_FLAG 0x04 /* Filter types for Basic encoding of Tight rectangles */ #define TIGHT_RECT_FILTER_COPY 0x00 #define TIGHT_RECT_FILTER_PALETTE 0x01 #define TIGHT_RECT_FILTER_GRADIENT 0x02 /* Minimum number of bytes to compress for Tight encoding */ #define TIGHT_MIN_BYTES_TO_COMPRESS 12 static const value_string tight_filter_ids_vs[] = { { TIGHT_RECT_FILTER_COPY, "Copy" }, { TIGHT_RECT_FILTER_PALETTE, "Palette" }, { TIGHT_RECT_FILTER_GRADIENT, "Gradient" }, { 0, NULL } }; /* MirrorLink messages */ typedef enum { VNC_ML_EXT_BYE_BYE = 0, VNC_ML_EXT_SERVER_DISPLAY_CONFIGURATION = 1, VNC_ML_EXT_CLIENT_DISPLAY_CONFIGURATION = 2, VNC_ML_EXT_SERVER_EVENT_CONFIGURATION = 3, VNC_ML_EXT_CLIENT_EVENT_CONFIGURATION = 4, VNC_ML_EXT_EVENT_MAPPING = 5, VNC_ML_EXT_EVENT_MAPPING_REQUEST = 6, VNC_ML_EXT_KEY_EVENT_LISTING = 7, VNC_ML_EXT_KEY_EVENT_LISTING_REQUEST = 8, VNC_ML_EXT_VIRTUAL_KEYBOARD = 9, VNC_ML_EXT_VIRTUAL_KEYBOARD_REQUEST = 10, VNC_ML_EXT_DEVICE_STATUS = 11, VNC_ML_EXT_DEVICE_STATUS_REQUEST = 12, VNC_ML_EXT_CONTENT_ATTESTATION = 13, VNC_ML_EXT_CONTENT_ATTESTATION_REQUEST = 14, VNC_ML_EXT_FB_BLOCKING_NOTIFICATION = 16, VNC_ML_EXT_AUDIO_BLOCKING_NOTIFICATION = 18, VNC_ML_EXT_TOUCH_EVENT = 20, VNC_ML_EXT_FB_ALTERNATIVE_TEXT = 21, VNC_ML_EXT_FB_ALTERNATIVE_TEXT_REQUEST = 22 } vnc_mirrorlink_ext_types_e; static const value_string vnc_mirrorlink_types_vs[] = { { VNC_ML_EXT_BYE_BYE, "ByeBye" }, { VNC_ML_EXT_SERVER_DISPLAY_CONFIGURATION, "Server Display Configuration" }, { VNC_ML_EXT_CLIENT_DISPLAY_CONFIGURATION, "Client Display Configuration" }, { VNC_ML_EXT_SERVER_EVENT_CONFIGURATION, "Server Event Configuration" }, { VNC_ML_EXT_CLIENT_EVENT_CONFIGURATION, "Client Event Configuration" }, { VNC_ML_EXT_EVENT_MAPPING, "Event Mapping" }, { VNC_ML_EXT_EVENT_MAPPING_REQUEST, "Event Mapping Request" }, { VNC_ML_EXT_KEY_EVENT_LISTING, "Key Event Listing" }, { VNC_ML_EXT_KEY_EVENT_LISTING_REQUEST, "Key Event Listing Request" }, { VNC_ML_EXT_VIRTUAL_KEYBOARD, "Virtual Keyboard Trigger" }, { VNC_ML_EXT_VIRTUAL_KEYBOARD_REQUEST, "Virtual Keyboard Trigger Request" }, { VNC_ML_EXT_DEVICE_STATUS, "Device Status" }, { VNC_ML_EXT_DEVICE_STATUS_REQUEST, "Device Status Request" }, { VNC_ML_EXT_CONTENT_ATTESTATION, "Content Attestation" }, { VNC_ML_EXT_CONTENT_ATTESTATION_REQUEST, "Content Attestation Request" }, { VNC_ML_EXT_FB_BLOCKING_NOTIFICATION, "Framebuffer Blocking Notification" }, { VNC_ML_EXT_AUDIO_BLOCKING_NOTIFICATION, "Audio Blocking Notification" }, { VNC_ML_EXT_TOUCH_EVENT, "Touch Event" }, { VNC_ML_EXT_FB_ALTERNATIVE_TEXT, "Framebuffer Alternative Text" }, { VNC_ML_EXT_FB_ALTERNATIVE_TEXT_REQUEST, "Framebuffer Alternative Text Request" }, { 0, NULL } }; /* Slice types for H.264 encoding */ typedef enum { VNC_H264_SLICE_TYPE_P = 0, VNC_H264_SLICE_TYPE_B = 1, VNC_H264_SLICE_TYPE_I = 2 } vnc_h264_slice_types_e; static const value_string vnc_h264_slice_types_vs[] = { { VNC_H264_SLICE_TYPE_P, "Predicted" }, { VNC_H264_SLICE_TYPE_B, "Bi-predicted" }, { VNC_H264_SLICE_TYPE_I, "Intra coded" }, { 0, NULL } }; typedef enum { VNC_SESSION_STATE_SERVER_VERSION, VNC_SESSION_STATE_CLIENT_VERSION, VNC_SESSION_STATE_SECURITY, VNC_SESSION_STATE_SECURITY_TYPES, VNC_SESSION_STATE_TIGHT_TUNNELING_CAPABILITIES, VNC_SESSION_STATE_TIGHT_TUNNEL_TYPE_REPLY, VNC_SESSION_STATE_TIGHT_AUTH_CAPABILITIES, VNC_SESSION_STATE_TIGHT_AUTH_TYPE_REPLY, VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3, VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE, VNC_SESSION_STATE_VNC_AUTHENTICATION_RESPONSE, VNC_SESSION_STATE_ARD_AUTHENTICATION_CHALLENGE, VNC_SESSION_STATE_ARD_AUTHENTICATION_RESPONSE, VNC_SESSION_STATE_SECURITY_RESULT, VNC_SESSION_STATE_VENCRYPT_SERVER_VERSION, VNC_SESSION_STATE_VENCRYPT_CLIENT_VERSION, VNC_SESSION_STATE_VENCRYPT_AUTH_CAPABILITIES, VNC_SESSION_STATE_VENCRYPT_AUTH_TYPE_REPLY, VNC_SESSION_STATE_VENCRYPT_AUTH_ACK, VNC_SESSION_STATE_CLIENT_INIT, VNC_SESSION_STATE_SERVER_INIT, VNC_SESSION_STATE_TIGHT_INTERACTION_CAPS, VNC_SESSION_STATE_NORMAL_TRAFFIC } vnc_session_state_e; #define VNC_FENCE_BLOCK_BEFORE 0x00000001 #define VNC_FENCE_BLOCK_AFTER 0x00000002 #define VNC_FENCE_SYNC_NEXT 0x00000004 #define VNC_FENCE_REQUEST 0x80000000 /* This structure will be tied to each conversation. */ typedef struct { gdouble server_proto_ver, client_proto_ver; vnc_session_state_e vnc_next_state; guint32 server_port; /* These are specific to TightVNC */ gint num_server_message_types; gint num_client_message_types; gint num_encoding_types; guint8 security_type_selected; gboolean tight_enabled; /* This is specific to Apple Remote Desktop */ guint16 ard_key_length; } vnc_conversation_t; /* This structure will be tied to each packet */ typedef struct { vnc_session_state_e state; gint preferred_encoding; guint8 bytes_per_pixel; guint8 depth; } vnc_packet_t; void proto_reg_handoff_vnc(void); static gboolean vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *tree, vnc_conversation_t *per_conversation_info); static void vnc_client_to_server(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_server_to_client(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_set_pixel_format(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_set_encodings(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_framebuffer_update_request(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_key_event(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_pointer_event(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_client_cut_text(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static guint vnc_server_framebuffer_update(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static guint vnc_raw_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_copyrect_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_rre_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_hextile_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_tight_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_rich_cursor_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_x_cursor_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_server_set_colormap_entries(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_server_ring_bell(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static guint vnc_server_cut_text(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static void vnc_set_bytes_per_pixel(packet_info *pinfo, const guint8 bytes_per_pixel); static void vnc_set_depth(packet_info *pinfo, const guint8 depth); static guint8 vnc_get_bytes_per_pixel(packet_info *pinfo); static guint8 vnc_get_depth(packet_info *pinfo); static guint32 vnc_extended_desktop_size(tvbuff_t *tvb, gint *offset, proto_tree *tree); static guint vnc_supported_messages(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width); static guint vnc_supported_encodings(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width, const guint16 height); static guint vnc_server_identity(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width); static guint vnc_fence(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static guint vnc_mirrorlink(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree); static guint vnc_context_information(tvbuff_t *tvb, gint *offset, proto_tree *tree); static guint vnc_slrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 height); static guint vnc_h264_encoding(tvbuff_t *tvb, gint *offset, proto_tree *tree); #define VNC_BYTES_NEEDED(a) \ if((a) > (guint)tvb_reported_length_remaining(tvb, *offset)) \ return (a); /* Initialize the protocol and registered fields */ static int proto_vnc = -1; /* Protocol subtree */ static int hf_vnc_padding = -1; static int hf_vnc_server_proto_ver = -1; static int hf_vnc_client_proto_ver = -1; static int hf_vnc_num_security_types = -1; static int hf_vnc_security_type = -1; static int hf_vnc_server_security_type = -1; static int hf_vnc_client_security_type = -1; static int hf_vnc_auth_challenge = -1; static int hf_vnc_auth_response = -1; static int hf_vnc_auth_result = -1; static int hf_vnc_auth_error = -1; static int hf_vnc_auth_error_length = -1; static int hf_vnc_ard_auth_generator = -1; static int hf_vnc_ard_auth_key_len = -1; static int hf_vnc_ard_auth_modulus = -1; static int hf_vnc_ard_auth_server_key = -1; static int hf_vnc_ard_auth_credentials = -1; static int hf_vnc_ard_auth_client_key = -1; static int hf_vnc_share_desktop_flag = -1; static int hf_vnc_width = -1; static int hf_vnc_height = -1; static int hf_vnc_server_bits_per_pixel = -1; static int hf_vnc_server_depth = -1; static int hf_vnc_server_big_endian_flag = -1; static int hf_vnc_server_true_color_flag = -1; static int hf_vnc_server_red_max = -1; static int hf_vnc_server_green_max = -1; static int hf_vnc_server_blue_max = -1; static int hf_vnc_server_red_shift = -1; static int hf_vnc_server_green_shift = -1; static int hf_vnc_server_blue_shift = -1; static int hf_vnc_desktop_name = -1; static int hf_vnc_desktop_name_len = -1; static int hf_vnc_desktop_screen_num = -1; static int hf_vnc_desktop_screen_id = -1; static int hf_vnc_desktop_screen_x = -1; static int hf_vnc_desktop_screen_y = -1; static int hf_vnc_desktop_screen_width = -1; static int hf_vnc_desktop_screen_height = -1; static int hf_vnc_desktop_screen_flags = -1; static int hf_vnc_num_server_message_types = -1; static int hf_vnc_num_client_message_types = -1; static int hf_vnc_num_encoding_types = -1; /********** Client Message Types **********/ static int hf_vnc_client_message_type = -1; /* A subtree under VNC */ static int hf_vnc_client_bits_per_pixel = -1; static int hf_vnc_client_depth = -1; static int hf_vnc_client_big_endian_flag = -1; static int hf_vnc_client_true_color_flag = -1; static int hf_vnc_client_red_max = -1; static int hf_vnc_client_green_max = -1; static int hf_vnc_client_blue_max = -1; static int hf_vnc_client_red_shift = -1; static int hf_vnc_client_green_shift = -1; static int hf_vnc_client_blue_shift = -1; /* Client Key Event */ static int hf_vnc_key_down = -1; static int hf_vnc_key = -1; /* Client Pointer Event */ static int hf_vnc_button_1_pos = -1; static int hf_vnc_button_2_pos = -1; static int hf_vnc_button_3_pos = -1; static int hf_vnc_button_4_pos = -1; static int hf_vnc_button_5_pos = -1; static int hf_vnc_button_6_pos = -1; static int hf_vnc_button_7_pos = -1; static int hf_vnc_button_8_pos = -1; static int hf_vnc_pointer_x_pos = -1; static int hf_vnc_pointer_y_pos = -1; /* Client Framebuffer Update Request */ static int hf_vnc_update_req_incremental = -1; static int hf_vnc_update_req_x_pos = -1; static int hf_vnc_update_req_y_pos = -1; static int hf_vnc_update_req_width = -1; static int hf_vnc_update_req_height = -1; /* Client Set Encodings */ static int hf_vnc_encoding_num = -1; static int hf_vnc_client_set_encodings_encoding_type = -1; /* Client Cut Text */ static int hf_vnc_client_cut_text_len = -1; static int hf_vnc_client_cut_text = -1; /********** Server Message Types **********/ static int hf_vnc_server_message_type = -1; /* Subtree */ /* Tunneling capabilities (TightVNC extension) */ static int hf_vnc_tight_num_tunnel_types = -1; static int hf_vnc_tight_tunnel_type_code = -1; static int hf_vnc_tight_tunnel_type_vendor = -1; static int hf_vnc_tight_tunnel_type_signature = -1; /* Authentication capabilities (TightVNC extension) */ static int hf_vnc_tight_num_auth_types = -1; static int hf_vnc_tight_auth_code = -1; /* TightVNC capabilities */ static int hf_vnc_tight_server_message_type = -1; static int hf_vnc_tight_server_vendor = -1; static int hf_vnc_tight_signature = -1; static int hf_vnc_tight_server_name = -1; static int hf_vnc_tight_client_message_type = -1; static int hf_vnc_tight_client_vendor = -1; static int hf_vnc_tight_client_name = -1; static int hf_vnc_tight_encoding_type = -1; static int hf_vnc_tight_encoding_vendor = -1; static int hf_vnc_tight_encoding_name = -1; /* VeNCrypt capabilities */ static int hf_vnc_vencrypt_server_major_ver = -1; static int hf_vnc_vencrypt_server_minor_ver = -1; static int hf_vnc_vencrypt_client_major_ver = -1; static int hf_vnc_vencrypt_client_minor_ver = -1; static int hf_vnc_vencrypt_version_ack = -1; static int hf_vnc_vencrypt_num_auth_types = -1; static int hf_vnc_vencrypt_auth_type = -1; static int hf_vnc_vencrypt_auth_type_ack = -1; /* Tight compression parameters */ static int hf_vnc_tight_reset_stream0 = -1; static int hf_vnc_tight_reset_stream1 = -1; static int hf_vnc_tight_reset_stream2 = -1; static int hf_vnc_tight_reset_stream3 = -1; static int hf_vnc_tight_rect_type = -1; static int hf_vnc_tight_image_len = -1; static int hf_vnc_tight_image_data = -1; static int hf_vnc_tight_fill_color = -1; static int hf_vnc_tight_filter_flag = -1; static int hf_vnc_tight_filter_id = -1; static int hf_vnc_tight_palette_num_colors = -1; static int hf_vnc_tight_palette_data = -1; /* Server Framebuffer Update */ static int hf_vnc_rectangle_num = -1; static int hf_vnc_fb_update_x_pos = -1; static int hf_vnc_fb_update_y_pos = -1; static int hf_vnc_fb_update_width = -1; static int hf_vnc_fb_update_height = -1; static int hf_vnc_fb_update_encoding_type = -1; /* Raw Encoding */ static int hf_vnc_raw_pixel_data = -1; /* CopyRect Encoding */ static int hf_vnc_copyrect_src_x_pos = -1; static int hf_vnc_copyrect_src_y_pos = -1; /* RRE Encoding */ static int hf_vnc_rre_num_subrects = -1; static int hf_vnc_rre_bg_pixel = -1; static int hf_vnc_rre_subrect_pixel = -1; static int hf_vnc_rre_subrect_x_pos = -1; static int hf_vnc_rre_subrect_y_pos = -1; static int hf_vnc_rre_subrect_width = -1; static int hf_vnc_rre_subrect_height = -1; /* Hextile Encoding */ static int hf_vnc_hextile_subencoding_mask = -1; static int hf_vnc_hextile_raw = -1; static int hf_vnc_hextile_raw_value = -1; static int hf_vnc_hextile_bg = -1; static int hf_vnc_hextile_bg_value = -1; static int hf_vnc_hextile_fg = -1; static int hf_vnc_hextile_fg_value = -1; static int hf_vnc_hextile_anysubrects = -1; static int hf_vnc_hextile_num_subrects = -1; static int hf_vnc_hextile_subrectscolored = -1; static int hf_vnc_hextile_subrect_pixel_value = -1; static int hf_vnc_hextile_subrect_x_pos = -1; static int hf_vnc_hextile_subrect_y_pos = -1; static int hf_vnc_hextile_subrect_width = -1; static int hf_vnc_hextile_subrect_height = -1; /* ZRLE Encoding */ static int hf_vnc_zrle_len = -1; static int hf_vnc_zrle_subencoding = -1; static int hf_vnc_zrle_rle = -1; static int hf_vnc_zrle_palette_size = -1; static int hf_vnc_zrle_data = -1; static int hf_vnc_zrle_raw = -1; static int hf_vnc_zrle_palette = -1; /* Cursor Encoding */ static int hf_vnc_cursor_x_fore_back = -1; static int hf_vnc_cursor_encoding_pixels = -1; static int hf_vnc_cursor_encoding_bitmask = -1; /* Server Set Colormap Entries */ static int hf_vnc_color_groups = -1; static int hf_vnc_colormap_first_color = -1; static int hf_vnc_colormap_num_colors = -1; static int hf_vnc_colormap_red = -1; static int hf_vnc_colormap_green = -1; static int hf_vnc_colormap_blue = -1; /* Server Cut Text */ static int hf_vnc_server_cut_text_len = -1; static int hf_vnc_server_cut_text = -1; /* LibVNCServer additions */ static int hf_vnc_supported_messages_client2server = -1; static int hf_vnc_supported_messages_server2client = -1; static int hf_vnc_num_supported_encodings = -1; static int hf_vnc_supported_encodings = -1; static int hf_vnc_server_identity = -1; /* MirrorLink */ static int hf_vnc_mirrorlink_type = -1; static int hf_vnc_mirrorlink_length = -1; static int hf_vnc_mirrorlink_version_major = -1; static int hf_vnc_mirrorlink_version_minor = -1; static int hf_vnc_mirrorlink_framebuffer_configuration = -1; static int hf_vnc_mirrorlink_pixel_width = -1; static int hf_vnc_mirrorlink_pixel_height = -1; static int hf_vnc_mirrorlink_pixel_format = -1; static int hf_vnc_mirrorlink_display_width = -1; static int hf_vnc_mirrorlink_display_height = -1; static int hf_vnc_mirrorlink_display_distance = -1; static int hf_vnc_mirrorlink_keyboard_language = -1; static int hf_vnc_mirrorlink_keyboard_country = -1; static int hf_vnc_mirrorlink_ui_language = -1; static int hf_vnc_mirrorlink_ui_country = -1; static int hf_vnc_mirrorlink_knob_keys = -1; static int hf_vnc_mirrorlink_device_keys = -1; static int hf_vnc_mirrorlink_multimedia_keys = -1; static int hf_vnc_mirrorlink_key_related = -1; static int hf_vnc_mirrorlink_pointer_related = -1; static int hf_vnc_mirrorlink_key_symbol_value_client = -1; static int hf_vnc_mirrorlink_key_symbol_value_server = -1; static int hf_vnc_mirrorlink_key_configuration = -1; static int hf_vnc_mirrorlink_key_num_events = -1; static int hf_vnc_mirrorlink_key_event_counter = -1; static int hf_vnc_mirrorlink_key_symbol_value = -1; static int hf_vnc_mirrorlink_key_request_configuration = -1; static int hf_vnc_mirrorlink_keyboard_configuration = -1; static int hf_vnc_mirrorlink_cursor_x = -1; static int hf_vnc_mirrorlink_cursor_y = -1; static int hf_vnc_mirrorlink_text_x = -1; static int hf_vnc_mirrorlink_text_y = -1; static int hf_vnc_mirrorlink_text_width = -1; static int hf_vnc_mirrorlink_text_height = -1; static int hf_vnc_mirrorlink_keyboard_request_configuration = -1; static int hf_vnc_mirrorlink_device_status = -1; static int hf_vnc_mirrorlink_app_id = -1; static int hf_vnc_mirrorlink_fb_block_x = -1; static int hf_vnc_mirrorlink_fb_block_y = -1; static int hf_vnc_mirrorlink_fb_block_width = -1; static int hf_vnc_mirrorlink_fb_block_height = -1; static int hf_vnc_mirrorlink_fb_block_reason = -1; static int hf_vnc_mirrorlink_audio_block_reason = -1; static int hf_vnc_mirrorlink_touch_num_events = -1; static int hf_vnc_mirrorlink_touch_x = -1; static int hf_vnc_mirrorlink_touch_y = -1; static int hf_vnc_mirrorlink_touch_id = -1; static int hf_vnc_mirrorlink_touch_pressure = -1; static int hf_vnc_mirrorlink_text = -1; static int hf_vnc_mirrorlink_text_length = -1; static int hf_vnc_mirrorlink_text_max_length = -1; static int hf_vnc_mirrorlink_unknown = -1; /* Fence */ static int hf_vnc_fence_flags = -1; static int hf_vnc_fence_request = -1; static int hf_vnc_fence_sync_next = -1; static int hf_vnc_fence_block_after = -1; static int hf_vnc_fence_block_before = -1; static int hf_vnc_fence_payload_length = -1; static int hf_vnc_fence_payload = -1; static int * const vnc_fence_flags[] = { &hf_vnc_fence_request, &hf_vnc_fence_sync_next, &hf_vnc_fence_block_after, &hf_vnc_fence_block_before, NULL }; /* Context Information */ static int hf_vnc_context_information_app_id = -1; static int hf_vnc_context_information_app_category = -1; static int hf_vnc_context_information_app_trust_level = -1; static int hf_vnc_context_information_content_category = -1; static int hf_vnc_context_information_content_rules = -1; static int hf_vnc_context_information_content_trust_level = -1; /* Scan Line based Run-Length Encoding */ static int hf_vnc_slrle_run_num = -1; static int hf_vnc_slrle_run_data = -1; /* H.264 Encoding */ static int hf_vnc_h264_slice_type = -1; static int hf_vnc_h264_nbytes = -1; static int hf_vnc_h264_width = -1; static int hf_vnc_h264_height = -1; static int hf_vnc_h264_data = -1; /********** End of Server Message Types **********/ static gboolean vnc_preference_desegment = TRUE; /* Initialize the subtree pointers */ static gint ett_vnc = -1; static gint ett_vnc_client_message_type = -1; static gint ett_vnc_server_message_type = -1; static gint ett_vnc_rect = -1; static gint ett_vnc_encoding_type = -1; static gint ett_vnc_rre_subrect = -1; static gint ett_vnc_hextile_subencoding_mask = -1; static gint ett_vnc_hextile_num_subrects = -1; static gint ett_vnc_hextile_subrect = -1; static gint ett_vnc_hextile_tile = -1; static gint ett_vnc_zrle_subencoding = -1; static gint ett_vnc_colormap_num_groups = -1; static gint ett_vnc_colormap_color_group = -1; static gint ett_vnc_desktop_screen = -1; static gint ett_vnc_key_events = -1; static gint ett_vnc_touch_events = -1; static gint ett_vnc_slrle_subline = -1; static gint ett_vnc_fence_flags = -1; static expert_field ei_vnc_possible_gtk_vnc_bug = EI_INIT; static expert_field ei_vnc_auth_code_mismatch = EI_INIT; static expert_field ei_vnc_unknown_tight_vnc_auth = EI_INIT; static expert_field ei_vnc_too_many_rectangles = EI_INIT; static expert_field ei_vnc_too_many_sub_rectangles = EI_INIT; static expert_field ei_vnc_invalid_encoding = EI_INIT; static expert_field ei_vnc_too_many_colors = EI_INIT; static expert_field ei_vnc_too_many_cut_text = EI_INIT; static expert_field ei_vnc_zrle_failed = EI_INIT; static expert_field ei_vnc_unknown_tight = EI_INIT; static expert_field ei_vnc_reassemble = EI_INIT; /* Global so they keep their value between packets */ guint8 vnc_bytes_per_pixel; guint8 vnc_depth; #define VNC_PORT_RANGE "5500-5501,5900-5901" /* Not IANA registered */ static range_t *vnc_tcp_range = NULL; static dissector_handle_t vnc_handle; static dissector_handle_t tls_handle; /* Code to dissect the packets */ static int dissect_vnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { gboolean ret; gint offset = 0; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *vnc_tree; conversation_t *conversation; vnc_conversation_t *per_conversation_info; conversation = find_or_create_conversation(pinfo); /* Retrieve information from conversation, or add it if it isn't * there yet */ per_conversation_info = (vnc_conversation_t *)conversation_get_proto_data(conversation, proto_vnc); if(!per_conversation_info) { per_conversation_info = wmem_new(wmem_file_scope(), vnc_conversation_t); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SERVER_VERSION; per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_INVALID; per_conversation_info->tight_enabled = FALSE; conversation_add_proto_data(conversation, proto_vnc, per_conversation_info); } /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "VNC"); /* First, clear the info column */ col_clear(pinfo->cinfo, COL_INFO); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_vnc, tvb, 0, -1, ENC_NA); vnc_tree = proto_item_add_subtree(ti, ett_vnc); /* Dissect any remaining session startup messages */ ret = vnc_startup_messages(tvb, pinfo, offset, vnc_tree, per_conversation_info); vnc_set_bytes_per_pixel(pinfo, vnc_bytes_per_pixel); vnc_set_depth(pinfo, vnc_depth); if (ret) { return tvb_captured_length(tvb); /* We're in a "startup" state; Cannot yet do "normal" processing */ } if (per_conversation_info->security_type_selected == VNC_SECURITY_TYPE_VENCRYPT) { call_dissector_with_data(tls_handle, tvb, pinfo, vnc_tree, GUINT_TO_POINTER(offset)); return tvb_captured_length(tvb); } if(value_is_in_range(vnc_tcp_range, pinfo->destport) || per_conversation_info->server_port == pinfo->destport) { vnc_client_to_server(tvb, pinfo, &offset, vnc_tree); } else { vnc_server_to_client(tvb, pinfo, &offset, vnc_tree); } return tvb_captured_length(tvb); } /* Returns the new offset after processing the 4-byte vendor string */ static gint process_vendor(proto_tree *tree, gint hfindex, tvbuff_t *tvb, gint offset) { const guint8 *vendor; proto_item *ti; if (tree) { ti = proto_tree_add_item_ret_string(tree, hfindex, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &vendor); if(g_ascii_strcasecmp(vendor, "STDV") == 0) proto_item_append_text(ti, " (Standard VNC vendor)"); else if(g_ascii_strcasecmp(vendor, "TRDV") == 0) proto_item_append_text(ti, " (Tridia VNC vendor)"); else if(g_ascii_strcasecmp(vendor, "TGHT") == 0) proto_item_append_text(ti, " (Tight VNC vendor)"); } offset += 4; return offset; } /* Returns the new offset after processing the specified number of capabilities */ static gint process_tight_capabilities(proto_tree *tree, gint type_index, gint vendor_index, gint name_index, tvbuff_t *tvb, gint offset, const gint num_capabilities) { gint i; /* See vnc_unixsrc/include/rfbproto.h:rfbCapabilityInfo */ for (i = 0; i < num_capabilities; i++) { proto_tree_add_item(tree, type_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset = process_vendor(tree, vendor_index, tvb, offset); proto_tree_add_item(tree, name_index, tvb, offset, 8, ENC_ASCII|ENC_NA); offset += 8; } return offset; } /* Returns true if this looks like a client or server version packet: 12 bytes, in the format "RFB xxx.yyy\n" . * Will check for the 12 bytes exact length, the 'RFB ' string and that it ends with a '\n'. * The exact 'xxx.yyy' is checked later, by trying to convert it to a double using g_ascii_strtod. * pinfo and tree are NULL when using this function to check the heuristics for dissection. If we're * checking the heuristics, we don't need to add expert_info, we just reject that packet as not * being a VNC packet. */ static gboolean vnc_is_client_or_server_version_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if(tvb_captured_length(tvb) != 12) { return FALSE; } if(tvb_strncaseeql(tvb, 0, "RFB ", 4) != 0) { return FALSE; } /* 0x2e = '.' 0xa = '\n' */ if (tvb_get_guint8(tvb, 7) != 0x2e) { return FALSE; } if (tvb_get_guint8(tvb,11) != 0xa) { if (tvb_get_guint8(tvb,11) == 0) { /* Per bug 5469, It appears that any VNC clients using gtk-vnc before [1] was * fixed will exhibit the described protocol violation that prevents wireshark * from dissecting the session. * * [1] http://git.gnome.org/browse/gtk-vnc/commit/?id=bc9e2b19167686dd381a0508af1a5113675d08a2 */ if ((pinfo != NULL) && (tree != NULL)) { proto_tree_add_expert(tree, pinfo, &ei_vnc_possible_gtk_vnc_bug, tvb, -1, 0); } return TRUE; } return FALSE; } return TRUE; } static gboolean test_vnc_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { conversation_t *conversation; if (vnc_is_client_or_server_version_message(tvb, NULL, NULL)) { conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), pinfo->srcport, pinfo->destport, 0); conversation_set_dissector(conversation, vnc_handle); dissect_vnc(tvb, pinfo, tree, data); return TRUE; } return FALSE; } /* Returns true if additional session startup messages follow */ static gboolean vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *tree, vnc_conversation_t *per_conversation_info) { guint8 num_security_types; guint32 desktop_name_len, auth_result, text_len, auth_code; vnc_packet_t *per_packet_info; gint num_tunnel_types; gint num_auth_types; proto_item* auth_item; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); if(!per_packet_info) { per_packet_info = wmem_new(wmem_file_scope(), vnc_packet_t); per_packet_info->state = per_conversation_info->vnc_next_state; per_packet_info->preferred_encoding = -1; p_add_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0, per_packet_info); } /* Packet dissection follows */ switch(per_packet_info->state) { case VNC_SESSION_STATE_SERVER_VERSION : if (!vnc_is_client_or_server_version_message(tvb, pinfo, tree)) return TRUE; /* we still hope to get a SERVER_VERSION message some day. Do not proceed yet */ proto_tree_add_item(tree, hf_vnc_server_proto_ver, tvb, 4, 7, ENC_ASCII); per_conversation_info->server_proto_ver = g_ascii_strtod((char *)tvb_get_string_enc(wmem_packet_scope(), tvb, 4, 7, ENC_ASCII), NULL); per_conversation_info->server_port = pinfo->srcport; col_add_fstr(pinfo->cinfo, COL_INFO, "Server protocol version: %s", tvb_format_text(pinfo->pool, tvb, 4, 7)); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_VERSION; break; case VNC_SESSION_STATE_CLIENT_VERSION : if (!vnc_is_client_or_server_version_message(tvb, pinfo, tree)) return TRUE; /* we still hope to get a CLIENT_VERSION message some day. Do not proceed yet */ proto_tree_add_item(tree, hf_vnc_client_proto_ver, tvb, 4, 7, ENC_ASCII); per_conversation_info->client_proto_ver = g_ascii_strtod((char *)tvb_get_string_enc(wmem_packet_scope(), tvb, 4, 7, ENC_ASCII), NULL); col_add_fstr(pinfo->cinfo, COL_INFO, "Client protocol version: %s", tvb_format_text(pinfo->pool, tvb, 4, 7)); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY; break; case VNC_SESSION_STATE_SECURITY : col_set_str(pinfo->cinfo, COL_INFO, "Security types supported"); /* We're checking against the client protocol version because * the client is the final decider on which version to use * after the server offers the highest version it supports. */ if(per_conversation_info->client_proto_ver >= 3.007) { num_security_types = tvb_get_guint8(tvb, offset); if (tree) { proto_tree_add_item(tree, hf_vnc_num_security_types, tvb, offset, 1, ENC_BIG_ENDIAN); for(offset = 1; offset <= num_security_types; offset++){ proto_tree_add_item(tree, hf_vnc_security_type, tvb, offset, 1, ENC_BIG_ENDIAN); } } per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY_TYPES; } else { /* Version < 3.007: The server decides the * authentication type for us to use */ proto_tree_add_item(tree, hf_vnc_server_security_type, tvb, offset, 4, ENC_BIG_ENDIAN); /* The cast below is possible since in older versions of the protocol the only possible values are 0,1,2 */ per_conversation_info->security_type_selected = (guint8)tvb_get_ntohl(tvb, offset); switch(per_conversation_info->security_type_selected) { case VNC_SECURITY_TYPE_INVALID: /* TODO: In this case (INVALID) the connection has failed */ /* and there should be an error string describing the error */ per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY_TYPES; break; case VNC_SECURITY_TYPE_NONE: per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; break; case VNC_SECURITY_TYPE_VNC: per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE; break; case VNC_SECURITY_TYPE_ARD: per_conversation_info->vnc_next_state = VNC_SESSION_STATE_ARD_AUTHENTICATION_CHALLENGE; break; default: /* Security type not supported by this dissector */ break; } } break; case VNC_SESSION_STATE_SECURITY_TYPES : proto_tree_add_item(tree, hf_vnc_client_security_type, tvb, offset, 1, ENC_BIG_ENDIAN); per_conversation_info->security_type_selected = tvb_get_guint8(tvb, offset); col_add_fstr(pinfo->cinfo, COL_INFO, "Security type %s (%d) selected by client", val_to_str_const(per_conversation_info->security_type_selected, vnc_security_types_vs, "Unknown"), per_conversation_info->security_type_selected); switch(per_conversation_info->security_type_selected) { case VNC_SECURITY_TYPE_NONE : if(per_conversation_info->client_proto_ver >= 3.008) per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY_RESULT; else per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; break; case VNC_SECURITY_TYPE_VNC : per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE; break; case VNC_SECURITY_TYPE_TIGHT : per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_TUNNELING_CAPABILITIES; per_conversation_info->tight_enabled = TRUE; break; case VNC_SECURITY_TYPE_ARD: per_conversation_info->vnc_next_state = VNC_SESSION_STATE_ARD_AUTHENTICATION_CHALLENGE; break; case VNC_SECURITY_TYPE_VENCRYPT: per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VENCRYPT_SERVER_VERSION; break; default : /* Security type not supported by this dissector */ break; } break; case VNC_SESSION_STATE_TIGHT_TUNNELING_CAPABILITIES : { gint i; col_set_str(pinfo->cinfo, COL_INFO, "TightVNC tunneling capabilities supported"); proto_tree_add_item(tree, hf_vnc_tight_num_tunnel_types, tvb, offset, 4, ENC_BIG_ENDIAN); num_tunnel_types = tvb_get_ntohl(tvb, offset); offset += 4; for(i = 0; i < num_tunnel_types; i++) { /* TightVNC and Xvnc don't support any tunnel capabilities yet, but each capability * is 16 bytes, so skip them. */ proto_tree_add_item(tree, hf_vnc_tight_tunnel_type_code, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_tight_tunnel_type_vendor, tvb, offset + 4, 4, ENC_ASCII); proto_tree_add_item(tree, hf_vnc_tight_tunnel_type_signature, tvb, offset + 8, 8, ENC_ASCII); offset += 16; } if (num_tunnel_types == 0) per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_AUTH_CAPABILITIES; else per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_TUNNEL_TYPE_REPLY; break; } case VNC_SESSION_STATE_TIGHT_TUNNEL_TYPE_REPLY: /* Neither TightVNC nor Xvnc implement this; they just have a placeholder that emits an error * message and closes the connection (xserver/hw/vnc/auth.c:rfbProcessClientTunnelingType). * We should actually never get here... */ break; case VNC_SESSION_STATE_TIGHT_AUTH_CAPABILITIES: { const guint8 *vendor, *signature; col_set_str(pinfo->cinfo, COL_INFO, "TightVNC authentication capabilities supported"); proto_tree_add_item(tree, hf_vnc_tight_num_auth_types, tvb, offset, 4, ENC_BIG_ENDIAN); num_auth_types = tvb_get_ntohl(tvb, offset); offset += 4; auth_code = tvb_get_ntohl(tvb, offset); auth_item = proto_tree_add_item(tree, hf_vnc_tight_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; vendor = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII); process_vendor(tree, hf_vnc_tight_server_vendor, tvb, offset); offset += 4; proto_tree_add_item_ret_string(tree, hf_vnc_tight_signature, tvb, offset, 8, ENC_ASCII|ENC_NA, wmem_packet_scope(), &signature); switch(auth_code) { case VNC_SECURITY_TYPE_NONE: if ((g_ascii_strcasecmp(vendor, "STDV") != 0) || (g_ascii_strcasecmp(signature, "NOAUTH__") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; case VNC_SECURITY_TYPE_VNC: if ((g_ascii_strcasecmp(vendor, "STDV") != 0) || (g_ascii_strcasecmp(signature, "VNCAUTH_") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; case VNC_SECURITY_TYPE_VENCRYPT: if ((g_ascii_strcasecmp(vendor, "VENC") != 0) || (g_ascii_strcasecmp(signature, "VENCRYPT") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; case VNC_SECURITY_TYPE_GTK_VNC_SASL: if ((g_ascii_strcasecmp(vendor, "GTKV") != 0) || (g_ascii_strcasecmp(signature, "SASL____") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; case VNC_TIGHT_AUTH_TGHT_ULGNAUTH: if ((g_ascii_strcasecmp(vendor, "TGHT") != 0) || (g_ascii_strcasecmp(signature, "ULGNAUTH") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; case VNC_TIGHT_AUTH_TGHT_XTRNAUTH: if ((g_ascii_strcasecmp(vendor, "TGHT") != 0) || (g_ascii_strcasecmp(signature, "XTRNAUTH") != 0)) { expert_add_info(pinfo, auth_item, &ei_vnc_auth_code_mismatch); } break; default: expert_add_info(pinfo, auth_item, &ei_vnc_unknown_tight_vnc_auth); break; } if (num_auth_types == 0) per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; else per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_AUTH_TYPE_REPLY; break; } case VNC_SESSION_STATE_TIGHT_AUTH_TYPE_REPLY: col_set_str(pinfo->cinfo, COL_INFO, "TightVNC authentication type selected by client"); auth_code = tvb_get_ntohl(tvb, offset); auth_item = proto_tree_add_item(tree, hf_vnc_tight_auth_code, tvb, offset, 4, ENC_BIG_ENDIAN); switch(auth_code) { case VNC_SECURITY_TYPE_NONE: per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_NONE; per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; break; case VNC_SECURITY_TYPE_VNC: per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_VNC; per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE; break; case VNC_SECURITY_TYPE_GTK_VNC_SASL: per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_GTK_VNC_SASL; /* TODO: dissection not implemented yet */ per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3; break; case VNC_TIGHT_AUTH_TGHT_ULGNAUTH: per_conversation_info->security_type_selected = VNC_TIGHT_AUTH_TGHT_ULGNAUTH; /* TODO: dissection not implemented yet */ per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3; break; case VNC_TIGHT_AUTH_TGHT_XTRNAUTH: per_conversation_info->security_type_selected = VNC_TIGHT_AUTH_TGHT_XTRNAUTH; /* TODO: dissection not implemented yet */ per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3; break; default: expert_add_info(pinfo, auth_item, &ei_vnc_unknown_tight_vnc_auth); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3; break; } break; case VNC_SESSION_STATE_TIGHT_UNKNOWN_PACKET3 : col_set_str(pinfo->cinfo, COL_INFO, "Unknown packet (TightVNC)"); proto_tree_add_expert(tree, pinfo, &ei_vnc_unknown_tight, tvb, offset, -1); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE; break; case VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE : col_set_str(pinfo->cinfo, COL_INFO, "Authentication challenge from server"); proto_tree_add_item(tree, hf_vnc_auth_challenge, tvb, offset, 16, ENC_NA); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_RESPONSE; break; case VNC_SESSION_STATE_VNC_AUTHENTICATION_RESPONSE : col_set_str(pinfo->cinfo, COL_INFO, "Authentication response from client"); proto_tree_add_item(tree, hf_vnc_auth_response, tvb, offset, 16, ENC_NA); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY_RESULT; break; case VNC_SESSION_STATE_ARD_AUTHENTICATION_CHALLENGE : { gint key_len; col_set_str(pinfo->cinfo, COL_INFO, "ARD authentication challenge"); proto_tree_add_item(tree, hf_vnc_ard_auth_generator, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_ard_auth_key_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN); key_len = tvb_get_ntohs(tvb, offset + 2); offset += 4; proto_tree_add_item(tree, hf_vnc_ard_auth_modulus, tvb, offset, key_len, ENC_NA); proto_tree_add_item(tree, hf_vnc_ard_auth_server_key, tvb, offset + key_len, key_len, ENC_NA); per_conversation_info->ard_key_length = key_len; per_conversation_info->vnc_next_state = VNC_SESSION_STATE_ARD_AUTHENTICATION_RESPONSE; } break; case VNC_SESSION_STATE_ARD_AUTHENTICATION_RESPONSE : col_set_str(pinfo->cinfo, COL_INFO, "ARD authentication response"); proto_tree_add_item(tree, hf_vnc_ard_auth_credentials, tvb, offset, 128, ENC_NA); proto_tree_add_item(tree, hf_vnc_ard_auth_client_key, tvb, offset + 128, per_conversation_info->ard_key_length, ENC_NA); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SECURITY_RESULT; break; case VNC_SESSION_STATE_SECURITY_RESULT : col_set_str(pinfo->cinfo, COL_INFO, "Authentication result"); proto_tree_add_item(tree, hf_vnc_auth_result, tvb, offset, 4, ENC_BIG_ENDIAN); auth_result = tvb_get_ntohl(tvb, offset); offset += 4; switch(auth_result) { case 0 : /* OK */ per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; break; case 1 : /* Failed */ if(per_conversation_info->client_proto_ver >= 3.008) { text_len = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_vnc_auth_error_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vnc_auth_error, tvb, offset, text_len, ENC_ASCII); } return TRUE; /* All versions: Do not continue processing VNC packets as connection will be closed after this packet. */ break; } break; case VNC_SESSION_STATE_VENCRYPT_SERVER_VERSION: { proto_tree_add_item(tree, hf_vnc_vencrypt_server_major_ver, tvb, offset, 1, ENC_BIG_ENDIAN); gint major = tvb_get_guint8(tvb, offset++); proto_tree_add_item(tree, hf_vnc_vencrypt_server_minor_ver, tvb, offset, 1, ENC_BIG_ENDIAN); gint minor = tvb_get_guint8(tvb, offset++); col_add_fstr(pinfo->cinfo, COL_INFO, "VeNCrypt server version %d.%d", major, minor); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VENCRYPT_CLIENT_VERSION; break; } case VNC_SESSION_STATE_VENCRYPT_CLIENT_VERSION: { proto_tree_add_item(tree, hf_vnc_vencrypt_client_major_ver, tvb, offset, 1, ENC_BIG_ENDIAN); gint major = tvb_get_guint8(tvb, offset++); proto_tree_add_item(tree, hf_vnc_vencrypt_client_minor_ver, tvb, offset, 1, ENC_BIG_ENDIAN); gint minor = tvb_get_guint8(tvb, offset++); col_add_fstr(pinfo->cinfo, COL_INFO, "VeNCrypt client version %d.%d", major, minor); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VENCRYPT_AUTH_CAPABILITIES; break; } case VNC_SESSION_STATE_VENCRYPT_AUTH_CAPABILITIES: { gint i; col_set_str(pinfo->cinfo, COL_INFO, "VeNCrypt authentication types supported"); proto_tree_add_item(tree, hf_vnc_vencrypt_version_ack, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_vencrypt_num_auth_types, tvb, offset, 1, ENC_BIG_ENDIAN); num_tunnel_types = tvb_get_guint8(tvb, offset); offset += 1; for(i = 0; i < num_tunnel_types; i++) { proto_tree_add_item(tree, hf_vnc_vencrypt_auth_type, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VENCRYPT_AUTH_TYPE_REPLY; break; } case VNC_SESSION_STATE_VENCRYPT_AUTH_TYPE_REPLY: { guint32 authtype = tvb_get_ntohl(tvb, offset); col_add_fstr(pinfo->cinfo, COL_INFO, "VeNCrypt authentication type %s (%d) selected by client", val_to_str_const(authtype, vnc_vencrypt_auth_types_vs, "Unknown"), authtype); proto_tree_add_item(tree, hf_vnc_vencrypt_auth_type, tvb, offset, 4, ENC_BIG_ENDIAN); /* offset+=4; */ if (authtype == VNC_SECURITY_TYPE_NONE) { per_conversation_info->vnc_next_state = VNC_SESSION_STATE_CLIENT_INIT; per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_NONE; } else if (authtype == VNC_SECURITY_TYPE_VNC) { per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VNC_AUTHENTICATION_CHALLENGE; per_conversation_info->security_type_selected = VNC_SECURITY_TYPE_VNC; } else { per_conversation_info->vnc_next_state = VNC_SESSION_STATE_VENCRYPT_AUTH_ACK; } break; } case VNC_SESSION_STATE_VENCRYPT_AUTH_ACK: col_set_str(pinfo->cinfo, COL_INFO, "VeNCrypt server ack"); proto_tree_add_item(tree, hf_vnc_vencrypt_auth_type_ack, tvb, offset, 1, ENC_BIG_ENDIAN); tls_handle = find_dissector("tls"); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_NORMAL_TRAFFIC; break; case VNC_SESSION_STATE_CLIENT_INIT : col_set_str(pinfo->cinfo, COL_INFO, "Share desktop flag"); proto_tree_add_item(tree, hf_vnc_share_desktop_flag, tvb, offset, 1, ENC_BIG_ENDIAN); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_SERVER_INIT; break; case VNC_SESSION_STATE_SERVER_INIT : col_set_str(pinfo->cinfo, COL_INFO, "Server framebuffer parameters"); proto_tree_add_item(tree, hf_vnc_width, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vnc_height, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vnc_server_bits_per_pixel, tvb, offset, 1, ENC_BIG_ENDIAN); vnc_bytes_per_pixel = tvb_get_guint8(tvb, offset)/8; vnc_set_bytes_per_pixel(pinfo, vnc_bytes_per_pixel); offset += 1; proto_tree_add_item(tree, hf_vnc_server_depth, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_server_big_endian_flag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_server_true_color_flag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_server_red_max, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vnc_server_green_max, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vnc_server_blue_max, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vnc_server_red_shift, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_server_green_shift, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_server_blue_shift, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_vnc_padding, tvb, offset, 3, ENC_NA); offset += 3; /* Skip over 3 bytes of padding */ if(tvb_reported_length_remaining(tvb, offset) > 4) { /* Sometimes the desktop name & length is skipped */ proto_tree_add_item(tree, hf_vnc_desktop_name_len, tvb, offset, 4, ENC_BIG_ENDIAN); desktop_name_len = tvb_get_ntohl(tvb, offset); offset += 4; proto_tree_add_item(tree, hf_vnc_desktop_name, tvb, offset, desktop_name_len, ENC_ASCII); } if(per_conversation_info->tight_enabled == TRUE) per_conversation_info->vnc_next_state = VNC_SESSION_STATE_TIGHT_INTERACTION_CAPS; else per_conversation_info->vnc_next_state = VNC_SESSION_STATE_NORMAL_TRAFFIC; break; case VNC_SESSION_STATE_TIGHT_INTERACTION_CAPS : col_set_str(pinfo->cinfo, COL_INFO, "TightVNC Interaction Capabilities"); proto_tree_add_item(tree, hf_vnc_num_server_message_types, tvb, offset, 2, ENC_BIG_ENDIAN); per_conversation_info->num_server_message_types = tvb_get_ntohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_vnc_num_client_message_types, tvb, offset, 2, ENC_BIG_ENDIAN); per_conversation_info->num_client_message_types = tvb_get_ntohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_vnc_num_encoding_types, tvb, offset, 2, ENC_BIG_ENDIAN); per_conversation_info->num_encoding_types = tvb_get_ntohs(tvb, offset); offset += 2; proto_tree_add_item(tree, hf_vnc_padding, tvb, offset, 2, ENC_NA); offset += 2; offset = process_tight_capabilities(tree, hf_vnc_tight_server_message_type, hf_vnc_tight_server_vendor, hf_vnc_tight_server_name, tvb, offset, per_conversation_info->num_server_message_types); offset = process_tight_capabilities(tree, hf_vnc_tight_client_message_type, hf_vnc_tight_client_vendor, hf_vnc_tight_client_name, tvb, offset, per_conversation_info->num_client_message_types); process_tight_capabilities(tree, hf_vnc_tight_encoding_type, hf_vnc_tight_encoding_vendor, hf_vnc_tight_encoding_name, tvb, offset, per_conversation_info->num_encoding_types); per_conversation_info->vnc_next_state = VNC_SESSION_STATE_NORMAL_TRAFFIC; break; case VNC_SESSION_STATE_NORMAL_TRAFFIC : return FALSE; } return TRUE; } static void vnc_client_to_server(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint8 message_type; proto_item *ti; proto_tree *vnc_client_message_type_tree; message_type = tvb_get_guint8(tvb, *offset); ti = proto_tree_add_item(tree, hf_vnc_client_message_type, tvb, *offset, 1, ENC_BIG_ENDIAN); vnc_client_message_type_tree = proto_item_add_subtree(ti, ett_vnc_client_message_type); *offset += 1; switch(message_type) { case VNC_CLIENT_MESSAGE_TYPE_SET_PIXEL_FORMAT : vnc_client_set_pixel_format(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_SET_ENCODINGS : vnc_client_set_encodings(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_FRAMEBUF_UPDATE_REQ : vnc_client_framebuffer_update_request(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_KEY_EVENT : vnc_client_key_event(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_POINTER_EVENT: vnc_client_pointer_event(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_CLIENT_CUT_TEXT : vnc_client_cut_text(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_MIRRORLINK : vnc_mirrorlink(tvb, pinfo, offset, vnc_client_message_type_tree); break; case VNC_CLIENT_MESSAGE_TYPE_ENABLE_CONTINUOUS_UPDATES : col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Client Enable Continuous Updates"); *offset += 9; break; case VNC_CLIENT_MESSAGE_TYPE_FENCE : vnc_fence(tvb, pinfo, offset, vnc_client_message_type_tree); break; default : col_append_sep_fstr(pinfo->cinfo, COL_INFO, "; ", "Unknown client message type (%u)", message_type); break; } } static void vnc_server_to_client(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { gint start_offset; guint8 message_type; gint bytes_needed = 0; proto_item *ti; proto_tree *vnc_server_message_type_tree; again: start_offset = *offset; message_type = tvb_get_guint8(tvb, *offset); ti = proto_tree_add_item(tree, hf_vnc_server_message_type, tvb, *offset, 1, ENC_BIG_ENDIAN); vnc_server_message_type_tree = proto_item_add_subtree(ti, ett_vnc_server_message_type); *offset += 1; switch(message_type) { case VNC_SERVER_MESSAGE_TYPE_FRAMEBUFFER_UPDATE : bytes_needed = vnc_server_framebuffer_update(tvb, pinfo, offset, vnc_server_message_type_tree); break; case VNC_SERVER_MESSAGE_TYPE_SET_COLORMAP_ENTRIES : bytes_needed = vnc_server_set_colormap_entries(tvb, pinfo, offset, vnc_server_message_type_tree); break; case VNC_SERVER_MESSAGE_TYPE_RING_BELL : vnc_server_ring_bell(tvb, pinfo, offset, vnc_server_message_type_tree); break; case VNC_SERVER_MESSAGE_TYPE_CUT_TEXT : bytes_needed = vnc_server_cut_text(tvb, pinfo, offset, vnc_server_message_type_tree); break; case VNC_SERVER_MESSAGE_TYPE_MIRRORLINK : bytes_needed = vnc_mirrorlink(tvb, pinfo, offset, vnc_server_message_type_tree); break; case VNC_SERVER_MESSAGE_TYPE_END_CONTINUOUS_UPDATES : col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Server End Continuous Updates"); *offset += 1; break; case VNC_SERVER_MESSAGE_TYPE_FENCE : bytes_needed = vnc_fence(tvb, pinfo, offset, vnc_server_message_type_tree); break; default : col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Unknown server message type"); *offset = tvb_reported_length(tvb); /* Swallow the rest of the segment */ break; } if(bytes_needed > 0 && vnc_preference_desegment && pinfo->can_desegment) { proto_tree_add_expert(vnc_server_message_type_tree, pinfo, &ei_vnc_reassemble, tvb, start_offset, -1); pinfo->desegment_offset = start_offset; pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; return; } if ((unsigned)*offset < tvb_reported_length(tvb)) { goto again; } } static void vnc_client_set_pixel_format(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { col_set_str(pinfo->cinfo, COL_INFO, "Client set pixel format"); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 3, ENC_NA); *offset += 3; /* Skip over 3 bytes of padding */ proto_tree_add_item(tree, hf_vnc_client_bits_per_pixel, tvb, *offset, 1, ENC_BIG_ENDIAN); vnc_bytes_per_pixel = tvb_get_guint8(tvb, *offset)/8; vnc_set_bytes_per_pixel(pinfo, vnc_bytes_per_pixel); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_depth, tvb, *offset, 1, ENC_BIG_ENDIAN); vnc_depth = tvb_get_guint8(tvb, *offset); vnc_set_depth(pinfo, vnc_depth); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_big_endian_flag, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_true_color_flag, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_red_max, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_client_green_max, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_client_blue_max, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_client_red_shift, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_green_shift, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_client_blue_shift, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 3, ENC_NA); *offset += 3; /* Skip over 3 bytes of padding */ } static void vnc_client_set_encodings(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint16 number_of_encodings; guint counter; vnc_packet_t *per_packet_info; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); col_set_str(pinfo->cinfo, COL_INFO, "Client set encodings"); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 1, ENC_NA); *offset += 1; /* Skip over 1 byte of padding */ number_of_encodings = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_vnc_encoding_num, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; per_packet_info->preferred_encoding = -1; for(counter = 0; counter < number_of_encodings; counter++) { proto_tree_add_item(tree, hf_vnc_client_set_encodings_encoding_type, tvb, *offset, 4, ENC_BIG_ENDIAN); /* Remember the first real encoding as the preferred encoding, * per xserver/hw/vnc/rfbserver.c:rfbProcessClientNormalMessage(). * Otherwise, use RAW as the preferred encoding. */ if (per_packet_info->preferred_encoding == -1) { int encoding; encoding = tvb_get_ntohl(tvb, *offset); switch(encoding) { case VNC_ENCODING_TYPE_RAW: case VNC_ENCODING_TYPE_RRE: case VNC_ENCODING_TYPE_CORRE: case VNC_ENCODING_TYPE_HEXTILE: case VNC_ENCODING_TYPE_ZLIB: case VNC_ENCODING_TYPE_TIGHT: per_packet_info->preferred_encoding = encoding; break; } } *offset += 4; } if (per_packet_info->preferred_encoding == -1) per_packet_info->preferred_encoding = VNC_ENCODING_TYPE_RAW; } static void vnc_client_framebuffer_update_request(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { col_set_str(pinfo->cinfo, COL_INFO, "Client framebuffer update request"); proto_tree_add_item(tree, hf_vnc_update_req_incremental, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_update_req_x_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_update_req_y_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_update_req_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_update_req_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; } static void vnc_client_key_event(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { col_set_str(pinfo->cinfo, COL_INFO, "Client key event"); proto_tree_add_item(tree, hf_vnc_key_down, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 2, ENC_NA); *offset += 2; /* Skip over 2 bytes of padding */ proto_tree_add_item(tree, hf_vnc_key, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; } static void vnc_client_pointer_event(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { col_set_str(pinfo->cinfo, COL_INFO, "Client pointer event"); proto_tree_add_item(tree, hf_vnc_button_1_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_2_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_3_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_4_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_5_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_6_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_7_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_vnc_button_8_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_pointer_x_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_pointer_y_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; } static void vnc_client_cut_text(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint32 text_len; col_set_str(pinfo->cinfo, COL_INFO, "Client cut text"); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 3, ENC_NA); *offset += 3; /* Skip over 3 bytes of padding */ text_len = tvb_get_ntohl(tvb, *offset); proto_tree_add_item(tree, hf_vnc_client_cut_text_len, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_client_cut_text, tvb, *offset, text_len, ENC_ASCII); *offset += text_len; } static guint vnc_server_framebuffer_update(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint ii; guint num_rects; guint16 width, height; guint bytes_needed = 0; guint32 encoding_type; proto_item *ti, *ti_x, *ti_y, *ti_width, *ti_height; proto_tree *vnc_rect_tree, *vnc_encoding_type_tree; col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Server framebuffer update"); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 1, ENC_NA); *offset += 1; num_rects = tvb_get_ntohs(tvb, *offset); ti = proto_tree_add_item(tree, hf_vnc_rectangle_num, tvb, *offset, 2, ENC_BIG_ENDIAN); /* In some cases, TIGHT encoding ignores the "number of rectangles" field; */ /* VNC_ENCODING_TYPE_LAST_RECT is used to indicate the end of the rectangle list. */ /* (It appears that TIGHT encoding uses 0xFFFF for the num_rects field when the */ /* field is not being used). For now: we'll assume that a value 0f 0xFFFF means */ /* that the field is not being used. */ if (num_rects == 0xFFFF) { proto_item_append_text(ti, " [TIGHT encoding assumed (field is not used)]"); } if ((num_rects != 0xFFFF) && (num_rects > 5000)) { expert_add_info_format(pinfo, ti, &ei_vnc_too_many_rectangles, "Too many rectangles (%d), aborting dissection", num_rects); return(0); } *offset += 2; for(ii = 0; ii < num_rects; ii++) { if (ii > 5000) { expert_add_info_format(pinfo, ti, &ei_vnc_too_many_rectangles, "Too many rectangles (%d), aborting dissection", ii); return(0); } VNC_BYTES_NEEDED(12); vnc_rect_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 12, ett_vnc_rect, NULL, "Rectangle #%d", ii+1); ti_x = proto_tree_add_item(vnc_rect_tree, hf_vnc_fb_update_x_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; ti_y = proto_tree_add_item(vnc_rect_tree, hf_vnc_fb_update_y_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; ti_width = proto_tree_add_item(vnc_rect_tree, hf_vnc_fb_update_width, tvb, *offset, 2, ENC_BIG_ENDIAN); width = tvb_get_ntohs(tvb, *offset); *offset += 2; ti_height = proto_tree_add_item(vnc_rect_tree, hf_vnc_fb_update_height, tvb, *offset, 2, ENC_BIG_ENDIAN); height = tvb_get_ntohs(tvb, *offset); *offset += 2; ti = proto_tree_add_item(vnc_rect_tree, hf_vnc_fb_update_encoding_type, tvb, *offset, 4, ENC_BIG_ENDIAN); encoding_type = tvb_get_ntohl(tvb, *offset); *offset += 4; if (encoding_type == VNC_ENCODING_TYPE_LAST_RECT) break; /* exit the loop */ vnc_encoding_type_tree = proto_item_add_subtree(ti, ett_vnc_encoding_type); switch(encoding_type) { case VNC_ENCODING_TYPE_RAW: bytes_needed = vnc_raw_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_COPY_RECT: bytes_needed = vnc_copyrect_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_RRE: bytes_needed = vnc_rre_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_HEXTILE: bytes_needed = vnc_hextile_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_RLE: bytes_needed = vnc_zrle_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_TIGHT: bytes_needed = vnc_tight_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_RICH_CURSOR: case VNC_ENCODING_TYPE_X_CURSOR: proto_item_append_text (ti_x, " (hotspot X)"); proto_item_append_text (ti_y, " (hotspot Y)"); proto_item_append_text (ti_width, " (cursor width)"); proto_item_append_text (ti_height, " (cursor height)"); if (encoding_type == VNC_ENCODING_TYPE_RICH_CURSOR) bytes_needed = vnc_rich_cursor_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); else bytes_needed = vnc_x_cursor_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_POINTER_POS: proto_item_append_text (ti_x, " (pointer X)"); proto_item_append_text (ti_y, " (pointer Y)"); proto_item_append_text (ti_width, " (unused)"); proto_item_append_text (ti_height, " (unused)"); bytes_needed = 0; break; case VNC_ENCODING_TYPE_DESKTOP_SIZE: /* There is no payload for this message type */ bytes_needed = 0; break; case VNC_ENCODING_TYPE_EXTENDED_DESK_SIZE : bytes_needed = vnc_extended_desktop_size(tvb, offset, vnc_encoding_type_tree); break; case VNC_ENCODING_TYPE_KEYBOARD_LED_STATE : /* There is no payload for this message type */ bytes_needed = 0; break; case VNC_ENCODING_TYPE_SUPPORTED_MESSAGES : bytes_needed = vnc_supported_messages(tvb, offset, vnc_encoding_type_tree, width); break; case VNC_ENCODING_TYPE_SUPPORTED_ENCODINGS : bytes_needed = vnc_supported_encodings(tvb, offset, vnc_encoding_type_tree, width, height); break; case VNC_ENCODING_TYPE_SERVER_IDENTITY : bytes_needed = vnc_server_identity(tvb, offset, vnc_encoding_type_tree, width); break; case VNC_ENCODING_TYPE_CONTEXT_INFORMATION : bytes_needed = vnc_context_information(tvb, offset, vnc_encoding_type_tree); break; case VNC_ENCODING_TYPE_SLRLE : bytes_needed = vnc_slrle_encoding(tvb, pinfo, offset, vnc_encoding_type_tree, height); break; case VNC_ENCODING_TYPE_H264 : bytes_needed = vnc_h264_encoding(tvb, offset, vnc_encoding_type_tree); break; } /* Check if the routines above requested more bytes to * be desegmented. */ if(bytes_needed > 0) return bytes_needed; } return 0; } static guint32 vnc_extended_desktop_size(tvbuff_t *tvb, gint *offset, proto_tree *tree) { guint8 i, num_of_screens; proto_tree *screen_tree; num_of_screens = tvb_get_guint8(tvb, *offset); proto_tree_add_item(tree, hf_vnc_desktop_screen_num, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 3, ENC_NA); VNC_BYTES_NEEDED((guint32)(3 + (num_of_screens * 16))); *offset += 3; for(i = 0; i < num_of_screens; i++) { screen_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 16, ett_vnc_desktop_screen, NULL, "Screen #%u", i+1); proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_id, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_x, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_y, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(screen_tree, hf_vnc_desktop_screen_flags, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; } return 0; } static guint vnc_raw_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) { guint8 bytes_per_pixel = vnc_get_bytes_per_pixel(pinfo); guint length; length = width * height * bytes_per_pixel; VNC_BYTES_NEEDED(length); proto_tree_add_item(tree, hf_vnc_raw_pixel_data, tvb, *offset, length, ENC_NA); *offset += length; return 0; /* bytes_needed */ } static guint vnc_copyrect_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset, proto_tree *tree, const guint16 width _U_, const guint16 height _U_) { proto_tree_add_item(tree, hf_vnc_copyrect_src_x_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_copyrect_src_y_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; return 0; /* bytes_needed */ } static guint vnc_rre_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width _U_, const guint16 height _U_) { guint8 bytes_per_pixel = vnc_get_bytes_per_pixel(pinfo); guint32 num_subrects, i; guint bytes_needed; proto_item *ti; proto_tree *subrect_tree; VNC_BYTES_NEEDED(4); ti = proto_tree_add_item(tree, hf_vnc_rre_num_subrects, tvb, *offset, 4, ENC_BIG_ENDIAN); num_subrects = tvb_get_ntohl(tvb, *offset); *offset += 4; if (num_subrects > 10000) { expert_add_info_format(pinfo, ti, &ei_vnc_too_many_sub_rectangles, "Too many sub-rectangles (%d), aborting dissection", num_subrects); return(0); } VNC_BYTES_NEEDED(bytes_per_pixel); proto_tree_add_item(tree, hf_vnc_rre_bg_pixel, tvb, *offset, bytes_per_pixel, ENC_NA); *offset += bytes_per_pixel; /* We know we need (at least) all these bytes, so ask for them now * (instead of a few at a time...). */ bytes_needed = bytes_per_pixel + 8; VNC_BYTES_NEEDED(bytes_needed * num_subrects); for(i = 0; i < num_subrects; i++) { subrect_tree = proto_tree_add_subtree_format(tree, tvb, *offset, bytes_per_pixel + 8, ett_vnc_rre_subrect, NULL, "Subrectangle #%d", i+1); proto_tree_add_item(subrect_tree, hf_vnc_rre_subrect_pixel, tvb, *offset, bytes_per_pixel, ENC_NA); *offset += bytes_per_pixel; proto_tree_add_item(subrect_tree, hf_vnc_rre_subrect_x_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(subrect_tree, hf_vnc_rre_subrect_y_pos, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(subrect_tree, hf_vnc_rre_subrect_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(subrect_tree, hf_vnc_rre_subrect_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; } return 0; /* bytes_needed */ } static guint vnc_hextile_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) { guint8 bytes_per_pixel = vnc_get_bytes_per_pixel(pinfo); guint8 i, subencoding_mask, num_subrects, subrect_len, tile_height, tile_width; guint32 raw_length; proto_tree *tile_tree, *subencoding_mask_tree, *subrect_tree, *num_subrects_tree; proto_item *ti; guint16 current_height = 0, current_width; while(current_height != height) { if (current_height + 16 > height) tile_height = height - current_height; else tile_height = 16; current_height += tile_height; current_width = 0; while(current_width != width) { if (current_width + 16 > width) tile_width = width - current_width; else tile_width = 16; current_width += tile_width; VNC_BYTES_NEEDED(1); subencoding_mask = tvb_get_guint8(tvb, *offset); tile_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 1, ett_vnc_hextile_tile, NULL, "Tile {%d:%d}, sub encoding mask %u", current_width, current_height, subencoding_mask); ti = proto_tree_add_item(tile_tree, hf_vnc_hextile_subencoding_mask, tvb, *offset, 1, ENC_BIG_ENDIAN); subencoding_mask_tree = proto_item_add_subtree(ti, ett_vnc_hextile_subencoding_mask); proto_tree_add_item(subencoding_mask_tree, hf_vnc_hextile_raw, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subencoding_mask_tree, hf_vnc_hextile_bg, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subencoding_mask_tree, hf_vnc_hextile_fg, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subencoding_mask_tree, hf_vnc_hextile_anysubrects, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subencoding_mask_tree, hf_vnc_hextile_subrectscolored, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; if(subencoding_mask & 0x1) { /* Raw */ raw_length = tile_width * tile_height * bytes_per_pixel; VNC_BYTES_NEEDED(raw_length); proto_tree_add_item(tile_tree, hf_vnc_hextile_raw_value, tvb, *offset, raw_length, ENC_NA); *offset += raw_length; } else { if(subencoding_mask & 0x2) { /* Background Specified */ VNC_BYTES_NEEDED(bytes_per_pixel); proto_tree_add_item(tile_tree, hf_vnc_hextile_bg_value, tvb, *offset, bytes_per_pixel, ENC_NA); *offset += bytes_per_pixel; } if(subencoding_mask & 0x4) { /* Foreground Specified */ VNC_BYTES_NEEDED(bytes_per_pixel); proto_tree_add_item(tile_tree, hf_vnc_hextile_fg_value, tvb, *offset, bytes_per_pixel, ENC_NA); *offset += bytes_per_pixel; } if(subencoding_mask & 0x8) { /* Any Subrects */ VNC_BYTES_NEEDED(3); /* 1 byte for number of subrects field, +2 at least for 1 subrect */ ti = proto_tree_add_item(tile_tree, hf_vnc_hextile_num_subrects, tvb, *offset, 1, ENC_BIG_ENDIAN); num_subrects = tvb_get_guint8(tvb, *offset); *offset += 1; if(subencoding_mask & 0x10) subrect_len = bytes_per_pixel + 2; else subrect_len = 2; VNC_BYTES_NEEDED((guint)(subrect_len * num_subrects)); num_subrects_tree = proto_item_add_subtree(ti, ett_vnc_hextile_num_subrects); for(i = 0; i < num_subrects; i++) { subrect_tree = proto_tree_add_subtree_format(num_subrects_tree, tvb, *offset, subrect_len, ett_vnc_hextile_subrect, NULL, "Subrectangle #%d", i+1); if(subencoding_mask & 0x10) { /* Subrects Colored */ proto_tree_add_item(subrect_tree, hf_vnc_hextile_subrect_pixel_value, tvb, *offset, bytes_per_pixel, ENC_NA); *offset += bytes_per_pixel; } proto_tree_add_item(subrect_tree, hf_vnc_hextile_subrect_x_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subrect_tree, hf_vnc_hextile_subrect_y_pos, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(subrect_tree, hf_vnc_hextile_subrect_width, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subrect_tree, hf_vnc_hextile_subrect_height, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; } } } } } return 0; /* bytes_needed */ } static guint vnc_supported_messages(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width) { VNC_BYTES_NEEDED(width); if (width >= 64) { proto_tree_add_item(tree, hf_vnc_supported_messages_client2server, tvb, *offset, 32, ENC_NA); *offset += 32; proto_tree_add_item(tree, hf_vnc_supported_messages_server2client, tvb, *offset, 32, ENC_NA); *offset += 32; *offset += width - 64; } else { *offset += width; } return 0; /* bytes_needed */ } static guint vnc_supported_encodings(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) { guint16 i = width; proto_tree_add_uint(tree, hf_vnc_num_supported_encodings, tvb, *offset, 0, height); VNC_BYTES_NEEDED(width); for (; i >= 4; i -= 4) { proto_tree_add_item(tree, hf_vnc_supported_encodings, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; } *offset += i; return 0; /* bytes_needed */ } static guint vnc_server_identity(tvbuff_t *tvb, gint *offset, proto_tree *tree, const guint16 width) { VNC_BYTES_NEEDED(width); proto_tree_add_item(tree, hf_vnc_server_identity, tvb, *offset, width, ENC_ASCII); *offset += width; return 0; /* bytes_needed */ } static guint vnc_mirrorlink(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint8 type; guint16 length; guint16 num, i; gint end; proto_tree *sub_tree; /* Header */ VNC_BYTES_NEEDED(3); type = tvb_get_guint8(tvb, *offset); proto_tree_add_item(tree, hf_vnc_mirrorlink_type, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; length = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_vnc_mirrorlink_length, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; col_add_fstr(pinfo->cinfo, COL_INFO, "MirrorLink (%s)", val_to_str_const(type, vnc_mirrorlink_types_vs, "Unknown")); /* Payload */ end = *offset + length; switch(type) { case VNC_ML_EXT_BYE_BYE : break; case VNC_ML_EXT_SERVER_DISPLAY_CONFIGURATION : VNC_BYTES_NEEDED(12); proto_tree_add_item(tree, hf_vnc_mirrorlink_version_major, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_mirrorlink_version_minor, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_mirrorlink_framebuffer_configuration, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_pixel_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_pixel_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_pixel_format, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; case VNC_ML_EXT_CLIENT_DISPLAY_CONFIGURATION : VNC_BYTES_NEEDED(14); proto_tree_add_item(tree, hf_vnc_mirrorlink_version_major, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_mirrorlink_version_minor, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_mirrorlink_framebuffer_configuration, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_pixel_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_pixel_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_display_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_display_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_display_distance, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; break; case VNC_ML_EXT_SERVER_EVENT_CONFIGURATION : case VNC_ML_EXT_CLIENT_EVENT_CONFIGURATION : VNC_BYTES_NEEDED(28); proto_tree_add_item(tree, hf_vnc_mirrorlink_keyboard_language, tvb, *offset, 2, ENC_ASCII); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_keyboard_country, tvb, *offset, 2, ENC_ASCII); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_ui_language, tvb, *offset, 2, ENC_ASCII); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_ui_country, tvb, *offset, 2, ENC_ASCII); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_knob_keys, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_device_keys, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_multimedia_keys, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_key_related, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_pointer_related, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; case VNC_ML_EXT_EVENT_MAPPING : case VNC_ML_EXT_EVENT_MAPPING_REQUEST : VNC_BYTES_NEEDED(8); proto_tree_add_item(tree, hf_vnc_mirrorlink_key_symbol_value_client, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_key_symbol_value_server, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; case VNC_ML_EXT_KEY_EVENT_LISTING : VNC_BYTES_NEEDED(4); proto_tree_add_item(tree, hf_vnc_mirrorlink_key_configuration, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; num = tvb_get_guint8(tvb, *offset); proto_tree_add_item(tree, hf_vnc_mirrorlink_key_num_events, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_vnc_mirrorlink_key_event_counter, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; VNC_BYTES_NEEDED((guint)(4 * num)); sub_tree = proto_tree_add_subtree(tree, tvb, *offset, 4 * num, ett_vnc_key_events, NULL, "Key Event List"); for (; num > 0; num--) { proto_tree_add_item(sub_tree, hf_vnc_mirrorlink_key_symbol_value, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4 ; } break; case VNC_ML_EXT_KEY_EVENT_LISTING_REQUEST : VNC_BYTES_NEEDED(4); proto_tree_add_item(tree, hf_vnc_mirrorlink_key_request_configuration, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; case VNC_ML_EXT_VIRTUAL_KEYBOARD : VNC_BYTES_NEEDED(16); proto_tree_add_item(tree, hf_vnc_mirrorlink_keyboard_configuration, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_cursor_x, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_cursor_y, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_text_x, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_text_y, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_text_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_text_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; break; case VNC_ML_EXT_VIRTUAL_KEYBOARD_REQUEST : VNC_BYTES_NEEDED(4); proto_tree_add_item(tree, hf_vnc_mirrorlink_keyboard_request_configuration, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; case VNC_ML_EXT_DEVICE_STATUS : case VNC_ML_EXT_DEVICE_STATUS_REQUEST : VNC_BYTES_NEEDED(4); proto_tree_add_item(tree, hf_vnc_mirrorlink_device_status, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; break; /* case VNC_ML_EXT_CONTENT_ATTESTATION : break; case VNC_ML_EXT_CONTENT_ATTESTATION_REQUEST : break; */ case VNC_ML_EXT_FB_BLOCKING_NOTIFICATION : VNC_BYTES_NEEDED(14); proto_tree_add_item(tree, hf_vnc_mirrorlink_fb_block_x, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_fb_block_y, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_fb_block_width, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_fb_block_height, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_mirrorlink_app_id, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_fb_block_reason, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; break; case VNC_ML_EXT_AUDIO_BLOCKING_NOTIFICATION : VNC_BYTES_NEEDED(6); proto_tree_add_item(tree, hf_vnc_mirrorlink_app_id, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_mirrorlink_audio_block_reason, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; break; case VNC_ML_EXT_TOUCH_EVENT : VNC_BYTES_NEEDED(1); num = tvb_get_guint8(tvb, *offset); proto_tree_add_item(tree, hf_vnc_mirrorlink_touch_num_events, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; VNC_BYTES_NEEDED((guint)(6 * num)); /*sub_tree = proto_item_add_subtree(tree, ett_vnc_touch_events);*/ for (i = 0; i < num; i++) { sub_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 6, ett_vnc_touch_events, NULL, "Touch Event #%d", i + 1); proto_tree_add_item(sub_tree, hf_vnc_mirrorlink_touch_x, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(sub_tree, hf_vnc_mirrorlink_touch_y, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(sub_tree, hf_vnc_mirrorlink_touch_id, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; proto_tree_add_item(sub_tree, hf_vnc_mirrorlink_touch_pressure, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; } break; case VNC_ML_EXT_FB_ALTERNATIVE_TEXT : VNC_BYTES_NEEDED(6); proto_tree_add_item(tree, hf_vnc_mirrorlink_app_id, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; num = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_vnc_mirrorlink_text_length, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; VNC_BYTES_NEEDED(num); proto_tree_add_item(tree, hf_vnc_mirrorlink_text, tvb, *offset, num, ENC_ASCII); *offset += num; break; case VNC_ML_EXT_FB_ALTERNATIVE_TEXT_REQUEST : VNC_BYTES_NEEDED(2); proto_tree_add_item(tree, hf_vnc_mirrorlink_text_max_length, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; break; } if (end > *offset) { length = end - *offset; VNC_BYTES_NEEDED(length); proto_tree_add_item(tree, hf_vnc_mirrorlink_unknown, tvb, *offset, length, ENC_NA); *offset = end; } return 0; /* bytes_needed */ } static guint vnc_fence(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint payload_length; VNC_BYTES_NEEDED(8); payload_length = tvb_get_guint8(tvb, *offset+7); VNC_BYTES_NEEDED((8+payload_length)); col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Fence"); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 3, ENC_NA); *offset += 3; /* skip padding */ proto_tree_add_bitmask(tree, tvb, *offset, hf_vnc_fence_flags, ett_vnc_fence_flags, vnc_fence_flags, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_fence_payload_length, tvb, *offset, 1, ENC_BIG_ENDIAN); *offset += 1; if (payload_length > 0) { proto_tree_add_item(tree, hf_vnc_fence_payload, tvb, *offset, payload_length, ENC_NA); *offset += payload_length; } return 0; } static guint vnc_context_information(tvbuff_t *tvb, gint *offset, proto_tree *tree) { VNC_BYTES_NEEDED(20); proto_tree_add_item(tree, hf_vnc_context_information_app_id, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_context_information_app_trust_level, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_context_information_content_trust_level, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(tree, hf_vnc_context_information_app_category, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_context_information_content_category, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_context_information_content_rules, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; return 0; /* bytes_needed */ } static guint vnc_slrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 height) { guint8 depth = vnc_get_depth(pinfo); guint8 depth_mod = depth % 8; guint8 bytes_per_run; guint16 num_runs, i; guint length; proto_tree *sub_tree; if (depth_mod <= 4) bytes_per_run = ( 8 - depth_mod + depth) / 8; else bytes_per_run = (16 - depth_mod + depth) / 8; for (i = 0; i < height; i++) { VNC_BYTES_NEEDED(2); num_runs = tvb_get_ntohs(tvb, *offset); length = num_runs * bytes_per_run; sub_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 2 + length, ett_vnc_slrle_subline, NULL, "Scanline #%d", i+1); proto_tree_add_item(sub_tree, hf_vnc_slrle_run_num, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; VNC_BYTES_NEEDED(length); proto_tree_add_item(sub_tree, hf_vnc_slrle_run_data, tvb, *offset, length, ENC_NA); *offset += length; } return 0; /* bytes_needed */ } static guint vnc_h264_encoding(tvbuff_t *tvb, gint *offset, proto_tree *tree) { guint32 nbytes; VNC_BYTES_NEEDED(16); nbytes = tvb_get_ntohl(tvb, *offset); proto_tree_add_item(tree, hf_vnc_h264_nbytes, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; /*0 == P-Frame; 1 == B-Frame; 2 == I-Frame*/ proto_tree_add_item(tree, hf_vnc_h264_slice_type, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_h264_width, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; proto_tree_add_item(tree, hf_vnc_h264_height, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; VNC_BYTES_NEEDED(nbytes); proto_tree_add_item(tree, hf_vnc_h264_data, tvb, *offset, nbytes, ENC_NA); *offset += nbytes; return 0; /* bytes_needed */ } #ifdef HAVE_ZLIB static guint vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) #else static guint vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset, proto_tree *tree, const guint16 width _U_, const guint16 height _U_) #endif { guint32 data_len; #ifdef HAVE_ZLIB guint8 palette_size; guint8 bytes_per_cpixel = vnc_get_bytes_per_pixel(pinfo); gint uncomp_offset = 0; guint length; gint subencoding_type; tvbuff_t *uncomp_tvb; proto_tree *zrle_subencoding_tree; proto_item *ti; #endif VNC_BYTES_NEEDED(4); proto_tree_add_item(tree, hf_vnc_zrle_len, tvb, *offset, 4, ENC_BIG_ENDIAN); data_len = tvb_get_ntohl(tvb, *offset); *offset += 4; VNC_BYTES_NEEDED(data_len); proto_tree_add_item(tree, hf_vnc_zrle_data, tvb, *offset, data_len, ENC_NA); #ifdef HAVE_ZLIB uncomp_tvb = tvb_child_uncompress(tvb, tvb, *offset, data_len); if(uncomp_tvb != NULL) { add_new_data_source(pinfo, uncomp_tvb, "Uncompressed ZRLE data"); ti = proto_tree_add_item(tree, hf_vnc_zrle_subencoding, uncomp_tvb, uncomp_offset, 1, ENC_BIG_ENDIAN); zrle_subencoding_tree = proto_item_add_subtree(ti, ett_vnc_zrle_subencoding); proto_tree_add_item(zrle_subencoding_tree, hf_vnc_zrle_rle, uncomp_tvb, uncomp_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(zrle_subencoding_tree, hf_vnc_zrle_palette_size, uncomp_tvb, uncomp_offset, 1, ENC_BIG_ENDIAN); subencoding_type = tvb_get_guint8(uncomp_tvb, uncomp_offset); palette_size = subencoding_type & 0x7F; uncomp_offset += 1; if(subencoding_type == 0) { /* Raw */ length = width * height * bytes_per_cpixel; VNC_BYTES_NEEDED(length); /* XXX - not working yet! */ proto_tree_add_item(zrle_subencoding_tree, hf_vnc_zrle_raw, uncomp_tvb, uncomp_offset, length, ENC_NA); } else if(subencoding_type >= 130 && subencoding_type <= 255) { length = palette_size * bytes_per_cpixel; VNC_BYTES_NEEDED(length); proto_tree_add_item(zrle_subencoding_tree, hf_vnc_zrle_palette, uncomp_tvb, uncomp_offset, length, ENC_NA); /* XXX - Not complete! */ } } else { proto_tree_add_expert(tree, pinfo, &ei_vnc_zrle_failed, tvb, *offset, data_len); } #endif /* HAVE_ZLIB */ *offset += data_len; return 0; /* bytes_needed */ } static guint read_compact_len(tvbuff_t *tvb, gint *offset, gint *length, gint *value_length) { gint b; VNC_BYTES_NEEDED(1); *value_length = 0; b = tvb_get_guint8(tvb, *offset); *offset += 1; *value_length += 1; *length = b & 0x7f; if ((b & 0x80) != 0) { VNC_BYTES_NEEDED(1); b = tvb_get_guint8(tvb, *offset); *offset += 1; *value_length += 1; *length |= (b & 0x7f) << 7; if ((b & 0x80) != 0) { VNC_BYTES_NEEDED (1); b = tvb_get_guint8(tvb, *offset); *offset += 1; *value_length += 1; *length |= (b & 0xff) << 14; } } return 0; } static guint process_compact_length_and_image_data(tvbuff_t *tvb, gint *offset, proto_tree *tree) { guint bytes_needed; guint length, value_length; bytes_needed = read_compact_len (tvb, offset, &length, &value_length); if (bytes_needed != 0) return bytes_needed; proto_tree_add_uint(tree, hf_vnc_tight_image_len, tvb, *offset - value_length, value_length, length); VNC_BYTES_NEEDED(length); proto_tree_add_item(tree, hf_vnc_tight_image_data, tvb, *offset, length, ENC_NA); *offset += length; return 0; /* bytes_needed */ } static guint process_tight_rect_filter_palette(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, gint *bits_per_pixel) { vnc_packet_t *per_packet_info; gint num_colors; guint palette_bytes; /* See TightVNC's vnc_unixsrc/vncviewer/tight.c:InitFilterPaletteBPP() */ per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); VNC_BYTES_NEEDED(1); proto_tree_add_item(tree, hf_vnc_tight_palette_num_colors, tvb, *offset, 1, ENC_BIG_ENDIAN); num_colors = tvb_get_guint8(tvb, *offset); *offset += 1; num_colors++; if (num_colors < 2) return 0; if (per_packet_info->depth == 24) palette_bytes = num_colors * 3; else palette_bytes = num_colors * per_packet_info->depth / 8; VNC_BYTES_NEEDED(palette_bytes); proto_tree_add_item(tree, hf_vnc_tight_palette_data, tvb, *offset, palette_bytes, ENC_NA); *offset += palette_bytes; /* This is the number of bits per pixel *in the image data*, not the actual client depth */ if (num_colors == 2) *bits_per_pixel = 1; else *bits_per_pixel = 8; return 0; } static guint vnc_tight_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width _U_, const guint16 height _U_) { vnc_packet_t *per_packet_info; guint8 comp_ctl; proto_item *compression_type_ti; gint bit_offset; gint bytes_needed = -1; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); /* See xserver/hw/vnc/rfbproto.h and grep for "Tight Encoding." for the following layout */ VNC_BYTES_NEEDED(1); /* least significant bits 0-3 are "reset compression stream N" */ bit_offset = *offset * 8; proto_tree_add_bits_item(tree, hf_vnc_tight_reset_stream0, tvb, bit_offset + 7, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tree, hf_vnc_tight_reset_stream1, tvb, bit_offset + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tree, hf_vnc_tight_reset_stream2, tvb, bit_offset + 5, 1, ENC_BIG_ENDIAN); proto_tree_add_bits_item(tree, hf_vnc_tight_reset_stream3, tvb, bit_offset + 4, 1, ENC_BIG_ENDIAN); /* most significant bits 4-7 are "compression type" */ compression_type_ti = proto_tree_add_bits_item(tree, hf_vnc_tight_rect_type, tvb, bit_offset + 0, 4, ENC_BIG_ENDIAN); comp_ctl = tvb_get_guint8(tvb, *offset); *offset += 1; comp_ctl >>= 4; /* skip over the "reset compression" bits from above */ /* compression format */ if (comp_ctl == TIGHT_RECT_FILL) { /* "fill" encoding (solid rectangle) */ proto_item_append_text(compression_type_ti, " (fill encoding - solid rectangle)"); if (per_packet_info->depth == 24) { VNC_BYTES_NEEDED(3); proto_tree_add_item(tree, hf_vnc_tight_fill_color, tvb, *offset, 3, ENC_NA); *offset += 3; } else { VNC_BYTES_NEEDED(per_packet_info->bytes_per_pixel); proto_tree_add_item(tree, hf_vnc_tight_fill_color, tvb, *offset, per_packet_info->bytes_per_pixel, ENC_NA); *offset += per_packet_info->bytes_per_pixel; } bytes_needed = 0; } else if (comp_ctl == TIGHT_RECT_JPEG) { /* jpeg encoding */ proto_item_append_text(compression_type_ti, " (JPEG encoding)"); bytes_needed = process_compact_length_and_image_data(tvb, offset, tree); if (bytes_needed != 0) return bytes_needed; } else if (comp_ctl > TIGHT_RECT_MAX_VALUE) { /* invalid encoding */ expert_add_info(pinfo, compression_type_ti, &ei_vnc_invalid_encoding); } else { guint row_size; gint bits_per_pixel; /* basic encoding */ proto_item_append_text(compression_type_ti, " (basic encoding)"); proto_tree_add_bits_item(tree, hf_vnc_tight_filter_flag, tvb, bit_offset + 1, 1, ENC_BIG_ENDIAN); bits_per_pixel = per_packet_info->depth; if ((comp_ctl & TIGHT_RECT_EXPLICIT_FILTER_FLAG) != 0) { guint8 filter_id; /* explicit filter */ VNC_BYTES_NEEDED(1); proto_tree_add_item(tree, hf_vnc_tight_filter_id, tvb, *offset, 1, ENC_BIG_ENDIAN); filter_id = tvb_get_guint8(tvb, *offset); *offset += 1; switch (filter_id) { case TIGHT_RECT_FILTER_COPY: /* nothing to do */ break; case TIGHT_RECT_FILTER_PALETTE: bytes_needed = process_tight_rect_filter_palette(tvb, pinfo, offset, tree, &bits_per_pixel); if (bytes_needed != 0) return bytes_needed; break; case TIGHT_RECT_FILTER_GRADIENT: /* nothing to do */ break; } } else { /* this is the same case as TIGHT_RECT_FILTER_COPY, so there's nothing special to do */ } row_size = ((guint) width * bits_per_pixel + 7) / 8; if (row_size * height < TIGHT_MIN_BYTES_TO_COMPRESS) { guint num_bytes; /* The data is not compressed; just skip over it */ num_bytes = row_size * height; VNC_BYTES_NEEDED(num_bytes); proto_tree_add_item(tree, hf_vnc_tight_image_data, tvb, *offset, num_bytes, ENC_NA); *offset += num_bytes; bytes_needed = 0; } else { /* The data is compressed; read its length and data */ bytes_needed = process_compact_length_and_image_data(tvb, offset, tree); if (bytes_needed != 0) return bytes_needed; } } DISSECTOR_ASSERT(bytes_needed != -1); return bytes_needed; } static guint decode_cursor(tvbuff_t *tvb, gint *offset, proto_tree *tree, guint pixels_bytes, guint mask_bytes) { guint total_bytes; total_bytes = pixels_bytes + mask_bytes; VNC_BYTES_NEEDED (total_bytes); proto_tree_add_item(tree, hf_vnc_cursor_encoding_pixels, tvb, *offset, pixels_bytes, ENC_NA); *offset += pixels_bytes; proto_tree_add_item(tree, hf_vnc_cursor_encoding_bitmask, tvb, *offset, mask_bytes, ENC_NA); *offset += mask_bytes; return 0; /* bytes_needed */ } static guint vnc_rich_cursor_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) { guint8 bytes_per_pixel = vnc_get_bytes_per_pixel(pinfo); guint pixels_bytes, mask_bytes; pixels_bytes = width * height * bytes_per_pixel; mask_bytes = ((width + 7) / 8) * height; return decode_cursor(tvb, offset, tree, pixels_bytes, mask_bytes); } static guint vnc_x_cursor_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset, proto_tree *tree, const guint16 width, const guint16 height) { gint bitmap_row_bytes = (width + 7) / 8; gint mask_bytes = bitmap_row_bytes * height; VNC_BYTES_NEEDED (6); proto_tree_add_item(tree, hf_vnc_cursor_x_fore_back, tvb, *offset, 6, ENC_NA); *offset += 6; /* The length of the pixel data is the same as the length of the mask data (X cursors are strictly black/white) */ return decode_cursor(tvb, offset, tree, mask_bytes, mask_bytes); } static guint vnc_server_set_colormap_entries(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint16 number_of_colors; guint counter, bytes_needed; proto_item *ti; proto_tree *vnc_colormap_num_groups, *vnc_colormap_color_group; col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Server set colormap entries"); number_of_colors = tvb_get_ntohs(tvb, 4); VNC_BYTES_NEEDED(3); proto_tree_add_item(tree, hf_vnc_padding, tvb, *offset, 1, ENC_NA); *offset += 1; /* Skip over 1 byte of padding */ proto_tree_add_item(tree, hf_vnc_colormap_first_color, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; /* XXX - this is 3 bytes into the tvb, but number_of_colors is set off * of 4 bytes in... Bug??? */ ti = proto_tree_add_item(tree, hf_vnc_colormap_num_colors, tvb, *offset, 2, ENC_BIG_ENDIAN); if (number_of_colors > 10000) { expert_add_info_format(pinfo, ti, &ei_vnc_too_many_colors,"Too many colors (%d), aborting dissection", number_of_colors); return(0); } bytes_needed = (number_of_colors * 6) + 5; VNC_BYTES_NEEDED(bytes_needed); *offset += 2; ti = proto_tree_add_item(tree, hf_vnc_color_groups, tvb, *offset, number_of_colors * 6, ENC_NA); vnc_colormap_num_groups = proto_item_add_subtree(ti, ett_vnc_colormap_num_groups); for(counter = 0; counter < number_of_colors; counter++) { vnc_colormap_color_group = proto_tree_add_subtree_format(vnc_colormap_num_groups, tvb, *offset, 6, ett_vnc_colormap_color_group, NULL, "Color group #%d", counter+1); proto_tree_add_item(vnc_colormap_color_group, hf_vnc_colormap_red, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(vnc_colormap_color_group, hf_vnc_colormap_green, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_tree_add_item(vnc_colormap_color_group, hf_vnc_colormap_blue, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; } return 0; } static void vnc_server_ring_bell(tvbuff_t *tvb _U_, packet_info *pinfo, gint *offset _U_, proto_tree *tree _U_) { col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Server ring bell on client"); /* This message type has no payload... */ } static guint vnc_server_cut_text(tvbuff_t *tvb, packet_info *pinfo, gint *offset, proto_tree *tree) { guint32 text_len; proto_item *pi; col_append_sep_str(pinfo->cinfo, COL_INFO, "; ", "Server cut text"); text_len = tvb_get_ntohl(tvb, *offset); pi = proto_tree_add_item(tree, hf_vnc_server_cut_text_len, tvb, *offset, 4, ENC_BIG_ENDIAN); *offset += 4; if (text_len > 100000) { expert_add_info_format(pinfo, pi, &ei_vnc_too_many_cut_text, "Too much cut text (%d), aborting dissection", text_len); return(0); } VNC_BYTES_NEEDED(text_len); proto_tree_add_item(tree, hf_vnc_server_cut_text, tvb, *offset, text_len, ENC_ASCII); *offset += text_len; return *offset; } static void vnc_set_bytes_per_pixel(packet_info *pinfo, const guint8 bytes_per_pixel) { vnc_packet_t *per_packet_info; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); per_packet_info->bytes_per_pixel = bytes_per_pixel; } static void vnc_set_depth(packet_info *pinfo, const guint8 depth) { vnc_packet_t *per_packet_info; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); per_packet_info->depth = depth; } static guint8 vnc_get_bytes_per_pixel(packet_info *pinfo) { vnc_packet_t *per_packet_info; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); return per_packet_info->bytes_per_pixel; } static guint8 vnc_get_depth(packet_info *pinfo) { vnc_packet_t *per_packet_info; per_packet_info = (vnc_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_vnc, 0); /* Our calling function should have set the packet's proto data already */ DISSECTOR_ASSERT(per_packet_info != NULL); return per_packet_info->depth; } /* Preference callbacks */ static void apply_vnc_prefs(void) { vnc_tcp_range = prefs_get_range_value("vnc", "tcp.port"); } /* Register the protocol with Wireshark */ void proto_register_vnc(void) { module_t *vnc_module; /* To handle our preferences */ expert_module_t* expert_vnc; /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_vnc_padding, { "Padding", "vnc.padding", FT_NONE, BASE_NONE, NULL, 0x0, "Unused space", HFILL } }, { &hf_vnc_server_proto_ver, { "Server protocol version", "vnc.server_proto_ver", FT_STRING, BASE_NONE, NULL, 0x0, "VNC protocol version on server", HFILL } }, { &hf_vnc_client_proto_ver, { "Client protocol version", "vnc.client_proto_ver", FT_STRING, BASE_NONE, NULL, 0x0, "VNC protocol version on client", HFILL } }, { &hf_vnc_num_security_types, { "Number of security types", "vnc.num_security_types", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of security (authentication) types supported by the server", HFILL } }, { &hf_vnc_security_type, { "Security type", "vnc.security_type", FT_UINT8, BASE_DEC, VALS(vnc_security_types_vs), 0x0, "Security types offered by the server (VNC versions => 3.007", HFILL } }, { &hf_vnc_server_security_type, { "Security type", "vnc.server_security_type", FT_UINT32, BASE_DEC, VALS(vnc_security_types_vs), 0x0, "Security type mandated by the server", HFILL } }, { &hf_vnc_client_security_type, { "Security type selected", "vnc.client_security_type", FT_UINT8, BASE_DEC, VALS(vnc_security_types_vs), 0x0, "Security type selected by the client", HFILL } }, { &hf_vnc_tight_num_tunnel_types, { "Number of supported tunnel types", "vnc.num_tunnel_types", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of tunnel types for TightVNC", HFILL } }, { &hf_vnc_tight_tunnel_type_code, { "Tunnel type code", "vnc.tunnel_type_code", FT_UINT32, BASE_DEC, NULL, 0x0, "Tunnel type code specific to TightVNC", HFILL } }, { &hf_vnc_tight_tunnel_type_vendor, { "Tunnel type vendor", "vnc.tunnel_type_vendor", FT_STRING, BASE_NONE, NULL, 0x0, "Tunnel type vendor specific to TightVNC", HFILL } }, { &hf_vnc_tight_tunnel_type_signature, { "Tunnel type signature", "vnc.tunnel_type_signature", FT_STRING, BASE_NONE, NULL, 0x0, "Tunnel type signature specific to TightVNC", HFILL } }, { &hf_vnc_tight_num_auth_types, { "Number of supported authentication types", "vnc.num_auth_types", FT_UINT32, BASE_DEC, NULL, 0x0, "Authentication types specific to TightVNC", HFILL } }, { &hf_vnc_tight_auth_code, { "Authentication code", "vnc.tight_auth_code", FT_UINT32, BASE_DEC, VALS(vnc_security_types_vs), 0x0, "Authentication code specific to TightVNC", HFILL } }, { &hf_vnc_tight_server_message_type, { "Server message type (TightVNC)", "vnc.tight_server_message_type", FT_INT32, BASE_DEC, NULL, 0x0, "Server message type specific to TightVNC", HFILL } }, { &hf_vnc_tight_server_vendor, { "Server vendor code", "vnc.server_vendor", FT_STRING, BASE_NONE, NULL, 0x0, "Server vendor code specific to TightVNC", HFILL } }, { &hf_vnc_tight_signature, { "Signature", "vnc.signature", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_tight_server_name, { "Server name", "vnc.server_name", FT_STRING, BASE_NONE, NULL, 0x0, "Server name specific to TightVNC", HFILL } }, { &hf_vnc_tight_client_message_type, { "Client message type (TightVNC)", "vnc.tight_client_message_type", FT_INT32, BASE_DEC, NULL, 0x0, "Client message type specific to TightVNC", HFILL } }, { &hf_vnc_tight_client_vendor, { "Client vendor code", "vnc.client_vendor", FT_STRING, BASE_NONE, NULL, 0x0, "Client vendor code specific to TightVNC", HFILL } }, { &hf_vnc_tight_client_name, { "Client name", "vnc.client_name", FT_STRING, BASE_NONE, NULL, 0x0, "Client name specific to TightVNC", HFILL } }, { &hf_vnc_tight_encoding_type, { "Encoding type", "vnc.encoding_type", FT_INT32, BASE_DEC, VALS(encoding_types_vs), 0x0, "Encoding type specific to TightVNC", HFILL } }, { &hf_vnc_tight_encoding_vendor, { "Encoding vendor code", "vnc.encoding_vendor", FT_STRING, BASE_NONE, NULL, 0x0, "Encoding vendor code specific to TightVNC", HFILL } }, { &hf_vnc_tight_encoding_name, { "Encoding name", "vnc.encoding_name", FT_STRING, BASE_NONE, NULL, 0x0, "Encoding name specific to TightVNC", HFILL } }, { &hf_vnc_tight_reset_stream0, { "Reset compression stream 0", "vnc.tight_reset_stream0", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Tight compression, reset compression stream 0", HFILL } }, { &hf_vnc_tight_reset_stream1, { "Reset compression stream 1", "vnc.tight_reset_stream1", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Tight compression, reset compression stream 1", HFILL } }, { &hf_vnc_tight_reset_stream2, { "Reset compression stream 2", "vnc.tight_reset_stream2", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Tight compression, reset compression stream 2", HFILL } }, { &hf_vnc_tight_reset_stream3, { "Reset compression stream 3", "vnc.tight_reset_stream3", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Tight compression, reset compression stream 3", HFILL } }, { &hf_vnc_tight_rect_type, { "Rectangle type", "vnc.tight_rect_type", FT_UINT8, BASE_HEX, NULL, 0x0, "Tight compression, rectangle type", HFILL } }, { &hf_vnc_tight_image_len, { "Image data length", "vnc.tight_image_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Tight compression, length of image data", HFILL } }, { &hf_vnc_tight_image_data, { "Image data", "vnc.tight_image_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Tight compression, image data", HFILL } }, { &hf_vnc_tight_fill_color, { "Fill color (RGB)", "vnc.tight_fill_color", FT_BYTES, BASE_NONE, NULL, 0x0, "Tight compression, fill color for solid rectangle", HFILL } }, { &hf_vnc_tight_filter_flag, { "Explicit filter flag", "vnc.tight_filter_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Tight compression, explicit filter flag", HFILL } }, { &hf_vnc_tight_filter_id, { "Filter ID", "vnc.tight_filter_id", FT_UINT8, BASE_DEC, VALS(tight_filter_ids_vs), 0x0, "Tight compression, filter ID", HFILL } }, { &hf_vnc_tight_palette_num_colors, { "Number of colors in palette", "vnc.tight_palette_num_colors", FT_UINT8, BASE_DEC, NULL, 0x0, "Tight compression, number of colors in rectangle's palette", HFILL } }, { &hf_vnc_tight_palette_data, { "Palette data", "vnc.tight_palette_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Tight compression, palette data for a rectangle", HFILL } }, { &hf_vnc_auth_challenge, { "Authentication challenge", "vnc.auth_challenge", FT_BYTES, BASE_NONE, NULL, 0x0, "Random authentication challenge from server to client", HFILL } }, { &hf_vnc_auth_response, { "Authentication response", "vnc.auth_response", FT_BYTES, BASE_NONE, NULL, 0x0, "Client's encrypted response to the server's authentication challenge", HFILL } }, { &hf_vnc_auth_result, { "Authentication result", "vnc.auth_result", FT_BOOLEAN, 32, TFS(&auth_result_tfs), 0x1, NULL, HFILL } }, { &hf_vnc_auth_error_length, { "Length of authentication error", "vnc.auth_error_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Authentication error length (present only if the authentication result is fail", HFILL } }, { &hf_vnc_auth_error, { "Authentication error", "vnc.auth_error", FT_STRING, BASE_NONE, NULL, 0x0, "Authentication error (present only if the authentication result is fail", HFILL } }, { &hf_vnc_ard_auth_generator, { "Generator", "vnc.ard_auth_generator", FT_UINT16, BASE_DEC, NULL, 0x0, "Generator for Diffie-Hellman key exchange", HFILL } }, { &hf_vnc_ard_auth_key_len, { "Key length", "vnc.ard_auth_key_len", FT_UINT16, BASE_DEC, NULL, 0x0, "Diffie-Hellman key length", HFILL } }, { &hf_vnc_ard_auth_modulus, { "Prime modulus", "vnc.ard_auth_modulus", FT_BYTES, BASE_NONE, NULL, 0x0, "Prime modulus for Diffie-Hellman key exchange", HFILL } }, { &hf_vnc_ard_auth_server_key, { "Server public key", "vnc.ard_auth_server_key", FT_BYTES, BASE_NONE, NULL, 0x0, "Server's public Diffie-Hellman key", HFILL } }, { &hf_vnc_ard_auth_credentials, { "Encrypted credentials", "vnc.ard_auth_credentials", FT_BYTES, BASE_NONE, NULL, 0x0, "Encrypted client username and password", HFILL } }, { &hf_vnc_ard_auth_client_key, { "Client public key", "vnc.ard_auth_client_key", FT_BYTES, BASE_NONE, NULL, 0x0, "Client's public Diffie-Hellman key", HFILL } }, { &hf_vnc_vencrypt_server_major_ver, { "VeNCrypt server major version", "vnc.vencrypt_server_major_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_vencrypt_server_minor_ver, { "VeNCrypt server minor version", "vnc.vencrypt_server_minor_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_vencrypt_client_major_ver, { "VeNCrypt client major version", "vnc.vencrypt_client_major_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_vencrypt_client_minor_ver, { "VeNCrypt client minor version", "vnc.vencrypt_client_minor_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_vencrypt_version_ack, { "VeNCrypt version ack", "vnc.vencrypt_version_ack", FT_BOOLEAN, 8, TFS(&tfs_error_ok), 0xFF, NULL, HFILL } }, { &hf_vnc_vencrypt_auth_type, { "VeNCrypt authentication type", "vnc.vencrypt_auth_type", FT_UINT32, BASE_DEC, VALS(vnc_vencrypt_auth_types_vs), 0x0, "Authentication type specific to VeNCrypt", HFILL } }, { &hf_vnc_vencrypt_num_auth_types, { "VeNCrypt Number of supported authentication types", "vnc.vencrypt_num_auth_types", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_vencrypt_auth_type_ack, { "VeNCrypt Authorization type ack", "vnc.vencrypt_auth_type_ack", FT_BOOLEAN, 8, TFS(&tfs_ok_error), 0xFF, NULL, HFILL } }, { &hf_vnc_share_desktop_flag, { "Share desktop flag", "vnc.share_desktop_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Client's desire to share the server's desktop with other clients", HFILL } }, { &hf_vnc_width, { "Framebuffer width", "vnc.width", FT_UINT16, BASE_DEC, NULL, 0x0, "Width of the framebuffer (screen) in pixels", HFILL } }, { &hf_vnc_height, { "Framebuffer height", "vnc.height", FT_UINT16, BASE_DEC, NULL, 0x0, "Height of the framebuffer (screen) in pixels", HFILL } }, { &hf_vnc_server_bits_per_pixel, { "Bits per pixel", "vnc.server_bits_per_pixel", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of bits used by server for each pixel value on the wire from the server", HFILL } }, { &hf_vnc_server_depth, { "Depth", "vnc.server_depth", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of useful bits in the pixel value on server", HFILL } }, { &hf_vnc_server_big_endian_flag, { "Big endian flag", "vnc.server_big_endian_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "True if multi-byte pixels are interpreted as big endian by server", HFILL } }, { &hf_vnc_server_true_color_flag, { "True color flag", "vnc.server_true_color_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "If true, then the next six items specify how to extract the red, green and blue intensities from the pixel value on the server.", HFILL } }, { &hf_vnc_server_red_max, { "Red maximum", "vnc.server_red_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum red value on server as n: 2^n - 1", HFILL } }, { &hf_vnc_server_green_max, { "Green maximum", "vnc.server_green_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum green value on server as n: 2^n - 1", HFILL } }, { &hf_vnc_server_blue_max, { "Blue maximum", "vnc.server_blue_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum blue value on server as n: 2^n - 1", HFILL } }, { &hf_vnc_server_red_shift, { "Red shift", "vnc.server_red_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the red value in a pixel to the least significant bit on the server", HFILL } }, { &hf_vnc_server_green_shift, { "Green shift", "vnc.server_green_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the green value in a pixel to the least significant bit on the server", HFILL } }, { &hf_vnc_server_blue_shift, { "Blue shift", "vnc.server_blue_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the blue value in a pixel to the least significant bit on the server", HFILL } }, { &hf_vnc_desktop_name_len, { "Desktop name length", "vnc.desktop_name_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of desktop name in bytes", HFILL } }, { &hf_vnc_desktop_screen_num, { "Number of screens", "vnc.screen_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_desktop_screen_id, { "Screen ID", "vnc.screen_id", FT_UINT32, BASE_DEC, NULL, 0x0, "ID of screen", HFILL } }, { &hf_vnc_desktop_screen_x, { "Screen X position", "vnc.screen_x", FT_UINT16, BASE_DEC, NULL, 0x0, "X coordinate of screen", HFILL } }, { &hf_vnc_desktop_screen_y, { "Screen Y position", "vnc.screen_y", FT_UINT16, BASE_DEC, NULL, 0x0, "Y coordinate of screen", HFILL } }, { &hf_vnc_desktop_screen_width, { "Screen width", "vnc.screen_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Width of screen", HFILL } }, { &hf_vnc_desktop_screen_height, { "Screen height", "vnc.screen_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Height of screen", HFILL } }, { &hf_vnc_desktop_screen_flags, { "Screen flags", "vnc.screen_flags", FT_UINT32, BASE_DEC, NULL, 0x0, "Flags of screen", HFILL } }, { &hf_vnc_desktop_name, { "Desktop name", "vnc.desktop_name", FT_STRING, BASE_NONE, NULL, 0x0, "Name of the VNC desktop on the server", HFILL } }, { &hf_vnc_num_server_message_types, { "Server message types", "vnc.num_server_message_types", FT_UINT16, BASE_DEC, NULL, 0x0, "Unknown", HFILL } /* XXX - Needs description */ }, { &hf_vnc_num_client_message_types, { "Client message types", "vnc.num_client_message_types", FT_UINT16, BASE_DEC, NULL, 0x0, "Unknown", HFILL } /* XXX - Needs description */ }, { &hf_vnc_num_encoding_types, { "Encoding types", "vnc.num_encoding_types", FT_UINT16, BASE_DEC, NULL, 0x0, "Unknown", HFILL } /* XXX - Needs description */ }, { &hf_vnc_client_message_type, { "Client Message Type", "vnc.client_message_type", FT_UINT8, BASE_DEC, VALS(vnc_client_message_types_vs), 0x0, "Message type from client", HFILL } }, { &hf_vnc_client_bits_per_pixel, { "Bits per pixel", "vnc.client_bits_per_pixel", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of bits used by server for each pixel value on the wire from the client", HFILL } }, { &hf_vnc_client_depth, { "Depth", "vnc.client_depth", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of useful bits in the pixel value on client", HFILL } }, { &hf_vnc_client_big_endian_flag, { "Big endian flag", "vnc.client_big_endian_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "True if multi-byte pixels are interpreted as big endian by client", HFILL } }, { &hf_vnc_client_true_color_flag, { "True color flag", "vnc.client_true_color_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "If true, then the next six items specify how to extract the red, green and blue intensities from the pixel value on the client.", HFILL } }, { &hf_vnc_client_red_max, { "Red maximum", "vnc.client_red_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum red value on client as n: 2^n - 1", HFILL } }, { &hf_vnc_client_green_max, { "Green maximum", "vnc.client_green_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum green value on client as n: 2^n - 1", HFILL } }, { &hf_vnc_client_blue_max, { "Blue maximum", "vnc.client_blue_max", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum blue value on client as n: 2^n - 1", HFILL } }, { &hf_vnc_client_red_shift, { "Red shift", "vnc.client_red_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the red value in a pixel to the least significant bit on the client", HFILL } }, { &hf_vnc_client_green_shift, { "Green shift", "vnc.client_green_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the green value in a pixel to the least significant bit on the client", HFILL } }, { &hf_vnc_client_blue_shift, { "Blue shift", "vnc.client_blue_shift", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of shifts needed to get the blue value in a pixel to the least significant bit on the client", HFILL } }, /* Client Key Event */ { &hf_vnc_key_down, { "Key down", "vnc.key_down", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0, "Specifies whether the key is being pressed or not", HFILL } }, { &hf_vnc_key, { "Key", "vnc.key", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &x11_keysym_vals_source_ext, 0x0, /* keysym_vals_source_exr is from packet-x11.c */ "Key being pressed/depressed", HFILL } }, /* Client Pointer Event */ { &hf_vnc_button_1_pos, { "Mouse button #1 position", "vnc.button_1_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x1, "Whether mouse button #1 is being pressed or not", HFILL } }, { &hf_vnc_button_2_pos, { "Mouse button #2 position", "vnc.button_2_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x2, "Whether mouse button #2 is being pressed or not", HFILL } }, { &hf_vnc_button_3_pos, { "Mouse button #3 position", "vnc.button_3_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x4, "Whether mouse button #3 is being pressed or not", HFILL } }, { &hf_vnc_button_4_pos, { "Mouse button #4 position", "vnc.button_4_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x8, "Whether mouse button #4 is being pressed or not", HFILL } }, { &hf_vnc_button_5_pos, { "Mouse button #5 position", "vnc.button_5_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x10, "Whether mouse button #5 is being pressed or not", HFILL } }, { &hf_vnc_button_6_pos, { "Mouse button #6 position", "vnc.button_6_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x20, "Whether mouse button #6 is being pressed or not", HFILL } }, { &hf_vnc_button_7_pos, { "Mouse button #7 position", "vnc.button_7_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x40, "Whether mouse button #7 is being pressed or not", HFILL } }, { &hf_vnc_button_8_pos, { "Mouse button #8 position", "vnc.button_8_pos", FT_BOOLEAN, 8, TFS(&tfs_pressed_not_pressed), 0x80, "Whether mouse button #8 is being pressed or not", HFILL } }, { &hf_vnc_pointer_x_pos, { "X position", "vnc.pointer_x_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Position of mouse cursor on the x-axis", HFILL } }, { &hf_vnc_pointer_y_pos, { "Y position", "vnc.pointer_y_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Position of mouse cursor on the y-axis", HFILL } }, { &hf_vnc_encoding_num, { "Number of encodings", "vnc.client_set_encodings_num", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of encodings used to send pixel data from server to client", HFILL } }, { &hf_vnc_client_set_encodings_encoding_type, { "Encoding type", "vnc.client_set_encodings_encoding_type", FT_INT32, BASE_DEC, VALS(encoding_types_vs), 0x0, "Type of encoding used to send pixel data from server to client", HFILL } }, /* Client Framebuffer Update Request */ { &hf_vnc_update_req_incremental, { "Incremental update", "vnc.update_req_incremental", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Specifies if the client wants an incremental update instead of a full one", HFILL } }, { &hf_vnc_update_req_x_pos, { "X position", "vnc.update_req_x_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "X position of framebuffer (screen) update requested", HFILL } }, { &hf_vnc_update_req_y_pos, { "Y position", "vnc.update_req_y_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Y position of framebuffer (screen) update request", HFILL } }, { &hf_vnc_update_req_width, { "Width", "vnc.update_req_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Width of framebuffer (screen) update request", HFILL } }, { &hf_vnc_update_req_height, { "Height", "vnc.update_req_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Height of framebuffer (screen) update request", HFILL } }, { &hf_vnc_client_cut_text_len, { "Length", "vnc.client_cut_text_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of client's copy/cut text (clipboard) string in bytes", HFILL } }, { &hf_vnc_client_cut_text, { "Text", "vnc.client_cut_text", FT_STRING, BASE_NONE, NULL, 0x0, "Text string in the client's copy/cut text (clipboard)", HFILL } }, /********** Server Message Types **********/ { &hf_vnc_server_message_type, { "Server Message Type", "vnc.server_message_type", FT_UINT8, BASE_DEC, VALS(vnc_server_message_types_vs), 0x0, "Message type from server", HFILL } }, { &hf_vnc_rectangle_num, { "Number of rectangles", "vnc.fb_update_num_rects", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of rectangles of this server framebuffer update", HFILL } }, { &hf_vnc_fb_update_x_pos, { "X position", "vnc.fb_update_x_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "X position of this server framebuffer update", HFILL } }, { &hf_vnc_fb_update_y_pos, { "Y position", "vnc.fb_update_y_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Y position of this server framebuffer update", HFILL } }, { &hf_vnc_fb_update_width, { "Width", "vnc.fb_update_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Width of this server framebuffer update", HFILL } }, { &hf_vnc_fb_update_height, { "Height", "vnc.fb_update_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Height of this server framebuffer update", HFILL } }, { &hf_vnc_fb_update_encoding_type, { "Encoding type", "vnc.fb_update_encoding_type", FT_INT32, BASE_DEC, VALS(encoding_types_vs), 0x0, "Encoding type of this server framebuffer update", HFILL } }, /* Cursor encoding */ { &hf_vnc_cursor_x_fore_back, { "X Cursor foreground RGB / background RGB", "vnc.cursor_x_fore_back", FT_BYTES, BASE_NONE, NULL, 0x0, "RGB values for the X cursor's foreground and background", HFILL } }, { &hf_vnc_cursor_encoding_pixels, { "Cursor encoding pixels", "vnc.cursor_encoding_pixels", FT_BYTES, BASE_NONE, NULL, 0x0, "Cursor encoding pixel data", HFILL } }, { &hf_vnc_cursor_encoding_bitmask, { "Cursor encoding bitmask", "vnc.cursor_encoding_bitmask", FT_BYTES, BASE_NONE, NULL, 0x0, "Cursor encoding pixel bitmask", HFILL } }, /* Raw Encoding */ { &hf_vnc_raw_pixel_data, { "Pixel data", "vnc.raw_pixel_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Raw pixel data.", HFILL } }, /* CopyRect Encoding*/ { &hf_vnc_copyrect_src_x_pos, { "Source x position", "vnc.copyrect_src_x_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "X position of the rectangle to copy from", HFILL } }, { &hf_vnc_copyrect_src_y_pos, { "Source y position", "vnc.copyrect_src_y_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Y position of the rectangle to copy from", HFILL } }, /* RRE Encoding */ { &hf_vnc_rre_num_subrects, { "Number of subrectangles", "vnc.rre_num_subrects", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of subrectangles contained in this encoding type", HFILL } }, { &hf_vnc_rre_bg_pixel, { "Background pixel value", "vnc.rre_bg_pixel", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_rre_subrect_pixel, { "Pixel value", "vnc.rre_subrect_pixel", FT_BYTES, BASE_NONE, NULL, 0x0, "Subrectangle pixel value", HFILL } }, { &hf_vnc_rre_subrect_x_pos, { "X position", "vnc.rre_subrect_x_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Position of this subrectangle on the x axis", HFILL } }, { &hf_vnc_rre_subrect_y_pos, { "Y position", "vnc.rre_subrect_y_pos", FT_UINT16, BASE_DEC, NULL, 0x0, "Position of this subrectangle on the y axis", HFILL } }, { &hf_vnc_rre_subrect_width, { "Width", "vnc.rre_subrect_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Width of this subrectangle", HFILL } }, { &hf_vnc_rre_subrect_height, { "Height", "vnc.rre_subrect_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Height of this subrectangle", HFILL } }, /* Hextile Encoding */ { &hf_vnc_hextile_subencoding_mask, { "Subencoding type", "vnc.hextile_subencoding", FT_UINT8, BASE_DEC, NULL, 0x0, "Hextile subencoding type.", HFILL } }, { &hf_vnc_hextile_raw, { "Raw", "vnc.hextile_raw", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x1, "Raw subencoding is used in this tile", HFILL } }, { &hf_vnc_hextile_raw_value, { "Raw pixel values", "vnc.hextile_raw_value", FT_BYTES, BASE_NONE, NULL, 0x0, "Raw subencoding pixel values", HFILL } }, { &hf_vnc_hextile_bg, { "Background Specified", "vnc.hextile_bg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x2, "Background Specified subencoding is used in this tile", HFILL } }, { &hf_vnc_hextile_bg_value, { "Background pixel value", "vnc.hextile_bg_value", FT_BYTES, BASE_NONE, NULL, 0x0, "Background color for this tile", HFILL } }, { &hf_vnc_hextile_fg, { "Foreground Specified", "vnc.hextile_fg", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x4, "Foreground Specified subencoding is used in this tile", HFILL } }, { &hf_vnc_hextile_fg_value, { "Foreground pixel value", "vnc.hextile_fg_value", FT_BYTES, BASE_NONE, NULL, 0x0, "Foreground color for this tile", HFILL } }, { &hf_vnc_hextile_anysubrects, { "Any Subrects", "vnc.hextile_anysubrects", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x8, "Any subrects subencoding is used in this tile", HFILL } }, { &hf_vnc_hextile_num_subrects, { "Number of subrectangles", "vnc.hextile_num_subrects", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of subrectangles that follow", HFILL } }, { &hf_vnc_hextile_subrectscolored, { "Subrects Colored", "vnc.hextile_subrectscolored", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, "Subrects colored subencoding is used in this tile", HFILL } }, { &hf_vnc_hextile_subrect_pixel_value, { "Pixel value", "vnc.hextile_subrect_pixel_value", FT_BYTES, BASE_NONE, NULL, 0x0, "Pixel value of this subrectangle", HFILL } }, { &hf_vnc_hextile_subrect_x_pos, { "X position", "vnc.hextile_subrect_x_pos", FT_UINT8, BASE_DEC, NULL, 0xF0, /* Top 4 bits */ "X position of this subrectangle", HFILL } }, { &hf_vnc_hextile_subrect_y_pos, { "Y position", "vnc.hextile_subrect_y_pos", FT_UINT8, BASE_DEC, NULL, 0xF, /* Bottom 4 bits */ "Y position of this subrectangle", HFILL } }, { &hf_vnc_hextile_subrect_width, { "Width", "vnc.hextile_subrect_width", FT_UINT8, BASE_DEC, NULL, 0xF0, /* Top 4 bits */ "Subrectangle width minus one", HFILL } }, { &hf_vnc_hextile_subrect_height, { "Height", "vnc.hextile_subrect_height", FT_UINT8, BASE_DEC, NULL, 0xF, /* Bottom 4 bits */ "Subrectangle height minus one", HFILL } }, /* ZRLE Encoding */ { &hf_vnc_zrle_len, { "ZRLE compressed length", "vnc.zrle_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of compressed ZRLE data that follows", HFILL } }, { &hf_vnc_zrle_subencoding, { "Subencoding type", "vnc.zrle_subencoding", FT_UINT8, BASE_DEC, NULL, 0x0, "Subencoding type byte", HFILL } }, { &hf_vnc_zrle_rle, { "RLE", "vnc.zrle_rle", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, /* Upper bit */ "Specifies that data is run-length encoded", HFILL } }, { &hf_vnc_zrle_palette_size, { "Palette size", "vnc.zrle_palette_size", FT_UINT8, BASE_DEC, NULL, 0x7F, /* Lower 7 bits */ NULL, HFILL } }, { &hf_vnc_zrle_data, { "ZRLE compressed data", "vnc.zrle_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Compressed ZRLE data. Compiling with zlib support will uncompress and dissect this data", HFILL } }, { &hf_vnc_zrle_raw, { "Pixel values", "vnc.zrle_raw", FT_BYTES, BASE_NONE, NULL, 0x0, "Raw pixel values for this tile", HFILL } }, { &hf_vnc_zrle_palette, { "Palette", "vnc.zrle_palette", FT_BYTES, BASE_NONE, NULL, 0x0, "Palette pixel values", HFILL } }, /* Server Set Colormap Entries */ { &hf_vnc_colormap_first_color, { "First color", "vnc.colormap_first_color", FT_UINT16, BASE_DEC, NULL, 0x0, "First color that should be mapped to given RGB intensities", HFILL } }, { &hf_vnc_color_groups, { "Color groups", "vnc.color_groups", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_colormap_num_colors, { "Number of color groups", "vnc.colormap_groups", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of red/green/blue color groups", HFILL } }, { &hf_vnc_colormap_red, { "Red", "vnc.colormap_red", FT_UINT16, BASE_DEC, NULL, 0x0, "Red intensity", HFILL } }, { &hf_vnc_colormap_green, { "Green", "vnc.colormap_green", FT_UINT16, BASE_DEC, NULL, 0x0, "Green intensity", HFILL } }, { &hf_vnc_colormap_blue, { "Blue", "vnc.colormap_blue", FT_UINT16, BASE_DEC, NULL, 0x0, "Blue intensity", HFILL } }, /* Server Cut Text */ { &hf_vnc_server_cut_text_len, { "Length", "vnc.server_cut_text_len", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of server's copy/cut text (clipboard) string in bytes", HFILL } }, { &hf_vnc_server_cut_text, { "Text", "vnc.server_cut_text", FT_STRING, BASE_NONE, NULL, 0x0, "Text string in the server's copy/cut text (clipboard)", HFILL } }, /* LibVNCServer additions */ { &hf_vnc_supported_messages_client2server, { "Client2server", "vnc.supported_messages_client2server", FT_BYTES, BASE_NONE, NULL, 0x0, "Supported client to server messages (bit flags)", HFILL } }, { &hf_vnc_supported_messages_server2client, { "Server2client", "vnc.supported_messages_server2client", FT_BYTES, BASE_NONE, NULL, 0x0, "Supported server to client messages (bit flags)", HFILL } }, { &hf_vnc_num_supported_encodings, { "Number of supported encodings", "vnc.num_supported_encodings", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_supported_encodings, { "Encoding", "vnc.supported_encodings", FT_UINT32, BASE_HEX, NULL, 0x0, "Supported encoding", HFILL } }, { &hf_vnc_server_identity, { "Server Identity", "vnc.server_identity", FT_STRING, BASE_NONE, NULL, 0x0, "Server identity string", HFILL } }, /* MirrorLink */ { &hf_vnc_mirrorlink_type, { "Type", "vnc.mirrorlink_type", FT_UINT8, BASE_DEC, VALS(vnc_mirrorlink_types_vs), 0x0, "MirrorLink extension message type", HFILL } }, { &hf_vnc_mirrorlink_length, { "Length", "vnc.mirrorlink_length", FT_UINT16, BASE_DEC, NULL, 0x0, "Payload length", HFILL } }, { &hf_vnc_mirrorlink_version_major, { "Major Version", "vnc.mirrorlink_version_major", FT_UINT8, BASE_DEC, NULL, 0x0, "MirrorLink major version", HFILL } }, { &hf_vnc_mirrorlink_version_minor, { "Minor Version", "vnc.mirrorlink_version_minor", FT_UINT8, BASE_DEC, NULL, 0x0, "MirrorLink minor version", HFILL } }, { &hf_vnc_mirrorlink_framebuffer_configuration, { "Configuration", "vnc.mirrorlink_framebuffer_configuration", FT_UINT16, BASE_HEX, NULL, 0x0, "Framebuffer configuration", HFILL } }, { &hf_vnc_mirrorlink_pixel_width, { "Pixel Width", "vnc.mirrorlink_pixel_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Display width [pixel]", HFILL } }, { &hf_vnc_mirrorlink_pixel_height, { "Pixel Height", "vnc.mirrorlink_pixel_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Display height [pixel]", HFILL } }, { &hf_vnc_mirrorlink_pixel_format, { "Pixel Format", "vnc.mirrorlink_pixel_format", FT_UINT32, BASE_HEX, NULL, 0x0, "Pixel format support", HFILL } }, { &hf_vnc_mirrorlink_display_width, { "Display Width", "vnc.mirrorlink_display_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Display width [mm]", HFILL } }, { &hf_vnc_mirrorlink_display_height, { "Display Height", "vnc.mirrorlink_display_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Display height [mm]", HFILL } }, { &hf_vnc_mirrorlink_display_distance, { "Display Distance", "vnc.mirrorlink_display_distance", FT_UINT16, BASE_DEC, NULL, 0x0, "Display distance [mm]", HFILL } }, { &hf_vnc_mirrorlink_keyboard_language, { "Keyboard Language", "vnc.mirrorlink_keyboard_language", FT_STRING, BASE_NONE, NULL, 0x0, "Keyboard layout - Language code (according ISO 639-1)", HFILL } }, { &hf_vnc_mirrorlink_keyboard_country, { "Keyboard Country", "vnc.mirrorlink_keyboard_country", FT_STRING, BASE_NONE, NULL, 0x0, "Keyboard layout - Country code (according ISO 3166-1 alpha-2)", HFILL } }, { &hf_vnc_mirrorlink_ui_language, { "UI Language", "vnc.mirrorlink_ui_language", FT_STRING, BASE_NONE, NULL, 0x0, "UI language - Language code (according ISO 639-1)", HFILL } }, { &hf_vnc_mirrorlink_ui_country, { "UI Country", "vnc.mirrorlink_ui_country", FT_STRING, BASE_NONE, NULL, 0x0, "UI language - Country code (according ISO 3166-1 alpha 2)", HFILL } }, { &hf_vnc_mirrorlink_knob_keys, { "Knob Keys", "vnc.mirrorlink_knob_keys", FT_UINT32, BASE_HEX, NULL, 0x0, "Supported knob keys", HFILL } }, { &hf_vnc_mirrorlink_device_keys, { "Device Keys", "vnc.mirrorlink_device_keys", FT_UINT32, BASE_HEX, NULL, 0x0, "Supported device keys", HFILL } }, { &hf_vnc_mirrorlink_multimedia_keys, { "Multimedia Keys", "vnc.mirrorlink_multimedia_keys", FT_UINT32, BASE_HEX, NULL, 0x0, "Supported multimedia keys", HFILL } }, { &hf_vnc_mirrorlink_key_related, { "Keyboard", "vnc.mirrorlink_key_related", FT_UINT32, BASE_HEX, NULL, 0x0, "Keyboard related", HFILL } }, { &hf_vnc_mirrorlink_pointer_related, { "Pointer", "vnc.mirrorlink_pointer_related", FT_UINT32, BASE_HEX, NULL, 0x0, "Pointer related", HFILL } }, { &hf_vnc_mirrorlink_key_symbol_value_client, { "Client KeySymValue", "vnc.mirrorlink_key_symbol_value_client", FT_UINT32, BASE_HEX, NULL, 0x0, "Client key symbol value", HFILL } }, { &hf_vnc_mirrorlink_key_symbol_value_server, { "Server KeySymValue", "vnc.mirrorlink_key_symbol_value_server", FT_UINT32, BASE_HEX, NULL, 0x0, "Server key symbol value", HFILL } }, { &hf_vnc_mirrorlink_key_configuration, { "Configuration", "vnc.mirrorlink_key_configuration", FT_UINT8, BASE_HEX, NULL, 0x0, "Key event listing configuration", HFILL } }, { &hf_vnc_mirrorlink_key_num_events, { "Number of Key Events", "vnc.mirrorlink_key_num_events", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of key events in list", HFILL } }, { &hf_vnc_mirrorlink_key_event_counter, { "Key Event Counter", "vnc.mirrorlink_key_event_counter", FT_UINT16, BASE_DEC, NULL, 0x0, "Key event listing counter", HFILL } }, { &hf_vnc_mirrorlink_key_symbol_value, { "KeySymValue", "vnc.mirrorlink_key_symbol_value", FT_UINT32, BASE_HEX, NULL, 0x0, "Key symbol value", HFILL } }, { &hf_vnc_mirrorlink_key_request_configuration, { "Configuration", "vnc.mirrorlink_key_request_configuration", FT_UINT32, BASE_HEX, NULL, 0x0, "Key event listing request configuration", HFILL } }, { &hf_vnc_mirrorlink_keyboard_configuration, { "Configuration", "vnc.mirrorlink_keyboard_configuration", FT_UINT32, BASE_HEX, NULL, 0x0, "Virtual keyboard configuration", HFILL } }, { &hf_vnc_mirrorlink_cursor_x, { "Cursor X", "vnc.mirrorlink_cursor_x", FT_UINT16, BASE_DEC, NULL, 0x0, "Cursor - X position", HFILL } }, { &hf_vnc_mirrorlink_cursor_y, { "Cursor Y", "vnc.mirrorlink_cursor_y", FT_UINT16, BASE_DEC, NULL, 0x0, "Cursor - Y position", HFILL } }, { &hf_vnc_mirrorlink_text_x, { "Text X", "vnc.mirrorlink_text_x", FT_UINT16, BASE_DEC, NULL, 0x0, "Text input area - X position", HFILL } }, { &hf_vnc_mirrorlink_text_y, { "Text Y", "vnc.mirrorlink_text_y", FT_UINT16, BASE_DEC, NULL, 0x0, "Text input area - Y position", HFILL } }, { &hf_vnc_mirrorlink_text_width, { "Text Width", "vnc.mirrorlink_text_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Text input area - Width", HFILL } }, { &hf_vnc_mirrorlink_text_height, { "Text Height", "vnc.mirrorlink_text_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Text input area - Height", HFILL } }, { &hf_vnc_mirrorlink_keyboard_request_configuration, { "Configuration", "vnc.mirrorlink_keyboard_request_configuration", FT_UINT32, BASE_HEX, NULL, 0x0, "Virtual keyboard request configuration", HFILL } }, { &hf_vnc_mirrorlink_device_status, { "Device Status", "vnc.mirrorlink_device_status", FT_UINT32, BASE_HEX, NULL, 0x0, "Status of Device Features", HFILL } }, { &hf_vnc_mirrorlink_app_id, { "App Id", "vnc.mirrorlink_app_id", FT_UINT32, BASE_HEX, NULL, 0x0, "Unique application id", HFILL } }, { &hf_vnc_mirrorlink_fb_block_x, { "Frambuffer X", "vnc.mirrorlink_fb_block_x", FT_UINT16, BASE_DEC, NULL, 0x0, "Frambuffer blocking - X position", HFILL } }, { &hf_vnc_mirrorlink_fb_block_y, { "Frambuffer Y", "vnc.mirrorlink_fb_block_y", FT_UINT16, BASE_DEC, NULL, 0x0, "Frambuffer blocking - Y position", HFILL } }, { &hf_vnc_mirrorlink_fb_block_width, { "Frambuffer Width", "vnc.mirrorlink_fb_block_width", FT_UINT16, BASE_DEC, NULL, 0x0, "Frambuffer blocking - Width", HFILL } }, { &hf_vnc_mirrorlink_fb_block_height, { "Frambuffer Height", "vnc.mirrorlink_fb_block_height", FT_UINT16, BASE_DEC, NULL, 0x0, "Frambuffer blocking - Height", HFILL } }, { &hf_vnc_mirrorlink_fb_block_reason, { "Reason", "vnc.mirrorlink_fb_block_reason", FT_UINT16, BASE_HEX, NULL, 0x0, "Reason for blocking", HFILL } }, { &hf_vnc_mirrorlink_audio_block_reason, { "Reason", "vnc.mirrorlink_audio_block_reason", FT_UINT16, BASE_HEX, NULL, 0x0, "Reason for blocking", HFILL } }, { &hf_vnc_mirrorlink_touch_num_events, { "Number of Touch Events", "vnc.mirrorlink_touch_num_events", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of touch events in list", HFILL } }, { &hf_vnc_mirrorlink_touch_x, { "Touch X", "vnc.mirrorlink_touch_x", FT_UINT16, BASE_DEC, NULL, 0x0, "Touch event - X position", HFILL } }, { &hf_vnc_mirrorlink_touch_y, { "Touch Y", "vnc.mirrorlink_touch_y", FT_UINT16, BASE_DEC, NULL, 0x0, "Touch event - Y position", HFILL } }, { &hf_vnc_mirrorlink_touch_id, { "Touch Id", "vnc.mirrorlink_touch_id", FT_UINT8, BASE_DEC, NULL, 0x0, "Touch event - identifier", HFILL } }, { &hf_vnc_mirrorlink_touch_pressure, { "Touch Pressure", "vnc.mirrorlink_touch_pressure", FT_UINT8, BASE_DEC, NULL, 0x0, "Touch event - pressure value", HFILL } }, { &hf_vnc_mirrorlink_text, { "Text", "vnc.mirrorlink_text", FT_STRING, BASE_NONE, NULL, 0x0, "Textual information", HFILL } }, { &hf_vnc_mirrorlink_text_length, { "Length", "vnc.mirrorlink_text_length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of textual information", HFILL } }, { &hf_vnc_mirrorlink_text_max_length, { "Max Length", "vnc.mirrorlink_text_max_length", FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum length of textual information", HFILL } }, { &hf_vnc_mirrorlink_unknown, { "Unknown", "vnc.mirrorlink_unknown", FT_BYTES, BASE_NONE, NULL, 0x0, "Unknown data", HFILL } }, /* Fence */ { &hf_vnc_fence_flags, {"Fence flags", "vnc.fence_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_vnc_fence_request, { "Fence_request", "vnc.fence_request", FT_BOOLEAN, 32, NULL, VNC_FENCE_REQUEST, NULL, HFILL } }, { &hf_vnc_fence_sync_next, { "Fence_sync_next", "vnc.fence_sync_next", FT_BOOLEAN, 32, NULL, VNC_FENCE_SYNC_NEXT, NULL, HFILL } }, { &hf_vnc_fence_block_after, { "Fence_block_after", "vnc.fence_block_after", FT_BOOLEAN, 32, NULL, VNC_FENCE_BLOCK_AFTER, NULL, HFILL } }, { &hf_vnc_fence_block_before, { "Fence block_before", "vnc.fence_block_before", FT_BOOLEAN, 32, NULL, VNC_FENCE_BLOCK_BEFORE, NULL, HFILL } }, { &hf_vnc_fence_payload_length, { "Fence payload length", "vnc.fence_payload_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vnc_fence_payload, { "Fence payload", "vnc.fence_payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Context Information */ { &hf_vnc_context_information_app_id, { "App Id", "vnc.context_information_app_id", FT_UINT32, BASE_HEX, NULL, 0x0, "Unique application id", HFILL } }, { &hf_vnc_context_information_app_trust_level, { "App Trust Level", "vnc.context_information_app_trust_level", FT_UINT16, BASE_HEX, NULL, 0x0, "Trust Level for Application Category", HFILL } }, { &hf_vnc_context_information_content_trust_level, { "Content Trust Level", "vnc.context_information_content_trust_level", FT_UINT16, BASE_HEX, NULL, 0x0, "Trust Level for Content Category", HFILL } }, { &hf_vnc_context_information_app_category, { "App Category", "vnc.context_information_app_category", FT_UINT32, BASE_HEX, NULL, 0x0, "Application Category", HFILL } }, { &hf_vnc_context_information_content_category, { "Content Category", "vnc.context_information_content_category", FT_UINT32, BASE_HEX, NULL, 0x0, "Visual content category", HFILL } }, { &hf_vnc_context_information_content_rules, { "Content Rules", "vnc.context_information_content_rules", FT_UINT32, BASE_HEX, NULL, 0x0, "Visual content rules", HFILL } }, /* Scan Line based Run-Length Encoding */ { &hf_vnc_slrle_run_num, { "Number of Runs", "vnc.slrle_run_num", FT_UINT16, BASE_DEC, NULL, 0x0, "Number of Runs within Line", HFILL } }, { &hf_vnc_slrle_run_data, { "Raw RLE data", "vnc.slrle_run_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Raw Run-Length encoded data within Line", HFILL } }, /* H.264 Encoding */ { &hf_vnc_h264_slice_type, { "Slice Type", "vnc.h264_slice_type", FT_UINT32, BASE_DEC, VALS(vnc_h264_slice_types_vs), 0x0, "Frame slice type", HFILL } }, { &hf_vnc_h264_nbytes, { "Number of Bytes", "vnc.h264_nbytes", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of bytes within frame", HFILL } }, { &hf_vnc_h264_width, { "Width", "vnc.h264_width", FT_UINT32, BASE_DEC, NULL, 0x0, "Frame Width", HFILL } }, { &hf_vnc_h264_height, { "Height", "vnc.h264_height", FT_UINT32, BASE_DEC, NULL, 0x0, "Frame Height", HFILL } }, { &hf_vnc_h264_data, { "Data", "vnc.h264_data", FT_BYTES, BASE_NONE, NULL, 0x0, "Frame H.264 data", HFILL } }, }; /* Setup protocol subtree arrays */ static gint *ett[] = { &ett_vnc, &ett_vnc_client_message_type, &ett_vnc_server_message_type, &ett_vnc_rect, &ett_vnc_encoding_type, &ett_vnc_rre_subrect, &ett_vnc_hextile_subencoding_mask, &ett_vnc_hextile_num_subrects, &ett_vnc_hextile_subrect, &ett_vnc_hextile_tile, &ett_vnc_zrle_subencoding, &ett_vnc_colormap_num_groups, &ett_vnc_desktop_screen, &ett_vnc_colormap_color_group, &ett_vnc_key_events, &ett_vnc_touch_events, &ett_vnc_slrle_subline, &ett_vnc_fence_flags }; static ei_register_info ei[] = { { &ei_vnc_possible_gtk_vnc_bug, { "vnc.possible_gtk_vnc_bug", PI_MALFORMED, PI_ERROR, "NULL found in greeting. client -> server greeting must be 12 bytes (possible gtk-vnc bug)", EXPFILL }}, { &ei_vnc_auth_code_mismatch, { "vnc.auth_code_mismatch", PI_PROTOCOL, PI_WARN, "Authentication code does not match vendor or signature", EXPFILL }}, { &ei_vnc_unknown_tight_vnc_auth, { "vnc.unknown_tight_vnc_auth", PI_PROTOCOL, PI_ERROR, "Unknown TIGHT VNC authentication", EXPFILL }}, { &ei_vnc_too_many_rectangles, { "vnc.too_many_rectangles", PI_MALFORMED, PI_ERROR, "Too many rectangles, aborting dissection", EXPFILL }}, { &ei_vnc_too_many_sub_rectangles, { "vnc.too_many_sub_rectangles", PI_MALFORMED, PI_ERROR, "Too many sub-rectangles, aborting dissection", EXPFILL }}, { &ei_vnc_invalid_encoding, { "vnc.invalid_encoding", PI_MALFORMED, PI_ERROR, "Invalid encoding", EXPFILL }}, { &ei_vnc_too_many_colors, { "vnc.too_many_colors", PI_MALFORMED, PI_ERROR, "Too many colors, aborting dissection", EXPFILL }}, { &ei_vnc_too_many_cut_text, { "vnc.too_many_cut_text", PI_MALFORMED, PI_ERROR, "Too much cut text, aborting dissection", EXPFILL }}, { &ei_vnc_zrle_failed, { "vnc.zrle_failed", PI_UNDECODED, PI_ERROR, "Decompression of ZRLE data failed", EXPFILL }}, { &ei_vnc_unknown_tight, { "vnc.unknown_tight_packet", PI_UNDECODED, PI_WARN, "Unknown packet (TightVNC)", EXPFILL }}, { &ei_vnc_reassemble, { "vnc.reassemble", PI_REASSEMBLE, PI_CHAT, "See further on for dissection of the complete (reassembled) PDU", EXPFILL }}, }; /* Register the protocol name and description */ proto_vnc = proto_register_protocol("Virtual Network Computing", "VNC", "vnc"); vnc_handle = register_dissector("vnc", dissect_vnc, proto_vnc); /* Required function calls to register the header fields and subtrees */ proto_register_field_array(proto_vnc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vnc = expert_register_protocol(proto_vnc); expert_register_field_array(expert_vnc, ei, array_length(ei)); /* Register our preferences module */ vnc_module = prefs_register_protocol(proto_vnc, apply_vnc_prefs); prefs_register_bool_preference(vnc_module, "desegment", "Reassemble VNC messages spanning multiple TCP segments.", "Whether the VNC dissector should reassemble messages spanning " "multiple TCP segments. To use this option, you must also enable " "\"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &vnc_preference_desegment); } void proto_reg_handoff_vnc(void) { dissector_add_uint_range_with_preference("tcp.port", VNC_PORT_RANGE, vnc_handle); heur_dissector_add("tcp", test_vnc_protocol, "VNC over TCP", "vnc_tcp", proto_vnc, HEURISTIC_ENABLE); /* We don't register a port for the VNC HTTP server because * that simply provides a java program for download via the * HTTP protocol. The java program then connects to a standard * VNC port. */ } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-vntag.c
/* packet-vntag.c * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include <epan/expert.h> #include <epan/tfs.h> #include "packet-ieee8023.h" void proto_register_vntag(void); void proto_reg_handoff_vntag(void); static dissector_handle_t ethertype_handle; static int proto_vntag = -1; static int hf_vntag_etype = -1; static int hf_vntag_dir = -1; static int hf_vntag_ptr = -1; static int hf_vntag_dst = -1; static int hf_vntag_looped = -1; static int hf_vntag_r = -1; static int hf_vntag_version = -1; static int hf_vntag_src = -1; static int hf_vntag_len = -1; static int hf_vntag_trailer = -1; static gint ett_vntag = -1; static expert_field ei_vntag_len = EI_INIT; static const true_false_string vntag_dir_tfs = { "From Bridge", "To Bridge" }; static const true_false_string vntag_ptr_tfs = { "vif_list_id", "vif_id" }; static int dissect_vntag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint16 encap_proto; proto_tree *vntag_tree = NULL; ethertype_data_t ethertype_data; /* Documentation: https://d2zmdbbm9feqrf.cloudfront.net/2012/usa/pdf/BRKDCT-2340.pdf p.61 http://www.definethecloud.net/access-layer-network-virtualization-vn-tag-and-vepa */ static int * const fields[] = { &hf_vntag_dir, &hf_vntag_ptr, &hf_vntag_dst, &hf_vntag_looped, &hf_vntag_r, &hf_vntag_version, &hf_vntag_src, NULL }; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VNTAG"); col_clear(pinfo->cinfo, COL_INFO); if (tree) { proto_item *ti = proto_tree_add_item(tree, proto_vntag, tvb, 0, 4, ENC_NA); vntag_tree = proto_item_add_subtree(ti, ett_vntag); proto_tree_add_bitmask_list(vntag_tree, tvb, 0, 4, fields, ENC_BIG_ENDIAN); } encap_proto = tvb_get_ntohs(tvb, 4); /* VNTAG may also carry 802.2 encapsulated data */ if (encap_proto <= IEEE_802_3_MAX_LEN) { gboolean is_802_2; /* Is there an 802.2 layer? I can tell by looking at the first 2 bytes after the VLAN header. If they are 0xffff, then what follows the VLAN header is an IPX payload, meaning no 802.2. (IPX/SPX is they only thing that can be contained inside a straight 802.3 packet, so presumably the same applies for Ethernet VLAN packets). A non-0xffff value means that there's an 802.2 layer inside the VLAN layer */ is_802_2 = TRUE; /* Don't throw an exception for this check (even a BoundsError) */ if (tvb_captured_length_remaining(tvb, 6) >= 2) { if (tvb_get_ntohs(tvb, 6) == 0xffff) is_802_2 = FALSE; } dissect_802_3(encap_proto, is_802_2, tvb, 6, pinfo, tree, vntag_tree, hf_vntag_len, hf_vntag_trailer, &ei_vntag_len, 0); } else { proto_tree_add_uint(vntag_tree, hf_vntag_etype, tvb, 4, 2, encap_proto); ethertype_data.etype = encap_proto; ethertype_data.payload_offset = 6; ethertype_data.fh_tree = vntag_tree; ethertype_data.trailer_id = hf_vntag_trailer; ethertype_data.fcs_len = 0; call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data); } return tvb_captured_length(tvb); } void proto_register_vntag(void) { static hf_register_info hf[] = { { &hf_vntag_etype, { "Type", "vntag.etype", FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, NULL, HFILL } }, { &hf_vntag_dir, { "Direction", "vntag.dir", FT_BOOLEAN, 32, TFS(&vntag_dir_tfs), 0x80000000, NULL, HFILL } }, { &hf_vntag_ptr, { "Pointer", "vntag.ptr", FT_BOOLEAN, 32, TFS(&vntag_ptr_tfs), 0x40000000, NULL, HFILL } }, { &hf_vntag_dst, { "Destination", "vntag.dst", FT_UINT32, BASE_DEC, NULL, 0x3FFF0000, NULL, HFILL } }, { &hf_vntag_looped, { "Looped", "vntag.looped", FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00008000, NULL, HFILL } }, { &hf_vntag_r, { "Reserved", "vntag.r", FT_UINT32, BASE_DEC, NULL, 0x00004000, NULL, HFILL } }, { &hf_vntag_version, { "Version", "vntag.version", FT_UINT32, BASE_DEC, NULL, 0x00003000, NULL, HFILL } }, { &hf_vntag_src, { "Source", "vntag.src", FT_UINT32, BASE_DEC, NULL, 0x00000FFF, NULL, HFILL } }, { &hf_vntag_len, { "Length", "vntag.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vntag_trailer, { "Trailer", "vntag.trailer", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_vntag }; static ei_register_info ei[] = { { &ei_vntag_len, { "vntag.len.past_end", PI_MALFORMED, PI_ERROR, "Length field value goes past the end of the payload", EXPFILL }}, }; expert_module_t* expert_vntag; proto_vntag = proto_register_protocol("VN-Tag", "VNTAG", "vntag"); proto_register_field_array(proto_vntag, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vntag = expert_register_protocol(proto_vntag); expert_register_field_array(expert_vntag, ei, array_length(ei)); } void proto_reg_handoff_vntag(void) { dissector_handle_t vntag_handle; vntag_handle = create_dissector_handle(dissect_vntag, proto_vntag); dissector_add_uint("ethertype", ETHERTYPE_VNTAG, vntag_handle); ethertype_handle = find_dissector_add_dependency("ethertype", proto_vntag); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-vp8.c
/* packet-vp8.c * Routines for VP8 dissection * Copyright 2014, Owen Williams [email protected] * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * RFC 6386 - VP8 Data Format and Decoding Guide * RFC 7741 - RTP Payload Format for VP8 Video */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> void proto_reg_handoff_vp8(void); void proto_register_vp8(void); #define BIT_1_MASK 0x80 #define BIT_2_MASK 0x40 #define BIT_3_MASK 0x20 #define BIT_4_MASK 0x10 #define BIT_5_MASK 0x08 #define BIT_6_MASK 0x04 #define BIT_7_MASK 0x02 #define BIT_8_MASK 0x01 #define BIT_123_MASK 0xE0 #define BIT_234_MASK 0x70 #define BIT_5678_MASK 0x0F #define BIT_567_MASK 0x0E #define BIT_45678_MASK 0x1F #define BIT_12_MASK 0xC0 #define BIT_NO_MASK 0x0 #define BIT_2BYTE_NO_MASK 0x0 #define BIT_3BYTE_NO_MASK 0x0 #define BIT_EXT_PICTURE_MASK 0x7FFF #define BIT_PARTITION_SIZE_MASK 0xFFFFE0 static dissector_handle_t vp8_handle; /* Initialize the protocol and registered fields */ static int proto_vp8 = -1; static int hf_vp8_pld_x_bit = -1; static int hf_vp8_pld_r_bit = -1; static int hf_vp8_pld_n_bit = -1; static int hf_vp8_pld_s_bit = -1; static int hf_vp8_pld_part_id = -1; static int hf_vp8_pld_i_bit = -1; static int hf_vp8_pld_l_bit = -1; static int hf_vp8_pld_t_bit = -1; static int hf_vp8_pld_k_bit = -1; static int hf_vp8_pld_rsv_a = -1; static int hf_vp8_pld_picture_id = -1; static int hf_vp8_pld_extended_picture_id = -1; static int hf_vp8_pld_tl0picidx = -1; static int hf_vp8_pld_tid = -1; static int hf_vp8_pld_y_bit = -1; static int hf_vp8_pld_keyidx = -1; /* payload header fields */ static int hf_vp8_hdr_frametype = -1; static int hf_vp8_hdr_version = -1; static int hf_vp8_hdr_show_bit = -1; static int hf_vp8_hdr_first_partition_size = -1; /* keyframe fields */ static int hf_vp8_keyframe_start_code = -1; static int hf_vp8_keyframe_width = -1; static int hf_vp8_keyframe_horizontal_scale = -1; static int hf_vp8_keyframe_height = -1; static int hf_vp8_keyframe_vertical_scale = -1; /* Initialize the subtree pointers */ static int ett_vp8 = -1; static int ett_vp8_payload_descriptor = -1; static int ett_vp8_payload_header = -1; static int ett_vp8_payload = -1; static int ett_vp8_keyframe = -1; static expert_field ei_vp8_startcode = EI_INIT; static expert_field ei_vp8_undecoded = EI_INIT; static expert_field ei_vp8_continuation = EI_INIT; static expert_field ei_vp8_first_partition_split = EI_INIT; static expert_field ei_vp8_first_partition_plus = EI_INIT; static void dissect_vp8_payload_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *vp8_tree, gint *offset, gboolean *hasHeader); static void dissect_vp8_payload_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *vp8_tree, gint *offset, gint *frametype, gint *partition1_size); static void dissect_vp8_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *vp8_tree, gint *offset, gint *frametype, gint *partition1_size); static gint *ett[] = { &ett_vp8, &ett_vp8_payload_descriptor, &ett_vp8_payload_header, &ett_vp8_payload, &ett_vp8_keyframe }; static const value_string vp8_type_values[] = { { 0, "Keyframe" }, { 1, "Interframe" }, { 2, "Continuation" }, { 0, NULL } }; static const range_string vp8_hdr_version_vals[] = { { 0, 0, "Bicubic (Loop Filter=Normal)" }, { 1, 1, "Bilinear (Loop Filter=Simple)" }, { 2, 2, "Bilinear (Loop Filter=None)" }, { 3, 3, "No filters" }, { 4, 7, "Reserved for future use" }, { 0, 0, NULL } }; static const true_false_string vp8_x_bit_vals = { "Extended control bits present (I L T K)", "Extended control bits not present" }; static const true_false_string vp8_r_bit_vals = { "Reserved for future use (error: should be zero)", "Reserved for future use" }; static const true_false_string vp8_n_bit_vals = { "Non-reference frame", "Reference frame" }; static const true_false_string vp8_s_bit_vals = { "Start of VP8 partition", "Continuation of VP8 partition" }; static const true_false_string vp8_i_bit_vals = { "Picture ID byte present", "No Picture byte ID" }; static const true_false_string vp8_l_bit_vals = { "TL0PICIDX byte present", "TL0PICIDX byte not present" }; static const true_false_string vp8_t_bit_vals = { "TID (temporal layer index) present", "TID (temporal layer index) not present" }; static const true_false_string vp8_k_bit_vals = { "KEYIDX present", "KEYIDX not present" }; static const true_false_string vp8_hdr_frametype_vals = { "interframe", "keyframe" }; static int dissect_vp8(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *item; gint offset = 0, frametype = 0, partition1_size = -1; proto_tree *vp8_tree; gboolean hasHeader = FALSE; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VP8"); item = proto_tree_add_item(tree, proto_vp8, tvb, 0, -1, ENC_NA); vp8_tree = proto_item_add_subtree(item, ett_vp8); frametype = 2; /*continuation, will get overridden if there is a payload header*/ dissect_vp8_payload_descriptor(tvb, pinfo, vp8_tree, &offset, &hasHeader); if (hasHeader) { dissect_vp8_payload_header(tvb, pinfo, vp8_tree, &offset, &frametype, &partition1_size); } dissect_vp8_payload(tvb, pinfo, vp8_tree, &offset, &frametype, &partition1_size); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", val_to_str(frametype, vp8_type_values, "Unknown Type (%u)")); return tvb_captured_length(tvb); } static void dissect_vp8_payload_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *vp8_tree, gint *offset, gboolean *hasHeader) { proto_item *item_descriptor; guint8 extended_bit, s_bit, partId; proto_tree *vp8_payload_descriptor_tree; /* The first octets after the RTP header are the VP8 payload descriptor, with the following structure. 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |X|R|N|S|R| PID | (REQUIRED), second R bit is parsed as part of PID +-+-+-+-+-+-+-+-+ X: |I|L|T|K| RSV | (OPTIONAL) +-+-+-+-+-+-+-+-+ I: |M| PictureID | (OPTIONAL) +-+-+-+-+-+-+-+-+ L: | TL0PICIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+ T/K: |TID|Y| KEYIDX | (OPTIONAL) +-+-+-+-+-+-+-+-+ */ vp8_payload_descriptor_tree = proto_tree_add_subtree(vp8_tree, tvb, *offset, -1, ett_vp8_payload_descriptor, &item_descriptor, "Payload descriptor"); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_x_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_r_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_n_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_s_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_part_id, tvb, *offset, 1, ENC_BIG_ENDIAN); extended_bit = tvb_get_guint8(tvb, *offset) & BIT_1_MASK; s_bit = tvb_get_guint8(tvb, *offset) & BIT_4_MASK; partId = tvb_get_guint8(tvb, *offset) & BIT_5678_MASK; if ((s_bit > 0) && (partId == 0)) { *hasHeader=TRUE; } if (extended_bit) { guint8 i_bit, l_bit, t_bit, k_bit; (*offset)++; proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_i_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_l_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_t_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_k_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_rsv_a, tvb, *offset, 1, ENC_BIG_ENDIAN); i_bit = tvb_get_guint8(tvb, *offset) & BIT_1_MASK; l_bit = tvb_get_guint8(tvb, *offset) & BIT_2_MASK; t_bit = tvb_get_guint8(tvb, *offset) & BIT_3_MASK; k_bit = tvb_get_guint8(tvb, *offset) & BIT_4_MASK; if (i_bit) { (*offset)++; if(tvb_get_guint8(tvb, *offset) & BIT_1_MASK) { proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_extended_picture_id, tvb, *offset, 2, ENC_BIG_ENDIAN); (*offset)++; } else { proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_picture_id, tvb, *offset, 1, ENC_BIG_ENDIAN); } } if (l_bit) { (*offset)++; proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_tl0picidx, tvb, *offset, 1, ENC_BIG_ENDIAN); } if (t_bit || k_bit) { (*offset)++; proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_tid, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_y_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_descriptor_tree, hf_vp8_pld_keyidx, tvb, *offset, 1, ENC_BIG_ENDIAN); } } (*offset)++; /* now we know the length of payload descriptor */ proto_item_set_len(item_descriptor, *offset); } static void dissect_vp8_payload_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *vp8_tree, gint *offset, gint *frametype, gint *partition1_size) { proto_item *item_header; proto_tree *vp8_payload_header_tree; gint size0, size1, size2; /* The first three octets of an encoded VP8 frame are referred to as an "uncompressed data chunk" in [RFC6386], and co-serve as payload header in this RTP format. The codec bitstream format specifies two different variants of the uncompressed data chunk: a 3 octet version for interframes and a 10 octet version for key frames. The first 3 octets are common to both variants. In the case of a key frame the remaining 7 octets are considered to be part of the remaining payload in this RTP format. Note that the header is present only in packets which have the S bit equal to one and the PartID equal to zero in the payload descriptor. Subsequent packets for the same frame do not carry the payload header. 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |Size0|H| VER |P| +-+-+-+-+-+-+-+-+ | Size1 | +-+-+-+-+-+-+-+-+ | Size2 | +-+-+-+-+-+-+-+-+ | Bytes 4..N of | | VP8 payload | : : +-+-+-+-+-+-+-+-+ | OPTIONAL RTP | | padding | : : +-+-+-+-+-+-+-+-+ */ vp8_payload_header_tree = proto_tree_add_subtree(vp8_tree, tvb, *offset, 3, ett_vp8_payload_header, &item_header, "Payload header"); proto_tree_add_item(vp8_payload_header_tree, hf_vp8_hdr_frametype, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_header_tree, hf_vp8_hdr_version, tvb, *offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp8_payload_header_tree, hf_vp8_hdr_show_bit, tvb, *offset, 1, ENC_BIG_ENDIAN); *frametype = tvb_get_guint8(tvb, *offset) & BIT_8_MASK; size0 = (tvb_get_guint8(tvb, *offset) & BIT_123_MASK) >> 5; size1 = tvb_get_guint8(tvb, *offset + 1); size2 = tvb_get_guint8(tvb, *offset + 2); (*partition1_size) = size0 + (size1*8) + (size2*2048); proto_tree_add_uint(vp8_payload_header_tree, hf_vp8_hdr_first_partition_size, tvb, *offset, 3, *partition1_size); (*offset) += 3; } static void dissect_vp8_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *vp8_tree, gint *offset, gint *frametype, gint *partition1_size) { proto_tree *vp8_payload_tree; proto_item *payload_item; gint remainder; vp8_payload_tree = proto_tree_add_subtree(vp8_tree, tvb, *offset, -1, ett_vp8_payload, &payload_item, "Payload"); if (*frametype == 0) { guint16 width, height; gint start1, start2, start3, horizontal_scale, vertical_scale; proto_tree *vp8_keyframe_tree; vp8_keyframe_tree = proto_tree_add_subtree(vp8_payload_tree, tvb, *offset, -1, ett_vp8_keyframe, NULL, "Keyframe header"); proto_tree_add_item(vp8_keyframe_tree, hf_vp8_keyframe_start_code, tvb, *offset, 3, ENC_BIG_ENDIAN); start1 = tvb_get_guint8(tvb, *offset); start2 = tvb_get_guint8(tvb, *offset + 1); start3 = tvb_get_guint8(tvb, *offset + 2); /* check start code is correct */ if ((start1 != 0x9d) || (start2 != 0x01) || (start3 != 0x2a)) { expert_add_info(pinfo, vp8_keyframe_tree, &ei_vp8_startcode); } (*offset)++; (*offset)++; (*offset)++; width = tvb_get_letohs(tvb, *offset) & 0x3FFF; horizontal_scale = tvb_get_letohs(tvb, *offset)>>14; proto_tree_add_uint(vp8_keyframe_tree, hf_vp8_keyframe_horizontal_scale, tvb, *offset, 2, horizontal_scale); proto_tree_add_uint(vp8_keyframe_tree, hf_vp8_keyframe_width, tvb, *offset, 2, width); (*offset)++; (*offset)++; height = tvb_get_letohs(tvb, *offset) & 0x3FFF; vertical_scale = tvb_get_letohs(tvb, *offset)>>14; proto_tree_add_uint(vp8_keyframe_tree, hf_vp8_keyframe_vertical_scale, tvb, *offset, 2, vertical_scale); proto_tree_add_uint(vp8_keyframe_tree, hf_vp8_keyframe_height, tvb, *offset, 2, height); (*offset)++; (*offset)++; } remainder = tvb_reported_length_remaining(tvb, (*offset)); if ((*partition1_size) == -1) { /*no header, continuation?*/ proto_tree_add_expert_format(vp8_payload_tree, pinfo, &ei_vp8_continuation, tvb, *offset, -1, "Continuation of partition fragment (%d bytes)", remainder); } else { if (remainder < *partition1_size) { /* partition size has already been added to vp8 header tree, but it would be useful to provide additional explanation */ proto_tree_add_expert_format(vp8_payload_tree, pinfo, &ei_vp8_first_partition_split, tvb, *offset, -1, "First partition is split with %d bytes in this packet and %d bytes in subsequent frames", remainder, ((*partition1_size)-remainder)); } else { (*offset)= (*offset) + (*partition1_size); proto_tree_add_expert_format(vp8_payload_tree, pinfo, &ei_vp8_first_partition_plus, tvb, *offset, -1, "This frame contains all of first partition (%d bytes) and also %d bytes from other partitions", *partition1_size, remainder); } } expert_add_info(pinfo, payload_item, &ei_vp8_undecoded); } void proto_register_vp8(void) { module_t *vp8_module; expert_module_t* expert_vp8; static hf_register_info hf[] = { { &hf_vp8_pld_x_bit, { "X bit", "vp8.pld.x", FT_BOOLEAN, 8, TFS(&vp8_x_bit_vals), BIT_1_MASK, NULL, HFILL } }, { &hf_vp8_pld_r_bit, { "R bit", "vp8.pld.r", FT_BOOLEAN, 8, TFS(&vp8_r_bit_vals), BIT_2_MASK, NULL, HFILL } }, { &hf_vp8_pld_n_bit, { "N bit", "vp8.pld.n", FT_BOOLEAN, 8, TFS(&vp8_n_bit_vals), BIT_3_MASK, NULL, HFILL } }, { &hf_vp8_pld_s_bit, { "S bit", "vp8.pld.s", FT_BOOLEAN, 8, TFS(&vp8_s_bit_vals), BIT_4_MASK, NULL, HFILL } }, { &hf_vp8_pld_part_id, { "2nd R bit and Part Id", "vp8.pld.partid", FT_UINT8, BASE_DEC, NULL, BIT_5678_MASK, NULL, HFILL } }, { &hf_vp8_pld_i_bit, { "I bit", "vp8.pld.i", FT_BOOLEAN, 8, TFS(&vp8_i_bit_vals), BIT_1_MASK, NULL, HFILL } }, { &hf_vp8_pld_l_bit, { "L bit", "vp8.pld.l", FT_BOOLEAN, 8, TFS(&vp8_l_bit_vals), BIT_2_MASK, NULL, HFILL } }, { &hf_vp8_pld_t_bit, { "T bit", "vp8.pld.t", FT_BOOLEAN, 8, TFS(&vp8_t_bit_vals), BIT_3_MASK, NULL, HFILL } }, { &hf_vp8_pld_k_bit, { "K bit", "vp8.pld.k", FT_BOOLEAN, 8, TFS(&vp8_k_bit_vals), BIT_4_MASK, NULL, HFILL } }, { &hf_vp8_pld_rsv_a, { "Reserved A", "vp8.pld.rsva", FT_UINT8, BASE_DEC, NULL, BIT_5678_MASK, NULL, HFILL } }, { &hf_vp8_pld_picture_id, { "Picture ID", "vp8.pld.pictureid", FT_UINT8, BASE_DEC, NULL, BIT_NO_MASK, NULL, HFILL } }, { &hf_vp8_pld_extended_picture_id, { "Extended Picture ID", "vp8.pld.pictureid", FT_UINT16, BASE_DEC, NULL, BIT_EXT_PICTURE_MASK, NULL, HFILL } }, { &hf_vp8_pld_tl0picidx, { "Temporal layer zero Picture Index (TL0PICIDX)", "vp8.pld.tl0picidx", FT_UINT8, BASE_DEC, NULL, BIT_NO_MASK, NULL, HFILL } }, { &hf_vp8_pld_tid, { "Temporal layer Index (TID)", "vp8.pld.tid", FT_UINT8, BASE_DEC, NULL, BIT_12_MASK, NULL, HFILL } }, { &hf_vp8_pld_y_bit, { "1 layer sync bit (Y)", "vp8.pld.y", FT_BOOLEAN, 8, NULL, BIT_3_MASK, NULL, HFILL } }, { &hf_vp8_pld_keyidx, { "Temporal Key Frame Index (KEYIDX)", "vp8.pld.keyidx", FT_UINT8, BASE_DEC, NULL, BIT_45678_MASK, NULL, HFILL } }, { &hf_vp8_hdr_frametype, { "frametype", "vp8.hdr.frametype", FT_BOOLEAN, 8, TFS(&vp8_hdr_frametype_vals), BIT_8_MASK, NULL, HFILL } }, { &hf_vp8_hdr_version, { "version", "vp8.hdr.version", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(vp8_hdr_version_vals), BIT_567_MASK, NULL, HFILL } }, { &hf_vp8_hdr_show_bit, { "Show bit", "vp8.hdr.show", FT_BOOLEAN, 8, NULL, BIT_4_MASK, "Set when current frame is for display", HFILL } }, { &hf_vp8_hdr_first_partition_size, { "First partition size", "vp8.hdr.partition_size", FT_UINT24, BASE_DEC, NULL, BIT_PARTITION_SIZE_MASK, NULL, HFILL } }, { &hf_vp8_keyframe_start_code, { "VP8 Start code", "vp8.keyframe.start_code", FT_UINT24, BASE_HEX, NULL, BIT_3BYTE_NO_MASK, NULL, HFILL } }, { &hf_vp8_keyframe_width, { "Width", "vp8.keyframe.width", FT_UINT16, BASE_DEC, NULL, BIT_2BYTE_NO_MASK, NULL, HFILL } }, { &hf_vp8_keyframe_height, { "Height", "vp8.keyframe.height", FT_UINT16, BASE_DEC, NULL, BIT_2BYTE_NO_MASK, NULL, HFILL } }, { &hf_vp8_keyframe_horizontal_scale, { "Horizontal Scale", "vp8.keyframe.horizontal_scale", FT_UINT8, BASE_DEC, NULL, BIT_12_MASK, NULL, HFILL } }, { &hf_vp8_keyframe_vertical_scale, { "Vertical Scale", "vp8.keyframe.vertical_scale", FT_UINT8, BASE_DEC, NULL, BIT_12_MASK, NULL, HFILL } } }; static ei_register_info ei[] = { { &ei_vp8_startcode, { "vp8.keyframe.startcode", PI_PROTOCOL, PI_ERROR, "Startcode is incorrect", EXPFILL }}, { &ei_vp8_undecoded, { "vp8.undecoded", PI_UNDECODED, PI_NOTE, "Payload not fully decoded", EXPFILL }}, { &ei_vp8_continuation, { "vp8.continuation", PI_REASSEMBLE, PI_CHAT, "Continuation of partition fragment", EXPFILL }}, { &ei_vp8_first_partition_split, { "vp8.first_partition_split", PI_REASSEMBLE, PI_CHAT, "First partition is split", EXPFILL }}, { &ei_vp8_first_partition_plus, { "vp8.first_partition_plus", PI_REASSEMBLE, PI_CHAT, "This frame contains all of first partition and also bytes from other partitions", EXPFILL }}, }; proto_vp8 = proto_register_protocol ( "VP8", /* name */ "VP8", /* short name */ "vp8" /* abbrev */ ); proto_register_field_array(proto_vp8, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vp8_module = prefs_register_protocol(proto_vp8, NULL); expert_vp8 = expert_register_protocol(proto_vp8); expert_register_field_array(expert_vp8, ei, array_length(ei)); prefs_register_obsolete_preference(vp8_module, "dynamic.payload.type"); vp8_handle = register_dissector("vp8", dissect_vp8, proto_vp8); } void proto_reg_handoff_vp8(void) { dissector_add_string("rtp_dyn_payload_type" , "VP8", vp8_handle); dissector_add_uint_range_with_preference("rtp.pt", "", vp8_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vp9.c
/* packet-vp9.c * Routines for VP9 dissection * Copyright 2023, Noan Perrot <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * vp9-bitstream-specification-v0.6-20160331-draft - VP9 Bitstream & Decoding Process Specification * draft-ietf-payload-vp9-16 - RTP Payload Format for VP9 Video */ #include "config.h" /* Define the name for the logging domain (try to avoid collisions with existing domains) */ #define WS_LOG_DOMAIN "vp9" /* Global header providing a minimum base set of required macros and APIs */ #include <wireshark.h> #include <epan/packet.h> /* Required dissection API header */ #include <epan/expert.h> /* Include only as needed */ #include <epan/prefs.h> /* Include only as needed */ #define STRING_SIZE 50 #define VP9_1_BIT_MASK 0x80 #define VP9_2_BIT_MASK 0x40 #define VP9_3_BIT_MASK 0x20 #define VP9_4_BIT_MASK 0x10 #define VP9_5_BIT_MASK 0x08 #define VP9_6_BIT_MASK 0x04 #define VP9_7_BIT_MASK 0x02 #define VP9_8_BIT_MASK 0x01 #define VP9_2_BITS_MASK 0xC0 #define VP9_3_BITS_MASK 0xE0 #define VP9_7_BITS_MASK 0xFE #define VP9_8_BITS_MASK 0xFF #define VP9_16_BITS_MASK 0xFFFF #define VP9_EXTENDED_PID 0x7FFF static int proto_vp9 = -1; static int hf_vp9_pld_i_bit = -1; static int hf_vp9_pld_p_bit = -1; static int hf_vp9_pld_l_bit = -1; static int hf_vp9_pld_f_bit = -1; static int hf_vp9_pld_b_bit = -1; static int hf_vp9_pld_e_bit = -1; static int hf_vp9_pld_v_bit = -1; static int hf_vp9_pld_z_bit = -1; static int hf_vp9_pld_u_bit = -1; static int hf_vp9_pld_m_bit = -1; static int hf_vp9_pld_d_bit = -1; static int hf_vp9_pld_n_bit = -1; static int hf_vp9_pld_y_bit = -1; static int hf_vp9_pld_g_bit = -1; static int hf_vp9_pld_pg_bits = -1; static int hf_vp9_pld_n_s_bits = -1; static int hf_vp9_pld_n_g_bits = -1; static int hf_vp9_pld_sid_bits = -1; static int hf_vp9_pld_pid_bits = -1; static int hf_vp9_pld_tid_bits = -1; static int hf_vp9_pld_width_bits = -1; static int hf_vp9_pld_height_bits = -1; static int hf_vp9_pld_p_diff_bits = -1; static int hf_vp9_pld_tl0picidx_bits = -1; static int hf_vp9_pld_pg_extended_bits = -1; static int hf_vp9_pld_pid_extended_bits = -1; static int ett_vp9 = -1; static int ett_vp9_descriptor = -1; static int *ett[] = { &ett_vp9, &ett_vp9_descriptor }; static int dissect_vp9(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "VP9"); proto_item *vp9_item = proto_tree_add_item(tree, proto_vp9, tvb, 0, -1, ENC_NA); proto_tree *vp9_tree = proto_item_add_subtree(vp9_item, ett_vp9); proto_item *vp9_descriptor_item; proto_tree *vp9_descriptor_tree = proto_tree_add_subtree(vp9_tree, tvb, 0, 1, ett_vp9_descriptor, &vp9_descriptor_item, "Payload Descriptor"); int offset = 0; /* 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |I|P|L|F|B|E|V|Z| (REQUIRED) +-+-+-+-+-+-+-+-+ */ guint8 i = tvb_get_guint8(tvb, offset) & VP9_1_BIT_MASK; guint8 p = tvb_get_guint8(tvb, offset) & VP9_2_BIT_MASK; guint8 l = tvb_get_guint8(tvb, offset) & VP9_3_BIT_MASK; guint8 f = tvb_get_guint8(tvb, offset) & VP9_4_BIT_MASK; guint8 v = tvb_get_guint8(tvb, offset) & VP9_7_BIT_MASK; proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_i_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_p_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_l_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_f_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_b_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_e_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_v_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_z_bit, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* +-+-+-+-+-+-+-+-+ I: |M| PICTURE ID | (REQUIRED) +-+-+-+-+-+-+-+-+ M: | EXTENDED PID | (RECOMMENDED) +-+-+-+-+-+-+-+-+ */ guint8 m = tvb_get_guint8(tvb, offset) & VP9_1_BIT_MASK; proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_m_bit, tvb, offset, 1, ENC_BIG_ENDIAN); if (f) { // Flexible mode if (m == i) { if (m) { // Extended PID proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_pid_extended_bits, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else { // PID proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_pid_bits, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } } else { // Malformated packet } } else { // Non-flexible mode if (m == i) { if (m) { // Extended PID proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_pg_extended_bits, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } else { // PID proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_pg_bits, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; } } else { // Malformated packet } } /* +-+-+-+-+-+-+-+-+ L: | TID |U| SID |D| (Conditionally RECOMMENDED) +-+-+-+-+-+-+-+-+ */ if (l) { // Layer indices present proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_tid_bits, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_u_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_sid_bits, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_d_bit, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (f) { // 1 octet is present for the layer indices proto_item_set_len(vp9_descriptor_item, 4); } else { // 2 octets are present for the layer indices proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_tl0picidx_bits, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_len(vp9_descriptor_item, 5); offset++; } } /* +-+-+-+-+-+-+-+-+ -\ P,F: | P_DIFF |N| (Conditionally REQUIRED) - up to 3 times +-+-+-+-+-+-+-+-+ -/ */ if (p && f) { guint8 n = tvb_get_guint8(tvb, offset) & (VP9_1_BIT_MASK >> 7); int idx = 0; int max_p_diff = 3; while (n && idx < max_p_diff) { proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_p_diff_bits, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_n_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_len(vp9_descriptor_item, 6); offset++; n = tvb_get_guint8(tvb, offset) & (VP9_1_BIT_MASK >> 7); idx++; if (n && idx == max_p_diff) { // Malformated packet } } } /* +-+-+-+-+-+-+-+-+ V: | SS | | .. | +-+-+-+-+-+-+-+-+ */ if (v) { /* +-+-+-+-+-+-+-+-+ V: | N_S |Y|G|-|-|-| +-+-+-+-+-+-+-+-+ */ guint8 n_s = tvb_get_guint8(tvb, offset) & (VP9_3_BITS_MASK); guint8 y = tvb_get_guint8(tvb, offset) & (VP9_1_BIT_MASK >> 3); guint8 g = tvb_get_guint8(tvb, offset) & (VP9_1_BIT_MASK >> 4); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_n_s_bits, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_y_bit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_g_bit, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* +-+-+-+-+-+-+-+-+ -\ Y: | WIDTH | (OPTIONAL) . + + . | | (OPTIONAL) . +-+-+-+-+-+-+-+-+ . - N_S + 1 times | HEIGHT | (OPTIONAL) . + + . | | (OPTIONAL) . +-+-+-+-+-+-+-+-+ -/ */ guint8 spatial_layer = 0; while (spatial_layer < (n_s + 1)) { if (y) { // TODO: Add subtree for spatial layers proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_width_bits, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_height_bits, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } spatial_layer++; } /* +-+-+-+-+-+-+-+-+ G: | N_G | (OPTIONAL) +-+-+-+-+-+-+-+-+ */ if (g) { /* +-+-+-+-+-+-+-+-+ -\ N_G: | TID |U| R |-|-| (OPTIONAL) . +-+-+-+-+-+-+-+-+ -\ . - N_G times | P_DIFF | (OPTIONAL) . - R times . +-+-+-+-+-+-+-+-+ -/ -/ */ proto_tree_add_item(vp9_descriptor_tree, hf_vp9_pld_n_g_bits, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; // TODO: handle N_G } } return tvb_captured_length(tvb); } void proto_register_vp9(void) { static hf_register_info hf[] = { {&hf_vp9_pld_i_bit, {"Picture ID present", "vp9.pld.i", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_p_bit, {"Inter-picture predicted frame", "vp9.pld.p", FT_BOOLEAN, 8, NULL, VP9_2_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_l_bit, {"Layer indices present", "vp9.pld.l", FT_BOOLEAN, 8, NULL, VP9_3_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_f_bit, {"Flexible mode", "vp9.pld.f", FT_BOOLEAN, 8, NULL, VP9_4_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_b_bit, {"Start of a frame", "vp9.pld.b", FT_BOOLEAN, 8, NULL, VP9_5_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_e_bit, {"End of a frame", "vp9.pld.e", FT_BOOLEAN, 8, NULL, VP9_6_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_v_bit, {"Scalability structure (SS) data present", "vp9.pld.v", FT_BOOLEAN, 8, NULL, VP9_7_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_z_bit, {"Not a reference frame for upper spatial layers", "vp9.pld.z", FT_BOOLEAN, 8, NULL, VP9_8_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_m_bit, {"Extension flag", "vp9.pld.m", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK, NULL, HFILL}}, {&hf_vp9_pld_pid_bits, {"Picture ID (PID)", "vp9.pld.pid", FT_UINT8, BASE_DEC, NULL, VP9_7_BITS_MASK >> 1, NULL, HFILL}}, {&hf_vp9_pld_pid_extended_bits, {"Picture ID (PID) Extended", "vp9.pld.pid_ext", FT_UINT16, BASE_DEC, NULL, VP9_EXTENDED_PID, NULL, HFILL}}, {&hf_vp9_pld_pg_bits, {"Picture Group Index (PG)", "vp9.pld.pg", FT_UINT8, BASE_DEC, NULL, VP9_7_BITS_MASK >> 1, NULL, HFILL}}, {&hf_vp9_pld_pg_extended_bits, {"Picture Group Index (PG) Extended", "vp9.pld.pg_ext", FT_UINT16, BASE_DEC, NULL, VP9_EXTENDED_PID, NULL, HFILL}}, {&hf_vp9_pld_tid_bits, {"Temporal layer ID", "vp9.pld.tid", FT_UINT8, BASE_DEC, NULL, VP9_3_BITS_MASK, NULL, HFILL}}, {&hf_vp9_pld_u_bit, {"Switching up point", "vp9.pld.u", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK >> 3, NULL, HFILL}}, {&hf_vp9_pld_sid_bits, {"Spatial Layer ID", "vp9.pld.sid", FT_UINT8, BASE_DEC, NULL, VP9_3_BITS_MASK >> 4, NULL, HFILL}}, {&hf_vp9_pld_d_bit, {"Inter-layer dependency used", "vp9.pld.d", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK >> 7, NULL, HFILL}}, {&hf_vp9_pld_tl0picidx_bits, {"Temporal layer zero index", "vp9.pld.tl0picidx", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_vp9_pld_p_diff_bits, {"Reference index", "vp9.pld.p_diff", FT_UINT8, BASE_DEC, NULL, VP9_7_BITS_MASK, NULL, HFILL}}, {&hf_vp9_pld_n_bit, {"Additional reference index", "vp9.pld.n", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK >> 7, NULL, HFILL}}, {&hf_vp9_pld_n_s_bits, {"Number of spatial layers", "vp9.pld.n_s", FT_UINT8, BASE_DEC, NULL, VP9_3_BITS_MASK, NULL, HFILL}}, {&hf_vp9_pld_y_bit, {"Spatial layer's frame resolution present", "vp9.pld.y", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK >> 3, NULL, HFILL}}, {&hf_vp9_pld_g_bit, {"PG description flag", "vp9.pld.g", FT_BOOLEAN, 8, NULL, VP9_1_BIT_MASK >> 4, NULL, HFILL}}, {&hf_vp9_pld_height_bits, {"Height", "vp9.pld.height", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_vp9_pld_width_bits, {"Width", "vp9.pld.width", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}}, {&hf_vp9_pld_n_g_bits, {"Number of pictures", "vp9.pld.n_g", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}}}; proto_vp9 = proto_register_protocol( "VP9", "VP9", "vp9"); proto_register_field_array(proto_vp9, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_vp9(void) { static dissector_handle_t vp9_handle; vp9_handle = register_dissector("vp9", dissect_vp9, proto_vp9); dissector_add_string("rtp_dyn_payload_type", "vp9", vp9_handle); dissector_add_uint_range_with_preference("rtp.pt", "", vp9_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vpp.c
/* packet-vpp.c * * Routines for the disassembly of fd.io vpp project * dispatch captures * * Copyright 2019, Dave Barach <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/to_str.h> #include <epan/nlpid.h> #include <epan/etypes.h> #include <epan/ws_printf.h> #include <wiretap/wtap.h> void proto_register_vpp(void); void proto_reg_handoff_vpp(void); static int proto_vpp = -1; static int proto_vpp_metadata = -1; static int proto_vpp_opaque = -1; static int proto_vpp_opaque2 = -1; static int proto_vpp_trace = -1; static int hf_vpp_nodename = -1; static int hf_vpp_metadata = -1; static int hf_vpp_buffer_index = -1; static int hf_vpp_buffer_opaque = -1; static int hf_vpp_buffer_opaque2 = -1; static int hf_vpp_buffer_trace = -1; static int hf_vpp_major_version = -1; static int hf_vpp_minor_version = -1; static int hf_vpp_protocol_hint = -1; static expert_module_t* expert_vpp; static expert_field ei_vpp_major_version_error = EI_INIT; static expert_field ei_vpp_minor_version_error = EI_INIT; static expert_field ei_vpp_protocol_hint_error = EI_INIT; static gint ett_vpp = -1; static gint ett_vpp_opaque = -1; static gint ett_vpp_opaque2 = -1; static gint ett_vpp_metadata = -1; static gint ett_vpp_trace = -1; static dissector_handle_t vpp_dissector_handle; static dissector_handle_t vpp_opaque_dissector_handle; static dissector_handle_t vpp_opaque2_dissector_handle; static dissector_handle_t vpp_metadata_dissector_handle; static dissector_handle_t vpp_trace_dissector_handle; #define VPP_MAJOR_VERSION 1 #define VPP_MINOR_VERSION 0 #define IP4_TYPICAL_VERSION_LENGTH 0x45 #define IP6_TYPICAL_VERSION_AND_TRAFFIC_CLASS 0x60 typedef enum { VLIB_NODE_PROTO_HINT_NONE = 0, VLIB_NODE_PROTO_HINT_ETHERNET, VLIB_NODE_PROTO_HINT_IP4, VLIB_NODE_PROTO_HINT_IP6, VLIB_NODE_PROTO_HINT_TCP, VLIB_NODE_PROTO_HINT_UDP, VLIB_NODE_N_PROTO_HINTS, } vlib_node_proto_hint_t; static dissector_handle_t next_dissectors[VLIB_NODE_N_PROTO_HINTS]; /* List of next dissectors hints that we know about */ #define foreach_next_dissector \ _(VLIB_NODE_PROTO_HINT_ETHERNET, eth_withoutfcs) \ _(VLIB_NODE_PROTO_HINT_IP4, ip) \ _(VLIB_NODE_PROTO_HINT_IP6, ipv6) \ _(VLIB_NODE_PROTO_HINT_TCP, tcp) \ _(VLIB_NODE_PROTO_HINT_UDP, udp) static void add_multi_line_string_to_tree(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint start, gint len, int hf) { gint next; int line_len; int data_len; while(len > 0) { line_len = tvb_find_line_end(tvb, start, len, &next, FALSE); data_len = next - start; proto_tree_add_string(tree, hf, tvb, start, data_len, tvb_format_stringzpad(pinfo->pool, tvb, start, line_len)); start += data_len; len -= data_len; } } static int dissect_vpp_metadata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *ti; proto_tree *metadata_tree; gint metadata_string_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VPP-Metadata"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vpp_metadata, tvb, offset, -1, ENC_NA); metadata_tree = proto_item_add_subtree(ti, ett_vpp_metadata); /* How long is the metadata string? */ metadata_string_length = tvb_strsize(tvb, offset); add_multi_line_string_to_tree(metadata_tree, tvb, pinfo, 0, metadata_string_length, hf_vpp_metadata); return tvb_captured_length(tvb); } static int dissect_vpp_trace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *ti; proto_tree *trace_tree; gint trace_string_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VPP-Trace"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vpp_trace, tvb, offset, -1, ENC_NA); trace_tree = proto_item_add_subtree(ti, ett_vpp_trace); /* How long is the trace string? */ trace_string_length = tvb_strsize(tvb, offset); add_multi_line_string_to_tree(trace_tree, tvb, pinfo, 0, trace_string_length, hf_vpp_buffer_trace); return tvb_captured_length(tvb); } static int dissect_vpp_opaque(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *ti; proto_tree *opaque_tree; gint opaque_string_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VPP-Opaque"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vpp_opaque, tvb, offset, -1, ENC_NA); opaque_tree = proto_item_add_subtree(ti, ett_vpp_opaque); opaque_string_length = tvb_strsize(tvb, offset); add_multi_line_string_to_tree(opaque_tree, tvb, pinfo, 0, opaque_string_length, hf_vpp_buffer_opaque); return tvb_captured_length(tvb); } static int dissect_vpp_opaque2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_item *ti; proto_tree *opaque2_tree; gint opaque2_string_length; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VPP-Opaque2"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vpp_opaque2, tvb, offset, -1, ENC_NA); opaque2_tree = proto_item_add_subtree(ti, ett_vpp_opaque2); opaque2_string_length = tvb_strsize(tvb, offset); add_multi_line_string_to_tree(opaque2_tree, tvb, pinfo, 0, opaque2_string_length, hf_vpp_buffer_opaque2); return tvb_captured_length(tvb); } static int dissect_vpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *vpp_tree; tvbuff_t *metadata_tvb, *opaque_tvb, *opaque2_tvb, *eth_tvb, *trace_tvb; int offset = 0; guint8 major_version, minor_version, string_count, protocol_hint; guint8 *name; guint len; guint8 maybe_protocol_id; dissector_handle_t use_this_dissector; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VPP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vpp, tvb, offset, -1, ENC_NA); vpp_tree = proto_item_add_subtree(ti, ett_vpp); major_version = tvb_get_guint8(tvb, offset); /* If the major version doesn't match, quit on the spot */ if(major_version != VPP_MAJOR_VERSION) { proto_item *major_version_item; major_version_item = proto_tree_add_item(tree, hf_vpp_major_version, tvb, offset, 1, ENC_NA); expert_add_info_format(pinfo, major_version_item, &ei_vpp_major_version_error, "Major Version Mismatch read %d not %d", (int)major_version, VPP_MAJOR_VERSION); return tvb_captured_length(tvb); } offset++; minor_version = tvb_get_guint8(tvb, offset); /* If the minor version doesn't match, make a note and try to continue */ if(minor_version != VPP_MINOR_VERSION) { proto_item *minor_version_item; minor_version_item = proto_tree_add_item(tree, hf_vpp_minor_version, tvb, offset, 1, ENC_NA); expert_add_info_format(pinfo, minor_version_item, &ei_vpp_minor_version_error, "Minor Version Mismatch read %d not %d", (int)minor_version, VPP_MINOR_VERSION); } offset++; /* Number of counted strings in this trace record */ string_count = tvb_get_guint8(tvb, offset); offset++; /* * Hint: protocol which should be at b->data[b->current_data] * It will be a while before vpp sends useful hints for every * possible node, see heuristic below. */ protocol_hint = tvb_get_guint8(tvb, offset); if(protocol_hint >= array_length(next_dissectors)) { proto_item *protocol_hint_item; protocol_hint_item = proto_tree_add_item(tree, hf_vpp_protocol_hint, tvb, offset, 1, ENC_NA); expert_add_info_format(pinfo, protocol_hint_item, &ei_vpp_protocol_hint_error, "Protocol hint %d out of range, max %d", (int)protocol_hint, (int)array_length(next_dissectors)); protocol_hint = 0; } offset++; /* Buffer Index */ proto_tree_add_item(vpp_tree, hf_vpp_buffer_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* Nodename */ len = tvb_strsize(tvb, offset); name = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); proto_tree_add_string(tree, hf_vpp_nodename, tvb, offset, len, name); offset += len; /* Metadata */ len = tvb_strsize(tvb, offset); metadata_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(vpp_metadata_dissector_handle, metadata_tvb, pinfo, tree); offset += len; /* Opaque */ len = tvb_strsize(tvb, offset); opaque_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(vpp_opaque_dissector_handle, opaque_tvb, pinfo, tree); offset += len; /* Opaque2 */ len = tvb_strsize(tvb, offset); opaque2_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(vpp_opaque2_dissector_handle, opaque2_tvb, pinfo, tree); offset += len; /* Trace, if present */ if(string_count > 4) { len = tvb_strsize(tvb, offset); trace_tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(vpp_trace_dissector_handle, trace_tvb, pinfo, tree); offset += len; } eth_tvb = tvb_new_subset_remaining(tvb, offset); /* * Delegate the rest of the packet dissection to the per-node * next dissector in the foreach_node_to_dissector_pair list * * Failing that, pretend its an ethernet packet */ /* See setup for hint == 0 below */ use_this_dissector = next_dissectors [protocol_hint]; if(protocol_hint == 0) { maybe_protocol_id = tvb_get_guint8(tvb, offset); switch(maybe_protocol_id) { case IP4_TYPICAL_VERSION_LENGTH: use_this_dissector = next_dissectors[VLIB_NODE_PROTO_HINT_IP4]; break; case IP6_TYPICAL_VERSION_AND_TRAFFIC_CLASS: use_this_dissector = next_dissectors[VLIB_NODE_PROTO_HINT_IP6]; break; default: break; } } call_dissector(use_this_dissector, eth_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_vpp(void) { static hf_register_info vpp_hf[] = { { &hf_vpp_buffer_index, { "BufferIndex", "vpp.BufferIndex", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, { &hf_vpp_nodename, { "NodeName", "vpp.NodeName", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, { &hf_vpp_major_version, { "MajorVersion", "vpp.MajorVersion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vpp_minor_version, { "MinorVersion", "vpp.MinorVersion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vpp_protocol_hint, { "ProtocolHint", "vpp.ProtocolHint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, }; static ei_register_info vpp_ei[] = { { &ei_vpp_major_version_error, { "vpp.bad_major_version", PI_MALFORMED, PI_ERROR, "Bad Major Version", EXPFILL }}, { &ei_vpp_minor_version_error, { "vpp.bad_minor_version", PI_UNDECODED, PI_WARN, "Bad Minor Version", EXPFILL }}, { &ei_vpp_protocol_hint_error, { "vpp.bad_protocol_hint", PI_PROTOCOL, PI_WARN, "Bad Protocol Hint", EXPFILL }}, }; static hf_register_info metadata_hf[] = { { &hf_vpp_metadata, { "Metadata", "vpp.metadata", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, }; static hf_register_info opaque_hf[] = { { &hf_vpp_buffer_opaque, { "Opaque", "vpp.opaque", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, }; static hf_register_info opaque2_hf[] = { { &hf_vpp_buffer_opaque2, { "Opaque2", "vpp.opaque2", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, }; static hf_register_info trace_hf[] = { { &hf_vpp_buffer_trace, { "Trace", "vpp.trace", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }, }, }; static gint *vpp_ett[] = { &ett_vpp, }; static gint *ett_metadata[] = { &ett_vpp_metadata, }; static gint *ett_opaque[] = { &ett_vpp_opaque, }; static gint *ett_opaque2[] = { &ett_vpp_opaque2, }; static gint *ett_trace[] = { &ett_vpp_trace, }; proto_vpp = proto_register_protocol("VPP Dispatch Trace", "VPP", "vpp"); proto_register_field_array(proto_vpp, vpp_hf, array_length(vpp_hf)); proto_register_subtree_array(vpp_ett, array_length(vpp_ett)); register_dissector("vpp", dissect_vpp, proto_vpp); expert_vpp = expert_register_protocol(proto_vpp); expert_register_field_array(expert_vpp, vpp_ei, array_length(vpp_ei)); proto_vpp_metadata = proto_register_protocol("VPP Buffer Metadata", "VPP-Metadata", "vpp-metadata"); proto_register_field_array(proto_vpp_metadata, metadata_hf, array_length(metadata_hf)); proto_register_subtree_array(ett_metadata, array_length(ett_metadata)); register_dissector("vppMetadata", dissect_vpp_metadata, proto_vpp_metadata); proto_vpp_opaque = proto_register_protocol("VPP Buffer Opaque", "VPP-Opaque", "vpp-opaque"); proto_register_field_array(proto_vpp_opaque, opaque_hf, array_length(opaque_hf)); proto_register_subtree_array(ett_opaque, array_length(ett_opaque)); register_dissector("vppOpaque", dissect_vpp_opaque, proto_vpp_opaque); proto_vpp_opaque2 = proto_register_protocol("VPP Buffer Opaque2", "VPP-Opaque2", "vpp-opaque2"); proto_register_field_array(proto_vpp_opaque2, opaque2_hf, array_length(opaque2_hf)); proto_register_subtree_array(ett_opaque2, array_length(ett_opaque2)); register_dissector("vppOpaque2", dissect_vpp_opaque2, proto_vpp_opaque2); proto_vpp_trace = proto_register_protocol("VPP Buffer Trace", "VPP-Trace", "vpp-trace"); proto_register_field_array(proto_vpp_trace, trace_hf, array_length(trace_hf)); proto_register_subtree_array(ett_trace, array_length(ett_trace)); register_dissector("vppTrace", dissect_vpp_trace, proto_vpp_trace); #define _(idx,dname) next_dissectors[idx] = find_dissector(#dname); foreach_next_dissector; #undef _ /* if all else fails, dissect data as if ethernet MAC */ next_dissectors[VLIB_NODE_PROTO_HINT_NONE] = next_dissectors [VLIB_NODE_PROTO_HINT_ETHERNET]; } void proto_reg_handoff_vpp(void) { vpp_dissector_handle = find_dissector("vpp"); vpp_metadata_dissector_handle = find_dissector("vppMetadata"); vpp_opaque_dissector_handle = find_dissector("vppOpaque"); vpp_opaque2_dissector_handle = find_dissector("vppOpaque2"); vpp_trace_dissector_handle = find_dissector("vppTrace"); dissector_add_uint("wtap_encap", WTAP_ENCAP_VPP, vpp_dissector_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vrrp.c
/* packet-vrrp.c * Routines for the Virtual Router Redundancy Protocol (VRRP) * * VRRPv2: RFC3768 (superseeding RFC2338) * VRRPv3: RFC5798 * * Heikki Vatiainen <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/ipproto.h> #include <epan/in_cksum.h> #include <epan/expert.h> #include <epan/prefs.h> void proto_register_vrrp(void); void proto_reg_handoff_vrrp(void); static gint proto_vrrp = -1; static gint ett_vrrp = -1; static gint ett_vrrp_ver_type = -1; static gint hf_vrrp_ver_type = -1; static gint hf_vrrp_version = -1; static gint hf_vrrp_type = -1; static gint hf_vrrp_virt_rtr_id = -1; static gint hf_vrrp_prio = -1; static gint hf_vrrp_addr_count = -1; static gint hf_vrrp_checksum = -1; static gint hf_vrrp_checksum_status = -1; static gint hf_vrrp_auth_type = -1; static gint hf_vrrp_adver_int = -1; static gint hf_vrrp_reserved_mbz = -1; static gint hf_vrrp_short_adver_int = -1; static gint hf_vrrp_ip = -1; static gint hf_vrrp_ip6 = -1; static gint hf_vrrp_auth_string = -1; static gint hf_vrrp_md5_auth_data = -1; static gboolean g_vrrp_v3_checksum_as_in_v2 = FALSE; static expert_field ei_vrrp_checksum = EI_INIT; #define VRRP_VERSION_MASK 0xf0 #define VRRP_TYPE_MASK 0x0f #define VRRP_AUTH_DATA_LEN 8 #define VRRP_TYPE_ADVERTISEMENT 1 static const value_string vrrp_type_vals[] = { {VRRP_TYPE_ADVERTISEMENT, "Advertisement"}, {0, NULL} }; #define VRRP_AUTH_TYPE_NONE 0 #define VRRP_AUTH_TYPE_SIMPLE_TEXT 1 #define VRRP_AUTH_TYPE_IP_AUTH_HDR 2 #define VRRP_AUTH_TYPE_IP_MD5 254 static const value_string vrrp_auth_vals[] = { {VRRP_AUTH_TYPE_NONE, "No Authentication"}, {VRRP_AUTH_TYPE_SIMPLE_TEXT, "Simple Text Authentication [RFC 2338] / Reserved [RFC 3768]"}, {VRRP_AUTH_TYPE_IP_AUTH_HDR, "IP Authentication Header [RFC 2338] / Reserved [RFC 3768]"}, {VRRP_AUTH_TYPE_IP_MD5, "Cisco VRRP MD5 authentication"}, {0, NULL} }; #define VRRP_PRIORITY_MASTER_STOPPING 0 /* Values between 1 and 254 inclusive are for backup VRRP routers */ #define VRRP_PRIORITY_DEFAULT 100 #define VRRP_PRIORITY_OWNER 255 static const value_string vrrp_prio_vals[] = { {VRRP_PRIORITY_MASTER_STOPPING, "Current Master has stopped participating in VRRP"}, {VRRP_PRIORITY_DEFAULT, "Default priority for a backup VRRP router"}, {VRRP_PRIORITY_OWNER, "This VRRP router owns the virtual router's IP address(es)"}, {0, NULL } }; static int dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { int offset = 0; gint vrrp_len; guint8 ver_type; vec_t cksum_vec[4]; guint32 phdr[2]; gboolean is_ipv6; proto_item *ti, *tv; proto_tree *vrrp_tree, *ver_type_tree; guint8 priority, addr_count = 0, auth_type = VRRP_AUTH_TYPE_NONE; guint16 computed_cksum = 0; is_ipv6 = (pinfo->src.type == AT_IPv6); col_set_str(pinfo->cinfo, COL_PROTOCOL, "VRRP"); col_clear(pinfo->cinfo, COL_INFO); ver_type = tvb_get_guint8(tvb, 0); col_add_fstr(pinfo->cinfo, COL_INFO, "Announcement (v%u)", hi_nibble(ver_type)); ti = proto_tree_add_item(tree, proto_vrrp, tvb, 0, -1, ENC_NA); vrrp_tree = proto_item_add_subtree(ti, ett_vrrp); priority = tvb_get_guint8(tvb, 2); addr_count = tvb_get_guint8(tvb, 3); tv = proto_tree_add_uint_format(vrrp_tree, hf_vrrp_ver_type, tvb, offset, 1, ver_type, "Version %u, Packet type %u (%s)", hi_nibble(ver_type), lo_nibble(ver_type), val_to_str_const(lo_nibble(ver_type), vrrp_type_vals, "Unknown")); ver_type_tree = proto_item_add_subtree(tv, ett_vrrp_ver_type); if(ver_type_tree){ proto_tree_add_uint(ver_type_tree, hf_vrrp_version, tvb, offset, 1, ver_type); proto_tree_add_uint(ver_type_tree, hf_vrrp_type, tvb, offset, 1, ver_type); offset += 1; proto_tree_add_item(vrrp_tree, hf_vrrp_virt_rtr_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_uint_format(vrrp_tree, hf_vrrp_prio, tvb, offset, 1, priority, "Priority: %u (%s)", priority, val_to_str_const(priority, vrrp_prio_vals, "Non-default backup priority")); offset += 1; proto_tree_add_uint(vrrp_tree, hf_vrrp_addr_count, tvb, offset, 1, addr_count); offset += 1; switch(hi_nibble(ver_type)) { case 3: /* 4 bits reserved (mbz) + 12 bits interval */ proto_tree_add_item(vrrp_tree, hf_vrrp_reserved_mbz, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(vrrp_tree, hf_vrrp_short_adver_int, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 2: default: /* 1 byte auth type + 1 byte interval */ auth_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(vrrp_tree, hf_vrrp_auth_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vrrp_tree, hf_vrrp_adver_int, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; break; } }else{ offset += 6; } vrrp_len = (gint)tvb_reported_length(tvb); if (!pinfo->fragmented && (gint)tvb_captured_length(tvb) >= vrrp_len) { /* The packet isn't part of a fragmented datagram and isn't truncated, so we can checksum it. */ switch(hi_nibble(ver_type)) { case 3: if((g_vrrp_v3_checksum_as_in_v2 == FALSE)||(pinfo->src.type == AT_IPv6)){ /* Set up the fields of the pseudo-header. */ SET_CKSUM_VEC_PTR(cksum_vec[0], (const guint8 *)pinfo->src.data, pinfo->src.len); SET_CKSUM_VEC_PTR(cksum_vec[1], (const guint8 *)pinfo->dst.data, pinfo->dst.len); phdr[0] = g_htonl(vrrp_len); phdr[1] = g_htonl(IP_PROTO_VRRP); SET_CKSUM_VEC_PTR(cksum_vec[2], (const guint8 *)&phdr, 8); SET_CKSUM_VEC_TVB(cksum_vec[3], tvb, 0, vrrp_len); computed_cksum = in_cksum(cksum_vec, 4); break; } /* FALL THROUGH */ case 2: default: SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, vrrp_len); computed_cksum = in_cksum(&cksum_vec[0], 1); break; } proto_tree_add_checksum(vrrp_tree, tvb, offset, hf_vrrp_checksum, hf_vrrp_checksum_status, &ei_vrrp_checksum, pinfo, computed_cksum, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY|PROTO_CHECKSUM_IN_CKSUM); } else { proto_tree_add_checksum(vrrp_tree, tvb, offset, hf_vrrp_checksum, hf_vrrp_checksum_status, &ei_vrrp_checksum, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); } offset += 2; while (addr_count > 0) { if (is_ipv6) { proto_tree_add_item(vrrp_tree, hf_vrrp_ip6, tvb, offset, 16, ENC_NA); offset += 16; } else { proto_tree_add_item(vrrp_tree, hf_vrrp_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } addr_count--; } if (auth_type == VRRP_AUTH_TYPE_SIMPLE_TEXT) { proto_tree_add_item(vrrp_tree, hf_vrrp_auth_string, tvb, offset, VRRP_AUTH_DATA_LEN, ENC_ASCII); offset += VRRP_AUTH_DATA_LEN; } else if (auth_type == VRRP_AUTH_TYPE_IP_MD5) { if (vrrp_len - offset >= 16) { proto_tree_add_item(vrrp_tree, hf_vrrp_md5_auth_data, tvb, vrrp_len - 16, 16, ENC_NA); } } return offset; } void proto_register_vrrp(void) { static hf_register_info hf[] = { { &hf_vrrp_ver_type, {"VRRP message version and type", "vrrp.typever", FT_UINT8, BASE_DEC, NULL, 0x0, "VRRP version and type", HFILL }}, { &hf_vrrp_version, {"VRRP protocol version", "vrrp.version", FT_UINT8, BASE_DEC, NULL, VRRP_VERSION_MASK, "VRRP version", HFILL }}, { &hf_vrrp_type, {"VRRP packet type", "vrrp.type", FT_UINT8, BASE_DEC, VALS(vrrp_type_vals), VRRP_TYPE_MASK, "VRRP type", HFILL }}, { &hf_vrrp_virt_rtr_id, {"Virtual Rtr ID", "vrrp.virt_rtr_id", FT_UINT8, BASE_DEC, NULL, 0x0, "Virtual router this packet is reporting status for", HFILL }}, { &hf_vrrp_prio, {"Priority", "vrrp.prio", FT_UINT8, BASE_DEC, NULL, 0x0, "Sending VRRP router's priority for the virtual router", HFILL }}, { &hf_vrrp_addr_count, {"Addr Count", "vrrp.addr_count", FT_UINT8, BASE_DEC, NULL, 0x0, "The number of addresses contained in this VRRP advertisement", HFILL }}, { &hf_vrrp_checksum, { "Checksum", "vrrp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "Used to detect data corruption in the VRRP message", HFILL }}, { &hf_vrrp_checksum_status, { "Checksum Status", "vrrp.checksum.status", FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0, NULL, HFILL }}, { &hf_vrrp_auth_type, {"Auth Type", "vrrp.auth_type", FT_UINT8, BASE_DEC, VALS(vrrp_auth_vals), 0x0, "The authentication method being utilized", HFILL }}, { &hf_vrrp_adver_int, {"Adver Int", "vrrp.adver_int", FT_UINT8, BASE_DEC, NULL, 0x0, "Time interval (in seconds) between ADVERTISEMENTS", HFILL }}, { &hf_vrrp_reserved_mbz, {"Reserved", "vrrp.reserved_mbz", FT_UINT8, BASE_DEC, NULL, 0xF0, "Must be zero", HFILL }}, { &hf_vrrp_short_adver_int, {"Adver Int", "vrrp.short_adver_int", FT_UINT16, BASE_DEC, NULL, 0x0FFF, "Time interval (in centiseconds) between ADVERTISEMENTS", HFILL }}, { &hf_vrrp_ip, {"IP Address", "vrrp.ip_addr", FT_IPv4, BASE_NONE, NULL, 0x0, "IP address associated with the virtual router", HFILL }}, { &hf_vrrp_ip6, {"IPv6 Address", "vrrp.ipv6_addr", FT_IPv6, BASE_NONE, NULL, 0x0, "IPv6 address associated with the virtual router", HFILL }}, { &hf_vrrp_auth_string, {"Authentication String", "vrrp.auth_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vrrp_md5_auth_data, {"MD5 Authentication Data", "vrrp.md5_auth_data", FT_BYTES, BASE_NONE, NULL, 0x0, "MD5 digest string is contained.", HFILL }}, }; static gint *ett[] = { &ett_vrrp, &ett_vrrp_ver_type }; static ei_register_info ei[] = { { &ei_vrrp_checksum, { "vrrp.checksum_bad.expert", PI_CHECKSUM, PI_WARN, "Bad checksum", EXPFILL }}, }; expert_module_t* expert_vrrp; module_t *vrrp_module; proto_vrrp = proto_register_protocol("Virtual Router Redundancy Protocol", "VRRP", "vrrp"); proto_register_field_array(proto_vrrp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vrrp = expert_register_protocol(proto_vrrp); expert_register_field_array(expert_vrrp, ei, array_length(ei)); vrrp_module = prefs_register_protocol(proto_vrrp, NULL); prefs_register_bool_preference(vrrp_module, "v3_checksum_as_in_v2", "Calculate V3 checksum as in V2 for IPv4 packets", "There is some ambiguity on how to calculate V3 checksums" "As in V3 will use a pseudo header(which may only be implemented for IPv6 by some manufacturers)", &g_vrrp_v3_checksum_as_in_v2); } void proto_reg_handoff_vrrp(void) { dissector_handle_t vrrp_handle; vrrp_handle = create_dissector_handle(dissect_vrrp, proto_vrrp); dissector_add_uint("ip.proto", IP_PROTO_VRRP, vrrp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vrt.c
/* packet-vrt.c * Routines for VRT (VITA 49) packet disassembly * Copyright 2012 Ettus Research LLC - Nick Foster <[email protected]>: original dissector * Copyright 2013 Alexander Chemeris <[email protected]>: dissector improvement * Copyright 2013 Dario Lombardo ([email protected]): Official Wireshark port * Copyright 2022 Amazon.com, Inc. or its affiliates - Cody Planteen <[email protected]>: context packet decoding * * Original dissector repository: https://github.com/bistromath/vrt-dissector * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <math.h> void proto_register_vrt(void); void proto_reg_handoff_vrt(void); #define VITA_49_PORT 4991 #define DEFAULT_EPHEMERIS_FIELDS { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } #define DEFAULT_FORMATTED_GPS_INS_FIELDS { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } typedef int (*complex_dissector_t)(proto_tree *tree, tvbuff_t *tvb, int offset); typedef struct { int tsi; /* 2-bit timestamp type */ int tsf; /* 2-bit fractional timestamp type */ int oui; /* 24-bit GPS/INS manufacturer OUI */ int ts_int; /* 32-bit integer timestamp (opt.) */ int ts_picosecond; /* 64-bit fractional timestamp (mutually exclusive with below) */ int ts_frac_sample; /* 64-bit fractional timestamp (mutually exclusive with above) */ int pos_x; /* 32-bit position X */ int pos_y; /* 32-bit position Y */ int pos_z; /* 32-bit position Z */ int att_alpha; /* 32-bit attitude alpha */ int att_beta; /* 32-bit attitude beta */ int att_phi; /* 32-bit attitude phi */ int vel_dx; /* 32-bit velocity dX */ int vel_dy; /* 32-bit velocity dY */ int vel_dz; /* 32-bit velocity dZ */ } ephemeris_fields; typedef struct { int tsi; /* 2-bit timestamp type */ int tsf; /* 2-bit fractional timestamp type */ int oui; /* 24-bit GPS/INS manufacturer OUI */ int ts_int; /* 32-bit integer timestamp (opt.) */ int ts_picosecond; /* 64-bit fractional timestamp (mutually exclusive with below) */ int ts_frac_sample; /* 64-bit fractional timestamp (mutually exclusive with above) */ int lat; /* 32-bit latitude */ int lon; /* 32-bit longitude */ int alt; /* 32-bit altitude */ int speed; /* 32-bit speed over ground */ int heading; /* 32-bit heading angle */ int track; /* 32-bit track angle */ int mag_var; /* 32-bit magnetic variation */ } formatted_gps_ins_fields; typedef int (*complex_dissector_t)(proto_tree *tree, tvbuff_t *tvb, int offset); static gboolean vrt_use_ettus_uhd_header_format = FALSE; static int proto_vrt = -1; /* fields */ static int hf_vrt_header = -1; /* 32-bit header */ static int hf_vrt_type = -1; /* 4-bit pkt type */ static int hf_vrt_cidflag = -1; /* 1-bit class ID flag */ static int hf_vrt_tflag = -1; /* 1-bit trailer flag */ static int hf_vrt_tsmflag = -1; /* 1-bit timestamp mode */ static int hf_vrt_tsi = -1; /* 2-bit timestamp type */ static int hf_vrt_tsf = -1; /* 2-bit fractional timestamp type */ static int hf_vrt_seq = -1; /* 4-bit sequence number */ static int hf_vrt_len = -1; /* 16-bit length */ static int hf_vrt_sid = -1; /* 32-bit stream ID (opt.) */ static int hf_vrt_cid = -1; /* 64-bit class ID (opt.) */ static int hf_vrt_cid_oui = -1; /* 24-bit class ID OUI */ static int hf_vrt_cid_icc = -1; /* 16-bit class ID ICC */ static int hf_vrt_cid_pcc = -1; /* 16-bit class ID PCC */ static int hf_vrt_cif[8] = { -1, -1, -1, -1, -1, -1, -1, -1}; /* 32-bit CIF0-CIF7 (opt.) */ static int hf_vrt_cif0_change_flag = -1; /* 1-bit context field change indicator */ static int hf_vrt_cif0_ref_pt_id = -1; /* 1-bit reference point identifier */ static int hf_vrt_cif0_bandwidth = -1; /* 1-bit bandwidth */ static int hf_vrt_cif0_if_freq = -1; /* 1-bit IF reference frequency */ static int hf_vrt_cif0_rf_freq = -1; /* 1-bit RF reference frequency */ static int hf_vrt_cif0_rf_freq_offset = -1; /* 1-bit RF reference frequency offset */ static int hf_vrt_cif0_if_band_offset = -1; /* 1-bit IF band offset */ static int hf_vrt_cif0_ref_level = -1; /* 1-bit reference level */ static int hf_vrt_cif0_gain = -1; /* 1-bit gain */ static int hf_vrt_cif0_over_range_count = -1; /* 1-bit over-range count */ static int hf_vrt_cif0_sample_rate = -1; /* 1-bit sample rate */ static int hf_vrt_cif0_timestamp_adjust = -1; /* 1-bit timestamp adjustment */ static int hf_vrt_cif0_timestamp_cal = -1; /* 1-bit timestamp calibration time */ static int hf_vrt_cif0_temperature = -1; /* 1-bit temperature */ static int hf_vrt_cif0_device_id = -1; /* 1-bit device identifier */ static int hf_vrt_cif0_state_event = -1; /* 1-bit state/event indicators */ static int hf_vrt_cif0_signal_data_format = -1; /* 1-bit signal data packet payload format */ static int hf_vrt_cif0_gps = -1; /* 1-bit formatted GPS */ static int hf_vrt_cif0_ins = -1; /* 1-bit formatted INS */ static int hf_vrt_cif0_ecef_ephemeris = -1; /* 1-bit ECEF ephemeris */ static int hf_vrt_cif0_rel_ephemeris = -1; /* 1-bit relative ephemeris */ static int hf_vrt_cif0_ephemeris_ref_id = -1; /* 1-bit ephemeris ref ID */ static int hf_vrt_cif0_gps_ascii = -1; /* 1-bit GPS ASCII */ static int hf_vrt_cif0_context_assoc_lists = -1; /* 1-bit context association lists */ static int hf_vrt_cif0_cif7 = -1; /* 1-bit CIF7 */ static int hf_vrt_cif0_cif6 = -1; /* 1-bit CIF6 */ static int hf_vrt_cif0_cif5 = -1; /* 1-bit CIF5 */ static int hf_vrt_cif0_cif4 = -1; /* 1-bit CIF4 */ static int hf_vrt_cif0_cif3 = -1; /* 1-bit CIF3 */ static int hf_vrt_cif0_cif2 = -1; /* 1-bit CIF2 */ static int hf_vrt_cif0_cif1 = -1; /* 1-bit CIF1 */ /* TODO: complete CIF1 support (have partial CIF1 support) */ static int hf_vrt_cif1_phase_offset = -1; /* 1-bit phase offset */ static int hf_vrt_cif1_polarization = -1; /* 1-bit polarization */ static int hf_vrt_cif1_range = -1; /* 1-bit range (distance) */ static int hf_vrt_cif1_aux_freq = -1; /* 1-bit aux frequency */ static int hf_vrt_cif1_aux_bandwidth = -1; /* 1-bit aux bandwidth */ static int hf_vrt_cif1_io32 = -1; /* 1-bit discrete I/O (32-bit) */ static int hf_vrt_cif1_io64 = -1; /* 1-bit discrete I/O (64-bit) */ static int hf_vrt_cif1_v49_spec = -1; /* 1-bit V49 spec compliance */ static int hf_vrt_cif1_ver = -1; /* 1-bit version and build code */ static int hf_vrt_context_ref_pt_id = -1; /* 32-bit reference point identifier */ static int hf_vrt_context_bandwidth = -1; /* 64-bit bandwidth */ static int hf_vrt_context_if_freq = -1; /* 64-bit IF reference frequency */ static int hf_vrt_context_rf_freq = -1; /* 64-bit RF reference frequency */ static int hf_vrt_context_rf_freq_offset = -1; /* 64-bit RF frequency offset */ static int hf_vrt_context_if_band_offset = -1; /* 64-bit IF band offset */ static int hf_vrt_context_ref_level = -1; /* 16-bit reference level */ static int hf_vrt_context_gain_stage2 = -1; /* 16-bit gain stage 2 */ static int hf_vrt_context_gain_stage1 = -1; /* 16-bit gain stage 1 */ static int hf_vrt_context_over_range_count = -1; /* 32-bit over-range count */ static int hf_vrt_context_sample_rate = -1; /* 64-bit sample rate */ static int hf_vrt_context_timestamp_adjust = -1; /* 64-bit timestamp adjustment */ static int hf_vrt_context_timestamp_cal = -1; /* 32-bit timestamp calibration */ static int hf_vrt_context_temperature = -1; /* 16-bit device temperature */ static int hf_vrt_context_device_id_oui = -1; /* 24-bit device ID OUI */ static int hf_vrt_context_device_id_code = -1; /* 16-bit device ID code */ static int hf_vrt_context_state_event_en_cal_time = -1; /* 1-bit enable calibrated time */ static int hf_vrt_context_state_event_en_valid_data = -1; /* 1-bit enable valid data */ static int hf_vrt_context_state_event_en_ref_lock = -1; /* 1-bit enable reference lock */ static int hf_vrt_context_state_event_en_agc = -1; /* 1-bit enable AGC/MGC */ static int hf_vrt_context_state_event_en_detected_sig = -1; /* 1-bit enable detected signal */ static int hf_vrt_context_state_event_en_spectral_inv = -1; /* 1-bit enable spectral inversion */ static int hf_vrt_context_state_event_en_over_range = -1; /* 1-bit enable over-range */ static int hf_vrt_context_state_event_en_sample_loss = -1; /* 1-bit enable sample loss */ static int hf_vrt_context_state_event_cal_time = -1; /* 1-bit enable calibrated time */ static int hf_vrt_context_state_event_valid_data = -1; /* 1-bit enable valid data */ static int hf_vrt_context_state_event_ref_lock = -1; /* 1-bit enable reference lock */ static int hf_vrt_context_state_event_agc = -1; /* 1-bit enable AGC/MGC */ static int hf_vrt_context_state_event_detected_sig = -1; /* 1-bit enable detected signal */ static int hf_vrt_context_state_event_spectral_inv = -1; /* 1-bit enable spectral inversion */ static int hf_vrt_context_state_event_over_range = -1; /* 1-bit enable over-range */ static int hf_vrt_context_state_event_sample_loss = -1; /* 1-bit enable sample loss */ static int hf_vrt_context_state_event_user = -1; /* 8-bit user-defined */ static int hf_vrt_context_signal_data_format_packing = -1; /* 1-bit signal data format packing */ static int hf_vrt_context_signal_data_format_type = -1; /* 2-bit real/complex type */ static int hf_vrt_context_signal_data_format_item = -1; /* 5-bit data item format */ static int hf_vrt_context_signal_data_format_repeat = -1; /* 1-bit sample-component repeat indicator */ static int hf_vrt_context_signal_data_format_event_size = -1; /* 3-bit event-tag size */ static int hf_vrt_context_signal_data_format_channel_size = -1; /* 4-bit channel-tag size */ static int hf_vrt_context_signal_data_format_fraction_size = -1; /* 4-bit data item fraction size */ static int hf_vrt_context_signal_data_format_packing_size = -1; /* 6-bit item packing field size */ static int hf_vrt_context_signal_data_format_item_size = -1; /* 6-bit data item size */ static int hf_vrt_context_signal_data_format_repeat_count = -1; /* 16-bit repeat count */ static int hf_vrt_context_signal_data_format_vector_size = -1; /* 16-bit vector size */ static formatted_gps_ins_fields hf_vrt_context_gps = DEFAULT_FORMATTED_GPS_INS_FIELDS; /* struct for formatted GPS */ static formatted_gps_ins_fields hf_vrt_context_ins = DEFAULT_FORMATTED_GPS_INS_FIELDS; /* struct for formatted INS */ static ephemeris_fields hf_vrt_context_ecef_ephemeris = DEFAULT_EPHEMERIS_FIELDS; /* struct for ECEF ephemeris */ static ephemeris_fields hf_vrt_context_rel_ephemeris = DEFAULT_EPHEMERIS_FIELDS; /* struct for relative ephemeris */ static int hf_vrt_context_ephemeris_ref_id = -1; /* 32-bit ephemeris reference identifier */ static int hf_vrt_context_gps_ascii_oui; /* 24-bit GPS/INS manufacturer OUI */ static int hf_vrt_context_gps_ascii_size; /* 32-bit number of words */ static int hf_vrt_context_gps_ascii_data = -1; /* Variable GPS ASCII data */ static int hf_vrt_context_assoc_lists_src_size; /* 32-bit source list size */ static int hf_vrt_context_assoc_lists_sys_size; /* 32-bit system list size */ static int hf_vrt_context_assoc_lists_vec_size; /* 32-bit vector-component list size */ static int hf_vrt_context_assoc_lists_a; /* 1-bit "A" bit (asynchronous-channel tag list present) */ static int hf_vrt_context_assoc_lists_asy_size; /* 32-bit asynchronous-channel list size */ static int hf_vrt_context_assoc_lists_src_data; /* Variable source context association list */ static int hf_vrt_context_assoc_lists_sys_data; /* Variable system context association list */ static int hf_vrt_context_assoc_lists_vec_data; /* Variable vector-component context association list */ static int hf_vrt_context_assoc_lists_asy_data; /* Variable asynchronous-channel context association list */ static int hf_vrt_context_assoc_lists_asy_tag_data; /* Variable asynchronous-channel tag list */ static int hf_vrt_context_phase_offset = -1; /* 16-bit phase offset */ static int hf_vrt_context_pol_tilt = -1; /* 16-bit polarization tilt angle */ static int hf_vrt_context_pol_ellipticity = -1; /* 16-bit polarization ellipticity angle */ static int hf_vrt_context_range = -1; /* 32-bit range (distance) */ static int hf_vrt_context_aux_freq = -1; /* 64-bit aux frequency */ static int hf_vrt_context_aux_bandwidth = -1; /* 64-bit aux bandwidth */ static int hf_vrt_context_io32 = -1; /* 32-bit discrete I/O */ static int hf_vrt_context_io64 = -1; /* 64-bit discrete I/O */ static int hf_vrt_context_v49_spec = -1; /* 32-bit V49 spec compliance */ static int hf_vrt_context_ver_year = -1; /* 7-bit year */ static int hf_vrt_context_ver_day = -1; /* 9-bit day */ static int hf_vrt_context_ver_rev = -1; /* 6-bit revision */ static int hf_vrt_context_ver_user = -1; /* 10-bit user defined */ static int hf_vrt_ts_int = -1; /* 32-bit integer timestamp (opt.) */ static int hf_vrt_ts_frac_picosecond = -1; /* 64-bit fractional timestamp (opt.) */ static int hf_vrt_ts_frac_sample = -1; /* 64-bit fractional timestamp (opt.) */ static int hf_vrt_data = -1; /* data */ static int hf_vrt_trailer = -1; /* 32-bit trailer (opt.) */ static int hf_vrt_trailer_enables = -1; /* trailer indicator enables */ static int hf_vrt_trailer_ind = -1; /* trailer indicators */ static int hf_vrt_trailer_e = -1; /* ass con pac cnt enable */ static int hf_vrt_trailer_acpc = -1; /* associated context packet count */ static int hf_vrt_trailer_en_caltime = -1; /* calibrated time indicator */ static int hf_vrt_trailer_en_valid = -1; /* valid data ind */ static int hf_vrt_trailer_en_reflock = -1; /* reference locked ind */ static int hf_vrt_trailer_en_agc = -1; /* AGC/MGC enabled ind */ static int hf_vrt_trailer_en_sig = -1; /* signal detected ind */ static int hf_vrt_trailer_en_inv = -1; /* spectral inversion ind */ static int hf_vrt_trailer_en_overrng = -1; /* overrange indicator */ static int hf_vrt_trailer_en_sampleloss = -1; /* sample loss indicator */ static int hf_vrt_trailer_en_user0 = -1; /* User indicator 0 */ static int hf_vrt_trailer_en_user1 = -1; /* User indicator 1 */ static int hf_vrt_trailer_en_user2 = -1; /* User indicator 2 */ static int hf_vrt_trailer_en_user3 = -1; /* User indicator 3 */ static int hf_vrt_trailer_ind_caltime = -1; /* calibrated time indicator */ static int hf_vrt_trailer_ind_valid = -1; /* valid data ind */ static int hf_vrt_trailer_ind_reflock = -1; /* reference locked ind */ static int hf_vrt_trailer_ind_agc = -1; /* AGC/MGC enabled ind */ static int hf_vrt_trailer_ind_sig = -1; /* signal detected ind */ static int hf_vrt_trailer_ind_inv = -1; /* spectral inversion ind */ static int hf_vrt_trailer_ind_overrng = -1; /* overrange indicator */ static int hf_vrt_trailer_ind_sampleloss = -1; /* sample loss indicator */ static int hf_vrt_trailer_ind_user0 = -1; /* User indicator 0 */ static int hf_vrt_trailer_ind_user1 = -1; /* User indicator 1 */ static int hf_vrt_trailer_ind_user2 = -1; /* User indicator 2 */ static int hf_vrt_trailer_ind_user3 = -1; /* User indicator 3 */ /* fixed sizes (in bytes) of context packet CIF field bits */ static int context_size_cif0[32] = { 0, 4, 4, 4, 4, 4, 4, 4, 8, 8, 4, 52, 52, 44, 44, 8, 4, 8, 4, 4, 8, 8, 4, 4, 4, 8, 8, 8, 8, 8, 4, 0 }; static int context_size_cif1[32] = { 0, 8, 4, 4, 4, 8, 4, 0, 0, 0, 52, 0, 0, 8, 4, 8, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 0, 4, 4, 4 }; /* subtree state variables */ static gint ett_vrt = -1; static gint ett_header = -1; static gint ett_trailer = -1; static gint ett_indicators = -1; static gint ett_ind_enables = -1; static gint ett_cid = -1; static gint ett_cif0 = -1; static gint ett_cif1 = -1; static gint ett_gain = -1; static gint ett_device_id = -1; static gint ett_state_event = -1; static gint ett_signal_data_format = -1; static gint ett_gps = -1; static gint ett_ins = -1; static gint ett_ecef_ephem = -1; static gint ett_rel_ephem = -1; static gint ett_gps_ascii = -1; static gint ett_assoc_lists = -1; static gint ett_pol = -1; static gint ett_ver = -1; /* constants (unit conversion) */ static const double FEMTOSEC_PER_SEC = 1e-15; static const double RADIX_CELSIUS = 1.0/64.0; static const double RADIX_DECIBEL = 1.0/128.0; static const double RADIX_DECIBEL_MILLIWATT = 1.0/128.0; static const double RADIX_DEGREES = 1.0/4194304.0; static const double RADIX_HERTZ = 1.0/1048576.0; static const double RADIX_METER = 1.0/32.0; static const double RADIX_METER_UNSIGNED = 1.0/64.0; static const double RADIX_METERS_PER_SECOND = 1.0/65536.0; static const double RADIX_RADIAN_PHASE = 1.0/128.0; static const double RADIX_RADIAN_POL = 1.0/8192.0; /* constants (tree index) */ static const int ETT_IDX_GAIN = 8; static const int ETT_IDX_DEVICE_ID = 9; static const int ETT_IDX_STATE_EVENT = 10; static const int ETT_IDX_SIGNAL_DATA_FORMAT = 11; static const int ETT_IDX_GPS = 12; static const int ETT_IDX_INS = 13; static const int ETT_IDX_ECEF_EPHEM = 14; static const int ETT_IDX_REL_EPHEM = 15; static const int ETT_IDX_GPS_ASCII = 16; static const int ETT_IDX_ASSOC_LISTS = 17; static const int ETT_IDX_POL = 18; static const int ETT_IDX_VER = 19; static const value_string packet_types[] = { {0x00, "IF data packet without stream ID"}, {0x01, "IF data packet with stream ID"}, {0x02, "Extension data packet without stream ID"}, {0x03, "Extension data packet with stream ID"}, {0x04, "IF context packet"}, {0x05, "Extension context packet"}, {0, NULL} }; static const value_string tsi_types[] = { {0x00, "No integer-seconds timestamp field included"}, {0x01, "Coordinated Universal Time (UTC)"}, {0x02, "GPS time"}, {0x03, "Other"}, {0, NULL} }; static const value_string tsf_types[] = { {0x00, "No fractional-seconds timestamp field included"}, {0x01, "Sample count timestamp"}, {0x02, "Real time (picoseconds) timestamp"}, {0x03, "Free running count timestamp"}, {0, NULL} }; static const value_string tsm_types[] = { {0x00, "Precise timestamp resolution"}, {0x01, "General timestamp resolution"}, {0, NULL} }; static const value_string packing_method[] = { {0x00, "Processing efficient"}, {0x01, "Link efficient"}, {0, NULL} }; static const value_string data_sample_type[] = { {0x00, "Real"}, {0x01, "Complex, Cartesian"}, {0x02, "Complex, polar"}, {0, NULL} }; static const value_string data_item_format[] = { {0x00, "Signed fixed-point"}, {0x01, "Signed VRT, 1-bit exponent"}, {0x02, "Signed VRT, 2-bit exponent"}, {0x03, "Signed VRT, 3-bit exponent"}, {0x04, "Signed VRT, 4-bit exponent"}, {0x05, "Signed VRT, 5-bit exponent"}, {0x06, "Signed VRT, 6-bit exponent"}, {0x07, "Signed fixed-point non-normalized"}, {0x0D, "IEEE-754 half-precision floating-point"}, {0x0E, "IEEE-754 single-precision floating-point"}, {0x0F, "IEEE-754 double-precision floating-point"}, {0x10, "Unsigned fixed-point"}, {0x11, "Unsigned VRT, 1-bit exponent"}, {0x12, "Unsigned VRT, 2-bit exponent"}, {0x13, "Unsigned VRT, 3-bit exponent"}, {0x14, "Unsigned VRT, 4-bit exponent"}, {0x15, "Unsigned VRT, 5-bit exponent"}, {0x16, "Unsigned VRT, 6-bit exponent"}, {0x17, "Unsigned fixed-point non-normalized"}, {0, NULL} }; static const value_string standard_version_codes[] = { {0x01, "Implements V49.0"}, {0x02, "Implements V49.1"}, {0x03, "Implements V49A"}, {0x04, "Implements V49.2"}, {0, NULL} }; static int * const enable_hfs[] = { &hf_vrt_trailer_en_user3, &hf_vrt_trailer_en_user2, &hf_vrt_trailer_en_user1, &hf_vrt_trailer_en_user0, &hf_vrt_trailer_en_sampleloss, &hf_vrt_trailer_en_overrng, &hf_vrt_trailer_en_inv, &hf_vrt_trailer_en_sig, &hf_vrt_trailer_en_agc, &hf_vrt_trailer_en_reflock, &hf_vrt_trailer_en_valid, &hf_vrt_trailer_en_caltime }; static int * const ind_hfs[] = { &hf_vrt_trailer_ind_user3, &hf_vrt_trailer_ind_user2, &hf_vrt_trailer_ind_user1, &hf_vrt_trailer_ind_user0, &hf_vrt_trailer_ind_sampleloss, &hf_vrt_trailer_ind_overrng, &hf_vrt_trailer_ind_inv, &hf_vrt_trailer_ind_sig, &hf_vrt_trailer_ind_agc, &hf_vrt_trailer_ind_reflock, &hf_vrt_trailer_ind_valid, &hf_vrt_trailer_ind_caltime }; static void dissect_header(tvbuff_t *tvb, proto_tree *tree, int type, int offset); static void dissect_trailer(tvbuff_t *tvb, proto_tree *tree, int offset); static void dissect_cid(tvbuff_t *tvb, proto_tree *tree, int offset); static int dissect_context(tvbuff_t *tvb, proto_tree *tree, int offset); static int dissect_context_as_cif(tvbuff_t *tvb, proto_tree *tree, int offset, uint32_t cif, complex_dissector_t *complex_fptr, int **item_ptr, const int *size_ptr, int stop); static int dissect_context_array_of_records(proto_tree *tree _U_, tvbuff_t *tvb, int offset); static int dissect_context_assoc_lists(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_cif0(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_cif1(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_device_id(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_ecef_ephemeris(proto_tree *tree, tvbuff_t *tvb, int offset); static void dissect_context_ephemeris(const ephemeris_fields *s, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_gain(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_gps(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_gps_ascii(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_ins(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_phase_offset(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_polarization(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_ref_level(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_rel_ephemeris(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_signal_data_format(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_state_event(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_temperature(proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_context_ver(proto_tree *tree, tvbuff_t *tvb, int offset); static const char* get_engr_prefix(double *val); /* context simple field dissector function pointer array (mutually exclusive with complex below) */ static int* hf_vrt_context_cif0[32] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &hf_vrt_context_ephemeris_ref_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &hf_vrt_context_timestamp_cal, &hf_vrt_context_timestamp_adjust, &hf_vrt_context_sample_rate, &hf_vrt_context_over_range_count, NULL, NULL, &hf_vrt_context_if_band_offset, &hf_vrt_context_rf_freq_offset, &hf_vrt_context_rf_freq, &hf_vrt_context_if_freq, &hf_vrt_context_bandwidth, &hf_vrt_context_ref_pt_id, NULL }; static int* hf_vrt_context_cif1[32] = { NULL, NULL, NULL, &hf_vrt_context_v49_spec, NULL, &hf_vrt_context_io64, &hf_vrt_context_io32, NULL, NULL, NULL, NULL, NULL, NULL, &hf_vrt_context_aux_bandwidth, NULL, &hf_vrt_context_aux_freq, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &hf_vrt_context_range, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* context complex field dissector function pointer array */ static complex_dissector_t complex_dissector_cif0[32] = { NULL, dissect_context_cif1, NULL, NULL, NULL, NULL, NULL, NULL, dissect_context_assoc_lists, dissect_context_gps_ascii, NULL, dissect_context_rel_ephemeris, dissect_context_ecef_ephemeris, dissect_context_ins, dissect_context_gps, dissect_context_signal_data_format, dissect_context_state_event, dissect_context_device_id, dissect_context_temperature, NULL, NULL, NULL, NULL, dissect_context_gain, dissect_context_ref_level, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* partial CIF1 support */ static complex_dissector_t complex_dissector_cif1[32] = { NULL, NULL, dissect_context_ver, NULL, NULL, NULL, NULL, dissect_context_array_of_records, NULL, dissect_context_array_of_records, NULL, dissect_context_array_of_records, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, dissect_context_array_of_records, NULL, dissect_context_polarization, dissect_context_phase_offset }; static int dissect_vrt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint8 type; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VITA 49"); col_clear(pinfo->cinfo,COL_INFO); /* HACK to support UHD's weird header offset on data packets. */ if (vrt_use_ettus_uhd_header_format && tvb_get_guint8(tvb, 0) == 0) offset += 4; /* get packet type */ type = tvb_get_guint8(tvb, offset) >> 4; col_add_str(pinfo->cinfo, COL_INFO, val_to_str(type, packet_types, "Reserved packet type (0x%02x)")); if (tree) { /* we're being asked for details */ guint8 sidflag; guint8 cidflag; guint8 tflag; guint8 tsitype; guint8 tsftype; guint16 len; guint16 nsamps; proto_tree *vrt_tree; proto_item *ti; /* get SID, CID, T flags and TSI, TSF types */ sidflag = (((type & 0x01) != 0) || (type == 4)) ? 1 : 0; cidflag = (tvb_get_guint8(tvb, offset) >> 3) & 0x01; /* tflag is in data packets but not context packets */ tflag = (tvb_get_guint8(tvb, offset) >> 2) & 0x01; if (type == 4) tflag = 0; /* this should be unnecessary but we do it just in case */ /* tsmflag is in context packets but not data packets tsmflag = (tvb_get_guint8(tvb, offset) >> 0) & 0x01; */ tsitype = (tvb_get_guint8(tvb, offset+1) >> 6) & 0x03; tsftype = (tvb_get_guint8(tvb, offset+1) >> 4) & 0x03; len = tvb_get_ntohs(tvb, offset+2); nsamps = len - 1; /* (Before adjusting word count for optional fields) */ ti = proto_tree_add_item(tree, proto_vrt, tvb, offset, -1, ENC_NA); vrt_tree = proto_item_add_subtree(ti, ett_vrt); dissect_header(tvb, vrt_tree, type, offset); offset += 4; /* header's done! if SID (last bit of type), put the stream ID here */ if (sidflag) { proto_tree_add_item(vrt_tree, hf_vrt_sid, tvb, offset, 4, ENC_BIG_ENDIAN); nsamps -= 1; offset += 4; } /* if there's a class ID (cidflag), put the class ID here */ if (cidflag) { dissect_cid(tvb, vrt_tree, offset); nsamps -= 2; offset += 8; } /* if TSI and/or TSF, populate those here */ if (tsitype != 0) { proto_tree_add_item(vrt_tree, hf_vrt_ts_int, tvb, offset, 4, ENC_BIG_ENDIAN); nsamps -= 1; offset += 4; } if (tsftype != 0) { if (tsftype == 1 || tsftype == 3) { proto_tree_add_item(vrt_tree, hf_vrt_ts_frac_sample, tvb, offset, 8, ENC_BIG_ENDIAN); } else if (tsftype == 2) { proto_tree_add_item(vrt_tree, hf_vrt_ts_frac_picosecond, tvb, offset, 8, ENC_BIG_ENDIAN); } nsamps -= 2; offset += 8; } if (tflag) { nsamps -= 1; } /* now we've got either a context packet or a data packet */ if (type == 4) { /* parse context packet */ int num_v49_words = dissect_context(tvb, vrt_tree, offset); nsamps -= num_v49_words; offset += 4*num_v49_words; } /* we're into the data */ if (nsamps != 0) { proto_tree_add_item(vrt_tree, hf_vrt_data, tvb, offset, nsamps*4, ENC_NA); } offset += nsamps*4; if (tflag) { dissect_trailer(tvb, vrt_tree, offset); } } return tvb_captured_length(tvb); } static void dissect_header(tvbuff_t *tvb, proto_tree *tree, int type, int offset) { proto_item *hdr_item; proto_tree *hdr_tree; hdr_item = proto_tree_add_item(tree, hf_vrt_header, tvb, offset, 4, ENC_BIG_ENDIAN); hdr_tree = proto_item_add_subtree(hdr_item, ett_header); proto_tree_add_item(hdr_tree, hf_vrt_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(hdr_tree, hf_vrt_cidflag, tvb, offset, 1, ENC_BIG_ENDIAN); if (type == 4) { proto_tree_add_item(hdr_tree, hf_vrt_tsmflag, tvb, offset, 1, ENC_BIG_ENDIAN); } else { proto_tree_add_item(hdr_tree, hf_vrt_tflag, tvb, offset, 1, ENC_BIG_ENDIAN); } offset += 1; proto_tree_add_item(hdr_tree, hf_vrt_tsi, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(hdr_tree, hf_vrt_tsf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(hdr_tree, hf_vrt_seq, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(hdr_tree, hf_vrt_len, tvb, offset, 2, ENC_BIG_ENDIAN); } static void dissect_trailer(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_item *enable_item, *ind_item, *trailer_item; proto_tree *enable_tree; proto_tree *ind_tree; proto_tree *trailer_tree; guint16 en_bits; gint16 i; trailer_item = proto_tree_add_item(tree, hf_vrt_trailer, tvb, offset, 4, ENC_BIG_ENDIAN); trailer_tree = proto_item_add_subtree(trailer_item, ett_trailer); /* grab the indicator enables and the indicators; only display enables, indicators which are enabled */ enable_item = proto_tree_add_item(trailer_tree, hf_vrt_trailer_enables, tvb, offset, 2, ENC_BIG_ENDIAN); ind_item = proto_tree_add_item(trailer_tree, hf_vrt_trailer_ind, tvb, offset + 1, 2, ENC_BIG_ENDIAN); /* grab enable bits */ en_bits = (tvb_get_ntohs(tvb, offset) & 0xFFF0) >> 4; /* if there's any enables, start trees for enable bits and for indicators only enables and indicators which are enabled get printed. */ if (en_bits) { enable_tree = proto_item_add_subtree(enable_item, ett_ind_enables); ind_tree = proto_item_add_subtree(ind_item, ett_indicators); for (i = 11; i >= 0; i--) { if (en_bits & (1<<i)) { /* XXX: Display needs to be improved ... */ proto_tree_add_item(enable_tree, *enable_hfs[i], tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ind_tree, *ind_hfs[i], tvb, offset+1, 2, ENC_BIG_ENDIAN); } } } offset += 3; proto_tree_add_item(trailer_tree, hf_vrt_trailer_e, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(trailer_tree, hf_vrt_trailer_acpc, tvb, offset, 1, ENC_BIG_ENDIAN); } static void dissect_cid(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_item *cid_item; proto_tree *cid_tree; cid_item = proto_tree_add_item(tree, hf_vrt_cid, tvb, offset, 8, ENC_BIG_ENDIAN); cid_tree = proto_item_add_subtree(cid_item, ett_cid); offset += 1; proto_tree_add_item(cid_tree, hf_vrt_cid_oui, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(cid_tree, hf_vrt_cid_icc, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(cid_tree, hf_vrt_cid_pcc, tvb, offset, 2, ENC_BIG_ENDIAN); } static int dissect_context(tvbuff_t *tvb, proto_tree *tree, int offset) { uint32_t cif[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int offset_start = offset; cif[0] = tvb_get_ntohl(tvb, offset); dissect_context_cif0(tree, tvb, offset); offset += 4; // CIF1-CIF7 bit fields come next with CIF1 first for (int i = 1; i < 8; i++) { if (cif[0] & (1 << i)) { if (complex_dissector_cif0[i] != NULL) { (*complex_dissector_cif0[i])(tree, tvb, offset); } else { proto_tree_add_item(tree, hf_vrt_cif[i], tvb, offset, 4, ENC_BIG_ENDIAN); } cif[i] = tvb_get_ntohl(tvb, offset); offset += 4; } } // decode CIF0 fields offset = dissect_context_as_cif(tvb, tree, offset, cif[0], complex_dissector_cif0, hf_vrt_context_cif0, context_size_cif0, 7); // finally other CIFs (only CIF1 for now) if (cif[0] & (1 << 1)) { offset = dissect_context_as_cif(tvb, tree, offset, cif[1], complex_dissector_cif1, hf_vrt_context_cif1, context_size_cif1, 0); } // return how many VITA-49 words were processed return (offset - offset_start)/4; } static int dissect_context_as_cif(tvbuff_t *tvb, proto_tree *tree, int offset, uint32_t cif, complex_dissector_t *complex_fptr, int **item_ptr, const int *size_ptr, int stop) { for (int i = 31; i > stop; i--) { if (cif & (1u << i)) { if (complex_fptr[i] != NULL) { // a complex dissector returns the variable part of field length (in bytes) offset += (*complex_fptr[i])(tree, tvb, offset); } else if (item_ptr[i] != NULL) { proto_tree_add_item(tree, *item_ptr[i], tvb, offset, size_ptr[i], ENC_BIG_ENDIAN); } // add fixed part of field length (in bytes) offset += size_ptr[i]; } } return offset; } static int dissect_context_array_of_records(proto_tree *tree _U_, tvbuff_t *tvb, int offset) { // This is a placeholder that does not populate a proto tree, but computes & returns the // variable field length so subsequent field indexing is correct. return tvb_get_ntohl(tvb, offset)*4; } static int dissect_context_assoc_lists(proto_tree *tree, tvbuff_t *tvb, int offset) { // compute number of variable words in field guint32 word1 = tvb_get_ntohl(tvb, offset); guint32 src_size = (word1 >> 16) & 0x01FF; guint32 sys_size = word1 & 0x01FF; guint32 word2 = tvb_get_ntohl(tvb, offset + 4); guint32 vec_size = word2 >> 16; gboolean a_bit = (word2 & 0x8000) != 0; guint32 asy_size = word2 & 0x7FFF; guint32 num_words = src_size + sys_size + vec_size + asy_size + a_bit*asy_size; proto_tree *assoc_tree = proto_tree_add_subtree(tree, tvb, offset, 8 + num_words*4, ETT_IDX_ASSOC_LISTS, NULL, "Context association lists"); proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_src_size, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_sys_size, tvb, offset + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_vec_size, tvb, offset + 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_a, tvb, offset + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_asy_size, tvb, offset + 6, 2, ENC_BIG_ENDIAN); offset += 8; if (src_size > 0) { proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_src_data, tvb, offset, src_size*4, ENC_NA); offset += src_size*4; } if (sys_size > 0) { proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_sys_data, tvb, offset, sys_size*4, ENC_NA); offset += sys_size*4; } if (vec_size > 0) { proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_vec_data, tvb, offset, vec_size*4, ENC_NA); offset += vec_size*4; } if (asy_size > 0) { proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_asy_data, tvb, offset, asy_size*4, ENC_NA); offset += asy_size*4; if (a_bit) { proto_tree_add_item(assoc_tree, hf_vrt_context_assoc_lists_asy_tag_data, tvb, offset, asy_size*4, ENC_NA); } } return num_words*4; } static int dissect_context_cif0(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *cif0_item; proto_tree *cif0_tree; cif0_item = proto_tree_add_item(tree, hf_vrt_cif[0], tvb, offset, 4, ENC_BIG_ENDIAN); cif0_tree = proto_item_add_subtree(cif0_item, ett_cif0); proto_tree_add_item(cif0_tree, hf_vrt_cif0_change_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_ref_pt_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_bandwidth, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_if_freq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_rf_freq, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_rf_freq_offset, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_if_band_offset, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_ref_level, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(cif0_tree, hf_vrt_cif0_gain, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_over_range_count, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_sample_rate, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_timestamp_adjust, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_timestamp_cal, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_temperature, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_device_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_state_event, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(cif0_tree, hf_vrt_cif0_signal_data_format, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_gps, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_ins, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_ecef_ephemeris, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_rel_ephemeris, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_ephemeris_ref_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_gps_ascii, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_context_assoc_lists, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif7, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif6, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif5, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif4, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif0_tree, hf_vrt_cif0_cif1, tvb, offset, 1, ENC_BIG_ENDIAN); return 0; } static int dissect_context_cif1(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *cif1_item = proto_tree_add_item(tree, hf_vrt_cif[1], tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree *cif1_tree = proto_item_add_subtree(cif1_item, ett_cif1); proto_tree_add_item(cif1_tree, hf_vrt_cif1_phase_offset, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_polarization, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_range, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_aux_freq, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_aux_bandwidth, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_io32, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_io64, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_v49_spec, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(cif1_tree, hf_vrt_cif1_ver, tvb, offset + 3, 1, ENC_BIG_ENDIAN); return 0; } static int dissect_context_device_id(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *id_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ETT_IDX_DEVICE_ID, NULL, "Device identifier"); proto_tree_add_item(id_tree, hf_vrt_context_device_id_oui, tvb, offset + 1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(id_tree, hf_vrt_context_device_id_code, tvb, offset + 6, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_ecef_ephemeris(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *ecef_tree = proto_tree_add_subtree(tree, tvb, offset, 52, ETT_IDX_ECEF_EPHEM, NULL, "ECEF ephemeris"); dissect_context_ephemeris(&hf_vrt_context_ecef_ephemeris, ecef_tree, tvb, offset); return 0; } static void dissect_context_ephemeris(const ephemeris_fields *s, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, s->tsi, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->tsf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->oui, tvb, offset + 1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->ts_int, tvb, offset + 4, 4, ENC_BIG_ENDIAN); guint8 tsftype = tvb_get_guint8(tvb, offset) & 0x03; if (tsftype == 1 || tsftype == 3) { proto_tree_add_item(tree, s->ts_frac_sample, tvb, offset + 8, 8, ENC_BIG_ENDIAN); } else if (tsftype == 2) { proto_tree_add_item(tree, s->ts_picosecond, tvb, offset + 8, 8, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, s->pos_x, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->pos_y, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->pos_z, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->att_alpha, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->att_beta, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->att_phi, tvb, offset + 36, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->vel_dx, tvb, offset + 40, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->vel_dy, tvb, offset + 44, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->vel_dz, tvb, offset + 48, 4, ENC_BIG_ENDIAN); } static void dissect_context_formatted_gps_ins(const formatted_gps_ins_fields *s, proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, s->tsi, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->tsf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->oui, tvb, offset + 1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->ts_int, tvb, offset + 4, 4, ENC_BIG_ENDIAN); guint8 tsftype = tvb_get_guint8(tvb, offset) & 0x03; if (tsftype == 1 || tsftype == 3) { proto_tree_add_item(tree, s->ts_frac_sample, tvb, offset + 8, 8, ENC_BIG_ENDIAN); } else if (tsftype == 2) { proto_tree_add_item(tree, s->ts_picosecond, tvb, offset + 8, 8, ENC_BIG_ENDIAN); } proto_tree_add_item(tree, s->lat, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->lon, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->alt, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->speed, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->heading, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->track, tvb, offset + 36, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, s->mag_var, tvb, offset + 40, 4, ENC_BIG_ENDIAN); } static int dissect_context_gain(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *gain_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ETT_IDX_GAIN, NULL, "Gain"); proto_tree_add_item(gain_tree, hf_vrt_context_gain_stage2, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(gain_tree, hf_vrt_context_gain_stage1, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_gps(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *gps_tree = proto_tree_add_subtree(tree, tvb, offset, 44, ETT_IDX_GPS, NULL, "Formatted GPS"); dissect_context_formatted_gps_ins(&hf_vrt_context_gps, gps_tree, tvb, offset); return 0; } static int dissect_context_gps_ascii(proto_tree *tree, tvbuff_t *tvb, int offset) { guint32 nword = tvb_get_ntohl(tvb, offset + 4); proto_tree *gps_tree = proto_tree_add_subtree(tree, tvb, offset, 8 + nword*4, ETT_IDX_GPS_ASCII, NULL, "GPS ASCII"); proto_tree_add_item(gps_tree, hf_vrt_context_gps_ascii_oui, tvb, offset + 1, 3, ENC_BIG_ENDIAN); proto_tree_add_item(gps_tree, hf_vrt_context_gps_ascii_size, tvb, offset + 4, 4, ENC_BIG_ENDIAN); if (nword > 0) { proto_tree_add_item(gps_tree, hf_vrt_context_gps_ascii_data, tvb, offset + 8, nword*4, ENC_NA); } return nword*4; } static int dissect_context_ins(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *ins_tree = proto_tree_add_subtree(tree, tvb, offset, 44, ETT_IDX_INS, NULL, "Formatted INS"); dissect_context_formatted_gps_ins(&hf_vrt_context_ins, ins_tree, tvb, offset); return 0; } static int dissect_context_phase_offset(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, hf_vrt_context_phase_offset, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_polarization(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *pol_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ETT_IDX_POL, NULL, "Polarization"); proto_tree_add_item(pol_tree, hf_vrt_context_pol_tilt, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pol_tree, hf_vrt_context_pol_ellipticity, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_ref_level(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, hf_vrt_context_ref_level, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_rel_ephemeris(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *rel_tree = proto_tree_add_subtree(tree, tvb, offset, 52, ETT_IDX_REL_EPHEM, NULL, "Relative ephemeris"); dissect_context_ephemeris(&hf_vrt_context_rel_ephemeris, rel_tree, tvb, offset); return 0; } static int dissect_context_signal_data_format(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *format_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ETT_IDX_SIGNAL_DATA_FORMAT, NULL, "Signal data packet payload format"); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_packing, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_item, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_repeat, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_event_size, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_channel_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_fraction_size, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_packing_size, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_item_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_repeat_count, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(format_tree, hf_vrt_context_signal_data_format_vector_size, tvb, offset, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_state_event(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *state_event_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ETT_IDX_STATE_EVENT, NULL, "State and event indicators"); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_cal_time, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_valid_data, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_ref_lock, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_agc, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_detected_sig, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_spectral_inv, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_over_range, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_en_sample_loss, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_cal_time, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_valid_data, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_ref_lock, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_agc, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_detected_sig, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_spectral_inv, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_over_range, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_sample_loss, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(state_event_tree, hf_vrt_context_state_event_user, tvb, offset + 3, 1, ENC_BIG_ENDIAN); return 0; } static int dissect_context_temperature(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, hf_vrt_context_temperature, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static int dissect_context_ver(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree *ver_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ETT_IDX_VER, NULL, "Version and build code"); proto_tree_add_item(ver_tree, hf_vrt_context_ver_year, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ver_tree, hf_vrt_context_ver_day, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ver_tree, hf_vrt_context_ver_rev, tvb, offset + 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ver_tree, hf_vrt_context_ver_user, tvb, offset + 2, 2, ENC_BIG_ENDIAN); return 0; } static void format_celsius(char *str, int16_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f °C", (double)val*RADIX_CELSIUS); } static void format_decibel(char *str, int16_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f dB", (double)val*RADIX_DECIBEL); } static void format_decibel_milliwatt(char *str, int16_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f dBm", (double)val*RADIX_DECIBEL_MILLIWATT); } static void format_degrees(char *str, int32_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f degrees", (double)val*RADIX_DEGREES); } static void format_hertz(char *str, int64_t val) { double val_f64 = (double)val*RADIX_HERTZ; const char *prefix = get_engr_prefix(&val_f64); snprintf(str, ITEM_LABEL_LENGTH, "%f %sHz", val_f64, prefix); } static void format_meter(char *str, int32_t val) { double val_f64 = (double)val*RADIX_METER; const char *prefix = get_engr_prefix(&val_f64); snprintf(str, ITEM_LABEL_LENGTH, "%f %sm", val_f64, prefix); } static void format_meter_unsigned(char *str, uint32_t val) { double val_f64 = (double)val*RADIX_METER_UNSIGNED; const char *prefix = get_engr_prefix(&val_f64); snprintf(str, ITEM_LABEL_LENGTH, "%f %sm", val_f64, prefix); } static void format_meters_per_second(char *str, int32_t val) { double val_f64 = (double)val*RADIX_METERS_PER_SECOND; const char *prefix = get_engr_prefix(&val_f64); snprintf(str, ITEM_LABEL_LENGTH, "%f %sm/s", val_f64, prefix); } static void format_radian_phase(char *str, int16_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f rad", (double)val*RADIX_RADIAN_PHASE); } static void format_radian_pol(char *str, int16_t val) { snprintf(str, ITEM_LABEL_LENGTH, "%f rad", (double)val*RADIX_RADIAN_POL); } static void format_second(char *str, int64_t val) { double val_f64 = (double)val*FEMTOSEC_PER_SEC; const char *prefix = get_engr_prefix(&val_f64); snprintf(str, ITEM_LABEL_LENGTH, "%f %ss", val_f64, prefix); } static const char* get_engr_prefix(double *val) { const char* prefix_str = ""; int32_t exp = (int32_t)floor(log10(fabs(*val))/(double)3.0)*3; switch (exp) { case -15: prefix_str = "f"; *val *= 1e15; break; case -12: prefix_str = "p"; *val *= 1e12; break; case -9: prefix_str = "n"; *val *= 1e9; break; case -6: prefix_str = "µ"; *val *= 1e6; break; case -3: prefix_str = "m"; *val *= 1e3; break; case 3: prefix_str = "k"; *val *= 1e-3; break; case 6: prefix_str = "M"; *val *= 1e-6; break; case 9: prefix_str = "G"; *val *= 1e-9; break; case 12: prefix_str = "T"; *val *= 1e-12; break; } return prefix_str; } void proto_register_vrt(void) { module_t *vrt_module; static hf_register_info hf[] = { { &hf_vrt_header, { "VRT header", "vrt.hdr", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_type, { "Packet type", "vrt.type", FT_UINT8, BASE_DEC, VALS(packet_types), 0xF0, NULL, HFILL } }, { &hf_vrt_cidflag, { "Class ID included", "vrt.cidflag", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_tflag, { "Trailer included", "vrt.tflag", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_tsmflag, { "Timestamp mode", "vrt.tsmflag", FT_UINT8, BASE_DEC, VALS(tsm_types), 0x01, NULL, HFILL } }, { &hf_vrt_tsi, { "Integer timestamp type", "vrt.tsi", FT_UINT8, BASE_DEC, VALS(tsi_types), 0xC0, NULL, HFILL } }, { &hf_vrt_tsf, { "Fractional timestamp type", "vrt.tsf", FT_UINT8, BASE_DEC, VALS(tsf_types), 0x30, NULL, HFILL } }, { &hf_vrt_seq, { "Sequence number", "vrt.seq", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_vrt_len, { "Length", "vrt.len", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_ts_int, { "Integer timestamp", "vrt.ts_int", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_ts_frac_sample, { "Fractional timestamp (samples)", "vrt.ts_frac_sample", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_ts_frac_picosecond, { "Fractional timestamp (picoseconds)", "vrt.ts_frac_picosecond", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_sid, { "Stream ID", "vrt.sid", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cid, { "Class ID", "vrt.cid", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[0], { "CIF0", "vrt.cif0", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif0_change_flag, { "Context field change indicator", "vrt.cif0.change", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif0_ref_pt_id, { "Reference point identifier", "vrt.cif0.refptid", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif0_bandwidth, { "Bandwidth", "vrt.cif0.bw", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif0_if_freq, { "IF reference frequency", "vrt.cif0.iffreq", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_cif0_rf_freq, { "RF reference frequency", "vrt.cif0.rffreq", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_cif0_rf_freq_offset, { "RF reference frequency offset", "vrt.cif0.rffreqoffset", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_cif0_if_band_offset, { "IF band offset", "vrt.cif0.ifbandoffset", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_cif0_ref_level, { "Reference level", "vrt.cif0.reflevel", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_cif0_gain, { "Gain", "vrt.cif0.gain", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif0_over_range_count, { "Over-range count", "vrt.cif0.overrangecount", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif0_sample_rate, { "Sample rate", "vrt.cif0.samplerate", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif0_timestamp_adjust, { "Timestamp adjustment", "vrt.cif0.timestampadjust", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_cif0_timestamp_cal, { "Timestamp calibration time", "vrt.cif0.timestampcal", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_cif0_temperature, { "Temperature", "vrt.cif0.temperature", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_cif0_device_id, { "Device identifier", "vrt.cif0.deviceid", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_cif0_state_event, { "State/event indicators", "vrt.cif0.stateevent", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_cif0_signal_data_format, { "Signal data format", "vrt.cif0.signaldataformat", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif0_gps, { "Formatted GPS", "vrt.cif0.gps", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif0_ins, { "Formatted INS", "vrt.cif0.ins", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif0_ecef_ephemeris, { "ECEF ephemeris", "vrt.cif0.ecefephem", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_cif0_rel_ephemeris, { "Relative ephemeris", "vrt.cif0.relephem", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_cif0_ephemeris_ref_id, { "Ephemeris ref ID", "vrt.cif0.ephemrefid", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_cif0_gps_ascii, { "GPS ASCII", "vrt.cif0.gpsascii", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_cif0_context_assoc_lists, { "Context association lists", "vrt.cif0.assoclists", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_cif0_cif7, { "CIF7", "vrt.cif0.cif7", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif0_cif6, { "CIF6", "vrt.cif0.cif6", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif0_cif5, { "CIF5", "vrt.cif0.cif5", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif0_cif4, { "CIF4", "vrt.cif0.cif4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_cif0_cif3, { "CIF3", "vrt.cif0.cif3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_cif0_cif2, { "CIF2", "vrt.cif0.cif2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_cif0_cif1, { "CIF1", "vrt.cif0.cif1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_cif1_phase_offset, { "Phase offset", "vrt.cif1.phaseoffset", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif1_polarization, { "Polarization", "vrt.cif1.polarization", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif1_range, { "Range (distance)", "vrt.cif1.range", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_cif1_aux_freq, { "Aux frequency", "vrt.cif1.auxfreq", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_cif1_aux_bandwidth, { "Aux bandwidth", "vrt.cif1.auxbw", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif1_io32, { "Discrete I/O (32-bit)", "vrt.cif1.io32", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_cif1_io64, { "Discrete I/O (64-bit)", "vrt.cif1.io64", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_cif1_v49_spec, { "V49 spec compliance", "vrt.cif1.v49spec", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_cif1_ver, { "Version and build code", "vrt.cif1.ver", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_cif[1], { "CIF1", "vrt.cif1", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[2], { "CIF2", "vrt.cif2", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[3], { "CIF3", "vrt.cif3", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[4], { "CIF4", "vrt.cif4", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[5], { "CIF5", "vrt.cif5", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[6], { "CIF6", "vrt.cif6", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cif[7], { "CIF7", "vrt.cif7", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ref_pt_id, { "Reference point identifier", "vrt.context.refptid", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_bandwidth, { "Bandwidth", "vrt.context.bw", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_if_freq, { "IF reference frequency", "vrt.context.iffreq", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_rf_freq, { "RF reference frequency", "vrt.context.rffreq", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_rf_freq_offset, { "RF reference frequency offset", "vrt.context.rffreqoffset", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_if_band_offset, { "IF band offset", "vrt.context.ifbandoffset", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_ref_level, { "Reference level", "vrt.context.reflevel", FT_INT16, BASE_CUSTOM, CF_FUNC(format_decibel_milliwatt), 0x00, NULL, HFILL } }, { &hf_vrt_context_gain_stage2, { "Stage 2", "vrt.context.gain.stage2", FT_INT16, BASE_CUSTOM, CF_FUNC(format_decibel), 0x00, NULL, HFILL } }, { &hf_vrt_context_gain_stage1, { "Stage 1", "vrt.context.gain.stage1", FT_INT16, BASE_CUSTOM, CF_FUNC(format_decibel), 0x00, NULL, HFILL } }, { &hf_vrt_context_over_range_count, { "Over-range count", "vrt.context.overrangecount", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_sample_rate, { "Sample rate", "vrt.context.samplerate", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_timestamp_adjust, { "Timestamp adjustment", "vrt.context.timestampadjust", FT_INT64, BASE_CUSTOM, CF_FUNC(format_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_timestamp_cal, { "Timestamp calibration", "vrt.context.timestampcal", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_temperature, { "Device temperature", "vrt.context.temperature", FT_INT16, BASE_CUSTOM, CF_FUNC(format_celsius), 0x00, NULL, HFILL } }, { &hf_vrt_context_device_id_oui, { "Manufacturer OUI", "vrt.context.deviceid.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_device_id_code, { "Device code", "vrt.context.deviceid.code", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_state_event_en_cal_time, { "Calibrated time enable", "vrt.context.stateevent.caltime.en", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_context_state_event_en_valid_data, { "Valid data enable", "vrt.context.stateevent.validdata.en", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_context_state_event_en_ref_lock, { "Reference lock enable", "vrt.context.stateevent.reflock.en", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_context_state_event_en_agc, { "AGC/MGC enable", "vrt.context.stateevent.agc.en", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_context_state_event_en_detected_sig, { "Detected signal enable", "vrt.context.stateevent.detectedsignal.en", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_context_state_event_en_spectral_inv, { "Spectral inversion enable", "vrt.context.stateevent.spectralinv.en", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_context_state_event_en_over_range, { "Over-range enable", "vrt.context.stateevent.overrange.en", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_context_state_event_en_sample_loss, { "Sample loss enable", "vrt.cif0.context.sampleloss.en", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_context_state_event_cal_time, { "Calibrated time indicator", "vrt.context.stateevent.caltime.val", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_vrt_context_state_event_valid_data, { "Valid data indicator", "vrt.context.stateevent.validdata.val", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_vrt_context_state_event_ref_lock, { "Reference lock indicator", "vrt.context.stateevent.reflock.val", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_vrt_context_state_event_agc, { "AGC/MGC indicator", "vrt.context.stateevent.agc.val", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_vrt_context_state_event_detected_sig, { "Detected signal indicator", "vrt.context.stateevent.detectedsignal.val", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_context_state_event_spectral_inv, { "Spectral inversion indicator", "vrt.context.stateevent.spectralinv.val", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_vrt_context_state_event_over_range, { "Over-range indicator", "vrt.context.stateevent.overrange.val", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_vrt_context_state_event_sample_loss, { "Sample loss indicator", "vrt.context.stateevent.sampleloss.val", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_vrt_context_state_event_user, { "User-defined", "vrt.context.stateevent.user", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_packing, { "Packing method", "vrt.context.signaldataformat.packing", FT_UINT8, BASE_DEC, VALS(packing_method), 0x80, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_type, { "Real/complex type", "vrt.context.signaldataformat.realcomplex", FT_UINT8, BASE_DEC, VALS(data_sample_type), 0x60, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_item, { "Data item format", "vrt.context.signaldataformat.format", FT_UINT8, BASE_DEC, VALS(data_item_format), 0x1F, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_repeat, { "Sample-component repeat indicator", "vrt.context.signaldataformat.repeat", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_event_size, { "Event-tag size", "vrt.context.signaldataformat.eventsize", FT_UINT8, BASE_DEC, NULL, 0x70, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_channel_size, { "Channel-tag size", "vrt.context.signaldataformat.channelsize", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_fraction_size, { "Data item fraction size", "vrt.context.signaldataformat.fractionsize", FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_packing_size, { "Item packing field size", "vrt.context.signaldataformat.packingsize", FT_UINT16, BASE_DEC, NULL, 0x0FC0, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_item_size, { "Data item size", "vrt.context.signaldataformat.itemsize", FT_UINT16, BASE_DEC, NULL, 0x003F, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_repeat_count, { "Repeat count", "vrt.context.signaldataformat.repeatcount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vrt_context_signal_data_format_vector_size, { "Vector size", "vrt.context.signaldataformat.vectorsize", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vrt_context_gps.tsi, { "Integer timestamp type", "vrt.context.gps.tsi", FT_UINT8, BASE_DEC, VALS(tsi_types), 0x0C, NULL, HFILL } }, { &hf_vrt_context_gps.tsf, { "Fractional timestamp type", "vrt.context.gps.tsf", FT_UINT8, BASE_DEC, VALS(tsf_types), 0x03, NULL, HFILL } }, { &hf_vrt_context_gps.oui, { "Manufacturer OUI", "vrt.context.gps.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.ts_int, { "Integer timestamp of position fix", "vrt.context.gps.ts_int", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.ts_frac_sample, { "Fractional timestamp (samples)", "vrt.context.gps.ts_frac_sample", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.ts_picosecond, { "Fractional timestamp (picoseconds)", "vrt.context.gps.ts_frac_picosecond", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.lat, { "Latitude", "vrt.context.gps.lat", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.lon, { "Longitude", "vrt.context.gps.lon", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.alt, { "Altitude", "vrt.context.gps.alt", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.speed, { "Speed over ground", "vrt.context.gps.speed", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.heading, { "Heading angle", "vrt.context.gps.heading", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.track, { "Track angle", "vrt.context.gps.track", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_gps.mag_var, { "Magnetic variation", "vrt.context.gps.mag_var", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.tsi, { "Integer timestamp type", "vrt.context.ins.tsi", FT_UINT8, BASE_DEC, VALS(tsi_types), 0x0C, NULL, HFILL } }, { &hf_vrt_context_ins.tsf, { "Fractional timestamp type", "vrt.context.ins.tsf", FT_UINT8, BASE_DEC, VALS(tsf_types), 0x03, NULL, HFILL } }, { &hf_vrt_context_ins.oui, { "Manufacturer OUI", "vrt.context.ins.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.ts_int, { "Integer timestamp of position fix", "vrt.context.ins.ts_int", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.ts_frac_sample, { "Fractional timestamp (samples)", "vrt.context.ins.ts_frac_sample", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.ts_picosecond, { "Fractional timestamp (picoseconds)", "vrt.context.ins.ts_frac_picosecond", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.lat, { "Latitude", "vrt.context.ins.lat", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.lon, { "Longitude", "vrt.context.ins.lon", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.alt, { "Altitude", "vrt.context.ins.alt", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.speed, { "Speed over ground", "vrt.context.ins.speed", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.heading, { "Heading angle", "vrt.context.ins.heading", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.track, { "Track angle", "vrt.context.ins.track", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ins.mag_var, { "Magnetic variation", "vrt.context.ins.mag_var", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.tsi, { "Integer timestamp type", "vrt.context.ecefephem.tsi", FT_UINT8, BASE_DEC, VALS(tsi_types), 0x0C, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.tsf, { "Fractional timestamp type", "vrt.context.ecefephem.tsf", FT_UINT8, BASE_DEC, VALS(tsf_types), 0x03, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.oui, { "Manufacturer OUI", "vrt.context.ecefephem.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.ts_int, { "Integer timestamp of position fix", "vrt.context.ecefephem.ts_int", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.ts_frac_sample, { "Fractional timestamp (samples)", "vrt.context.ecefephem.ts_frac_sample", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.ts_picosecond, { "Fractional timestamp (picoseconds)", "vrt.context.ecefephem.ts_frac_picosecond", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.pos_x, { "Position X", "vrt.context.ecefephem.posx", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.pos_y, { "Position Y", "vrt.context.ecefephem.posy", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.pos_z, { "Position Z", "vrt.context.ecefephem.posz", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.att_alpha, { "Attitude alpha (α)", "vrt.context.ecefephem.attalpha", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.att_beta, { "Attitude beta (β)", "vrt.context.ecefephem.attbeta", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.att_phi, { "Attitude phi (φ)", "vrt.context.ecefephem.attphi", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.vel_dx, { "Velocity dX", "vrt.context.ecefephem.veldx", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.vel_dy, { "Velocity dY", "vrt.context.ecefephem.veldy", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_ecef_ephemeris.vel_dz, { "Velocity dZ", "vrt.context.ecefephem.veldz", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.tsi, { "Integer timestamp type", "vrt.context.relephem.tsi", FT_UINT8, BASE_DEC, VALS(tsi_types), 0x0C, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.tsf, { "Fractional timestamp type", "vrt.context.relephem.tsf", FT_UINT8, BASE_DEC, VALS(tsf_types), 0x03, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.oui, { "Manufacturer OUI", "vrt.context.relephem.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.ts_int, { "Integer timestamp of position fix", "vrt.context.relephem.ts_int", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.ts_frac_sample, { "Fractional timestamp (samples)", "vrt.context.relephem.ts_frac_sample", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.ts_picosecond, { "Fractional timestamp (picoseconds)", "vrt.context.relephem.ts_frac_picosecond", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.pos_x, { "Position X", "vrt.context.relephem.posx", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.pos_y, { "Position Y", "vrt.context.relephem.posy", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.pos_z, { "Position Z", "vrt.context.relephem.posz", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meter), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.att_alpha, { "Attitude alpha (α)", "vrt.context.relephem.attalpha", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.att_beta, { "Attitude beta (β)", "vrt.context.relephem.attbeta", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.att_phi, { "Attitude phi (φ)", "vrt.context.relephem.attphi", FT_INT32, BASE_CUSTOM, CF_FUNC(format_degrees), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.vel_dx, { "Velocity dX", "vrt.context.relephem.veldx", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.vel_dy, { "Velocity dY", "vrt.context.relephem.veldy", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_rel_ephemeris.vel_dz, { "Velocity dZ", "vrt.context.relephem.veldz", FT_INT32, BASE_CUSTOM, CF_FUNC(format_meters_per_second), 0x00, NULL, HFILL } }, { &hf_vrt_context_ephemeris_ref_id, { "Ephemeris reference identifier", "vrt.context.ephemrefid", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps_ascii_oui, { "Manufacturer OUI", "vrt.context.gpsascii.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps_ascii_size, { "Number of words", "vrt.context.gpsascii.size", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_gps_ascii_data, { "Data", "vrt.context.gpsascii.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_src_size, { "Source list size", "vrt.context.assoclists.src.size", FT_UINT16, BASE_DEC, NULL, 0x01FF, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_sys_size, { "System list size", "vrt.context.assoclists.sys.size", FT_UINT16, BASE_DEC, NULL, 0x01FF, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_vec_size, { "Vector-component list size", "vrt.context.assoclists.vec.size", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_a, { "A bit (asynchronous-channel tag list present)", "vrt.context.assoclists.a", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_asy_size, { "Asynchronous-channel list size", "vrt.context.assoclists.asy.size", FT_UINT16, BASE_DEC, NULL, 0x7FFF, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_src_data, { "Source context association list", "vrt.context.assoclists.src.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_sys_data, { "System context association list", "vrt.context.assoclists.sys.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_vec_data, { "Vector-component context association list", "vrt.context.assoclists.vec.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_asy_data, { "Asynchronous-channel context association list", "vrt.context.assoclists.asy.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_assoc_lists_asy_tag_data, { "Asynchronous-channel tag list", "vrt.context.assoclists.asy.tagdata", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_phase_offset, { "Phase offset", "vrt.context.phaseoffset", FT_INT16, BASE_CUSTOM, CF_FUNC(format_radian_phase), 0x00, NULL, HFILL } }, { &hf_vrt_context_pol_tilt, { "Tilt angle (θ)", "vrt.context.polarization.tilt", FT_INT16, BASE_CUSTOM, CF_FUNC(format_radian_pol), 0x00, NULL, HFILL } }, { &hf_vrt_context_pol_ellipticity, { "Ellipticity angle (χ)", "vrt.context.polarization.ellipticity", FT_INT16, BASE_CUSTOM, CF_FUNC(format_radian_pol), 0x00, NULL, HFILL } }, { &hf_vrt_context_range, { "Range (distance)", "vrt.context.range", FT_UINT32, BASE_CUSTOM, CF_FUNC(format_meter_unsigned), 0x00, NULL, HFILL } }, { &hf_vrt_context_aux_freq, { "Aux frequency", "vrt.context.auxfreq", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_aux_bandwidth, { "Aux bandwidth", "vrt.context.auxbw", FT_INT64, BASE_CUSTOM, CF_FUNC(format_hertz), 0x00, NULL, HFILL } }, { &hf_vrt_context_io32, { "Discrete I/O (32-bit)", "vrt.context.io32", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_io64, { "Discrete I/O (64-bit)", "vrt.context.io64", FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_context_v49_spec, { "V49 spec compliance", "vrt.context.v49spec", FT_UINT32, BASE_HEX, VALS(standard_version_codes), 0x00, NULL, HFILL } }, { &hf_vrt_context_ver_year, { "Year", "vrt.context.ver.year", FT_UINT16, BASE_DEC, NULL, 0xFE00, NULL, HFILL } }, { &hf_vrt_context_ver_day, { "Day", "vrt.context.ver.day", FT_UINT16, BASE_DEC, NULL, 0x01FF, NULL, HFILL } }, { &hf_vrt_context_ver_rev, { "Revision", "vrt.context.ver.rev", FT_UINT16, BASE_DEC, NULL, 0xFC00, NULL, HFILL } }, { &hf_vrt_context_ver_user, { "User defined", "vrt.context.ver.user", FT_UINT16, BASE_DEC, NULL, 0x03FF, NULL, HFILL } }, { &hf_vrt_data, { "Data", "vrt.data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_trailer, { "Trailer", "vrt.trailer", FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_trailer_enables, { "Indicator enable bits", "vrt.enables", FT_UINT16, BASE_HEX, NULL, 0xFFF0, NULL, HFILL } }, { &hf_vrt_trailer_ind, { "Indicator bits", "vrt.indicators", FT_UINT16, BASE_HEX, NULL, 0x0FFF, NULL, HFILL } }, { &hf_vrt_trailer_e, { "Associated context packet count enabled", "vrt.e", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL } }, { &hf_vrt_trailer_acpc, { "Associated context packet count", "vrt.acpc", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL } }, { &hf_vrt_trailer_ind_caltime, { "Calibrated time indicator", "vrt.caltime", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL } }, { &hf_vrt_trailer_ind_valid, { "Valid signal indicator", "vrt.valid", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL } }, { &hf_vrt_trailer_ind_reflock, { "Reference lock indicator", "vrt.reflock", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, { &hf_vrt_trailer_ind_agc, { "AGC/MGC indicator", "vrt.agc", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, { &hf_vrt_trailer_ind_sig, { "Signal detected indicator", "vrt.sig", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, { &hf_vrt_trailer_ind_inv, { "Spectral inversion indicator", "vrt.inv", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, { &hf_vrt_trailer_ind_overrng, { "Overrange indicator", "vrt.overrng", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, { &hf_vrt_trailer_ind_sampleloss, { "Lost sample indicator", "vrt.sampleloss", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, { &hf_vrt_trailer_ind_user0, { "User indicator 0", "vrt.user0", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL } }, { &hf_vrt_trailer_ind_user1, { "User indicator 1", "vrt.user1", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, { &hf_vrt_trailer_ind_user2, { "User indicator 2", "vrt.user2", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, { &hf_vrt_trailer_ind_user3, { "User indicator 3", "vrt.user3", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, { &hf_vrt_trailer_en_caltime, { "Calibrated time indicator enable", "vrt.caltime_en", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL } }, { &hf_vrt_trailer_en_valid, { "Valid signal indicator enable", "vrt.valid_en", FT_BOOLEAN, 16, NULL, 0x4000, NULL, HFILL } }, { &hf_vrt_trailer_en_reflock, { "Reference lock indicator enable", "vrt.reflock_en", FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL } }, { &hf_vrt_trailer_en_agc, { "AGC/MGC indicator enable", "vrt.agc_en", FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL } }, { &hf_vrt_trailer_en_sig, { "Signal detected indicator enable", "vrt.sig_en", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL } }, { &hf_vrt_trailer_en_inv, { "Spectral inversion indicator enable", "vrt.inv_en", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL } }, { &hf_vrt_trailer_en_overrng, { "Overrange indicator enable", "vrt.overrng_en", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, { &hf_vrt_trailer_en_sampleloss, { "Lost sample indicator enable", "vrt.sampleloss_en", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, { &hf_vrt_trailer_en_user0, { "User indicator 0 enable", "vrt.user0_en", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, { &hf_vrt_trailer_en_user1, { "User indicator 1 enable", "vrt.user1_en", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, { &hf_vrt_trailer_en_user2, { "User indicator 2 enable", "vrt.user2_en", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, { &hf_vrt_trailer_en_user3, { "User indicator 3 enable", "vrt.user3_en", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, { &hf_vrt_cid_oui, { "Class ID Organizationally Unique ID", "vrt.oui", FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cid_icc, { "Class ID Information Class Code", "vrt.icc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_vrt_cid_pcc, { "Class ID Packet Class Code", "vrt.pcc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } } }; // update ETT_IDX_* as new items added to track indices static gint *ett[] = { &ett_vrt, &ett_header, &ett_trailer, &ett_indicators, &ett_ind_enables, &ett_cid, &ett_cif0, &ett_cif1, &ett_gain, // ETT_IDX_GAIN &ett_device_id, // ETT_IDX_DEVICE_ID &ett_state_event, // ETT_IDX_STATE_EVENT &ett_signal_data_format, // ETT_IDX_SIGNAL_DATA_FORMAT &ett_gps, // ETT_IDX_GPS &ett_ins, // ETT_IDX_INS &ett_ecef_ephem, // ETT_IDX_ECEF_EPHEM &ett_rel_ephem, // ETT_IDX_REL_EPHEM &ett_gps_ascii, // ETT_IDX_GPS_ASCII &ett_assoc_lists, // ETT_IDX_ASSOC_LISTS &ett_pol, // ETT_IDX_POL &ett_ver, // ETT_IDX_VER }; proto_vrt = proto_register_protocol ("VITA 49 radio transport protocol", "VITA 49", "vrt"); proto_register_field_array(proto_vrt, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vrt_module = prefs_register_protocol(proto_vrt, NULL); prefs_register_bool_preference(vrt_module, "ettus_uhd_header_format", "Use Ettus UHD header format", "Activate workaround for weird Ettus UHD header offset on data packets", &vrt_use_ettus_uhd_header_format); } void proto_reg_handoff_vrt(void) { dissector_handle_t vrt_handle; vrt_handle = create_dissector_handle(dissect_vrt, proto_vrt); dissector_add_uint_with_preference("udp.port", VITA_49_PORT, vrt_handle); dissector_add_string("rtp_dyn_payload_type","VITA 49", vrt_handle); dissector_add_uint_range_with_preference("rtp.pt", "", vrt_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vsip.c
/* packet-vsip.c * Routines for VSIP packet disassembly * * Copyright (c) 2010 by Verint Canada Systems Inc. * * Original Author: Charles Nepveu <charles.nepveu at verint.com> * Generated using the TSN.1 compiler from protomatics. * * Updated to current API usage to create "manual" version of * dissector by Michael Mann * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> void proto_register_vsip(void); void proto_reg_handoff_vsip(void); static const value_string EVsipMessageType_vals[] = { { 1, "VSIP Ping Request"}, { 2, "VSIP Ping Response"}, { 3, "VSIP Get Capabilities Request"}, { 4, "VSIP Get Capabilities Response"}, { 5, "VSIP Start Device Request"}, { 6, "VSIP Stop Device Request"}, { 7, "VSIP Set Configuration Request"}, { 8, "VSIP Get Configuration Request"}, { 9, "VSIP Get Configuration Response"}, {10, "VSIP Send Command Request"}, {11, "VSIP Event Notify"}, {12, "VSIP Event Subscribe"}, {13, "VSIP Error Response"}, {19, "VSIP Content-Type Switch Request"}, {20, "VSIP Content-Type Switch Response"}, {21, "VSIP Start Device EX Request"}, {22, "VSIP Stop Device EX Request"}, {23, "VSIP Event Subscribe Extended"}, {24, "VSIP Send Command EX Request"}, {48, "VSIP Error Variable Arguments Response"}, {0, NULL} }; static value_string_ext EVsipMessageType_vals_ext = VALUE_STRING_EXT_INIT(EVsipMessageType_vals); static const value_string EVsipVendorID_vals[] = { {8192, "Unknown Vendor"}, {8193, "Verint"}, {8194, "DVTEL"}, {8195, "GENETEC"}, {8196, "RADIANT"}, {8197, "SILENT WITNESS"}, {8198, "EUROPLEX TECH"}, {8199, "JVC"}, {8200, "SAMSUNG"}, {0, NULL} }; static const value_string EVsipEntityType_vals[] = { { 0, "Device"}, { 1, "Video decoder"}, { 2, "Video encoder"}, { 3, "Audio decoder"}, { 4, "Audio encoder"}, { 5, "Serial port"}, { 6, "Input pin"}, { 7, "Output pin"}, {11, "Wireless connection"}, {12, "Ethernet connection"}, {13, "Motion detection"}, {17, "Video sensor"}, {18, "Content analyzer"}, {20, "Content analyzer view"}, {22, "Camera tampering detection"}, {0, NULL} }; static const value_string EVsipContentType_vals[] = { {0, "None"}, {1, "Command and Control"}, {2, "Stream -video, audio, serial-"}, {3, "SSL Command and Control Client"}, {4, "SSL Command and Control Server"}, {5, "SSL Stream -video, audio, serial- Client"}, {6, "SSL Stream -video, audio, serial- Server"}, {0, NULL} }; static const value_string EVsipValueType_vals[] = { {1, "Character - 8 bits"}, {2, "Short - 16 bits"}, {3, "Integer - 32 bits"}, {4, "VSIP String - Variable"}, {5, "Unsigned Integer - 32 bits"}, {6, "GUID - 128 bits"}, {7, "Float - 32 bits"}, {8, "Binary - Variable"}, {0, NULL} }; static const value_string EVsipConnectionType_vals[] = { { 0, "VSIP_CONN_TYPE_NULL"}, { 1, "VSIP_CONN_TYPE_UDP_UNICAST"}, { 2, "VSIP_CONN_TYPE_UDP_MULTICAST"}, { 3, "VSIP_CONN_TYPE_UDP"}, { 7, "VSIP_CONN_TYPE_RTPSTANDARDH264_UDP"}, { 11, "VSIP_CONN_TYPE_RTPSTANDARDH264_UDP_VOLATILE"}, { 12, "VSIP_CONN_TYPE_TCP"}, { 64, "VSIP_CONN_TYPE_RTP"}, { 65, "VSIP_CONN_TYPE_RTPVERINT_UDP"}, { 76, "VSIP_CONN_TYPE_RTPVERINT_TCP"}, {129, "VSIP_CONN_TYPE_UDP_VOLATILE"}, {140, "VSIP_CONN_TYPE_TCP_VOLATILE"}, {192, "VSIP_CONN_TYPE_RTPVERINT_UDP_VOLATILE"}, {204, "VSIP_CONN_TYPE_RTPVERINT_TCP_VOLATILE"}, {0, NULL} }; static const value_string EVsipCommand_vals[] = { { 1, "Send Key Frame"}, { 2, "VSIP Proprietary Command"}, { 3, "Set TCP Connection As Vital"}, { 4, "Reset Wireless Passkey"}, { 5, "Remove Multicast Stream"}, { 7, "Clear Statistics"}, { 8, "Clear Logs"}, { 9, "Ping Remote Host"}, {10, "VSIP_CA_COMMAND_ADD_VIEW"}, {11, "VSIP_CA_COMMAND_DEL_VIEW"}, {12, "VSIP_CA_COMMAND_FORCE_VIEW"}, {13, "VSIP_CA_COMMAND_GET_VIEW_SNAPSHOT"}, {14, "VSIP_CA_COMMAND_GET_LIVE_SNAPSHOT"}, {15, "VSIP_CA_COMMAND_ADD_RULE"}, {16, "VSIP_CA_COMMAND_DEL_RULE"}, {17, "VSIP_CA_COMMAND_SET_RULE"}, {18, "VSIP_CA_COMMAND_GET_RULES"}, {19, "VSIP_CA_COMMAND_RESET_INT_PARAMS"}, {32, "VSIP_CA_COMMAND_RESET_CA_CONFIG"}, {33, "Install License"}, {34, "Remove License"}, {49, "Reset Out-Of-Position View"}, {50, "Reset Out-Of-Position Params"}, {51, "Reset Out-Of-Focus Params"}, {64, "RTSP control over VSIP"}, {0, NULL} }; static value_string_ext EVsipCommand_vals_ext = VALUE_STRING_EXT_INIT(EVsipCommand_vals); static const value_string EVsipConfigItem_vals[] = { { 1, "CONFIG_NETWORK_PORT/CONFIG_NETWORK_RX_PORT"}, { 2, "CONFIG_NETWORK_CONNECTION_TYPE"}, { 3, "CONFIG_NETWORK_SUPPORTED_CONNECTION_TYPE"}, { 4, "CONFIG_NETWORK_SSL_PASSKEY"}, { 5, "CONFIG_NETWORK_MAC_ADDRESS"}, { 6, "CONFIG_NETWORK_TX_PORT"}, { 7, "CONFIG_NETWORK_RX_PORT2"}, { 8, "CONFIG_NETWORK_RX_PORT3"}, { 9, "CONFIG_NETWORK_RX_PORT4"}, { 10, "CONFIG_NETWORK_TX_PORT2"}, { 11, "CONFIG_NETWORK_TX_PORT3"}, { 12, "CONFIG_NETWORK_TX_PORT4"}, { 13, "CONFIG_NETWORK_DESTINATION_GUID"}, { 14, "CONFIG_NETWORK_DESTINATION_GUID2"}, { 15, "CONFIG_NETWORK_DESTINATION_GUID3"}, { 16, "CONFIG_NETWORK_DESTINATION_GUID4"}, { 257, "CONFIG_CONTENT_ANALYZER_TARGET_FRAME_RATE"}, { 258, "CONFIG_CONTENT_ANALYZER_CURRENT_STREAMING_STATE"}, { 259, "CONFIG_CONTENT_ANALYZER_INITIAL_STREAMING_STATE"}, { 260, "CONFIG_CONTENT_ANALYZER_TARGET_IP_ADDRESS"}, { 261, "CONFIG_CONTENT_ANALYZER_TARGET_VSIP_GUID"}, { 262, "CONFIG_CONTENT_ANALYZER_SUPPORTED_TYPE"}, { 263, "CONFIG_CONTENT_ANALYZER_JPEG_ENCODING_STATE"}, { 264, "CONFIG_CONTENT_ANALYZER_JPEG_FRAME_RATE"}, { 265, "CONFIG_CONTENT_ANALYZER_JPEG_QUALITY"}, { 266, "CONFIG_CONTENT_ANALYZER_SOURCE_INPUT_NUMBER"}, { 267, "CONFIG_CONTENT_ANALYZER_ACTUAL_TYPE"}, { 268, "CONFIG_CONTENT_ANALYZER_VERSION"}, { 269, "CONFIG_CONTENT_ANALYZER_FORENSICS_METADATA_ENABLED"}, { 270, "CONFIG_CONTENT_ANALYZER_POSSIBLE_SENSORS"}, { 271, "CONFIG_CONTENT_ANALYZER_CONNECTION_MODE"}, { 272, "CONFIG_CONTENT_ANALYZER_INTERNAL_PARAMETERS"}, { 273, "CONFIG_CONTENT_ANALYZER_STATUS"}, { 274, "CONFIG_CONTENT_ANALYZER_CURRENT_VIEW_ID"}, { 275, "CONFIG_CONTENT_ANALYZER_SUPPORTED_FEATURES"}, { 276, "CONFIG_CONTENT_ANALYZER_CURRENT_SENSOR"}, { 277, "CONFIG_CONTENT_ANALYZER_AVAILABLE_SENSORS"}, { 278, "CONFIG_CONTENT_ANALYZER_AUTO_DISABLE_SCHEDULES"}, { 513, "CONFIG_NETWORK_QOS_TYPE"}, { 514, "CONFIG_NETWORK_QOS_VIDEO_PRIORITY"}, { 515, "CONFIG_NETWORK_QOS_AUDIO_PRIORITY"}, { 516, "CONFIG_NETWORK_QOS_CONTROL_PRIORITY"}, { 517, "CONFIG_NETWORK_QOS_TOS_VIDEO_PRIORITY"}, { 518, "CONFIG_NETWORK_QOS_TOS_AUDIO_PRIORITY"}, { 519, "CONFIG_NETWORK_QOS_TOS_CONTROL_PRIORITY"}, { 769, "CONFIG_SYSTEM_MONITOR_MAX_FATAL_ERR_COUNT"}, {1025, "CONFIG_CONTENT_ANALYZER_VIEW_NAME"}, {1026, "CONFIG_CONTENT_ANALYZER_VIEW_IS_DEFINED"}, {1027, "CONFIG_CONTENT_ANALYZER_VIEW_SOURCE_INPUT_NUMBER"}, {1028, "CONFIG_CONTENT_ANALYZER_VIEW_SUPPORTED_FEATURES"}, {1281, "CONFIG_CAMALERT_PAINTOVER_MODE"}, {1282, "CONFIG_CAMALERT_PAINTOVER_SENSITIVITY_OFFSET"}, {1283, "CONFIG_CAMALERT_PAINTOVER_ALARM"}, {1284, "CONFIG_CAMALERT_PAINTOVER_ALARM_RESET"}, {1285, "CONFIG_CAMALERT_PAINTOVER_MEDIAN_THRES"}, {1286, "CONFIG_CAMALERT_PAINTOVER_STDDEV_THRES"}, {1287, "CONFIG_CAMALERT_PAINTOVER_MEDIAN"}, {1288, "CONFIG_CAMALERT_PAINTOVER_STDDEV"}, {1289, "CONFIG_CAMALERT_PAINTOVER_INPUT_NUMBER"}, {1290, "CONFIG_CAMALERT_PAINTOVER_ALARM_STATE"}, {1537, "CONFIG_CAMERA_TAMPERING_LIB_VERSION"}, {1538, "CONFIG_CAMERA_TAMPERING_INPUT_NUM"}, {1539, "CONFIG_CAMERA_TAMPERING_OOP_FRAME_RATE"}, {1540, "CONFIG_CAMERA_TAMPERING_OOP_ENABLE"}, {1541, "CONFIG_CAMERA_TAMPERING_OOP_SENSITIVITY_THRESHOLD"}, {1542, "CONFIG_CAMERA_TAMPERING_OOP_PERST_LEVEL"}, {1543, "CONFIG_CAMERA_TAMPERING_OOP_MASK"}, {1544, "CONFIG_CAMERA_TAMPERING_OOP_MASK_ENABLE"}, {1545, "CONFIG_CAMERA_TAMPERING_OOP_MASK_POLARITY"}, {1546, "CONFIG_CAMERA_TAMPERING_OOP_ALARM_STATUS"}, {1547, "CONFIG_CAMERA_TAMPERING_OOP_CURRENT_LEVEL"}, {1548, "CONFIG_CAMERA_TAMPERING_OOF_ENABLE"}, {1549, "CONFIG_CAMERA_TAMPERING_OOF_SENSITIVITY_THRESHOLD"}, {1550, "CONFIG_CAMERA_TAMPERING_OOF_PERST_LEVEL"}, {1551, "CONFIG_CAMERA_TAMPERING_OOF_MASK"}, {1552, "CONFIG_CAMERA_TAMPERING_OOF_MASK_ENABLE"}, {1553, "CONFIG_CAMERA_TAMPERING_OOF_MASK_POLARITY"}, {1554, "CONFIG_CAMERA_TAMPERING_OOF_ALARM_STATUS"}, {1555, "CONFIG_CAMERA_TAMPERING_OOF_CURRENT_LEVEL"}, {1556, "CONFIG_CAMERA_TAMPERING_OOF_FRAME_RATE"}, {1557, "CONFIG_CAMERA_TAMPERING_OOP_ILLUM_NORM"}, {4097, "CONFIG_VIDEO_ATTRIBUTE_BRIGHTNESS"}, {4098, "CONFIG_VIDEO_ATTRIBUTE_CONTRAST"}, {4099, "CONFIG_VIDEO_ATTRIBUTE_GAIN_U"}, {4100, "CONFIG_VIDEO_ATTRIBUTE_GAIN_V"}, {4101, "CONFIG_VIDEO_ATTRIBUTE_HUE"}, {4102, "CONFIG_VIDEO_ATTRIBUTE_MOTION_ENC"}, {4103, "CONFIG_VIDEO_ATTRIBUTE_SATURATION"}, {4104, "CONFIG_VIDEO_ATTRIBUTE_RECEIVER_MODE"}, {4105, "CONFIG_VIDEO_ATTRIBUTE_INPUT_OPTION"}, {4106, "CONFIG_VIDEO_ATTRIBUTE_H264_ENC"}, {4113, "CONFIG_VIDEO_COMPRESSION_DATA_FORMAT"}, {4114, "CONFIG_VIDEO_COMPRESSION_BLOCK_REFRESH"}, {4115, "CONFIG_VIDEO_COMPRESSION_FRAME_RATE"}, {4116, "CONFIG_VIDEO_COMPRESSION_OVERLAY_RATE"}, {4117, "CONFIG_VIDEO_COMPRESSION_QUANTIZATION"}, {4118, "CONFIG_VIDEO_COMPRESSION_BIT_RATE"}, {4119, "CONFIG_VIDEO_COMPRESSION_INTRA_INTERVAL"}, {4120, "CONFIG_VIDEO_COMPRESSION_QUANTIZATION_MIN"}, {4121, "CONFIG_VIDEO_COMPRESSION_MODE"}, {4122, "CONFIG_VIDEO_COMPRESSION_MODE_SUPPORTED"}, {4123, "CONFIG_VIDEO_COMPRESSION_FRAME_RATE_CONTROL"}, {4124, "CONFIG_VIDEO_COMPRESSION_TARGET_FILE_SIZE"}, {4125, "CONFIG_VIDEO_COMPRESSION_VFS_QUALITY"}, {4126, "CONFIG_VIDEO_ENHANCED_QUALITY_MODE"}, {4127, "CONFIG_VIDEO_COMPRESSION_FRAME_SKIPRATE"}, {4129, "CONFIG_VIDEO_INFO_ANALOG_FORMAT"}, {4130, "CONFIG_VIDEO_INFO_SUPPORTED_DATA_FORMAT"}, {4131, "CONFIG_VIDEO_INFO_SOURCE_INPUT"}, {4132, "CONFIG_VIDEO_INFO_ENCODER_NUMBER"}, {4133, "CONFIG_VIDEO_INFO_SINK_OUTPUT"}, {4134, "CONFIG_VIDEO_INFO_DECODER_NUMBER"}, {4135, "CONFIG_VIDEO_INFO_SECOND_CONNECTOR_STATE"}, {4136, "CONFIG_VIDEO_INFO_INPUT_STATE"}, {4137, "CONFIG_VIDEO_INFO_MAX_RESOLUTION"}, {4138, "CONFIG_VIDEO_INFO_SUPPORTED_MAX_RESOLUTION"}, {4139, "CONFIG_VIDEO_INFO_VIDEO_FORMAT_AUTODETECT"}, {4145, "CONFIG_VIDEO_STREAMING_STATE_CURRENT"}, {4146, "CONFIG_VIDEO_STREAMING_STATE_INITIAL"}, {4147, "CONFIG_VIDEO_STREAMING_TARGET_IP_ADDRESS"}, {4148, "CONFIG_VIDEO_STREAMING_TARGET_VSIP_GUID"}, {4149, "CONFIG_VIDEO_STREAMING_TRANSPORT_PROTOCOL"}, {4150, "CONFIG_VIDEO_STREAMING_RATE_CONTROL_MODE"}, {4151, "CONFIG_VIDEO_STREAMING_INPUT_FILTER_MODE"}, {4152, "CONFIG_VIDEO_STREAMING_ENCODER_MODE"}, {4153, "CONFIG_VIDEO_STREAMING_MAX_BIT_RATE"}, {4154, "CONFIG_VIDEO_STREAMING_DEFAULT_KEEP_ALIVE_ENABLE"}, {4160, "CONFIG_VIDEO_STREAMING_DYN_FILT_ENABLE"}, {4161, "CONFIG_VIDEO_DESTINATION_ADD"}, {4162, "CONFIG_VIDEO_DESTINATION_REMOVE"}, {4163, "CONFIG_VIDEO_STREAMING_RATE_CONTROL_MODE_SUPPORTED"}, {4176, "CONFIG_VIDEO_ENERGY_VECTOR_FREQUENCY"}, {4193, "CONFIG_VIDEO_WEB_MULTICAST_IP_ADDRESS"}, {4194, "CONFIG_VIDEO_WEB_MULTICAST_IP_PORT"}, {4208, "CONFIG_VIDEO_STREAMING_MAX_TX_SIZE"}, {4209, "CONFIG_VIDEO_STREAMING_NOISE_GEN_MODE"}, {4210, "CONFIG_VIDEO_STREAMING_NRF_MODE"}, {4211, "CONFIG_VIDEO_STREAMING_INTERLACED_MODE"}, {4212, "CONFIG_VIDEO_ROTATION_FILTER"}, {4213, "CONFIG_VIDEO_STARVING_MODE"}, {4214, "CONFIG_VIDEO_STARVING_DELAY"}, {4215, "CONFIG_VIDEO_DEBLOCKING_FILTER"}, {4216, "CONFIG_VIDEO_DEINTERLACING_MODE"}, {4217, "CONFIG_VIDEO_DECODER_QUAD_DISCOVERY_MODE"}, {4224, "CONFIG_VIDEO_ENCODER_POWER"}, {4225, "CONFIG_VIDEO_ENCODER_MAX_STREAMS"}, {4226, "CONFIG_VIDEO_ENCODER_MOTD_SUPPORTED"}, {4240, "CONFIG_VIDEO_COMPRESSION_H264_QUALITY"}, {4241, "CONFIG_VIDEO_COMPRESSION_H264_ADV_PROFILE"}, {4242, "CONFIG_VIDEO_COMPRESSION_H264_ADV_QUALITY"}, {4243, "CONFIG_VIDEO_COMPRESSION_H264_ADV_QUARTER_PEL"}, {4244, "CONFIG_VIDEO_COMPRESSION_H264_ADV_DEBLOCKING"}, {4245, "CONFIG_VIDEO_COMPRESSION_H264_ADV_DEBLOCK_LEVEL"}, {4246, "CONFIG_VIDEO_COMPRESSION_H264_ADV_CODING"}, {4247, "CONFIG_VIDEO_COMPRESSION_H264_ADV_MOTION_VECTOR_RANGE"}, {4248, "CONFIG_VIDEO_COMPRESSION_H264_MIN_QP"}, {4249, "CONFIG_VIDEO_COMPRESSION_H264_MAX_QP"}, {4250, "CONFIG_VIDEO_COMPRESSION_H264_RATE_CTRL"}, {4272, "CONFIG_VIDEO_LOW_RESOLUTION_MODE"}, {4273, "CONFIG_VIDEO_INPUT_STATE"}, {4304, "CONFIG_VIDEO_OUTPUT_MODE"}, {4305, "CONFIG_VIDEO_OUTPUT_MODE_SUPPORTED"}, {4306, "CONFIG_VIDEO_OUTPUT_FORMAT"}, {4307, "CONFIG_VIDEO_OUTPUT_FORMAT_SUPPORTED"}, {4314, "CONFIG_VIDEO_RTSP_RESOURCE_PATH"}, {4315, "CONFIG_VIDEO_RESOLUTION_RESOURCE_GROUP"}, {8193, "CONFIG_AUDIO_ATTRIBUTE_PITCH"}, {8194, "CONFIG_AUDIO_ATTRIBUTE_VOLUME"}, {8208, "CONFIG_AUDIO_INPUT_TYPE"}, {8209, "CONFIG_AUDIO_COMPRESSION_DATA_FORMAT"}, {8210, "CONFIG_AUDIO_SAMPLING_RATE"}, {8211, "CONFIG_AUDIO_COMPRESSION_CHANNEL"}, {8212, "CONFIG_AUDIO_COMPRESSION_GAIN"}, {8213, "CONFIG_AUDIO_COMPRESSION_SAMPLE_BITS"}, {8214, "CONFIG_AUDIO_SAMPLING_RATE_SUPPORTED"}, {8225, "CONFIG_AUDIO_INFO_SUPPORTED_DATA_FORMAT"}, {8226, "CONFIG_AUDIO_INFO_INPUT_NUMBER"}, {8227, "CONFIG_AUDIO_INFO_ENCODER_NUMBER"}, {8228, "CONFIG_AUDIO_INFO_SUPPORTED_INPUT_TYPE"}, {8240, "CONFIG_AUDIO_PLAYMODE"}, {8241, "CONFIG_AUDIO_GAIN_IN_DB"}, {8242, "CONFIG_AUDIO_GAIN_IN_DB_POSSIBLE_RANGE"}, {8243, "CONFIG_AUDIO_BIAS_STATE"}, {8244, "CONFIG_AUDIO_BIAS_IN_VOLT"}, {8245, "CONFIG_AUDIO_BIAS_IN_VOLT_POSSIBLE_RANGE"}, {8246, "CONFIG_AUDIO_GAIN_STATE"}, {8257, "CONFIG_AUDIO_STREAMING_STATE_INITIAL"}, {8258, "CONFIG_AUDIO_WEB_MULTICAST_IP_ADDRESS"}, {8259, "CONFIG_AUDIO_WEB_MULTICAST_IP_PORT"}, {8260, "CONFIG_AUDIO_STREAMING_TRANSPORT_PROTOCOL"}, {8261, "CONFIG_AUDIO_DESTINATION_ADD"}, {8262, "CONFIG_AUDIO_DESTINATION_REMOVE"}, {8263, "CONFIG_AUDIO_AUDIO_MODE"}, {8264, "CONFIG_AUDIO_STREAMING_DEFAULT_KEEP_ALIVE_ENABLE"}, {8272, "CONFIG_AUDIO_STREAMING_TARGET_IP_ADDRESS"}, {8273, "CONFIG_AUDIO_STREAMING_TARGET_VSIP_GUID"}, {8410, "CONFIG_AUDIO_RTSP_RESOURCE_PATH"}, {8411, "CONFIG_AUDIO_INPUT_RESOURCE_GROUP"}, {12289, "CONFIG_SERIAL_PORT_BAUD_RATE"}, {12290, "CONFIG_SERIAL_PORT_DATA_BITS"}, {12291, "CONFIG_SERIAL_PORT_PARITY"}, {12292, "CONFIG_SERIAL_PORT_STOP_BITS"}, {12293, "CONFIG_SERIAL_PORT_READ_ONCE"}, {12294, "CONFIG_SERIAL_PORT_WRITE_ONCE"}, {12295, "CONFIG_SERIAL_PORT_READ_INTERCHAR_TIMEOUT"}, {12296, "CONFIG_SERIAL_PORT_READ_TOTAL_TIMEOUT"}, {12297, "CONFIG_SERIAL_PORT_LINE_DRIVER"}, {12305, "CONFIG_SERIAL_HANDSHAKE"}, {12306, "CONFIG_SERIAL_FLOW_SOFTWARE"}, {12307, "CONFIG_SERIAL_FLOW_CTS"}, {12308, "CONFIG_SERIAL_FLOW_DSR"}, {12309, "CONFIG_SERIAL_CONTROL_RTS"}, {12310, "CONFIG_SERIAL_CONTROL_DTR"}, {12311, "CONFIG_SERIAL_CONTROL_SOFTWARE"}, {12321, "CONFIG_SERIAL_STREAMING_STATE_INITIAL"}, {12322, "CONFIG_SERIAL_STREAMING_TRANSPORT_PROTOCOL"}, {12337, "CONFIG_SERIAL_RS422_485_OPERATING_MODE"}, {12338, "CONFIG_SERIAL_STREAMING_TARGET_IP_ADDRESS"}, {12339, "CONFIG_SERIAL_STREAMING_TARGET_IP_ADDRESS2"}, {12340, "CONFIG_SERIAL_STREAMING_TARGET_IP_ADDRESS3"}, {12341, "CONFIG_SERIAL_STREAMING_TARGET_IP_ADDRESS4"}, {12342, "CONFIG_SERIAL_INFO_SUPPORTED_OPER_MODE"}, {16385, "CONFIG_IO_PIN_STATE"}, {20481, "CONFIG_SYSTEM_REBOOTREQUIRED"}, {20482, "CONFIG_SYSTEM_DEVICE_NAME"}, {20483, "CONFIG_SYSTEM_DEVICE_TYPE"}, {20484, "CONFIG_SYSTEM_UTC_DATETIME"}, {20485, "CONFIG_SYSTEM_GMT_OFFSET"}, {20486, "CONFIG_SYSTEM_COUNTRY_CODE"}, {20487, "CONFIG_SYSTEM_COUNTRY_CODE_CAP"}, {20488, "CONFIG_SYSTEM_NTP_RTP_SYNCHRO_PAIR"}, {20489, "CONFIG_SYSTEM_BOARD_TEMPERATURE"}, {20490, "CONFIG_SYSTEM_TIMEZONE"}, {20491, "CONFIG_SYSTEM_TIMEZONE_SUPPORTED_LIST"}, {20497, "CONFIG_SYSTEM_FIRMWARE_VERSION"}, {20498, "CONFIG_SYSTEM_UPTIME"}, {20499, "CONFIG_SYSTEM_IP_FIRMWARE_UPDATE_SUPPORT"}, {20500, "CONFIG_SYSTEM_FTP_FIRMWARE_UPDATE_SUPPORT"}, {20501, "CONFIG_SYSTEM_XML_REPORT_GENERATION"}, {20502, "CONFIG_SYSTEM_GLOBAL_SECURITY_PROFILE"}, {20503, "CONFIG_SYSTEM_TELNET_SESSION"}, {20504, "CONFIG_SYSTEM_IDENTIFY_STATUS"}, {20505, "CONFIG_SYSTEM_AUDIO_HARDWARE"}, {20512, "CONFIG_SYSTEM_FIRMWARE_METHOD_HTTP_SUPPORTED"}, {20529, "CONFIG_SYSTEM_TIME_NTP_SERVER_USAGE"}, {20530, "CONFIG_SYSTEM_TIME_NTP_SERVER_IP_ADDRESS"}, {20531, "CONFIG_SYSTEM_TIME_NTP_SERVER_IP_PORT"}, {20532, "CONFIG_SYSTEM_TIME_NTP_STATUS"}, {20533, "CONFIG_SYSTEM_DST_ENABLED"}, {20545, "CONFIG_SYSTEM_LOCAL_IP_ADDRESS"}, {20546, "CONFIG_SYSTEM_LOCAL_IP_NETMASK"}, {20547, "CONFIG_SYSTEM_GATEWAY"}, {20548, "CONFIG_SYSTEM_DHCP_STATE"}, {20549, "CONFIG_SYSTEM_HOST_NAME"}, {20560, "CONFIG_SYSTEM_VOLATILE_CONNECTIONS"}, {20561, "CONFIG_SYSTEM_MONITOR_SUPPORTED_FEATURES"}, {20562, "CONFIG_SYSTEM_SET_ID"}, {20563, "CONFIG_SYSTEM_HTTP_ACCESS_ENABLE"}, {20564, "CONFIG_SYSTEM_HTTP_ACCESS_SECURED_ENABLE"}, {20565, "CONFIG_SYSTEM_LED_STATE_ENABLE"}, {20566, "CONFIG_SYSTEM_RESET_BUTTON_STATE"}, {20576, "CONFIG_SYSTEM_LICENSING_SUPPORTED"}, {20577, "CONFIG_SYSTEM_LICENSE"}, {20578, "CONFIG_SYSTEM_LATEST_SUPPORTED_LICENSE_VERSION"}, {20579, "CONFIG_SYSTEM_LAST_REMOVAL_CODE"}, {20580, "CONFIG_SYSTEM_LICENSE_STATUS"}, {20581, "CONFIG_SYSTEM_LICENSE_USAGE"}, {20582, "CONFIG_SYSTEM_SERIAL_NUMBER"}, {20583, "CONFIG_SYSTEM_SERIAL_NUMBER_STAMPER"}, {20586, "CONFIG_SYSTEM_PERFORMANCE_OPTIONS_SUPP"}, {20587, "CONFIG_SYSTEM_PERFORMANCE_OPTIONS"}, {20592, "CONFIG_SYSTEM_SNMP_ENABLE"}, {20593, "CONFIG_SYSTEM_SNMP_SYSTEM_CONTACT"}, {20594, "CONFIG_SYSTEM_SNMP_SYSTEM_LOCATION"}, {20595, "CONFIG_SYSTEM_SNMP_RO_COMMUNITY_NAME"}, {20596, "CONFIG_SYSTEM_SNMP_RO_USER_NAME"}, {20597, "CONFIG_SYSTEM_SNMP_RO_USER_AUTH_TYPE"}, {20598, "CONFIG_SYSTEM_SNMP_RO_USER_AUTH_PASSWORD"}, {20599, "CONFIG_SYSTEM_SNMP_RO_USER_PRIVACY_PROTOCOL"}, {20600, "CONFIG_SYSTEM_SNMP_RO_USER_PRIVACY_PASSWORD"}, {20601, "CONFIG_SYSTEM_SNMP_TRAP_PRIMARY_DEST_ADDRESS"}, {20602, "CONFIG_SYSTEM_SNMP_TRAP_BACKUP_DEST_ADDRESS"}, {20608, "CONFIG_SYSTEM_PROPERTY_RTSP_SUPPORT"}, {24577, "CONFIG_IF_FILTER_ALLOW_MCAST_FWD"}, {32769, "CONFIG_WLS_MAC_ASSOCIATIONS_LIST_CLIENT"}, {32770, "CONFIG_WLS_MAC_ASSOCIATIONS_LIST_SLAVE"}, {32771, "CONFIG_WLS_MODE"}, {32772, "CONFIG_WLS_POSSIBLE_MODE"}, {32773, "CONFIG_WLS_BAND"}, {32774, "CONFIG_WLS_POSSIBLE_BAND"}, {32775, "CONFIG_WLS_CHANNEL"}, {32776, "CONFIG_WLS_POSSIBLE_CHANNEL"}, {32777, "CONFIG_WLS_BIT_RATE"}, {32778, "CONFIG_WLS_POSSIBLE_BIT_RATE"}, {32779, "CONFIG_WLS_PASS_KEY"}, {32780, "CONFIG_WLS_ENCRYPTION_TYPE"}, {32781, "CONFIG_WLS_POSSIBLE_ENCRYPTION_TYPE"}, {32782, "CONFIG_WLS_KEY_DISTRIBUTION"}, {32783, "CONFIG_WLS_POSSIBLE_KEY_DISTRIBUTION"}, {32784, "CONFIG_WLS_SSID"}, {32785, "CONFIG_WLS_RSSI"}, {32786, "CONFIG_WLS_ROLE"}, {32787, "CONFIG_WLS_POSSIBLE_ROLE"}, {32788, "CONFIG_WLS_FILTER_WLS_TO_WLS_MCAST"}, {32789, "CONFIG_WLS_CURRENT_TX_BIT_RATE"}, {32790, "CONFIG_WLS_CURRENT_SPCF_MASTER"}, {32791, "CONFIG_WLS_DIST_RANGE"}, {32792, "CONFIG_WLS_POSSIBLE_DIST_RANGE"}, {32793, "CONFIG_WLS_CURRENT_RX_BIT_RATE"}, {32794, "CONFIG_WLS_STARTING_ORDER"}, {32795, "CONFIG_WLS_TRANSMIT_POWER_SCALE"}, {32796, "CONFIG_WLS_OPERATING_MODE"}, {32797, "CONFIG_WLS_ANTENNA_GAIN"}, {32798, "CONFIG_WLS_SENSITIVITY_THRESHOLD"}, {32799, "CONFIG_WLS_LINK_INFO"}, {32800, "CONFIG_WLS_MIN_MARGIN"}, {32801, "CONFIG_WLS_CHANNEL_BW"}, {32802, "CONFIG_WLS_POSSIBLE_CHANNEL_BW"}, {32803, "CONFIG_WLS_WPA_AUTH_TYPE"}, {32804, "CONFIG_WLS_POSSIBLE_WPA_AUTH_TYPES"}, {32805, "CONFIG_WLS_WPA_NEGOTIATION_TIMEOUT"}, {32807, "CONFIG_WLS_WPA_PMK_LIFETIME"}, {32808, "CONFIG_WLS_WPA_EAP_LOGIN"}, {32809, "CONFIG_WLS_WPA_EAP_PASSWORD"}, {32810, "CONFIG_WLS_WPA_CA_CERTIFICATE"}, {32811, "CONFIG_WLS_WPA_UNIT_CERTIFICATE"}, {32812, "CONFIG_WLS_WPA_UNIT_PRIVATE_KEY"}, {32813, "CONFIG_WLS_WPA_PRIVATE_KEY_PASSPHRASE"}, {32814, "CONFIG_WLS_ANTENNA_SELECTION"}, {32815, "CONFIG_WLS_INTERCHANNEL_INTERFERENCE"}, {32816, "CONFIG_WLS_SPCF_MAX_FRAME_PER_BURST"}, {32817, "CONFIG_WLS_SPCF_MAX_POLLING_LATENCY"}, {36865, "CONFIG_CAPABILITY_NAME"}, {36866, "CONFIG_CAPABILITY_INSTANCE"}, {36867, "CONFIG_CAPABILITY_EOD_STATS_SUPPORTED"}, {36868, "CONFIG_CAPABILITY_LICENSABLE"}, {36869, "CONFIG_CAPABILITY_LICENSING_STATUS"}, {36870, "CONFIG_CAPABILITY_ENABLED"}, {40961, "CONFIG_MOTD_UPPER_THRESHOLD"}, {40962, "CONFIG_MOTD_LOWER_THRESHOLD"}, {40963, "CONFIG_MOTD_NB_FRAMES"}, {40964, "CONFIG_MOTD_VECT_LENGTH"}, {40965, "CONFIG_MOTD_LEFT_TO_RIGHT"}, {40966, "CONFIG_MOTD_RIGHT_TO_LEFT"}, {40967, "CONFIG_MOTD_TOP_TO_BOTTOM"}, {40968, "CONFIG_MOTD_BOTTOM_TO_TOP"}, {40969, "CONFIG_MOTD_MASK_STRING"}, {40970, "CONFIG_MOTD_MASK_ENABLED"}, {40971, "CONFIG_MOTD_STATE"}, {40972, "CONFIG_MOTD_INPUT_INDEX"}, {40973, "CONFIG_MOTD_ALARM_STATE"}, {45057, "CONFIG_PREA_MEMSPACE"}, {45058, "CONFIG_PREA_STATE"}, {45059, "CONFIG_PREA_RECORDING_STATE"}, {45060, "CONFIG_PREA_INPUT_INDEX"}, {49153, "CONFIG_PREPOST_CURRENT_STATE"}, {49154, "CONFIG_PREPOST_INITIAL_STATE"}, {49155, "CONFIG_PREPOST_OPERATIONAL_MODE"}, {49156, "CONFIG_PREPOST_CR_IP"}, {49157, "CONFIG_PREPOST_CR_PORT"}, {49158, "CONFIG_PREPOST_CR_USERNAME"}, {49159, "CONFIG_PREPOST_CR_PASSWORD"}, {49160, "CONFIG_PREPOST_CR_CLIP_DIRECTORY"}, {49161, "CONFIG_PREPOST_TRIGGER_IP"}, {49162, "CONFIG_PREPOST_TRIGGER_PORT"}, {49163, "CONFIG_PREPOST_TRIGGER_USERNAME"}, {49164, "CONFIG_PREPOST_TRIGGER_PASSWORD"}, {49165, "CONFIG_PREPOST_TRIGGER_CLIP_DIRECTORY"}, {49166, "CONFIG_PREPOST_PRE_LENGTH"}, {49167, "CONFIG_PREPOST_POST_LENGTH"}, {49168, "CONFIG_PREPOST_FALLING_RISING"}, {49169, "CONFIG_PREPOST_CR_CLIP_LENGTH"}, {53249, "CONFIG_VSIP_PROTOCOL_PORT_NUMBER"}, {53250, "CONFIG_VSIP_PROTOCOL_MULTICAST_IP_ADDRESS"}, {53251, "CONFIG_VSIP_PROTOCOL_DISCOVERY_IP_ADDRESS"}, {53252, "CONFIG_VSIP_TCP_HEARTBEAT_STATE"}, {53253, "CONFIG_VSIP_EVENT_MONITOR_IP_ADDRESS"}, {53254, "CONFIG_VSIP_EVENT_MONITOR_TCP_STATE"}, {53255, "CONFIG_VSIP_EVENT_MAX_REPEAT_COUNT"}, {57345, "CONFIG_OSD_DISPLAY_LOGO"}, {57346, "CONFIG_OSD_TX_DEVICE_NAME"}, {57347, "CONFIG_OSD_EVENT_DESCRIPTION"}, {57348, "CONFIG_OSD_DISPLAY_CUSTOM_ITEM"}, {57349, "CONFIG_OSD_FONT_HEIGHT"}, {57350, "CONFIG_OSD_CUSTOM_MODE"}, {57351, "CONFIG_OSD_SHOW_TRANSMITTER_NAME"}, {57352, "CONFIG_OSD_DECODER_STARVE"}, {57353, "CONFIG_OSD_DISPLAY_OPTION"}, {57354, "CONFIG_OSD_DISPLAY_STARTUP_INFO"}, {57355, "CONFIG_OSD_TRANSPARENCY"}, {57356, "CONFIG_OSD_DISPLAY_CUSTOM_ITEM_SUPPORTED"}, {57357, "CONFIG_OSD_DECODER_STARVE_SUPPORTED"}, {61441, "CONFIG_VIDEO_SENSOR_SOURCE_TYPE"}, {61442, "CONFIG_VIDEO_SENSOR_PRESET"}, {61443, "CONFIG_VIDEO_SENSOR_WHITE_BALANCE_BIAS"}, {61444, "CONFIG_VIDEO_SENSOR_BACKLIGHT_ENABLE"}, {61445, "CONFIG_VIDEO_SENSOR_GAMMA_MODE"}, {61446, "CONFIG_VIDEO_SENSOR_GAMMA_VALUE"}, {61447, "CONFIG_VIDEO_SENSOR_LENS_TYPE"}, {61448, "CONFIG_VIDEO_SENSOR_NORMAL_ZONE_MODE"}, {61449, "CONFIG_VIDEO_SENSOR_BACKLIGHT_ZONE_MODE"}, {61450, "CONFIG_VIDEO_SENSOR_WHITE_BALANCE_BIAS_MIN"}, {61451, "CONFIG_VIDEO_SENSOR_WHITE_BALANCE_BIAS_MAX"}, {61452, "CONFIG_VIDEO_SENSOR_WHITE_BALANCE_BIAS_STEP"}, {61453, "CONFIG_VIDEO_SENSOR_GAMMA_MIN"}, {61454, "CONFIG_VIDEO_SENSOR_GAMMA_MAX"}, {61455, "CONFIG_VIDEO_SENSOR_GAMMA_STEP"}, {61456, "CONFIG_VIDEO_SENSOR_NORMAL_ZONE_CUSTOM_STRING"}, {61457, "CONFIG_VIDEO_SENSOR_BACKLIGHT_ZONE_CUSTOM_STRING"}, {61458, "CONFIG_VIDEO_SENSOR_SAVE_USER_SETTINGS"}, {61459, "CONFIG_VIDEO_SENSOR_VERSION"}, {61460, "CONFIG_VIDEO_SENSOR_GAMMA_POSSIBLE_RANGE"}, {61461, "CONFIG_VIDEO_SENSOR_WHITE_BIAS_POSSIBLE_RANGE"}, {61462, "CONFIG_VIDEO_SENSOR_DAYNIGHT_CONTROL"}, {61463, "CONFIG_VIDEO_SENSOR_DAYNIGHT_COLOR_MODE"}, {61464, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_LIMIT"}, {61465, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_IN_GAIN"}, {61466, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_OUT_GAIN"}, {61467, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_BOOST"}, {61468, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_LIMIT_MIN"}, {61469, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_LIMIT_MAX"}, {61470, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_LIMIT_STEP"}, {61471, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_IN_MIN"}, {61472, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_IN_MAX"}, {61473, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_IN_STEP"}, {61474, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_OUT_MIN"}, {61475, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_OUT_MAX"}, {61476, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_OUT_STEP"}, {61477, "CONFIG_VIDEO_SENSOR_STATUS_DAYNIGHT"}, {61478, "CONFIG_VIDEO_SENSOR_MODULE_TYPE"}, {61479, "CONFIG_VIDEO_SENSOR_FIRMWARE_REVISION"}, {61480, "CONFIG_VIDEO_SENSOR_DYNAMO_REVISION"}, {61481, "CONFIG_VIDEO_SENSOR_DYNAMITE_REVISION"}, {61483, "CONFIG_VIDEO_SENSOR_STATUS_ORIENTATION_ANGLE"}, {61484, "CONFIG_VIDEO_SENSOR_DAYNIGHT_GAIN_LIMIT_POSSIBLE_RANGE"}, {61485, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_IN_POSSIBLE_RANGE"}, {61486, "CONFIG_VIDEO_SENSOR_DAYNIGHT_THRES_OUT_POSSIBLE_RANGE"}, {61487, "CONFIG_VIDEO_SENSOR_LOAD_FACTORY_DEFAULT"}, {61488, "CONFIG_VIDEO_SENSOR_NTSC_50HZ_ENVIRONMENT"}, {61489, "CONFIG_VIDEO_SENSOR_MAX_SLOW_SHUTTER_SPEED_LIMIT"}, {61490, "CONFIG_VIDEO_SENSOR_DAYNIGHT_METER_DELAY"}, {61491, "CONFIG_VIDEO_SENSOR_DAYNIGHT_VALIDATE_DELAY"}, {61504, "CONFIG_VIDEO_SENSOR_C215_PRESET_POS_SELECT"}, {61505, "CONFIG_VIDEO_SENSOR_C215_WHITE_BAL_MODE"}, {61506, "CONFIG_VIDEO_SENSOR_C215_AGC_MODE"}, {61507, "CONFIG_VIDEO_SENSOR_C215_BACKLIGHT_COMP_MODE"}, {61508, "CONFIG_VIDEO_SENSOR_C215_BW_MODE"}, {61509, "CONFIG_VIDEO_SENSOR_C215_ZOOM_POSITION"}, {61510, "CONFIG_VIDEO_SENSOR_C215_FOCUS_POSITION"}, {61511, "CONFIG_VIDEO_SENSOR_C215_FOCUS_FAR"}, {61512, "CONFIG_VIDEO_SENSOR_C215_FOCUS_NEAR"}, {61513, "CONFIG_VIDEO_SENSOR_C215_FOCUS_STOP"}, {61514, "CONFIG_VIDEO_SENSOR_C215_ZOOM_TELE"}, {61515, "CONFIG_VIDEO_SENSOR_C215_ZOOM_WIDE"}, {61516, "CONFIG_VIDEO_SENSOR_C215_ZOOM_STOP"}, {61517, "CONFIG_VIDEO_SENSOR_C215_ALL_STOP"}, {61518, "CONFIG_VIDEO_SENSOR_C215_ENTER_MEMORY"}, {61519, "CONFIG_VIDEO_SENSOR_C215_SAVE_AS_POSITION"}, {61520, "CONFIG_VIDEO_SENSOR_C215_EXTEND_POSITION_CLEAR"}, {61521, "CONFIG_VIDEO_SENSOR_C215_ALL_CLEAR"}, {61522, "CONFIG_VIDEO_SENSOR_C215_MANUAL_WHITE_BALANCE"}, {61523, "CONFIG_VIDEO_SENSOR_C215_SHUTTER_SPEED"}, {0, NULL} }; static value_string_ext EVsipConfigItem_vals_ext = VALUE_STRING_EXT_INIT(EVsipConfigItem_vals); static const value_string EVsipEventType_vals[] = { { 1, "Input Pin State Change"}, { 2, "Analog Video Input State Change"}, { 3, "Motion Detection State Change"}, { 4, "Device Temperature Critical"}, { 5, "Device Temperature Above Normal"}, { 8, "Video Decoder Packet Loss"}, { 9, "Video Decoder State"}, {10, "Fatal Message Logged"}, {12, "Last Event Repeated"}, {16, "Camera Tampering Detection"}, {0, NULL} }; static const value_string EVsipErrorCode_vals[] = { { 0, "VSIP_ERROR_CODE_SUCCESS"}, { 1, "VSIP_ERROR_CODE_FAILURE"}, { 3, "VSIP_ERROR_CODE_UNKNOWNCAPABILITY"}, {4096, "VSIP_ERROR_CODE_ALREADY_EXISTS"}, {4097, "VSIP_ERROR_CODE_DOESNT_EXIST"}, {4098, "VSIP_ERROR_CODE_INVALID_ARGUMENTS"}, {4099, "VSIP_ERROR_CODE_MAXIMUM_REACHED"}, {4100, "VSIP_ERROR_CODE_ALREADY_REMOVED"}, {4101, "VSIP_ERROR_CODE_WRONG_DEVICE"}, {8192, "VSIP_ERROR_CODE_CA_STATUS_BAD_SIGNAL"}, {8193, "VSIP_ERROR_CODE_CA_STATUS_SEARCHING"}, {8194, "VSIP_ERROR_CODE_CA_STATUS_KNOWN_VIEW"}, {8195, "VSIP_ERROR_CODE_CA_STATUS_UNKNOWN_VIEW"}, {8197, "VSIP_ERROR_CODE_CA_DISABLED"}, {8198, "VSIP_ERROR_CODE_CA_NOT_STARTED"}, {8208, "VSIP_ERROR_CODE_VIEW_NAME_ALREADY_EXISTS"}, {8209, "VSIP_ERROR_CODE_CANNOT_DELETE_LAST_VIEW"}, {8210, "VSIP_ERROR_CODE_RULE_NOT_SUPPORTED"}, {8224, "VSIP_ERROR_CODE_XML_INVALID_FORMAT"}, {8226, "VSIP_ERROR_CODE_XML_MISSING_ELEMENT"}, {8227, "VSIP_ERROR_CODE_XML_INVALID_VALUE"}, {12288, "VSIP_ERROR_CODE_FEATURE_NOT_SUPPORTED"}, {0, NULL} }; static value_string_ext EVsipErrorCode_vals_ext = VALUE_STRING_EXT_INIT(EVsipErrorCode_vals); /* Global module variables. */ static int proto_vsip = -1; static int hf_vsip_ValueTypeString_Size = -1; static int hf_vsip_ValueTypeBinary_Size = -1; static int hf_vsip_PingReq_ReplyAddress = -1; static int hf_vsip_PingReq_ReplyPort = -1; static int hf_vsip_PingReq_ConnType = -1; static int hf_vsip_PingResp_SuppConnTypes_VOLATILE = -1; static int hf_vsip_PingResp_SuppConnTypes_RTP = -1; static int hf_vsip_PingResp_SuppConnTypes_SSL = -1; static int hf_vsip_PingResp_SuppConnTypes_UDP_BROADCAST = -1; static int hf_vsip_PingResp_SuppConnTypes_TCP_CLIENT = -1; static int hf_vsip_PingResp_SuppConnTypes_TCP_SERVER = -1; static int hf_vsip_PingResp_SuppConnTypes_UDP_MULTICAST = -1; static int hf_vsip_PingResp_SuppConnTypes_UDP_UNICAST = -1; static int hf_vsip_PingResp_DeviceIP = -1; static int hf_vsip_PingResp_DevicePort = -1; static int hf_vsip_PingResp_SuppConnTypes = -1; static int hf_vsip_ContentTypeSwitchReq_DeviceGUID = -1; static int hf_vsip_PingResp_DeviceGUID = -1; static int hf_vsip_PingResp_VendorID = -1; static int hf_vsip_PingResp_ProductType = -1; static int hf_vsip_PingResp_Status = -1; static int hf_vsip_PingResp_SubtypeLen = -1; static int hf_vsip_PingResp_Subtype = -1; static int hf_vsip_ContentTypeSwitchReq_ApplicationGUID = -1; static int hf_vsip_ContentTypeSwitchReq_ContentType = -1; static int hf_vsip_ContentTypeSwitchResp_DeviceGUID = -1; static int hf_vsip_ContentTypeSwitchResp_SwitchResult = -1; static int hf_vsip_GetCapabilitiesReq_DisabledCapabilities = -1; static int hf_vsip_GetCapabilitiesResp_CapabilityArray_EntityType = -1; static int hf_vsip_GetCapabilitiesResp_CapabilityArray_CapabilityGUID = -1; static int hf_vsip_GetCapabilitiesResp_CapabilityArray_VendorID = -1; static int hf_vsip_GetCapabilitiesResp_CapabilityArray_VersionNumber = -1; static int hf_vsip_GetCapabilitiesResp_CapabilityCount = -1; static int hf_vsip_StartDevice_CapabilityGUID = -1; static int hf_vsip_StartDevice_TargetAddress = -1; static int hf_vsip_StartDevice_TargetPort = -1; static int hf_vsip_StartDevice_LocalPort = -1; static int hf_vsip_StartDevice_ConnectionType = -1; static int hf_vsip_StartDeviceEx_CapabilityGUID = -1; static int hf_vsip_StartDeviceEx_TargetAddress = -1; static int hf_vsip_StartDeviceEx_TargetPort = -1; static int hf_vsip_StartDeviceEx_LocalPort = -1; static int hf_vsip_StartDeviceEx_ConnectionType = -1; static int hf_vsip_StartDeviceEx_TargetGUID = -1; static int hf_vsip_StopDevice_CapabilityGUID = -1; static int hf_vsip_StopDeviceEx_CapabilityGUID = -1; static int hf_vsip_StopDeviceEx_TargetGUID = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_ShortValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_ValueType = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_ConfigItemID = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_IntValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_StringValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_UintValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_GuidValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_FloatValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_BinaryValue = -1; static int hf_vsip_SetConfigReq_CapabilityGUID = -1; static int hf_vsip_SetConfigReq_ConfigItemCount = -1; static int hf_vsip_GetConfigReq_ConfigItemArray_ConfigItemID = -1; static int hf_vsip_GetConfigReq_CapabilityGUID = -1; static int hf_vsip_GetConfigReq_ConfigItemCount = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_ConfigItemID = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_ValueType = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_CharValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_ShortValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_IntValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_StringValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_UintValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_GuidValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_FloatValue = -1; static int hf_vsip_GetConfigResp_ConfigItemArray_Value_BinaryValue = -1; static int hf_vsip_SetConfigReq_ConfigItemArray_Value_CharValue = -1; static int hf_vsip_GetConfigResp_CapabilityGUID = -1; static int hf_vsip_GetConfigResp_ConfigItemCount = -1; static int hf_vsip_SendCommand_CapabilityGUID = -1; static int hf_vsip_SendCommand_CommandCode = -1; static int hf_vsip_SendCommand_Arg1 = -1; static int hf_vsip_SendCommand_Arg2 = -1; static int hf_vsip_SendCommandEx_AddArgsArray_ValueType = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_CharValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_ShortValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_IntValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_StringValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_UintValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_GuidValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_FloatValue = -1; static int hf_vsip_SendCommandEx_AddArgsArray_Value_BinaryValue = -1; static int hf_vsip_SendCommandEx_CapabilityGUID = -1; static int hf_vsip_SendCommandEx_CommandCode = -1; static int hf_vsip_SendCommandEx_Arg1 = -1; static int hf_vsip_SendCommandEx_Arg2 = -1; static int hf_vsip_SendCommandEx_NumAddArgs = -1; static int hf_vsip_EventNotify_CapabilityGUID = -1; static int hf_vsip_EventNotify_EventType = -1; static int hf_vsip_EventNotify_EventArgument = -1; static int hf_vsip_EventSubscribeReq_ReceiverAddress = -1; static int hf_vsip_EventSubscribeReq_ReceiverPort = -1; static int hf_vsip_EventSubscribeReq_ConnectionType = -1; static int hf_vsip_EventSubscribeExReq_ReceiverAddress = -1; static int hf_vsip_EventSubscribeExReq_ReceiverPort = -1; static int hf_vsip_EventSubscribeExReq_ConnectionType = -1; static int hf_vsip_EventSubscribeExReq_DestinationGUID = -1; static int hf_vsip_ErrorResponse_RequestMessageType = -1; static int hf_vsip_ErrorResponse_StatusCode = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_ValueType = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_CharValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_ShortValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_IntValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_StringValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_UintValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_GuidValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_FloatValue = -1; static int hf_vsip_ErrorVAResponse_AddArgsArray_Value_BinaryValue = -1; static int hf_vsip_ErrorVAResponse_NumAddArgs = -1; static int hf_vsip_Version = -1; static int hf_vsip_Type = -1; static int hf_vsip_TransacId = -1; static int hf_vsip_PacketSize = -1; static int ett_vsipValueTypeString = -1; static int ett_vsipValueTypeBinary = -1; static int ett_vsipPingReq = -1; static int ett_vsipPingResp_SuppConnTypes = -1; static int ett_vsipPingResp = -1; static int ett_vsipContentTypeSwitchReq = -1; static int ett_vsipContentTypeSwitchResp = -1; static int ett_vsipGetCapabilitiesReq = -1; static int ett_vsipGetCapabilitiesResp_CapabilityArray = -1; static int ett_vsipGetCapabilitiesResp = -1; static int ett_vsipStartDevice = -1; static int ett_vsipStartDeviceEx = -1; static int ett_vsipStopDevice = -1; static int ett_vsipStopDeviceEx = -1; static int ett_vsipSetConfigReq_ConfigItemArray = -1; static int ett_vsipSetConfigReq = -1; static int ett_vsipGetConfigReq_ConfigItemArray = -1; static int ett_vsipGetConfigReq = -1; static int ett_vsipGetConfigResp_ConfigItemArray = -1; static int ett_vsipGetConfigResp = -1; static int ett_vsipSendCommand = -1; static int ett_vsipSendCommandEx_AddArgsArray = -1; static int ett_vsipSendCommandEx = -1; static int ett_vsipEventNotify = -1; static int ett_vsipEventSubscribeReq = -1; static int ett_vsipEventSubscribeExReq = -1; static int ett_vsipErrorResponse = -1; static int ett_vsipErrorVAResponse_AddArgsArray = -1; static int ett_vsipErrorVAResponse = -1; static int ett_vsip = -1; static guint32 vsip_ValueTypeString(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset, int hf_string) { int soffset = offset; guint16 length; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_vsipValueTypeString, &ti, "ValueTypeString"); length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_vsip_ValueTypeString_Size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (length > 0) { proto_tree_add_item(tree, hf_string, tvb, offset, length, ENC_ASCII|ENC_NA); offset += length; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_ValueTypeBinary(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset, int hf_bin) { int soffset = offset; guint32 length; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_vsipValueTypeBinary, &ti, "Binary"); length = tvb_get_ntohl(tvb, offset); proto_tree_add_item(tree, hf_vsip_ValueTypeBinary_Size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (length > 0) { proto_tree_add_item(tree, hf_bin, tvb, offset, length, ENC_NA); offset += length; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_PingReq(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_vsipPingReq, NULL, "PingReq"); proto_tree_add_item(tree, hf_vsip_PingReq_ReplyAddress, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_PingReq_ReplyPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_PingReq_ConnType, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset - soffset; } static guint32 vsip_PingResp(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 len; proto_item *ti; static int * const supp_conn_types[] = { &hf_vsip_PingResp_SuppConnTypes_VOLATILE, &hf_vsip_PingResp_SuppConnTypes_RTP, &hf_vsip_PingResp_SuppConnTypes_SSL, &hf_vsip_PingResp_SuppConnTypes_UDP_BROADCAST, &hf_vsip_PingResp_SuppConnTypes_TCP_CLIENT, &hf_vsip_PingResp_SuppConnTypes_TCP_SERVER, &hf_vsip_PingResp_SuppConnTypes_UDP_MULTICAST, &hf_vsip_PingResp_SuppConnTypes_UDP_UNICAST, NULL }; tree = proto_tree_add_subtree(tree, tvb, offset, 30, ett_vsipPingResp, &ti, "PingResp"); proto_tree_add_item(tree, hf_vsip_PingResp_DeviceIP, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_PingResp_DevicePort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_bitmask(tree, tvb, offset, hf_vsip_PingResp_SuppConnTypes, ett_vsipPingResp_SuppConnTypes, supp_conn_types, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_vsip_PingResp_DeviceGUID, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_vsip_PingResp_VendorID, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_PingResp_ProductType, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_PingResp_Status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; len = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_vsip_PingResp_SubtypeLen, tvb, offset, 2, len); offset += 2; if (len > 0) { proto_tree_add_item(tree, hf_vsip_PingResp_Subtype, tvb, offset, len, ENC_ASCII); offset += len; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_ContentTypeSwitchReq(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 33, ett_vsipContentTypeSwitchReq, NULL, "ContentTypeSwitchReq"); proto_tree_add_item(tree, hf_vsip_ContentTypeSwitchReq_ApplicationGUID, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_vsip_ContentTypeSwitchReq_ContentType, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_vsip_ContentTypeSwitchReq_DeviceGUID, tvb, offset, 16, ENC_NA); offset += 16; return offset - soffset; } static guint32 vsip_ContentTypeSwitchResp(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 17, ett_vsipContentTypeSwitchResp, NULL, "ContentTypeSwitchResp"); proto_tree_add_item(tree, hf_vsip_ContentTypeSwitchResp_DeviceGUID, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(tree, hf_vsip_ContentTypeSwitchResp_SwitchResult, tvb, offset, 1, ENC_NA); return offset - soffset; } static guint32 vsip_GetCapabilitiesReq(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_vsipGetCapabilitiesReq, NULL, "GetCapabilitiesReq"); proto_tree_add_item(tree, hf_vsip_GetCapabilitiesReq_DisabledCapabilities, tvb, offset, 1, ENC_NA); offset++; return offset - soffset; } static guint32 vsip_GetCapabilitiesResp_CapabilityArray(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 21, ett_vsipGetCapabilitiesResp_CapabilityArray, NULL, "CapabilityArray"); proto_tree_add_item(tree, hf_vsip_GetCapabilitiesResp_CapabilityArray_EntityType, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_vsip_GetCapabilitiesResp_CapabilityArray_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_GetCapabilitiesResp_CapabilityArray_VendorID, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_GetCapabilitiesResp_CapabilityArray_VersionNumber, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset - soffset; } static guint32 vsip_GetCapabilitiesResp(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_vsipGetCapabilitiesResp, &ti, "GetCapabilitiesResp"); count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_vsip_GetCapabilitiesResp_CapabilityCount, tvb, offset, 2, count); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_GetCapabilitiesResp_CapabilityArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_StartDevice(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 25, ett_vsipStartDevice, NULL, "StartDevice"); proto_tree_add_item(tree, hf_vsip_StartDevice_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_StartDevice_TargetAddress, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_StartDevice_TargetPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_StartDevice_LocalPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_StartDevice_ConnectionType, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset - soffset; } static guint32 vsip_StartDeviceEx(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 41, ett_vsipStartDeviceEx, NULL, "StartDeviceEx"); proto_tree_add_item(tree, hf_vsip_StartDeviceEx_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_StartDeviceEx_TargetAddress, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_StartDeviceEx_TargetPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_StartDeviceEx_LocalPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_StartDeviceEx_ConnectionType, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_vsip_StartDeviceEx_TargetGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; return offset - soffset; } static guint32 vsip_StopDevice(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_vsipStopDevice, NULL, "StopDevice"); proto_tree_add_item(tree, hf_vsip_StopDevice_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; return offset - soffset; } static guint32 vsip_StopDeviceEx(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 32, ett_vsipStopDeviceEx, NULL, "StopDeviceEx"); proto_tree_add_item(tree, hf_vsip_StopDeviceEx_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_StopDeviceEx_TargetGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; return offset - soffset; } static guint32 vsip_SetConfigReq_ConfigItemArray(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint8 type; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_vsipSetConfigReq_ConfigItemArray, &ti, "ConfigItemArray"); proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_ConfigItemID, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_ValueType, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; switch(type) { case 1: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_CharValue, tvb, offset, 1, ENC_NA); offset++; break; case 2: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_ShortValue, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 3: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_IntValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 4: offset += vsip_ValueTypeString(tree, pinfo, tvb, offset, hf_vsip_SetConfigReq_ConfigItemArray_Value_StringValue); break; case 5: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_UintValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 6: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_GuidValue, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; break; case 7: proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemArray_Value_FloatValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 8: offset += vsip_ValueTypeBinary(tree, pinfo, tvb, offset, hf_vsip_SetConfigReq_ConfigItemArray_Value_BinaryValue); break; default: break; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_SetConfigReq(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 18, ett_vsipSetConfigReq, &ti, "SetConfigReq"); proto_tree_add_item(tree, hf_vsip_SetConfigReq_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; count = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_vsip_SetConfigReq_ConfigItemCount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_SetConfigReq_ConfigItemArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_GetConfigReq_ConfigItemArray(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_vsipGetConfigReq_ConfigItemArray, NULL, "ConfigItemArray"); proto_tree_add_item(tree, hf_vsip_GetConfigReq_ConfigItemArray_ConfigItemID, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset - soffset; } static guint32 vsip_GetConfigReq(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 18, ett_vsipGetConfigReq, &ti, "GetConfigReq"); proto_tree_add_item(tree, hf_vsip_GetConfigReq_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; count = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_vsip_GetConfigReq_ConfigItemCount, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_GetConfigReq_ConfigItemArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_GetConfigResp_ConfigItemArray(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint8 type; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_vsipGetConfigResp_ConfigItemArray, &ti, "ConfigItemArray"); proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_ConfigItemID, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_ValueType, tvb, offset, 1, ENC_NA); offset++; switch(type) { case 1: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_CharValue, tvb, offset, 1, ENC_NA); offset++; break; case 2: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_ShortValue, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 3: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_IntValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 4: offset += vsip_ValueTypeString(tree, pinfo, tvb, offset, hf_vsip_GetConfigResp_ConfigItemArray_Value_StringValue); break; case 5: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_UintValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 6: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_GuidValue, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; break; case 7: proto_tree_add_item(tree, hf_vsip_GetConfigResp_ConfigItemArray_Value_FloatValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 8: offset += vsip_ValueTypeBinary(tree, pinfo, tvb, offset, hf_vsip_GetConfigResp_ConfigItemArray_Value_BinaryValue); break; default: break; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_GetConfigResp(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 18, ett_vsipGetConfigResp, &ti, "GetConfigResp"); proto_tree_add_item(tree, hf_vsip_GetConfigResp_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_vsip_GetConfigResp_ConfigItemCount, tvb, offset, 2, count); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_GetConfigResp_ConfigItemArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_SendCommand(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 25, ett_vsipSendCommand, &ti, "SendCommand"); proto_tree_add_item(tree, hf_vsip_SendCommand_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_SendCommand_CommandCode, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_vsip_SendCommand_Arg1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_SendCommand_Arg2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset - soffset; } static guint32 vsip_SendCommandEx_AddArgsArray(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint8 type; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_vsipSendCommandEx_AddArgsArray, &ti, "AddArgsArray"); type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_ValueType, tvb, offset, 1, ENC_NA); offset++; switch(type) { case 1: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_CharValue, tvb, offset, 1, ENC_NA); offset++; break; case 2: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_ShortValue, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 3: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_IntValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 4: offset += vsip_ValueTypeString(tree, pinfo, tvb, offset, hf_vsip_SendCommandEx_AddArgsArray_Value_StringValue); break; case 5: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_UintValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 6: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_GuidValue, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; break; case 7: proto_tree_add_item(tree, hf_vsip_SendCommandEx_AddArgsArray_Value_FloatValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 8: offset += vsip_ValueTypeBinary(tree, pinfo, tvb, offset, hf_vsip_SendCommandEx_AddArgsArray_Value_BinaryValue); break; default: break; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_SendCommandEx(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 27, ett_vsipSendCommandEx, &ti, "SendCommandEx"); proto_tree_add_item(tree, hf_vsip_SendCommandEx_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_SendCommandEx_CommandCode, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_vsip_SendCommandEx_Arg1, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_SendCommandEx_Arg2, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_vsip_SendCommandEx_NumAddArgs, tvb, offset, 2, count); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_SendCommandEx_AddArgsArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_EventNotify(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 22, ett_vsipEventNotify, NULL, "EventNotify"); proto_tree_add_item(tree, hf_vsip_EventNotify_CapabilityGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; proto_tree_add_item(tree, hf_vsip_EventNotify_EventType, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_EventNotify_EventArgument, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset - soffset; } static guint32 vsip_EventSubscribeReq(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_vsipEventSubscribeReq, NULL, "EventSubscribeReq"); proto_tree_add_item(tree, hf_vsip_EventSubscribeReq_ReceiverAddress, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_EventSubscribeReq_ReceiverPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_EventSubscribeReq_ConnectionType, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; return offset - soffset; } static guint32 vsip_EventSubscribeExReq(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 23, ett_vsipEventSubscribeExReq, NULL, "EventSubscribeExReq"); proto_tree_add_item(tree, hf_vsip_EventSubscribeExReq_ReceiverAddress, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_vsip_EventSubscribeExReq_ReceiverPort, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_vsip_EventSubscribeExReq_ConnectionType, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_vsip_EventSubscribeExReq_DestinationGUID, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; return offset - soffset; } static guint32 vsip_ErrorResponse(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { int soffset = offset; tree = proto_tree_add_subtree(tree, tvb, offset, 5, ett_vsipErrorResponse, NULL, "ErrorResponse"); proto_tree_add_item(tree, hf_vsip_ErrorResponse_RequestMessageType, tvb, offset, 1, ENC_NA); offset++; proto_tree_add_item(tree, hf_vsip_ErrorResponse_StatusCode, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset - soffset; } static guint32 vsip_ErrorVAResponse_AddArgsArray(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint8 type; proto_item* ti; tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_vsipErrorVAResponse_AddArgsArray, &ti, "AddArgsArray"); type = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_ValueType, tvb, offset, 1, ENC_NA); offset++; switch(type) { case 1: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_CharValue, tvb, offset, 1, ENC_NA); offset++; break; case 2: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_ShortValue, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; break; case 3: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_IntValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 4: offset += vsip_ValueTypeString(tree, pinfo, tvb, offset, hf_vsip_ErrorVAResponse_AddArgsArray_Value_StringValue); break; case 5: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_UintValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 6: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_GuidValue, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16; break; case 7: proto_tree_add_item(tree, hf_vsip_ErrorVAResponse_AddArgsArray_Value_FloatValue, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case 8: offset += vsip_ValueTypeBinary(tree, pinfo, tvb, offset, hf_vsip_ErrorVAResponse_AddArgsArray_Value_BinaryValue); break; default: break; } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_ErrorVAResponse(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset) { int soffset = offset; guint16 count; guint32 i; proto_item *ti; tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_vsipErrorVAResponse, &ti, "ErrorVAResponse"); offset += vsip_ErrorResponse(tree, pinfo, tvb, offset); count = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(tree, hf_vsip_ErrorVAResponse_NumAddArgs, tvb, offset, 2, count); offset += 2; for(i = 0; i < count; ++i) { offset += vsip_ErrorVAResponse_AddArgsArray(tree, pinfo, tvb, offset); } proto_item_set_len(ti, offset - soffset); return offset - soffset; } static guint32 vsip_dissect_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { int soffset = offset; guint32 version; guint8 type; proto_item *ti; proto_tree_add_item_ret_uint(tree, hf_vsip_Version, tvb, offset, 2, ENC_BIG_ENDIAN, &version); offset += 2; type = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_vsip_Type, tvb, offset, 1, type); col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(type, &EVsipMessageType_vals_ext, "Unknown") ); offset++; proto_tree_add_item(tree, hf_vsip_TransacId, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (version == 257) { proto_tree_add_item(tree, hf_vsip_PacketSize, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else if (version == 256) { proto_tree_add_item(tree, hf_vsip_PacketSize, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } switch(type) { case 1: offset += vsip_PingReq(tree, pinfo, tvb, offset); break; case 2: offset += vsip_PingResp(tree, pinfo, tvb, offset); break; case 19: offset += vsip_ContentTypeSwitchReq(tree, pinfo, tvb, offset); break; case 20: offset += vsip_ContentTypeSwitchResp(tree, pinfo, tvb, offset); break; case 3: offset += vsip_GetCapabilitiesReq(tree, pinfo, tvb, offset); break; case 4: offset += vsip_GetCapabilitiesResp(tree, pinfo, tvb, offset); break; case 5: offset += vsip_StartDevice(tree, pinfo, tvb, offset); break; case 21: offset += vsip_StartDeviceEx(tree, pinfo, tvb, offset); break; case 6: offset += vsip_StopDevice(tree, pinfo, tvb, offset); break; case 22: offset += vsip_StopDeviceEx(tree, pinfo, tvb, offset); break; case 7: offset += vsip_SetConfigReq(tree, pinfo, tvb, offset); break; case 8: offset += vsip_GetConfigReq(tree, pinfo, tvb, offset); break; case 9: offset += vsip_GetConfigResp(tree, pinfo, tvb, offset); break; case 10: offset += vsip_SendCommand(tree, pinfo, tvb, offset); break; case 24: offset += vsip_SendCommandEx(tree, pinfo, tvb, offset); break; case 11: offset += vsip_EventNotify(tree, pinfo, tvb, offset); break; case 12: offset += vsip_EventSubscribeReq(tree, pinfo, tvb, offset); break; case 23: offset += vsip_EventSubscribeExReq(tree, pinfo, tvb, offset); break; case 13: offset += vsip_ErrorResponse(tree, pinfo, tvb, offset); break; case 48: offset += vsip_ErrorVAResponse(tree, pinfo, tvb, offset); break; default: break; } ti = proto_tree_get_parent(tree); proto_item_set_len(ti, offset - soffset); return offset - soffset; } static int dissect_vsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; guint16 version; /* Make sure we have a supported version */ version = tvb_get_ntohs(tvb, 0); if ((version != 0x0100) && (version != 0x0101)) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSIP"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vsip, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(ti, ett_vsip); /* call the tsnc generated dissect function. */ return vsip_dissect_pdu(tvb, 0, pinfo, tree); } static void vsip_fmt_revision( gchar *result, guint32 revision ) { snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } void proto_register_vsip(void) { /* Setup protocol subtree array */ static int *ett[] = { &ett_vsipValueTypeString, &ett_vsipValueTypeBinary, &ett_vsipPingReq, &ett_vsipPingResp_SuppConnTypes, &ett_vsipPingResp, &ett_vsipContentTypeSwitchReq, &ett_vsipContentTypeSwitchResp, &ett_vsipGetCapabilitiesReq, &ett_vsipGetCapabilitiesResp_CapabilityArray, &ett_vsipGetCapabilitiesResp, &ett_vsipStartDevice, &ett_vsipStartDeviceEx, &ett_vsipStopDevice, &ett_vsipStopDeviceEx, &ett_vsipSetConfigReq_ConfigItemArray, &ett_vsipSetConfigReq, &ett_vsipGetConfigReq_ConfigItemArray, &ett_vsipGetConfigReq, &ett_vsipGetConfigResp_ConfigItemArray, &ett_vsipGetConfigResp, &ett_vsipSendCommand, &ett_vsipSendCommandEx_AddArgsArray, &ett_vsipSendCommandEx, &ett_vsipEventNotify, &ett_vsipEventSubscribeReq, &ett_vsipEventSubscribeExReq, &ett_vsipErrorResponse, &ett_vsipErrorVAResponse_AddArgsArray, &ett_vsipErrorVAResponse, &ett_vsip }; static hf_register_info hf[] = { { &hf_vsip_ValueTypeBinary_Size, { "Size", "vsip.ValueTypeBinary.Size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ValueTypeString_Size, { "Size", "vsip.ValueTypeString.Size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingReq_ReplyAddress, { "ReplyAddress", "vsip.PingReq.ReplyAddress", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingReq_ReplyPort, { "ReplyPort", "vsip.PingReq.ReplyPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingReq_ConnType, { "ConnType", "vsip.PingReq.ConnType", FT_UINT8, BASE_HEX, VALS(EVsipConnectionType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_DeviceIP, { "DeviceIP", "vsip.PingResp.DeviceIP", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_DevicePort, { "DevicePort", "vsip.PingResp.DevicePort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_DeviceGUID, { "DeviceGUID", "vsip.PingResp.DeviceGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_VendorID, { "VendorID", "vsip.PingResp.VendorID", FT_UINT16, BASE_DEC, VALS(EVsipVendorID_vals), 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_ProductType, { "ProductType", "vsip.PingResp.ProductType", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_Status, { "Status", "vsip.PingResp.Status", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_SubtypeLen, { "SubtypeLen", "vsip.PingResp.SubtypeLen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_Subtype, { "Subtype", "vsip.PingResp.Subtype", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes, { "SuppConnTypes", "vsip.PingResp.SuppConnTypes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_VOLATILE, { "VOLATILE", "vsip.PingResp_SuppConnTypes.VOLATILE", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_RTP, { "RTP", "vsip.PingResp_SuppConnTypes.RTP", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_SSL, { "SSL", "vsip.PingResp_SuppConnTypes.SSL", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_UDP_BROADCAST, { "UDP_BROADCAST", "vsip.PingResp_SuppConnTypes.UDP_BROADCAST", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_TCP_CLIENT, { "TCP_CLIENT", "vsip.PingResp_SuppConnTypes.TCP_CLIENT", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_TCP_SERVER, { "TCP_SERVER", "vsip.PingResp_SuppConnTypes.TCP_SERVER", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_UDP_MULTICAST, { "UDP_MULTICAST", "vsip.PingResp_SuppConnTypes.UDP_MULTICAST", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL } }, { &hf_vsip_PingResp_SuppConnTypes_UDP_UNICAST, { "UDP_UNICAST", "vsip.PingResp_SuppConnTypes.UDP_UNICAST", FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL } }, { &hf_vsip_ContentTypeSwitchReq_ApplicationGUID, { "ApplicationGUID", "vsip.ContentTypeSwitchReq.ApplicationGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ContentTypeSwitchReq_ContentType, { "ContentType", "vsip.ContentTypeSwitchReq.ContentType", FT_UINT8, BASE_DEC, VALS(EVsipContentType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_ContentTypeSwitchReq_DeviceGUID, { "DeviceGUID", "vsip.ContentTypeSwitchReq.DeviceGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ContentTypeSwitchResp_DeviceGUID, { "DeviceGUID", "vsip.ContentTypeSwitchResp.DeviceGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ContentTypeSwitchResp_SwitchResult, { "SwitchResult", "vsip.ContentTypeSwitchResp.SwitchResult", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesReq_DisabledCapabilities, { "DisabledCapabilities", "vsip.GetCapabilitiesReq.DisabledCapabilities", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesResp_CapabilityArray_EntityType, { "EntityType", "vsip.GetCapabilitiesResp_CapabilityArray.EntityType", FT_UINT8, BASE_DEC, VALS(EVsipEntityType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesResp_CapabilityArray_CapabilityGUID, { "CapabilityGUID", "vsip.GetCapabilitiesResp_CapabilityArray.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesResp_CapabilityArray_VendorID, { "VendorID", "vsip.GetCapabilitiesResp_CapabilityArray.VendorID", FT_UINT16, BASE_DEC, VALS(EVsipVendorID_vals), 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesResp_CapabilityArray_VersionNumber, { "VersionNumber", "vsip.GetCapabilitiesResp_CapabilityArray.VersionNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetCapabilitiesResp_CapabilityCount, { "CapabilityCount", "vsip.GetCapabilitiesResp.CapabilityCount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDevice_CapabilityGUID, { "CapabilityGUID", "vsip.StartDevice.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDevice_TargetAddress, { "TargetAddress", "vsip.StartDevice.TargetAddress", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDevice_TargetPort, { "TargetPort", "vsip.StartDevice.TargetPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDevice_LocalPort, { "LocalPort", "vsip.StartDevice.LocalPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDevice_ConnectionType, { "ConnectionType", "vsip.StartDevice.ConnectionType", FT_UINT8, BASE_DEC, VALS(EVsipConnectionType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_CapabilityGUID, { "CapabilityGUID", "vsip.StartDeviceEx.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_TargetAddress, { "TargetAddress", "vsip.StartDeviceEx.TargetAddress", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_TargetPort, { "TargetPort", "vsip.StartDeviceEx.TargetPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_LocalPort, { "LocalPort", "vsip.StartDeviceEx.LocalPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_ConnectionType, { "ConnectionType", "vsip.StartDeviceEx.ConnectionType", FT_UINT8, BASE_DEC, VALS(EVsipConnectionType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_StartDeviceEx_TargetGUID, { "TargetGUID", "vsip.StartDeviceEx.TargetGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StopDevice_CapabilityGUID, { "CapabilityGUID", "vsip.StopDevice.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StopDeviceEx_CapabilityGUID, { "CapabilityGUID", "vsip.StopDeviceEx.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_StopDeviceEx_TargetGUID, { "TargetGUID", "vsip.StopDeviceEx.TargetGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_ConfigItemID, { "ConfigItemID", "vsip.SetConfigReq_ConfigItemArray.ConfigItemID", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &EVsipConfigItem_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_ValueType, { "ValueType", "vsip.SetConfigReq_ConfigItemArray.ValueType", FT_UINT8, BASE_DEC, VALS(EVsipValueType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_CharValue, { "CharValue", "vsip.SetConfigReq_ConfigItemArray.CharValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_ShortValue, { "ShortValue", "vsip.SetConfigReq_ConfigItemArray.ShortValue", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_IntValue, { "IntValue", "vsip.SetConfigReq_ConfigItemArray.IntValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_StringValue, { "StringValue", "vsip.SetConfigReq_ConfigItemArray.StringValue", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_UintValue, { "UintValue", "vsip.SetConfigReq_ConfigItemArray.UintValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_GuidValue, { "GuidValue", "vsip.SetConfigReq_ConfigItemArray.GuidValue", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_FloatValue, { "FloatValue", "vsip.SetConfigReq_ConfigItemArray.FloatValue", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemArray_Value_BinaryValue, { "BinaryValue", "vsip.SetConfigReq_ConfigItemArray.BinaryValue", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_CapabilityGUID, { "CapabilityGUID", "vsip.SetConfigReq.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SetConfigReq_ConfigItemCount, { "ConfigItemCount", "vsip.SetConfigReq.ConfigItemCount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigReq_ConfigItemArray_ConfigItemID, { "ConfigItemID", "vsip.GetConfigReq_ConfigItemArray.ConfigItemID", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &EVsipConfigItem_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigReq_CapabilityGUID, { "CapabilityGUID", "vsip.GetConfigReq.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigReq_ConfigItemCount, { "ConfigItemCount", "vsip.GetConfigReq.ConfigItemCount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_ConfigItemID, { "ConfigItemID", "vsip.GetConfigResp_ConfigItemArray.ConfigItemID", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &EVsipConfigItem_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_ValueType, { "ValueType", "vsip.GetConfigResp_ConfigItemArray.ValueType", FT_UINT8, BASE_DEC, VALS(EVsipValueType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_CharValue, { "CharValue", "vsip.GetConfigResp_ConfigItemArray.CharValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_ShortValue, { "ShortValue", "vsip.GetConfigResp_ConfigItemArray.ShortValue", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_IntValue, { "IntValue", "vsip.GetConfigResp_ConfigItemArray.IntValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_StringValue, { "StringValue", "vsip.GetConfigResp_ConfigItemArray.StringValue", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_UintValue, { "UintValue", "vsip.GetConfigResp_ConfigItemArray.UintValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_GuidValue, { "GuidValue", "vsip.GetConfigResp_ConfigItemArray.GuidValue", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_FloatValue, { "FloatValue", "vsip.GetConfigResp_ConfigItemArray.FloatValue", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemArray_Value_BinaryValue, { "BinaryValue", "vsip.GetConfigResp_ConfigItemArray.BinaryValue", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_CapabilityGUID, { "CapabilityGUID", "vsip.GetConfigResp.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_GetConfigResp_ConfigItemCount, { "ConfigItemCount", "vsip.GetConfigResp.ConfigItemCount", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommand_CapabilityGUID, { "CapabilityGUID", "vsip.SendCommand.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommand_CommandCode, { "CommandCode", "vsip.SendCommand.CommandCode", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &EVsipCommand_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommand_Arg1, { "Arg1", "vsip.SendCommand.Arg1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommand_Arg2, { "Arg2", "vsip.SendCommand.Arg2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_ValueType, { "ValueType", "vsip.SendCommandEx_AddArgsArray.ValueType", FT_UINT8, BASE_DEC, VALS(EVsipValueType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_CharValue, { "CharValue", "vsip.SendCommandEx_AddArgsArray.CharValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_ShortValue, { "ShortValue", "vsip.SendCommandEx_AddArgsArray.ShortValue", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_IntValue, { "IntValue", "vsip.SendCommandEx_AddArgsArray.IntValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_StringValue, { "StringValue", "vsip.SendCommandEx_AddArgsArray.StringValue", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_UintValue, { "UintValue", "vsip.SendCommandEx_AddArgsArray.UintValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_GuidValue, { "GuidValue", "vsip.SendCommandEx_AddArgsArray.GuidValue", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_FloatValue, { "FloatValue", "vsip.SendCommandEx_AddArgsArray.FloatValue", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_AddArgsArray_Value_BinaryValue, { "BinaryValue", "vsip.SendCommandEx_AddArgsArray.BinaryValue", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_CapabilityGUID, { "CapabilityGUID", "vsip.SendCommandEx.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_CommandCode, { "CommandCode", "vsip.SendCommandEx.CommandCode", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &EVsipCommand_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_Arg1, { "Arg1", "vsip.SendCommandEx.Arg1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_Arg2, { "Arg2", "vsip.SendCommandEx.Arg2", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_SendCommandEx_NumAddArgs, { "NumAddArgs", "vsip.SendCommandEx.NumAddArgs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventNotify_CapabilityGUID, { "CapabilityGUID", "vsip.EventNotify.CapabilityGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventNotify_EventType, { "EventType", "vsip.EventNotify.EventType", FT_UINT16, BASE_DEC, VALS(EVsipEventType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_EventNotify_EventArgument, { "EventArgument", "vsip.EventNotify.EventArgument", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeReq_ReceiverAddress, { "ReceiverAddress", "vsip.EventSubscribeReq.ReceiverAddress", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeReq_ReceiverPort, { "ReceiverPort", "vsip.EventSubscribeReq.ReceiverPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeReq_ConnectionType, { "ConnectionType", "vsip.EventSubscribeReq.ConnectionType", FT_UINT8, BASE_DEC, VALS(EVsipConnectionType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeExReq_ReceiverAddress, { "ReceiverAddress", "vsip.EventSubscribeExReq.ReceiverAddress", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeExReq_ReceiverPort, { "ReceiverPort", "vsip.EventSubscribeExReq.ReceiverPort", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeExReq_ConnectionType, { "ConnectionType", "vsip.EventSubscribeExReq.ConnectionType", FT_UINT8, BASE_DEC, VALS(EVsipConnectionType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_EventSubscribeExReq_DestinationGUID, { "DestinationGUID", "vsip.EventSubscribeExReq.DestinationGUID", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorResponse_RequestMessageType, { "RequestMessageType", "vsip.ErrorResponse.RequestMessageType", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &EVsipMessageType_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorResponse_StatusCode, { "StatusCode", "vsip.ErrorResponse.StatusCode", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &EVsipErrorCode_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_ValueType, { "ValueType", "vsip.ErrorVAResponse_AddArgsArray.ValueType", FT_UINT8, BASE_DEC, VALS(EVsipValueType_vals), 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_CharValue, { "CharValue", "vsip.ErrorVAResponse_AddArgsArray.CharValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_ShortValue, { "ShortValue", "vsip.ErrorVAResponse_AddArgsArray.ShortValue", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_IntValue, { "IntValue", "vsip.ErrorVAResponse_AddArgsArray.IntValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_StringValue, { "StringValue", "vsip.ErrorVAResponse_AddArgsArray.StringValue", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_UintValue, { "UintValue", "vsip.ErrorVAResponse_AddArgsArray.UintValue", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_GuidValue, { "GuidValue", "vsip.ErrorVAResponse_AddArgsArray.GuidValue", FT_GUID, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_FloatValue, { "FloatValue", "vsip.ErrorVAResponse_AddArgsArray.FloatValue", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_AddArgsArray_Value_BinaryValue, { "BinaryValue", "vsip.ErrorVAResponse_AddArgsArray.BinaryValue", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_ErrorVAResponse_NumAddArgs, { "NumAddArgs", "vsip.ErrorVAResponse.NumAddArgs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_Version, { "Version", "vsip.Version", FT_UINT16, BASE_CUSTOM, CF_FUNC(vsip_fmt_revision), 0x0, NULL, HFILL } }, { &hf_vsip_Type, { "Type", "vsip.Type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &EVsipMessageType_vals_ext, 0x0, NULL, HFILL } }, { &hf_vsip_TransacId, { "TransacId", "vsip.TransacId", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vsip_PacketSize, { "PacketSize", "vsip.PacketSize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; proto_vsip = proto_register_protocol ( "Video Services over IP", "VSIP", "vsip"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_vsip, hf, array_length(hf)); } void proto_reg_handoff_vsip(void) { dissector_handle_t vsip_handle; vsip_handle = create_dissector_handle(dissect_vsip, proto_vsip); dissector_add_for_decode_as_with_preference("udp.port", vsip_handle); dissector_add_for_decode_as_with_preference("tcp.port", vsip_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vsock.c
/* packet-vsock.c * Routines for AF_VSOCK dissection * Copyright 2016, Gerard Garcia <[email protected]> * * Header definition: * https://github.com/GerardGarcia/linux/blob/vsockmon/include/uapi/linux/vsockmon.h * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * The AF_VSOCK socket allows zero-configuration communication between guests * and hypervisors using the standard socket API. */ #include <config.h> #include <epan/packet.h> #include <wsutil/pint.h> #include <epan/address_types.h> #include <wiretap/wtap.h> void proto_register_vsock(void); void proto_reg_handoff_vsock(void); static int proto_vsock = -1; static int vsock_address_type = -1; static dissector_handle_t vsock_handle; /* Generic header related fields */ static int hf_vsock_src_cid = -1; static int hf_vsock_src_port = -1; static int hf_vsock_dst_cid = -1; static int hf_vsock_dst_port = -1; static int hf_vsock_op = -1; static int hf_vsock_t = -1; static int hf_vsock_t_len = -1; static int hf_vsock_reserved = -1; static int hf_vsock_payload = -1; /* Virtio related fields */ static int hf_virtio_src_cid = -1; static int hf_virtio_dst_cid = -1; static int hf_virtio_src_port = -1; static int hf_virtio_dst_port = -1; static int hf_virtio_len = -1; static int hf_virtio_type = -1; static int hf_virtio_op = -1; static int hf_virtio_flags = -1; static int hf_virtio_buf_alloc = -1; static int hf_virtio_fwd_cnt = -1; static gint ett_vsock = -1; static gint ett_virtio = -1; static const value_string af_vsockmon_op_names[] = { { 0, "Unknown" }, { 1, "Connect" }, { 2, "Disconnect" }, { 3, "Control" }, { 4, "Payload" }, { 0, NULL } }; enum af_vsockmon_t { AF_VSOCK_T_UNKNOWN = 0, AF_VSOCK_T_NO_INFO = 1, AF_VSOCK_T_VIRTIO = 2 }; static const value_string af_vsockmon_t_names[] = { { 0, "Unknown" }, { 1, "No info" }, { 2, "Virtio" }, { 0 , NULL } }; static const value_string virtio_vsock_type_names[] = { { 1, "Stream"}, { 0, NULL } }; static const value_string virtio_vsock_op_names[] = { { 0, "Invalid" }, { 1, "Request" }, { 2, "Response" }, { 3, "Rst" }, { 4, "Shutdown" }, { 5, "RW" }, { 6, "Credit update" }, { 7, "Credit response" }, { 0 , NULL } }; #define VSOCK_MIN_LENGTH 32 static int vsock_addr_to_str(const address* addr, gchar *buf, int buf_len) { const guint8 *addrp = (const guint8 *)addr->data; if(pletoh64(&addrp[0])==2){ (void) g_strlcpy(buf, "host", buf_len); } else { snprintf(buf, buf_len, "%" PRIu64, pletoh64(&addrp[0])); } return (int)(strlen(buf)+1); } static int vsock_addr_str_len(const address* addr _U_) { /* 2^64 unsigned int len */ return 19; } static int dissect_vsock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti, *virtio_ti; proto_tree *vsock_tree, *virtio_tree; guint32 t_len, payload_len, virtio_buf_alloc, op, type, virtio_fwd_cnt, virtio_op, virtio_type; guint16 payload_offset = 0, offset = 0; if (tvb_reported_length(tvb) < VSOCK_MIN_LENGTH) return 0; /* Clear column information before start parsing */ col_clear(pinfo->cinfo, COL_INFO); /* Create top tree */ ti = proto_tree_add_item(tree, proto_vsock, tvb, 0, -1, ENC_NA); vsock_tree = proto_item_add_subtree(ti, ett_vsock); /* Parse generic header part */ proto_tree_add_item(vsock_tree, hf_vsock_src_cid, tvb, offset, 8, ENC_LITTLE_ENDIAN); set_address_tvb(&pinfo->src, vsock_address_type, 8, tvb, offset); offset += 8; proto_tree_add_item(vsock_tree, hf_vsock_dst_cid, tvb, offset, 8, ENC_LITTLE_ENDIAN); set_address_tvb(&pinfo->dst, vsock_address_type, 8, tvb, offset); offset += 8; proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_src_port, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pinfo->srcport); offset += 4; proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_dst_port, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pinfo->destport); offset += 4; proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_op, tvb, offset, 2, ENC_LITTLE_ENDIAN, &op); offset += 2; proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_t, tvb, offset, 2, ENC_LITTLE_ENDIAN, &type); offset += 2; proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_t_len, tvb, offset, 2, ENC_LITTLE_ENDIAN, &t_len); offset += 2; proto_tree_add_item(vsock_tree, hf_vsock_reserved, tvb, offset, 2, ENC_NA); offset += 2; payload_offset = offset + t_len; /* Append summary information to top tree */ proto_item_append_text(ti, ", Op: %s, Transport: %s", val_to_str(op, af_vsockmon_op_names, "Unknown (%d)"), val_to_str(type, af_vsockmon_t_names, "Unknown (%d)")); /* Fill columns */ col_add_fstr(pinfo->cinfo, COL_INFO, "[%s] %s", val_to_str(op, af_vsockmon_op_names, "Unknown (%d)"), val_to_str(type, af_vsockmon_t_names, "Unknown (%d)")); col_set_str(pinfo->cinfo, COL_PROTOCOL, "vSocket"); /* Create subtree if there is transport information */ switch (type) { case AF_VSOCK_T_UNKNOWN: case AF_VSOCK_T_NO_INFO: break; case AF_VSOCK_T_VIRTIO: virtio_tree = proto_tree_add_subtree(vsock_tree, tvb, offset, 44, ett_virtio, &virtio_ti, "Virtio transport header"); proto_tree_add_item(virtio_tree, hf_virtio_src_cid, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(virtio_tree, hf_virtio_dst_cid, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; proto_tree_add_item(virtio_tree, hf_virtio_src_port, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(virtio_tree, hf_virtio_dst_port, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(virtio_tree, hf_virtio_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item_ret_uint(virtio_tree, hf_virtio_type, tvb, offset, 2, ENC_LITTLE_ENDIAN, &virtio_type); offset += 2; proto_tree_add_item_ret_uint(virtio_tree, hf_virtio_op, tvb, offset, 2, ENC_LITTLE_ENDIAN, &virtio_op); offset += 2; proto_tree_add_item(virtio_tree, hf_virtio_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item_ret_uint(virtio_tree, hf_virtio_buf_alloc, tvb, offset, 4, ENC_LITTLE_ENDIAN, &virtio_buf_alloc); offset += 4; proto_tree_add_item_ret_uint(virtio_tree, hf_virtio_fwd_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN, &virtio_fwd_cnt); /*offset += 4;*/ /* Append virtio information */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s, Op: %s, Buf alloc: %u, Fwd cnt: %u", val_to_str(virtio_type, virtio_vsock_type_names, "Unknown (%d)"), val_to_str(virtio_op, virtio_vsock_op_names, "Unknown (%d)"), virtio_buf_alloc, virtio_fwd_cnt); break; } /* Append payload */ payload_len = tvb_reported_length_remaining(tvb, payload_offset); if (payload_len) proto_tree_add_bytes_format(vsock_tree, hf_vsock_payload, tvb, payload_offset, payload_len, NULL, "Payload (%uB)", payload_len); return tvb_reported_length(tvb); } void proto_register_vsock(void) { static hf_register_info hf[] = { { &hf_vsock_src_cid, {"Source cid", "vsock.src_cid", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_dst_cid, {"Destination cid", "vsock.dst_cid", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_src_port, {"Source port", "vsock.src_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_dst_port, {"Destination port", "vsock.dst_port", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_op, {"Operation", "vsock.op", FT_UINT16, BASE_DEC, VALS(af_vsockmon_op_names), 0x0, NULL, HFILL }}, { &hf_vsock_t, {"Transport", "vsock.trans", FT_UINT16, BASE_DEC, VALS(af_vsockmon_t_names), 0x0, NULL, HFILL }}, { &hf_vsock_t_len, {"Transport length", "vsock.trans_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_reserved, {"Reserved", "vsock.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vsock_payload, { "Payload", "vsock.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}}, { &hf_virtio_src_cid, {"Source cid", "vsock.virtio.src_cid", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_dst_cid, {"Destination cid", "vsock.virtio.dst_cid", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_src_port, {"Source port", "vsock.virtio.src_prot", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_dst_port, {"Destination port", "vsock.virtio.dst_prot", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_len, {"Length", "vsock.virtio.len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_type, {"Type", "vsock.virtio.type", FT_UINT16, BASE_DEC, VALS(virtio_vsock_type_names), 0x0, NULL, HFILL }}, { &hf_virtio_op, {"Operation", "vsock.virtio.op", FT_UINT16, BASE_DEC, VALS(virtio_vsock_op_names), 0x0, NULL, HFILL }}, { &hf_virtio_flags, {"Flags", "vsock.virtio.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_buf_alloc, {"Buf alloc", "vsock.virtio.buf_alloc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_virtio_fwd_cnt, {"Fwd cnt", "vsock.virtio.fwd_cnt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_vsock, &ett_virtio }; vsock_address_type = address_type_dissector_register("AT_VSOCK", "vSocket Address", vsock_addr_to_str, vsock_addr_str_len, NULL, NULL, NULL, NULL, NULL); proto_vsock = proto_register_protocol("vSocket", "vsock", "vsock"); proto_register_field_array(proto_vsock, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vsock_handle = register_dissector("vsock", dissect_vsock, proto_vsock); } void proto_reg_handoff_vsock(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_VSOCK, vsock_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vssmonitoring.c
/* packet-vssmonitoring.c * Routines for dissection of VSS Monitoring timestamp and portstamp * * Copyright VSS Monitoring 2011 * * 20111205 - First edition by Sake Blok ([email protected]) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #define VSS_NS_MASK 0x3fffffff #define CLKSRC_SHIFT 30 #define CLKSRC_LOCAL 0 #define CLKSRC_NTP 1 #define CLKSRC_GPS 2 #define CLKSRC_PTP 3 static const value_string clksrc_vals[] = { { CLKSRC_LOCAL, "Not Synced" }, { CLKSRC_NTP, "NTP" }, { CLKSRC_GPS, "GPS" }, { CLKSRC_PTP, "PTP" }, { 0, NULL } }; void proto_register_vssmonitoring(void); void proto_reg_handoff_vssmonitoring(void); static int proto_vssmonitoring = -1; static int hf_vssmonitoring_time = -1; static int hf_vssmonitoring_clksrc = -1; static int hf_vssmonitoring_srcport = -1; static gint ett_vssmonitoring = -1; static gboolean vss_dissect_portstamping_only = FALSE; static gboolean vss_two_byte_portstamps = FALSE; static int dissect_vssmonitoring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_tree *ti = NULL; proto_tree *vssmonitoring_tree = NULL; guint offset = 0; guint trailer_len; guint portstamp_len = (vss_two_byte_portstamps) ? 2 : 1; nstime_t vssmonitoring_time; guint8 vssmonitoring_clksrc = 0; guint32 vssmonitoring_srcport = 0; struct tm *tmp; /* First get the length of the trailer */ trailer_len = tvb_reported_length(tvb); /* The trailer length is a sum (of any combination) of: * timestamp (8 bytes) * port stamp (1 or 2 bytes) * fcs (4 bytes) * * Our caller might pass in the trailer with FCS included, so we check for * a trailer with a length that includes one or more of a time stamp, * a 1-byte or 2-byte port stamp, and optionally an FCS. * * See * * https://web.archive.org/web/20160402091604/http://www.vssmonitoring.com/resources/feature-brief/Port-and-Time-Stamping.pdf * * which speaks of 2-byte port stamps as being for a "future release". * * Iris Packet Broker user manuals when VSS Monitoring was owned by * Tektronix also mentioned only a 1-byte port stamp. * * VSS Monitoring has since been acquired by NetScout. * Products released in 2019: * https://www.netscout.com/sites/default/files/2019-01/PFSPDS_002_EN-1803-nGenius-4200-Series-Packet-Flow-Switch.pdf * https://www.netscout.com/sites/default/files/2019-12/PFSPDS_003_EN-1901%20-%20nGenius%206010%20Packet%20Flow%20Switch.pdf * mention both Port Stamping and VLAN tagging under "traffic port tagging," * and also note separately that up to _256_ ports can be meshed together * across hardware to act as a single device. * * Products released in 2021: * https://www.netscout.com/sites/default/files/2021-07/PFSPDS_021_EN-2102%20-%20nGenius%207000%20Series%20Packet%20Flow%20Switches.pdf * https://www.netscout.com/sites/default/files/2021-07/PFSPDS_022_EN-2102%20-%20nGenius%205000%20Series%20Packet%20Flow%20Switches.pdf * mention only VLAN tagging, and not Port Stamping in the port tagging * feature section. * * VSS Monitoring has apparently never released a product with 2 byte * port stamps, and it seems going forward that port stamping is going * to be deprecrated in favor of VLAN tagging. * * So by default we'll assume port stamps are 1 byte, with 2 bytes * port stamps supported via preference (disabled by default.) * * This means a trailer length must not be more than 14 bytes, * and: * * must not be 3 modulo 4 (as it can't have both a 1-byte * and a 2-byte port stamp); * * can only be either 1 or 2 module 4, depending on the size * of port stamp we accept; * * if it's less than 8 bytes, must not be 0 modulo 4 (as * it must have a 1-byte or 2-byte port stamp, given that * it has no timestamp). */ if ( trailer_len > 12 + portstamp_len ) return 0; if ( (trailer_len & 3) != 0 && (trailer_len & 3) != portstamp_len ) return 0; /* * If we have a time stamp, check it for validity. */ if ( trailer_len >= 8 ) { vssmonitoring_time.secs = tvb_get_ntohl(tvb, offset); vssmonitoring_time.nsecs = tvb_get_ntohl(tvb, offset + 4); vssmonitoring_clksrc = (guint8)(((guint32)vssmonitoring_time.nsecs) >> CLKSRC_SHIFT); vssmonitoring_time.nsecs &= VSS_NS_MASK; /* Probably padding passed to this dissector (e.g., a 802.1Q tagged * packet where the minimum frame length was increased to account * for the tag, see IEEE Std 802.1Q-2014 G.2.3 "Minimum PDU Size") * FIXME: Should be made even stricter. */ if (vssmonitoring_time.secs == 0) return 0; /* The timestamp will be based on the uptime until the TAP is completely * booted, this takes about 60s, but use 1 hour to be sure */ if (vssmonitoring_time.secs > 3600) { /* Check whether the timestamp in the PCAP header and the VSS-Monitoring * differ less than 30 days, otherwise, this might not be a VSS-Monitoring * timestamp */ if ( vssmonitoring_time.secs > pinfo->abs_ts.secs ) { if ( vssmonitoring_time.secs - pinfo->abs_ts.secs > 2592000 ) /* 30 days */ return 0; } else { if ( pinfo->abs_ts.secs - vssmonitoring_time.secs > 2592000 ) /* 30 days */ return 0; } } /* The nanoseconds field should be less than 1000000000 */ if ( vssmonitoring_time.nsecs >= 1000000000 ) return 0; } else if (!vss_dissect_portstamping_only || (trailer_len & 3) == 0) { /* No timestamp, so we need a port stamp and be willing to accept * packets with port stamping but not time stamping. * * Unfortunately, the port stamp can be zero or any other value, so * this means that a one-byte or two-byte all-zero trailer that's just * padding can be misinterpreted as a VSS monitoring trailer, among * other false positives, so we disable that by default. */ return 0; } /* All systems are go, lets dissect the VSS-Monitoring trailer */ if (tree) { ti = proto_tree_add_item(tree, proto_vssmonitoring, tvb, 0, (trailer_len & 0xb), ENC_NA); vssmonitoring_tree = proto_item_add_subtree(ti, ett_vssmonitoring); } /* Do we have a timestamp? */ if ( trailer_len >= 8 ) { if (tree) { proto_tree_add_time(vssmonitoring_tree, hf_vssmonitoring_time, tvb, offset, 8, &vssmonitoring_time); proto_tree_add_uint(vssmonitoring_tree, hf_vssmonitoring_clksrc, tvb, offset + 4, 1, vssmonitoring_clksrc); tmp = localtime(&vssmonitoring_time.secs); if (tmp) proto_item_append_text(ti, ", Timestamp: %02d:%02d:%02d.%09ld", tmp->tm_hour, tmp->tm_min, tmp->tm_sec,(long)vssmonitoring_time.nsecs); else proto_item_append_text(ti, ", Timestamp: <Not representable>"); } offset += 8; } /* Do we have a port stamp? */ if ( (trailer_len & 3) == portstamp_len) { if (tree) { proto_tree_add_item_ret_uint(vssmonitoring_tree, hf_vssmonitoring_srcport, tvb, offset, portstamp_len, ENC_BIG_ENDIAN, &vssmonitoring_srcport); proto_item_append_text(ti, ", Source Port: %d", vssmonitoring_srcport); } offset += portstamp_len; } return offset; } void proto_register_vssmonitoring(void) { static hf_register_info hf[] = { { &hf_vssmonitoring_time, { "Time Stamp", "vssmonitoring.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "VSS Monitoring Time Stamp", HFILL }}, { &hf_vssmonitoring_clksrc, { "Clock Source", "vssmonitoring.clksrc", FT_UINT8, BASE_DEC, VALS(clksrc_vals), 0x0, "VSS Monitoring Clock Source", HFILL }}, { &hf_vssmonitoring_srcport, { "Src Port", "vssmonitoring.srcport", FT_UINT16, BASE_DEC, NULL, 0x0, "VSS Monitoring Source Port", HFILL }} }; static gint *ett[] = { &ett_vssmonitoring }; module_t *vssmonitoring_module; proto_vssmonitoring = proto_register_protocol("VSS Monitoring Ethernet trailer", "VSS Monitoring", "vssmonitoring"); proto_register_field_array(proto_vssmonitoring, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vssmonitoring_module = prefs_register_protocol(proto_vssmonitoring, NULL); prefs_register_obsolete_preference(vssmonitoring_module, "use_heuristics"); prefs_register_bool_preference(vssmonitoring_module, "dissect_portstamping_only", "Dissect trailers with only port stamping", "Whether the VSS Monitoring dissector should attempt to dissect trailers with no timestamp, only port stamping. Note that this can result in a large number of false positives.", &vss_dissect_portstamping_only); prefs_register_bool_preference(vssmonitoring_module, "two_byte_portstamps", "Two byte port stamps", "Whether the VSS Monitoring dissector should assume that the port stamp is two bytes, instead of the standard one byte.", &vss_two_byte_portstamps); } void proto_reg_handoff_vssmonitoring(void) { heur_dissector_add("eth.trailer", dissect_vssmonitoring, "VSS Monitoring ethernet trailer", "vssmonitoring_eth", proto_vssmonitoring, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vtp.c
/* packet-vtp.c * Routines for the disassembly of Cisco's VLAN Trunking Protocol * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/cisco_pid.h> /* * See * * http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml * * for some information on VTP. */ void proto_register_vtp(void); void proto_reg_handoff_vtp(void); static int proto_vtp = -1; static int hf_vtp_version = -1; static int hf_vtp_code = -1; static int hf_vtp_followers = -1; static int hf_vtp_md_len = -1; static int hf_vtp_md = -1; static int hf_vtp_conf_rev_num = -1; static int hf_vtp_upd_id = -1; static int hf_vtp_upd_ts = -1; static int hf_vtp_md5_digest = -1; static int hf_vtp_seq_num = -1; static int hf_vtp_start_value = -1; static int hf_vtp_vlan_info_len = -1; static int hf_vtp_vlan_status = -1; static int hf_vtp_vlan_status_vlan_susp = -1; static int hf_vtp_vlan_type = -1; static int hf_vtp_vlan_name_len = -1; static int hf_vtp_isl_vlan_id = -1; static int hf_vtp_mtu_size = -1; static int hf_vtp_802_10_index = -1; static int hf_vtp_vlan_name = -1; static int hf_vtp_vlan_tlvtype = -1; static int hf_vtp_vlan_tlvlength = -1; static int hf_vtp_pruning_first_vid = -1; static int hf_vtp_pruning_last_vid = -1; static int hf_vtp_pruning_active_vid = -1; static int hf_vtp_vlan_src_route_ring_num = -1; static int hf_vtp_vlan_src_route_bridge_num = -1; static int hf_vtp_vlan_stp_type = -1; static int hf_vtp_vlan_parent_vlan = -1; static int hf_vtp_vlan_translationally_bridged_vlans = -1; static int hf_vtp_vlan_pruning = -1; static int hf_vtp_vlan_bridge_type = -1; static int hf_vtp_vlan_max_are_hop_count = -1; static int hf_vtp_vlan_max_ste_hop_count = -1; static int hf_vtp_vlan_backup_crf_mode = -1; static int hf_vtp_vlan_data = -1; static int hf_vtp_reserved = -1; static gint ett_vtp = -1; static gint ett_vtp_vlan_info = -1; static gint ett_vtp_vlan_status = -1; static gint ett_vtp_tlv = -1; static gint ett_vtp_pruning = -1; static expert_field ei_vtp_vlan_tlvlength_bad = EI_INIT; static int dissect_vlan_info(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree); static void dissect_vlan_info_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree, proto_item *ti, guint8 type); #define SUMMARY_ADVERT 0x01 #define SUBSET_ADVERT 0x02 #define ADVERT_REQUEST 0x03 #define JOIN_MSG 0x04 static const value_string type_vals[] = { { SUMMARY_ADVERT, "Summary Advertisement" }, { SUBSET_ADVERT, "Subset Advertisement" }, { ADVERT_REQUEST, "Advertisement Request" }, { JOIN_MSG, "Join/Prune Message" }, { 0, NULL }, }; static void set_vtp_info_col(tvbuff_t *tvb, packet_info *pinfo) { switch (tvb_get_guint8(tvb, 1)) { case SUMMARY_ADVERT: col_add_fstr(pinfo->cinfo, COL_INFO, "Summary Advertisement, Revision: %u", tvb_get_ntohl(tvb, 36)); if (tvb_get_guint8(tvb, 2) > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Followers: %u", tvb_get_guint8(tvb, 2)); } break; case SUBSET_ADVERT: col_add_fstr(pinfo->cinfo, COL_INFO, "Subset Advertisement, Revision: %u, Seq: %u", tvb_get_ntohl(tvb, 36), tvb_get_guint8(tvb, 2)); break; case ADVERT_REQUEST: col_set_str(pinfo->cinfo, COL_INFO, "Advertisement Request"); break; case JOIN_MSG: col_set_str(pinfo->cinfo, COL_INFO, "Join"); break; default: col_set_str(pinfo->cinfo, COL_INFO, "Unrecognized VTP message"); break; } } static int dissect_vtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *vtp_tree = NULL, *vtp_pruning_tree = NULL; int offset = 0; guint8 code; guint8 *upd_timestamp; int vlan_info_len; int pruning_vlan_id; int yy, mm, dd, hh, _mm, ss; char *display; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VTP"); set_vtp_info_col(tvb, pinfo); ti = proto_tree_add_item(tree, proto_vtp, tvb, offset, -1, ENC_NA); vtp_tree = proto_item_add_subtree(ti, ett_vtp); proto_tree_add_item(vtp_tree, hf_vtp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; code = tvb_get_guint8(tvb, offset); proto_tree_add_item(vtp_tree, hf_vtp_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; switch (code) { case SUMMARY_ADVERT: proto_tree_add_item(vtp_tree, hf_vtp_followers, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md, tvb, offset, 32, ENC_ASCII); offset += 32; proto_tree_add_item(vtp_tree, hf_vtp_conf_rev_num, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(vtp_tree, hf_vtp_upd_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; upd_timestamp = display = tvb_get_string_enc(pinfo->pool, tvb, offset, 12, ENC_ASCII); if (sscanf(upd_timestamp, "%2d%2d%2d%2d%2d%2d", &yy, &mm, &dd, &hh, &_mm, &ss) == 6) { display = wmem_strdup_printf(pinfo->pool, "%02d-%02d-%02d %02d:%02d:%02d", yy, mm, dd, hh, _mm, ss); } proto_tree_add_string_format_value(vtp_tree, hf_vtp_upd_ts, tvb, offset, 12, upd_timestamp, "%s", display); offset += 12; proto_tree_add_item(vtp_tree, hf_vtp_md5_digest, tvb, offset, 16, ENC_NA); break; case SUBSET_ADVERT: proto_tree_add_item(vtp_tree, hf_vtp_seq_num, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md, tvb, offset, 32, ENC_ASCII); offset += 32; proto_tree_add_item(vtp_tree, hf_vtp_conf_rev_num, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; while (tvb_reported_length_remaining(tvb, offset) > 0) { vlan_info_len = dissect_vlan_info(tvb, pinfo, offset, vtp_tree); if (vlan_info_len <= 0) break; offset += vlan_info_len; } break; case ADVERT_REQUEST: proto_tree_add_item(vtp_tree, hf_vtp_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md, tvb, offset, 32, ENC_ASCII); offset += 32; proto_tree_add_item(vtp_tree, hf_vtp_start_value, tvb, offset, 2, ENC_BIG_ENDIAN); break; case JOIN_MSG: proto_tree_add_item(vtp_tree, hf_vtp_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vtp_tree, hf_vtp_md, tvb, offset, 32, ENC_ASCII); offset += 32; proto_tree_add_item(vtp_tree, hf_vtp_pruning_first_vid, tvb, offset, 2, ENC_BIG_ENDIAN); pruning_vlan_id = tvb_get_ntohs(tvb, offset); offset += 2; proto_tree_add_item(vtp_tree, hf_vtp_pruning_last_vid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; vtp_pruning_tree = proto_tree_add_subtree(vtp_tree, tvb, offset, -1, ett_vtp_pruning, NULL, "Advertised active (i.e. not pruned) VLANs"); while (tvb_reported_length_remaining(tvb, offset) > 0) { guint8 vlan_usage_bitmap; int shift; vlan_usage_bitmap = tvb_get_guint8(tvb, offset); for (shift = 0; shift < 8; shift++) { if (vlan_usage_bitmap & (1<<7)) { proto_tree_add_uint(vtp_pruning_tree, hf_vtp_pruning_active_vid, tvb, offset, 1, pruning_vlan_id); } pruning_vlan_id += 1; vlan_usage_bitmap <<= 1; } offset += 1; } break; } return tvb_captured_length(tvb); } #define VLAN_SUSPENDED 0x01 static const value_string vlan_type_vals[] = { { 0x01, "Ethernet" }, { 0x02, "FDDI" }, { 0x03, "TrCRF" }, { 0x04, "FDDI-net" }, { 0x05, "TrBRF" }, { 0, NULL }, }; #define SR_RING_NUM 0x01 #define SR_BRIDGE_NUM 0x02 #define STP_TYPE 0x03 #define PARENT_VLAN 0x04 #define TR_BRIDGED_VLANS 0x05 #define PRUNING 0x06 #define BRIDGE_TYPE 0x07 #define MAX_ARE_HOP_CNT 0x08 #define MAX_STE_HOP_CNT 0x09 #define BACKUP_CRF_MODE 0x0A static const value_string vlan_tlv_type_vals[] = { { SR_RING_NUM, "Source-Routing Ring Number" }, { SR_BRIDGE_NUM, "Source-Routing Bridge Number" }, { STP_TYPE, "Spanning-Tree Protocol Type" }, { PARENT_VLAN, "Parent VLAN" }, { TR_BRIDGED_VLANS, "Translationally Bridged VLANs" }, { PRUNING, "Pruning" }, { BRIDGE_TYPE, "Bridge Type" }, { MAX_ARE_HOP_CNT, "Max ARE Hop Count" }, { MAX_STE_HOP_CNT, "Max STE Hop Count" }, { BACKUP_CRF_MODE, "Backup CRF Mode" }, { 0, NULL }, }; static int dissect_vlan_info(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree) { proto_item *ti; proto_tree *vlan_info_tree; proto_tree *status_tree; guint8 vlan_info_len; int vlan_info_left; guint8 status; guint8 vlan_name_len; guint8 type; int length; proto_tree *tlv_tree; vlan_info_len = tvb_get_guint8(tvb, offset); vlan_info_tree = proto_tree_add_subtree(tree, tvb, offset, vlan_info_len, ett_vtp_vlan_info, NULL, "VLAN Information"); vlan_info_left = vlan_info_len; proto_tree_add_uint(vlan_info_tree, hf_vtp_vlan_info_len, tvb, offset, 1, vlan_info_len); offset += 1; vlan_info_left -= 1; status = tvb_get_guint8(tvb, offset); ti = proto_tree_add_uint(vlan_info_tree, hf_vtp_vlan_status, tvb, offset, 1, status); if (status & VLAN_SUSPENDED) proto_item_append_text(ti, " (VLAN suspended)"); status_tree = proto_item_add_subtree(ti, ett_vtp_vlan_status); proto_tree_add_boolean(status_tree, hf_vtp_vlan_status_vlan_susp, tvb, offset, 1, status); offset += 1; vlan_info_left -= 1; proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; vlan_info_left -= 1; vlan_name_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_name_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; vlan_info_left -= 1; proto_tree_add_item(vlan_info_tree, hf_vtp_isl_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; vlan_info_left -= 2; proto_tree_add_item(vlan_info_tree, hf_vtp_mtu_size, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; vlan_info_left -= 2; proto_tree_add_item(vlan_info_tree, hf_vtp_802_10_index, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; vlan_info_left -= 4; /* VLAN name length appears to be rounded up to a multiple of 4. */ vlan_name_len = 4*((vlan_name_len + 3)/4); proto_tree_add_item(vlan_info_tree, hf_vtp_vlan_name, tvb, offset, vlan_name_len, ENC_ASCII); offset += vlan_name_len; vlan_info_left -= vlan_name_len; while (vlan_info_left > 0) { type = tvb_get_guint8(tvb, offset + 0); length = tvb_get_guint8(tvb, offset + 1); tlv_tree = proto_tree_add_subtree(vlan_info_tree, tvb, offset, 2 + length*2, ett_vtp_tlv, &ti, val_to_str(type, vlan_tlv_type_vals, "Unknown TLV type: 0x%02x")); proto_tree_add_item(tlv_tree, hf_vtp_vlan_tlvtype, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_tree, hf_vtp_vlan_tlvlength, tvb, offset+1, 1, ENC_BIG_ENDIAN); offset += 2; vlan_info_left -= 2; if (length > 0) { dissect_vlan_info_tlv(tvb, pinfo, offset, length*2, tlv_tree, ti, type); } offset += length*2; vlan_info_left -= length*2; } return vlan_info_len; } static const value_string stp_type_vals[] = { { 1, "SRT" }, { 2, "SRB" }, { 3, "Auto" }, { 0, NULL }, }; static const value_string pruning_vals[] = { { 1, "Enabled" }, { 2, "Disabled" }, { 0, NULL }, }; static const value_string bridge_type_vals[] = { { 1, "SRT" }, { 2, "SRB" }, { 0, NULL }, }; static const value_string backup_crf_mode_vals[] = { { 1, "TrCRF is configured as a backup" }, { 2, "TrCRF is not configured as a backup" }, { 0, NULL }, }; static void dissect_vlan_info_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_tree *tree, proto_item *ti, guint8 type) { switch (type) { case SR_RING_NUM: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_src_route_ring_num, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Source-Routing Ring Number: Bad length %u", length); } break; case SR_BRIDGE_NUM: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_src_route_bridge_num, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Source-Routing Bridge Number: Bad length %u", length); } break; case STP_TYPE: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_stp_type, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Spanning-Tree Protocol Type: Bad length %u", length); } break; case PARENT_VLAN: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_parent_vlan, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Parent VLAN: Bad length %u", length); } break; case TR_BRIDGED_VLANS: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_translationally_bridged_vlans, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Translationally Bridged VLANs: Bad length %u", length); } break; case PRUNING: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_pruning, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Pruning: Bad length %u", length); } break; case BRIDGE_TYPE: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_bridge_type, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Bridge Type: Bad length %u", length); } break; case MAX_ARE_HOP_CNT: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_max_are_hop_count, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Max ARE Hop Count: Bad length %u", length); } break; case MAX_STE_HOP_CNT: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_max_ste_hop_count, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Max STE Hop Count: Bad length %u", length); } break; case BACKUP_CRF_MODE: if (length == 2) { proto_tree_add_item(tree, hf_vtp_vlan_backup_crf_mode, tvb, offset, 2, ENC_BIG_ENDIAN); } else { expert_add_info_format(pinfo, ti, &ei_vtp_vlan_tlvlength_bad, "Backup CRF Mode: Bad length %u", length); } break; default: proto_tree_add_item(tree, hf_vtp_vlan_data, tvb, offset, length, ENC_NA); break; } } void proto_register_vtp(void) { static hf_register_info hf[] = { { &hf_vtp_version, { "Version", "vtp.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_code, { "Code", "vtp.code", FT_UINT8, BASE_HEX, VALS(type_vals), 0x0, NULL, HFILL }}, { &hf_vtp_followers, { "Followers", "vtp.followers", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of following Subset-Advert messages", HFILL }}, { &hf_vtp_md_len, { "Management Domain Length", "vtp.md_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of management domain string", HFILL }}, { &hf_vtp_md, { "Management Domain", "vtp.md", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_vtp_conf_rev_num, { "Configuration Revision Number", "vtp.conf_rev_num", FT_UINT32, BASE_DEC, NULL, 0x0, "Revision number of the configuration information", HFILL }}, { &hf_vtp_upd_id, { "Updater Identity", "vtp.upd_id", FT_IPv4, BASE_NONE, NULL, 0x0, "IP address of the updater", HFILL }}, { &hf_vtp_upd_ts, { "Update Timestamp", "vtp.upd_ts", FT_STRING, BASE_NONE, NULL, 0, "Time stamp of the current configuration revision", HFILL }}, { &hf_vtp_md5_digest, { "MD5 Digest", "vtp.md5_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_seq_num, { "Sequence Number", "vtp.seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, "Order of this frame in the sequence of Subset-Advert frames", HFILL }}, { &hf_vtp_start_value, { "Start Value", "vtp.start_value", FT_UINT16, BASE_HEX, NULL, 0x0, "Virtual LAN ID of first VLAN for which information is requested", HFILL }}, { &hf_vtp_vlan_info_len, { "VLAN Information Length", "vtp.vlan_info.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of the VLAN information field", HFILL }}, { &hf_vtp_vlan_status, { "Status", "vtp.vlan_info.status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_status_vlan_susp, { "VLAN suspended", "vtp.vlan_info.status.vlan_susp", FT_BOOLEAN, 8, NULL, VLAN_SUSPENDED, NULL, HFILL }}, { &hf_vtp_vlan_type, { "VLAN Type", "vtp.vlan_info.vlan_type", FT_UINT8, BASE_HEX, VALS(vlan_type_vals), 0x0, "Type of VLAN", HFILL }}, { &hf_vtp_vlan_name_len, { "VLAN Name Length", "vtp.vlan_info.vlan_name_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Length of VLAN name string", HFILL }}, { &hf_vtp_isl_vlan_id, { "ISL VLAN ID", "vtp.vlan_info.isl_vlan_id", FT_UINT16, BASE_HEX, NULL, 0x0, "ID of this VLAN on ISL trunks", HFILL }}, { &hf_vtp_mtu_size, { "MTU Size", "vtp.vlan_info.mtu_size", FT_UINT16, BASE_DEC, NULL, 0x0, "MTU for this VLAN", HFILL }}, { &hf_vtp_802_10_index, { "802.10 Index", "vtp.vlan_info.802_10_index", FT_UINT32, BASE_HEX, NULL, 0x0, "IEEE 802.10 security association identifier for this VLAN", HFILL }}, { &hf_vtp_vlan_name, { "VLAN Name", "vtp.vlan_info.vlan_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_vtp_vlan_tlvtype, { "Type", "vtp.vlan_info.tlv_type", FT_UINT8, BASE_HEX, VALS(vlan_tlv_type_vals), 0x0, NULL, HFILL }}, { &hf_vtp_vlan_tlvlength, { "Length", "vtp.vlan_info.tlv_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_pruning_first_vid, { "First VLAN ID", "vtp.pruning.first", FT_UINT16, BASE_DEC, NULL, 0x0, "First VLAN ID for which pruning information is present", HFILL }}, { &hf_vtp_pruning_last_vid, { "Last VLAN ID", "vtp.pruning.last", FT_UINT16, BASE_DEC, NULL, 0x0, "Last VLAN ID for which pruning information is present", HFILL }}, { &hf_vtp_pruning_active_vid, { "VLAN", "vtp.pruning.active", FT_UINT16, BASE_DEC, NULL, 0x0, "Active advertised VLAN ID", HFILL }}, { &hf_vtp_vlan_src_route_ring_num, { "Source-Routing Ring Number", "vtp.vlan_info.src_route_ring_num", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_src_route_bridge_num, { "Source-Routing Bridge Number", "vtp.vlan_info.src_route_bridge_num", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_stp_type, { "Spanning-Tree Protocol Type", "vtp.vlan_info.stp_type", FT_UINT16, BASE_HEX, VALS(stp_type_vals), 0x0, NULL, HFILL }}, { &hf_vtp_vlan_parent_vlan, { "Parent VLAN", "vtp.vlan_info.parent_vlan", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_translationally_bridged_vlans, { "Translationally Bridged VLANs", "vtp.vlan_info.translationally_bridged_vlans", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_pruning, { "Pruning", "vtp.vlan_info.pruning", FT_UINT16, BASE_HEX, VALS(pruning_vals), 0x0, NULL, HFILL }}, { &hf_vtp_vlan_bridge_type, { "Bridge Type", "vtp.vlan_info.bridge_type", FT_UINT16, BASE_HEX, VALS(bridge_type_vals), 0x0, NULL, HFILL }}, { &hf_vtp_vlan_max_are_hop_count, { "Max ARE Hop Count", "vtp.vlan_info.max_are_hop_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_max_ste_hop_count, { "Max STE Hop Count", "vtp.vlan_info.max_ste_hop_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_vlan_backup_crf_mode, { "Backup CRF Mode", "vtp.vlan_info.backup_crf_mode", FT_UINT16, BASE_HEX, VALS(backup_crf_mode_vals), 0x0, NULL, HFILL }}, { &hf_vtp_vlan_data, { "Data", "vtp.vlan_info.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_vtp_reserved, { "Reserved", "vtp.reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, }; static gint *ett[] = { &ett_vtp, &ett_vtp_vlan_info, &ett_vtp_vlan_status, &ett_vtp_tlv, &ett_vtp_pruning, }; static ei_register_info ei[] = { { &ei_vtp_vlan_tlvlength_bad, { "vtp.vlan_info.tlv_len.bad", PI_PROTOCOL, PI_WARN, "Bad length for TLV length", EXPFILL }}, }; expert_module_t* expert_vtp; proto_vtp = proto_register_protocol("VLAN Trunking Protocol", "VTP", "vtp"); proto_register_field_array(proto_vtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_vtp = expert_register_protocol(proto_vtp); expert_register_field_array(expert_vtp, ei, array_length(ei)); } void proto_reg_handoff_vtp(void) { dissector_handle_t vtp_handle; vtp_handle = create_dissector_handle(dissect_vtp, proto_vtp); dissector_add_uint("llc.cisco_pid", CISCO_PID_VTP, vtp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-vuze-dht.c
/* packet-vuze-dht.c * Routines for Vuze-DHT dissection * Copyright 2011, Xiao Xiangquan <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #define DEFAULT_UDP_PORT 11273 /* Not IANA registered */ void proto_register_vuze_dht(void); /* --- protocol specification: * http://wiki.vuze.com/w/Distributed_hash_table */ /* protocol versions */ enum { PV_DIV_AND_CONT = 6, PV_ANTI_SPOOF = 7, PV_ANTI_SPOOF2 = 8, PV_FIX_ORIGINATOR = 9, PV_NETWORKS = 9, PV_VIVALDI = 10, PV_REMOVE_DIST_ADD_VER = 11, PV_XFER_STATUS = 12, PV_SIZE_ESTIMATE = 13, PV_VENDOR_ID = 14, PV_BLOCK_KEYS = 14, PV_GENERIC_NETPOS = 15, PV_VIVALDI_FINDVALUE = 16, PV_ANON_VALUES = 17, PV_CVS_FIX_OVERLOAD_V1 = 18, PV_CVS_FIX_OVERLOAD_V2 = 19, PV_MORE_STATS = 20, PV_CVS_FIX_OVERLOAD_V3 = 21, PV_MORE_NODE_STATUS = 22, PV_LONGER_LIFE = 23, PV_REPLICATION_CONTROL = 24, PV_RESTRICT_ID_PORTS = 32, PV_RESTRICT_ID_PORTS2 = 33, PV_RESTRICT_ID_PORTS2X = 34, PV_RESTRICT_ID_PORTS2Y = 35, PV_RESTRICT_ID_PORTS2Z = 36, PV_RESTRICT_ID3 = 50, PV_VIVALDI_OPTIONAL = 51, PV_PACKET_FLAGS = 51, PV_ALT_CONTACTS = 52, PV_PACKET_FLAGS2 = 53 }; /* Type Length */ enum { TL_BYTE = 1, TL_BOOL = 1, TL_SHORT = 2, TL_INT = 4, TL_IPv4 = 4, TL_FLOAT = 4, TL_LONG = 8, TL_IPv6 = 16 }; /* Bool type */ enum { BT_FALSE = 0x0, BT_TRUE = 0x1 }; static const value_string vuze_dht_bool_type_vals[] = { { BT_FALSE, "False" }, { BT_TRUE, "True" }, { 0, NULL } }; /* action type */ enum { AT_PING_REQUEST = 1024, AT_PING_REPLY = 1025, AT_STORE_REQUEST = 1026, AT_STORE_REPLY = 1027, AT_FIND_NODE_REQUEST = 1028, AT_FIND_NODE_REPLY = 1029, AT_FIND_VALUE_REQUEST = 1030, AT_FIND_VALUE_REPLY = 1031, AT_ERROR_REPLY = 1032, AT_KEY_BLOCK_REQUEST = 1036, AT_KEY_BLOCK_REPLY = 1037 }; static const value_string vuze_dht_action_type_vals[] = { { AT_PING_REQUEST, "PING request" }, { AT_PING_REPLY, "PING reply" }, { AT_STORE_REQUEST, "STORE request" }, { AT_STORE_REPLY, "STORE reply" }, { AT_FIND_NODE_REQUEST, "FIND_NODE request" }, { AT_FIND_NODE_REPLY, "FIND_NODE reply" }, { AT_FIND_VALUE_REQUEST, "FIND_VALUE request" }, { AT_FIND_VALUE_REPLY, "FIND_VALUE reply" }, { AT_ERROR_REPLY, "ERROR reply" }, { AT_KEY_BLOCK_REQUEST, "kEY_BLOCK request" }, { AT_KEY_BLOCK_REPLY, "KEY_BLOCK reply" }, { 0, NULL } }; /* Contact type, must be 1(UDP) */ enum { CONTACT_UDP = 1 }; static const value_string vuze_dht_contact_type_vals[] = { { CONTACT_UDP, "UDP" }, { 0, NULL } }; /* Node type */ enum { NT_BOOTSTRAP_NODE = 0x0, NT_ORDINARY_NODE = 0x1, NT_UNKNOWN_NODE = -1 }; static const value_string vuze_dht_node_type_vals[] = { { NT_BOOTSTRAP_NODE, "Bootstrap node" }, { NT_ORDINARY_NODE, "Ordinary node" }, { NT_UNKNOWN_NODE, "Unknown node" }, { 0, NULL } }; /* flag type */ enum { FT_SINGLE_VALUE = 0x00, FT_DOWNLOADING = 0x01, FT_SEEDING = 0x02, FT_MULTI_VALUE = 0x04, FT_STATS = 0x08, FLAG_ANON = 0x10, FLAG_PRECIOUS = 0x20 }; static const value_string vuze_dht_flag_type_vals[] = { { FT_SINGLE_VALUE, "Single value" }, { FT_DOWNLOADING, "Downloading" }, { FT_SEEDING, "Seeding" }, { FT_MULTI_VALUE, "Multi value" }, { FT_STATS, "Stats" }, { FLAG_ANON, "Anon" }, { FLAG_PRECIOUS, "Precious" }, { 0, NULL } }; /* generic flag type */ enum { GF_NONE = 0x00, GF_DHT_SLEEPING = 0x01 }; static const value_string vuze_dht_generic_flag_type_vals[] = { { GF_NONE, "None"}, { GF_DHT_SLEEPING, "DHT sleeping" }, {0, NULL} }; /* error type */ enum { ET_WRONG_ADDRESS = 1, ET_KEY_BLOCKED = 2 }; static const value_string vuze_dht_error_type_vals[] = { { ET_WRONG_ADDRESS, "Originator's address stored in the request is incorrect" }, { ET_KEY_BLOCKED, "The requested key has been blocked" }, { 0, NULL } }; /* network coordinate type */ enum { NC_VIVALDI = 1 }; static const value_string vuze_dht_network_coordinate_type_vals[] = { { NC_VIVALDI, "Vivaldi" }, { 0, NULL } }; static int proto_vuze_dht = -1; /* --- fields ---*/ /* address appears in contacts, request header, reply error */ static int hf_vuze_dht_address = -1; static int hf_vuze_dht_address_len = -1; static int hf_vuze_dht_address_v4 = -1; static int hf_vuze_dht_address_v6 = -1; static int hf_vuze_dht_address_port = -1; /* contact appears in values, reply find_node, reply find_value */ static int hf_vuze_dht_contact = -1; static int hf_vuze_dht_contact_type = -1; static int hf_vuze_dht_proto_ver = -1; /* value appears in reply find_value */ static int hf_vuze_dht_value = -1; static int hf_vuze_dht_value_ver = -1; static int hf_vuze_dht_value_created = -1; static int hf_vuze_dht_value_bytes_count = -1; static int hf_vuze_dht_value_bytes = -1; static int hf_vuze_dht_value_flags = -1; static int hf_vuze_dht_value_life_hours = -1; static int hf_vuze_dht_value_replication_factor = -1; /* firstly appear in request header */ static int hf_vuze_dht_connection_id = -1; static int hf_vuze_dht_action = -1; static int hf_vuze_dht_transaction_id = -1; static int hf_vuze_dht_vendor_id = -1; static int hf_vuze_dht_network_id = -1; static int hf_vuze_dht_local_proto_ver = -1; static int hf_vuze_dht_instance_id = -1; static int hf_vuze_dht_time = -1; static int hf_vuze_dht_generic_flags = -1; static int hf_vuze_dht_generic_flags2 = -1; /* firstly appear in reply ping */ static int hf_vuze_dht_network_coordinates_count = -1; static int hf_vuze_dht_network_coordinates = -1; static int hf_vuze_dht_network_coordinate = -1; static int hf_vuze_dht_network_coordinate_type = -1; static int hf_vuze_dht_network_coordinate_size = -1; static int hf_vuze_dht_network_coordinate_data = -1; static int hf_vuze_dht_network_coordinate_x = -1; static int hf_vuze_dht_network_coordinate_y = -1; static int hf_vuze_dht_network_coordinate_height = -1; static int hf_vuze_dht_network_coordinate_error = -1; /* firstly appear in request store */ static int hf_vuze_dht_spoof_id = -1; static int hf_vuze_dht_keys_count = -1; static int hf_vuze_dht_keys = -1; static int hf_vuze_dht_key = -1; static int hf_vuze_dht_key_len = -1; static int hf_vuze_dht_key_data = -1; static int hf_vuze_dht_value_group = -1; static int hf_vuze_dht_value_groups = -1; static int hf_vuze_dht_value_groups_count = -1; static int hf_vuze_dht_values_count = -1; /* firstly appear in reply store */ static int hf_vuze_dht_diversifications_len = -1; static int hf_vuze_dht_diversifications = -1; /* firstly appear in request find_node */ static int hf_vuze_dht_id_len = -1; static int hf_vuze_dht_id = -1; static int hf_vuze_dht_node_status = -1; static int hf_vuze_dht_size = -1; /* firstly appear in reply find_node */ static int hf_vuze_dht_node_type = -1; static int hf_vuze_dht_contacts_count = -1; static int hf_vuze_dht_contacts = -1; /* firstly appear in request find_value */ static int hf_vuze_dht_flags = -1; static int hf_vuze_dht_values_num = -1; static int hf_vuze_dht_values_total = -1; static int hf_vuze_dht_reads_per_min = -1; static int hf_vuze_dht_diversification_type = -1; static int hf_vuze_dht_max_values = -1; /* firstly appear in reply find_value */ static int hf_vuze_dht_has_continuation = -1; static int hf_vuze_dht_has_values = -1; /* firstly appear in reply error */ static int hf_vuze_dht_error_type = -1; static int hf_vuze_dht_key_block_request_len = -1; static int hf_vuze_dht_key_block_request = -1; static int hf_vuze_dht_signature_len = -1; static int hf_vuze_dht_signature = -1; /* trees */ static gint ett_vuze_dht = -1; static gint ett_vuze_dht_address = -1; static gint ett_vuze_dht_contacts = -1; static gint ett_vuze_dht_contact = -1; static gint ett_vuze_dht_keys = -1; static gint ett_vuze_dht_key = -1; static gint ett_vuze_dht_value_groups = -1; static gint ett_vuze_dht_value_group = -1; static gint ett_vuze_dht_value = -1; static gint ett_vuze_dht_network_coordinates = -1; static gint ett_vuze_dht_network_coordinate = -1; static dissector_handle_t vuze_dht_handle; void proto_reg_handoff_vuze_dht(void); /* --- Address format -------------- byte: indicates length of the IP address (4 for IPv4, 16 for IPv6) 4 or 16 bytes: the address in network byte order short: port number */ static int dissect_vuze_dht_address(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset, const char* addr_name) { guint8 ip_length; proto_tree *sub_tree; proto_item *ti; address addr; ip_length = tvb_get_guint8(tvb,offset); /* the decoded length is ip length+3, see the format above */ ti = proto_tree_add_none_format(tree, hf_vuze_dht_address, tvb, offset, ip_length+3, "%s: ", addr_name ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_address); proto_tree_add_item(sub_tree, hf_vuze_dht_address_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; switch(ip_length) { case TL_IPv4: proto_tree_add_item(sub_tree, hf_vuze_dht_address_v4, tvb, offset, ip_length, ENC_BIG_ENDIAN); set_address_tvb( &addr, AT_IPv4, ip_length, tvb, offset); break; case TL_IPv6: proto_tree_add_item(sub_tree, hf_vuze_dht_address_v6, tvb, offset, ip_length, ENC_NA); set_address_tvb( &addr, AT_IPv6, ip_length, tvb, offset); break; default: clear_address(&addr); break; } offset += ip_length; proto_tree_add_item(sub_tree, hf_vuze_dht_address_port, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); proto_item_append_text( ti, "%s:%d", address_to_str(pinfo->pool, &addr ), tvb_get_ntohs(tvb,offset) ); offset += TL_SHORT; return offset; } /* --- Contact format -------------- byte: indicates contact type, which must be UDP(1) byte: the contact's protocol version 7 or 19 bytes: Address */ static int dissect_vuze_dht_contact(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { proto_item *ti; proto_tree *sub_tree; /* the decoded length is ip length+5, see the format above */ ti = proto_tree_add_none_format( tree, hf_vuze_dht_contact, tvb, offset, tvb_get_guint8(tvb,offset+2)+5, "%s contact, version %d", val_to_str_const( tvb_get_guint8(tvb, offset), vuze_dht_contact_type_vals, "Unknown"), tvb_get_guint8(tvb, offset+1) ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_contact); proto_tree_add_item(sub_tree, hf_vuze_dht_contact_type, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; proto_tree_add_item(sub_tree, hf_vuze_dht_proto_ver, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; offset = dissect_vuze_dht_address( tvb, pinfo, sub_tree, offset, "Contact Address" ); return offset; } /* --- Contact List --- */ static int dissect_vuze_dht_contacts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int contacts_count) { proto_item *ti; proto_tree *sub_tree; int i; ti = proto_tree_add_none_format( tree, hf_vuze_dht_contacts, tvb, offset, 0, "%d contacts", contacts_count ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_contacts); for( i=0; i<contacts_count; i++ ) offset = dissect_vuze_dht_contact( tvb, pinfo, sub_tree, offset ); return offset; } /* --- Key format Name | Type LENGTH byte KEY byte[LENGTH] --- */ static int dissect_vuze_dht_key(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset) { proto_item *ti; proto_tree *sub_tree; guint key_len; key_len = tvb_get_guint8( tvb, offset ); ti = proto_tree_add_item( tree, hf_vuze_dht_key, tvb, offset, key_len+1, ENC_NA ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_key); proto_tree_add_item( sub_tree, hf_vuze_dht_key_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN ); offset += TL_BYTE; proto_tree_add_item( sub_tree, hf_vuze_dht_key_data, tvb, offset, key_len, ENC_NA ); proto_item_append_text( ti, ": %d bytes ( %s )", key_len, tvb_bytes_to_str(pinfo->pool, tvb, offset, key_len ) ); offset += key_len; return offset; } /* --- Keys List --- */ static int dissect_vuze_dht_keys(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int keys_count) { proto_item *ti; proto_tree *sub_tree; int i; ti = proto_tree_add_none_format( tree, hf_vuze_dht_keys, tvb, offset, 0, "%d keys", keys_count ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_keys); for( i=0; i<keys_count; i++ ) offset = dissect_vuze_dht_key( tvb, pinfo, sub_tree, offset ); return offset; } /* --- Value format -------------- Name | Type | Protocol version | Note VERSION byte >=REMOVE_DIST_ADD_VER Version of the value. (details later) CREATED long always Creation time. Units unknown; probably milliseconds since the epoch. VALUE_BYTES_COUNT short always Number of bytes in the value. VALUE_BYTES bytes always The bytes of the value. ORIGINATOR contact always presumably the node that created the value. FLAGS byte always LIFE_HOURS byte >=LONGER_LIFE Hours for the value to live. (Details of how it's handled) REPLICATION_FACTOR byte >=REPLICATION_CONTROL Per-value # of replicas to maintain. If STATS are used in request, then some stats for the value are returned instead of value itself. They are serialised as follows: 0 (byte) - version, number of stored values for the key (int), total size of stored values (int), reads per minute (int), diversification type (byte). */ static int dissect_vuze_dht_value(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset, int ver ) { proto_item *ti; proto_tree *sub_tree; int value_ver = -1; ti = proto_tree_add_item( tree, hf_vuze_dht_value, tvb, offset, 0, ENC_NA ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_value); if( ver >= PV_REMOVE_DIST_ADD_VER ) { proto_tree_add_item(sub_tree, hf_vuze_dht_value_ver, tvb, offset, TL_INT, ENC_BIG_ENDIAN); value_ver = tvb_get_ntohl( tvb, offset ); offset += TL_INT; } /* It's a return for STATS */ if( value_ver==0 ) { proto_item_append_text( ti, " (reply to STATS): %d values for the key, out of %d in total...", tvb_get_ntohl(tvb, offset), tvb_get_ntohl(tvb, offset+TL_INT) ); proto_tree_add_item(tree, hf_vuze_dht_values_num, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_values_total, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_reads_per_min, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_diversification_type, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } /* regular value */ else { int value_bytes_count; proto_tree_add_item(sub_tree, hf_vuze_dht_value_created, tvb, offset, TL_LONG, ENC_BIG_ENDIAN); offset += TL_LONG; proto_tree_add_item(sub_tree, hf_vuze_dht_value_bytes_count, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); value_bytes_count = tvb_get_ntohs(tvb, offset); offset += TL_SHORT; proto_tree_add_item(sub_tree, hf_vuze_dht_value_bytes, tvb, offset, value_bytes_count, ENC_NA); proto_item_append_text( ti, ": %d bytes ( %s )", value_bytes_count, tvb_bytes_to_str(pinfo->pool, tvb, offset, value_bytes_count ) ); offset += value_bytes_count; offset = dissect_vuze_dht_contact( tvb, pinfo, sub_tree, offset ); proto_tree_add_item(sub_tree, hf_vuze_dht_value_flags, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; proto_tree_add_item(sub_tree, hf_vuze_dht_value_life_hours, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; proto_tree_add_item(sub_tree, hf_vuze_dht_value_replication_factor, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } return offset; } /* --- Values format values_count short values value[values_count] --- */ static int dissect_vuze_dht_value_group(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver) { proto_item *ti; proto_tree *sub_tree; int values_count; int i; values_count = tvb_get_ntohs( tvb, offset ); ti = proto_tree_add_none_format( tree, hf_vuze_dht_value_group, tvb, offset, 0, "%d values", values_count ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_value_group); proto_tree_add_item( sub_tree, hf_vuze_dht_values_count, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN ); offset += TL_SHORT; for( i=0; i<values_count; i++ ) offset = dissect_vuze_dht_value( tvb, pinfo, sub_tree, offset, ver ); return offset; } /* --- Values Groups format value_group[value_groups_count] --- */ static int dissect_vuze_dht_value_groups(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int value_groups_count, int ver) { proto_item *ti; proto_tree *sub_tree; int i; ti = proto_tree_add_none_format( tree, hf_vuze_dht_value_groups, tvb, offset, 0, "%d value groups", value_groups_count ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_value_groups); for( i=0; i<value_groups_count; i++ ) offset = dissect_vuze_dht_value_group( tvb, pinfo, sub_tree, offset, ver ); return offset; } /* --- Network Coordinates format ------ Name | Type TYPE byte SIZE byte Network Coordinates byte[SIZE] */ static int dissect_vuze_dht_network_coordinate(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset) { proto_item *ti; proto_tree *sub_tree; guint coordinate_size; guint coordinate_type; coordinate_type = tvb_get_guint8( tvb, offset ); coordinate_size = tvb_get_guint8( tvb, offset+1 ); ti = proto_tree_add_item( tree, hf_vuze_dht_network_coordinate, tvb, offset, coordinate_size+2, ENC_NA ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_network_coordinate); proto_item_append_text( ti, ": type %d, length %d", tvb_get_guint8(tvb,offset), tvb_get_guint8(tvb,offset+TL_BYTE) ); if (coordinate_type == NC_VIVALDI) { proto_item_append_text( ti, " ( %.2f, %.2f, %.2f, %.2f )", tvb_get_ntohieee_float(tvb, offset+TL_BYTE+TL_BYTE), tvb_get_ntohieee_float(tvb, offset+TL_BYTE+TL_BYTE+TL_FLOAT), tvb_get_ntohieee_float(tvb, offset+TL_BYTE+TL_BYTE+TL_FLOAT+TL_FLOAT), tvb_get_ntohieee_float(tvb, offset+TL_BYTE+TL_BYTE+TL_FLOAT+TL_FLOAT+TL_FLOAT) ); } else { proto_item_append_text( ti, " ( %s )", tvb_bytes_to_str(pinfo->pool, tvb, offset+TL_BYTE+TL_BYTE, coordinate_size ) ); } proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_type, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN ); offset += TL_BYTE; proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_size, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN ); offset += TL_BYTE; if (coordinate_type == NC_VIVALDI) { proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_x, tvb, offset, TL_FLOAT, ENC_BIG_ENDIAN ); offset += TL_FLOAT; proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_y, tvb, offset, TL_FLOAT, ENC_BIG_ENDIAN ); offset += TL_FLOAT; proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_height, tvb, offset, TL_FLOAT, ENC_BIG_ENDIAN ); offset += TL_FLOAT; proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_error, tvb, offset, TL_FLOAT, ENC_BIG_ENDIAN ); offset += TL_FLOAT; } else { proto_tree_add_item( sub_tree, hf_vuze_dht_network_coordinate_data, tvb, offset, coordinate_size, ENC_NA ); offset += coordinate_size; } return offset; } /* --- Network Coordinates List --- Name | Type | Protocol version Network Coordinates Count byte >=PV_GENERIC_NETPOS Network Coordinates Network Coordinate >=PV_GENERIC_NETPOS */ static int dissect_vuze_dht_network_coordinates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver) { proto_item *ti; proto_tree *sub_tree; guint i; guint network_coordinates_count; if( ver >= PV_GENERIC_NETPOS ) { proto_tree_add_item(tree, hf_vuze_dht_network_coordinates_count, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); network_coordinates_count = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; ti = proto_tree_add_none_format( tree, hf_vuze_dht_network_coordinates, tvb, offset, 0, "%d network coordinates", network_coordinates_count ); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht_network_coordinates); for( i=0; i<network_coordinates_count; i++ ) offset = dissect_vuze_dht_network_coordinate( tvb, pinfo, sub_tree, offset ); } return offset; } /* --- Request Header format -------------- Name | Type | Protocol version | Note CONNECTION_ID long always random number with most significant bit set to 1 ACTION int always type of the packet TRANSACTION_ID int always unique number used through the communication; it is randomly generated at the start of the application and increased by 1 with each sent packet PROTOCOL_VERSION byte always version of protocol used in this packet VENDOR_ID byte >=VENDOR_ID ID of the DHT implementator; 0 = Azureus, 1 = ShareNet, 255 = unknown NETWORK_ID int >=NETWORKS ID of the network; 0 = stable version; 1 = CVS version LOCAL_PROTOCOL_VERSION byte >=FIX_ORIGINATOR maximum protocol version this node supports; if this packet's protocol version is <FIX_ORIGINATOR then the value is stored at the end of the packet NODE_ADDRESS address always address of the local node INSTANCE_ID int always application's helper number; randomly generated at the start TIME long always time of the local node; stored as number of milliseconds since Epoch FLAG byte >=PACKET_FLAGS FLAG2 byte >=PACKET_FLAGS2 */ static int dissect_vuze_dht_request_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int *action, int *ver ) { proto_tree_add_item(tree, hf_vuze_dht_connection_id, tvb, offset, TL_LONG, ENC_BIG_ENDIAN); offset += TL_LONG; proto_tree_add_item(tree, hf_vuze_dht_action, tvb, offset, TL_INT, ENC_BIG_ENDIAN); *action = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str_const( *action, vuze_dht_action_type_vals, "Unknown") ); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_transaction_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_proto_ver, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); *ver = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; if( *ver >= PV_VENDOR_ID ) { proto_tree_add_item(tree, hf_vuze_dht_vendor_id, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } if( *ver >= PV_NETWORKS ) { proto_tree_add_item(tree, hf_vuze_dht_network_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } if( *ver >= PV_FIX_ORIGINATOR ) { proto_tree_add_item(tree, hf_vuze_dht_local_proto_ver, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } offset = dissect_vuze_dht_address(tvb, pinfo, tree, offset, "Local Address"); proto_tree_add_item(tree, hf_vuze_dht_instance_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_time, tvb, offset, TL_LONG, ENC_BIG_ENDIAN); offset += TL_LONG; if( *ver >= PV_PACKET_FLAGS ) { proto_tree_add_item(tree, hf_vuze_dht_generic_flags, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } if( *ver >= PV_PACKET_FLAGS2 ) { proto_tree_add_item(tree, hf_vuze_dht_generic_flags2, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } return offset; } /* --- Reply Header format -------------- Name | Type | Protocol version | Note ACTION int always type of the packet TRANSACTION_ID int always must be equal to TRANSACTION_ID from the request CONNECTION_ID long always must be equal to CONNECTION_ID from the request PROTOCOL_VERSION byte always version of protocol used in this packet VENDOR_ID byte >=VENDOR_ID same meaning as in the request NETWORK_ID int >=NETWORKS same meaning as in the request INSTANCE_ID int always instance id of the node that replies to the request FLAG byte >=PACKET_FLAGS FLAG2 byte >=PACKET_FLAGS2 */ static int dissect_vuze_dht_reply_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int *action, int *ver ) { proto_tree_add_item(tree, hf_vuze_dht_action, tvb, offset, TL_INT, ENC_BIG_ENDIAN); *action = tvb_get_ntohl(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " Action: %s", val_to_str_const( *action, vuze_dht_action_type_vals, "Unknown") ); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_transaction_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_connection_id, tvb, offset, TL_LONG, ENC_BIG_ENDIAN); offset += TL_LONG; proto_tree_add_item(tree, hf_vuze_dht_proto_ver, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); *ver = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; if( *ver >= PV_VENDOR_ID ) { proto_tree_add_item(tree, hf_vuze_dht_vendor_id, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } if( *ver >= PV_NETWORKS ) { proto_tree_add_item(tree, hf_vuze_dht_network_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } proto_tree_add_item(tree, hf_vuze_dht_instance_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; if( *ver >= PV_PACKET_FLAGS ) { proto_tree_add_item(tree, hf_vuze_dht_generic_flags, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } if( *ver >= PV_PACKET_FLAGS2 ) { proto_tree_add_item(tree, hf_vuze_dht_generic_flags2, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } return offset; } /* --- Reply Ping ----------------- ACTION equal to 1025 If protocol version is >=VIVALDI then packet's body carries network coordinates. */ static int dissect_vuze_dht_reply_ping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver ) { if( ver >= PV_VIVALDI ) { offset = dissect_vuze_dht_network_coordinates( tvb, pinfo, tree, offset, ver ); } return offset; } /* --- Request Store ----------------- Name | Type | Protocol version | Note SPOOF_ID int >=ANTI_SPOOF Spoof ID of the target node; it must be the same number as previously retrived through FIND_NODE reply. KEYS_COUNT byte always Number of keys that follow. KEYS keys always Keys that the target node should store. VALUE_GROUPS_COUNT byte always Number of groups of values this packet contains. VALUES value groups always Groups of values, one for each key; values are stored in the same order as keys. */ static int dissect_vuze_dht_request_store(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver ) { guint8 keys_count, value_groups_count; if( ver >= PV_ANTI_SPOOF ) { proto_tree_add_item(tree, hf_vuze_dht_spoof_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } proto_tree_add_item(tree, hf_vuze_dht_keys_count, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); keys_count = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; offset = dissect_vuze_dht_keys( tvb, pinfo, tree, offset, keys_count ); proto_tree_add_item(tree, hf_vuze_dht_value_groups_count, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); value_groups_count = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; offset = dissect_vuze_dht_value_groups( tvb, pinfo, tree, offset, value_groups_count, ver ); return offset; } /* --- Reply Store ----------------- Name | Type | Protocol version | Note DIVERSIFICATIONS_LENGTH byte >=DIV_AND_CONT Number of diversifications this packet contains. DIVERSIFICATIONS byte[] >=DIV_AND_CONT Array with diversifications; they are stored in the same order as keys and values from the request. */ static int dissect_vuze_dht_reply_store(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset, int ver ) { if( ver >= PV_DIV_AND_CONT ) { guint diversifications_len; proto_tree_add_item(tree, hf_vuze_dht_diversifications_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); diversifications_len = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; proto_tree_add_item(tree, hf_vuze_dht_diversifications, tvb, offset, diversifications_len, ENC_NA); offset += diversifications_len; } return offset; } /* --- Request Find node ----------------- Name | Type | Protocol version | Note ID_LENGTH byte always Length of the following ID. ID byte[] always ID to search NODE_STATUS int >=MORE_NODE_STATUS Node status DHT_SIZE int >=MORE_NODE_STATUS Estimated size of the DHT; Unknown value can be indicated as zero. */ static int dissect_vuze_dht_request_find_node(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset, int ver ) { guint id_len; proto_tree_add_item(tree, hf_vuze_dht_id_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); id_len = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; proto_tree_add_item(tree, hf_vuze_dht_id, tvb, offset, id_len, ENC_NA); offset += id_len; if( ver >= PV_MORE_NODE_STATUS ) { proto_tree_add_item(tree, hf_vuze_dht_node_status, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_size, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } return offset; } /* --- Reply Find node ----------------- Name | Type | Protocol version | Note SPOOF_ID int >=ANTI_SPOOF Spoof ID of the requesting node; it should be constructed from information known about requesting contact and not easily guessed by others. NODE_TYPE int >=XFER_STATUS Type of the replying node; Possible values are 0 for bootstrap node, 1 for ordinary node and ffffffffh for unknown type. DHT_SIZE int >=SIZE_ESTIMATE Estimated size of the DHT; Unknown value can be indicated as zero. NETWORK_COORDINATES network coordinates >=VIVALDI Network coordinates of replying node. CONTACTS_COUNT short always Number of carried contacts. CONTACTS contacts always List with contacts. */ static int dissect_vuze_dht_reply_find_node(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver ) { guint contacts_count; if( ver >= PV_ANTI_SPOOF ) { proto_tree_add_item(tree, hf_vuze_dht_spoof_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } if( ver >= PV_XFER_STATUS ) { proto_tree_add_item(tree, hf_vuze_dht_node_type, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } if( ver >= PV_SIZE_ESTIMATE ) { proto_tree_add_item(tree, hf_vuze_dht_size, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; } if( ver >= PV_VIVALDI ) { offset = dissect_vuze_dht_network_coordinates( tvb, pinfo, tree, offset, ver ); } proto_tree_add_item(tree, hf_vuze_dht_contacts_count, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); contacts_count = tvb_get_ntohs( tvb, offset ); offset += TL_SHORT; offset = dissect_vuze_dht_contacts( tvb, pinfo, tree, offset, contacts_count ); return offset; } /* --- Request Find value ----------------- Name | Type | Note KEY key Key for which the values are requested. FLAGS byte Flags for the operation, possible values are: SINGLE_VALUE = 00h DOWNLOADING = 01h SEEDING = 02h MULTI_VALUE = 04h STATS = 08h MAX_VALUES byte Maximum number of returned values. */ static int dissect_vuze_dht_request_find_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver _U_ ) { offset = dissect_vuze_dht_key( tvb, pinfo, tree, offset ); proto_tree_add_item(tree, hf_vuze_dht_flags, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; proto_tree_add_item(tree, hf_vuze_dht_max_values, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; return offset; } /* --- Reply Find value ----------------- Name | Type | Condition | Note HAS_CONTINUATION boolean protocol version >=DIV_AND_CONT Indicates whether there is at least one other packet with values. HAS_VALUES boolean always Indicates whether this packet carries values or contacts. CONTACTS_COUNT short HAS_VALUES == false Number of stored contacts. CONTACTS contacts HAS_VALUES == false Stored contacts that are close to the searched key. NETWORK_COORDINATES network coordinates HAS_VALUES == false Network coordinates of the replying node. && protocol version >=VIVALDI_FINDVALUE DIVERSIFICATION_TYPE byte HAS_VALUES == true Type of key's diversification. && protocol version >=DIV_AND_CONT VALUES value group HAS_VALUES == true Values that match searched key. */ static int dissect_vuze_dht_reply_find_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver ) { guint8 has_values; guint contacts_count; if( ver >= PV_DIV_AND_CONT ) { proto_tree_add_item(tree, hf_vuze_dht_has_continuation, tvb, offset, TL_BOOL, ENC_BIG_ENDIAN); offset += TL_BOOL; } proto_tree_add_item(tree, hf_vuze_dht_has_values, tvb, offset, TL_BOOL, ENC_BIG_ENDIAN); has_values = tvb_get_guint8( tvb, offset ); offset += TL_BOOL; if( has_values ) { proto_tree_add_item(tree, hf_vuze_dht_contacts_count, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); contacts_count = tvb_get_ntohs( tvb, offset ); offset += TL_SHORT; offset = dissect_vuze_dht_contacts( tvb, pinfo, tree, offset, contacts_count ); if( ver >= PV_VIVALDI_FINDVALUE ) { offset = dissect_vuze_dht_network_coordinates( tvb, pinfo, tree, offset, ver ); } if( ver >= PV_DIV_AND_CONT ) { proto_tree_add_item(tree, hf_vuze_dht_diversification_type, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); offset += TL_BYTE; } offset = dissect_vuze_dht_value_group( tvb, pinfo, tree, offset, ver ); } return offset; } /* --- Reply Error ----------------- Name | Type | Condition | Note ERROR_TYPE int always Type of the error. Possible values are: WRONG_ADDRESS = 1 - originator's address stored in the request is incorrect KEY_BLOCKED = 2 - the requested key has been blocked SENDER_ADDRESS address ERROR_TYPE == WRONG_ADDRESS Real originator's address. KEY_BLOCK_REQUEST_LENGTH byte ERROR_TYPE == KEY_BLOCKED Length of the following request. KEY_BLOCK_REQUEST byte[] ERROR_TYPE == KEY_BLOCKED Request that blocks/unlocks the key. SIGNATURE_LENGTH short ERROR_TYPE == KEY_BLOCKED Length of the following signature. SIGNATURE byte[] ERROR_TYPE == KEY_BLOCKED Signature of the request. */ static int dissect_vuze_dht_reply_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ver _U_ ) { guint error_type; guint8 key_block_request_len; guint signature_len; proto_tree_add_item(tree, hf_vuze_dht_error_type, tvb, offset, TL_INT, ENC_BIG_ENDIAN); error_type = tvb_get_ntohl( tvb, offset ); col_append_fstr(pinfo->cinfo, COL_INFO, " Error: %s", val_to_str_const( error_type, vuze_dht_error_type_vals, "Unknown") ); offset += TL_INT; switch(error_type) { case ET_WRONG_ADDRESS: offset = dissect_vuze_dht_address( tvb, pinfo, tree, offset, "Sender Address" ); break; case ET_KEY_BLOCKED: proto_tree_add_item(tree, hf_vuze_dht_key_block_request_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); key_block_request_len = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; proto_tree_add_item(tree, hf_vuze_dht_key_block_request, tvb, offset, key_block_request_len, ENC_NA); offset += key_block_request_len; proto_tree_add_item(tree, hf_vuze_dht_signature_len, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); signature_len = tvb_get_ntohs( tvb, offset ); offset += TL_SHORT; proto_tree_add_item(tree, hf_vuze_dht_signature, tvb, offset, signature_len, ENC_NA); offset += signature_len; break; default: break; } return offset; } /* --- Request Key block ----------------- Name | Type | Note SPOOF_ID int Spoof ID obtained through FIND_NODE request. KEY_BLOCK_REQUEST_LENGTH byte Length of the following request. KEY_BLOCK_REQUEST byte[] Request that blocks/unlocks the key. SIGNATURE_LENGTH short Length of the following signature. SIGNATURE byte[] Signature of the request. */ static int dissect_vuze_dht_request_key_block(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, int offset, int ver _U_ ) { guint8 key_block_request_len; guint signature_len; proto_tree_add_item(tree, hf_vuze_dht_spoof_id, tvb, offset, TL_INT, ENC_BIG_ENDIAN); offset += TL_INT; proto_tree_add_item(tree, hf_vuze_dht_key_block_request_len, tvb, offset, TL_BYTE, ENC_BIG_ENDIAN); key_block_request_len = tvb_get_guint8( tvb, offset ); offset += TL_BYTE; proto_tree_add_item(tree, hf_vuze_dht_key_block_request, tvb, offset, key_block_request_len, ENC_NA); offset += key_block_request_len; proto_tree_add_item(tree, hf_vuze_dht_signature_len, tvb, offset, TL_SHORT, ENC_BIG_ENDIAN); signature_len = tvb_get_ntohs( tvb, offset ); offset += TL_SHORT; proto_tree_add_item(tree, hf_vuze_dht_signature, tvb, offset, signature_len, ENC_NA); offset += signature_len; return offset; } static int dissect_vuze_dht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *sub_tree; int action, proto_ver; int decoded_length = 0; /* set the protocol column */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Vuze-DHT"); /* clear the info column */ col_clear( pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vuze_dht, tvb, 0, -1, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_vuze_dht); /* Requests always start with Connection IDs, which guaranteed to have their MSB set to 1 Replies always start with the action, which always has the MSB clear Therefore, the MSB of an incoming packet should be used to distinguish requests from replies. */ if( tvb_get_guint8(tvb,0) & 0x80 ) { decoded_length = dissect_vuze_dht_request_header(tvb, pinfo, sub_tree, decoded_length, &action, &proto_ver ); } else { decoded_length = dissect_vuze_dht_reply_header(tvb, pinfo, sub_tree, decoded_length, &action, &proto_ver ); } switch( action ) { case AT_PING_REQUEST: break; case AT_PING_REPLY: decoded_length = dissect_vuze_dht_reply_ping(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_STORE_REQUEST: decoded_length = dissect_vuze_dht_request_store(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_STORE_REPLY: decoded_length = dissect_vuze_dht_reply_store(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_FIND_NODE_REQUEST: decoded_length = dissect_vuze_dht_request_find_node(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_FIND_NODE_REPLY: decoded_length = dissect_vuze_dht_reply_find_node(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_FIND_VALUE_REQUEST: decoded_length = dissect_vuze_dht_request_find_value(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_FIND_VALUE_REPLY: decoded_length = dissect_vuze_dht_reply_find_value(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_ERROR_REPLY: decoded_length = dissect_vuze_dht_reply_error(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; case AT_KEY_BLOCK_REQUEST: decoded_length = dissect_vuze_dht_request_key_block(tvb, pinfo, sub_tree, decoded_length, proto_ver ); break; default: break; } return decoded_length; } void proto_register_vuze_dht(void) { static hf_register_info hf[] = { { &hf_vuze_dht_address, { "Address", "vuze-dht.address", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_address_len, { "Address Length", "vuze-dht.address.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_address_v4, { "IPv4 Address", "vuze-dht.address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_address_v6, { "IPv6 Address", "vuze-dht.address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_address_port, { "Port", "vuze-dht.address.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_contact, { "Contact", "vuze-dht.contact", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_contact_type, { "Contact Type", "vuze-dht.contact.type", FT_UINT8, BASE_DEC, VALS(vuze_dht_contact_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_proto_ver, { "Protocol Version", "vuze-dht.proto_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value, { "Value", "vuze-dht.value", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_ver, { "Value Version", "vuze-dht.value.ver", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_created, { "Value Creation Time", "vuze-dht.value.creation_time", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_bytes_count, { "Value Bytes Count", "vuze-dht.value.bytes_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_bytes, { "Value Bytes", "vuze-dht.value.bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_flags, { "Value Flags", "vuze-dht.value.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_life_hours, { "Value Life Hours", "vuze-dht.value.life_hours", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_replication_factor, { "Value Replication Factor", "vuze-dht.value.replication_factor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_connection_id, { "Connection ID", "vuze-dht.connection_id", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_action, { "Action", "vuze-dht.action", FT_UINT32, BASE_DEC, VALS(vuze_dht_action_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_transaction_id, { "Transaction ID", "vuze-dht.transaction_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_vendor_id, { "Vendor ID", "vuze-dht.vendor_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_id, { "Network ID", "vuze-dht.network_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_local_proto_ver, { "Local Protocol Version", "vuze-dht.local_proto_ver", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_instance_id, { "Instance ID", "vuze-dht.instance_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_time, { "Time", "vuze-dht.time", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinates_count, { "Network Coordinates Count", "vuze-dht.network_coordinates_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinates, { "Network Coordinates", "vuze-dht.network_coordinates", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate, { "Network Coordinate", "vuze-dht.network_coordinate", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_type, { "Network Coordinate Type", "vuze-dht.network_coordinate.type", FT_UINT8, BASE_DEC, VALS(vuze_dht_network_coordinate_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_size, { "Network Coordinate Size", "vuze-dht.network_coordinate.size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_data, { "Network Coordinate Data", "vuze-dht.network_coordinate.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_x, { "Network Coordinate X", "vuze-dht.network_coordinate.x", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_y, { "Network Coordinate Y", "vuze-dht.network_coordinate.y", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_height, { "Network Coordinate Height", "vuze-dht.network_coordinate.height", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_network_coordinate_error, { "Network Coordinate Error", "vuze-dht.network_coordinate.error", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_spoof_id, { "Spoof ID", "vuze-dht.spoof_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_keys_count, { "Keys Count", "vuze-dht.keys_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_keys, { "Keys", "vuze-dht.keys", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_key, { "Key", "vuze-dht.key", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_key_len, { "Key Length", "vuze-dht.key.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_key_data, { "Key Data", "vuze-dht.key.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_values_count, { "Values Count", "vuze-dht.values_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_groups_count, { "Value Groups Count", "vuze-dht.value_groups_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_group, { "Values", "vuze-dht.values", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_value_groups, { "Value Groups", "vuze-dht.value_groups", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_diversifications_len, { "Diversifications Length", "vuze-dht.diversifications_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_diversifications, { "Diversifications", "vuze-dht.diversifications", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_id_len, { "ID Length", "vuze-dht.id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_id, { "ID", "vuze-dht.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_node_status, { "Node Status", "vuze-dht.node_status", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_size, { "DHT Size", "vuze-dht.dht_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_node_type, { "Node Type", "vuze-dht.node_type", FT_UINT32, BASE_DEC, VALS(vuze_dht_node_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_contacts_count, { "Contacts Count", "vuze-dht.contacts_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_contacts, { "Contacts", "vuze-dht.contacts", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_flags, { "Flags", "vuze-dht.flags", FT_UINT8, BASE_DEC, VALS(vuze_dht_flag_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_values_num, { "Values Num", "vuze-dht.stats.values_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_values_total, { "Values Total", "vuze-dht.stats.values_total", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_reads_per_min, { "Reads Per Minute", "vuze-dht.stats.reads_per_min", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_diversification_type, { "Diversification Type", "vuze-dht.stats.diversification_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_max_values, { "Max values", "vuze-dht.max_values", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_has_continuation, { "Has Continuation", "vuze-dht.has_continuation", FT_UINT8, BASE_DEC, VALS(vuze_dht_bool_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_has_values, { "Has Values", "vuze-dht.has_values", FT_UINT8, BASE_DEC, VALS(vuze_dht_bool_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_error_type, { "Error Type", "vuze-dht.error_type", FT_UINT32, BASE_DEC, VALS(vuze_dht_error_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_key_block_request_len, { "Key Block Request Length", "vuze-dht.key_block_request_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_key_block_request, { "Key Block Request", "vuze-dht.key_block_request", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_signature_len, { "Signature Length", "vuze-dht.signature_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_signature, { "Signature", "vuze-dht.signature", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_vuze_dht_generic_flags, { "Generic Flags", "vuze-dht.generic_flags", FT_UINT8, BASE_DEC, VALS(vuze_dht_generic_flag_type_vals), 0x0, NULL, HFILL } }, { &hf_vuze_dht_generic_flags2, { "Generic Flags 2", "vuze-dht.generic_flags2", FT_UINT8, BASE_DEC, VALS(vuze_dht_flag_type_vals), 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_vuze_dht, &ett_vuze_dht_address, &ett_vuze_dht_contacts, &ett_vuze_dht_contact, &ett_vuze_dht_keys, &ett_vuze_dht_key, &ett_vuze_dht_value_groups, &ett_vuze_dht_value_group, &ett_vuze_dht_value, &ett_vuze_dht_network_coordinates, &ett_vuze_dht_network_coordinate }; /* Register protocol */ proto_vuze_dht = proto_register_protocol ( "Vuze DHT Protocol", "Vuze-DHT", "vuze-dht" ); proto_register_field_array(proto_vuze_dht, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vuze_dht_handle = register_dissector("vuze-dht", dissect_vuze_dht, proto_vuze_dht); } void proto_reg_handoff_vuze_dht(void) { dissector_add_uint("udp.port", DEFAULT_UDP_PORT, vuze_dht_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vxi11.c
/* packet-vxi11.c * Routines for VXI-11 (TCP/IP Instrument Protocol) dissection. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * VXI-11 protocol dissector * By Jens Kilian <[email protected]> * Copyright 2009 Verigy Deutschland GmbH * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include "packet-rpc.h" #include <epan/to_str.h> /* * For the protocol specifications, see * http://www.vxibus.org/files/VXI_Specs/VXI-11.zip * * This dissector handles the basic Network Instrument protocol as defined * in VXI-11, and parts of the TCP/IP-IEEE 488.1 Interface spec (VXI-11.2). */ /* Core protocol. */ #define VXI11_CORE_ADDRESS_FAMILY_TCP 0 #define VXI11_CORE_ADDRESS_FAMILY_UDP 1 #define VXI11_CORE_CMD_SEND_COMMAND 0x020000 #define VXI11_CORE_CMD_BUS_STATUS 0x020001 #define VXI11_CORE_CMD_ATN_CONTROL 0x020002 #define VXI11_CORE_CMD_REN_CONTROL 0x020003 #define VXI11_CORE_CMD_PASS_CONTROL 0x020004 #define VXI11_CORE_CMD_BUS_ADDRESS 0x02000a #define VXI11_CORE_CMD_IFC_CONTROL 0x020010 #define VXI11_CORE_ERROR_NO_ERROR 0 #define VXI11_CORE_ERROR_SYNTAX_ERROR 1 #define VXI11_CORE_ERROR_DEVICE_NOT_ACCESSIBLE 3 #define VXI11_CORE_ERROR_INVALID_ID 4 #define VXI11_CORE_ERROR_PARAMETER_ERROR 5 #define VXI11_CORE_ERROR_CHANNEL_NOT_ESTABLISHED 6 #define VXI11_CORE_ERROR_OPERATION_NOT_SUPPORTED 8 #define VXI11_CORE_ERROR_OUT_OF_RESOURCES 9 #define VXI11_CORE_ERROR_DEVICE_LOCKED 11 #define VXI11_CORE_ERROR_NO_LOCK_HELD 12 #define VXI11_CORE_ERROR_IO_TIMEOUT 15 #define VXI11_CORE_ERROR_IO_ERROR 17 #define VXI11_CORE_ERROR_INVALID_ADDRESS 21 #define VXI11_CORE_ERROR_ABORT 23 #define VXI11_CORE_ERROR_CHANNEL_ALREADY_ESTABLISHED 29 #define VXI11_CORE_FLAG_WAITLOCK (1 << 0) #define VXI11_CORE_FLAG_END (1 << 3) #define VXI11_CORE_FLAG_TERMCHRSET (1 << 7) #define VXI11_CORE_REASON_REQCNT (1 << 0) #define VXI11_CORE_REASON_CHR (1 << 1) #define VXI11_CORE_REASON_END (1 << 2) #define VXI11_CORE_PROC_NULL 0 #define VXI11_CORE_PROC_CREATE_LINK 10 #define VXI11_CORE_PROC_DEVICE_WRITE 11 #define VXI11_CORE_PROC_DEVICE_READ 12 #define VXI11_CORE_PROC_DEVICE_READSTB 13 #define VXI11_CORE_PROC_DEVICE_TRIGGER 14 #define VXI11_CORE_PROC_DEVICE_CLEAR 15 #define VXI11_CORE_PROC_DEVICE_REMOTE 16 #define VXI11_CORE_PROC_DEVICE_LOCAL 17 #define VXI11_CORE_PROC_DEVICE_LOCK 18 #define VXI11_CORE_PROC_DEVICE_UNLOCK 19 #define VXI11_CORE_PROC_DEVICE_ENABLE_SRQ 20 #define VXI11_CORE_PROC_DEVICE_DOCMD 22 #define VXI11_CORE_PROC_DESTROY_LINK 23 #define VXI11_CORE_PROC_CREATE_INTR_CHAN 25 #define VXI11_CORE_PROC_DESTROY_INTR_CHAN 26 #define VXI11_CORE_PROGRAM 0x0607AF #define VXI11_CORE_VERSION 1 #define MAX_DATA_SHOW_SIZE 70 void proto_register_vxi11_core(void); void proto_reg_handoff_vxi11_core(void); void proto_register_vxi11_async(void); void proto_reg_handoff_vxi11_async(void); void proto_register_vxi11_intr(void); void proto_reg_handoff_vxi11_intr(void); static int proto_vxi11_core = -1; static gint ett_vxi11_core = -1; static gint ett_vxi11_core_flags = -1; static gint ett_vxi11_core_reason = -1; static int hf_vxi11_core_procedure_v1 = -1; static int hf_vxi11_core_abort_port = -1; static int hf_vxi11_core_client_id = -1; static int hf_vxi11_core_cmd = -1; static int hf_vxi11_core_data = -1; static int hf_vxi11_core_device = -1; static int hf_vxi11_core_enable = -1; static int hf_vxi11_core_error = -1; static int hf_vxi11_core_flags = -1; static int hf_vxi11_core_flag_wait_lock = -1; static int hf_vxi11_core_flag_end = -1; static int hf_vxi11_core_flag_term_chr_set = -1; static int hf_vxi11_core_handle = -1; static int hf_vxi11_core_host_addr = -1; static int hf_vxi11_core_host_port = -1; static int hf_vxi11_core_io_timeout = -1; static int hf_vxi11_core_lid = -1; static int hf_vxi11_core_lock_device = -1; static int hf_vxi11_core_lock_timeout = -1; static int hf_vxi11_core_max_recv_size = -1; static int hf_vxi11_core_network_order = -1; static int hf_vxi11_core_prog_family = -1; static int hf_vxi11_core_prog_num = -1; static int hf_vxi11_core_prog_vers = -1; static int hf_vxi11_core_reason = -1; static int hf_vxi11_core_reason_req_cnt = -1; static int hf_vxi11_core_reason_chr = -1; static int hf_vxi11_core_reason_end = -1; static int hf_vxi11_core_size = -1; static int hf_vxi11_core_stb = -1; static int hf_vxi11_core_term_char = -1; static const value_string vxi11_core_error_vals[] = { { VXI11_CORE_ERROR_NO_ERROR, "No Error" }, { VXI11_CORE_ERROR_SYNTAX_ERROR, "Syntax Error" }, { VXI11_CORE_ERROR_DEVICE_NOT_ACCESSIBLE, "Device Not Accessible" }, { VXI11_CORE_ERROR_INVALID_ID, "Invalid ID" }, { VXI11_CORE_ERROR_PARAMETER_ERROR, "Parameter Error" }, { VXI11_CORE_ERROR_CHANNEL_NOT_ESTABLISHED, "Channel Not Established" }, { VXI11_CORE_ERROR_OPERATION_NOT_SUPPORTED, "Operation Not Supported" }, { VXI11_CORE_ERROR_OUT_OF_RESOURCES, "Out Of Resources" }, { VXI11_CORE_ERROR_DEVICE_LOCKED, "Device Locked" }, { VXI11_CORE_ERROR_NO_LOCK_HELD, "No Lock Held" }, { VXI11_CORE_ERROR_IO_TIMEOUT, "I/O Timeout" }, { VXI11_CORE_ERROR_IO_ERROR, "I/O Error" }, { VXI11_CORE_ERROR_INVALID_ADDRESS, "Invalid Address" }, { VXI11_CORE_ERROR_ABORT, "Abort" }, { VXI11_CORE_ERROR_CHANNEL_ALREADY_ESTABLISHED, "Channel Already Established" }, { 0, NULL } }; static const value_string vxi11_core_cmd_vals[] = { { VXI11_CORE_CMD_SEND_COMMAND, "SEND_COMMAND" }, { VXI11_CORE_CMD_BUS_STATUS, "BUS_STATUS" }, { VXI11_CORE_CMD_ATN_CONTROL, "ATN_CONTROL" }, { VXI11_CORE_CMD_REN_CONTROL, "REN_CONTROL" }, { VXI11_CORE_CMD_PASS_CONTROL, "PASS_CONTROL" }, { VXI11_CORE_CMD_BUS_ADDRESS, "BUS_ADDRESS" }, { VXI11_CORE_CMD_IFC_CONTROL, "IFC_CONTROL" }, { 0, NULL } }; /* Asynchronous-abort protocol. */ #define VXI11_ASYNC_PROC_NULL 0 #define VXI11_ASYNC_PROC_DEVICE_ABORT 1 #define VXI11_ASYNC_PROGRAM 0x0607B0 #define VXI11_ASYNC_VERSION 1 static int proto_vxi11_async = -1; static gint ett_vxi11_async = -1; static int hf_vxi11_async_procedure_v1 = -1; /* Interrupt protocol. */ #define VXI11_INTR_PROC_NULL 0 #define VXI11_INTR_PROC_DEVICE_INTR_SRQ 30 #define VXI11_INTR_PROGRAM 0x0607B1 #define VXI11_INTR_VERSION 1 static int proto_vxi11_intr = -1; static gint ett_vxi11_intr = -1; static int hf_vxi11_intr_procedure_v1 = -1; static int hf_vxi11_intr_handle = -1; /* Helper routines for dissecting common fields. */ static int dissect_error(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, const gchar *packet_type, guint32 *error) { const gchar *errstr; *error = tvb_get_ntohl(tvb, offset); errstr = val_to_str(*error, vxi11_core_error_vals, "Error %d"); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_error, offset); proto_item_append_text(tree, " (%s) %s", packet_type, errstr); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", errstr); return offset; } static int dissect_flags(tvbuff_t *tvb, int offset, proto_tree *tree) { if (tree) { guint32 flags = tvb_get_ntohl(tvb, offset); proto_item *flags_item = proto_tree_add_item(tree, hf_vxi11_core_flags, tvb, offset, 4, ENC_BIG_ENDIAN); if (flags_item) { proto_tree *flags_tree = proto_item_add_subtree(flags_item, ett_vxi11_core_flags); proto_tree_add_item(flags_tree, hf_vxi11_core_flag_wait_lock, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_vxi11_core_flag_end, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_vxi11_core_flag_term_chr_set, tvb, offset, 4, ENC_BIG_ENDIAN); if (flags != 0) { wmem_strbuf_t *strbuf = wmem_strbuf_create(wmem_packet_scope()); if (flags & VXI11_CORE_FLAG_WAITLOCK) { wmem_strbuf_append(strbuf, "WAIT_LOCK, "); } if (flags & VXI11_CORE_FLAG_END) { wmem_strbuf_append(strbuf, "END, "); } if (flags & VXI11_CORE_FLAG_TERMCHRSET) { wmem_strbuf_append(strbuf, "TERM_CHR_SET, "); } wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2); proto_item_append_text(flags_item, " (%s)", wmem_strbuf_get_str(strbuf)); } } } return offset + 4; } static int dissect_reason(tvbuff_t *tvb, int offset, proto_tree *tree) { if (tree) { guint32 reason = tvb_get_ntohl(tvb, offset); proto_item *reason_item = proto_tree_add_item(tree, hf_vxi11_core_reason, tvb, offset, 4, ENC_BIG_ENDIAN); if (reason_item) { proto_tree *reason_tree = proto_item_add_subtree(reason_item, ett_vxi11_core_reason); proto_tree_add_item(reason_tree, hf_vxi11_core_reason_req_cnt, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(reason_tree, hf_vxi11_core_reason_chr, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(reason_tree, hf_vxi11_core_reason_end, tvb, offset, 4, ENC_BIG_ENDIAN); if (reason != 0) { wmem_strbuf_t *strbuf = wmem_strbuf_create(wmem_packet_scope()); if (reason & VXI11_CORE_REASON_REQCNT) { wmem_strbuf_append(strbuf, "REQ_CNT, "); } if (reason & VXI11_CORE_REASON_CHR) { wmem_strbuf_append(strbuf, "CHR, "); } if (reason & VXI11_CORE_REASON_END) { wmem_strbuf_append(strbuf, "END, "); } wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2); proto_item_append_text(reason_item, " (%s)", wmem_strbuf_get_str(strbuf)); } } } return offset + 4; } /* Dissectors for individual RPC requests and responses. */ static int dissect_create_link_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { const char *str; int offset = 0; offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_client_id, offset); offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_lock_device, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); offset = dissect_rpc_string(tvb, tree, hf_vxi11_core_device, offset, &str); proto_item_append_text(tree, " (Create_LinkParms) %s", str); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str); return offset; } static int dissect_create_link_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error, lid; int offset = 0; offset = dissect_error(tvb, offset, pinfo, tree, "Create_LinkResp", &error); lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_abort_port, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_max_recv_size, offset); if (error == VXI11_CORE_ERROR_NO_ERROR) { proto_item_append_text(tree, " LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); } return offset; } static int dissect_device_SRQ_parms(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = dissect_rpc_opaque_data(tvb, 0, tree, NULL, hf_vxi11_intr_handle, FALSE, 0, FALSE, NULL, NULL); proto_item_append_text(tree, " (Device_SrqParms)"); return offset; } static int dissect_device_docmd_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 lid, cmd; const gchar *cmdstr; int offset = 0; lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_flags(tvb, offset, tree); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_io_timeout, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); cmd = tvb_get_ntohl(tvb, offset); cmdstr = val_to_str(cmd, vxi11_core_cmd_vals, "Unknown(0x%x)"); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_cmd, offset); offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_network_order, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_size, offset); offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_data, FALSE, 0, FALSE, NULL, NULL); proto_item_append_text(tree, " (Device_DocmdParms) LID=%d CMD=%s", lid, cmdstr); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d CMD=%s", lid, cmdstr); return offset; } static int dissect_device_docmd_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error; int offset = 0; offset = dissect_error(tvb, offset, pinfo, tree, "Device_DocmdResp", &error); offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_data, FALSE, 0, FALSE, NULL, NULL); return offset; } static int dissect_device_enable_SRQ_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_rpc_bool(tvb, tree, hf_vxi11_core_enable, offset); offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_handle, FALSE, 0, FALSE, NULL, NULL); proto_item_append_text(tree, " (Device_EnableSrqParms) LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); return offset; } static int dissect_device_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error; return dissect_error(tvb, 0, pinfo, tree, "Device_Error", &error); } static int dissect_device_generic_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_flags(tvb, offset, tree); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_io_timeout, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); proto_item_append_text(tree, " (Device_GenericParms) LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); return offset; } static int dissect_device_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); proto_item_append_text(tree, " (Device_Link) LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); return offset; } static int dissect_device_lock_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_flags(tvb, offset, tree); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); proto_item_append_text(tree, " (Device_LockParms) LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); return offset; } static int dissect_device_read_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_size, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_io_timeout, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); offset = dissect_flags(tvb, offset, tree); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_term_char, offset); proto_item_append_text(tree, " (Device_ReadParms) LID=%d", lid); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); return offset; } static int dissect_device_read_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error; int offset = 0; guint32 datalength = 0; offset = dissect_error(tvb, offset, pinfo, tree, "Device_ReadResp", &error); offset = dissect_reason(tvb, offset, tree); datalength = tvb_get_ntohl( tvb, offset); if(MAX_DATA_SHOW_SIZE <=datalength) datalength = MAX_DATA_SHOW_SIZE; col_append_fstr( pinfo->cinfo, COL_INFO," %s",tvb_format_text(pinfo->pool, tvb, offset+4,(guint32) datalength)); offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_data, FALSE, 0, FALSE, NULL, NULL); return offset; } static int dissect_device_readstb_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error, stb; int offset = 0; offset = dissect_error(tvb, offset, pinfo, tree, "Device_ReadStbResp", &error); stb = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_stb, offset); if (error == VXI11_CORE_ERROR_NO_ERROR) { proto_item_append_text(tree, " STB=0x%02x", stb); col_append_fstr(pinfo->cinfo, COL_INFO, " STB=0x%02x", stb); } return offset; } static int dissect_device_remote_func(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 port; const gchar *addrstr; int offset = 0; addrstr = tvb_ip_to_str(pinfo->pool, tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_host_addr, offset); port = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_host_port, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_prog_num, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_prog_vers, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_prog_family, offset); proto_item_append_text(tree, " (Device_RemoteFunc) %s:%d", addrstr, port); col_append_fstr(pinfo->cinfo, COL_INFO, " %s:%d", addrstr, port); return offset; } static int dissect_device_write_parms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 datalength = 0; int offset = 0; guint32 lid = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lid, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_io_timeout, offset); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_lock_timeout, offset); offset = dissect_flags(tvb, offset, tree); col_append_fstr(pinfo->cinfo, COL_INFO, " LID=%d", lid); datalength = tvb_get_ntohl( tvb, offset); if(MAX_DATA_SHOW_SIZE <=datalength) datalength = MAX_DATA_SHOW_SIZE; col_append_fstr( pinfo->cinfo, COL_INFO," %s",tvb_format_text(pinfo->pool, tvb, offset+4,(guint32) datalength)); offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL, hf_vxi11_core_data, FALSE, 0, FALSE, NULL, NULL); proto_item_append_text(tree, " (Device_WriteParms) LID=%d", lid); return offset; } static int dissect_device_write_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 error; int offset = 0; offset = dissect_error(tvb, offset, pinfo, tree, "Device_WriteResp", &error); offset = dissect_rpc_uint32(tvb, tree, hf_vxi11_core_size, offset); return offset; } /* Initialization & registration. */ void proto_register_vxi11_core(void) { static const value_string vxi11_core_v1_proc_vals[] = { { VXI11_CORE_PROC_NULL, "NULL" }, { VXI11_CORE_PROC_CREATE_LINK, "CREATE_LINK" }, { VXI11_CORE_PROC_DEVICE_WRITE, "DEVICE_WRITE" }, { VXI11_CORE_PROC_DEVICE_READ, "DEVICE_READ" }, { VXI11_CORE_PROC_DEVICE_READSTB, "DEVICE_READSTB" }, { VXI11_CORE_PROC_DEVICE_TRIGGER, "DEVICE_TRIGGER" }, { VXI11_CORE_PROC_DEVICE_CLEAR, "DEVICE_CLEAR" }, { VXI11_CORE_PROC_DEVICE_REMOTE, "DEVICE_REMOTE" }, { VXI11_CORE_PROC_DEVICE_LOCAL, "DEVICE_LOCAL" }, { VXI11_CORE_PROC_DEVICE_LOCK, "DEVICE_LOCK" }, { VXI11_CORE_PROC_DEVICE_UNLOCK, "DEVICE_UNLOCK" }, { VXI11_CORE_PROC_DEVICE_ENABLE_SRQ, "DEVICE_ENABLE_SRQ" }, { VXI11_CORE_PROC_DEVICE_DOCMD, "DEVICE_DOCMD" }, { VXI11_CORE_PROC_DESTROY_LINK, "DESTROY_LINK" }, { VXI11_CORE_PROC_CREATE_INTR_CHAN, "CREATE_INTR_CHAN" }, { VXI11_CORE_PROC_DESTROY_INTR_CHAN, "DESTROY_INTR_CHAN" }, { 0, NULL } }; static const value_string vxi11_core_addr_family_vals[] = { { VXI11_CORE_ADDRESS_FAMILY_TCP, "TCP" }, { VXI11_CORE_ADDRESS_FAMILY_UDP, "UDP" }, { 0, NULL } }; static hf_register_info vxi11_core_hf[] = { { &hf_vxi11_core_procedure_v1, { "V1 Procedure", "vxi11_core.procedure_v1", FT_UINT32, BASE_DEC, VALS(vxi11_core_v1_proc_vals), 0, NULL, HFILL } }, { &hf_vxi11_core_abort_port, { "Abort Port", "vxi11_core.abort_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_client_id, { "Client ID", "vxi11_core.client_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_cmd, { "Command", "vxi11_core.cmd", FT_UINT32, BASE_HEX, VALS(vxi11_core_cmd_vals), 0, NULL, HFILL } }, { &hf_vxi11_core_data, { "Data", "vxi11_core.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_device, { "Device Name", "vxi11_core.device", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_enable, { "Enable", "vxi11_core.enable", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0, NULL, HFILL } }, { &hf_vxi11_core_error, { "Error Code", "vxi11_core.error", FT_UINT32, BASE_DEC, VALS(vxi11_core_error_vals), 0, NULL, HFILL } }, { &hf_vxi11_core_flags, { "Flags", "vxi11_core.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_flag_wait_lock, { "Wait Until Locked", "vxi11_core.flags.wait_lock", FT_BOOLEAN, 32, NULL, VXI11_CORE_FLAG_WAITLOCK, NULL, HFILL } }, { &hf_vxi11_core_flag_end, { "Set EOI", "vxi11_core.flags.end", FT_BOOLEAN, 32, NULL, VXI11_CORE_FLAG_END, NULL, HFILL } }, { &hf_vxi11_core_flag_term_chr_set, { "Termination Character Set", "vxi11_core.flags.term_chr_set", FT_BOOLEAN, 32, NULL, VXI11_CORE_FLAG_TERMCHRSET, NULL, HFILL } }, { &hf_vxi11_core_handle, { "Handle", "vxi11_core.handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_host_addr, { "Host Address", "vxi11_core.host_addr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_host_port, { "Host Port", "vxi11_core.host_port", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_io_timeout, { "I/O Timeout", "vxi11_core.io_timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_lid, { "Link ID", "vxi11_core.lid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_lock_device, { "Lock Device", "vxi11_core.lock_device", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0, NULL, HFILL } }, { &hf_vxi11_core_lock_timeout, { "Lock Timeout", "vxi11_core.lock_timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_max_recv_size, { "Maximum Receive Size", "vxi11_core.max_recv_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_network_order, { "Network Byte Order", "vxi11_core.network_order", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0, NULL, HFILL } }, { &hf_vxi11_core_prog_family, { "Address Family", "vxi11_core.prog_family", FT_UINT32, BASE_DEC, VALS(vxi11_core_addr_family_vals), 0, NULL, HFILL } }, { &hf_vxi11_core_prog_num, { "Program", "vxi11_core.prog_num", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_prog_vers, { "Version", "vxi11_core.prog_vers", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_reason, { "Reason", "vxi11_core.reason", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_reason_req_cnt, { "Requested Count Reached", "vxi11_core.reason.req_cnt", FT_BOOLEAN, 32, NULL, VXI11_CORE_REASON_REQCNT, NULL, HFILL } }, { &hf_vxi11_core_reason_chr, { "Termination Character Seen", "vxi11_core.reason.chr", FT_BOOLEAN, 32, NULL, VXI11_CORE_REASON_CHR, NULL, HFILL } }, { &hf_vxi11_core_reason_end, { "EOI Set", "vxi11_core.reason.end", FT_BOOLEAN, 32, NULL, VXI11_CORE_REASON_END, NULL, HFILL } }, { &hf_vxi11_core_size, { "Size", "vxi11_core.size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_stb, { "Status Byte", "vxi11_core.stb", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_vxi11_core_term_char, { "Termination Character", "vxi11_core.term_char", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } } }; static gint *vxi11_core_ett[] = { &ett_vxi11_core, &ett_vxi11_core_flags, &ett_vxi11_core_reason }; proto_vxi11_core = proto_register_protocol("VXI-11 Core Protocol", "VXI-11 Core", "vxi11_core"); proto_register_field_array(proto_vxi11_core, vxi11_core_hf, array_length(vxi11_core_hf)); proto_register_subtree_array(vxi11_core_ett, array_length(vxi11_core_ett)); } void proto_reg_handoff_vxi11_core(void) { /* proc number, "proc name", dissect_request, dissect_reply */ static const vsff vxi111_core_proc[] = { { VXI11_CORE_PROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { VXI11_CORE_PROC_CREATE_LINK, "CREATE_LINK", dissect_create_link_parms, dissect_create_link_resp }, { VXI11_CORE_PROC_DEVICE_WRITE, "DEVICE_WRITE", dissect_device_write_parms, dissect_device_write_resp }, { VXI11_CORE_PROC_DEVICE_READ, "DEVICE_READ", dissect_device_read_parms, dissect_device_read_resp }, { VXI11_CORE_PROC_DEVICE_READSTB, "DEVICE_READSTB", dissect_device_generic_parms, dissect_device_readstb_resp }, { VXI11_CORE_PROC_DEVICE_TRIGGER, "DEVICE_TRIGGER", dissect_device_generic_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_CLEAR, "DEVICE_CLEAR", dissect_device_generic_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_REMOTE, "DEVICE_REMOTE", dissect_device_generic_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_LOCAL, "DEVICE_LOCAL", dissect_device_generic_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_LOCK, "DEVICE_LOCK", dissect_device_lock_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_UNLOCK, "DEVICE_UNLOCK", dissect_device_link, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_ENABLE_SRQ, "DEVICE_ENABLE_SRQ", dissect_device_enable_SRQ_parms, dissect_device_error }, { VXI11_CORE_PROC_DEVICE_DOCMD, "DEVICE_DOCMD", dissect_device_docmd_parms, dissect_device_docmd_resp }, { VXI11_CORE_PROC_DESTROY_LINK, "DESTROY_LINK", dissect_device_link, dissect_device_error }, { VXI11_CORE_PROC_CREATE_INTR_CHAN, "CREATE_INTR_CHAN", dissect_device_remote_func, dissect_device_error }, { VXI11_CORE_PROC_DESTROY_INTR_CHAN, "DESTROY_INTR_CHAN", dissect_rpc_void, dissect_device_error }, { 0, NULL, NULL, NULL } }; static const rpc_prog_vers_info vxi11_core_vers_info[] = { { VXI11_CORE_VERSION, vxi111_core_proc, &hf_vxi11_core_procedure_v1 }, }; rpc_init_prog(proto_vxi11_core, VXI11_CORE_PROGRAM, ett_vxi11_core, G_N_ELEMENTS(vxi11_core_vers_info), vxi11_core_vers_info); } void proto_register_vxi11_async(void) { static const value_string vxi11_async_v1_proc_vals[] = { { VXI11_ASYNC_PROC_NULL, "NULL" }, { VXI11_ASYNC_PROC_DEVICE_ABORT, "DEVICE_ABORT" }, { 0, NULL } }; static hf_register_info vxi11_async_hf[] = { { &hf_vxi11_async_procedure_v1, { "V1 Procedure", "vxi11_async.procedure_v1", FT_UINT32, BASE_DEC, VALS(vxi11_async_v1_proc_vals), 0, NULL, HFILL } } }; static gint *vxi11_async_ett[] = { &ett_vxi11_async, }; proto_vxi11_async = proto_register_protocol("VXI-11 Asynchronous Abort", "VXI-11 Async", "vxi11_async"); proto_register_field_array(proto_vxi11_async, vxi11_async_hf, array_length(vxi11_async_hf)); proto_register_subtree_array(vxi11_async_ett, array_length(vxi11_async_ett)); } void proto_reg_handoff_vxi11_async(void) { static const vsff vxi111_async_proc[] = { { VXI11_ASYNC_PROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { VXI11_ASYNC_PROC_DEVICE_ABORT, "DEVICE_ABORT", dissect_device_link, dissect_device_error }, { 0, NULL, NULL, NULL } }; static const rpc_prog_vers_info vxi11_async_vers_info[] = { { VXI11_ASYNC_VERSION, vxi111_async_proc, &hf_vxi11_async_procedure_v1 }, }; rpc_init_prog(proto_vxi11_async, VXI11_ASYNC_PROGRAM, ett_vxi11_async, G_N_ELEMENTS(vxi11_async_vers_info), vxi11_async_vers_info); } void proto_register_vxi11_intr(void) { static const value_string vxi11_intr_v1_proc_vals[] = { { VXI11_INTR_PROC_NULL, "NULL" }, { VXI11_INTR_PROC_DEVICE_INTR_SRQ, "DEVICE_INTR_SRQ" }, { 0, NULL } }; static hf_register_info vxi11_intr_hf[] = { { &hf_vxi11_intr_procedure_v1, { "V1 Procedure", "vxi11_intr.procedure_v1", FT_UINT32, BASE_DEC, VALS(vxi11_intr_v1_proc_vals), 0, NULL, HFILL } }, { &hf_vxi11_intr_handle, { "Handle", "vxi11_intr.handle", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } } }; static gint *vxi11_intr_ett[] = { &ett_vxi11_intr, }; proto_vxi11_intr = proto_register_protocol("VXI-11 Interrupt", "VXI-11 Intr", "vxi11_intr"); proto_register_field_array(proto_vxi11_intr, vxi11_intr_hf, array_length(vxi11_intr_hf)); proto_register_subtree_array(vxi11_intr_ett, array_length(vxi11_intr_ett)); } void proto_reg_handoff_vxi11_intr(void) { static const vsff vxi111_intr_proc[] = { { VXI11_INTR_PROC_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, { VXI11_INTR_PROC_DEVICE_INTR_SRQ, "DEVICE_INTR_SRQ", dissect_device_SRQ_parms, dissect_rpc_void }, { 0, NULL, NULL, NULL } }; static const rpc_prog_vers_info vxi11_intr_vers_info[] = { { VXI11_INTR_VERSION, vxi111_intr_proc, &hf_vxi11_intr_procedure_v1 }, }; rpc_init_prog(proto_vxi11_intr, VXI11_INTR_PROGRAM, ett_vxi11_intr, G_N_ELEMENTS(vxi11_intr_vers_info), vxi11_intr_vers_info); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-vxlan.c
/* packet-vxlan.c * * Routines for Virtual eXtensible Local Area Network (VXLAN) packet dissection * RFC 7348 plus draft-smith-vxlan-group-policy-01 * * (c) Copyright 2016, Sumit Kumar Jha <[email protected]> * Support for VXLAN GPE (https://datatracker.ietf.org/doc/html/draft-ietf-nvo3-vxlan-gpe-02) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/tfs.h> #include "packet-vxlan.h" #define UDP_PORT_VXLAN 4789 #define UDP_PORT_VXLAN_GPE 4790 void proto_register_vxlan(void); void proto_reg_handoff_vxlan(void); static int proto_vxlan = -1; static int proto_vxlan_gpe = -1; static int hf_vxlan_flags = -1; static int hf_vxlan_gpe_flags = -1; static int hf_vxlan_flags_reserved = -1; static int hf_vxlan_reserved_8 = -1; static int hf_vxlan_flag_a = -1; static int hf_vxlan_flag_d = -1; static int hf_vxlan_flag_i = -1; static int hf_vxlan_flag_g = -1; static int hf_vxlan_gbp = -1; static int hf_vxlan_vni = -1; static int hf_vxlan_gpe_flag_i = -1; static int hf_vxlan_gpe_flag_p = -1; static int hf_vxlan_gpe_flag_o = -1; static int hf_vxlan_gpe_flag_ver = -1; static int hf_vxlan_gpe_flag_reserved = -1; static int hf_vxlan_gpe_reserved_16 = -1; static int hf_vxlan_next_proto = -1; static int ett_vxlan = -1; static int ett_vxlan_flags = -1; static int * const flags_fields[] = { &hf_vxlan_flag_g, &hf_vxlan_flag_i, &hf_vxlan_flag_d, &hf_vxlan_flag_a, &hf_vxlan_flags_reserved, NULL }; static int * const gpe_flags_fields[] = { &hf_vxlan_gpe_flag_ver, &hf_vxlan_gpe_flag_i, &hf_vxlan_gpe_flag_p, &hf_vxlan_gpe_flag_o, &hf_vxlan_gpe_flag_reserved, NULL }; static const value_string vxlan_next_protocols[] = { { VXLAN_IPV4, "IPv4" }, { VXLAN_IPV6, "IPv6" }, { VXLAN_ETHERNET, "Ethernet" }, { VXLAN_NSH, "Network Service Header" }, { VXLAN_MPLS, "MPLS"}, { 0, NULL } }; static dissector_handle_t eth_handle; static dissector_table_t vxlan_dissector_table; static int dissect_vxlan_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int is_gpe) { proto_tree *vxlan_tree; proto_item *ti; tvbuff_t *next_tvb; int offset = 0; guint32 vxlan_next_proto; col_set_str(pinfo->cinfo, COL_PROTOCOL, "VxLAN"); col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_vxlan, tvb, offset, 8, ENC_NA); vxlan_tree = proto_item_add_subtree(ti, ett_vxlan); if(is_gpe) { proto_tree_add_bitmask(vxlan_tree, tvb, offset, hf_vxlan_gpe_flags, ett_vxlan_flags, gpe_flags_fields, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(vxlan_tree, hf_vxlan_gpe_reserved_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item_ret_uint(vxlan_tree, hf_vxlan_next_proto, tvb, offset, 1, ENC_BIG_ENDIAN, &vxlan_next_proto); offset += 1; } else { proto_tree_add_bitmask(vxlan_tree, tvb, offset, hf_vxlan_flags, ett_vxlan_flags, flags_fields, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(vxlan_tree, hf_vxlan_gbp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } proto_tree_add_item(vxlan_tree, hf_vxlan_vni, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; proto_tree_add_item(vxlan_tree, hf_vxlan_reserved_8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; next_tvb = tvb_new_subset_remaining(tvb, offset); if(is_gpe){ if(!dissector_try_uint(vxlan_dissector_table, vxlan_next_proto, next_tvb, pinfo, tree)) { call_data_dissector(next_tvb, pinfo, tree); } } else { call_dissector(eth_handle, next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } static int dissect_vxlan_gpe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { return dissect_vxlan_common(tvb, pinfo, tree, TRUE); } static int dissect_vxlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { return dissect_vxlan_common(tvb, pinfo, tree, FALSE); } /* Register VxLAN with Wireshark */ void proto_register_vxlan(void) { static hf_register_info hf[] = { { &hf_vxlan_flags, { "Flags", "vxlan.flags", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL }, }, { &hf_vxlan_gpe_flags, { "Flags", "vxlan.flags", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }, }, { &hf_vxlan_flags_reserved, { "Reserved(R)", "vxlan.flags_reserved", FT_UINT16, BASE_HEX, NULL, 0x77b7, NULL, HFILL, }, }, { &hf_vxlan_gpe_flag_reserved, { "Reserved(R)", "vxlan.flags_reserved", FT_UINT8, BASE_DEC, NULL, 0xC2, NULL, HFILL, }, }, { &hf_vxlan_flag_g, { "GBP Extension", "vxlan.flag_g", FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x8000, NULL, HFILL, }, }, { &hf_vxlan_flag_i, { "VXLAN Network ID (VNI)", "vxlan.flag_i", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL, }, }, { &hf_vxlan_flag_d, { "Don't Learn", "vxlan.flag_d", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL, }, }, { &hf_vxlan_flag_a, { "Policy Applied", "vxlan.flag_a", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL, }, }, { &hf_vxlan_gpe_flag_ver, { "Version", "vxlan.ver", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL, }, }, { &hf_vxlan_gpe_flag_i, { "Instance", "vxlan.i_bit", FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL, }, }, { &hf_vxlan_gpe_flag_p, { "Next Protocol Bit", "vxlan.p_bit", FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL, }, }, { &hf_vxlan_gpe_flag_o, { "OAM bit", "vxlan.o_bit", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL, }, }, { &hf_vxlan_gbp, { "Group Policy ID", "vxlan.gbp", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vxlan_vni, { "VXLAN Network Identifier (VNI)", "vxlan.vni", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vxlan_reserved_8, { "Reserved", "vxlan.reserved8", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vxlan_gpe_reserved_16, { "Reserved", "vxlan.reserved_16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_vxlan_next_proto, { "Next Protocol", "vxlan.next_proto", FT_UINT8, BASE_DEC, VALS(vxlan_next_protocols), 0x0, NULL, HFILL }, }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_vxlan, &ett_vxlan_flags, }; /* Register the protocol name and description */ proto_vxlan = proto_register_protocol("Virtual eXtensible Local Area Network", "VXLAN", "vxlan"); /* Protocol registered just for Decode As */ proto_vxlan_gpe = proto_register_protocol_in_name_only("Virtual eXtensible Local Area Network (GPE)", "VXLAN (GPE)", "vxlan_gpe", proto_vxlan, FT_PROTOCOL); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_vxlan, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); vxlan_dissector_table = register_dissector_table("vxlan.next_proto", "VXLAN Next Protocol", proto_vxlan, FT_UINT8, BASE_DEC); } void proto_reg_handoff_vxlan(void) { dissector_handle_t vxlan_handle; dissector_handle_t vxlan_gpe_handle; /* * RFC 7348 Figures 1 and 2, in the Payload section, say * * "(Note that the original Ethernet Frame's FCS is not included)" * * meaning that the inner Ethernet frame does *not* include an * FCS. */ eth_handle = find_dissector_add_dependency("eth_withoutfcs", proto_vxlan); vxlan_handle = create_dissector_handle(dissect_vxlan, proto_vxlan); vxlan_gpe_handle = create_dissector_handle(dissect_vxlan_gpe, proto_vxlan_gpe); dissector_add_uint_with_preference("udp.port", UDP_PORT_VXLAN, vxlan_handle); dissector_add_uint_with_preference("udp.port", UDP_PORT_VXLAN_GPE, vxlan_gpe_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-vxlan.h
/* packet-vxlan.h * * Routines for Virtual eXtensible Local Area Network (VXLAN) packet dissection * RFC 7348 plus draft-smith-vxlan-group-policy-01 * * (c) Copyright 2016, Sumit Kumar Jha <[email protected]> * Support for VXLAN GPE (https://www.ietf.org/id/draft-ietf-nvo3-vxlan-gpe-02.txt) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_VXLAN_H__ #define __PACKET_VXLAN_H__ #define VXLAN_IPV4 1 #define VXLAN_IPV6 2 #define VXLAN_ETHERNET 3 #define VXLAN_NSH 4 #define VXLAN_MPLS 5 #endif /* __PACKET_VXLAN_H__ */
C
wireshark/epan/dissectors/packet-wai.c
/* packet-wai.c * Routines for WAI packet dissection * Based on: WAPI ISO submission - ISO/IEC JTC 1 N 9880 [ref: 1] * chapter "8.1.4 WAI protocol" * * Written by Lukasz Kotasa <[email protected]> * Lukasz Suchy <[email protected]> * Copyright 2010, Tieto. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Protocol reference: * http://isotc.iso.org/livelink/livelink?func=ll&objId=8500308&objAction=Open&ei=nt-RTKe1IJKTjAeepLS8BQ&usg=AFQjCNEn8hlU_SfoAGkM-X48JL_BL8bptA&sig2=JOHNPrqgCMO4q0cWhAfkow * (chapter: 8.1.4. WAI protocol) */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include <epan/reassemble.h> #define WAI_SUB_PRE_AUTHENTICATION 0x01 /* pre-authentication start */ #define WAI_SUB_STAKEY_REQ 0x02 /* STAKey request */ #define WAI_SUB_AUTH_ACTIVATION 0x03 /* authentication activation */ #define WAI_SUB_ACCESS_AUTH_REQ 0x04 /* access authentication request */ #define WAI_SUB_ACCESS_AUTH_RESP 0x05 /* access authentication response */ #define WAI_SUB_CERT_AUTH_REQ 0x06 /* certificate authentication request */ #define WAI_SUB_CERT_AUTH_RESP 0x07 /* certificate authentication response */ #define WAI_SUB_UNICAST_KEY_REQ 0x08 /* unicast key negotiation request */ #define WAI_SUB_UNICAST_KEY_RESP 0x09 /* unicast key negotiation response */ #define WAI_SUB_UNICAST_KEY_CONFIRM 0x0A /* unicast key negotiation confirmation */ #define WAI_SUB_MULTICAST_ANNOUNCE 0x0B /* multicast key/STAKey announcement */ #define WAI_SUB_MULTICAST_ANNOUNCE_RESP 0x0C /* multicast key/STAKey announcement response */ #define FLAG_BIT0 0x01 #define FLAG_BIT1 0x02 #define FLAG_BIT2 0x04 #define FLAG_BIT3 0x08 #define FLAG_BIT4 0x10 #define FLAG_BIT5 0x20 #define FLAG_BIT6 0x40 #define FLAG_BIT7 0x80 void proto_register_wai(void); void proto_reg_handoff_wai(void); static reassembly_table wai_reassembly_table; static dissector_handle_t wai_handle; static int proto_wai = -1; static gint hf_wai_version = -1; static gint hf_wai_type = -1; static gint hf_wai_subtype = -1; static gint hf_wai_reserved = -1; static gint hf_wai_length = -1; static gint hf_wai_seq = -1; static gint hf_wai_fragm_seq = -1; static gint hf_wai_flag = -1; static gint hf_wai_data = -1; static gint hf_wai_bk_rekeying_flag = -1; static gint hf_wai_preauthentication_flag = -1; static gint hf_wai_certificate_flag = -1; static gint hf_wai_optional_flag = -1; static gint hf_wai_usk_rekeying_flag = -1; static gint hf_wai_negotiation_flag = -1; static gint hf_wai_revoking_flag = -1; static gint hf_wai_reserved_flag = -1; static gint hf_wai_attr_type = -1; static gint hf_wai_cert = -1; static gint hf_wai_cert_id = -1; static gint hf_wai_cert_data = -1; static gint hf_wai_cert_len = -1; static gint hf_wai_addid = -1; static gint hf_wai_ae_mac = -1; static gint hf_wai_asue_mac = -1; static gint hf_wai_bkid = -1; static gint hf_wai_uskid = -1; static gint hf_wai_wie = -1; static gint hf_wai_message_auth_code = -1; static gint hf_wai_mskid = -1; static gint hf_wai_data_pack_num = -1; static gint hf_wai_key_data = -1; static gint hf_wai_key_data_len = -1; static gint hf_wai_key_data_content = -1; static gint hf_wai_key_ann_id = -1; static gint hf_wai_auth_id = -1; static gint hf_wai_identity = -1; static gint hf_wai_identity_id = -1; static gint hf_wai_identity_len = -1; static gint hf_wai_identity_data = -1; static gint hf_wai_ecdh = -1; static gint hf_wai_ecdh_id = -1; static gint hf_wai_ecdh_len = -1; static gint hf_wai_ecdh_content = -1; static gint hf_wai_counter = -1; static gint hf_wai_sta_key_id = -1; static gint hf_wai_challenge = -1; static gint hf_wai_cert_ver = -1; static gint hf_wai_nonce = -1; static gint hf_wai_ver_res = -1; static gint hf_wai_sign_alg = -1; static gint hf_wai_hash_alg_id = -1; static gint hf_wai_sign_alg_id = -1; static gint hf_wai_param = -1; static gint hf_wai_param_id = -1; static gint hf_wai_param_content = -1; static gint hf_wai_sign_val = -1; static gint hf_wai_sign_content = -1; static gint hf_wai_sign = -1; static gint hf_wai_identity_list = -1; static gint hf_wai_reserved_byte = -1; static gint hf_wai_no_of_ids = -1; static gint hf_wai_access_res = -1; static gint hf_wai_fragments = -1; static gint hf_wai_fragment = -1; static gint hf_wai_fragment_overlap = -1; static gint hf_wai_fragment_overlap_conflicts = -1; static gint hf_wai_fragment_multiple_tails = -1; static gint hf_wai_fragment_too_long_fragment = -1; static gint hf_wai_fragment_error = -1; static gint hf_wai_fragment_count = -1; static gint hf_wai_reassembled_in = -1; static gint hf_wai_reassembled_length = -1; static gint ett_wai = -1; static gint ett_wai_data = -1; static gint ett_wai_flags = -1; static gint ett_wai_certificate = -1; static gint ett_wai_mac = -1; static gint ett_wai_identity = -1; static gint ett_wai_key_data = -1; static gint ett_wai_ecdh_param = -1; static gint ett_wai_certificate_verification = -1; static gint ett_wai_identity_list = -1; static gint ett_wai_sign = -1; static gint ett_wai_sign_alg = -1; static gint ett_wai_sign_val = -1; static gint ett_wai_parameter = -1; static gint ett_wai_fragment = -1; static gint ett_wai_fragments = -1; static const value_string wai_type_names [] = { { 1, "WAI protocol package"}, { 0, NULL } }; static const value_string wai_attr_type_names [] = { { 1, "Signature"}, { 2, "Certificate Authentication Result"}, { 3, "Identity List"}, { 0, NULL } }; static const value_string wai_ver_res_names [] = { { 0, "Certificate is valid" }, { 1, "Certificate issuer is unknown"}, { 2, "Root certificate is untrusted"}, { 3, "Certificate time is invalid"}, { 4, "Certificate signature is invalid"}, { 5, "Certificate is revoked"}, { 6, "Certificate is not valid in its proposed usage"}, { 7, "Certificate revocation state is unknown"}, { 8, "Certificate has an unknown error"}, { 0, NULL } }; static const value_string wai_access_res_names [] = { { 0, "Success" }, { 1, "Unidentified certificate"}, { 2, "Certificate Error"}, { 3, "Prohibited by AE"}, { 0, NULL } }; static const fragment_items wai_frag_items = { /* Fragment subtrees */ &ett_wai_fragment, &ett_wai_fragments, /* Fragment fields */ &hf_wai_fragments, &hf_wai_fragment, &hf_wai_fragment_overlap, &hf_wai_fragment_overlap_conflicts, &hf_wai_fragment_multiple_tails, &hf_wai_fragment_too_long_fragment, &hf_wai_fragment_error, &hf_wai_fragment_count, /* Reassembled in field */ &hf_wai_reassembled_in, /* Reassembled length field */ &hf_wai_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "Message fragments" }; static const value_string wai_subtype_names[] = { { WAI_SUB_PRE_AUTHENTICATION, "Pre-Authentication start" }, { WAI_SUB_STAKEY_REQ, "STAKey request" }, { WAI_SUB_AUTH_ACTIVATION, "Authentication activation" }, { WAI_SUB_ACCESS_AUTH_REQ, "Access authentication request" }, { WAI_SUB_ACCESS_AUTH_RESP, "Access authentication response" }, { WAI_SUB_CERT_AUTH_REQ, "Certificate authentication request" }, { WAI_SUB_CERT_AUTH_RESP, "Certificate authentication response" }, { WAI_SUB_UNICAST_KEY_REQ, "Unicast key negotiation request" }, { WAI_SUB_UNICAST_KEY_RESP, "Unicast key negotiation response" }, { WAI_SUB_UNICAST_KEY_CONFIRM, "Unicast key negotiation confirmation" }, { WAI_SUB_MULTICAST_ANNOUNCE, "Multicast key/STAKey announcement" }, { WAI_SUB_MULTICAST_ANNOUNCE_RESP, "Multicast key/STAKey announcement response" }, { 0, NULL } }; static value_string_ext wai_subtype_names_ext = VALUE_STRING_EXT_INIT(wai_subtype_names); static const true_false_string wai_bk_rekeying_flag = { "Packet is a BK rekeying packet", "Packet is not a BK rekeying packet" }; static const true_false_string wai_preauthentication_flag = { "Packet is a pre-authentication packet", "Packet is not a pre-authentication packet" }; static const true_false_string wai_certificate_flag = { "STA requires to verify the peers certificate", "STA doesn't require to verify the peers certificate" }; static const true_false_string wai_optional_flag = { "There are some optional fields in packet", "No optional fields in packet" }; static const true_false_string wai_usk_rekeying_flag = { "Packet is a USK rekeying packet", "Packet is not a USK rekeying packet" }; static const true_false_string wai_negotiation_flag = { "Packet is a STAKey negotiation packet", "Packet is not a STAKey negotiation packet" }; static const true_false_string wai_revoking_flag = { "STA delete a STAKey", "STA doesn't delete a STAKey" }; static const true_false_string wai_reserved_flag = { "reserved 1", "reserved 0" }; static void dissect_flag(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_item *flag_item; proto_tree *flag_tree; flag_item = proto_tree_add_item(tree, hf_wai_flag, tvb, offset, 1, ENC_BIG_ENDIAN); flag_tree = proto_item_add_subtree (flag_item, ett_wai_flags); proto_tree_add_item (flag_tree, hf_wai_bk_rekeying_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_preauthentication_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_certificate_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_optional_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_usk_rekeying_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_negotiation_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_revoking_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (flag_tree, hf_wai_reserved_flag, tvb, offset, 1, ENC_BIG_ENDIAN); } inline static void dissect_bkid(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_bkid, tvb, offset, 16, ENC_NA); } inline static void dissect_uskid(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_uskid, tvb, offset, 1, ENC_NA); } inline static void dissect_wie(tvbuff_t *tvb, guint offset, guint length, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_wie, tvb, offset, length, ENC_NA); } inline static void dissect_message_auth_code(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_message_auth_code, tvb, offset, 20, ENC_NA); } inline static void dissect_mskid(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_mskid, tvb, offset, 1, ENC_NA); } inline static void dissect_key_announcement_identifier(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_key_ann_id, tvb, offset, 16, ENC_NA); } inline static void dissect_counter(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_counter, tvb, offset, 16, ENC_NA); } inline static void dissect_authentication_id(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wai_auth_id, tvb, offset, 32, ENC_NA); } static void dissect_addid(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_item *mac_item; proto_tree *mac_tree; mac_item = proto_tree_add_string(tree, hf_wai_addid, tvb, offset, 12, "AE MAC and ASUE MAC addresses"); mac_tree = proto_item_add_subtree(mac_item, ett_wai_mac); proto_tree_add_item(mac_tree, hf_wai_ae_mac, tvb, offset, 6, ENC_NA); proto_tree_add_item(mac_tree, hf_wai_asue_mac, tvb, offset+6, 6, ENC_NA); } static guint16 dissect_identity(tvbuff_t * tvb, const guint16 offset, proto_tree * tree, const char * const label) { proto_tree *id_tree; proto_item *id_item; guint16 length; length = tvb_get_ntohs(tvb, offset+2); id_item = proto_tree_add_item(tree, hf_wai_identity, tvb, offset, length+4, ENC_NA); id_tree = proto_item_add_subtree(id_item, ett_wai_identity); proto_item_set_text(id_item, "%sIdentity", ((label==NULL)?"":label)); proto_tree_add_item(id_tree, hf_wai_identity_id, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(id_tree, hf_wai_identity_len, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(id_tree, hf_wai_identity_data, tvb, offset+4, length, ENC_NA); return length + 4; } static gint16 dissect_certificate(tvbuff_t * tvb, const gint offset, proto_tree * tree, const gchar * const label) { proto_item *certificate_item; proto_tree *certificate_tree; proto_item *id_item; guint16 length; guint16 id; const gchar *id_name = "unknown"; id = tvb_get_ntohs(tvb, offset); if (id == 1) { id_name = "X.509 v3"; } else if (id == 2){ id_name = "GBW"; } length = tvb_get_ntohs(tvb, offset+2); certificate_item = proto_tree_add_item(tree, hf_wai_cert, tvb, offset, length+4, ENC_NA); proto_item_set_text(certificate_item, "%sCertificate", ((label==NULL)?"":label)); certificate_tree = proto_item_add_subtree(certificate_item, ett_wai_certificate); id_item = proto_tree_add_item(certificate_tree, hf_wai_cert_id, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_set_text(id_item, "Certificate Identifier: %s (%#x)", id_name, id); proto_tree_add_item(certificate_tree, hf_wai_cert_len, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(certificate_tree, hf_wai_cert_data, tvb, offset+4, length, ENC_NA); return length + 4; } static guint16 dissect_ecdh_parameter(tvbuff_t * tvb, const gint offset, proto_tree * tree) { proto_item *ecdh_item; proto_tree *ecdh_tree; proto_item *ecdh_id_item; guint8 ecdh_id; guint16 ecdh_len; const gchar *id_name = "unknown"; ecdh_id = tvb_get_guint8(tvb, offset); if (ecdh_id == 1) { id_name = "OID"; } else if (ecdh_id == 2) { id_name = "Detailed parameter"; } ecdh_len = tvb_get_ntohs(tvb, offset+1); ecdh_item = proto_tree_add_item(tree, hf_wai_ecdh, tvb, offset, ecdh_len+3, ENC_NA); ecdh_tree = proto_item_add_subtree(ecdh_item, ett_wai_ecdh_param); ecdh_id_item = proto_tree_add_item(ecdh_tree, hf_wai_ecdh_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_set_text(ecdh_id_item, "ID: %s (%#x)", id_name, ecdh_id); proto_tree_add_item(ecdh_tree, hf_wai_ecdh_len, tvb, offset+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ecdh_tree, hf_wai_ecdh_content, tvb, offset+3, ecdh_len, ENC_NA); return ecdh_len + 3; } static guint16 dissect_challenge(tvbuff_t *tvb, guint offset, proto_tree *tree, const gchar * const label) { proto_item *challenge_item; const guint16 challenge_length = 32; challenge_item = proto_tree_add_item(tree, hf_wai_challenge, tvb, offset, 32, ENC_NA); proto_item_append_text(challenge_item, "(%schallenge)", ((label==NULL)?"":label)); return challenge_length; } static guint16 dissect_key_data(tvbuff_t *tvb, guint offset, proto_tree *tree, const gchar *const label) { proto_item *key_data_item; proto_tree *key_data_tree; guint8 length; length = tvb_get_guint8(tvb, offset); key_data_item = proto_tree_add_item(tree, hf_wai_key_data, tvb, offset, length+1, ENC_NA); proto_item_set_text(key_data_item, "%sKey Data", ((label==NULL)?"":label)); key_data_tree = proto_item_add_subtree(key_data_item, ett_wai_key_data); proto_tree_add_item(key_data_tree, hf_wai_key_data_len, tvb, offset, 1, ENC_BIG_ENDIAN); if (length > 0) { proto_tree_add_item(key_data_tree, hf_wai_key_data_content, tvb, offset+1, length, ENC_NA); } return length + 1; } static guint dissect_multiple_certificate(tvbuff_t * tvb, guint offset, proto_tree *tree) { proto_item *multicert_item; proto_tree *multicert_tree; proto_item *nonce_1_item; proto_item *nonce_2_item; guint length; length = tvb_get_ntohs(tvb, offset+1); multicert_item = proto_tree_add_item(tree, hf_wai_cert_ver, tvb, offset, length+3, ENC_NA); multicert_tree = proto_item_add_subtree(multicert_item, ett_wai_certificate_verification); proto_tree_add_item(multicert_tree, hf_wai_attr_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(multicert_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; nonce_1_item = proto_tree_add_item(multicert_tree, hf_wai_nonce, tvb, offset, 32, ENC_NA); offset += 32; proto_item_append_text(nonce_1_item, " 1"); nonce_2_item = proto_tree_add_item(multicert_tree, hf_wai_nonce, tvb, offset, 32, ENC_NA); offset += 32; proto_item_append_text(nonce_2_item, " 2"); proto_tree_add_item(multicert_tree, hf_wai_ver_res, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset += dissect_certificate(tvb, offset, multicert_tree, "1 "); proto_tree_add_item(multicert_tree, hf_wai_ver_res, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; dissect_certificate(tvb, offset, multicert_tree, "2 "); return length + 3; } static guint dissect_identity_list(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_item *id_list_item; proto_tree *id_list_tree; guint16 length; guint16 no_of_ids; guint16 i; length = tvb_get_ntohs(tvb, offset+1); id_list_item = proto_tree_add_item(tree, hf_wai_identity_list, tvb, offset, length+3, ENC_NA); id_list_tree = proto_item_add_subtree(id_list_item, ett_wai_identity_list); proto_tree_add_item(id_list_tree, hf_wai_attr_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(id_list_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(id_list_tree, hf_wai_reserved_byte, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(id_list_tree, hf_wai_no_of_ids, tvb, offset, 2, ENC_BIG_ENDIAN); no_of_ids = tvb_get_ntohs(tvb, offset); offset += 2; for(i=0; i < no_of_ids; i++) { gchar number[4] = {0}; snprintf(number, 4, "%d", i); offset += dissect_identity(tvb, offset, id_list_tree, number); } return length + 3; } static guint16 dissect_signature_algorithm(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_item *sa_item; proto_tree *sa_tree; proto_item *param_item; proto_tree *param_tree; proto_item *alg_name_item; proto_item *sig_name_item; guint16 length; guint8 alg_id; guint8 sig_id; guint16 param_len; length = tvb_get_ntohs(tvb, offset); sa_item = proto_tree_add_item(tree, hf_wai_sign_alg, tvb, offset, length+2, ENC_NA); sa_tree = proto_item_add_subtree(sa_item, ett_wai_sign_alg); proto_tree_add_item(sa_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; alg_name_item = proto_tree_add_item(sa_tree, hf_wai_hash_alg_id, tvb, offset, 1, ENC_BIG_ENDIAN); alg_id = tvb_get_guint8(tvb, offset); if (1 == alg_id) { proto_item_set_text(alg_name_item, "Algorithm Identifier: SHA-256 (0x01)"); } offset += 1; sig_name_item = proto_tree_add_item(sa_tree, hf_wai_sign_alg_id, tvb, offset, 1, ENC_BIG_ENDIAN); sig_id = tvb_get_guint8(tvb, offset); if (1 == sig_id) { proto_item_set_text(sig_name_item, "Signature Algorithm Identifier: ECDSA-192 (0x01)"); } offset += 1; param_len = tvb_get_ntohs(tvb, offset+1); param_item = proto_tree_add_item(sa_tree, hf_wai_param, tvb, offset, param_len+3, ENC_NA); param_tree = proto_item_add_subtree(param_item, ett_wai_parameter); proto_tree_add_item(param_tree, hf_wai_param_id, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(param_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(param_tree, hf_wai_param_content, tvb, offset, param_len, ENC_NA); return length + 2; } static guint16 dissect_signature_value(tvbuff_t *tvb, guint offset, proto_tree *tree) { proto_item *sv_item; proto_tree *sv_tree; guint16 length = 0; length = tvb_get_ntohs(tvb, offset); sv_item = proto_tree_add_item(tree, hf_wai_sign_val, tvb, offset, length+2, ENC_NA); sv_tree = proto_item_add_subtree(sv_item, ett_wai_sign_val); proto_tree_add_item(sv_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(sv_tree, hf_wai_sign_content, tvb, offset, length, ENC_NA); return length + 2; } static guint16 dissect_signature(tvbuff_t *tvb, guint offset, proto_tree *tree, const gchar *const label) { proto_item *ss_item; proto_tree *ss_tree; guint length = 0; length = tvb_get_ntohs(tvb, offset+1); ss_item = proto_tree_add_item(tree, hf_wai_sign, tvb, offset, length+3, ENC_NA); proto_item_set_text(ss_item, "%s", (label==NULL)?"Signature":label); ss_tree = proto_item_add_subtree(ss_item, ett_wai_sign); proto_tree_add_item(ss_tree, hf_wai_attr_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(ss_tree, hf_wai_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; offset += dissect_identity(tvb, offset, ss_tree, NULL); offset += dissect_signature_algorithm(tvb, offset, ss_tree); dissect_signature_value(tvb, offset, ss_tree); return length + 3; } static void dissect_wai_data(tvbuff_t *tvb, proto_tree *tree, guint8 subtype, guint16 lenx) { proto_item *data_item; proto_tree *data_tree; const gchar *type_name; data_item = proto_tree_add_item(tree, hf_wai_data, tvb, 0, lenx, ENC_NA); data_tree = proto_item_add_subtree (data_item, ett_wai_data); type_name = val_to_str_ext_const(subtype, &wai_subtype_names_ext, "Unknown type"); proto_item_set_text(data_item, "%s data (%d bytes)", type_name, lenx); switch (subtype) { case WAI_SUB_PRE_AUTHENTICATION: { /* Chapter 8.1.4.6 Preauthentication [ref: 1] */ dissect_flag(tvb, 0, data_tree); dissect_uskid(tvb, 1, data_tree); dissect_addid(tvb, 2, data_tree); dissect_counter(tvb, 14, data_tree); dissect_message_auth_code(tvb, 30, data_tree); break; } case WAI_SUB_STAKEY_REQ: { /* Chapter 8.1.4.5 STAKey Establishment procedure [ref: 1] */ dissect_flag(tvb, 0, data_tree); proto_tree_add_item(data_tree, hf_wai_sta_key_id, tvb, 1, 1, ENC_BIG_ENDIAN); dissect_uskid(tvb, 2, data_tree); dissect_addid(tvb, 3, data_tree); dissect_counter(tvb, 15, data_tree); dissect_message_auth_code(tvb, 31, data_tree); break; } case WAI_SUB_AUTH_ACTIVATION: { /* Chapter 8.1.4.2.1 WAI Authentication Activation [ref: 1] */ guint16 offset = 0; dissect_flag(tvb, offset, data_tree); offset += 1; dissect_authentication_id(tvb, offset, data_tree); offset += 32; offset += dissect_identity(tvb, offset, data_tree, "Local ASU "); offset += dissect_certificate(tvb, offset, data_tree, "STE AE "); dissect_ecdh_parameter(tvb, offset, data_tree); break; } case WAI_SUB_ACCESS_AUTH_REQ: { /* Chapter 8.1.4.2.2 Access WAI Authentication Request [ref: 1] */ guint16 offset = 0; guint8 optional_field; optional_field = tvb_get_guint8(tvb, 0) & FLAG_BIT3; dissect_flag(tvb, offset, data_tree); offset += 1; dissect_authentication_id(tvb, offset, data_tree); offset += 32; offset += dissect_challenge(tvb, offset, data_tree, "ASUE "); offset += dissect_key_data(tvb, offset, data_tree, "ASUE "); offset += dissect_identity(tvb, offset, data_tree, "STA AE "); offset += dissect_certificate(tvb, offset, data_tree, "STA ASUE "); offset += dissect_ecdh_parameter(tvb, offset, data_tree); if (optional_field) { offset += dissect_identity_list(tvb, offset, data_tree); } dissect_signature(tvb, offset, data_tree, "ASUE Signature"); break; } case WAI_SUB_ACCESS_AUTH_RESP: { /* Chapter 8.1.4.2.5 Access WAI Authentication Response [ref: 1] */ guint16 offset = 0; guint8 optional_field; optional_field = tvb_get_guint8(tvb, 0) & FLAG_BIT3; dissect_flag(tvb, offset, data_tree); offset += 1; offset += dissect_challenge(tvb, offset, data_tree, "ASUE "); offset += dissect_challenge(tvb, offset, data_tree, "AE "); proto_tree_add_item(data_tree, hf_wai_access_res, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; offset += dissect_key_data(tvb, offset, data_tree, "ASUE "); offset += dissect_key_data(tvb, offset, data_tree, "AE "); offset += dissect_identity(tvb, offset, data_tree, "STA AE "); offset += dissect_identity(tvb, offset, data_tree, "STA ASUE "); if (optional_field) { guint length = 0; offset += dissect_multiple_certificate(tvb, offset, data_tree); offset += dissect_signature(tvb, offset, data_tree, "Server Signature trusted by ASUE"); length = tvb_get_ntohs(tvb, offset+1); if (length + 3 + offset + 1 < lenx) offset += dissect_signature(tvb, offset, data_tree, "Server Signature trusted by AE"); } dissect_signature(tvb, offset, data_tree, "AE Signature"); break; } case WAI_SUB_CERT_AUTH_REQ: { /* Chapter 8.1.4.2.3 Certificate Authentication Request [ref: 1] */ guint16 offset = 0; guint8 optional_field; optional_field = tvb_get_guint8(tvb, 0) & FLAG_BIT3; dissect_addid(tvb, offset, data_tree); offset += 12; offset += dissect_challenge(tvb, offset, data_tree, "AE "); offset += dissect_challenge(tvb, offset, data_tree, "ASUE "); offset += dissect_certificate(tvb, offset, data_tree, "STE ASUE "); offset += dissect_certificate(tvb, offset, data_tree, "STE AE "); if (optional_field) { dissect_identity_list(tvb, offset, data_tree); } break; } case WAI_SUB_CERT_AUTH_RESP: { /* Chapter 8.1.4.2.4 Certificate Authentication Response [ref: 1] */ guint16 offset = 0; dissect_addid(tvb, offset, data_tree); offset += 12; offset += dissect_multiple_certificate(tvb, offset, data_tree); offset += dissect_signature(tvb, offset, data_tree, "Server Signature trusted by ASUE"); if (offset < lenx) dissect_signature(tvb, offset, data_tree, "Server Signature trusted by AE"); break; } case WAI_SUB_UNICAST_KEY_REQ: { /* Chapter 8.1.4.3.1 Unicast Key Negotiation Request [ref: 1] */ dissect_flag(tvb, 0, data_tree); dissect_bkid(tvb, 1, data_tree); dissect_uskid(tvb, 17, data_tree); dissect_addid(tvb, 18, data_tree); dissect_challenge(tvb, 30, data_tree , "AE "); break; } case WAI_SUB_UNICAST_KEY_RESP: { /* Chapter 8.1.4.3.2 Unicast Key Negotiation Response [ref: 1] */ tvbuff_t *next_tvb; guint length = 0; dissect_flag(tvb, 0, data_tree); dissect_bkid(tvb, 1, data_tree); dissect_uskid(tvb, 17, data_tree); dissect_addid(tvb, 18, data_tree); dissect_challenge(tvb, 30, data_tree, "ASUE "); dissect_challenge(tvb, 62, data_tree, "AE "); next_tvb = tvb_new_subset_remaining(tvb, 96); length = tvb_reported_length(next_tvb); dissect_wie(next_tvb, 0, length-20, data_tree); dissect_message_auth_code(next_tvb, length-20, data_tree); break; } case WAI_SUB_UNICAST_KEY_CONFIRM: { /* Chapter 8.1.4.3.3 Unicast Key Negotiation Confirmation [ref: 1] */ tvbuff_t *next_tvb; guint length = 0; dissect_flag(tvb, 0, data_tree); dissect_bkid(tvb, 1, data_tree); dissect_uskid(tvb, 17, data_tree); dissect_addid(tvb, 18, data_tree); dissect_challenge(tvb, 30, data_tree, "ASUE "); next_tvb = tvb_new_subset_remaining(tvb, 62); length = tvb_reported_length(next_tvb); dissect_wie(next_tvb, 0, length-20, data_tree); dissect_message_auth_code(next_tvb, length-20, data_tree); break; } case WAI_SUB_MULTICAST_ANNOUNCE: { /* Chapter 8.1.4.4.1 Multicast Key/STAKey Announcement [ref: 1] */ guint16 offset = 0; dissect_flag(tvb, offset, data_tree); offset += 1; dissect_mskid(tvb, offset, data_tree); offset += 1; dissect_uskid(tvb, offset, data_tree); offset += 1; dissect_addid(tvb, offset, data_tree); offset += 12; proto_tree_add_item(data_tree, hf_wai_data_pack_num, tvb, offset, 16, ENC_NA); offset += 16; dissect_key_announcement_identifier(tvb, offset, data_tree); offset += 16; offset += dissect_key_data(tvb, offset, data_tree, NULL); dissect_message_auth_code(tvb, offset, data_tree); break; } case WAI_SUB_MULTICAST_ANNOUNCE_RESP: { /* Chapter 8.1.4.4.2 Multicast Key/STAKey Announcement Response [ref: 1] */ dissect_flag(tvb, 0, data_tree); dissect_mskid(tvb, 1, data_tree); dissect_uskid(tvb, 2, data_tree); dissect_addid(tvb, 3, data_tree); dissect_key_announcement_identifier(tvb, 15, data_tree); dissect_message_auth_code(tvb, 31, data_tree); break; } default: break; } } static int dissect_wai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Format of WAPI protocol packet in WAI authentication system 0 2 3 4 6 8 10 11 12 ------------------------------------------------------------------------------- | Ver. | Type | Subtype | Reserved | Length | packet | fragm. | flag | data | | | seq. no | seq. no | | |-----------------------------------------------------------------------------| Figure 18 from [ref:1] */ #define WAI_MESSAGE_LENGTH 12 /*Length of all fields without 'Data' field*/ #define WAI_DATA_OFFSET WAI_MESSAGE_LENGTH guint16 version; guint8 subtype; guint16 length; guint16 packet_num; guint8 fragment_num; guint8 flags; fragment_head *frag_msg; proto_tree *wai_tree = NULL; tvbuff_t *next_tvb; tvbuff_t *new_tvb; const gchar *subtype_name = "Unknown type"; length = tvb_get_ntohs(tvb, 6)-WAI_MESSAGE_LENGTH; subtype = tvb_get_guint8(tvb, 3); /* quick sanity check */ if ((length != tvb_reported_length (tvb)-WAI_MESSAGE_LENGTH) || (subtype > WAI_SUB_MULTICAST_ANNOUNCE_RESP)) { return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "WAI"); col_clear(pinfo->cinfo, COL_INFO); version = tvb_get_ntohs(tvb, 0); if (version == 1) { subtype_name = val_to_str_ext_const(subtype, &wai_subtype_names_ext, "Unknown type"); } col_append_str(pinfo->cinfo, COL_INFO, subtype_name); /* Field lengths and offsets in WAI protocol described above */ packet_num = tvb_get_ntohs(tvb, 8); fragment_num = tvb_get_guint8(tvb, 10); flags = tvb_get_guint8(tvb, 11); if (tree) { proto_item *wai_item; wai_item = proto_tree_add_item(tree, proto_wai, tvb, 0, -1, ENC_NA); proto_item_set_text (wai_item, "WAI Protocol (%s)", val_to_str_ext_const(subtype, &wai_subtype_names_ext, "Unknown type")); wai_tree = proto_item_add_subtree(wai_item, ett_wai); /* Field lengths and offsets in WAI protocol described above */ proto_tree_add_item(wai_tree, hf_wai_version, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_type, tvb, 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_subtype, tvb, 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_reserved, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_length, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_seq, tvb, 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_fragm_seq, tvb, 10, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wai_tree, hf_wai_flag, tvb, 11, 1, ENC_BIG_ENDIAN); } frag_msg = fragment_add_seq_check (&wai_reassembly_table, tvb, WAI_DATA_OFFSET, pinfo, packet_num, NULL, fragment_num, length, flags); next_tvb = tvb_new_subset_remaining(tvb, WAI_DATA_OFFSET); /* Replace INFO column if message is fragmented and call data dissector */ if (flags) { col_add_fstr(pinfo->cinfo, COL_INFO, "Fragment (%d) of message, data not dissected", fragment_num); process_reassembled_data(tvb, WAI_DATA_OFFSET, pinfo, "Reassembled WAI", frag_msg, &wai_frag_items, NULL, wai_tree); call_data_dissector(next_tvb, pinfo, tree); } else { /* If this is the last fragment of fragmented message, then reassamble and dissect otherwise only dissect */ if (fragment_num > 0) { new_tvb = process_reassembled_data(tvb, WAI_DATA_OFFSET, pinfo, "Reassembled WAI", frag_msg, &wai_frag_items, NULL, wai_tree); if (new_tvb) { col_set_str(pinfo->cinfo, COL_INFO, "Last fragment of message, data dissected"); col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", subtype_name); next_tvb=new_tvb; length = tvb_reported_length (next_tvb); } } /* dissect Data field of WAI packet */ if (tree) { dissect_wai_data(next_tvb, wai_tree, subtype, length); } } return tvb_captured_length(tvb); } void proto_register_wai(void) { static hf_register_info hf[] = { { &hf_wai_version, { "Version", "wai.version", FT_UINT16, BASE_DEC, NULL, 0x0, "Version of authentication infrastructure", HFILL }}, { &hf_wai_type, { "Type", "wai.type", FT_UINT8, BASE_HEX, VALS(wai_type_names), 0x0, "Protocol type", HFILL }}, { &hf_wai_subtype, { "Subtype", "wai.subtype", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wai_subtype_names_ext, 0x0, NULL, HFILL }}, { &hf_wai_reserved, { "Reserved", "wai.reserved", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_length, { "Length", "wai.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_seq, { "Sequence number", "wai.seq", FT_UINT16, BASE_DEC, NULL, 0x0, "Packet sequence number", HFILL }}, { &hf_wai_fragm_seq, { "Fragment sequence number", "wai.fragm.seq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_flag, { "Flag", "wai.flag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_data, { "Data", "wai.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_bk_rekeying_flag, {"BK rekeying", "wai.bk.rekeying.flag", FT_BOOLEAN, 8, TFS (&wai_bk_rekeying_flag), FLAG_BIT0, "BK rekeying flag", HFILL }}, { &hf_wai_preauthentication_flag, {"Pre-Authentication", "wai.preauthentication.flag", FT_BOOLEAN, 8, TFS (&wai_preauthentication_flag), FLAG_BIT1, "Pre-Authentication flag", HFILL }}, { &hf_wai_certificate_flag, {"Certificate", "wai.certificate.flag", FT_BOOLEAN, 8, TFS (&wai_certificate_flag), FLAG_BIT2, "Certificate flag", HFILL }}, { &hf_wai_optional_flag, {"Optional", "wai.optional.flag", FT_BOOLEAN, 8, TFS (&wai_optional_flag), FLAG_BIT3, "Optional flag", HFILL }}, { &hf_wai_usk_rekeying_flag, {"USK rekeying", "wai.usk.rekeying.flag", FT_BOOLEAN, 8, TFS (&wai_usk_rekeying_flag), FLAG_BIT4, "USK rekeying flag", HFILL }}, { &hf_wai_negotiation_flag, {"STA negotiation", "wai.negotiation.flag", FT_BOOLEAN, 8, TFS (&wai_negotiation_flag), FLAG_BIT5, "STA negotiation flag", HFILL }}, { &hf_wai_revoking_flag, {"STA revoking", "wai.revoking.flag", FT_BOOLEAN, 8, TFS (&wai_revoking_flag), FLAG_BIT6, "STA revoking flag", HFILL }}, { &hf_wai_reserved_flag, {"Reserved", "wai.reserved.flag", FT_BOOLEAN, 8, TFS (&wai_reserved_flag), FLAG_BIT7, "Reserved flag", HFILL }}, { &hf_wai_attr_type, { "Type", "wai.attrtype", FT_UINT8, BASE_HEX, VALS(wai_attr_type_names), 0x0, "Attribute type", HFILL }}, { &hf_wai_cert, {"Certificate", "wai.cert", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_cert_id, {"Id", "wai.cert.id", FT_UINT16, BASE_HEX, NULL, 0x0, "Certificate Id", HFILL }}, { &hf_wai_cert_data, {"Data", "wai.cert.data", FT_BYTES, BASE_NONE, NULL, 0x0, "Certificate data", HFILL }}, { &hf_wai_cert_len, {"Length", "wai.cert.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Certificate length", HFILL }}, { &hf_wai_addid, {"ADDID", "wai.addid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ae_mac, {"AE MAC", "wai.ae.mac", FT_ETHER, BASE_NONE, NULL, 0x0, "AE MAC address", HFILL }}, { &hf_wai_asue_mac, {"ASUE MAC", "wai.asue.mac", FT_ETHER, BASE_NONE, NULL, 0x0, "ASUE MAC address", HFILL }}, { &hf_wai_bkid, {"BKID", "wai.bkid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_uskid, {"USKID", "wai.uskid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_wie, {"WIE from ASUE", "wai.wie", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_message_auth_code, {"Message Authentication Code", "wai.message.auth.code", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_mskid, {"MSKID/STAKeyID", "wai.mskid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_data_pack_num, {"Data packet number", "wai.data.packet.num", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_key_data, {"Key Data", "wai.key.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_key_data_len, {"Length", "wai.key.data.len", FT_UINT8, BASE_DEC, NULL, 0x0, "Key data length", HFILL }}, { &hf_wai_key_data_content, {"Content", "wai.key.data.content", FT_BYTES, BASE_NONE, NULL, 0x0, "Key data content", HFILL }}, { &hf_wai_key_ann_id, {"Key Announcement Identifier", "wai.key.ann.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_auth_id, {"Authentication Identifier", "wai.auth.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity, {"Identifier", "wai.identity", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_id, {"Id", "wai.identity.id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_len, {"Length", "wai.identity.len", FT_UINT16, BASE_DEC, NULL, 0x0, "Identity length", HFILL }}, { &hf_wai_identity_data, {"Data", "wai.identity.data", FT_BYTES, BASE_NONE, NULL, 0x0, "Identity data", HFILL }}, { &hf_wai_ecdh, {"ECDH Parameter", "wai.ecdhp", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ecdh_id, {"ID", "wai.edch.id", FT_UINT8, BASE_HEX, NULL, 0x0, "ECDH Parameter Identifier", HFILL }}, { &hf_wai_ecdh_len, {"Length", "wai.ecdh.len", FT_UINT16, BASE_DEC, NULL, 0x0, "ECDH Parameter Length", HFILL }}, { &hf_wai_ecdh_content, {"Content", "wai.ecdh.content", FT_BYTES, BASE_NONE, NULL, 0x0, "ECDH Parameter Content", HFILL }}, { &hf_wai_counter, {"Replay counter", "wai.counter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sta_key_id, {"STAKeyID", "wai.sta.key.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_challenge, {"Challenge", "wai.challenge", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_cert_ver, {"Multiple Certificate Verification Result", "wai.cert.ver", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_nonce, {"Nonce", "wai.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_ver_res, {"Verification result", "wai.ver.res", FT_UINT8, BASE_HEX, VALS(wai_ver_res_names), 0x0, NULL, HFILL }}, { &hf_wai_sign_alg, {"Signature Algorithm", "wai.sign.alg", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_hash_alg_id, {"Hash Algorithm Identifier", "wai.hash.alg.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_alg_id, {"Signature Algorithm Identifier", "wai.sign.alg.id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param, {"Parameter", "wai.param", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param_id, {"Parameter Identifier", "wai.param.id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_param_content, {"Parameter Content", "wai.param.content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_val, {"Signature Value", "wai.sign.val", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign_content, {"Signature Content", "wai.sign.content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_sign, {"Signature", "wai.sign", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wai_identity_list, {"ASU List trusted by ASUE", "wai.identity_list", FT_BYTES, BASE_NONE, NULL, 0x0, "Identity list", HFILL }}, { &hf_wai_reserved_byte, {"Reserved", "wai.reserved.byte", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wai_no_of_ids, {"Number of Identities", "wai.no.of.ids", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wai_access_res, {"Access result", "wai.access_result", FT_UINT8, BASE_HEX, VALS(wai_access_res_names), 0x0, NULL, HFILL }}, { &hf_wai_fragments, {"Message fragments", "wai.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment, {"Message fragment", "wai.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_overlap, {"Message fragment overlap", "wai.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_overlap_conflicts, {"Message fragment overlapping with conflicting data", "wai.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_multiple_tails, {"Message has multiple tail fragments", "wai.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_too_long_fragment, {"Message fragment too long", "wai.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_error, {"Message defragmentation error", "wai.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_fragment_count, {"Message fragment count", "wai.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_wai_reassembled_in, {"Reassembled in", "wai.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_wai_reassembled_length, {"Reassembled length", "wai.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }} }; static gint *ett[] = { &ett_wai, &ett_wai_data, &ett_wai_flags, &ett_wai_certificate, &ett_wai_mac, &ett_wai_identity, &ett_wai_key_data, &ett_wai_ecdh_param, &ett_wai_certificate_verification, &ett_wai_identity_list, &ett_wai_sign, &ett_wai_sign_alg, &ett_wai_sign_val, &ett_wai_parameter, &ett_wai_fragment, &ett_wai_fragments }; proto_wai = proto_register_protocol("WAI Protocol", "WAI", "wai"); proto_register_field_array(proto_wai, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); reassembly_table_register(&wai_reassembly_table, &addresses_reassembly_table_functions); wai_handle = register_dissector("wai", dissect_wai, proto_wai); } void proto_reg_handoff_wai(void) { dissector_add_uint("ethertype", ETHERTYPE_WAI, wai_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wap.c
/* packet-wap.c * * Utility routines for WAP dissectors * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #ifdef DEBUG #include <stdio.h> #endif #include <epan/packet.h> #include "packet-wap.h" /* * Accessor to retrieve variable length int as used in WAP protocol. * The value is encoded in the lower 7 bits. If the top bit is set, then the * value continues into the next byte. * The octetCount parameter holds the number of bytes read in order to return * the final value. Can be pre-initialised to start at offset+count. * * XXX This seems to be used exclusively for fetching size values. We should * probably rename this to wap_get_checked_size or something along those lines. */ #define MAX_WAP_GUINTVAR (100 * 1000 * 1000) // Arbitrary. We need a large number that won't overflow a guint. guint tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount, packet_info *pinfo, expert_field *ei) { guint value = 0, previous_value; guint octet; guint counter = 0; #ifdef DEBUG fprintf (stderr, "dissect_wap: Starting tvb_get_guintvar at offset %d\n", offset); #endif do { octet = tvb_get_guint8 (tvb, offset+counter); counter++; previous_value = value; value <<= 7; /* Value only exists in 7 of the 8 bits */ value += (octet & 0x7F); if (value < previous_value || value > MAX_WAP_GUINTVAR) { /* overflow; clamp the value at UINT_MAX */ proto_tree_add_expert(NULL, pinfo, ei, tvb, offset, counter); value = MAX_WAP_GUINTVAR; break; } #ifdef DEBUG fprintf(stderr, "dissect_wap: computing: octet is %d (0x%02x), count=%d, value=%d\n", octet, octet, counter, value); #endif } while (octet & 0x80); #ifdef DEBUG fprintf (stderr, "dissect_wap: Leaving tvb_get_guintvar count=%d, value=%u\n", counter, value); #endif if (octetCount) *octetCount = counter; return value; } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wap.h
/* packet-wap.h * * Declarations for WAP packet disassembly * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_WAP_H__ #define __PACKET_WAP_H__ #include <glib.h> #include <epan/packet.h> #include <epan/expert.h> /* Port Numbers as per IANA */ /* < URL:http://www.iana.org/assignments/port-numbers/ > */ #define UDP_PORT_WSP 9200 /* wap-wsp */ #define UDP_PORT_WSP_RANGE "2948,9200" /* wap-wsp */ #define UDP_PORT_WTP_WSP 9201 /* wap-wsp-wtp */ #define UDP_PORT_WTLS_WSP 9202 /* wap-wsp-s */ #define UDP_PORT_WTLS_WTP_WSP 9203 /* wap-wsp-wtp-s */ #define UDP_PORT_WSP_PUSH 2948 /* wap-wsp */ #define UDP_PORT_WTLS_WSP_PUSH 2949 /* wap-wsp-s */ #define UDP_PORT_WTLS_RANGE "2949,9202-9203" /* wap-wsp */ /* * Note: * There are four dissectors for the WAP protocol: * WTLS * WTP * WSP * WMLC * Which of these are necessary is determined by the port number above. * I.e. port 9200 (wap-wsp) indicates WSP data and possibly WMLC (depending on * the WSP PDU). * Port 9203 (wap-wsp-wtp-s), on the other hand, has WTLS, WTP, WSP and * possibly WMLC data in that order in the packet. * * Therefore the dissectors are chained as follows: * * Port Dissectors * 9200 WSP -> WMLC * 9201 WTP -> WSP -> WMLC * 9202 WTLS -> WSP -> WMLC * 9203 WTLS -> WTP -> WSP -> WMLC * * 2948 WSP -> WMLC (Push) * 2949 WTLS -> WSP -> WMLC (Push) * * At present, only the unencrypted parts of WTLS can be analysed. Therefore * the WTP and WSP dissectors are not called. */ /* Utility function for reading Uintvar encoded values */ guint tvb_get_guintvar (tvbuff_t *, guint , guint *, packet_info *, expert_field *); /* * Misc TODO: * * WMLC Dissector * Check Protocol display * Check Protocol information display * Check CONNECT/CONNECT REPLY headers * Check add_headers code * Check Content-Length code * */ #endif /* packet-wap.h */
C
wireshark/epan/dissectors/packet-wassp.c
/* packet-wassp.c * Routines for the disassembly of the Chantry/Enterasys/ExtremeNetworks AP-Controller * tunneling protocol. * * By Zhong Wei Situ <[email protected]> * Copyright 2019 Extreme Networks * * SPDX-License-Identifier: GPL-2.0-or-later */ /* https://tools.ietf.org/html/draft-singh-capwap-ctp-02 looks very similar (but not always identical). AC: Access Controller MU: Mobile Unit (Wireless client) RU: Radio Unit (Access point) */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/show_exception.h> #include <epan/expert.h> #include <epan/reassemble.h> #include <epan/conversation.h> #define PROTO_SHORT_NAME "WASSP" #define PROTO_LONG_NAME "Wireless Access Station Session Protocol" #define LBS_HDR_MAGIC 0x7c83 #define MU_NETFLOW_RECORD_SIZE 46 #define WASSP_SNMP 161 /* TLV structure offsets. */ #define TLV_TYPE 0 #define TLV_LENGTH 2 #define TLV_VALUE 4 /* header lengths */ #define WASSP_HDR_LEN 8 #define RU_HEADER_WITH_MAC_LEN 16 #define RU_HEADER_WITHOUT_MAC_LEN 12 #define WASSP_MU_HDR_LEN 14 /* WASSP header offsets in bytes */ #define WASSP_HDR_VERSION 0 #define WASSP_HDR_TYPE 1 #define WASSP_HDR_SEQ_NUM 2 #define WASSP_HDR_FLAGS 3 #define WASSP_HDR_SESSIONID 4 #define WASSP_HDR_PLENGTH 6 /* RU Discover header offsets in bytes */ #define RU_HDR_VERSION 0 #define RU_HDR_TYPE 1 #define RU_HDR_RAD_NUM 2 #define RU_HDR_LENGTH 4 #define RU_HDR_CHECKSUM 6 #define RU_HDR_AC_OP 8 #define RU_HDR_MAC 10 #define RU_HDR_AC_MODE 10 #define RU_HDR_CONTAIN_MAC 1 /* MU NetFlow header offsets in bytes */ #define MU_NETFLOW_HDR_VERSION 0 #define MU_NETFLOW_HDR_LENGTH 2 #define MU_NETFLOW_HDR_FLAG 4 #define MU_NETFLOW_HDR_UPTIME 6 #define MU_NETFLOW_HEADER_TOTAL_LENGTH 10 /* WASSP MU header offsets in bytes */ #define WASSP_MU_HDR_TYPE 0 #define WASSP_MU_HDR_QOS 1 #define WASSP_MU_HDR_ACTION_SSID 2 #define WASSP_MU_HDR_MAC 4 #define WASSP_MU_HDR_RESV_0 10 #define WASSP_MU_HDR_RESV_1 12 #define WASSP_MU_HDR_WITH_ASSO_STATUS_LEN 15 #define WASSP_MU_HDR_WITHOUT_ASSO_STATUS_LEN 14 #define RU_WASSP_FLAGS_MORE_FRAGMENTS_FOLLOWING 0x01 #define RU_WASSP_FLAGS_NOT_FIRST_FRAGMENT 0x04 #define RU_WASSP_FLAGS_USE_FRAGMENTATION 0x08 #define RU_WASSP_FLAGS 0x3f #define RU_DISCOVER_OP_MODE 1 #define WASSP_MOBILITY 0x10 #define WASSP_DATA_FRAGMENT 0x2 /* Define WASSP UDP port */ #define UDP_PORT_WASSP 13910 #define PORT_WASSP_DISCOVER 13907 #define PORT_WASSP_RANGE "13907,13910" /* Not IANA registered */ #define WASSP_DATA_FRAGMENT_BIT 0x2 typedef struct tlv_mac_add { guint16 tlvType ; guint16 tlvLen; guint8 tlvMac[6/* MAC_ADDR_SIZE */]; } TLV_MAC_ADD; #define TLV_MAC_ADD_SIZE sizeof (TLV_MAC_ADD) typedef struct { guint16 tlvType; guint16 tlvLen; TLV_MAC_ADD tlvMacAddress; guint32 radioId; } TLV_RADIO_BLOCK; typedef struct tlvVnsBlock { guint16 tlvType; guint16 tlvLen; guint32 radioId; guint32 bssidId; guint32 ssidId; } TLV_VNS_BLOCK; typedef struct { TLV_MAC_ADD tlvMacAddress; TLV_RADIO_BLOCK tlvRadioB[2]; TLV_VNS_BLOCK tlvVnsB[16]; } tlvSsiddBssidMap; /* @*@ */ typedef struct { guint16 tlvId; char *name; guint16 type; guint16 length; #define WASSP_TAB_IDX length guint32 (*parseFunc)(void); guint32 (*setFunc)(void); guint32 offset; guint8 flags; guint32 minValue; guint32 maxValue; guint32 (*customCheckFunc)(void); } TLV_PARSER_ENTRY; /* @*@ */ #define TLV_TYPE_UNKNOWN 0 #define TLV_TYPE_STRING 1 //- PW_TYPE_STRING #define TLV_TYPE_INT 2 //- PW_TYPE_INTEGER #define TLV_TYPE_UINT 3 //- PW_TYPE_INTEGER #define TLV_TYPE_BOOL 4 //- PW_TYPE_INTEGER #define TLV_TYPE_OCTETS 5 //- PW_TYPE_OCTETS #define TLV_TYPE_MACADD 6 //- PW_TYPE_MACADD #define TLV_TYPE_BLOCK_TLV 7 #define TLV_TYPE_INDEX 8 //- PW_TYPE_INTEGER #define TLV_TYPE_IP_ADDR 9 //- PW_TYPE_INTEGER typedef enum { CONFIG_GLOBAL_BLOCK, CONFIG_ERROR_BLOCK, TAB_CONFIG_MODIFIED, RADIO_CONFIG_BLOCK, VNS_CONFIG_BLOCK, MU_RF_STATS_BLOCK, AP_STATS_BLOCK, STATS_MU_BLOCK, TAB_STATS_RADIO, TAB_STATS_ETH, TAB_STATS_WDS, TAB_STATS_DOT1x, TAB_CONFIG_FILTER, TAB_STATS_VNS, TAB_CONFIG_RADIUS_SERVER, TAB_CONFIG_SITE, TAB_CONFIG_POLICY, TAB_CONFIG_COS, TAB_CONFIG_LOC_BASE_LP, TAB_CONFIG_RADIUS, EVENT_BLOCK, TAB_SSS_MU_BLOCK, TAB_EID_MU_BLOCK, BULK_MU_BLOCK, MU_BLOCK, BULK_VNS_BLOCK, VNS_BLOCK, TAB_SIAPP_PMK_BLOCK, TAB_SIAPP_RADIO_CONFIG_BLOCK, TAB_SIAPP_MU_STATS_BLOCK, TAB_SIAPP_THIN_BLOCK, TAB_SIAPP_BLOCK, TAB_ASSOC_SSID_ARRAY, TAB_ASSOC_SSID_BLOCK, TAB_AP_LIST_BLOCK, TAB_AP_LIST_ARRAY, TAB_SCAN_PROFILE_BLOCK, TAB_THREAT_DEF_ARRAY, TAB_THREAT_DEF_BLOCK, TAB_THREAT_PATTERN_ARRAY, TAB_THREAT_PATTERN_BLOCK, TAB_SURVEILLANCE_DATA_ARRAY, TAB_SURVEILLANCE_DATA_BLOCK, TAB_THREAT_DATA_ARRAY, TAB_THREAT_DATA_BLOCK, TAB_THREAT_CLASSIFY_ARRAY, TAB_THREAT_CLASSIFY_BLOCK, TAB_USER_CLASSIFY_ARRAY, TAB_USER_CLASSIFY_BLOCK, TAB_MU_EVENT_ARRAY, TAB_MU_EVENT_BLOCK, TAB_COUNTRY_ARRAY, TAB_COUNTRY_BLOCK, TAB_LOCATOR_LOC_BLOCK, TAB_LOCATOR_LOC_ARRAY, TAB_RSS_DATA_ARRAY, TAB_RSS_DATA_BLOCK, TAB_MCAST_FILTER_BLOCK, TAB_MCAST_FILTER_BLOCK_ENTRY, TAB_MU_SESSION_ARRAY, TAB_MU_SESSION_BLOCK, TAB_DETECTED_ROGUE_ARRAY, TAB_DETECTED_ROGUE_BLOCK, TAB_FILTER_RULES_EXT_BLOCK, TAB_APP_POLICY_FIXED_BLOCK, TAB_V_FILTER_RULES_EXT_BLOCK, TAB_V_SITE_FILTER_RULES_EXT_BLOCK, TAB_APP_POLICY_ENTRY_BLOCK, TAB_11U_ANQP_BLOCK, TAB_HS2_BLOCK, TAB_RU_ACK_RADIO_CONFIG, TAB_MU_APPL_STATS_BLOCK, TAB_EXTAPP_CONF_BLOCK, TAB_V_CP_CONFIG_BLOCK, TAB_TOPOLOGY_ARRAY_BLOCK, TAB_TOPOLOGY_STRUCT_BLOCK, TAB_FILTER_CONFIG_STRUCT_BLOCK, TAB_S_TOPOLOGY_ARRAY_BLOCK, TAB_S_TOPOLOGY_STRUCT_BLOCK, TAB_S_TOPO_MCAST_FILTER_CONFIG_BLOCK, TAB_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK, TAB_NAC_SERVER_CONFIG_ARRAY, TAB_NAC_SERVER_CONFIG_BLOCK, TAB_NAC_WEB_AUTH_USER_GROUP_ARRAY, TAB_NAC_WEB_AUTH_USER_GROUP_BLOCK, TAB_MAX } WASSP_SUBTLV_TAB_e; /* Wassp RU Message/Header Types */ typedef enum { WASSP_RU_UNUSED_0 = 0, WASSP_RU_Discov, // 1 WASSP_RU_Register_Req, // 2 WASSP_RU_Register_Rsp, // 3 WASSP_RU_Authentication_Req, // 4 WASSP_RU_Authentication_Rsp, // 5 WASSP_RU_SW_Version_Validate_Req, // 6 WASSP_RU_SW_Version_Validate_Rsp, // 7 WASSP_RU_Config_Req, // 8 WASSP_RU_Config_Rsp, // 9 WASSP_RU_Ack, // 10 WASSP_RU_Config_Status_Notify, // 11 WASSP_RU_Set_State_Req, // 12 WASSP_RU_Set_State_Rsp, // 13 WASSP_RU_Stats_Notify, // 14 WASSP_Data, // 15 WASSP_RU_Poll, // 16 WASSP_RU_SNMP_Req, // 17 WASSP_RU_SNMP_Rsp, // 18 WASSP_BP_Trap_Notify, // 19 WASSP_BP_Scan_Req, // 20 WASSP_RFM_Notify, // 21 WASSP_RU_SNMP_Alarm_Notify, // 22 WASSP_RU_SNMP_Set_Alarm_Clear, // 23 WASSP_RU_SNMP_Set_Log_Status, // 24 WASSP_RU_SNMP_Get_Log_Req, // 25 WASSP_RU_SNMP_Get_Log_Resp, // 26 WASSP_SEC_Update_Notify, // 27 WASSP_RU_STATS_Req, // 28 WASSP_RU_STATS_Rsp, // 29 WASSP_RU_UNUSED_30, // 30 WASSP_RU_UNUSED_31, // 31 WASSP_RU_Get_Req, // 32 WASSP_RU_Get_Rsp, // 33 WASSP_RU_Alarm_Notify, // 34 WASSP_RU_Set_Alarm_Clear, // 35 WASSP_RU_Get_Log_Req, // 36 WASSP_RU_Get_Log_Rsp, // 37 WASSP_RU_UNUSED_38, // 38 WASSP_RU_UNUSED_39, // 39 WASSP_P_PEER_DOWN_NOTIFY, // 40 WASSP_P_LINK_STATE_CHANGE_REQ, // 41 WASSP_P_LINK_STATE_CHANGE_RSP, // 42 WASSP_RU_AC_Poll, // 43 WASSP_RU_GetIP_Req, // 44 WASSP_RU_GetIP_Rsp, // 45 WASSP_RU_LAMG_Update_Req, // 46 WASSP_RU_LAMG_Update_Rsp, // 47 WASSP_RU_Event_Req, // 48 WASSP_RU_Event_Rsp, // 49 WASSP_RU_BULK_MU_UPDATE_REQ, // 50 WASSP_RU_BULK_MU_UPDATE_RSP, // 51 WASSP_ROAMED_MU_FILTER_STATS_REQ, // 52 WASSP_ROAMED_MU_FILTER_STATS_RESP, // 53 WASSP_RU_UNUSED_54, // 54 WASSP_LBS_TAG_REPORT, // 55 WASSP_RU_AC_Event_Req, // 56 WASSP_RU_AC_Event_Rsp, // 57 WASSP_RU_Event_Notify, // 58 WASSP_RU_AC_EVENT, // 59 WASSP_WIDS_WIPS_Config_Req, // 60 WASSP_WIDS_WIPS_Config_Rsp, // 61 WASSP_Scan_Data_Notify, // 62 WASSP_Scan_Data_Notify_Ack, // 63 WASSP_Loc_Data_Notify, // 64 WASSP_Loc_Data_Notify_Ack, // 65 WASSP_RU_SW_Version_Validate_Ack, // 66 WASSP_NEIGHBOUR_STATS_Rsp, // 67 WASSP_APPL_STATS_RESP, // 68 WASSP_RU_Capture_Req, // 69 WASSP_RU_Capture_Rsp, // 70 /* AC/AC tunneling */ WASSP_AC_Register_Req = 101, // 101 WASSP_AC_Register_Rsp, // 102 WASSP_AC_Deregister_Req, // 103 WASSP_AC_Deregister_Rsp, // 104 WASSP_P_MAX } wassp_ru_msg_t; /* Value string object enumerates wassp header type field */ static const value_string wassp_header_types[] = { { WASSP_RU_UNUSED_0, "WASSP Reserved 0"}, { WASSP_RU_Discov, "WASSP RU Discover"}, { WASSP_RU_Register_Req, "RU Registration Request"}, { WASSP_RU_Register_Rsp, "RU Registration Response"}, { WASSP_RU_Authentication_Req, "RU Authentication Request"}, { WASSP_RU_Authentication_Rsp, "RU Authentication Response"}, { WASSP_RU_SW_Version_Validate_Req, "RU Software Version Report"}, { WASSP_RU_SW_Version_Validate_Rsp, "RU Software Version Command"}, { WASSP_RU_Config_Req, "RU Configuration Request"}, { WASSP_RU_Config_Rsp, "RU Configuration Response"}, { WASSP_RU_Ack, "RU Acknowledge"}, { WASSP_RU_Config_Status_Notify, "RU Configuration Status Notify"}, { WASSP_RU_Set_State_Req, "RU Set State Request"}, { WASSP_RU_Set_State_Rsp, "RU Set State Response"}, { WASSP_RU_Stats_Notify, "RU Statistics Notify"}, { WASSP_Data, "WASSP Data"}, { WASSP_RU_Poll, "RU Poll"}, { WASSP_RU_SNMP_Req, "SNMP Request"}, { WASSP_RU_SNMP_Rsp, "SNMP Response"}, { WASSP_BP_Trap_Notify, "BP Trap Notify"}, { WASSP_BP_Scan_Req, "BP Trap Notify"}, { WASSP_RFM_Notify, "RFM Notify"}, { WASSP_RU_SNMP_Alarm_Notify, "RU SNMP Alarm Notify"}, { WASSP_RU_SNMP_Set_Alarm_Clear, "RU SNMP Set Alarm"}, { WASSP_RU_SNMP_Set_Log_Status, "RU SNMP Set Log Status"}, { WASSP_RU_SNMP_Get_Log_Req, "RU SNMP Get Log Request"}, { WASSP_RU_SNMP_Get_Log_Resp, "RU SNMP Get Log Response"}, { WASSP_SEC_Update_Notify, "SEC Update Notify"}, { WASSP_RU_STATS_Req, "RU Statistics Request"}, { WASSP_RU_STATS_Rsp, "RU Statistics Response"}, { WASSP_RU_UNUSED_30, "WASSP MU Statistics Request" }, { WASSP_RU_UNUSED_31, "WASSP MU Statistics Response" }, { WASSP_RU_Get_Req, "Dot1x Get Request"}, { WASSP_RU_Get_Rsp, "Dot1x Get Response"}, { WASSP_RU_Alarm_Notify, "RU Alarm Notify"}, { WASSP_RU_Set_Alarm_Clear, "RU Set Alarm Clear"}, { WASSP_RU_Get_Log_Req, "RU Get Log Request"}, { WASSP_RU_Get_Log_Rsp, "RU Get Log Response"}, { WASSP_RU_UNUSED_38, "WASSP UNUSED 38"}, { WASSP_RU_UNUSED_39, "WASSP UNUSED 39"}, { WASSP_P_PEER_DOWN_NOTIFY, "Availability Peer Controller down Notify"}, { WASSP_P_LINK_STATE_CHANGE_REQ, "Availability Peer Controller Link State Change Request"}, { WASSP_P_LINK_STATE_CHANGE_RSP, "Availability Peer Controller Link State Change Response"}, { WASSP_RU_AC_Poll, "RU Poll Controller"}, { WASSP_RU_GetIP_Req, "RU Get IP Request"}, { WASSP_RU_GetIP_Rsp, "RU Get IP Response"}, { WASSP_RU_LAMG_Update_Req, "WASSP reserved"}, { WASSP_RU_LAMG_Update_Rsp, "WASSP reserved"}, { WASSP_RU_Event_Req, "RU Event Request"}, { WASSP_RU_Event_Rsp, "RU Event Response"}, { WASSP_RU_BULK_MU_UPDATE_REQ, "RU Bulk MUs Update Request"}, { WASSP_RU_BULK_MU_UPDATE_RSP, "RU Bulk MUs Update Response"}, { WASSP_ROAMED_MU_FILTER_STATS_REQ, "Roamed MU Filter Statistics Request"}, { WASSP_ROAMED_MU_FILTER_STATS_RESP, "Roamed MU Filter Statistics Response"}, { WASSP_RU_UNUSED_54, "WASSP reserved"}, { WASSP_LBS_TAG_REPORT, "Location Base Service Tag Report"}, { WASSP_RU_AC_Event_Req, "RU Alarm Clear Event Request"}, { WASSP_RU_AC_Event_Rsp, "RU Alarm Clear Event Response"}, { WASSP_RU_Event_Notify, "RU Event Notify"}, { WASSP_RU_AC_EVENT, "RU Alarm Clear Event"}, { WASSP_WIDS_WIPS_Config_Req, "WIDS WIPS Configuration Request"}, { WASSP_WIDS_WIPS_Config_Rsp, "WIDS WIPS Configuration Response"}, { WASSP_Scan_Data_Notify, "Scan Data Notify"}, { WASSP_Scan_Data_Notify_Ack, "Scan Data Notify Acknowledge"}, { WASSP_Loc_Data_Notify, "Location Data Notify"}, { WASSP_Loc_Data_Notify_Ack, "Location Data Notify Acknowledge"}, { WASSP_RU_SW_Version_Validate_Ack, "RU Software Version Validate Acknowledge"}, { WASSP_NEIGHBOUR_STATS_Rsp, "Neighbor Statistics Response"}, { WASSP_APPL_STATS_RESP, "Application Statistics Response"}, { WASSP_RU_Capture_Req, "RU Capture Request"}, { WASSP_RU_Capture_Rsp, "RU Capture Response"}, /* AC/AC tunneling */ { WASSP_AC_Register_Req, "Tunnel Register Request"}, { WASSP_AC_Register_Rsp, "Tunnel Register Response"}, { WASSP_AC_Deregister_Req, "Tunnel Deregister Request"}, { WASSP_AC_Deregister_Rsp, "Tunnel deregister Response"}, { 0, NULL } }; /* Wassp MU Header Types */ typedef enum { WASSP_MU_UNUSED_0 = 0, WASSP_MU_Associate_Req, // 1 WASSP_MU_Associate_Rsp, // 2 WASSP_MU_Data, // 3 WASSP_MU_Disconnect_Req, // 4 WASSP_MU_Disconnect_Rsp, // 5 WASSP_MU_Roam_Notify, // 6 WASSP_MU_Disconnect_Notify, // 7 WASSP_MU_INVALID_PMK_REQ, // 8 WASSP_MU_Update_Req, // 9 WASSP_MU_Update_Rsp, // 10 WASSP_MU_MIRRORN, // 11 WASSP_MU_NETFLOW, // 12 WASSP_MU_Radius_Update, // 13 WASSP_AP2AC_MU_Inform_Req, // 14 WASSP_AP2AC_MU_Inform_Rsp, // 15 WASSP_MU_Eap_Last, // 16 WASSP_MU_PMIRROR, // 17 WASSP_MU_UNUSED_18, // 18 WASSP_MU_UNUSED_19, // 19 WASSP_MU_UNUSED_20, // 20 WASSP_MU_UNUSED_21, // 21 WASSP_MU_UNUSED_22, // 22 WASSP_MU_UNUSED_23, // 23 WASSP_MU_UNUSED_24, // 24 WASSP_MU_UNUSED_25, // 25 WASSP_MU_UNUSED_26, // 26 WASSP_MU_UNUSED_27, // 27 WASSP_MU_UNUSED_28, // 28 WASSP_MU_UNUSED_29, // 29 WASSP_MU_STATS_Req, // 30 WASSP_MU_STATS_Rsp, // 31 WASSP_MU_UNUSED_32, // 32 WASSP_MU_UNUSED_33, // 33 WASSP_MU_UNUSED_34, // 34 WASSP_MU_UNUSED_35, // 35 WASSP_MU_UNUSED_36, // 36 WASSP_MU_UNUSED_37, // 37 WASSP_MU_BULK_Associate_Req, // 38 WASSP_MU_BULK_Associate_Rsp // 39 } wassp_mu_msg_t; /* Value string object enumerates wassp mu header type field */ static const value_string wassp_mu_header_types[] = { { WASSP_MU_UNUSED_0, "MU Unused 0"}, { WASSP_MU_Associate_Req, "MU Association Request"}, { WASSP_MU_Associate_Rsp, "MU Association Response"}, { WASSP_MU_Data, "MU Data"}, { WASSP_MU_Disconnect_Req, "MU Disconnect Request"}, { WASSP_MU_Disconnect_Rsp, "MU Disconnect Response"}, { WASSP_MU_Roam_Notify, "MU Roam Notify"}, { WASSP_MU_Disconnect_Notify, "MU Disconnect Notify"}, { WASSP_MU_INVALID_PMK_REQ, "MU Invalid PMK Request"}, { WASSP_MU_Update_Req, "MU Update Request"}, { WASSP_MU_Update_Rsp, "MU Update Response"}, { WASSP_MU_MIRRORN, "MU Mirror N"}, { WASSP_MU_NETFLOW, "MU Netflow"}, { WASSP_MU_Radius_Update, "MU Radius Update"}, { WASSP_AP2AC_MU_Inform_Req, "AccessPoint To Controller MU Info Request"}, { WASSP_AP2AC_MU_Inform_Rsp, "AccessPoint To Controller MU Info Response"}, { WASSP_MU_Eap_Last, "MU Extensible Authentication Protocol Last"}, { WASSP_MU_PMIRROR, "MU P Mirror"}, { WASSP_MU_UNUSED_18, "MU Unused 18"}, { WASSP_MU_UNUSED_19, "MU Unused 19"}, { WASSP_MU_UNUSED_20, "MU Unused 20"}, { WASSP_MU_UNUSED_21, "MU Unused 21"}, { WASSP_MU_UNUSED_22, "MU Unused 22"}, { WASSP_MU_UNUSED_23, "MU Unused 23"}, { WASSP_MU_UNUSED_24, "MU Unused 24"}, { WASSP_MU_UNUSED_25, "MU Unused 25"}, { WASSP_MU_UNUSED_26, "MU Unused 26"}, { WASSP_MU_UNUSED_27, "MU Unused 27"}, { WASSP_MU_UNUSED_28, "MU Unused 28"}, { WASSP_MU_UNUSED_29, "MU Unused 29"}, { WASSP_MU_STATS_Req, "MU Statistics Request"}, { WASSP_MU_STATS_Rsp, "MU Statistics Response"}, { WASSP_MU_UNUSED_32, "MU Unused 32"}, { WASSP_MU_UNUSED_33, "MU Unused 33"}, { WASSP_MU_UNUSED_34, "MU Unused 34"}, { WASSP_MU_UNUSED_35, "MU Unused 35"}, { WASSP_MU_UNUSED_36, "MU Unused 36"}, { WASSP_MU_UNUSED_37, "MU Unused 37"}, { WASSP_MU_BULK_Associate_Req, "MU Bulk Associate Request"}, { WASSP_MU_BULK_Associate_Rsp, "MU Bulk Associate Response"}, { 0, NULL } }; /***************************************************** * Main TLVs ****************************************************/ /* TLV Header Types */ typedef enum { EID_UNUSED_0 = 0, // 0 EID_STATUS, // 1 EID_RU_SW_VERSION, // 2 EID_RU_SERIAL_NUMBER, // 3 EID_RU_REG_CHALLENGE, // 4 EID_RU_REG_RESPONSE, // 5 EID_AC_IPADDR, // 6 EID_RU_VNSID, // 7 EID_TFTP_SERVER, // 8 EID_IMAGE_PATH, // 9 EID_CONFIG, // 10 EID_RU_STATE, // 11 EID_SESSION_KEY, // 12 EID_RU_PROTOCOL, // 13 EID_RANDOM_NUMBER, // 14 EID_STANDBY_TIMEOUT, // 15 EID_RU_CHALLENGE_ID, // 16 EID_RU_MODEL, // 17 EID_RU_SCAN_MODE, // 18 EID_RU_SCAN_TYPE, // 19 EID_RU_SCAN_INTERVAL, // 20 EID_RU_RADIO_TYPE, // 21 EID_RU_CHANNEL_DWELL_TIME, // 22 EID_RU_CHANNEL_LIST, // 23 EID_RU_TRAP, // 24 EID_RU_SCAN_TIMES, // 25 EID_RU_SCAN_DELAY, // 26 EID_RU_SCAN_REQ_ID, // 27 EID_STATIC_CONFIG, // 28 EID_LOCAL_BRIDGING, // 29 EID_STATIC_BP_IPADDR, // 30 EID_STATIC_BP_NETMASK, // 31 EID_STATIC_BP_GATEWAY, // 32 EID_STATIC_BM_IPADDR, // 33 EID_BP_BPSSID, // 34 EID_BP_WIRED_MACADDR, // 35 EID_RU_CAPABILITY, // 36 EID_RU_SSID_NAME, // 37 EID_ALARM, // 38 EID_RU_PREAUTH, // 39 EID_RU_PMK, // 40 EID_AC_REG_CHALLENGE, // 41 EID_AC_REG_RESPONSE, // 42 EID_STATS, // 43 EID_CERTIFICATE, // 44 EID_RADIO_ID, // 45 EID_REQ_ID, // 46 EID_NETWORK_ID, // 47 EID_MU_MAC, // 48 EID_TIME, // 49 EID_NUM_RADIOS, // 50 EID_RADIO_INFO, // 51 EID_NETWORK_INFO, // 52 EID_VENDOR_ID, // 53 EID_PRODUCT_ID, // 54 EID_RADIO_INFO_ACK, // 55 EID_SECURE_TUNNEL, // 56 EID_MU_TOPOLOGY_ID, // 57 EID_SSID, // 58 EID_EVENT_BLOCK, // 59 EID_SNMP_ERROR_STATUS, // 60 EID_SNMP_ERROR_INDEX, // 61 EID_RU_REAUTH_TIMER, // 62 EID_AP_IMG_TO_RAM, // 63 EID_AP_IMG_ROLE, // 64 EID_AP_STATS_BLOCK, // 65 EID_MU_RF_STATS_BLOCK, // 66 EID_STATS_REQUEST_TYPE, // 67 EID_STATS_LAST, // 68 EID_TLV_CONFIG, // 69 EID_CONFIG_ERROR_BLOCK, // 70 EID_CONFIG_MODIFIED_BLOCK, // 71 EID_MU_PMKID_LIST, // 72 EID_MU_PMK_BP, // 73 EID_MU_PMKID_BP, // 74 EID_COUNTDOWN_TIME, // 75 EID_WASSP_VLAN_TAG, // 76 EID_SSID_ID, // 77 EID_BULK_MU_BLOCK, // 78 EID_MU_BLOCK, // 79 EID_PORT_OPEN_FLAG, // 80 EID_WASSP_TUNNEL_TYPE, // 81 EID_LOG_TYPE, // 82 EID_LOG_FILE, // 83 EID_ALARM_SEVERITY, // 84 EID_ALARM_DESCRIPTION, // 85 EID_BULK_VNS_BLOCK, // 86 EID_VNS_BLOCK, // 87 EID_AP_DHCP_MODE, // 88 EID_AP_IPADDR, // 89 EID_AP_NETMASK, // 90 EID_AP_GATEWAY, // 91 EID_BSSID2IP_BLOCK, // 92 EID_RU_BACKUP_VERSION, // 93 EID_AC_SW_VERSION, // 94 EID_MCAST_LAMG_LIST, // 95 EID_FILTER_NAME, // 96 EID_FILTER_RULES, // 97 EID_AUTH_STATE, // 98 EID_MU_DISC_AFTER_AUTH, // 99 EID_MU_MAC_LIST, // 100 EID_TRANS_ID, // 101 EID_TIMEZONE_OFFSET, // 102 EID_SENSOR_FORCE_DOWNLOAD, // 103 EID_SENSOR_IMG_VERSION, // 104 EID_BRIDGE_MODE, // 105 EID_MU_VLAN_TAG, // 106 EID_RATECTRL_CIR_UL, // 107 EID_RATECTRL_CIR_DL, // 108 EID_RATECTRL_CBS_UL, // 109 EID_RATECTRL_CBS_DL, // 110 EID_RATECTRL_NAME_UL, // 111 EID_RATECTRL_NAME_DL, // 112 EID_POLICY_NAME, // 113 EID_SIAPP_PMK_BLOCK, // 114 EID_SIAPP_PMKID, // 115 EID_SIAPP_PMK_REAUTH, // 116 EID_SIAPP_PMK_LIFETIME, // 117 EID_SIAPP_PMKID_FLAG, // 118 EID_SIAPP_MU_PMK, // 119 EID_SIAPP_AP_NAME, // 120 EID_SIAPP_RADIO_CONFIG_BLOCK, // 121 EID_SIAPP_CLUSTER_ACS_REQ, // 122 EID_SIAPP_SIAPP_MU_STATS_BLOCK, // 123 EID_SIAPP_PACKET_RETRIES, // 124 EID_SIAPP_ASSOC_IN_WLAN, // 125 EID_SIAPP_ASSOC_IN_CLUSTER, // 126 EID_SIAPP_REASSOC_IN_CLUSTER, // 127 EID_SIAPP_THIN_BLOCK, // 128 EID_SIAPP_NEWAP_BSSID, // 129 EID_SIAPP_OLDAP_BSSID, // 130 EID_SIAPP_RAD_CACS_REQ, // 131 EID_SIAPP_RADIOBLOCK, // 132 EID_SIAPP_CLIENT_COUNT, // 133 EID_SIAPP_BLOCK, // 134 EID_SIAPP_MU_TransmittedFrameCount, // 135 EID_SIAPP_MU_ReceivedFrameCount, // 136 EID_SIAPP_MU_TransmittedBytes, // 137 EID_SIAPP_MU_ReceivedBytes, // 138 EID_SIAPP_MU_UL_DroppedRateControlPackets, // 139 EID_SIAPP_MU_DL_DroppedRateControlPackets, // 140 EID_SIAPP_MU_DL_DroppedBufferFullPackets, // 141 EID_SIAPP_MU_DL_LostRetriesPackets, // 142 EID_SIAPP_MU_UL_DroppedRateControlBytes, // 143 EID_SIAPP_MU_DL_DroppedRateControlBytes, // 144 EID_SIAPP_MU_DL_DroppedBufferFullBytes, // 145 EID_SIAPP_MU_DL_LostRetriesBytes, // 146 EID_SIAPP_BP_BSSID, // 147 EID_SIAPP_RADIO_ID, // 148 EID_SIAPP_MACADDR, // 149 EID_SIAPP_PREAUTH_REQ, // 150 EID_SIAPP_USER_IDENTITY, // 151 EID_SIAPP_LOADBAL_BLOCK, // 152 EID_SIAPP_LOADBAL_PKT_TYPE, // 153 EID_SIAPP_LOADBAL_LOADGROUP_ID, // 154 EID_SIAPP_LOADBAL_LOAD_VALUE, // 155 EID_SIAPP_AC_MGMT_MAC, // 156 EID_SIAPP_FILTER_COS, // 157 EID_COS, // 158 EID_RATE_LIMIT_RESOURCE_TBL, // 159 EID_UCAST_FILTER_DISABLE, // 160 EID_MU_INFORM_REASON, // 161 EID_MU_FILTER_POLICY_NAME, // 162 EID_MU_TOPOLOGY_POLICY_NAME, // 163 EID_MU_COS_POLICY_NAME, // 164 EID_MU_FILTER_KEY, // 165 EID_MU_TOPOLOGY_KEY, // 166 EID_MU_COS_KEY, // 167 EID_MU_SESSION_TIMEOUT, // 168 EID_MU_ACCOUNTING_CLASS, // 169 EID_MU_LOGIN_LAT_PORT, // 170 EID_MU_IDLE_TIMEOUT, // 171 EID_MU_ACCT_INTERIM_INTERVAL, // 172 EID_MU_IP_ADDR, // 173 EID_MU_TERMINATE_ACTION, // 174 EID_SITE_NAME, // 175 EID_PEER_SITE_IP, // 176 EID_INTERFERENCE_EVENTS_ENABLE, // 177 EID_EVENT_TYPE, // 178 EID_EVENT_CHANNEL, // 179 EID_EVENT_VALUE, // 180 EID_SSS_MU_BLOCK, // 181 EID_SSS_MU_ASSOC_TIME, // 182 EID_SSS_TS64_MU_UPDATE, // 183 EID_SSS_TS64_AP_CURRENT, // 184 EID_SSS_MU_AUTH_STATE, // 185 EID_SSS_AP_HOMEHASH, // 186 EID_TIME_FIRST_DETECTED, // 187 EID_TIME_LAST_REPORTED, // 188 EID_EVENT_ARRAY, // 189 EID_SSS_DEFAULT_SESSION_TIMEOUT, // 190 EID_SSS_SSID, // 191 EID_SSS_PRIVACY_TYPE, // 192 EID_POLICY_ZONE_NAME, // 193 EID_RU_AC_EVENT_COMPONENT_ID, // 194 EID_MU_AUTH_STATE, // 195 EID_MU_USER_NAME, // 196 EID_BULK_TYPE, // 197 EID_SENT_TIME, // 198 EID_INFORM_MU_PMK, // 199 EID_COLLECTOR_IP_ADDR, // 200 EID_ARP_PROXY, // 201 EID_MCAST_FILTER_RULES, // 202 EID_AP_PARAMS, // 203 EID_ASSOC_SSID_ARRAY, // 204 EID_ASSOC_SSID_BLOCK, // 205 EID_AP_LIST_BLOCK, // 206 EID_AP_LIST_ARRAY, // 207 EID_MAC_ADDR, // 208 EID_SCAN_PROFILE_ID, // 209 EID_ACTION_REQ, // 210 EID_CHANNEL_LIST, // 211 EID_COUNTERMEASURES_MAX_CH, // 212 EID_COUNTERMEASURES_SET, // 213 EID_SCAN_PROFILE_BLOCK, // 214 EID_SEQ_NUM, // 215 EID_THREAT_DEF_ARRAY, // 216 EID_THREAT_DEF_BLOCK, // 217 EID_THREAT_TYPE, // 218 EID_THREAT_ID, // 219 EID_THREAT_STATS_F, // 220 EID_THREAT_FR_SFR, // 221 EID_THREAT_PATTERN_ARRAY, // 222 EID_THREAT_PATTERN_BLOCK, // 223 EID_THREAT_PATTERN, // 224 EID_THREAT_ALERT_TH_DUR, // 225 EID_THREAT_CLEAR_TH_DUR, // 226 EID_THREAT_PRIORITY, // 227 EID_THREAT_MITIGATION_LIST, // 228 EID_SSS_MU_IS_PORT_CLOSED, // 229 EID_FULL_UPDATE, // 230 EID_REASON, // 231 EID_SURVEILLANCE_DATA_ARRAY, // 232 EID_SURVEILLANCE_DATA_BLOCK, // 233 EID_SCAN_BSSID, // 234 EID_PARAMS, // 235 EID_SCAN_RSS_RSSI, // 236 EID_SCAN_SSID, // 237 EID_SCAN_CAP, // 238 EID_THREAT_CLASSIFICATION, // 239 EID_THREAT_DATA_ARRAY, // 240 EID_THREAT_DATA_BLOCK, // 241 EID_STATE, // 242 EID_DROP_FR_CNT, // 243 EID_STOP_ROAM_CNT, // 244 EID_SPOOF_CNT, // 245 EID_THREAT_CLASSIFY_ARRAY, // 246 EID_THREAT_CLASSIFY_BLOCK, // 247 EID_THREAT_NAME, // 248 EID_LOCATION, // 249 EID_ENCRYPTION_TYPE, // 250 EID_MU_EVENT_ARRAY, // 251 EID_MU_EVENT_BLOCK, // 252 EID_COMPONENT_ID, // 253 EID_MU_EVENT_STRING, // 254 EID_BYPASS_BMCAST, // 255 EID_GETTIMEOFDAY, // 256 EID_COUNTRY_ID, // 257 EID_COUNTRY_ARRAY, // 258 EID_COUNTRY_BLOCK, // 259 EID_MU_EVENT_TYPE, // 260 EID_LOCATOR_FLOOR_ID, // 261 EID_LOCATOR_LOC_TYPE, // 262 EID_LOCATOR_LOC_BLOCK, // 263 EID_LOCATOR_LOC_ARRAY, // 264 EID_LOCATOR_LOC_POINT, // 265 EID_MU_EVENT_DETAILS, // 266 EID_MU_EVENT_FROM_AP, // 267 EID_MU_EVENT_LOC_BLOCK, // 268 EID_LOCATOR_LOC_AP_DISTANCE, // 269 EID_LOCATOR_LOC_PRECISION, // 270 EID_RSS_DATA_ARRAY, // 271 EID_RSS_DATA_BLOCK, // 272 EID_LOCATOR_MU_ACTION, // 273 EID_EFFECTIVE_EGRESS_VLAN, // 274 EID_REBOOT_ACK, // 275 EID_MU_BSSID, // 276 EID_AUTH_FLAG, // 277 EID_ROAMED_FLAG, // 278 EID_MU_RSS, // 279 EID_FILTER_RULES_VER, // 280 EID_FILTER_TYPE, // 281 EID_MCAST_FILTER_BLOCK, // 282 EID_MCAST_FILTER_BLOCK_ENTRY, // 283 EID_DEFAULT_ACTION_TYPE, // 284 EID_DEFAULT_CONTAIN_TO_VLAN, // 285 EID_DEFAULT_BRIDGE_MODE, // 286 EID_INVALID_POLICY, // 287 EID_LOCATOR_FLOOR_NAME, // 288 EID_AP_FLAGS, // 289 EID_AP_PVID, // 290 EID_AP_REDIRECT, // 291 EID_MU_CVLAN_BAP, // 292 EID_MU_SESSION_ARRAY, // 293 EID_MU_SESSION_BLOCK, // 294 EID_MU_SESSION_ID, // 295 EID_MU_RFS_NAME, // 296 EID_MU_FLAGS, // 297 EID_MU_ASSOC_TIME, // 298 EID_MU_ACTIVE_TIME, // 299 EID_REPORT_REQ, // 300 EID_MU_URL, // 301 EID_MU_SESSION_LIFETIME, // 302 EID_MU_REAUTH_TIMER, // 303 EID_MU_ACCT_SESSION_ID_STRING, // 304 EID_MU_ACCT_POLICY_NAME, // 305 EID_MU_ACCT_START_TIME, // 306 EID_MU_ACCT_CLASS, // 307 EID_MU_LOGIN_LAT_GROUP, // 308 EID_MU_TUNNEL_PRIVATE_GROUP_ID_STRING, // 309 EID_MU_USER_ID_STRING, // 310 EID_MU_DEFENDED_STATE, // 311 EID_MU_MOD_MASK, // 312 EID_LOCATOR_TRACKED, // 313 EID_PORT, // 314 EID_RETRIES_COUNT, // 315 EID_MODULATION_TYPE, // 316 EID_DETECTED_ROGUE_ARRAY, // 317 EID_DETECTED_ROGUE_BLOCK, // 318 EID_ROGUE_DETECTION, // 319 EID_MAC_ADDR_TX, // 320 EID_MAC_ADDR_RX, // 321 EID_IP_ADDR_TX, // 322 EID_IP_ADDR_RX, // 323 EID_TTL, // 324 EID_GW_IP_ADDR, // 325 EID_LOCATOR_STATE_DATA, // 326 EID_LOCATOR_POINT_SET, // 327 EID_FILTER_RULE_FIXED_APP_ID, // 328 EID_FILTER_RULES_EXT_BLOCK, // 329 EID_MU_AREA_BLOCK, // 330 EID_MU_LOCATION, // 331 EID_MU_LOCATION_TS, // 332 EID_DNS_IP_ADDR, // 333 EID_IN_SERVICE_AP_LIST, // 334 EID_OUT_SERVICE_AP_LIST, // 335 EID_LAST_RD_AP, // 336 EID_ROGUE_INFO, // 337 EID_MU_IS_FT, // 338 EID_MU_PMK_R1, // 339 EID_SIAPP_R0KHID, // 340 EID_SIAPP_R1KHID, // 341 EID_SIAPP_FT_NONCE, // 342 EID_SIAPP_FT_PMKR0NAME, // 343 EID_SIAPP_FT_R1KHID, // 344 EID_SIAPP_FT_S1KHID, // 345 EID_SIAPP_FT_PMKR1, // 346 EID_SIAPP_FT_PMKR1NAME, // 347 EID_SIAPP_FT_PAIRWISE, // 348 EID_SIAPP_FT_LIFETIME, // 349 EID_MU_POWER_CAP, // 350 EID_AREA_NAME, // 351 EID_PERIODIC_NEIGHBOUR_REPORT, // 352 EID_TIMESTAMP, // 353 EID_NEIGHBOUR_ENTRY, // 354 EID_MU_REQ, // 355 EID_RU_REQ, // 356 EID_NEIGHBOUR_REQ, // 357 EID_SSS_FT_ASSOC, // 358 EID_DEFAULT_MIRRORN, // 359 EID_FILTER_RULE_EXT_ACT_FLAGS, // 360 EID_TOPO_GROUP_MAPPING, // 361 EID_MU_PMK_R0NAME, // 362 EID_CUI, // 363 EID_SSS_CAPINFO, // 364 EID_SSS_CAPPOWER, // 365 EID_WFA_VSA, // 366 EID_WFA_HS20_REMED_METHOD, // 367 EID_WFA_HS20_URL, // 368 EID_WFA_HS20_DEAUTH_CODE, // 369 EID_WFA_HS20_REAUTH_DELAY, // 370 EID_WFA_HS20_SWT, // 371 EID_POWER_STATUS, // 372 EID_IPV6_ADDR, // 373 EID_FILTER_RULES_APP_SIG_GROUP_ID, // 374 EID_FILTER_RULES_APP_SIG_DISP_ID, // 375 EID_MU_DEV_IDENTITY, // 376 EID_APPL_STATS_REQ, // 377 EID_MU_APPL_STATS_BLOCK, // 378 EID_TOPOLOGY_ARRAY, // 379 EID_TOPOLOGY_STRUCT, // 380 EID_FILTER_CONFIG_STRUCT, // 381 EID_DHCP_HOST_NAME, // 382 EID_NEIGHBOUR_ENTRY_2, // 383 EID_CHANNEL_ENTRY, // 384 EID_MU_ECP_PW, // 385 EID_MU_ECP_TOKEN, // 386 EID_STATIC_VSA_IPADDR, // 387 EID_STATIC_VSA_NETMASK, // 388 EID_PKT_CAPTURE_STATUS, // 389 EID_PKT_CAPTURE_FILTERS, // 390 EID_PKT_F_WIRELESS, // 391 EID_PKT_F_WIREDCLIENT, // 392 EID_PKT_F_DIRECTION, // 393 EID_PKT_F_RADIO, // 394 EID_PKT_F_FLAGS, // 395 EID_PKT_F_IP_ARRAY, // 396 EID_PKT_F_MAC, // 397 EID_PKT_F_PROTOCOL, // 398 EID_PKT_F_PORT, // 399 EID_VSA_SSID_ID, // 400 EID_MU_AUTH_TYPE, // 401 EID_PKT_F_MAX_PKT_COUNT, // 402 EID_PKT_F_FLAG_2, // 403 EID_IMAGE_PORT, // 404 EID_FILTER_ROLE_ID, // 405 EID_FILTER_ROLE_TIMESTAMP, // 406 EID_MAX } wassp_tlv_type_t; /* Value string object enumerates wassp tlv type field */ static const value_string wassp_tlv_types[] = { { EID_STATUS, "Status/Action"}, { EID_RU_SW_VERSION, "Software Version"}, { EID_RU_SERIAL_NUMBER, "Serial Number"}, { EID_RU_REG_CHALLENGE, "Registration Challenge"}, { EID_RU_REG_RESPONSE, "Challenge Response"}, { EID_AC_IPADDR, "Controller IP Address"}, { EID_RU_VNSID, "AccessPoint VNS ID"}, { EID_TFTP_SERVER, "TFTP Server Address"}, { EID_IMAGE_PATH, "Path/Filename of Upgrade Image"}, { EID_CONFIG, "SNMP Encoded Configuration"}, { EID_RU_STATE, "AccessPoint State"}, { EID_SESSION_KEY, "Binding Key"}, { EID_RU_PROTOCOL, "Message Type"}, { EID_RANDOM_NUMBER, "Random Number"}, { EID_STANDBY_TIMEOUT, "Standby Timeout"}, { EID_RU_CHALLENGE_ID, "AccessPoint Challenge ID"}, { EID_RU_MODEL, "AccessPoint Model"}, { EID_RU_SCAN_MODE, "AccessPoint Scan Mode"}, { EID_RU_SCAN_TYPE, "AccessPoint Scan Type"}, { EID_RU_SCAN_INTERVAL, "AccessPoint Scan Interval"}, { EID_RU_RADIO_TYPE, "AccessPoint Radio Type"}, { EID_RU_CHANNEL_DWELL_TIME, "AccessPoint Channel Dwell Time"}, { EID_RU_CHANNEL_LIST, "AccessPoint Channel List"}, { EID_RU_TRAP, "AccessPoint Trap"}, { EID_RU_SCAN_TIMES, "AccessPoint Scan Times"}, { EID_RU_SCAN_DELAY, "AccessPoint Scan Delay"}, { EID_RU_SCAN_REQ_ID, "AccessPoint Scan Request ID"}, { EID_STATIC_CONFIG, "Static Configuration"}, { EID_LOCAL_BRIDGING, "Local Bridging"}, { EID_STATIC_BP_IPADDR, "Static AccessPoint IP Address"}, { EID_STATIC_BP_NETMASK, "Static AccessPoint NetMask"}, { EID_STATIC_BP_GATEWAY, "Static AccessPoint Gateway"}, { EID_STATIC_BM_IPADDR, "Static Controller IP Address"}, { EID_BP_BPSSID, "AccessPoint BSSID"}, { EID_BP_WIRED_MACADDR, "AccessPoint Wired MAC"}, { EID_RU_CAPABILITY, "AccessPoint Capability"}, { EID_RU_SSID_NAME, "AccessPoint SSID Name"}, { EID_ALARM, "Alarm"}, { EID_RU_PREAUTH, "AccessPoint Preauthorization"}, { EID_RU_PMK, "AccessPoint Pairwise Master Key"}, { EID_AC_REG_CHALLENGE, "Controller Register Challenge"}, { EID_AC_REG_RESPONSE, "Controller Register Response"}, { EID_STATS, "Stats"}, { EID_CERTIFICATE, "Certificate"}, { EID_RADIO_ID, "Radio ID"}, { EID_REQ_ID, "Request ID"}, { EID_NETWORK_ID, "Network ID"}, { EID_MU_MAC, "MU MAC Address"}, { EID_TIME, "Time"}, { EID_NUM_RADIOS, "Number of Radios"}, { EID_RADIO_INFO, "Radio Info"}, { EID_NETWORK_INFO, "Network Info"}, { EID_VENDOR_ID, "Vendor ID"}, { EID_PRODUCT_ID, "Product ID"}, { EID_RADIO_INFO_ACK, "Radio Info Acknowledge"}, { EID_SECURE_TUNNEL, "Secure Tunnel"}, { EID_MU_TOPOLOGY_ID, "MU Topology ID"}, { EID_SSID, "SSID"}, { EID_EVENT_BLOCK, "Event Block"}, { EID_SNMP_ERROR_STATUS, "SNMP Error Status"}, { EID_SNMP_ERROR_INDEX, "SNMP Error Index"}, { EID_RU_REAUTH_TIMER, "AccessPoint ReAuthentication Timer"}, { EID_AP_IMG_TO_RAM, "AccessPoint Image Store to RAM"}, { EID_AP_IMG_ROLE, "AccessPoint Image Type"}, { EID_AP_STATS_BLOCK, "AccessPoint Statistics Block"}, { EID_MU_RF_STATS_BLOCK, "AccessPoint RF Statistics Block"}, { EID_STATS_REQUEST_TYPE, "AccessPoint Statistics Request Type"}, { EID_STATS_LAST, "AccessPoint Statistics Last Flag"}, { EID_TLV_CONFIG, "TLV Configuration"}, { EID_CONFIG_ERROR_BLOCK, "AccessPoint Configuration Error Block"}, { EID_CONFIG_MODIFIED_BLOCK, "AccessPoint Configuration Modified Block"}, { EID_MU_PMKID_LIST, "MU Pairwise Master Key List"}, { EID_MU_PMK_BP, "MU and AccessPoint Pairwise Master Key"}, { EID_MU_PMKID_BP, "MU and AccessPoint Pairwise Master Key ID"}, { EID_COUNTDOWN_TIME, "CountDown Time"}, { EID_WASSP_VLAN_TAG, "VLAN Tag"}, { EID_SSID_ID, "SSID(Service Set Identifier)"}, { EID_BULK_MU_BLOCK, "Bulk MU Block"}, { EID_MU_BLOCK, "MU Block" }, { EID_PORT_OPEN_FLAG, "Port Open Flag"}, { EID_WASSP_TUNNEL_TYPE, "Tunnel Type"}, { EID_LOG_TYPE, "Log type"}, { EID_LOG_FILE, "Log File"}, { EID_ALARM_SEVERITY, "Alarm Severity"}, { EID_ALARM_DESCRIPTION, "Alarm Information"}, { EID_BULK_VNS_BLOCK, "Bulk VNS Block"}, { EID_VNS_BLOCK, "VNS Block"}, { EID_AP_DHCP_MODE, "AccessPoint DHCP Mode"}, { EID_AP_IPADDR, "AccessPoint IP Address"}, { EID_AP_NETMASK, "AccessPoint IP Netmask"}, { EID_AP_GATEWAY, "AccessPoint IP Gateway"}, { EID_BSSID2IP_BLOCK, "BSSID to IP Address Mapping Block"}, { EID_RU_BACKUP_VERSION, "AccessPoint Upgrade: Software Version of The Backup Image"}, { EID_AC_SW_VERSION, "AccessPoint Upgrade: Software Version"}, { EID_MCAST_LAMG_LIST, "Multicast Optimization"}, { EID_FILTER_NAME, "Filter Rule Name"}, { EID_FILTER_RULES, "Array of Filter Rules"}, { EID_AUTH_STATE, "Authentication State( MU Not Authenticate = 0, ANON_AUTHENTICATED=0, MU Authenticated = 1"}, { EID_MU_DISC_AFTER_AUTH, "After Authenticated MU State( Disconnected = 0, Connected = 1"}, { EID_MU_MAC_LIST, "Array of MAC Addresses"}, { EID_TRANS_ID, "Transaction ID of The Message Determined At The Home Controller"}, { EID_TIMEZONE_OFFSET, "Timezone Offset"}, { EID_SENSOR_FORCE_DOWNLOAD, "Force Download of Sensor Image"}, { EID_SENSOR_IMG_VERSION, "Sensor Image Version"}, { EID_BRIDGE_MODE, "Bridge Mode"}, { EID_MU_VLAN_TAG, "MU VLAN Tag"}, { EID_RATECTRL_CIR_UL, "Up Link Bandwidth Control: Committed Information Rate (CIR)"}, { EID_RATECTRL_CIR_DL, "Down Link Bandwidth Control: Committed Information Rate (CIR)"}, { EID_RATECTRL_CBS_UL, "Up Link Bandwidth Control: Committed Burst Size (CBS)"}, { EID_RATECTRL_CBS_DL, "Down Link Bandwidth Control: Committed Burst Size (CBS)"}, { EID_RATECTRL_NAME_UL, "Up Link Bandwidth Control Profile Name"}, { EID_RATECTRL_NAME_DL, "Down Link Bandwidth Control Profile Name"}, { EID_POLICY_NAME, "Policy Profile Name"}, { EID_SIAPP_PMK_BLOCK, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key Block"}, { EID_SIAPP_PMKID, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ID"}, { EID_SIAPP_PMK_REAUTH, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ReAuthenticate"}, { EID_SIAPP_PMK_LIFETIME, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key Life Time"}, { EID_SIAPP_PMKID_FLAG, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ID Flag"}, { EID_SIAPP_MU_PMK, "MU Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key"}, { EID_SIAPP_AP_NAME, "SIAPP AP Name"}, { EID_SIAPP_RADIO_CONFIG_BLOCK, "SIAPP Radio Configuration Block"}, { EID_SIAPP_CLUSTER_ACS_REQ, "SIAPP Cluster ACS Request"}, { EID_SIAPP_SIAPP_MU_STATS_BLOCK, "SIAPP MU Statistics Block"}, { EID_SIAPP_PACKET_RETRIES, "SIAPP Packet Retries"}, { EID_SIAPP_ASSOC_IN_WLAN, "SIAPP MU Association With In Same WLAN"}, { EID_SIAPP_ASSOC_IN_CLUSTER, "SIAPP MU Association With In Same Cluster"}, { EID_SIAPP_REASSOC_IN_CLUSTER, "SIAPP MU Reassociation With In Same Cluster"}, { EID_SIAPP_THIN_BLOCK, "SIAPP Thin Access Points Block"}, { EID_SIAPP_NEWAP_BSSID, "SIAPP New Access Points BSSID"}, { EID_SIAPP_OLDAP_BSSID, "SIAPP Old Access Points BSSID"}, { EID_SIAPP_RAD_CACS_REQ, "SIAPP Radio CACS Request"}, { EID_SIAPP_RADIOBLOCK, "SIAPP Radio Block"}, { EID_SIAPP_CLIENT_COUNT, "SIAPP Client Count"}, { EID_SIAPP_BLOCK, "SIAPP Block"}, { EID_SIAPP_MU_TransmittedFrameCount, "SIAPP MU _Transmitted Frame Count"}, { EID_SIAPP_MU_ReceivedFrameCount, "SIAPP MU Received Frame Count"}, { EID_SIAPP_MU_TransmittedBytes, "SIAPP MU Transmitted Bytes"}, { EID_SIAPP_MU_ReceivedBytes, "SIAPP MU Received Bytes"}, { EID_SIAPP_MU_UL_DroppedRateControlPackets, "SIAPP MU Up Link Dropped Rate Control Packets"}, { EID_SIAPP_MU_DL_DroppedRateControlPackets, "SIAPP MU Down Link Dropped Rate Control Packets"}, { EID_SIAPP_MU_DL_DroppedBufferFullPackets, "SIAPP MU Down Link Dropped Buffer Full Packets"}, { EID_SIAPP_MU_DL_LostRetriesPackets, "SIAPP MU Down Link Lost Retries Packets"}, { EID_SIAPP_MU_UL_DroppedRateControlBytes, "SIAPP MU Up Link Dropped Rate Control Bytes"}, { EID_SIAPP_MU_DL_DroppedRateControlBytes, "SIAPP MU Down Link Dropped Rate Control Bytes"}, { EID_SIAPP_MU_DL_DroppedBufferFullBytes, "SIAPP MU Down Link Dropped Buffer Full Bytes"}, { EID_SIAPP_MU_DL_LostRetriesBytes, "SIAPP MU Down Link Lost Retries Bytes"}, { EID_SIAPP_BP_BSSID, "SIAPP Access Points BSSID"}, { EID_SIAPP_RADIO_ID, "SIAPP Radio ID"}, { EID_SIAPP_MACADDR, "SIAPP Mac Address"}, { EID_SIAPP_PREAUTH_REQ, "SIAPP Preauthentication Request"}, { EID_SIAPP_USER_IDENTITY, "SIAPP Client IDY"}, { EID_SIAPP_LOADBAL_BLOCK, "SIAPP Load Balance block"}, { EID_SIAPP_LOADBAL_PKT_TYPE, "SIAPP Load Balance PKT Type"}, { EID_SIAPP_LOADBAL_LOADGROUP_ID, "SIAPP Load Balance Load Group ID"}, { EID_SIAPP_LOADBAL_LOAD_VALUE, "SIAPP Load Balance Load Value"}, { EID_SIAPP_AC_MGMT_MAC, "SIAPP Controller Management Mac Address"}, { EID_SIAPP_FILTER_COS, "SIAPP Filter Rule COS"}, { EID_COS, "Classes of Service(COS)"}, { EID_RATE_LIMIT_RESOURCE_TBL, "Bandwidth Control Rate Limit Resource Table"}, { EID_UCAST_FILTER_DISABLE, "Unicast Filter Disable Flag"}, { EID_MU_INFORM_REASON, "MU Information"}, { EID_MU_FILTER_POLICY_NAME, "MU Filter Rule Name"}, { EID_MU_TOPOLOGY_POLICY_NAME, "MU Topology Name"}, { EID_MU_COS_POLICY_NAME, "MU COS Name"}, { EID_MU_FILTER_KEY, "MU Filter Rule ID"}, { EID_MU_TOPOLOGY_KEY, "MU Topology ID"}, { EID_MU_COS_KEY, "MU COS ID"}, { EID_MU_SESSION_TIMEOUT, "MU Session Life Time"}, { EID_MU_ACCOUNTING_CLASS, "MU Accounting Class"}, { EID_MU_LOGIN_LAT_PORT, "MU Login authentication state(0 = Non-auth, 1 = Auth)"}, { EID_MU_IDLE_TIMEOUT, "MU Session Idle Timeout"}, { EID_MU_ACCT_INTERIM_INTERVAL, "Client Acct-Interim-Interval(RADIUS)"}, { EID_MU_IP_ADDR, "MU IP Address"}, { EID_MU_TERMINATE_ACTION, "MU Terminate Action"}, { EID_SITE_NAME, "Site Name"}, { EID_PEER_SITE_IP, "Peer Site IP Address"}, { EID_INTERFERENCE_EVENTS_ENABLE, "Interference Events Enable Flag"}, { EID_EVENT_TYPE, "Event Type"}, { EID_EVENT_CHANNEL, "Event Channel"}, { EID_EVENT_VALUE, "Event Value"}, { EID_SSS_MU_BLOCK, "Site Section MU Block"}, { EID_SSS_MU_ASSOC_TIME, "Site Section MU Association Time"}, { EID_SSS_TS64_MU_UPDATE, "Site Section MU Update Time Stamp"}, { EID_SSS_TS64_AP_CURRENT, "Site Section AccessPoint Current Time"}, { EID_SSS_MU_AUTH_STATE, "Site Section MU Authentication State"}, { EID_SSS_AP_HOMEHASH, "Site Section AccessPoint Home Hashed Value"}, { EID_TIME_FIRST_DETECTED, "First Detected Time"}, { EID_TIME_LAST_REPORTED, "Last Reported Time"}, { EID_EVENT_ARRAY, "Array Of Events"}, { EID_SSS_DEFAULT_SESSION_TIMEOUT, "Site Section Default Timeout Time"}, { EID_SSS_SSID, "Site Section SSID"}, { EID_SSS_PRIVACY_TYPE, "Site Section Privacy Type"}, { EID_POLICY_ZONE_NAME, "Policy Zone Name"}, { EID_RU_AC_EVENT_COMPONENT_ID, "Event Component ID"}, { EID_MU_AUTH_STATE, "MU Authentication State"}, { EID_MU_USER_NAME, "MU User Name"}, { EID_BULK_TYPE, "Bulk Type"}, { EID_SENT_TIME, "Sent Time"}, { EID_INFORM_MU_PMK, "Pairwise Master Key Informed From AP"}, { EID_COLLECTOR_IP_ADDR, "Collector IP Address"}, { EID_ARP_PROXY, "Enable/Disable Proxying of ARP Per Topology"}, { EID_MCAST_FILTER_RULES, "Multicast Filter Rules Per Topology"}, { EID_AP_PARAMS, "AP Parameters"}, { EID_ASSOC_SSID_ARRAY, "Array of Associated SSID"}, { EID_ASSOC_SSID_BLOCK, "Block of Associated SSID"}, { EID_AP_LIST_BLOCK, "Bloc of AP List"}, { EID_AP_LIST_ARRAY, "Array of AP List"}, { EID_MAC_ADDR, "MAC Address"}, { EID_SCAN_PROFILE_ID, "Scan Profile ID"}, { EID_ACTION_REQ, "Action Request"}, { EID_CHANNEL_LIST, "Channel List"}, { EID_COUNTERMEASURES_MAX_CH, "CounterMeasures Max Channel"}, { EID_COUNTERMEASURES_SET, "Enable/disable CounterMeasures"}, { EID_SCAN_PROFILE_BLOCK, "Scan Profile Block"}, { EID_SEQ_NUM, "Sequence Number"}, { EID_THREAT_DEF_ARRAY, "Array Of Threat Definition"}, { EID_THREAT_DEF_BLOCK, "Block Of Threat Definition"}, { EID_THREAT_TYPE, "Threat Type"}, { EID_THREAT_ID, "Threat ID"}, { EID_THREAT_STATS_F, "Threat State"}, { EID_THREAT_FR_SFR, "Threat FR SFR"}, { EID_THREAT_PATTERN_ARRAY, "Array Of Threat Pattern"}, { EID_THREAT_PATTERN_BLOCK, "Block Of Threat Pattern"}, { EID_THREAT_PATTERN, "Threat Pattern"}, { EID_THREAT_ALERT_TH_DUR, "Threat Alert"}, { EID_THREAT_CLEAR_TH_DUR, "Threat Clear"}, { EID_THREAT_PRIORITY, "Threat Priority"}, { EID_THREAT_MITIGATION_LIST, "Threat Mitigation List"}, { EID_SSS_MU_IS_PORT_CLOSED, "Enable/Disable Site Section MU Port"}, { EID_FULL_UPDATE, "Full Update"}, { EID_REASON, "Reason"}, { EID_SURVEILLANCE_DATA_ARRAY, "Array of Surveillance Data"}, { EID_SURVEILLANCE_DATA_BLOCK, "Block of Surveillance Data"}, { EID_SCAN_BSSID, "Scan BSSID"}, { EID_PARAMS, "Parameters"}, { EID_SCAN_RSS_RSSI, "Scan RSS and RSSI"}, { EID_SCAN_SSID, "Scan SSID"}, { EID_SCAN_CAP, "Scan Capability"}, { EID_THREAT_CLASSIFICATION, "Threat Classification"}, { EID_THREAT_DATA_ARRAY, "Array Of Threat Data"}, { EID_THREAT_DATA_BLOCK, "Block Of Threat Data"}, { EID_STATE, "State"}, { EID_DROP_FR_CNT, "Drop FR Count"}, { EID_STOP_ROAM_CNT, "Stop ROAM Count"}, { EID_SPOOF_CNT, "Spoof Count"}, { EID_THREAT_CLASSIFY_ARRAY, "Array Of Classify Threat"}, { EID_THREAT_CLASSIFY_BLOCK, "Block Of Classify Threat"}, { EID_THREAT_NAME, "Threat Name"}, { EID_LOCATION, "Location"}, { EID_ENCRYPTION_TYPE, "Encryption Type"}, { EID_MU_EVENT_ARRAY, "Array Of MU Events"}, { EID_MU_EVENT_BLOCK, "Block Of MU Events"}, { EID_COMPONENT_ID, "Component ID"}, { EID_MU_EVENT_STRING, "MU Event String"}, { EID_BYPASS_BMCAST, "Bypass Broadcast and Multicast"}, { EID_GETTIMEOFDAY, "Get Time of Day"}, /* Dedicated scanner / Guardian */ { EID_COUNTRY_ID, "Country ID"}, { EID_COUNTRY_ARRAY, "Array of Country"}, { EID_COUNTRY_BLOCK, "Country Block"}, /* Location Engine */ { EID_MU_EVENT_TYPE, "MU Event Type"}, { EID_LOCATOR_FLOOR_ID, "Floor ID"}, { EID_LOCATOR_LOC_TYPE, "Location Type"}, { EID_LOCATOR_LOC_BLOCK, "Block of Location Data"}, { EID_LOCATOR_LOC_ARRAY, "Array of Location Data"}, { EID_LOCATOR_LOC_POINT, "Location Point"}, { EID_MU_EVENT_DETAILS, "MU Event Details"}, { EID_MU_EVENT_FROM_AP, "MU Event From AP"}, { EID_MU_EVENT_LOC_BLOCK, "Block of MU Location Event"}, { EID_LOCATOR_LOC_AP_DISTANCE, "AP Location Distance"}, { EID_LOCATOR_LOC_PRECISION, "Location Precision"}, { EID_RSS_DATA_ARRAY, "Array of RSS Data"}, { EID_RSS_DATA_BLOCK, "Block of RSS Data"}, { EID_LOCATOR_MU_ACTION, "Location MU Action"}, { EID_EFFECTIVE_EGRESS_VLAN, "Effective Egress Vlan"}, { EID_REBOOT_ACK, "Reboot Acknowledgement"}, { EID_MU_BSSID, "MU BSSID"}, { EID_AUTH_FLAG, "Authentication Flag"}, { EID_ROAMED_FLAG, "ROAMED Flag"}, { EID_MU_RSS, "MU RSS"}, { EID_FILTER_RULES_VER, "Filter Rule Struct Version"}, { EID_FILTER_TYPE, "Filter Rule Type"}, { EID_MCAST_FILTER_BLOCK, "Multicast Filter Rule Block"}, { EID_MCAST_FILTER_BLOCK_ENTRY, "Multicast Filter Rule Block Entry"}, { EID_DEFAULT_ACTION_TYPE, "Default Action Type"}, { EID_DEFAULT_CONTAIN_TO_VLAN, "Default Contain to Vlan Flag"}, { EID_DEFAULT_BRIDGE_MODE, "Default Bridge Mode Flag"}, { EID_INVALID_POLICY, "Invalid Policy Flag"}, { EID_LOCATOR_FLOOR_NAME, "Floor Name"}, { EID_AP_FLAGS, "AP Flags"}, { EID_AP_PVID, "AP PVID"}, { EID_AP_REDIRECT, "AP Redirect Flag"}, { EID_MU_CVLAN_BAP, "AP Contain to Vlan Has Bridge At AP Topology Flag"}, { EID_MU_SESSION_ARRAY, "Array Of MU Session"}, { EID_MU_SESSION_BLOCK, "MU Session Block"}, { EID_MU_SESSION_ID, "MU Session ID"}, { EID_MU_RFS_NAME, "MU RFS Name"}, { EID_MU_FLAGS, "MU Flags"}, { EID_MU_ASSOC_TIME, "MU Associated Time"}, { EID_MU_ACTIVE_TIME, "MU Active Time"}, { EID_REPORT_REQ, "Report Request"}, { EID_MU_URL, "MU Captive Portal Url"}, { EID_MU_SESSION_LIFETIME, "MU Session Life Time"}, { EID_MU_REAUTH_TIMER, "MU Re-Authentication Timer"}, { EID_MU_ACCT_SESSION_ID_STRING, "MU Acct Session ID String"}, { EID_MU_ACCT_POLICY_NAME, "MU Acct Policy Name"}, { EID_MU_ACCT_START_TIME, "MU Acct Start Time"}, { EID_MU_ACCT_CLASS, "MU Acct Class"}, { EID_MU_LOGIN_LAT_GROUP, "MU Login Group"}, { EID_MU_TUNNEL_PRIVATE_GROUP_ID_STRING, "MU Tunnel Private Group ID String"}, { EID_MU_USER_ID_STRING, "MU User ID String"}, { EID_MU_DEFENDED_STATE, "MU Defended State"}, { EID_MU_MOD_MASK, "MU Modulation Maske"}, { EID_LOCATOR_TRACKED, "Locator Tracked"}, { EID_PORT, "Port"}, { EID_RETRIES_COUNT, "Retries Count"}, { EID_MODULATION_TYPE, "Modulation Type"}, { EID_DETECTED_ROGUE_ARRAY, "Array Of Detected Rogue"}, { EID_DETECTED_ROGUE_BLOCK, "Detected Rogue Block"}, { EID_ROGUE_DETECTION, "Rogue Detection"}, { EID_MAC_ADDR_TX, "Tx Mac Address"}, { EID_MAC_ADDR_RX, "Rx Mac Address"}, { EID_IP_ADDR_TX, "Tx IP Address"}, { EID_IP_ADDR_RX, "Rx IP Address"}, { EID_TTL, "TTL"}, { EID_GW_IP_ADDR, "Gateway IP Address"}, { EID_LOCATOR_STATE_DATA, "Location State Data"}, { EID_LOCATOR_POINT_SET, "Location Point Set"}, { EID_FILTER_RULE_FIXED_APP_ID, "Filter Rule Fixed Application ID"}, { EID_FILTER_RULES_EXT_BLOCK, "Filter Rule Extended Block"}, { EID_MU_AREA_BLOCK, "MU Area Block"}, { EID_MU_LOCATION, "MU Location"}, { EID_MU_LOCATION_TS, "MU Location Time Stamp"}, { EID_DNS_IP_ADDR, "DNS IP Address"}, { EID_IN_SERVICE_AP_LIST, "In-Service AP List"}, { EID_OUT_SERVICE_AP_LIST, "Out of Service AP List"}, { EID_LAST_RD_AP, "Last RD AP"}, { EID_ROGUE_INFO, "Rogue Info"}, { EID_MU_IS_FT, "Enable/Disable MU Fast Transition"}, { EID_MU_PMK_R1, "MU Fast Transition Roaming"}, { EID_SIAPP_R0KHID, "SIAPP R0KH ID"}, { EID_SIAPP_R1KHID, "SIAPP R1KH ID"}, { EID_SIAPP_FT_NONCE, "SIAPP Fast Transition Nonce"}, { EID_SIAPP_FT_PMKR0NAME, "SIAPP Fast Transition PMKR0 Name"}, { EID_SIAPP_FT_R1KHID, "SIAPP Fast Transition R1KH ID"}, { EID_SIAPP_FT_S1KHID, "SIAPP Fast Transition S1KH ID"}, { EID_SIAPP_FT_PMKR1, "SIAPP Fast Transition PMKR1"}, { EID_SIAPP_FT_PMKR1NAME, "SIAPP Fast Transition PMKR1 Name"}, { EID_SIAPP_FT_PAIRWISE, "SIAPP Fast Transition Pairwise"}, { EID_SIAPP_FT_LIFETIME, "SIAPP Fast Transition Life Time"}, { EID_MU_POWER_CAP, "MU Power Capable"}, { EID_AREA_NAME, "Area Name"}, { EID_PERIODIC_NEIGHBOUR_REPORT, "Periodic Neighbour Report"}, { EID_TIMESTAMP, "Time Stamp"}, { EID_NEIGHBOUR_ENTRY, "Neighbour Entry"}, { EID_MU_REQ, "MU Request"}, { EID_RU_REQ, "RU Request"}, { EID_NEIGHBOUR_REQ, "Neighbour Request"}, { EID_SSS_FT_ASSOC, "Site Section Fast Transition Association"}, { EID_DEFAULT_MIRRORN, "Enables the First N Packets of a Flow to The Controller"}, { EID_FILTER_RULE_EXT_ACT_FLAGS, "Extension to Filter Rule Definition. Specifies Additional Actions Per Filter Rule"}, { EID_TOPO_GROUP_MAPPING, "Topology Group Mapping"}, { EID_MU_PMK_R0NAME, "MU Pairwise Master Key R0 Name"}, { EID_CUI, "CUI"}, { EID_SSS_CAPINFO, "Site Section CAP Info"}, { EID_SSS_CAPPOWER, "Site Section CAP Power"}, { EID_WFA_VSA, "WFA Vendor Specific Hotspot"}, { EID_WFA_HS20_REMED_METHOD, "Online Signup Method for HS2.0 Remediation"}, { EID_WFA_HS20_URL, "Remediation Server Url for Online Signup In HS2.0"}, { EID_WFA_HS20_DEAUTH_CODE, "WFA HS20 De-Authentication Code"}, { EID_WFA_HS20_REAUTH_DELAY, "WFA HS20 Re-Authentication Delay"}, { EID_WFA_HS20_SWT, "WFA HS20 SWT"}, { EID_POWER_STATUS, "Power Status"}, { EID_IPV6_ADDR, "IPV6 Address"}, { EID_FILTER_RULES_APP_SIG_GROUP_ID, "Filter Rule Application Signature Group ID"}, { EID_FILTER_RULES_APP_SIG_DISP_ID, "Filter Rule Application Signature Display ID"}, { EID_MU_DEV_IDENTITY, "MU Device ID"}, { EID_APPL_STATS_REQ, "Application Rule Stats Request"}, { EID_MU_APPL_STATS_BLOCK, "MU Application Rule Stats Block"}, { EID_TOPOLOGY_ARRAY, "Array of Topologies"}, { EID_TOPOLOGY_STRUCT, "Topology Struct"}, { EID_FILTER_CONFIG_STRUCT, "Filter Rule Configuration Struct"}, { EID_DHCP_HOST_NAME, "DHCP Host Name"}, { EID_NEIGHBOUR_ENTRY_2, "Neighbour Entry 2"}, { EID_CHANNEL_ENTRY, "Channel Entry"}, { EID_MU_ECP_PW, "MU External Captive Portal Password"}, { EID_MU_ECP_TOKEN, "MU External Captive Portal Token"}, { EID_STATIC_VSA_IPADDR, "AP Endpoint on Overlay Network IP Address"}, { EID_STATIC_VSA_NETMASK, "AP Endpoint on Overlay Network IP Mask"}, { EID_PKT_CAPTURE_STATUS, "Packet Capture Status"}, { EID_PKT_CAPTURE_FILTERS, "Packet Capture Filters"}, { EID_PKT_F_WIRELESS, "Enable Packet Capture On Wireless"}, { EID_PKT_F_WIREDCLIENT, "Enable Packet Capture on Wired Client"}, { EID_PKT_F_DIRECTION, "Packet Capture Direction"}, { EID_PKT_F_RADIO, "Packet Capture on Radio"}, { EID_PKT_F_FLAGS, "Packet Capture Flag"}, { EID_PKT_F_IP_ARRAY, "Array of Packet Capture IP Addresses"}, { EID_PKT_F_MAC, "Array of Packet Capture Mac Addresses"}, { EID_PKT_F_PROTOCOL, "Packet Capture On Protocol"}, { EID_PKT_F_PORT, "Packet Capture On Port"}, { EID_VSA_SSID_ID, "VSA SSID ID"}, { EID_MU_AUTH_TYPE, "MU Authentication Type"}, { EID_PKT_F_MAX_PKT_COUNT, "Max Captured Packet Count"}, { EID_PKT_F_FLAG_2, "Packet Capture Flag 2"}, { EID_IMAGE_PORT, "Image Port"}, { EID_FILTER_ROLE_ID, "Filter Rule ID"}, { EID_FILTER_ROLE_TIMESTAMP, "Time Stamp of When Role Was Last Changed"}, { 0, NULL } }; static const TLV_PARSER_ENTRY tlvMainTable[] = { { EID_UNUSED_0, "Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATUS, "Status/Action", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SW_VERSION, "Software Version", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SERIAL_NUMBER, "Serial Number", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_REG_CHALLENGE, "Registration Challenge", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_REG_RESPONSE, "Challenge Response", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AC_IPADDR, "Controller IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_VNSID, "AccessPoint VNS ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TFTP_SERVER, "TFTP Server Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IMAGE_PATH, "Path/Filename of Upgrade Image", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CONFIG, "SNMP Encoded Configuration", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_STATE, "AccessPoint State", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SESSION_KEY, "Binding Key", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_PROTOCOL, "Message Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RANDOM_NUMBER, "Random Number", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STANDBY_TIMEOUT, "Standby Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_CHALLENGE_ID, "AccessPoint Challenge ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_MODEL, "AccessPoint Model", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_MODE, "AccessPoint Scan Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_TYPE, "AccessPoint Scan Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_INTERVAL, "AccessPoint Scan Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_RADIO_TYPE, "AccessPoint Radio Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_CHANNEL_DWELL_TIME, "AccessPoint Channel Dwell Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_CHANNEL_LIST, "AccessPoint Channel List", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_TRAP, "AccessPoint Trap", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_TIMES, "AccessPoint Scan Times", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_DELAY, "AccessPoint Scan Delay", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SCAN_REQ_ID, "AccessPoint Scan Request ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_CONFIG, "Static Configuration", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCAL_BRIDGING, "Local Bridging", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_BP_IPADDR, "Static AccessPoint IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_BP_NETMASK, "Static AccessPoint NetMask", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_BP_GATEWAY, "Static AccessPoint Gateway", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_BM_IPADDR, "Static Controller IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BP_BPSSID, "AccessPoint BSSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BP_WIRED_MACADDR, "AccessPoint Wired MAC", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_CAPABILITY, "AccessPoint Capability", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_SSID_NAME, "AccessPoint SSID Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ALARM, "Alarm", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_PREAUTH, "AccessPoint Preauthorization", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_PMK, "AccessPoint Pairwise Master Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AC_REG_CHALLENGE, "Controller Register Challenge", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AC_REG_RESPONSE, "Controller Register Response", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS, "Stats", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CERTIFICATE, "Certificate", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_ID, "Radio ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_REQ_ID, "Request ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NETWORK_ID, "Network ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_MAC, "MU MAC Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TIME, "Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NUM_RADIOS, "Number of Radios", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_INFO, "Radio Info", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NETWORK_INFO, "Network Info", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_VENDOR_ID, "Vendor ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PRODUCT_ID, "Product ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_INFO_ACK, "Radio Info Acknowledge", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SECURE_TUNNEL, " secure tunnel", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TOPOLOGY_ID, "MU topology ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSID, "SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EVENT_BLOCK, "Event Block", TLV_TYPE_BLOCK_TLV, EVENT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SNMP_ERROR_STATUS, "SNMP Error Status", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SNMP_ERROR_INDEX, "SNMP Error Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_REAUTH_TIMER, "AccessPoint ReAuthentication Timer", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_IMG_TO_RAM, "AccessPoint Image Store to RAM", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_IMG_ROLE, "AccessPoint Image Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_STATS_BLOCK, "AccessPoint Statistics Block", TLV_TYPE_BLOCK_TLV, AP_STATS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RF_STATS_BLOCK, "AccessPoint RF Statistics Block", TLV_TYPE_BLOCK_TLV, MU_RF_STATS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_REQUEST_TYPE, "AccessPoint Statistics Request Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_LAST, "AccessPoint Statistics Last Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TLV_CONFIG, "TLV Configuration", TLV_TYPE_BLOCK_TLV, CONFIG_GLOBAL_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_CONFIG_ERROR_BLOCK, "AccessPoint Configuration Error Block", TLV_TYPE_BLOCK_TLV, CONFIG_ERROR_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_CONFIG_MODIFIED_BLOCK, "AccessPoint Configuration Modified Block", TLV_TYPE_BLOCK_TLV, CONFIG_ERROR_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_PMKID_LIST, "MU Pairwise Master Key List", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_PMK_BP, "MU and AccessPoint Pairwise Master Key", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_PMKID_BP, "MU and AccessPoint Pairwise Master Key ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTDOWN_TIME, "CountDown Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WASSP_VLAN_TAG, "VLAN Tag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSID_ID, "SSID(Service Set Identifier)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BULK_MU_BLOCK, "Bulk MU Block", TLV_TYPE_BLOCK_TLV, BULK_MU_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_BLOCK, "MU Block", TLV_TYPE_BLOCK_TLV, MU_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_PORT_OPEN_FLAG, "Port Open Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WASSP_TUNNEL_TYPE, "Tunnel Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOG_TYPE, "Log type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOG_FILE, "Log File", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ALARM_SEVERITY, "Alarm Severity", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ALARM_DESCRIPTION, "Alarm Information", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BULK_VNS_BLOCK, "Bulk VNS Block", TLV_TYPE_BLOCK_TLV, BULK_VNS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_VNS_BLOCK, "VNS Block", TLV_TYPE_BLOCK_TLV, VNS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_DHCP_MODE, "AccessPoint DHCP Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_IPADDR, "AccessPoint IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_NETMASK, "AccessPoint IP Netmask", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_GATEWAY, "AccessPoint IP Gateway", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BSSID2IP_BLOCK, "BSSID to IP Address Mapping Block", TLV_TYPE_BLOCK_TLV, CONFIG_ERROR_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_BACKUP_VERSION, "AccessPoint Upgrade: Software Version of The Backup Image", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AC_SW_VERSION, "AccessPoint Upgrade: Software Version", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_LAMG_LIST, " Multicast Optimization", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_NAME, "Filter Rule Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULES, "Array of Filter Rules", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AUTH_STATE, "Authentication State( MU Not Authenticate = 0, ANON_AUTHENTICATED=0, MU Authenticated = 1", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DISC_AFTER_AUTH, "After Authenticated MU State( Disconnected = 0, Connected = 1", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_MAC_LIST, "Array of MAC Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TRANS_ID, "Transaction ID of The Message Determined At The Home Controller", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TIMEZONE_OFFSET, "Timezone Offset", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SENSOR_FORCE_DOWNLOAD, " Force Download of Sensor Image", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SENSOR_IMG_VERSION, " Sensor Image Version", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BRIDGE_MODE, "Bridge Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_VLAN_TAG, "MU VLAN Tag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_CIR_UL, "Up Link Bandwidth Control: Committed Information Rate (CIR)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_CIR_DL, "Down Link Bandwidth Control: Committed Information Rate (CIR)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_CBS_UL, "Up Link Bandwidth Control: Committed Burst Size (CBS)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_CBS_DL, "Down Link Bandwidth Control: Committed Burst Size (CBS)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_NAME_UL, "Up Link Bandwidth Control Profile Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATECTRL_NAME_DL, "Down Link Bandwidth Control Profile Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_NAME, "Policy Profile Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PMK_BLOCK, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_PMK_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PMKID, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PMK_REAUTH, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ReAuthenticate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PMK_LIFETIME, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key Life Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PMKID_FLAG, "Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key ID Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_PMK, "MU Secure Inter-Access Point Protocol(SIAPP) Pairwise Master Key", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_AP_NAME, "SIAPP AP Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_RADIO_CONFIG_BLOCK, "SIAPP Radio Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_RADIO_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_CLUSTER_ACS_REQ, "SIAPP Cluster ACS Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_SIAPP_MU_STATS_BLOCK, "SIAPP MU Statistics Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_MU_STATS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PACKET_RETRIES, "SIAPP Packet Retries", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_ASSOC_IN_WLAN, "SIAPP MU Association With In Same WLAN", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_ASSOC_IN_CLUSTER, "SIAPP MU Association With In Same Cluster", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_REASSOC_IN_CLUSTER, "SIAPP MU Reassociation With In Same Cluster", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_THIN_BLOCK, "SIAPP Thin Access Points Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_THIN_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_NEWAP_BSSID, "SIAPP New Access Points BSSID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_OLDAP_BSSID, "SIAPP Old Access Points BSSID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_RAD_CACS_REQ, "SIAPP Radio CACS Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_RADIOBLOCK, "SIAPP Radio Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_MU_STATS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_CLIENT_COUNT, "SIAPP Client Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_BLOCK, "SIAPP Block", TLV_TYPE_BLOCK_TLV, TAB_SIAPP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_TransmittedFrameCount, "SIAPP MU Transmitted Frame Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_ReceivedFrameCount, "SIAPP MU Received Frame Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_TransmittedBytes, "SIAPP MU Transmitted Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_ReceivedBytes, "SIAPP MU Received Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_UL_DroppedRateControlPackets, "SIAPP MU Up Link Dropped Rate Control Packets", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_DroppedRateControlPackets, "SIAPP MU Down Link Dropped Rate Control Packets", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_DroppedBufferFullPackets, "SIAPP MU Down Link Dropped Buffer Full Packets", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_LostRetriesPackets, "SIAPP MU Down Link Lost Retries Packets", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_UL_DroppedRateControlBytes, "SIAPP MU Up Link Dropped Rate Control Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_DroppedRateControlBytes, "SIAPP MU Down Link Dropped Rate Control Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_DroppedBufferFullBytes, "SIAPP MU Down Link Dropped Buffer Full Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MU_DL_LostRetriesBytes, "SIAPP MU Down Link Lost Retries Bytes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_BP_BSSID, "SIAPP Access Points BSSID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_RADIO_ID, "SIAPP Radio ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_MACADDR, "SIAPP Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PREAUTH_REQ, "SIAPP Preauthentication Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_USER_IDENTITY, "SIAPP Client ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_LOADBAL_BLOCK, "SIAPP Load Balance Block", TLV_TYPE_BLOCK_TLV, CONFIG_ERROR_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_LOADBAL_PKT_TYPE, "SIAPP Load Balance PKT Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_LOADBAL_LOADGROUP_ID, "SIAPP Load Balance Load Group ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_LOADBAL_LOAD_VALUE, "SIAPP Load Balance Load Value", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_AC_MGMT_MAC, "SIAPP Controller Management Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FILTER_COS, "SIAPP Filter Rule COS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COS, "Classes of Service(COS)", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATE_LIMIT_RESOURCE_TBL, "Bandwidth Control Rate Limit Resource Table", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_UCAST_FILTER_DISABLE, "Unicast Filter Disable Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_INFORM_REASON, "MU Information", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FILTER_POLICY_NAME, "MU Filter Rule Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TOPOLOGY_POLICY_NAME, "MU Topology Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_COS_POLICY_NAME, "MU COS Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FILTER_KEY, "MU Filter Rule ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TOPOLOGY_KEY, "MU Topology ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_COS_KEY, "MU COS ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_SESSION_TIMEOUT, "MU Session Life Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCOUNTING_CLASS, "MU Accounting Class", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_LOGIN_LAT_PORT, "MU Login authentication state(0 = Non-auth, 1 = Auth)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_IDLE_TIMEOUT, "MU Session Idle Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCT_INTERIM_INTERVAL, "Client Acct-Interim-Interval(RADIUS)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_IP_ADDR, "MU IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TERMINATE_ACTION, "MU Terminate Action", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_NAME, "Site Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PEER_SITE_IP, "Peer Site IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_INTERFERENCE_EVENTS_ENABLE, "Interference Events Enable Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EVENT_TYPE, "Event Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EVENT_CHANNEL, " Event Channel", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EVENT_VALUE, "Event Value", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_MU_BLOCK, "Site Section MU Block", TLV_TYPE_BLOCK_TLV, TAB_SSS_MU_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_MU_ASSOC_TIME, "Site Section MU Association Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_TS64_MU_UPDATE, "Site Section MU Update Time Stamp", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_TS64_AP_CURRENT, "Site Section AccessPoint Current Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_MU_AUTH_STATE, "Site Section MU Authentication State", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_AP_HOMEHASH, "Site Section AccessPoint Home Hashed Value", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TIME_FIRST_DETECTED, "First Detected Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TIME_LAST_REPORTED, "Last Reported Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EVENT_ARRAY, "Array Of Events", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_DEFAULT_SESSION_TIMEOUT, "Site Section Default Timeout Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_SSID, "Site Section SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_PRIVACY_TYPE, "Site Section Privacy Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_ZONE_NAME, "Policy Zone Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_AC_EVENT_COMPONENT_ID, "Event Component ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_AUTH_STATE, "MU Authentication State", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_USER_NAME, "MU User Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BULK_TYPE, "Bulk Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SENT_TIME, "Sent Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_INFORM_MU_PMK, "Pairwise Master Key Informed From AP", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COLLECTOR_IP_ADDR, "Collector IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0 }, { EID_ARP_PROXY, "Enable/Disable Proxying of ARP Per Topology", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_FILTER_RULES, "Multicast Filter Rules Per Topology", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_PARAMS, "AP Parameters", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ASSOC_SSID_ARRAY, "Array of Associated SSID", TLV_TYPE_BLOCK_TLV, TAB_ASSOC_SSID_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_ASSOC_SSID_BLOCK, "Block of Associated SSID", TLV_TYPE_BLOCK_TLV, TAB_ASSOC_SSID_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_LIST_BLOCK, "Bloc of AP List", TLV_TYPE_BLOCK_TLV, TAB_AP_LIST_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_LIST_ARRAY, " Array of AP List", TLV_TYPE_BLOCK_TLV, TAB_AP_LIST_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_MAC_ADDR, "MAC Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_PROFILE_ID, "Scan Profile ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ACTION_REQ, "Action Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CHANNEL_LIST, "Channel List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTERMEASURES_MAX_CH, "CounterMeasures Max Channel", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTERMEASURES_SET, "Enable/disable CounterMeasures", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_PROFILE_BLOCK, "Scan Profile Block", TLV_TYPE_BLOCK_TLV, TAB_SCAN_PROFILE_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SEQ_NUM, "Sequence Number", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_DEF_ARRAY, "Array Of Threat Definition", TLV_TYPE_BLOCK_TLV, TAB_THREAT_DEF_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_DEF_BLOCK, "Block Of Threat Definition", TLV_TYPE_BLOCK_TLV, TAB_THREAT_DEF_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_TYPE, "Threat Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_ID, "Threat ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_STATS_F, "Threat State", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_FR_SFR, "Threat FR SFR", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_PATTERN_ARRAY, "Array Of Threat Pattern", TLV_TYPE_BLOCK_TLV, TAB_THREAT_PATTERN_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_PATTERN_BLOCK, "Block Of Threat Pattern", TLV_TYPE_BLOCK_TLV, TAB_THREAT_PATTERN_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_PATTERN, "Threat Pattern", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_ALERT_TH_DUR, "Threat Alert", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_CLEAR_TH_DUR, "Threat Clear", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_PRIORITY, "Threat Priority", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_MITIGATION_LIST, "Threat Mitigation List", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_MU_IS_PORT_CLOSED, "Enable/Disable Site Section MU Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FULL_UPDATE, "Full Update", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_REASON, "Reason", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SURVEILLANCE_DATA_ARRAY, "Array of Surveillance Data", TLV_TYPE_BLOCK_TLV, TAB_SURVEILLANCE_DATA_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_SURVEILLANCE_DATA_BLOCK, "Block of Surveillance Data", TLV_TYPE_BLOCK_TLV, TAB_SURVEILLANCE_DATA_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_BSSID, "Scan BSSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PARAMS, "Parameters", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_RSS_RSSI, "Scan RSS and RSSI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_SSID, "Scan SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SCAN_CAP, "Scan Capability", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_CLASSIFICATION, "Threat Classification", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_DATA_ARRAY, "Array Of Threat Data", TLV_TYPE_BLOCK_TLV, TAB_THREAT_DATA_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_DATA_BLOCK, "Block Of Threat Data", TLV_TYPE_BLOCK_TLV, TAB_THREAT_DATA_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_STATE, "State", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DROP_FR_CNT, "Drop FR Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STOP_ROAM_CNT, "Stop ROAM Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SPOOF_CNT, "Spoof Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_CLASSIFY_ARRAY, "Array Of Classify Threat", TLV_TYPE_BLOCK_TLV, TAB_THREAT_CLASSIFY_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_CLASSIFY_BLOCK, "Block Of Classify Threat", TLV_TYPE_BLOCK_TLV, TAB_THREAT_CLASSIFY_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_THREAT_NAME, "Threat Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATION, "Location", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ENCRYPTION_TYPE, "Encryption Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_ARRAY, "Array Of MU Events", TLV_TYPE_BLOCK_TLV, TAB_MU_EVENT_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_BLOCK, "Block Of MU Events", TLV_TYPE_BLOCK_TLV, TAB_MU_EVENT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_COMPONENT_ID, "Component ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_STRING, "MU Event String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BYPASS_BMCAST, "Bypass Broadcast and Multicast", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_GETTIMEOFDAY, "Get Time of Day", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTRY_ID, "Country ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTRY_ARRAY, "Array of Country", TLV_TYPE_BLOCK_TLV, TAB_COUNTRY_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTRY_BLOCK, "Country Block", TLV_TYPE_BLOCK_TLV, TAB_COUNTRY_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_TYPE, "MU Event Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_FLOOR_ID, "Floor ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_TYPE, "Location Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_BLOCK, "Block of Location Data", TLV_TYPE_BLOCK_TLV, TAB_LOCATOR_LOC_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_ARRAY, "Array of Location Data", TLV_TYPE_BLOCK_TLV, TAB_LOCATOR_LOC_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_POINT, "Location Point", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_DETAILS, "MU Event Details", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_FROM_AP, "MU Event From AP", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_EVENT_LOC_BLOCK, "Block of MU Location Event", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_AP_DISTANCE, "AP Location Distance", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_LOC_PRECISION, "Location Precision", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RSS_DATA_ARRAY, "Array of RSS Data", TLV_TYPE_BLOCK_TLV, TAB_RSS_DATA_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_RSS_DATA_BLOCK, "Block of RSS Data", TLV_TYPE_BLOCK_TLV, TAB_RSS_DATA_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_MU_ACTION, "Location MU Action", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EFFECTIVE_EGRESS_VLAN, "Effective Egress Vlan", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_REBOOT_ACK, "Reboot Acknowledgement", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_BSSID, "MU BSSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AUTH_FLAG, "Authentication Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ROAMED_FLAG, "ROAMED Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RSS, "MU RSS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULES_VER, "Filter Rule Struct Version", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_TYPE, "Filter Rule Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_FILTER_BLOCK, "Multicast Filter Rule Block", TLV_TYPE_BLOCK_TLV, TAB_MCAST_FILTER_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_FILTER_BLOCK_ENTRY, "Multicast Filter Rule Block Entry", TLV_TYPE_BLOCK_TLV, TAB_MCAST_FILTER_BLOCK_ENTRY, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_ACTION_TYPE, "Default Action Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_CONTAIN_TO_VLAN, "Default Contain to Vlan Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_BRIDGE_MODE, "Default Bridge Mode Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_INVALID_POLICY, "Invalid Policy Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_FLOOR_NAME, "Floor Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_FLAGS, "AP Flags", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_PVID, "AP PVID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_REDIRECT, "AP Redirect Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_CVLAN_BAP, "AP Contain to Vlan Has Bridge At AP Topology Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_SESSION_ARRAY, "Array Of MU Session", TLV_TYPE_BLOCK_TLV, TAB_MU_SESSION_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_SESSION_BLOCK, "MU Session Block", TLV_TYPE_BLOCK_TLV, TAB_MU_SESSION_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_SESSION_ID, "MU Session ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RFS_NAME, "MU RFS Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FLAGS, "MU Flags", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ASSOC_TIME, "MU Associated Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACTIVE_TIME, "MU Actived Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_REPORT_REQ, "Report Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_URL, "MU Captive Portal Url", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_SESSION_LIFETIME, "MU Session Life Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_REAUTH_TIMER, "MU Re-Authentication Timer", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCT_SESSION_ID_STRING, "MU Acct Session ID String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCT_POLICY_NAME, "MU Acct Policy Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCT_START_TIME, "MU Acct Start Time", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ACCT_CLASS, "MU Acct Class", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_LOGIN_LAT_GROUP, "MU Login Group", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TUNNEL_PRIVATE_GROUP_ID_STRING, "MU Tunnel Private Group ID String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_USER_ID_STRING, "MU User ID String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DEFENDED_STATE, "MU Defended State", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_MOD_MASK, "MU Modulation Maske", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_TRACKED, "Locator Tracked", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PORT, "Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RETRIES_COUNT, "Retries Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MODULATION_TYPE, "Modulation Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DETECTED_ROGUE_ARRAY, "Array Of Detected Rogue", TLV_TYPE_BLOCK_TLV, TAB_DETECTED_ROGUE_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_DETECTED_ROGUE_BLOCK, "Detected Rogue Block", TLV_TYPE_BLOCK_TLV, TAB_DETECTED_ROGUE_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_ROGUE_DETECTION, "Rogue Detection", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MAC_ADDR_TX, "Tx Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MAC_ADDR_RX, "Rx Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IP_ADDR_TX, "Tx IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IP_ADDR_RX, "Rx IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TTL, "TTL", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_GW_IP_ADDR, "Gateway IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_STATE_DATA, "Location State Data", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATOR_POINT_SET, "Location Point Set", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULE_FIXED_APP_ID, "Filter Rule Fixed Application ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULES_EXT_BLOCK, "Filter Rule Extended Block", TLV_TYPE_BLOCK_TLV, TAB_FILTER_RULES_EXT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_AREA_BLOCK, "MU Area Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_LOCATION, "MU Location", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_LOCATION_TS, "MU Location Time Stamp", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DNS_IP_ADDR, "DNS IP Address", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IN_SERVICE_AP_LIST, "In-Service AP List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_OUT_SERVICE_AP_LIST, "Out of Service AP List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LAST_RD_AP, "Last RD AP", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ROGUE_INFO, "Rogue Info", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_IS_FT, "Enable/Disable MU Fast Transition", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_PMK_R1, "MU Fast Transition Roaming", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_R0KHID, "SIAPP R0KH ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_R1KHID, "SIAPP R1KH ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_NONCE, "SIAPP Fast Transition Nonce", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_PMKR0NAME, "SIAPP Fast Transition PMKR0 Name", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_R1KHID, "SIAPP Fast Transition R1KH ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_S1KHID, "SIAPP Fast Transition S1KH ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_PMKR1, "SIAPP Fast Transition PMKR1", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_PMKR1NAME, "SIAPP Fast Transition PMKR1 Name", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_PAIRWISE, "SIAPP Fast Transition Pairwise", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_FT_LIFETIME, "SIAPP Fast Transition Life Time", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_POWER_CAP, "MU Power Capable", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AREA_NAME, "Area Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PERIODIC_NEIGHBOUR_REPORT, "Periodic Neighbour Report", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TIMESTAMP, "Time Stamp", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NEIGHBOUR_ENTRY, "Neighbour Entry", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_REQ, "MU Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RU_REQ, "RU Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NEIGHBOUR_REQ, "Neighbour Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_FT_ASSOC, "Site Section Fast Transition Association", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_MIRRORN, "Enables the First N Packets of a Flow to The Controller", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULE_EXT_ACT_FLAGS, "Extension to Filter Rule Definition. Specifies Additional Actions Per Filter Rule", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TOPO_GROUP_MAPPING, "Topology Group Mapping", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_PMK_R0NAME, "MU Pairwise Master Key R0 Name", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CUI, "CUI", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_CAPINFO, "Site Section CAP Info", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SSS_CAPPOWER, "Site Section CAP Power", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_VSA, "WFA Vendor Specific Hotspot", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_HS20_REMED_METHOD, "Online Signup Method for HS2.0 Remediation", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_HS20_URL, "Remediation Server Url for Online Signup In HS2.0", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_HS20_DEAUTH_CODE, "WFA HS20 De-Authentication Code", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_HS20_REAUTH_DELAY, "WFA HS20 Re-Authentication Delay", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WFA_HS20_SWT, "WFA HS20 SWT", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POWER_STATUS, "Power Status", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IPV6_ADDR, "IPV6 Address", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULES_APP_SIG_GROUP_ID, "Filter Rule Application Signature Group ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_RULES_APP_SIG_DISP_ID, "Filter Rule Application Signature Display ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DEV_IDENTITY, "MU Device ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_STATS_REQ, "Application Rule Stats Request", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_APPL_STATS_BLOCK, "MU Application Rule Stats Block", TLV_TYPE_BLOCK_TLV, TAB_MU_APPL_STATS_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_TOPOLOGY_ARRAY, "Array of Topologies", TLV_TYPE_BLOCK_TLV, TAB_TOPOLOGY_ARRAY_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_TOPOLOGY_STRUCT, "Topology Struct", TLV_TYPE_BLOCK_TLV, TAB_TOPOLOGY_STRUCT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_CONFIG_STRUCT, "Filter Rule Configuration Struct", TLV_TYPE_BLOCK_TLV, TAB_FILTER_CONFIG_STRUCT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_DHCP_HOST_NAME, "DHCP Host Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NEIGHBOUR_ENTRY_2, "Neighbour Entry 2", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CHANNEL_ENTRY, "Channel Entry", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ECP_PW, "MU External Captive Portal Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ECP_TOKEN, "MU External Captive Portal Token", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_VSA_IPADDR, "AP Endpoint on Overlay Network IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_VSA_NETMASK, "AP Endpoint on Overlay Network IP Mask", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_CAPTURE_STATUS, "Packet Capture Status", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_CAPTURE_FILTERS, "Packet Capture Filters", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_WIRELESS, "Enable Packet Capture On Wireless", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_WIREDCLIENT, "Enable Packet Capture on Wired Client", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_DIRECTION, "Packet Capture Direction", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_RADIO, "Packet Capture on Radio", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_FLAGS, "Packet Capture Flag", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_IP_ARRAY, "Array of Packet Capture IP Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_MAC, "Array of Packet Capture Mac Addresses", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_PROTOCOL, "Packet Capture On Protocol", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_PORT, "Packet Capture On Port", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_VSA_SSID_ID, "VSA SSID ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_AUTH_TYPE, "MU Authentication Type", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_MAX_PKT_COUNT, "Max Captured Packet Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PKT_F_FLAG_2, "Packet Capture Flag 2", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IMAGE_PORT, "Image Port", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_ROLE_ID, " Filter Rule ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_ROLE_TIMESTAMP, " Time Stamp of When Role Was Last Changed", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MAX, "EID_MAX", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; typedef enum { EID_CONFIG_UNUSED_0 = 0, EID_RADIO_CONFIG_BLOCK, EID_VNS_CONFIG_BLOCK, EID_AP_ROLE, EID_LOC_ACTION_REQ, EID_TRACE_STATUS_DEBUG, EID_TRACE_STATUS_CONFIG, EID_MIC_ERR, EID_USE_BCAST_FOR_DISASSC, EID_BANDWIDTH_VOICE_ASSC, EID_BANDWIDTH_VOICE_REASSC, EID_BANDWIDTH_VIDEO_ASSC, EID_BANDWIDTH_VIDEO_REASSC, EID_BANDWIDTH_VIDEO_RESERVE, EID_BANDWIDTH_ADM_CTRL_RESERVE, EID_VLAN_TAG, EID_COUNTRY_CODE, EID_POLL_DURATION, EID_POLL_INTERVAL, EID_LOC_AUTO_COLLECT_ENABLE, EID_POLL_MAINTAIN_CLIENT_SESSION, EID_TELNET_ENABLE, EID_TELNET_PASSWORD, EID_TELNET_PASSWORD_ENTRY_MODE, EID_OUTDOOR_ENABLE, EID_ON_DEMAND_ARRAY, EID_LAG_ENABLED, EID_APP_POLICY_FIXED_BLOCK, EID_SLP_RETRY_COUNT, EID_SLP_RETRY_DELAY, EID_DNS_RETRY_COUNT, EID_DNS_RETRY_DELAY, EID_MCAST_SLP_RETRY_COUNT, EID_MCAST_SLP_RETRY_DELAY, EID_DISC_RETRY_COUNT, EID_DISC_RETRY_DELAY, EID_LOGGING_ALARM_SEV, EID_BLACKLIST_ADD, EID_FAILOVER_AC_IP_ADDR, EID_STATIC_AC_IP_ADDR, EID_DHCP_ASSIGNMENT, EID_STATIC_AP_IP_ADDR, EID_STATIC_AP_IP_NETMASK, EID_STATIC_AP_DEFAULT_GW, EID_BLACKLIST_DEL, EID_MACADDR_REQ, EID_AVAILABILITY_MODE, EID_AP_PERSISTENCE, EID_FOREIGN_AP, EID_SUPP1X_CREDENTIAL_REMOVE, EID_SUPP1X_CERT_TFTP_IP, EID_SUPP1X_CERT_TFTP_PATH, EID_SUPP1X_PRIVATE, EID_SUPP1X_DOMAIN, EID_SUPP1X_USERID, EID_SUPP1X_PASSWORD, EID_SUPP1X_CREDENT, EID_SUPP1X_SERIAL, EID_SUPP1X_START_DATE, EID_SUPP1X_END_DATE, EID_SUPP1X_ISSUED_BY, EID_SUPP1X_ISSUED_TO, EID_SUPP1X_SUBJALTNAME, EID_NOT_USED_CONFIG_TLV_63, EID_FAILOVER_AC_HOME_IP_ADDR, EID_FAILOVER_AC_FOREIGN_IP_ADDR, EID_AP_HOSTNAME, EID_LLDP_ENABLED, EID_LLDP_TTL, EID_LLDP_ANNOUNCEMENT_INT, EID_LLDP_ANNOUNCEMENT_DELAY, EID_VOWIFI_EXPIRATION_TIME, EID_MOBILITY_SHARED_KEY, EID_CHANNEL_REPORT_2_4G, EID_CHANNEL_REPORT_5G, EID_RATE_CONTROL_BLOCK, EID_AP_DNS, EID_STATIC_MTU, EID_MACFILTER_MODE, EID_SITE_CONFIG_BLOCK, EID_TOPOLOGY_BLOCK, EID_AP_NAME, EID_ANTENNA_MODELS, EID_AIRTIME_FAIRNESS_LEVEL, EID_VLAN_DEFAULT, EID_CLUSTER_PASSWORD, EID_SIAPP_PRIVACY, EID_LED_STATUS, EID_LBS_SRC_IP, EID_LBS_SRC_PORT, EID_LBS_DST_IP, EID_LBS_DST_PORT, EID_LBS_MCAST, EID_LBS_TAG_MODE, EID_ETH_PORT_MODE, EID_INTER_AP_ROAM, EID_MGMT_MAC, EID_REAL_CAPTURE_TIMEOUT, EID_POLICY_BLOCK, EID_FILTER_CONFIG_BLOCK, EID_COS_CONFIG_BLOCK, EID_LOCATION_BASED_LOOKUP_BLOCK, EID_RADIUS_SERVER_BLOCK, EID_DISC_RETRY_DELAY_WOUI_ADD, EID_DISC_RETRY_DELAY_WOUI_DEL, EID_SNIFFER_RADIO_BITMAP, EID_MCAST_ASSEMB, EID_JUMBO_FRAME, EID_DYN_ON_DEMAND_ARRAY, EID_BANDWIDTH_BE_ASSC, EID_BANDWIDTH_BE_REASSC, EID_BANDWIDTH_BK_ASSC, EID_BANDWIDTH_BK_REASSC, EID_NETFLOW_EXPORT_INTERVAL, EID_MIRRORN_PACKETS, EID_ICON_NAME, EID_ICON_FILE, EID_ICON_BLOCK, EID_BOARD_STATUS, EID_CP_MU_AUTO_LOGIN, EID_EXTAPP_CONF_BLOCK, EID_RB_REDIRECT, EID_RB_REDIRECT_PORTS, EID_S_TOPOLOGY_ARRAY, EID_S_TOPOLOGY_STRUCT, EID_S_TOPOLOGY_KEY, EID_S_TOPOLOGY_VLAN_TAG, EID_S_TOPOLOGY_ARP_PROXY, EID_S_TOPO_MCAST_FILTER_CONFIG_BLOCK, EID_MCAST_PRIORITIZED_VOICE, EID_IOT_CONTROL, EID_IOT_APPLICATION_ID, EID_AP_LOCATION, EID_IOT_ADMIN, EID_IOT_IMAGE, EID_IOT_BLE_ADVERTISE_INTERVAL, EID_IOT_BLE_ADVERTISE_POWER, EID_IOT_IBEACON_MAJOR, EID_IOT_IBEACON_MINOR, EID_IOT_IBEACON_UUID, EID_STATIC_ADSP_IP_ADDR, EID_OBSS_CHAN_ADJ_ACTIVE, EID_IOT_BLE_SCAN_SRC_IP, EID_IOT_BLE_SCAN_SRC_PORT, EID_IOT_BLE_SCAN_DST_IP, EID_IOT_BLE_SCAN_DST_PORT, EID_IOT_BLE_SCAN_INTERVAL, EID_IOT_BLE_SCAN_WINDOW, EID_IOT_BLE_SCAN_MIN_RSSI, EID_LISENSE_SERVER, EID_LISENSE_MIN_RSSI, EID_LISENSE_REP_FREQ, EID_DPI_SIG_HASH, EID_ANT_MODELS_IOT, EID_FABRICATTACH_ARRAY, EID_IOT_THREAD_CHANNEL, EID_IOT_THREAD_FACTORY_RESET, EID_IOT_THREAD_SHORT_PAN_ID, EID_IOT_THREAD_SHORT_EUI, EID_IOT_THREAD_PSKD, EID_IOT_THREAD_MASTER_KEY, EID_IOT_THREAD_NWK_NAME, EID_IOT_THREAD_COMM_CREDENTIAL, EID_IOT_THREAD_LONG_EUI, EID_IOT_THREAD_EXTENDED_PAN_ID, EID_AP_VSA_SSID_ID, EID_AP_STATIC_VSA_IPADDR, EID_AP_STATIC_VSA_NETMASK, EID_IOT_BLE_URL, EID_AP_PERSONALITY, EID_ADSP_RADIO_SHARE, EID_LOCATION_TENANT_ID, EID_IOT_BLE_BEACON_MEASURED_RSSI, EID_MU_NUM_RADAR_BACK } wassp_subtlv_config_type_t; /*************************************************** get define from packet-wassp.h 's wassp_subtlv_config_type_t struct ****************************************************/ static const TLV_PARSER_ENTRY tlvGlobalConfigTable[] = { { EID_CONFIG_UNUSED_0, "Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_CONFIG_BLOCK, "Radio Configuration Block", TLV_TYPE_BLOCK_TLV, RADIO_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_VNS_CONFIG_BLOCK, "VNS Configuration Block", TLV_TYPE_BLOCK_TLV, VNS_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_ROLE, "AccessPoint Role(0 - Traffic Forwarder, 1 - Dedicated Scanner, 2 - ADSP Sensor)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOC_ACTION_REQ, "Enable RSS Collection for Positioning Engine Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TRACE_STATUS_DEBUG, "Enable Trace Debug", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TRACE_STATUS_CONFIG, "Enable Trace Configuration", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MIC_ERR, "Message Integrity Check on AP26xx", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_USE_BCAST_FOR_DISASSC, "Use Broadcast for Client Disassociation", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_VOICE_ASSC, "Admission Control: Maximum Bandwidth for Voice Clients", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_VOICE_REASSC, "Admission Control: Maximum Bandwidth for Reassociation of Voice Clients", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_VIDEO_ASSC, "Admission Control: Maximum Bandwidth for Video Clients", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_VIDEO_REASSC, "Admission Control: Maximum Bandwidth for Reassociation of Video Clients", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_VIDEO_RESERVE, "Admission Control: Maximum Bandwidth for Reserve of Video Clients", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_ADM_CTRL_RESERVE, "Admission Control: Maximum Bandwidth for Reserve of Admin", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_VLAN_TAG, "VLAN Tag of AP Uplink", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COUNTRY_CODE, "Country Code", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLL_DURATION, "Poll Timeout in Seconds", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLL_INTERVAL, "Poll Interval in Seconds", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOC_AUTO_COLLECT_ENABLE, "Enable Auto Collection of RSS for Positioning Engine", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLL_MAINTAIN_CLIENT_SESSION, "Enable Maintaining of Client Session When Poll to Controller Times Out", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TELNET_ENABLE, "Enable SSH Access to AP", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TELNET_PASSWORD, "Hash SSH Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TELNET_PASSWORD_ENTRY_MODE, "Telnet Password Entry Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_OUTDOOR_ENABLE, "AP Environment (1 - Indoor, 2 - Outdoor)", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ON_DEMAND_ARRAY, "Array of MAC Addresses to Collect RSS for Positioning Engine (each element is 6 bytes)", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LAG_ENABLED, "Enable Link Aggregation on Uplink Ethernet Ports", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_FIXED_BLOCK, "Application Definition for Layer 4 Filters ", TLV_TYPE_BLOCK_TLV, TAB_APP_POLICY_FIXED_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_SLP_RETRY_COUNT, "Retry Count for SLP Discovery", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SLP_RETRY_DELAY, "Delay Between SLP Retries", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DNS_RETRY_COUNT, "Retry Count for DNS Discovery", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DNS_RETRY_DELAY, "Delay Between DNS Retries", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_SLP_RETRY_COUNT, "Retry Count for Multicast SLP Discovery", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_SLP_RETRY_DELAY, "Delay Between Multicast SLP Retries", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DISC_RETRY_COUNT, "Retry Count for Discovery", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DISC_RETRY_DELAY, "Delay Between Discovery Retries", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOGGING_ALARM_SEV, "Minimum Severity of Event to Report", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BLACKLIST_ADD, "Add Clients to MAC Access List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FAILOVER_AC_IP_ADDR, "Array of Controllers IP Addresses for Legacy Failover", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_AC_IP_ADDR, "Array of Static Controller IP Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DHCP_ASSIGNMENT, "Uplink IP Address Assignment (0 - Static, 1 - DHCP)", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_AP_IP_ADDR, "Uplink Static IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_AP_IP_NETMASK, "Uplink Netmask", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_AP_DEFAULT_GW, "Uplink Default Gateway", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BLACKLIST_DEL, "Remove Clients from MAC Access List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MACADDR_REQ, "Request to Send Radio BSSIDs in Config Acknowledge", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AVAILABILITY_MODE, "Availability Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_PERSISTENCE, "Keep Client Sessions When Connection to Controller Times Out", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FOREIGN_AP, "Home AP = 0, Foreign AP = 1", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_CREDENTIAL_REMOVE, "Remove Credential from AP,type: bitmask (1 - EAP-TLS, 2 - PEAP)", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_CERT_TFTP_IP, "TFTP Server IP Address for EAP-TLS Credential", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_CERT_TFTP_PATH, "TFTP Path for EAP-TLS Credential", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_PRIVATE, "EAP-TLS Private Key, Blowfish Encrypted", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_DOMAIN, "Community Domain", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_USERID, "PEAP User Id", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_PASSWORD, "PEAP Password, Blowfish Encrypted", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_CREDENT, "Credential Configuration of AP", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_SERIAL, "Certificate Serial", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_START_DATE, "Certificate Start Date", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_END_DATE, "Certificate Expiry Date", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_ISSUED_BY, "Certificate Issuer Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_ISSUED_TO, "Certificate Issued to Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SUPP1X_SUBJALTNAME, "Certificate Subject Alternative Name (Required From Microsoft)", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NOT_USED_CONFIG_TLV_63, "Not Used", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FAILOVER_AC_HOME_IP_ADDR, "Array of Home Controller IP Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FAILOVER_AC_FOREIGN_IP_ADDR, "Array of Foreign Controller IP Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_HOSTNAME, "AP Hostname", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LLDP_ENABLED, "Enable LLDP", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LLDP_TTL, "LLDP Time To Live", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LLDP_ANNOUNCEMENT_INT, "LLDP Announcement Interval", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LLDP_ANNOUNCEMENT_DELAY, "LLDP Announcement Delay", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_VOWIFI_EXPIRATION_TIME, "Voice Over WiFi Expiration Time", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MOBILITY_SHARED_KEY, "Encrypted With Blowfish Using AP Serial Number As Seed", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CHANNEL_REPORT_2_4G, "Channel Report Based On 2.4GHz", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CHANNEL_REPORT_5G, "Channel Report Based On 5GHz", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RATE_CONTROL_BLOCK, "Rate Control Block For Site", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_DNS, "AP DNS", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_MTU, "Uplink Static MTU", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MACFILTER_MODE, "MAC Access List Mode (1 - Blacklist, 2 - Whitelist)", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_CONFIG_BLOCK, "Configuration Block for Site", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_TOPOLOGY_BLOCK, "Topology Configuration Block for Site", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_NAME, "AP Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ANTENNA_MODELS, "Array of Antenna Model IDs", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AIRTIME_FAIRNESS_LEVEL, "Airtime Fairness Level: 0-4", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_VLAN_DEFAULT, "Thick AP Default Vlan (Untagged: -1, Vlan: 0~4094)", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CLUSTER_PASSWORD, "SIAPP Cluster Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SIAPP_PRIVACY, "Enable SIAPP Encryption", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LED_STATUS, "LED Status (0 - Off, 1 - WDS Signal Strength, 2 - Locate, 3 - Normal)", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_SRC_IP, "Location Base Service Source IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_SRC_PORT, "Location Base Service Source Port", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_DST_IP, "Location Base Service Destination IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_DST_PORT, "Location Base Service Destination Port", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_MCAST, "Location Base Service Multicast", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LBS_TAG_MODE, "Location Base Service Tag Mode", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ETH_PORT_MODE, "Ethernet Port Mode", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_INTER_AP_ROAM, "Inter AP Roam", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MGMT_MAC, "Management Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_REAL_CAPTURE_TIMEOUT, "Real Capture Time Out", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_BLOCK, "Policy Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_POLICY, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_CONFIG_BLOCK, "Filter Rule Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_FILTER, 0, 0, 0, 0, 0, 0, 0}, { EID_COS_CONFIG_BLOCK, "COS Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_COS, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATION_BASED_LOOKUP_BLOCK, "Location Based Lookup Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_LOC_BASE_LP, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_SERVER_BLOCK, "RADIUS Server Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_RADIUS_SERVER, 0, 0, 0, 0, 0, 0, 0}, { EID_DISC_RETRY_DELAY_WOUI_ADD, "Blacklist WOUI Add", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DISC_RETRY_DELAY_WOUI_DEL, "Blacklist WOUI Delete", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SNIFFER_RADIO_BITMAP, "Sniffer Radio Bit Map", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_ASSEMB, "Multicast Assemble", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_JUMBO_FRAME, "Jumbo Frame", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DYN_ON_DEMAND_ARRAY, "Location Dynamic On-demand MAC List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_BE_ASSC, "Best Effort Bandwidth for Association", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_BE_REASSC, "Best Effort Bandwidth for Reassociation", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_BK_ASSC, "Background Bandwidth for Association", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BANDWIDTH_BK_REASSC, "Background Bandwidth for Reassociation", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NETFLOW_EXPORT_INTERVAL, "Netflow Export Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MIRRORN_PACKETS, "MirrorN Packets", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ICON_NAME, "Hotspot 2.0 ICON Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ICON_FILE, "Hotspot 2.0 ICON File", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ICON_BLOCK, "Hotspot 2.0 ICON Block", TLV_TYPE_BLOCK_TLV, VNS_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_BOARD_STATUS, "Board Status", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CP_MU_AUTO_LOGIN, "Client Auto Login Handling: 0 : Hide Auto Login, 1 : Redirect Auto Login, 2 : Drop Auto Login", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_CONF_BLOCK, "Application Control Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_EXTAPP_CONF_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_RB_REDIRECT, "Role Based Redirection", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RB_REDIRECT_PORTS, "Role Based Redirection Ports", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPOLOGY_ARRAY, "Array of Site Topologies", TLV_TYPE_BLOCK_TLV, TAB_S_TOPOLOGY_ARRAY_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPOLOGY_STRUCT, "Site Topology Struct", TLV_TYPE_BLOCK_TLV, TAB_S_TOPOLOGY_STRUCT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPOLOGY_KEY, "Site Topology Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPOLOGY_VLAN_TAG, "Site Topology Vlan Tag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPOLOGY_ARP_PROXY, "Site Topology Arp Proxy", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPO_MCAST_FILTER_CONFIG_BLOCK, "Site Topology Multicast Filter Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_S_TOPO_MCAST_FILTER_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_MCAST_PRIORITIZED_VOICE, "Multicast Prioritized Voice", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_CONTROL, "IOT Control", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_APPLICATION_ID, "IOT Application ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_LOCATION, "AP Location", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_ADMIN, "Enable/Disable IOT Admin", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_IMAGE, "Enable IoT-KW41Z Image Upgrade", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_ADVERTISE_INTERVAL, "IOT BLE Advertise Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_ADVERTISE_POWER, "IOT BLE Advertise Power", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_IBEACON_MAJOR, "IOT Ibeacon Major", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_IBEACON_MINOR, "IOT Ibeacon Minor", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_IBEACON_UUID, "IOT Ibeacon UUID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATIC_ADSP_IP_ADDR, "Set ADSP Url", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_OBSS_CHAN_ADJ_ACTIVE, "Set Auto Channel Width", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_SRC_IP, "IOT BLE Scan Source IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_SRC_PORT, "IOT BLE Scan Source Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_DST_IP, "IOT BLE Scan Destination IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_DST_PORT, "IOT BLE Scan Destination Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_INTERVAL, "IOT BLE Scan Interval In Milliseconds", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_WINDOW, "IOT BLE Scan Window In Milliseconds", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_SCAN_MIN_RSSI, "IOT BLE Scan Min RSSI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LISENSE_SERVER, "License Server", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LISENSE_MIN_RSSI, "License Min RSSI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LISENSE_REP_FREQ, "License Report Frequency", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DPI_SIG_HASH, "Deep Packet Inspection Signature Hash", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ANT_MODELS_IOT, "Antanna Type for IOT Radio", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FABRICATTACH_ARRAY, "Array Of FabricAttach ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_CHANNEL, "IoT-Thread Network Parameter 802.15.4 Channel", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_FACTORY_RESET, "IoT-Thread Network Factory Reset", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_SHORT_PAN_ID, "IoT-Thread Network Parameter PAN ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_SHORT_EUI, "IoT-Thread network Parameter EUI", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_PSKD, "IoT-Thread network Parameter PSKd - Pre-Shared Key for the Device", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_MASTER_KEY, "IoT-Thread Network Parameter: Master Key", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_NWK_NAME, "IoT-Thread Network Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_COMM_CREDENTIAL, "IoT-Thread Commissioner Credential", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_LONG_EUI, "IoT-Thread Network Parameter EUI", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_THREAD_EXTENDED_PAN_ID, "IoT-Thread Network Parameter PAN ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_VSA_SSID_ID, "Configure VSA Interface", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_STATIC_VSA_IPADDR, "Configure VSA IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_STATIC_VSA_NETMASK, "Configure VSA Network Mask", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IOT_BLE_URL, "IoT-Eddystone URL Parameter", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_AP_PERSONALITY, "WING Or Identifi AP 1: WING AP, 0 : Identifi AP", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ADSP_RADIO_SHARE, "ADSP Radio Share Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOCATION_TENANT_ID, "Location Tenant ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0} }; /*Members of EID_S_TOPO_MCAST_FILTER_CONFIG_BLOCK: */ typedef enum { EID_S_TOPO_MCAST_FILTER_NAME = 1, EID_S_TOPO_MCAST_FILTER_RULES, EID_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK } wassp_tlv_S_topo_mcast_type_t; static const TLV_PARSER_ENTRY tlvSTopoMcastFilterBlock[] = { { EID_S_TOPO_MCAST_FILTER_NAME, "Site Topology Multicast Filter Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPO_MCAST_FILTER_RULES, "Site Topology Multicast Filter Rules", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK, "Site Topology Multicast Filter Rules Block", TLV_TYPE_BLOCK_TLV, TAB_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK, 0, 0, 0, 0, 0, 0, 0} }; /* Members of EID_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK: */ typedef enum { EID_S_TOPO_MCAST_FILTER_RULE_EXT_ACT_FLAGS = 1, EID_S_TOPO_MCAST_FILTER_RULES_IPV6 } wassp_tlv_S_topo_mcast_rule_type_t; static const TLV_PARSER_ENTRY tlvSTopoMcastFilterRuleBlock[] = { { EID_S_TOPO_MCAST_FILTER_RULE_EXT_ACT_FLAGS, "Site Topology Multicast Filter Rule Action Flags", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_S_TOPO_MCAST_FILTER_RULES_IPV6, "Site Topology Multicast Filter Rule IPv6 Addresses", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0} }; /* TLV Stats Types Layer 1 */ typedef enum { EID_DOT11_NOT_USED = 0, // 0 EID_DOT11_ACKFailureCount, // 1 EID_DOT11_FCSErrorCount, // 2 EID_DOT11_FailedCount, // 3 EID_DOT11_FrameDuplicateCount, // 4 EID_DOT11_MulticastReceivedFrameCount, // 5 EID_DOT11_MulticastTransmittedFrameCount, // 6 EID_DOT11_MultipleRetryCount, // 7 EID_DOT11_RTSFailureCount, // 8 EID_DOT11_RTSSuccessCount, // 9 EID_DOT11_ReceivedFragmentCount, // 10 EID_DOT11_RetryCount, // 11 EID_DOT11_TransmittedFragmentCount, // 12 EID_DOT11_TransmittedFrameCount, // 13 EID_DOT11_WEBUndecryptableCount, // 14 EID_DOT11_WEPExcludedCount, // 15 EID_DOT11_WEPICVErrorCount, // 16 EID_DRM_AllocFailures, // 17 EID_DRM_CurrentChannel, // 18 EID_DRM_CurrentPower, // 19 EID_DRM_DataTxFailures, // 20 EID_DRM_DeviceType, // 21 EID_DRM_InDataPackets, // 22 EID_DRM_InMgmtPackets, // 23 EID_DRM_LoadFactor, // 24 EID_DRM_MgmtTxFailures, // 25 EID_DRM_MsgQFailures, // 26 EID_DRM_NoDRMCurrentChannel, // 27 EID_DRM_OutDataPackets, // 28 EID_DRM_OutMgmtPackets, // 29 EID_IF_InBcastPackets, // 30 EID_IF_InDiscards, // 31 EID_IF_InErrors, // 32 EID_IF_InMcastPackets, // 33 EID_IF_InOctets, // 34 EID_IF_InUcastPackets, // 35 EID_IF_MTU, // 36 EID_IF_OutBcastPackets, // 37 EID_IF_OutDiscards, // 38 EID_IF_OutErrors, // 39 EID_IF_OutOctets, // 40 EID_IF_OutUcastPackets, // 41 EID_IF_OutMCastPackets, // 42 EID_MU_Address, // 43 EID_MU_AssociationCount, // 44 EID_MU_AuthenticationCount, // 45 EID_MU_DeAssociationCount, // 46 EID_MU_DeAuthenticationCount, // 47 EID_MU_IfIndex, // 48 EID_MU_ReAssociationCount, // 49 EID_MU_ReceivedBytes, // 50 EID_MU_ReceivedErrors, // 51 EID_MU_ReceivedFrameCount, // 52 EID_MU_ReceivedRSSI, // 53 EID_MU_ReceivedRate, // 54 EID_MU_TransmittedBytes, // 55 EID_MU_TransmittedErrors, // 56 EID_MU_TransmittedFrameCount, // 57 EID_MU_TransmittedRSSI, // 58 EID_MU_TransmittedRate, // 59 EID_MU_RF_STATS_END, // 60 EID_RFC_1213_SYSUPTIME, // 61 EID_STATS_ETHER_BLOCK, // 62 EID_STATS_RADIO_A_BLOCK, // 63 EID_STATS_RADIO_B_G_BLOCK, // 64 EID_MU_STATS_BLOCK, // 65 EID_STATS_WDS_BLOCK, // 66 EID_WDS_ROLE, // 67 EID_WDS_PARENTMAC, // 68 EID_WDS_SSID, // 69 EID_STATS_SUPP1x_BLOCK, // 70 EID_STATS_SUPP1X_CREDENT, // 71 EID_STATS_SUPP1X_END_DATE, // 72 EID_DOT11_ProtectionMode, // 73 EID_MU_TSPEC_Stats_Block, // 74 EID_DOT11_ChannelBonding, // 75 EID_DCS_STAS_NF, // 76 EID_DCS_STAS_CHANN_OCCUPANCY, // 77 EID_DCS_STAS_TX_OCCUPANCY, // 78 EID_DCS_STAS_RX_OCCUPANCY, // 79 EID_CAC_DEAUTH, // 80 EID_MU_IP, // 81 EID_STATS_CHECK, // 82 EID_WDS_BONDING, // 83 EID_MU_ReceivedRSS, // 84 EID_MU_RadioIndex, // 85 EID_MU_FltPktAllowed, // 86 EID_MU_FltPktDenied, // 87 EID_MU_FltName, // 88 EID_MU_FltReset, // 89 EID_MU_DL_DroppedRateControlPackets, // 90 EID_MU_DL_DroppedRateControlBytes, // 91 EID_MU_DL_DroppedBufferFullPackets, // 92 EID_MU_DL_DroppedBufferFullBytes, // 93 EID_MU_DL_LostRetriesPackets, // 94 EID_MU_DL_LostRetriesBytes, // 95 EID_MU_UL_DroppedRateControlPackets, // 96 EID_MU_UL_DroppedRateControlBytes, // 97 EID_SiappClusterName, // 98 EID_LB_LoadGroupID, // 99 EID_LB_LoadValue, // 100 EID_LB_MemberCount, // 101 EID_LB_ClientCount, // 102 EID_LB_LoadState, // 103 EID_LB_ProbeReqsDeclined, // 104 EID_LB_AuthReqsDeclined, // 105 EID_LB_RebalanceEvents, // 106 EID_MU_DOT11_CAPABILITY, // 107 EID_BAND_PREFERENCE_STATS, // 108 EID_R_LC_STATUS, // 109 EID_WDS_ROAM_COUNT, // 110 EID_WDS_TX_RETRIES, // 111 EID_RealCaptureTimeout, // 112 EID_MU_11N_ADVANCED, // 113 EID_MU_Count, // 114 EID_R_Clear_channel, // 115 EID_R_RX_Occupancy, // 116 EID_STATS_VNS_BLOCK, // 117 EID_STATS_VNS_ENTRY, // 118 EID_ETH_STATUS, // 119 EID_LAG_ACT_AGGREGATE_STATUS, // 120 EID_PERFORMANCE_STATS, // 121 EID_APPL_STATS, // 122 EID_APPL_COUNT, // 123 EID_APPL_MAC, // 124 EID_APPL_DISPLAY_ID, // 125 EID_APPL_TX_BYTES, // 126 EID_APPL_RX_BYTES, // 127 EID_MU_TRANSMITTED_MCS, // 128 EID_MU_TOTAL_LOST_FRAMES, // 129 EID_MU_DL_AGGR_SIZE, // 130 EID_RX_PHYS_ERRORS, // 131 EID_RADIO_HARDWARE_RESET, // 132 EID_TOTAL_PACKET_ERROR_RATE, // 133 EID_STATS_PORT_BLOCK, // 134 EID_PORT_ID, // 135 EID_MU_RADIO_ID, // 136 EID_IF_LinkSpeed, // 137 EID_MU_DL_RETRY_ATTEMPTS, // 138 EID_FILTER_STATS_BLOCK, // 139 EID_FILTER_STATS_RULES_BLOCK, // 140 EID_ROLE_ID, // 141 EID_ROLE_TIMESTAMP, // 142 EID_DEFAULT_HIT_COUNT_IN, // 143 EID_DEFAULT_HIT_COUNT_OUT, // 144 EID_RULE_HIT_COUNT_IN, // 145 EID_RULE_HIT_COUNT_OUT, // 146 EID_STATS_RADIO_ID, // 147 EID_STATS_RADIO_BLOCK, // 148 EID_MU_RFQI, // 149 EID_RADIO_RFQI, // 150 EID_IF_InBcastPackets_D, // 151 EID_IF_InDiscards_D, // 152 EID_IF_InErrors_D, // 153 EID_IF_InMcastPackets_D, // 154 EID_IF_InOctets_D, // 155 EID_IF_InUcastPackets_D, // 156 EID_IF_OutBcastPackets_D, // 157 EID_IF_OutDiscards_D, // 158 EID_IF_OutErrors_D, // 159 EID_IF_OutOctets_D, // 160 EID_IF_OutUcastPackets_D, // 161 EID_IF_OutMCastPackets_D, // 162 EID_MU_ReceivedFrameCount_D, // 163 EID_MU_TransmittedFrameCount_D, // 164 EID_MU_ReceivedErrors_D, // 165 EID_MU_TransmittedErrors_D, // 166 EID_MU_ReceivedBytes_D, // 167 EID_MU_TransmittedBytes_D, // 168 EID_MU_rc_ul_dropped_pkts_D, // 169 EID_MU_rc_ul_dropped_bytes_D, // 170 EID_MU_rc_dl_dropped_pkts_D, // 171 EID_MU_rc_dl_dropped_bytes_D, // 172 EID_STATS_TLV_MAX // Make shure this is the MAX } wassp_tlv_stats_1_type_t; /* Value string object enumerates wassp tlv type field */ static const TLV_PARSER_ENTRY tlvBeastConfigTable[] = { { EID_DOT11_NOT_USED, "DOT11Unused 0", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_ACKFailureCount, "802.11 Ack Failure Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_FCSErrorCount, "802.11 FCS Error Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_FailedCount, "802.11 Failed Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_FrameDuplicateCount, "802.11 Frame Duplicated Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_MulticastReceivedFrameCount, "802.11 Multicast Received Frame Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_MulticastTransmittedFrameCount, "802.11 Multicast Transmitted Frame Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_MultipleRetryCount, "802.11 Multiple Retry Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_RTSFailureCount, "802.11 RTS Failure Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_RTSSuccessCount, "802.11 RTS Success Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_ReceivedFragmentCount, "802.11 Received Fragment Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_RetryCount, "802.11 Retry Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_TransmittedFragmentCount, "802.11 Transmitted Fragment Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_TransmittedFrameCount, "802.11 Transmitted Frame Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_WEBUndecryptableCount, "802.11 WEP Undecryptable Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_WEPExcludedCount, "802.11 WEP Excluded Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_WEPICVErrorCount, "802.11 WEP ICV Error Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_AllocFailures, "802.11 DRM Allocated Failures", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_CurrentChannel, "802.11 DRM Current Channel", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_CurrentPower, "802.11 DRM Current Power", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_DataTxFailures, "802.11 DRM Data Tx Failures", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_DeviceType, "802.11 DRM Device Type", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_InDataPackets, "802.11 DRM In Data Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_InMgmtPackets, "802.11 DRM In Management Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_LoadFactor, "802.11 DRM Load Factor", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_MgmtTxFailures, "802.11 DRM Management Tx Failures", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_MsgQFailures, "802.11 DRM Message Q Failures", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_NoDRMCurrentChannel, "802.11 No DRM Current Channel", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_OutDataPackets, "802.11 DRM Out Data Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DRM_OutMgmtPackets, "802.11 DRM Out Management Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InBcastPackets, "Interface In Bcast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InDiscards, "Interface In Discards", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InErrors, "Interface In Errors", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InMcastPackets, "Interface In Mcast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InOctets, "Interface In Octets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InUcastPackets, "Interface In Ucast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_MTU, "Interface MTU", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutBcastPackets, "Interface Out Bcast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutDiscards, "Interface Out Discards", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutErrors, "Interface Out Errors", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutOctets, "Interface Out Octets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutUcastPackets, "Interface Out Ucast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutMCastPackets, "Interface Out MCast Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_Address, "MU Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_AssociationCount, "MU Association Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_AuthenticationCount, "MU Authentication Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DeAssociationCount, "MU DeAssociation Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DeAuthenticationCount, "MU DeAuthentication Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_IfIndex, "MU Interface Index", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReAssociationCount, "MU ReAssociation Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedBytes, "MU Received Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedErrors, "MU Received Errors", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedFrameCount, "MU Received Frame Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedRSSI, "MU Received RSSI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedRate, "MU Received Rate", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedBytes, "MU Transmitted Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedErrors, "MU Transmitted Errors", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedFrameCount, "MU Transmitted Frame Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedRSSI, "MU Transmitted RSSI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedRate, "MU Transmitted Rate", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RF_STATS_END, "MU RF Stats End", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RFC_1213_SYSUPTIME, "RFC1213 System Up Time", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_ETHER_BLOCK, "Stats Ethernet Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_ETH, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_RADIO_A_BLOCK, "Stats Radio A Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_RADIO, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_RADIO_B_G_BLOCK, "Stats Radio BG Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_RADIO, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_STATS_BLOCK, "MU Stats Block", TLV_TYPE_BLOCK_TLV, STATS_MU_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_WDS_BLOCK, "Stats WDS Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_WDS, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_ROLE, "WDS Role", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_PARENTMAC, "WDS Parent Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_SSID, "WDS SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_SUPP1x_BLOCK, "802.11X Stats Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_WDS, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_SUPP1X_CREDENT, "802.11X Credent", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_SUPP1X_END_DATE, "802.11X Expiry Date", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_ProtectionMode, "802.11 Protection Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TSPEC_Stats_Block, "MU TSPEC Stats Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DOT11_ChannelBonding, "802.11 Channel Bonding", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DCS_STAS_NF, "DCS STAS NF", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DCS_STAS_CHANN_OCCUPANCY, "DCS Stats Channel Occupancy", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DCS_STAS_TX_OCCUPANCY, "DCS Stats Tx Occupancy", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DCS_STAS_RX_OCCUPANCY, "DCS Stats Rx Occupancy", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_CAC_DEAUTH, "CAC DeAuthentication", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_IP, "MU IP", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_CHECK, "Stats Check", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_BONDING, "WDS Bonding", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedRSS, "MU Received RSS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RadioIndex, "MU Radio Index", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FltPktAllowed, "MU Allowed Packet", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FltPktDenied, "MU Denied Packet", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FltName, "MU Filter Rule Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_FltReset, "MU Filter Reset", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_DroppedRateControlPackets, "MU Down Link Dropped Rate Control Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_DroppedRateControlBytes, "MU Down Link Dropped Rate Control Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_DroppedBufferFullPackets, "MU Down Link Dropped Buffer Full Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_DroppedBufferFullBytes, "MU Down Link Dropped Buffer Full Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_LostRetriesPackets, "MU Down Link Lost Retries Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_LostRetriesBytes, "MU Down Link Lost Retries Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_UL_DroppedRateControlPackets, "MU Up Link Dropped Rate Control Packets", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_UL_DroppedRateControlBytes, "MU Up Link Dropped Rate Control Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SiappClusterName, "Siapp Cluster Mac address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_LoadGroupID, "Load Balance Load Group ID", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_LoadValue, "Load Balance Load value", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_MemberCount, "Load Balance Member Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_ClientCount, "Load Balance Client Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_LoadState, "Load Balance Load State", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_ProbeReqsDeclined, "Load Balance Probe Request Declined", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_AuthReqsDeclined, "Load Balance Authentication request Declined", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LB_RebalanceEvents, "Load Balance Rebalance Events", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DOT11_CAPABILITY, "MU 802.11 Capability", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BAND_PREFERENCE_STATS, "Band Preference Stats", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LC_STATUS, "Radio Load Control Stats", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_ROAM_COUNT, "WDS Roam Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_WDS_TX_RETRIES, "WDS Tx Retries", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RealCaptureTimeout, "Real Capture Timeout", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_11N_ADVANCED, "MU 802.11N Advanced", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_Count, "MU Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_Clear_channel, "Radio Clear Channel", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_RX_Occupancy, "Radio Rx Occupancy", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_VNS_BLOCK, "VNS Stats Block", TLV_TYPE_BLOCK_TLV, TAB_STATS_VNS, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_VNS_ENTRY, "VNS Stats Entry", TLV_TYPE_BLOCK_TLV, TAB_STATS_VNS, 0, 0, 0, 0, 0, 0, 0}, { EID_ETH_STATUS, "Ethernet Stats", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LAG_ACT_AGGREGATE_STATUS, "LAG Aggregate Stats", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PERFORMANCE_STATS, "Performance Stats", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_STATS, "Application Stats", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_COUNT, "Application Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_MAC, "Application Mac Address", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_DISPLAY_ID, "Application Display ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_TX_BYTES, "Application Tx Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APPL_RX_BYTES, "Application Rx Bytes", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TRANSMITTED_MCS, "MU Transmitted MCS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TOTAL_LOST_FRAMES, "MU Total Lost Frames", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_AGGR_SIZE, "MU Down Link Aggregate Size", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RX_PHYS_ERRORS, "Rx Phys Errors", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_HARDWARE_RESET, "Radio hardware Reset", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_TOTAL_PACKET_ERROR_RATE, "total Packet Error Rate", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_PORT_BLOCK, "ports Stats Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_PORT_ID, "Port ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RADIO_ID, "MU Radio ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_LinkSpeed, "Interface Link Speed", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_DL_RETRY_ATTEMPTS, "MU Down Link Retry Attempts", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_STATS_BLOCK, "Filter Stats Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_FILTER_STATS_RULES_BLOCK, "Filter Stats Rules Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ROLE_ID, "Role ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_ROLE_TIMESTAMP, "Role Timestamp", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_HIT_COUNT_IN, "Default In Direction Hit Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_DEFAULT_HIT_COUNT_OUT, "Default Out Direction Hit Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RULE_HIT_COUNT_IN, "Role In Direction Hit Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RULE_HIT_COUNT_OUT, "Role Out Direction Hit Count", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_RADIO_ID, "Stats Radio ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_RADIO_BLOCK, "Stats Radio ID Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_RFQI, "MU RFQI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIO_RFQI, "Radio RFQI", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InBcastPackets_D, "Interface In Bcast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InDiscards_D, "Interface In Discards Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InErrors_D, "Interface In Error Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InMcastPackets_D, "Interface In Mcast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InOctets_D, "Interface In Octets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_InUcastPackets_D, "Interface In Ucast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutBcastPackets_D, "Interface Out Bcast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutDiscards_D, "Interface Out Discards Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutErrors_D, "Interface Out Error Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutOctets_D, "Interface Out Octets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutUcastPackets_D, "Interface Out Ucast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_IF_OutMCastPackets_D, "Interface Out Mcast Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedFrameCount_D, "MU Received Fram Count Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedFrameCount_D, "MU Transmitted Fram Count Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedErrors_D, "MU Received Error Count Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedErrors_D, "MU Transmitted Error Count Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_ReceivedBytes_D, "MU Received Bytes Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_TransmittedBytes_D, "MU Transmitted Bytes Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_rc_ul_dropped_pkts_D, "MU Received Up Link Dropped Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_rc_ul_dropped_bytes_D, "MU Received Up Link Dropped Bytes Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_rc_dl_dropped_pkts_D, "MU Received Down Link Dropped Packets Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_MU_rc_dl_dropped_bytes_D, "MU Received Down Link Dropped Bytes Delta Value Since Last Message", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_STATS_TLV_MAX, "Last Stats TLV",0, 0, 0, 0, 0, 0, 0, 0, 0} }; #define WASSP_MAX_DECR_INFO_NUM 18 #define WASSP_MAX_SUBTREE_LEN 50 #define EID_PARSE_ERROR (EID_MAX+1) #define SET_WASSP_TLV_VERSION(val) (g_wassp_ver = (val)) #define GET_WASSP_TLV_VERSION() (g_wassp_ver) // #define WASSP_PRINT printf #define WASSP_PRINT #define WASSP_SUBTLV_GET_NAME(in_ptr) ((in_ptr)->name) #define WASSP_SUBTLV_GET_TYPE(in_ptr) ((in_ptr)->type) typedef enum { EID_R_UNUSED_0 = 0, EID_R_RADIO_ID, EID_R_ENABLE_RADIO, EID_R_CHANNEL, EID_R_OP_RATE_SET, EID_R_OP_RATE_MAX, EID_R_BEACON_PERIOD, EID_R_DTIM_PERIOD, EID_R_RTS_THRESHOLD, EID_R_ANTENNA_TYPE, EID_R_A_CHAN_PLAN_TYPE, EID_R_FRAGMENT_THRESHOLD, EID_R_POWER_LEVEL, EID_R_LC_ASSOC_TRY_MAX, EID_R_LC_STRICT_CLIENT_COUNT_LIMIT, EID_R_DIVERSITY_RX, EID_R_DIVERSITY_TX, EID_R_SHORT_PREAMBLE, EID_R_BASIC_RATE_MAX, EID_R_BASIC_RATE_MIN, EID_R_HW_RETRIES, EID_R_TX_POWER_MIN, EID_R_TX_POWER_MAX, EID_R_INTERFERENCE_EVENT_TYPE, EID_R_DOMAIN_ID, EID_R_B_ENABLE, EID_R_B_BASIC_RATES, EID_R_G_ENABLE, EID_R_G_PROTECT_MODE, EID_R_G_PROTECT_TYPE, EID_R_G_PROTECT_RATE, EID_R_G_BASIC_RATE, EID_R_A_SUPPORT_802_11_J, EID_R_ATPC_EN_INTERVAL, EID_R_ACS_CH_LIST, EID_R_TX_POWER_ADJ, EID_R_WIRELESS_MODE, EID_R_N_CHANNEL_BONDING, EID_R_N_CHANNEL_WIDTH, EID_R_N_GUARD_INTERVAL, EID_R_N_PROTECT_ENABLE, EID_R_N_PROTECT_TYPE, EID_R_N_PROTECT_OFFSET, EID_R_N_PROTECT_BUSY_THRESHOLD, EID_R_AGGREGATE_MSDU, EID_R_AGGREGATE_MSDU_MAX_LEN, EID_R_AGGREGATE_MPDU, EID_R_AGGREGATE_MPDU_MAX_LEN, EID_R_AGGREGATE_MPDU_SUBFRAMES, EID_R_ADDBA_SUPPORT, EID_R_DCS_MODE, EID_R_DCS_NOISE_THRESHOLD, EID_R_DCS_CHL_OCCUPANCY_THRESHOLD, EID_R_DCS_UPDATE_PERIOD, EID_R_ANTENNA_SELECTION, EID_R_BKGND_SCAN_ENABLE, EID_R_BKGND_SCAN_INTERVAL, EID_R_BCMCRATECTRL_AIRTIME, EID_R_CACS, EID_R_MAX_DISTANCE, EID_R_LOADGROUP_ID, EID_R_GROUP_BALANCING, EID_R_LC_CLIENT_COUNT_LIMIT, EID_R_ENABLE_LDPC, EID_R_ENABLE_TXSTBC, EID_R_ENABLE_RXSTBC, EID_R_ENABLE_TXBF, EID_R_TXBF_CLIENT_LIMIT, EID_R_INTERFERENCE_WAIT_TIME, EID_R_LC_ASSOC_TRY_TIMEOUT, EID_R_OPT_MCAST_PS, EID_R_MCAST_TO_UCAST_DELIVERY, EID_R_ADAPTABLE_RATE_FOR_MCAST, EID_R_ANTENNA_PORT_ATT, EID_R_PROBE_SUP_ENABLE, EID_R_PROBE_SUP_CAP, EID_R_PROBE_SUP_THRESH, EID_R_MU_NUM_RADAR_BACK, EID_R_ADSP_RADIO_SHARE, EID_R_OCS_CHANNEL_ENABLE, EID_R_OCS_CHANNEL_LIST, EID_R_OCS_SCAN_INTERVAL, EID_R_SENSOR_SCAN_MODE, EID_R_SENSOR_SCAN_LIST } wassp_subtlv_radio_block_type_t; static const TLV_PARSER_ENTRY tlvRadioConfigTable[] = { { EID_R_UNUSED_0, "Radio Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_RADIO_ID, "Radio ID", TLV_TYPE_INDEX, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ENABLE_RADIO, "Enable/Disable Radio", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_CHANNEL, "Radio Frequency In MHz", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OP_RATE_SET, "Operation Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OP_RATE_MAX, "Max Operation Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BEACON_PERIOD, "Beacon Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DTIM_PERIOD, "DTIM Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_RTS_THRESHOLD, "RTS/CTS Threshold", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ANTENNA_TYPE, "Radio Antenna Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_A_CHAN_PLAN_TYPE, "Radio Channel Plan Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_FRAGMENT_THRESHOLD, "Fragment Threshold", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_POWER_LEVEL, "Power Level", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LC_ASSOC_TRY_MAX, "LC Association Max Try", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LC_STRICT_CLIENT_COUNT_LIMIT, "LC Strict Client Count Limit", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DIVERSITY_RX, "Rx Diversity", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DIVERSITY_TX, "Tx Diversity", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_SHORT_PREAMBLE, "Radio Short Preamble", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BASIC_RATE_MAX, "Max Basic Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BASIC_RATE_MIN, "Min Basic Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_HW_RETRIES, "Hardware Retries", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_TX_POWER_MIN, "Min Tx Power", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_TX_POWER_MAX, "Max Tx Power", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_INTERFERENCE_EVENT_TYPE, "Interference Event Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DOMAIN_ID, "Domain ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_B_ENABLE, "Enable Radio B", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_B_BASIC_RATES, "Radio B Basic Rates", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_G_ENABLE, "Enable Radio G", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_G_PROTECT_MODE, "Radio G Protect Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_G_PROTECT_TYPE, "Radio G Protect Type", TLV_TYPE_INDEX, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_G_PROTECT_RATE, "Radio G Protect Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_G_BASIC_RATE, "Radio G Basic Rate", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_A_SUPPORT_802_11_J, "Radio A Support 802.11J", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ATPC_EN_INTERVAL, "Automatic Transmit Power Control Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ACS_CH_LIST, "Radio ACS Channel List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_TX_POWER_ADJ, "Radio Tx Power Adjustment", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_WIRELESS_MODE, "Wireless Radio Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_CHANNEL_BONDING, "802.11n Channel Bonding: 0=No Bonding, 1=Bond-Up, 2=Bond-Down", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_CHANNEL_WIDTH, "802.11n Channel Width: 1=20Mhz, 2=40Mhz, 3=both", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_GUARD_INTERVAL, "802.11n Guard Interval: 1=short, 2=long", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_PROTECT_ENABLE, "802.11n Channel Protection Mode: 0=disabled, 1=enabled", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_PROTECT_TYPE, "802.11n 40Mhz Channel Protection: 0=None, 1=CTS only, 2=RTS/CTS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_PROTECT_OFFSET, "802.11n Channel Protection Offset: 1=20Mhz, 2=25MHz", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_N_PROTECT_BUSY_THRESHOLD, "802.11n 40Mhz Channel Busy Threshold: 0...100", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_AGGREGATE_MSDU, "Aggregate MSDUs: 0=disabled, 1=enabled", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_AGGREGATE_MSDU_MAX_LEN, "Aggregate MSDU Max Length: 2290...4096", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_AGGREGATE_MPDU, "Aggregate MPDUs: 0=disabled, 1=enabled", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_AGGREGATE_MPDU_MAX_LEN, "Aggregate MPDU Max Length: 1024...65535", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_AGGREGATE_MPDU_SUBFRAMES, "Aggregate MPDU Max # of Sub-frames: 2...64", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ADDBA_SUPPORT, "ADDBA Support: 0=disabled, 1=enabled", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DCS_MODE, "Dynamic channel Selection Mode: 0=off, 1=monitor, 2=active", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DCS_NOISE_THRESHOLD, "Dynamic channel Selection Noise Threshold", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DCS_CHL_OCCUPANCY_THRESHOLD, "Dynamic channel Selection Channel Occupancy", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_DCS_UPDATE_PERIOD, "Dynamic channel Selection Update Period", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ANTENNA_SELECTION, "Antenna selection. LSB 0 - Left, bit 1 - Middle, bit 2 - Right", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BKGND_SCAN_ENABLE, "Voice Over WIFI: 0=off, 1=on ", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BKGND_SCAN_INTERVAL, "Voice Over WIFI Interval", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_BCMCRATECTRL_AIRTIME, "Broadcast/Multicast Rate Control: The Percentage of Airtime Allowed for Broadcast/Multicast Traffic", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_CACS, "Thick/Thin AP: Cluster ACS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_MAX_DISTANCE, "Radio Max Distance (used for WDS)", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LOADGROUP_ID, "Radio Load Group or Balance Group ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_GROUP_BALANCING, "Group Balancing Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LC_CLIENT_COUNT_LIMIT, "Radio Client Count Limit", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ENABLE_LDPC, "Enable/Disable LDPC Coding: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ENABLE_TXSTBC, "Enable/Disable Radio TxSTBC: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ENABLE_RXSTBC, "Enable/Disable Radio RxSTBC: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ENABLE_TXBF, "Set TxBF Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_TXBF_CLIENT_LIMIT, "TxBF Client Limit", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_INTERFERENCE_WAIT_TIME, "Interference Wait Time", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_LC_ASSOC_TRY_TIMEOUT, "LC Association Try Time Out", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OPT_MCAST_PS, "Enable/Disable Optimized Multicast Power Save: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_MCAST_TO_UCAST_DELIVERY, "Multicast to Unicast Delivery: 0 = Disable, 1 = Auto", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ADAPTABLE_RATE_FOR_MCAST, "Enable/Disable Adaptable Rate for Multicast: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ANTENNA_PORT_ATT, "Antenna Port ATT", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_PROBE_SUP_ENABLE, "Enable/Disable Probe Suppression: 0 = Disable, 1 = Enable", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_PROBE_SUP_CAP, "Probe Suppression Capacity", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_PROBE_SUP_THRESH, "Probe Suppression Threshold", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_MU_NUM_RADAR_BACK, "DFS Max Number of Clients Allow Return to Original Channel After DFS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_ADSP_RADIO_SHARE, "ADSP Radio Share", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OCS_CHANNEL_ENABLE, "Enable/Disable OCS", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OCS_CHANNEL_LIST, "List Of OCS Channel", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_OCS_SCAN_INTERVAL, "OCS Scan Interval", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_SENSOR_SCAN_MODE, "Sensor Scan Mode", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_R_SENSOR_SCAN_LIST, "Sensor Scan List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0} }; typedef enum { EID_V_UNUSED = 0, EID_V_RADIO_ID, EID_V_VNS_ID, EID_V_TURBO_VOICE, EID_V_PROP_IE, EID_V_ENABLE_802_11_H, EID_V_POWER_BACKOFF, EID_V_BRIDGE_MODE, EID_V_VLAN_TAG, EID_V_PROCESS_IE_REQ, EID_V_ENABLE_U_APSD, EID_V_ADM_CTRL_VOICE, EID_V_ADM_CTRL_VIDEO, EID_V_QOS_UP_VALUE, EID_V_PRIORITY_OVERRIDE, EID_V_DSCP_OVERRIDE_VALUE, EID_V_ENABLE_802_11_E, EID_V_ENABLE_WMM, EID_V_LEGACY_CLIENT_PRIORITY, EID_V_SSID_ID, EID_V_SSID_BCAST_STRING, EID_V_SSID_SUPPRESS, EID_V_802_1_X_ENABLE, EID_V_802_1_X_DYN_REKEY, EID_V_WPA_ENABLE, EID_V_WPA_V2_ENABLE, EID_V_WPA_PASSPHRASE, EID_V_WPA_CIPHER_TYPE, EID_V_WPA_V2_CIPHER_TYPE, EID_V_WEP_KEY_INDEX, EID_V_WEP_DEFAULT_KEY_VALUE, EID_V_CHANNEL_REPORT, EID_V_WDS_SERVICE, EID_V_WDS_BSSID_PARENT, EID_V_WDS_BRIDGE, EID_V_OKC_ENABLED, EID_V_MU_ASSOC_RETRIES, EID_V_MU_ASSOC_TIMEOUT, EID_V_WDS_PARENT, EID_V_WDS_BACK_PARENT, EID_V_WDS_NAME, EID_V_SESSION_AVAIL, EID_V_UL_POLICER_ACTION, EID_V_DL_POLICER_ACTION, EID_V_ENABLE_802_11_K, EID_V_ENABLE_802_11_H_BG, EID_V_SITE_EGRESS_FILTER_MODE, EID_V_DEFAULT_IDLE_PRE_TIMEOUT, EID_V_DEFAULT_IDLE_POST_TIMEOUT, EID_V_IGNORE_COS, EID_V_RADIUS_SERVER_INDEX2, EID_V_MCAST_OPTIMIZATION, EID_V_MCAST_IGMP_TIMEOUT, EID_V_MCAST_FILTER_ENABLE, EID_V_FILTER_CONFIG_BLOCK, EID_V_DATA_REASSEMBLY_ENABLE, EID_V_UCAST_FILTER_ENABLE, EID_V_RATECTRL_CIR_UL, EID_V_RATECTRL_CIR_DL, EID_V_RATECTRL_CBS_UL, EID_V_RATECTRL_CBS_DL, EID_V_AIRTIME_FAIRNESS_ENABLE, EID_V_POWERSAVE_ENABLE, EID_V_GROUP_KP_SAVE_RETRY, EID_V_BALANCE_GROUP, EID_V_MESH_TYPE, EID_V_MESH_ROAMING_THRESHOLD, EID_V_COS, EID_V_RATE_LIMIT_RESOURCE_TBL, EID_V_AP_AUTH_CLIENT_MODES, EID_V_DEFAULT_POLICY_INDEX, EID_V_AUTH_POLICY_INDEX, EID_V_NONAUTH_POLICY_INDEX, EID_V_RADIUS_SERVER_INDEX, EID_V_NAS_IP, EID_V_NAS_ID, EID_V_VSA_SELMASK, EID_V_MBA_OPTIONS_MASK, EID_V_MBA_TIMEOUT_POLICY_KEY, EID_V_WLAN_SERVICE_NAME, EID_V_DEFAULT_SESSION_TIMEOUT, EID_V_RADIUS_CALLED_STATION_ID, EID_V_CAPTIVE_PORTAL, EID_V_COS_CONFIG_BLOCK, EID_V_TOPOLOGY_KEY, EID_V_MU_INIT_PERIOD_BEHAVIOUR, EID_V_DYNAMIC_EGRESS_VLANS, EID_V_STATIC_EGRESS_VLANS, EID_V_FLAGS, EID_V_DEFAULT_ACTION, EID_V_CONTAIN_TO_VLAN, EID_V_PVID_TOPOLOGY_KEY, EID_V_AP_REDIRECT, EID_V_ADM_CTRL_BE, EID_V_ADM_CTRL_BK, EID_V_11K_ENABLE, EID_V_11K_RM_CAP, EID_V_11R_ENABLE, EID_V_11R_R0KH_ID, EID_V_11R_MD_ID, EID_V_MGMT_FRAME_PROTECTION, EID_V_NETFLOW, EID_V_WLAN_DEFAULT_MIRRORN, EID_V_DEFAULT_MIRRORN, EID_V_11U_ANQP_BLOCK, EID_V_HS2_BLOCK, EID_V_APP_IDENTIFICATION_ENABLED, EID_V_PRIVACY, EID_V_11U_OSEN, EID_V_QOS_IN_USE, EID_V_CP_CONFIG_BLOCK, EID_V_CP_IDENTITY, EID_V_CP_PASSPHRASE, EID_V_CP_REDIRECT_URL, EID_V_CP_USE_HTTPS, EID_V_CP_AUTH_URL, EID_V_CP_FLAGS, EID_V_CP_AP_FQDN, EID_V_VNS_NAME, EID_V_LDAP_SERVER_INDEX, EID_V_AIRTIME_RESERVATION, EID_V_MU_DISCON_REQ_ENABLE } wassp_subtlv_vns_config_type_t; static const TLV_PARSER_ENTRY tlvVnsConfigTable[] = { { EID_V_UNUSED, "Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADIO_ID, "Radio ID", TLV_TYPE_INDEX, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_VNS_ID, "VNS ID", TLV_TYPE_INDEX, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_TURBO_VOICE, "Enable Turbo Voice", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_PROP_IE, "Process IE", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_802_11_H, "Enable 802.11H", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_POWER_BACKOFF, "Enable 802.11H Power Back Off", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_BRIDGE_MODE, "VNS Bridge Mode: 0 = Tunnel, 1 = Bridge, 3 = WDS, 10 = Any ", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_VLAN_TAG, "Vlan Tag: -1 = Untagged, -2 = Tunnel, 0 = WDS, 1-4094 = Tagged", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_PROCESS_IE_REQ, "Process IE Request", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_U_APSD, "Enable UAPSD Mode", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ADM_CTRL_VOICE, "Enable Admission Control for Voice", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ADM_CTRL_VIDEO, "Enable Admission Control for Video", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_QOS_UP_VALUE, "DSCP to UP Mapping", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_PRIORITY_OVERRIDE, "Enable DSCP to UP Override", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DSCP_OVERRIDE_VALUE, "DSCP to UP Override value", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_802_11_E, "Enable 802.11E", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_WMM, "Enable WMM Mode", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_LEGACY_CLIENT_PRIORITY, "Enable Legacy Value", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SSID_ID, "Internal VID Number Assigned by Controller", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SSID_BCAST_STRING, "SSID String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SSID_SUPPRESS, "Enable Suppress SSID", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_802_1_X_ENABLE, "Enable 802.11X", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_802_1_X_DYN_REKEY, "VAP Group Key Update Interval", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WPA_ENABLE, "Enable WPA", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WPA_V2_ENABLE, "Enable WPA V2", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WPA_PASSPHRASE, "WPA-PSK Passphrase", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WPA_CIPHER_TYPE, "WPA Cipher Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WPA_V2_CIPHER_TYPE, "WPA V2 Cipher Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WEP_KEY_INDEX, "WEP Key Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WEP_DEFAULT_KEY_VALUE, "WEP Default Key", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CHANNEL_REPORT, "Channel Report", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_SERVICE, "WDS Service Type: 0 = None, 1 = Child, 2 = Parent, 3 = Both", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_BSSID_PARENT, "WDS Parent BSSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_BRIDGE, "Enable WDS Bridge: 0 = Unknown, 1 = Enable, 2 = Disable", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_OKC_ENABLED, "OKC/Preauthentication", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MU_ASSOC_RETRIES, "MU Association Retries", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MU_ASSOC_TIMEOUT, "MU Association Request Time Out", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_PARENT, "WDS Parent AP", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_BACK_PARENT, "WDS Backup Parent AP", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WDS_NAME, "WDS AP Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SESSION_AVAIL, "Enable Session Availability", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_UL_POLICER_ACTION, "Up Link Policer Action: Bit0 Set = Downgrade, Bit1 Set = Drop, Bit2 Set = Delete TSPEC", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DL_POLICER_ACTION, "Down Link Policer Action: Bit0 Set = Downgrade, Bit1 Set = Drop, Bit2 Set = Delete TSPEC", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_802_11_K, "Enable 802.11K", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ENABLE_802_11_H_BG, "Enable 802.11H For BG Radio", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_EGRESS_FILTER_MODE, "Site Egress Filter Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_IDLE_PRE_TIMEOUT, "Default Idle Pre Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_IDLE_POST_TIMEOUT, "Default Idle Post Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_IGNORE_COS, "Ignore CoS In This VNS", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADIUS_SERVER_INDEX2, "Secondary Radius Server Index", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MCAST_OPTIMIZATION, "Multicast: IGMP Snooping Enable/Disable Per VNS", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MCAST_IGMP_TIMEOUT, "Multicast: IGMP Snooping LDMG Entry Expire Timer In Minutes", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MCAST_FILTER_ENABLE, "Enable Multicast Filtering at AP", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_CONFIG_BLOCK, "Filter Config Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_FILTER, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DATA_REASSEMBLY_ENABLE, "Enable Fragmentation", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_UCAST_FILTER_ENABLE, "Enable Unicast Filter", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RATECTRL_CIR_UL, "Uplink CIR", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RATECTRL_CIR_DL, "Downlink CIR", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RATECTRL_CBS_UL, "Uplink CBS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RATECTRL_CBS_DL, "Downlink CBS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_AIRTIME_FAIRNESS_ENABLE, "Enable Airtime Fairness", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_POWERSAVE_ENABLE, "Enable Power Save", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_GROUP_KP_SAVE_RETRY, "Group Power Save Retry", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_BALANCE_GROUP, "Enable Vlan Membership to The Radio Balance", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MESH_TYPE, "Mesh Type: 0 = Static WDS, 1 = Dynamic WDS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MESH_ROAMING_THRESHOLD, "Mesh Roaming Threshold", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_COS, "AP COS", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RATE_LIMIT_RESOURCE_TBL, "Rate Limit Resource List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_AP_AUTH_CLIENT_MODES, "Client Authentication Mode: Bit0 Set = MBA, Bit1 SET = Dot1x, Bit2 Set = CP", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_POLICY_INDEX, "Default Policy Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_AUTH_POLICY_INDEX, "Authentication Policy Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_NONAUTH_POLICY_INDEX, "Non Authentication Policy Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADIUS_SERVER_INDEX, "Primary Radius Server", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_NAS_IP, "NAS IP", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_NAS_ID, "NAS Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_VSA_SELMASK, "VSA Mask", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MBA_OPTIONS_MASK, "MBA Options Mask", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MBA_TIMEOUT_POLICY_KEY, "MBA Timeout Policy Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WLAN_SERVICE_NAME, "WLAN Service Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_SESSION_TIMEOUT, "Default Session Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADIUS_CALLED_STATION_ID, "Radius Called Station ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CAPTIVE_PORTAL, "Enable Captive Portal", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_COS_CONFIG_BLOCK, "COS Configuration Block Index", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_TOPOLOGY_KEY, "Topology Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MU_INIT_PERIOD_BEHAVIOUR, "MU Init Behaviour: 0 = Discard Non Auth Traffic, 1 = Default Policy", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DYNAMIC_EGRESS_VLANS, "Dynamic Egress Vlan list", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATIC_EGRESS_VLANS, "Static Egress Vlan list", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FLAGS, "Policy Flags Based on Analyzing The Rules Inside The Policy", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_ACTION, "Default Action", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CONTAIN_TO_VLAN, "Default Contain Vlan", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_PVID_TOPOLOGY_KEY, "PVID Topology Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_AP_REDIRECT, "AP Redirect Mode: -1 = Invalid, 0 = Disable, 1 = At Controller, 2 = At AP", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ADM_CTRL_BE, "Enable Admission Control For Best Effort", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_ADM_CTRL_BK, "Enable Admission Control For Background", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11K_ENABLE, "Enable 802.11K", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11K_RM_CAP, "802.11K RM Capacity", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11R_ENABLE, "Enable 802.11R", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11R_R0KH_ID, "802.11R R0 Key Holder ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11R_MD_ID, "802.11R Mobility Domain ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_MGMT_FRAME_PROTECTION, "Protected Management Frames: 0 = Enable, 1 = Disable, 2 = Require", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_NETFLOW, "Control for NetFlow: 1 = Enable, 2 = Disable", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_WLAN_DEFAULT_MIRRORN, "V_WLAN_DEFAULT_MIRRORN", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_DEFAULT_MIRRORN, "WLAN Default MirrorN: 0 = None, 1 = Prohibited, 2 = Enable, 3 = Enable TCP and UDP Both Direction, 4 = Enable TCP and UDP In Direction ", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11U_ANQP_BLOCK, "802.11U ANQP Config Block", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_V_HS2_BLOCK, "HS2 Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_V_APP_IDENTIFICATION_ENABLED, "Enable/Disable Application Identification", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_PRIVACY, "Privacy", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_11U_OSEN, "Enable OSU Server-Only Authenticated L2 Encryption Network", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_QOS_IN_USE, "Bitmask Used to Select DHCP Values for QoS Mapping", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_CONFIG_BLOCK, "CP Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_V_CP_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_IDENTITY, "User Identity", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_PASSPHRASE, "Shared Secret in Encryption Form", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_REDIRECT_URL, "Redirection Url for Non-auth Policy", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_USE_HTTPS, "Enable HTTPS", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_AUTH_URL, "Where to Redirect MU After Successful Authentication", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_FLAGS, "Bitmap for Captive Portal Flags", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_CP_AP_FQDN, "AP FQDN Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_VNS_NAME, "VNS Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_LDAP_SERVER_INDEX, "LDAP Server for CP Authentication", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_AIRTIME_RESERVATION, "Assign Airtime to VNS In Percentage In Steps of 10%", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_STATS_VNS_BLOCK typedef enum { EID_V_STATS_UNUSED0, EID_V_STATS_VNSID, EID_V_STATS_RADCL_REQS, EID_V_STATS_RADCL_FAILED, EID_V_STATS_RADCL_REJECTS, EID_V_STATS_VNS_ENTRY = 118 } wassp_subtlv_vns_status_type_t; static const TLV_PARSER_ENTRY tlvVnsStatusTable[] = { { EID_V_STATS_UNUSED0, "VNS Stats Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATS_VNSID, "VNS ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATS_RADCL_REQS, "VNS Radius Stats Request", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATS_RADCL_FAILED, "VNS Radius Stats Failed", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATS_RADCL_REJECTS, "VNS Radius Stats Reject", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_STATS_VNS_ENTRY, "VNS Stats Entry", TLV_TYPE_BLOCK_TLV, TAB_STATS_VNS, 0, 0, 0, 0, 0, 0, 0} }; //RADIUS: Global Radius Config Block (V8R11: Site) typedef enum { EID_RADIUS_ID = 0, EID_RADIUS_IP_NAME, EID_RADIUS_SHAREDSECRET, EID_RADIUS_PROTOCOL, EID_RADIUS_PORT, EID_RADIUS_TIMEOUT, EID_RADIUS_RETRY, EID_RADIUS_MBA_MAC_FORMAT, EID_RADIUS_MBA_PASSWORD } wassp_subtlv_radius_config_type_t; static const TLV_PARSER_ENTRY tlvRadiusConfigTable[] = { { EID_RADIUS_ID, "Radius ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_IP_NAME, "Radius Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_SHAREDSECRET, "Radius Shared Secret", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_PROTOCOL, "Radius Protocol: 0 = PAP, 1 = CHAP, 2 = MS CHAP, 3 = MS CHAP2", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_PORT, "Radius Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_TIMEOUT, "Radius Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_RETRY, "Radius Retry Count", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_MBA_MAC_FORMAT, "Radius MBA MAC Format", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_RADIUS_MBA_PASSWORD, "Radius MBA Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0} }; //RADSRV:Radius Server Config Block for a specific VNS (for V6R0: Branch 802.1x) typedef enum { EID_V_UNUSED0, EID_V_RADSRV_SRV_ID, EID_V_RADSRV_SRV_TYPE, EID_V_RADSRV_SRV_PORT, EID_V_RADSRV_SRV_RETRY, EID_V_RADSRV_SRV_TIMEOUT, EID_V_RADSRV_AUTH_TYPE, EID_V_RADSRV_PASSWORD, EID_V_RADSRV_NAS_IP, EID_V_RADSRV_NAS_ID } wassp_subtlv_radius_server_config_type_t; static const TLV_PARSER_ENTRY tlvRadiusServerConfigTable[] = { { EID_V_UNUSED0, "V_UNUSED0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_SRV_ID, "Radius Server ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_SRV_TYPE, "Radius Server Type", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_SRV_PORT, "Radius Server Port", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_SRV_RETRY, "Radius Server Retry", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_SRV_TIMEOUT, "Radius Server Timeout", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_AUTH_TYPE, "Radius Server Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_PASSWORD, "Radius Server Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_NAS_IP, "Radius Server NAS IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_RADSRV_NAS_ID, "Radius Server NAS ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0} }; typedef enum { EID_V_FILTER_UNUSED_0, EID_V_FILTER_NAME, EID_V_FILTER_RULES, EID_V_FILTER_TYPE, EID_V_FILTER_KEY, EID_V_SITE_FILTER_RULES, EID_V_FILTER_BYPASS_BMCAST, EID_V_FILTER_RULES_EXT_BLOCK, EID_V_SITE_FILTER_RULES_EXT_BLOCK } wassp_subtlv_filter_block_type_t; static const TLV_PARSER_ENTRY tlvFilterConfigTable[] = { { EID_V_FILTER_UNUSED_0, "Filter Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_NAME, "Filter Rule Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULES, "Filter Rule Bit Mask", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_TYPE, "Filter Rule Type", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_KEY, "Filter Rule Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULES, "Site Filter Rules", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_BYPASS_BMCAST, "Bypass Broadcast and Multicast", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULES_EXT_BLOCK, "Filter Rule Extended Block", TLV_TYPE_BLOCK_TLV, TAB_V_FILTER_RULES_EXT_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULES_EXT_BLOCK, "Site Filter Rule Extended Block", TLV_TYPE_BLOCK_TLV, TAB_V_SITE_FILTER_RULES_EXT_BLOCK, 0, 0, 0, 0, 0, 0, 0} }; typedef enum { EID_V_FILTER_UNUSED0, EID_V_FILTER_RULE_FIXED_APP_ID, EID_V_FILTER_RULE_EXT_ACT_FLAGS, EID_V_FILTER_RULES_APP_SIG_GROUP_ID, EID_V_FILTER_RULES_APP_SIG_DISP_ID, EID_V_FILTER_RULES_IPV6_ADDR } wassp_subtlv_filter_rule_ext_block_type_t; static const TLV_PARSER_ENTRY tlvFilterRuleExtConfigTable[] = { { EID_V_FILTER_UNUSED0, "Filter Rule Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULE_FIXED_APP_ID, "Fixed Application Rule ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULE_EXT_ACT_FLAGS, "Filter Rule Ext Act Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULES_APP_SIG_GROUP_ID, "Application Signature group ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULES_APP_SIG_DISP_ID, "Application Signature Display ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_FILTER_RULES_IPV6_ADDR, "Filter Rule IPV6 List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0} }; typedef enum { EID_V_SITE_FILTER_UNUSED0, EID_V_SITE_FILTER_RULE_FIXED_APP_ID, EID_V_SITE_FILTER_RULE_EXT_ACT_FLAGS, EID_V_SITE_FILTER_RULES_APP_SIG_GROUP_ID, EID_V_SITE_FILTER_RULES_APP_SIG_DISP_ID, EID_V_SITE_FILTER_RULES_IPV6_ADDR } wassp_subtlv_site_filter_rule_ext_block_type_t; static const TLV_PARSER_ENTRY tlvSiteFilterRuleExtConfigTable[] = { { EID_V_SITE_FILTER_UNUSED0, "Site Filter Rule Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULE_FIXED_APP_ID, "Site Fixed Application Rule ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULE_EXT_ACT_FLAGS, "Site Filter Rule Ext Act Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULES_APP_SIG_GROUP_ID, "Site Application Signature group ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULES_APP_SIG_DISP_ID, "Site Application Signature Display ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_V_SITE_FILTER_RULES_IPV6_ADDR, "Site Filter Rule IPV6 List", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0} }; #if 0 //BSSID2IP: BSSID to IP mapping block (for V6R0: VoWIFI) typedef enum { EID_BSSID2IP_UNUSED0, EID_BSSID2IP_BSSID, EID_BSSID2IP_IP } wassp_subtlv_bssid2ip_block_type_t; static const TLV_PARSER_ENTRY tlvBssid2ipConfigTable[] = { { EID_BSSID2IP_UNUSED0, "BSSID2IP Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BSSID2IP_BSSID, "BSSID2IP BSSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_BSSID2IP_IP, "BSSID2IP IP Address", TLV_TYPE_IP_ADDR, 0, 0, 0, 0, 0, 0, 0, 0} }; #endif //EID_SITE_CONFIG_BLOCK: Site Config Block (V8.11: Rad@AP) typedef enum { EID_G_SITE_ENABLE = 4, EID_G_SITE_NAME, EID_G_RADIUS_CLIENT_AT_AP, EID_G_HYBRID_POLICY_MODE, EID_G_LOCATION, EID_G_INVALID_POLICY, EID_NAC_MBA_LOCAL_AUTH, EID_NAC_RULE_ARRAY, EID_NAC_RULE_BLOCK, EID_NAC_RULE_FLAGS, EID_NAC_RULE_AUTH_TYPE, EID_NAC_RULE_USER_USERNAME_GROUP_KEY, EID_NAC_RULE_USER_LDAPUSER_GROUP_KEY, EID_NAC_RULE_ENDSYS_HOSTNAME_GROUP_KEY, EID_NAC_RULE_ENDSYS_LDAPHOST_GROUP_KEY, EID_NAC_RULE_ENDSYS_IPv4_GROUP_KEY, EID_NAC_RULE_ENDSYS_MAC_GROUP_KEY, EID_NAC_RULE_DEV_TYPE_GROUP_KEY, EID_NAC_RULE_LOCATION_GROUP_KEY, EID_NAC_RULE_TIME_GROUP_KEY, EID_NAC_RULE_POLICY_KEY, EID_NAC_LDAP_USER_GROUP_ARRAY, EID_NAC_LDAP_USER_GROUP_BLOCK, EID_NAC_LDAP_USER_GROUP_KEY, EID_NAC_LDAP_USER_GROUP_MATCH_MODE, EID_NAC_LDAP_USER_ATTR_ARRAY, EID_NAC_LDAP_USER_ATTR_BLOCK, EID_NAC_LDAP_USER_ATTR_KEY, EID_NAC_LDAP_USER_ATTR_VAL, EID_NAC_USERNAME_GROUP_ARRAY, EID_NAC_USERNAME_GROUP_BLOCK, EID_NAC_USERNAME_GROUP_KEY, EID_NAC_USERNAME_ARRAY, EID_NAC_USERNAME, EID_NAC_HOSTNAME_GROUP_ARRAY, EID_NAC_HOSTNAME_GROUP_BLOCK, EID_NAC_HOSTNAME_GROUP_KEY, EID_NAC_HOSTNAME_ARRAY, EID_NAC_HOSTNAME, EID_NAC_HOST_IPv4_GROUP_ARRAY, EID_NAC_HOST_IPv4_GROUP_BLOCK, EID_NAC_HOST_IPv4_GROUP_KEY, EID_NAC_HOST_IPv4_ARRAY, EID_NAC_HOST_IPv4_ADDRESS, EID_NAC_LDAP_HOST_GROUP_ARRAY, EID_NAC_LDAP_HOST_GROUP_BLOCK, EID_NAC_LDAP_HOST_GROUP_KEY, EID_NAC_LDAP_HOST_GROUP_MATCH_MODE, EID_NAC_LDAP_HOST_ATTR_ARRAY, EID_NAC_LDAP_HOST_ATTR_BLOCK, EID_NAC_LDAP_HOST_ATTR_KEY, EID_NAC_LDAP_HOST_ATTR_VAL, EID_NAC_HOST_MAC_GROUP_ARRAY, EID_NAC_HOST_MAC_GROUP_BLOCK, EID_NAC_HOST_MAC_GROUP_KEY, EID_NAC_HOST_MAC_ARRAY, EID_NAC_HOST_MAC, EID_NAC_DEV_TYPE_GROUP_ARRAY, EID_NAC_DEV_TYPE_GROUP_BLOCK, EID_NAC_DEV_TYPE_GROUP_KEY, EID_NAC_DEV_TYPE_ARRAY, EID_NAC_DEV_TYPE_ATTRIBUTE, EID_NAC_TIME_GROUP_ARRAY, EID_NAC_TIME_GROUP_BLOCK, EID_NAC_TIME_RANGE_GROUP_KEY, EID_NAC_TIME_RANGE_ARRAY, EID_NAC_TIME_RANGE, EID_NAC_LOC_GROUP_ARRAY, EID_NAC_LOC_GROUP_BLOCK, EID_NAC_LOC_GROUP_KEY, EID_NAC_LOC_ATTR_ARRAY, EID_SITE_RATE_CONTROL_BLOCK, EID_NAC_LOC_ATTR_BLOCK, EID_NAC_LOC_SSID, EID_NAC_LOC_APID, EID_NAC_LDAP_SRV_ARRAY, EID_SITE_TOPOLOGY_BLOCK, EID_NAC_LDAP_SRV_BLOCK, EID_NAC_LDAP_SRV_KEY, EID_NAC_LDAP_SRV_URL, EID_NAC_LDAP_SRV_TIMEOUT, EID_NAC_LDAP_USER_SRCH_ROOT, EID_NAC_LDAP_HOST_SRCH_ROOT, EID_NAC_LDAP_OU_SRCH_ROOT, EID_NAC_LDAP_USER_OBJ_CLASS, EID_NAC_LDAP_USER_SRCH_ATTR, EID_NAC_LDAP_HOST_OBJ_CLASS, EID_NAC_LDAP_HOST_SRCH_ATTR, EID_NAC_LDAP_FLAGS, EID_NAC_LDAP_USER_AUTH_TYPE, EID_NAC_LDAP_OU_OBJ_CLASS_ARRAY, EID_NAC_LDAP_OU_OBJ_CLASS, EID_NAC_KRB_REALM_ARRAY, EID_NAC_KRB_REALM_BLOCK, EID_SITE_POLICY_BLOCK, EID_SITE_FILTER_CONFIG_BLOCK, EID_SITE_COS_CONFIG_BLOCK, EID_SITE_LOCATION_BASED_LOOKUP_BLOCK, EID_SITE_RADIUS_SERVER_BLOCK, EID_NAC_KRB_KDCS, EID_NAC_LDAP_SERVER_INDEX, EID_NAC_SERVER_CONFIG_ARRAY, EID_NAC_SERVER_CONFIG_BLOCK, EID_NAC_SERVER_FQDN, EID_NAC_SERVER_IPV4_ADDR, EID_NAC_SERVER_DOMAIN, EID_NAC_SERVER_ADMIN_ID, EID_NAC_SERVER_ADMIN_PWD, EID_NAC_SERVER_WORKGROUP, EID_NAC_RULE_ENDSYS_WEB_AUTH_USER_GROUP_KEY, EID_NAC_WEB_AUTH_USER_GROUP_ARRAY, EID_NAC_WEB_AUTH_USER_GROUP_BLOCK, EID_NAC_WEB_AUTH_USER_GROUP_KEY, EID_NAC_WEB_AUTH_USER_ARRAY, EID_G_SITE_MAX } wassp_subtlv_site_config_type_t; static const TLV_PARSER_ENTRY tlvSiteConfigTable[] = { { EID_G_SITE_ENABLE, "Enable Site", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_SITE_NAME, "Site Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_RADIUS_CLIENT_AT_AP, "Enables Radius Client At AP", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_HYBRID_POLICY_MODE, "Hybrid Policy Mode", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_LOCATION, "Location", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_INVALID_POLICY, "Invalid Policy Action", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_MBA_LOCAL_AUTH, "NAC MBA Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ARRAY, "Array of NAC Rule Structures", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_BLOCK, "NAC Rule Configuration Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_FLAGS, "Negate Flags For Different Groups", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_AUTH_TYPE, "Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_USER_USERNAME_GROUP_KEY, "Key Identifier of User Name Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_USER_LDAPUSER_GROUP_KEY, "Key identifier of LDAP User Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ENDSYS_HOSTNAME_GROUP_KEY, "Key Identifier of End System Host Name Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ENDSYS_LDAPHOST_GROUP_KEY, "Key Identifier of End System LDAP Host Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ENDSYS_IPv4_GROUP_KEY, "Key Identifier of End System IPv4 Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ENDSYS_MAC_GROUP_KEY, "Key Identifier of End System Mac Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_DEV_TYPE_GROUP_KEY, "Key Identifier of Device", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_LOCATION_GROUP_KEY, "Key Identifier of Location Group", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_TIME_GROUP_KEY, "Key Identifier of Time Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_POLICY_KEY, "Policy ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_GROUP_ARRAY, "NAC LDAP User Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_GROUP_BLOCK, "NAC LDAP User Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_GROUP_KEY, "Key Identifier of Specific LDAP User Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_GROUP_MATCH_MODE, "Match Mode of LDAP User Group", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_ATTR_ARRAY, "NAC LDAP User Attribute Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_ATTR_BLOCK, "NAC LDAP User Attribute Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_ATTR_KEY, "LDAP User Attribute Key", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_ATTR_VAL, "LDAP User Attribute Value", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_USERNAME_GROUP_ARRAY, "NAC Username Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_USERNAME_GROUP_BLOCK, "NAC Username Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_USERNAME_GROUP_KEY, "Key Identifier of Specific Username Group", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_USERNAME_ARRAY, "NAC Username Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_USERNAME, "NAC Username", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOSTNAME_GROUP_ARRAY, "NAC Host Name Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOSTNAME_GROUP_BLOCK, "NAC Host Name Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOSTNAME_GROUP_KEY, "NAC Host Name Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOSTNAME_ARRAY, "NAC Host Name Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOSTNAME, "NAC Host Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_IPv4_GROUP_ARRAY, "Array of Host By IPv4 Groups", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_IPv4_GROUP_BLOCK, "NAC Host IPv4 Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_IPv4_GROUP_KEY, "NAC Host IPv4 Group key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_IPv4_ARRAY, "NAC Host IPv4 Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_IPv4_ADDRESS, "NAC Host IPv4 Address", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_GROUP_ARRAY, "NAC LDAP Host Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_GROUP_BLOCK, "NAC LDAP Host Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_GROUP_KEY, "NAC LDAP Host Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_GROUP_MATCH_MODE, "Match Mode of Specific LDAP Host Group", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_ATTR_ARRAY, "NAC LDAP Host Attribute Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_ATTR_BLOCK, "NAC LDAP Host Attribute Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_ATTR_KEY, "NAC LDAP Host Attribute Key", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_ATTR_VAL, "NAC LDAP Host Attribute value", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_MAC_GROUP_ARRAY, "NAC Host Mac Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_MAC_GROUP_BLOCK, "NAC Host Mac Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_MAC_GROUP_KEY, "NAC Host Mac Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_MAC_ARRAY, "NAC Host Mac Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_HOST_MAC, "NAC Host Mac", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_DEV_TYPE_GROUP_ARRAY, "NAC Device Type Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_DEV_TYPE_GROUP_BLOCK, "NAC Device Type Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_DEV_TYPE_GROUP_KEY, "NAC Device Type Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_DEV_TYPE_ARRAY, "NAC Device Type Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_DEV_TYPE_ATTRIBUTE, "NAC Device Type Attribute", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_TIME_GROUP_ARRAY, "NAC Time Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_TIME_GROUP_BLOCK, "NAC Time Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_TIME_RANGE_GROUP_KEY, "NAC Time Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_TIME_RANGE_ARRAY, "NAC Time Range Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_TIME_RANGE, "NAC Time Range", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_GROUP_ARRAY, "NAC Location Group Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_GROUP_BLOCK, "NAC Location Group Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_GROUP_KEY, "NAC Location Group Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_ATTR_ARRAY, "NAC Location Attribute Array", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_RATE_CONTROL_BLOCK, "Site Rate Control Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_ATTR_BLOCK, "NAC Location Attribute Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_SSID, "NAC Location SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LOC_APID, "NAC Location AP ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SRV_ARRAY, "NAC Array of LDAP Servers", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_TOPOLOGY_BLOCK, "Site Topology Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SRV_BLOCK, "NAC LDAP Server Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SRV_KEY, "NAC LDAP Server Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SRV_URL, "NAC LDAP Server Url", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SRV_TIMEOUT, "Timeout for Response From LDAP Server", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_SRCH_ROOT, "LDAP Server User Search Root", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_SRCH_ROOT, "LDAP Server Hostname Search Root", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_OU_SRCH_ROOT, "LDAP Server OU Search Root", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_OBJ_CLASS, "LDAP Server User Object Class", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_SRCH_ATTR, "LDAP Server User Search Attribute", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_OBJ_CLASS, "LDAP Server Host object Class", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_HOST_SRCH_ATTR, "LDAP Server Host Search Attribute", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_FLAGS, "LDAP Server Flag", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_USER_AUTH_TYPE, "User Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_OU_OBJ_CLASS_ARRAY, "Array of NAC LDAP Organizational Units (OU) Object Classes", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_OU_OBJ_CLASS, "NAC LDAP Organizational Units (OU) Object Class", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_KRB_REALM_ARRAY, "Array of NAC Kerberos Realms", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_KRB_REALM_BLOCK, "NAC Kerberos Realm Block", TLV_TYPE_BLOCK_TLV, TAB_CONFIG_SITE, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_POLICY_BLOCK, "Policy Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_FILTER_CONFIG_BLOCK, "Filter Configuration Block",TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_COS_CONFIG_BLOCK, "COS Configuration Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_LOCATION_BASED_LOOKUP_BLOCK, "Location Based Lookup Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_SITE_RADIUS_SERVER_BLOCK, "Radius Server Block", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_KRB_KDCS, "List of Kerberos KDC FQDN", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_LDAP_SERVER_INDEX, "LDAP Server for MU Authorization", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_CONFIG_ARRAY, "Array of NAC Authentication Server Configurations", TLV_TYPE_BLOCK_TLV, TAB_NAC_SERVER_CONFIG_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_CONFIG_BLOCK, "NAC Authentication Server Block", TLV_TYPE_BLOCK_TLV, TAB_NAC_SERVER_CONFIG_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_FQDN, "Authentication Server FQDN", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_IPV4_ADDR, "Authentication Server IPv4 address", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_DOMAIN, "Authentication Server Domain", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_ADMIN_ID, "NAC Authentication Server Admin ID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_ADMIN_PWD, "NAC Authentication Server Admin Password", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_SERVER_WORKGROUP, "NAC Authentication Server Workgroup", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_RULE_ENDSYS_WEB_AUTH_USER_GROUP_KEY, "NAC Rule End System WEB Authentication User Group Key", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_WEB_AUTH_USER_GROUP_ARRAY, "NAC WEB Authentication User Group Array", TLV_TYPE_BLOCK_TLV, TAB_NAC_WEB_AUTH_USER_GROUP_ARRAY, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_WEB_AUTH_USER_GROUP_BLOCK, "NAC WEB Authentication User Group Block", TLV_TYPE_BLOCK_TLV, TAB_NAC_WEB_AUTH_USER_GROUP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_WEB_AUTH_USER_GROUP_KEY, "NAC WEB Authentication User Group key", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_NAC_WEB_AUTH_USER_ARRAY, "NAC WEB Authentication User", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_G_SITE_MAX, "G_SITE_MAX",0, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_POLICY_BLOCK: Policy Table typedef enum { EID_POLICY_UNUSED0, EID_POLICY_ENTRY_NAME, EID_POLICY_ENTRY_KEY, EID_POLICY_TOPOLOGY_KEY, EID_POLICY_TOPOLOGY_VLAN_ID, EID_POLICY_TOPOLOGY_TYPE, EID_POLICY_FILTER_KEY, EID_POLICY_COS_KEY, EID_POLICY_IGNORE_COS, EID_POLICY_DYNAMIC_EGRESS_VLANS, EID_POLICY_STATIC_EGRESS_VLANS, EID_POLICY_DEFAULT_ACTION, EID_POLICY_FLAGS, EID_POLICY_DEFAULT_MIRRORN, EID_POLICY_RB_REDIRECT_URL // update below tlvPolicyConfigTable } wassp_subtlv_policy_config_type_t; static const TLV_PARSER_ENTRY tlvPolicyConfigTable[] = { { EID_POLICY_UNUSED0, "Policy Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_ENTRY_NAME, "Policy Entry name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_ENTRY_KEY, "Policy Entry Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_TOPOLOGY_KEY, "Policy Topology Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_TOPOLOGY_VLAN_ID, "Topology Vlan ID", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_TOPOLOGY_TYPE, "Policy Topology Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_FILTER_KEY, "Policy Filter Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_COS_KEY, "Policy COS Key", TLV_TYPE_INT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_IGNORE_COS, "Policy Ignore COS", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_DYNAMIC_EGRESS_VLANS, "list of Dynamic Egress VLAN IDs", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_STATIC_EGRESS_VLANS, "list of static egress VLAN IDs", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_DEFAULT_ACTION, "Default Action for Policy", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_FLAGS, "Policy Flags", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_DEFAULT_MIRRORN, "Set Default MirrorN", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_POLICY_RB_REDIRECT_URL, "Policy Redirect Url", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_COS_CONFIG_BLOCK typedef enum { EID_COS_UNUSED0, EID_COS_KEY, EID_COS_DEFINITION, EID_COS_IN_RATE_LIMIT, EID_COS_OUT_RATE_LIMIT } wassp_subtlv_cos_config_type_t; static const TLV_PARSER_ENTRY tlvCosConfigTable[] = { { EID_COS_UNUSED0, "COS Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COS_KEY, "COS Key", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COS_DEFINITION, "Binary Encoded COS Definition", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COS_IN_RATE_LIMIT, "Input Rate Limit in Kbps", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_COS_OUT_RATE_LIMIT, "Output Rate Limit in Kbps", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_11U_ANQP_BLOCK typedef enum { EID_11U_UNUSED0, EID_11U_3GPP_CELL_NETWORK_ARRAY, EID_11U_3GPP_CELL_NETWORK_STRUCT, EID_11U_3GPP_CELL_NETWORK_MCC, EID_11U_3GPP_CELL_NETWORK_MNC, EID_11U_ACCESS_NETWORK_TYPE, EID_11U_ASRA, EID_11U_DOMAIN_NAME, EID_11U_EAP_AUTH_PARAM, EID_11U_EAP_AUTH_PARAM_ARRAY, EID_11U_EAP_AUTH_PARAM_STRUCT, EID_11U_EAP_AUTH_TYPE, EID_11U_EAP_METHOD, EID_11U_EAP_METHODS_ARRAY, EID_11U_EAP_METHODS_STRUCT, EID_11U_HESSID, EID_11U_INTERNET_AVAILABLE, EID_11U_IPV4_ADDR_TYPE_AVAIL, EID_11U_IPV6_ADDR_TYPE_AVAIL, EID_11U_NAI_REALM, EID_11U_NAI_REALM_ARRAY, EID_11U_NAI_REALM_STRUCT, EID_11U_NETWORK_AUTH_TYPE, EID_11U_ROAMING_CONSORTIUM, EID_11U_ROAMING_CONSORTIUM_ARRAY, EID_11U_VENUE_INFO_GROUP_CODE, EID_11U_VENUE_INFO_TYPE_ASSIGNMENTS, EID_11U_VENUE_NAME_ARRAY, EID_11U_VENUE_NAME, EID_11U_NETWORK_AUTH_TYPE_URL } wassp_subtlv_11u_anqp_config_type_t; static const TLV_PARSER_ENTRY tlv11U_ANQP_blockTable[] = { //Members of EID_11U_ANQP_BLOCK block { EID_11U_UNUSED0, "11U Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_3GPP_CELL_NETWORK_ARRAY, "11U 3GPP Cell Network Array", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_3GPP_CELL_NETWORK_STRUCT, "11U 3GPP Cell Network Struct", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_3GPP_CELL_NETWORK_MCC, "11U 3GPP Cell Network MCC", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_3GPP_CELL_NETWORK_MNC, "11U 3GPP Cell Network MNC", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_ACCESS_NETWORK_TYPE, "11U Access network Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_ASRA, "11U ASRA", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_DOMAIN_NAME, "11U Domain Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_AUTH_PARAM, "11U EAP Authentication Parameter", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_AUTH_PARAM_ARRAY, "11U EAP Authentication Parameter Array", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_AUTH_PARAM_STRUCT, "11U EAP Authentication Parameter Struct", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_AUTH_TYPE, "11U EAP Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_METHOD, "11U EAP Authentication Method", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_METHODS_ARRAY, "11U EAP Authentication Methods Array", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_EAP_METHODS_STRUCT, "11U EAP Authentication Method Struct", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_HESSID, "11U HESSID", TLV_TYPE_MACADD, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_INTERNET_AVAILABLE, "11U Internet Available", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_IPV4_ADDR_TYPE_AVAIL, "11U IPv4 Address Type Availability", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_IPV6_ADDR_TYPE_AVAIL, "11U IPv6 Address Type Availability", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_NAI_REALM, "11U NAI Realm", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_NAI_REALM_ARRAY, "11U NAI Realm Array", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_NAI_REALM_STRUCT, "11U NAI Realm Struct", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_NETWORK_AUTH_TYPE, "11U Network Authentication Type", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_ROAMING_CONSORTIUM, "11U Roaming Consortium", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_ROAMING_CONSORTIUM_ARRAY, "11U Roaming Consortium Array", TLV_TYPE_BLOCK_TLV, TAB_11U_ANQP_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_VENUE_INFO_GROUP_CODE, "11U Venue Info Group Code", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_VENUE_INFO_TYPE_ASSIGNMENTS, "11U Venue Info Type Assignments", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_VENUE_NAME_ARRAY, "1U Venue Name Array", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_VENUE_NAME, "1U Venue Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_11U_NETWORK_AUTH_TYPE_URL, "11U Network Authentication Type Url", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0} }; // AppVisibility Enforce config block EID_EXTAPP_CONF_BLOCK typedef enum { EID_EXTAPP_UNUSED0, EID_EXTAPP_DISP_NAME, EID_EXTAPP_DISP_ID, EID_EXTAPP_MATCH_STR, EID_EXTAPP_APP_ID, EID_EXTAPP_GROUP_ID } wassp_subtlv_extapp_conf_block_type_t; static const TLV_PARSER_ENTRY tlvExtapp_conf_blockTable[] = { { EID_EXTAPP_UNUSED0, "EXTAPP Unused 0", TLV_TYPE_UNKNOWN, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_DISP_NAME, "EXTAPP Display Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_DISP_ID, "EXTAPP Display ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_MATCH_STR, "EXTAPP Match String", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_APP_ID, "EXTAPP Application ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_EXTAPP_GROUP_ID, "EXTAPP Application Group ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; //Members of EID_HS2_BLOCK block typedef enum { EID_HS2_UNUSED0, EID_HS2_ANQP_DOMAIN_ID, EID_HS2_CONNECTION_CAP, EID_HS2_CONNECTION_CAP_ARRAY, EID_HS2_DGAF, EID_HS2_ICON_NAME, EID_HS2_OPERATING_CLASS, EID_HS2_OP_FRIENDLY_NAME_ARRAY, EID_HS2_OP_FRIENDLY_NAME, EID_HS2_OSU_STRUCT, EID_HS2_OSU_SP_ARRAY, EID_HS2_OSU_SP_STRUCT, EID_HS2_OSU_SP_DESC_ARRAY, EID_HS2_OSU_SP_DESC, EID_HS2_OSU_SP_FRIENDLY_NAME_ARRAY, EID_HS2_OSU_SP_FRIENDLY_NAME, EID_HS2_OSU_SP_ICON_ARRAY, EID_HS2_OSU_SP_ICON_STRUCT, EID_HS2_OSU_SP_METHOD_LIST, EID_HS2_OSU_SP_NAI, EID_HS2_OSU_SP_SERVER_URI, EID_HS2_OSU_SSID, EID_HS2_RELEASE, EID_HS2_WAN_METRICS_STRUCT, EID_HS2_UPLINK_LOAD, EID_HS2_UPLINK_SPEED, EID_HS2_WIDTH, EID_HS2_DOWLINK_LOAD, EID_HS2_DOWLINK_SPEED, EID_HS2_HIGHT } wassp_subtlv_hs2_block_type_t; static const TLV_PARSER_ENTRY tlvHS2_blockTable[] = { { EID_HS2_UNUSED0, "HS2 Unused 0", TLV_TYPE_UNKNOWN, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_ANQP_DOMAIN_ID, "HS2 ANQP Domain ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_CONNECTION_CAP, "HS2 Connection Capacity", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_CONNECTION_CAP_ARRAY, "HS2 Connection Capacity Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_DGAF, "Enable HS2 DGAF", TLV_TYPE_BOOL, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_ICON_NAME, "HS2 Icon Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OPERATING_CLASS, "HS2 Operating Class", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OP_FRIENDLY_NAME_ARRAY, "HS2 Operation Friendly Name Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OP_FRIENDLY_NAME, "HS2 Operation Friendly Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_STRUCT, "HS2 OSU Struct", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_ARRAY, "HS2 OSU SP Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_STRUCT, "HS2 OSU SP Struct", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_DESC_ARRAY, "HS2 OSU SP Description Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_DESC, "HS2 OSU SP Description", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_FRIENDLY_NAME_ARRAY, "HS2 OSU SP Friendly Name Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_FRIENDLY_NAME, "HS2 OSU SP Friendly Name", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_ICON_ARRAY, "HS2 OSU SP Icon Array", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_ICON_STRUCT, "HS2 OSU SP Icon Struct", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_METHOD_LIST, "HS2 OSU SP Method List", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_NAI, "HS2 OSU SP NAI", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SP_SERVER_URI, "HS2 OSU SP Server Uri", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_OSU_SSID, "HS2 OSU SSID", TLV_TYPE_STRING, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_RELEASE, "HS2 Release", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_WAN_METRICS_STRUCT, "HS2 WAN method Struct", TLV_TYPE_BLOCK_TLV, TAB_HS2_BLOCK, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_UPLINK_LOAD, "HS2 Uplink Load", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_UPLINK_SPEED, "HS2 Uplink Speed", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_WIDTH, "HS2 Width", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_DOWLINK_LOAD, "HS2 Downlink Load", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_DOWLINK_SPEED, "HS2 Downlink Speed", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_HS2_HIGHT, "HS2 Height", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_LOCATION_BASED_LOOKUP_BLOCK typedef enum { EID_LOC_UNUSED0, EID_LOC_VLAN_ID_KEY, // 1 EID_LOC_POLICY_TOPOLOGY_KEY // 2 } wassp_subtlv_locationbased_lookup_type_t; static const TLV_PARSER_ENTRY tlvLocationBaseLookUpTable[] = { { EID_LOC_UNUSED0, "Location Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOC_VLAN_ID_KEY, "Location Vlan ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_LOC_POLICY_TOPOLOGY_KEY, "Location Topology ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0} }; //EID_APP_POLICY_FIXED_BLOCK typedef enum { EID_APP_POLICY_UNUSED0, EID_APP_POLICY_ENTRY_BLOCK // 1 } wassp_subtlv_app_policy_fixed_type_t; static const TLV_PARSER_ENTRY tlvAppPolicyFixedTable[] = { { EID_APP_POLICY_UNUSED0, "Application Policy Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_ENTRY_BLOCK, "Application Policy Entry Block", TLV_TYPE_BLOCK_TLV, TAB_APP_POLICY_ENTRY_BLOCK, 0, 0, 0, 0, 0, 0, 0} }; // EID_APP_POLICY_ENTRY_BLOCK typedef enum { EID_APP_POLICY_ENTRY_UNUSED0, EID_APP_POLICY_APP_ID, // 1 EID_APP_POLICY_OFFSET_LW, // 2 EID_APP_POLICY_MASK, // 3 EID_APP_POLICY_VALUE // 4 } wassp_subtlv_app_policy_entry_type_t; static const TLV_PARSER_ENTRY tlvAppPolicyEntryTable[] = { { EID_APP_POLICY_ENTRY_UNUSED0, "Application Policy Entry Unused 0", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_APP_ID, "Application Policy ID", TLV_TYPE_UINT, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_OFFSET_LW, "Application Policy Offset", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_MASK, "Application Policy Masks", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0}, { EID_APP_POLICY_VALUE, "Application Policy Values", TLV_TYPE_OCTETS, 0, 0, 0, 0, 0, 0, 0, 0} }; typedef struct { char subtree_name[WASSP_MAX_SUBTREE_LEN]; int* ett_num; int max_entry; const TLV_PARSER_ENTRY *entry; } WASSP_SUBTLV_DECODER_INFO_t; /* EID_ACTION -- upgrade command */ #define UPGRADE_ACTION_REPORT (0) /* report current status */ #define UPGRADE_ACTION_NO_CHANGE (1) /* no upgrade is required */ #define UPGRADE_ACTION_LEGACY (2) /* legacy upgrade, stop service and upgrade*/ #define UPGRADE_ACTION_BACKGROUND (3) /* background download, keep serivece then upgrade */ #define UPGRADE_ACTION_SAVE_BACKUP (4) /* download image, overwrite backup image*/ #define UPGRADE_ACTION_SWITCH_VERSION (5) /* switch to a previously downloaded image */ #define UPGRADE_ACTION_ABORT (6) /* abort current download operation */ #define UPGRADE_ACTION_STOP_SERVICE (7) /* put AP on hold, stopping service */ #define UPGRADE_ACTION_HOLD (8) /* put AP on hold, continue providing service !!!*/ #define UPGRADE_ACTION_REBOOT (9) /* reboot AP */ /* EID_STATUS -- version report */ #define UPGRADE_STATUS_NONE (0) /* not used */ #define UPGRADE_STATUS_SUCCESS (1) /* command is successful */ #define UPGRADE_STATUS_FAIL (2) /* command has failed */ #define UPGRADE_STATUS_INPROGRESS (100) /* download and writing to flash */ #define UPGRADE_STATUS_DOWNLOAD_FAIL (101) /* download and writing to flash */ #define UPGRADE_STATUS_WRITE_FAIL (102) /* writing to flash failed */ #define UPGRADE_STATUS_CORRUPTED_FILE (103) /*corrupted/unusable image */ #define UPGRADE_STATUS_REBOOTING (104) /*AP is rebooting*/ #define UPGRADE_STATUS_INVALID_FILE (105) /*invalid image file (checksum, type etc..)*/ #define UPGRADE_STATUS_VERSION_MISMATCH (106) /* requested version is not found*/ /* Wassp EID Status Type */ typedef enum { EID_STATUS_UNDEFINED = 0, EID_STATUS_SUCCESS, EID_STATUS_FAILURE, EID_STATUS_INPROGRESS, EID_STATUS_DOWNLOAD_FAIL, EID_STATUS_WRITE_FAIL, EID_STATUS_CORRUPTED_FILE, EID_STATUS_REBOOTING, EID_STATUS_INVALID_FILE, EID_STATUS_VERSION_MISMATCH } wassp_eid_status_t; /* Wassp EID action Type */ typedef enum { EID_ACTION_REPORT = 0, EID_ACTION_NOCHANGE, EID_ACTION_LEGACY, EID_ACTION_BACKGROUND, EID_ACTION_SAVE_BACKUP, EID_ACTION_SWITCH_VERSION, EID_ACTION_ABORT, EID_ACTION_STOP_SERVICE, EID_ACTION_HOLD, EID_ACTION_REBOOT } wassp_eid_action_t; static const value_string wassp_eid_status_types[] = { { UPGRADE_STATUS_NONE, "Unused" }, { UPGRADE_STATUS_SUCCESS, "success" }, { UPGRADE_STATUS_FAIL, "failure" }, { UPGRADE_STATUS_INPROGRESS, "download in progress" }, { UPGRADE_STATUS_DOWNLOAD_FAIL, "image download failed" }, { UPGRADE_STATUS_WRITE_FAIL, "writing image to flash failed" }, { UPGRADE_STATUS_CORRUPTED_FILE, "main image file is corrupted/unusable" }, { UPGRADE_STATUS_REBOOTING, "AP is rebooting" }, { UPGRADE_STATUS_INVALID_FILE, "bad header in downloaded image" }, { UPGRADE_STATUS_VERSION_MISMATCH, "image version requested does not exist" }, { 0, NULL } }; /* Value string object enumerates wassp action type field */ static const value_string wassp_eid_action_types[] = { { UPGRADE_ACTION_REPORT, "request status report" }, { UPGRADE_ACTION_NO_CHANGE, "no change required" }, { UPGRADE_ACTION_LEGACY, "legacy AP upgrade -no service" }, { UPGRADE_ACTION_BACKGROUND, "upgrade AP while providing service" }, { UPGRADE_ACTION_SAVE_BACKUP, "download and save to backup image" }, { UPGRADE_ACTION_SWITCH_VERSION, "switch to a given version" }, { UPGRADE_ACTION_ABORT, "abort current download" }, { UPGRADE_ACTION_STOP_SERVICE, "put AP on hold,stop wireless service" }, { UPGRADE_ACTION_HOLD, "put AP on hold,keep wireless service" }, { UPGRADE_ACTION_REBOOT, "reboot AP" }, { 0, NULL } }; static const value_string mu_resv0_strings[] = { { 0x0000, "UnUsed" }, { 0x4000, "Netflow" }, { 0x8000, "Mirrorn & Netflow" }, { 0xc000, "Mirrorn" }, { 0, NULL } }; static const value_string mu_action_field_strings[] = { { 0x0000, "SSID" }, { 0x2000, "Redirect With Vlan ID" }, { 0x3000, "Vlan ID" }, { 0, NULL } }; static const value_string threat_state_strings[] = { { 0x0, "NA" }, { 0x1, "Active" }, { 0x2, "Inactive" }, { 0, NULL } }; static const value_string radio_params_strings[] = { { 0x0, "NONE" }, { 0x1, "WMM" }, { 0x2, "80211E" }, { 0x3, "WMM & 80211E" }, { 0x4, "NA" }, { 0, NULL } }; /* True False string object masks RU state boolean labels */ static const true_false_string wassp_eid_rustate_types = { "Standby", "Active", }; #define WASSP_SUBTLV_GET_SUBTREE(in_ptr) ((in_ptr)->subtree_name) #define WASSP_SUBTLV_GET_ETTNUM(in_ptr) ((in_ptr)->ett_num) #define WASSP_SUBTLV_GET_MAXENTRY(in_ptr) ((in_ptr)->max_entry) #define WASSP_SUBTLV_GET_ENTRY(in_ptr) ((in_ptr)->entry) #define WASSP_SUBTLV_GET_ENTRY_IDX(in_ptr, idx) ((in_ptr)->entry[(idx)]) #define WASSP_SUBTLV_GET_ENTRY_IDX_TYPE(in_ptr, idx) (((in_ptr)->entry[(idx)]).type) #define WASSP_SUBTLV_GET_ENTRY_IDX_NAME(in_ptr, idx) (((in_ptr)->entry[(idx)]).name) #define WASSP_SUBTLV_GET_ENTRY_IDX_TABIDX(in_ptr, idx) (((in_ptr)->entry[(idx)]).length) /* Wassp protocol registered fields or ru discover fields*/ static int proto_wassp = -1; static int hf_wassp_version = -1; static int hf_wassp_type = -1; static int hf_ru_rad_num = -1; static int hf_ru_checksum = -1; static int hf_ru_ac_op = -1; static int hf_ru_mac = -1; static int hf_ru_ac_mode = -1; static int hf_wassp_seq_num_flag = -1; static int hf_seq_num = -1; static int hf_wassp_use_frag = -1; static int hf_wassp_data_frag = -1; static int hf_wassp_more_frag = -1; static int hf_wassp_first_frag = -1; static int hf_wassp_sessionid = -1; static int hf_wassp_length = -1; static int hf_wassp_header = -1; static int hf_ru_discover_header =-1; /* ----------- MU data --------------*/ static int hf_wassp_mu_type = -1; static int hf_wassp_mu_qos = -1; static int hf_wassp_mu_action_ssid = -1; static int hf_wassp_mu_mac = -1; static int hf_wassp_mu_data_tree = -1; static int hf_wassp_mu_resv0 = -1; static int hf_wassp_mu_resv1 = -1; static int hf_wassp_mu_assoc_status = -1; static int hf_wassp_mu_data_header =-1; static int hf_wassp_mu_action =-1; static int hf_wassp_mu_action_field_value =-1; // netflow static int hf_wassp_mu_netflow_version = -1; static int hf_wassp_mu_netflow_length = -1; static int hf_wassp_mu_netflow_flags = -1; static int hf_wassp_mu_netflow_uptime = -1; static int hf_wassp_mu_netflow_record = -1; static int hf_wassp_mu_netflow_in_bytes = -1; static int hf_wassp_mu_netflow_in_packets = -1; static int hf_wassp_mu_netflow_ip_protocol_number = -1; static int hf_wassp_mu_netflow_source_tos = -1; static int hf_wassp_mu_netflow_source_port = -1; static int hf_wassp_mu_netflow_source_ip = -1; static int hf_wassp_mu_netflow_input_snmp = -1; static int hf_wassp_mu_netflow_dest_port = -1; static int hf_wassp_mu_netflow_dest_ip = -1; static int hf_wassp_mu_netflow_output_snmp = -1; static int hf_wassp_mu_netflow_last_time = -1; static int hf_wassp_mu_netflow_first_time = -1; static int hf_wassp_mu_netflow_in_source_mac = -1; static int hf_wassp_mu_netflow_in_dest_mac = -1; static int hf_wassp_mu_netflow_tree = -1; static int hf_wassp_mu_netflow_header = -1; /* ------ wassp TLV -------*/ static int hf_wassp_tlv_value = -1; static int hf_wassp_tlv_type_main = -1; static int hf_wassp_tlv_type_sub = -1; static int hf_wassp_tlv_length = -1; static int hf_wassp_tlv_value_octext = -1; // PW_TYPE_OCTETS static int hf_wassp_tlv_value_string = -1; static int hf_wassp_tlv_value_ip = -1; static int hf_wassp_tlv_value_int = -1; static int hf_wassp_tlv_eid_status = -1; static int hf_wassp_tlv_eid_action = -1; static int hf_wassp_tlv_eid_rustate = -1; static int hf_wassp_tlv_unknown = -1; static int hf_wassp_tlv_invalid = -1; static int hf_wassp_ipaddress = -1; static int hf_wassp_sub_tree = -1; static int hf_wassp_topologykey = -1; static int hf_wassp_vlanid = -1; static int hf_wassp_topology_mode = -1; static int hf_wassp_in_cir = -1; static int hf_wassp_out_cir = -1; static int hf_wassp_flag_1b = -1; static int hf_wassp_tos = -1; static int hf_cos_tos = -1; static int hf_cos_tos_mask = -1; static int hf_cos_priority_txq = -1; static int hf_wassp_tos_mask = -1; static int hf_filter_tos_maskbit_priority = -1; static int hf_wassp_priority = -1; static int hf_cos_rateid = -1; static int hf_wassp_filter_rule = -1; static int hf_wassp_filter_flag = -1; static int hf_filter_rule_port_range = -1; static int hf_wassp_ipprotocol = -1; static int hf_wassp_netmasklength = -1; static int hf_wassp_macaddr = -1; static int hf_wassp_macaddr_mask = -1; static int hf_wassp_ethernet_type = -1; static int hf_wassp_reserve = -1; static int hf_wassp_freq = -1; static int hf_wassp_rss = -1; static int hf_wassp_rssi = -1; static int hf_wassp_threatstate = -1; static int hf_wassp_radioparams = -1; static int hf_wassp_channelfreq = -1; static int hf_wassp_mu = -1; static int hf_wassp_apprules = -1; static int hf_wassp_displayid = -1; static int hf_wassp_txbytes = -1; static int hf_wassp_rxbytes = -1; /* ************************************************************************* */ /* Header values for reassembly */ /* ************************************************************************* */ static int hf_wassp_fragments = -1; static int hf_wassp_fragment = -1; static int hf_wassp_fragment_overlap = -1; static int hf_wassp_fragment_overlap_conflict = -1; static int hf_wassp_fragment_multiple_tails = -1; static int hf_wassp_fragment_too_long_fragment = -1; static int hf_wassp_fragment_error = -1; static int hf_wassp_fragment_count = -1; static int hf_wassp_reassembled_in = -1; static int hf_wassp_reassembled_length = -1; static gint ett_wassp_fragment = -1; static gint ett_wassp_fragments = -1; static const fragment_items wassp_frag_items = { /* Fragment subtrees */ &ett_wassp_fragment, &ett_wassp_fragments, /* Fragment fields */ &hf_wassp_fragments, &hf_wassp_fragment, &hf_wassp_fragment_overlap, &hf_wassp_fragment_overlap_conflict, &hf_wassp_fragment_multiple_tails, &hf_wassp_fragment_too_long_fragment, &hf_wassp_fragment_error, &hf_wassp_fragment_count, &hf_wassp_reassembled_in, &hf_wassp_reassembled_length, NULL, "fragments" }; /* Wassp protocol registered subtrees */ static gint ett_wassp = -1; static gint ett_seq_flags = -1; static gint ett_wassp_header = -1; static gint ett_mu_data_header = -1; static gint ett_mu_action_field =-1; static gint ett_ru_discover_header = -1; static gint ett_wassp_tlv = -1; static gint ett_wassp_filter_rule = -1; static gint ett_lbs_header = -1; static gint ett_wassp_mu_appl_stats = -1; static gint ett_wassp_data = -1; static gint ett_wassp_mu_data_netflow = -1; static gint ett_wassp_mu_data_netflow_header = -1; static gint ett_wassp_tlv_missing = -1; static gint ett_wassp_ap_stats_block = -1; static gint ett_wassp_mu_rf_stats_block = -1; static gint ett_wassp_config_error_block = -1; static gint ett_wassp_config_modified_block = -1; static gint ett_wassp_global_config_block = -1; static gint ett_wassp_radio_config_block = -1; static gint ett_wassp_vns_config_block = -1; static gint ett_wassp_mu_stats_block = -1; static gint ett_wassp_radio_stats_block = -1; static gint ett_wassp_ether_stats_block = -1; static gint ett_wassp_wds_stats_block = -1; static gint ett_wassp_dot1x_stats_block = -1; static gint ett_wassp_filter_config_block = -1; static gint ett_wassp_site_filter_config_block = -1; static gint ett_wassp_filter_ext_config_block = -1; static gint ett_wassp_vns_stats_block = -1; static gint ett_wassp_radius_config_block = -1; static gint ett_wassp_eid_main_tlv_block = -1; static gint ett_wassp_radius_server_config_block = -1; static gint ett_wassp_site_config_block = -1; static gint ett_wassp_policy_config_block = -1; static gint ett_wassp_cos_config_block = -1; static gint ett_wassp_localbase_lookup_block = -1; static gint ett_wassp_app_policy_fixed_block = -1; static gint ett_wassp_app_policy_entry_block = -1; static gint ett_wassp_s_topo_m_filter_entry_block = -1; static gint ett_wassp_s_topo_m_filter_ext_entry_block = -1; static gint ett_wassp_11u_config_entry_block = -1; static gint ett_wassp_hs2_config_entry_block = -1; static gint ett_wassp_extapp_config_entry_block = -1; /* aeroscout */ static int hf_aeroscout_header = -1; static int hf_aeroscout_header_magic_number = -1; // 2 bytes static int hf_aeroscout_request_id = -1; // 2 bytes static int hf_aeroscout_code = -1; // 1 byte static int hf_aeroscout_sub_code = -1; // 1 byte static int hf_aeroscout_datalength = -1; // 2 bytes static int hf_lbs_vendor_id = -1; // 2 byte static int hf_lbs_rsvd1 = -1; // 2 bytes static int hf_lbs_ap_bssid = -1; // 6 bytes static int hf_lbs_rsvd2 = -1; // 1 static int hf_lbs_rxchan = -1; // 1 static int hf_lsb_tstamp = -1; // 4 bytes static int hf_hf_lsb_rsvd3 = -1; // 2 bytes static int hf_lsb_rssi = -1; // 1 static int hf_lsb_rsvd = -1; // 1 static int hf_lsb_noise_floor = -1; // 1 static int hf_lsb_rsvd4 = -1; // 3 bytes static int hf_lsb_chan_rate = -1; // 1 static int hf_lsb_rsvd5 = -1; // 1 static int hf_lsb_wh_addr2 = -1; // 6 bytes static int hf_lsb_wh_fc = -1; // 2 bytes static int hf_lsb_wh_seq = -1; // 2 bytes static int hf_lsb_rsvd6 = -1; // 2 bytes static int hf_lsb_wh_addr3 = -1; // 6 bytes static int hf_lsb_wh_addr4 = -1; // 6 bytes /* Dissector handles used in dissector registration */ static dissector_handle_t data_handle; static dissector_handle_t eth_handle; static dissector_handle_t ip_handle; static dissector_handle_t ieee80211_handle; static dissector_handle_t snmp_handle; static const WASSP_SUBTLV_DECODER_INFO_t wassp_decr_info[TAB_MAX] = { /*CONFIG_GLOBAL_BLOCK */ {"WASSP Global Config", &ett_wassp_global_config_block, sizeof(tlvGlobalConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvGlobalConfigTable}, /*CONFIG_ERROR_BLOCK */ {"WASSP Config Error", &ett_wassp_config_error_block, sizeof(tlvGlobalConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvGlobalConfigTable}, /*TAB_CONFIG_MODIFIED */ {"WASSP Config Modified", &ett_wassp_config_modified_block, sizeof(tlvGlobalConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvGlobalConfigTable}, /*RADIO_CONFIG_BLOCK */ {"WASSP Radio Configure", &ett_wassp_radio_config_block, sizeof(tlvRadioConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvRadioConfigTable}, /*VNS_CONFIG_BLOCK */ {"WASSP VNS Configure", &ett_wassp_vns_config_block, sizeof(tlvVnsConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvVnsConfigTable}, /*MU_RF_STATS_BLOCK */ {"WASSP MU RF Stats", &ett_wassp_mu_rf_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*AP_STATS_BLOCK */ {"WASSP RU RF Stats", &ett_wassp_ap_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*STATS_MU_BLOCK */ {"WASSP MU Stats", &ett_wassp_mu_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*TAB_STATS_RADIO */ {"WASSP Radio Stats", &ett_wassp_radio_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*TAB_STATS_ETH */ {"WASSP Ethernet Stats", &ett_wassp_ether_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*TAB_STATS_WDS */ {"WASSP Wds Stats", &ett_wassp_wds_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*TAB_STATS_DOT1x */ {"WASSP Dot1x Stats", &ett_wassp_dot1x_stats_block, sizeof(tlvBeastConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvBeastConfigTable}, /*TAB_CONFIG_FILTER */ {"WASSP Filter Config", &ett_wassp_filter_config_block, sizeof(tlvFilterConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvFilterConfigTable}, /*TAB_STATS_VNS */ {"WASSP VNS Status", &ett_wassp_vns_stats_block, sizeof(tlvVnsStatusTable) / sizeof(TLV_PARSER_ENTRY), tlvVnsStatusTable}, /*TAB_CONFIG_RADIUS_SERVER */ {"WASSP Radius Server Config", &ett_wassp_radius_server_config_block, sizeof(tlvRadiusServerConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvRadiusServerConfigTable}, /*TAB_CONFIG_SITE */ {"WASSP Site Config", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_CONFIG_POLICY */ {"WASSP Policy Config", &ett_wassp_policy_config_block, sizeof(tlvPolicyConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvPolicyConfigTable}, /*TAB_CONFIG_COS */ {"WASSP Class of Service Configuration", &ett_wassp_cos_config_block, sizeof(tlvCosConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvCosConfigTable}, /*TAB_CONFIG_LOC_BASE_LP */ {"WASSP LocalBase Lookup", &ett_wassp_localbase_lookup_block, sizeof(tlvLocationBaseLookUpTable) / sizeof(TLV_PARSER_ENTRY), tlvLocationBaseLookUpTable}, /*TAB_CONFIG_RADIUS */ {"WASSP Radius Config", &ett_wassp_radius_config_block, sizeof(tlvRadiusConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvRadiusConfigTable}, /*EVENT_BLOCK */ {"WASSP Event Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SSS_MU_BLOCK */ {"WASSP SSS MU Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_EID_MU_BLOCK */ {"WASSP EID MU Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*BULK_MU_BLOCK */ {"WASSP BULK MU Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*MU_BLOCK */ {"WASSP MU Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*BULK_VNS_BLOCK */ {"WASSP BULK VNS Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*VNS_BLOCK */ {"WASSP VNS Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SIAPP_PMK_BLOCK */ {"SIAPP PMK Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SIAPP_RADIO_CONFIG_BLOCK */ {"SIAPP Radio Config Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SIAPP_MU_STATS_BLOCK */ {"SIAPP MU STATS Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SIAPP_THIN_BLOCK */ {"SIAPP THIN Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SIAPP_BLOCK */ {"SIAPP Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_ASSOC_SSID_ARRAY*/ {"Assoc SSID array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_ASSOC_SSID_BLOCK*/ {"Assoc SSID Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_AP_LIST_BLOCK*/ {"AP list Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_AP_LIST_ARRAY*/ {"AP list array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SCAN_PROFILE_BLOCK*/ {"Scan profile Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_DEF_ARRAY*/ {"Threat def array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_DEF_BLOCK*/ {"Thread def Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_PATTERN_ARRAY*/ {"Thread pattern array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_PATTERN_BLOCK*/ {"Thread pattern Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SURVEILLANCE_DATA_ARRAY,*/ {"Surveillance Data Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_SURVEILLANCE_DATA_BLOCK,*/ {"Surveillance Data Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_DATA_ARRAY,*/ {"Thread Data Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_DATA_BLOCK,*/ {"Thread Data Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_CLASSIFY_ARRAY,*/ {"Thread Classify Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_THREAT_CLASSIFY_BLOCK,*/ {"Thread Classify Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_USER_CLASSIFY_ARRAY,*/ {"User Classify Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_USER_CLASSIFY_BLOCK,*/ {"User Classify Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MU_EVENT_ARRAY, */ {"MU Event Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MU_EVENT_BLOCK,*/ {"MU Event Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_COUNTRY_ARRAY,*/ {"Country Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_COUNTRY_BLOCK,*/ {"Country Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_LOCATOR_LOC_BLOCK,*/ {"Locator LOC Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_LOCATOR_LOC_ARRAY,*/ {"Locator LOC Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_RSS_DATA_ARRAY,*/ {"RSS Data Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_RSS_DATA_BLOCK,*/ {"RSS Data Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MCAST_FILTER_BLOCK, */ {"MCAST Filter Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MCAST_FILTER_BLOCK_ENTRY */ {"MCAST Filter Block Entry", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MU_SESSION_ARRAY,*/ {"MU Session Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MU_SESSION_BLOCK,*/ {"MU Session Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_DETECTED_ROGUE_ARRAY,*/ {"Detected Rogue Array", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_DETECTED_ROGUE_BLOCK,*/ {"Detected Rogue Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_FILTER_RULES_EXT_BLOCK */ {"Filter Rule Ext Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_APP_POLICY_FIXED_BLOCK */ {"App Policy Fixed Block", &ett_wassp_app_policy_fixed_block, sizeof(tlvAppPolicyFixedTable) / sizeof(TLV_PARSER_ENTRY), tlvAppPolicyFixedTable}, /*TAB_V_FILTER_RULES_EXT_BLOCK */ {"FilterRules Ext Block", &ett_wassp_filter_ext_config_block, sizeof(tlvFilterRuleExtConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvFilterRuleExtConfigTable}, /*TAB_V_SITE_FILTER_RULES_EXT_BLOCK */ {"Site FilterRules Ext Block", &ett_wassp_site_filter_config_block, sizeof(tlvSiteFilterRuleExtConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteFilterRuleExtConfigTable}, /*TAB_APP_POLICY_ENTRY_BLOCK */ {"App Policy Entry Block", &ett_wassp_app_policy_entry_block, sizeof(tlvAppPolicyEntryTable) / sizeof(TLV_PARSER_ENTRY), tlvAppPolicyEntryTable}, /*TAB_11U_ANQP_BLOCK, */ {"11u Config Block", &ett_wassp_11u_config_entry_block, sizeof(tlv11U_ANQP_blockTable) / sizeof(TLV_PARSER_ENTRY), tlv11U_ANQP_blockTable}, /*TAB_HS2_BLOCK, */ {"HS2 config Block", &ett_wassp_hs2_config_entry_block, sizeof(tlvHS2_blockTable) / sizeof(TLV_PARSER_ENTRY), tlvHS2_blockTable}, /*TAB_RU_ACK_RADIO_CONFIG,*/ {"WASSP RU Ack Radio Configure", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_MU_APPL_STATS_BLOCK */ {"MU Appl Stats Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_EXTAPP_CONF_BLOCK */ {"Extend AppControl Config Block", &ett_wassp_extapp_config_entry_block, sizeof(tlvExtapp_conf_blockTable) / sizeof(TLV_PARSER_ENTRY), tlvExtapp_conf_blockTable}, /*TAB_V_CP_CONFIG_BLOCK */ {"CP Config Block", &ett_wassp_vns_config_block, sizeof(tlvVnsConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvVnsConfigTable}, /*TAB_TOPOLOGY_ARRAY_BLOCK */ {"Topology Array Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_TOPOLOGY_STRUCT_BLOCK */ {"Topology Struct Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_FILTER_CONFIG_STRUCT_BLOCK */ {"Filter Config Struct Block", &ett_wassp_eid_main_tlv_block, sizeof(tlvMainTable) / sizeof(TLV_PARSER_ENTRY), tlvMainTable}, /*TAB_S_TOPOLOGY_ARRAY_BLOCK, */ {"Site Topology Array Block", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_S_TOPOLOGY_STRUCT_BLOCK,*/ {"Site Topology Struct Block", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_S_TOPO_MCAST_FILTER_CONFIG_BLOCK,*/ {"Site Topology Mcast Filter Config Struct Block", &ett_wassp_s_topo_m_filter_entry_block, sizeof(tlvSTopoMcastFilterBlock) / sizeof(TLV_PARSER_ENTRY), tlvSTopoMcastFilterBlock}, /*TAB_S_TOPO_MCAST_FILTER_RULES_EXT_BLOCK,*/ {"Site Topology Mcast Filter Rule Ext Block", &ett_wassp_s_topo_m_filter_ext_entry_block, sizeof(tlvSTopoMcastFilterRuleBlock) / sizeof(TLV_PARSER_ENTRY), tlvSTopoMcastFilterRuleBlock}, /*TAB_NAC_SERVER_CONFIG_ARRAY,*/ {"NAC service config array", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_NAC_SERVER_CONFIG_BLOCK,*/ {"NAC service config Block", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_NAC_WEB_AUTH_USER_GROUP_ARRAY,*/ {"NAC WEB auth user group config array", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, /*TAB_NAC_WEB_AUTH_USER_GROUP_BLOCK,*/ {"NAC WEB auth user group Block", &ett_wassp_site_config_block, sizeof(tlvSiteConfigTable) / sizeof(TLV_PARSER_ENTRY), tlvSiteConfigTable}, }; static int wassp_type_converter(int in_tlv_type) { int rtn_val = hf_wassp_tlv_value_octext; switch (in_tlv_type) { case 1: rtn_val = hf_wassp_tlv_value_string; break; case 2: case 3: case 4: case 7: case 8: rtn_val = hf_wassp_tlv_value_int; break; case 5: rtn_val = hf_wassp_tlv_value_octext; break; case 6: rtn_val = hf_wassp_mu_mac; break; case 9: rtn_val = hf_wassp_tlv_value_ip; break; default: break; } return rtn_val; } static int dissect_wassp_sub_tlv(proto_tree *wassp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int in_len, int which_tab, int ru_msg_type); static int dissect_wassp_tlv(proto_tree *wassp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, wassp_ru_msg_t rumsg_type); /* Registered WASSP subdissectors */ static dissector_table_t wassp_dissector_table; /* WASSP dissector routines */ static int dissect_wassp_mu(proto_tree *, tvbuff_t *, packet_info *, int, int); static int dissect_wassp(tvbuff_t *, packet_info *, proto_tree *); /* Dissector registration routines */ void proto_register_wassp(void); void proto_reg_handoff_wassp(void); static int g_wassp_ver = 0; static reassembly_table wassp_reassembled_table; static void wassp_defragment_init(void) { reassembly_table_init(&wassp_reassembled_table, &addresses_reassembly_table_functions); } static const char* wassp_match_strval(const WASSP_SUBTLV_DECODER_INFO_t *in_ptr, int in_type) { if (in_ptr == NULL) { return NULL; } if (in_ptr->max_entry <= in_type) { return NULL; } return in_ptr->entry[in_type].name; } static void port_range_print(char *buf, guint32 temp) { snprintf(buf, ITEM_LABEL_LENGTH, " %d - %d", (temp & 0xffff), (temp >> 16)); } static void topology_moder_print(char *buf, guint16 temp) { guint16 temp3 = temp & 0xc000; guint16 temp4 = temp & 0x0fff; switch (temp3) { case 0xc000: if (temp4) snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller with vlanId = %d (0x%x)", temp4, temp); else snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller, Untagged (0x%x)", temp); break; case 0x4000: if (temp4) snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP with vlanId = %d (0x%x)", temp4, temp); else snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP, Untagged (0x%x) ", temp); break; case 0x8000: if (temp4) snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller with vlanId = %d (0x%x) ", temp4, temp); else snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller, Untagged (0x%x) ", temp); break; default: if (temp4) snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode with vlanId = %d (0x%x)", temp4, temp); else snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode, Untagged (0x%x) ", temp); break; } } static void maskbit_priority_print(char *buf, guint8 temp) { snprintf(buf, ITEM_LABEL_LENGTH, " Type of Service Mask bits : %d Priority TxQ : %d", (temp >> 4) & 0xf, temp & 0xf); } static void cos_priority_txq_print(char *buf, guint8 temp) { snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service priority bits : %d Class of Service Transmit Queue : %d", (temp >> 4) & 0xf, temp & 0xf); } static void cos_rate_id_print(char *buf, guint8 temp) { snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service Inbound Rate Limit ID : %d Class of Service Outbound Rate Limit ID : %d", (temp >> 4) & 0xf, temp & 0xf); } #define V831_FILTER_RULE_FORMAT 4 #define BEFORE_V831_FILTER_RULE_FORMAT 2 #define AFTER_V831_FILTER_RULE_FORMAT 1 #define V831_FILTER_RULE_STRUCT_SIZE 36 #define BEFORE_V831_FILTER_RULE_STRUCT_SIZE 16 #define AFTER_V831_FILTER_RULE_STRUCT_SIZE 20 static void decode_filter_rule_octext_string(proto_tree *tree, tvbuff_t *tvb, int offset, int length ) { int flag = 0, suboffset, count, i; proto_tree *filter_rule_tree = proto_item_add_subtree(tree, ett_wassp_filter_rule); /* there are 3 kinds of filter rule struct. before V8.31 -- 16 bytes V83.1 -- 36 bytes after V8.31 -- 20 bytes */ if (((length - 4) % V831_FILTER_RULE_STRUCT_SIZE) == 0) // might be V8.31 filter struct flag |= V831_FILTER_RULE_FORMAT; if (((length - 4) % AFTER_V831_FILTER_RULE_STRUCT_SIZE) == 0) // might be new filter struct flag |= AFTER_V831_FILTER_RULE_FORMAT; if (((length - 4) % BEFORE_V831_FILTER_RULE_STRUCT_SIZE) == 0) // might be old filter struct flag |= BEFORE_V831_FILTER_RULE_FORMAT; if (flag & V831_FILTER_RULE_FORMAT) // display as V8.31 filter struct { suboffset = offset + 4; //proto_tree_add_debug_text(filter_rule_tree, "-----------Display Filter Rule(s) in V3 Struct Format------------"); count = (length - 4) / V831_FILTER_RULE_STRUCT_SIZE; for (i = 0; i < count; i++) { //proto_tree_add_debug_text(filter_rule_tree, " filter rule %d", i + 1); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_rule, tvb, suboffset, V831_FILTER_RULE_STRUCT_SIZE, ENC_NA); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_flag, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipaddress, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_filter_rule_port_range, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipprotocol, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_netmasklength, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_tos, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_filter_tos_maskbit_priority, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_tos, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_tos_mask, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_priority_txq, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_rateid, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_macaddr, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(filter_rule_tree, hf_wassp_macaddr_mask, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(filter_rule_tree, hf_wassp_vlanid, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(filter_rule_tree, hf_wassp_ethernet_type, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; } } if (flag & AFTER_V831_FILTER_RULE_FORMAT) // display as new filter struct { suboffset = offset + 4; //proto_tree_add_debug_text(filter_rule_tree, "-----------Display Filter Rule(s) in V2 Struct Format------------"); count = (length - 4) / AFTER_V831_FILTER_RULE_STRUCT_SIZE; for (i = 0; i < count; i++) { //proto_tree_add_debug_text(filter_rule_tree, " filter rule %d", i + 1); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_rule, tvb, suboffset, AFTER_V831_FILTER_RULE_STRUCT_SIZE, ENC_NA); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_flag, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipaddress, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_filter_rule_port_range, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipprotocol, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_netmasklength, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_tos, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_filter_tos_maskbit_priority, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_tos, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_tos_mask, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_priority_txq, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_cos_rateid, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; } } if (flag & BEFORE_V831_FILTER_RULE_FORMAT) { suboffset = offset + 4; //proto_tree_add_debug_text(filter_rule_tree, "-----------Display Filter Rule(s) in V1 Struct Format------------"); count = (length - 4) / BEFORE_V831_FILTER_RULE_STRUCT_SIZE; for (i = 0; i < count; i++) { //proto_tree_add_debug_text(filter_rule_tree, " filter rule %d", i + 1); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_rule, tvb, suboffset, BEFORE_V831_FILTER_RULE_STRUCT_SIZE, ENC_NA); proto_tree_add_item(filter_rule_tree, hf_wassp_filter_flag, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipaddress, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_filter_rule_port_range, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(filter_rule_tree, hf_wassp_ipprotocol, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_netmasklength, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(filter_rule_tree, hf_wassp_reserve, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; } } } static void decode_mu_appl_stats_block(proto_tree *tree, tvbuff_t *tvb, int offset ) { int suboffset, count, i; proto_tree *tlv_tree = proto_item_add_subtree(tree, ett_wassp_mu_appl_stats); suboffset = offset; count = tvb_get_ntohl(tvb, suboffset); proto_tree_add_item(tlv_tree, hf_wassp_mu, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; for (i = 1; i <= count; i++) { //proto_tree_add_debug_text(tlv_tree, "MU_%d", i); proto_tree_add_item(tlv_tree, hf_wassp_macaddr, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(tlv_tree, hf_wassp_apprules, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tlv_tree, hf_wassp_displayid, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tlv_tree, hf_wassp_txbytes, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(tlv_tree, hf_wassp_rxbytes, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; } } static void decode_cos_struct(proto_tree *tree, tvbuff_t *tvb, int offset ) { int suboffset = offset; proto_tree_add_item(tree, hf_wassp_flag_1b, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tree, hf_wassp_tos, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tree, hf_wassp_tos_mask, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tree, hf_wassp_priority, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tree, hf_cos_rateid, tvb, suboffset, 1, ENC_BIG_ENDIAN); } static void decode_rate_limit_struct(proto_tree *tree, tvbuff_t *tvb, int offset, int length ) { int suboffset = offset, count = length / 4, i; for (i = 0; i < count; i++) { proto_tree_add_item(tree, hf_wassp_in_cir, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tree, hf_wassp_out_cir, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; } } static void decode_mac_list_struct(proto_tree *tree, tvbuff_t *tvb, int offset, int length ) { int suboffset = offset, count = length / 6, i; for (i = 0; i < count; i++) { proto_tree_add_item(tree, hf_wassp_macaddr, tvb, suboffset, 6, ENC_NA); suboffset += 6; } } static void decode_ipv4_list_struct(proto_tree *tree, tvbuff_t *tvb, int offset, int length ) { int suboffset = offset, count = length / 4, i; for (i = 0; i < count; i++) { proto_tree_add_item(tree, hf_wassp_ipaddress, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; } } static void decode_Channel_list(proto_tree *tree, tvbuff_t *tvb, int offset, int length ) { int suboffset = offset, count = length / 2, i; for (i = 0; i < count; i++) { proto_tree_add_item(tree, hf_wassp_freq, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; } } static int decode_lbs_tag_header(proto_tree *tree, tvbuff_t *tvb, int offset) { int suboffset = offset; proto_item *temp; proto_tree *lbs_header_tree; temp = proto_tree_add_item(tree, hf_aeroscout_header, tvb, suboffset, 64, ENC_NA); lbs_header_tree = proto_item_add_subtree(temp, ett_wassp_header); proto_tree_add_item(lbs_header_tree, hf_aeroscout_header_magic_number, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_aeroscout_request_id, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_aeroscout_code, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_aeroscout_sub_code, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_aeroscout_datalength, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_wassp_mu_mac, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(lbs_header_tree, hf_lbs_vendor_id, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lbs_rsvd1, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lbs_ap_bssid, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(lbs_header_tree, hf_lbs_rsvd2, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lbs_rxchan, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_tstamp, tvb, suboffset, 4, ENC_BIG_ENDIAN); suboffset += 4; proto_tree_add_item(lbs_header_tree, hf_hf_lsb_rsvd3, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lsb_rssi, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_rsvd, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_noise_floor, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_rsvd4, tvb, suboffset, 3, ENC_BIG_ENDIAN); suboffset += 3; proto_tree_add_item(lbs_header_tree, hf_lsb_chan_rate, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_rsvd5, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(lbs_header_tree, hf_lsb_wh_addr2, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(lbs_header_tree, hf_lsb_wh_fc, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lsb_wh_seq, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lsb_rsvd6, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(lbs_header_tree, hf_lsb_wh_addr3, tvb, suboffset, 6, ENC_NA); suboffset += 6; proto_tree_add_item(lbs_header_tree, hf_lsb_wh_addr4, tvb, suboffset, 6, ENC_NA); suboffset += 6; return suboffset; } int dissect_wassp_sub_tlv(proto_tree *wassp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int in_len, int which_tab, int ru_msg_type) { proto_item *tlvi; proto_item *ti; proto_tree *tmp_tree; const char *label; guint32 value; guint16 tlv_type = EID_PARSE_ERROR; guint16 length = 0, org_offset = offset; const WASSP_SUBTLV_DECODER_INFO_t *tmp_decr = NULL; guint32 i, tableNo; int suboffset; if (which_tab >= TAB_MAX) { return offset; } tmp_decr = &wassp_decr_info[which_tab]; if (tvb_reported_length_remaining(tvb, offset) > 0) { ti = proto_tree_add_item(wassp_tree, hf_wassp_sub_tree, tvb, offset, in_len, ENC_NA); proto_item_append_text(ti, " : %s", tmp_decr->subtree_name); tmp_tree = proto_item_add_subtree(ti, *((int*)(WASSP_SUBTLV_GET_ETTNUM(tmp_decr)))); while (((value = tvb_reported_length_remaining(tvb, offset)) >= 4) && (offset - org_offset < in_len)) { tlv_type = tvb_get_ntohs(tvb, offset + TLV_TYPE); length = tvb_get_ntohs(tvb, offset + TLV_LENGTH); if (tlv_type >= WASSP_SUBTLV_GET_MAXENTRY(tmp_decr)) { proto_tree_add_uint_format_value(tmp_tree, hf_wassp_tlv_unknown, tvb, offset, 4, tlv_type, "Unknown Wassp TLV (%d)", tlv_type); proto_tree_add_item(tmp_tree, hf_wassp_tlv_length, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tmp_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); offset += length; continue; } label = wassp_match_strval(tmp_decr, tlv_type); label = (label == NULL) ? "Unknown Type" : label; if (length > value) { proto_tree_add_item(tmp_tree, hf_wassp_tlv_invalid, tvb, offset, 4, ENC_BIG_ENDIAN); tlv_type = EID_PARSE_ERROR; } else if (length < 4) { proto_tree_add_item(tmp_tree, hf_wassp_tlv_invalid, tvb, offset, 4, ENC_BIG_ENDIAN); tlv_type = EID_PARSE_ERROR; } else if (length == 4) { if ((which_tab == TAB_RSS_DATA_ARRAY) && (tlv_type == EID_RSS_DATA_BLOCK)) { proto_tree_add_item(tmp_tree, hf_wassp_tlv_value_octext, tvb, offset, length, ENC_NA); } else { tlvi = proto_tree_add_item(tmp_tree, hf_wassp_tlv_value, tvb, offset, length, ENC_NA); proto_item_append_text(tlvi, " : %s (%d)", label, tlv_type); } offset += length; continue; } else { if ((which_tab == TAB_RSS_DATA_ARRAY) && (tlv_type == EID_RSS_DATA_BLOCK)) { proto_tree_add_item(tmp_tree, hf_wassp_tlv_value_octext, tvb, offset, length, ENC_NA); } else { tlvi = proto_tree_add_item(tmp_tree, hf_wassp_tlv_value, tvb, offset, length, ENC_NA); proto_item_append_text(tlvi, " : %s (%d)", label, tlv_type); } } tlvi = proto_tree_add_item(tmp_tree, hf_wassp_tlv_type_sub, tvb, offset + TLV_TYPE, 2, ENC_NA); proto_item_append_text(tlvi, " : %s (%d)", label, tlv_type); proto_tree_add_item(tmp_tree, hf_wassp_tlv_length, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN); if (tlv_type == EID_PARSE_ERROR) { proto_tree_add_item(wassp_tree, hf_wassp_tlv_invalid, tvb, offset, value, ENC_BIG_ENDIAN); offset += length; break; } else { if (WASSP_SUBTLV_GET_ENTRY_IDX_TYPE(tmp_decr, tlv_type) != TLV_TYPE_BLOCK_TLV) { proto_tree_add_item(tmp_tree, wassp_type_converter(WASSP_SUBTLV_GET_ENTRY_IDX_TYPE(tmp_decr, tlv_type)), tvb, offset + TLV_VALUE, length - 4, FALSE); if ((which_tab == TAB_CONFIG_SITE) && (tlv_type == EID_SITE_TOPOLOGY_BLOCK)) { suboffset = offset + 4; for (i = 0; i < (guint32)(length / 4 - 1); i++) { proto_tree_add_item(tmp_tree, hf_wassp_topologykey, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tmp_tree, hf_wassp_topology_mode, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; } } if (which_tab == VNS_CONFIG_BLOCK) { if (tlv_type == EID_V_COS) { decode_cos_struct(tmp_tree, tvb, offset + 4 ); } else if (tlv_type == EID_V_RATE_LIMIT_RESOURCE_TBL) { decode_rate_limit_struct(tmp_tree,tvb, offset + 4,length-4 ); } } if (which_tab == TAB_CONFIG_FILTER || which_tab == TAB_FILTER_CONFIG_STRUCT_BLOCK) { if (tlv_type == EID_V_FILTER_RULES || tlv_type == EID_FILTER_RULES || tlv_type == EID_V_SITE_FILTER_RULES ) { if (length < 20) break; decode_filter_rule_octext_string(tmp_tree, tvb, offset + 4, length ); } } if (which_tab == TAB_SCAN_PROFILE_BLOCK) { if (tlv_type == EID_CHANNEL_LIST) { decode_Channel_list(tmp_tree, tvb, offset + 4, length -4 ); } } if (which_tab == TAB_SURVEILLANCE_DATA_BLOCK) { if (tlv_type == EID_SCAN_RSS_RSSI) { suboffset = offset + 4; proto_tree_add_item(tmp_tree, hf_wassp_rss, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tmp_tree, hf_wassp_rssi, tvb, suboffset, 2, ENC_BIG_ENDIAN); } if (tlv_type == EID_PARAMS) { suboffset = offset + 4; proto_tree_add_item(tmp_tree, hf_wassp_threatstate, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tmp_tree, hf_wassp_radioparams, tvb, suboffset, 1, ENC_BIG_ENDIAN); suboffset += 1; proto_tree_add_item(tmp_tree, hf_wassp_channelfreq, tvb, suboffset, 2, ENC_BIG_ENDIAN); } } if (which_tab == CONFIG_GLOBAL_BLOCK) { if (tlv_type == EID_ON_DEMAND_ARRAY || tlv_type == EID_DYN_ON_DEMAND_ARRAY) { decode_mac_list_struct(tmp_tree, tvb, offset + 4, length -4 ); } } if (which_tab == TAB_DETECTED_ROGUE_BLOCK) { if (tlv_type == EID_DNS_IP_ADDR) { decode_ipv4_list_struct(tmp_tree, tvb, offset + 4, length -4 ); } } offset += length; } else { tableNo = WASSP_SUBTLV_GET_ENTRY_IDX_TABIDX(tmp_decr, tlv_type); if ((tableNo == RADIO_CONFIG_BLOCK) && (ru_msg_type == WASSP_RU_Ack)) { offset = dissect_wassp_sub_tlv(tmp_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_RU_ACK_RADIO_CONFIG, ru_msg_type); } else offset = dissect_wassp_sub_tlv(tmp_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, tableNo, ru_msg_type); } } } } return offset; } int dissect_wassp_tlv(proto_tree *wassp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, wassp_ru_msg_t rumsg_type) { proto_item *tlvi = NULL; proto_tree *tlv_tree; guint16 tlv_type = WASSP_RU_UNUSED_0; guint16 length; guint32 value; int suboffset; wassp_ru_msg_t ru_msg_type = rumsg_type; const char *label; SET_WASSP_TLV_VERSION(0); while ((value = tvb_reported_length_remaining(tvb, offset)) >= 4) { tlv_type = tvb_get_ntohs(tvb, offset + TLV_TYPE); length = tvb_get_ntohs(tvb, offset + TLV_LENGTH); label = try_val_to_str(tlv_type, wassp_tlv_types); label = (label == NULL) ? "Unknown Type" : label; if (length > value) { tlvi = proto_tree_add_item(wassp_tree, hf_wassp_tlv_invalid, tvb, offset, 4, ENC_BIG_ENDIAN); tlv_type = EID_UNUSED_0; } else if (length < 4) { tlvi = proto_tree_add_item(wassp_tree, hf_wassp_tlv_invalid, tvb, offset, 4, ENC_BIG_ENDIAN); tlv_type = EID_UNUSED_0; } else { tlvi = proto_tree_add_item(wassp_tree, hf_wassp_tlv_value, tvb, offset, length, ENC_NA); proto_item_append_text(tlvi, " : %s (%d)", label, tlv_type); } tlv_tree = proto_item_add_subtree(tlvi, ett_wassp_tlv); proto_tree_add_item(tlv_tree, hf_wassp_tlv_type_main, tvb, offset + TLV_TYPE, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_tree, hf_wassp_tlv_length, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN); switch (tlv_type) { case EID_UNUSED_0: // 0 offset += 4; break; case EID_STATUS: // 1 ru_msg_type = (wassp_ru_msg_t) tvb_get_guint8(tvb, WASSP_HDR_TYPE); /*this is an action TLV*/ if (WASSP_RU_SW_Version_Validate_Rsp == ru_msg_type) { proto_item_append_text(tlvi, " (upgrade action)"); proto_tree_add_item(tlv_tree, hf_wassp_tlv_eid_action, tvb, offset + TLV_VALUE, length - 4, ENC_BIG_ENDIAN); } else /*assume status TLV*/ { proto_item_append_text(tlvi, " (status)"); proto_tree_add_item(tlv_tree, hf_wassp_tlv_eid_status, tvb, offset + TLV_VALUE, length - 4, ENC_BIG_ENDIAN); } offset += length; break; /* display as string */ case EID_RU_SW_VERSION: // 2 case EID_RU_SERIAL_NUMBER: // 3 case EID_IMAGE_PATH: // 9 case EID_RANDOM_NUMBER: // 14 case EID_RU_MODEL: // 17 case EID_RU_TRAP: // 24 case EID_RU_SSID_NAME: // 37 case EID_AC_REG_CHALLENGE: // 41 case EID_AC_REG_RESPONSE: // 42 case EID_STATS: // 43 case EID_CERTIFICATE: // 44 case EID_RADIO_INFO: // 51 case EID_NETWORK_INFO: // 52 case EID_PRODUCT_ID: // 54 case EID_RADIO_INFO_ACK: // 55 case EID_SSID: // 58 case EID_MU_PMKID_LIST: // 72 case EID_MU_PMK_BP: // 73 case EID_MU_PMKID_BP: // 74 case EID_LOG_FILE: // 83 case EID_ALARM_DESCRIPTION: // 85 case EID_RU_BACKUP_VERSION: // 93 case EID_AC_SW_VERSION: // 94 case EID_MCAST_LAMG_LIST: // 95 case EID_FILTER_NAME: // 96 case EID_SENSOR_IMG_VERSION: // 104 case EID_RATECTRL_NAME_UL: // 111 case EID_RATECTRL_NAME_DL: // 112 case EID_POLICY_NAME: // 113 case EID_SIAPP_AP_NAME: // 120 case EID_SIAPP_USER_IDENTITY: // 151 case EID_MU_FILTER_POLICY_NAME: // 162 case EID_MU_TOPOLOGY_POLICY_NAME: // 163 case EID_MU_COS_POLICY_NAME: // 164 case EID_SITE_NAME: // 175 case EID_SSS_SSID: // 191 case EID_POLICY_ZONE_NAME: // 193 case EID_MU_USER_NAME: // 196 case EID_SCAN_SSID: // 237 case EID_THREAT_NAME: // 248 case EID_LOCATION: // 249 case EID_MU_EVENT_STRING: // 254 case EID_LOCATOR_FLOOR_NAME: // 288 case EID_MU_RFS_NAME: // 296 case EID_MU_URL: // 301 case EID_MU_ACCT_SESSION_ID_STRING: // 304 case EID_MU_ACCT_POLICY_NAME: // 305 case EID_MU_TUNNEL_PRIVATE_GROUP_ID_STRING: // 309 case EID_MU_USER_ID_STRING: // 310 case EID_MU_LOCATION: // 331 case EID_AREA_NAME: // 335 case EID_CUI: // 363 case EID_WFA_HS20_URL: // 368 case EID_DHCP_HOST_NAME: // 382 case EID_MU_ECP_PW: // 385 case EID_MU_ECP_TOKEN: // 386 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_string, tvb, offset + TLV_VALUE, length - 4, ENC_ASCII); offset += length; break; /* display as octext string */ case EID_RU_REG_CHALLENGE: // 4 case EID_RU_REG_RESPONSE: // 5 case EID_RU_VNSID: // 7 case EID_SESSION_KEY: // 12 case EID_RU_PREAUTH: // 39 case EID_RU_PMK: // 40 case EID_SIAPP_PMKID: // 115 case EID_SIAPP_PMK_REAUTH: // 116 case EID_SIAPP_PMK_LIFETIME: // 117 case EID_SIAPP_PMKID_FLAG: // 118 case EID_SIAPP_MU_PMK: // 119 case EID_SIAPP_CLUSTER_ACS_REQ: // 122 case EID_SIAPP_PACKET_RETRIES: // 124 case EID_SIAPP_ASSOC_IN_WLAN: // 125 case EID_SIAPP_ASSOC_IN_CLUSTER: // 126 case EID_SIAPP_REASSOC_IN_CLUSTER: // 127 case EID_SIAPP_NEWAP_BSSID: // 129 case EID_SIAPP_OLDAP_BSSID: // 130 case EID_SIAPP_RAD_CACS_REQ: // 131 case EID_SIAPP_CLIENT_COUNT: // 133 case EID_SIAPP_MU_TransmittedFrameCount: // 135 case EID_SIAPP_MU_ReceivedFrameCount: // 136 case EID_SIAPP_MU_TransmittedBytes: // 137 case EID_SIAPP_MU_ReceivedBytes: // 138 case EID_SIAPP_MU_UL_DroppedRateControlPackets: // 139 case EID_SIAPP_MU_DL_DroppedRateControlPackets: // 140 case EID_SIAPP_MU_DL_DroppedBufferFullPackets: // 141 case EID_SIAPP_MU_DL_LostRetriesPackets: // 142 case EID_SIAPP_MU_UL_DroppedRateControlBytes: // 143 case EID_SIAPP_MU_DL_DroppedRateControlBytes: // 144 case EID_SIAPP_MU_DL_DroppedBufferFullBytes: // 145 case EID_SIAPP_MU_DL_LostRetriesBytes: // 146 case EID_SIAPP_BP_BSSID: // 147 case EID_SIAPP_RADIO_ID: // 148 case EID_SIAPP_PREAUTH_REQ: // 150 case EID_SIAPP_LOADBAL_LOADGROUP_ID: // 154 case EID_MU_ACCOUNTING_CLASS: // 169 case EID_SSS_TS64_MU_UPDATE: // 183 case EID_SSS_TS64_AP_CURRENT: // 184 case EID_SSS_AP_HOMEHASH: // 186 case EID_EVENT_ARRAY: // 189 case EID_INFORM_MU_PMK: // 199 case EID_ARP_PROXY: // 201 case EID_MCAST_FILTER_RULES: // 202 case EID_AP_PARAMS: // 203 case EID_THREAT_STATS_F: // 220 case EID_THREAT_PATTERN: // 224 case EID_LOCATOR_LOC_POINT: // 265 case EID_MU_EVENT_DETAILS: // 266 case EID_MU_EVENT_LOC_BLOCK: // 268 case EID_AP_REDIRECT: // 291 case EID_MU_CVLAN_BAP: // 292 case EID_MU_SESSION_ID: // 295 case EID_MU_FLAGS: // 297 case EID_MU_ASSOC_TIME: // 298 case EID_MU_ACTIVE_TIME: // 299 case EID_REPORT_REQ: // 300 case EID_MU_SESSION_LIFETIME: // 302 case EID_MU_REAUTH_TIMER: // 303 case EID_MU_ACCT_START_TIME: // 306 case EID_MU_ACCT_CLASS: // 307 case EID_MU_LOGIN_LAT_GROUP: // 308 case EID_MU_DEFENDED_STATE: // 311 case EID_MU_MOD_MASK: // 312 case EID_LOCATOR_TRACKED: // 313 case EID_PORT: // 314 case EID_RETRIES_COUNT: // 315 case EID_MODULATION_TYPE: // 316 case EID_ROGUE_DETECTION: // 319 case EID_TTL: // 324 case EID_LOCATOR_STATE_DATA: // 326 case EID_LOCATOR_POINT_SET: // 327 case EID_FILTER_RULE_FIXED_APP_ID: // 328 case EID_MU_AREA_BLOCK: // 330 case EID_IN_SERVICE_AP_LIST: // 334 case EID_OUT_SERVICE_AP_LIST: // 335 case EID_LAST_RD_AP: // 336 case EID_ROGUE_INFO: // 337 case EID_MU_PMK_R1: // 339 case EID_SIAPP_R0KHID: // 340 case EID_SIAPP_R1KHID: // 341 case EID_SIAPP_FT_NONCE: // 342 case EID_SIAPP_FT_PMKR0NAME: // 343 case EID_SIAPP_FT_R1KHID: // 344 case EID_SIAPP_FT_S1KHID: // 345 case EID_SIAPP_FT_PMKR1: // 346 case EID_SIAPP_FT_PMKR1NAME: // 347 case EID_SIAPP_FT_PAIRWISE: // 348 case EID_SIAPP_FT_LIFETIME: // 349 case EID_MU_POWER_CAP: // 350 case EID_PERIODIC_NEIGHBOUR_REPORT: // 352 case EID_NEIGHBOUR_ENTRY: // 354 case EID_MU_PMK_R0NAME: // 362 case EID_IPV6_ADDR: // 373 case EID_MU_DEV_IDENTITY: // 376 case EID_NEIGHBOUR_ENTRY_2: // 383 case EID_CHANNEL_ENTRY: // 384 case EID_PKT_F_WIRELESS: // 391 case EID_PKT_F_WIREDCLIENT: // 392 case EID_PKT_F_DIRECTION: // 393 case EID_PKT_F_IP_ARRAY: // 396 case EID_PKT_F_RADIO: // 394 case EID_VSA_SSID_ID: // 400 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); offset += length; break; /* display as IP address format */ case EID_AC_IPADDR: // 6 case EID_TFTP_SERVER: // 8 case EID_STATIC_BP_IPADDR: // 30 case EID_STATIC_BP_NETMASK: // 31 case EID_STATIC_BP_GATEWAY: // 32 case EID_STATIC_BM_IPADDR: // 33 case EID_AP_IPADDR: // 89 case EID_AP_NETMASK: // 90 case EID_AP_GATEWAY: // 91 case EID_MU_IP_ADDR: // 173 case EID_PEER_SITE_IP: // 176 case EID_COLLECTOR_IP_ADDR: // 200 case EID_IP_ADDR_TX: // 322 case EID_IP_ADDR_RX: // 323 case EID_GW_IP_ADDR: // 325 case EID_STATIC_VSA_IPADDR: // 387 case EID_STATIC_VSA_NETMASK: // 388 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += length; break; case EID_CONFIG: // 10 case EID_ALARM: // 38 /* Dissect SNMP encoded configuration */ dissector_try_uint(wassp_dissector_table, WASSP_SNMP, tvb_new_subset_length_caplen(tvb, offset + TLV_VALUE, -1, length - 4), pinfo, tlv_tree); offset += length; break; case EID_RU_STATE: // 11 proto_tree_add_item(tlv_tree, hf_wassp_tlv_eid_rustate, tvb, offset + TLV_VALUE, length - 4, ENC_BIG_ENDIAN); proto_item_append_text(tlvi, ": %s", tfs_get_string(tvb_get_guint8(tvb, offset + TLV_VALUE), &wassp_eid_rustate_types)); offset += length; break; /* display as int */ case EID_RU_PROTOCOL: // 13 case EID_STANDBY_TIMEOUT: // 15 case EID_RU_CHALLENGE_ID: // 16 case EID_RU_SCAN_MODE: // 18 case EID_RU_SCAN_TYPE: // 19 case EID_RU_SCAN_INTERVAL: // 20 case EID_RU_RADIO_TYPE: // 21 case EID_RU_CHANNEL_DWELL_TIME: // 22 case EID_RU_CHANNEL_LIST: // 23 case EID_RU_SCAN_TIMES: // 25 case EID_RU_SCAN_DELAY: // 26 case EID_RU_SCAN_REQ_ID: // 27 case EID_STATIC_CONFIG: // 28 case EID_LOCAL_BRIDGING: // 29 case EID_RU_CAPABILITY: // 36 case EID_RADIO_ID: // 45 case EID_REQ_ID: // 46 case EID_NETWORK_ID: // 47 case EID_TIME: // 49 case EID_NUM_RADIOS: // 50 case EID_VENDOR_ID: // 53 case EID_SECURE_TUNNEL: // 56 case EID_MU_TOPOLOGY_ID: // 57 case EID_SNMP_ERROR_STATUS: // 60 case EID_SNMP_ERROR_INDEX: // 61 case EID_RU_REAUTH_TIMER: // 62 case EID_AP_IMG_TO_RAM: // 63 case EID_AP_IMG_ROLE: // 64 case EID_STATS_REQUEST_TYPE: // 67 case EID_STATS_LAST: // 68 case EID_COUNTDOWN_TIME: // 75 case EID_WASSP_VLAN_TAG: // 76 case EID_SSID_ID: // 77 case EID_PORT_OPEN_FLAG: // 80 case EID_WASSP_TUNNEL_TYPE: // 81 case EID_LOG_TYPE: // 82 case EID_ALARM_SEVERITY: // 84 case EID_AP_DHCP_MODE: // 88 case EID_AUTH_STATE: // 98 case EID_MU_DISC_AFTER_AUTH: // 99 case EID_TRANS_ID: // 101 case EID_TIMEZONE_OFFSET: // 102 case EID_SENSOR_FORCE_DOWNLOAD: // 103 case EID_BRIDGE_MODE: // 105 case EID_MU_VLAN_TAG: // 106 case EID_RATECTRL_CIR_UL: // 107 case EID_RATECTRL_CIR_DL: // 108 case EID_RATECTRL_CBS_UL: // 109 case EID_RATECTRL_CBS_DL: // 110 case EID_SIAPP_LOADBAL_PKT_TYPE: // 153 case EID_SIAPP_LOADBAL_LOAD_VALUE: // 155 case EID_SIAPP_FILTER_COS: // 157 case EID_UCAST_FILTER_DISABLE: // 160 case EID_MU_INFORM_REASON: // 161 case EID_MU_FILTER_KEY: // 165 case EID_MU_TOPOLOGY_KEY: // 166 case EID_MU_COS_KEY: // 167 case EID_MU_SESSION_TIMEOUT: // 168 case EID_MU_LOGIN_LAT_PORT: // 170 case EID_MU_IDLE_TIMEOUT: // 171 case EID_MU_ACCT_INTERIM_INTERVAL: // 172 case EID_MU_TERMINATE_ACTION: // 174 case EID_INTERFERENCE_EVENTS_ENABLE: // 177 case EID_EVENT_TYPE: // 178 case EID_EVENT_CHANNEL: // 179 case EID_EVENT_VALUE: // 180 case EID_SSS_MU_ASSOC_TIME: // 182 case EID_SSS_MU_AUTH_STATE: // 185 case EID_TIME_FIRST_DETECTED: // 187 case EID_TIME_LAST_REPORTED: // 188 case EID_SSS_DEFAULT_SESSION_TIMEOUT: // 190 case EID_SSS_PRIVACY_TYPE: // 192 case EID_RU_AC_EVENT_COMPONENT_ID: // 194 case EID_MU_AUTH_STATE: // 195 case EID_BULK_TYPE: // 197 case EID_SENT_TIME: // 198 case EID_SCAN_PROFILE_ID: // 209 case EID_ACTION_REQ: // 210 case EID_COUNTERMEASURES_MAX_CH: // 212 case EID_COUNTERMEASURES_SET: // 213 case EID_SEQ_NUM: // 215 case EID_THREAT_TYPE: // 218 case EID_THREAT_ID: // 219 case EID_THREAT_FR_SFR: // 221 case EID_THREAT_ALERT_TH_DUR: // 225 case EID_THREAT_CLEAR_TH_DUR: // 226 case EID_THREAT_PRIORITY: // 227 case EID_THREAT_MITIGATION_LIST: // 228 case EID_PARAMS: // 235 case EID_MU_EVENT_TYPE: // 260 case EID_SSS_MU_IS_PORT_CLOSED: // 229 case EID_FULL_UPDATE: // 230 case EID_REASON: // 231 case EID_SCAN_CAP: // 238 case EID_THREAT_CLASSIFICATION: // 239 case EID_STATE: // 242 case EID_DROP_FR_CNT: // 243 case EID_STOP_ROAM_CNT: // 244 case EID_SPOOF_CNT: // 245 case EID_ENCRYPTION_TYPE: // 250 case EID_COMPONENT_ID: // 253 case EID_BYPASS_BMCAST: // 255 case EID_GETTIMEOFDAY: // 256 case EID_COUNTRY_ID: // 257 case EID_LOCATOR_FLOOR_ID: // 261 case EID_LOCATOR_LOC_TYPE: // 262 case EID_MU_EVENT_FROM_AP: // 267 case EID_LOCATOR_LOC_AP_DISTANCE: // 269 case EID_LOCATOR_LOC_PRECISION: // 270 case EID_LOCATOR_MU_ACTION: // 273 case EID_EFFECTIVE_EGRESS_VLAN: // 274 case EID_REBOOT_ACK: // 275 case EID_AUTH_FLAG: // 277 case EID_ROAMED_FLAG: // 278 case EID_MU_RSS: // 279 case EID_FILTER_RULES_VER: // 280 case EID_FILTER_TYPE: // 281 case EID_DEFAULT_ACTION_TYPE: // 284 case EID_DEFAULT_CONTAIN_TO_VLAN: // 285 case EID_DEFAULT_BRIDGE_MODE: // 286 case EID_INVALID_POLICY: // 287 case EID_AP_FLAGS: // 289 case EID_AP_PVID: // 290 case EID_MU_LOCATION_TS: // 332 case EID_MU_IS_FT: // 338 case EID_TIMESTAMP: // 353 case EID_MU_REQ: // 355 case EID_RU_REQ: // 356 case EID_NEIGHBOUR_REQ: // 357 case EID_SSS_FT_ASSOC: // 358 case EID_DEFAULT_MIRRORN: // 359 case EID_FILTER_RULE_EXT_ACT_FLAGS: // 360 case EID_TOPO_GROUP_MAPPING: // 361 case EID_SSS_CAPINFO: // 364 case EID_SSS_CAPPOWER: // 365 case EID_WFA_VSA: // 366 case EID_WFA_HS20_REMED_METHOD: // 367 case EID_WFA_HS20_DEAUTH_CODE: // 369 case EID_WFA_HS20_REAUTH_DELAY: // 370 case EID_WFA_HS20_SWT: // 371 case EID_POWER_STATUS: // 372 case EID_FILTER_RULES_APP_SIG_GROUP_ID: // 374 case EID_FILTER_RULES_APP_SIG_DISP_ID: // 375 case EID_APPL_STATS_REQ: // 377 case EID_PKT_CAPTURE_STATUS: // 389 case EID_PKT_CAPTURE_FILTERS: // 390 case EID_PKT_F_FLAGS: // 395 case EID_PKT_F_PROTOCOL: // 398 case EID_PKT_F_PORT: // 399 case EID_MU_AUTH_TYPE: // 401 case EID_PKT_F_MAX_PKT_COUNT: // 402 case EID_PKT_F_FLAG_2: // 403 case EID_IMAGE_PORT: // 404 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_int, tvb, offset + TLV_VALUE, length - 4, ENC_NA); offset += length; break; /* display as Mac address */ case EID_BP_BPSSID: // 34 case EID_BP_WIRED_MACADDR: // 35 case EID_SIAPP_MACADDR: // 149 case EID_SIAPP_AC_MGMT_MAC: // 156 case EID_MAC_ADDR: // 208 case EID_SCAN_BSSID: // 233 case EID_MU_BSSID: // 276 case EID_MAC_ADDR_TX: // 320 case EID_MAC_ADDR_RX: // 321 proto_tree_add_item(tlv_tree, hf_wassp_macaddr, tvb, offset + TLV_VALUE, length - 4, ENC_NA); offset += length; break; case EID_MU_MAC: // 48 case EID_PKT_F_MAC: // 397 proto_tree_add_item(tlv_tree, hf_wassp_mu_mac, tvb, offset + TLV_VALUE, length - 4, ENC_NA); offset += length; break; /* call sub tlv */ case EID_EVENT_BLOCK: // 59 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, EVENT_BLOCK, ru_msg_type); break; case EID_AP_STATS_BLOCK: // 65 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, AP_STATS_BLOCK, ru_msg_type); break; case EID_MU_RF_STATS_BLOCK: // 66 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, MU_RF_STATS_BLOCK, ru_msg_type); break; case EID_TLV_CONFIG: // 69 case EID_BSSID2IP_BLOCK: // 92 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, CONFIG_GLOBAL_BLOCK, ru_msg_type); break; case EID_CONFIG_ERROR_BLOCK: // 70 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, CONFIG_ERROR_BLOCK, ru_msg_type); break; case EID_CONFIG_MODIFIED_BLOCK: // 71 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_CONFIG_MODIFIED, ru_msg_type); break; case EID_BULK_MU_BLOCK: // 78 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, BULK_MU_BLOCK, ru_msg_type); break; case EID_MU_BLOCK: // 79 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, MU_BLOCK, ru_msg_type); break; case EID_BULK_VNS_BLOCK: // 86 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, BULK_VNS_BLOCK, ru_msg_type); break; case EID_VNS_BLOCK: // 87 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, VNS_BLOCK, ru_msg_type); break; case EID_SIAPP_PMK_BLOCK: // 114 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_PMK_BLOCK, ru_msg_type); break; case EID_SIAPP_RADIO_CONFIG_BLOCK: // 121 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_RADIO_CONFIG_BLOCK, ru_msg_type); break; case EID_SIAPP_SIAPP_MU_STATS_BLOCK: // 123 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_MU_STATS_BLOCK, ru_msg_type); break; case EID_SIAPP_THIN_BLOCK: // 128 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_THIN_BLOCK, ru_msg_type); break; case EID_SIAPP_RADIOBLOCK: // 132 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_MU_STATS_BLOCK, ru_msg_type); break; case EID_SIAPP_BLOCK: // 134 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SIAPP_BLOCK, ru_msg_type); break; case EID_SIAPP_LOADBAL_BLOCK: // 152 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, VNS_BLOCK, ru_msg_type); break; case EID_SSS_MU_BLOCK: // 181 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SSS_MU_BLOCK, ru_msg_type); break; case EID_ASSOC_SSID_ARRAY: // 204 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_ASSOC_SSID_ARRAY, ru_msg_type); break; case EID_ASSOC_SSID_BLOCK: // 205 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_ASSOC_SSID_BLOCK, ru_msg_type); break; case EID_AP_LIST_BLOCK: // 206 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_AP_LIST_BLOCK, ru_msg_type); break; case EID_AP_LIST_ARRAY: // 207 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_AP_LIST_ARRAY, ru_msg_type); break; case EID_SCAN_PROFILE_BLOCK: // 214 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SCAN_PROFILE_BLOCK, ru_msg_type); break; case EID_THREAT_DEF_ARRAY: // 216 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_DEF_ARRAY, ru_msg_type); break; case EID_THREAT_DEF_BLOCK: // 217 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_DEF_BLOCK, ru_msg_type); break; case EID_THREAT_PATTERN_ARRAY: // 222 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_PATTERN_ARRAY, ru_msg_type); break; case EID_THREAT_PATTERN_BLOCK: // 223 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_PATTERN_BLOCK, ru_msg_type); break; case EID_SURVEILLANCE_DATA_ARRAY: // 231 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SURVEILLANCE_DATA_ARRAY, ru_msg_type); break; case EID_SURVEILLANCE_DATA_BLOCK: // 232 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_SURVEILLANCE_DATA_BLOCK, ru_msg_type); break; case EID_THREAT_DATA_ARRAY: // 239 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_DATA_ARRAY, ru_msg_type); break; case EID_THREAT_DATA_BLOCK: // 240 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_DATA_BLOCK, ru_msg_type); break; case EID_THREAT_CLASSIFY_ARRAY: // 245 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_CLASSIFY_ARRAY, ru_msg_type); break; case EID_THREAT_CLASSIFY_BLOCK: // 246 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_THREAT_CLASSIFY_BLOCK, ru_msg_type); break; case EID_MU_EVENT_ARRAY: // 251 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MU_EVENT_ARRAY, ru_msg_type); break; case EID_MU_EVENT_BLOCK: // 252 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MU_EVENT_BLOCK, ru_msg_type); break; case EID_COUNTRY_ARRAY: // 258 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_COUNTRY_ARRAY, ru_msg_type); break; case EID_COUNTRY_BLOCK: // 259 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_COUNTRY_BLOCK, ru_msg_type); break; case EID_LOCATOR_LOC_BLOCK: // 263 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_LOCATOR_LOC_BLOCK, ru_msg_type); break; case EID_LOCATOR_LOC_ARRAY: // 264 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_LOCATOR_LOC_ARRAY, ru_msg_type); break; case EID_RSS_DATA_ARRAY: // 271 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_RSS_DATA_ARRAY, ru_msg_type); break; case EID_RSS_DATA_BLOCK: // 272 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_RSS_DATA_BLOCK, ru_msg_type); break; case EID_MCAST_FILTER_BLOCK: // 282 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MCAST_FILTER_BLOCK, ru_msg_type); break; case EID_MCAST_FILTER_BLOCK_ENTRY: // 283 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MCAST_FILTER_BLOCK_ENTRY, ru_msg_type); break; case EID_MU_SESSION_ARRAY: // 293 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MU_SESSION_ARRAY, ru_msg_type); break; case EID_MU_SESSION_BLOCK: // 294 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_MU_SESSION_BLOCK, ru_msg_type); break; case EID_DETECTED_ROGUE_ARRAY: // 317 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_DETECTED_ROGUE_ARRAY, ru_msg_type); break; case EID_DETECTED_ROGUE_BLOCK: // 318 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_DETECTED_ROGUE_BLOCK, ru_msg_type); break; case EID_FILTER_RULES_EXT_BLOCK: // 329 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_FILTER_RULES_EXT_BLOCK, ru_msg_type); break; case EID_TOPOLOGY_ARRAY: // 379 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_TOPOLOGY_ARRAY_BLOCK, ru_msg_type); break; case EID_TOPOLOGY_STRUCT: // 380 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_TOPOLOGY_STRUCT_BLOCK, ru_msg_type); break; case EID_FILTER_CONFIG_STRUCT: // 381 offset = dissect_wassp_sub_tlv(tlv_tree, tvb, pinfo, offset + TLV_VALUE, length - TLV_VALUE, TAB_FILTER_CONFIG_STRUCT_BLOCK, ru_msg_type); break; case EID_FILTER_RULES: // 97 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_filter_rule_octext_string(tlv_tree, tvb, offset + 4, length ); offset += length; break; case EID_MU_MAC_LIST: // 100 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_mac_list_struct(tlv_tree, tvb, offset + 4, length -4 ); offset += length; break; case EID_COS: // 158 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_cos_struct(tlv_tree, tvb, offset + 4 ); offset += length; break; case EID_RATE_LIMIT_RESOURCE_TBL: // 159 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_rate_limit_struct(tlv_tree,tvb, offset + 4,length-4 ); offset += length; break; case EID_CHANNEL_LIST: // 211 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_Channel_list(tlv_tree, tvb, offset + 4, length -4 ); offset += length; break; case EID_DNS_IP_ADDR: // 333 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_ipv4_list_struct(tlv_tree, tvb, offset + 4, length -4 ); offset += length; break; case EID_MU_APPL_STATS_BLOCK: // 378 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); decode_mu_appl_stats_block(tlv_tree, tvb, offset + 4 ); offset += length; break; case EID_SCAN_RSS_RSSI: // 236 proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_int, tvb, offset + TLV_VALUE, length - 4, ENC_NA); suboffset = offset + 4; proto_tree_add_item(tlv_tree, hf_wassp_rss, tvb, suboffset, 2, ENC_BIG_ENDIAN); suboffset += 2; proto_tree_add_item(tlv_tree, hf_wassp_rssi, tvb, suboffset, 2, ENC_BIG_ENDIAN); offset += length; break; default: /* If tlv isn't in the list, then just display the raw data*/ proto_tree_add_item(tlv_tree, hf_wassp_tlv_value_octext, tvb, offset + TLV_VALUE, length - 4, ENC_NA); call_dissector(data_handle, tvb_new_subset_length_caplen(tvb, offset + TLV_VALUE, -1, length - 4), pinfo, wassp_tree); offset += length; } if (tlv_type == EID_UNUSED_0) { proto_tree_add_item(wassp_tree, hf_wassp_tlv_invalid, tvb, offset, value, ENC_BIG_ENDIAN); offset += length; } } return offset; } static void mu_association_status(char *buf, guint8 value) { if (value == 1) snprintf(buf, ITEM_LABEL_LENGTH, " Success (%d)", value); else if (value == 2) snprintf(buf, ITEM_LABEL_LENGTH, " Reject (%d)", value); else snprintf(buf, ITEM_LABEL_LENGTH, " Failure (%d)", value); } static int dissect_mu_netflow(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_item *ti, *temp; proto_tree *wassp_mu_netflow_tree, *mu_netflow_header_tree; guint16 netflowLen, totalRecord, i; ti = proto_tree_add_item(tree, hf_wassp_mu_netflow_tree, tvb, offset, -1, ENC_NA); wassp_mu_netflow_tree = proto_item_add_subtree(ti, ett_wassp_mu_data_netflow); temp = proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_header, tvb, MU_NETFLOW_HDR_VERSION, MU_NETFLOW_HEADER_TOTAL_LENGTH, ENC_NA); mu_netflow_header_tree = proto_item_add_subtree(temp, ett_wassp_mu_data_netflow_header); proto_tree_add_item(mu_netflow_header_tree, hf_wassp_mu_netflow_version, tvb, MU_NETFLOW_HDR_VERSION, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_netflow_header_tree, hf_wassp_mu_netflow_length, tvb, MU_NETFLOW_HDR_LENGTH, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_netflow_header_tree, hf_wassp_mu_netflow_flags, tvb, MU_NETFLOW_HDR_FLAG, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_netflow_header_tree, hf_wassp_mu_netflow_uptime, tvb, MU_NETFLOW_HDR_UPTIME, 4, ENC_NA); offset += MU_NETFLOW_HEADER_TOTAL_LENGTH; netflowLen = tvb_get_ntohs(tvb, MU_NETFLOW_HDR_LENGTH); totalRecord = (netflowLen - MU_NETFLOW_HEADER_TOTAL_LENGTH) / MU_NETFLOW_RECORD_SIZE; //netflow record size is 46 bytes if (totalRecord > 0) { for (i = 1; i <= totalRecord; i++) { //proto_tree_add_debug_text(wassp_mu_netflow_tree, " WASSP MU Netflow Record %d ", i); proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_record, tvb, offset, MU_NETFLOW_RECORD_SIZE, ENC_NA); proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_in_bytes, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_in_packets, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_ip_protocol_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_source_tos, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_source_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_source_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_input_snmp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_dest_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_output_snmp, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_last_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_first_time, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_in_source_mac, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(wassp_mu_netflow_tree, hf_wassp_mu_netflow_in_dest_mac, tvb, offset, 6, ENC_NA); offset += 6; } } else { //proto_tree_add_debug_text(wassp_mu_netflow_tree, "WASSP MU Netflow Records are incomplete "); offset += netflowLen; } return offset; } /* Dissect Wassp MU message: return offset in current tvb */ static int dissect_wassp_mu(proto_tree *wassp_tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int plength) { proto_item *ti, *temp; proto_tree *wassp_mu_tree, *mu_data_header_tree, *mu_action_field_tree; wassp_mu_msg_t mu_msg_type; char *label; guint16 length = WASSP_MU_HDR_WITHOUT_ASSO_STATUS_LEN; if (tvb_reported_length_remaining(tvb, offset) > 0) { mu_msg_type = (wassp_mu_msg_t)tvb_get_guint8(tvb, offset + WASSP_MU_HDR_TYPE); ti = proto_tree_add_item(wassp_tree, hf_wassp_mu_data_tree, tvb, offset, -1, ENC_NA); wassp_mu_tree = proto_item_add_subtree(ti, ett_wassp_data); label = (char*)try_val_to_str(mu_msg_type, wassp_mu_header_types); label = (label == NULL) ? "Unknown Type" : label; proto_item_append_text(ti, ", %s", label); if ( mu_msg_type == WASSP_MU_Associate_Rsp ) length = WASSP_MU_HDR_WITH_ASSO_STATUS_LEN; /* Dissect the WASSP MU header */ temp = proto_tree_add_item(wassp_mu_tree, hf_wassp_mu_data_header, tvb, WASSP_MU_HDR_TYPE, length, ENC_NA); mu_data_header_tree = proto_item_add_subtree(temp, ett_mu_data_header); proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_type, tvb, offset + WASSP_MU_HDR_TYPE, 1, ENC_BIG_ENDIAN); proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_qos, tvb, offset + WASSP_MU_HDR_QOS, 1, ENC_BIG_ENDIAN); temp = proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_action_ssid, tvb, offset + WASSP_MU_HDR_ACTION_SSID, 2, ENC_BIG_ENDIAN); mu_action_field_tree = proto_item_add_subtree(temp, ett_mu_action_field); proto_tree_add_item(mu_action_field_tree, hf_wassp_mu_action, tvb, offset + WASSP_MU_HDR_ACTION_SSID, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_action_field_tree, hf_wassp_mu_action_field_value, tvb, offset + WASSP_MU_HDR_ACTION_SSID, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_mac, tvb, offset + WASSP_MU_HDR_MAC, 6, ENC_NA); proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_resv0, tvb, offset + WASSP_MU_HDR_RESV_0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_resv1, tvb, offset + WASSP_MU_HDR_RESV_1, 2, ENC_BIG_ENDIAN); if ( mu_msg_type == WASSP_MU_Associate_Rsp ) proto_tree_add_item(mu_data_header_tree, hf_wassp_mu_assoc_status, tvb, offset + WASSP_MU_HDR_RESV_1 + 2, 1, ENC_BIG_ENDIAN); offset += length; /* WASSP MU payload length */ plength -= length; /* Dissect the WASSP MU payload */ switch (mu_msg_type) { case WASSP_MU_NETFLOW: offset = dissect_mu_netflow(wassp_mu_tree, tvb, offset); break; case WASSP_MU_Associate_Req: case WASSP_MU_Update_Req: case WASSP_MU_Update_Rsp: case WASSP_AP2AC_MU_Inform_Req: case WASSP_AP2AC_MU_Inform_Rsp: case WASSP_MU_BULK_Associate_Req: case WASSP_MU_BULK_Associate_Rsp: case WASSP_MU_Disconnect_Req: case WASSP_MU_Disconnect_Rsp: case WASSP_MU_Associate_Rsp: offset = dissect_wassp_tlv(wassp_mu_tree, tvb, pinfo, offset, WASSP_RU_UNUSED_0); break; case WASSP_MU_MIRRORN: case WASSP_MU_Data: case WASSP_MU_Eap_Last: /* Dissect the WASSP MU ethernet frame */ call_dissector(eth_handle, tvb_new_subset_length_caplen(tvb, offset, -1, plength), pinfo, wassp_mu_tree); offset += plength; break; case WASSP_MU_Roam_Notify: case WASSP_MU_Disconnect_Notify: offset += plength; break; default: /* Dissect the WASSP MU payload as data by default */ call_dissector(data_handle, tvb_new_subset_length_caplen(tvb, offset, -1, plength), pinfo, wassp_mu_tree); offset += plength; break; } } return offset; } static void dissect_unfragmented_wassp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 plength2, wassp_ru_msg_t ru_msg_type, int offset2) { proto_tree *wassp_tree; int offset = offset2; guint16 plength = plength2; guint16 lsbHeaderMagic = 0; if (tree) { wassp_tree = tree; plength -= WASSP_HDR_LEN; switch (ru_msg_type) { case WASSP_RU_Discov: // 1 case WASSP_RU_Register_Req: // 2 case WASSP_RU_Register_Rsp: // 3 case WASSP_RU_Authentication_Req: // 4 case WASSP_RU_Authentication_Rsp: // 5 case WASSP_RU_SW_Version_Validate_Req: // 6 case WASSP_RU_SW_Version_Validate_Rsp: // 7 case WASSP_RU_Config_Req: // 8 case WASSP_RU_Config_Rsp: // 9 case WASSP_RU_Ack: // 10 case WASSP_RU_Config_Status_Notify: // 11 case WASSP_RU_Set_State_Req: // 12 case WASSP_RU_Set_State_Rsp: // 13 case WASSP_RU_Poll: // 16 case WASSP_RU_SNMP_Req: // 17 case WASSP_RU_SNMP_Rsp: // 18 case WASSP_BP_Trap_Notify: // 19 case WASSP_BP_Scan_Req: // 20 case WASSP_RFM_Notify: // 21 case WASSP_RU_SNMP_Alarm_Notify: // 22 case WASSP_RU_SNMP_Set_Alarm_Clear: // 23 case WASSP_RU_SNMP_Set_Log_Status: // 24 case WASSP_RU_SNMP_Get_Log_Req: // 25 case WASSP_RU_SNMP_Get_Log_Resp: // 26 case WASSP_SEC_Update_Notify: // 27 case WASSP_RU_STATS_Req: // 28 case WASSP_RU_STATS_Rsp: // 29 case WASSP_RU_UNUSED_30: // 30 case WASSP_RU_UNUSED_31: // 31 case WASSP_RU_Get_Req: // 32 case WASSP_RU_Get_Rsp: // 33 case WASSP_RU_Alarm_Notify: // 34 case WASSP_RU_Set_Alarm_Clear: // 35 case WASSP_RU_Get_Log_Req: // 36 case WASSP_RU_Get_Log_Rsp: // 37 case WASSP_RU_UNUSED_38: // 38 case WASSP_RU_UNUSED_39: // 39 case WASSP_P_PEER_DOWN_NOTIFY: // 40 case WASSP_P_LINK_STATE_CHANGE_REQ: // 41 case WASSP_P_LINK_STATE_CHANGE_RSP: // 42 case WASSP_RU_GetIP_Req: // 44 case WASSP_RU_GetIP_Rsp: // 45 case WASSP_RU_LAMG_Update_Req: // 46 case WASSP_RU_LAMG_Update_Rsp: // 47 case WASSP_RU_Event_Req: // 48 case WASSP_RU_Event_Rsp: // 49 case WASSP_RU_BULK_MU_UPDATE_REQ: // 50 case WASSP_RU_BULK_MU_UPDATE_RSP: // 51 case WASSP_ROAMED_MU_FILTER_STATS_REQ: // 52 case WASSP_ROAMED_MU_FILTER_STATS_RESP: // 53 case WASSP_RU_AC_Event_Req: // 56 case WASSP_RU_AC_Event_Rsp: // 57 case WASSP_RU_Event_Notify: // 58 case WASSP_RU_AC_EVENT: // 59 case WASSP_WIDS_WIPS_Config_Req: // 60 case WASSP_WIDS_WIPS_Config_Rsp: // 61 case WASSP_Scan_Data_Notify: // 62 case WASSP_Scan_Data_Notify_Ack: // 63 case WASSP_Loc_Data_Notify: // 64 case WASSP_Loc_Data_Notify_Ack: // 65 case WASSP_RU_SW_Version_Validate_Ack: // 66 case WASSP_NEIGHBOUR_STATS_Rsp: // 67 case WASSP_APPL_STATS_RESP: // 68 case WASSP_AC_Register_Req: // 101 case WASSP_AC_Register_Rsp: // 102 case WASSP_AC_Deregister_Req: // 103 case WASSP_AC_Deregister_Rsp: // 104 goto tlv_dissect; case WASSP_RU_Stats_Notify: // 14 /* Dissect SNMP encoded RU statistics */ dissector_try_uint(wassp_dissector_table, WASSP_SNMP, tvb_new_subset_length_caplen(tvb, offset, -1, plength), pinfo, wassp_tree); offset += plength; goto data_dissect; case WASSP_LBS_TAG_REPORT: // 55 lsbHeaderMagic = tvb_get_ntohs(tvb, 36); call_dissector(ip_handle, tvb_new_subset_length_caplen(tvb, offset, -1, plength), pinfo, wassp_tree); if (lsbHeaderMagic == LBS_HDR_MAGIC) offset = decode_lbs_tag_header(wassp_tree, tvb, offset + 28); else { return; } goto data_dissect; case WASSP_Data: // 15 offset = dissect_wassp_mu(wassp_tree, tvb, pinfo, offset, plength); goto data_dissect; default: offset += plength; goto data_dissect; } tlv_dissect: /* Dissect all RU messages containing TLVs */ offset = dissect_wassp_tlv(wassp_tree, tvb, pinfo, offset, ru_msg_type); data_dissect: /* Call data dissector on any remaining bytes */ call_dissector(data_handle, tvb_new_subset_length_caplen(tvb, offset, -1, -1), pinfo, wassp_tree); } } static int dissect_wassp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { proto_item *ti, *temp; proto_tree *wassp_tree; proto_tree *wassp_header_tree, *ru_discover_header_tree, *wassp_seq_flag_tree; wassp_ru_msg_t ru_msg_type; int offset = 0; guint16 flag = 0, seq_number = 0; guint32 fragment = FALSE, complete = TRUE; guint32 remain_len = 0, length; fragment_head *wassp_frag_msg = NULL; gboolean save_fragmented; tvbuff_t *next_tvb = NULL, *combined_tvb = NULL; const char *label; conversation_t *conv = NULL; guint32 reassembly_id; /********************************************************************************************************************************************************** UDP Port = 13910 --> Wassp Protocol UDP port = 13907 --> Access Point Discover Wassp header format: Byte 1 Byte 2 Byte 3 and Byte 4 Byte 5 and Byte 6 Byte 7 and Byte 8 | Version | Type | Seq. Number & Flag | Session ID | Length of Payload | RU discover header format: Byte 1 Byte 2 Byte 3 and Byte 4 Byte 5 and Byte 6 Byte 7 and Byte 8 Byte 7 and Byte 8 Byte 9 to Byte 12 if mac, else Byte 9 to Byte 10 for operation | Version | Type | Random Number | Length of Payload | Check Sum | Controller Operation | Mac or Operation ************************************************************************************************************************************************************/ col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME); remain_len = tvb_reported_length_remaining(tvb, WASSP_HDR_VERSION); next_tvb = tvb; ru_msg_type = (wassp_ru_msg_t)tvb_get_guint8(tvb, WASSP_HDR_TYPE); if ( ru_msg_type == WASSP_Data ) // wassp mu header { label = val_to_str_const(tvb_get_guint8(tvb, WASSP_HDR_LEN + WASSP_MU_HDR_TYPE), wassp_mu_header_types, "Unknown WASSP MU Message Type"); col_add_str(pinfo->cinfo, COL_INFO, label); } else if (ru_msg_type == WASSP_RU_Discov) /* ap discover header*/ { if (tvb_get_ntohs(tvb, RU_HDR_AC_OP) == RU_DISCOVER_OP_MODE) col_add_str(pinfo->cinfo, COL_INFO, "RU Discover Request"); else col_add_str(pinfo->cinfo, COL_INFO, "RU Discover Response"); } else { col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const(tvb_get_guint8(tvb, WASSP_HDR_TYPE), wassp_header_types, "Unknown WASSP Message Type")); } save_fragmented = pinfo->fragmented; ti = proto_tree_add_item(tree, proto_wassp, tvb, offset, -1, ENC_NA); wassp_tree = proto_item_add_subtree(ti, ett_wassp); if (ru_msg_type == WASSP_RU_Discov) /* UDP port = 13907, ap discover tlv, decode AP discover header */ { flag = tvb_get_ntohs(tvb, RU_HDR_AC_OP); if ( flag == RU_HDR_CONTAIN_MAC) // ru mac or ac-mode length = RU_HEADER_WITH_MAC_LEN; else length = RU_HEADER_WITHOUT_MAC_LEN; temp = proto_tree_add_item(wassp_tree, hf_ru_discover_header, tvb, RU_HDR_VERSION, length, ENC_NA); ru_discover_header_tree = proto_item_add_subtree(temp, ett_ru_discover_header); proto_tree_add_item(ru_discover_header_tree, hf_wassp_version, tvb, RU_HDR_VERSION, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", %s", (char*)try_val_to_str(ru_msg_type, wassp_header_types)); //Update WASSP protocol with message type proto_tree_add_item(ru_discover_header_tree, hf_wassp_type, tvb, RU_HDR_TYPE, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ru_discover_header_tree, hf_ru_rad_num, tvb, RU_HDR_RAD_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ru_discover_header_tree, hf_wassp_length, tvb, RU_HDR_LENGTH, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ru_discover_header_tree, hf_ru_checksum, tvb, RU_HDR_CHECKSUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ru_discover_header_tree, hf_ru_ac_op, tvb, RU_HDR_AC_OP, 2, ENC_BIG_ENDIAN); if ( flag == RU_HDR_CONTAIN_MAC) // ru mac or ac-mode proto_tree_add_item(ru_discover_header_tree, hf_ru_mac, tvb, RU_HDR_MAC, 6, ENC_NA); else proto_tree_add_item(ru_discover_header_tree, hf_ru_ac_mode, tvb, RU_HDR_AC_MODE, 2, ENC_BIG_ENDIAN); offset = length; } else /* UDP port = 13910, decode Wassp protocol header */ { temp = proto_tree_add_item(wassp_tree, hf_wassp_header, tvb, WASSP_HDR_VERSION, WASSP_HDR_LEN, ENC_NA); wassp_header_tree = proto_item_add_subtree(temp, ett_wassp_header); flag = tvb_get_ntohs(tvb, WASSP_HDR_SEQ_NUM); /* seq_number used 10 bits only */ seq_number = flag >> 6; proto_tree_add_item(wassp_header_tree, hf_wassp_version, tvb, WASSP_HDR_VERSION, 1, ENC_NA); proto_item_append_text(ti, ", %s", (char*)try_val_to_str(ru_msg_type, wassp_header_types)); //Update WASSP protocol with message type proto_tree_add_item(wassp_header_tree, hf_wassp_type, tvb, WASSP_HDR_TYPE, 1, ENC_BIG_ENDIAN); temp = proto_tree_add_item(wassp_header_tree, hf_wassp_seq_num_flag, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); wassp_seq_flag_tree = proto_item_add_subtree(temp, ett_seq_flags); proto_tree_add_item(wassp_seq_flag_tree, hf_seq_num, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wassp_seq_flag_tree, hf_wassp_use_frag, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wassp_seq_flag_tree, hf_wassp_data_frag, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wassp_seq_flag_tree, hf_wassp_more_frag, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wassp_seq_flag_tree, hf_wassp_first_frag, tvb, WASSP_HDR_SEQ_NUM, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wassp_header_tree, hf_wassp_sessionid, tvb, WASSP_HDR_SESSIONID, 2, ENC_BIG_ENDIAN);/* display session id */ proto_tree_add_item(wassp_header_tree, hf_wassp_length, tvb, WASSP_HDR_PLENGTH, 2, ENC_BIG_ENDIAN); if ( flag & RU_WASSP_FLAGS_USE_FRAGMENTATION) { fragment = TRUE; complete = FALSE; } offset = WASSP_HDR_LEN; } if (fragment) /* fragmented */ { pinfo->fragmented = TRUE; offset = WASSP_HDR_LEN; conv = find_conversation_pinfo(pinfo, 0); DISSECTOR_ASSERT(conv); reassembly_id = (((conv->conv_index) & 0x00FFFFFF) << 8) + ru_msg_type; wassp_frag_msg = fragment_add_seq_next(&wassp_reassembled_table, tvb, offset, pinfo, reassembly_id, NULL, remain_len - WASSP_HDR_LEN, flag & RU_WASSP_FLAGS_MORE_FRAGMENTS_FOLLOWING); if ( wassp_frag_msg ) combined_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled Wassp", wassp_frag_msg, &wassp_frag_items, NULL, wassp_tree); if ( combined_tvb) { col_append_str(pinfo->cinfo, COL_INFO, " (Message Reassembled)"); next_tvb = combined_tvb; complete = TRUE; offset = 0; } else { col_append_fstr(pinfo->cinfo, COL_INFO, " (Message fragment %u)", seq_number); next_tvb = tvb_new_subset_length_caplen(tvb, WASSP_HDR_LEN, -1, -1); } } if (complete) dissect_unfragmented_wassp(next_tvb, pinfo, wassp_tree, remain_len, ru_msg_type, offset); pinfo->fragmented = save_fragmented; return 1; } /* Register WASSP protocol */ void proto_register_wassp(void) { static hf_register_info hf[] = { { &hf_aeroscout_header, { "Location Base Service Header", "wassp.aeroscout.header", FT_BYTES, BASE_NONE, NULL, 0x0, "Aeroscout header", HFILL } }, { &hf_aeroscout_header_magic_number, { "Header Magic Number", "wassp.aeroscout.header_magic", FT_UINT16, BASE_HEX, NULL, 0x0, "Aeroscout header magic number", HFILL } }, { &hf_aeroscout_request_id, { "Request ID", "wassp.aeroscout.request_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Aeroscout Request ID", HFILL } }, { &hf_aeroscout_code, { "Operation Code", "wassp.aeroscout.code", FT_UINT8, BASE_DEC, NULL, 0x0, "Aeroscout Operation Code", HFILL } }, { &hf_aeroscout_sub_code, { "Operation Sub Code", "wassp.aeroscout.sub_code", FT_UINT8, BASE_DEC, NULL, 0x0, "Aeroscout Operation Sub Code", HFILL } }, { &hf_aeroscout_datalength, { "Length of Data Payload", "wassp.aeroscout.datalength", FT_UINT16, BASE_DEC, NULL, 0x0, "Aeroscout Length of Data Payload", HFILL } }, { &hf_lbs_vendor_id, { "Location Base Service Vendor ID", "wassp.lbs.vendor_id", FT_UINT16, BASE_DEC, NULL, 0x0, "LBS TAG Vendor ID", HFILL } }, { &hf_lbs_rsvd1, { "LBS Rsvd", "wassp.lbs.rsvd1", FT_UINT16, BASE_HEX, NULL, 0x0, "LBS TAG rsvd", HFILL } }, { &hf_lbs_ap_bssid, { "Location Base Service AccessPoint BSSID", "wassp.lbs.ap_bssid", FT_BYTES, BASE_NONE, NULL, 0x0, "LBS TAG ap bssid", HFILL } }, { &hf_lbs_rsvd2, { "LBS Rsvd", "wassp.lbs.rsvd2", FT_UINT8, BASE_HEX, NULL, 0x0, "LBS TAG rsvd2", HFILL } }, { &hf_lbs_rxchan, { "LBS rxchan", "wassp.lbs.rxchan", FT_UINT8, BASE_DEC, NULL, 0x0, "LBS TAG rxchan", HFILL } }, { &hf_lsb_tstamp, { "Location Base Service Time Stamp", "wassp.lbs.tstamp", FT_UINT32, BASE_DEC, NULL, 0x0, "LBS TAG tstamp", HFILL } }, { &hf_hf_lsb_rsvd3, { "LBS Rsvd", "wassp.lbs.rsvd3", FT_UINT16, BASE_HEX, NULL, 0x0, "LBS TAG rsvd3", HFILL } }, { &hf_lsb_rssi, { "Location Base Service RSSI", "wassp.lbs.rssi", FT_INT8, BASE_DEC, NULL, 0x0, "LBS TAG rssi", HFILL } }, { &hf_lsb_rsvd, { "LBS Rsvd", "wassp.lbs.rsvd", FT_UINT8, BASE_HEX, NULL, 0x0, "LBS TAG rsvd4", HFILL } }, { &hf_lsb_noise_floor, { "LBS Noise Floor", "wassp.lsb.noise_floor", FT_INT8, BASE_DEC, NULL, 0x0, "LBS TAG noise floor", HFILL } }, { &hf_lsb_rsvd4, { "LBS Rsvd", "wassp.lsb.rsvd4", FT_UINT24, BASE_HEX, NULL, 0x0, "LBS TAG rsvd5", HFILL } }, { &hf_lsb_chan_rate, { "LBS channel Rate", "wassp.lsb.chan_rate", FT_UINT8, BASE_DEC, NULL, 0x0, "LBS TAG channel rate", HFILL } }, { &hf_lsb_rsvd5, { "LBS Rsvd", "wassp.lsb.rsvd5", FT_UINT8, BASE_HEX, NULL, 0x0, "LBS TAG rsvd6", HFILL } }, { &hf_lsb_wh_fc, { "LBS Wireless Header Frame Control", "wassp.lsb.wh_fc", FT_UINT16, BASE_HEX, NULL, 0x0, "LBS TAG Frame Control", HFILL } }, { &hf_lsb_wh_seq, { "LBS Wireless Header Sequence Number", "wassp.hf_lsb_wh_seq", FT_UINT16, BASE_HEX, NULL, 0x0, "LBS TAG Sequence Number", HFILL } }, { &hf_lsb_rsvd6, { "LBS Rsvd", "wassp.lsb.rsvd6", FT_UINT16, BASE_HEX, NULL, 0x0, "LBS TAG rsvd7", HFILL } }, { &hf_lsb_wh_addr2, { "MAC address2", "wassp.data.mu_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "Mobile Unit Ethernet address", HFILL } }, { &hf_lsb_wh_addr3, { "MAC address3", "wassp.data.mu_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "Mobile Unit Ethernet address", HFILL } }, { &hf_lsb_wh_addr4, { "MAC address4", "wassp.data.mu_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "Mobile Unit Ethernet address", HFILL } }, { &hf_wassp_version, { "Version", "wassp.version", FT_UINT8, BASE_DEC, NULL, 0x0, "Wassp Protocol Version", HFILL } }, /* ru discover header */ { &hf_ru_rad_num, { "RU Random Number", "wassp.ru_xid", FT_UINT16, BASE_DEC, NULL, 0x0, "random number for checking the session", HFILL } }, { &hf_ru_checksum, { "RU Messages Checksum", "wassp.ru_checksum", FT_UINT16, BASE_DEC, NULL, 0x0, "AccessPoint messages checksum", HFILL } }, { &hf_ru_ac_op, { "Controller Operation", "wassp.ru_ac_op", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ru_ac_mode, { "Controller Operation Mode", "wassp.ru_ac_mode", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ru_mac, { "AP MAC address", "wassp.ru_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "AP Ethernet address", HFILL } }, { &hf_ru_discover_header, { "RU Discover Header", "wassp.ru.header", FT_BYTES, BASE_NONE, NULL , 0x0, "AccessPoint Discover Header", HFILL } }, { &hf_wassp_header, { "Wassp Header", "wassp.header", FT_BYTES, BASE_NONE, NULL , 0x0, "Wassp Message Header", HFILL } }, { &hf_wassp_type, { "WASSP Type", "wassp.type", FT_UINT8, BASE_DEC, VALS(wassp_header_types), 0x0, "Wassp message type", HFILL } }, { &hf_wassp_seq_num_flag, { "Sequence Number & Flag", "wassp.seq_num_flag", FT_UINT16, BASE_DEC, NULL, 0x0, "Sequence number and flag for multi-message", HFILL } }, { &hf_seq_num, { "Sequence Number", "wassp.seq_num", FT_UINT16, BASE_DEC, NULL, 0xffc0, "Sequence number for multi-message", HFILL } }, { &hf_wassp_use_frag, { "Wassp Use Fragmentation", "wassp.use_frag", FT_BOOLEAN, 6, NULL, 0x8, "Wassp Packet Use Fragmentation", HFILL } }, { &hf_wassp_data_frag, { "Wassp Data Fragmentation", "wassp.data_frag", FT_BOOLEAN, 6, NULL, 0x2, "Data Fragmentation", HFILL } }, { &hf_wassp_more_frag, { "Fragments following", "wassp.following_frag", FT_BOOLEAN, 6, NULL, 0x1, "Wassp Fragments following", HFILL } }, { &hf_wassp_first_frag, { "Not First fragment packet", "wassp.no_first_frag", FT_BOOLEAN, 6, NULL, 0x4, "Wassp Not First Fragment Packet", HFILL } }, { &hf_wassp_sessionid, { "Session ID", "wassp.session_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Concentrator Session ID", HFILL } }, { &hf_wassp_length, { "Length", "wassp.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of Payload", HFILL } }, /* wassp MU data --- start */ { &hf_wassp_mu_data_tree, { "WASSP MU Data tree", "wassp.mu.data.subtree", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wassp_mu_data_header, { "Wassp MU Data Header", "wassp.mu_data_header", FT_BYTES, BASE_NONE, NULL, 0x0, "MU Data Header", HFILL } }, { &hf_wassp_mu_type, { "Type", "wassp.data.mu_type", FT_UINT8, BASE_DEC, NULL, 0x0, "Wassp MU message type", HFILL } }, { &hf_wassp_mu_qos, { "QOS", "wassp.data.mu_qos", FT_UINT8, BASE_DEC, NULL, 0x0, "Quality of Service identifier", HFILL } }, { &hf_wassp_mu_action_ssid, { "Action & SSID/Vlan ID", "wassp.data.mu_action_ssid", FT_UINT16, BASE_DEC, NULL, 0x0, "Action and where device is currently registered", HFILL } }, { &hf_wassp_mu_action, { "Action", "wassp.data.mu_action", FT_UINT16, BASE_HEX, VALS(mu_action_field_strings), 0xf000, "Notify what kind of action", HFILL } }, { &hf_wassp_mu_action_field_value, { "SSID/Vlan ID", "wassp.data.mu_action_field_value", FT_UINT16, BASE_DEC, NULL, 0x0fff, "SSID value or VlanID value", HFILL } }, { &hf_wassp_mu_resv0, { "Reserved0", "wassp.data.mu_resv0", FT_UINT16, BASE_HEX, VALS(mu_resv0_strings), 0x0, "MU data Reserved0 or Flag", HFILL } }, { &hf_wassp_mu_resv1, { "Reserved1", "wassp.data.mu_resv1", FT_UINT16, BASE_DEC, NULL, 0x0, "MU data Reserved 1", HFILL } }, { &hf_wassp_mu_assoc_status, { "Association Status", "wassp.data.mu_assoc_status", FT_UINT8, BASE_CUSTOM, CF_FUNC(mu_association_status), 0x0, "MU Association Status", HFILL } }, { &hf_wassp_mu_mac, { "MAC address", "wassp.data.mu_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "Mobile Unit Ethernet address", HFILL } }, /* netflow */ { &hf_wassp_mu_netflow_tree, { "WASSP MU Data NetFlow Tree", "wassp.mu.data.netflow.subtree", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wassp_mu_netflow_header, { "Wassp MU Data NetFlow Header", "wassp.mu_data_netflow_header", FT_BYTES, BASE_NONE, NULL, 0x0, "MU Data NetFlow Header", HFILL } }, { &hf_wassp_mu_netflow_version, { "Version", "wassp.data.mu_netflow_version", FT_UINT16, BASE_DEC, NULL, 0x0, "MU NetFlow Version", HFILL } }, { &hf_wassp_mu_netflow_length, { "Length", "wassp.data.mu_netflow_length", FT_UINT16, BASE_DEC, NULL, 0x0, "MU NetFlow Length", HFILL } }, { &hf_wassp_mu_netflow_flags, { "Flag", "wassp.data.mu_netflow_flag", FT_UINT16, BASE_HEX, NULL, 0x0, "MU NetFlow Flag", HFILL } }, { &hf_wassp_mu_netflow_uptime, { "UpTime", "wassp.data.mu_netflow_uptime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "MU NetFlow Up Time", HFILL } }, { &hf_wassp_mu_netflow_record, { "Record", "wassp.data.mu_netflow_record", FT_BYTES, BASE_NONE, NULL, 0x0, "MU NetFlow Record", HFILL } }, { &hf_wassp_mu_netflow_in_bytes, { "InBytes", "wassp.data.mu_netflow_inbytes", FT_UINT32, BASE_DEC, NULL, 0x0, "MU NetFlow In Bytes", HFILL } }, { &hf_wassp_mu_netflow_in_packets, { "InPackets", "wassp.data.mu_netflow_inpackets", FT_UINT32, BASE_DEC, NULL, 0x0, "MU NetFlow In Packets", HFILL } }, { &hf_wassp_mu_netflow_ip_protocol_number, { "Protocol", "wassp.data.mu_netflow_protocol", FT_UINT8, BASE_DEC, NULL, 0x0, "MU NetFlow IP Protocol", HFILL } }, { &hf_wassp_mu_netflow_source_tos, { "Source TOS", "wassp.data.mu_netflow_tos", FT_UINT8, BASE_HEX, NULL, 0x0, "MU NetFlow Source TOS", HFILL } }, { &hf_wassp_mu_netflow_source_port, { "Source Port", "wassp.data.mu_netflow_source_port", FT_INT16, BASE_DEC, NULL, 0x0, "MU NetFlow Source Port", HFILL } }, { &hf_wassp_mu_netflow_source_ip, { "IP", "wassp.data.mu_netflow_source_ip", FT_IPv4, BASE_NONE, NULL, 0x0, "MU NetFlow Source IP", HFILL } }, { &hf_wassp_mu_netflow_input_snmp, { "In SNMP", "wassp.data.mu_netflow_in_snmp", FT_UINT16, BASE_DEC, NULL, 0x0, "MU NetFlow In Snmp", HFILL } }, { &hf_wassp_mu_netflow_dest_port, { "Dest Port", "wassp.data.mu_netflow_dest_port", FT_INT16, BASE_DEC, NULL, 0x0, "MU NetFlow Dest Port", HFILL } }, { &hf_wassp_mu_netflow_dest_ip, { "Dest IP", "wassp.data.mu_netflow_dest_ip", FT_IPv4, BASE_NONE, NULL, 0x0, "MU NetFlow Dest IP", HFILL } }, { &hf_wassp_mu_netflow_output_snmp, { "Out SNMP", "wassp.data.mu_netflow_out_snmp", FT_UINT16, BASE_DEC, NULL, 0x0, "MU NetFlow Out Snmp", HFILL } }, { &hf_wassp_mu_netflow_last_time, { "Last Time", "wassp.data.mu_netflow_last_time", FT_UINT32, BASE_DEC, NULL, 0x0, "MU NetFlow Last Time", HFILL } }, { &hf_wassp_mu_netflow_first_time, { "First Time", "wassp.data.mu_netflow_first_time", FT_UINT32, BASE_DEC, NULL, 0x0, "MU NetFlow First Time", HFILL } }, { &hf_wassp_mu_netflow_in_source_mac, { "Source Mac", "wassp.data.mu_netflow_source_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "MU NetFlow Source MAC Address", HFILL } }, { &hf_wassp_mu_netflow_in_dest_mac, { "Dest Mac", "wassp.data.mu_netflow_dest_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "MU NetFlow Dest MAC Address", HFILL } }, /* wassp TLV */ { &hf_wassp_tlv_value, { "Wassp TLV", "wassp.tlv.value", FT_NONE, BASE_NONE, NULL, 0x0, "Wassp TLV in hexadecimal", HFILL } }, { &hf_wassp_tlv_type_main, { "Type", "wassp.tlv.type", FT_UINT16, BASE_DEC, VALS(wassp_tlv_types), 0x0, "Wassp TLV type", HFILL } }, { &hf_wassp_tlv_type_sub, { "Type", "wassp.tlv.type", FT_NONE, BASE_NONE, NULL, 0x0, "Wassp TLV type", HFILL } }, { &hf_wassp_tlv_length, { "Length", "wassp.tlv.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Wassp TLV length", HFILL } }, { &hf_wassp_tlv_value_octext, { "value", "wassp.tlv.value_octext", FT_BYTES, BASE_NONE, NULL, 0x0, "Wassp TLV Value in hexadecimal", HFILL } }, { &hf_wassp_tlv_value_string, { "Value", "wassp.tlv.valuestr", FT_STRING, BASE_NONE, NULL, 0x0, "Wassp TLV Value in string format", HFILL } }, { &hf_wassp_tlv_value_ip, { "Value", "wassp.tlv.valueip", FT_IPv4, BASE_NONE, NULL, 0x0, "Wassp TLV Value in IP format", HFILL } }, { &hf_wassp_tlv_value_int, { "Value", "wassp.tlv.valueint", FT_UINT8, BASE_DEC, NULL, 0x0, "Wassp TLV Value in an integer", HFILL } }, { &hf_wassp_tlv_eid_status, { "Status", "wassp.tlv.eid.status", FT_UINT32, BASE_DEC, VALS(wassp_eid_status_types), 0x0, "Explicit indication of request's status", HFILL } }, { &hf_wassp_tlv_eid_action, { "action", "wassp.tlv.eid.action", FT_UINT32, BASE_DEC, VALS(wassp_eid_action_types), 0x0, "upgrade action request", HFILL } }, { &hf_wassp_tlv_eid_rustate, { "RU State", "wassp.tlv.eid.rustate", FT_BOOLEAN, FT_UINT8, TFS(&wassp_eid_rustate_types), 0x0, "Remote Unit State", HFILL } }, { &hf_wassp_ipaddress, { "IPv4 address", "wassp.ipaddress", FT_IPv4, BASE_NONE, NULL, 0x0, "IPv4 IP address", HFILL } }, /* fragmentation */ { &hf_wassp_fragment_overlap, { "Fragment overlap", "wassp.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL } }, { &hf_wassp_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "wassp.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL } }, { &hf_wassp_fragment_multiple_tails, { "Multiple tail fragments found", "wassp.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL } }, { &hf_wassp_fragment_too_long_fragment, { "Fragment too long", "wassp.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL } }, { &hf_wassp_fragment_error, { "Defragmentation error", "wassp.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL } }, { &hf_wassp_fragment, { "WASSP Fragment", "wassp.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "wassp Fragmented", HFILL } }, { &hf_wassp_fragments, { "WASSP Fragments", "wassp.fragments", FT_NONE, BASE_NONE, NULL, 0x0, "wassp more Fragments", HFILL } }, { &hf_wassp_fragment_count, { "WASSP Fragment count", "wassp.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, "Fragment Count", HFILL } }, { &hf_wassp_reassembled_in, { "Reassembled WASSP in frame", "wassp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This WASSP frame is reassembled in this frame", HFILL } }, { &hf_wassp_reassembled_length, { "Reassembled WASSP length", "wassp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL } }, { &hf_wassp_sub_tree, { "WASSP Sub TLV Block", "wassp.subtree", FT_NONE, BASE_NONE, NULL, 0x0, "WASSP sub tree", HFILL } }, { &hf_wassp_tlv_unknown, { "WASSP unknown tlv", "wassp.tlv.unknown", FT_UINT32, BASE_DEC, NULL, 0x0, "Unknown tlv", HFILL } }, { &hf_wassp_tlv_invalid, { "WASSP invalid tlv", "wassp.tlv.invalid", FT_UINT32, BASE_DEC, NULL, 0x0, "Invalid tlv", HFILL } }, { &hf_wassp_topologykey, { "Topology Key", "wassp.topology_key", FT_UINT16, BASE_DEC, NULL, 0x0, "Topology ID", HFILL } }, { &hf_wassp_vlanid, { "Vlan ID", "wassp.vlan_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Vlan Number", HFILL } }, { &hf_wassp_topology_mode, { "Topology Mode", "wassp.topology_mode", FT_UINT16,BASE_CUSTOM, CF_FUNC(topology_moder_print), 0x0, "Wassp Topology Mode", HFILL } }, { &hf_wassp_in_cir, { "Committed Information Rate(In direction)", "wassp.in_cir", FT_UINT16, BASE_DEC, NULL, 0x0, "Committed Information Rate", HFILL } }, { &hf_wassp_out_cir, { "Committed Information Rate(out direction)", "wassp.out_cir", FT_UINT16, BASE_DEC, NULL, 0x0, "Committed Information Rate", HFILL } }, { &hf_wassp_flag_1b, { "Flag (1 byte)", "wassp.flag.1b", FT_UINT8, BASE_HEX, NULL, 0x0, "Flag", HFILL } }, { &hf_wassp_tos, { "Type of Service", "wassp.tos", FT_UINT8, BASE_HEX, NULL, 0x0, "Tos", HFILL } }, { &hf_cos_tos, { "COS Tos", "wassp.cos_tos", FT_UINT8, BASE_HEX, NULL, 0x00, "Tos", HFILL } }, { &hf_wassp_tos_mask, { "Type of Service Mask", "wassp.tos.mask", FT_UINT8, BASE_HEX, NULL, 0x0, "ToS Mask", HFILL } }, { &hf_cos_tos_mask, { "Class of Service ToS Mask", "wassp.cos_tos.mask", FT_UINT8, BASE_HEX, NULL, 0x0, "Cos Tos Mask", HFILL } }, { &hf_filter_tos_maskbit_priority, { "Mask bit and Priority", "wassp.mask_bit", FT_UINT8, BASE_CUSTOM, CF_FUNC(maskbit_priority_print), 0xff, "Mask bit", HFILL } }, { &hf_wassp_priority, { "Priority bit", "wassp.priority", FT_BOOLEAN, 8, NULL, 0xff, "Priority", HFILL } }, { &hf_cos_priority_txq, { "COS Priority and TxQ", "wassp.cos_priority_txq", FT_UINT8, BASE_CUSTOM, CF_FUNC(cos_priority_txq_print), 0x0, "Cos Priority and Transmit Queue", HFILL } }, { &hf_cos_rateid, { "COS In&Out Rate Id", "wassp.rate_id", FT_UINT8, BASE_CUSTOM, CF_FUNC(cos_rate_id_print), 0x0, "Cos In&Out Rate Id", HFILL } }, { &hf_wassp_filter_rule, { "WASSP Filter Rule", "wassp.filter.rule", FT_BYTES, BASE_NONE, NULL, 0x0, "Filter Rule", HFILL } }, { &hf_wassp_filter_flag, { "WASSP Filter Flag", "wassp.filter.flag", FT_UINT32, BASE_HEX, NULL, 0x0, "Filter Flag", HFILL } }, { &hf_filter_rule_port_range, { "TCP/UDP Port range", "wassp.port", FT_UINT32, BASE_CUSTOM, CF_FUNC(port_range_print), 0x0, "WASSP TCP/UDP Port", HFILL } }, { &hf_wassp_ipprotocol, { "IP Protocol", "wassp.ip_protocol", FT_UINT8, BASE_DEC, NULL, 0x0, "WASSP IP Protocol", HFILL } }, { &hf_wassp_netmasklength, { "Netmask Length Bit", "wassp.netmask_length", FT_UINT8, BASE_DEC, NULL, 0x0, "WASSP Netmask Length Bit", HFILL } }, { &hf_wassp_macaddr, { "MAC address", "wassp.mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, "WASSP MAC address", HFILL } }, { &hf_wassp_macaddr_mask, { "MAC address mask", "wassp.mac_address.mask", FT_ETHER, BASE_NONE, NULL, 0x0, "MAC mask", HFILL } }, { &hf_wassp_ethernet_type, { "Ethernet Type", "wassp.ethernet_type", FT_UINT16, BASE_HEX, NULL, 0x0, "Ethernet Type Field", HFILL } }, { &hf_wassp_reserve, { "Reserve", "wassp.reserve", FT_UINT16, BASE_DEC, NULL, 0x0, "Reserve value", HFILL } }, { &hf_wassp_freq, { "Freq in MHz", "wassp.freq", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP Freq", HFILL } }, { &hf_wassp_rss, { "RSS", "wassp.rss", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP RSS", HFILL } }, { &hf_wassp_rssi, { "RSSI", "wassp.rssi", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP RSSI", HFILL } }, { &hf_wassp_threatstate, { "WASSP Threat State", "wassp.threat_state", FT_UINT8, BASE_HEX, VALS(threat_state_strings), 0x0, "WASSP Threat State (NA/Active/Inactive)", HFILL } }, { &hf_wassp_radioparams, { "Radio Params QOS", "wassp.radio_params", FT_UINT8, BASE_HEX, VALS(radio_params_strings), 0x0, "WASSP Radio Params QOS", HFILL } }, { &hf_wassp_channelfreq, { "Channel Frequency", "wassp.channel_freq", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP Channel Frequency", HFILL } }, { &hf_wassp_mu, { "Total Mu", "wassp.mu", FT_UINT32, BASE_DEC, NULL, 0x0, "WASSP Total Mu", HFILL } }, { &hf_wassp_apprules, { "Number of Application Rules", "wassp.num_apprules", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP number of app rules", HFILL } }, { &hf_wassp_displayid, { "Display ID", "wassp.display_id", FT_UINT16, BASE_DEC, NULL, 0x0, "WASSP display ID", HFILL } }, { &hf_wassp_txbytes, { "Tx Bytes", "wassp.tx_bytes", FT_UINT32, BASE_DEC, NULL, 0x0, "WASSP Tx Bytes", HFILL } }, { &hf_wassp_rxbytes, { "Rx Bytes", "wassp.rx_bytes", FT_UINT32, BASE_DEC, NULL, 0x0, "WASSP Rx Bytes", HFILL } }, }; static gint * ett[] = { &ett_wassp, &ett_wassp_tlv, &ett_wassp_filter_rule, &ett_lbs_header, &ett_wassp_mu_appl_stats, &ett_wassp_header, &ett_ru_discover_header, &ett_mu_data_header, &ett_mu_action_field, &ett_wassp_data, &ett_wassp_mu_data_netflow, &ett_wassp_mu_data_netflow_header, &ett_seq_flags, &ett_wassp_tlv_missing, &ett_wassp_ap_stats_block, &ett_wassp_mu_rf_stats_block, &ett_wassp_config_error_block, &ett_wassp_config_modified_block, &ett_wassp_global_config_block, &ett_wassp_radio_config_block, &ett_wassp_vns_config_block, &ett_wassp_mu_stats_block, &ett_wassp_radio_stats_block, &ett_wassp_ether_stats_block, &ett_wassp_wds_stats_block, &ett_wassp_dot1x_stats_block, &ett_wassp_fragment, &ett_wassp_fragments, &ett_wassp_filter_config_block, &ett_wassp_filter_ext_config_block, &ett_wassp_site_filter_config_block, &ett_wassp_vns_stats_block, &ett_wassp_radius_server_config_block, &ett_wassp_site_config_block, &ett_wassp_policy_config_block, &ett_wassp_cos_config_block, &ett_wassp_localbase_lookup_block, &ett_wassp_radius_config_block, &ett_wassp_eid_main_tlv_block, &ett_wassp_app_policy_fixed_block, &ett_wassp_app_policy_entry_block, &ett_wassp_s_topo_m_filter_entry_block, &ett_wassp_s_topo_m_filter_ext_entry_block, &ett_wassp_11u_config_entry_block, &ett_wassp_hs2_config_entry_block, &ett_wassp_extapp_config_entry_block, }; /* Register wassp protocol */ proto_wassp = proto_register_protocol("Wireless Access Station Session Protocol", "WASSP", "wassp"); /* Register wassp protocol fields */ proto_register_field_array(proto_wassp, hf, array_length(hf)); /* Register wassp protocol sub-trees */ proto_register_subtree_array(ett, array_length(ett)); wassp_dissector_table = register_dissector_table("wassp.subd", "WASSP subdissectors", proto_wassp, FT_UINT16, BASE_DEC); register_init_routine(&wassp_defragment_init); } static gboolean test_wassp(tvbuff_t *tvb) { /* Minimum of 8 bytes, first byte (version) has value of 3 */ if (tvb_captured_length(tvb) < 8 || tvb_get_guint8(tvb, 0) != 3 /* || tvb_get_guint8(tvb, 2) != 0 || tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */ ) { return FALSE; } return TRUE; } static gboolean dissect_wassp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!test_wassp(tvb)) { return FALSE; } dissect_wassp(tvb, pinfo, tree); return TRUE; } static int dissect_wassp_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!test_wassp(tvb)) { return 0; } return dissect_wassp(tvb, pinfo, tree); } /* The registration hand-off routing for WASSP */ void proto_reg_handoff_wassp(void) { dissector_handle_t wassp_handle; wassp_handle = create_dissector_handle(dissect_wassp_static, proto_wassp); dissector_add_uint_range_with_preference("udp.port", PORT_WASSP_RANGE, wassp_handle); heur_dissector_add("udp", dissect_wassp_heur, "WASSP over UDP", "wassp_udp", proto_wassp, HEURISTIC_DISABLE); snmp_handle = find_dissector_add_dependency("snmp", proto_wassp); ieee80211_handle = find_dissector_add_dependency("wlan_withoutfcs", proto_wassp); eth_handle = find_dissector("eth_withoutfcs"); data_handle = find_dissector("data"); ip_handle = find_dissector("ip"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-waveagent.c
/* packet-waveagent.c * Routines for WaveAgent dissection * Copyright 2009-2011, Tom Cook <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #define ETHERNET_INTERFACE 1 #define WLAN_INTERFACE 2 #define IPV4_TYPE 2 #define IPV6_TYPE 10 #define NUM_STATE_CHANGES 8 #define NUM_BSS 8 #define SHORT_STR 256 #define WA_V2_PAYLOAD_OFFSET 40 #define WA_V3_PAYLOAD_OFFSET 44 void proto_register_waveagent(void); void proto_reg_handoff_waveagent(void); /* Initialize the protocol and registered fields */ static int proto_waveagent = -1; static int hf_waveagent_controlword = -1; static int hf_waveagent_payloadlen = -1; static int hf_waveagent_transnum = -1; static int hf_waveagent_rtoken = -1; static int hf_waveagent_flowid = -1; static int hf_waveagent_capstatus = -1; static int hf_waveagent_protocolversion = -1; static int hf_waveagent_capimpl = -1; static int hf_waveagent_id = -1; static int hf_waveagent_bindtag = -1; static int hf_waveagent_version = -1; static int hf_waveagent_brokerip = -1; static int hf_waveagent_brokerport = -1; static int hf_waveagent_bindlevel = -1; static int hf_waveagent_bindport = -1; static int hf_waveagent_numinterfaces = -1; static int hf_waveagent_capabilities2 = -1; static int hf_waveagent_ifmask = -1; static int hf_waveagent_commandstatus = -1; static int hf_waveagent_syserrno = -1; static int hf_waveagent_statusstring = -1; static int hf_waveagent_rxdatapckts = -1; static int hf_waveagent_rxdatabytes = -1; static int hf_waveagent_rxpcktrate = -1; static int hf_waveagent_rxbyterate = -1; static int hf_waveagent_txdatapckts = -1; static int hf_waveagent_txdatabytes = -1; static int hf_waveagent_txpcktrate = -1; static int hf_waveagent_txbyterate = -1; static int hf_waveagent_looppckts = -1; static int hf_waveagent_loopbytes = -1; static int hf_waveagent_rxctlpckts = -1; static int hf_waveagent_rxctlbytes = -1; static int hf_waveagent_txctlpckts = -1; static int hf_waveagent_txctlbytes = -1; static int hf_waveagent_unknowncmds = -1; static int hf_waveagent_snap = -1; static int hf_waveagent_state = -1; static int hf_waveagent_appstate = -1; static int hf_waveagent_rx1pl = -1; static int hf_waveagent_rx2pl = -1; static int hf_waveagent_rx3pl = -1; static int hf_waveagent_rx4pl = -1; static int hf_waveagent_rx5pl = -1; static int hf_waveagent_rxoospkts = -1; /* static int hf_waveagent_rxmeanlatency = -1; */ /* static int hf_waveagent_rxminlatency = -1; */ /* static int hf_waveagent_rxmaxlatency = -1; */ static int hf_waveagent_latencysum = -1; static int hf_waveagent_latencycount = -1; static int hf_waveagent_txflowstop = -1; static int hf_waveagent_jitter = -1; static int hf_waveagent_remoteport = -1; static int hf_waveagent_remoteaddr = -1; static int hf_waveagent_dscp = -1; static int hf_waveagent_fsflags = -1; static int hf_waveagent_fscbrflag = -1; static int hf_waveagent_fscombinedsetupflag = -1; /* static int hf_waveagent_totalbytes = -1; */ static int hf_waveagent_payfill = -1; static int hf_waveagent_paysize = -1; static int hf_waveagent_avgrate = -1; static int hf_waveagent_rxflownum = -1; static int hf_waveagent_mode = -1; static int hf_waveagent_endpointtype = -1; static int hf_waveagent_totalframes = -1; static int hf_waveagent_bssidstartindex = -1; static int hf_waveagent_bssidstopindex = -1; static int hf_waveagent_ifindex = -1; static int hf_waveagent_iftype = -1; static int hf_waveagent_ifdescription = -1; static int hf_waveagent_ifmacaddr = -1; static int hf_waveagent_iflinkspeed = -1; static int hf_waveagent_ifdhcp = -1; static int hf_waveagent_ifwlanbssid = -1; static int hf_waveagent_ifwlanssid = -1; static int hf_waveagent_ifiptype = -1; static int hf_waveagent_ifipv4 = -1; static int hf_waveagent_ifipv6 = -1; static int hf_waveagent_ifdhcpserver = -1; static int hf_waveagent_ifgateway = -1; static int hf_waveagent_ifdnsserver = -1; static int hf_waveagent_ifethl2status = -1; static int hf_waveagent_ifwlanl2status = -1; static int hf_waveagent_ifl3status = -1; static int hf_waveagent_totalbssid = -1; static int hf_waveagent_returnedbssid = -1; static int hf_waveagent_scanbssid = -1; static int hf_waveagent_scanssid = -1; static int hf_waveagent_ifwlanrssi = -1; static int hf_waveagent_ifwlansupprates = -1; static int hf_waveagent_ifwlancapabilities = -1; static int hf_waveagent_ifwlanchannel = -1; static int hf_waveagent_ifwlanprivacy = -1; static int hf_waveagent_ifwlanbssmode = -1; static int hf_waveagent_ifwlannoise = -1; static int hf_waveagent_ifphytypes = -1; static int hf_waveagent_ifphytypebit0 = -1; static int hf_waveagent_ifphytypebit1 = -1; static int hf_waveagent_ifphytypebit2 = -1; static int hf_waveagent_ifphytypebit3 = -1; /* static int hf_waveagent_ifphytypebit4 = -1; */ static int hf_waveagent_ifwlanauthentication = -1; static int hf_waveagent_ifwlancipher = -1; static int hf_waveagent_delayfactor = -1; static int hf_waveagent_medialossrate = -1; static int hf_waveagent_txstartts = -1; static int hf_waveagent_txendts = -1; static int hf_waveagent_rxstartts = -1; static int hf_waveagent_rxendts = -1; static int hf_waveagent_oidcode = -1; static int hf_waveagent_oidvalue = -1; static int hf_waveagent_destip = -1; static int hf_waveagent_destport = -1; static int hf_waveagent_connectflags = -1; static int hf_waveagent_connecttype = -1; static int hf_waveagent_minrssi = -1; static int hf_waveagent_connecttimeout = -1; static int hf_waveagent_connectattempts = -1; static int hf_waveagent_reason = -1; static int hf_waveagent_sigsequencenum = -1; static int hf_waveagent_relaydestid = -1; static int hf_waveagent_relaysrcid = -1; static int hf_waveagent_relaymessagest = -1; /* Initialize the subtree pointers */ static gint ett_waveagent = -1; static gint ett_statechange = -1; static gint ett_phytypes = -1; static gint ett_fsflags = -1; static gint ett_scindex[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; /* NUM_STATE_CHANGES */ static gint ett_bss[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; /* NUM_BSS */ static gint ett_relaymessage = -1; static const value_string control_words[] = { { 0x01, "Receive, Count, Discard"}, { 0x02, "Receive, Count, Loopback"}, { 0x03, "Receive, Count, Push timestamp, Discard"}, { 0x04, "Receive, Count, Push timestamp, Loopback"}, { 0x08, "Transmit"}, { 0x11, "Start Flow"}, { 0x12, "Stop Flow"}, { 0x20, "Stats Reset"}, { 0x21, "Stats Request"}, { 0x22, "Flow Stats Reset"}, { 0x23, "Scan Results Request"}, { 0x24, "Interface Info Request"}, { 0x25, "Interface Change Info Request"}, { 0x26, "OID Request"}, { 0x2e, "Scan Results Response"}, { 0x2f, "Stats Response"}, { 0x30, "Interface Info Response"}, { 0x31, "Interface Change Info Response"}, { 0x32, "OID Response"}, /* XXX: is this correct ? entry originally located after 0x41 */ { 0x3e, "Relay Message"}, { 0x3f, "Relay Response"}, { 0x40, "Client Connect Request"}, { 0x41, "Client Disconnect Request"}, { 0x80, "Capabilities Request"}, { 0x81, "Capabilities Response"}, { 0x82, "Reserve Request"}, { 0x84, "Release Request"}, { 0x85, "Flow Setup"}, { 0x86, "Flow Destroy"}, { 0x87, "Flow Connect"}, { 0x88, "Flow Disconnect"}, { 0x89, "Flow Listen"}, { 0x8a, "Scan Request"}, { 0x8b, "Learning Message"}, { 0x8f, "Command Response"}, { 0, NULL}, }; static value_string_ext control_words_ext = VALUE_STRING_EXT_INIT(control_words); /* Dissects the WLAN interface stats structure */ static void dissect_wlan_if_stats(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb) { proto_item *phy_types; proto_tree *phy_types_tree; guint32 phy_types_bitfield, noise_floor; proto_tree_add_item(parent_tree, hf_waveagent_ifwlanbssid, tvb, starting_offset, 6, ENC_NA); /* two bytes of pad go here */ proto_tree_add_item(parent_tree, hf_waveagent_ifwlanssid, tvb, starting_offset + 8, 32, ENC_ASCII); /* 4 byte SSID length field not reported */ proto_tree_add_item(parent_tree, hf_waveagent_ifwlanrssi, tvb, starting_offset + 44, 4, ENC_BIG_ENDIAN); noise_floor = tvb_get_ntohl(tvb, starting_offset + 48); if (noise_floor != 0x7fffffff) { proto_tree_add_item(parent_tree, hf_waveagent_ifwlannoise, tvb, starting_offset + 48, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_int_format_value(parent_tree, hf_waveagent_ifwlannoise, tvb, starting_offset + 48, 4, noise_floor, "Not Reported"); } phy_types_bitfield = tvb_get_ntohl(tvb, starting_offset + 52); phy_types = proto_tree_add_uint(parent_tree, hf_waveagent_ifphytypes, tvb, starting_offset + 52, 4, phy_types_bitfield); phy_types_tree = proto_item_add_subtree(phy_types, ett_phytypes); proto_tree_add_item(phy_types_tree, hf_waveagent_ifphytypebit0, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(phy_types_tree, hf_waveagent_ifphytypebit1, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(phy_types_tree, hf_waveagent_ifphytypebit2, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(phy_types_tree, hf_waveagent_ifphytypebit3, tvb, starting_offset + 55, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifwlanauthentication, tvb, starting_offset + 56, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifwlancipher, tvb, starting_offset + 60, 4, ENC_BIG_ENDIAN); } static void dissect_wa_payload(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb, guint32 control_word, guint8 version) { switch (control_word) { case 0x11: /* Flow start message */ proto_tree_add_item(parent_tree, hf_waveagent_payfill, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_paysize, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_avgrate, tvb, starting_offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_totalframes, tvb, starting_offset+12, 4, ENC_BIG_ENDIAN); break; case 0x23: /* Scan results request */ proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bssidstartindex, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bssidstopindex, tvb, starting_offset+8, 4, ENC_BIG_ENDIAN); break; case 0x24: /* Interface info request */ case 0x25: /* Interface change info request */ case 0x8a: /* Scan request */ proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); break; case 0x26: /* OID request */ proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_oidcode, tvb, starting_offset+4, 4, ENC_BIG_ENDIAN); break; case 0x30: { /* Interface stats response */ guint32 if_type; proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); if_type = tvb_get_ntohl(tvb, starting_offset + 4); proto_tree_add_item(parent_tree, hf_waveagent_iftype, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifdhcp, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifmacaddr, tvb, starting_offset + 12, 6, ENC_NA); /* 2 bytes of pad go here */ proto_tree_add_item(parent_tree, hf_waveagent_iflinkspeed, tvb, starting_offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifdescription, tvb, starting_offset + 24, 128, ENC_ASCII); /* 4 byte length field goes here - skip it */ /* two bytes of pad go here */ /* If we have WLAN interface, then report the following */ if (if_type == WLAN_INTERFACE) dissect_wlan_if_stats(starting_offset + 156, parent_tree, tvb); /* Next come the BindingAddress fields (for each address): 2 bytes: IP type (v4 or v6) 2 bytes: address length 4 bytes: service number (not used) 16 bytes: IP address */ /* for the bound IP address, report both IP type and address */ proto_tree_add_item(parent_tree, hf_waveagent_ifiptype, tvb, starting_offset + 252, 2, ENC_BIG_ENDIAN); if (tvb_get_ntohs(tvb, starting_offset + 252) == IPV4_TYPE) { proto_tree_add_item(parent_tree, hf_waveagent_ifipv4, tvb, starting_offset + 260, 4, ENC_BIG_ENDIAN); /* grab the last 4 bytes of the IP address field */ } else { proto_tree_add_item(parent_tree, hf_waveagent_ifipv6, tvb, starting_offset + 260, 16, ENC_NA); } proto_tree_add_item(parent_tree, hf_waveagent_ifdhcpserver, tvb, starting_offset + 284, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifgateway, tvb, starting_offset + 308, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifdnsserver, tvb, starting_offset + 332, 4, ENC_BIG_ENDIAN); break; } case 0x31: { /* Interface change info response */ guint32 offset; guint32 if_type; guint32 delta; guint32 iLoop; proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); if_type = tvb_get_ntohl(tvb, starting_offset + 4); proto_tree_add_item(parent_tree, hf_waveagent_iftype, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); offset = starting_offset + 8; delta = 156; for (iLoop = 0; iLoop < NUM_STATE_CHANGES; iLoop++) { proto_item *stIndex; proto_tree *st_change_index_tree; guint32 if_status; int current_offset; current_offset = offset + iLoop * delta; /* Check to see if the interface entry is valid */ if_status = tvb_get_ntohl(tvb, current_offset); if (if_status == 0) continue; /* No entry at this index, keep going */ /* Add index specific trees to hide the details */ stIndex = proto_tree_add_uint_format_value(parent_tree, hf_waveagent_ifwlanl2status, tvb, current_offset, 4, if_status, "Interface state change %d", iLoop); st_change_index_tree = proto_item_add_subtree(stIndex, ett_scindex[iLoop]); if (if_type == WLAN_INTERFACE) { proto_tree_add_item(st_change_index_tree, hf_waveagent_ifwlanl2status, tvb, current_offset, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item(st_change_index_tree, hf_waveagent_ifethl2status, tvb, current_offset, 4, ENC_BIG_ENDIAN); } proto_tree_add_item(st_change_index_tree, hf_waveagent_ifl3status, tvb, current_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(st_change_index_tree, hf_waveagent_iflinkspeed, tvb, current_offset + 8, 4, ENC_BIG_ENDIAN); if (if_type == WLAN_INTERFACE) { dissect_wlan_if_stats(current_offset + 12, st_change_index_tree, tvb); } proto_tree_add_item(st_change_index_tree, hf_waveagent_snap, tvb, current_offset + 108, 8, ENC_BIG_ENDIAN); proto_tree_add_item(st_change_index_tree, hf_waveagent_ifiptype, tvb, current_offset + 116, 2, ENC_BIG_ENDIAN); if (tvb_get_ntohs(tvb, current_offset + 116) == IPV4_TYPE) { proto_tree_add_item(st_change_index_tree, hf_waveagent_ifipv4, tvb, current_offset + 124, 4, ENC_BIG_ENDIAN); /* grab the last 4 bytes of the IP address field */ } else { proto_tree_add_item(st_change_index_tree, hf_waveagent_ifipv6, tvb, current_offset + 124, 16, ENC_NA); } /* 16 bytes of padding */ } break; } case 0x32: /* OID response */ proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_oidcode, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_oidvalue, tvb, starting_offset + 12, 1024, ENC_ASCII); break; case 0x2e: { /* scan results response message */ guint32 offset; proto_item *pi; guint32 num_bss_entries; guint32 tag_len; guint32 delta; guint32 iLoop; wmem_strbuf_t *sb; proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_totalbssid, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); pi = proto_tree_add_item(parent_tree, hf_waveagent_returnedbssid, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); num_bss_entries = tvb_get_ntohl(tvb, starting_offset + 8); if (num_bss_entries > NUM_BSS) { proto_item_append_text(pi, " [**Too large: Limiting to " G_STRINGIFY(NUM_BSS) "]"); num_bss_entries = NUM_BSS; } /* Add 4 bytes of pad for the offset */ offset = starting_offset + 16; delta = 148; sb = wmem_strbuf_new_sized(wmem_packet_scope(), 8); for (iLoop = 0; iLoop < num_bss_entries; iLoop++) { proto_item *bssIndex; proto_tree *bss_tree; int current_offset; wmem_strbuf_truncate(sb, 0); current_offset = offset + iLoop * delta; bssIndex = proto_tree_add_item(parent_tree, hf_waveagent_scanssid, tvb, current_offset, 32, ENC_ASCII); bss_tree = proto_item_add_subtree(bssIndex, ett_bss[iLoop]); tag_len = tvb_get_ntohl(tvb, current_offset + 52); if (tag_len != 0) { guint32 isr; guint8 isr_value; for (isr = 0; isr < tag_len; isr++) { isr_value = tvb_get_guint8(tvb, offset + 36 + isr); if (isr_value == 0xFF){ proto_tree_add_string (bss_tree, hf_waveagent_ifwlansupprates, tvb, offset + 36 + isr, 1, "BSS requires support for mandatory features of HT PHY (IEEE 802.11" " - Clause 20)"); } else { wmem_strbuf_append_printf(sb, "%2.1f%s ", (isr_value & 0x7F) * 0.5, (isr_value & 0x80) ? "(B)" : ""); } } wmem_strbuf_append(sb, " [Mbit/sec]"); } else { wmem_strbuf_append(sb, "Not defined"); } proto_tree_add_string (bss_tree, hf_waveagent_ifwlansupprates, tvb, offset + 36, tag_len, wmem_strbuf_get_str(sb)); proto_tree_add_item(bss_tree, hf_waveagent_scanbssid, tvb, current_offset + 56, 6, ENC_NA); proto_tree_add_item(bss_tree, hf_waveagent_ifwlancapabilities, tvb, current_offset + 62, 2, ENC_BIG_ENDIAN); proto_tree_add_item(bss_tree, hf_waveagent_ifwlanrssi, tvb, current_offset + 64, 4, ENC_BIG_ENDIAN); /* For now this is just a 4 byte pad, so comment it out... */ #if 0 proto_tree_add_item(bss_tree, hf_waveagent_ifwlansigquality, tvb, current_offset + 68, 4, ENC_BIG_ENDIAN); #endif proto_tree_add_item(bss_tree, hf_waveagent_ifwlanchannel, tvb, current_offset + 72, 4, ENC_BIG_ENDIAN); proto_tree_add_item(bss_tree, hf_waveagent_ifwlanprivacy, tvb, current_offset + 76, 4, ENC_BIG_ENDIAN); proto_tree_add_item(bss_tree, hf_waveagent_ifwlanbssmode, tvb, current_offset + 80, 4, ENC_BIG_ENDIAN); } break; } case 0x2f: /* Stats response message */ if (version < 3) { /* For version 2 WA protocol the capability status is not in the header but in the CAP RESPONSE. Need to read it here and then advance the payload offset. This is a packet that had a structure change in the beginning of the packet when moving to v3 */ proto_tree_add_item(parent_tree, hf_waveagent_capstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_protocolversion, tvb, starting_offset, 1, ENC_BIG_ENDIAN); starting_offset += 4; } proto_tree_add_item(parent_tree, hf_waveagent_capimpl, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_state, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_appstate, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxdatapckts, tvb, starting_offset + 12, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxdatabytes, tvb, starting_offset + 20, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxpcktrate, tvb, starting_offset + 28, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxbyterate, tvb, starting_offset + 36, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txdatapckts, tvb, starting_offset + 44, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txdatabytes, tvb, starting_offset + 52, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txpcktrate, tvb, starting_offset + 60, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txbyterate, tvb, starting_offset + 68, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_looppckts, tvb, starting_offset + 76, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_loopbytes, tvb, starting_offset + 84, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxctlpckts, tvb, starting_offset + 92, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxctlbytes, tvb, starting_offset + 100, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txctlpckts, tvb, starting_offset + 108, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txctlbytes, tvb, starting_offset + 116, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_unknowncmds, tvb, starting_offset + 124, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_snap, tvb, starting_offset + 132, 8, ENC_BIG_ENDIAN); #if 0 proto_tree_add_item(parent_tree, hf_waveagent_tstamp1, tvb, 140, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp2, tvb, 144, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp3, tvb, 148, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp4, tvb, 152, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp5, tvb, 156, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp6, tvb, 160, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp7, tvb, 164, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_tstamp8, tvb, 168, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_minlcldelta, tvb, 172, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_maxlcldelta, tvb, 176, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_avglcldelta, tvb, 180, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_minremdelta, tvb, 184, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_maxremdelta, tvb, 188, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_avgremdelta, tvb, 192, 4, ENC_BIG_ENDIAN); #endif proto_tree_add_item(parent_tree, hf_waveagent_rx1pl, tvb, starting_offset + 284, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rx2pl, tvb, starting_offset + 292, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rx3pl, tvb, starting_offset + 300, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rx4pl, tvb, starting_offset + 308, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rx5pl, tvb, starting_offset + 316, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxoospkts, tvb, starting_offset + 324, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_jitter, tvb, starting_offset + 356, 8, ENC_BIG_ENDIAN); if (version >= 3) { proto_tree_add_item(parent_tree, hf_waveagent_delayfactor, tvb, starting_offset + 364, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_medialossrate, tvb, starting_offset + 372, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txstartts, tvb, starting_offset + 380, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txendts, tvb, starting_offset + 388, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxstartts, tvb, starting_offset + 396, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rxendts, tvb, starting_offset + 404, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_latencysum, tvb, starting_offset + 412, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_latencycount, tvb, starting_offset + 420, 8, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_txflowstop, tvb, starting_offset + 428, 8, ENC_BIG_ENDIAN); } break; case 0x40: { guint32 offset; guint32 delta; guint32 iLoop; guint32 num_bss_entries; proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_connectflags, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_connecttype, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_scanssid, tvb, starting_offset + 12, 32, ENC_ASCII); num_bss_entries = tvb_get_ntohl(tvb, starting_offset + 142); offset = starting_offset + 46; delta = 6; for (iLoop = 0; iLoop < num_bss_entries; iLoop++) { int current_offset; current_offset = offset + iLoop * delta; proto_tree_add_item(parent_tree, hf_waveagent_scanbssid, tvb, current_offset, 6, ENC_NA); } proto_tree_add_item(parent_tree, hf_waveagent_minrssi, tvb, starting_offset + 146, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_connecttimeout, tvb, starting_offset + 150, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_connectattempts, tvb, starting_offset + 154, 4, ENC_BIG_ENDIAN); break; } case 0x41: proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_reason, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); break; case 0x81: /* Capabilities response */ if (version < 3) { /* For version 2 WA protocol the capability status is not in the header but in the CAP RESPONSE. Need to read it here and then advance the payload offset. This is a packet that had a structure change in the beginning of the packet when moving to v3 */ proto_tree_add_item(parent_tree, hf_waveagent_capstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_protocolversion, tvb, starting_offset, 1, ENC_BIG_ENDIAN); starting_offset += 4; } proto_tree_add_item(parent_tree, hf_waveagent_capimpl, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_id, tvb, starting_offset + 4, 128, ENC_ASCII); proto_tree_add_item(parent_tree, hf_waveagent_bindtag, tvb, starting_offset + 136, 128, ENC_ASCII); proto_tree_add_item(parent_tree, hf_waveagent_version, tvb, starting_offset + 268, 128, ENC_ASCII); proto_tree_add_item(parent_tree, hf_waveagent_brokerip, tvb, starting_offset + 400, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_brokerport, tvb, starting_offset + 404, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bindlevel, tvb, starting_offset + 408, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bindport, tvb, starting_offset + 412, 4, ENC_BIG_ENDIAN); if (version >= 3) { proto_tree_add_item(parent_tree, hf_waveagent_capabilities2, tvb, starting_offset + 416, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_numinterfaces, tvb, starting_offset + 420, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_ifmask, tvb, starting_offset + 424, 4, ENC_BIG_ENDIAN); } break; case 0x82: /* Reserve request */ proto_tree_add_item(parent_tree, hf_waveagent_bindtag, tvb, starting_offset, 128, ENC_ASCII); proto_tree_add_item(parent_tree, hf_waveagent_brokerip, tvb, starting_offset + 132, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_brokerport, tvb, starting_offset + 136, 4, ENC_BIG_ENDIAN); break; case 0x85: { /* Flow setup */ proto_tree *fs_flags; proto_tree *fs_flags_tree; guint32 flags_bitfield; if (version < 3) { proto_tree_add_item(parent_tree, hf_waveagent_rxflownum, tvb, starting_offset, 4, ENC_BIG_ENDIAN); } proto_tree_add_item(parent_tree, hf_waveagent_mode, tvb, starting_offset + 7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_endpointtype, tvb, starting_offset + 7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bindport, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_bindlevel, tvb, starting_offset + 12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_remoteport, tvb, starting_offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_remoteaddr, tvb, starting_offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_dscp, tvb, starting_offset + 40, 4, ENC_BIG_ENDIAN); flags_bitfield = tvb_get_ntohl(tvb, starting_offset + 44); fs_flags = proto_tree_add_uint(parent_tree, hf_waveagent_fsflags, tvb, starting_offset + 44, 4, flags_bitfield); fs_flags_tree = proto_item_add_subtree(fs_flags, ett_fsflags); proto_tree_add_item(fs_flags_tree, hf_waveagent_fscbrflag, tvb, starting_offset + 47, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(fs_flags_tree, hf_waveagent_fscombinedsetupflag, tvb, starting_offset + 47, 1, ENC_LITTLE_ENDIAN); if (version >= 3) { proto_tree_add_item(parent_tree, hf_waveagent_ifindex, tvb, starting_offset + 48, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_payfill, tvb, starting_offset + 52, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_paysize, tvb, starting_offset + 56, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_avgrate, tvb, starting_offset + 60, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_totalframes, tvb, starting_offset + 64, 4, ENC_BIG_ENDIAN); } break; } case 0x8b: proto_tree_add_item(parent_tree, hf_waveagent_destip, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_destport, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_connectflags, tvb, starting_offset + 8, 4, ENC_BIG_ENDIAN); break; case 0x3f: /* Relay response */ case 0x8f: /* Command Response */ proto_tree_add_item(parent_tree, hf_waveagent_commandstatus, tvb, starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_syserrno, tvb, starting_offset + 4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_statusstring, tvb, starting_offset + 8, 128, ENC_ASCII); break; } } static guint32 dissect_wa_header(guint32 starting_offset, proto_item *parent_tree, tvbuff_t *tvb, guint8 version) { guint32 wa_payload_offset; proto_tree_add_item(parent_tree, hf_waveagent_controlword, tvb, 30+starting_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_payloadlen, tvb, 20+starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_transnum, tvb, 24+starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_rtoken, tvb, 32+starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_flowid, tvb, 36+starting_offset, 4, ENC_BIG_ENDIAN); if (version >= 3) { proto_tree_add_item(parent_tree, hf_waveagent_capstatus, tvb, 40+starting_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(parent_tree, hf_waveagent_protocolversion, tvb, 40+starting_offset, 1, ENC_BIG_ENDIAN); wa_payload_offset = WA_V3_PAYLOAD_OFFSET + starting_offset; } else { wa_payload_offset = WA_V2_PAYLOAD_OFFSET + starting_offset; } proto_tree_add_item(parent_tree, hf_waveagent_sigsequencenum, tvb, 4+starting_offset, 1, ENC_BIG_ENDIAN); return wa_payload_offset; } /* Dissect the packets */ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti, *rmi; proto_tree *waveagent_tree, *relay_message_tree, *payload_tree; guint8 signature_start, signature_end; guint8 version; guint32 magic_number; guint32 control_word, paylen; guint32 wa_payload_offset; /* Check that there's enough data */ if (tvb_captured_length(tvb) < 52 ) return 0; magic_number = tvb_get_ntohl(tvb, 16) & 0x0FFFFFFF; /* Mask magic number off */ if(magic_number != 0x0F87C3A5){ return 0; } signature_start = tvb_get_guint8(tvb, 0); signature_end = tvb_get_guint8(tvb, 15); if ( ((signature_start != 0xcc) && (signature_start !=0xdd)) || (signature_end != 0xE2)) /* This packet does not appear to belong to WaveAgent. * Return 0 to give another dissector a chance to dissect it. */ return 0; version = ((tvb_get_ntohl(tvb, 16) & 0xF0000000) >> 28 == 1) ? 3 : 2; /* Mask version bit off */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WA"); col_clear(pinfo->cinfo, COL_INFO); /* Grab the control word, parse the WaveAgent payload accordingly */ control_word = tvb_get_ntohl(tvb, 28); paylen = tvb_get_ntohl(tvb, 20); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (0x%x)", val_to_str_ext_const(control_word, &control_words_ext, "Unknown"), control_word); if (tree) { /* create display subtree for the protocol */ ti = proto_tree_add_protocol_format(tree, proto_waveagent, tvb, 0, -1, "WaveAgent, %s (0x%x), Payload Length %u Bytes", val_to_str_ext_const(control_word, &control_words_ext, "Unknown"), control_word, paylen); waveagent_tree = proto_item_add_subtree(ti, ett_waveagent); wa_payload_offset = dissect_wa_header(0, waveagent_tree, tvb, version); payload_tree = waveagent_tree; /* Need to check for a relay message. If so, parse the extra fields and then parse the WA packet */ if (control_word == 0x3e) { proto_tree_add_item(waveagent_tree, hf_waveagent_relaydestid, tvb, wa_payload_offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(waveagent_tree, hf_waveagent_relaysrcid, tvb, wa_payload_offset+4, 4, ENC_BIG_ENDIAN); /* Parse control_word of the relay message */ control_word = tvb_get_ntohl(tvb, wa_payload_offset+12+28); rmi = proto_tree_add_none_format(waveagent_tree, hf_waveagent_relaymessagest, tvb, wa_payload_offset+12+28, 0, "Relayed WaveAgent Message, %s (0x%x)", val_to_str_ext_const(control_word, &control_words_ext, "Unknown"), control_word); relay_message_tree = proto_item_add_subtree(rmi, ett_relaymessage); wa_payload_offset = dissect_wa_header(wa_payload_offset+12, relay_message_tree, tvb, version); payload_tree = relay_message_tree; } dissect_wa_payload(wa_payload_offset, payload_tree, tvb, control_word, version); } /* Return the amount of data this dissector was able to dissect */ return tvb_captured_length(tvb); } static gboolean dissect_waveagent_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { return (dissect_waveagent(tvb, pinfo, tree) > 0) ? TRUE : FALSE; } #if 0 static const value_string status_values[] = { { 0, "OK" }, { 1, "In Use" }, { 0, NULL } }; #endif /* Register the protocol with Wireshark */ void proto_register_waveagent(void) { static const value_string tcp_states[] = { { 0, "Closed" }, { 1, "Listen" }, { 2, "SYN Sent" }, { 3, "SYN received" }, { 4, "Established" }, { 5, "FIN Wait 1" }, { 6, "FIN Wait 2" }, { 7, "Close Wait" }, { 8, "Closing" }, { 9, "Last ACK" }, { 10, "Time Wait" }, { 0, NULL }, }; static const value_string app_states[] = { { 0, "IDLE" }, { 1, "READY" }, { 0, NULL }, }; static const value_string wa_modes[] = { { 0, "In-band" }, { 1, "Source" }, { 2, "Sink" }, { 3, "Loopback" }, { 0, NULL }, }; static const value_string wa_endpointtypes[] = { { 0, "Undefined" }, { 1, "Server" }, { 2, "Client" }, { 0, NULL }, }; static const value_string binding_levels[] = { { 0, "WLAN" }, { 1, "Ethernet" }, { 2, "IP" }, { 3, "UDP" }, { 4, "TCP" }, { 5, "FIN Wait 1" }, { 6, "FIN Wait 2" }, { 7, "Close Wait" }, { 8, "Closing" }, { 9, "Last ACK" }, { 10, "Time Wait" }, { 0, NULL }, }; static const value_string if_types[] = { { ETHERNET_INTERFACE, "Ethernet" }, { WLAN_INTERFACE, "WLAN" }, { 0, NULL }, }; static const value_string no_yes[] = { { 0, "No" }, { 1, "Yes" }, { 0, NULL }, }; static const value_string ip_types[] = { { 0, "Unspecified" }, { IPV4_TYPE, "IPv4" }, { IPV6_TYPE, "IPv6" }, { 0, NULL }, }; static const value_string if_l3_states[] = { { 0, "Uninitialized" }, { 1, "Disconnected" }, { 2, "Connected" }, { 3, "Error" }, { 0, NULL }, }; static const value_string if_wlan_states[] = { { 0, "Uninitialized" }, { 1, "Not ready" }, { 2, "Connected" }, { 3, "Ad Hoc network formed" }, { 4, "Disconnecting" }, { 5, "Disconnected" }, { 6, "Associating" }, { 7, "Discovering" }, { 8, "Authenticating" }, { 0, NULL }, }; static const value_string if_eth_states[] = { { 0, "Uninitialized" }, { 1, "Not Operational" }, { 2, "Unreachable" }, { 3, "Disconnected" }, { 4, "Connecting" }, { 5, "Connected" }, { 6, "Operational" }, { 7, "Error" }, { 0, NULL }, }; static const value_string bss_modes[] = { { 0, "Infrastructure" }, { 1, "IBSS" }, { 2, "Unknown" }, { 0, NULL }, }; static const value_string auth_algs[] = { { 0, "Open" }, { 1, "Shared Key" }, { 2, "WPA" }, { 4, "WPA PSK" }, { 8, "WPA2" }, { 16, "WPA2 PSK" }, { 0, NULL }, }; static const value_string cipher_algs[] = { { 0, "None" }, { 1, "WEP 40" }, { 2, "WEP 104" }, { 4, "WEP" }, { 8, "TKIP" }, { 16, "CCMP" }, { 0, NULL }, }; /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { /* START: General purpose message fields - used in multiple messages */ { &hf_waveagent_controlword, { "Control Word", "waveagent.cword", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &control_words_ext, 0x0, NULL, HFILL } }, { &hf_waveagent_payloadlen, { "Payload Length", "waveagent.paylen", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_transnum, { "Transaction Number", "waveagent.transnum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rtoken, { "Reservation Token", "waveagent.rtoken", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_flowid, { "Flow ID", "waveagent.flowid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_capstatus, { "Capabilities Status", "waveagent.capstatus", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_protocolversion, { "Protocol Version", "waveagent.protocolversion", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_capimpl, { "Capabilities Implementation", "waveagent.capimpl", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_sigsequencenum, { "Signature Sequence Number", "waveagent.sigsequencenum", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_id, { "ID", "waveagent.id", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_bindtag, { "Binding Tag", "waveagent.bindtag", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_version, { "Version", "waveagent.version", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_brokerip, { "Broker IP address", "waveagent.brokerip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_brokerport, { "Broker Port", "waveagent.brokerport", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_bindlevel, { "Binding Level", "waveagent.bindlevel", FT_UINT32, BASE_DEC, VALS(binding_levels), 0x0, NULL, HFILL } }, { &hf_waveagent_bindport, { "Binding Port", "waveagent.bindport", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifindex, { "Interface Index", "waveagent.ifindex", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* END: General purpose message fields - used in multiple messages */ /* START: Capabilities response fields (specific to this message, other general fields are also used) */ { &hf_waveagent_capabilities2, { "Additional Capabilities", "waveagent.capabilities2", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_numinterfaces, { "Number of WA Interfaces", "waveagent.numinterfaces", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifmask, { "Mask of Active Interfaces", "waveagent.ifmask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* END: Capabilities response fields (specific to this message, other general fields are also used) */ /* START: Command response message fields */ { &hf_waveagent_commandstatus, { "Status of Previous Command", "waveagent.cmdstat", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_syserrno, { "System Error Number", "waveagent.syserrno", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_statusstring, { "Status Message", "waveagent.statmsg", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, /* END: Command response message fields */ /* START: Stats response message fields */ { &hf_waveagent_rxdatapckts, { "Received Data Packets", "waveagent.rxdpkts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxdatabytes, { "Received Data Bytes", "waveagent.rxdbytes", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxpcktrate, { "Received Data Packet Rate (pps)", "waveagent.rxpktrate", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxbyterate, { "Received Byte Rate", "waveagent.rxbyterate", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txdatapckts, { "Transmitted Data Packets", "waveagent.txdpkts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txdatabytes, { "Transmitted Data Bytes", "waveagent.txdbytes", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txpcktrate, { "Transmitted Data Packet Rate (pps)", "waveagent.txpktrate", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txbyterate, { "Transmitted Byte Rate", "waveagent.txbyterate", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_looppckts, { "Loopback Packets", "waveagent.looppckts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_loopbytes, { "Loopback Bytes", "waveagent.loopbytes", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxctlpckts, { "Received Control Packets", "waveagent.rxctlpkts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxctlbytes, { "Received Control Bytes", "waveagent.rxctlbytes", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txctlpckts, { "Transmitted Control Packets", "waveagent.txctlpkts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txctlbytes, { "Transmitted Control Bytes", "waveagent.txctlbytes", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_unknowncmds, { "Unknown Commands", "waveagent.unkcmds", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_snap, { "Time Snap for Counters", "waveagent.snap", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_appstate, { "TCP State", "waveagent.state", FT_UINT32, BASE_DEC, VALS(tcp_states), 0x0, NULL, HFILL } }, { &hf_waveagent_state, { "Application State", "waveagent.appstate", FT_UINT32, BASE_DEC, VALS(app_states), 0x0, NULL, HFILL } }, { &hf_waveagent_rx1pl, { "Instances of single packet loss", "waveagent.rx1pl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rx2pl, { "Instances of 2 sequential packets lost", "waveagent.rx2pl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rx3pl, { "Instances of 3 sequential packets lost", "waveagent.rx3pl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rx4pl, { "Instances of 4 sequential packets lost", "waveagent.rx4pl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rx5pl, { "Instances of 5 sequential packets lost", "waveagent.rx5pl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxoospkts, { "Instances of out-of-sequence packets", "waveagent.rxoospkts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_waveagent_rxmeanlatency, { "Rx Mean latency", "waveagent.rxmeanlatency", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_waveagent_rxminlatency, { "Rx Minimum latency", "waveagent.rxminlatency", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif #if 0 { &hf_waveagent_rxmaxlatency, { "Rx Maximum latency", "waveagent.rxmaxlatency", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_waveagent_jitter, { "Jitter (microseconds)", "waveagent.jitter", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_delayfactor, { "Delay Factor", "waveagent.delayfactor", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_medialossrate, { "Media Loss Rate", "waveagent.medialossrate", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txstartts, { "Timestamp for first Tx flow packet", "waveagent.txstartts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txendts, { "Timestamp for last Tx flow packet", "waveagent.txendts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxstartts, { "Timestamp for first Rx flow packet", "waveagent.rxstartts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_rxendts, { "Timestamp for last Rx flow packet", "waveagent.rxendts", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_latencysum, { "Sum of latencies across all received packets", "waveagent.latencysum", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_latencycount, { "Count of packets included in the latency sum", "waveagent.latencycount", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_txflowstop, { "Timestamp for Tx flow stop message", "waveagent.txflowstop", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* END Stats response message fields */ /* START: Flow setup message */ { &hf_waveagent_rxflownum, { "Received Flow Number", "waveagent.rxflownum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_mode, { "WaveAgent Mode", "waveagent.trafficmode", FT_UINT8, BASE_DEC, VALS(wa_modes), 0x03, NULL, HFILL } }, { &hf_waveagent_endpointtype, { "WaveAgent Endpoint Type", "waveagent.endpointtype", FT_UINT8, BASE_DEC, VALS(wa_endpointtypes), 0x0c, NULL, HFILL } }, { &hf_waveagent_remoteport, { "Remote port", "waveagent.remoteport", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_remoteaddr, { "Remote address", "waveagent.remoteaddr", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_dscp, { "DSCP Setting", "waveagent.dscp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_fsflags, { "Flow Setup Flags", "waveagent.fsflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_fscbrflag, { "CBR Transmit Mode", "waveagent.fscbrflag", FT_BOOLEAN, 4, NULL, 0x1, NULL, HFILL } }, { &hf_waveagent_fscombinedsetupflag, { "Setup, Connect/Listen, Start Combined", "waveagent.fscombinedsetupflag", FT_BOOLEAN, 4, NULL, 0x2, NULL, HFILL } }, /* END: Flow setup message */ /* START: Flow start message fields */ { &hf_waveagent_payfill, { "Payload Fill", "waveagent.payfill", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_paysize, { "WaveAgent Payload Size (bytes)", "waveagent.paysize", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_avgrate, { "Average Rate (header + payload + trailer bytes/s)", "waveagent.avgrate", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_totalframes, { "Total Frames", "waveagent.totalframes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* END: Flow start message fields */ /* START: Scan results request (0x23) fields */ { &hf_waveagent_bssidstartindex, { "Starting Index of BSSID list for reporting", "waveagent.bssidstartindex", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_bssidstopindex, { "Ending Index of BSSID list for reporting", "waveagent.bssidstopindex", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* END: Scan results request (0x23) fields */ /* START: WLAN Interface stats fields */ { &hf_waveagent_ifwlanbssid, { "WLAN Interface Connected to BSSID", "waveagent.ifwlanbssid", FT_ETHER, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanssid, { "WLAN Interface Connected to SSID", "waveagent.ifwlanssid", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanrssi, { "WLAN Interface RSSI", "waveagent.ifwlanrssi", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlannoise, { "WLAN Interface Noise Floor (dBm)", "waveagent.ifwlannoise", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifphytypes, { "WLAN Interface Supported PHY Types", "waveagent.ifphytypes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifphytypebit0, { "11b", "waveagent.ifphytypebit0", FT_BOOLEAN, 4, NULL, 0x1, NULL, HFILL } }, { &hf_waveagent_ifphytypebit1, { "11g", "waveagent.ifphytypebit1", FT_BOOLEAN, 4, NULL, 0x2, NULL, HFILL } }, { &hf_waveagent_ifphytypebit2, { "11a", "waveagent.ifphytypebit2", FT_BOOLEAN, 4, NULL, 0x4, NULL, HFILL } }, { &hf_waveagent_ifphytypebit3, { "11n", "waveagent.ifphytypebit3", FT_BOOLEAN, 4, NULL, 0x8, NULL, HFILL } }, { &hf_waveagent_ifwlanauthentication, { "WLAN Interface Authentication Algorithm", "waveagent.ifwlanauthentication", FT_UINT32, BASE_DEC, VALS(auth_algs), 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlancipher, { "WLAN Interface Encryption/Cipher Algorithm", "waveagent.ifwlancipher", FT_UINT32, BASE_DEC, VALS(cipher_algs), 0x0, NULL, HFILL } }, /* END: WLAN Interface stats fields */ /* START: Interface stats response (0x2d) fields */ { &hf_waveagent_iftype, { "Interface type", "waveagent.iftype", FT_UINT32, BASE_DEC, VALS(if_types), 0x0, NULL, HFILL } }, { &hf_waveagent_ifdescription, { "Name/Description of the adapter", "waveagent.ifdescription", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifmacaddr, { "Interface MAC Address", "waveagent.ifmacaddr", FT_ETHER, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_iflinkspeed, { "Interface Link Speed (kbps)", "waveagent.iflinkspeed", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifdhcp, { "Interface DHCP Enabled", "waveagent.ifdhcp", FT_UINT32, BASE_DEC, VALS(no_yes), 0x0, NULL, HFILL } }, { &hf_waveagent_ifiptype, { "Interface IP Type", "waveagent.ifiptype", FT_UINT32, BASE_DEC, VALS(ip_types), 0x0, NULL, HFILL } }, { &hf_waveagent_ifipv4, { "Interface Bound to IP Address", "waveagent.ifipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifipv6, { "Interface Bound to IP Address", "waveagent.ifipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifdhcpserver, { "Interface DHCP Server Address", "waveagent.ifdhcpserver", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifgateway, { "Interface Gateway", "waveagent.ifgateway", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifdnsserver, { "Interface DNS Server Address", "waveagent.ifdnsserver", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifethl2status, { "Ethernet L2 Interface Status", "waveagent.ifethl2status", FT_UINT32, BASE_DEC, VALS(if_eth_states), 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanl2status, { "WLAN L2 Interface Status", "waveagent.ifwlanl2status", FT_UINT32, BASE_DEC, VALS(if_wlan_states), 0x0, NULL, HFILL } }, { &hf_waveagent_ifl3status, { "L3 Interface Status", "waveagent.ifl3status", FT_UINT32, BASE_DEC, VALS(if_l3_states), 0x0, NULL, HFILL } }, /* END: Interface stats response (0x2d) fields */ /* START: Scan results response (0x2e) fields */ { &hf_waveagent_totalbssid, { "Number of Found BSSID", "waveagent.totalbssid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_returnedbssid, { "Number of BSSID Reported in This Response", "waveagent.returnedbssid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_scanbssid, { "BSSID", "waveagent.scanbssid", FT_ETHER, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_scanssid, { "SSID", "waveagent.scanssid", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlansupprates, { "Supported Rates", "waveagent.ifwlansupportedrates", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlancapabilities, { "Capabilities field", "waveagent.ifwlancapabilities", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanchannel, { "Channel", "waveagent.ifwlanchannel", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanprivacy, { "Privacy Enabled", "waveagent.ifwlanprivacy", FT_UINT32, BASE_DEC, VALS(no_yes), 0x0, NULL, HFILL } }, { &hf_waveagent_ifwlanbssmode, { "BSS Mode", "waveagent.ifwlanbssmode", FT_UINT32, BASE_DEC, VALS(bss_modes), 0x0, NULL, HFILL } }, /* END: Scan results response (0x2e) fields */ /* START: OID fields */ { &hf_waveagent_oidcode, { "OID Code", "waveagent.oidcode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_oidvalue, { "OID Value", "waveagent.oidvalue", FT_STRING, 0, NULL, 0x0, NULL, HFILL } }, /* END: OID fields */ /* START: Learning Message fields */ { &hf_waveagent_destip, { "Destination IP", "waveagent.destip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_destport, { "Destination Port", "waveagent.destport", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_connectflags, { "Connect Flags", "waveagent.connectflags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* END: Learning Message fields */ /* START: client connect fields */ { &hf_waveagent_connecttype, { "Connect Type", "waveagent.connecttype", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_minrssi, { "Minimum RSSI", "waveagent.minrssi", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_connecttimeout, { "Connect timeout (s)", "waveagent.connecttimeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_connectattempts, { "Connect attempts", "waveagent.connectattempt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_reason, { "Reason", "waveagent.reason", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* END: client connect fields */ /* START: relay server fields */ { &hf_waveagent_relaydestid, { "ID of destination client (assigned by relay server)", "waveagent.relaydestid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_relaysrcid, { "ID of source client (assigned by relay server)", "waveagent.relaysrcid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_waveagent_relaymessagest, { "Relayed WaveAgent Message", "waveagent.relaymessagest", FT_NONE, BASE_NONE, NULL, 0x0, "This is a relayed WaveAgent message", HFILL } }, /* END: relay server fields */ }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_waveagent, &ett_statechange, &ett_phytypes, &ett_fsflags, &ett_scindex[0], &ett_scindex[1], &ett_scindex[2], &ett_scindex[3], &ett_scindex[4], &ett_scindex[5], &ett_scindex[6], &ett_scindex[7], &ett_bss[0], &ett_bss[1], &ett_bss[2], &ett_bss[3], &ett_bss[4], &ett_bss[5], &ett_bss[6], &ett_bss[7], &ett_relaymessage, }; proto_waveagent = proto_register_protocol( "WaveAgent", "waveagent", "waveagent"); proto_register_field_array(proto_waveagent, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_waveagent(void) { heur_dissector_add("udp", dissect_waveagent_heur, "WaveAgent over UDP", "waveagent_udp", proto_waveagent, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wbxml.c
/* packet-wbxml.c * * Routines for WAP Binary XML dissection * Copyright 2003, 2004, Olivier Biot. * * Routines for WV-CSP 1.3 dissection * Copyright 2007, Andrei Rubaniuk. * * 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 <[email protected]> * Copyright 1998 Gerald Combs * * WAP Binary XML decoding functionality provided by Olivier Biot. * WV-CSP 1.2 updated to Release version and WV-CSP 1.3 protocol * decoding functionality provided by Andrei Rubaniuk. * * The WAP specifications used to be found at the WAP Forum: * <http://www.wapforum.org/what/Technical.htm> * But now the correct link is at the Open Mobile Alliance: * <http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html> * Media types defined by OMA affiliates will have their standards at: * <http://www.openmobilealliance.org/tech/affiliates/index.html> * <http://www.openmobilealliance.org/release_program/index.html> * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/prefs.h> #include <epan/expert.h> #include <epan/proto_data.h> #include <epan/strutil.h> #include <epan/iana_charsets.h> /* We need the function tvb_get_guintvar() */ #include "packet-wap.h" void proto_register_wbxml(void); void proto_reg_handoff_wbxml(void); /* General-purpose debug logger. * Requires double parentheses because of variable arguments of printf(). * * Enable debug logging for WBXML by defining AM_FLAGS * so that it contains "-DDEBUG_wbxml" */ #ifdef DEBUG_wbxml #define DebugLog(x) \ g_print("%s:%u: ", __FILE__, __LINE__); \ g_print x #else #define DebugLog(x) ; #endif /* The code in this source file dissects the WAP Binary XML content, * and if possible renders it. WBXML mappings are defined in the * "wbxml_decoding" structure. * * NOTES: * * - Some WBXML content is *not* backwards compatible across minor versions. * This painful remark is true for: * o WMLC 1.0 with respect to later WMLC 1.x * o All WV-CSP versions (never backwards compatible) * The only way of correctly rendering the WBXML is to let the end-user * choose from the possible renderings. This only applies to the case when * the WBXML DocType is not included in the WBXML header (unknown/missing). * * - Some WBXML content uses EXT_T_* in a non-tableref manner. This is the * case with WV-CSP 1.1 and up, where the index points to a value_string * containing WV-CSP specific token values. This is allowed as it is not * explicitly forbidden in the WBXML specifications. Hence the global token * map for content must also contain a function pointer if no tableref * string is used. * * - Code page switches apply until a new code page switch. In the WBXML/1.x * ABNF notation, it can be proven that the switch_page can only precede * the following tokens: * o stag : TAG | LITERAL | LITERAL_A | LITERAL_C | LITERAL_AC * o attr : ATTRSTART | ATTRVALUE * o extension : EXT_I | EXT_T | EXT * Code page switches are displayed in a separate column. * * - The WBXML spec states that code pages are static to both the tag and the * attribute state parser. A SWITCH_PAGE within a state switches the code * page of the active state only. Note that code page 255 is reserved for * application-specific (read: testing) purposes. * * - In order to render the XML content, recursion is inevitable at some * point (when a tag with content occurs in the content of a tag with * content). The code will however not recurse if this is not strictly * required (e.g., tag without content in the content of a tag with * content). * * - I found it useful to display the XML nesting level as a first "column", * followed by the abbreviated WBXML token interpretation. When a mapping * is defined for the parsed WBXML content, then the XML rendering is * displayed with appropriate indentation (maximum nesting level = 255, * after which the nesting and level will safely roll-over to 0). * * - The WAP Forum defines the order of precedence for finding out the * WBXML content type (same rules for charset) as follows: * 1. Look in the Content-Type WSP header * 2. Look in the WBXML header * Currently there is no means of using content type parameters: * o Type=<some_type> * o Charset=<charset_of_the_content> * So it is possible some WBXML content types are incorrectly parsed. * This would only be the case when the content type declaration in the * WSP Content-Type header would be different (or would have parameters * which are relevant to the WBXML decoding) from the content type * identifier specified in the WBXML header. This has to do with the * decoding of terminated text strings in the different character codings. * TODO: investigate this and provide correct decoding at all times. */ /************************** Variable declarations **************************/ /* Initialize the protocol and registered fields */ static int proto_wbxml = -1; static int hf_wbxml_version = -1; static int hf_wbxml_public_id_known = -1; static int hf_wbxml_public_id_literal = -1; static int hf_wbxml_charset = -1; static int hf_wbxml_string_table_item_offset = -1; static int hf_wbxml_string_table_item_string = -1; static int hf_wbxml_switch_page = -1; static int hf_wbxml_known_tag = -1; static int hf_wbxml_end_known_tag = -1; static int hf_wbxml_end_known_tag_uint = -1; static int hf_wbxml_str_i = -1; static int hf_wbxml_str_t = -1; static int hf_wbxml_opaque_data = -1; static int hf_wbxml_entity = -1; static int hf_wbxml_literal = -1; static int hf_wbxml_ext_i = -1; static int hf_wbxml_ext_t = -1; static int hf_wbxml_extension_token = -1; static int hf_wbxml_reserved_2 = -1; static int hf_wbxml_invalid_token = -1; static int hf_wbxml_known_attrvalue = -1; static int hf_wbxml_known_attrstart = -1; static int hf_wbxml_end_literal_tag = -1; static int hf_wbxml_literal_a = -1; static int hf_wbxml_literal_c = -1; static int hf_wbxml_literal_ac = -1; static int hf_wbxml_end_pi = -1; static int hf_wbxml_end_attribute_list = -1; static int hf_wbxml_pi_xml = -1; /* Initialize the subtree pointers */ static gint ett_wbxml = -1; static gint ett_wbxml_str_tbl = -1; static gint ett_wbxml_content = -1; static gint ett_wbxml_tags = -1; static gint ett_wbxml_string_table_item = -1; static expert_field ei_wbxml_data_not_shown = EI_INIT; static expert_field ei_wbxml_content_type_not_supported = EI_INIT; static expert_field ei_wbxml_content_type_disabled = EI_INIT; static expert_field ei_wbxml_oversized_uintvar = EI_INIT; static expert_field ei_wbxml_too_much_recursion = EI_INIT; static dissector_handle_t wbxml_handle; /* WBXML Preferences */ static gboolean skip_wbxml_token_mapping = FALSE; static gboolean disable_wbxml_token_parsing = FALSE; typedef struct _value_valuestring { guint32 value; const value_string *valstrptr; } value_valuestring; /* Tries to match val against each element in the value_value_string array vvs. * Returns the associated value_string ptr on a match, or NULL on failure. */ static const value_string * val_to_valstr(guint32 val, const value_valuestring *vvs) { gint i = 0; while (vvs[i].valstrptr) { if (vvs[i].value == val) return(vvs[i].valstrptr); i++; } return(NULL); } /* Note on Token mapping * --------------------- * * The WBXML dissector will try mapping the token decoding to their textual * representation if the media type has a defined token representation. The * following logic applies: * * a. Inspect the WBXML PublicID * This means that I need a list { PublicID, decoding } * * b. Inspect the literal media type * This requires a list { "media/type", discriminator, { decodings } } * * b.1. Use a discriminator to choose an appropriate token mapping; * The disciminator needs a small number of bytes from the data tvbuff_t. * * else * b.2. Provide a list to the end-user with all possible token mappings. * * c. If none match then only show the tokens without mapping. * */ /* ext_t_func_ptr is a pointer to a function handling the EXT_T_i tokens: * * char * ext_t_function(tvbuff_t *tvb, guint32 value, guint32 strtbl); */ typedef char * (* ext_t_func_ptr)(tvbuff_t *, guint32, guint32); /* Note on parsing of OPAQUE data * ------------------------------ * * The WBXML encapsulation allows the insertion of opaque binary data in the * WBXML body. Although this opaque data has no meaning in WBXML, the media * type itself may define compact encoding of given input by encoding it in * such a OPAQUE blob of bytes. * * The WBXML dissector now supports dissection of OPAQUE data by means of a * mapping function that will operate based on the token (well-known or literal) * and the active code page. * * For well-known tokens the simplest approach is to use a switch for the code * pages and another switch for the relevant tokens within a code page. * * For literal tokens (tags and attribute names), the only approach is a string * comparison with the literal representation of the given tag or attribute * name. * * opaque_token_func_ptr is a pointer to a function handling OPAQUE values * for binary tokens representing tags or attribute starts. * opaque_literal_func_ptr is a pointer to a function handling OPAQUE values * for literal tokens representing tags or attribute starts. * * The length field of the OPAQUE entry starts at offset (not offset + 1). * * The length of the processed OPAQUE value is returned by reference. * * char * opaque_token_function(tvbuff_t *tvb, guint32 offset, * guint8 token, guint8 codepage, guint32 *length); * char * opaque_literal_function(tvbuff_t *tvb, guint32 offset, * const char *token, guint8 codepage, guint32 *length); */ typedef char * (* opaque_token_func_ptr)(tvbuff_t *, guint32, guint8, guint8, guint32 *, packet_info *); typedef char * (* opaque_literal_func_ptr)(tvbuff_t *, guint32, const char *, guint8, guint32 *, packet_info *); static char * default_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } static char * default_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } static char * default_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, guint8 token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } static char * default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, const char *token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } /* Render a hex %dateTime encoded timestamp as a string. * 0x20011231123456 becomes "2001-12-31T12:34:56Z" */ static char * date_time_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; switch (data_len) { case 4: /* YYYY-MM-DD[T00:00:00Z] */ str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT00:00:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), tvb_get_guint8(tvb, offset + 2), tvb_get_guint8(tvb, offset + 3)); break; case 5: /* YYYY-MM-DDThh[:00:00Z] */ str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:00:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), tvb_get_guint8(tvb, offset + 2), tvb_get_guint8(tvb, offset + 3), tvb_get_guint8(tvb, offset + 4)); break; case 6: /* YYYY-MM-DDThh:mm[:00Z] */ str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:%02x:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), tvb_get_guint8(tvb, offset + 2), tvb_get_guint8(tvb, offset + 3), tvb_get_guint8(tvb, offset + 4), tvb_get_guint8(tvb, offset + 5)); break; case 7: /* YYYY-MM-DDThh:mm[:00Z] */ str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:%02x:%02xZ", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), tvb_get_guint8(tvb, offset + 2), tvb_get_guint8(tvb, offset + 3), tvb_get_guint8(tvb, offset + 4), tvb_get_guint8(tvb, offset + 5), tvb_get_guint8(tvb, offset + 6)); break; default: str = wmem_strdup_printf(pool, "<Error: invalid binary %%DateTime " "(%u bytes of opaque data)>", data_len); break; } return str; } /* Is ALWAYS 6 bytes long: * 00YY YYYY YYYY YYMM MMDD DDDh hhhh mmmm mmss ssss ZZZZ ZZZZ */ static char * wv_datetime_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; guint16 year; guint8 month, day, hour, minute, second, time_zone; guint8 peek; if (data_len == 6) { /* Valid */ /* Octet 1: 00YY YYYY */ year = tvb_get_guint8(tvb, offset) & 0x3F; /* ..11 1111 */ year <<=6; /* Octet 2: YYYY YYMM */ peek = tvb_get_guint8(tvb, offset + 1); year += (peek >> 2); /* 1111 11.. */ month = (peek & 0x03) << 2; /* .... ..11 */ /* Octet 3: MMDD DDDh */ peek = tvb_get_guint8(tvb, offset + 2); month += (peek >> 6); /* 11.. .... */ day = (peek & 0x3E) >> 1; /* ..11 111. */ hour = (peek & 0x01) << 4; /* .... ...1 */ /* Octet 4: hhhh mmmm */ peek = tvb_get_guint8(tvb, offset + 3); hour += (peek >> 4); minute = (peek & 0x0F) << 2; /* .... 1111 */ /* Octet 5: mmss ssss */ peek = tvb_get_guint8(tvb, offset + 4); minute += (peek >> 6); /* 11.. .... */ second = peek & 0x3F; /* ..11 1111 */ /* octet 6: ZZZZZZZZ */ time_zone = tvb_get_guint8(tvb, offset + 5); /* Now construct the string */ str = wmem_strdup_printf(pool, "WV-CSP DateTime: " "%04d-%02d-%02dT%02d:%02d:%02d%s", year, month, day, hour, minute, second, format_char(pool, time_zone)); } else { /* Invalid length for a WV-CSP DateTime tag value */ str = wmem_strdup_printf(pool, "<Error: invalid binary WV-CSP DateTime value " "(%u bytes of opaque data)>", data_len); } return str; } /* WV-CSP integer values for tag content is encoded in a fashion similar * to a Long-Integer in WSP */ static char * wv_integer_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; switch (data_len) { case 1: str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_guint8(tvb, offset)); break; case 2: str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntohs(tvb, offset)); break; case 3: str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntoh24(tvb, offset)); break; case 4: str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntohl(tvb, offset)); break; default: str = wmem_strdup_printf(pool, "<Error: invalid binary WV-CSP Integer value " "(%u bytes of opaque data)>", data_len); break; } return str; } static char * wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Common code page */ switch (token) { case 0x0B: /* <Code> */ case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 1: /* Access code page */ switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 3: /* Client capability code page */ switch (token) { case 0x06: /* <AcceptedContentLength> */ case 0x0C: /* <MultiTrans> */ case 0x0D: /* <ParserSize> */ case 0x0E: /* <ServerPollMin> */ case 0x11: /* <TCPAddress> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%u bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp10_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && ( (strcmp(token, "Code") == 0) || (strcmp(token, "ContentSize") == 0) || (strcmp(token, "MessageCount") == 0) || (strcmp(token, "Validity") == 0) || (strcmp(token, "KeepAliveTime") == 0) || (strcmp(token, "TimeToLive") == 0) || (strcmp(token, "AcceptedContentLength") == 0) || (strcmp(token, "MultiTrans") == 0) || (strcmp(token, "ParserSize") == 0) || (strcmp(token, "ServerPollMin") == 0) || (strcmp(token, "TCPAddress") == 0) || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) ) ) { str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( strcmp(token, "DateTime") == 0) ) { str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Common code page */ switch (token) { case 0x0B: /* <Code> */ case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 1: /* Access code page */ switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 3: /* Client capability code page */ switch (token) { case 0x06: /* <AcceptedContentLength> */ case 0x0C: /* <MultiTrans> */ case 0x0D: /* <ParserSize> */ case 0x0E: /* <ServerPollMin> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 6: /* Messaging code page */ switch (token) { case 0x1A: /* <DeliveryTime> - not in 1.0 */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp11_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && ( (strcmp(token, "Code") == 0) || (strcmp(token, "ContentSize") == 0) || (strcmp(token, "MessageCount") == 0) || (strcmp(token, "Validity") == 0) || (strcmp(token, "KeepAliveTime") == 0) || (strcmp(token, "TimeToLive") == 0) || (strcmp(token, "AcceptedContentLength") == 0) || (strcmp(token, "MultiTrans") == 0) || (strcmp(token, "ParserSize") == 0) || (strcmp(token, "ServerPollMin") == 0) || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) ) ) { str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Common code page */ switch (token) { case 0x0B: /* <Code> */ case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 1: /* Access code page */ switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 3: /* Client capability code page */ switch (token) { case 0x06: /* <AcceptedContentLength> */ case 0x0C: /* <MultiTrans> */ case 0x0D: /* <ParserSize> */ case 0x0E: /* <ServerPollMin> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 6: /* Messaging code page */ switch (token) { case 0x1A: /* <DeliveryTime> - not in 1.0 */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 9: /* Common code page (continued) */ switch (token) { case 0x08: /* <HistoryPeriod> - 1.2 only */ case 0x0A: /* <MaxWatcherList> - 1.2 only */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp12_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && ( (strcmp(token, "Code") == 0) || (strcmp(token, "ContentSize") == 0) || (strcmp(token, "MessageCount") == 0) || (strcmp(token, "Validity") == 0) || (strcmp(token, "KeepAliveTime") == 0) || (strcmp(token, "TimeToLive") == 0) || (strcmp(token, "AcceptedContentLength") == 0) || (strcmp(token, "MultiTrans") == 0) || (strcmp(token, "ParserSize") == 0) || (strcmp(token, "ServerPollMin") == 0) || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) || (strcmp(token, "HistoryPeriod") == 0) || (strcmp(token, "MaxWatcherList") == 0) ) ) { str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Common code page */ switch (token) { case 0x0B: /* <Code> */ case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 1: /* Access code page */ switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x25: /* <SearchFindings> */ case 0x26: /* <SearchID> */ case 0x27: /* <SearchIndex> */ case 0x28: /* <SearchLimit> */ case 0x32: /* <TimeToLive> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 3: /* Client capability code page */ switch (token) { case 0x06: /* <AcceptedContentLength> */ case 0x0C: /* <MultiTrans> */ case 0x0D: /* <ParserSize> */ case 0x0E: /* <ServerPollMin> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ /* New in WV-CSP 1.3*/ case 0x16: /* <AcceptedPullLength> */ case 0x17: /* <AcceptedPushLength> */ case 0x18: /* <AcceptedRichContentLength> */ case 0x19: /* <AcceptedTextContentLength> */ case 0x1B: /* <PlainTextCharset> MIBenum number - character set, i.e. UTF-8, windows-1251, etc. */ case 0x1C: /* <SessionPriority> */ case 0x1F: /* <UserSessionLimit> */ case 0x21: /* <MultiTransPerMessage> */ case 0x24: /* <ContentPolicyLimit> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 5: /* Presence attribute code page */ switch (token) { /* New in WV-CSP 1.3*/ /* case 0x3B: */ /* <ClientContentLimit> */ case 0x3C: /* <ClientIMPriority> */ case 0x3D: /* <MaxPullLength> */ case 0x3E: /* <MaxPushLength> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 6: /* Messaging code page */ switch (token) { case 0x1A: /* <DeliveryTime> - not in 1.0 */ /* New in WV-CSP 1.3*/ case 0x1C: /* <AnswerOptionID> */ str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 9: /* Common code page (continued) */ switch (token) { case 0x08: /* <HistoryPeriod> - 1.2 only */ case 0x0A: /* <MaxWatcherList> - 1.2 only */ /* New in WV-CSP 1.3*/ case 0x25: /* <SegmentCount> */ case 0x28: /* <SegmentReference> */ case 0x30: /* <TryAgainTimeout> */ case 0x3A: /* <GroupContentLimit> */ case 0x3B: /* <MessageTotalCount> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; case 10: switch (token) { /* New in WV-CSP 1.3*/ case 0x0C: /* <PairID> */ str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * wv_csp13_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && ( (strcmp(token, "Code") == 0) || (strcmp(token, "ContentSize") == 0) || (strcmp(token, "MessageCount") == 0) || (strcmp(token, "Validity") == 0) || (strcmp(token, "KeepAliveTime") == 0) || (strcmp(token, "TimeToLive") == 0) || (strcmp(token, "AcceptedContentLength") == 0) || (strcmp(token, "MultiTrans") == 0) || (strcmp(token, "ParserSize") == 0) || (strcmp(token, "ServerPollMin") == 0) || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) || (strcmp(token, "HistoryPeriod") == 0) || (strcmp(token, "MaxWatcherList") == 0) /* New in WV-CSP 1.3*/ || (strcmp(token, "SearchFindings") == 0) || (strcmp(token, "SearchID") == 0) || (strcmp(token, "SearchIndex") == 0) || (strcmp(token, "SearchLimit") == 0) || (strcmp(token, "AcceptedPullLength") == 0) || (strcmp(token, "AcceptedPushLength") == 0) || (strcmp(token, "AcceptedRichContentLength") == 0) || (strcmp(token, "AcceptedTextContentLength") == 0) || (strcmp(token, "SessionPriority") == 0) || (strcmp(token, "UserSessionLimit") == 0) || (strcmp(token, "MultiTransPerMessage") == 0) || (strcmp(token, "ContentPolicyLimit") == 0) || (strcmp(token, "AnswerOptionID") == 0) || (strcmp(token, "SegmentCount") == 0) || (strcmp(token, "SegmentReference") == 0) || (strcmp(token, "TryAgainTimeout") == 0) || (strcmp(token, "GroupContentLimit") == 0) || (strcmp(token, "MessageTotalCount") == 0) || (strcmp(token, "PairID") == 0) ) ) { str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * sic10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && ( (strcmp(token, "created") == 0) || (strcmp(token, "si-expires") == 0) ) ) { str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Only valid codepage for SI */ switch (token) { case 0x0A: /* created= */ case 0x10: /* si-expires= */ str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * emnc10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, const char *token, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; if ( token && (strcmp(token, "timestamp") == 0) ) { str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } static char * emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, guint8 token, guint8 codepage, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); char *str = NULL; switch (codepage) { case 0: /* Only valid codepage for EMN */ switch (token) { case 0x05: /* timestamp= */ str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; } break; default: break; } if (str == NULL) { /* Error, or not parsed */ str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; } typedef struct _wbxml_decoding { const char *name; const char *abbrev; ext_t_func_ptr ext_t[3]; opaque_token_func_ptr opaque_binary_tag; opaque_literal_func_ptr opaque_literal_tag; opaque_token_func_ptr opaque_binary_attr; opaque_literal_func_ptr opaque_literal_attr; const value_valuestring *global; const value_valuestring *tags; const value_valuestring *attrStart; const value_valuestring *attrValue; } wbxml_decoding; /* Define a pointer to a discriminator function taking a tvb and the start * offset of the WBXML tokens in the body as arguments. */ typedef const wbxml_decoding * (* discriminator_func_ptr)(tvbuff_t *, guint32); /* For the decoding lists based on the known WBXML public ID */ typedef struct _wbxml_integer_list { guint32 public_id; const wbxml_decoding *map; } wbxml_integer_list; /* For the decoding lists on the literal content type */ typedef struct _wbxml_literal_list { const char *content_type; discriminator_func_ptr discriminator; /* TODO */ const wbxml_decoding *map; } wbxml_literal_list; /**************** WBXML related declarations and definitions ****************/ /* WBXML public ID mappings. For an up-to-date list, see * http://www.openmobilealliance.org/tech/omna/ */ static const value_string vals_wbxml_public_ids[] = { /* 0x00 = literal public identifier */ { 0x01, "Unknown or missing Public Identifier" }, { 0x02, "-//WAPFORUM//DTD WML 1.0//EN (WML 1.0)" }, { 0x03, "-//WAPFORUM//DTD WTA 1.0//EN (WTA Event 1.0) - Deprecated" }, { 0x04, "-//WAPFORUM//DTD WML 1.1//EN (WML 1.1)" }, { 0x05, "-//WAPFORUM//DTD SI 1.0//EN (Service Indication 1.0)" }, { 0x06, "-//WAPFORUM//DTD SL 1.0//EN (Service Loading 1.0)" }, { 0x07, "-//WAPFORUM//DTD CO 1.0//EN (Cache Operation 1.0)" }, { 0x08, "-//WAPFORUM//DTD CHANNEL 1.1//EN (Channel 1.1)" }, { 0x09, "-//WAPFORUM//DTD WML 1.2//EN (WML 1.2)" }, { 0x0a, "-//WAPFORUM//DTD WML 1.3//EN (WML 1.3)" }, { 0x0b, "-//WAPFORUM//DTD PROV 1.0//EN (Provisioning 1.0)" }, { 0x0c, "-//WAPFORUM//DTD WTA-WML 1.2//EN (WTA-WML 1.2)" }, { 0x0d, "-//WAPFORUM//DTD EMN 1.0//EN (Email Notification 1.0)" }, { 0x0e, "-//WAPFORUM//DTD DRMREL 1.0//EN (DRMREL 1.0)" }, { 0x0f, "-//WIRELESSVILLAGE//DTD CSP 1.0//EN" " (Wireless Village Client-Server Protocol DTD v1.0)" }, { 0x10, "-//WIRELESSVILLAGE//DTD CSP 1.1//EN" " (Wireless Village Client-Server Protocol DTD v1.1)" }, { 0x11, "-//OMA//DTD WV-CSP 1.2//EN (OMA IMPS - CSP protocol DTD v1.2)" }, { 0x12, "-//OMA//DTD IMPS-CSP 1.3//EN (OMA IMPS - CSP protocol DTD v1.3)" }, { 0x13, "-//OMA//DRM 2.1//EN (OMA DRM 2.1)" }, /* 0x14 -- 0x7F: reserved */ /* Registered values - www.syncml.org */ { 0x0fd1, "-//SYNCML//DTD SyncML 1.0//EN (SyncML 1.0)" }, { 0x0fd3, "-//SYNCML//DTD SyncML 1.1//EN (SyncML 1.1)" }, /* Registered values - www.wapforum.org/wina/ */ { 0x1100, "-//PHONE.COM//DTD ALERT 1.0//EN" }, { 0x1101, "-//PHONE.COM//DTD CACHE-OPERATION 1.0//EN" }, { 0x1102, "-//PHONE.COM//DTD SIGNAL 1.0//EN" }, { 0x1103, "-//PHONE.COM//DTD LIST 1.0//EN" }, { 0x1104, "-//PHONE.COM//DTD LISTCMD 1.0//EN" }, { 0x1105, "-//PHONE.COM//DTD CHANNEL 1.0//EN" }, { 0x1106, "-//PHONE.COM//DTD MMC 1.0//EN" }, { 0x1107, "-//PHONE.COM//DTD BEARER-CHOICE 1.0//EN" }, { 0x1108, "-//PHONE.COM//DTD WML 1.1//EN (WML+ 1.1)" }, { 0x1109, "-//PHONE.COM//DTD CHANNEL 1.1//EN" }, { 0x110a, "-//PHONE.COM//DTD LIST 1.1//EN" }, { 0x110b, "-//PHONE.COM//DTD LISTCMD 1.1//EN" }, { 0x110c, "-//PHONE.COM//DTD MMC 1.1//EN" }, { 0x110d, "-//PHONE.COM//DTD WML 1.3//EN (WML+ 1.3)" }, { 0x110e, "-//PHONE.COM//DTD MMC 2.0//EN" }, /* 0x110F -- 0x11FF: unassigned */ { 0x1200, "-//3GPP2.COM//DTD IOTA 1.0//EN" }, { 0x1201, "-//SYNCML//DTD SyncML 1.2//EN" }, { 0x1202, "-//SYNCML//DTD MetaInf 1.2//EN" }, { 0x1203, "-//SYNCML//DTD DevInf 1.2//EN" }, { 0x1204, "-//NOKIA//DTD LANDMARKS 1.0//EN" }, { 0x00, NULL } }; static value_string_ext vals_wbxml_public_ids_ext = VALUE_STRING_EXT_INIT(vals_wbxml_public_ids); static const value_string vals_wbxml_versions[] = { { 0x00, "1.0" }, /* WAP-104-WBXML */ { 0x01, "1.1" }, /* WAP-135-WBXML */ { 0x02, "1.2" }, /* WAP-154-WBXML */ { 0x03, "1.3" }, /* WAP-192-WBXML */ { 0x00, NULL } }; static value_string_ext vals_wbxml_versions_ext = VALUE_STRING_EXT_INIT(vals_wbxml_versions); /* WBXML 1.0 global tokens: WAP-104-WBXML * Same token mapping as in vals_wbxml1x_global_tokens, but: * { 0xC3, "RESERVED_2" } */ /* WBXML 1.x (x>0) global tokens: WAP-135-WBXML, WAP-154-WBXML, WAP-192-WBXML */ static const value_string vals_wbxml1x_global_tokens[] = { { 0x00, "SWITCH_PAGE" }, { 0x01, "END" }, { 0x02, "ENTITY" }, { 0x03, "STR_I" }, { 0x04, "LITERAL" }, { 0x40, "EXT_I_0" }, { 0x41, "EXT_I_1" }, { 0x42, "EXT_I_2" }, { 0x43, "PI" }, { 0x44, "LITERAL_C" }, { 0x80, "EXT_T_0" }, { 0x81, "EXT_T_1" }, { 0x82, "EXT_T_2" }, { 0x83, "STR_T" }, { 0x84, "LITERAL_A" }, { 0xC0, "EXT_0" }, { 0xC1, "EXT_1" }, { 0xC2, "EXT_2" }, { 0xC3, "OPAQUE" }, { 0xC4, "LITERAL_AC" }, { 0x00, NULL } }; static value_string_ext vals_wbxml1x_global_tokens_ext = VALUE_STRING_EXT_INIT(vals_wbxml1x_global_tokens); /********************** WBXML token mapping definition **********************/ /* * NOTE: Please make sure the Attribute Start values all contain an equal sign * even in cases where they do not contain the start of an Attribute * Value. */ /* WML 1.0 * * Wireless Markup Language ***************************************/ static char * ext_t_0_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - escaped: '%s'", tvb_get_stringz_enc(wmem_packet_scope(), tvb, str_tbl + value, NULL, ENC_ASCII)); return str; } static char * ext_t_1_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - unescaped: '%s'", tvb_get_stringz_enc(wmem_packet_scope(), tvb, str_tbl + value, NULL, ENC_ASCII)); return str; } static char * ext_t_2_wml_10(tvbuff_t *tvb, guint32 value, guint32 str_tbl) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Variable substitution - no transformation: '%s'", tvb_get_stringz_enc(wmem_packet_scope(), tvb, str_tbl + value, NULL, ENC_ASCII)); return str; } /***** Global extension tokens *****/ static const value_string wbxml_wmlc10_global_cp0[] = { { 0x40, "Variable substitution - escaped" }, { 0x41, "Variable substitution - unescaped" }, { 0x42, "Variable substitution - no transformation" }, { 0x80, "Variable substitution - escaped" }, { 0x81, "Variable substitution - unescaped" }, { 0x82, "Variable substitution - no transformation" }, { 0xC0, "Reserved" }, { 0xC1, "Reserved" }, { 0xC2, "Reserved" }, { 0x00, NULL } }; /***** Tag tokens *****/ static const value_string wbxml_wmlc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ /* 0x05 -- 0x21 */ { 0x22, "A" }, { 0x23, "ACCESS" }, { 0x24, "B" }, { 0x25, "BIG" }, { 0x26, "BR" }, { 0x27, "CARD" }, { 0x28, "DO" }, { 0x29, "EM" }, { 0x2A, "FIELDSET" }, { 0x2B, "GO" }, { 0x2C, "HEAD" }, { 0x2D, "I" }, { 0x2E, "IMG" }, { 0x2F, "INPUT" }, { 0x30, "META" }, { 0x31, "NOOP" }, { 0x32, "PREV" }, { 0x33, "ONEVENT" }, { 0x34, "OPTGROUP" }, { 0x35, "OPTION" }, { 0x36, "REFRESH" }, { 0x37, "SELECT" }, { 0x38, "SMALL" }, { 0x39, "STRONG" }, { 0x3A, "TAB" }, { 0x3B, "TEMPLATE" }, { 0x3C, "TIMER" }, { 0x3D, "U" }, { 0x3E, "VAR" }, { 0x3F, "WML" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_wmlc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ACCEPT-CHARSET=" }, { 0x06, "ALIGN='BOTTOM'" }, { 0x07, "ALIGN='CENTER'" }, { 0x08, "ALIGN='LEFT'" }, { 0x09, "ALIGN='MIDDLE'" }, { 0x0A, "ALIGN='RIGHT'" }, { 0x0B, "ALIGN='TOP'" }, { 0x0C, "ALT=" }, { 0x0D, "CONTENT=" }, { 0x0E, "DEFAULT=" }, { 0x0F, "DOMAIN=" }, { 0x10, "EMPTYOK='FALSE'" }, { 0x11, "EMPTYOK='TRUE'" }, { 0x12, "FORMAT=" }, { 0x13, "HEIGHT=" }, { 0x14, "HSPACE=" }, { 0x15, "IDEFAULT=" }, { 0x16, "IKEY=" }, { 0x17, "KEY=" }, { 0x18, "LABEL=" }, { 0x19, "LOCALSRC=" }, { 0x1A, "MAXLENGTH=" }, { 0x1B, "METHOD='GET'" }, { 0x1C, "METHOD='POST'" }, { 0x1D, "MODE='NOWRAP'" }, { 0x1E, "MODE='WRAP'" }, { 0x1F, "MULTIPLE='FALSE'" }, { 0x20, "MULTIPLE='TRUE'" }, { 0x21, "NAME=" }, { 0x22, "NEWCONTEXT='FALSE'" }, { 0x23, "NEWCONTEXT='TRUE'" }, { 0x24, "ONCLICK=" }, { 0x25, "ONENTERBACKWARD=" }, { 0x26, "ONENTERFORWARD=" }, { 0x27, "ONTIMER=" }, { 0x28, "OPTIONAL='FALSE'" }, { 0x29, "OPTIONAL='TRUE'" }, { 0x2A, "PATH=" }, { 0x2B, "POSTDATA=" }, { 0x2C, "PUBLIC='FALSE'" }, { 0x2D, "PUBLIC='TRUE'" }, { 0x2E, "SCHEME=" }, { 0x2F, "SENDREFERER='FALSE'" }, { 0x30, "SENDREFERER='TRUE'" }, { 0x31, "SIZE=" }, { 0x32, "SRC=" }, { 0x33, "STYLE='LIST'" }, { 0x34, "STYLE='SET'" }, { 0x35, "TABINDEX=" }, { 0x36, "TITLE=" }, { 0x37, "TYPE=" }, { 0x38, "TYPE='ACCEPT'" }, { 0x39, "TYPE='DELETE'" }, { 0x3A, "TYPE='HELP'" }, { 0x3B, "TYPE='PASSWORD'" }, { 0x3C, "TYPE='ONCLICK'" }, { 0x3D, "TYPE='ONENTERBACKWARD'" }, { 0x3E, "TYPE='ONENTERFORWARD'" }, { 0x3F, "TYPE='ONTIMER'" }, /* 0x40 -- 0x44 GLOBAL */ { 0x45, "TYPE='OPTIONS'" }, { 0x46, "TYPE='PREV'" }, { 0x47, "TYPE='RESET'" }, { 0x48, "TYPE='TEXT'" }, { 0x49, "TYPE='vnd.'" }, { 0x4A, "URL=" }, { 0x4B, "URL='http://'" }, { 0x4C, "URL='https://'" }, { 0x4D, "USER-AGENT=" }, { 0x4E, "VALUE=" }, { 0x4F, "VSPACE=" }, { 0x50, "WIDTH=" }, { 0x51, "xml:lang=" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ static const value_string wbxml_wmlc10_attrValue_cp0[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "'.com/'" }, { 0x86, "'.edu/'" }, { 0x87, "'.net/'" }, { 0x88, "'.org/'" }, { 0x89, "'ACCEPT'" }, { 0x8A, "'BOTTOM'" }, { 0x8B, "'CLEAR'" }, { 0x8C, "'DELETE'" }, { 0x8D, "'HELP'" }, { 0x8E, "'http://'" }, { 0x8F, "'http://www.'" }, { 0x90, "'https://'" }, { 0x91, "'https://www.'" }, { 0x92, "'LIST'" }, { 0x93, "'MIDDLE'" }, { 0x94, "'NOWRAP'" }, { 0x95, "'ONCLICK'" }, { 0x96, "'ONENTERBACKWARD'" }, { 0x97, "'ONENTERFORWARD'" }, { 0x98, "'ONTIMER'" }, { 0x99, "'OPTIONS'" }, { 0x9A, "'PASSWORD'" }, { 0x9B, "'RESET'" }, { 0x9C, "'SET'" }, { 0x9D, "'TEXT'" }, { 0x9E, "'TOP'" }, { 0x9F, "'UNKNOWN'" }, { 0xA0, "'WRAP'" }, { 0xA1, "'www.'" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_wmlc10_global[] = { { 0, wbxml_wmlc10_global_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc10_tags[] = { { 0, wbxml_wmlc10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc10_attrStart[] = { { 0, wbxml_wmlc10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc10_attrValue[] = { { 0, wbxml_wmlc10_attrValue_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_wmlc_10 = { "Wireless Markup Language 1.0", "WML 1.0", { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wmlc10_global, wbxml_wmlc10_tags, wbxml_wmlc10_attrStart, wbxml_wmlc10_attrValue }; /* WML 1.1 * * Wireless Markup Language ***************************************/ /***** Global extension tokens *****/ /* Same as in WML 1.0 */ /***** Tag tokens *****/ static const value_string wbxml_wmlc11_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ /* 0x05 -- 0x1B */ { 0x1C, "a" }, { 0x1D, "td" }, { 0x1E, "tr" }, { 0x1F, "table" }, { 0x20, "p" }, { 0x21, "postfield" }, { 0x22, "anchor" }, { 0x23, "access" }, { 0x24, "b" }, { 0x25, "big" }, { 0x26, "br" }, { 0x27, "card" }, { 0x28, "do" }, { 0x29, "em" }, { 0x2A, "fieldset" }, { 0x2B, "go" }, { 0x2C, "head" }, { 0x2D, "i" }, { 0x2E, "img" }, { 0x2F, "input" }, { 0x30, "meta" }, { 0x31, "noop" }, { 0x32, "prev" }, { 0x33, "onevent" }, { 0x34, "optgroup" }, { 0x35, "option" }, { 0x36, "refresh" }, { 0x37, "select" }, { 0x38, "small" }, { 0x39, "strong" }, /* 0x3A */ { 0x3B, "template" }, { 0x3C, "timer" }, { 0x3D, "u" }, { 0x3E, "setvar" }, { 0x3F, "wml" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_wmlc11_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "accept-charset=" }, { 0x06, "align='bottom'" }, { 0x07, "align='center'" }, { 0x08, "align='left'" }, { 0x09, "align='middle'" }, { 0x0A, "align='right'" }, { 0x0B, "align='top'" }, { 0x0C, "alt=" }, { 0x0D, "content=" }, /* 0x0E */ { 0x0F, "domain=" }, { 0x10, "emptyok='false'" }, { 0x11, "emptyok='true'" }, { 0x12, "format=" }, { 0x13, "height=" }, { 0x14, "hspace=" }, { 0x15, "ivalue=" }, { 0x16, "iname=" }, /* 0x17 */ { 0x18, "label=" }, { 0x19, "localsrc=" }, { 0x1A, "maxlength=" }, { 0x1B, "method='get'" }, { 0x1C, "method='post'" }, { 0x1D, "mode='nowrap'" }, { 0x1E, "mode='wrap'" }, { 0x1F, "multiple='false'" }, { 0x20, "multiple='true'" }, { 0x21, "name=" }, { 0x22, "newcontext='false'" }, { 0x23, "newcontext='true'" }, { 0x24, "onpick=" }, { 0x25, "onenterbackward=" }, { 0x26, "onenterforward=" }, { 0x27, "ontimer=" }, { 0x28, "optional='false'" }, { 0x29, "optional='true'" }, { 0x2A, "path=" }, /* 0x2B -- 0x2D */ { 0x2E, "scheme=" }, { 0x2F, "sendreferer='false'" }, { 0x30, "sendreferer='true'" }, { 0x31, "size=" }, { 0x32, "src=" }, { 0x33, "ordered='false'" }, { 0x34, "ordered='true'" }, { 0x35, "tabindex=" }, { 0x36, "title=" }, { 0x37, "type=" }, { 0x38, "type='accept'" }, { 0x39, "type='delete'" }, { 0x3A, "type='help'" }, { 0x3B, "type='password'" }, { 0x3C, "type='onpick'" }, { 0x3D, "type='onenterbackward'" }, { 0x3E, "type='onenterforward'" }, { 0x3F, "type='ontimer'" }, /* 0x40 -- 0x44 GLOBAL */ { 0x45, "type='options'" }, { 0x46, "type='prev'" }, { 0x47, "type='reset'" }, { 0x48, "type='text'" }, { 0x49, "type='vnd.'" }, { 0x4A, "href=" }, { 0x4B, "href='http://'" }, { 0x4C, "href='https://'" }, { 0x4D, "value=" }, { 0x4E, "vspace=" }, { 0x4F, "width=" }, { 0x50, "xml:lang=" }, /* 0x51 */ { 0x52, "align=" }, { 0x53, "columns=" }, { 0x54, "class=" }, { 0x55, "id=" }, { 0x56, "forua='false'" }, { 0x57, "forua='true'" }, { 0x58, "src='http://'" }, { 0x59, "src='https://'" }, { 0x5A, "http-equiv=" }, { 0x5B, "http-equiv='Content-Type'" }, { 0x5C, "content='application/vnd.wap.wmlc;charset='" }, { 0x5D, "http-equiv='Expires'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ static const value_string wbxml_wmlc11_attrValue_cp0[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "'.com/'" }, { 0x86, "'.edu/'" }, { 0x87, "'.net/'" }, { 0x88, "'.org/'" }, { 0x89, "'accept'" }, { 0x8A, "'bottom'" }, { 0x8B, "'clear'" }, { 0x8C, "'delete'" }, { 0x8D, "'help'" }, { 0x8E, "'http://'" }, { 0x8F, "'http://www.'" }, { 0x90, "'https://'" }, { 0x91, "'https://www.'" }, /* 0x92 */ { 0x93, "'middle'" }, { 0x94, "'nowrap'" }, { 0x95, "'onpick'" }, { 0x96, "'onenterbackward'" }, { 0x97, "'onenterforward'" }, { 0x98, "'ontimer'" }, { 0x99, "'options'" }, { 0x9A, "'password'" }, { 0x9B, "'reset'" }, /* 0x9C */ { 0x9D, "'text'" }, { 0x9E, "'top'" }, { 0x9F, "'unknown'" }, { 0xA0, "'wrap'" }, { 0xA1, "'www.'" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_wmlc11_global[] = { { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */ { 0, NULL } }; static const value_valuestring wbxml_wmlc11_tags[] = { { 0, wbxml_wmlc11_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc11_attrStart[] = { { 0, wbxml_wmlc11_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc11_attrValue[] = { { 0, wbxml_wmlc11_attrValue_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_wmlc_11 = { "Wireless Markup Language 1.1", "WML 1.1", { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wmlc11_global, wbxml_wmlc11_tags, wbxml_wmlc11_attrStart, wbxml_wmlc11_attrValue }; /* WML 1.2 * * Wireless Markup Language ***************************************/ /***** Global extension tokens *****/ /* Same as in WML 1.0 */ /***** Tag tokens *****/ static const value_string wbxml_wmlc12_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ /* 0x05 -- 0x1A */ { 0x1B, "pre" }, { 0x1C, "a" }, { 0x1D, "td" }, { 0x1E, "tr" }, { 0x1F, "table" }, { 0x20, "p" }, { 0x21, "postfield" }, { 0x22, "anchor" }, { 0x23, "access" }, { 0x24, "b" }, { 0x25, "big" }, { 0x26, "br" }, { 0x27, "card" }, { 0x28, "do" }, { 0x29, "em" }, { 0x2A, "fieldset" }, { 0x2B, "go" }, { 0x2C, "head" }, { 0x2D, "i" }, { 0x2E, "img" }, { 0x2F, "input" }, { 0x30, "meta" }, { 0x31, "noop" }, { 0x32, "prev" }, { 0x33, "onevent" }, { 0x34, "optgroup" }, { 0x35, "option" }, { 0x36, "refresh" }, { 0x37, "select" }, { 0x38, "small" }, { 0x39, "strong" }, /* 0x3A */ { 0x3B, "template" }, { 0x3C, "timer" }, { 0x3D, "u" }, { 0x3E, "setvar" }, { 0x3F, "wml" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_wmlc12_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "accept-charset=" }, { 0x06, "align='bottom'" }, { 0x07, "align='center'" }, { 0x08, "align='left'" }, { 0x09, "align='middle'" }, { 0x0A, "align='right'" }, { 0x0B, "align='top'" }, { 0x0C, "alt=" }, { 0x0D, "content=" }, /* 0x0E */ { 0x0F, "domain=" }, { 0x10, "emptyok='false'" }, { 0x11, "emptyok='true'" }, { 0x12, "format=" }, { 0x13, "height=" }, { 0x14, "hspace=" }, { 0x15, "ivalue=" }, { 0x16, "iname=" }, /* 0x17 */ { 0x18, "label=" }, { 0x19, "localsrc=" }, { 0x1A, "maxlength=" }, { 0x1B, "method='get'" }, { 0x1C, "method='post'" }, { 0x1D, "mode='nowrap'" }, { 0x1E, "mode='wrap'" }, { 0x1F, "multiple='false'" }, { 0x20, "multiple='true'" }, { 0x21, "name=" }, { 0x22, "newcontext='false'" }, { 0x23, "newcontext='true'" }, { 0x24, "onpick=" }, { 0x25, "onenterbackward=" }, { 0x26, "onenterforward=" }, { 0x27, "ontimer=" }, { 0x28, "optional='false'" }, { 0x29, "optional='true'" }, { 0x2A, "path=" }, /* 0x2B -- 0x2D */ { 0x2E, "scheme=" }, { 0x2F, "sendreferer='false'" }, { 0x30, "sendreferer='true'" }, { 0x31, "size=" }, { 0x32, "src=" }, { 0x33, "ordered='false'" }, { 0x34, "ordered='true'" }, { 0x35, "tabindex=" }, { 0x36, "title=" }, { 0x37, "type=" }, { 0x38, "type='accept'" }, { 0x39, "type='delete'" }, { 0x3A, "type='help'" }, { 0x3B, "type='password'" }, { 0x3C, "type='onpick'" }, { 0x3D, "type='onenterbackward'" }, { 0x3E, "type='onenterforward'" }, { 0x3F, "type='ontimer'" }, /* 0x40 -- 0x44 GLOBAL */ { 0x45, "type='options'" }, { 0x46, "type='prev'" }, { 0x47, "type='reset'" }, { 0x48, "type='text'" }, { 0x49, "type='vnd.'" }, { 0x4A, "href=" }, { 0x4B, "href='http://'" }, { 0x4C, "href='https://'" }, { 0x4D, "value=" }, { 0x4E, "vspace=" }, { 0x4F, "width=" }, { 0x50, "xml:lang=" }, /* 0x51 */ { 0x52, "align=" }, { 0x53, "columns=" }, { 0x54, "class=" }, { 0x55, "id=" }, { 0x56, "forua='false'" }, { 0x57, "forua='true'" }, { 0x58, "src='http://'" }, { 0x59, "src='https://'" }, { 0x5A, "http-equiv=" }, { 0x5B, "http-equiv='Content-Type'" }, { 0x5C, "content='application/vnd.wap.wmlc;charset='" }, { 0x5D, "http-equiv='Expires'" }, { 0x5E, "accesskey=" }, { 0x5F, "enctype=" }, { 0x60, "enctype='application/x-www-form-urlencoded'" }, { 0x61, "enctype='multipart/form-data'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* Same as in WML 1.1 */ /***** Token code page aggregation *****/ static const value_valuestring wbxml_wmlc12_global[] = { { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */ { 0, NULL } }; static const value_valuestring wbxml_wmlc12_tags[] = { { 0, wbxml_wmlc12_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc12_attrStart[] = { { 0, wbxml_wmlc12_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc12_attrValue[] = { { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */ { 0, NULL } }; static const wbxml_decoding decode_wmlc_12 = { "Wireless Markup Language 1.2", "WML 1.2", { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wmlc12_global, wbxml_wmlc12_tags, wbxml_wmlc12_attrStart, wbxml_wmlc12_attrValue }; /* WML 1.3 * * Wireless Markup Language ***************************************/ /***** Global extension tokens *****/ /* Same as in WML 1.0 */ /***** Tag tokens *****/ /* Same as in WML 1.2 */ /***** Attribute Start tokens *****/ static const value_string wbxml_wmlc13_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "accept-charset=" }, { 0x06, "align='bottom'" }, { 0x07, "align='center'" }, { 0x08, "align='left'" }, { 0x09, "align='middle'" }, { 0x0A, "align='right'" }, { 0x0B, "align='top'" }, { 0x0C, "alt=" }, { 0x0D, "content=" }, /* 0x0E */ { 0x0F, "domain=" }, { 0x10, "emptyok='false'" }, { 0x11, "emptyok='true'" }, { 0x12, "format=" }, { 0x13, "height=" }, { 0x14, "hspace=" }, { 0x15, "ivalue=" }, { 0x16, "iname=" }, /* 0x17 */ { 0x18, "label=" }, { 0x19, "localsrc=" }, { 0x1A, "maxlength=" }, { 0x1B, "method='get'" }, { 0x1C, "method='post'" }, { 0x1D, "mode='nowrap'" }, { 0x1E, "mode='wrap'" }, { 0x1F, "multiple='false'" }, { 0x20, "multiple='true'" }, { 0x21, "name=" }, { 0x22, "newcontext='false'" }, { 0x23, "newcontext='true'" }, { 0x24, "onpick=" }, { 0x25, "onenterbackward=" }, { 0x26, "onenterforward=" }, { 0x27, "ontimer=" }, { 0x28, "optional='false'" }, { 0x29, "optional='true'" }, { 0x2A, "path=" }, /* 0x2B -- 0x2D */ { 0x2E, "scheme=" }, { 0x2F, "sendreferer='false'" }, { 0x30, "sendreferer='true'" }, { 0x31, "size=" }, { 0x32, "src=" }, { 0x33, "ordered='false'" }, { 0x34, "ordered='true'" }, { 0x35, "tabindex=" }, { 0x36, "title=" }, { 0x37, "type=" }, { 0x38, "type='accept'" }, { 0x39, "type='delete'" }, { 0x3A, "type='help'" }, { 0x3B, "type='password'" }, { 0x3C, "type='onpick'" }, { 0x3D, "type='onenterbackward'" }, { 0x3E, "type='onenterforward'" }, { 0x3F, "type='ontimer'" }, /* 0x40 -- 0x44 GLOBAL */ { 0x45, "type='options'" }, { 0x46, "type='prev'" }, { 0x47, "type='reset'" }, { 0x48, "type='text'" }, { 0x49, "type='vnd.'" }, { 0x4A, "href=" }, { 0x4B, "href='http://'" }, { 0x4C, "href='https://'" }, { 0x4D, "value=" }, { 0x4E, "vspace=" }, { 0x4F, "width=" }, { 0x50, "xml:lang=" }, /* 0x51 */ { 0x52, "align=" }, { 0x53, "columns=" }, { 0x54, "class=" }, { 0x55, "id=" }, { 0x56, "forua='false'" }, { 0x57, "forua='true'" }, { 0x58, "src='http://'" }, { 0x59, "src='https://'" }, { 0x5A, "http-equiv=" }, { 0x5B, "http-equiv='Content-Type'" }, { 0x5C, "content='application/vnd.wap.wmlc;charset='" }, { 0x5D, "http-equiv='Expires'" }, { 0x5E, "accesskey=" }, { 0x5F, "enctype=" }, { 0x60, "enctype='application/x-www-form-urlencoded'" }, { 0x61, "enctype='multipart/form-data'" }, { 0x62, "xml:space='preserve'" }, { 0x63, "xml:space='default'" }, { 0x64, "cache-control='no-cache'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* Same as in WML 1.1 */ /***** Token code page aggregation *****/ static const value_valuestring wbxml_wmlc13_global[] = { { 0, wbxml_wmlc10_global_cp0 }, /* Same as WML 1.0 */ { 0, NULL } }; static const value_valuestring wbxml_wmlc13_tags[] = { { 0, wbxml_wmlc12_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc13_attrStart[] = { { 0, wbxml_wmlc13_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wmlc13_attrValue[] = { { 0, wbxml_wmlc11_attrValue_cp0 }, /* Same as WML 1.1 */ { 0, NULL } }; static const wbxml_decoding decode_wmlc_13 = { "Wireless Markup Language 1.3", "WML 1.3", { ext_t_0_wml_10, ext_t_1_wml_10, ext_t_2_wml_10 }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wmlc13_global, wbxml_wmlc13_tags, wbxml_wmlc13_attrStart, wbxml_wmlc13_attrValue }; /* SI 1.0 * * Service Indication ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_sic10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "si" }, { 0x06, "indication" }, { 0x07, "info" }, { 0x08, "item" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_sic10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "action='signal-none'" }, { 0x06, "action='signal-low'" }, { 0x07, "action='signal-medium'" }, { 0x08, "action='signal-high'" }, { 0x09, "action='delete'" }, { 0x0a, "created=" }, { 0x0b, "href=" }, { 0x0c, "href='http://'" }, { 0x0d, "href='http://www.'" }, { 0x0e, "href='https://'" }, { 0x0f, "href='https://www.'" }, { 0x10, "si-expires=" }, { 0x11, "si-id=" }, { 0x12, "class=" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ static const value_string wbxml_sic10_attrValue_cp0[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "'.com/'" }, { 0x86, "'.edu/'" }, { 0x87, "'.net/'" }, { 0x88, "'.org/'" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_sic10_tags[] = { { 0, wbxml_sic10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_sic10_attrStart[] = { { 0, wbxml_sic10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_sic10_attrValue[] = { { 0, wbxml_sic10_attrValue_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_sic_10 = { "Service Indication 1.0", "SI 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, sic10_opaque_binary_attr, sic10_opaque_literal_attr, NULL, wbxml_sic10_tags, wbxml_sic10_attrStart, wbxml_sic10_attrValue }; /* SL 1.0 * * Service Loading ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_slc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "sl" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_slc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "action='execute-low'" }, { 0x06, "action='execute-high'" }, { 0x07, "action='cache'" }, { 0x08, "href=" }, { 0x09, "href='http://'" }, { 0x0a, "href='http://www.'" }, { 0x0b, "href='https://'" }, { 0x0c, "href='https://www.'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* Same as in SI 1.0 */ /***** Token code page aggregation *****/ static const value_valuestring wbxml_slc10_tags[] = { { 0, wbxml_slc10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_slc10_attrStart[] = { { 0, wbxml_slc10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_slc10_attrValue[] = { { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */ { 0, NULL } }; static const wbxml_decoding decode_slc_10 = { "Service Loading 1.0", "SL 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_slc10_tags, wbxml_slc10_attrStart, wbxml_slc10_attrValue }; /* CO 1.0 * * Cache Operation ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_coc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "co" }, { 0x06, "invalidate-object" }, { 0x07, "invalidate-service" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_coc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "uri=" }, { 0x06, "uri='http://'" }, { 0x07, "uri='http://www.'" }, { 0x08, "uri='https://'" }, { 0x09, "uri='https://www.'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* Same as in SI 1.0 */ /***** Token code page aggregation *****/ static const value_valuestring wbxml_coc10_tags[] = { { 0, wbxml_coc10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_coc10_attrStart[] = { { 0, wbxml_coc10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_coc10_attrValue[] = { { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */ { 0, NULL } }; static const wbxml_decoding decode_coc_10 = { "Cache Operation 1.0", "CO 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_coc10_tags, wbxml_coc10_attrStart, wbxml_coc10_attrValue }; /* PROV 1.0 * * Client Provisioning ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_provc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "wap-provisioningdoc" }, { 0x06, "characteristic" }, { 0x07, "parm" }, { 0x00, NULL } }; static const value_string wbxml_provc10_tags_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ /* 0x05 */ { 0x06, "characteristic" }, { 0x07, "parm" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_provc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "name=" }, { 0x06, "value=" }, { 0x07, "name='NAME'" }, { 0x08, "name='NAP-ADDRESS'" }, { 0x09, "name='NAP-ADDRTYPE'" }, { 0x0A, "name='CALLTYPE'" }, { 0x0B, "name='VALIDUNTIL'" }, { 0x0C, "name='AUTHTYPE'" }, { 0x0D, "name='AUTHNAME'" }, { 0x0E, "name='AUTHSECRET'" }, { 0x0F, "name='LINGER'" }, { 0x10, "name='BEARER'" }, { 0x11, "name='NAPID'" }, { 0x12, "name='COUNTRY'" }, { 0x13, "name='NETWORK'" }, { 0x14, "name='INTERNET'" }, { 0x15, "name='PROXY-ID'" }, { 0x16, "name='PROXY-PROVIDER-ID'" }, { 0x17, "name='DOMAIN'" }, { 0x18, "name='PROVURL'" }, { 0x19, "name='PXAUTH-TYPE'" }, { 0x1A, "name='PXAUTH-ID'" }, { 0x1B, "name='PXAUTH-PW'" }, { 0x1C, "name='STARTPAGE'" }, { 0x1D, "name='BASAUTH-ID'" }, { 0x1E, "name='BASAUTH-PW'" }, { 0x1F, "name='PUSHENABLED'" }, { 0x20, "name='PXADDR'" }, { 0x21, "name='PXADDRTYPE'" }, { 0x22, "name='TO-NAPID'" }, { 0x23, "name='PORTNBR'" }, { 0x24, "name='SERVICE'" }, { 0x25, "name='LINKSPEED'" }, { 0x26, "name='DNLINKSPEED'" }, { 0x27, "name='LOCAL-ADDR'" }, { 0x28, "name='LOCAL-ADDRTYPE'" }, { 0x29, "name='CONTEXT-ALLOW'" }, { 0x2A, "name='TRUST'" }, { 0x2B, "name='MASTER'" }, { 0x2C, "name='SID'" }, { 0x2D, "name='SOC'" }, { 0x2E, "name='WSP-VERSION'" }, { 0x2F, "name='PHYSICAL-PROXY-ID'" }, { 0x30, "name='CLIENT-ID'" }, { 0x31, "name='DELIVERY-ERR-SDU'" }, { 0x32, "name='DELIVERY-ORDER'" }, { 0x33, "name='TRAFFIC-CLASS'" }, { 0x34, "name='MAX-SDU-SIZE'" }, { 0x35, "name='MAX-BITRATE-UPLINK'" }, { 0x36, "name='MAX-BITRATE-DNLINK'" }, { 0x37, "name='RESIDUAL-BER'" }, { 0x38, "name='SDU-ERROR-RATIO'" }, { 0x39, "name='TRAFFIC-HANDL-PRIO'" }, { 0x3A, "name='TRANSFER-DELAY'" }, { 0x3B, "name='GUARANTEED-BITRATE-UPLINK'" }, { 0x3C, "name='GUARANTEED-BITRATE-DNLINK'" }, { 0x3D, "name='PXADDR-FQDN'" }, { 0x3E, "name='PROXY-PW'" }, { 0x3F, "name='PPGAUTH-TYPE'" }, /* 0x40 -- 0x44 GLOBAL */ { 0x45, "version=" }, { 0x46, "version='1.0'" }, { 0x47, "name='PULLENABLED'" }, { 0x48, "name='DNS-ADDR'" }, { 0x49, "name='MAX-NUM-RETRY'" }, { 0x4A, "name='FIRST-RETRY-TIMEOUT'" }, { 0x4B, "name='REREG-THRESHOLD'" }, { 0x4C, "name='T-BIT'" }, /* 0x4D */ { 0x4E, "name='AUTH-ENTITY'" }, { 0x4F, "name='SPI'" }, { 0x50, "type=" }, { 0x51, "type='PXLOGICAL'" }, { 0x52, "type='PXPHYSICAL'" }, { 0x53, "type='PORT'" }, { 0x54, "type='VALIDITY'" }, { 0x55, "type='NAPDEF'" }, { 0x56, "type='BOOTSTRAP'" }, { 0x57, "type='VENDORCONFIG'" }, { 0x58, "type='CLIENTIDENTITY'" }, { 0x59, "type='PXAUTHINFO'" }, { 0x5A, "type='NAPAUTHINFO'" }, { 0x5B, "type='ACCESS'" }, { 0x00, NULL } }; static const value_string wbxml_provc10_attrStart_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ /* 0x05 -- 0x06 */ { 0x07, "name='NAME'" }, /* 0x08 -- 0x13 */ { 0x14, "name='INTERNET'" }, /* 0x15 -- 0x1B */ { 0x1C, "name='STARTPAGE'" }, /* 0x1D -- 0x21 */ { 0x22, "name='TO-NAPID'" }, { 0x23, "name='PORTNBR'" }, { 0x24, "name='SERVICE'" }, /* 0x25 -- 0x2D */ { 0x2E, "name='AACCEPT'" }, { 0x2F, "name='AAUTHDATA'" }, { 0x30, "name='AAUTHLEVEL'" }, { 0x31, "name='AAUTHNAME'" }, { 0x32, "name='AAUTHSECRET'" }, { 0x33, "name='AAUTHTYPE'" }, { 0x34, "name='ADDR'" }, { 0x35, "name='ADDRTYPE'" }, { 0x36, "name='APPID'" }, { 0x37, "name='APROTOCOL'" }, { 0x38, "name='PROVIDER-ID'" }, { 0x39, "name='TO-PROXY'" }, { 0x3A, "name='URI'" }, { 0x3B, "name='RULE'" }, /* 0x3C -- 0x3F */ /* 0x40 -- 0x44 GLOBAL */ /* 0x45 -- 0x4F */ { 0x50, "type=" }, /* 0x51 -- 0x52 */ { 0x53, "type='PORT'" }, /* 0x54 */ { 0x55, "type='APPLICATION'" }, { 0x56, "type='APPADDR'" }, { 0x57, "type='APPAUTH'" }, { 0x58, "type='CLIENTIDENTITY'" }, { 0x59, "type='RESOURCE'" }, /* 0x5A -- 0x7F */ { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_provc10_attrValue_cp0[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "'IPV4'" }, { 0x86, "'IPV6'" }, { 0x87, "'E164'" }, { 0x88, "'ALPHA'" }, { 0x89, "'APN'" }, { 0x8A, "'SCODE'" }, { 0x8B, "'TETRA-ITSI'" }, { 0x8C, "'MAN'" }, /* 0x8D -- 0x8F */ { 0x90, "'ANALOG-MODEM'" }, { 0x91, "'V.120'" }, { 0x92, "'V.110'" }, { 0x93, "'X.31'" }, { 0x94, "'BIT-TRANSPARENT'" }, { 0x95, "'DIRECT-ASYNCHRONOUS-DATA-SERVICE'" }, /* 0x96 -- 0x99 */ { 0x9A, "'PAP'" }, { 0x9B, "'CHAP'" }, { 0x9C, "'HTTP-BASIC'" }, { 0x9D, "'HTTP-DIGEST'" }, { 0x9E, "'WTLS-SS'" }, { 0x9F, "'MD5'" }, /* 0xA0 -- 0xA1 */ { 0xA2, "'GSM-USSD'" }, { 0xA3, "'GSM-SMS'" }, { 0xA4, "'ANSI-136-GUTS'" }, { 0xA5, "'IS-95-CDMA-SMS'" }, { 0xA6, "'IS-95-CDMA-CSD'" }, { 0xA7, "'IS-95-CDMA-PACKET'" }, { 0xA8, "'ANSI-136-CSD'" }, { 0xA9, "'ANSI-136-GPRS'" }, { 0xAA, "'GSM-CSD'" }, { 0xAB, "'GSM-GPRS'" }, { 0xAC, "'AMPS-CDPD'" }, { 0xAD, "'PDC-CSD'" }, { 0xAE, "'PDC-PACKET'" }, { 0xAF, "'IDEN-SMS'" }, { 0xB0, "'IDEN-CSD'" }, { 0xB1, "'IDEN-PACKET'" }, { 0xB2, "'FLEX/REFLEX'" }, { 0xB3, "'PHS-SMS'" }, { 0xB4, "'PHS-CSD'" }, { 0xB5, "'TETRA-SDS'" }, { 0xB6, "'TETRA-PACKET'" }, { 0xB7, "'ANSI-136-GHOST'" }, { 0xB8, "'MOBITEX-MPAK'" }, { 0xB9, "'CDMA2000-IX-SIMPLE-IP'" }, { 0xBA, "'CDMA2000-IX-MOBILE-IP'" }, /* 0xBB -- 0xBF */ /* 0xC0 -- 0xC4 GLOBAL */ { 0xC5, "'AUTOBAUDING'" }, /* 0xC6 -- 0xC9 */ { 0xCA, "'CL-WSP'" }, { 0xCB, "'CO-WSP'" }, { 0xCC, "'CL-SEC-WSP'" }, { 0xCD, "'CO-SEC-WSP'" }, { 0xCE, "'CL-SEC-WTA'" }, { 0xCF, "'CO-SEC-WTA'" }, { 0xD0, "'OTA-HTTP-TO'" }, { 0xD1, "'OTA-HTTP-TLS-TO'" }, { 0xD2, "'OTA-HTTP-PO'" }, { 0xD3, "'OTA-HTTP-TLS-PO'" }, /* 0xD4 -- 0xFF */ { 0x00, NULL } }; static const value_string wbxml_provc10_attrValue_cp1[] = { /* 0x80 -- 0x84 GLOBAL */ /* 0x85 */ { 0x86, "'IPV6'" }, { 0x87, "'E164'" }, { 0x88, "'ALPHA'" }, { 0x8D, "'APPSRV'" }, { 0x8E, "'OBEX'" }, /* 0x8F */ /* XXX - Errors that require a fix in the OMA/WAP Client Provisioning specs: { 0xXXX, "','" }, { 0xXXX, "'HTTP-'" }, { 0xXXX, "'BASIC'" }, { 0xXXX, "'DIGEST'" }, */ { 0xE0, "'AAA'" }, { 0xE1, "'HA'" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_provc10_tags[] = { { 0, wbxml_provc10_tags_cp0 }, { 1, wbxml_provc10_tags_cp1 }, { 0, NULL } }; static const value_valuestring wbxml_provc10_attrStart[] = { { 0, wbxml_provc10_attrStart_cp0 }, { 1, wbxml_provc10_attrStart_cp1 }, { 0, NULL } }; static const value_valuestring wbxml_provc10_attrValue[] = { { 0, wbxml_provc10_attrValue_cp0 }, { 1, wbxml_provc10_attrValue_cp1 }, { 0, NULL } }; static const wbxml_decoding decode_provc_10 = { "WAP Client Provisioning Document 1.0", "WAP ProvisioningDoc 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_provc10_tags, wbxml_provc10_attrStart, wbxml_provc10_attrValue }; /* EMN 1.0 * * Email Notification ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_emnc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "emn" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_emnc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "timestamp=" }, { 0x06, "mailbox=" }, { 0x07, "mailbox='mailat:'" }, { 0x08, "mailbox='pop://'" }, { 0x09, "mailbox='imap://'" }, { 0x0a, "mailbox='http://'" }, { 0x0b, "mailbox='http://www.'" }, { 0x0c, "mailbox='https://'" }, { 0x0D, "mailbox='https://www.'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* Same as in SI 1.0 */ /***** Token code page aggregation *****/ static const value_valuestring wbxml_emnc10_tags[] = { { 0, wbxml_emnc10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_emnc10_attrStart[] = { { 0, wbxml_emnc10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_emnc10_attrValue[] = { { 0, wbxml_sic10_attrValue_cp0 }, /* Same as SI 1.0 */ { 0, NULL } }; static const wbxml_decoding decode_emnc_10 = { "E-Mail Notification 1.0", "EMN 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, emnc10_opaque_binary_attr, emnc10_opaque_literal_attr, NULL, wbxml_emnc10_tags, wbxml_emnc10_attrStart, wbxml_emnc10_attrValue }; /* SyncML 1.0 * * SyncML Representation Protocol ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_syncmlc10_tags_cp0[] = { /* SyncML 1.0 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Add" }, { 0x06, "Alert" }, { 0x07, "Archive" }, { 0x08, "Atomic" }, { 0x09, "Chal" }, { 0x0A, "Cmd" }, { 0x0B, "CmdID" }, { 0x0C, "CmdRef" }, { 0x0D, "Copy" }, { 0x0E, "Cred" }, { 0x0F, "Data" }, { 0x10, "Delete" }, { 0x11, "Exec" }, { 0x12, "Final" }, { 0x13, "Get" }, { 0x14, "Item" }, { 0x15, "Lang" }, { 0x16, "LocName" }, { 0x17, "LocURI" }, { 0x18, "Map" }, { 0x19, "MapItem" }, { 0x1A, "Meta" }, { 0x1B, "MsgID" }, { 0x1C, "MsgRef" }, { 0x1D, "NoResp" }, { 0x1E, "NoResults" }, { 0x1F, "Put" }, { 0x20, "Replace" }, { 0x21, "RespURI" }, { 0x22, "Results" }, { 0x23, "Search" }, { 0x24, "Sequence" }, { 0x25, "SessionID" }, { 0x26, "SftDel" }, { 0x27, "Source" }, { 0x28, "SourceRef" }, { 0x29, "Status" }, { 0x2A, "Sync" }, { 0x2B, "SyncBody" }, { 0x2C, "SyncHdr" }, { 0x2D, "SyncML" }, { 0x2E, "Target" }, { 0x2F, "TargetRef" }, /* 0x30 - Reserved */ { 0x31, "VerDTD" }, { 0x32, "VerProto" }, { 0x00, NULL } }; static const value_string wbxml_syncmlc10_tags_cp1[] = { /* MetInf 1.0 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Anchor" }, { 0x06, "EMI" }, { 0x07, "Format" }, { 0x08, "FreeID" }, { 0x09, "FreeMem" }, { 0x0A, "Last" }, { 0x0B, "Mark" }, { 0x0C, "MaxMsgSize" }, { 0x0D, "Mem" }, { 0x0E, "MetInf" }, { 0x0F, "Next" }, { 0x10, "NextNonce" }, { 0x11, "SharedMem" }, { 0x12, "Size" }, { 0x13, "Type" }, { 0x14, "Version" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_syncmlc10_tags[] = { { 0, wbxml_syncmlc10_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.0//EN */ { 1, wbxml_syncmlc10_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.0//EN */ { 0, NULL } }; static const wbxml_decoding decode_syncmlc_10 = { "SyncML Representation Protocol 1.0", "SyncML 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_syncmlc10_tags, NULL, NULL }; /* SyncML 1.1 * * SyncML Representation Protocol ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_syncmlc11_tags_cp0[] = { /* SyncML 1.1 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Add" }, { 0x06, "Alert" }, { 0x07, "Archive" }, { 0x08, "Atomic" }, { 0x09, "Chal" }, { 0x0a, "Cmd" }, { 0x0b, "CmdID" }, { 0x0c, "CmdRef" }, { 0x0d, "Copy" }, { 0x0e, "Cred" }, { 0x0f, "Data" }, { 0x10, "Delete" }, { 0x11, "Exec" }, { 0x12, "Final" }, { 0x13, "Get" }, { 0x14, "Item" }, { 0x15, "Lang" }, { 0x16, "LocName" }, { 0x17, "LocURI" }, { 0x18, "Map" }, { 0x19, "MapItem" }, { 0x1a, "Meta" }, { 0x1b, "MsgID" }, { 0x1c, "MsgRef" }, { 0x1d, "NoResp" }, { 0x1e, "NoResults" }, { 0x1f, "Put" }, { 0x20, "Replace" }, { 0x21, "RespURI" }, { 0x22, "Results" }, { 0x23, "Search" }, { 0x24, "Sequence" }, { 0x25, "SessionID" }, { 0x26, "SftDel" }, { 0x27, "Source" }, { 0x28, "SourceRef" }, { 0x29, "Status" }, { 0x2a, "Sync" }, { 0x2b, "SyncBody" }, { 0x2c, "SyncHdr" }, { 0x2d, "SyncML" }, { 0x2e, "Target" }, { 0x2f, "TargetRef" }, /* 0x30 - Reserved */ { 0x31, "VerDTD" }, { 0x32, "VerProto" }, { 0x33, "NumberOfChanges" }, { 0x34, "MoreData" }, { 0x00, NULL } }; static const value_string wbxml_syncmlc11_tags_cp1[] = { /* MetInf 1.1 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Anchor" }, { 0x06, "EMI" }, { 0x07, "Format" }, { 0x08, "FreeID" }, { 0x09, "FreeMem" }, { 0x0A, "Last" }, { 0x0B, "Mark" }, { 0x0C, "MaxMsgSize" }, { 0x0D, "Mem" }, { 0x0E, "MetInf" }, { 0x0F, "Next" }, { 0x10, "NextNonce" }, { 0x11, "SharedMem" }, { 0x12, "Size" }, { 0x13, "Type" }, { 0x14, "Version" }, { 0x15, "MaxObjSize" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_syncmlc11_tags[] = { { 0, wbxml_syncmlc11_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.1//EN */ { 1, wbxml_syncmlc11_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.1//EN */ { 0, NULL } }; static const wbxml_decoding decode_syncmlc_11 = { "SyncML Representation Protocol 1.1", "SyncML 1.1", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_syncmlc11_tags, NULL, NULL }; /* SyncML 1.2 * * SyncML Representation Protocol ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_syncmlc12_tags_cp0[] = { /* SyncML 1.2 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Add" }, { 0x06, "Alert" }, { 0x07, "Archive" }, { 0x08, "Atomic" }, { 0x09, "Chal" }, { 0x0a, "Cmd" }, { 0x0b, "CmdID" }, { 0x0c, "CmdRef" }, { 0x0d, "Copy" }, { 0x0e, "Cred" }, { 0x0f, "Data" }, { 0x10, "Delete" }, { 0x11, "Exec" }, { 0x12, "Final" }, { 0x13, "Get" }, { 0x14, "Item" }, { 0x15, "Lang" }, { 0x16, "LocName" }, { 0x17, "LocURI" }, { 0x18, "Map" }, { 0x19, "MapItem" }, { 0x1a, "Meta" }, { 0x1b, "MsgID" }, { 0x1c, "MsgRef" }, { 0x1d, "NoResp" }, { 0x1e, "NoResults" }, { 0x1f, "Put" }, { 0x20, "Replace" }, { 0x21, "RespURI" }, { 0x22, "Results" }, { 0x23, "Search" }, { 0x24, "Sequence" }, { 0x25, "SessionID" }, { 0x26, "SftDel" }, { 0x27, "Source" }, { 0x28, "SourceRef" }, { 0x29, "Status" }, { 0x2a, "Sync" }, { 0x2b, "SyncBody" }, { 0x2c, "SyncHdr" }, { 0x2d, "SyncML" }, { 0x2e, "Target" }, { 0x2f, "TargetRef" }, /* 0x30 - Reserved */ { 0x31, "VerDTD" }, { 0x32, "VerProto" }, { 0x33, "NumberOfChanges" }, { 0x34, "MoreData" }, { 0x35, "Field" }, { 0x36, "Filter" }, { 0x37, "Record" }, { 0x38, "FilterType" }, { 0x39, "SourceParent" }, { 0x3a, "TargetParent" }, { 0x3b, "Move" }, { 0x3c, "Correlator" }, { 0x00, NULL } }; static const value_string wbxml_syncmlc12_tags_cp1[] = { /* MetInf 1.2 */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Anchor" }, { 0x06, "EMI" }, { 0x07, "Format" }, { 0x08, "FreeID" }, { 0x09, "FreeMem" }, { 0x0A, "Last" }, { 0x0B, "Mark" }, { 0x0C, "MaxMsgSize" }, { 0x0D, "Mem" }, { 0x0E, "MetInf" }, { 0x0F, "Next" }, { 0x10, "NextNonce" }, { 0x11, "SharedMem" }, { 0x12, "Size" }, { 0x13, "Type" }, { 0x14, "Version" }, { 0x15, "MaxObjSize" }, { 0x16, "FieldLevel" }, { 0x17, "FP" }, /* Extensions on certain devices */ { 0x18, "ID" }, /* Extensions on certain devices */ { 0x19, "IDContainer" }, /* Extensions on certain devices */ { 0x1a, "IDPair" }, /* Extensions on certain devices */ { 0x00, NULL } }; /***** Attribute Start tokens *****/ /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_syncmlc12_tags[] = { { 0, wbxml_syncmlc12_tags_cp0 }, /* -//SYNCML//DTD SyncML 1.2//EN */ { 1, wbxml_syncmlc12_tags_cp1 }, /* -//SYNCML//DTD MetInf 1.2//EN */ /* Note: 02 reserved for DM use */ { 0, NULL } }; static const wbxml_decoding decode_syncmlc_12 = { "SyncML Representation Protocol 1.2", "SyncML 1.2", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_syncmlc12_tags, NULL, NULL }; /* Microsoft ActiveSync 1.0 (Actual Version Unknown - either 1.0 or 2.0, taken from [MS-ASWBXML].pdf) * * ActiveSync Representation Protocol ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_mssyncc10_tags_cp0[] = { /* ActiveSync 'AirSync:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Sync" }, { 0x06, "Responses" }, { 0x07, "Add" }, { 0x08, "Change" }, { 0x09, "Delete" }, { 0x0A, "Fetch" }, { 0x0B, "SyncKey" }, { 0x0C, "ClientId" }, { 0x0D, "ServerId" }, { 0x0E, "Status" }, { 0x0F, "Collection" }, { 0x10, "Class" }, { 0x12, "CollectionId" }, { 0x13, "GetChanges" }, { 0x14, "MoreAvailable" }, { 0x15, "WindowSize" }, { 0x16, "Commands" }, { 0x17, "Options" }, { 0x18, "FilterType" }, { 0x1B, "Conflict" }, { 0x1C, "Collections" }, { 0x1D, "ApplicationData" }, { 0x1E, "DeletesAsMoves" }, { 0x20, "Supported" }, { 0x21, "SoftDelete" }, { 0x22, "MIMESupport" }, { 0x23, "MIMETruncation" }, { 0x24, "Wait" }, { 0x25, "Limit" }, { 0x26, "Partial" }, { 0x27, "ConversationMode" }, { 0x28, "MaxItems" }, { 0x29, "HeartbeatInterval" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp1[] = { /* ActiveSync 'Contacts:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Anniversary" }, { 0x06, "AssistantName" }, { 0x07, "AssistantTelephoneNumber" }, { 0x08, "Birthday" }, { 0x0C, "Business2PhoneNumber" }, { 0x0D, "BusinessCity" }, { 0x0E, "BusinessCountry" }, { 0x0F, "BusinessPostalCode" }, { 0x10, "BusinessState" }, { 0x11, "BusinessStreet" }, { 0x12, "BusinessFaxNumber" }, { 0x13, "BusinessPhoneNumber" }, { 0x14, "CarPhoneNumber" }, { 0x15, "Categories" }, { 0x16, "Category" }, { 0x17, "Children" }, { 0x18, "Child" }, { 0x19, "CompanyName" }, { 0x1A, "Department" }, { 0x1B, "Email1Address" }, { 0x1C, "Email2Address" }, { 0x1D, "Email3Address" }, { 0x1E, "FileAs" }, { 0x1F, "FirstName" }, { 0x20, "Home2PhoneNumber" }, { 0x21, "HomeCity" }, { 0x22, "HomeCountry" }, { 0x23, "HomePostalCode" }, { 0x24, "HomeState" }, { 0x25, "HomeStreet" }, { 0x26, "HomeFaxNumber" }, { 0x27, "HomePhoneNumber" }, { 0x29, "JobTitle" }, { 0x2A, "MiddleName" }, { 0x2B, "MobilePhoneNumber" }, { 0x2C, "OfficeLocation" }, { 0x2D, "OtherCity" }, { 0x2E, "OtherCountry" }, { 0x2F, "OtherPostalCode" }, { 0x30, "OtherState" }, { 0x31, "OtherStreet" }, { 0x32, "PagerNumber" }, { 0x33, "RadioPhoneNumber" }, { 0x34, "Spouse" }, { 0x35, "Suffix" }, { 0x36, "Title" }, { 0x37, "Webpage" }, { 0x38, "YomiCompanyName" }, { 0x39, "YomiFirstName" }, { 0x3A, "YomiLastName" }, { 0x3C, "Picture" }, { 0x3D, "Alias" }, { 0x3E, "WeightedRank" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp2[] = { /* ActiveSync 'Email:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x0F, "DateReceived" }, { 0x11, "DisplayTo" }, { 0x12, "Importance" }, { 0x13, "MessageClass" }, { 0x14, "Subject" }, { 0x15, "Read" }, { 0x16, "To" }, { 0x17, "CC" }, { 0x18, "From" }, { 0x19, "ReplyTo" }, { 0x1A, "AllDayEvent" }, { 0x1B, "Categories" }, { 0x1C, "Category" }, { 0x1D, "DTStamp" }, { 0x1E, "EndTime" }, { 0x1F, "InstanceType" }, { 0x20, "BusyStatus" }, { 0x21, "Location" }, { 0x22, "MeetingRequest" }, { 0x23, "Organizer" }, { 0x24, "RecurrenceId" }, { 0x25, "Reminder" }, { 0x26, "ResponseRequest" }, { 0x27, "Recurrences" }, { 0x28, "Recurrence" }, { 0x29, "Recurrence_Type" }, { 0x2A, "Recurrence_Until" }, { 0x2B, "Recurrence_Occurrences" }, { 0x2C, "Recurrence_Interval" }, { 0x2D, "Recurrence_DayOfWeek" }, { 0x2E, "Recurrence_DayOfMonth" }, { 0x2F, "Recurrence_WeekOfMonth" }, { 0x30, "Recurrence_MonthOfYear" }, { 0x31, "StartTime" }, { 0x32, "Sensitivity" }, { 0x33, "TimeZone" }, { 0x34, "GlobalObjId" }, { 0x35, "ThreadTopic" }, { 0x39, "InternetCPID" }, { 0x3A, "Flag" }, { 0x3B, "FlagStatus" }, { 0x3C, "ContentClass" }, { 0x3D, "FlagType" }, { 0x3E, "CompleteTime" }, { 0x3F, "DisallowNewTimeProposal" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp4[] = { /* ActiveSync 'Calendar:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "TimeZone" }, { 0x06, "AllDAyEvent" }, { 0x07, "Attendees" }, { 0x08, "Attendee" }, { 0x09, "Attendee_Email" }, { 0x0A, "Attendee_Name" }, { 0x0D, "BusyStatus" }, { 0x0E, "Categories" }, { 0x0F, "Category" }, { 0x11, "DTStamp" }, { 0x12, "EndTime" }, { 0x13, "Exception" }, { 0x14, "Exceptions" }, { 0x15, "Exception_Deleted" }, { 0x16, "Exception_StartTime" }, { 0x17, "Location" }, { 0x18, "MeetingStatus" }, { 0x19, "Organizer_Email" }, { 0x1A, "Organizer_Name" }, { 0x1B, "Recurrence" }, { 0x1C, "Recurrence_Type" }, { 0x1D, "Recurrence_Until" }, { 0x1E, "Recurrence_Occurrences" }, { 0x1F, "Recurrence_Interval" }, { 0x20, "Recurrence_DayOfWeek" }, { 0x21, "Recurrence_DayOfMonth" }, { 0x22, "Recurrence_WeekOfMonth" }, { 0x23, "Recurrence_MonthOfYear" }, { 0x24, "Reminder" }, { 0x25, "Sensitivity" }, { 0x26, "Subject" }, { 0x27, "StartTime" }, { 0x28, "UID" }, { 0x29, "Attendee_Status" }, { 0x2A, "Attendee_Type" }, { 0x33, "DisallowNewTimeProposal" }, { 0x34, "ResponseRequested" }, { 0x35, "AppointmentReplyTime" }, { 0x36, "ResponseType" }, { 0x37, "CalendarType" }, { 0x38, "IsLeapMonth" }, { 0x39, "FirstDayOfWeek" }, { 0x3A, "OnlineMeetingConfLink" }, { 0x3B, "OnlineMeetingExternalLink" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp5[] = { /* ActiveSync 'Move:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "MoveItems" }, { 0x06, "Move" }, { 0x07, "SrcMsgId" }, { 0x08, "SrcFldId" }, { 0x09, "DstFldId" }, { 0x0A, "Response" }, { 0x0B, "Status" }, { 0x0C, "DstMsgId" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp6[] = { /* ActiveSync 'GetItemEstimate:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "GetItemEstimate" }, { 0x06, "Version" }, { 0x07, "Collections" }, { 0x08, "Collection" }, { 0x09, "Class" }, { 0x0A, "CollectionId" }, { 0x0B, "DateTime" }, { 0x0C, "Estimate" }, { 0x0D, "Response" }, { 0x0E, "Status" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp7[] = { /* ActiveSync 'FolderHierarchy:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x07, "DisplayName" }, { 0x08, "ServerId" }, { 0x09, "ParentId" }, { 0x0A, "Type" }, { 0x0C, "Status" }, { 0x0E, "Changes" }, { 0x0F, "Add" }, { 0x10, "Delete" }, { 0x11, "Update" }, { 0x12, "SyncKey" }, { 0x13, "FolderCreate" }, { 0x14, "FolderDelete" }, { 0x15, "FolderUpdate" }, { 0x16, "FolderSync" }, { 0x17, "Count" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp8[] = { /* ActiveSync 'MeetingResponse:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CalendarId" }, { 0x06, "CollectionId" }, { 0x07, "MeetingResponse" }, { 0x08, "RequestId" }, { 0x09, "Request" }, { 0x0A, "Result" }, { 0x0B, "Status" }, { 0x0C, "UserResponse" }, { 0x0E, "InstanceId" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp9[] = { /* ActiveSync 'Tasks:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x08, "Categories" }, { 0x09, "Category" }, { 0x0A, "Complete" }, { 0x0B, "DateCompleted" }, { 0x0D, "DueDate" }, { 0x0E, "Importance" }, { 0x0F, "Recurrence" }, { 0x10, "Recurrence_Type" }, { 0x11, "Recurrence_Start" }, { 0x12, "Recurrence_Until" }, { 0x13, "Recurrence_Occurrences" }, { 0x14, "Recurrence_Interval" }, { 0x15, "Recurrence_DayOfMonth" }, { 0x16, "Recurrence_DayOfWeek" }, { 0x17, "Recurrence_WeekOfMonth" }, { 0x18, "Recurrence_MonthOfYear" }, { 0x19, "Recurrence_Regenerate" }, { 0x1A, "Recurrence_DeadOccur" }, { 0x1B, "ReminderSet" }, { 0x1C, "ReminderTime" }, { 0x1D, "Sensitivity" }, { 0x1E, "StartDate" }, { 0x1F, "UTCStartDate" }, { 0x20, "Subject" }, { 0x22, "OrdinalDate" }, { 0x23, "SubOrdinalDate" }, { 0x24, "CalendarType" }, { 0x25, "IsLeapMonth" }, { 0x26, "FirstDayOfWeek" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp10[] = { /* ActiveSync 'ResolveRecipients:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ResolveRecipients" }, { 0x06, "Response" }, { 0x07, "Status" }, { 0x08, "Type" }, { 0x09, "Recipient" }, { 0x0A, "DisplayName" }, { 0x0B, "EmailAddress" }, { 0x0C, "Certificates" }, { 0x0D, "Certificate" }, { 0x0E, "MiniCertificate" }, { 0x0F, "Options" }, { 0x10, "To" }, { 0x11, "CertificateRetrieval" }, { 0x12, "RecipientCount" }, { 0x13, "MaxCertificates" }, { 0x14, "MaxAmbiguousRecipients" }, { 0x15, "CertificateCount" }, { 0x16, "Availability" }, { 0x17, "StartTime" }, { 0x18, "EndTime" }, { 0x19, "MergedFreeBusy" }, { 0x1A, "Picture" }, { 0x1B, "MaxSize" }, { 0x1C, "Data" }, { 0x1D, "MaxPictures" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp11[] = { /* ActiveSync 'ValidateCert:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ValidateCert" }, { 0x06, "Certificates" }, { 0x07, "Certificate" }, { 0x08, "CertificateChain" }, { 0x09, "CheckCRL" }, { 0x0A, "Status" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp12[] = { /* ActiveSync 'Contacts2:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CustomerId" }, { 0x06, "GovernmentId" }, { 0x07, "IMAddress" }, { 0x08, "IMAddress2" }, { 0x09, "IMAddress3" }, { 0x0A, "ManagerName" }, { 0x0B, "CompanyMainPhone" }, { 0x0C, "AccountName" }, { 0x0D, "NickName" }, { 0x0E, "MMS" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp13[] = { /* ActiveSync 'Ping:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Ping" }, { 0x06, "AutdState" }, { 0x07, "Status" }, { 0x08, "HeartbeatInterval" }, { 0x09, "Folders" }, { 0x0A, "Folder" }, { 0x0B, "Id" }, { 0x0C, "Class" }, { 0x0D, "MaxFolders" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp14[] = { /* ActiveSync 'Provision:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Provision" }, { 0x06, "Policies" }, { 0x07, "Policy" }, { 0x08, "PolicyType" }, { 0x09, "PolicyKey" }, { 0x0A, "Data" }, { 0x0B, "Status" }, { 0x0C, "RemoteWipe" }, { 0x0D, "EASProvisionDoc" }, { 0x0E, "DevicePasswordEnabled" }, { 0x0F, "AlphanumericDevicePasswordRequired" }, { 0x10, "DeviceEncryptionEnabled" }, { 0x11, "PasswordRecoveryEnabled" }, { 0x13, "AttachmentsEnabled" }, { 0x14, "MinDevicePasswordLength" }, { 0x15, "MaxInactivityTimeDeviceLock" }, { 0x16, "MaxDevicePasswordFailedAttempts" }, { 0x17, "MaxAttachmentSize" }, { 0x18, "AllowSimpleDevicePassword" }, { 0x19, "DevicePasswordExpiration" }, { 0x1A, "DevicePasswordHistory" }, { 0x1B, "AllowStorageCard" }, { 0x1C, "AllowCamera" }, { 0x1D, "RequireDeviceEncryption" }, { 0x1E, "AllowUnsignedApplications" }, { 0x1F, "AllowUnsignedInstallationPackages" }, { 0x20, "MinDevicePasswordComplexCharacters" }, { 0x21, "AllowWiFi" }, { 0x22, "AllowTextMessaging" }, { 0x23, "AllowPOPIMAPEmail" }, { 0x24, "AllowBluetooth" }, { 0x25, "AllowIrDA" }, { 0x26, "RequireManualSyncWhenRoaming" }, { 0x27, "AllowDesktopSync" }, { 0x28, "MaxCalendarAgeFilter" }, { 0x29, "AllowHTMLEmail" }, { 0x2A, "MaxEmailAgeFilter" }, { 0x2B, "MaxEmailBodyTruncationSize" }, { 0x2C, "MaxEmailHTMLBodyTruncationSize" }, { 0x2D, "RequireSignedSMIMEMessages" }, { 0x2E, "RequireEncryptedSMIMEMessages" }, { 0x2F, "RequireSignedSMIMEAlgorithm" }, { 0x30, "RequireEncryptionSMIMEAlgorithm" }, { 0x31, "AllowSMIMEEncryptionAlgorithmNegotiation" }, { 0x32, "AllowSMIMESoftCerts" }, { 0x33, "AllowBrowser" }, { 0x34, "AllowConsumerEmail" }, { 0x35, "AllowRemoteDesktop" }, { 0x36, "AllowInternetSharing" }, { 0x37, "UnapprovedInROMApplicationList" }, { 0x38, "ApplicationName" }, { 0x39, "ApprovedApplicationList" }, { 0x3A, "Hash" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp15[] = { /* ActiveSync 'Search:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Search" }, { 0x07, "Store" }, { 0x08, "Name" }, { 0x09, "Query" }, { 0x0A, "Options" }, { 0x0B, "Range" }, { 0x0C, "Status" }, { 0x0D, "Response" }, { 0x0E, "Result" }, { 0x0F, "Properties" }, { 0x10, "Total" }, { 0x11, "EqualTo" }, { 0x12, "Value" }, { 0x13, "And" }, { 0x14, "Or" }, { 0x15, "FreeText" }, { 0x17, "DeepTraversal" }, { 0x18, "LongId" }, { 0x19, "RebuildResults" }, { 0x1A, "LessThan" }, { 0x1B, "GreaterThan" }, { 0x1E, "UserName" }, { 0x1F, "Password" }, { 0x20, "ConversationId" }, { 0x21, "Picture" }, { 0x22, "MaxSize" }, { 0x23, "MaxPictures" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp16[] = { /* ActiveSync 'Gal:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "DisplayName" }, { 0x06, "Phone" }, { 0x07, "Office" }, { 0x08, "Title" }, { 0x09, "Company" }, { 0x0A, "Alias" }, { 0x0B, "FirstName" }, { 0x0C, "LastName" }, { 0x0D, "HomePhone" }, { 0x0E, "MobilePhone" }, { 0x0F, "EmailAddress" }, { 0x10, "Picture" }, { 0x11, "Status" }, { 0x12, "Data" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp17[] = { /* ActiveSync 'AirSyncBase:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "BodyPreference" }, { 0x06, "Type" }, { 0x07, "TruncationSize" }, { 0x08, "AllOrNone" }, { 0x0A, "Body" }, { 0x0B, "Data" }, { 0x0C, "EstimatedDataSize" }, { 0x0D, "Truncated" }, { 0x0E, "Attachments" }, { 0x0F, "Attachment" }, { 0x10, "DisplayName" }, { 0x11, "FileReference" }, { 0x12, "Method" }, { 0x13, "ContentId" }, { 0x14, "ContentLocation" }, { 0x15, "IsInline" }, { 0x16, "NativeBodyType" }, { 0x17, "ContentType" }, { 0x18, "Preview" }, { 0x19, "BodyPartReference" }, { 0x1A, "BodyPart" }, { 0x1B, "Status" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp18[] = { /* ActiveSync 'Settings:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Settings" }, { 0x06, "Status" }, { 0x07, "Get" }, { 0x08, "Set" }, { 0x09, "Oof" }, { 0x0A, "OofState" }, { 0x0B, "StartTime" }, { 0x0C, "EndTime" }, { 0x0D, "OofMessage" }, { 0x0E, "AppliesToInternal" }, { 0x0F, "AppliesToExternalKnown" }, { 0x10, "AppliesToExternalUnknown" }, { 0x11, "Enabled" }, { 0x12, "ReplyMessage" }, { 0x13, "BodyType" }, { 0x14, "DevicePassword" }, { 0x15, "Password" }, { 0x16, "DeviceInformation" }, { 0x17, "Model" }, { 0x18, "IMEI" }, { 0x19, "FriendlyName" }, { 0x1A, "OS" }, { 0x1B, "OSLanguage" }, { 0x1C, "PhoneNumber" }, { 0x1D, "UserInformation" }, { 0x1E, "EmailAddresses" }, { 0x1F, "SmtpAddress" }, { 0x20, "UserAgent" }, { 0x21, "EnableOutboundSMS" }, { 0x22, "MobileOperator" }, { 0x23, "PrimarySmtpAddress" }, { 0x24, "Accounts" }, { 0x25, "Account" }, { 0x26, "AccountId" }, { 0x27, "AccountName" }, { 0x28, "UserDisplayName" }, { 0x29, "SendDisabled" }, { 0x2B, "RightsManagementInformation" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp19[] = { /* ActiveSync 'DocumentLibrary:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "LinkId" }, { 0x06, "DisplayName" }, { 0x07, "IsFolder" }, { 0x09, "CreationDate" }, { 0x0A, "LastModifiedDate" }, { 0x0B, "ContentLength" }, { 0x0C, "ContentType" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp20[] = { /* ActiveSync 'ItemOperations:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ItemOperations" }, { 0x06, "Fetch" }, { 0x07, "Store" }, { 0x08, "Options" }, { 0x09, "Range" }, { 0x0A, "Total" }, { 0x0B, "Properties" }, { 0x0C, "Data" }, { 0x0D, "Status" }, { 0x0E, "Response" }, { 0x0F, "Version" }, { 0x10, "Schema" }, { 0x11, "Part" }, { 0x12, "EmptyFolderContents" }, { 0x13, "DeleteSubFolders" }, { 0x14, "UserName" }, { 0x15, "Password" }, { 0x16, "Move" }, { 0x17, "DstFldId" }, { 0x18, "ConversationId" }, { 0x19, "MoveAlways" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp21[] = { /* ActiveSync 'ComposeMail:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "SendMail" }, { 0x06, "SmartForward" }, { 0x07, "SmartReply" }, { 0x08, "SaveInSentItems" }, { 0x09, "ReplaceMime" }, { 0x0B, "Source" }, { 0x0C, "FolderId" }, { 0x0D, "ItemId" }, { 0x0E, "LongId" }, { 0x0F, "InstanceId" }, { 0x10, "MIME" }, { 0x11, "ClientId" }, { 0x12, "Status" }, { 0x13, "AccountId" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp22[] = { /* ActiveSync 'Email2:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "UmCallerID" }, { 0x06, "UmUserNotes" }, { 0x07, "UmAttDuration" }, { 0x08, "UmAttOrder" }, { 0x09, "ConversationId" }, { 0x0A, "ConversationIndex" }, { 0x0B, "LastVerbExecuted" }, { 0x0C, "LastVerbExecutionTime" }, { 0x0D, "ReceivedAsBcc" }, { 0x0E, "Sender" }, { 0x0F, "CalendarType" }, { 0x10, "IsLeapMonth" }, { 0x11, "AccountId" }, { 0x12, "FirstDayOfWeek" }, { 0x13, "MeetingMessageType" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp23[] = { /* ActiveSync 'Notes:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Subject" }, { 0x06, "MessageClass" }, { 0x07, "LastModifiedDate" }, { 0x08, "Categories" }, { 0x09, "Category" }, { 0x00, NULL } }; static const value_string wbxml_mssyncc10_tags_cp24[] = { /* ActiveSync 'RightsManagement:' Page */ /* 0x00 -- 0x04 GLOBAL */ { 0x05, "RightsManagementSupport" }, { 0x06, "RightsManagementTemplates" }, { 0x07, "RightsManagementTemplate" }, { 0x08, "RightsManagementLicense" }, { 0x09, "EditAllowed" }, { 0x0A, "ReplyAllowed" }, { 0x0B, "ReplyAllAllowed" }, { 0x0C, "ForwardAllowed" }, { 0x0D, "ModifyRecipientsAllowed" }, { 0x0E, "ExtractAllowed" }, { 0x0F, "PrintAllowed" }, { 0x10, "ExportAllowed" }, { 0x11, "ProgrammaticAccessAllowed" }, { 0x12, "RMOwner" }, { 0x13, "ContentExpiryDate" }, { 0x14, "TemplateId" }, { 0x15, "TemplateName" }, { 0x16, "TemplateDescription" }, { 0x17, "ContentOwner" }, { 0x18, "RemoveRightsManagementDistribution" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_mssyncc10_tags[] = { { 0x00, wbxml_mssyncc10_tags_cp0 }, /* AirSync: */ { 0x01, wbxml_mssyncc10_tags_cp1 }, /* Contacts: */ { 0x02, wbxml_mssyncc10_tags_cp2 }, /* Email: */ { 0x04, wbxml_mssyncc10_tags_cp4 }, /* Calendar: */ { 0x05, wbxml_mssyncc10_tags_cp5 }, /* Move: */ { 0x06, wbxml_mssyncc10_tags_cp6 }, /* GetItemEstimate: */ { 0x07, wbxml_mssyncc10_tags_cp7 }, /* FolderHierarchy: */ { 0x08, wbxml_mssyncc10_tags_cp8 }, /* MeetingResponse: */ { 0x09, wbxml_mssyncc10_tags_cp9 }, /* Tasks: */ { 0x0A, wbxml_mssyncc10_tags_cp10 }, /* ResolveRecipients: */ { 0x0B, wbxml_mssyncc10_tags_cp11 }, /* ValidateCert: */ { 0x0C, wbxml_mssyncc10_tags_cp12 }, /* Contacts2: */ { 0x0D, wbxml_mssyncc10_tags_cp13 }, /* Ping: */ { 0x0E, wbxml_mssyncc10_tags_cp14 }, /* Provision: */ { 0x0F, wbxml_mssyncc10_tags_cp15 }, /* Search: */ { 0x10, wbxml_mssyncc10_tags_cp16 }, /* Gal: */ { 0x11, wbxml_mssyncc10_tags_cp17 }, /* AirSyncBase: */ { 0x12, wbxml_mssyncc10_tags_cp18 }, /* Settings: */ { 0x13, wbxml_mssyncc10_tags_cp19 }, /* DocumentLibrary: */ { 0x14, wbxml_mssyncc10_tags_cp20 }, /* ItemOperations: */ { 0x15, wbxml_mssyncc10_tags_cp21 }, /* ComposeMail: */ { 0x16, wbxml_mssyncc10_tags_cp22 }, /* Email2: */ { 0x17, wbxml_mssyncc10_tags_cp23 }, /* Notes: */ { 0x18, wbxml_mssyncc10_tags_cp24 }, /* RightsManagement: */ { 0x00, NULL } }; static const wbxml_decoding decode_mssync_10 = { "Microsoft ActiveSync", "ActiveSync", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_mssyncc10_tags, NULL, NULL }; /* CHANNEL 1.0 * * WTA Channel ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_channelc10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "channel" }, { 0x06, "title" }, { 0x07, "abstract" }, { 0x08, "resource" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_channelc10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "maxspace=" }, { 0x06, "base=" }, { 0x07, "href=" }, { 0x08, "href='http://'" }, { 0x09, "href='https://'" }, { 0x0A, "lastmod=" }, { 0x0B, "etag=" }, { 0x0C, "md5=" }, { 0x0D, "success=" }, { 0x0E, "success='http://'" }, { 0x0F, "success='https://'" }, { 0x10, "failure=" }, { 0x11, "failure='http://'" }, { 0x12, "failure='https://'" }, { 0x13, "EventId=" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_channelc10_tags[] = { { 0, wbxml_channelc10_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_channelc10_attrStart[] = { { 0, wbxml_channelc10_attrStart_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_channelc_10 = { "Wireless Telephony Application (WTA) Channel 1.0", "CHANNEL 1.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_channelc10_tags, wbxml_channelc10_attrStart, NULL }; /* application/x-wap-prov.browser-settings * application/x-wap-prov.browser-bookmarks * * Nokia OTA Provisioning document format ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ static const value_string wbxml_nokiaprovc70_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CHARACTERISTIC-LIST" }, { 0x06, "CHARACTERISTIC" }, { 0x07, "PARM" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ static const value_string wbxml_nokiaprovc70_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x06, "TYPE='ADDRESS'" }, { 0x07, "TYPE='URL'" }, { 0x08, "TYPE='NAME'" }, { 0x10, "NAME=" }, { 0x11, "VALUE=" }, { 0x12, "NAME='BEARER'" }, { 0x13, "NAME='PROXY'" }, { 0x14, "NAME='PORT'" }, { 0x15, "NAME='NAME'" }, { 0x16, "NAME='PROXY_TYPE'" }, { 0x17, "NAME='URL'" }, { 0x18, "NAME='PROXY_AUTHNAME'" }, { 0x19, "NAME='PROXY_AUTHSECRET'" }, { 0x1A, "NAME='SMS_SMSC_ADDRESS'" }, { 0x1B, "NAME='USSD_SERVICE_CODE'" }, { 0x1C, "NAME='GPRS_ACCESSPOINTNAME'" }, { 0x1D, "NAME='PPP_LOGINTYPE'" }, { 0x1E, "NAME='PROXY_LOGINTYPE'" }, { 0x21, "NAME='CSD_DIALSTRING'" }, { 0x22, "NAME='PPP_AUTHTYPE'" }, { 0x23, "NAME='PPP_AUTHNAME'" }, { 0x24, "NAME='PPP_AUTHSECRET'" }, { 0x28, "NAME='CSD_CALLTYPE'" }, { 0x29, "NAME='CSD_CALLSPEED'" }, { 0x45, "VALUE='GSM/CSD'" }, { 0x46, "VALUE='GSM/SMS'" }, { 0x47, "VALUE='GSM/USSD'" }, { 0x48, "VALUE='IS-136/CSD'" }, { 0x49, "VALUE='GPRS'" }, { 0x60, "VALUE='9200'" }, { 0x61, "VALUE='9201'" }, { 0x62, "VALUE='9202'" }, { 0x63, "VALUE='9203'" }, { 0x64, "VALUE='AUTOMATIC'" }, { 0x65, "VALUE='MANUAL'" }, { 0x6A, "VALUE='AUTO'" }, { 0x6B, "VALUE='9600'" }, { 0x6C, "VALUE='14400'" }, { 0x6D, "VALUE='19200'" }, { 0x6E, "VALUE='28800'" }, { 0x6F, "VALUE='38400'" }, { 0x70, "VALUE='PAP'" }, { 0x71, "VALUE='CHAP'" }, { 0x72, "VALUE='ANALOGUE'" }, { 0x73, "VALUE='ISDN'" }, { 0x74, "VALUE='43200'" }, { 0x75, "VALUE='57600'" }, { 0x76, "VALUE='MSISDN_NO'" }, { 0x77, "VALUE='IPV4'" }, { 0x78, "VALUE='MS_CHAP'" }, { 0x7C, "TYPE='MMSURL'" }, { 0x7D, "TYPE='ID'" }, { 0x7E, "NAME='ISP_NAME'" }, { 0x7F, "TYPE='BOOKMARK'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /***** Token code page aggregation *****/ static const value_valuestring wbxml_nokiaprovc70_tags[] = { { 0, wbxml_nokiaprovc70_tags_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_nokiaprovc70_attrStart[] = { { 0, wbxml_nokiaprovc70_attrStart_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_nokiaprovc_70 = { "Nokia Client Provisioning 7.0", "Nokia Client Provisioning 7.0", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_nokiaprovc70_tags, wbxml_nokiaprovc70_attrStart, NULL }; /* UAProf [WAP-248] * * User-Agent Profile (used in profile-diff WSP header) ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ /* CodePage 0 RDF */ static const value_string wbxml_uaprof_tags_cp0[] = { {0x05, "rdf:RDF"}, {0x06, "rdf:Description"}, {0x07, "rdf:Alt"}, {0x08, "rdf:Bag"}, {0x09, "rdf:Seq"}, {0x0A, "rdf:li"}, {0x0B, "rdf:type"}, {0x0C, "rdf:value"}, {0x0D, "rdf:subject"}, {0x0E, "rdf:predicate"}, {0x0F, "rdf:object"}, { 0x00, NULL } }; /* CodePage 1 Core Vocabulary */ static const value_string wbxml_uaprof_tags_cp1[] = { {0x06, "rdf:Description"}, {0x07, "rdf:Alt"}, {0x08, "rdf:Bag"}, {0x09, "rdf:Seq"}, {0x0A, "rdf:li"}, {0x0B, "rdf:type"}, {0x0C, "prf:component"}, {0x0D, "prf:defaults"}, {0x0E, "prf:BitsPerPixel"}, {0x0F, "prf:ColorCapable"}, {0x10, "prf:CPU"}, {0x11, "prf:ImageCapable"}, {0x12, "prf:InputCharSet"}, {0x13, "prf:Keyboard"}, {0x15, "prf:Model"}, {0x16, "prf:OutputCharSet"}, {0x17, "prf:PointingResolution"}, {0x18, "prf:ScreenSize"}, {0x19, "prf:ScreenSizeChar"}, {0x1A, "prf:NumberOfSoftKeys"}, {0x1B, "prf:SoundOutputCapable"}, {0x1C, "prf:TextInputCapable"}, {0x1D, "prf:Vendor"}, {0x1E, "prf:VoiceInputCapable"}, {0x1F, "prf:AcceptDownloadableSoftware"}, {0x20, "prf:AudioInputEncoder"}, {0x21, "prf:DownloadableSoftwareSupport"}, {0x22, "prf:JavaEnabled"}, {0x23, "prf:JVMVersion"}, {0x24, "prf:MexeClassmark"}, {0x25, "prf:MexeSpec"}, {0x26, "prf:OSName"}, {0x27, "prf:OSVendor"}, {0x28, "prf:OSVersion"}, {0x29, "prf:RecipientAppAgent"}, {0x2A, "prf:SoftwareNumber"}, {0x2B, "prf:VideoInputEncoder"}, {0x2C, "prf:CurrentBearerService"}, {0x2D, "prf:SecuritySupport"}, {0x2E, "prf:SupportedBearers"}, {0x2F, "prf:WapDeviceClass"}, {0x30, "prf:WapPushMsgPriority"}, /* Deprecated */ {0x31, "prf:WapPushMsgSize"}, /* Deprecated */ {0x32, "prf:WapVersion"}, {0x33, "prf:WmlDeckSize"}, {0x34, "prf:WmlScriptLibraries"}, {0x35, "prf:WmlScriptVersion"}, {0x36, "prf:WmlVersion"}, {0x37, "prf:WtaiLibraries"}, {0x38, "prf:WtaVersion"}, {0x39, "prf:PixelAspectRatio"}, {0x3A, "prf:StandardFontProportional"}, {0x3B, "prf:WapSupportedApplications"}, /* Deprecated */ {0x3C, "prf:BluetoothProfile"}, {0x3D, "prf:MexeClassmarks"}, {0x3E, "prf:MexeSecureDomains"}, { 0x00, NULL } }; /* CodePage 4 Core Vocabulary (continued) */ static const value_string wbxml_uaprof_tags_cp4[] = { {0x10, "prf:SupportedBluetoothVersion"}, {0x11, "prf:SupportedPictogramSet"}, {0x12, "prf:CcppAccept"}, {0x13, "prf:CcppAccept-Charset"}, {0x14, "prf:CcppAccept-Encoding"}, {0x15, "prf:CcppAccept-Language"}, { 0x00, NULL } }; /* CodePage 2 BrowserUA */ static const value_string wbxml_uaprof_tags_cp2[] = { {0x05, "rdf:Description"}, {0x06, "rdf:Alt"}, {0x07, "rdf:Bag"}, {0x08, "rdf:Seq"}, {0x09, "rdf:li"}, {0x0A, "rdf:type"}, {0x0B, "prf:component"}, {0x0C, "prf:defaults"}, {0x0D, "prf:BrowserName"}, {0x0E, "prf:BrowserVersion"}, {0x0F, "prf:CcppAccept"}, /* Deprecated */ {0x10, "prf:CcppAccept-Charset"}, /* Deprecated */ {0x11, "prf:CcppAccept-Encoding"}, /* Deprecated */ {0x12, "prf:CcppAccept-Language"}, /* Deprecated */ {0x13, "prf:DownloadableBrowserApps"}, {0x14, "prf:FramesCapable"}, {0x15, "prf:HtmlVersion"}, {0x16, "prf:JavaAppletEnabled"}, {0x17, "prf:JavaScriptEnabled"}, {0x18, "prf:JavaScriptVersion"}, {0x19, "prf:PreferenceForFrames"}, {0x1A, "prf:TablesCapable"}, {0x1B, "Prf:XhtmlVersion"}, {0x1C, "prf:XhtmlModules"}, { 0x00, NULL } }; /* CodePage 3 PushCharacteristics */ static const value_string wbxml_uaprof_tags_cp3[] = { {0x05, "rdf:Description"}, {0x06, "rdf:Alt"}, {0x07, "rdf:Bag"}, {0x08, "rdf:Seq"}, {0x09, "rdf:li"}, {0x0A, "rdf:type"}, {0x0B, "prf:component"}, {0x0C, "prf:defaults"}, {0x0D, "prf:Push-Accept"}, {0x0E, "prf:Push-Accept-Charset"}, {0x0F, "prf:Push-Accept-Encoding"}, {0x10, "prf:Push-Accept-Language"}, {0x11, "prf:Push-Accept-AppID"}, {0x12, "prf:Push-MsgSize"}, {0x13, "prf:Push-MaxPushReq"}, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /* CodePage 0 RDF */ static const value_string wbxml_uaprof_attrStart_cp0[] = { {0x05, "ID"}, {0x06, "rdf:about"}, {0x07, "rdf:aboutEach"}, {0x08, "rdf:aboutEachPrefix"}, {0x09, "rdf:bagID"}, {0x0A, "rdf:type"}, {0x0B, "rdf:resource"}, {0x0C, "rdf:parseType='Literal'"}, {0x0D, "rdf:parseType='Resource'"}, {0x0E, "xml:lang"}, {0x0F, "xmlns:prf"}, {0x10, "xmlns:rdf"}, { 0x00, NULL } }; /* CodePage 1 Core Vocabulary */ static const value_string wbxml_uaprof_attrStart_cp1[] = { {0x05, "rdf:resource"}, {0x06, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#HardwarePlatform'"}, {0x07, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#SoftwarePlatform'"}, {0x08, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#NetworkCharacteristics'"}, {0x09, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#WapCharacteristics'"}, {0x0A, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#BrowserUA'"}, {0x0B, "rdf:resource='http://www.wapforum.org/profiles/UAPROF/" "ccppschema-20010430#PushCharacteristics'"}, {0x10, "prf:BitsPerPixel"}, {0x11, "prf:ColorCapable='Yes'"}, {0x12, "prf:ColorCapable='No'"}, {0x13, "prf:CPU"}, {0x14, "prf:ImageCapable='Yes'"}, {0x15, "prf:ImageCapable='No'"}, {0x16, "prf:InputCharSet"}, {0x17, "prf:Keyboard"}, {0x19, "prf:Model"}, {0x1A, "prf:OutputCharSet"}, {0x1B, "prf:PointingResolution"}, {0x1C, "prf:ScreenSize"}, {0x1D, "prf:ScreenSizeChar"}, {0x1E, "prf:NumberOfSoftKeys='Yes'"}, {0x20, "prf:SoundOutputCapable='Yes'"}, {0x21, "prf:SoundOutputCapable='No'"}, {0x22, "prf:TextInputCapable='Yes'"}, {0x23, "prf:TextInputCapable='No'"}, {0x24, "prf:Vendor"}, {0x25, "prf:VoiceInputCapable='Yes'"}, {0x26, "prf:VoiceInputCapable='No'"}, {0x27, "prf:PixelAspectRatio"}, {0x28, "prf:StandardFontProportional='Yes'"}, {0x29, "prf:StandardFontProportional='No'"}, {0x30, "prf:AcceptDownloadableSoftware='Yes'"}, {0x31, "prf:AcceptDownloadableSoftware='No'"}, {0x32, "prf:AudioInputEncoder"}, {0x33, "prf:DownloadableSoftwareSupport"}, {0x35, "prf:JavaEnabled='Yes'"}, {0x36, "prf:JavaEnabled='No'"}, {0x37, "prf:JVMVersion"}, {0x38, "prf:MexeClassmark"}, {0x39, "prf:MexeSpec"}, {0x3A, "prf:OSName"}, {0x3B, "prf:OSVendor"}, {0x3C, "prf:OSVersion"}, {0x3D, "prf:RecipientAppAgent"}, {0x3E, "prf:SoftwareNumber"}, {0x21, "prf:SoundOutputCapable='No'"}, {0x22, "prf:TextInputCapable='Yes'"}, {0x23, "prf:TextInputCapable='No'"}, {0x24, "prf:Vendor"}, {0x25, "prf:VoiceInputCapable='Yes'"}, {0x26, "prf:VoiceInputCapable='No'"}, {0x27, "prf:PixelAspectRatio"}, {0x28, "prf:StandardFontProportional='Yes'"}, {0x29, "prf:StandardFontProportional='No'"}, {0x30, "prf:AcceptDownloadableSoftware='Yes'"}, {0x31, "prf:AcceptDownloadableSoftware='No'"}, {0x32, "prf:AudioInputEncoder"}, {0x33, "prf:DownloadableSoftwareSupport"}, {0x35, "prf:JavaEnabled='Yes'"}, {0x36, "prf:JavaEnabled='No'"}, {0x37, "prf:JVMVersion"}, {0x38, "prf:MexeClassmark"}, {0x39, "prf:MexeSpec"}, {0x3A, "prf:OSName"}, {0x3B, "prf:OSVendor"}, {0x3C, "prf:OSVersion"}, {0x3D, "prf:RecipientAppAgent"}, {0x3E, "prf:SoftwareNumber"}, {0x3F, "prf:VideoInputEncoder"}, {0x50, "prf:CurrentBearerService"}, {0x51, "prf:SecuritySupport"}, {0x52, "prf:SupportedBearers"}, {0x60, "prf:WapDeviceClass"}, {0x61, "prf:WapPushMsgPriority"}, /* Deprecated */ {0x62, "prf:WapPushMsgSize"}, /* Deprecated */ {0x63, "prf:WapVersion"}, {0x64, "prf:WmlDeckSize"}, {0x65, "prf:WmlScriptLibraries"}, {0x66, "prf:WmlScriptVersion"}, {0x67, "prf:WmlVersion"}, {0x68, "prf:WtaiLibraries"}, {0x69, "prf:WtaVersion"}, {0x70, "prf:WapSupportedApplications"}, /* Deprecated */ {0x71, "prf:BluetoothProfile"}, {0x72, "prf:MexeClassmarks"}, {0x73, "prf:MexeSecureDomains='YES'"}, {0x74, "prf:MexeSecureDomains='NO'"}, {0x75, "prf:SupportedBluetoothVersion"}, {0x76, "prf:SupportedPictogramSet"}, {0x77, "prf:CcppAccept"}, {0x78, "prf:CcppAccept-Charset"}, {0x79, "prf:CcppAccept-Encoding"}, {0x7F, "prf:CcppAccept-Language"}, { 0x00, NULL } }; /* CodePage 2 BrowserUA */ static const value_string wbxml_uaprof_attrStart_cp2[] = { {0x05, "prf:CcppAccept"}, /* Deprecated */ {0x06, "prf:CcppAccept-Charset"}, /* Deprecated */ {0x07, "prf:CcppAccept-Encoding"}, /* Deprecated */ {0x08, "prf:CcppAccept-Language"}, /* Deprecated */ {0x09, "prf:DownloadableBrowserApps"}, {0x0A, "prf:FramesCapable='Yes'"}, {0x0B, "prf:FramesCapable='No'"}, {0x0C, "prf:HtmlVersion='3.2'"}, {0x0D, "prf:HtmlVersion='4.0'"}, {0x0E, "prf:JavaAppletEnabled='Yes'"}, {0x0F, "prf:JavaAppletEnabled='No'"}, {0x10, "prf:JavaScriptEnabled='Yes'"}, {0x11, "prf:JavaScriptEnabled='No'"}, {0x12, "prf:JavaScriptVersion"}, {0x13, "prf:PreferenceForFrames='Yes'"}, {0x14, "prf:PreferenceForFrames='No'"}, {0x15, "prf:TablesCapable='Yes'"}, {0x16, "prf:TablesCapable='No'"}, {0x17, "prf:XhtmlVersion"}, {0x18, "prf:XhtmlModules"}, {0x19, "prf:BrowserName"}, {0x1A, "prf:BrowserVersion"}, { 0x00, NULL } }; /* CodePage 3 PushCharacteristics */ static const value_string wbxml_uaprof_attrStart_cp3[] = { {0x05, "prf:Push-Accept"}, {0x06, "prf:Push-Accept-Charset"}, {0x07, "prf:Push-Accept-Encoding"}, {0x08, "prf:Push-Accept-Language"}, {0x09, "prf:Push-Accept-AppID"}, {0x0A, "prf:Push-MsgSize"}, {0x0B, "prf:Push-MaxPushReq"}, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* CodePage 0 RDF */ static const value_string wbxml_uaprof_attrValue_cp0[] = { {0x85, "rdf:Statement"}, {0x86, "http://"}, {0x87, "http://www."}, {0x88, "https://"}, {0x89, "https://www."}, {0x8A, "www."}, {0x8B, ".com/"}, {0x8C, ".edu/"}, {0x8D, ".net/"}, {0x8E, ".org/"}, { 0x00, NULL } }; /* CodePage 1 CoreVocabularyAttrValue */ static const value_string wbxml_uaprof_attrValue_cp1[] = { {0x85, "No"}, {0x86, "Yes"}, { 0x00, NULL } }; /* CodePage 2 BrowserUAAttrValue */ static const value_string wbxml_uaprof_attrValue_cp2[] = { {0x85, "No"}, {0x86, "Yes"}, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_uaprof_tags[] = { { 0, wbxml_uaprof_tags_cp0 }, { 1, wbxml_uaprof_tags_cp1 }, { 2, wbxml_uaprof_tags_cp2 }, { 3, wbxml_uaprof_tags_cp3 }, { 4, wbxml_uaprof_tags_cp4 }, { 0, NULL } }; static const value_valuestring wbxml_uaprof_attrStart[] = { { 0, wbxml_uaprof_attrStart_cp0 }, { 1, wbxml_uaprof_attrStart_cp1 }, { 2, wbxml_uaprof_attrStart_cp2 }, { 3, wbxml_uaprof_attrStart_cp3 }, { 0, NULL } }; static const value_valuestring wbxml_uaprof_attrValue[] = { { 0, wbxml_uaprof_attrValue_cp0 }, { 1, wbxml_uaprof_attrValue_cp1 }, { 2, wbxml_uaprof_attrValue_cp2 }, { 0, NULL } }; static const wbxml_decoding decode_uaprof_wap_248 = { "User-Agent Profile (WAP-174, WAP-248)", "UAProf (WAP-174, WAP-248)", { NULL, NULL, NULL }, default_opaque_binary_tag, default_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_uaprof_tags, wbxml_uaprof_attrStart, wbxml_uaprof_attrValue }; /* WV-CSP 1.0 * * Wireless Village Client Server Protocol ***************************************/ /***** Global extension tokens *****/ /***** Tag tokens *****/ /* Common code page (0x00) */ static const value_string wbxml_wv_csp_10_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Acceptance" }, { 0x06, "AddList" }, { 0x07, "AddNickList" }, { 0x08, "Attribute" }, { 0x09, "AttributeList" }, { 0x0A, "ClientID" }, { 0x0B, "Code" }, { 0x0C, "ContactList" }, { 0x0D, "ContentData" }, { 0x0E, "ContentEncoding" }, { 0x0F, "ContentSize" }, { 0x10, "ContentType" }, { 0x11, "DateTime" }, { 0x12, "Description" }, { 0x13, "DetailedResult" }, { 0x14, "EntityList" }, { 0x15, "Group" }, { 0x16, "GroupID" }, { 0x17, "GroupList" }, { 0x18, "InUse" }, { 0x19, "Logo" }, { 0x1A, "MessageCount" }, { 0x1B, "MessageID" }, { 0x1C, "MessageURI" }, { 0x1D, "MSISDN" }, { 0x1E, "Name" }, { 0x1F, "NickList" }, { 0x20, "NickName" }, { 0x21, "Poll" }, { 0x22, "Presence" }, { 0x23, "PresenceSubList" }, { 0x24, "PresenceValue" }, { 0x25, "Property" }, { 0x26, "Qualifier" }, { 0x27, "Recipient" }, { 0x28, "RemoveList" }, { 0x29, "RemoveNickList" }, { 0x2A, "Result" }, { 0x2B, "ScreenName" }, { 0x2C, "Sender" }, { 0x2D, "Session" }, { 0x2E, "SessionDescriptor" }, { 0x2F, "SessionID" }, { 0x30, "SessionType" }, { 0x31, "Status" }, { 0x32, "Transaction" }, { 0x33, "TransactionContent" }, { 0x34, "TransactionDescriptor" }, { 0x35, "TransactionID" }, { 0x36, "TransactionMode" }, { 0x37, "URL" }, { 0x38, "URLList" }, { 0x39, "User" }, { 0x3A, "UserID" }, { 0x3B, "UserList" }, { 0x3C, "Validity" }, { 0x3D, "Value" }, { 0x3E, "WV-CSP-Message" }, { 0x00, NULL } }; /* Access code page (0x01) */ static const value_string wbxml_wv_csp_10_tags_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AllFunctions" }, { 0x06, "AllFunctionsRequest" }, { 0x07, "CancelInvite-Request" }, { 0x08, "CancelInviteUser-Request" }, { 0x09, "Capability" }, { 0x0A, "CapabilityList" }, { 0x0B, "CapabilityRequest" }, { 0x0C, "ClientCapability-Request" }, { 0x0D, "ClientCapability-Response" }, { 0x0E, "DigestBytes" }, { 0x0F, "DigestSchema" }, { 0x10, "Disconnect" }, { 0x11, "Functions" }, { 0x12, "GetSPInfo-Request" }, { 0x13, "GetSPInfo-Response" }, { 0x14, "InviteID" }, { 0x15, "InviteNote" }, { 0x16, "Invite-Request" }, { 0x17, "Invite-Response" }, { 0x18, "InviteType" }, { 0x19, "InviteUser-Request" }, { 0x1A, "InviteUser-Response" }, { 0x1B, "KeepAlive-Request" }, { 0x1C, "KeepAliveTime" }, { 0x1D, "Login-Request" }, { 0x1E, "Login-Response" }, { 0x1F, "Logout-Request" }, { 0x20, "Nonce" }, { 0x21, "Password" }, { 0x22, "Polling-Request" }, { 0x23, "ResponseNote" }, { 0x24, "SearchElement" }, { 0x25, "SearchFindings" }, { 0x26, "SearchID" }, { 0x27, "SearchIndex" }, { 0x28, "SearchLimit" }, { 0x29, "SearchOnlineStatus" }, { 0x2A, "SearchPairList" }, { 0x2B, "Search-Request" }, { 0x2C, "Search-Response" }, { 0x2D, "SearchResult" }, { 0x2E, "Service-Request" }, { 0x2F, "Service-Response" }, { 0x30, "SessionCookie" }, { 0x31, "StopSearch-Request" }, { 0x32, "TimeToLive" }, { 0x00, NULL } }; /* Service code page (0x02) */ static const value_string wbxml_wv_csp_10_tags_cp2[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ADDGM" }, { 0x06, "AttListFunc" }, { 0x07, "BLENT" }, { 0x08, "CAAUT" }, { 0x09, "CAINV" }, { 0x0A, "CALI" }, { 0x0B, "CCLI" }, { 0x0C, "ContListFunc" }, { 0x0D, "CREAG" }, { 0x0E, "DALI" }, { 0x0F, "DCLI" }, { 0x10, "DELGR" }, { 0x11, "FundamentalFeat" }, { 0x12, "FWMSG" }, { 0x13, "GALS" }, { 0x14, "GCLI" }, { 0x15, "GETGM" }, { 0x16, "GETGP" }, { 0x17, "GETLM" }, { 0x18, "GETM" }, { 0x19, "GETPR" }, { 0x1A, "GETSPI" }, { 0x1B, "GETWL" }, { 0x1C, "GLBLU" }, { 0x1D, "GRCHN" }, { 0x1E, "GroupAuthFunc" }, { 0x1F, "GroupFeat" }, { 0x20, "GroupMgmtFunc" }, { 0x21, "GroupUseFunc" }, { 0x22, "IMAuthFunc" }, { 0x23, "IMFeat" }, { 0x24, "IMReceiveFunc" }, { 0x25, "IMSendFunc" }, { 0x26, "INVIT" }, { 0x27, "InviteFunc" }, { 0x28, "MBRAC" }, { 0x29, "MCLS" }, { 0x2A, "MDELIV" }, { 0x2B, "NEWM" }, { 0x2C, "NOTIF" }, { 0x2D, "PresenceAuthFunc" }, { 0x2E, "PresenceDeliverFunc" }, { 0x2F, "PresenceFeat" }, { 0x30, "REACT" }, { 0x31, "REJCM" }, { 0x32, "REJEC" }, { 0x33, "RMVGM" }, { 0x34, "SearchFunc" }, { 0x35, "ServiceFunc" }, { 0x36, "SETD" }, { 0x37, "SETGP" }, { 0x38, "SRCH" }, { 0x39, "STSRC" }, { 0x3A, "SUBGCN" }, { 0x3B, "UPDPR" }, { 0x3C, "WVCSPFeat" }, { 0x00, NULL } }; /* Client capability code page (0x03) */ static const value_string wbxml_wv_csp_10_tags_cp3[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AcceptedCharset" }, { 0x06, "AcceptedContentLength" }, { 0x07, "AcceptedContentType" }, { 0x08, "AcceptedTransferEncoding" }, { 0x09, "AnyContent" }, { 0x0A, "ClientType" }, { 0x0B, "InitialDeliveryMethod" }, { 0x0C, "MultiTrans" }, { 0x0D, "ParserSize" }, { 0x0E, "ServerPollMin" }, { 0x0F, "SupportedBearer" }, { 0x10, "SupportedCIRMethod" }, { 0x11, "TCPAddress" }, { 0x12, "TCPPort" }, { 0x13, "UDPPort" }, { 0x00, NULL } }; /* Presence primitive code page (0x04) */ static const value_string wbxml_wv_csp_10_tags_cp4[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CancelAuth-Request" }, { 0x06, "ContactListProperties" }, { 0x07, "CreateAttributeList-Request" }, { 0x08, "CreateList-Request" }, { 0x09, "DefaultAttributeList" }, { 0x0A, "DefaultContactList" }, { 0x0B, "DefaultList" }, { 0x0C, "DeleteAttributeList-Request" }, { 0x0D, "DeleteList-Request" }, { 0x0E, "GetAttributeList-Request" }, { 0x0F, "GetAttributeList-Response" }, { 0x10, "GetList-Request" }, { 0x11, "GetList-Response" }, { 0x12, "GetPresence-Request" }, { 0x13, "GetPresence-Response" }, { 0x14, "GetWatcherList-Request" }, { 0x15, "GetWatcherList-Response" }, { 0x16, "ListManage-Request" }, { 0x17, "ListManage-Response" }, { 0x18, "Presence" }, { 0x19, "PresenceAuth-Request" }, { 0x1A, "PresenceAuth-Response" }, { 0x1B, "PresenceNotification-Request" }, { 0x1C, "PresenceValueList" }, { 0x1D, "SubscribePresence-Request" }, { 0x1E, "UnsubscribePresence-Request" }, { 0x1F, "UpdatePresence-Request" }, { 0x00, NULL } }; /* Presence attribute code page (0x05) */ static const value_string wbxml_wv_csp_10_tags_cp5[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Accuracy" }, { 0x06, "Address" }, { 0x07, "AddrPref" }, { 0x08, "Alias" }, { 0x09, "Altitude" }, { 0x0A, "Building" }, { 0x0B, "CAddr" }, { 0x0C, "City" }, { 0x0D, "ClientInfo" }, { 0x0E, "ClientProducer" }, { 0x0F, "ClientType" }, { 0x10, "ClientVersion" }, { 0x11, "CommC" }, { 0x12, "CommCap" }, { 0x13, "ContactInfo" }, { 0x14, "ContainedvCard" }, { 0x15, "Country" }, { 0x16, "Crossing1" }, { 0x17, "Crossing2" }, { 0x18, "DevManufacturer" }, { 0x19, "DirectContent" }, { 0x1A, "FreeTextLocation" }, { 0x1B, "GeoLocation" }, { 0x1C, "Language" }, { 0x1D, "Latitude" }, { 0x1E, "Longitude" }, { 0x1F, "Model" }, { 0x20, "NamedArea" }, { 0x21, "OnlineStatus" }, { 0x22, "PLMN" }, { 0x23, "PrefC" }, { 0x24, "PreferredContacts" }, { 0x25, "PreferredLanguage" }, { 0x26, "ReferredContent" }, { 0x27, "ReferredvCard" }, { 0x28, "Registration" }, { 0x29, "StatusContent" }, { 0x2A, "StatusMood" }, { 0x2B, "StatusText" }, { 0x2C, "Street" }, { 0x2D, "TimeZone" }, { 0x2E, "UserAvailability" }, { 0x00, NULL } }; /* Messaging code page (0x06) */ static const value_string wbxml_wv_csp_10_tags_cp6[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "BlockList" }, { 0x06, "BlockUser-Request" }, { 0x07, "DeliveryMethod" }, { 0x08, "DeliveryReport" }, { 0x09, "DeliveryReport-Request" }, { 0x0A, "ForwardMessage-Request" }, { 0x0B, "GetBlockedList-Request" }, { 0x0C, "GetBlockedList-Response" }, { 0x0D, "GetMessageList-Request" }, { 0x0E, "GetMessageList-Response" }, { 0x0F, "GetMessage-Request" }, { 0x10, "GetMessage-Response" }, { 0x11, "GrantList" }, { 0x12, "MessageDelivered" }, { 0x13, "MessageInfo" }, { 0x14, "MessageNotification" }, { 0x15, "NewMessage" }, { 0x16, "RejectMessage-Request" }, { 0x17, "SendMessage-Request" }, { 0x18, "SendMessage-Response" }, { 0x19, "SetDeliveryMethod-Request" }, { 0x00, NULL } }; /* Group code page (0x07) */ static const value_string wbxml_wv_csp_10_tags_cp7[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AddGroupMembers-Request" }, { 0x06, "Admin" }, { 0x07, "CreateGroup-Request" }, { 0x08, "DeleteGroup-Request" }, { 0x09, "GetGroupMembers-Request" }, { 0x0A, "GetGroupMembers-Response" }, { 0x0B, "GetGroupProps-Request" }, { 0x0C, "GetGroupProps-Response" }, { 0x0D, "GroupChangeNotice" }, { 0x0E, "GroupProperties" }, { 0x0F, "Joined" }, { 0x10, "JoinedRequest" }, { 0x11, "JoinGroup-Request" }, { 0x12, "JoinGroup-Response" }, { 0x13, "LeaveGroup-Request" }, { 0x14, "LeaveGroup-Response" }, { 0x15, "Left" }, { 0x16, "MemberAccess-Request" }, { 0x17, "Mod" }, { 0x18, "OwnProperties" }, { 0x19, "RejectList-Request" }, { 0x1A, "RejectList-Response" }, { 0x1B, "RemoveGroupMembers-Request" }, { 0x1C, "SetGroupProps-Request" }, { 0x1D, "SubscribeGroupNotice-Request" }, { 0x1E, "SubscribeGroupNotice-Response" }, { 0x1F, "Users" }, { 0x20, "WelcomeNote" }, { 0x00, NULL } }; /* * Attribute start tokens */ /* common code page (0x00) */ static const value_string wbxml_wv_csp_10_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "xmlns='http://www.wireless-village.org/CSP'" }, { 0x06, "xmlns='http://www.wireless-village.org/PA'" }, { 0x07, "xmlns='http://www.wireless-village.org/TRC'" }, { 0x00, NULL } }; /* * Attribute value tokens */ /* Common value tokens (0x00) */ static const value_string wbxml_wv_csp_10_attrValue_cp0[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "AccessType" }, { 0x86, "ActiveUsers" }, { 0x87, "Admin" }, { 0x88, "application/" }, { 0x89, "application/vnd.wap.mms-message" }, { 0x8A, "application/x-sms" }, { 0x8B, "BASE64" }, { 0x8C, "Closed" }, { 0x8D, "Default" }, { 0x8E, "DisplayName" }, { 0x8F, "False (No)" }, { 0x90, "Get" }, { 0x91, "Group (GR)" }, { 0x92, "http://" }, { 0x93, "https://" }, { 0x94, "image/" }, { 0x95, "Inband" }, { 0x96, "Instant Messaging (IM)" }, { 0x97, "MaxActiveUsers" }, { 0x98, "Mod" }, { 0x99, "Name" }, { 0x9A, "None" }, { 0x9B, "Notify/Get" }, { 0x9C, "Open" }, { 0x9D, "Outband" }, { 0x9E, "Presence (PR)" }, { 0x9F, "Private" }, { 0xA0, "PrivateMessaging" }, { 0xA1, "PrivilegeLevel" }, { 0xA2, "Public" }, { 0xA3, "Push" }, { 0xA4, "Request" }, { 0xA5, "Response" }, { 0xA6, "ScreenName" }, { 0xA7, "Searchable" }, { 0xA8, "Set" }, { 0xA9, "Shared Content (SC)" }, { 0xAA, "text/" }, { 0xAB, "text/plain" }, { 0xAC, "text/x-vCalendar" }, { 0xAD, "text/x-vCard" }, { 0xAE, "Topic" }, { 0xAF, "True (Yes)" }, { 0xB0, "Type" }, { 0xB1, "Unset" }, { 0xB2, "User (US)" }, { 0xB3, "www.wireless-village.org" }, { 0x00, NULL } }; /* Access value tokens (0x01) */ static const value_string wbxml_wv_csp_10_attrValue_cp1[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "GROUP_ID" }, { 0x86, "GROUP_NAME" }, { 0x87, "GROUP_TOPIC" }, { 0x88, "GROUP_USER_ID_JOINED" }, { 0x89, "HTTP" }, { 0x8A, "SMS" }, { 0x8B, "STCP" }, { 0x8C, "SUDP" }, { 0x8D, "USER_ALIAS" }, { 0x8E, "USER_EMAIL_ADDRESS" }, { 0x8F, "USER_FIRST_NAME" }, { 0x90, "USER_ID" }, { 0x91, "USER_LAST_NAME" }, { 0x92, "USER_MOBILE_NUMBER" }, { 0x93, "WAPSMS" }, { 0x94, "WAPUDP" }, { 0x95, "WSP" }, { 0x00, NULL } }; /* Presence value tokens (0x05) */ static const value_string wbxml_wv_csp_10_attrValue_cp5[] = { /* 0x80 -- 0x84 GLOBAL */ { 0x85, "ANGRY" }, { 0x86, "ANXIOUS" }, { 0x87, "ASHAMED" }, { 0x88, "AUDIO_CALL" }, { 0x89, "AVAILABLE" }, { 0x8A, "BORED" }, { 0x8B, "CALL" }, { 0x8C, "CLI" }, { 0x8D, "COMPUTER" }, { 0x8E, "DISCREET" }, { 0x8F, "EMAIL" }, { 0x90, "EXCITED" }, { 0x91, "HAPPY" }, { 0x92, "IM" }, { 0x93, "IM_OFFLINE" }, { 0x94, "IM_ONLINE" }, { 0x95, "IN_LOVE" }, { 0x96, "INVINCIBLE" }, { 0x97, "JEALOUS" }, { 0x98, "MMS" }, { 0x99, "MOBILE_PHONE" }, { 0x9A, "NOT_AVAILABLE" }, { 0x9B, "OTHER" }, { 0x9C, "PDA" }, { 0x9D, "SAD" }, { 0x9E, "SLEEPY" }, { 0x9F, "SMS" }, { 0xA0, "VIDEO_CALL" }, { 0xA1, "VIDEO_STREAM" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static const value_valuestring wbxml_wv_csp_10_tags[] = { { 0, wbxml_wv_csp_10_tags_cp0 }, { 1, wbxml_wv_csp_10_tags_cp1 }, { 2, wbxml_wv_csp_10_tags_cp2 }, { 3, wbxml_wv_csp_10_tags_cp3 }, { 4, wbxml_wv_csp_10_tags_cp4 }, { 5, wbxml_wv_csp_10_tags_cp5 }, { 6, wbxml_wv_csp_10_tags_cp6 }, { 7, wbxml_wv_csp_10_tags_cp7 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_10_attrStart[] = { { 0, wbxml_wv_csp_10_attrStart_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_10_attrValue[] = { { 0, wbxml_wv_csp_10_attrValue_cp0 }, { 1, wbxml_wv_csp_10_attrValue_cp1 }, { 5, wbxml_wv_csp_10_attrValue_cp5 }, { 0, NULL } }; static const wbxml_decoding decode_wv_cspc_10 = { "Wireless-Village Client-Server Protocol 1.0", "WV-CSP 1.0", { NULL, NULL, NULL }, wv_csp10_opaque_binary_tag, wv_csp10_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, NULL, wbxml_wv_csp_10_tags, wbxml_wv_csp_10_attrStart, wbxml_wv_csp_10_attrValue }; /* WV-CSP 1.1 * * Wireless Village Client Server Protocol ***************************************/ /***** Global extension tokens *****/ static const value_string wbxml_wv_csp_11_global_cp0[] = { { 0x80, "Common Value" }, /* EXT_T_0 */ { 0x00, NULL } }; /***** Tag tokens *****/ /* Common code page */ static const value_string wbxml_wv_csp_11_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Acceptance" }, { 0x06, "AddList" }, { 0x07, "AddNickList" }, { 0x08, "SName" }, /* Was: Attribute */ { 0x09, "WV-CSP-Message" }, /* Was: AttributeList */ { 0x0A, "ClientID" }, { 0x0B, "Code" }, { 0x0C, "ContactList" }, { 0x0D, "ContentData" }, { 0x0E, "ContentEncoding" }, { 0x0F, "ContentSize" }, { 0x10, "ContentType" }, { 0x11, "DateTime" }, { 0x12, "Description" }, { 0x13, "DetailedResult" }, { 0x14, "EntityList" }, { 0x15, "Group" }, { 0x16, "GroupID" }, { 0x17, "GroupList" }, { 0x18, "InUse" }, { 0x19, "Logo" }, { 0x1A, "MessageCount" }, { 0x1B, "MessageID" }, { 0x1C, "MessageURI" }, { 0x1D, "MSISDN" }, { 0x1E, "Name" }, { 0x1F, "NickList" }, { 0x20, "NickName" }, { 0x21, "Poll" }, { 0x22, "Presence" }, { 0x23, "PresenceSubList" }, { 0x24, "PresenceValue" }, { 0x25, "Property" }, { 0x26, "Qualifier" }, { 0x27, "Recipient" }, { 0x28, "RemoveList" }, { 0x29, "RemoveNickList" }, { 0x2A, "Result" }, { 0x2B, "ScreenName" }, { 0x2C, "Sender" }, { 0x2D, "Session" }, { 0x2E, "SessionDescriptor" }, { 0x2F, "SessionID" }, { 0x30, "SessionType" }, { 0x31, "Status" }, { 0x32, "Transaction" }, { 0x33, "TransactionContent" }, { 0x34, "TransactionDescriptor" }, { 0x35, "TransactionID" }, { 0x36, "TransactionMode" }, { 0x37, "URL" }, { 0x38, "URLList" }, { 0x39, "User" }, { 0x3A, "UserID" }, { 0x3B, "UserList" }, { 0x3C, "Validity" }, { 0x3D, "Value" }, /* 0x3E - Removed: WV-CSP-Message */ { 0x00, NULL } }; /* Access code page */ static const value_string wbxml_wv_csp_11_tags_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AllFunctions" }, { 0x06, "AllFunctionsRequest" }, { 0x07, "CancelInvite-Request" }, { 0x08, "CancelInviteUser-Request" }, { 0x09, "Capability" }, { 0x0A, "CapabilityList" }, { 0x0B, "CapabilityRequest" }, { 0x0C, "ClientCapability-Request" }, { 0x0D, "ClientCapability-Response" }, { 0x0E, "DigestBytes" }, { 0x0F, "DigestSchema" }, { 0x10, "Disconnect" }, { 0x11, "Functions" }, { 0x12, "GetSPInfo-Request" }, { 0x13, "GetSPInfo-Response" }, { 0x14, "InviteID" }, { 0x15, "InviteNote" }, { 0x16, "Invite-Request" }, { 0x17, "Invite-Response" }, { 0x18, "InviteType" }, { 0x19, "InviteUser-Request" }, { 0x1A, "InviteUser-Response" }, { 0x1B, "KeepAlive-Request" }, { 0x1C, "KeepAliveTime" }, { 0x1D, "Login-Request" }, { 0x1E, "Login-Response" }, { 0x1F, "Logout-Request" }, { 0x20, "Nonce" }, { 0x21, "Password" }, { 0x22, "Polling-Request" }, { 0x23, "ResponseNote" }, { 0x24, "SearchElement" }, { 0x25, "SearchFindings" }, { 0x26, "SearchID" }, { 0x27, "SearchIndex" }, { 0x28, "SearchLimit" }, { 0x29, "KeepAlive-Response" }, { 0x2A, "SearchPairList" }, { 0x2B, "Search-Request" }, { 0x2C, "Search-Response" }, { 0x2D, "SearchResult" }, { 0x2E, "Service-Request" }, { 0x2F, "Service-Response" }, { 0x30, "SessionCookie" }, { 0x31, "StopSearch-Request" }, { 0x32, "TimeToLive" }, /* New in WV-CSP 1.1 */ { 0x33, "SearchString" }, { 0x34, "CompletionFlag" }, { 0x00, NULL } }; /* Service code page */ /* Same as cp2 of WV-CSP 1.0 */ #define wbxml_wv_csp_11_tags_cp2 wbxml_wv_csp_10_tags_cp2 /* Client capability code page */ static const value_string wbxml_wv_csp_11_tags_cp3[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AcceptedCharset" }, { 0x06, "AcceptedContentLength" }, { 0x07, "AcceptedContentType" }, { 0x08, "AcceptedTransferEncoding" }, { 0x09, "AnyContent" }, { 0x0A, "DefaultLanguage" }, /* Was: ClientType */ { 0x0B, "InitialDeliveryMethod" }, { 0x0C, "MultiTrans" }, { 0x0D, "ParserSize" }, { 0x0E, "ServerPollMin" }, { 0x0F, "SupportedBearer" }, { 0x10, "SupportedCIRMethod" }, { 0x11, "TCPAddress" }, { 0x12, "TCPPort" }, { 0x13, "UDPPort" }, { 0x00, NULL } }; /* Presence primitive code page */ static const value_string wbxml_wv_csp_11_tags_cp4[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CancelAuth-Request" }, { 0x06, "ContactListProperties" }, { 0x07, "CreateAttributeList-Request" }, { 0x08, "CreateList-Request" }, { 0x09, "DefaultAttributeList" }, { 0x0A, "DefaultContactList" }, { 0x0B, "DefaultList" }, { 0x0C, "DeleteAttributeList-Request" }, { 0x0D, "DeleteList-Request" }, { 0x0E, "GetAttributeList-Request" }, { 0x0F, "GetAttributeList-Response" }, { 0x10, "GetList-Request" }, { 0x11, "GetList-Response" }, { 0x12, "GetPresence-Request" }, { 0x13, "GetPresence-Response" }, { 0x14, "GetWatcherList-Request" }, { 0x15, "GetWatcherList-Response" }, { 0x16, "ListManage-Request" }, { 0x17, "ListManage-Response" }, { 0x18, "UnsubscribePresence-Request" }, /* Was: Presence */ { 0x19, "PresenceAuth-Request" }, { 0x1A, "PresenceAuth-User" }, /* Was: PresenceAuth-Response */ { 0x1B, "PresenceNotification-Request" }, { 0x1C, "UpdatePresence-Request" }, /* Was: PresenceValueList */ { 0x1D, "SubscribePresence-Request" }, /* 0x1E - Removed: UnsubscribePresence-Request */ /* 0x1F - Removed: UpdatePresence-Request */ { 0x00, NULL } }; /* Presence attribute code page */ static const value_string wbxml_wv_csp_11_tags_cp5[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Accuracy" }, { 0x06, "Address" }, { 0x07, "AddrPref" }, { 0x08, "Alias" }, { 0x09, "Altitude" }, { 0x0A, "Building" }, { 0x0B, "Caddr" }, { 0x0C, "City" }, { 0x0D, "ClientInfo" }, { 0x0E, "ClientProducer" }, { 0x0F, "ClientType" }, { 0x10, "ClientVersion" }, { 0x11, "CommC" }, { 0x12, "CommCap" }, { 0x13, "ContactInfo" }, { 0x14, "ContainedvCard" }, { 0x15, "Country" }, { 0x16, "Crossing1" }, { 0x17, "Crossing2" }, { 0x18, "DevManufacturer" }, { 0x19, "DirectContent" }, { 0x1A, "FreeTextLocation" }, { 0x1B, "GeoLocation" }, { 0x1C, "Language" }, { 0x1D, "Latitude" }, { 0x1E, "Longitude" }, { 0x1F, "Model" }, { 0x20, "NamedArea" }, { 0x21, "OnlineStatus" }, { 0x22, "PLMN" }, { 0x23, "PrefC" }, { 0x24, "PreferredContacts" }, { 0x25, "PreferredLanguage" }, { 0x26, "ReferredContent" }, { 0x27, "ReferredvCard" }, { 0x28, "Registration" }, { 0x29, "StatusContent" }, { 0x2A, "StatusMood" }, { 0x2B, "StatusText" }, { 0x2C, "Street" }, { 0x2D, "TimeZone" }, { 0x2E, "UserAvailability" }, /* New in WV-CSP 1.1 */ { 0x2F, "Cap" }, { 0x30, "Cname" }, { 0x31, "Contact" }, { 0x32, "Cpriority" }, { 0x33, "Cstatus" }, { 0x34, "Note" }, { 0x35, "Zone" }, { 0x00, NULL } }; /* Messaging code page */ static const value_string wbxml_wv_csp_11_tags_cp6[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "BlockList" }, { 0x06, "BlockUser-Request" }, { 0x07, "DeliveryMethod" }, { 0x08, "DeliveryReport" }, { 0x09, "DeliveryReport-Request" }, { 0x0A, "ForwardMessage-Request" }, { 0x0B, "GetBlockedList-Request" }, { 0x0C, "GetBlockedList-Response" }, { 0x0D, "GetMessageList-Request" }, { 0x0E, "GetMessageList-Response" }, { 0x0F, "GetMessage-Request" }, { 0x10, "GetMessage-Response" }, { 0x11, "GrantList" }, { 0x12, "MessageDelivered" }, { 0x13, "MessageInfo" }, { 0x14, "MessageNotification" }, { 0x15, "NewMessage" }, { 0x16, "RejectMessage-Request" }, { 0x17, "SendMessage-Request" }, { 0x18, "SendMessage-Response" }, { 0x19, "SetDeliveryMethod-Request" }, /* New in WV-CSP 1.1 */ { 0x1A, "DeliveryTime" }, { 0x00, NULL } }; /* Group code page */ static const value_string wbxml_wv_csp_11_tags_cp7[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AddGroupMembers-Request" }, { 0x06, "Admin" }, { 0x07, "CreateGroup-Request" }, { 0x08, "DeleteGroup-Request" }, { 0x09, "GetGroupMembers-Request" }, { 0x0A, "GetGroupMembers-Response" }, { 0x0B, "GetGroupProps-Request" }, { 0x0C, "GetGroupProps-Response" }, { 0x0D, "GroupChangeNotice" }, { 0x0E, "GroupProperties" }, { 0x0F, "Joined" }, { 0x10, "JoinedRequest" }, { 0x11, "JoinGroup-Request" }, { 0x12, "JoinGroup-Response" }, { 0x13, "LeaveGroup-Request" }, { 0x14, "LeaveGroup-Response" }, { 0x15, "Left" }, { 0x16, "MemberAccess-Request" }, { 0x17, "Mod" }, { 0x18, "OwnProperties" }, { 0x19, "RejectList-Request" }, { 0x1A, "RejectList-Response" }, { 0x1B, "RemoveGroupMembers-Request" }, { 0x1C, "SetGroupProps-Request" }, { 0x1D, "SubscribeGroupNotice-Request" }, { 0x1E, "SubscribeGroupNotice-Response" }, { 0x1F, "Users" }, { 0x20, "WelcomeNote" }, /* New in WV-CSP 1.1 */ { 0x21, "JoinGroup" }, { 0x22, "SubscribeNotification" }, { 0x23, "SubscribeType" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /* Common code page */ /* Same as cp0 of WV-CSP 1.0 */ #define wbxml_wv_csp_11_attrStart_cp0 wbxml_wv_csp_10_attrStart_cp0 /***** Attribute Value tokens *****/ /* * Element value tokens * * NOTE - WV-CSP uses the EXT_T_0 token in a peculiar way: the mb_u_int32 * does *not* reference an offset in the string table, but it refers to * the index in the following value_string. * * Please note that: * - Values 'T' and 'F' are Boolean values representing "True" and "False" * (or "Yes" and "No" in some circumstances) respectively. * - Values 'GR', 'IM', 'PR', 'SC', 'GM' and 'US' are enumerated values * representing "Group", "Instant Messaging", "Presence", "Shared Content", * "Group membership" and "User" respectively. * - Values 'G', 'S' and 'U' are enumerated values representing "Get", "Set" * and "Unset" respectively. * - Values 'N' and 'P' are enumerated values representing "Notify/Get" and * "Push" respectively. * * I repeat: this is NOT a attrValue[] array hence it is not called * wbxml_wv_XXX but vals_wv_XXX. * * Result: the attribute value token definitions from WV-CSP 1.0 are dropped. */ static const value_string vals_wv_csp_11_element_value_tokens[] = { /* * Common value tokens */ { 0x00, "AccessType" }, { 0x01, "ActiveUsers" }, { 0x02, "Admin" }, { 0x03, "application/" }, { 0x04, "application/vnd.wap.mms-message" }, { 0x05, "application/x-sms" }, { 0x06, "AutoJoin" }, { 0x07, "BASE64" }, { 0x08, "Closed" }, { 0x09, "Default" }, { 0x0A, "DisplayName" }, { 0x0B, "F" }, { 0x0C, "G" }, { 0x0D, "GR" }, { 0x0E, "http://" }, { 0x0F, "https://" }, { 0x10, "image/" }, { 0x11, "Inband" }, { 0x12, "IM" }, { 0x13, "MaxActiveUsers" }, { 0x14, "Mod" }, { 0x15, "Name" }, { 0x16, "None" }, { 0x17, "N" }, { 0x18, "Open" }, { 0x19, "Outband" }, { 0x1A, "PR" }, { 0x1B, "Private" }, { 0x1C, "PrivateMessaging" }, { 0x1D, "PrivilegeLevel" }, { 0x1E, "Public" }, { 0x1F, "P" }, { 0x20, "Request" }, { 0x21, "Response" }, { 0x22, "Restricted" }, { 0x23, "ScreenName" }, { 0x24, "Searchable" }, { 0x25, "S" }, { 0x26, "SC" }, { 0x27, "text/" }, { 0x28, "text/plain" }, { 0x29, "text/x-vCalendar" }, { 0x2A, "text/x-vCard" }, { 0x2B, "Topic" }, { 0x2C, "T" }, { 0x2D, "Type" }, { 0x2E, "U" }, { 0x2F, "US" }, { 0x30, "www.wireless-village.org" }, /* * Access value tokens */ { 0x3D, "GROUP_ID" }, { 0x3E, "GROUP_NAME" }, { 0x3F, "GROUP_TOPIC" }, { 0x40, "GROUP_USER_ID_JOINED" }, { 0x41, "GROUP_USER_ID_OWNER" }, { 0x42, "HTTP" }, { 0x43, "SMS" }, { 0x44, "STCP" }, { 0x45, "SUDP" }, { 0x46, "USER_ALIAS" }, { 0x47, "USER_EMAIL_ADDRESS" }, { 0x48, "USER_FIRST_NAME" }, { 0x49, "USER_ID" }, { 0x4A, "USER_LAST_NAME" }, { 0x4B, "USER_MOBILE_NUMBER" }, { 0x4C, "USER_ONLINE_STATUS" }, { 0x4D, "WAPSMS" }, { 0x4E, "WAPUDP" }, { 0x4F, "WSP" }, /* * Presence value tokens */ { 0x5B, "ANGRY" }, { 0x5C, "ANXIOUS" }, { 0x5D, "ASHAMED" }, { 0x5E, "AUDIO_CALL" }, { 0x5F, "AVAILABLE" }, { 0x60, "BORED" }, { 0x61, "CALL" }, { 0x62, "CLI" }, { 0x63, "COMPUTER" }, { 0x64, "DISCREET" }, { 0x65, "EMAIL" }, { 0x66, "EXCITED" }, { 0x67, "HAPPY" }, { 0x68, "IM" }, { 0x69, "IM_OFFLINE" }, { 0x6A, "IM_ONLINE" }, { 0x6B, "IN_LOVE" }, { 0x6C, "INVINCIBLE" }, { 0x6D, "JEALOUS" }, { 0x6E, "MMS" }, { 0x6F, "MOBILE_PHONE" }, { 0x70, "NOT_AVAILABLE" }, { 0x71, "OTHER" }, { 0x72, "PDA" }, { 0x73, "SAD" }, { 0x74, "SLEEPY" }, { 0x75, "SMS" }, { 0x76, "VIDEO_CALL" }, { 0x77, "VIDEO_STREAM" }, { 0x00, NULL } }; static value_string_ext vals_wv_csp_11_element_value_tokens_ext = VALUE_STRING_EXT_INIT(vals_wv_csp_11_element_value_tokens); /***** Token code page aggregation *****/ static char * ext_t_0_wv_cspc_11(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'", val_to_str_ext(value, &vals_wv_csp_11_element_value_tokens_ext, "<Unknown WV-CSP 1.1 Common Value token 0x%X>")); return str; } static const value_valuestring wbxml_wv_csp_11_global[] = { { 0, wbxml_wv_csp_11_global_cp0 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_11_tags[] = { { 0, wbxml_wv_csp_11_tags_cp0 }, { 1, wbxml_wv_csp_11_tags_cp1 }, { 2, wbxml_wv_csp_11_tags_cp2 }, { 3, wbxml_wv_csp_11_tags_cp3 }, { 4, wbxml_wv_csp_11_tags_cp4 }, { 5, wbxml_wv_csp_11_tags_cp5 }, { 6, wbxml_wv_csp_11_tags_cp6 }, { 7, wbxml_wv_csp_11_tags_cp7 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_11_attrStart[] = { { 0, wbxml_wv_csp_11_attrStart_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_wv_cspc_11 = { "Wireless-Village Client-Server Protocol 1.1", "WV-CSP 1.1", { ext_t_0_wv_cspc_11, NULL, NULL }, wv_csp11_opaque_binary_tag, wv_csp11_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wv_csp_11_global, wbxml_wv_csp_11_tags, wbxml_wv_csp_11_attrStart, NULL }; /* WV-CSP 1.2 * * Wireless Village Client Server Protocol ***************************************/ /***** Global extension tokens *****/ /* Same as WV-CSP 1.1 */ /***** Tag tokens *****/ /* Common code page */ /* Same as cp0 of WV-CSP 1.1 */ #define wbxml_wv_csp_12_tags_cp0 wbxml_wv_csp_11_tags_cp0 /* Note that the table continues in code page 0x09 */ /* Access code page (0x01) */ static const value_string wbxml_wv_csp_12_tags_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AllFunctions" }, { 0x06, "AllFunctionsRequest" }, { 0x07, "CancelInvite-Request" }, { 0x08, "CancelInviteUser-Request" }, { 0x09, "Capability" }, { 0x0A, "CapabilityList" }, { 0x0B, "CapabilityRequest" }, { 0x0C, "ClientCapability-Request" }, { 0x0D, "ClientCapability-Response" }, { 0x0E, "DigestBytes" }, { 0x0F, "DigestSchema" }, { 0x10, "Disconnect" }, { 0x11, "Functions" }, { 0x12, "GetSPInfo-Request" }, { 0x13, "GetSPInfo-Response" }, { 0x14, "InviteID" }, { 0x15, "InviteNote" }, { 0x16, "Invite-Request" }, { 0x17, "Invite-Response" }, { 0x18, "InviteType" }, { 0x19, "InviteUser-Request" }, { 0x1A, "InviteUser-Response" }, { 0x1B, "KeepAlive-Request" }, { 0x1C, "KeepAliveTime" }, { 0x1D, "Login-Request" }, { 0x1E, "Login-Response" }, { 0x1F, "Logout-Request" }, { 0x20, "Nonce" }, { 0x21, "Password" }, { 0x22, "Polling-Request" }, { 0x23, "ResponseNote" }, { 0x24, "SearchElement" }, { 0x25, "SearchFindings" }, { 0x26, "SearchID" }, { 0x27, "SearchIndex" }, { 0x28, "SearchLimit" }, { 0x29, "KeepAlive-Response" }, { 0x2A, "SearchPairList" }, { 0x2B, "Search-Request" }, { 0x2C, "Search-Response" }, { 0x2D, "SearchResult" }, { 0x2E, "Service-Request" }, { 0x2F, "Service-Response" }, { 0x30, "SessionCookie" }, { 0x31, "StopSearch-Request" }, { 0x32, "TimeToLive" }, /* New in WV-CSP 1.1 */ { 0x33, "SearchString" }, { 0x34, "CompletionFlag" }, /* New in WV-CSP 1.2 */ { 0x36, "ReceiveList" }, { 0x37, "VerifyID-Request" }, { 0x38, "Extended-Request" }, { 0x39, "Extended-Response" }, { 0x3A, "AgreedCapabilityList" }, { 0x3B, "ExtendedData" }, { 0x3C, "OtherServer" }, { 0x3D, "PresenceAttributeNSName" }, { 0x3E, "SessionNSName" }, { 0x3F, "TransactionNSName" }, { 0x00, NULL } }; /* Note that the table continues in code page 0x0A */ /* Service code page (0x02) */ static const value_string wbxml_wv_csp_12_tags_cp2[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ADDGM" }, { 0x06, "AttListFunc" }, { 0x07, "BLENT" }, { 0x08, "CAAUT" }, { 0x09, "CAINV" }, { 0x0A, "CALI" }, { 0x0B, "CCLI" }, { 0x0C, "ContListFunc" }, { 0x0D, "CREAG" }, { 0x0E, "DALI" }, { 0x0F, "DCLI" }, { 0x10, "DELGR" }, { 0x11, "FundamentalFeat" }, { 0x12, "FWMSG" }, { 0x13, "GALS" }, { 0x14, "GCLI" }, { 0x15, "GETGM" }, { 0x16, "GETGP" }, { 0x17, "GETLM" }, { 0x18, "GETM" }, { 0x19, "GETPR" }, { 0x1A, "GETSPI" }, { 0x1B, "GETWL" }, { 0x1C, "GLBLU" }, { 0x1D, "GRCHN" }, { 0x1E, "GroupAuthFunc" }, { 0x1F, "GroupFeat" }, { 0x20, "GroupMgmtFunc" }, { 0x21, "GroupUseFunc" }, { 0x22, "IMAuthFunc" }, { 0x23, "IMFeat" }, { 0x24, "IMReceiveFunc" }, { 0x25, "IMSendFunc" }, { 0x26, "INVIT" }, { 0x27, "InviteFunc" }, { 0x28, "MBRAC" }, { 0x29, "MCLS" }, { 0x2A, "MDELIV" }, { 0x2B, "NEWM" }, { 0x2C, "NOTIF" }, { 0x2D, "PresenceAuthFunc" }, { 0x2E, "PresenceDeliverFunc" }, { 0x2F, "PresenceFeat" }, { 0x30, "REACT" }, { 0x31, "REJCM" }, { 0x32, "REJEC" }, { 0x33, "RMVGM" }, { 0x34, "SearchFunc" }, { 0x35, "ServiceFunc" }, { 0x36, "SETD" }, { 0x37, "SETGP" }, { 0x38, "SRCH" }, { 0x39, "STSRC" }, { 0x3A, "SUBGCN" }, { 0x3B, "UPDPR" }, { 0x3C, "WVCSPFeat" }, /* New in WV-CSP 1.2 */ { 0x3D, "MF" }, { 0x3E, "MG" }, { 0x3F, "MM" }, { 0x00, NULL } }; /* Note that the table continues in code page 0x08 */ /* Client capability code page (0x03) */ static const value_string wbxml_wv_csp_12_tags_cp3[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AcceptedCharset" }, { 0x06, "AcceptedContentLength" }, { 0x07, "AcceptedContentType" }, { 0x08, "AcceptedTransferEncoding" }, { 0x09, "AnyContent" }, { 0x0A, "DefaultLanguage" }, { 0x0B, "InitialDeliveryMethod" }, { 0x0C, "MultiTrans" }, { 0x0D, "ParserSize" }, { 0x0E, "ServerPollMin" }, { 0x0F, "SupportedBearer" }, { 0x10, "SupportedCIRMethod" }, { 0x11, "TCPAddress" }, { 0x12, "TCPPort" }, { 0x13, "UDPPort" }, { 0x14, "CIRURL" }, { 0x00, NULL } }; /* Presence primitive code page (0x04) */ static const value_string wbxml_wv_csp_12_tags_cp4[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CancelAuth-Request" }, { 0x06, "ContactListProperties" }, { 0x07, "CreateAttributeList-Request" }, { 0x08, "CreateList-Request" }, { 0x09, "DefaultAttributeList" }, { 0x0A, "DefaultContactList" }, { 0x0B, "DefaultList" }, { 0x0C, "DeleteAttributeList-Request" }, { 0x0D, "DeleteList-Request" }, { 0x0E, "GetAttributeList-Request" }, { 0x0F, "GetAttributeList-Response" }, { 0x10, "GetList-Request" }, { 0x11, "GetList-Response" }, { 0x12, "GetPresence-Request" }, { 0x13, "GetPresence-Response" }, { 0x14, "GetWatcherList-Request" }, { 0x15, "GetWatcherList-Response" }, { 0x16, "ListManage-Request" }, { 0x17, "ListManage-Response" }, { 0x18, "UnsubscribePresence-Request" }, { 0x19, "PresenceAuth-Request" }, { 0x1A, "PresenceAuth-User" }, { 0x1B, "PresenceNotification-Request" }, { 0x1C, "UpdatePresence-Request" }, { 0x1D, "SubscribePresence-Request" }, /* New in WV-CSP 1.2 */ { 0x1E, "Auto-Subscribe" }, /* 0x1E was defined in WV-CSP 1.0: UnsubscribePresence-Request */ { 0x1F, "GetReactiveAuthStatus-Request" }, /* 0x1F was defined in WV-CSP 1.0: UpdatePresence-Request */ { 0x20, "GetReactiveAuthStatus-Response" }, { 0x00, NULL } }; /* Presence attribute code page (0x05) */ static const value_string wbxml_wv_csp_12_tags_cp5[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Accuracy" }, { 0x06, "Address" }, { 0x07, "AddrPref" }, { 0x08, "Alias" }, { 0x09, "Altitude" }, { 0x0A, "Building" }, { 0x0B, "Caddr" }, { 0x0C, "City" }, { 0x0D, "ClientInfo" }, { 0x0E, "ClientProducer" }, { 0x0F, "ClientType" }, { 0x10, "ClientVersion" }, { 0x11, "CommC" }, { 0x12, "CommCap" }, { 0x13, "ContactInfo" }, { 0x14, "ContainedvCard" }, { 0x15, "Country" }, { 0x16, "Crossing1" }, { 0x17, "Crossing2" }, { 0x18, "DevManufacturer" }, { 0x19, "DirectContent" }, { 0x1A, "FreeTextLocation" }, { 0x1B, "GeoLocation" }, { 0x1C, "Language" }, { 0x1D, "Latitude" }, { 0x1E, "Longitude" }, { 0x1F, "Model" }, { 0x20, "NamedArea" }, { 0x21, "OnlineStatus" }, { 0x22, "PLMN" }, { 0x23, "PrefC" }, { 0x24, "PreferredContacts" }, { 0x25, "PreferredLanguage" }, { 0x26, "ReferredContent" }, { 0x27, "ReferredvCard" }, { 0x28, "Registration" }, { 0x29, "StatusContent" }, { 0x2A, "StatusMood" }, { 0x2B, "StatusText" }, { 0x2C, "Street" }, { 0x2D, "TimeZone" }, { 0x2E, "UserAvailability" }, /* New in WV-CSP 1.1 */ { 0x2F, "Cap" }, { 0x30, "Cname" }, { 0x31, "Contact" }, { 0x32, "Cpriority" }, { 0x33, "Cstatus" }, { 0x34, "Note" }, { 0x35, "Zone" }, /* New in WV-CSP 1.2 */ { 0x36, "ContentType" }, { 0x37, "Inf_link" }, { 0x38, "InfoLink" }, { 0x39, "Link" }, { 0x3A, "Text" }, { 0x00, NULL } }; /* Messaging code page (0x06) */ static const value_string wbxml_wv_csp_12_tags_cp6[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "BlockList" }, { 0x06, "BlockEntity-Request" }, /* Was: BlockUser-Request */ { 0x07, "DeliveryMethod" }, { 0x08, "DeliveryReport" }, { 0x09, "DeliveryReport-Request" }, { 0x0A, "ForwardMessage-Request" }, { 0x0B, "GetBlockedList-Request" }, { 0x0C, "GetBlockedList-Response" }, { 0x0D, "GetMessageList-Request" }, { 0x0E, "GetMessageList-Response" }, { 0x0F, "GetMessage-Request" }, { 0x10, "GetMessage-Response" }, { 0x11, "GrantList" }, { 0x12, "MessageDelivered" }, { 0x13, "MessageInfo" }, { 0x14, "MessageNotification" }, { 0x15, "NewMessage" }, { 0x16, "RejectMessage-Request" }, { 0x17, "SendMessage-Request" }, { 0x18, "SendMessage-Response" }, { 0x19, "SetDeliveryMethod-Request" }, { 0x1A, "DeliveryTime" }, { 0x00, NULL } }; /* Group code page (0x07) */ static const value_string wbxml_wv_csp_12_tags_cp7[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AddGroupMembers-Request" }, { 0x06, "Admin" }, { 0x07, "CreateGroup-Request" }, { 0x08, "DeleteGroup-Request" }, { 0x09, "GetGroupMembers-Request" }, { 0x0A, "GetGroupMembers-Response" }, { 0x0B, "GetGroupProps-Request" }, { 0x0C, "GetGroupProps-Response" }, { 0x0D, "GroupChangeNotice" }, { 0x0E, "GroupProperties" }, { 0x0F, "Joined" }, { 0x10, "JoinedRequest" }, { 0x11, "JoinGroup-Request" }, { 0x12, "JoinGroup-Response" }, { 0x13, "LeaveGroup-Request" }, { 0x14, "LeaveGroup-Response" }, { 0x15, "Left" }, { 0x16, "MemberAccess-Request" }, { 0x17, "Mod" }, { 0x18, "OwnProperties" }, { 0x19, "RejectList-Request" }, { 0x1A, "RejectList-Response" }, { 0x1B, "RemoveGroupMembers-Request" }, { 0x1C, "SetGroupProps-Request" }, { 0x1D, "SubscribeGroupNotice-Request" }, { 0x1E, "SubscribeGroupNotice-Response" }, { 0x1F, "Users" }, { 0x20, "WelcomeNote" }, /* New in WV-CSP 1.1 */ { 0x21, "JoinGroup" }, { 0x22, "SubscribeNotification" }, { 0x23, "SubscribeType" }, /* New in WV-CSP 1.2 */ { 0x24, "GetJoinedUsers-Request" }, { 0x25, "GetJoinedUsers-Response" }, { 0x26, "AdminMapList" }, { 0x27, "AdminMapping" }, { 0x28, "Mapping" }, { 0x29, "ModMapping" }, { 0x2A, "UserMapList" }, { 0x2B, "UserMapping" }, { 0x00, NULL } }; /* Service negotiation code page - continued (0x08) */ static const value_string wbxml_wv_csp_12_tags_cp8[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "MP" }, { 0x06, "GETAUT" }, { 0x07, "GETJU" }, { 0x08, "VRID" }, { 0x09, "VerifyIDFunc" }, { 0x00, NULL } }; /* Common code page - continued (0x09) */ static const value_string wbxml_wv_csp_12_tags_cp9[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "CIR" }, { 0x06, "Domain" }, { 0x07, "ExtBlock" }, { 0x08, "HistoryPeriod" }, { 0x09, "IDList" }, { 0x0A, "MaxWatcherList" }, { 0x0B, "ReactiveAuthState" }, { 0x0C, "ReactiveAuthStatus" }, { 0x0D, "ReactiveAuthStatusList" }, { 0x0E, "Watcher" }, { 0x0F, "WatcherStatus" }, { 0x00, NULL } }; /* Access code page - continued (0x0A) */ static const value_string wbxml_wv_csp_12_tags_cp10[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "WV-CSP-NSDiscovery-Request" }, { 0x06, "WV-CSP-NSDiscovery-Response" }, { 0x07, "VersionList" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /* Common code page (0x00) */ static const value_string wbxml_wv_csp_12_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "xmlns='http://www.wireless-village.org/CSP'" }, { 0x06, "xmlns='http://www.wireless-village.org/PA'" }, { 0x07, "xmlns='http://www.wireless-village.org/TRC'" }, /* New in WV-CSP 1.2 */ { 0x08, "xmlns='http://www.openmobilealliance.org/DTD/WV-CSP'" }, { 0x09, "xmlns='http://www.openmobilealliance.org/DTD/WV-PA'" }, { 0x0A, "xmlns http://www.openmobilealliance.org/DTD/WV-TRC'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* * Element value tokens * * NOTE - WV-CSP uses the EXT_T_0 token in a peculiar way: the mb_u_int32 * does *not* reference an offset in the string table, but it refers to * the index in the following value_string. * * Please note that: * - Values 'T' and 'F' are Boolean values representing "True" and "False" * (or "Yes" and "No" in some circumstances) respectively. * - Values 'GR', 'IM', 'PR', 'SC', 'GM' and 'US' are enumerated values * representing "Group", "Instant Messaging", "Presence", "Shared Content", * "Group membership" and "User" respectively. * - Values 'G', 'S' and 'U' are enumerated values representing "Get", "Set" * and "Unset" respectively. * - Values 'N' and 'P' are enumerated values representing "Notify/Get" and * "Push" respectively. * * I repeat: this is NOT a attrValue[] array hence it is not called * wbxml_wv_XXX but vals_wv_XXX. */ static const value_string vals_wv_csp_12_element_value_tokens[] = { /* * Common value tokens */ { 0x00, "AccessType" }, { 0x01, "ActiveUsers" }, { 0x02, "Admin" }, { 0x03, "application/" }, { 0x04, "application/vnd.wap.mms-message" }, { 0x05, "application/x-sms" }, { 0x06, "AutoJoin" }, { 0x07, "BASE64" }, { 0x08, "Closed" }, { 0x09, "Default" }, { 0x0A, "DisplayName" }, { 0x0B, "F" }, { 0x0C, "G" }, { 0x0D, "GR" }, { 0x0E, "http://" }, { 0x0F, "https://" }, { 0x10, "image/" }, { 0x11, "Inband" }, { 0x12, "IM" }, { 0x13, "MaxActiveUsers" }, { 0x14, "Mod" }, { 0x15, "Name" }, { 0x16, "None" }, { 0x17, "N" }, { 0x18, "Open" }, { 0x19, "Outband" }, { 0x1A, "PR" }, { 0x1B, "Private" }, { 0x1C, "PrivateMessaging" }, { 0x1D, "PrivilegeLevel" }, { 0x1E, "Public" }, { 0x1F, "P" }, { 0x20, "Request" }, { 0x21, "Response" }, { 0x22, "Restricted" }, { 0x23, "ScreenName" }, { 0x24, "Searchable" }, { 0x25, "S" }, { 0x26, "SC" }, { 0x27, "text/" }, { 0x28, "text/plain" }, { 0x29, "text/x-vCalendar" }, { 0x2A, "text/x-vCard" }, { 0x2B, "Topic" }, { 0x2C, "T" }, { 0x2D, "Type" }, { 0x2E, "U" }, { 0x2F, "US" }, { 0x30, "www.wireless-village.org" }, /* New in WV-CSP 1.2 */ { 0x31, "AutoDelete" }, { 0x32, "GM" }, { 0x33, "Validity" }, { 0x34, "DENIED" }, { 0x35, "GRANTED" }, { 0x36, "PENDING" }, { 0x37, "ShowID" }, /* * Access value tokens */ { 0x3D, "GROUP_ID" }, { 0x3E, "GROUP_NAME" }, { 0x3F, "GROUP_TOPIC" }, { 0x40, "GROUP_USER_ID_JOINED" }, { 0x41, "GROUP_USER_ID_OWNER" }, { 0x42, "HTTP" }, { 0x43, "SMS" }, { 0x44, "STCP" }, { 0x45, "SUDP" }, { 0x46, "USER_ALIAS" }, { 0x47, "USER_EMAIL_ADDRESS" }, { 0x48, "USER_FIRST_NAME" }, { 0x49, "USER_ID" }, { 0x4A, "USER_LAST_NAME" }, { 0x4B, "USER_MOBILE_NUMBER" }, { 0x4C, "USER_ONLINE_STATUS" }, { 0x4D, "WAPSMS" }, { 0x4E, "WAPUDP" }, { 0x4F, "WSP" }, /* New in WV-CSP 1.2 */ { 0x50, "GROUP_USER_ID_AUTOJOIN" }, /* * Presence value tokens */ { 0x5B, "ANGRY" }, { 0x5C, "ANXIOUS" }, { 0x5D, "ASHAMED" }, { 0x5E, "AUDIO_CALL" }, { 0x5F, "AVAILABLE" }, { 0x60, "BORED" }, { 0x61, "CALL" }, { 0x62, "CLI" }, { 0x63, "COMPUTER" }, { 0x64, "DISCREET" }, { 0x65, "EMAIL" }, { 0x66, "EXCITED" }, { 0x67, "HAPPY" }, /* { 0x68, "IM" }, Obsolete */ { 0x69, "IM_OFFLINE" }, { 0x6A, "IM_ONLINE" }, { 0x6B, "IN_LOVE" }, { 0x6C, "INVINCIBLE" }, { 0x6D, "JEALOUS" }, { 0x6E, "MMS" }, { 0x6F, "MOBILE_PHONE" }, { 0x70, "NOT_AVAILABLE" }, { 0x71, "OTHER" }, { 0x72, "PDA" }, { 0x73, "SAD" }, { 0x74, "SLEEPY" }, { 0x75, "SMS" }, { 0x76, "VIDEO_CALL" }, { 0x77, "VIDEO_STREAM" }, /* * Access value tokens - continued */ { 0xA4, "SSMS" }, { 0xA5, "SHTTP" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static char * ext_t_0_wv_cspc_12(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'", val_to_str(value, vals_wv_csp_12_element_value_tokens, "<Unknown WV-CSP 1.2 Common Value token 0x%X>")); return str; } #define wbxml_wv_csp_12_global wbxml_wv_csp_11_global static const value_valuestring wbxml_wv_csp_12_tags[] = { { 0, wbxml_wv_csp_12_tags_cp0 }, { 1, wbxml_wv_csp_12_tags_cp1 }, { 2, wbxml_wv_csp_12_tags_cp2 }, { 3, wbxml_wv_csp_12_tags_cp3 }, { 4, wbxml_wv_csp_12_tags_cp4 }, { 5, wbxml_wv_csp_12_tags_cp5 }, { 6, wbxml_wv_csp_12_tags_cp6 }, { 7, wbxml_wv_csp_12_tags_cp7 }, { 8, wbxml_wv_csp_12_tags_cp8 }, { 9, wbxml_wv_csp_12_tags_cp9 }, { 10, wbxml_wv_csp_12_tags_cp10 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_12_attrStart[] = { { 0, wbxml_wv_csp_12_attrStart_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_wv_cspc_12 = { "Wireless-Village Client-Server Protocol 1.2", "WV-CSP 1.2", { ext_t_0_wv_cspc_12, NULL, NULL }, wv_csp12_opaque_binary_tag, wv_csp12_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wv_csp_12_global, wbxml_wv_csp_12_tags, wbxml_wv_csp_12_attrStart, NULL }; /* WV-CSP 1.3 * * Wireless Village Client Server Protocol ***************************************/ /***** Global extension tokens *****/ /* Same as WV-CSP 1.1 */ /***** Tag tokens *****/ /* Common code page */ static const value_string wbxml_wv_csp_13_tags_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Acceptance"}, { 0x06, "AddList" }, { 0x07, "AddNickList"}, { 0x09, "WV-CSP-Message"}, { 0x0A, "ClientID"}, { 0x0B, "Code"}, { 0x0C, "ContactList"}, { 0x0D, "ContentData"}, { 0x0E, "ContentEncoding"}, { 0x0F, "ContentSize" }, { 0x10, "ContentType"}, { 0x11, "DateTime" }, { 0x12, "Description" }, { 0x13, "DetailedResult"}, { 0x14, "EntityList"}, { 0x15, "Group" }, { 0x16, "GroupID"}, { 0x17, "GroupList"}, { 0x19, "Logo"}, { 0x1A, "MessageCount" }, { 0x1B, "MessageID" }, { 0x1C, "MessageURI"}, { 0x1D, "MSISDN" }, { 0x1E, "Name"}, { 0x1F, "NickList"}, { 0x20, "NickName"}, { 0x21, "Poll"}, { 0x22, "Presence"}, { 0x23, "PresenceSubList" }, { 0x24, "PresenceValue"}, { 0x25, "Property" }, { 0x26, "Qualifier" }, { 0x27, "Recipient" }, { 0x28, "RemoveList"}, { 0x29, "RemoveNickList" }, { 0x2A, "Result" }, { 0x2B, "ScreenName"}, { 0x2C, "Sender" }, { 0x2D, "Session"}, { 0x2E, "SessionDescriptor" }, { 0x2F, "SessionID"}, { 0x30, "SessionType" }, { 0x08, "SName" }, { 0x31, "Status"}, { 0x32, "Transaction" }, { 0x33, "TransactionContent" }, { 0x34, "TransactionDescriptor"}, { 0x35, "TransactionID"}, { 0x36, "TransactionMode" }, { 0x37, "URL" }, { 0x38, "URLList"}, { 0x39, "User"}, { 0x3A, "UserID" }, { 0x3B, "UserList" }, { 0x3C, "Validity" }, { 0x3D, "Value" }, { 0x00, NULL } }; /* Note that the table continues in code page 0x09 */ /* Access code page (0x01) */ static const value_string wbxml_wv_csp_13_tags_cp1[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AllFunctions" }, { 0x06, "AllFunctionsRequest" }, { 0x07, "CancelInvite-Request" }, { 0x08, "CancelInviteUser-Request" }, /* { 0x09, "Capability" }, - removed in WV 1.3*/ { 0x0A, "CapabilityList" }, { 0x0B, "CapabilityRequest" }, { 0x0C, "ClientCapability-Request" }, { 0x0D, "ClientCapability-Response" }, { 0x0E, "DigestBytes" }, { 0x0F, "DigestSchema" }, { 0x10, "Disconnect" }, { 0x11, "Functions" }, { 0x12, "GetSPInfo-Request" }, { 0x13, "GetSPInfo-Response" }, { 0x14, "InviteID" }, { 0x15, "InviteNote" }, { 0x16, "Invite-Request" }, { 0x17, "Invite-Response" }, { 0x18, "InviteType" }, { 0x19, "InviteUser-Request" }, { 0x1A, "InviteUser-Response" }, { 0x1B, "KeepAlive-Request" }, { 0x1C, "KeepAliveTime" }, { 0x1D, "Login-Request" }, { 0x1E, "Login-Response" }, { 0x1F, "Logout-Request" }, { 0x20, "Nonce" }, { 0x21, "Password" }, { 0x22, "Polling-Request" }, { 0x23, "ResponseNote" }, { 0x24, "SearchElement" }, { 0x25, "SearchFindings" }, { 0x26, "SearchID" }, { 0x27, "SearchIndex" }, { 0x28, "SearchLimit" }, { 0x29, "KeepAlive-Response" }, { 0x2A, "SearchPairList" }, { 0x2B, "Search-Request" }, { 0x2C, "Search-Response" }, { 0x2D, "SearchResult" }, { 0x2E, "Service-Request" }, { 0x2F, "Service-Response" }, { 0x30, "SessionCookie" }, { 0x31, "StopSearch-Request" }, { 0x32, "TimeToLive" }, /* New in WV-CSP 1.1 */ { 0x33, "SearchString" }, { 0x34, "CompletionFlag" }, /* New in WV-CSP 1.2 */ { 0x36, "ReceiveList" }, { 0x37, "VerifyID-Request" }, { 0x38, "Extended-Request" }, { 0x39, "Extended-Response" }, { 0x3A, "AgreedCapabilityList" }, { 0x3B, "ExtendedData" }, { 0x3C, "OtherServer" }, { 0x3D, "PresenceAttributeNSName" }, { 0x3E, "SessionNSName" }, { 0x3F, "TransactionNSName" }, { 0x00, NULL } }; /* Note that the table continues in code page 0x0A */ /* Service code page (0x02) */ static const value_string wbxml_wv_csp_13_tags_cp2[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "ADDGM" }, /* { 0x06, "AttListFunc" }, removed in WV 1.3 */ { 0x07, "BLENT" }, /* { 0x08, "CAAUT" }, removed in WV 1.3 */ { 0x09, "CAINV" }, /* { 0x0A, "CALI" }, removed in WV 1.3 */ { 0x0B, "CCLI" }, { 0x0C, "ContListFunc" }, { 0x0D, "CREAG" }, { 0x0E, "DALI" }, { 0x0F, "DCLI" }, { 0x10, "DELGR" }, { 0x11, "FundamentalFeat" }, { 0x12, "FWMSG" }, /* { 0x13, "GALS" }, removed in WV 1.3 */ { 0x14, "GCLI" }, { 0x15, "GETGM" }, { 0x16, "GETGP" }, { 0x17, "GETLM" }, { 0x18, "GETM" }, { 0x19, "GETPR" }, { 0x1A, "GETSPI" }, { 0x1B, "GETWL" }, { 0x1C, "GLBLU" }, { 0x1D, "GRCHN" }, { 0x1E, "GroupAuthFunc" }, { 0x1F, "GroupFeat" }, { 0x20, "GroupMgmtFunc" }, { 0x21, "GroupUseFunc" }, { 0x22, "IMAuthFunc" }, { 0x23, "IMFeat" }, { 0x24, "IMReceiveFunc" }, { 0x25, "IMSendFunc" }, { 0x26, "INVIT" }, { 0x27, "InviteFunc" }, { 0x28, "MBRAC" }, { 0x29, "MCLS" }, { 0x2A, "MDELIV" }, { 0x2B, "NEWM" }, { 0x2C, "NOTIF" }, { 0x2D, "PresenceAuthFunc" }, { 0x2E, "PresenceDeliverFunc"}, { 0x2F, "PresenceFeat" }, /* { 0x30, "REACT" }, removed in WV 1.3 */ { 0x31, "REJCM" }, { 0x32, "REJEC" }, { 0x33, "RMVGM" }, { 0x34, "SearchFunc" }, { 0x35, "ServiceFunc" }, { 0x36, "SETD" }, { 0x37, "SETGP" }, { 0x38, "SRCH" }, { 0x39, "STSRC" }, { 0x3A, "SUBGCN" }, { 0x3B, "UPDPR" }, { 0x3C, "WVCSPFeat" }, /* New in WV-CSP 1.2 */ { 0x3D, "MF" }, { 0x3E, "MG" }, { 0x3F, "MM" }, { 0x00, NULL } }; /* Note that the table continues in code page 0x08 */ /* Client capability code page (0x03) */ static const value_string wbxml_wv_csp_13_tags_cp3[] = { /* 0x00 -- 0x04 GLOBAL */ /* {0x05, "AcceptedCharset"}, - removed in WV 1.3 */ /* { 0x06, "AcceptedContentLength"}, - removed in WV 1.3 */ { 0x07, "AcceptedContentType"}, { 0x08, "AcceptedTransferEncoding"}, { 0x09, "AnyContent"}, { 0x0A, "DefaultLanguage"}, { 0x0B, "InitialDeliveryMethod"}, { 0x0C, "MultiTrans"}, { 0x0D, "ParserSize"}, { 0x0E, "ServerPollMin"}, { 0x0F, "SupportedBearer"}, { 0x10, "SupportedCIRMethod"}, { 0x11, "TCPAddress"}, { 0x12, "TCPPort"}, { 0x13, "UDPPort"}, /* New in WV-CSP 1.3*/ { 0x14, "CIRHTTPAddress"}, { 0x15, "UDPAddress"}, { 0x16, "AcceptedPullLength"}, { 0x17, "AcceptedPushLength"}, { 0x18, "AcceptedRichContentLength"}, { 0x19, "AcceptedTextContentLength"}, { 0x1A, "OfflineETEMHandling"}, { 0x1B, "PlainTextCharset"}, { 0x1C, "SessionPriority"}, { 0x1D, "SupportedOfflineBearer"}, { 0x1F, "UserSessionLimit"}, { 0x20, "CIRSMSAddress"}, { 0x21, "MultiTransPerMessage"}, { 0x22, "OnlineETEMHandling"}, { 0x23,"ContentPolicy"}, { 0x24, "ContentPolicyLimit"}, { 0x00, NULL } }; /* Presence primitive code page (0x04) */ static const value_string wbxml_wv_csp_13_tags_cp4[] = { /* 0x00 -- 0x04 GLOBAL */ /* { 0x05, "CancelAuth-Request" }, - removed in WV 1.3 */ { 0x06, "ContactListProperties" }, { 0x07, "CreateAttributeList-Request" }, { 0x08, "CreateList-Request" }, { 0x09, "DefaultAttributeList" }, { 0x0A, "DefaultContactList" }, { 0x0B, "DefaultList" }, { 0x0C, "DeleteAttributeList-Request" }, { 0x0D, "DeleteList-Request" }, { 0x0E, "GetAttributeList-Request" }, { 0x0F, "GetAttributeList-Response" }, { 0x10, "GetList-Request" }, { 0x11, "GetList-Response" }, { 0x12, "GetPresence-Request" }, { 0x13, "GetPresence-Response" }, { 0x14, "GetWatcherList-Request" }, { 0x15, "GetWatcherList-Response" }, { 0x16, "ListManage-Request" }, { 0x17, "ListManage-Response" }, { 0x18, "UnsubscribePresence-Request" }, { 0x19, "PresenceAuth-Request" }, { 0x1A, "PresenceAuth-User" }, { 0x1B, "PresenceNotification-Request" }, { 0x1C, "UpdatePresence-Request" }, { 0x1D, "SubscribePresence-Request" }, /* New in WV-CSP 1.2 */ /* { 0x1E, "Auto-Subscribe" }, - removed in WV 1.3 */ /* { 0x1F, "GetReactiveAuthStatus-Request" }, */ /* { 0x20, "GetReactiveAuthStatus-Response" }, */ /* New in WV-CSP 1.3 */ { 0x21, "CreateList-Response"}, { 0x00, NULL } }; /* Presence attribute code page (0x05) */ static const value_string wbxml_wv_csp_13_tags_cp5[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "Accuracy" }, { 0x06, "Address" }, { 0x07, "AddrPref" }, { 0x08, "Alias" }, { 0x09, "Altitude" }, { 0x0A, "Building" }, { 0x0B, "Caddr" }, { 0x0C, "City" }, { 0x0D, "ClientInfo" }, { 0x0E, "ClientProducer" }, { 0x0F, "ClientType" }, { 0x10, "ClientVersion" }, { 0x11, "CommC" }, { 0x12, "CommCap" }, { 0x13, "ContactInfo" }, { 0x14, "ContainedvCard" }, { 0x15, "Country" }, { 0x16, "Crossing1" }, { 0x17, "Crossing2" }, { 0x18, "DevManufacturer" }, { 0x19, "DirectContent" }, { 0x1A, "FreeTextLocation" }, { 0x1B, "GeoLocation" }, { 0x1C, "Language" }, { 0x1D, "Latitude" }, { 0x1E, "Longitude" }, { 0x1F, "Model" }, { 0x20, "NamedArea" }, { 0x21, "OnlineStatus" }, { 0x22, "PLMN" }, { 0x23, "PrefC" }, { 0x24, "PreferredContacts" }, { 0x25, "PreferredLanguage" }, { 0x26, "ReferredContent" }, { 0x27, "ReferredvCard" }, { 0x28, "Registration" }, { 0x29, "StatusContent" }, { 0x2A, "StatusMood" }, { 0x2B, "StatusText" }, { 0x2C, "Street" }, { 0x2D, "TimeZone" }, { 0x2E, "UserAvailability" }, /* New in WV-CSP 1.1 */ { 0x2F, "Cap" }, { 0x30, "Cname" }, { 0x31, "Contact" }, { 0x32, "Cpriority" }, { 0x33, "Cstatus" }, { 0x34, "Note" }, { 0x35, "Zone" }, /* New in WV-CSP 1.2 */ { 0x36, "ContentType" }, { 0x37, "Inf_link" }, { 0x38, "InfoLink" }, { 0x39, "Link" }, { 0x3A, "Text" }, /* New in WV-CSP 1.3 */ { 0x3B, "ClientContentLimit"}, { 0x3C, "ClientIMPriority"}, { 0x3D, "MaxPullLength"}, { 0x3E, "MaxPushLength"}, { 0x00, NULL } }; /* Messaging code page (0x06) */ static const value_string wbxml_wv_csp_13_tags_cp6[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "BlockList" }, { 0x06, "BlockEntity-Request" }, /* Was: BlockUser-Request */ { 0x07, "DeliveryMethod" }, { 0x08, "DeliveryReport" }, { 0x09, "DeliveryReport-Request" }, { 0x0A, "ForwardMessage-Request" }, { 0x0B, "GetBlockedList-Request" }, { 0x0C, "GetBlockedList-Response" }, { 0x0D, "GetMessageList-Request" }, { 0x0E, "GetMessageList-Response" }, { 0x0F, "GetMessage-Request" }, { 0x10, "GetMessage-Response" }, { 0x11, "GrantList" }, { 0x12, "MessageDelivered" }, { 0x13, "MessageInfo" }, { 0x14, "MessageNotification" }, { 0x15, "NewMessage" }, { 0x16, "RejectMessage-Request" }, { 0x17, "SendMessage-Request" }, { 0x18, "SendMessage-Response" }, { 0x19, "SetDeliveryMethod-Request" }, { 0x1A, "DeliveryTime" }, /* New in WV-CSP 1.3 */ { 0x20, "MessageInfoList"}, { 0x21, "ForwardMessage-Response"}, { 0x00, NULL } }; /* Group code page (0x07) */ static const value_string wbxml_wv_csp_13_tags_cp7[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "AddGroupMembers-Request" }, { 0x06, "Admin" }, { 0x07, "CreateGroup-Request" }, { 0x08, "DeleteGroup-Request" }, { 0x09, "GetGroupMembers-Request" }, { 0x0A, "GetGroupMembers-Response" }, { 0x0B, "GetGroupProps-Request" }, { 0x0C, "GetGroupProps-Response" }, { 0x0D, "GroupChangeNotice" }, { 0x0E, "GroupProperties" }, { 0x0F, "Joined" }, { 0x10, "JoinedRequest" }, { 0x11, "JoinGroup-Request" }, { 0x12, "JoinGroup-Response" }, { 0x13, "LeaveGroup-Request" }, { 0x14, "LeaveGroup-Response" }, { 0x15, "Left" }, { 0x16, "MemberAccess-Request" }, { 0x17, "Mod" }, { 0x18, "OwnProperties" }, { 0x19, "RejectList-Request" }, { 0x1A, "RejectList-Response" }, { 0x1B, "RemoveGroupMembers-Request" }, { 0x1C, "SetGroupProps-Request" }, { 0x1D, "SubscribeGroupNotice-Request" }, { 0x1E, "SubscribeGroupNotice-Response" }, /* { 0x1F, "Users" }, - removed in WV 1.3 */ { 0x20, "WelcomeNote" }, /* New in WV-CSP 1.1 */ { 0x21, "JoinGroup" }, { 0x22, "SubscribeNotification" }, { 0x23, "SubscribeType" }, /* New in WV-CSP 1.2 */ { 0x24, "GetJoinedUsers-Request" }, { 0x25, "GetJoinedUsers-Response" }, { 0x26, "AdminMapList" }, { 0x27, "AdminMapping" }, { 0x28, "Mapping" }, { 0x29, "ModMapping" }, { 0x2A, "UserMapList" }, { 0x2B, "UserMapping" }, /* New in WV-CSP 1.3 */ { 0x2C, "JoinedBlocked" }, { 0x2D, "LeftBlocked" }, { 0x00, NULL } }; /* Service negotiation code page - continued (0x08) */ static const value_string wbxml_wv_csp_13_tags_cp8[] = { /* 0x00 -- 0x04 GLOBAL */ /* New in WV-CSP 1.2 */ { 0x05, "MP" }, { 0x06, "GETAUT" }, { 0x07, "GETJU" }, { 0x08, "VRID" }, { 0x09, "VerifyIDFunc" }, /* New in WV-CSP 1.3 */ { 0x0A, "GETMAP" }, { 0x0B, "SGMNT" }, { 0x0C, "EXCON" }, { 0x0D, "OFFNOTIF" }, { 0x0E, "ADVSR" }, { 0x00, NULL } }; /* Common code page - continued (0x09) */ static const value_string wbxml_wv_csp_13_tags_cp9[] = { /* 0x00 -- 0x04 GLOBAL */ /* New in WV-CSP 1.2 */ { 0x05, "CIR" }, { 0x06, "Domain" }, { 0x07, "ExtBlock" }, { 0x08, "HistoryPeriod" }, { 0x09, "IDList" }, { 0x0A, "MaxWatcherList" }, /* { 0x0B, "ReactiveAuthState" }, - removed in WV 1.3 */ /* { 0x0C, "ReactiveAuthStatus" }, - removed in WV 1.3 */ /* { 0x0D, "ReactiveAuthStatusList" }, - removed in WV 1.3 */ { 0x0E, "Watcher" }, { 0x0F, "WatcherStatus" }, /* New in WV-CSP 1.3 */ { 0x1B, "AnswerOption"}, { 0x1C, "AnswerOptionID" }, { 0x1D, "AnswerOptions"}, { 0x0B, "AnswerOptionText"}, { 0x1E, "ApplicationID"}, { 0x1F, "AuthorizeAndGrant"}, { 0x20, "ChosenOptionID"}, { 0x19, "ClearPublicProfile"}, { 0x13, "Color"}, { 0x21, "ContactListNotify"}, { 0x14, "ContentName"}, { 0x22, "DefaultNotify"}, { 0x39, "ExtBlockETEM"}, { 0x36, "ExtendConversationID"}, { 0x23, "ExtendConversationUser"}, { 0x10, "Font"}, { 0x18, "FriendlyName"}, { 0x34 , "GetMap-Request"}, { 0x35, "GetMap-Response"}, { 0x3A, "GroupContentLimit" }, { 0x24, "InText"}, { 0x15, "Map"}, { 0x3B, "MessageTotalCount"}, { 0x16, "NotificationType"}, { 0x17, "NotificationTypeList"}, { 0x1A, "PublicProfile"}, { 0x38, "RequiresResponse"}, { 0x25, "SegmentCount"}, { 0x26, "SegmentID" }, { 0x27, "SegmentInfo"}, { 0x28, "SegmentReference"}, { 0x11, "Size"}, { 0x12, "Style" }, { 0x29, "SystemMessage"}, { 0x2A, "SystemMessageID"}, { 0x2B, "SystemMessageList"}, { 0x2C, "SystemMessageResponse"}, { 0x2D, "SystemMessageResponseList" }, { 0x2F, "SystemMessageText"}, { 0x30, "TryAgainTimeout"}, { 0x3C, "UnrecognizedUserID"}, { 0x3F , "UserIDList"}, { 0x3D, "UserIDPair"}, { 0x31, "UserNotify"}, { 0x3E, "ValidUserID"}, { 0x32, "VerificationKey"}, { 0x33, "VerificationMechanism"}, { 0x37, "WatcherCount"}, { 0x00, NULL } }; /* Access code page - continued (0x0A) */ static const value_string wbxml_wv_csp_13_tags_cp10[] = { /* 0x00 -- 0x04 GLOBAL */ /* New in WV-CSP 1.2 */ { 0x05, "WV-CSP-NSDiscovery-Request" }, { 0x06, "WV-CSP-NSDiscovery-Response" }, { 0x07, "VersionList"}, /* New in WV-CSP 1.3 */ { 0x08, "SubscribeNotification-Request" }, { 0x09, "UnsubscribeNotification-Request" }, { 0x0A, "Notification-Request" }, { 0x0B, "AdvancedCriteria" }, { 0x0C, "PairID" }, { 0x0D, "GetPublicProfile-Request" }, { 0x0E, "GetPublicProfile-Response" }, { 0x0F, "UpdatePublicProfile-Request" }, { 0x10, "DropSegment-Request" }, { 0x11, "ExtendConversation-Response" }, { 0x12, "ExtendConversation-Request" }, { 0x13, "GetSegment-Request" }, { 0x14, "GetSegment-Response" }, { 0x15, "SystemMessage-Request" }, { 0x16, "SystemMessage-User" }, { 0x17, "SearchPair" }, { 0x18, "SegmentContent" }, { 0x00, NULL } }; /* Common code page - continued (0x0B) */ static const value_string wbxml_wv_csp_13_tags_cp11[] = { /* 0x00 -- 0x04 GLOBAL */ /* New in WV-CSP 1.3 */ { 0x05, "GrantListInUse" }, { 0x06, "BlockListInUse" }, { 0x07, "ContactListIDList" }, { 0x08, "AnswerOptionsText" }, { 0x00, NULL } }; /***** Attribute Start tokens *****/ /* Common code page (0x00) */ static const value_string wbxml_wv_csp_13_attrStart_cp0[] = { /* 0x00 -- 0x04 GLOBAL */ { 0x05, "xmlns='http://www.wireless-village.org/CSP'" }, { 0x06, "xmlns='http://www.wireless-village.org/PA'" }, { 0x07, "xmlns='http://www.wireless-village.org/TRC'" }, /* New in WV-CSP 1.2 */ { 0x08, "xmlns='http://www.openmobilealliance.org/DTD/WV-CSP'" }, { 0x09, "xmlns='http://www.openmobilealliance.org/DTD/WV-PA'" }, { 0x0A, "xmlns='http://www.openmobilealliance.org/DTD/WV-TRC'" }, /* New in WV-CSP 1.3 */ { 0x0B, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-CSP'" }, { 0x0C, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-PA'" }, { 0x0D, "xmlns='http://www.openmobilealliance.org/DTD/IMPS-TRC'" }, { 0x00, NULL } }; /***** Attribute Value tokens *****/ /* * Element value tokens */ static const value_string vals_wv_csp_13_element_value_tokens[] = { /* * Common value tokens */ { 0x52, "AC" }, { 0x00, "AccessType" }, { 0x01, "ActiveUsers" }, { 0x02, "Admin" }, { 0x3C, "ANC" }, { 0x51, "AND" }, { 0x5A, "ANU" }, { 0x68, "AP" }, { 0x03, "application/" }, { 0x04, "application/vnd.wap.mms-message" }, { 0x05, "application/x-sms" }, { 0x8F, "Aqua" }, { 0x90, "ATCL" }, { 0x31, "AutoDelete" }, { 0x06, "AutoJoin" }, { 0x07, "BASE64" }, { 0x7B, "Big" }, { 0x80, "Black" }, { 0x53, "BLC" }, { 0x54, "BLUC" }, { 0x8D, "Blue" }, { 0x7D, "Bold" }, { 0xBC, "C" }, { 0x91, "CLC" }, { 0x55, "CLCR" }, { 0x56, "CLD" }, { 0x08, "Closed" }, { 0xBD, "CURRENT_SUBSCRIBER" }, { 0x09, "Default" }, { 0x34, "DENIED" }, { 0xAB, "DETECT" }, { 0x0A, "DisplayName" }, { 0xA6, "DoNotNotify" }, { 0xA0, "EC" }, { 0xBA, "EG" }, { 0x0B, "F" }, { 0xAC, "FORKALL" }, { 0xBE, "FORMER_SUBSCRIBER" }, { 0x87, "Fuchsia" }, { 0x0C, "G" }, { 0x57, "GC" }, { 0x58, "GD" }, { 0x59, "GLC" }, { 0xA1, "GLUC" }, { 0x32, "GM" }, { 0xA7, "GMAU" }, { 0xA8, "GMG" }, { 0xA9, "GMR" }, { 0xAA, "GMU" }, { 0x0D, "GR" }, { 0x35, "GRANTED" }, { 0x82, "Gray" }, { 0x88, "Green" }, { 0x3D, "History" }, { 0x0E, "http://" }, { 0x0F, "https://" }, { 0x7C, "Huge" }, { 0xA2, "IA" }, { 0xA3, "IC" }, { 0x10, "image/" }, { 0x11, "Inband" }, { 0x12, "IM" }, { 0x9F, "IR" }, { 0x7E, "Italic" }, { 0x89, "Lime" }, { 0x84, "Maroon" }, { 0x13, "MaxActiveUsers" }, { 0x7A, "Medium" }, { 0xBB, "MinimumAge" }, { 0x14, "Mod" }, { 0x15, "Name" }, { 0x8C, "Navy" }, { 0x16, "None" }, { 0x17, "N" }, { 0xAD, "OEU" }, { 0x8A, "Olive" }, { 0x18, "Open" }, { 0x19, "Outband" }, { 0x36, "PENDING" }, { 0x3A, "PPU" }, { 0x1A, "PR" }, { 0xBF, "PRESENCE_ACCESS" }, { 0x1B, "Private" }, { 0x1C, "PrivateMessaging" }, { 0x1D, "PrivilegeLevel" }, { 0x1E, "Public" }, { 0x86, "Purple" }, { 0x1F, "P" }, { 0xC0, "R" }, { 0x85, "Red" }, { 0x20, "Request" }, { 0x21, "Response" }, { 0x22, "Restricted" }, { 0x38, "RequireInvitation" }, { 0x23, "ScreenName" }, { 0x24, "Searchable" }, { 0x25, "S" }, { 0x26, "SC" }, { 0xAE, "SERVERLOGIC" }, { 0x37, "ShowID" }, { 0x81, "Silver" }, { 0x79, "Small" }, { 0x3B, "SPA" }, { 0x8E, "Teal" }, { 0x27, "text/" }, { 0x28, "text/plain" }, { 0x29, "text/x-vCalendar" }, { 0x2A, "text/x-vCard" }, { 0x39, "Tiny" }, { 0x2B, "Topic" }, { 0x2C, "T" }, { 0x2D, "Type" }, { 0x2E, "U" }, { 0x7F, "Underline" }, { 0x2F, "US" }, { 0x33, "Validity" }, { 0x83, "White" }, { 0x78, "www.openmobilealliance.org" }, { 0x30, "www.wireless-village.org" }, { 0x8B, "Yellow" }, /* * Access value tokens */ { 0x3D, "GROUP_ID" }, { 0x3E, "GROUP_NAME" }, { 0x3F, "GROUP_TOPIC" }, { 0x40, "GROUP_USER_ID_JOINED" }, { 0x41, "GROUP_USER_ID_OWNER" }, { 0x42, "HTTP" }, { 0x43, "SMS" }, { 0x44, "STCP" }, { 0x45, "SUDP" }, { 0x46, "USER_ALIAS" }, { 0x47, "USER_EMAIL_ADDRESS" }, { 0x48, "USER_FIRST_NAME" }, { 0x49, "USER_ID" }, { 0x4A, "USER_LAST_NAME" }, { 0x4B, "USER_MOBILE_NUMBER" }, { 0x4C, "USER_ONLINE_STATUS" }, { 0x4D, "WAPSMS" }, { 0x4E, "WAPUDP" }, { 0x4F, "WSP" }, { 0x50, "GROUP_USER_ID_AUTOJOIN" }, /* * Presence value tokens */ { 0x5B, "ANGRY" }, { 0x5C, "ANXIOUS" }, { 0x5D, "ASHAMED" }, { 0x5F, "AVAILABLE" }, { 0x60, "BORED" }, { 0x61, "CALL" }, { 0x62, "CLI" }, { 0x63, "COMPUTER" }, { 0x64, "DISCREET" }, { 0x65, "EMAIL" }, { 0x66, "EXCITED" }, { 0x67, "HAPPY" }, { 0x6B, "IN_LOVE" }, { 0x6C, "INVINCIBLE" }, { 0x6D, "JEALOUS" }, { 0x6E, "MMS" }, { 0x6F, "MOBILE_PHONE" }, { 0x70, "NOT_AVAILABLE" }, { 0x71, "OTHER" }, { 0x72, "PDA" }, { 0x73, "SAD" }, { 0x74, "SLEEPY" }, { 0x75, "SMS" }, /* * Access value tokens - continued */ { 0x93, "USER_CITY" }, { 0x94, "USER_COUNTRY" }, { 0x95, "USER_FRIENDLY_NAME" }, { 0x96, "USER_GENDER" }, { 0x97, "USER_INTENTION" }, { 0x98, "USER_INTERESTS_HOBBIES" }, { 0x99, "USER_MARITAL_STATUS" }, { 0x9A, "PRIORITYREJECT" }, { 0x9B, "PRIORITYSTORE" }, { 0x9C, "REJECT" }, { 0x9D, "SENDREJECT" }, { 0x9E, "SENDSTORE" }, { 0xA4, "SSMS" }, { 0xA5, "SHTTP" }, { 0xAF, "PP_AGE" }, { 0xB0, "PP_CITY" }, { 0xB1, "PP_COUNTRY" }, { 0xB2, "PP_FRIENDLY_NAME" }, { 0xB3, "PP_FREE_TEXT" }, { 0xB4, "PP_GENDER" }, { 0xB5, "PP_INTENTION" }, { 0xB6, "PP_INTERESTS" }, { 0xB7, "PP_MARITAL_STATUS" }, { 0xB8, "USER_AGE_MAX" }, { 0xB9, "USER_AGE_MIN" }, { 0x00, NULL } }; /***** Token code page aggregation *****/ static char * ext_t_0_wv_cspc_13(tvbuff_t *tvb _U_, guint32 value, guint32 str_tbl _U_) { char *str = wmem_strdup_printf(wmem_packet_scope(), "Common Value: '%s'", val_to_str(value, vals_wv_csp_13_element_value_tokens, "<Unknown WV-CSP 1.3 Common Value token 0x%X>")); return str; } #define wbxml_wv_csp_13_global wbxml_wv_csp_12_global /*TODO*/ static const value_valuestring wbxml_wv_csp_13_tags[] = { { 0, wbxml_wv_csp_13_tags_cp0 }, { 1, wbxml_wv_csp_13_tags_cp1 }, { 2, wbxml_wv_csp_13_tags_cp2 }, { 3, wbxml_wv_csp_13_tags_cp3 }, { 4, wbxml_wv_csp_13_tags_cp4 }, { 5, wbxml_wv_csp_13_tags_cp5 }, { 6, wbxml_wv_csp_13_tags_cp6 }, { 7, wbxml_wv_csp_13_tags_cp7 }, { 8, wbxml_wv_csp_13_tags_cp8 }, { 9, wbxml_wv_csp_13_tags_cp9 }, { 10, wbxml_wv_csp_13_tags_cp10 }, { 11, wbxml_wv_csp_13_tags_cp11 }, { 0, NULL } }; static const value_valuestring wbxml_wv_csp_13_attrStart[] = { { 0, wbxml_wv_csp_13_attrStart_cp0 }, { 0, NULL } }; static const wbxml_decoding decode_wv_cspc_13 = { "Wireless-Village Client-Server Protocol 1.3", "WV-CSP 1.3", { ext_t_0_wv_cspc_13, NULL, NULL }, wv_csp13_opaque_binary_tag, wv_csp13_opaque_literal_tag, default_opaque_binary_attr, default_opaque_literal_attr, wbxml_wv_csp_13_global, wbxml_wv_csp_13_tags, wbxml_wv_csp_13_attrStart, NULL }; /****************************** Discriminators ******************************/ /* Discriminator for WV-CSP; allows version detection based on parsing parts * of the start of the WBXML body. */ static const wbxml_decoding * wv_csp_discriminator(tvbuff_t *tvb, guint32 offset) { guint32 magic_1 = tvb_get_ntohl(tvb, offset + 0); guint16 magic_2 = tvb_get_ntohs(tvb, offset + 4); if (magic_1 == 0xFE050331 && magic_2 == 0x2e30) { /* FE 05 03 31 2E 30 --> WV-CSP 1.0 */ return &decode_wv_cspc_10; } else if (magic_1 == 0xC9050331 && magic_2 == 0x2e31) { /* C9 05 03 31 2E 31 --> WV-CSP 1.1 */ return &decode_wv_cspc_11; } else if (magic_1 == 0xC9080331 && magic_2 == 0x2e32) { /* C9 08 03 31 2E 32 --> WV-CSP 1.2 */ return &decode_wv_cspc_12; } else if ( magic_1 == 0xC90B0331 && magic_2 == 0x2E33) { /* C9 0B 03 31 2E 33 --> WV-CSP 1.3 */ return &decode_wv_cspc_13; } /* Default: WV-CSP 1.2 */ return &decode_wv_cspc_12; } /********************** WBXML token mapping aggregation **********************/ static const wbxml_decoding *get_wbxml_decoding_from_public_id (guint32 publicid); static const wbxml_decoding *get_wbxml_decoding_from_content_type ( const char *content_type, tvbuff_t *tvb, guint32 offset); /** ** Aggregation of content type and aggregated code pages ** Content type map lookup will stop at the 1st entry with 3rd member = FALSE **/ /* * The following map contains entries registered with a registered WBXML * public ID. See WAP WINA or OMA OMNA for registered values: * http://www.openmobilealliance.org/tech/omna/ */ static const wbxml_integer_list well_known_public_id_list[] = { /* 0x00 - Unknown or missing Public ID */ /* 0x01 - LITERAL PublicID - see String Table */ { 0x02, &decode_wmlc_10 }, /* WML 1.0 */ /* 0x03 - WTA 1.0 */ { 0x04, &decode_wmlc_11 }, /* WML 1.1 */ { 0x05, &decode_sic_10 }, /* SI 1.0 */ { 0x06, &decode_slc_10 }, /* SL 1.0 */ { 0x07, &decode_coc_10 }, /* CO 1.0 */ { 0x08, &decode_channelc_10 }, /* CHANNEL 1.0 */ { 0x09, &decode_wmlc_12 }, /* WML 1.2 */ { 0x0A, &decode_wmlc_13 }, /* WML 1.3 */ { 0x0B, &decode_provc_10 }, /* PROV 1.0 */ /* 0x0C - WTA-WML 1.2 */ { 0x0D, &decode_emnc_10 }, /* EMN 1.0 */ /* 0x0E - DRMREL 1.0 */ { 0x0F, &decode_wv_cspc_10 }, /* WV-CSP 1.0 */ { 0x10, &decode_wv_cspc_11 }, /* WV-CSP 1.1 */ /*See http://www.openmobilealliance.org/tech/omna/omna-wbxml-public-docid.htm */ { 0x11, &decode_wv_cspc_12 }, /* OMA IMPS - CSP protocol DTD v1.2 */ { 0x12, &decode_wv_cspc_13 }, /* OMA IMPS - CSP protocol DTD v1.3 */ { 0x020B, &decode_nokiaprovc_70 },/* Nokia OTA Provisioning 7.0 */ { 0x0FD1, &decode_syncmlc_10 }, /* SyncML 1.0 */ { 0x0FD3, &decode_syncmlc_11 }, /* SyncML 1.1 */ /* Note: I assumed WML+ 1.x would be not that different from WML 1.x, * the real mapping should come from Phone.com (OpenWave)! */ { 0x1108, &decode_wmlc_11 }, /* Phone.com WMLC+ 1.1 - not 100% correct */ { 0x110D, &decode_wmlc_13 }, /* Phone.com WMLC+ 1.3 - not 100% correct */ { 0x1201, &decode_syncmlc_12 }, /* SyncML 1.2 */ { 0x00, NULL } }; /* The following map contains entries only registered with a literal media * type. */ static const wbxml_literal_list content_type_list[] = { { "application/x-wap-prov.browser-settings", NULL, &decode_nokiaprovc_70 }, { "application/x-wap-prov.browser-bookmarks", NULL, &decode_nokiaprovc_70 }, { "application/vnd.wv.csp.wbxml", wv_csp_discriminator, &decode_wv_cspc_11 }, { "application/vnd.ms-sync.wbxml", NULL, &decode_mssync_10 }, { "application/vnd.ms-sync", NULL, &decode_mssync_10 }, { NULL, NULL, NULL } }; /* Returns a pointer to the WBXML token map for the given WBXML public * identifier value (see WINA for a table with defined identifiers). */ static const wbxml_decoding *get_wbxml_decoding_from_public_id (guint32 public_id) { const wbxml_decoding *map = NULL; DebugLog(("get_wbxml_decoding_from_public_id: public_id = %u\n", public_id)); if (public_id >= 2) { const wbxml_integer_list *item = well_known_public_id_list; while (item && item->public_id && item->map) { if (item->public_id == public_id) { map = item->map; break; } item++; } } return map; } static const wbxml_decoding *get_wbxml_decoding_from_content_type ( const char *content_type, tvbuff_t *tvb, guint32 offset) { const wbxml_decoding *map = NULL; DebugLog(("get_wbxml_decoding_from_content_type: content_type = [%s]\n", content_type)); if (content_type && content_type[0]) { const wbxml_literal_list *item = content_type_list; while (item && item->content_type) { if (g_ascii_strcasecmp(content_type, item->content_type) == 0) { /* Try the discriminator */ if (item->discriminator != NULL) { map = item->discriminator(tvb, offset); } if (map == NULL) { map = item->map; } break; } item++; } } return map; } /* WBXML content token mapping depends on the following parameters: * - Content type (guint32) * - Token type (global, tags, attrStart, attrValue) * - Code page for tag and attribute * * This results in the following steps: * 1. Retrieve content type mapping * 2. If exists, retrieve token type mapping * 3. If exists, retrieve required code page * 4. If exists, retrieve token mapping */ #define wbxml_UNDEFINED_TOKEN \ "(Requested token not defined for this content type)" #define wbxml_UNDEFINED_TOKEN_CODE_PAGE \ "(Requested token code page not defined for this content type)" #define wbxml_UNDEFINED_TOKEN_MAP \ "(Requested token map not defined for this content type)" /* Return token mapping for a given content mapping entry. */ static const char * map_token (const value_valuestring *token_map, guint8 codepage, guint8 token) { const value_string *vs; const char *s; if (token_map) { /* Found map */ if ((vs = val_to_valstr (codepage, token_map))) { /* Found codepage map */ s = try_val_to_str (token, vs); if (s) { /* Found valid token */ DebugLog(("map_token(codepage = %u, token = %u: [%s]\n", codepage, token, s)); return s; } /* No valid token mapping in specified code page of token map */ DebugLog(("map_token(codepage = %u, token = %u: " wbxml_UNDEFINED_TOKEN "\n", codepage, token)); return wbxml_UNDEFINED_TOKEN; } /* There is no token map entry for the requested code page */ DebugLog(("map_token(codepage = %u, token = %u: " wbxml_UNDEFINED_TOKEN_CODE_PAGE "\n", codepage, token)); return wbxml_UNDEFINED_TOKEN_CODE_PAGE; } /* The token map does not exist */ DebugLog(("map_token(codepage = %u, token = %u: " wbxml_UNDEFINED_TOKEN_MAP "\n", codepage, token)); return wbxml_UNDEFINED_TOKEN_MAP; } /* Parse and display the WBXML string table. */ static void show_wbxml_string_table (proto_tree *tree, tvbuff_t *tvb, guint32 str_tbl, guint32 str_tbl_len, guint charset) { guint encoding = mibenum_charset_to_encoding(charset); guint32 off = str_tbl; guint32 end = str_tbl + str_tbl_len; proto_tree *item_tree; proto_item *ti; const guint8 *str; gint len; while (off < end) { /* * XXX - use the string encoding. */ item_tree = proto_tree_add_subtree_format (tree, tvb, off, 0, ett_wbxml_string_table_item, &ti, "%u:", off - str_tbl); proto_tree_add_uint (item_tree, hf_wbxml_string_table_item_offset, tvb, 0, 0, off - str_tbl); proto_tree_add_item_ret_string_and_length (item_tree, hf_wbxml_string_table_item_string, tvb, off, -1, encoding, wmem_packet_scope(), &str, &len); proto_item_append_text(ti, " '%s'", format_text(wmem_packet_scope(), str, strlen(str))); proto_item_set_len(ti, len); off += len; } } /* Indentation code is based on a static const array of space characters. * At least one single space is returned */ static const char indent_buffer[514] = " " " " " " " " " " " " " " " " " " ; /* Generate XML indentation (length = 1 + 2 * 256 + 1 for '\0') */ static const char * Indent (guint8 level) { return indent_buffer + (512 - 2 * (level)); } /******************** * WBXML tag tokens * ******************** * * Bit Mask : Example * ------------------- * 00.. .... : <tag /> * * 01.. .... : <tag> * CONTENT * </tag> * * 10.. .... : <tag * atrtribute1="value1" * atrtribute2="value2" * /> * * 11.. .... : <tag * atrtribute1="value1" * atrtribute2="value2" * > * CONTENT * </tag> * * NOTES * - An XML PI is parsed as an attribute list (same syntax). * - A code page switch only applies to the single token that follows. */ /************************** * WBXML Attribute tokens * ************************** * Bit Mask : Example * ------------------- * 0... .... : attr= (attribute name) * href='http://' (attribute name with start of attribute value) * 1... .... : 'www.' (attribute value, or part of it) * */ /* This function parses the WBXML and maps known token interpretations * to the WBXML tokens. As a result, the original XML document can be * recreated. Indentation is generated in order to ease reading. * * This function performs attribute list parsing. * * The wbxml_decoding entry *map contains the actual token mapping. * * NOTE: See above for known token mappings. */ static guint32 parse_wbxml_attribute_list_defined (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint32 offset, guint32 str_tbl, guint8 *codepage_attr, const wbxml_decoding *map) { guint32 tvb_len = tvb_reported_length (tvb); guint32 off = offset; guint32 len; guint str_len; guint32 ent; guint32 idx; guint8 peek; guint8 attr_save_known = 0; /* Will contain peek & 0x3F (attr identity) */ const char *attr_save_literal = NULL; /* Will contain the LITERAL attr identity */ const gchar *str; unsigned recursion_level = p_get_proto_depth(pinfo, proto_wbxml); unsigned encoding = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_wbxml, 0)); DebugLog(("parse_wbxml_attr_defined (level = %u, offset = %u)\n", recursion_level, offset)); /* Parse attributes */ while (off < tvb_len) { peek = tvb_get_guint8 (tvb, off); DebugLog(("ATTR: (top of while) level = %3u, peek = 0x%02X, " "off = %u, tvb_len = %u\n", recursion_level, peek, off, tvb_len)); if ((peek & 0x3F) < 5) switch (peek) { /* Global tokens in state = ATTR */ case 0x00: /* SWITCH_PAGE */ *codepage_attr = tvb_get_guint8 (tvb, off+1); proto_tree_add_uint_format(tree, hf_wbxml_switch_page, tvb, off, 2, *codepage_attr, " | Attr | A -->%3d | SWITCH_PAGE (Attr code page) |", *codepage_attr); off += 2; break; case 0x01: /* END */ /* BEWARE * The Attribute END token means either ">" or "/>" * and as a consequence both must be treated separately. * This is done in the TAG state parser. */ off++; DebugLog(("ATTR: level = %u, Return: len = %u\n", recursion_level, off - offset)); return (off - offset); case 0x02: /* ENTITY */ ent = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); if (len <= tvb_len) { proto_tree_add_uint_format(tree, hf_wbxml_entity, tvb, off, 1+len, ent, " %3d | Attr | A %3d | ENTITY | %s'&#%u;'", recursion_level, *codepage_attr, Indent (recursion_level), ent); off += 1+len; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } break; case 0x03: /* STR_I */ str = tvb_get_stringz_enc(pinfo->pool, tvb, off+1, &len, encoding); proto_tree_add_string_format(tree, hf_wbxml_str_i, tvb, off, 1+len, str, " %3d | Attr | A %3d | STR_I (Inline string) | %s\'%s\'", recursion_level, *codepage_attr, Indent (recursion_level), str); off += 1+len; break; case 0x04: /* LITERAL */ /* ALWAYS means the start of a new attribute, * and may only contain the NAME of the attribute. */ idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); if (len <= tvb_len) { attr_save_known = 0; attr_save_literal = tvb_get_stringz_enc(pinfo->pool, tvb, str_tbl+idx, &str_len, encoding); proto_tree_add_string_format(tree, hf_wbxml_literal, tvb, off, 1+len, attr_save_literal, " %3d | Attr | A %3d | LITERAL (Literal Attribute) | %s<%s />", recursion_level, *codepage_attr, Indent (recursion_level), attr_save_literal); off += 1+len; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } break; case 0x40: /* EXT_I_0 */ case 0x41: /* EXT_I_1 */ case 0x42: /* EXT_I_2 */ /* Extension tokens */ str = tvb_get_stringz_enc(pinfo->pool, tvb, off+1, &len, encoding); proto_tree_add_string_format(tree, hf_wbxml_ext_i, tvb, off, 1+len, str, " %3d | Attr | A %3d | EXT_I_%1x (Extension Token) | %s(%s: \'%s\')", recursion_level, *codepage_attr, peek & 0x0f, Indent (recursion_level), ((map != NULL) ? map_token (map->global, 0, peek) : "Inline string extension"), str); off += 1+len; break; /* 0x43 impossible in ATTR state */ /* 0x44 impossible in ATTR state */ case 0x80: /* EXT_T_0 */ case 0x81: /* EXT_T_1 */ case 0x82: /* EXT_T_2 */ /* Extension tokens */ idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); { char *s; if (map != NULL) { if (map->ext_t[peek & 0x03]) s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl); else s = wmem_strdup_printf(pinfo->pool, "EXT_T_%1x (%s)", peek & 0x03, map_token (map->global, 0, peek)); } else { s = wmem_strdup_printf(pinfo->pool, "Extension Token, integer value: (%u", idx); } proto_tree_add_string_format(tree, hf_wbxml_ext_t, tvb, off, 1+len, s, " %3d | Tag | T %3d | EXT_T_%1x (Extension Token) | %s%s)", recursion_level, *codepage_attr, peek & 0x0f, Indent (recursion_level), s); } if (len <= tvb_len) { off += 1+len; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } break; case 0x83: /* STR_T */ idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); if (len <= tvb_len) { str = tvb_get_stringz_enc(pinfo->pool, tvb, str_tbl+idx, &str_len, encoding); proto_tree_add_string_format(tree, hf_wbxml_str_t, tvb, off, 1+len, str, " %3d | Attr | A %3d | STR_T (Tableref string) | %s\'%s\'", recursion_level, *codepage_attr, Indent (recursion_level), str); off += 1+len; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } break; /* 0x84 impossible in ATTR state */ case 0xC0: /* EXT_0 */ case 0xC1: /* EXT_1 */ case 0xC2: /* EXT_2 */ /* Extension tokens */ str = (map != NULL) ? map_token (map->global, 0, peek) : "Single-byte extension"; proto_tree_add_string_format(tree, hf_wbxml_extension_token, tvb, off, 1, str, " %3d | Attr | A %3d | EXT_%1x (Extension Token) | %s(%s)", recursion_level, *codepage_attr, peek & 0x0f, Indent (recursion_level), str); off++; break; case 0xC3: /* OPAQUE - WBXML 1.1 and newer */ if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */ if (map != NULL) { char *tmp_str; if (attr_save_known) { /* Knwon attribute */ if (map->opaque_binary_attr) { tmp_str = map->opaque_binary_attr(tvb, off + 1, attr_save_known, *codepage_attr, &len, pinfo); } else { tmp_str = default_opaque_binary_attr(tvb, off + 1, attr_save_known, *codepage_attr, &len, pinfo); } } else { /* lITERAL attribute */ if (map->opaque_literal_tag) { tmp_str = map->opaque_literal_attr(tvb, off + 1, attr_save_literal, *codepage_attr, &len, pinfo); } else { tmp_str = default_opaque_literal_attr(tvb, off + 1, attr_save_literal, *codepage_attr, &len, pinfo); } } if (len <= tvb_len) { proto_tree_add_bytes_format(tree, hf_wbxml_opaque_data, tvb, off, 1 + len, NULL, " %3d | Attr | A %3d | OPAQUE (Opaque data) | %s%s", recursion_level, *codepage_attr, Indent (recursion_level), tmp_str); off += 1 + len; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } } else { idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); if ((len <= tvb_len) && (idx < tvb_len)) { proto_tree_add_bytes_format(tree, hf_wbxml_opaque_data, tvb, off, 1 + len + idx, NULL, " %3d | Attr | A %3d | OPAQUE (Opaque data) | %s(%u bytes of opaque data)", recursion_level, *codepage_attr, Indent (recursion_level), idx); off += 1+len+idx; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } } } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */ proto_tree_add_none_format(tree, hf_wbxml_reserved_2, tvb, off, 1, " %3d | Attr | A %3d | RESERVED_2 (Invalid Token!) | WBXML 1.0 parsing stops here.", recursion_level, *codepage_attr); /* Stop processing as it is impossible to parse now */ off = tvb_len; DebugLog(("ATTR: level = %u, Return: len = %u\n", recursion_level, off - offset)); return (off - offset); } break; /* 0xC4 impossible in ATTR state */ default: proto_tree_add_none_format(tree, hf_wbxml_invalid_token, tvb, off, 1, " %3d | Attr | A %3d | %-10s (Invalid Token!) | WBXML parsing stops here.", recursion_level, *codepage_attr, val_to_str_ext (peek, &vals_wbxml1x_global_tokens_ext, "(unknown 0x%x)")); /* Move to end of buffer */ off = tvb_len; break; } else { /* Known atribute token */ const char* s; if (peek & 0x80) { /* attrValue */ if (map != NULL) { s = map_token (map->attrValue, *codepage_attr, peek); } else { s = wmem_strdup_printf(wmem_packet_scope(), "attrValue_0x%02X", peek); } proto_tree_add_string_format(tree, hf_wbxml_known_attrvalue, tvb, off, 1, s, " %3d | Attr | A %3d | Known attrValue 0x%02X | %s%s", recursion_level, *codepage_attr, peek & 0x7f, Indent (recursion_level), s); off++; } else { /* attrStart */ attr_save_known = peek & 0x7f; if (map != NULL) { s = map_token (map->attrStart, *codepage_attr, peek); } else { s = wmem_strdup_printf(wmem_packet_scope(), "attrStart_0x%02X", peek); } proto_tree_add_string_format(tree, hf_wbxml_known_attrstart, tvb, off, 1, s, " %3d | Attr | A %3d | Known attrStart 0x%02X | %s%s", recursion_level, *codepage_attr, attr_save_known, Indent (recursion_level), s); off++; } } } /* End WHILE */ DebugLog(("ATTR: level = %u, Return: len = %u (end of function body)\n", recursion_level, off - offset)); return (off - offset); } /* This function parses the WBXML and maps known token interpretations * to the WBXML tokens. As a result, the original XML document can be * recreated. Indentation is generated in order to ease reading. * * Attribute parsing is done in parse_wbxml_attribute_list_defined(). * * The wbxml_decoding entry *map contains the actual token mapping. * * NOTE: In order to parse the content, some recursion is required. * However, for performance reasons, recursion has been avoided * where possible (tags without content within tags with content). * This is achieved by means of the parsing_tag_content and tag_save* * variables. * * NOTE: See above for known token mappings. * * NOTE: As tags can be opened and closed, a tag representation lookup * may happen once or twice for a given tag. For efficiency reasons, * the literal tag value is stored and used throughout the code. * With the introduction of code page support, this solution is robust * as the lookup only occurs once, removing the need for storage of * the used code page. */ #define WBXML_MAX_RECURSION_LEVEL 255 static guint32 parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint32 offset, guint32 str_tbl, guint8 *codepage_stag, guint8 *codepage_attr, const wbxml_decoding *map) { guint32 tvb_len = tvb_reported_length (tvb); guint32 off = offset; guint32 len; guint str_len; guint32 ent; guint32 idx; guint8 peek; guint32 tag_len; /* Length of the index (uintvar) from a LITERAL tag */ guint8 tag_save_known = 0; /* Will contain peek & 0x3F (tag identity) */ guint8 tag_new_known = 0; /* Will contain peek & 0x3F (tag identity) */ const char *tag_save_literal = NULL; /* Will contain the LITERAL tag identity */ const char *tag_new_literal; /* Will contain the LITERAL tag identity */ const gchar *str; guint8 parsing_tag_content = FALSE; /* Are we parsing content from a tag with content: <x>Content</x> The initial state is FALSE. This state will trigger recursion. */ unsigned recursion_level = p_get_proto_depth(pinfo, proto_wbxml); unsigned encoding = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_wbxml, 0)); if (++recursion_level >= WBXML_MAX_RECURSION_LEVEL) { proto_tree_add_expert(tree, pinfo, &ei_wbxml_too_much_recursion, tvb, offset, tvb_captured_length_remaining(tvb, offset)); return tvb_len; } DebugLog(("parse_wbxml_tag_defined (level = %u, offset = %u)\n", recursion_level, offset)); while (off < tvb_len) { peek = tvb_get_guint8 (tvb, off); DebugLog(("STAG: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n", recursion_level, peek, off, tvb_len)); if ((peek & 0x3F) < 4) switch (peek) { /* Global tokens in state = STAG but not the LITERAL tokens */ case 0x00: /* SWITCH_PAGE */ *codepage_stag = tvb_get_guint8 (tvb, off+1); proto_tree_add_uint_format(tree, hf_wbxml_switch_page, tvb, off, 2, *codepage_stag, " | Tag | T -->%3d | SWITCH_PAGE (Tag code page) |", *codepage_stag); off += 2; break; case 0x01: /* END: only possible for Tag with Content */ if (tag_save_known) { /* Known TAG */ proto_tree_add_string_format(tree, hf_wbxml_end_known_tag, tvb, off, 1, tag_save_literal, " %3d | Tag | T %3d | END (Known Tag 0x%02X) | %s</%s>", recursion_level, *codepage_stag, tag_save_known, Indent (recursion_level), tag_save_literal); /* We already looked it up! */ } else { /* Literal TAG */ proto_tree_add_string_format(tree, hf_wbxml_end_literal_tag, tvb, off, 1, tag_save_literal ? tag_save_literal : "", " %3d | Tag | T %3d | END (Literal Tag) | %s</%s>", recursion_level, *codepage_stag, Indent (recursion_level), tag_save_literal ? tag_save_literal : ""); } recursion_level--; p_set_proto_depth(pinfo, proto_wbxml, recursion_level); off++; /* Reset code page: not needed as return from recursion */ DebugLog(("STAG: level = %u, Return: len = %u\n", recursion_level, off - offset)); return (off - offset); case 0x02: /* ENTITY */ ent = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); proto_tree_add_uint_format(tree, hf_wbxml_entity, tvb, off, 1+len, ent, " %3d | Tag | T %3d | ENTITY | %s'&#%u;'", recursion_level, *codepage_stag, Indent (recursion_level), ent); off += 1+len; break; case 0x03: /* STR_I */ str = tvb_get_stringz_enc(pinfo->pool, tvb, off+1, &len, encoding); proto_tree_add_string_format(tree, hf_wbxml_str_i, tvb, off, 1+len, str, " %3d | Tag | T %3d | STR_I (Inline string) | %s\'%s\'", recursion_level, *codepage_stag, Indent(recursion_level), str); off += 1+len; break; case 0x40: /* EXT_I_0 */ case 0x41: /* EXT_I_1 */ case 0x42: /* EXT_I_2 */ /* Extension tokens */ str = tvb_get_stringz_enc(pinfo->pool, tvb, off+1, &len, encoding); proto_tree_add_string_format(tree, hf_wbxml_ext_i, tvb, off, 1+len, str, " %3d | Tag | T %3d | EXT_I_%1x (Extension Token) | %s(%s: \'%s\')", recursion_level, *codepage_stag, peek & 0x0f, Indent (recursion_level), ((map != NULL) ? map_token (map->global, 0, peek) : "Inline string extension"), str); off += 1+len; break; case 0x43: /* PI */ proto_tree_add_none_format(tree, hf_wbxml_pi_xml, tvb, off, 1, " %3d | Tag | T %3d | PI (XML Processing Instruction) | %s<?xml", recursion_level, *codepage_stag, Indent (recursion_level)); len = parse_wbxml_attribute_list_defined (tree, tvb, pinfo, off, str_tbl, codepage_attr, map); /* Check that there is still room in packet */ off += len; if (off >= tvb_len) { DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", recursion_level, off - offset)); } proto_tree_add_none_format(tree, hf_wbxml_end_pi, tvb, off-1, 1, " %3d | Tag | T %3d | END (PI) | %s?>", recursion_level, *codepage_stag, Indent (recursion_level)); break; case 0x80: /* EXT_T_0 */ case 0x81: /* EXT_T_1 */ case 0x82: /* EXT_T_2 */ /* Extension tokens */ idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); { char *s; if (map) { if (map->ext_t[peek & 0x03]) s = (map->ext_t[peek & 0x03])(tvb, idx, str_tbl); else s = wmem_strdup_printf(pinfo->pool, "EXT_T_%1x (%s)", peek & 0x03, map_token (map->global, 0, peek)); } else { s = wmem_strdup_printf(pinfo->pool, "(Extension Token, integer value: %u)", idx); } proto_tree_add_string_format(tree, hf_wbxml_ext_t, tvb, off, 1+len, s, " %3d | Tag | T %3d | EXT_T_%1x (Extension Token) | %s%s", recursion_level, *codepage_stag, peek & 0x0f, Indent (recursion_level), s); } off += 1+len; break; case 0x83: /* STR_T */ idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); str = tvb_get_stringz_enc(pinfo->pool, tvb, str_tbl+idx, &str_len, encoding); proto_tree_add_string_format(tree, hf_wbxml_str_t, tvb, off, 1+len, str, " %3d | Tag | T %3d | STR_T (Tableref string) | %s\'%s\'", recursion_level, *codepage_stag, Indent (recursion_level), str); off += 1+len; break; case 0xC0: /* EXT_0 */ case 0xC1: /* EXT_1 */ case 0xC2: /* EXT_2 */ /* Extension tokens */ str = (map != NULL) ? map_token (map->global, 0, peek) : "Single-byte extension"; proto_tree_add_string_format(tree, hf_wbxml_extension_token, tvb, off, 1, str, " %3d | Tag | T %3d | EXT_%1x (Extension Token) | %s(%s)", recursion_level, *codepage_stag, peek & 0x0f, Indent (recursion_level), str); off++; break; case 0xC3: /* OPAQUE - WBXML 1.1 and newer */ if (tvb_get_guint8 (tvb, 0)) { /* WBXML 1.x (x > 0) */ if (map != NULL) { char *tmp_str; if (tag_save_known) { /* Knwon tag */ if (map->opaque_binary_tag) { tmp_str = map->opaque_binary_tag(tvb, off + 1, tag_save_known, *codepage_stag, &len, pinfo); } else { tmp_str = default_opaque_binary_tag(tvb, off + 1, tag_save_known, *codepage_stag, &len, pinfo); } } else { /* lITERAL tag */ if (map->opaque_literal_tag) { tmp_str = map->opaque_literal_tag(tvb, off + 1, tag_save_literal, *codepage_stag, &len, pinfo); } else { tmp_str = default_opaque_literal_tag(tvb, off + 1, tag_save_literal, *codepage_stag, &len, pinfo); } } proto_tree_add_bytes_format(tree, hf_wbxml_opaque_data, tvb, off, 1 + len, NULL, " %3d | Tag | T %3d | OPAQUE (Opaque data) | %s%s", recursion_level, *codepage_stag, Indent (recursion_level), tmp_str); off += 1 + len; } else { idx = tvb_get_guintvar (tvb, off+1, &len, pinfo, &ei_wbxml_oversized_uintvar); if ((len <= tvb_len) && (idx < tvb_len)) { proto_tree_add_bytes_format(tree, hf_wbxml_opaque_data, tvb, off, 1 + len + idx, NULL, " %3d | Tag | T %3d | OPAQUE (Opaque data) | %s(%u bytes of opaque data)", recursion_level, *codepage_stag, Indent (recursion_level), idx); off += 1+len+idx; } else { /* Stop processing as it is impossible to parse now */ off = tvb_len; } } } else { /* WBXML 1.0 - RESERVED_2 token (invalid) */ proto_tree_add_none_format(tree, hf_wbxml_reserved_2, tvb, off, 1, " %3d | Tag | T %3d | RESERVED_2 (Invalid Token!) | WBXML 1.0 parsing stops here.", recursion_level, *codepage_stag); /* Stop processing as it is impossible to parse now */ off = tvb_len; DebugLog(("STAG: level = %u, Return: len = %u\n", recursion_level, off - offset)); return (off - offset); } break; /* No default clause, as all cases have been treated */ } else { /* LITERAL or Known TAG */ /* We must store the initial tag, and also retrieve the new tag. * For efficiency reasons, we store the literal tag representation * for known tags too, so we can easily close the tag without the * need of a new lookup and avoiding storage of token codepage. * * There are 4 possibilities: * * 1. Known tag followed by a known tag * 2. Known tag followed by a LITERAL tag * 3. LITERAL tag followed by Known tag * 4. LITERAL tag followed by LITERAL tag */ /* Store the new tag */ tag_len = 0; if ((peek & 0x3F) == 4) { /* LITERAL */ DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off)); idx = tvb_get_guintvar (tvb, off+1, &tag_len, pinfo, &ei_wbxml_oversized_uintvar); tag_new_literal = tvb_get_stringz_enc(pinfo->pool, tvb, str_tbl+idx, &str_len, encoding); tag_new_known = 0; /* invalidate known tag_new */ } else { /* Known tag */ tag_new_known = peek & 0x3F; if (map != NULL) { tag_new_literal = map_token (map->tags, *codepage_stag, tag_new_known); } else { tag_new_literal = wmem_strdup_printf(wmem_packet_scope(), "Tag_0x%02X", tag_new_known); } /* Stored looked up tag name string */ } /* Parsing of TAG starts HERE */ if (peek & 0x40) { /* Content present */ /* Content follows * [!] An explicit END token is expected in these cases! * ==> Recursion possible if we encounter a tag with content; * recursion will return at the explicit END token. */ if (parsing_tag_content) { /* Recurse */ DebugLog(("STAG: Tag in Tag - RECURSE! (off = %u)\n", off)); /* Do not process the attribute list: * recursion will take care of it */ recursion_level++; p_set_proto_depth(pinfo, proto_wbxml, recursion_level); len = parse_wbxml_tag_defined (tree, tvb, pinfo, off, str_tbl, codepage_stag, codepage_attr, map); off += len; } else { /* Now we will have content to parse */ /* Save the start tag so we can properly close it later. */ if ((peek & 0x3F) == 4) { /* Literal tag */ tag_save_literal = tag_new_literal; tag_save_known = 0; } else { /* Known tag */ tag_save_known = tag_new_known; tag_save_literal = tag_new_literal; /* The last statement avoids needless lookups */ } /* Process the attribute list if present */ if (peek & 0x80) { /* Content and Attribute list present */ if (tag_new_known) { /* Known tag */ proto_tree_add_string_format(tree, hf_wbxml_known_tag, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | Known Tag 0x%02X (AC) | %s<%s", recursion_level, *codepage_stag, tag_new_known, Indent (recursion_level), tag_new_literal); /* Tag string already looked up earlier! */ off++; } else { /* LITERAL tag */ proto_tree_add_string_format(tree, hf_wbxml_literal_ac, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | LITERAL_AC (Literal tag) (AC) | %s<%s", recursion_level, *codepage_stag, Indent (recursion_level), tag_new_literal); off += 1 + tag_len; } len = parse_wbxml_attribute_list_defined (tree, tvb, pinfo, off, str_tbl, codepage_attr, map); /* Check that there is still room in packet */ off += len; if (off >= tvb_len) { DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", recursion_level, off - offset)); } proto_tree_add_none_format(tree, hf_wbxml_end_attribute_list, tvb, off-1, 1, " %3d | Tag | T %3d | END (attribute list) | %s>", recursion_level, *codepage_stag, Indent (recursion_level)); } else { /* Content, no Attribute list */ if (tag_new_known) { /* Known tag */ proto_tree_add_string_format(tree, hf_wbxml_known_tag, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | Known Tag 0x%02X (.C) | %s<%s>", recursion_level, *codepage_stag, tag_new_known, Indent (recursion_level), tag_new_literal); /* Tag string already looked up earlier! */ off++; } else { /* LITERAL tag */ proto_tree_add_string_format(tree, hf_wbxml_literal_c, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | LITERAL_C (Literal Tag) (.C) | %s<%s>", recursion_level, *codepage_stag, Indent (recursion_level), tag_new_literal); off += 1 + tag_len; } } /* The data that follows in the parsing process * represents content for the opening tag * we've just processed in the lines above. * Next time we encounter a tag with content: recurse */ parsing_tag_content = TRUE; DebugLog(("Tag in Tag - No recursion this time! (off = %u)\n", off)); } } else { /* No Content */ DebugLog(("<Tag/> in Tag - No recursion! (off = %u)\n", off)); recursion_level++; p_set_proto_depth(pinfo, proto_wbxml, recursion_level); if (peek & 0x80) { /* No Content, Attribute list present */ if (tag_new_known) { /* Known tag */ proto_tree_add_string_format(tree, hf_wbxml_known_tag, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | Known Tag 0x%02X (A.) | %s<%s", recursion_level, *codepage_stag, tag_new_known, Indent (recursion_level), tag_new_literal); /* Tag string already looked up earlier! */ off++; len = parse_wbxml_attribute_list_defined (tree, tvb, pinfo, off, str_tbl, codepage_attr, map); /* Check that there is still room in packet */ off += len; if (off > tvb_len) { DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", recursion_level, off - offset)); } proto_tree_add_uint_format(tree, hf_wbxml_end_known_tag_uint, tvb, off-1, 1, *codepage_stag, " %3d | Tag | T %3d | END (Known Tag) | %s/>", recursion_level, *codepage_stag, Indent (recursion_level)); } else { /* LITERAL tag */ proto_tree_add_string_format(tree, hf_wbxml_literal_a, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | LITERAL_A (Literal Tag) (A.) | %s<%s", recursion_level, *codepage_stag, Indent (recursion_level), tag_new_literal); off += 1 + tag_len; len = parse_wbxml_attribute_list_defined (tree, tvb, pinfo, off, str_tbl, codepage_attr, map); /* Check that there is still room in packet */ off += len; if (off >= tvb_len) { DebugLog(("STAG: level = %u, ThrowException: len = %u (short frame)\n", recursion_level, off - offset)); } proto_tree_add_string_format(tree, hf_wbxml_end_literal_tag, tvb, off-1, 1, "", " %3d | Tag | T %3d | END (Literal Tag) | %s/>", recursion_level, *codepage_stag, Indent (recursion_level)); } } else { /* No Content, No Attribute list */ if (tag_new_known) { /* Known tag */ proto_tree_add_string_format(tree, hf_wbxml_known_tag, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | Known Tag 0x%02x (..) | %s<%s />", recursion_level, *codepage_stag, tag_new_known, Indent (recursion_level), tag_new_literal); /* Tag string already looked up earlier! */ off++; } else { /* LITERAL tag */ proto_tree_add_string_format(tree, hf_wbxml_literal, tvb, off, 1, tag_new_literal, " %3d | Tag | T %3d | LITERAL (Literal Tag) (..) | %s<%s />", recursion_level, *codepage_stag, Indent (recursion_level), tag_new_literal); off += 1 + tag_len; } } recursion_level--; p_set_proto_depth(pinfo, proto_wbxml, recursion_level); /* TODO: Do I have to reset code page here? */ } } /* if (tag & 0x3F) >= 5 */ } /* while */ DebugLog(("STAG: level = %u, Return: len = %u (end of function body)\n", recursion_level, off - offset)); return (off - offset); } /****************** WBXML protocol dissection functions ******************/ /* Code to actually dissect the packets */ static void dissect_wbxml_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const wbxml_decoding *override_content_map) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *wbxml_tree; /* Main WBXML tree */ proto_tree *wbxml_str_tbl_tree; /* String table subtree */ proto_tree *wbxml_content_tree; /* Content subtree */ proto_tree *tag_tree; guint8 version; guint offset = 0; guint32 len; guint32 charset = 0; guint32 charset_len = 0; guint encoding; guint32 publicid; guint32 publicid_index = 0; guint32 publicid_len; guint32 str_tbl; guint32 str_tbl_len; guint32 str_tbl_len_len = 0; const wbxml_decoding *content_map = NULL; gchar *summary = NULL; guint8 codepage_stag = 0; guint8 codepage_attr = 0; DebugLog(("dissect_wbxml: Dissecting packet %u\n", pinfo->num)); /* WBXML format * * Version 1.0: version publicid strtbl BODY * Version 1.x: version publicid charset strtbl BODY * * Last valid format: WBXML 1.3 */ switch ( version = tvb_get_guint8 (tvb, 0) ) { case 0x00: /* WBXML/1.0 */ break; case 0x01: /* WBXML/1.1 */ case 0x02: /* WBXML/1.2 */ case 0x03: /* WBXML/1.3 */ break; default: /* Put some information here, so that the user knows what's going on. */ /* Add summary to INFO column if it is enabled */ col_append_fstr(pinfo->cinfo, COL_INFO, " (Unknown WBXML version 0x%02x)", version); ti = proto_tree_add_item (tree, proto_wbxml, tvb, 0, -1, ENC_NA); proto_item_append_text(ti, ", Unknown version 0x%02x", version); return; } /* In order to properly construct the packet summary, * I need to read the entire WBXML header * up to the string table length. */ /* Public ID */ publicid = tvb_get_guintvar(tvb, 1, &publicid_len, pinfo, &ei_wbxml_oversized_uintvar); if (! publicid) { /* Public identifier in string table */ publicid_index = tvb_get_guintvar (tvb, 1+publicid_len, &len, pinfo, &ei_wbxml_oversized_uintvar); publicid_len += len; } offset = 1 + publicid_len; /* Version-specific handling of Charset */ switch ( version ) { case 0x00: /* WBXML/1.0 */ /* No charset */ break; case 0x01: /* WBXML/1.1 */ case 0x02: /* WBXML/1.2 */ case 0x03: /* WBXML/1.3 */ /* Get charset */ charset = tvb_get_guintvar (tvb, offset, &charset_len, pinfo, &ei_wbxml_oversized_uintvar); offset += charset_len; break; default: /* Impossible since we returned already earlier */ DISSECTOR_ASSERT_NOT_REACHED(); break; } if (charset) { encoding = mibenum_charset_to_encoding(charset); } else { /* XXX: If the charset is 0 we should look if there is a charset * parameter in the Content-Type / media_type if passed to * the dissector. Otherwise the default is UTF-8. */ encoding = ENC_UTF_8; } p_add_proto_data(pinfo->pool, pinfo, proto_wbxml, 0, GUINT_TO_POINTER(encoding)); /* String table: read string table length in bytes */ tvb_get_guintvar (tvb, offset, &str_tbl_len_len, pinfo, &ei_wbxml_oversized_uintvar); str_tbl = offset + str_tbl_len_len; /* Start of 1st string in string table */ /* Compose the summary line */ if ( publicid ) { summary = wmem_strdup_printf(pinfo->pool, "%s, Public ID: \"%s\"", val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"), val_to_str_ext (publicid, &vals_wbxml_public_ids_ext, "(unknown 0x%x)")); } else { /* Read length of Public ID from string table */ summary = wmem_strdup_printf(pinfo->pool, "%s, Public ID: \"%s\"", val_to_str_ext (version, &vals_wbxml_versions_ext, "(unknown 0x%x)"), tvb_get_stringz_enc(pinfo->pool, tvb, str_tbl + publicid_index, &len, encoding)); } /* Add summary to INFO column if it is enabled */ col_append_fstr(pinfo->cinfo, COL_INFO, " (WBXML %s)", summary); /* create display subtree for the protocol */ ti = proto_tree_add_item (tree, proto_wbxml, tvb, 0, -1, ENC_NA); proto_item_append_text(ti, ", Version: %s", summary); /* * Now show the protocol subtree, if tree is set. */ wbxml_tree = proto_item_add_subtree(ti, ett_wbxml); /* WBXML Version */ proto_tree_add_uint (wbxml_tree, hf_wbxml_version, tvb, 0, 1, version); /* Public ID */ if (publicid) { /* Known Public ID */ proto_tree_add_uint(wbxml_tree, hf_wbxml_public_id_known, tvb, 1, publicid_len, publicid); } else { /* Public identifier in string table */ proto_tree_add_item (wbxml_tree, hf_wbxml_public_id_literal, tvb, 1, publicid_len, ENC_ASCII); } offset = 1 + publicid_len; if ( charset ) { /* Charset */ proto_tree_add_uint (wbxml_tree, hf_wbxml_charset, tvb, 1 + publicid_len, charset_len, charset); offset += charset_len; } str_tbl_len = tvb_get_guintvar (tvb, offset, &len, pinfo, &ei_wbxml_oversized_uintvar); str_tbl = offset + len; /* Start of 1st string in string table */ /* String Table */ wbxml_str_tbl_tree = proto_tree_add_subtree_format(wbxml_tree, tvb, offset, len + str_tbl_len, ett_wbxml_str_tbl, NULL, "String table: %u bytes", str_tbl_len); if (str_tbl_len) { /* Display string table as subtree */ show_wbxml_string_table (wbxml_str_tbl_tree, tvb, str_tbl, str_tbl_len, charset); } /* Data starts HERE */ offset += len + str_tbl_len; wbxml_content_tree = proto_tree_add_subtree(wbxml_tree, tvb, offset, -1, ett_wbxml_content, &ti, "Data representation"); /* The WBXML BODY starts here */ if (disable_wbxml_token_parsing) { expert_add_info(pinfo, ti, &ei_wbxml_data_not_shown); return; } /* The parse_wbxml_X() functions will process the content correctly, * irrespective of the WBXML version used. For the WBXML body, this * means that there is a different processing for the global token * RESERVED_2 (WBXML 1.0) or OPAQUE (WBXML 1.x with x > 0). */ if (override_content_map != NULL) { content_map = override_content_map; proto_item_append_text(ti, " is based on: %s", content_map->name); } else { /* Retrieve the content token mapping if available */ content_map = get_wbxml_decoding_from_public_id (publicid); if (! content_map) { content_map = get_wbxml_decoding_from_content_type( pinfo->match_string, tvb, offset); if (! content_map) { expert_add_info(pinfo, ti, &ei_wbxml_content_type_not_supported); } else { proto_item_append_text(ti, " is based on Content-Type: %s " "(chosen decoding: %s)", pinfo->match_string, content_map->name); } } } if (content_map && skip_wbxml_token_mapping) { expert_add_info(pinfo, ti, &ei_wbxml_content_type_disabled); content_map = NULL; } tag_tree = proto_tree_add_subtree(wbxml_content_tree, tvb, offset, -1, ett_wbxml_tags, NULL, "Level | State | Codepage | WBXML Token Description | Rendering"); /* If content_map == NULL, WBXML only, no interpretation of the content */ parse_wbxml_tag_defined (tag_tree, tvb, pinfo, offset, str_tbl, &codepage_stag, &codepage_attr, content_map); } static int dissect_wbxml(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_wbxml_common(tvb, pinfo, tree, NULL); return tvb_captured_length(tvb); } static int dissect_uaprof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_wbxml_common(tvb, pinfo, tree, &decode_uaprof_wap_248); return tvb_captured_length(tvb); } /****************** Register the protocol with Wireshark ******************/ /* This format is required because a script is used to build the C function * that calls the protocol registration. */ void proto_register_wbxml(void) { module_t *wbxml_module; /* WBXML Preferences */ /* Setup list of header fields. */ static hf_register_info hf[] = { { &hf_wbxml_version, { "Version", "wbxml.version", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wbxml_versions_ext, 0x00, "WBXML Version", HFILL } }, { &hf_wbxml_public_id_known, { "Public Identifier (known)", "wbxml.public_id.known", FT_UINT32, BASE_HEX|BASE_EXT_STRING, &vals_wbxml_public_ids_ext, 0x00, "WBXML Known Public Identifier (integer)", HFILL } }, { &hf_wbxml_public_id_literal, { "Public Identifier (literal)", "wbxml.public_id.literal", FT_STRING, BASE_NONE, NULL, 0x00, "WBXML Literal Public Identifier (text string)", HFILL } }, { &hf_wbxml_charset, { "Character Set", "wbxml.charset", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &mibenum_vals_character_sets_ext, 0x00, "WBXML Character Set", HFILL } }, { &hf_wbxml_string_table_item_offset, { "Offset", "wbxml.string_table_item_offset", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_string_table_item_string, { "String", "wbxml.string_table_item_string", FT_STRINGZ, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_switch_page, { "SWITCH_PAGE", "wbxml.switch_page", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_known_tag, { "Known Tag", "wbxml.known_tag", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_end_known_tag, { "END Known Tag", "wbxml.end_known_tag", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_end_known_tag_uint, { "END Known Tag", "wbxml.end_known_tag.uint", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_str_i, { "STR_I", "wbxml.str_i", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_str_t, { "STR_T", "wbxml.str_t", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_opaque_data, { "Opaque Data", "wbxml.opaque_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_entity, { "ENTITY", "wbxml.entity", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_literal, { "LITERAL", "wbxml.literal", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_ext_i, { "EXT_I", "wbxml.ext_i", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_ext_t, { "EXT_T", "wbxml.ext_t", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_extension_token, { "Extension Token", "wbxml.extension_token", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_reserved_2, { "RESERVED_2", "wbxml.reserved_2", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_invalid_token, { "Invalid token", "wbxml.invalid_token", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_known_attrvalue, { "Known attrValue", "wbxml.known_attrvalue", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_known_attrstart, { "Known attrStart", "wbxml.known_attrstart", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_end_literal_tag, { "END (Literal Tag)", "wbxml.end_literal_tag", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_literal_a, { "LITERAL_A", "wbxml.literal_a", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_literal_c, { "LITERAL_C", "wbxml.literal_c", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_literal_ac, { "LITERAL_AC", "wbxml.literal_ac", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_end_pi, { "END (PI)", "wbxml.end_pi", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_end_attribute_list, { "END (attribute list)", "wbxml.end_attribute_list", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wbxml_pi_xml, { "PI (XML Processing Instruction)", "wbxml.pi_xml", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wbxml, &ett_wbxml_str_tbl, &ett_wbxml_content, &ett_wbxml_tags, &ett_wbxml_string_table_item, }; static ei_register_info ei[] = { { &ei_wbxml_data_not_shown, { "wbxml.data_not_shown", PI_PROTOCOL, PI_NOTE, "Data representation not shown (edit WBXML preferences to show)", EXPFILL }}, { &ei_wbxml_content_type_not_supported, { "wbxml.content_type.not_supported", PI_UNDECODED, PI_WARN, "Rendering of this content type not (yet) supported", EXPFILL }}, { &ei_wbxml_content_type_disabled, { "wbxml.content_type.disabled", PI_PROTOCOL, PI_NOTE, "Rendering of this content type has been disabled (edit WBXML preferences to enable)", EXPFILL }}, { &ei_wbxml_oversized_uintvar, { "wbxml.oversized_uintvar", PI_MALFORMED, PI_ERROR, "Uintvar is oversized", EXPFILL }}, { &ei_wbxml_too_much_recursion, { "wbxml.too_much_recursion", PI_UNDECODED, PI_WARN, "Too much recursion", EXPFILL }} }; expert_module_t* expert_wbxml; /* Register the protocol name and description */ proto_wbxml = proto_register_protocol( "WAP Binary XML", "WBXML", "wbxml" ); /* Required function calls to register the header fields * and subtrees used */ proto_register_field_array(proto_wbxml, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wbxml = expert_register_protocol(proto_wbxml); expert_register_field_array(expert_wbxml, ei, array_length(ei)); /* Preferences */ wbxml_module = prefs_register_protocol(proto_wbxml, NULL); prefs_register_bool_preference(wbxml_module, "skip_wbxml_token_mapping", "Skip the mapping of WBXML tokens to media type tokens.", "Enable this preference if you want to view the WBXML " "tokens without the representation in a media type " "(e.g., WML). Tokens will show up as Tag_0x12, " "attrStart_0x08 or attrValue_0x0B for example.", &skip_wbxml_token_mapping); prefs_register_bool_preference(wbxml_module, "disable_wbxml_token_parsing", "Disable the parsing of the WBXML tokens.", "Enable this preference if you want to skip the " "parsing of the WBXML tokens that constitute the body " "of the WBXML document. Only the WBXML header will be " "dissected (and visualized) then.", &disable_wbxml_token_parsing); register_dissector("wbxml", dissect_wbxml, proto_wbxml); register_dissector("wbxml-uaprof", dissect_uaprof, proto_wbxml); } void proto_reg_handoff_wbxml(void) { /* Heuristic dissectors would be declared by means of: * heur_dissector_add("wsp", dissect_wbxml_heur, proto_wbxml); */ wbxml_handle = find_dissector("wbxml"); /* Register the WSP content types (defined as protocol port) * for WBXML dissection. * * See http://www.wapforum.org/wina/wsp-content-type.htm * * As the media types for WSP and HTTP are the same, the WSP dissector * uses the same string dissector table as the HTTP protocol. */ /**** Well-known WBXML WSP Content-Type values ****/ dissector_add_string("media_type", "application/vnd.wap.wmlc", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.wta-eventc", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.sic", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.slc", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.coc", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.connectivity-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.wap.locc+wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.syncml+wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.syncml.dm+wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.oma.drm.rights+wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.wv.csp.wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.ms-sync.wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.ms-sync", wbxml_handle); /**** Registered WBXML WSP Content-Type values ****/ dissector_add_string("media_type", "application/vnd.uplanet.cacheop-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.uplanet.alert-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.uplanet.list-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.uplanet.listcmd-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.uplanet.channel-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.uplanet.bearer-choice-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.phonecom.mmc-wbxml", wbxml_handle); dissector_add_string("media_type", "application/vnd.nokia.syncset+wbxml", wbxml_handle); /***** Content types that only have a textual representation *****/ dissector_add_string("media_type", "application/x-wap-prov.browser-bookmarks", wbxml_handle); dissector_add_string("media_type", "application/x-wap-prov.browser-settings", wbxml_handle); /* Same as application/vnd.nokia.syncset+wbxml */ dissector_add_string("media_type", "application/x-prov.syncset+wbxml", wbxml_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * ex: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-wccp.c
/* packet-wccp.c * Routines for Web Cache C* Protocol dissection * Jerry Talkington <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #include <epan/ipproto.h> #include <epan/expert.h> #include "packet-wccp.h" void proto_register_wccp(void); void proto_reg_handoff_wccp(void); static int proto_wccp = -1; static int hf_wccp_message_type = -1; /* the message type */ static int hf_wccp_version = -1; /* protocol version */ static int hf_bucket = -1; static int hf_bucket_bit = -1; static int hf_message_header_version = -1; static int hf_hash_revision = -1; /* the version of the hash */ static int hf_change_num = -1; /* change number */ static int hf_hash_flag = -1; static int hf_hash_flag_u = -1; static int hf_recvd_id = -1; static int hf_wc_num = -1; static int hf_wc_view_wc_num = -1; static int hf_cache_ip = -1; static int hf_message_header_length = -1; static int hf_item_type = -1; static int hf_item_length = -1; static int hf_item_data = -1; static int hf_security_info_option = -1; static int hf_security_info_md5_checksum = -1; static int hf_command_element_type = -1; static int hf_command_element_length = -1; static int hf_command_length = -1; static int hf_command_element_shutdown_ip_index = -1; static int hf_command_element_shutdown_ipv4 = -1; static int hf_command_element_shutdown_ipv6 = -1; static int hf_command_unknown = -1; static int hf_service_info_type = -1; static int hf_service_info_id_standard = -1; static int hf_service_info_id_dynamic = -1; static int hf_service_info_priority = -1; static int hf_service_info_protocol = -1; static int hf_service_info_flags = -1; static int hf_service_info_flags_src_ip_hash = -1; static int hf_service_info_flags_dest_ip_hash = -1; static int hf_service_info_flags_src_port_hash = -1; static int hf_service_info_flags_dest_port_hash = -1; static int hf_service_info_flags_ports_defined = -1; static int hf_service_info_flags_ports_source = -1; static int hf_service_info_flags_redirect_only_protocol_0 = -1; static int hf_service_info_flags_src_ip_alt_hash = -1; static int hf_service_info_flags_dest_ip_alt_hash = -1; static int hf_service_info_flags_src_port_alt_hash = -1; static int hf_service_info_flags_dest_port_alt_hash = -1; static int hf_service_info_flags_reserved = -1; static int hf_service_info_source_port = -1; static int hf_service_info_destination_port = -1; static int hf_router_identity_ip_index = -1; static int hf_router_identity_ipv4 = -1; static int hf_router_identity_ipv6 = -1; static int hf_router_identity_receive_id = -1; static int hf_router_identity_send_to_ip_index = -1; static int hf_router_identity_send_to_ipv4 = -1; static int hf_router_identity_send_to_ipv6 = -1; static int hf_router_identity_received_from_num = -1; static int hf_web_cache_identity_index = -1; static int hf_web_cache_identity_ipv4 = -1; static int hf_web_cache_identity_ipv6 = -1; static int hf_web_cache_identity_hash_rev = -1; static int hf_web_cache_identity_flags = -1; static int hf_web_cache_identity_flag_hash_info = -1; static int hf_web_cache_identity_flag_assign_type = -1; static int hf_web_cache_identity_flag_version_request = -1; static int hf_web_cache_identity_flag_reserved = -1; static int hf_mask_value_set_element_value_element_num = -1; static int hf_assignment_weight = -1; static int hf_assignment_status = -1; static int hf_assignment_key_ip_index = -1; static int hf_assignment_key_ipv4 = -1; static int hf_assignment_key_ipv6 = -1; static int hf_assignment_key_change_num = -1; static int hf_assignment_no_data = -1; static int hf_router_view_member_change_num = -1; static int hf_router_router_num = -1; static int hf_router_identity_router_ip_index = -1; static int hf_router_identity_router_ipv4 = -1; static int hf_router_identity_router_ipv6 = -1; static int hf_wc_view_info_change_num = -1; static int hf_wc_view_info_router_ip_index = -1; static int hf_wc_view_info_router_ipv4 = -1; static int hf_wc_view_info_router_ipv6 = -1; static int hf_wc_view_info_wc_ip_index = -1; static int hf_wc_view_info_wc_ipv4 = -1; static int hf_wc_view_info_wc_ipv6 = -1; static int hf_wc_view_router_num = -1; static int hf_wc_identity_ip_address_index = -1; static int hf_wc_identity_ip_address_ipv4 = -1; static int hf_wc_identity_ip_address_ipv6 = -1; static int hf_router_identity_received_from_ip_index = -1; static int hf_router_identity_received_from_ipv4 = -1; static int hf_router_identity_received_from_ipv6 = -1; static int hf_router_assignment_element_change_num = -1; static int hf_assignment_info_router_num = -1; static int hf_hash_buckets_assignment_wc_num = -1; static int hf_hash_buckets_assignment_wc_ip_index = -1; static int hf_hash_buckets_assignment_wc_ipv4 = -1; static int hf_hash_buckets_assignment_wc_ipv6 = -1; static int hf_assignment_info_router_ip_index = -1; static int hf_assignment_info_router_ipv4 = -1; static int hf_assignment_info_router_ipv6 = -1; static int hf_router_view_ip_index = -1; static int hf_router_view_ipv4 = -1; static int hf_router_view_ipv6 = -1; static int hf_router_query_info_ip_index = -1; static int hf_router_query_info_ipv4 = -1; static int hf_router_query_info_ipv6 = -1; static int hf_router_query_info_send_to_ip_index = -1; static int hf_router_query_info_send_to_ipv4 = -1; static int hf_router_query_info_send_to_ipv6 = -1; static int hf_router_query_info_target_ip_index = -1; static int hf_router_query_info_target_ipv4 = -1; static int hf_router_query_info_target_ipv6 = -1; static int hf_capability_element_type = -1; static int hf_capability_element_length = -1; static int hf_capability_info_value = -1; static int hf_capability_forwarding_method_flag_gre = -1; static int hf_capability_forwarding_method_flag_l2 = -1; static int hf_capability_assignment_method_flag_hash = -1; static int hf_capability_assignment_method_flag_mask = -1; static int hf_capability_return_method_flag_gre = -1; static int hf_capability_return_method_flag_l2 = -1; static int hf_capability_transmit_t = -1; static int hf_capability_transmit_t_upper_limit = -1; static int hf_capability_transmit_t_lower_limit = -1; static int hf_capability_timer_scale_timeout_scale = -1; static int hf_capability_timer_scale_ra_timer_scale = -1; static int hf_capability_timer_scale_timeout_scale_upper_limit = -1; static int hf_capability_timer_scale_timeout_scale_lower_limit = -1; static int hf_capability_timer_scale_ra_scale_upper_limit = -1; static int hf_capability_timer_scale_ra_scale_lower_limit = -1; static int hf_capability_value = -1; static int hf_reserved_zero = -1; static int hf_value_element_src_ip_index = -1; static int hf_value_element_src_ipv4 = -1; static int hf_value_element_src_ipv6 = -1; static int hf_value_element_dest_ip_index = -1; static int hf_value_element_dest_ipv4 = -1; static int hf_value_element_dest_ipv6 = -1; static int hf_value_element_src_port = -1; static int hf_value_element_dest_port = -1; static int hf_value_element_web_cache_ip_index = -1; static int hf_value_element_web_cache_ipv4 = -1; static int hf_value_element_web_cache_ipv6 = -1; static int hf_mask_value_set_list_num_elements = -1; static int hf_mask_element_src_ip = -1; static int hf_mask_element_dest_ip = -1; static int hf_mask_element_src_port = -1; static int hf_mask_element_dest_port = -1; static int hf_alt_assignment_info_assignment_type = -1; static int hf_extended_assignment_data_type = -1; static int hf_alt_assignment_info_assignment_length = -1; static int hf_alt_assignment_map_assignment_type = -1; static int hf_alt_assignment_map_assignment_length = -1; static int hf_extended_assignment_data_length = -1; static int hf_alt_assignment_info_num_routers = -1; static int hf_alt_assignment_mask_value_set_element_num_wc_value_elements = -1; static int hf_web_cache_value_element_wc_address_index = -1; static int hf_web_cache_value_element_wc_address_ipv4 = -1; static int hf_web_cache_value_element_wc_address_ipv6 = -1; static int hf_web_cache_value_element_num_values = -1; static int hf_web_cache_value_seq_num = -1; static int hf_alt_assignment_mask_value_set_list_num_elements = -1; static int hf_address_table_family = -1; static int hf_address_table_address_length = -1; static int hf_address_table_length = -1; static int hf_address_table_element = -1; static gint ett_wccp = -1; static gint ett_buckets = -1; static gint ett_hash_assignment_buckets = -1; static gint ett_mask_assignment_data_element = -1; static gint ett_alternate_mask_assignment_data_element = -1; static gint ett_extended_assigment_data_element = -1; static gint ett_table_element = -1; static gint ett_hash_flags = -1; static gint ett_wc_identity_flags = -1; static gint ett_cache_info = -1; static gint ett_security_info = -1; static gint ett_service_info = -1; static gint ett_service_flags = -1; static gint ett_service_info_ports = -1; static gint ett_wc_view_info_router_element = -1; static gint ett_router_identity_info = -1; static gint ett_wc_identity_element = -1; static gint ett_wc_identity_info = -1; static gint ett_router_view_info = -1; static gint ett_wc_view_info = -1; static gint ett_router_assignment_element = -1; static gint ett_hash_buckets_assignment_wc_element=-1; static gint ett_hash_buckets_assignment_buckets=-1; static gint ett_router_alt_assignment_element = -1; static gint ett_router_assignment_info = -1; static gint ett_query_info = -1; static gint ett_capabilities_info = -1; static gint ett_capability_element = -1; static gint ett_capability_forwarding_method = -1; static gint ett_capability_assignment_method = -1; static gint ett_capability_return_method = -1; static gint ett_capability_transmit_t = -1; static gint ett_capability_timer_scale = -1; static gint ett_alt_assignment_info = -1; static gint ett_alt_assignment_map = -1; static gint ett_address_table = -1; static gint ett_assignment_map = -1; static gint ett_command_extension = -1; static gint ett_alternate_mask_value_set=-1; static gint ett_alternate_mask_value_set_element=-1; static gint ett_mv_set_list = -1; static gint ett_mv_set_element = -1; static gint ett_mv_set_value_list = -1; static gint ett_alternate_mv_set_element_list = -1; static gint ett_web_cache_value_element_list = -1; static gint ett_alternate_mv_set_element = -1; static gint ett_value_element = -1; static gint ett_unknown_info = -1; static expert_field ei_wccp_missing_security_info = EI_INIT; static expert_field ei_wccp_missing_service_info = EI_INIT; static expert_field ei_wccp_missing_wc_id_info = EI_INIT; static expert_field ei_wccp_missing_router_id_info = EI_INIT; static expert_field ei_wccp_missing_query_info = EI_INIT; static expert_field ei_wccp_missing_wc_view_info = EI_INIT; static expert_field ei_wccp_missing_rtr_view_info = EI_INIT; static expert_field ei_wccp_contains_redirect_assignment = EI_INIT; static expert_field ei_wccp_contains_router_id_info = EI_INIT; static expert_field ei_wccp_contains_rtr_view_info = EI_INIT; static expert_field ei_wccp_contains_query_info = EI_INIT; static expert_field ei_wccp_contains_alt_assignment = EI_INIT; static expert_field ei_wccp_contains_assign_map = EI_INIT; static expert_field ei_wccp_contains_alt_assignment_map = EI_INIT; static expert_field ei_wccp_contains_wc_id_info = EI_INIT; static expert_field ei_wccp_contains_wc_view_info = EI_INIT; static expert_field ei_wccp_contains_capabilities_info = EI_INIT; static expert_field ei_wccp_contains_command_extension = EI_INIT; static expert_field ei_wccp_missing_assignment = EI_INIT; static expert_field ei_wccp_assignment_length_bad = EI_INIT; static expert_field ei_wccp_length_bad = EI_INIT; static expert_field ei_wccp_service_info_priority_nonzero = EI_INIT; static expert_field ei_wccp_service_info_protocol_nonzero = EI_INIT; static expert_field ei_wccp_router_identity_receive_id_zero = EI_INIT; static expert_field ei_wccp_web_cache_identity_hash_rev_zero = EI_INIT; static expert_field ei_wccp_address_table_family_unknown = EI_INIT; static expert_field ei_wccp_capability_element_length = EI_INIT; static expert_field ei_wccp_port_fields_not_used = EI_INIT; static expert_field ei_wccp_a_zero_not_c = EI_INIT; /* static expert_field ei_wccp_c_zero_not_a = EI_INIT; */ /* * At * * https://datatracker.ietf.org/doc/html/draft-forster-wrec-wccp-v1-00 * * is the now-expired Internet-Draft for WCCP 1.0 (Web Cache Coordination * Protocol V1.0). * * At * * https://datatracker.ietf.org/doc/html/draft-wilson-wrec-wccp-v2-01 * * is the now-expired Internet-Draft for WCCP 2.0 (Web Cache Communication * Protocol V2.0). * * https://datatracker.ietf.org/doc/html/draft-param-wccp-v2rev1-01 * * is the now-expired Internet-Draft for WCCP 2.01 (Web Cache Communication * Protocol V2, Revision 1). */ /* This is NOT IANA assigned */ #define UDP_PORT_WCCP 2048 #define WCCPv1 4 #define WCCPv2 0x0200 #define WCCPv2r1 0x0201 #define WCCP_HERE_I_AM 7 #define WCCP_I_SEE_YOU 8 #define WCCP_ASSIGN_BUCKET 9 #define WCCP2_HERE_I_AM 10 #define WCCP2_I_SEE_YOU 11 #define WCCP2_REDIRECT_ASSIGN 12 #define WCCP2_REMOVAL_QUERY 13 static const value_string wccp_type_vals[] = { { WCCP_HERE_I_AM, "1.0 Here I am" }, { WCCP_I_SEE_YOU, "1.0 I see you" }, { WCCP_ASSIGN_BUCKET, "1.0 Assign bucket" }, { WCCP2_HERE_I_AM, "2.0 Here I am" }, { WCCP2_I_SEE_YOU, "2.0 I see you" }, { WCCP2_REDIRECT_ASSIGN, "2.0 Redirect assign" }, { WCCP2_REMOVAL_QUERY, "2.0 Removal query" }, { 0, NULL } }; static const value_string wccp_version_val[] = { { WCCPv1, "1"}, { WCCPv2, "2"}, { WCCPv2r1, "2.01"}, { 0, NULL} }; static const true_false_string tfs_src_dest_port = { "Source port", "Destination port" }; static const true_false_string tfs_redirect_protocol0 = { "Redirect only protocol 0 (IP)", "Redirect all traffic" }; static const true_false_string tfs_historical_current = { "Historical", "Current" }; static const true_false_string tfs_version_min_max = {"WCCP version set is maximum supported by CE", "WCCP version set is minimum supported by CE"}; static const value_string wccp_address_family_val[] = { { 0, "Reserved" }, { 1, "IPv4" }, { 2, "IPv6" }, { 0, NULL } }; #define WCCP2_HASH_ASSIGNMENT_TYPE 0 #define WCCP2_MASK_ASSIGNMENT_TYPE 1 #define WCCP2r1_ALT_MASK_ASSIGNMENT_TYPE 2 #define WCCP2r1_ASSIGNMENT_WEIGHT_STATUS 3 static const value_string assignment_type_vals[] = { { WCCP2_HASH_ASSIGNMENT_TYPE, "Hash" }, { WCCP2_MASK_ASSIGNMENT_TYPE, "Mask" }, { WCCP2r1_ALT_MASK_ASSIGNMENT_TYPE, "WCCP2r1 Alternate Mask"}, { WCCP2r1_ASSIGNMENT_WEIGHT_STATUS, "WCCP2r1 Assignment Weight Status"}, { 0, NULL } }; #define HASH_INFO_SIZE (4*(1+8+1)) #define WCCP2_SECURITY_INFO 0 #define WCCP2_SERVICE_INFO 1 #define WCCP2_ROUTER_ID_INFO 2 #define WCCP2_WC_ID_INFO 3 #define WCCP2_RTR_VIEW_INFO 4 #define WCCP2_WC_VIEW_INFO 5 #define WCCP2_REDIRECT_ASSIGNMENT 6 #define WCCP2_QUERY_INFO 7 #define WCCP2_CAPABILITIES_INFO 8 #define WCCP2_ALT_ASSIGNMENT 13 #define WCCP2_ASSIGN_MAP 14 #define WCCP2_COMMAND_EXTENSION 15 /* WCCP 2 r1 additions: */ #define WCCP2r1_ALT_ASSIGNMENT_MAP 16 #define WCCP2r1_ADDRESS_TABLE 17 static const value_string info_type_vals[] = { { WCCP2_SECURITY_INFO, "Security Info" }, { WCCP2_SERVICE_INFO, "Service Info" }, { WCCP2_ROUTER_ID_INFO, "Router Identity Info" }, { WCCP2_WC_ID_INFO, "Web-Cache Identity Info" }, { WCCP2_RTR_VIEW_INFO, "Router View Info" }, { WCCP2_WC_VIEW_INFO, "Web-Cache View Info" }, { WCCP2_REDIRECT_ASSIGNMENT, "Assignment Info" }, { WCCP2_QUERY_INFO, "Router Query Info" }, { WCCP2_CAPABILITIES_INFO, "Capabilities Info" }, { WCCP2_ALT_ASSIGNMENT, "Alternate Assignment" }, { WCCP2_ASSIGN_MAP, "Assignment Map" }, { WCCP2_COMMAND_EXTENSION, "Command Extension" }, { WCCP2r1_ALT_ASSIGNMENT_MAP, "Alternative Assignment Map" }, { WCCP2r1_ADDRESS_TABLE, "Address Table" }, { 0, NULL } }; const value_string service_id_vals[] = { { 0x00, "HTTP" }, { 0, NULL } }; typedef struct capability_flag { guint32 value; const char *short_name; int* phf; } capability_flag; #define WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_HASH 0 #define WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_MASK 1 #define WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_NOT_PRESENT 2 #define WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_EXTENDED 3 static const value_string wccp_web_cache_assignment_data_type_val[] = { { WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_HASH , "Hash Assignment Data Element"}, { WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_MASK , "Mask Assignment Data Element"}, { WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_NOT_PRESENT , "Assignment Data Element Not Present"}, { WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_EXTENDED , "Extended Assignment Data Element"}, { 0, NULL } }; #define WCCP2_FORWARDING_METHOD 0x01 #define WCCP2_ASSIGNMENT_METHOD 0x02 #define WCCP2_PACKET_RETURN_METHOD 0x03 #define WCCP2_TRANSMIT_T 0x04 #define WCCP2_TIMER_SCALE 0x05 static const value_string capability_type_vals[] = { { WCCP2_FORWARDING_METHOD, "Forwarding Method" }, { WCCP2_ASSIGNMENT_METHOD, "Assignment Method" }, { WCCP2_PACKET_RETURN_METHOD, "Packet Return Method" }, { WCCP2_TRANSMIT_T, "Transmit_t Message interval values"}, { WCCP2_TIMER_SCALE, "Timer_scale Timeout scale values"}, { 0, NULL } }; /* with version 2.01 we now have a address table which is possibly present */ typedef struct wccp_address_table { gboolean in_use; gint16 family; gint16 version; guint16 table_length; guint32 *table_ipv4; ws_in6_addr *table_ipv6; } wccp_address_table; static int wccp_bucket_info(guint8 bucket_info, proto_tree *bucket_tree, guint32 start, tvbuff_t *tvb, int offset); /* The V2 dissectors will return the remaining length of the packet and a negative number if there are missing bytes to finish the dissection */ static gint dissect_wccp2_mask_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2_hash_buckets_assignment_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2r1_address_table_info(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* wccp_wccp_address_table); static gint dissect_wccp2_hash_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree); static gint dissect_wccp2_assignment_weight_and_status_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree); static gint dissect_wccp2_extended_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2_capability_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree); static gint dissect_wccp2_mask_value_set_list(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); /* Utility functions */ static gint dissect_wccp2_mask_value_set_element(tvbuff_t *tvb, int offset, gint length, int idx, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2_alternate_mask_value_set_list(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2_alternate_mask_value_set_element(tvbuff_t *tvb, int offset, gint length, guint el_index, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static gint dissect_wccp2_web_cache_value_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table); static void dissect_32_bit_capability_flags(tvbuff_t *tvb, int curr_offset, guint16 capability_val_len, gint ett, const capability_flag *flags, proto_tree *element_tree, proto_item *header, proto_item *length_item, packet_info *pinfo); static void dissect_transmit_t_capability(tvbuff_t *tvb, proto_item *te, int curr_offset, guint16 capability_val_len, gint ett, proto_tree *element_tree, proto_item *length_item, packet_info *pinfo); static void dissect_timer_scale_capability(tvbuff_t *tvb, int curr_offset, guint16 capability_val_len, gint ett, proto_tree *element_tree, proto_item *length_item, packet_info *pinfo); /* * In WCCP 2.01 addresses are encoded to support IPv6 with 32 bit fields * * handle the decoding */ static void find_wccp_address_table(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *wccp_tree _U_, wccp_address_table* wccp_wccp_address_table) { guint16 type; guint16 item_length; for (;;) { if (4 > tvb_reported_length_remaining(tvb, offset)) { /* We've run out of packet data without finding an address table, so there's no address table in the packet. */ return; } type = tvb_get_ntohs(tvb, offset); item_length = tvb_get_ntohs(tvb, offset+2); if ((item_length + 4) > tvb_reported_length_remaining(tvb, offset)) { /* We've run out of packet data without finding an address table, so there's no address table in the packet. */ return; } if (type == WCCP2r1_ADDRESS_TABLE) { dissect_wccp2r1_address_table_info(tvb, offset+4, item_length, pinfo, NULL, wccp_wccp_address_table); /* no need to decode the rest */ return; } offset = offset + (item_length + 4); } } /* This function prints the IP or the encoded IP if the table exists */ /* at most an IPv6 IP: see http://stackoverflow.com/questions/166132/maximum-length-of-the-textual-representation-of-an-ipv6-address 39 = 8 groups of 4 digits with 7 : characters or 45 = IPv4 tunnel features: 0000:0000:0000:0000:0000:0000:192.168.0.1 */ /* problem here is that the IP is in network byte order for IPv4 we need to fix that */ static const gchar * decode_wccp_encoded_address(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *info_tree _U_, wccp_address_table* addr_table) { guint32 host_addr; gchar *buffer; /* are we using an address table? */ if (!addr_table->in_use) { /* no; return the IPv4 IP */ host_addr = tvb_get_ipv4(tvb,offset); buffer = (char *) wmem_alloc(wmem_packet_scope(), WS_INET_ADDRSTRLEN); ip_to_str_buf( (guint8 *) &host_addr, buffer, WS_INET_ADDRSTRLEN); } else { /* yes; we need to decode the encoded address */ guint16 reserv; guint16 addr_index; host_addr = tvb_get_ntohl(tvb,offset); reserv = (host_addr & 0xFFFF0000) >> 16; addr_index = (host_addr & 0x0000FFFF); if (reserv != 0) { buffer = wmem_strdup(wmem_packet_scope(), "INVALID: reserved part non zero"); } else { /* now check if it's IPv4 or IPv6 we need to print */ switch (addr_table->family) { case 1: /* IPv4 */ /* special case: index 0 -> undefined IP */ if (addr_index == 0) { buffer = wmem_strdup(wmem_packet_scope(), "0.0.0.0"); break; } /* are we be beyond the end of the table? */ if (addr_index > addr_table->table_length) { buffer = wmem_strdup_printf(wmem_packet_scope(), "INVALID IPv4 index: %d > %d", addr_index, addr_table->table_length); break; } /* ok get the IP */ if (addr_table->table_ipv4 != NULL) { buffer = (char *) wmem_alloc(wmem_packet_scope(), WS_INET_ADDRSTRLEN); ip_to_str_buf( (guint8 *) &(addr_table->table_ipv4[addr_index-1]), buffer, WS_INET_ADDRSTRLEN); } else { buffer = wmem_strdup(wmem_packet_scope(), "INVALID IPv4 table empty!"); } break; case 2: /* IPv6 */ /* special case: index 0 -> undefined IP */ if (addr_index == 0) { buffer = wmem_strdup(wmem_packet_scope(), "::"); break; } /* are we be beyond the end of the table? */ if (addr_index > addr_table->table_length) { buffer = wmem_strdup_printf(wmem_packet_scope(), "INVALID IPv6 index: %d > %d", addr_index, addr_table->table_length); break; } /* ok get the IP */ if (addr_table->table_ipv6 != NULL) { buffer = (char *) wmem_alloc(wmem_packet_scope(), WS_INET6_ADDRSTRLEN); ip6_to_str_buf(&(addr_table->table_ipv6[addr_index-1]), buffer, WS_INET6_ADDRSTRLEN); } else { buffer = wmem_strdup(wmem_packet_scope(), "INVALID IPv6 table empty!"); } break; default: buffer = wmem_strdup(wmem_packet_scope(), "INVALID IP family"); break; } } } return buffer; } static proto_item* wccp_add_ipaddress_item(proto_tree* tree, int hf_index, int hf_ipv4, int hf_ipv6, tvbuff_t *tvb, int offset, gint length, wccp_address_table* addr_table) { guint32 host_addr; ws_in6_addr ipv6_zero; guint16 reserv, addr_index; /* are we using an address table? */ if (! addr_table->in_use) return proto_tree_add_item(tree, hf_ipv4, tvb, offset, length, ENC_BIG_ENDIAN); host_addr = tvb_get_ntohl(tvb, offset); /* we need to decode the encoded address: */ reserv = (host_addr & 0xFFFF0000) >> 16; addr_index = (host_addr & 0x0000FFFF); memset(&ipv6_zero, 0, sizeof(ipv6_zero)); if (reserv != 0) return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, "INVALID: reserved part non zero"); /* now check if it's IPv4 or IPv6 we need to print */ switch (addr_table->family) { case 1: /* IPv4 */ /* special case: index 0 -> undefined IP */ if (addr_index == 0) { return proto_tree_add_item(tree, hf_ipv4, tvb, offset, length, ENC_LITTLE_ENDIAN); } /* are we be beyond the end of the table? */ if (addr_index > addr_table->table_length) { return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, "INVALID IPv4 index: %d > %d", addr_index, addr_table->table_length); } /* ok get the IP */ if (addr_table->table_ipv4 != NULL) { return proto_tree_add_ipv4(tree, hf_ipv4, tvb, offset, length, addr_table->table_ipv4[addr_index-1]); } return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, "INVALID: IPv4 table empty!"); case 2: /* IPv6 */ /* special case: index 0 -> undefined IP */ if (addr_index == 0) { return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, &ipv6_zero); } /* are we be beyond the end of the table? */ if (addr_index > addr_table->table_length) { return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, "INVALID IPv6 index: %d > %d", addr_index, addr_table->table_length); } /* ok get the IP */ if (addr_table->table_ipv6 != NULL) { return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, &(addr_table->table_ipv6[addr_index-1])); } return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, "INVALID IPv6 table empty!"); } return proto_tree_add_ipv4_format(tree, hf_index, tvb, offset, length, host_addr, "INVALID IP family"); } #define WCCP_IP_MAX_LENGTH (WS_INET_ADDRSTRLEN > 46 ? WS_INET_ADDRSTRLEN : 46) static guint dissect_hash_data(tvbuff_t *tvb, int offset, proto_tree *wccp_tree) { proto_tree *bucket_tree; proto_item *tf; proto_tree *field_tree; int i; guint8 bucket_info; int n; proto_tree_add_item(wccp_tree, hf_hash_revision, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; bucket_tree = proto_tree_add_subtree(wccp_tree, tvb, offset, 32, ett_buckets, NULL, "Hash information"); for (i = 0, n = 0; i < 32; i++) { bucket_info = tvb_get_guint8(tvb, offset); n = wccp_bucket_info(bucket_info, bucket_tree, n, tvb, offset); offset += 1; } tf = proto_tree_add_item(wccp_tree, hf_hash_flag, tvb, offset, 4, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree(tf, ett_hash_flags); proto_tree_add_item(field_tree, hf_hash_flag_u, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; } static guint dissect_web_cache_list_entry(tvbuff_t *tvb, int offset, int idx, proto_tree *wccp_tree) { proto_tree *list_entry_tree; list_entry_tree = proto_tree_add_subtree_format(wccp_tree, tvb, offset, 4 + HASH_INFO_SIZE, ett_cache_info, NULL, "Web-Cache List Entry(%d)", idx); proto_tree_add_item(list_entry_tree, hf_cache_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset = dissect_hash_data(tvb, offset, list_entry_tree); return offset; } /* * wccp_bucket_info() * takes an integer representing a "Hash Information" bitmap, and spits out * the corresponding proto_tree entries, returning the next bucket number. */ static int wccp_bucket_info(guint8 bucket_info, proto_tree *bucket_tree, guint32 start, tvbuff_t *tvb, int offset) { guint32 i; for(i = 0; i < 8; i++) { proto_tree_add_uint_format(bucket_tree, hf_bucket_bit, tvb, offset, 1, bucket_info & 1<<i, "Bucket %3d: %s", start, (bucket_info & 1<<i ? "Assigned" : "Not Assigned") ); start++; } return(start); } /* the following functions all need to check the length and the offset so we have a few macros to use */ #define EAT(x) {length -= x; offset += x;} #define EAT_AND_CHECK(x,next) {length -= x; offset += x; if (length < next) return length - next;} #define CHECK_LENGTH_ADVANCE_OFFSET(new_length) { \ int old_offset = offset; \ if (new_length<0) return new_length; \ offset += length-new_length; \ if (old_offset >= offset) return offset - old_offset; \ length = new_length; \ } /* 5.1.1 Security Info Component */ /* Security options */ #define WCCP2_NO_SECURITY 0 #define WCCP2_MD5_SECURITY 1 #define SECURITY_INFO_LEN 4 static const value_string security_option_vals[] = { { WCCP2_NO_SECURITY, "None" }, { WCCP2_MD5_SECURITY, "MD5" }, { 0, NULL } }; static gint dissect_wccp2_security_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table _U_) { guint32 security_option; if (length < SECURITY_INFO_LEN) return (length-SECURITY_INFO_LEN); security_option = tvb_get_ntohl(tvb, offset); proto_tree_add_item(info_tree, hf_security_info_option, tvb, offset, 4, ENC_BIG_ENDIAN); if (security_option == WCCP2_MD5_SECURITY) { offset += 4; proto_tree_add_item(info_tree, hf_security_info_md5_checksum, tvb, offset, length-4, ENC_NA); return length-4-16; } return length-4; } /* 5.1.2 Service Info Component */ #define SERVICE_INFO_LEN (4+4+8*2) #define WCCP2_SERVICE_STANDARD 0 #define WCCP2_SERVICE_DYNAMIC 1 static const value_string service_type_vals[] = { { WCCP2_SERVICE_STANDARD, "Standard predefined service"}, { WCCP2_SERVICE_DYNAMIC, "Dynamic CE defined service" }, { 0, NULL } }; /* * Service flags. */ #define WCCP2_SI_SRC_IP_HASH 0x00000001 #define WCCP2_SI_DST_IP_HASH 0x00000002 #define WCCP2_SI_SRC_PORT_HASH 0x00000004 #define WCCP2_SI_DST_PORT_HASH 0x00000008 #define WCCP2_SI_PORTS_DEFINED 0x00000010 #define WCCP2_SI_PORTS_SOURCE 0x00000020 #define WCCP2r1_SI_REDIRECT_ONLY_PROTOCOL_0 0x00000040 #define WCCP2_SI_SRC_IP_ALT_HASH 0x00000100 #define WCCP2_SI_DST_IP_ALT_HASH 0x00000200 #define WCCP2_SI_SRC_PORT_ALT_HASH 0x00000400 #define WCCP2_SI_DST_PORT_ALT_HASH 0x00000800 static gint dissect_wccp2_service_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table _U_) { guint8 service_type; guint32 flags; proto_item *tf; proto_tree *ports_tree; int i; int max_offset = offset+length; static int * const flag_fields[] = { &hf_service_info_flags_src_ip_hash, &hf_service_info_flags_dest_ip_hash, &hf_service_info_flags_src_port_hash, &hf_service_info_flags_dest_port_hash, &hf_service_info_flags_ports_defined, &hf_service_info_flags_ports_source, &hf_service_info_flags_redirect_only_protocol_0, &hf_service_info_flags_src_ip_alt_hash, &hf_service_info_flags_dest_ip_alt_hash, &hf_service_info_flags_src_port_alt_hash, &hf_service_info_flags_dest_port_alt_hash, &hf_service_info_flags_reserved, NULL }; if (length != SERVICE_INFO_LEN) return length - SERVICE_INFO_LEN; service_type = tvb_get_guint8(tvb, offset); proto_tree_add_item(info_tree, hf_service_info_type, tvb, offset, 1, ENC_BIG_ENDIAN); switch (service_type) { case WCCP2_SERVICE_STANDARD: proto_tree_add_item(info_tree, hf_service_info_id_standard, tvb, offset +1 , 1, ENC_BIG_ENDIAN); tf = proto_tree_add_item(info_tree, hf_service_info_priority, tvb, offset+2, 1, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb, offset+2) != 0) expert_add_info(pinfo, tf, &ei_wccp_service_info_priority_nonzero); tf = proto_tree_add_item(info_tree, hf_service_info_protocol, tvb, offset+3, 1, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb, offset+3) != 0) expert_add_info(pinfo, tf, &ei_wccp_service_info_protocol_nonzero); break; case WCCP2_SERVICE_DYNAMIC: proto_tree_add_item(info_tree, hf_service_info_id_dynamic, tvb, offset +1 , 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_service_info_priority, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(info_tree, hf_service_info_protocol, tvb, offset+3, 1, ENC_BIG_ENDIAN); break; } offset += 4; flags = tvb_get_ntohl(tvb, offset); proto_tree_add_bitmask(info_tree, tvb, offset, hf_service_info_flags, ett_service_flags, flag_fields, ENC_BIG_ENDIAN); offset += 4; if (flags & WCCP2_SI_PORTS_DEFINED) { ports_tree = proto_tree_add_subtree(info_tree, tvb, offset, 2*8, ett_service_info_ports, &tf, "Ports list: "); for (i = 0; i < 8; i++) { guint16 port = tvb_get_ntohs(tvb, offset); if (port) { if (flags & WCCP2_SI_SRC_PORT_HASH) proto_tree_add_item(ports_tree, hf_service_info_source_port, tvb, offset, 2, ENC_BIG_ENDIAN); else proto_tree_add_item(ports_tree, hf_service_info_destination_port, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(tf, " %d", port); } offset += 2; DISSECTOR_ASSERT(offset <= max_offset); } } else { /* just use up the space if there is */ if (offset + 8 * 2 <= max_offset) { proto_tree_add_expert(info_tree, pinfo, &ei_wccp_port_fields_not_used, tvb, offset, 8*2); /*offset += 8*2;*/ } } return length - SERVICE_INFO_LEN; } /* 6.1 Router Identity Element */ static void dissect_wccp2_router_identity_element(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, wccp_address_table* addr_table) { proto_item *tf; wccp_add_ipaddress_item(tree, hf_router_identity_ip_index, hf_router_identity_ipv4, hf_router_identity_ipv6, tvb, offset, 4, addr_table); tf = proto_tree_add_item(tree, hf_router_identity_receive_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); if (tvb_get_ntohl(tvb, offset + 4) == 0) expert_add_info(pinfo, tf, &ei_wccp_router_identity_receive_id_zero); } #define ROUTER_ID_INFO_MIN_LEN (8+4+4) /* 5.3.1 Router Identity Info Component */ static gint dissect_wccp2_router_identity_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 n_received_from; guint i; proto_item *te; proto_tree *element_tree; if (length < 8) return length - ROUTER_ID_INFO_MIN_LEN; te = wccp_add_ipaddress_item(info_tree, hf_router_identity_router_ip_index, hf_router_identity_router_ipv4, hf_router_identity_router_ipv6, tvb, offset, 4, addr_table); element_tree = proto_item_add_subtree(te,ett_wc_view_info_router_element); dissect_wccp2_router_identity_element(tvb,offset,pinfo,element_tree, addr_table); EAT_AND_CHECK(8,4); wccp_add_ipaddress_item(info_tree, hf_router_identity_send_to_ip_index, hf_router_identity_send_to_ipv4, hf_router_identity_send_to_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,4); n_received_from = tvb_get_ntohl(tvb, offset); proto_tree_add_item(info_tree, hf_router_identity_received_from_num, tvb, offset, 4, ENC_BIG_ENDIAN); EAT(4); for (i = 0; i < n_received_from; i++) { if (length < 4) return length-4*(i-n_received_from); wccp_add_ipaddress_item(info_tree, hf_router_identity_received_from_ip_index, hf_router_identity_received_from_ipv4, hf_router_identity_received_from_ipv6, tvb, offset, 4, addr_table); EAT(4); } return length; } #define ROUTER_WC_ID_ELEMENT_MIN_LEN (4+2+2) /* 6.4 Web-Cache Identity Element */ static gint dissect_wccp2_web_cache_identity_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *tf; guint16 flags; guint data_element_type; static int * const flag_fields[] = { &hf_web_cache_identity_flag_hash_info, &hf_web_cache_identity_flag_assign_type, &hf_web_cache_identity_flag_version_request, &hf_web_cache_identity_flag_reserved, NULL }; if (length < ROUTER_WC_ID_ELEMENT_MIN_LEN) return length - ROUTER_WC_ID_ELEMENT_MIN_LEN; wccp_add_ipaddress_item(info_tree, hf_web_cache_identity_index, hf_web_cache_identity_ipv4, hf_web_cache_identity_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,2); tf = proto_tree_add_item(info_tree, hf_web_cache_identity_hash_rev, tvb, offset, 2, ENC_BIG_ENDIAN); if (tvb_get_ntohs(tvb, offset) != 0) expert_add_info(pinfo, tf, &ei_wccp_web_cache_identity_hash_rev_zero); EAT_AND_CHECK(2,2); flags = tvb_get_ntohs(tvb, offset); data_element_type = (flags & 0x6) >> 1; proto_tree_add_bitmask(info_tree, tvb, offset, hf_web_cache_identity_flags, ett_wc_identity_flags, flag_fields, ENC_BIG_ENDIAN); EAT(2); switch (data_element_type) { case WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_HASH: return dissect_wccp2_hash_assignment_data_element(tvb,offset,length,pinfo,info_tree); case WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_MASK: return dissect_wccp2_mask_assignment_data_element(tvb,offset,length,pinfo,info_tree, addr_table); case WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_NOT_PRESENT: proto_tree_add_item(info_tree, hf_assignment_no_data, tvb, offset, 2, ENC_NA); return length; break; case WCCP2_WEB_CACHE_ASSIGNMENT_DATA_TYPE_EXTENDED: return dissect_wccp2_extended_assignment_data_element(tvb,offset,length,pinfo,info_tree, addr_table); } return length; } /* 5.2.1 Web-Cache Identity Info Component */ static gint dissect_wccp2_wc_identity_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *te; proto_tree *element_tree; te = wccp_add_ipaddress_item(info_tree, hf_wc_identity_ip_address_index, hf_wc_identity_ip_address_ipv4, hf_wc_identity_ip_address_ipv6, tvb, offset, 4, addr_table); element_tree = proto_item_add_subtree(te, ett_wc_identity_element); return dissect_wccp2_web_cache_identity_element(tvb, offset,length, pinfo, element_tree, addr_table); } /* 6.3 Assignment Key Element */ static gint dissect_wccp2_assignment_key_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table) { if (length < 8) return length -8; wccp_add_ipaddress_item(info_tree, hf_assignment_key_ip_index, hf_assignment_key_ipv4, hf_assignment_key_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,4); proto_tree_add_item(info_tree, hf_assignment_key_change_num, tvb, offset, 4, ENC_BIG_ENDIAN); EAT(4); return length; } #define ROUTER_VIEW_INFO_MIN_LEN (4+8+4+4) /* 5.3.2 Router View Info Component */ static gint dissect_wccp2_router_view_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 n_routers; guint32 n_web_caches; guint i; proto_item *te; proto_tree *element_tree; gint new_length; if (length < ROUTER_VIEW_INFO_MIN_LEN) return length - ROUTER_VIEW_INFO_MIN_LEN; proto_tree_add_item(info_tree, hf_router_view_member_change_num, tvb, offset, 4, ENC_BIG_ENDIAN); EAT(4); new_length=dissect_wccp2_assignment_key_element(tvb, offset, length, pinfo, info_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); n_routers = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_router_router_num, tvb, offset, 4, n_routers); EAT(4); for (i = 0; i < n_routers; i++) { if (length < 4) return length - (n_routers-i)*4 - 4; wccp_add_ipaddress_item(info_tree, hf_router_view_ip_index, hf_router_view_ipv4, hf_router_view_ipv6, tvb, offset, 4, addr_table); EAT(4); } if (length < 4) return length - 4; n_web_caches = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_wc_view_wc_num, tvb, offset, 4, n_web_caches); EAT(4); for (i = 0; i < n_web_caches; i++) { gint old_length; old_length = length; if (length < 4) return length - 4*(n_web_caches-i); te = wccp_add_ipaddress_item(info_tree, hf_router_query_info_ip_index, hf_router_query_info_ipv4, hf_router_query_info_ipv6, tvb, offset, 4, addr_table); element_tree = proto_item_add_subtree(te, ett_wc_identity_element); length = dissect_wccp2_web_cache_identity_element(tvb, offset, length, pinfo, element_tree, addr_table); if (length < 0) return length; offset += old_length - length; } return length; } #define WC_VIEW_INFO_MIN_LEN (4+4+4) /* 5.2.2 Web Cache View Info Component */ static gint dissect_wccp2_web_cache_view_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 n_routers; guint32 n_web_caches; guint i; proto_item *te; proto_tree *element_tree; if (length < WC_VIEW_INFO_MIN_LEN) return length - WC_VIEW_INFO_MIN_LEN; proto_tree_add_item(info_tree, hf_wc_view_info_change_num, tvb, offset, 4, ENC_BIG_ENDIAN); EAT_AND_CHECK(4,4); n_routers = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_wc_view_router_num, tvb, offset, 4, n_routers); EAT(4); for (i = 0; i < n_routers; i++) { if (length < 8) return length -8 * (n_routers-i) - 4; te = wccp_add_ipaddress_item(info_tree, hf_wc_view_info_router_ip_index, hf_wc_view_info_router_ipv4, hf_wc_view_info_router_ipv6, tvb, offset, 4, addr_table); /* also include the receive id in the object */ proto_item_set_len(te, 8); element_tree = proto_item_add_subtree(te,ett_wc_view_info_router_element); dissect_wccp2_router_identity_element(tvb, offset, pinfo, element_tree, addr_table); EAT(8); } if (length < 4) return length - 4; n_web_caches = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_wc_view_wc_num, tvb, offset, 4, n_web_caches); EAT(4); for (i = 0; i < n_web_caches; i++) { if (length < 4) return length - 4*(n_web_caches-i); wccp_add_ipaddress_item(info_tree, hf_wc_view_info_wc_ip_index, hf_wc_view_info_wc_ipv4, hf_wc_view_info_wc_ipv6, tvb, offset, 4, addr_table); EAT(4); } return length; } /* 6.2 Router Assignment Element */ static void dissect_wccp2_router_assignment_element(tvbuff_t *tvb, int offset, gint length _U_, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { dissect_wccp2_router_identity_element(tvb,offset,pinfo,info_tree, addr_table); EAT(8); proto_tree_add_item(info_tree, hf_router_assignment_element_change_num, tvb, offset, 4, ENC_BIG_ENDIAN); EAT(4); } static const gchar * assignment_bucket_name(guint8 bucket) { const gchar *cur; if (bucket == 0xff) { cur= "Unassigned"; } else { cur=wmem_strdup_printf(wmem_packet_scope(), "%u%s", bucket & 0x7F, (bucket & 0x80) ? " (Alt)" : ""); } return cur; } #define ASSIGNMENT_INFO_MIN_LEN (8+4+4) /* 5.4.1 Assignment Info Component */ static gint dissect_wccp2_assignment_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 n_routers; guint i; proto_item *te; proto_tree *element_tree; gint new_length; if (length < ASSIGNMENT_INFO_MIN_LEN) return length - ASSIGNMENT_INFO_MIN_LEN; new_length=dissect_wccp2_assignment_key_element(tvb, offset, length, pinfo, info_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); n_routers = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_assignment_info_router_num, tvb, offset, 4, n_routers); EAT(4); for (i = 0; i < n_routers; i++) { if (length < 12) return length - 12*(n_routers-i)-4-256; te = wccp_add_ipaddress_item(info_tree, hf_assignment_info_router_ip_index, hf_assignment_info_router_ipv4, hf_assignment_info_router_ipv6, tvb, offset, 4, addr_table); element_tree = proto_item_add_subtree(te, ett_router_assignment_element); dissect_wccp2_router_assignment_element(tvb, offset, length , pinfo, element_tree, addr_table); EAT(12); } new_length = dissect_wccp2_hash_buckets_assignment_element(tvb, offset, length, pinfo, info_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); return length; } #define QUERY_INFO_LEN (4+4+4+4) /* 5.5.1 Router Query Info Component */ static gboolean dissect_wccp2_router_query_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { if (length < QUERY_INFO_LEN) return length - QUERY_INFO_LEN; dissect_wccp2_router_identity_element(tvb,offset,pinfo,info_tree, addr_table); EAT_AND_CHECK(8,4); wccp_add_ipaddress_item(info_tree, hf_router_query_info_send_to_ip_index, hf_router_query_info_send_to_ipv4, hf_router_query_info_send_to_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,4); wccp_add_ipaddress_item(info_tree, hf_router_query_info_target_ip_index, hf_router_query_info_target_ipv4, hf_router_query_info_target_ipv6, tvb, offset, 4, addr_table); EAT(4); return length; } /* 6.5 Hash Buckets Assignment Element */ static gint dissect_wccp2_hash_buckets_assignment_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 i,n_web_caches; proto_item *te; proto_tree *element_tree; guint8 bucket; if (length < 4) return length - 4; te = proto_tree_add_item_ret_uint(info_tree, hf_hash_buckets_assignment_wc_num, tvb, offset, 4, ENC_BIG_ENDIAN, &n_web_caches); EAT(4); element_tree = proto_item_add_subtree(te,ett_hash_buckets_assignment_wc_element); for (i = 0; i < n_web_caches; i++) { proto_item *l_te; if (length < 4) return length - 4*(n_web_caches-i)-256; l_te = wccp_add_ipaddress_item(element_tree, hf_hash_buckets_assignment_wc_ip_index, hf_hash_buckets_assignment_wc_ipv4, hf_hash_buckets_assignment_wc_ipv6, tvb, offset, 4, addr_table); proto_item_append_text(l_te, " id: %d", i); EAT(4); } element_tree = proto_tree_add_subtree(info_tree,tvb, offset, 256, ett_hash_buckets_assignment_buckets, NULL, "Buckets"); for (i = 0; i < 256; i++, offset++, length--) { if (length < 1) return length - (256-i); bucket = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(element_tree, hf_bucket, tvb, offset, 1, bucket, "Bucket %3d: %10s", i, assignment_bucket_name(bucket)); } return length; } #define WCCP2_FORWARDING_METHOD_GRE 0x00000001 #define WCCP2_FORWARDING_METHOD_L2 0x00000002 static const capability_flag forwarding_method_flags[] = { { WCCP2_FORWARDING_METHOD_GRE, "IP-GRE", &hf_capability_forwarding_method_flag_gre }, { WCCP2_FORWARDING_METHOD_L2, "L2", &hf_capability_forwarding_method_flag_l2 }, { 0, NULL, NULL } }; #define WCCP2_ASSIGNMENT_METHOD_HASH 0x00000001 #define WCCP2_ASSIGNMENT_METHOD_MASK 0x00000002 static const capability_flag assignment_method_flags[] = { { WCCP2_ASSIGNMENT_METHOD_HASH, "Hash", &hf_capability_assignment_method_flag_hash }, { WCCP2_ASSIGNMENT_METHOD_MASK, "Mask", &hf_capability_assignment_method_flag_mask }, { 0, NULL, NULL } }; #define WCCP2_PACKET_RETURN_METHOD_GRE 0x00000001 #define WCCP2_PACKET_RETURN_METHOD_L2 0x00000002 static const capability_flag packet_return_method_flags[] = { { WCCP2_PACKET_RETURN_METHOD_GRE, "IP-GRE", &hf_capability_return_method_flag_gre }, { WCCP2_PACKET_RETURN_METHOD_L2, "L2", &hf_capability_return_method_flag_l2 }, { 0, NULL, NULL } }; #define WCCP2_COMMAND_TYPE_SHUTDOWN 1 #define WCCP2_COMMAND_TYPE_SHUTDOWN_RESPONSE 2 static const value_string wccp_command_type_vals[] = { { WCCP2_COMMAND_TYPE_SHUTDOWN, "CE shutting down" }, { WCCP2_COMMAND_TYPE_SHUTDOWN_RESPONSE, "Router Acknowledge CE shutdown"}, { 0, NULL } }; /* 5.1.3 Capabilities Info Component */ static gint dissect_wccp2_capability_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table _U_) { gint capability_length; while (length >= 8) { capability_length = dissect_wccp2_capability_element(tvb,offset,length,pinfo,info_tree); CHECK_LENGTH_ADVANCE_OFFSET(capability_length); } return length; } #define ALT_COMMAND_EXTENSION_MIN_LEN (4) /* 5.1.4 && 6.12 Command Extension Component */ static gint dissect_wccp2_command_extension(tvbuff_t *tvb, int offset, int length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table) { guint16 command_type; guint32 command_length; for (;;) { if (length == 0) return length; if (length < ALT_COMMAND_EXTENSION_MIN_LEN ) return length - ALT_COMMAND_EXTENSION_MIN_LEN ; command_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(info_tree, hf_command_element_type, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); proto_tree_add_item_ret_uint(info_tree, hf_command_element_length, tvb, offset, 2, ENC_BIG_ENDIAN, &command_length); proto_tree_add_item(info_tree, hf_command_length, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); if (((command_type == WCCP2_COMMAND_TYPE_SHUTDOWN) || (command_type == WCCP2_COMMAND_TYPE_SHUTDOWN_RESPONSE)) && (command_length == 4)) { if (length < 4) return length - 4; wccp_add_ipaddress_item(info_tree, hf_command_element_shutdown_ip_index, hf_command_element_shutdown_ipv4, hf_command_element_shutdown_ipv6, tvb, offset, 4, addr_table); } else { if (length < (int)command_length) return length - command_length; proto_tree_add_item(info_tree, hf_command_unknown, tvb, offset, command_length, ENC_NA); } EAT(command_length); } } /* 5.1.5 Address Table Component */ /* this function is special as it can be invoked twice during a packet decode: once to get the tables, once to display them */ static gint dissect_wccp2r1_address_table_info(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* wccp_wccp_address_table) { guint16 address_length; guint32 i; gint16 family; guint16 table_length; proto_tree *element_tree; proto_item *tf; if (length < 2*4) return length - 2*4; family = tvb_get_ntohs(tvb, offset); proto_tree_add_item(info_tree, hf_address_table_family, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); address_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(info_tree, hf_address_table_address_length, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); table_length = tvb_get_ntohl(tvb, offset); tf = proto_tree_add_item(info_tree, hf_address_table_length, tvb, offset, 4, ENC_BIG_ENDIAN); element_tree = proto_item_add_subtree(tf, ett_table_element); EAT(4); if (wccp_wccp_address_table->in_use == FALSE) { wccp_wccp_address_table->family = family; wccp_wccp_address_table->table_length = table_length; /* check if the length is valid and allocate the tables if needed */ switch (wccp_wccp_address_table->family) { case 1: if (wccp_wccp_address_table->table_ipv4 == NULL) wccp_wccp_address_table->table_ipv4 = (guint32 *) wmem_alloc0(pinfo->pool, wccp_wccp_address_table->table_length * 4); if (address_length != 4) { expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The Address length must be 4, but I found %d for IPv4 addresses. Correcting this.", address_length); address_length = 4; } break; case 2: if (wccp_wccp_address_table->table_ipv6 == NULL) wccp_wccp_address_table->table_ipv6 = (ws_in6_addr *) wmem_alloc0(pinfo->pool, wccp_wccp_address_table->table_length * sizeof(ws_in6_addr)); if (address_length != 16) { expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The Address length must be 16, but I found %d for IPv6 addresses. Correcting this.", address_length); address_length = 16; } break; default: expert_add_info_format(pinfo, tf, &ei_wccp_address_table_family_unknown, "Unknown address family: %d", wccp_wccp_address_table->family); }; } /* now read the addresses and print/store them */ for(i=0; i<table_length; i++) { const gchar *addr; switch (family) { case 1: /* IPv4 */ addr = tvb_ip_to_str(pinfo->pool, tvb, offset); if ((wccp_wccp_address_table->in_use == FALSE) && (wccp_wccp_address_table->table_ipv4 != NULL) && (i < wccp_wccp_address_table->table_length)) wccp_wccp_address_table->table_ipv4[i] = tvb_get_ipv4(tvb, offset); break; case 2: /* IPv6 */ addr = tvb_ip6_to_str(pinfo->pool, tvb, offset); if ((wccp_wccp_address_table->in_use == FALSE) && (wccp_wccp_address_table->table_ipv6 != NULL) && (i < wccp_wccp_address_table->table_length)) tvb_get_ipv6(tvb, offset, &(wccp_wccp_address_table->table_ipv6[i])); break; default: addr = wmem_strdup_printf(wmem_packet_scope(), "unknown family %d", wccp_wccp_address_table->family); }; if (element_tree) { proto_item *pi; pi = proto_tree_add_string_format_value(element_tree, hf_address_table_element, tvb, offset, address_length, addr, "%d: %s", i+1, addr); if (i > wccp_wccp_address_table->table_length) expert_add_info_format(pinfo, pi, &ei_wccp_length_bad, "Ran out of space to store address"); } EAT(address_length); } wccp_wccp_address_table->in_use = TRUE; return length; } #define HASH_ASSIGNMENT_INFO_MIN_LEN (4+256) /* part of 5.6.11 Alternate Assignment Component */ static gint dissect_wccp2_hash_assignment_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint32 n_web_caches, host_addr; guint i; guint8 bucket; if (length < HASH_ASSIGNMENT_INFO_MIN_LEN) return length - ASSIGNMENT_INFO_MIN_LEN; proto_tree_add_item_ret_uint(info_tree, hf_wc_view_wc_num, tvb, offset, 4, ENC_BIG_ENDIAN, &n_web_caches); EAT(4); for (i = 0; i < n_web_caches; i++) { if (length < 4) return length - 4*(n_web_caches-i)-256; host_addr = tvb_get_ntohl(tvb,offset); if (! addr_table->in_use){ proto_tree_add_ipv4_format(info_tree, hf_cache_ip, tvb, offset, 4, host_addr, "Web-Cache %d: IP address %s", i, decode_wccp_encoded_address(tvb, offset, pinfo, info_tree, addr_table)); } else { proto_tree_add_uint_format(info_tree, hf_web_cache_identity_index, tvb, offset, 4, host_addr, "Web-Cache %d: IP address %s", i, decode_wccp_encoded_address(tvb, offset, pinfo, info_tree, addr_table)); } EAT(4); } for (i = 0; i < 256; i++, offset++, length--) { if (length < 1) return length - (256-i); bucket = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(info_tree, hf_bucket, tvb, offset, 1, bucket, "Bucket %3d: %10s", i, assignment_bucket_name(bucket)); } return length; } /* 5.3.3 Assignment Map Component */ static gint dissect_wccp2_assignment_map(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { gint new_length; new_length=dissect_wccp2_mask_value_set_list(tvb, offset, length, pinfo, info_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); return length; } #define ALT_ASSIGNMENT_MAP_MIN_LEN (4) /* 5.3.4 Alternate Assignment Map Component */ static gint dissect_wccp2r1_alt_assignment_map_info(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint16 assignment_type; guint16 assignment_length; proto_item *tf=NULL; if (length < ALT_ASSIGNMENT_MAP_MIN_LEN ) return length - ALT_ASSIGNMENT_MAP_MIN_LEN ; assignment_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(info_tree, hf_alt_assignment_map_assignment_type, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); assignment_length = tvb_get_ntohs(tvb, offset); tf=proto_tree_add_item(info_tree, hf_alt_assignment_map_assignment_length, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); if (length < assignment_length) expert_add_info_format(pinfo, tf, &ei_wccp_assignment_length_bad, "Assignment length is %d but only %d remain in the packet. Ignoring this for now", assignment_length, length); if (length > assignment_length) { expert_add_info_format(pinfo, tf, &ei_wccp_assignment_length_bad, "Assignment length is %d but %d remain in the packet. Assuming that the assignment length is wrong and setting it to %d.", assignment_length, length, length); assignment_length = length; } switch (assignment_type) { case WCCP2_HASH_ASSIGNMENT_TYPE: return dissect_wccp2_assignment_info(tvb, offset, assignment_length, pinfo, info_tree, addr_table); case WCCP2_MASK_ASSIGNMENT_TYPE: return dissect_wccp2_mask_value_set_list(tvb, offset, assignment_length, pinfo, info_tree, addr_table); case WCCP2r1_ALT_MASK_ASSIGNMENT_TYPE: return dissect_wccp2_alternate_mask_value_set_list(tvb, offset, assignment_length, pinfo, info_tree, addr_table); default: return length; } } /* 6.6 Hash Assignment Data Element */ static gint dissect_wccp2_hash_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree) { proto_tree *bucket_tree; int i; guint8 bucket_info; int n; bucket_tree = proto_tree_add_subtree(info_tree, tvb, offset, 8*4, ett_hash_assignment_buckets, NULL, "Hash Assignment Data"); for (i = 0, n = 0; i < 32; i++) { if (length == 0) { return -i-2-2; } bucket_info = tvb_get_guint8(tvb, offset); n = wccp_bucket_info(bucket_info, bucket_tree, n, tvb, offset); EAT(1); } if (length < 2){ return -2-2; } return dissect_wccp2_assignment_weight_and_status_element(tvb, offset, length, pinfo, info_tree); } /* 6.7 Mask Assignment Data Element */ static gint dissect_wccp2_mask_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *mask_item; proto_tree *mask_tree; gint new_length,start; mask_tree = proto_tree_add_subtree(info_tree, tvb, offset, 4, ett_mask_assignment_data_element, &mask_item, "Mask Assignment Data"); start = offset; new_length=dissect_wccp2_mask_value_set_list(tvb, offset, length, pinfo, mask_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); if (length < 2) return length-4; new_length = dissect_wccp2_assignment_weight_and_status_element(tvb, offset, length, pinfo, info_tree); CHECK_LENGTH_ADVANCE_OFFSET(new_length); proto_item_set_len(mask_item, offset-start); return length; } /* 5.7.5 Alternate Mask Assignment Data Element */ static gint dissect_wccp2_alternate_mask_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_tree *mask_tree; mask_tree = proto_tree_add_subtree(info_tree, tvb, offset, length, ett_alternate_mask_assignment_data_element, NULL, "Alternate Mask Assignment Data"); if (length < 4) return length-4; if (length > 4) for (;length >4;) { gint new_length; new_length=dissect_wccp2_alternate_mask_value_set_list(tvb, offset, length, pinfo, mask_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); } if (length < 2) return -2; return dissect_wccp2_assignment_weight_and_status_element(tvb, offset, length, pinfo, info_tree); } /* 6.9 Assignment Weight and Status Data Element */ static gint dissect_wccp2_assignment_weight_and_status_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree) { if (length < 4) return length - 4; proto_tree_add_item(info_tree, hf_assignment_weight, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); proto_tree_add_item(info_tree, hf_assignment_status, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); return length; } /* 6.10 Extended Assignment Data Element */ static gint dissect_wccp2_extended_assignment_data_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *element_item, *header; proto_tree *item_tree; guint type_of_assignment; gint assignment_length; if (length < 4) return length-4; item_tree = proto_tree_add_subtree(info_tree, tvb, offset, length, ett_extended_assigment_data_element, &header, "Extended Assignment Data Element"); type_of_assignment = tvb_get_ntohs(tvb, offset); proto_tree_add_item(item_tree, hf_extended_assignment_data_type, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); assignment_length = tvb_get_ntohs(tvb,offset); element_item = proto_tree_add_item(item_tree, hf_extended_assignment_data_length, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); if (length < assignment_length) expert_add_info_format(pinfo, element_item, &ei_wccp_assignment_length_bad, "Assignment length is %d but only %d remain in the packet. Ignoring this for now", assignment_length, length); /* Now a common bug seems to be to set the assignment_length to the length -4 check for this */ if ((length > assignment_length) && (length == (assignment_length + 4))) { expert_add_info_format(pinfo, element_item, &ei_wccp_assignment_length_bad, "Assignment length is %d but %d remain in the packet. Assuming that this is wrong as this is only 4 bytes too small, proceeding with the assumption it is %d", assignment_length, length, length); assignment_length = length; } proto_item_set_len(header, assignment_length+4); switch (type_of_assignment) { case WCCP2_HASH_ASSIGNMENT_TYPE: dissect_wccp2_hash_assignment_data_element(tvb, offset, assignment_length, pinfo, item_tree); return length - assignment_length; case WCCP2_MASK_ASSIGNMENT_TYPE: dissect_wccp2_mask_assignment_data_element(tvb, offset, assignment_length, pinfo, item_tree, addr_table); return length - assignment_length; case WCCP2r1_ALT_MASK_ASSIGNMENT_TYPE: dissect_wccp2_alternate_mask_assignment_data_element(tvb, offset, assignment_length, pinfo, item_tree, addr_table); return length - assignment_length; case WCCP2r1_ASSIGNMENT_WEIGHT_STATUS: dissect_wccp2_assignment_weight_and_status_element(tvb, offset, assignment_length, pinfo, item_tree); return length - assignment_length; } return length; } /* 6.11 Capability Element */ static gint dissect_wccp2_capability_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree) { guint16 capability_type; guint16 capability_val_len; proto_item *te, *header, *tf; proto_tree *element_tree; if (length < 4) return length - 4; capability_type = tvb_get_ntohs(tvb, offset); element_tree = proto_tree_add_subtree_format(info_tree, tvb, offset, -1, ett_capability_element, &te, "Type: %s", val_to_str(capability_type, capability_type_vals, "Unknown (0x%08X)")); header = te; proto_tree_add_item(element_tree, hf_capability_element_type, tvb, offset, 2, ENC_BIG_ENDIAN); capability_val_len = tvb_get_ntohs(tvb, offset+2); tf = proto_tree_add_uint(element_tree, hf_capability_element_length, tvb, offset+2, 2, capability_val_len); proto_item_set_len(te, capability_val_len + 4); if (length < (4+capability_val_len)) return length - (4 + capability_val_len); switch (capability_type) { case WCCP2_FORWARDING_METHOD: dissect_32_bit_capability_flags(tvb, offset, capability_val_len, ett_capability_forwarding_method, forwarding_method_flags, element_tree, header, tf, pinfo); break; case WCCP2_ASSIGNMENT_METHOD: dissect_32_bit_capability_flags(tvb, offset, capability_val_len, ett_capability_assignment_method, assignment_method_flags, element_tree, header, tf, pinfo); break; case WCCP2_PACKET_RETURN_METHOD: dissect_32_bit_capability_flags(tvb, offset, capability_val_len, ett_capability_return_method, packet_return_method_flags, element_tree, header, tf, pinfo); break; case WCCP2_TRANSMIT_T: dissect_transmit_t_capability(tvb, te, offset, capability_val_len, ett_capability_transmit_t, element_tree, tf, pinfo); break; case WCCP2_TIMER_SCALE: dissect_timer_scale_capability(tvb, offset, capability_val_len, ett_capability_timer_scale, element_tree, tf, pinfo); break; default: proto_tree_add_item(element_tree, hf_capability_value, tvb, offset, capability_val_len, ENC_NA); break; } return length - 4 - capability_val_len; } /* 6.13 Mask/Value Set List */ static gint dissect_wccp2_mask_value_set_list(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint num_of_elem; guint i; proto_item *te; proto_tree *element_tree; guint start; if (length < 4) return length - 4; element_tree = proto_tree_add_subtree(info_tree, tvb, offset, 4, ett_mv_set_list, &te, "Mask/Value Set List"); start = offset; num_of_elem = tvb_get_ntohl(tvb, offset); proto_tree_add_item(element_tree, hf_mask_value_set_list_num_elements, tvb, offset, 4, ENC_BIG_ENDIAN); /* proto_tree_add_uint(element_tree, , tvb, offset, 4, num_of_elem); */ EAT(4); for (i = 0; i < num_of_elem; i++) { gint new_length; new_length=dissect_wccp2_mask_value_set_element(tvb, offset, length, i, pinfo, element_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); } proto_item_set_len(te, offset-start); return length; } /* 6.15 Mask Element */ static gint dissect_wccp2_mask_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree) { if (length < 2) return length-12; proto_tree_add_item(info_tree, hf_mask_element_src_ip, tvb, offset, 4, ENC_BIG_ENDIAN); EAT_AND_CHECK(4,4); proto_tree_add_item(info_tree, hf_mask_element_dest_ip, tvb, offset, 4, ENC_BIG_ENDIAN); EAT_AND_CHECK(4,2); proto_tree_add_item(info_tree, hf_mask_element_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); proto_tree_add_item(info_tree, hf_mask_element_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); return length; } /* 6.17 Alternate Mask/Value Set List */ static gint dissect_wccp2_alternate_mask_value_set_list(tvbuff_t *tvb, int offset, int length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_tree *list_tree; guint num_of_val_elements; guint i; if (length < 4) return length - 4; list_tree = proto_tree_add_subtree(info_tree, tvb, offset, length, ett_alternate_mask_value_set, NULL, "Alternate Mask/Value Set List"); num_of_val_elements = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(list_tree, hf_alt_assignment_mask_value_set_list_num_elements, tvb, offset, 4, num_of_val_elements); EAT(4); for(i=0;i<num_of_val_elements;i++) { gint new_length; new_length=dissect_wccp2_alternate_mask_value_set_element(tvb, offset, length, i, pinfo, list_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); } return length; } /* 6.18 Alternate Mask/Value Set Element */ static gint dissect_wccp2_alternate_mask_value_set_element(tvbuff_t *tvb, int offset, gint length, guint el_index, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *tl, *header; proto_tree *element_tree, *value_tree; guint number_of_elements; gint new_length, total_length; guint i; element_tree = proto_tree_add_subtree_format(info_tree, tvb, offset, 0, ett_alternate_mask_value_set_element, &header, "Alternate Mask/Value Set Element(%d)", el_index); total_length = 0; new_length=dissect_wccp2_mask_element(tvb,offset,length,pinfo,element_tree); total_length += length - new_length; CHECK_LENGTH_ADVANCE_OFFSET(new_length); if (length < 4) return length - 4; number_of_elements = tvb_get_ntohl(tvb, offset); tl = proto_tree_add_uint(element_tree, hf_alt_assignment_mask_value_set_element_num_wc_value_elements, tvb, offset, 4, number_of_elements); value_tree = proto_item_add_subtree(tl, ett_alternate_mv_set_element_list); total_length += 4; EAT(4); /* XXX Add a bounds check for number_of_elements? */ for (i=0; i < number_of_elements; i++) { new_length=dissect_wccp2_web_cache_value_element(tvb, offset, length, pinfo, value_tree, addr_table); total_length += length - new_length; CHECK_LENGTH_ADVANCE_OFFSET(new_length); } proto_item_set_len(header, total_length); return length; } /* 6.19 Web-Cache Value Element */ static gint dissect_wccp2_web_cache_value_element(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo _U_, proto_tree *info_tree, wccp_address_table* addr_table) { guint number_of_elements, seq_num; proto_item *tl; proto_tree *element_tree; guint i; if (length < 4) return length - 8; tl = wccp_add_ipaddress_item(info_tree, hf_web_cache_value_element_wc_address_index, hf_web_cache_value_element_wc_address_ipv4, hf_web_cache_value_element_wc_address_ipv6, tvb, offset, 4, addr_table); element_tree = proto_item_add_subtree(tl, ett_web_cache_value_element_list); EAT_AND_CHECK(4,4); number_of_elements = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(element_tree, hf_web_cache_value_element_num_values, tvb, offset, 4, number_of_elements); EAT(4); for (i=0; i < number_of_elements; i++) { if (length < 4) return length - 4*(number_of_elements-i); seq_num = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format(element_tree, hf_web_cache_value_seq_num, tvb, offset, 4, seq_num, "Value Sequence Number %d: %x", i+1, seq_num); EAT(4); } return length; } /* End of standard functions */ static void dissect_32_bit_capability_flags(tvbuff_t *tvb, int curr_offset, guint16 capability_val_len, gint ett, const capability_flag *flags, proto_tree *element_tree, proto_item *header, proto_item *length_item, packet_info *pinfo) { guint32 capability_val; proto_item *tm; proto_tree *method_tree; int i; gboolean first = TRUE; if (capability_val_len != 4) { expert_add_info_format(pinfo, length_item, &ei_wccp_capability_element_length, "Value Length: %u (illegal, must be == 4)", capability_val_len); return; } capability_val = tvb_get_ntohl(tvb, curr_offset + 4); tm = proto_tree_add_uint(element_tree, hf_capability_info_value, tvb, curr_offset + 4, 4, capability_val); for (i = 0; flags[i].short_name != NULL; i++) { if (capability_val & flags[i].value) { if (first) { proto_item_append_text( tm, " (%s", flags[i].short_name); proto_item_append_text( header, " (%s", flags[i].short_name); first = FALSE; } else { proto_item_append_text( tm, ", %s", flags[i].short_name); proto_item_append_text( header, " (%s", flags[i].short_name); } } } if (first == FALSE) { proto_item_append_text( tm, ")"); proto_item_append_text( header, ")"); } method_tree = proto_item_add_subtree(tm, ett); for (i = 0; flags[i].phf != NULL; i++) proto_tree_add_item(method_tree, *(flags[i].phf), tvb, curr_offset+4, 4, ENC_BIG_ENDIAN); } /* 6.11.4 Capability Type WCCP2_TRANSMIT_T */ static void dissect_transmit_t_capability(tvbuff_t *tvb, proto_item *te, int curr_offset, guint16 capability_val_len, gint ett, proto_tree *element_tree, proto_item *length_item, packet_info *pinfo) { guint16 upper_limit, lower_limit; proto_tree *method_tree; if (capability_val_len != 4) { expert_add_info_format(pinfo, length_item, &ei_wccp_capability_element_length, "Value Length: %u (illegal, must be == 4)", capability_val_len); return; } upper_limit = tvb_get_ntohs(tvb, curr_offset); lower_limit = tvb_get_ntohs(tvb, curr_offset + 2); if ( upper_limit == 0) { method_tree = proto_tree_add_subtree(element_tree, tvb, curr_offset, 2, ett, NULL, "Only accepting one value"); proto_tree_add_uint(method_tree, hf_reserved_zero, tvb, curr_offset, 2, upper_limit); proto_tree_add_item(method_tree, hf_capability_transmit_t , tvb, curr_offset+2, 2, ENC_BIG_ENDIAN); proto_item_append_text(te, " %d ms", lower_limit); } else { method_tree = proto_tree_add_subtree(element_tree, tvb, curr_offset, 2, ett, NULL, "Accepting a range"); proto_tree_add_item(method_tree, hf_capability_transmit_t_upper_limit, tvb, curr_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(method_tree, hf_capability_transmit_t_lower_limit, tvb, curr_offset+2, 2, ENC_BIG_ENDIAN); proto_item_append_text(te, " < %d ms > %d ms", lower_limit, upper_limit); } } static void dissect_timer_scale_capability(tvbuff_t *tvb, int curr_offset, guint16 capability_val_len, gint ett, proto_tree *element_tree, proto_item *length_item, packet_info *pinfo) { guint8 a,c; proto_tree *method_tree; if (capability_val_len != 4) { expert_add_info_format(pinfo, length_item, &ei_wccp_capability_element_length, "Value Length: %u (illegal, must be == 4)", capability_val_len); return; } a = tvb_get_guint8(tvb, curr_offset); c = tvb_get_guint8(tvb, curr_offset+2); if ( a == 0) { if ( c == 0) { method_tree = proto_tree_add_subtree(element_tree, tvb, curr_offset, 2, ett, NULL, "Only accepting one value"); proto_tree_add_uint(method_tree, hf_reserved_zero, tvb, curr_offset, 1, a); proto_tree_add_item(method_tree, hf_capability_timer_scale_timeout_scale, tvb, curr_offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(method_tree, hf_reserved_zero, tvb, curr_offset+2, 1, c); proto_tree_add_item(method_tree, hf_capability_timer_scale_ra_timer_scale, tvb, curr_offset+3, 1, ENC_BIG_ENDIAN); } else { proto_tree_add_expert(element_tree, pinfo, &ei_wccp_a_zero_not_c, tvb, curr_offset, 1); } } else { if ( c == 0) { proto_tree_add_expert(element_tree, pinfo, &ei_wccp_a_zero_not_c, tvb, curr_offset, 1); } else { method_tree = proto_tree_add_subtree(element_tree, tvb, curr_offset, 2, ett, NULL, "Accepting a range"); proto_tree_add_item(method_tree, hf_capability_timer_scale_timeout_scale_upper_limit, tvb, curr_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(method_tree, hf_capability_timer_scale_timeout_scale_lower_limit, tvb, curr_offset+1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(method_tree, hf_capability_timer_scale_ra_scale_upper_limit, tvb, curr_offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(method_tree, hf_capability_timer_scale_ra_scale_lower_limit, tvb, curr_offset+3, 1, ENC_BIG_ENDIAN); } } } /* 6.16 Value Element */ static gint dissect_wccp2_value_element(tvbuff_t *tvb, int offset, gint length, int idx, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_tree *element_tree; if (length < 4) return length - 16; element_tree = proto_tree_add_subtree_format(info_tree, tvb, offset, 16, ett_value_element, NULL, "Value Element(%u) %s", idx,decode_wccp_encoded_address(tvb, offset+4+4+2+2, pinfo, info_tree, addr_table)); wccp_add_ipaddress_item(info_tree, hf_value_element_src_ip_index, hf_value_element_src_ipv4, hf_value_element_src_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,4); wccp_add_ipaddress_item(info_tree, hf_value_element_dest_ip_index, hf_value_element_dest_ipv4, hf_value_element_dest_ipv6, tvb, offset, 4, addr_table); EAT_AND_CHECK(4,2); proto_tree_add_item(element_tree, hf_value_element_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); proto_tree_add_item(element_tree, hf_value_element_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,4); wccp_add_ipaddress_item(info_tree, hf_value_element_web_cache_ip_index, hf_value_element_web_cache_ipv4, hf_value_element_web_cache_ipv6, tvb, offset, 4, addr_table); EAT(4); return length; } /* 6.14 Mask/Value Set Element */ static gint dissect_wccp2_mask_value_set_element(tvbuff_t *tvb, int offset, gint length, int idx, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { proto_item *tl, *te; proto_tree *element_tree, *value_tree; guint num_of_val_elements; guint i; gint new_length; element_tree = proto_tree_add_subtree_format(info_tree, tvb, offset, 0, ett_mv_set_element, &tl, "Mask/Value Set Element(%d)", idx); new_length = dissect_wccp2_mask_element(tvb,offset,length,pinfo,element_tree); CHECK_LENGTH_ADVANCE_OFFSET(new_length); if (length < 4) return length-4; num_of_val_elements = tvb_get_ntohl(tvb, offset); te = proto_tree_add_uint(element_tree, hf_mask_value_set_element_value_element_num, tvb, offset, 4, num_of_val_elements); value_tree = proto_item_add_subtree(te, ett_mv_set_value_list); EAT(4); for (i = 0; i < num_of_val_elements; i++) { new_length=dissect_wccp2_value_element(tvb, offset, length, i, pinfo, value_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); } proto_item_set_len(tl, 16+num_of_val_elements*16); return length; } #define ALT_ASSIGNMENT_INFO_MIN_LEN (4+4) /* 5.4.2 Alternate Assignment Component */ static gint dissect_wccp2_alternate_assignment_info(tvbuff_t *tvb, int offset, gint length, packet_info *pinfo, proto_tree *info_tree, wccp_address_table* addr_table) { guint16 assignment_type; guint16 assignment_length; proto_item *tf=NULL; guint32 n_routers; guint i; proto_tree *element_tree; gint new_length; if (length < ALT_ASSIGNMENT_INFO_MIN_LEN) return length - ALT_ASSIGNMENT_INFO_MIN_LEN; assignment_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(info_tree, hf_alt_assignment_info_assignment_type, tvb, offset, 2, ENC_BIG_ENDIAN); EAT_AND_CHECK(2,2); assignment_length = tvb_get_ntohs(tvb, offset); tf=proto_tree_add_item(info_tree, hf_alt_assignment_info_assignment_length, tvb, offset, 2, ENC_BIG_ENDIAN); EAT(2); if (length < assignment_length) expert_add_info_format(pinfo, tf, &ei_wccp_assignment_length_bad, "Assignment length is %d but only %d remain in the packet. Ignoring this for now", assignment_length, length); if (length > assignment_length) { expert_add_info_format(pinfo, tf, &ei_wccp_assignment_length_bad, "Assignment length is %d but %d remain in the packet. Assuming that the assignment length is wrong and setting it to %d.", assignment_length, length, length); } new_length=dissect_wccp2_assignment_key_element(tvb, offset, length, pinfo, info_tree, addr_table); CHECK_LENGTH_ADVANCE_OFFSET(new_length); n_routers = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(info_tree, hf_alt_assignment_info_num_routers, tvb, offset, 4, n_routers); EAT(4); for (i = 0; i < n_routers; i++) { if (length < 12) return length - 12*(n_routers-i); element_tree = proto_tree_add_subtree_format(info_tree, tvb, offset, 12, ett_router_alt_assignment_element, NULL, "Router %d Assignment Element: IP address %s", i, decode_wccp_encoded_address(tvb, offset, pinfo, info_tree, addr_table)); dissect_wccp2_router_assignment_element(tvb, offset, length , pinfo, element_tree, addr_table); EAT(12); } switch (assignment_type) { case WCCP2_HASH_ASSIGNMENT_TYPE: return dissect_wccp2_hash_assignment_info(tvb, offset, length, pinfo, info_tree, addr_table); case WCCP2_MASK_ASSIGNMENT_TYPE: return dissect_wccp2_mask_value_set_list(tvb, offset, length, pinfo, info_tree, addr_table); case WCCP2r1_ALT_MASK_ASSIGNMENT_TYPE: return dissect_wccp2_alternate_mask_value_set_list(tvb, offset, length, pinfo, info_tree, addr_table); default: return length; } } static void dissect_wccp2_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *wccp_tree, guint32 message_type) { guint16 type; guint16 item_length; proto_item *tf; proto_tree *info_tree; gint ett; gint (*dissector)(tvbuff_t *, int, int, packet_info *, proto_tree *, wccp_address_table*); /* check if all required fields are there */ gboolean wccp2_security_info; gboolean wccp2_service_info; gboolean wccp2_router_id_info; gboolean wccp2_wc_id_info; gboolean wccp2_rtr_view_info; gboolean wccp2_wc_view_info; gboolean wccp2_redirect_assignment; gboolean wccp2_query_info; gboolean wccp2_capabilities_info; gboolean wccp2_alt_assignment; gboolean wccp2_assign_map; gboolean wccp2_command_extension; gboolean wccp2r1_alt_assignment_map; wccp_address_table wccp_wccp_address_table = {FALSE, -1, -1, 0, NULL, NULL}; wccp2_security_info=FALSE; wccp2_service_info=FALSE; wccp2_router_id_info=FALSE; wccp2_wc_id_info=FALSE; wccp2_rtr_view_info=FALSE; wccp2_wc_view_info=FALSE; wccp2_redirect_assignment=FALSE; wccp2_query_info=FALSE; wccp2_capabilities_info=FALSE; wccp2_alt_assignment=FALSE; wccp2_assign_map=FALSE; wccp2_command_extension=FALSE; wccp2r1_alt_assignment_map=FALSE; /* ugly hack: we first need to check for the address table component, otherwise we cannot print the IP's. */ find_wccp_address_table(tvb,offset,pinfo,wccp_tree, &wccp_wccp_address_table); while (tvb_reported_length_remaining(tvb, offset) > 0) { type = tvb_get_ntohs(tvb, offset); switch (type) { case WCCP2_SECURITY_INFO: wccp2_security_info=TRUE; ett = ett_security_info; dissector = dissect_wccp2_security_info; break; case WCCP2_SERVICE_INFO: wccp2_service_info=TRUE; ett = ett_service_info; dissector = dissect_wccp2_service_info; break; case WCCP2_ROUTER_ID_INFO: wccp2_router_id_info=TRUE; ett = ett_router_identity_info; dissector = dissect_wccp2_router_identity_info; break; case WCCP2_WC_ID_INFO: wccp2_wc_id_info=TRUE; ett = ett_wc_identity_info; dissector = dissect_wccp2_wc_identity_info; break; case WCCP2_RTR_VIEW_INFO: wccp2_rtr_view_info=TRUE; ett = ett_router_view_info; dissector = dissect_wccp2_router_view_info; break; case WCCP2_WC_VIEW_INFO: wccp2_wc_view_info=TRUE; ett = ett_wc_view_info; dissector = dissect_wccp2_web_cache_view_info; break; case WCCP2_REDIRECT_ASSIGNMENT: wccp2_redirect_assignment=TRUE; ett = ett_router_assignment_info; dissector = dissect_wccp2_assignment_info; break; case WCCP2_QUERY_INFO: wccp2_query_info=TRUE; ett = ett_query_info; dissector = dissect_wccp2_router_query_info; break; case WCCP2_CAPABILITIES_INFO: wccp2_capabilities_info=TRUE; ett = ett_capabilities_info; dissector = dissect_wccp2_capability_info; break; case WCCP2_ALT_ASSIGNMENT: wccp2_alt_assignment=TRUE; ett = ett_alt_assignment_info; dissector = dissect_wccp2_alternate_assignment_info; break; case WCCP2r1_ALT_ASSIGNMENT_MAP: wccp2r1_alt_assignment_map=TRUE; ett = ett_alt_assignment_map; dissector = dissect_wccp2r1_alt_assignment_map_info; break; case WCCP2r1_ADDRESS_TABLE: ett = ett_address_table; dissector = dissect_wccp2r1_address_table_info; break; case WCCP2_ASSIGN_MAP: wccp2_assign_map=TRUE; ett = ett_assignment_map; dissector = dissect_wccp2_assignment_map; break; case WCCP2_COMMAND_EXTENSION: wccp2_command_extension=TRUE; ett = ett_command_extension; dissector = dissect_wccp2_command_extension; break; default: ett = ett_unknown_info; dissector = NULL; break; } info_tree = proto_tree_add_subtree(wccp_tree, tvb, offset, -1, ett, &tf, val_to_str(type, info_type_vals, "Unknown info type (%u)")); proto_tree_add_item(info_tree, hf_item_type, tvb, offset, 2, ENC_BIG_ENDIAN); item_length = tvb_get_ntohs(tvb, offset+2); proto_tree_add_item(info_tree, hf_item_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); offset += 4; if (dissector != NULL) { gint remaining_item_length = (*dissector)(tvb, offset, item_length, pinfo, info_tree, &wccp_wccp_address_table); /* warn if we left bytes */ if (remaining_item_length > 0) expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The item is %d bytes too long", remaining_item_length); /* error if we needed more bytes */ if (remaining_item_length < 0) expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The item is %d bytes too short", -remaining_item_length); /* we assume that the item length is correct and jump forward */ } else { proto_tree_add_item(info_tree, hf_item_data, tvb, offset, item_length, ENC_NA); } offset += item_length; proto_item_set_end(tf, tvb, offset); } /* we're done. Check if we got all the required components */ switch (message_type) { case WCCP2_HERE_I_AM: if (!wccp2_security_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_security_info); if (!wccp2_service_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_service_info); if (wccp2_router_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_router_id_info); if (!wccp2_wc_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_wc_id_info); if (wccp2_rtr_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_rtr_view_info); if (!wccp2_wc_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_wc_view_info); if (wccp2_redirect_assignment) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_redirect_assignment); if (wccp2_query_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_query_info); if (wccp2_alt_assignment) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_alt_assignment); if (wccp2_assign_map) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_assign_map); if (wccp2r1_alt_assignment_map) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_alt_assignment_map); break; case WCCP2_I_SEE_YOU: if (!wccp2_security_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_security_info); if (!wccp2_service_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_service_info); if (!wccp2_router_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_router_id_info); if (wccp2_wc_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_id_info); if (!wccp2_rtr_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_rtr_view_info); if (wccp2_wc_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_view_info); if (wccp2_redirect_assignment) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_redirect_assignment); if (wccp2_query_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_query_info); if (wccp2r1_alt_assignment_map) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_alt_assignment_map); break; case WCCP2_REMOVAL_QUERY: if (!wccp2_security_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_security_info); if (!wccp2_service_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_service_info); if (wccp2_router_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_router_id_info); if (wccp2_wc_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_id_info); if (wccp2_rtr_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_rtr_view_info); if (wccp2_wc_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_view_info); if (wccp2_redirect_assignment) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_redirect_assignment); if (!wccp2_query_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_query_info); if (wccp2_capabilities_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_capabilities_info); if (wccp2_alt_assignment) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_alt_assignment); if (wccp2_assign_map) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_assign_map); if (wccp2_command_extension) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_command_extension); if (wccp2r1_alt_assignment_map) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_alt_assignment_map); break; case WCCP2_REDIRECT_ASSIGN: if (!wccp2_security_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_security_info); if (!wccp2_service_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_service_info); if (wccp2_router_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_router_id_info); if (wccp2_wc_id_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_id_info); if (wccp2_rtr_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_rtr_view_info); if (wccp2_wc_view_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_wc_view_info); if (wccp2_query_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_query_info); if (wccp2_capabilities_info) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_capabilities_info); if (! (wccp2_assign_map || wccp2r1_alt_assignment_map || wccp2_alt_assignment || wccp2_redirect_assignment)) expert_add_info(pinfo, wccp_tree, &ei_wccp_missing_assignment); if (wccp2_command_extension) expert_add_info(pinfo, wccp_tree, &ei_wccp_contains_command_extension); break; } } static int dissect_wccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { int offset = 0; proto_tree *wccp_tree = NULL; proto_item *wccp_tree_item; guint32 wccp_message_type; guint16 length; gint wccp2_length; proto_item *length_item; guint32 cache_count; guint32 ipaddr; guint i; guint8 bucket; wccp_message_type = tvb_get_ntohl(tvb, offset); /* Check if this is really a WCCP message */ if (try_val_to_str(wccp_message_type, wccp_type_vals) == NULL) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WCCP"); col_add_str(pinfo->cinfo, COL_INFO, val_to_str(wccp_message_type, wccp_type_vals, "Unknown WCCP message (%u)")); wccp_tree_item = proto_tree_add_item(tree, proto_wccp, tvb, offset, -1, ENC_NA); wccp_tree = proto_item_add_subtree(wccp_tree_item, ett_wccp); proto_tree_add_uint(wccp_tree, hf_wccp_message_type, tvb, offset, 4, wccp_message_type); offset += 4; switch (wccp_message_type) { case WCCP_HERE_I_AM: proto_tree_add_item(wccp_tree, hf_wccp_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset = dissect_hash_data(tvb, offset, wccp_tree); proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset, 4, ENC_BIG_ENDIAN); /*offset += 4;*/ break; case WCCP_I_SEE_YOU: proto_tree_add_item(wccp_tree, hf_wccp_version, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wccp_tree, hf_change_num, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; cache_count = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(wccp_tree, hf_wc_num, tvb, offset, 4, cache_count); offset += 4; for (i = 0; i < cache_count; i++) { offset = dissect_web_cache_list_entry(tvb, offset, i, wccp_tree); } break; case WCCP_ASSIGN_BUCKET: /* * This hasn't been tested, since I don't have any * traces with this in it. * * The V1 spec claims that this does, indeed, * have a Received ID field after the type, * rather than a Version field. */ proto_tree_add_item(wccp_tree, hf_recvd_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; cache_count = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(wccp_tree, hf_wc_num, tvb, offset, 4, cache_count); offset += 4; for (i = 0; i < cache_count; i++) { ipaddr = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4_format(wccp_tree, hf_cache_ip, tvb, offset, 4, ipaddr, "Web Cache %d IP Address: %s", i, tvb_ip_to_str(pinfo->pool, tvb, offset)); offset += 4; } for (i = 0; i < 256; i++) { bucket = tvb_get_guint8(tvb, offset); if (bucket == 0xff) { proto_tree_add_uint_format(wccp_tree, hf_bucket, tvb, offset, 1, bucket, "Bucket %d: Unassigned", i); } else { proto_tree_add_uint_format(wccp_tree, hf_bucket, tvb, offset, 1, bucket, "Bucket %d: %d", i, bucket); } offset++; } break; case WCCP2_HERE_I_AM: case WCCP2_I_SEE_YOU: case WCCP2_REMOVAL_QUERY: case WCCP2_REDIRECT_ASSIGN: default: /* assume unknown packets are v2 */ /* 5.5 WCCP Message Header */ proto_tree_add_item(wccp_tree, hf_message_header_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length = tvb_get_ntohs(tvb, offset); length_item = proto_tree_add_uint(wccp_tree, hf_message_header_length, tvb, offset, 2, length); offset += 2; /* Is the length plus the length of the data preceding it longer than the length of our packet? */ wccp2_length = tvb_reported_length_remaining(tvb, offset); if (length > (guint)wccp2_length) { expert_add_info_format(pinfo, length_item, &ei_wccp_length_bad, "The length as specified by the length field is bigger than the length of the packet"); length = wccp2_length - offset; } else { /* Truncate the packet to the specified length. */ tvb_set_reported_length(tvb, offset + length); } proto_item_set_len(wccp_tree_item, offset + length); dissect_wccp2_info(tvb, offset, pinfo, wccp_tree, wccp_message_type); break; } return tvb_captured_length(tvb); } /* End of utility functions */ void proto_register_wccp(void) { static hf_register_info hf[] = { { &hf_wccp_message_type, { "WCCP Message Type", "wccp.message", FT_UINT32, BASE_DEC, VALS(wccp_type_vals), 0x0, "The WCCP message that was sent", HFILL } }, { &hf_wccp_version, { "WCCP Version", "wccp.version", FT_UINT32, BASE_HEX, VALS(wccp_version_val), 0x0, "The WCCP version", HFILL } }, { &hf_bucket, { "Bucket", "wccp.bucket", FT_UINT8, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_bucket_bit, { "Bucket", "wccp.bucket_bit", FT_UINT8, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_message_header_version, { "WCCP Version (>=2)", "wccp.message_header_version", FT_UINT16, BASE_HEX, NULL, 0x0, "The WCCP version for version 2 and above", HFILL } }, { &hf_hash_revision, { "Hash Revision", "wccp.hash_revision", FT_UINT32, BASE_DEC, 0x0, 0x0, "The cache hash revision", HFILL } }, { &hf_change_num, { "Change Number", "wccp.change_num", FT_UINT32, BASE_DEC, 0x0, 0x0, "The Web-Cache list entry change number", HFILL } }, { &hf_hash_flag, { "Flags", "wccp.hash_flag", FT_UINT32, BASE_HEX, 0x0, 0x0, NULL, HFILL } }, { &hf_hash_flag_u, { "Hash information", "wccp.hash_flag.u", FT_BOOLEAN, 32, TFS(&tfs_historical_current), 0x00010000, NULL, HFILL } }, { &hf_recvd_id, { "Received ID", "wccp.recvd_id", FT_UINT32, BASE_DEC, 0x0, 0x0, "The number of I_SEE_YOU's that have been sent", HFILL } }, { &hf_cache_ip, { "Web Cache IP address", "wccp.cache_ip", FT_IPv4, BASE_NONE, NULL, 0x0, "The IP address of a Web cache", HFILL } }, { &hf_wc_num, { "Number of Web Caches", "wccp.wc_num", FT_UINT32, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_message_header_length, { "Length", "wccp.message_header_length", FT_UINT16, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_item_length, { "Length", "wccp.item_length", FT_UINT16, BASE_DEC, 0x0, 0x0, "The Length of the WCCPv2 item", HFILL } }, { &hf_item_type, { "Type", "wccp.item_type", FT_UINT16, BASE_DEC, VALS(info_type_vals), 0x0, "The type of the WCCPv2 item", HFILL } }, { &hf_item_data, { "Data", "wccp.item_data", FT_BYTES, BASE_NONE, 0x0, 0x0, "The data for an unknown item type", HFILL } }, { &hf_security_info_option, { "Security Option", "wccp.security_info_option", FT_UINT32, BASE_DEC, VALS(security_option_vals), 0x0, NULL, HFILL } }, { &hf_security_info_md5_checksum, { "MD5 checksum (not checked)", "wccp.security_md5_checksum", FT_BYTES, BASE_NONE, 0x0, 0x0, NULL, HFILL } }, { &hf_command_element_type, {"Command Extension Type", "wccp.command_element_type", FT_UINT16, BASE_DEC, VALS(wccp_command_type_vals), 0x0, NULL, HFILL } }, { &hf_command_element_length, {"Command Extension Length", "wccp.command_element_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_command_length, {"Command Length", "wccp.command_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_command_element_shutdown_ip_index, {"Command Element Shutdown IP", "wccp.command_element_shudown_ip_Address.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_command_element_shutdown_ipv4, {"Command Element Shutdown IP", "wccp.command_element_shudown_ip_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_command_element_shutdown_ipv6, {"Command Element Shutdown IP", "wccp.command_element_shudown_ip_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_command_unknown, {"Unknown Command", "wccp.command_unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_service_info_type, { "Service Type", "wccp.service_info_type", FT_UINT8, BASE_DEC, VALS(service_type_vals), 0x0, NULL, HFILL } }, { &hf_service_info_id_standard, { "WCCP Service ID (Standard)", "wccp.service_info_std_id", FT_UINT8, BASE_DEC, VALS(service_id_vals) , 0x0, "The WCCP Service id (Standard)", HFILL } }, { &hf_service_info_id_dynamic, { "WCCP Service ID ( Dynamic)", "wccp.service_info_dyn_id", FT_UINT8, BASE_DEC, NULL , 0x0, "The WCCP Service id (Dynamic)", HFILL } }, { &hf_service_info_priority, { "Priority (highest is 255)", "wccp.service_info_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_service_info_protocol, { "Protocol", "wccp.service_info_protocol", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &ipproto_val_ext, 0x0, NULL, HFILL } }, { &hf_service_info_flags, { "Flags", "wccp.service_info_flags", FT_UINT32, BASE_HEX, 0x0, 0x0, NULL, HFILL } }, { &hf_service_info_flags_src_ip_hash, { "Source IP address in primary hash", "wccp.service_info_flag.src_ip_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_SRC_IP_HASH, NULL, HFILL } }, { &hf_service_info_flags_dest_ip_hash, { "Destination IP address in primary hash", "wccp.service_info_flag.dest_ip_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_DST_IP_HASH, NULL, HFILL } }, { &hf_service_info_flags_src_port_hash, { "Source port in primary hash", "wccp.service_info_flag.src_port_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_SRC_PORT_HASH, NULL, HFILL } }, { &hf_service_info_flags_dest_port_hash, { "Destination port in primary hash", "wccp.service_info_flag.dest_port_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_DST_PORT_HASH, NULL, HFILL } }, { &hf_service_info_flags_ports_defined, { "Ports", "wccp.service_info_flag.ports_defined", FT_BOOLEAN, 32, TFS(&tfs_defined_not_defined), WCCP2_SI_PORTS_DEFINED, NULL, HFILL } }, { &hf_service_info_flags_ports_source, { "Ports refer to", "wccp.service_info_flag.ports_source", FT_BOOLEAN, 32, TFS(&tfs_src_dest_port), WCCP2_SI_PORTS_SOURCE, NULL, HFILL } }, { &hf_service_info_flags_redirect_only_protocol_0, { "Redirect only protocol 0", "wccp.service_info_flag.redirect_only_protocol_0", FT_BOOLEAN, 32, TFS(&tfs_redirect_protocol0), WCCP2r1_SI_REDIRECT_ONLY_PROTOCOL_0, NULL, HFILL } }, { &hf_service_info_flags_src_ip_alt_hash, { "Source IP address in secondary hash", "wccp.service_info_flag.src_ip_alt_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_SRC_IP_ALT_HASH, NULL, HFILL } }, { &hf_service_info_flags_dest_ip_alt_hash, { "Destination IP address in secondary hash", "wccp.service_info_flag.dest_ip_alt_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_DST_IP_ALT_HASH, NULL, HFILL } }, { &hf_service_info_flags_src_port_alt_hash, { "Source port in secondary hash", "wccp.service_info_flag.src_port_alt_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_SRC_PORT_ALT_HASH, NULL, HFILL } }, { &hf_service_info_flags_dest_port_alt_hash, { "Destination port in secondary hash", "wccp.service_info_flag.dest_port_alt_hash", FT_BOOLEAN, 32, TFS(&tfs_used_notused), WCCP2_SI_DST_PORT_ALT_HASH, NULL, HFILL } }, { &hf_service_info_flags_reserved, { "Reserved, should be 0", "wccp.service_info_flag.reserved", FT_UINT32, BASE_HEX, NULL, 0xFFFFF000, NULL, HFILL } }, { &hf_service_info_source_port, { "Source Port", "wccp.service_info_source_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_service_info_destination_port, { "Destination Port", "wccp.service_info_destination_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_ip_index, { "IP Address", "wccp.router_identity.ip_address.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_ipv4, { "IP Address", "wccp.router_identity.ip_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_ipv6, { "IP Address", "wccp.router_identity.ip_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_receive_id, { "Received ID", "wccp.router_identity.receive_id", FT_UINT32, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_router_identity_send_to_ip_index, { "Sent To IP Address", "wccp.router_identity.send_to_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_send_to_ipv4, { "Sent To IP Address", "wccp.router_identity.send_to_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_send_to_ipv6, { "Sent To IP Address", "wccp.router_identity.send_to_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_received_from_num, { "Number of Received From IP addresses (Webcache to which the message is directed)", "wccp.router.num_recv_ip", FT_UINT32, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_index, { "Web-Cache IP Address", "wccp.web_cache_identity.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_ipv4, { "Web-Cache IP Address", "wccp.web_cache_identity.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_ipv6, { "Web-Cache IP Address", "wccp.web_cache_identity.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_hash_rev, { "Hash Revision", "wccp.web_cache_identity.hash_rev", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_flags, { "Flags", "wccp.web_cache_identity.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_identity_flag_hash_info, { "Hash information", "wccp.web_cache_identity.flags.hash_info", FT_BOOLEAN, 16, TFS(&tfs_historical_current), 0x1, NULL, HFILL } }, { &hf_web_cache_identity_flag_assign_type, { "Assignment Type", "wccp.web_cache_identity.flags.assign_type", FT_UINT16, BASE_HEX, VALS(wccp_web_cache_assignment_data_type_val), 0x6, NULL, HFILL } }, { &hf_web_cache_identity_flag_version_request, { "Version Request", "wccp.web_cache_identity.flags.version_request", FT_BOOLEAN, 16, TFS(&tfs_version_min_max), 0x8, NULL, HFILL } }, { &hf_web_cache_identity_flag_reserved, { "Reserved, should be 0", "wccp.web_cache_identity.flags.reserved", FT_UINT16, BASE_HEX, NULL, 0xFFF0, NULL, HFILL } }, { &hf_mask_value_set_element_value_element_num, { "Number of Value Elements", "wccp.mask_value_set_selement.value_element_num", FT_UINT32, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_assignment_weight, { "Assignment Weight", "wccp.assignment_weight", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_status, { "Status", "wccp.assignment_status", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_key_ip_index, { "Assignment Key IP Address", "wccp.assignment_key.ip_index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_key_ipv4, { "Assignment Key IP Address", "wccp.assignment_key.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_key_ipv6, { "Assignment Key IP Address", "wccp.assignment_key.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_key_change_num, { "Assignment Key Change Number", "wccp.assignment_key.change_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_no_data, { "No Assignment Data Present", "wccp.assignment_no_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_view_member_change_num, { "Member Change Number", "wccp.router_view.member_change_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_router_router_num, { "Number of Routers", "wccp.router_view.router_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_router_ip_index, { "Router IP Address", "wccp.router_identity.router_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_router_ipv4, { "Router IP Address", "wccp.router_identity.router_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_router_ipv6, { "Router IP Address", "wccp.router_identity.router_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_received_from_ip_index, { "Received From IP Address/Target Web Cache IP", "wccp.router_identity.received_from_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_received_from_ipv4, { "Received From IP Address/Target Web Cache IP", "wccp.router_identity.received_from_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_identity_received_from_ipv6, { "Received From IP Address/Target Web Cache IP", "wccp.router_identity.received_from_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_change_num, { "Change Number", "wccp.wc_view_info.change_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_router_ip_index, { "Router IP", "wccp.wc_view_info.router_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_router_ipv4, { "Router IP", "wccp.wc_view_info.router_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_router_ipv6, { "Router IP", "wccp.wc_view_info.router_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_wc_ip_index, { "Web Cache IP", "wccp.wc_view_info.wc_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_wc_ipv4, { "Web Cache IP", "wccp.wc_view_info.wc_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_info_wc_ipv6, { "Web Cache IP", "wccp.wc_view_info.wc_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_router_num, { "Number of Routers", "wccp.wc_view_info.router_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wc_view_wc_num, { "Number of Web Caches", "wccp.wc_view_info.wc_num", FT_UINT32, BASE_DEC, 0x0, 0x0, NULL, HFILL } }, { &hf_wc_identity_ip_address_index, { "Web Cache Identity", "wccp.wc_identity_ip_address.index", FT_UINT32, BASE_HEX, NULL, 0x0, "The IP identifying the Web Cache", HFILL } }, { &hf_wc_identity_ip_address_ipv4, { "Web Cache Identity", "wccp.wc_identity_ip_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "The IP identifying the Web Cache", HFILL } }, { &hf_wc_identity_ip_address_ipv6, { "Web Cache Identity", "wccp.wc_identity_ip_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "The IP identifying the Web Cache", HFILL } }, { &hf_router_assignment_element_change_num, { "Change Number", "wccp.router_assignment_element.change_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_info_router_num, { "Number of Routers", "wccp.assignment_info.router_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_info_router_ip_index, { "Router IP", "wccp.assignment_info.router_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_info_router_ipv4, { "Router IP", "wccp.assignment_info.router_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_assignment_info_router_ipv6, { "Router IP", "wccp.assignment_info.router_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_hash_buckets_assignment_wc_num, { "Number of WC", "wccp.hash_buckets_assignment.wc_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_hash_buckets_assignment_wc_ip_index, { "WC IP", "wccp.hash_buckets_assignment.wc_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_hash_buckets_assignment_wc_ipv4, { "WC IP", "wccp.hash_buckets_assignment.wc_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_hash_buckets_assignment_wc_ipv6, { "WC IP", "wccp.hash_buckets_assignment.wc_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_view_ip_index, { "Router IP Address", "wccp.router_view.ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_view_ipv4, { "Router IP Address", "wccp.router_view.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_view_ipv6, { "Router IP Address", "wccp.router_view.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_ip_index, { "Web-Cache Identity Element IP address", "wccp.router_query_info.ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_ipv4, { "Web-Cache Identity Element IP address", "wccp.router_query_info.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_ipv6, { "Web-Cache Identity Element IP address", "wccp.router_query_info.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_send_to_ip_index, { "Sent To IP Address", "wccp.router_query_info.send_to_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_send_to_ipv4, { "Sent To IP Address", "wccp.router_query_info.send_to_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_send_to_ipv6, { "Sent To IP Address", "wccp.router_query_info.send_to_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_target_ip_index, { "Target IP Address", "wccp.router_query_info.target_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_target_ipv4, { "Target IP Address", "wccp.router_query_info.target_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_router_query_info_target_ipv6, { "Target IP Address", "wccp.router_query_info.target_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_capability_element_type, { "Type", "wccp.capability_element.type", FT_UINT16, BASE_DEC, VALS(capability_type_vals), 0x0, NULL, HFILL } }, { &hf_capability_element_length, { "Value Length", "wccp.capability_element.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_info_value, { "Value", "wccp.capability_info.value", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_capability_forwarding_method_flag_gre, { "GRE-encapsulated", "wccp.capability_info.forwarding_method_flag.gre", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_FORWARDING_METHOD_GRE, NULL, HFILL } }, { &hf_capability_forwarding_method_flag_l2, { "L2 rewrite", "wccp.capability_info.forwarding_method_flag.l2", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_FORWARDING_METHOD_L2, NULL, HFILL } }, { &hf_capability_assignment_method_flag_hash, { "Hash", "wccp.capability_info.assignment_method_flag.hash", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_ASSIGNMENT_METHOD_HASH, NULL, HFILL } }, { &hf_capability_assignment_method_flag_mask, { "Mask", "wccp.capability_info.assignment_method_flag.mask", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_ASSIGNMENT_METHOD_MASK, NULL, HFILL } }, { &hf_capability_return_method_flag_gre, { "GRE-encapsulated", "wccp.capability_info.return_method_flag.gre", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_PACKET_RETURN_METHOD_GRE, NULL, HFILL } }, { &hf_capability_return_method_flag_l2, { "L2 rewrite", "wccp.capability_info.return_method_flag.l2", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), WCCP2_PACKET_RETURN_METHOD_L2, NULL, HFILL } }, { &hf_capability_transmit_t, { "Message interval in milliseconds", "wccp.capability.transmit_t", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_transmit_t_upper_limit, { "Message interval upper limit in milliseconds", "wccp.capability.transmit_t.upper_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_transmit_t_lower_limit, { "Message interval lower limit in milliseconds", "wccp.capability.transmit_t.lower_limit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_timeout_scale, { "Timer scale", "wccp.capability.timer_scale.timeout_scale", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_timeout_scale_upper_limit, { "Timer scale upper limit", "wccp.capability.timer_scale.timeout_scale.upper_limit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_timeout_scale_lower_limit, { "Timer scale lower limit", "wccp.capability.timer_scale.timeout_scale.lower_limit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_ra_timer_scale, { "RA Timer scale", "wccp.capability.timer_scale.ra_timer_scale", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_ra_scale_upper_limit, { "RA Timer scale upper limit", "wccp.capability.timer_scale.ra_timer_scale.upper_limit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_timer_scale_ra_scale_lower_limit, { "RA Timer scale lower limit", "wccp.capability.timer_scale.ra_timer_scale.lower_limit", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capability_value, { "Value", "wccp.capability.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_reserved_zero, { "Reserved, must be 0", "wccp.reserved_zero", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_src_ip_index, { "Source Address", "wccp.value_element.src_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_src_ipv4, { "Source Address", "wccp.value_element.src_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_src_ipv6, { "Source Address", "wccp.value_element.src_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_dest_ip_index, { "Destination Address", "wccp.value_element.dest_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_dest_ipv4, { "Destination Address", "wccp.value_element.dest_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_dest_ipv6, { "Destination Address", "wccp.value_element.dest_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_src_port, { "Source Port", "wccp.value_element.src_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_dest_port, { "Destination Port", "wccp.value_element.dest_port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_web_cache_ip_index, { "Web Cache Address", "wccp.value_element.web_cache_ip.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_web_cache_ipv4, { "Web Cache Address", "wccp.value_element.web_cache_ip.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_value_element_web_cache_ipv6, { "Web Cache Address", "wccp.value_element.web_cache_ip.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_mask_value_set_list_num_elements, { "Number of elements", "wccp.mask_value_set_list.num_elements", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_mask_element_src_ip, { "Source Address Mask", "wccp.mask_element.src_ip", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mask_element_dest_ip, { "Destination Address Mask", "wccp.mask_element.dest_ip", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mask_element_src_port, { "Source Port Mask", "wccp.mask_element.src_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_mask_element_dest_port, { "Destination Port Mask", "wccp.mask_element.dest_port", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_alt_assignment_info_assignment_type, { "Assignment type", "wccp.alt_assignment_info.assignment_type", FT_UINT16, BASE_DEC, VALS(assignment_type_vals), 0x0, NULL, HFILL } }, { &hf_extended_assignment_data_type, { "Assignment type", "wccp.extended_assignment_data.type", FT_UINT16, BASE_DEC, VALS(assignment_type_vals), 0x0, NULL, HFILL } }, { &hf_alt_assignment_map_assignment_type, { "Assignment type", "wccp.alt_assignment_map.assignment_type", FT_UINT16, BASE_DEC, VALS(assignment_type_vals), 0x0, NULL, HFILL } }, { &hf_alt_assignment_map_assignment_length, { "Assignment length", "wccp.alt_assignment_map.assignment_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_alt_assignment_info_assignment_length, { "Assignment length", "wccp.alt_assignment_info.assignment_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_extended_assignment_data_length, { "Assignment length", "wccp.extended_assignment_data.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_alt_assignment_info_num_routers, { "Number of routers", "wccp.alt_assignment_info.num_routers", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_alt_assignment_mask_value_set_element_num_wc_value_elements, { "Number of Web-Cache Value Elements", "wccp.alt_assignment_mask_value_set_element.num_wc_value_elements", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_value_element_wc_address_index, { "Web-Cache Address", "wccp.web_cache_value_element.wc_address.index", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_value_element_wc_address_ipv4, { "Web-Cache Address", "wccp.web_cache_value_element.wc_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_value_element_wc_address_ipv6, { "Web-Cache Address", "wccp.web_cache_value_element.wc_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_value_element_num_values, { "Number of Value Sequence Numbers", "wccp.web_cache_value_element.num_values", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_web_cache_value_seq_num, { "Value Sequence Number", "wccp.web_cache_value_element.value_seq_num", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_alt_assignment_mask_value_set_list_num_elements, { "Number of Alternate Mask/Value Set Elements", "wccp.alt_assignment_mask_value_list.num_elements", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_address_table_family, { "Family Type", "wccp.address_table.family_type", FT_UINT16, BASE_DEC, VALS(wccp_address_family_val), 0x0, "The WCCP Address Table Family type", HFILL } }, { &hf_address_table_address_length, { "Address Length", "wccp.address_table.address_length", FT_UINT16, BASE_DEC, NULL, 0x0, "The WCCP Address Table Address Length", HFILL } }, { &hf_address_table_length, { "Length", "wccp.address_table.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The WCCP Address Table Length", HFILL } }, { &hf_address_table_element, { "Address", "wccp.address_table.element", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; static gint *ett[] = { &ett_wccp, &ett_buckets, &ett_hash_assignment_buckets, &ett_mask_assignment_data_element, &ett_alternate_mask_assignment_data_element, &ett_extended_assigment_data_element, &ett_table_element, &ett_hash_flags, &ett_wc_identity_flags, &ett_cache_info, &ett_security_info, &ett_service_info, &ett_service_flags, &ett_service_info_ports, &ett_wc_view_info_router_element, &ett_router_identity_info, &ett_wc_identity_element, &ett_wc_identity_info, &ett_router_view_info, &ett_wc_view_info, &ett_router_assignment_element, &ett_hash_buckets_assignment_wc_element, &ett_hash_buckets_assignment_buckets, &ett_router_alt_assignment_element, &ett_router_assignment_info, &ett_query_info, &ett_capabilities_info, &ett_capability_element, &ett_capability_forwarding_method, &ett_capability_assignment_method, &ett_capability_return_method, &ett_capability_transmit_t, &ett_capability_timer_scale, &ett_alt_assignment_info, &ett_alt_assignment_map, &ett_address_table, &ett_assignment_map, &ett_command_extension, &ett_alternate_mask_value_set, &ett_alternate_mask_value_set_element, &ett_mv_set_list, &ett_mv_set_element, &ett_mv_set_value_list, &ett_alternate_mv_set_element_list, &ett_web_cache_value_element_list, &ett_alternate_mv_set_element, &ett_value_element, &ett_unknown_info, }; static ei_register_info ei[] = { { &ei_wccp_missing_security_info, { "wccp.missing.security_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Security Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_service_info, { "wccp.missing.service_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Service Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_wc_id_info, { "wccp.missing.wc_id_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Web-Cache Identity Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_router_id_info, { "wccp.missing.router_id_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Router Identity Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_query_info, { "wccp.missing.query_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Query Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_wc_view_info, { "wccp.missing.wc_view_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Web-Cache View Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_rtr_view_info, { "wccp.missing.rtr_view_info", PI_PROTOCOL, PI_ERROR, "This message should contain a Router View Info component, but it is missing", EXPFILL }}, { &ei_wccp_missing_assignment, { "wccp.missing.assignment", PI_PROTOCOL, PI_ERROR, "This message should contain a Alternate Assignment, Assignment Map, Assignment Info or " "Alternative Assignment Map component, but it is missing", EXPFILL }}, { &ei_wccp_contains_redirect_assignment, { "wccp.contains.redirect_assignment", PI_PROTOCOL, PI_ERROR, "This message contains a Assignment Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_router_id_info, { "wccp.contains.router_id_info", PI_PROTOCOL, PI_ERROR, "This message contains a Router Identity Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_rtr_view_info, { "wccp.contains.rtr_view_info", PI_PROTOCOL, PI_ERROR, "This message contains a Router View Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_query_info, { "wccp.contains.query_info", PI_PROTOCOL, PI_ERROR, "This message contains a Query Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_alt_assignment, { "wccp.contains.alt_assignment", PI_PROTOCOL, PI_ERROR, "This message contains a Alternate Assignment component, but it should not", EXPFILL }}, { &ei_wccp_contains_assign_map, { "wccp.contains.assign_map", PI_PROTOCOL, PI_ERROR, "This message contains a Assignment Map component, but it should not", EXPFILL }}, { &ei_wccp_contains_alt_assignment_map, { "wccp.contains.alt_assignment_map", PI_PROTOCOL, PI_ERROR, "This message contains a Alternative Assignment Map component, but it should not", EXPFILL }}, { &ei_wccp_contains_wc_id_info, { "wccp.contains.wc_id_info", PI_PROTOCOL, PI_ERROR, "This message contains a Web-Cache Identity Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_wc_view_info, { "wccp.contains.wc_view_info", PI_PROTOCOL, PI_ERROR, "This message contains a Web-Cache View Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_capabilities_info, { "wccp.contains.capabilities_info", PI_PROTOCOL, PI_ERROR, "This message contains a Capabilities Info component, but it should not", EXPFILL }}, { &ei_wccp_contains_command_extension, { "wccp.contains.command_extension", PI_PROTOCOL, PI_ERROR, "This message contains a Command Extension component, but it should not", EXPFILL }}, { &ei_wccp_assignment_length_bad, { "wccp.assignment_length_bad", PI_PROTOCOL, PI_ERROR, "Assignment length bad", EXPFILL }}, { &ei_wccp_length_bad, { "wccp.length_bad", PI_PROTOCOL, PI_ERROR, "Length bad", EXPFILL }}, { &ei_wccp_service_info_priority_nonzero, { "wccp.service_info_priority.nonzero", PI_PROTOCOL, PI_WARN, "The priority must be zero for well-known services.", EXPFILL }}, { &ei_wccp_service_info_protocol_nonzero, { "wccp.service_info_protocol.nonzero", PI_PROTOCOL, PI_WARN, "The protocol must be zero for well-known services.", EXPFILL }}, { &ei_wccp_router_identity_receive_id_zero, { "wccp.router_identity.receive_id.zero", PI_PROTOCOL, PI_WARN, "Receive ID shouldn't be 0", EXPFILL }}, { &ei_wccp_web_cache_identity_hash_rev_zero, { "wccp.web_cache_identity.hash_rev.zero", PI_PROTOCOL, PI_WARN, "Should be 0 (6.4)", EXPFILL }}, { &ei_wccp_address_table_family_unknown, { "wccp.address_table.family_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown address family", EXPFILL }}, { &ei_wccp_capability_element_length, { "wccp.capability_element.length.invalid", PI_PROTOCOL, PI_WARN, "Value Length invalid", EXPFILL }}, { &ei_wccp_port_fields_not_used, { "wccp.port_fields_not_used", PI_PROTOCOL, PI_NOTE, "Ports fields not used", EXPFILL }}, { &ei_wccp_a_zero_not_c, { "wccp.a_zero_not_c", PI_PROTOCOL, PI_WARN, "Error A is 0, but C is not", EXPFILL }}, #if 0 { &ei_wccp_c_zero_not_a, { "wccp.c_zero_not_a", PI_PROTOCOL, PI_WARN, "Error C is 0, but A is not", EXPFILL }}, #endif }; expert_module_t* expert_wccp; proto_wccp = proto_register_protocol("Web Cache Communication Protocol", "WCCP", "wccp"); proto_register_field_array(proto_wccp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wccp = expert_register_protocol(proto_wccp); expert_register_field_array(expert_wccp, ei, array_length(ei)); } void proto_reg_handoff_wccp(void) { dissector_handle_t wccp_handle; wccp_handle = create_dissector_handle(dissect_wccp, proto_wccp); dissector_add_uint_with_preference("udp.port", UDP_PORT_WCCP, wccp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wccp.h
/* packet-wccp.h * Declarations for Cisco Web Cache Communication Protocol * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Maps service ID values to service names. */ extern const value_string service_id_vals[];
C
wireshark/epan/dissectors/packet-wcp.c
/* packet-wcp.c * Routines for Wellfleet Compression frame disassembly * Copyright 2001, Jeffrey C. Foster <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 * * SPDX-License-Identifier: GPL-2.0-or-later * * ToDo: * Add preference to allow/disallow decompression * Calculate and verify check byte (last byte), if only we knew how! * Handle Wellfleet compression over PPP links. * - This will require changing the sub-dissector call * routine to determine if layer 2 is frame relay or * or PPP and different sub-dissector routines for each. * * Based upon information in the Nortel TCL based Pcaptap code. *http://www.mynetworkforum.com/tools/PCAPTAP/pcaptap-Win32-3.00.exe * * And lzss algorithm *http://www.rasip.fer.hr/research/compress/algorithms/fund/lz/lzss.html */ /* * Wellfleet compression is a variation on LZSS encoding. * * Compression is done by keeping a sliding window of previous * data transmited. The sender will use a pattern match to * encode repeated data as a data pointer field. Then a stream * of pointers and actual data bytes. The pointer values include * an offset to previous data in the stream and the length of the * matching data. * * The data pattern matching is done on the octets. * * The data is encoded as 8 field blocks with a compression flag * byte at the beginning. If the bit is set in the compression * flag, then that field has a compression field. If it isn't set * then the byte is raw data. * * The compression field is either 2 or 3 bytes long. The length * is determined by the length of the matching data, for short * matches the match length is encoded in the high nibble of the * first byte. Otherwise the third byte of the field contains * the match length. * * First byte - * lower 4 bits: * High order nibble of the offset * * upper 4 bits: * 1 = length is in 3rd byte * 2-F = length of matching data - 1 * * Second byte - * Lower byte of the source offset. * * Third byte - * Length of match - 1 if First byte upper nibble = 1, otherwise * this byte isn't added to data stream. * * Example: * Uncompressed data (hex): 11 22 22 22 22 33 44 55 66 77 * * * Compression data : * Flag bits: 0x20 (third field is compressed) * Data: 11 22 20 00 33 44 55 * / / / / * raw data ------+--+ / / * (Comp length - 1)<<4+ / * Data offset ----------+ * * Output data (hex): 20 11 22 20 00 33 44 55 66 77 * * In this example the copy src is one byte behind the copy destination * so if appears as if output is being loaded with the source byte. * */ #include "config.h" #include <epan/packet.h> #include <epan/proto_data.h> #include <wiretap/wtap.h> #include <wsutil/pint.h> #include <epan/conversation.h> #include <epan/etypes.h> #include <epan/nlpid.h> #include <epan/expert.h> #include <epan/exceptions.h> #define MAX_WIN_BUF_LEN 0x7fff /* storage size for decompressed data */ #define MAX_WCP_BUF_LEN 2048 /* storage size for compressed data */ #define FROM_DCE 0x80 /* for direction setting */ void proto_register_wcp(void); void proto_reg_handoff_wcp(void); typedef struct { guint8 *buf_cur; guint8 buffer[MAX_WIN_BUF_LEN]; /* initialized bytes in the buffer (since buf_cur may wrap around) */ guint16 initialized; } wcp_window_t; typedef struct { wcp_window_t recv; wcp_window_t send; } wcp_circuit_data_t; /* XXX do I really want the length in here */ typedef struct { guint16 len; guint8 buffer[MAX_WCP_BUF_LEN]; } wcp_pdata_t; static int proto_wcp = -1; static int hf_wcp_cmd = -1; static int hf_wcp_ext_cmd = -1; static int hf_wcp_seq = -1; static int hf_wcp_chksum = -1; static int hf_wcp_tid = -1; static int hf_wcp_rev = -1; static int hf_wcp_init = -1; static int hf_wcp_seq_size = -1; static int hf_wcp_alg = -1; static int hf_wcp_alg_cnt = -1; static int hf_wcp_alg_a = -1; static int hf_wcp_alg_b = -1; static int hf_wcp_alg_c = -1; static int hf_wcp_alg_d = -1; /* static int hf_wcp_rexmit = -1; */ static int hf_wcp_hist_size = -1; static int hf_wcp_ppc = -1; static int hf_wcp_pib = -1; static int hf_wcp_compressed_data = -1; static int hf_wcp_comp_bits = -1; /* static int hf_wcp_comp_marker = -1; */ static int hf_wcp_short_len = -1; static int hf_wcp_long_len = -1; static int hf_wcp_short_run = -1; static int hf_wcp_long_run = -1; static int hf_wcp_offset = -1; static gint ett_wcp = -1; static gint ett_wcp_comp_data = -1; static gint ett_wcp_field = -1; static expert_field ei_wcp_compressed_data_exceeds = EI_INIT; static expert_field ei_wcp_uncompressed_data_exceeds = EI_INIT; static expert_field ei_wcp_invalid_window_offset = EI_INIT; static expert_field ei_wcp_buffer_too_long = EI_INIT; /* static expert_field ei_wcp_invalid_match_length = EI_INIT; */ static dissector_handle_t fr_uncompressed_handle; /* * Bits in the address field. */ #define WCP_CMD 0xf0 /* WCP Command */ #define WCP_EXT_CMD 0x0f /* WCP Extended Command */ #define WCP_SEQ 0x0fff /* WCP Sequence number */ #define WCP_OFFSET_MASK 0x0fff /* WCP Pattern source offset */ #define PPC_COMPRESSED_IND 0x0 #define PPC_UNCOMPRESSED_IND 0x1 #define PPC_TPPC_COMPRESSED_IND 0x2 #define PPC_TPPC_UNCOMPRESSED_IND 0x3 #define CONNECT_REQ 0x4 #define CONNECT_ACK 0x5 #define CONNECT_NAK 0x6 #define DISCONNECT_REQ 0x7 #define DISCONNECT_ACK 0x8 #define INIT_REQ 0x9 #define INIT_ACK 0xa #define RESET_REQ 0xb #define RESET_ACK 0xc #define REXMIT_NAK 0xd static const value_string cmd_string[] = { {0, "Compressed Data"}, {1, "Uncompressed Data"}, {15, "Extended"}, { 0, NULL } }; static const value_string ext_cmd_string[] = { {0, "Per Packet Compression"}, {4, "Connect Req"}, {5, "Connect Ack"}, {9, "Init Req"}, {0x0a, "Init Ack"}, { 0, NULL } }; static tvbuff_t *wcp_uncompress(tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree); static wcp_window_t *get_wcp_window_ptr(packet_info *pinfo); static void dissect_wcp_con_req(tvbuff_t *tvb, int offset, proto_tree *tree) { /* WCP connector request message */ guint32 alg_cnt; proto_tree_add_item(tree, hf_wcp_tid, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wcp_rev, tvb, offset + 2, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_init, tvb, offset + 3, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_seq_size, tvb, offset + 4, 1, ENC_NA); proto_tree_add_item_ret_uint(tree, hf_wcp_alg_cnt, tvb, offset + 5, 1, ENC_NA, &alg_cnt); proto_tree_add_item(tree, hf_wcp_alg_a, tvb, offset + 6, 1, ENC_NA); if (alg_cnt > 1) proto_tree_add_item(tree, hf_wcp_alg_b, tvb, offset + 7, 1, ENC_NA); if (alg_cnt > 2) proto_tree_add_item(tree, hf_wcp_alg_c, tvb, offset + 8, 1, ENC_NA); if (alg_cnt > 3) proto_tree_add_item(tree, hf_wcp_alg_d, tvb, offset + 9, 1, ENC_NA); } static void dissect_wcp_con_ack(tvbuff_t *tvb, int offset, proto_tree *tree) { /* WCP connector ack message */ proto_tree_add_item(tree, hf_wcp_tid, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wcp_rev, tvb, offset + 2, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_seq_size, tvb, offset + 3, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_alg, tvb, offset + 4, 1, ENC_NA); } static void dissect_wcp_init(tvbuff_t *tvb, int offset, proto_tree *tree) { /* WCP Initiate Request/Ack message */ proto_tree_add_item(tree, hf_wcp_tid, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wcp_rev, tvb, offset + 2, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_hist_size, tvb, offset + 3, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_ppc, tvb, offset + 4, 1, ENC_NA); proto_tree_add_item(tree, hf_wcp_pib, tvb, offset + 5, 1, ENC_NA); } static void dissect_wcp_reset(tvbuff_t *tvb, int offset, proto_tree *tree) { /* Process WCP Reset Request/Ack message */ proto_tree_add_item(tree, hf_wcp_tid, tvb, offset, 2, ENC_BIG_ENDIAN); } static void wcp_save_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree) { wcp_window_t *buf_ptr = 0; size_t len; /* discard first 2 bytes, header and last byte (check byte) */ len = tvb_reported_length(tvb) - 3; buf_ptr = get_wcp_window_ptr(pinfo); if ((buf_ptr->buf_cur + len) <= (buf_ptr->buffer + MAX_WIN_BUF_LEN)) { tvb_memcpy(tvb, buf_ptr->buf_cur, 2, len); buf_ptr->buf_cur += len; } else { guint8 *buf_end = buf_ptr->buffer + MAX_WIN_BUF_LEN; tvb_memcpy(tvb, buf_ptr->buf_cur, 2, buf_end - buf_ptr->buf_cur); if (buf_ptr->buf_cur + len <= buf_end) { tvb_memcpy(tvb, buf_ptr->buffer, (gint) (buf_end - buf_ptr->buf_cur-2), len - (buf_end - buf_ptr->buf_cur)); buf_ptr->buf_cur += len - MAX_WIN_BUF_LEN; } else { proto_tree_add_expert(tree, pinfo, &ei_wcp_buffer_too_long, tvb, 0, -1); } } } static int dissect_wcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *wcp_tree; proto_item *ti; int wcp_header_len; guint16 temp, cmd, ext_cmd, seq; tvbuff_t *next_tvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WCP"); col_clear(pinfo->cinfo, COL_INFO); temp = tvb_get_ntohs(tvb, 0); cmd = (temp & 0xf000) >> 12; ext_cmd = (temp & 0x0f00) >> 8; if (cmd == 0xf) wcp_header_len = 1; else wcp_header_len = 2; seq = temp & 0x0fff; /* XXX should test seq to be sure it the last + 1 !! */ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd, cmd_string, "Unknown")); if (cmd == 0xf) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(ext_cmd, ext_cmd_string, "Unknown")); ti = proto_tree_add_item(tree, proto_wcp, tvb, 0, wcp_header_len, ENC_NA); wcp_tree = proto_item_add_subtree(ti, ett_wcp); proto_tree_add_item(wcp_tree, hf_wcp_cmd, tvb, 0, 1, ENC_NA); if (cmd == 0xf) { proto_tree_add_item(wcp_tree, hf_wcp_ext_cmd, tvb, 1, 1, ENC_NA); switch (ext_cmd) { case CONNECT_REQ: dissect_wcp_con_req(tvb, 1, wcp_tree); break; case CONNECT_ACK: dissect_wcp_con_ack(tvb, 1, wcp_tree); break; case INIT_REQ: case INIT_ACK: dissect_wcp_init(tvb, 1, wcp_tree); break; case RESET_REQ: case RESET_ACK: dissect_wcp_reset(tvb, 1, wcp_tree); break; default: break; } } else { proto_tree_add_uint(wcp_tree, hf_wcp_seq, tvb, 0, 2, seq); } /* exit if done */ if (cmd != 1 && cmd != 0 && !(cmd == 0xf && ext_cmd == 0)) return 2; if (cmd == 1) { /* uncompressed data */ if (!pinfo->fd->visited) { /* if first pass */ wcp_save_data(tvb, pinfo, wcp_tree); } next_tvb = tvb_new_subset_remaining(tvb, wcp_header_len); } else { /* cmd == 0 || (cmd == 0xf && ext_cmd == 0) */ next_tvb = wcp_uncompress(tvb, wcp_header_len, pinfo, wcp_tree); if (!next_tvb) { return tvb_captured_length(tvb); } } /* add the check byte */ proto_tree_add_checksum(wcp_tree, tvb, tvb_reported_length(tvb) - 1, hf_wcp_chksum, -1, NULL, pinfo, 0, ENC_NA, PROTO_CHECKSUM_NO_FLAGS); call_dissector(fr_uncompressed_handle, next_tvb, pinfo, tree); return tvb_captured_length(tvb); } static guint8 * decompressed_entry(guint8 *dst, guint16 data_offset, guint16 data_cnt, int *len, wcp_window_t *buf_ptr) { const guint8 *src; guint8 *buf_start, *buf_end; buf_start = buf_ptr->buffer; buf_end = buf_ptr->buffer + MAX_WIN_BUF_LEN; /* do the decompression for one field */ src = (dst - 1 - data_offset); if (src < buf_start) src += MAX_WIN_BUF_LEN; /* XXX could do some fancy memory moves, later if speed is problem */ while(data_cnt--) { *dst = *src; if (buf_ptr->initialized < MAX_WIN_BUF_LEN) buf_ptr->initialized++; if ( ++(*len) >MAX_WCP_BUF_LEN) { return NULL; /* end of buffer error */ } if (dst++ == buf_end) dst = buf_start; if (src++ == buf_end) src = buf_start; } return dst; } static wcp_window_t *get_wcp_window_ptr(packet_info *pinfo) { /* find the circuit for this DLCI, create one if needed */ /* and return the wcp_window data structure pointer */ /* for the direction of this packet */ conversation_t *conv; wcp_circuit_data_t *wcp_circuit_data; conv = find_or_create_conversation(pinfo); wcp_circuit_data = (wcp_circuit_data_t *)conversation_get_proto_data(conv, proto_wcp); if (!wcp_circuit_data) { wcp_circuit_data = wmem_new0(wmem_file_scope(), wcp_circuit_data_t); wcp_circuit_data->recv.buf_cur = wcp_circuit_data->recv.buffer; wcp_circuit_data->send.buf_cur = wcp_circuit_data->send.buffer; conversation_add_proto_data(conv, proto_wcp, wcp_circuit_data); } if (pinfo->pseudo_header->dte_dce.flags & FROM_DCE) return &wcp_circuit_data->recv; else return &wcp_circuit_data->send; } static tvbuff_t *wcp_uncompress(tvbuff_t *src_tvb, int offset, packet_info *pinfo, proto_tree *tree) { /* do the packet data uncompression and load it into the dst buffer */ proto_tree *cd_tree, *sub_tree; proto_item *cd_item, *ti; int len, i; int cnt = tvb_reported_length(src_tvb) - 1;/* don't include check byte */ guint8 *dst, *src, *buf_start, *buf_end, comp_flag_bits = 0; guint16 data_offset, data_cnt; guint8 src_buf[ MAX_WCP_BUF_LEN]; tvbuff_t *tvb; wcp_window_t *buf_ptr = 0; wcp_pdata_t *pdata_ptr; buf_ptr = get_wcp_window_ptr(pinfo); buf_start = buf_ptr->buffer; buf_end = buf_start + MAX_WIN_BUF_LEN; cd_item = proto_tree_add_item(tree, hf_wcp_compressed_data, src_tvb, offset, cnt - offset, ENC_NA); cd_tree = proto_item_add_subtree(cd_item, ett_wcp_comp_data); if (cnt - offset > MAX_WCP_BUF_LEN) { expert_add_info_format(pinfo, cd_item, &ei_wcp_compressed_data_exceeds, "Compressed data exceeds maximum buffer length (%d > %d)", cnt - offset, MAX_WCP_BUF_LEN); return NULL; } /* * XXX - this will throw an exception if a snapshot length cut short * the data. We may want to try to dissect the data in that case, * and we may even want to try to decompress it, *but* we will * want to mark the buffer of decompressed data as incomplete, so * that we don't try to use it for decompressing later packets. */ src = (guint8 *)tvb_memcpy(src_tvb, src_buf, offset, cnt - offset); dst = buf_ptr->buf_cur; len = 0; i = -1; while(offset < cnt) { /* There are i bytes left for this byte of flag bits */ if ( --i >= 0) { /* * There's still at least one more byte left for * the current set of compression flag bits; is * it compressed data or uncompressed data? */ if (comp_flag_bits & 0x80) { /* This byte is compressed data */ if (!(offset + 1 < cnt)) { /* * The data offset runs past the * end of the data. */ return NULL; } data_offset = pntoh16(src) & WCP_OFFSET_MASK; if ((*src & 0xf0) == 0x10) { /* * The count of bytes to copy from * the dictionary window is in the * byte following the data offset. */ if (!(offset + 2 < cnt)) { /* * The data count runs past the * end of the data. */ return NULL; } data_cnt = *(src + 2) + 1; if (tree) { ti = proto_tree_add_item(cd_tree, hf_wcp_long_run, src_tvb, offset, 3, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_wcp_field); proto_tree_add_uint(sub_tree, hf_wcp_offset, src_tvb, offset, 2, data_offset); proto_tree_add_item(sub_tree, hf_wcp_long_len, src_tvb, offset+2, 1, ENC_BIG_ENDIAN); } src += 3; offset += 3; } else { /* * The count of bytes to copy from * the dictionary window is in * the upper 4 bits of the next * byte. */ data_cnt = (*src >> 4) + 1; if (tree) { ti = proto_tree_add_item(cd_tree, hf_wcp_short_run, src_tvb, offset, 2, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_wcp_field); proto_tree_add_uint(sub_tree, hf_wcp_short_len, src_tvb, offset, 1, *src); proto_tree_add_uint(sub_tree, hf_wcp_offset, src_tvb, offset, 2, data_offset); } src += 2; offset += 2; } if (data_offset + 1 > buf_ptr->initialized) { expert_add_info_format(pinfo, cd_item, &ei_wcp_invalid_window_offset, "Data offset exceeds valid window size (%d > %d)", data_offset+1, buf_ptr->initialized); return NULL; } if (data_offset + 1 < data_cnt) { expert_add_info_format(pinfo, cd_item, &ei_wcp_invalid_window_offset, "Data count exceeds offset (%d > %d)", data_cnt, data_offset+1); return NULL; } if ( !pinfo->fd->visited) { /* if first pass */ dst = decompressed_entry(dst, data_offset, data_cnt, &len, buf_ptr); if (dst == NULL) { expert_add_info_format(pinfo, cd_item, &ei_wcp_uncompressed_data_exceeds, "Uncompressed data exceeds maximum buffer length (%d > %d)", len, MAX_WCP_BUF_LEN); return NULL; } } }else { /* * This byte is uncompressed data; is there * room for it in the buffer of uncompressed * data? */ if ( ++len >MAX_WCP_BUF_LEN) { /* No - report an error. */ expert_add_info_format(pinfo, cd_item, &ei_wcp_uncompressed_data_exceeds, "Uncompressed data exceeds maximum buffer length (%d > %d)", len, MAX_WCP_BUF_LEN); return NULL; } if ( !pinfo->fd->visited) { /* * This is the first pass through * the packets, so copy it to the * buffer of uncompressed data. */ *dst = *src; if (dst++ == buf_end) dst = buf_start; if (buf_ptr->initialized < MAX_WIN_BUF_LEN) buf_ptr->initialized++; } ++src; ++offset; } /* Skip to the next compression flag bit */ comp_flag_bits <<= 1; }else { /* * There are no more bytes left for the current * set of compression flag bits, so this byte * is another byte of compression flag bits. */ comp_flag_bits = *src++; proto_tree_add_uint(cd_tree, hf_wcp_comp_bits, src_tvb, offset, 1, comp_flag_bits); offset++; i = 8; } } if (pinfo->fd->visited) { /* if not first pass */ /* get uncompressed data */ pdata_ptr = (wcp_pdata_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_wcp, 0); if (!pdata_ptr) { /* exit if no data */ REPORT_DISSECTOR_BUG("Can't find uncompressed data"); return NULL; } len = pdata_ptr->len; } else { if (buf_ptr->buf_cur + len > buf_end) { expert_add_info_format(pinfo, cd_item, &ei_wcp_invalid_window_offset, "Uncompressed data exceeds available buffer length (%d > %d)", len, (int) (buf_end - buf_ptr->buf_cur)); return NULL; } /* save the new data as per packet data */ pdata_ptr = wmem_new0(wmem_file_scope(), wcp_pdata_t); memcpy( &pdata_ptr->buffer, buf_ptr->buf_cur, len); pdata_ptr->len = len; p_add_proto_data(wmem_file_scope(), pinfo, proto_wcp, 0, (void*)pdata_ptr); buf_ptr->buf_cur = dst; } tvb = tvb_new_child_real_data(src_tvb, pdata_ptr->buffer, pdata_ptr->len, pdata_ptr->len); /* Add new data to the data source list */ add_new_data_source(pinfo, tvb, "Uncompressed WCP"); return tvb; } void proto_register_wcp(void) { static hf_register_info hf[] = { { &hf_wcp_cmd, { "Command", "wcp.cmd", FT_UINT8, BASE_HEX, VALS(cmd_string), WCP_CMD, "Compression Command", HFILL }}, { &hf_wcp_ext_cmd, { "Extended Command", "wcp.ext_cmd", FT_UINT8, BASE_HEX, VALS(ext_cmd_string), WCP_EXT_CMD, "Extended Compression Command", HFILL }}, { &hf_wcp_seq, { "SEQ", "wcp.seq", FT_UINT16, BASE_HEX, NULL, WCP_SEQ, "Sequence Number", HFILL }}, { &hf_wcp_chksum, { "Checksum", "wcp.checksum", FT_UINT8, BASE_DEC, NULL, 0, "Packet Checksum", HFILL }}, { &hf_wcp_tid, { "TID", "wcp.tid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wcp_rev, { "Revision", "wcp.rev", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wcp_init, { "Initiator", "wcp.init", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wcp_seq_size, { "Seq Size", "wcp.seq_size", FT_UINT8, BASE_DEC, NULL, 0, "Sequence Size", HFILL }}, { &hf_wcp_alg_cnt, { "Alg Count", "wcp.alg_cnt", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm Count", HFILL }}, { &hf_wcp_alg_a, { "Alg 1", "wcp.alg1", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm #1", HFILL }}, { &hf_wcp_alg_b, { "Alg 2", "wcp.alg2", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm #2", HFILL }}, { &hf_wcp_alg_c, { "Alg 3", "wcp.alg3", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm #3", HFILL }}, { &hf_wcp_alg_d, { "Alg 4", "wcp.alg4", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm #4", HFILL }}, { &hf_wcp_alg, { "Alg", "wcp.alg", FT_UINT8, BASE_DEC, NULL, 0, "Algorithm", HFILL }}, #if 0 { &hf_wcp_rexmit, { "Rexmit", "wcp.rexmit", FT_UINT8, BASE_DEC, NULL, 0, "Retransmit", HFILL }}, #endif { &hf_wcp_hist_size, { "History", "wcp.hist", FT_UINT8, BASE_DEC, NULL, 0, "History Size", HFILL }}, { &hf_wcp_ppc, { "PerPackComp", "wcp.ppc", FT_UINT8, BASE_DEC, NULL, 0, "Per Packet Compression", HFILL }}, { &hf_wcp_pib, { "PIB", "wcp.pib", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wcp_compressed_data, { "Compressed Data", "wcp.compressed_data", FT_NONE, BASE_NONE, NULL, 0, "Raw compressed data", HFILL }}, { &hf_wcp_comp_bits, { "Compress Flag", "wcp.flag", FT_UINT8, BASE_HEX, NULL, 0, "Compressed byte flag", HFILL }}, #if 0 { &hf_wcp_comp_marker, { "Compress Marker", "wcp.mark", FT_UINT8, BASE_DEC, NULL, 0, "Compressed marker", HFILL }}, #endif { &hf_wcp_offset, { "Source offset", "wcp.off", FT_UINT16, BASE_HEX, NULL, WCP_OFFSET_MASK, "Data source offset", HFILL }}, { &hf_wcp_short_len, { "Compress Length", "wcp.short_len", FT_UINT8, BASE_HEX, NULL, 0xf0, "Compressed length", HFILL }}, { &hf_wcp_long_len, { "Compress Length", "wcp.long_len", FT_UINT8, BASE_HEX, NULL, 0, "Compressed length", HFILL }}, { &hf_wcp_long_run, { "Long Compression", "wcp.long_comp", FT_BYTES, BASE_NONE, NULL, 0, "Long Compression type", HFILL }}, { &hf_wcp_short_run, { "Short Compression", "wcp.short_comp", FT_BYTES, BASE_NONE, NULL, 0, "Short Compression type", HFILL }}, }; static gint *ett[] = { &ett_wcp, &ett_wcp_comp_data, &ett_wcp_field, }; static ei_register_info ei[] = { { &ei_wcp_compressed_data_exceeds, { "wcp.compressed_data.exceeds", PI_MALFORMED, PI_ERROR, "Compressed data exceeds maximum buffer length", EXPFILL }}, { &ei_wcp_uncompressed_data_exceeds, { "wcp.uncompressed_data.exceeds", PI_MALFORMED, PI_ERROR, "Uncompressed data exceeds maximum buffer length", EXPFILL }}, { &ei_wcp_invalid_window_offset, { "wcp.off.invalid", PI_MALFORMED, PI_ERROR, "Offset points outside of visible window", EXPFILL }}, { &ei_wcp_buffer_too_long, { "wcp.buffer_too_long", PI_MALFORMED, PI_ERROR, "Buffer too long", EXPFILL }}, #if 0 { &ei_wcp_invalid_match_length, { "wcp.len.invalid", PI_MALFORMED, PI_ERROR, "Length greater than offset", EXPFILL }}, #endif }; expert_module_t* expert_wcp; proto_wcp = proto_register_protocol ("Wellfleet Compression", "WCP", "wcp"); proto_register_field_array (proto_wcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wcp = expert_register_protocol(proto_wcp); expert_register_field_array(expert_wcp, ei, array_length(ei)); } void proto_reg_handoff_wcp(void) { dissector_handle_t wcp_handle; /* * Get handle for the Frame Relay (uncompressed) dissector. */ fr_uncompressed_handle = find_dissector_add_dependency("fr_uncompressed", proto_wcp); wcp_handle = create_dissector_handle(dissect_wcp, proto_wcp); dissector_add_uint("fr.nlpid", NLPID_COMPRESSED, wcp_handle); dissector_add_uint("ethertype", ETHERTYPE_WCP, wcp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-websocket.c
/* packet-websocket.c * Routines for WebSocket dissection * Copyright 2012, Alexis La Goutte <[email protected]> * 2015, Peter Wu <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <wsutil/wslog.h> #include <epan/addr_resolv.h> #include <epan/conversation.h> #include <epan/follow.h> #include <epan/proto_data.h> #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/reassemble.h> #include <wsutil/strtoi.h> #include "packet-http.h" #include "packet-tcp.h" #ifdef HAVE_ZLIB #define ZLIB_CONST #include <zlib.h> #endif /* * The information used comes from: * RFC6455: The WebSocket Protocol * http://www.iana.org/assignments/websocket (last updated 2012-04-12) */ void proto_register_websocket(void); void proto_reg_handoff_websocket(void); static dissector_handle_t websocket_handle; static dissector_handle_t text_lines_handle; static dissector_handle_t json_handle; static dissector_handle_t sip_handle; #define WEBSOCKET_NONE 0 #define WEBSOCKET_TEXT 1 #define WEBSOCKET_JSON 2 #define WEBSOCKET_SIP 3 #define OPCODE_KEY 0 static gint pref_text_type = WEBSOCKET_NONE; static gboolean pref_decompress = TRUE; typedef struct { const char *subprotocol; guint16 server_port; gboolean permessage_deflate; #ifdef HAVE_ZLIB gboolean permessage_deflate_ok; gint8 server_wbits; gint8 client_wbits; z_streamp server_take_over_context; z_streamp client_take_over_context; #endif guint32 frag_id; guint8 first_frag_opcode; } websocket_conv_t; #ifdef HAVE_ZLIB typedef struct { guint8 *decompr_payload; guint decompr_len; } websocket_packet_t; #endif static int websocket_follow_tap = -1; /* Initialize the protocol and registered fields */ static int proto_websocket = -1; static int proto_http = -1; static int hf_ws_fin = -1; static int hf_ws_reserved = -1; static int hf_ws_pmc = -1; static int hf_ws_opcode = -1; static int hf_ws_mask = -1; static int hf_ws_payload_length = -1; static int hf_ws_payload_length_ext_16 = -1; static int hf_ws_payload_length_ext_64 = -1; static int hf_ws_masking_key = -1; static int hf_ws_payload = -1; static int hf_ws_masked_payload = -1; static int hf_ws_payload_continue = -1; static int hf_ws_payload_text = -1; static int hf_ws_payload_close = -1; static int hf_ws_payload_close_status_code = -1; static int hf_ws_payload_close_reason = -1; static int hf_ws_payload_ping = -1; static int hf_ws_payload_pong = -1; static int hf_ws_payload_unknown = -1; static int hf_ws_fragments = -1; static int hf_ws_fragment = -1; static int hf_ws_fragment_overlap = -1; static int hf_ws_fragment_overlap_conflict = -1; static int hf_ws_fragment_multiple_tails = -1; static int hf_ws_fragment_too_long_fragment = -1; static int hf_ws_fragment_error = -1; static int hf_ws_fragment_count = -1; static int hf_ws_reassembled_length = -1; static gint ett_ws = -1; static gint ett_ws_pl = -1; static gint ett_ws_mask = -1; static gint ett_ws_control_close = -1; static gint ett_ws_fragments = -1; static gint ett_ws_fragment = -1; static expert_field ei_ws_payload_unknown = EI_INIT; static expert_field ei_ws_decompression_failed = EI_INIT; #define WS_CONTINUE 0x0 #define WS_TEXT 0x1 #define WS_BINARY 0x2 #define WS_CLOSE 0x8 #define WS_PING 0x9 #define WS_PONG 0xA static const value_string ws_opcode_vals[] = { { WS_CONTINUE, "Continuation" }, { WS_TEXT, "Text" }, { WS_BINARY, "Binary" }, { WS_CLOSE, "Connection Close" }, { WS_PING, "Ping" }, { WS_PONG, "Pong" }, { 0, NULL} }; #define MASK_WS_FIN 0x80 #define MASK_WS_RSV 0x70 #define MASK_WS_RSV1 0x40 #define MASK_WS_OPCODE 0x0F #define MASK_WS_MASK 0x80 #define MASK_WS_PAYLOAD_LEN 0x7F static const value_string ws_close_status_code_vals[] = { { 1000, "Normal Closure" }, { 1001, "Going Away" }, { 1002, "Protocol error" }, { 1003, "Unsupported Data" }, { 1004, "---Reserved----" }, { 1005, "No Status Rcvd" }, { 1006, "Abnormal Closure" }, { 1007, "Invalid frame payload data" }, { 1008, "Policy Violation" }, { 1009, "Message Too Big" }, { 1010, "Mandatory Ext." }, { 1011, "Internal Server" }, { 1015, "TLS handshake" }, { 0, NULL} }; static const fragment_items ws_frag_items = { &ett_ws_fragments, &ett_ws_fragment, &hf_ws_fragments, &hf_ws_fragment, &hf_ws_fragment_overlap, &hf_ws_fragment_overlap_conflict, &hf_ws_fragment_multiple_tails, &hf_ws_fragment_too_long_fragment, &hf_ws_fragment_error, &hf_ws_fragment_count, NULL, &hf_ws_reassembled_length, /* Reassembled data field */ NULL, "websocket fragments" }; static dissector_table_t port_subdissector_table; static dissector_table_t protocol_subdissector_table; static heur_dissector_list_t heur_subdissector_list; static reassembly_table ws_reassembly_table; #define MAX_UNMASKED_LEN (1024 * 256) static tvbuff_t * tvb_unmasked(tvbuff_t *tvb, packet_info *pinfo, const guint offset, guint payload_length, const guint8 *masking_key) { gchar *data_unmask; guint i; const guint8 *data_mask; guint unmasked_length = payload_length > MAX_UNMASKED_LEN ? MAX_UNMASKED_LEN : payload_length; data_unmask = (gchar *)wmem_alloc(pinfo->pool, unmasked_length); data_mask = tvb_get_ptr(tvb, offset, unmasked_length); /* Unmasked(XOR) Data... */ for(i=0; i < unmasked_length; i++) { data_unmask[i] = data_mask[i] ^ masking_key[i%4]; } return tvb_new_real_data(data_unmask, unmasked_length, payload_length); } #ifdef HAVE_ZLIB static gint8 websocket_extract_wbits(const gchar *str) { guint8 wbits; const gchar *end; if (str && ws_strtou8(str, &end, &wbits) && (*end == '\0' || strchr(";\t ", *end))) { if (wbits < 8) { wbits = 8; } else if (wbits > 15) { wbits = 15; } } else { wbits = 15; } return -wbits; } static void * websocket_zalloc(void *opaque _U_, unsigned int items, unsigned int size) { return wmem_alloc(wmem_file_scope(), items*size); } static void websocket_zfree(void *opaque _U_, void *addr) { wmem_free(wmem_file_scope(), addr); } static z_streamp websocket_init_z_stream_context(gint8 wbits) { z_streamp z_strm = wmem_new0(wmem_file_scope(), z_stream); z_strm->zalloc = websocket_zalloc; z_strm->zfree = websocket_zfree; if (inflateInit2(z_strm, wbits) != Z_OK) { inflateEnd(z_strm); wmem_free(wmem_file_scope(), z_strm); return NULL; } return z_strm; } /* * Decompress the given buffer using the given zlib context. On success, the * (possibly empty) buffer is stored as "proto data" and TRUE is returned. * Otherwise FALSE is returned. */ static gboolean websocket_uncompress(tvbuff_t *tvb, packet_info *pinfo, z_streamp z_strm, tvbuff_t **uncompressed_tvb, guint32 key) { /* * Decompression a message: append "0x00 0x00 0xff 0xff" to the end of * message, then apply DEFLATE to the result. * https://tools.ietf.org/html/rfc7692#section-7.2.2 */ guint8 *decompr_payload = NULL; guint decompr_len = 0; guint compr_len, decompr_buf_len; guint8 *compr_payload, *decompr_buf; gint err; compr_len = tvb_captured_length(tvb) + 4; compr_payload = (guint8 *)wmem_alloc(pinfo->pool, compr_len); tvb_memcpy(tvb, compr_payload, 0, compr_len-4); compr_payload[compr_len-4] = compr_payload[compr_len-3] = 0x00; compr_payload[compr_len-2] = compr_payload[compr_len-1] = 0xff; decompr_buf_len = 2*compr_len; decompr_buf = (guint8 *)wmem_alloc(pinfo->pool, decompr_buf_len); z_strm->next_in = compr_payload; z_strm->avail_in = compr_len; /* Decompress all available data. */ do { z_strm->next_out = decompr_buf; z_strm->avail_out = decompr_buf_len; err = inflate(z_strm, Z_SYNC_FLUSH); if (err == Z_OK || err == Z_STREAM_END || err == Z_BUF_ERROR) { guint avail_bytes = decompr_buf_len - z_strm->avail_out; if (avail_bytes) { decompr_payload = (guint8 *)wmem_realloc(wmem_file_scope(), decompr_payload, decompr_len + avail_bytes); memcpy(&decompr_payload[decompr_len], decompr_buf, avail_bytes); decompr_len += avail_bytes; } } } while (err == Z_OK); if (err == Z_STREAM_END || err == Z_BUF_ERROR) { /* Data was (partially) uncompressed. */ websocket_packet_t *pkt_info = wmem_new0(wmem_file_scope(), websocket_packet_t); if (decompr_len > 0) { pkt_info->decompr_payload = decompr_payload; pkt_info->decompr_len = decompr_len; *uncompressed_tvb = tvb_new_real_data(decompr_payload, decompr_len, decompr_len); } p_add_proto_data(wmem_file_scope(), pinfo, proto_websocket, key, pkt_info); return TRUE; } else { /* decompression failed */ wmem_free(wmem_file_scope(), decompr_payload); return FALSE; } } #endif static void dissect_websocket_control_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 opcode) { proto_item *ti; proto_tree *subtree; const guint offset = 0, length = tvb_reported_length(tvb); switch (opcode) { case WS_CLOSE: /* Close */ ti = proto_tree_add_item(tree, hf_ws_payload_close, tvb, offset, length, ENC_NA); subtree = proto_item_add_subtree(ti, ett_ws_control_close); /* Close frame MAY contain a body. */ if (length >= 2) { proto_tree_add_item(subtree, hf_ws_payload_close_status_code, tvb, offset, 2, ENC_BIG_ENDIAN); if (length > 2) proto_tree_add_item(subtree, hf_ws_payload_close_reason, tvb, offset+2, length-2, ENC_UTF_8); } break; case WS_PING: /* Ping */ proto_tree_add_item(tree, hf_ws_payload_ping, tvb, offset, length, ENC_NA); break; case WS_PONG: /* Pong */ proto_tree_add_item(tree, hf_ws_payload_pong, tvb, offset, length, ENC_NA); break; default: /* Unknown */ ti = proto_tree_add_item(tree, hf_ws_payload_unknown, tvb, offset, length, ENC_NA); expert_add_info_format(pinfo, ti, &ei_ws_payload_unknown, "Dissector for Websocket Opcode (%d)" " code not implemented, Contact Wireshark developers" " if you want this supported", opcode); break; } } static void dissect_websocket_data_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *pl_tree, guint8 opcode, websocket_conv_t *websocket_conv, gboolean pmc _U_, gint raw_offset _U_) { proto_item *ti; dissector_handle_t handle = NULL; heur_dtbl_entry_t *hdtbl_entry; if (pinfo->fragmented) { /* Skip dissecting fragmented payload data. */ return; } /* try to find a dissector which accepts the data. */ if (websocket_conv->subprotocol) { handle = dissector_get_string_handle(protocol_subdissector_table, websocket_conv->subprotocol); } else if (websocket_conv->server_port) { handle = dissector_get_uint_handle(port_subdissector_table, websocket_conv->server_port); } #ifdef HAVE_ZLIB if (websocket_conv->permessage_deflate_ok && pmc) { tvbuff_t *uncompressed = NULL; gboolean uncompress_ok = FALSE; if (!PINFO_FD_VISITED(pinfo)) { z_streamp z_strm; gint8 wbits; if (pinfo->destport == websocket_conv->server_port) { z_strm = websocket_conv->server_take_over_context; wbits = websocket_conv->server_wbits; } else { z_strm = websocket_conv->client_take_over_context; wbits = websocket_conv->client_wbits; } if (z_strm) { uncompress_ok = websocket_uncompress(tvb, pinfo, z_strm, &uncompressed, raw_offset); } else { /* no context take over, initialize a new context */ z_strm = wmem_new0(pinfo->pool, z_stream); if (inflateInit2(z_strm, wbits) == Z_OK) { uncompress_ok = websocket_uncompress(tvb, pinfo, z_strm, &uncompressed, raw_offset); } inflateEnd(z_strm); } } else { websocket_packet_t *pkt_info = (websocket_packet_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_websocket, raw_offset); if (pkt_info) { uncompress_ok = TRUE; if (pkt_info->decompr_len > 0) { uncompressed = tvb_new_real_data(pkt_info->decompr_payload, pkt_info->decompr_len, pkt_info->decompr_len); } } } if (!uncompress_ok) { proto_tree_add_expert(tree, pinfo, &ei_ws_decompression_failed, tvb, 0, -1); return; } if (uncompressed) { add_new_data_source(pinfo, uncompressed, "Decompressed payload"); tvb = uncompressed; } } #endif if (handle) { call_dissector_only(handle, tvb, pinfo, tree, NULL); return; /* handle found, assume dissector took care of it. */ } else if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) { return; /* heuristics dissector handled it. */ } /* no dissector wanted it, try to print something appropriate. */ switch (opcode) { case WS_TEXT: /* Text */ { proto_tree_add_item(pl_tree, hf_ws_payload_text, tvb, 0, -1, ENC_UTF_8); const gchar *saved_match_string = pinfo->match_string; pinfo->match_string = NULL; switch (pref_text_type) { case WEBSOCKET_TEXT: case WEBSOCKET_NONE: default: /* Assume that most text protocols are line-based. */ call_dissector(text_lines_handle, tvb, pinfo, tree); break; case WEBSOCKET_JSON: call_dissector(json_handle, tvb, pinfo, tree); break; case WEBSOCKET_SIP: call_dissector(sip_handle, tvb, pinfo, tree); break; } pinfo->match_string = saved_match_string; } break; case WS_BINARY: /* Binary */ call_data_dissector(tvb, pinfo, tree); break; default: /* Unknown */ ti = proto_tree_add_item(pl_tree, hf_ws_payload_unknown, tvb, 0, -1, ENC_NA); expert_add_info_format(pinfo, ti, &ei_ws_payload_unknown, "Dissector for Websocket Opcode (%d)" " code not implemented, Contact Wireshark developers" " if you want this supported", opcode); break; } } static void websocket_parse_extensions(websocket_conv_t *websocket_conv, const char *str) { /* * Grammar for the header: * * Sec-WebSocket-Extensions = extension-list * extension-list = 1#extension * extension = extension-token *( ";" extension-param ) * extension-token = registered-token * registered-token = token * extension-param = token [ "=" (token | quoted-string) ] */ /* * RFC 7692 permessage-deflate parsing. * "x-webkit-deflate-frame" is an alias used by some versions of Safari browser */ websocket_conv->permessage_deflate = !!strstr(str, "permessage-deflate") || !!strstr(str, "x-webkit-deflate-frame"); #ifdef HAVE_ZLIB websocket_conv->permessage_deflate_ok = pref_decompress && websocket_conv->permessage_deflate; if (websocket_conv->permessage_deflate_ok) { websocket_conv->server_wbits = websocket_extract_wbits(strstr(str, "server_max_window_bits=")); if (!strstr(str, "server_no_context_takeover")) { websocket_conv->server_take_over_context = websocket_init_z_stream_context(websocket_conv->server_wbits); } websocket_conv->client_wbits = websocket_extract_wbits(strstr(str, "client_max_window_bits=")); if (!strstr(str, "client_no_context_takeover")) { websocket_conv->client_take_over_context = websocket_init_z_stream_context(websocket_conv->client_wbits); } } #endif } static void dissect_websocket_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *ws_tree, guint8 fin, guint8 opcode, websocket_conv_t *websocket_conv, gboolean pmc, gint raw_offset) { const guint offset = 0, length = tvb_reported_length(tvb); proto_item *ti; proto_tree *pl_tree; tvbuff_t *tvb_appdata; tvbuff_t *frag_tvb = NULL; /* Payload */ ti = proto_tree_add_item(ws_tree, hf_ws_payload, tvb, offset, length, ENC_NA); pl_tree = proto_item_add_subtree(ti, ett_ws_pl); /* Extension Data */ /* TODO: Add dissector of Extension (not extension available for the moment...) */ if (opcode & 8) { /* Control frames have MSB set. */ dissect_websocket_control_frame(tvb, pinfo, pl_tree, opcode); return; } bool save_fragmented = pinfo->fragmented; if (!fin || opcode == WS_CONTINUE) { /* Fragmented data frame */ fragment_head *frag_msg; pinfo->fragmented = TRUE; if (!PINFO_FD_VISITED(pinfo) && opcode != WS_CONTINUE) { /* First fragment, temporarily save opcode needed when dissecting the reassembled frame */ websocket_conv->first_frag_opcode = opcode; } frag_msg = fragment_add_seq_next(&ws_reassembly_table, tvb, offset, pinfo, websocket_conv->frag_id, NULL, tvb_captured_length_remaining(tvb, offset), !fin); frag_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled Message", frag_msg, &ws_frag_items, NULL, tree); } if (!PINFO_FD_VISITED(pinfo) && frag_tvb) { /* First time fragments fully reassembled, store opcode from first fragment */ p_add_proto_data(wmem_file_scope(), pinfo, proto_websocket, OPCODE_KEY, GUINT_TO_POINTER(websocket_conv->first_frag_opcode)); } if (frag_tvb) { /* Fragments were fully reassembled. */ tvb_appdata = frag_tvb; /* Lookup opcode from first fragment */ guint first_frag_opcode = GPOINTER_TO_UINT( p_get_proto_data(wmem_file_scope(),pinfo, proto_websocket, OPCODE_KEY)); opcode = (guint8)first_frag_opcode; } else { /* Right now this is exactly the same, this may change when exts. are added. tvb_appdata = tvb_new_subset_length_caplen(tvb, offset, length, length); */ tvb_appdata = tvb; } /* Application Data */ if (pinfo->fragmented && opcode == WS_CONTINUE) { /* Not last fragment, dissect continue fragment as is */ proto_tree_add_item(tree, hf_ws_payload_continue, tvb_appdata, offset, length, ENC_NA); return; } dissect_websocket_data_frame(tvb_appdata, pinfo, tree, pl_tree, opcode, websocket_conv, pmc, raw_offset); pinfo->fragmented = save_fragmented; } static int dissect_websocket_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { static guint32 frag_id_counter = 0; proto_item *ti, *ti_len; guint8 fin, opcode; gboolean mask; guint short_length, payload_length; guint payload_offset, mask_offset; proto_tree *ws_tree; const guint8 *masking_key = NULL; tvbuff_t *tvb_payload; conversation_t *conv; websocket_conv_t *websocket_conv; gboolean pmc = FALSE; /* * If this is a new Websocket session, try to parse HTTP Sec-Websocket-* * headers once. */ conv = find_or_create_conversation(pinfo); websocket_conv = (websocket_conv_t *)conversation_get_proto_data(conv, proto_websocket); if (!websocket_conv) { websocket_conv = wmem_new0(wmem_file_scope(), websocket_conv_t); websocket_conv->frag_id = ++frag_id_counter; http_conv_t *http_conv = (http_conv_t *)conversation_get_proto_data(conv, proto_http); if (http_conv) { websocket_conv->subprotocol = http_conv->websocket_protocol; websocket_conv->server_port = http_conv->server_port; if ( http_conv->websocket_extensions) { websocket_parse_extensions(websocket_conv, http_conv->websocket_extensions); } } conversation_add_proto_data(conv, proto_websocket, websocket_conv); } short_length = tvb_get_guint8(tvb, 1) & MASK_WS_PAYLOAD_LEN; mask_offset = 2; if (short_length == 126) { payload_length = tvb_get_ntohs(tvb, 2); mask_offset += 2; } else if (short_length == 127) { /* warning C4244: '=' : conversion from 'guint64' to 'guint ', possible loss of data */ payload_length = (guint)tvb_get_ntoh64(tvb, 2); mask_offset += 8; } else { payload_length = short_length; } /* Mask */ mask = (tvb_get_guint8(tvb, 1) & MASK_WS_MASK) != 0; payload_offset = mask_offset + (mask ? 4 : 0); col_set_str(pinfo->cinfo, COL_PROTOCOL, "WebSocket"); col_set_str(pinfo->cinfo, COL_INFO, "WebSocket"); ti = proto_tree_add_item(tree, proto_websocket, tvb, 0, payload_offset, ENC_NA); ws_tree = proto_item_add_subtree(ti, ett_ws); /* Flags */ proto_tree_add_item(ws_tree, hf_ws_fin, tvb, 0, 1, ENC_NA); fin = (tvb_get_guint8(tvb, 0) & MASK_WS_FIN) >> 4; proto_tree_add_item(ws_tree, hf_ws_reserved, tvb, 0, 1, ENC_BIG_ENDIAN); if (websocket_conv->permessage_deflate) { /* RSV1 is Per-Message Compressed bit (RFC 7692). */ pmc = !!(tvb_get_guint8(tvb, 0) & MASK_WS_RSV1); proto_tree_add_item(ws_tree, hf_ws_pmc, tvb, 0, 1, ENC_BIG_ENDIAN); } /* Opcode */ proto_tree_add_item(ws_tree, hf_ws_opcode, tvb, 0, 1, ENC_BIG_ENDIAN); opcode = tvb_get_guint8(tvb, 0) & MASK_WS_OPCODE; col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_const(opcode, ws_opcode_vals, "Unknown Opcode")); col_append_str(pinfo->cinfo, COL_INFO, fin ? " [FIN]" : "[FRAGMENT] "); /* Add Mask bit to the tree */ proto_tree_add_item(ws_tree, hf_ws_mask, tvb, 1, 1, ENC_NA); col_append_str(pinfo->cinfo, COL_INFO, mask ? " [MASKED]" : " "); /* (Extended) Payload Length */ ti_len = proto_tree_add_item(ws_tree, hf_ws_payload_length, tvb, 1, 1, ENC_BIG_ENDIAN); if (short_length == 126) { proto_item_append_text(ti_len, " Extended Payload Length (16 bits)"); proto_tree_add_item(ws_tree, hf_ws_payload_length_ext_16, tvb, 2, 2, ENC_BIG_ENDIAN); } else if (short_length == 127) { proto_item_append_text(ti_len, " Extended Payload Length (64 bits)"); proto_tree_add_item(ws_tree, hf_ws_payload_length_ext_64, tvb, 2, 8, ENC_BIG_ENDIAN); } /* Masking-key */ if (mask) { proto_tree_add_item(ws_tree, hf_ws_masking_key, tvb, mask_offset, 4, ENC_NA); masking_key = tvb_get_ptr(tvb, mask_offset, 4); } if (payload_length > 0) { /* Always unmask payload data before analysing it. */ if (mask) { proto_tree_add_item(ws_tree, hf_ws_masked_payload, tvb, payload_offset, payload_length, ENC_NA); tvb_payload = tvb_unmasked(tvb, pinfo, payload_offset, payload_length, masking_key); tvb_set_child_real_data_tvbuff(tvb, tvb_payload); add_new_data_source(pinfo, tvb_payload, "Unmasked data"); } else { tvb_payload = tvb_new_subset_length_caplen(tvb, payload_offset, payload_length, payload_length); } dissect_websocket_payload(tvb_payload, pinfo, tree, ws_tree, fin, opcode, websocket_conv, pmc, tvb_raw_offset(tvb)); if (have_tap_listener(websocket_follow_tap)) { tap_queue_packet(websocket_follow_tap, pinfo, tvb_payload); } } return tvb_captured_length(tvb); } static guint get_websocket_frame_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint frame_length, payload_length; gboolean mask; frame_length = 2; /* flags, opcode and Payload length */ mask = tvb_get_guint8(tvb, offset + 1) & MASK_WS_MASK; payload_length = tvb_get_guint8(tvb, offset + 1) & MASK_WS_PAYLOAD_LEN; offset += 2; /* Skip flags, opcode and Payload length */ /* Check for Extended Payload Length. */ if (payload_length == 126) { if (tvb_reported_length_remaining(tvb, offset) < 2) return 0; /* Need more data. */ payload_length = tvb_get_ntohs(tvb, offset); frame_length += 2; /* Extended payload length */ } else if (payload_length == 127) { if (tvb_reported_length_remaining(tvb, offset) < 8) return 0; /* Need more data. */ payload_length = (guint)tvb_get_ntoh64(tvb, offset); frame_length += 8; /* Extended payload length */ } if (mask) frame_length += 4; /* Masking-key */ frame_length += payload_length; /* Payload data */ return frame_length; } static int dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { /* Need at least two bytes for flags, opcode and Payload length. */ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 2, get_websocket_frame_length, dissect_websocket_frame, data); return tvb_captured_length(tvb); } static gboolean test_websocket(packet_info* pinfo _U_, tvbuff_t* tvb, int offset _U_, void* data _U_) { guint buffer_length = tvb_captured_length(tvb); // At least 2 bytes are required for a websocket header if (buffer_length < 2) { return FALSE; } guint8 first_byte = tvb_get_guint8(tvb, 0); guint8 second_byte = tvb_get_guint8(tvb, 1); // Reserved bits RSV1, RSV2 and RSV3 need to be 0 if ((first_byte & 0x70) > 0) { return FALSE; } guint8 op_code = first_byte & 0x0F; // op_code must be one of WS_CONTINUE, WS_TEXT, WS_BINARY, WS_CLOSE, WS_PING or WS_PONG if (!(op_code == WS_CONTINUE || op_code == WS_TEXT || op_code == WS_BINARY || op_code == WS_CLOSE || op_code == WS_PING || op_code == WS_PONG)) { return FALSE; } // It is necessary to prevent that HTTP connection setups are treated as websocket. // If HTTP catches and it upgrades to websocket then HTTP takes care that websocket dissector gets called for this stream. // If first two byte start with printable characters from the alphabet it's likely that it is part of a HTTP connection setup. if (((first_byte >= 'a' && first_byte <= 'z') || (first_byte >= 'A' && first_byte <= 'Z')) && ((second_byte >= 'a' && second_byte <= 'z') || (second_byte >= 'A' && second_byte <= 'Z'))) { return FALSE; } return TRUE; } static gboolean dissect_websocket_heur_tcp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data) { if (!test_websocket(pinfo, tvb, 0, data)) { return FALSE; } conversation_t* conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation, websocket_handle); tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 2, get_websocket_frame_length, dissect_websocket_frame, data); return TRUE; } void proto_register_websocket(void) { static hf_register_info hf[] = { { &hf_ws_fin, { "Fin", "websocket.fin", FT_BOOLEAN, 8, NULL, MASK_WS_FIN, "Indicates that this is the final fragment in a message", HFILL } }, { &hf_ws_reserved, { "Reserved", "websocket.rsv", FT_UINT8, BASE_HEX, NULL, MASK_WS_RSV, "Must be zero", HFILL } }, { &hf_ws_pmc, { "Per-Message Compressed", "websocket.pmc", FT_BOOLEAN, 8, NULL, MASK_WS_RSV1, "Whether a message is compressed or not", HFILL } }, { &hf_ws_opcode, { "Opcode", "websocket.opcode", FT_UINT8, BASE_DEC, VALS(ws_opcode_vals), MASK_WS_OPCODE, "Defines the interpretation of the Payload data", HFILL } }, { &hf_ws_mask, { "Mask", "websocket.mask", FT_BOOLEAN, 8, NULL, MASK_WS_MASK, "Defines whether the Payload data is masked", HFILL } }, { &hf_ws_payload_length, { "Payload length", "websocket.payload_length", FT_UINT8, BASE_DEC, NULL, MASK_WS_PAYLOAD_LEN, "The length of the Payload data", HFILL } }, { &hf_ws_payload_length_ext_16, { "Extended Payload length (16 bits)", "websocket.payload_length_ext_16", FT_UINT16, BASE_DEC, NULL, 0x0, "The length (16 bits) of the Payload data", HFILL } }, { &hf_ws_payload_length_ext_64, { "Extended Payload length (64 bits)", "websocket.payload_length_ext_64", FT_UINT64, BASE_DEC, NULL, 0x0, "The length (64 bits) of the Payload data", HFILL } }, { &hf_ws_masking_key, { "Masking-Key", "websocket.masking_key", FT_BYTES, BASE_NONE, NULL, 0x0, "All frames sent from the client to the server are masked by a 32-bit value that is contained within the frame", HFILL } }, { &hf_ws_payload, { "Payload", "websocket.payload", FT_NONE, BASE_NONE, NULL, 0x0, "Payload (after unmasking)", HFILL } }, { &hf_ws_masked_payload, { "Masked payload", "websocket.masked_payload", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_continue, { "Continue", "websocket.payload.continue", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_text, { "Text", "websocket.payload.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_close, { "Close", "websocket.payload.close", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_close_status_code, { "Status code", "websocket.payload.close.status_code", FT_UINT16, BASE_DEC, VALS(ws_close_status_code_vals), 0x0, NULL, HFILL } }, { &hf_ws_payload_close_reason, { "Reason", "websocket.payload.close.reason", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_ping, { "Ping", "websocket.payload.ping", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_pong, { "Pong", "websocket.payload.pong", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_payload_unknown, { "Unknown", "websocket.payload.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Reassembly */ { &hf_ws_fragments, { "Reassembled websocket Fragments", "websocket.fragments", FT_NONE, BASE_NONE, NULL, 0x0, "Fragments", HFILL } }, { &hf_ws_fragment, { "Websocket Fragment", "websocket.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_ws_fragment_overlap, { "Fragment overlap", "websocket.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL } }, { &hf_ws_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "websocket.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL } }, { &hf_ws_fragment_multiple_tails, { "Multiple tail fragments found", "websocket.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL } }, { &hf_ws_fragment_too_long_fragment, { "Fragment too long", "websocket.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL } }, { &hf_ws_fragment_error, { "Defragmentation error", "websocket.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL } }, { &hf_ws_fragment_count, { "Fragment count", "websocket.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ws_reassembled_length, { "Reassembled websocket Payload length", "websocket.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL } }, }; static gint *ett[] = { &ett_ws, &ett_ws_pl, &ett_ws_mask, &ett_ws_control_close, &ett_ws_fragment, &ett_ws_fragments, }; static ei_register_info ei[] = { { &ei_ws_payload_unknown, { "websocket.payload.unknown.expert", PI_UNDECODED, PI_NOTE, "Dissector for Websocket Opcode", EXPFILL }}, { &ei_ws_decompression_failed, { "websocket.decompression.failed.expert", PI_PROTOCOL, PI_WARN, "Decompression failed", EXPFILL }}, }; static const enum_val_t text_types[] = { {"None", "No subdissection", WEBSOCKET_NONE}, {"Line based text", "Line based text", WEBSOCKET_TEXT}, {"As JSON", "As json", WEBSOCKET_JSON}, {"As SIP", "As SIP", WEBSOCKET_SIP}, {NULL, NULL, -1} }; module_t *websocket_module; expert_module_t* expert_websocket; proto_websocket = proto_register_protocol("WebSocket", "WebSocket", "websocket"); /* * Heuristic dissectors SHOULD register themselves in * this table using the standard heur_dissector_add() * function. */ heur_subdissector_list = register_heur_dissector_list("ws", proto_websocket); port_subdissector_table = register_dissector_table("ws.port", "TCP port for protocols using WebSocket", proto_websocket, FT_UINT16, BASE_DEC); protocol_subdissector_table = register_dissector_table("ws.protocol", "Negotiated WebSocket protocol", proto_websocket, FT_STRING, STRING_CASE_SENSITIVE); reassembly_table_register(&ws_reassembly_table, &addresses_reassembly_table_functions); websocket_follow_tap = register_tap("websocket_follow"); /* websocket follow tap */ register_follow_stream(proto_websocket, "websocket_follow", tcp_follow_conv_filter, tcp_follow_index_filter, tcp_follow_address_filter, tcp_port_to_display, follow_tvb_tap_listener, get_tcp_stream_count, NULL); proto_register_field_array(proto_websocket, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_websocket = expert_register_protocol(proto_websocket); expert_register_field_array(expert_websocket, ei, array_length(ei)); websocket_handle = register_dissector("websocket", dissect_websocket, proto_websocket); websocket_module = prefs_register_protocol(proto_websocket, NULL); prefs_register_enum_preference(websocket_module, "text_type", "Dissect websocket text as", "Select dissector for websocket text", &pref_text_type, text_types, WEBSOCKET_NONE); prefs_register_bool_preference(websocket_module, "decompress", "Try to decompress permessage-deflate payload", NULL, &pref_decompress); } void proto_reg_handoff_websocket(void) { dissector_add_string("http.upgrade", "websocket", websocket_handle); dissector_add_for_decode_as("tcp.port", websocket_handle); heur_dissector_add("tcp", dissect_websocket_heur_tcp, "WebSocket Heuristic", "websocket_tcp", proto_websocket, HEURISTIC_DISABLE); text_lines_handle = find_dissector_add_dependency("data-text-lines", proto_websocket); json_handle = find_dissector_add_dependency("json", proto_websocket); sip_handle = find_dissector_add_dependency("sip", proto_websocket); proto_http = proto_get_id_by_filter_name("http"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wfleet-hdlc.c
/* packet-chdlc.c * Routines for Wellfleet HDLC packet disassembly * Copied from the Cisco HDLC packet disassembly routines * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/addr_resolv.h> void proto_register_wfleet_hdlc(void); void proto_reg_handoff_wfleet_hdlc(void); static int proto_wfleet_hdlc = -1; static int hf_wfleet_hdlc_addr = -1; static int hf_wfleet_hdlc_cmd = -1; static gint ett_wfleet_hdlc = -1; static dissector_handle_t eth_withoutfcs_handle; static dissector_handle_t wfleet_hdlc_handle; static const value_string wfleet_hdlc_cmd_vals[] = { { 0x03, "Un-numbered I frame"}, { 0, NULL} }; static int dissect_wfleet_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *fh_tree = NULL; tvbuff_t *next_tvb; guint8 addr; guint8 cmd; col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "N/A"); col_set_str(pinfo->cinfo, COL_RES_DL_DST, "N/A"); col_set_str(pinfo->cinfo, COL_PROTOCOL, "WHDLC"); col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_guint8(tvb, 0); cmd = tvb_get_guint8(tvb, 1); if (tree) { ti = proto_tree_add_item(tree, proto_wfleet_hdlc, tvb, 0, 2, ENC_NA); fh_tree = proto_item_add_subtree(ti, ett_wfleet_hdlc); proto_tree_add_uint(fh_tree, hf_wfleet_hdlc_addr, tvb, 0, 1, addr); proto_tree_add_uint(fh_tree, hf_wfleet_hdlc_cmd, tvb, 1, 1, cmd); } /* * Build a tvb of the piece past the first two bytes and call the * ethernet dissector */ next_tvb = tvb_new_subset_remaining(tvb, 2); call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_register_wfleet_hdlc(void) { static hf_register_info hf[] = { { &hf_wfleet_hdlc_addr, { "Address", "wfleet_hdlc.address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wfleet_hdlc_cmd, { "Command", "wfleet_hdlc.command", FT_UINT8, BASE_HEX, VALS(wfleet_hdlc_cmd_vals), 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_wfleet_hdlc, }; proto_wfleet_hdlc = proto_register_protocol("Wellfleet HDLC", "WHDLC", "whdlc"); proto_register_field_array(proto_wfleet_hdlc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); wfleet_hdlc_handle = register_dissector("wfleet_hdlc", dissect_wfleet_hdlc, proto_wfleet_hdlc); } void proto_reg_handoff_wfleet_hdlc(void) { dissector_add_uint("wtap_encap", WTAP_ENCAP_WFLEET_HDLC, wfleet_hdlc_handle); /* * Find the eth dissector and save a ref to it */ eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_wfleet_hdlc); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-who.c
/* packet-who.c * Routines for who protocol (see man rwhod) * Gilbert Ramirez <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> /* * RWHOD(8) UNIX System Manager's Manual RWHOD(8) The messages sent and received, are of the form: struct outmp { 0 char out_line[8]; tty name 8 char out_name[8]; user id 16 long out_time; time on }; struct whod { 0 char wd_vers; 1 char wd_type; 2 char wd_fill[2]; 4 int wd_sendtime; 8 int wd_recvtime; 12 char wd_hostname[32]; 44 int wd_loadav[3]; 56 int wd_boottime; 60 struct whoent { struct outmp we_utmp; (20 each) int we_idle; } wd_we[1024 / sizeof (struct whoent)]; }; * */ void proto_register_who(void); void proto_reg_handoff_who(void); static dissector_handle_t who_handle; static int proto_who = -1; static int hf_who_vers = -1; static int hf_who_type = -1; static int hf_who_sendtime = -1; static int hf_who_recvtime = -1; static int hf_who_hostname = -1; static int hf_who_loadav_5 = -1; static int hf_who_loadav_10 = -1; static int hf_who_loadav_15 = -1; static int hf_who_boottime = -1; static int hf_who_whoent = -1; static int hf_who_tty = -1; static int hf_who_uid = -1; static int hf_who_timeon = -1; static int hf_who_idle = -1; static gint ett_who = -1; static gint ett_whoent = -1; #define UDP_PORT_WHO 513 static void dissect_whoent(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree); static int dissect_who(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; proto_tree *who_tree; proto_item *who_ti; guint8 *server_name; double loadav_5 = 0.0, loadav_10 = 0.0, loadav_15 = 0.0; /* Summary information */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WHO"); col_clear(pinfo->cinfo, COL_INFO); who_ti = proto_tree_add_item(tree, proto_who, tvb, offset, -1, ENC_NA); who_tree = proto_item_add_subtree(who_ti, ett_who); proto_tree_add_item(who_tree, hf_who_vers, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(who_tree, hf_who_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; /* 2 filler bytes */ offset += 2; if (tree) { proto_tree_add_item(who_tree, hf_who_sendtime, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); } offset += 4; if (tree) { proto_tree_add_item(who_tree, hf_who_recvtime, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); } offset += 4; server_name = tvb_get_stringzpad(pinfo->pool, tvb, offset, 32, ENC_ASCII|ENC_NA); proto_tree_add_string(who_tree, hf_who_hostname, tvb, offset, 32, server_name); offset += 32; loadav_5 = tvb_get_ntohl(tvb, offset) / 100.0; proto_tree_add_double(who_tree, hf_who_loadav_5, tvb, offset, 4, loadav_5); offset += 4; loadav_10 = tvb_get_ntohl(tvb, offset) / 100.0; proto_tree_add_double(who_tree, hf_who_loadav_10, tvb, offset, 4, loadav_10); offset += 4; loadav_15 = tvb_get_ntohl(tvb, offset) / 100.0; proto_tree_add_double(who_tree, hf_who_loadav_15, tvb, offset, 4, loadav_15); offset += 4; /* Summary information */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %.02f %.02f %.02f", server_name, loadav_5, loadav_10, loadav_15); if (tree) { proto_tree_add_item(who_tree, hf_who_boottime, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset += 4; dissect_whoent(pinfo, tvb, offset, who_tree); } return tvb_captured_length(tvb); } /* The man page says that (1024 / sizeof(struct whoent)) is the maximum number * of whoent structures in the packet. */ #define SIZE_OF_WHOENT 24 #define MAX_NUM_WHOENTS (1024 / SIZE_OF_WHOENT) static void dissect_whoent(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree *whoent_tree = NULL; proto_item *whoent_ti = NULL; int line_offset = offset; guint8 *out_line; guint8 *out_name; int whoent_num = 0; guint32 idle_secs; /* say that out loud... */ while (tvb_reported_length_remaining(tvb, line_offset) > 0 && whoent_num < MAX_NUM_WHOENTS) { whoent_ti = proto_tree_add_item(tree, hf_who_whoent, tvb, line_offset, SIZE_OF_WHOENT, ENC_NA); whoent_tree = proto_item_add_subtree(whoent_ti, ett_whoent); out_line = tvb_get_stringzpad(pinfo->pool, tvb, line_offset, 8, ENC_ASCII|ENC_NA); proto_tree_add_string(whoent_tree, hf_who_tty, tvb, line_offset, 8, out_line); line_offset += 8; out_name = tvb_get_stringzpad(pinfo->pool, tvb, line_offset, 8, ENC_ASCII|ENC_NA); proto_tree_add_string(whoent_tree, hf_who_uid, tvb, line_offset, 8, out_name); line_offset += 8; proto_tree_add_item(whoent_tree, hf_who_timeon, tvb, line_offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); line_offset += 4; idle_secs = tvb_get_ntohl(tvb, line_offset); proto_tree_add_uint_format(whoent_tree, hf_who_idle, tvb, line_offset, 4, idle_secs, "Idle: %s", signed_time_secs_to_str(pinfo->pool, idle_secs)); line_offset += 4; whoent_num++; } } void proto_register_who(void) { static hf_register_info hf[] = { { &hf_who_vers, { "Version", "who.vers", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_who_type, { "Type", "who.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_who_sendtime, { "Send Time", "who.sendtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_recvtime, { "Receive Time", "who.recvtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_hostname, { "Hostname", "who.hostname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_5, { "Load Average Over Past 5 Minutes", "who.loadav_5", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_10, { "Load Average Over Past 10 Minutes", "who.loadav_10", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_loadav_15, { "Load Average Over Past 15 Minutes", "who.loadav_15", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_boottime, { "Boot Time", "who.boottime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_whoent, { "Who utmp Entry", "who.entry", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_tty, { "TTY Name", "who.tty", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_uid, { "User ID", "who.uid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_who_timeon, { "Time On", "who.timeon", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL }}, { &hf_who_idle, { "Time Idle", "who.idle", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_who, &ett_whoent, }; proto_who = proto_register_protocol("Who", "WHO", "who"); who_handle = register_dissector("who", dissect_who, proto_who); proto_register_field_array(proto_who, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_who(void) { dissector_add_uint_with_preference("udp.port", UDP_PORT_WHO, who_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-whois.c
/* packet-whois.c * Routines for whois dissection (see https://tools.ietf.org/html/rfc3912) * Copyright 2013, Christopher Maynard <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/conversation.h> #include <epan/expert.h> #include "packet-tcp.h" #define WHOIS_PORT 43 /* This is the registered IANA port (nicname) */ void proto_register_whois(void); void proto_reg_handoff_whois(void); static int proto_whois = -1; static int hf_whois_query = -1; static int hf_whois_answer = -1; static int hf_whois_answer_in = -1; static int hf_whois_answer_to = -1; static int hf_whois_response_time = -1; static expert_field ei_whois_nocrlf = EI_INIT; static expert_field ei_whois_encoding = EI_INIT; static gint ett_whois = -1; typedef struct _whois_transaction_t { guint32 req_frame; guint32 rep_frame; nstime_t req_time; guint8* query; } whois_transaction_t; static int dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *ti, *expert_ti; proto_tree *whois_tree; conversation_t *conversation; whois_transaction_t *whois_trans; gboolean is_query; guint len; struct tcpinfo *tcpinfo = (struct tcpinfo*)data; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WHOIS"); if (pinfo->destport == WHOIS_PORT) { is_query = TRUE; col_set_str(pinfo->cinfo, COL_INFO, "Query"); } else { is_query = FALSE; col_set_str(pinfo->cinfo, COL_INFO, "Answer"); } conversation = find_or_create_conversation(pinfo); whois_trans = (whois_transaction_t *)conversation_get_proto_data(conversation, proto_whois); if (whois_trans == NULL) { gint linelen; whois_trans = wmem_new0(wmem_file_scope(), whois_transaction_t); /* * Find the end of the first line. */ linelen = tvb_find_line_end(tvb, 0, -1, NULL, FALSE); if (linelen != -1) whois_trans->query = tvb_get_string_enc(wmem_file_scope(), tvb, 0, linelen, ENC_ASCII|ENC_NA); conversation_add_proto_data(conversation, proto_whois, whois_trans); } if (whois_trans->query) { col_append_str(pinfo->cinfo, COL_INFO, ": "); col_append_str(pinfo->cinfo, COL_INFO, whois_trans->query); } len = tvb_reported_length(tvb); if (!PINFO_FD_VISITED(pinfo)) { if (pinfo->can_desegment) { if (is_query) { if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; pinfo->desegment_offset = 0; return -1; } else { whois_trans->req_frame = pinfo->num; whois_trans->req_time = pinfo->abs_ts; } } else if (!(tcpinfo && (IS_TH_FIN(tcpinfo->flags) || tcpinfo->is_reassembled))) { /* If this is the FIN (or already desegmented, as with an out * of order segment received after FIN) go ahead and dissect * on the first pass. */ pinfo->desegment_len = DESEGMENT_UNTIL_FIN; pinfo->desegment_offset = 0; return -1; } } } else if (is_query && (whois_trans->req_frame == 0)) { whois_trans->req_frame = pinfo->num; whois_trans->req_time = pinfo->abs_ts; } if (!is_query && (whois_trans->rep_frame == 0)) { /* By comparing whois_trans->rep_frame to 0, if reassembly is turned * on, whois_trans->rep_frame will be assigned to the reassembled frame * number, and if reassembly is turned off, whois_trans->rep_frame will * be assigned to the first frame number of the response. This seems * to match other protocols' behavior. The alternative is: * if (pinfo->num > whois_trans->rep_frame) * which will give us the same frame number either way. */ whois_trans->rep_frame = pinfo->num; } ti = proto_tree_add_protocol_format(tree, proto_whois, tvb, 0, -1, "WHOIS: %s", is_query ? "Query" : "Answer"); whois_tree = proto_item_add_subtree(ti, ett_whois); /* * XXX - WHOIS, as RFC 3912 says, "has no mechanism for indicating * the character set in use." We assume UTF-8, which is backwards * compatible with ASCII; if somebody wants to support WHOIS requests * or responses in other encodings, they should add a preference. * (Show Packet Bytes works well enough for many use cases.) * Some servers do use other character encodings; * e.g., in 2022 RIPE still uses ISO-8859-1. */ if (is_query) { expert_ti = proto_tree_add_item(whois_tree, hf_whois_query, tvb, 0, -1, ENC_ASCII); if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { /* * From RFC3912, section 2: * All requests are terminated with ASCII CR and then ASCII LF. */ expert_add_info(pinfo, expert_ti, &ei_whois_nocrlf); } if (tree && whois_trans->rep_frame) { ti = proto_tree_add_uint(whois_tree, hf_whois_answer_in, tvb, 0, 0, whois_trans->rep_frame); proto_item_set_generated(ti); } } else if (tree && whois_trans->rep_frame) { /* * If we know the request frame, show it and the time delta between * the request and the response. */ if (whois_trans->req_frame) { nstime_t ns; ti = proto_tree_add_uint(whois_tree, hf_whois_answer_to, tvb, 0, 0, whois_trans->req_frame); proto_item_set_generated(ti); if (pinfo->num == whois_trans->rep_frame) { nstime_delta(&ns, &pinfo->abs_ts, &whois_trans->req_time); ti = proto_tree_add_time(whois_tree, hf_whois_response_time, tvb, 0, 0, &ns); proto_item_set_generated(ti); } } /* * Show the response as text, a line at a time. */ int offset = 0, next_offset; while (tvb_offset_exists(tvb, offset)) { /* * Find the end of the line. */ tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE); /* * Put this line. */ proto_tree_add_item(whois_tree, hf_whois_answer, tvb, offset, next_offset - offset, ENC_UTF_8); offset = next_offset; } proto_tree_add_expert(whois_tree, pinfo, &ei_whois_encoding, tvb, 0, -1); } return tvb_captured_length(tvb); } void proto_register_whois(void) { expert_module_t *expert_whois; static hf_register_info hf[] = { { &hf_whois_query, { "Query", "whois.query", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_whois_answer, { "Answer", "whois.answer", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_whois_answer_in, { "Answer In", "whois.answer_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The answer to this WHOIS query is in this frame", HFILL } }, { &hf_whois_answer_to, { "Query In", "whois.answer_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is the answer to the WHOIS query in this frame", HFILL } }, { &hf_whois_response_time, { "Response Time", "whois.response_time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Query and the Answer", HFILL } } }; static gint *ett[] = { &ett_whois }; static ei_register_info ei[] = { { &ei_whois_nocrlf, { "whois.nocrlf", PI_MALFORMED, PI_WARN, "Missing <CR><LF>", EXPFILL} }, { &ei_whois_encoding, { "whois.encoding", PI_ASSUMPTION, PI_CHAT, "WHOIS has no mechanism to indicate encoding (RFC 3912), assuming UTF-8", EXPFILL} } }; proto_whois = proto_register_protocol("whois", "WHOIS", "whois"); proto_register_field_array(proto_whois, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_whois = expert_register_protocol(proto_whois); expert_register_field_array(expert_whois, ei, array_length(ei)); } void proto_reg_handoff_whois(void) { static dissector_handle_t whois_handle; whois_handle = create_dissector_handle(dissect_whois, proto_whois); dissector_add_uint_with_preference("tcp.port", WHOIS_PORT, whois_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wifi-display.c
/* packet-wifi-display.c * * Wi-Fi Display * * Copyright 2011-2013 Qualcomm Atheros, Inc. * * SPDX-License-Identifier: GPL-2.0-or-later */ # include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #include <epan/expert.h> #include "packet-ieee80211.h" void proto_register_wifi_display(void); void proto_reg_handoff_wifi_display(void); static int proto_wifi_display = -1; static int hf_wfd_subelem_id = -1; static int hf_wfd_subelem_len = -1; static int hf_wfd_subelem_dev_info_type = -1; static int hf_wfd_subelem_dev_info_coupled_sink_source = -1; static int hf_wfd_subelem_dev_info_coupled_sink_sink = -1; static int hf_wfd_subelem_dev_info_available = -1; static int hf_wfd_subelem_dev_info_wsd = -1; static int hf_wfd_subelem_dev_info_pc = -1; static int hf_wfd_subelem_dev_info_content_protection = -1; static int hf_wfd_subelem_dev_info_time_sync = -1; static int hf_wfd_subelem_dev_info_control_port = -1; static int hf_wfd_subelem_dev_info_max_throughput = -1; static int hf_wfd_subelem_dev_info_audio_unsupp_pri_sink = -1; static int hf_wfd_subelem_dev_info_audio_only_supp_source = -1; static int hf_wfd_subelem_dev_info_tdls_persistent_group = -1; static int hf_wfd_subelem_dev_info_tdls_persistent_group_reinvoke = -1; static int hf_wfd_subelem_dev_info_reserved = -1; static int hf_wfd_subelem_assoc_bssid = -1; static int hf_wfd_subelem_coupled_sink_status_bitmap = -1; static int hf_wfd_subelem_coupled_sink_reserved = -1; static int hf_wfd_subelem_coupled_sink_mac_addr = -1; static int hf_wfd_subelem_session_descr_len = -1; static int hf_wfd_subelem_session_dev_addr = -1; static int hf_wfd_subelem_session_assoc_bssid = -1; static int hf_wfd_subelem_session_dev_info_type = -1; static int hf_wfd_subelem_session_dev_info_coupled_sink_source = -1; static int hf_wfd_subelem_session_dev_info_coupled_sink_sink = -1; static int hf_wfd_subelem_session_dev_info_available = -1; static int hf_wfd_subelem_session_dev_info_wsd = -1; static int hf_wfd_subelem_session_dev_info_pc = -1; static int hf_wfd_subelem_session_dev_info_content_protection = -1; static int hf_wfd_subelem_session_dev_info_time_sync = -1; static int hf_wfd_subelem_session_dev_info_audio_unsupp_pri_sink = -1; static int hf_wfd_subelem_session_dev_info_audio_only_supp_source = -1; static int hf_wfd_subelem_session_dev_info_tdls_persistent_group = -1; static int hf_wfd_subelem_session_dev_info_tdls_persistent_group_reinvoke = -1; static int hf_wfd_subelem_session_dev_info_reserved = -1; static int hf_wfd_subelem_session_dev_info_max_throughput = -1; static int hf_wfd_subelem_session_coupled_sink_status_bitmap = -1; static int hf_wfd_subelem_session_coupled_sink_reserved = -1; static int hf_wfd_subelem_session_coupled_sink_addr = -1; static int hf_wfd_subelem_session_extra_info = -1; static int hf_wfd_subelem_ext_capab = -1; static int hf_wfd_subelem_ext_capab_uibc = -1; static int hf_wfd_subelem_ext_capab_i2c_read_write = -1; static int hf_wfd_subelem_ext_capab_preferred_display_mode = -1; static int hf_wfd_subelem_ext_capab_standby_resume_control = -1; static int hf_wfd_subelem_ext_capab_tdls_persistent = -1; static int hf_wfd_subelem_ext_capab_tdls_persistent_bssid = -1; static int hf_wfd_subelem_ext_capab_reserved = -1; static int hf_wfd_subelem_alt_mac_addr = -1; static gint ett_wfd_subelem = -1; static gint ett_wfd_dev_info_descr = -1; static expert_field ei_wfd_subelem_len_invalid = EI_INIT; static expert_field ei_wfd_subelem_session_descr_invalid = EI_INIT; static expert_field ei_wfd_subelem_id = EI_INIT; static dissector_handle_t wifi_display_ie_handle; enum wifi_display_subelem { WFD_SUBELEM_DEVICE_INFO = 0, WFD_SUBELEM_ASSOCIATED_BSSID = 1, WFD_SUBELEM_AUDIO_FORMATS = 2, WFD_SUBELEM_VIDEO_FORMATS = 3, WFD_SUBELEM_3D_VIDEO_FORMATS = 4, WFD_SUBELEM_CONTENT_PROTECTION = 5, WFD_SUBELEM_COUPLED_SINK = 6, WFD_SUBELEM_EXT_CAPAB = 7, WFD_SUBELEM_LOCAL_IP_ADDRESS = 8, WFD_SUBELEM_SESSION_INFO = 9, WFD_SUBELEM_ALT_MAC_ADDR = 10 }; static const value_string wfd_subelem_ids[] = { { WFD_SUBELEM_DEVICE_INFO, "WFD Device Information" }, { WFD_SUBELEM_ASSOCIATED_BSSID, "Associated BSSID" }, { WFD_SUBELEM_AUDIO_FORMATS, "WFD Audio Formats" }, { WFD_SUBELEM_VIDEO_FORMATS, "WFD Video Formats" }, { WFD_SUBELEM_3D_VIDEO_FORMATS, "WFD 3D Video Formats" }, { WFD_SUBELEM_CONTENT_PROTECTION, "WFD Content Protection" }, { WFD_SUBELEM_COUPLED_SINK, "Coupled Sink Information" }, { WFD_SUBELEM_EXT_CAPAB, "WFD Extended Capability" }, { WFD_SUBELEM_LOCAL_IP_ADDRESS, "Local IP Address" }, { WFD_SUBELEM_SESSION_INFO, "WFD Session Information" }, { WFD_SUBELEM_ALT_MAC_ADDR, "Alternative MAC Address" }, { 0, NULL } }; static const value_string wfd_dev_info_types[] = { { 0, "WFD source" }, { 1, "WFD primary sink" }, { 2, "WFD secondary sink" }, { 3, "WFD source/primary sink" }, { 0, NULL } }; static const value_string wfd_dev_info_avail[] = { { 0, "Not available for WFD Session" }, { 1, "Available for WFD Session" }, { 0, NULL } }; static const value_string wfd_dev_info_pc[] = { { 0, "P2P" }, { 1, "TDLS" }, { 0, NULL } }; static const value_string wfd_coupled_sink_status_bitmap[] = { { 0, "Not coupled/Available for Coupling" }, { 1, "Coupled" }, { 2, "Teardown Coupling" }, { 3, "Reserved" }, { 0, NULL } }; static void dissect_wfd_subelem_device_info(proto_tree *tree, tvbuff_t *tvb, int offset) { proto_tree_add_item(tree, hf_wfd_subelem_dev_info_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_coupled_sink_source, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_coupled_sink_sink, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_available, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_wsd, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_pc, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_content_protection, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_time_sync, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_audio_unsupp_pri_sink, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_audio_only_supp_source, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_tdls_persistent_group, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_tdls_persistent_group_reinvoke, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_dev_info_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_wfd_subelem_dev_info_control_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_wfd_subelem_dev_info_max_throughput, tvb, offset, 2, ENC_BIG_ENDIAN); } static void dissect_wfd_subelem_associated_bssid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int len) { if (len < 6) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Too short Wi-Fi Display Associated BSSID"); return; } proto_tree_add_item(tree, hf_wfd_subelem_assoc_bssid, tvb, offset, 6, ENC_NA); } static void dissect_wfd_subelem_coupled_sink(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int len) { if (len < 1) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Too short Wi-Fi Display Coupled Sink"); return; } proto_tree_add_item(tree, hf_wfd_subelem_coupled_sink_status_bitmap, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_coupled_sink_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); if (len < 1 + 6) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Too short Wi-Fi Display Coupled Sink"); return; } proto_tree_add_item(tree, hf_wfd_subelem_coupled_sink_mac_addr, tvb, offset + 1, 6, ENC_NA); } static void dissect_wfd_subelem_session_info(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint16 len) { int end = offset + len, next; proto_item *item; proto_tree *descr; while (offset < end) { guint8 dlen = tvb_get_guint8(tvb, offset); next = offset + 1 + dlen; descr = proto_tree_add_subtree(tree, tvb, offset, 1 + dlen, ett_wfd_dev_info_descr, &item, "WFD Device Info Descriptor"); if (offset + 1 + dlen > end || dlen < 23) { expert_add_info(pinfo, item, &ei_wfd_subelem_session_descr_invalid); break; } proto_tree_add_item(descr, hf_wfd_subelem_session_descr_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(descr, hf_wfd_subelem_session_dev_addr, tvb, offset, 6, ENC_NA); proto_item_append_text(descr, ": %s", tvb_ether_to_str(pinfo->pool, tvb, offset)); offset += 6; proto_tree_add_item(descr, hf_wfd_subelem_session_assoc_bssid, tvb, offset, 6, ENC_NA); offset += 6; proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_coupled_sink_source, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_coupled_sink_sink, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_available, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_wsd, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_pc, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_content_protection, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_time_sync, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_session_dev_info_audio_unsupp_pri_sink, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_session_dev_info_audio_only_supp_source, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_session_dev_info_tdls_persistent_group, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_session_dev_info_tdls_persistent_group_reinvoke, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_session_dev_info_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(descr, hf_wfd_subelem_session_dev_info_max_throughput, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(descr, hf_wfd_subelem_session_coupled_sink_status_bitmap, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(descr, hf_wfd_subelem_session_coupled_sink_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(descr, hf_wfd_subelem_session_coupled_sink_addr, tvb, offset, 6, ENC_NA); offset += 6; if (offset < next) { proto_tree_add_item(descr, hf_wfd_subelem_session_extra_info, tvb, offset, next - offset, ENC_NA); } offset = next; } } static void dissect_wfd_subelem_ext_capab(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int len) { if (len<2) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Too short Wi-Fi Display Extended Capability"); return; } proto_tree_add_item(tree, hf_wfd_subelem_ext_capab, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_uibc, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_i2c_read_write, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_preferred_display_mode, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_standby_resume_control, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_tdls_persistent, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_tdls_persistent_bssid, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wfd_subelem_ext_capab_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); } static void dissect_wfd_subelem_alt_mac_addr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int len) { if (len<6) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Too short Wi-Fi Display Alternative MAC Address"); return; } proto_tree_add_item(tree, hf_wfd_subelem_alt_mac_addr, tvb, offset, 6, ENC_NA); } static int dissect_wifi_display_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { int end = tvb_reported_length(tvb); int offset = 0; guint8 id; guint16 len; proto_tree *wfd_tree; proto_item *subelem; while (offset < end) { if (end - offset < 2) { expert_add_info_format(pinfo, tree, &ei_wfd_subelem_len_invalid, "Packet too short for Wi-Fi Display subelement"); break; } id = tvb_get_guint8(tvb, offset); len = tvb_get_ntohs(tvb, offset + 1); wfd_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + len, ett_wfd_subelem, &subelem, val_to_str(id, wfd_subelem_ids, "Unknown subelement ID (%u)")); if (offset + 3 + len > end) { expert_add_info_format(pinfo, subelem, &ei_wfd_subelem_len_invalid, "Packet too short for Wi-Fi Display subelement payload"); } proto_tree_add_item(wfd_tree, hf_wfd_subelem_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wfd_tree, hf_wfd_subelem_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; switch (id) { case WFD_SUBELEM_DEVICE_INFO: dissect_wfd_subelem_device_info(wfd_tree, tvb, offset); break; case WFD_SUBELEM_ASSOCIATED_BSSID: dissect_wfd_subelem_associated_bssid(pinfo, wfd_tree, tvb, offset, len); break; case WFD_SUBELEM_COUPLED_SINK: dissect_wfd_subelem_coupled_sink(pinfo, wfd_tree, tvb, offset, len); break; case WFD_SUBELEM_SESSION_INFO: dissect_wfd_subelem_session_info(pinfo, wfd_tree, tvb, offset, len); break; case WFD_SUBELEM_EXT_CAPAB: dissect_wfd_subelem_ext_capab(pinfo, wfd_tree, tvb, offset, len); break; case WFD_SUBELEM_ALT_MAC_ADDR: dissect_wfd_subelem_alt_mac_addr(pinfo, wfd_tree, tvb, offset, len); break; default: expert_add_info(pinfo, subelem, &ei_wfd_subelem_id); break; } offset += len; } return tvb_captured_length(tvb); } void proto_register_wifi_display(void) { static hf_register_info hf[] = { { &hf_wfd_subelem_id, { "Subelement ID", "wifi_display.subelem.id", FT_UINT8, BASE_DEC, VALS(wfd_subelem_ids), 0, NULL, HFILL }}, { &hf_wfd_subelem_len, { "Length", "wifi_display.subelem.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_type, { "Device type", "wifi_display.subelem.dev_info.type", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_types), 0x0003, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_coupled_sink_source, { "Coupled sink operation supported by WFD source", "wifi_display.subelem.dev_info.coupled_sink_by_source", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_coupled_sink_sink, { "Coupled sink operation supported by WFD sink", "wifi_display.subelem.dev_info.coupled_sink_by_sink", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_available, { "Available for WFD Session", "wifi_display.subelem.dev_info.available", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_avail), 0x0030, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_wsd, { "WFD Service Discovery", "wifi_display.subelem.dev_info.wsd", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_pc, { "Preferred Connectivity", "wifi_display.subelem.dev_info.pc", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_pc), 0x0080, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_content_protection, { "Content Protection using HDCP2.0", "wifi_display.subelem.dev_info.content_protection", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_time_sync, { "Time Synchronization using 802.1AS", "wifi_display.subelem.dev_info.time_sync", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_audio_unsupp_pri_sink, { "Audio un-supported at Primary sink", "wifi_display.subelem.session.audio_unsupp_pri_sink", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_audio_only_supp_source, { "Audio only support af WFD source", "wifi_display.subelem.session.audio_only_supp_source", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_tdls_persistent_group, { "TDLS Persistent Group", "wifi_display.subelem.session.tdls_persistent_group", FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_tdls_persistent_group_reinvoke, { "TDLS Persistent Group Re-invoke", "wifi_display.subelem.session.tdls_persistent_group_reinvoke", FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_reserved, { "Reserved", "wifi_display.subelem.session.reserved", FT_UINT16, BASE_DEC, NULL, 0xc000, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_control_port, { "Session Management Control Port", "wifi_display.subelem.dev_info.control_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_dev_info_max_throughput, { "WFD Device Maximum Throughput (Mbps)", "wifi_display.subelem.dev_info.max_throughput", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_assoc_bssid, { "Associated BSSID", "wifi_display.subelem.assoc_bssid.bssid", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_coupled_sink_status_bitmap, { "Coupled Sink Status bitmap", "wifi_display.subelem.coupled_sink.status", FT_UINT8, BASE_DEC, VALS(wfd_coupled_sink_status_bitmap), 0x03, NULL, HFILL }}, { &hf_wfd_subelem_coupled_sink_reserved, { "Reserved", "wifi_display.subelem.coupled_sink.reserved", FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL }}, { &hf_wfd_subelem_coupled_sink_mac_addr, { "Coupled Sink MAC Address", "wifi_display.subelem.coupled_sink.mac_addr", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_descr_len, { "Descriptor length", "wifi_display.subelem.session.descr_len", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_addr, { "Device address", "wifi_display.subelem.session.device_address", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_assoc_bssid, { "Associated BSSID", "wifi_display.subelem.session.associated_bssid", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_type, { "Device type", "wifi_display.subelem.session.type", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_types), 0x0003, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_coupled_sink_source, { "Coupled sink operation supported by WFD source", "wifi_display.subelem.session.coupled_sink_by_source", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_coupled_sink_sink, { "Coupled sink operation supported by WFD sink", "wifi_display.subelem.session.coupled_sink_by_sink", FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_available, { "Available for WFD Session", "wifi_display.subelem.session.available", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_avail), 0x0030, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_wsd, { "WFD Service Discovery", "wifi_display.subelem.session.wsd", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_pc, { "Preferred Connectivity", "wifi_display.subelem.session.pc", FT_UINT16, BASE_DEC, VALS(wfd_dev_info_pc), 0x0080, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_content_protection, { "Content Protection using HDCP2.0", "wifi_display.subelem.session.content_protection", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_time_sync, { "Time Synchronization using 802.1AS", "wifi_display.subelem.session.time_sync", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_audio_unsupp_pri_sink, { "Audio un-supported at Primary sink", "wifi_display.subelem.session.audio_unsupp_pri_sink", FT_BOOLEAN, 16, NULL, 0x0400, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_audio_only_supp_source, { "Audio only support af WFD source", "wifi_display.subelem.session.audio_only_supp_source", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_tdls_persistent_group, { "TDLS Persistent Group", "wifi_display.subelem.session.tdls_persistent_group", FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_tdls_persistent_group_reinvoke, { "TDLS Persistent Group Re-invoke", "wifi_display.subelem.session.tdls_persistent_group_reinvoke", FT_BOOLEAN, 16, NULL, 0x2000, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_reserved, { "Reserved", "wifi_display.subelem.session.reserved", FT_UINT16, BASE_DEC, NULL, 0xc000, NULL, HFILL }}, { &hf_wfd_subelem_session_dev_info_max_throughput, { "WFD Device Maximum Throughput (Mbps)", "wifi_display.subelem.session.max_throughput", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_coupled_sink_status_bitmap, { "Coupled Sink Status bitmap", "wifi_display.subelem.session.coupled_sink_status", FT_UINT8, BASE_DEC, VALS(wfd_coupled_sink_status_bitmap), 0x03, NULL, HFILL }}, { &hf_wfd_subelem_session_coupled_sink_reserved, { "Reserved", "wifi_display.subelem.session.coupled_sink.reserved", FT_UINT8, BASE_DEC, NULL, 0xfc, NULL, HFILL }}, { &hf_wfd_subelem_session_coupled_sink_addr, { "Coupled peer sink address", "wifi_display.subelem.session.coupled_peer_sink_addr", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_session_extra_info, { "Extra info in the end of descriptor", "wifi_display.subelem.session.extra_info", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab, { "WFD Extended Capability Bitmap", "wifi_display.subelem.ext_capab", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_uibc, { "User Input Back Channel(UIBC)", "wifi_display.subelem.ext_capab.uibc", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0001, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_i2c_read_write, { "I2C Read/Write", "wifi_display.subelem.ext_capab.i2c_read_write", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0002, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_preferred_display_mode, { "Preferred Display Mode", "wifi_display.subelem.ext_capab.preferred_display_mode", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0004, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_standby_resume_control, { "Standby and Resume Control", "wifi_display.subelem.ext_capab.standby_resume_control", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0008, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_tdls_persistent, { "TDLS Persistent", "wifi_display.subelem.ext_capab.tdls_persistent", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0010, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_tdls_persistent_bssid, { "TDLS Persistent BSSID", "wifi_display.subelem.ext_capab.tdls_persistent_bssid", FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0020, NULL, HFILL }}, { &hf_wfd_subelem_ext_capab_reserved, { "Reserved", "wifi_display.subelem.ext_capab.reserved", FT_UINT16, BASE_HEX, NULL, 0xffc0, NULL, HFILL }}, { &hf_wfd_subelem_alt_mac_addr, { "Alternative MAC Address", "wifi_display.subelem.alt_mac_addr", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, }; static gint *ett[] = { &ett_wfd_subelem, &ett_wfd_dev_info_descr }; static ei_register_info ei[] = { { &ei_wfd_subelem_len_invalid, { "wifi_display.subelem.length.invalid", PI_MALFORMED, PI_ERROR, "Subelement length invalid", EXPFILL }}, { &ei_wfd_subelem_session_descr_invalid, { "wifi_display.subelem.session.descr_invalid", PI_MALFORMED, PI_ERROR, "Invalid WFD Device Info Descriptor", EXPFILL }}, { &ei_wfd_subelem_id, { "wifi_display.subelem.id.unknown", PI_PROTOCOL, PI_WARN, "Unknown subelement payload", EXPFILL }}, }; expert_module_t* expert_wifi_display; proto_wifi_display = proto_register_protocol("Wi-Fi Display", "WFD", "wifi_display"); proto_register_field_array(proto_wifi_display, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wifi_display = expert_register_protocol(proto_wifi_display); expert_register_field_array(expert_wifi_display, ei, array_length(ei)); wifi_display_ie_handle = register_dissector("wifi_display_ie", dissect_wifi_display_ie, proto_wifi_display); } void proto_reg_handoff_wifi_display(void) { dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_WIFI_DISPLAY, wifi_display_ie_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wifi-dpp.c
/* packet-wifi-dpp.c * * Wi-Fi Device Provisioning Protocol (DPP) * * Copyright 2017-2020 Richard Sharpe <[email protected]> * Copyright 2017-2020 The WiFi Alliance * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Code and constants based on Device_Provisioning_Protocol_Specification_v1.2.9 */ #include "config.h" #include <epan/packet.h> #include "packet-tcp.h" #include <epan/to_str.h> #include <epan/expert.h> #include "packet-wifi-dpp.h" #include "packet-ieee80211.h" extern const value_string wfa_subtype_vals[]; void proto_register_wifi_dpp(void); void proto_reg_handoff_wifi_dpp(void); #define WIFI_DPP_TCP_PORT (7871) static guint wifi_dpp_tcp_port = WIFI_DPP_TCP_PORT; enum { DPP_STATUS_OK = 0, DPP_STATUS_NOT_COMPATIBLE = 1, DPP_STATUS_AUTH_FAILURE = 2, DPP_STATUS_UNWRAP_FAILURE = 3, DPP_STATUS_BAD_GROUP = 4, DPP_STATUS_CONFIGURE_FAILURE = 5, DPP_STATUS_RESPONSE_PENDING = 6, DPP_STATUS_INVALID_CONNECTOR = 7, DPP_STATUS_NO_MATCH = 8, DPP_STATUS_CONFIG_REJECTED = 9, DPP_STATUS_NO_AP = 10, DPP_STATUS_CONFIGURE_PENDING = 11, DPP_STATUS_CSR_NEEDED = 12, DPP_STATUS_CSR_BAD = 13 }; static const value_string dpp_status_codes[] = { { DPP_STATUS_OK, "OK" }, { DPP_STATUS_NOT_COMPATIBLE, "Not Compatible" }, { DPP_STATUS_AUTH_FAILURE, "Auth Failure" }, { DPP_STATUS_UNWRAP_FAILURE, "Unwrap Failure" }, { DPP_STATUS_BAD_GROUP, "Bad Group" }, { DPP_STATUS_CONFIGURE_FAILURE, "Configure Failure" }, { DPP_STATUS_RESPONSE_PENDING, "Response Pending" }, { DPP_STATUS_INVALID_CONNECTOR, "Invalid Connector" }, { DPP_STATUS_NO_MATCH, "No Match" }, { DPP_STATUS_CONFIG_REJECTED, "Enrollee rejected the config" }, { DPP_STATUS_NO_AP, "Enrollee failed to discover an AP" }, { DPP_STATUS_CONFIGURE_PENDING, "Configuration response is not ready yet. The enrollee needs to request again." }, { DPP_STATUS_CSR_NEEDED, "Configuration requires a Certificate Signing Request. Enrollee needs to request again." }, { DPP_STATUS_CSR_BAD, "The Certificate Signing Request was invalid." }, { DPP_STATUS_OK, "OK" }, { DPP_STATUS_NOT_COMPATIBLE, "Not Compatible" }, { DPP_STATUS_AUTH_FAILURE, "Auth Failure" }, { DPP_STATUS_UNWRAP_FAILURE, "Unwrap Failure" }, { DPP_STATUS_BAD_GROUP, "Bad Group" }, { DPP_STATUS_CONFIGURE_FAILURE, "Configure Failure" }, { DPP_STATUS_RESPONSE_PENDING, "Response Pending" }, { 0, NULL } }; enum { DPP_STATUS = 0x1000, DPP_INITIATOR_BOOTSTRAPPING_KEY_HASH = 0x1001, DPP_RESPONDER_BOOTSTRAPPING_KEY_HASH = 0x1002, DPP_INITIATOR_PROTOCOL_KEY = 0x1003, DPP_WRAPPED_DATA = 0x1004, DPP_INITIATOR_NONCE = 0x1005, DPP_INITIATOR_CAPABILITIES = 0x1006, DPP_RESPONDER_NONCE = 0x1007, DPP_RESPONDER_CAPABILITIES = 0x1008, DPP_RESPONDER_PROTOCOL_KEY = 0x1009, DPP_INITIATOR_AUTHENTICATING_TAG = 0x100A, DPP_RESPONDER_AUTHENTICATING_TAG = 0x100B, DPP_CONFIGURATION_OBJECT = 0x100C, DPP_CONNECTOR = 0x100D, DPP_CONFIGURATION_ATTRIBUTES_OBJECT = 0x100E, DPP_BOOTSTRAPPING_KEY = 0x100F, DPP_FINITE_CYCLIC_GROUP = 0x1012, DPP_ENCRYPTED_KEY = 0x1013, DPP_ENROLLEE_NONCE = 0x1014, DPP_CODE_IDENTIFIER = 0x1015, DPP_TRANSACTION_ID = 0x1016, DPP_BOOTSTRAPPING_INFO = 0x1017, DPP_CHANNEL = 0x1018, DPP_PROTOCOL_VERSION = 0x1019, DPP_ENVELOPEDATA = 0x101A, DPP_SENDCONNSTATUS = 0x101B, DPP_CONNSTATUS = 0x101C, DPP_RECONFIG_FLAGS = 0x101D, DPP_C_SIGN_KEY_HASH = 0x101E, DPP_CSR_ATTRIBUTES_REQUEST = 0x101F, DPP_A_NONCE = 0x1020, DPP_E_PRIME_ID = 0x1021 }; static const value_string dpp_ie_attr_ids[] = { { DPP_STATUS, "DPP Status" }, { DPP_INITIATOR_BOOTSTRAPPING_KEY_HASH, "DPP Initiator Bootstrapping Key Hash" }, { DPP_RESPONDER_BOOTSTRAPPING_KEY_HASH, "DPP Responder Bootstrapping Key Hash" }, { DPP_INITIATOR_PROTOCOL_KEY, "DPP Initiator Protocol Key" }, { DPP_WRAPPED_DATA, "DPP Primary Wrapped Data" }, { DPP_INITIATOR_NONCE, "DPP Initiator Nonce" }, { DPP_INITIATOR_CAPABILITIES, "DPP Initiator Capabilities" }, { DPP_RESPONDER_NONCE, "DPP Responder Nonce" }, { DPP_RESPONDER_CAPABILITIES, "DPP Responder Capabilities" }, { DPP_RESPONDER_PROTOCOL_KEY, "DPP Responder Protocol Key" }, { DPP_INITIATOR_AUTHENTICATING_TAG, "DPP Initiator Authenticating Tag" }, { DPP_RESPONDER_AUTHENTICATING_TAG, "DPP Responder Authenticating Tag" }, { DPP_CONFIGURATION_OBJECT, "DPP Configuration Object" }, { DPP_CONNECTOR, "DPP Connector" }, { DPP_CONFIGURATION_ATTRIBUTES_OBJECT, "DPP Configuration Attributes Object" }, { DPP_BOOTSTRAPPING_KEY, "DPP Bootstrapping Key" }, { DPP_FINITE_CYCLIC_GROUP, "DPP Finite Cyclic Group" }, { DPP_ENCRYPTED_KEY, "DPP Encrypted Key" }, { DPP_CODE_IDENTIFIER, "DPP Code Identifier" }, { DPP_TRANSACTION_ID, "DPP Transaction ID" }, { DPP_BOOTSTRAPPING_INFO, "DPP Bootstrapping Info" }, { DPP_CHANNEL, "DPP Channel" }, { DPP_PROTOCOL_VERSION, "DPP Protocol Version" }, { DPP_ENVELOPEDATA, "DPP Enveloped Data" }, { DPP_SENDCONNSTATUS, "DPP Send Conn Status" }, { DPP_CONNSTATUS, "DPP Conn Status" }, { DPP_RECONFIG_FLAGS, "DPP Reconfig Flags" }, { DPP_C_SIGN_KEY_HASH, "DPP C-sign key Hash" }, { DPP_CSR_ATTRIBUTES_REQUEST, "DPP CSR Attributes Request" }, { DPP_A_NONCE, "DPP A-NONCE" }, { DPP_E_PRIME_ID, "DPP E'-id" }, { 0, NULL } }; enum { DPP_AUTHENTICATION_REQUEST = 0, DPP_AUTHENTICATION_RESPONSE = 1, DPP_AUTHENTICATION_CONFIRM = 2, DPP_PEER_DISCOVERY_REQUEST = 5, DPP_PEER_DISCOVERY_RESPONSE = 6, DPP_PKEX_EXCHANGE_REQUEST = 7, DPP_PKEX_EXCHANGE_RESPONSE = 8, DPP_PKEX_COMMIT_REVEAL_REQUEST = 9, DPP_PKEX_COMMIT_REVEAL_RESPONSE = 10, DPP_CONFIGURATION_RESULT = 11, DPP_CONNECTION_STATUS_RESULT = 12, DPP_PRESENCE_ANNOUNCEMENT = 13, DPP_RECONFIG_ANNOUNCEMENT = 14, DPP_RECONFIG_AUTH_REQUEST = 15, DPP_RECONFIG_AUTH_RESPONSE = 16, DPP_RECONFIG_AUTH_CONFIRM = 17 }; static const value_string dpp_public_action_subtypes[] = { { DPP_AUTHENTICATION_REQUEST, "Authentication Request" }, { DPP_AUTHENTICATION_RESPONSE, "Authentication Response" }, { DPP_AUTHENTICATION_CONFIRM, "Authentication Confirm" }, { DPP_PEER_DISCOVERY_REQUEST, "Peer Discovery Request" }, { DPP_PEER_DISCOVERY_RESPONSE, "Peer Discovery Response" }, { DPP_PKEX_EXCHANGE_REQUEST, "PKEX Exchange Request" }, { DPP_PKEX_EXCHANGE_RESPONSE, "PKEX Exchange Response" }, { DPP_PKEX_COMMIT_REVEAL_REQUEST, "PKEX Commit-Reveal Request" }, { DPP_PKEX_COMMIT_REVEAL_RESPONSE, "PKEX Commit-Reveal Response" }, { DPP_CONFIGURATION_RESULT, "Configuration Result" }, { DPP_CONNECTION_STATUS_RESULT, "Connection Status Result" }, { DPP_PRESENCE_ANNOUNCEMENT, "Presence Announcement" }, { DPP_RECONFIG_ANNOUNCEMENT, "Reconfig Announcement" }, { DPP_RECONFIG_AUTH_REQUEST, "Reconfig Authentication Request" }, { DPP_RECONFIG_AUTH_RESPONSE, "Reconfig Authentication Response" }, { DPP_RECONFIG_AUTH_CONFIRM, "Reconfig Authentication Confirm" }, { 0, NULL } }; /* * This table and the one above share values ... but this one is truncated. */ static const value_string dpp_action_subtypes[] = { { DPP_AUTHENTICATION_REQUEST, "Authentication Request" }, { DPP_AUTHENTICATION_RESPONSE, "Authentication Response" }, { DPP_AUTHENTICATION_CONFIRM, "Authentication Confirm" }, { DPP_PEER_DISCOVERY_REQUEST, "Peer Discovery Request" }, { DPP_PEER_DISCOVERY_RESPONSE, "Peer Discovery Response" }, { 0, NULL } }; static const range_string dpp_protocol_version_rvals[] = { { 0, 0, "Reserved" }, { 1, 1, "1.0" }, { 2, 255, "Reserved" }, { 0, 0, NULL } }; static int proto_wifi_dpp = -1; static gint ett_wifi_dpp_ie_generic = -1; static gint ett_wifi_dpp_attributes = -1; static gint ett_wifi_dpp_pa = -1; static gint ett_wifi_dpp_attribute = -1; static gint ett_wifi_dpp_attr_header = -1; static gint ett_wifi_dpp_attr_value = -1; static int hf_wifi_dpp_ie_attr_id = -1; static int hf_wifi_dpp_ie_attr_len = -1; static int hf_wifi_dpp_ie_generic = -1; /* Remove eventually */ static int hf_wifi_dpp_action_dialog_token = -1; static int hf_wifi_dpp_action_subtype = -1; static int hf_wifi_dpp_crypto_suite = -1; static int hf_wifi_dpp_public_action_subtype = -1; static int hf_wifi_dpp_init_hash = -1; static int hf_wifi_dpp_resp_hash = -1; static int hf_wifi_dpp_status = -1; static int hf_wifi_dpp_key_x = -1; static int hf_wifi_dpp_key_y = -1; static int hf_wifi_dpp_trans_id = -1; static int hf_wifi_dpp_finite_cyclic_group = -1; static int hf_wifi_dpp_capabilities = -1; static int hf_wifi_dpp_code_identifier = -1; static int hf_wifi_dpp_enc_key_attribute = -1; static int hf_wifi_dpp_primary_wrapped_data = -1; static int hf_wifi_dpp_connector_attr = -1; static int hf_wifi_dpp_initiator_nonce = -1; static int hf_wifi_dpp_operating_class = -1; static int hf_wifi_dpp_channel = -1; static int hf_wifi_dpp_protocol_version = -1; static int hf_wifi_dpp_a_nonce = -1; static int hf_wifi_dpp_e_prime_id = -1; static int hf_wifi_dpp_unknown_anqp_item = -1; static int hf_wifi_dpp_tcp_pdu_length = -1; static int hf_wifi_dpp_tcp_pdu_action_field = -1; static int hf_wifi_dpp_tcp_oui = -1; static int hf_wifi_dpp_tcp_oui_type = -1; static int hf_wifi_dpp_tcp_dialog_token = -1; static int hf_wifi_dpp_tcp_adv_proto_elt = -1; static int hf_wifi_dpp_tcp_vendor_specific = -1; static int hf_wifi_dpp_tcp_vendor_spec_len = -1; static int hf_wifi_dpp_tcp_config = -1; static int hf_wifi_dpp_tcp_query_req_len = -1; static int hf_wifi_dpp_tcp_status_code = -1; static int hf_wifi_dpp_gas_query_resp_frag_id = -1; static int hf_wifi_dpp_tcp_comeback_delay = -1; static int hf_wifi_dpp_tcp_query_resp_len = -1; static int dissect_wifi_dpp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { int offset = 0; proto_tree_add_item(tree, hf_wifi_dpp_unknown_anqp_item, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA); return tvb_captured_length(tvb); } static int dissect_wifi_dpp_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *ie; guint remaining_len = tvb_reported_length(tvb); ie = proto_tree_add_subtree(tree, tvb, 0, remaining_len, ett_wifi_dpp_ie_generic, NULL, "Generic DPP IE"); proto_tree_add_item(ie, hf_wifi_dpp_ie_generic, tvb, 0, remaining_len, ENC_NA); return tvb_captured_length(tvb); } static int dissect_wifi_dpp_attributes(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset _U_) { proto_item *si = NULL; guint8 status; proto_tree *attr, *specific_attr, *attr_hdr; guint16 attribute_id; guint16 attribute_len; guint attributes_len = 0; guint remaining_len = tvb_reported_length_remaining(tvb, offset); while (remaining_len) { attribute_id = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); attribute_len = tvb_get_guint16(tvb, offset + 2, ENC_LITTLE_ENDIAN); attr = proto_tree_add_subtree_format(tree, tvb, offset, attribute_len + 4, ett_wifi_dpp_attribute, &si, "%s Attribute", val_to_str(attribute_id, dpp_ie_attr_ids, "Unknown (%u)")); attr_hdr = proto_tree_add_subtree(attr, tvb, offset, 4, ett_wifi_dpp_attr_header, NULL, "Attribute Header"); proto_tree_add_item(attr_hdr, hf_wifi_dpp_ie_attr_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(attr_hdr, hf_wifi_dpp_ie_attr_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; specific_attr = proto_tree_add_subtree(attr, tvb, offset, attribute_len, ett_wifi_dpp_attr_value, NULL, "Attribute Value"); switch (attribute_id) { case DPP_STATUS: status = tvb_get_guint8(tvb, offset); proto_item_append_text(si, ": %s", val_to_str(status, dpp_status_codes, "Unknown (%u)")); proto_tree_add_item(specific_attr, hf_wifi_dpp_status, tvb, offset, attribute_len, ENC_LITTLE_ENDIAN); break; case DPP_INITIATOR_BOOTSTRAPPING_KEY_HASH: proto_tree_add_item(specific_attr, hf_wifi_dpp_init_hash, tvb, offset, attribute_len, ENC_NA); break; case DPP_RESPONDER_BOOTSTRAPPING_KEY_HASH: proto_tree_add_item(specific_attr, hf_wifi_dpp_resp_hash, tvb, offset, attribute_len, ENC_NA); break; case DPP_RESPONDER_PROTOCOL_KEY: case DPP_INITIATOR_PROTOCOL_KEY: // This is two protocol keys of equal length, X then Y. proto_tree_add_item(specific_attr, hf_wifi_dpp_key_x, tvb, offset, attribute_len/2, ENC_NA); proto_tree_add_item(specific_attr, hf_wifi_dpp_key_y, tvb, offset + attribute_len/2, attribute_len/2, ENC_NA); break; case DPP_TRANSACTION_ID: proto_tree_add_item(specific_attr, hf_wifi_dpp_trans_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case DPP_FINITE_CYCLIC_GROUP: case DPP_RESPONDER_CAPABILITIES: proto_tree_add_item(specific_attr, hf_wifi_dpp_finite_cyclic_group, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; case DPP_INITIATOR_CAPABILITIES: proto_tree_add_item(specific_attr, hf_wifi_dpp_capabilities, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case DPP_CODE_IDENTIFIER: proto_tree_add_item(specific_attr, hf_wifi_dpp_code_identifier, tvb, offset, attribute_len, ENC_UTF_8); break; case DPP_ENCRYPTED_KEY: proto_tree_add_item(specific_attr, hf_wifi_dpp_enc_key_attribute, tvb, offset, attribute_len, ENC_NA); break; case DPP_WRAPPED_DATA: proto_tree_add_item(specific_attr, hf_wifi_dpp_primary_wrapped_data, tvb, offset, attribute_len, ENC_NA); break; case DPP_CONNECTOR: proto_tree_add_item(specific_attr, hf_wifi_dpp_connector_attr, tvb, offset, attribute_len, ENC_NA); break; case DPP_INITIATOR_NONCE: proto_tree_add_item(specific_attr, hf_wifi_dpp_initiator_nonce, tvb, offset, attribute_len, ENC_NA); break; case DPP_CHANNEL: proto_tree_add_item(specific_attr, hf_wifi_dpp_operating_class, tvb, offset, 1, ENC_NA); proto_tree_add_item(specific_attr, hf_wifi_dpp_channel, tvb, offset + 1, 1, ENC_NA); break; case DPP_PROTOCOL_VERSION: proto_tree_add_item(specific_attr, hf_wifi_dpp_protocol_version, tvb, offset, 1, ENC_NA); break; case DPP_A_NONCE: proto_tree_add_item(specific_attr, hf_wifi_dpp_a_nonce, tvb, offset, attribute_len, ENC_NA); break; case DPP_E_PRIME_ID: proto_tree_add_item(specific_attr, hf_wifi_dpp_e_prime_id, tvb, offset, attribute_len, ENC_NA); break; case DPP_INITIATOR_AUTHENTICATING_TAG: case DPP_RESPONDER_AUTHENTICATING_TAG: case DPP_CONFIGURATION_OBJECT: case DPP_CONFIGURATION_ATTRIBUTES_OBJECT: case DPP_BOOTSTRAPPING_KEY: case DPP_ENROLLEE_NONCE: default: proto_tree_add_item(specific_attr, hf_wifi_dpp_ie_generic, tvb, offset, attribute_len, ENC_NA); break; } offset += attribute_len; attributes_len += attribute_len + 4; remaining_len -= (attribute_len + 4); } return attributes_len; // We return the attribute length plus hdr! } int dissect_wifi_dpp_config_proto(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int offset _U_) { proto_item *dpp_item; proto_tree *dpp_tree, *attr_tree; guint remaining_len = tvb_reported_length_remaining(tvb, offset); dpp_item = proto_tree_add_item(tree, proto_wifi_dpp, tvb, offset, -1, ENC_NA); dpp_tree = proto_item_add_subtree(dpp_item, ett_wifi_dpp_pa); proto_item_append_text(dpp_item, " Configuration"); attr_tree = proto_tree_add_subtree_format(dpp_tree, tvb, offset, remaining_len, ett_wifi_dpp_attributes, NULL, "DPP Attributes"); offset = dissect_wifi_dpp_attributes(pinfo, attr_tree, tvb, offset); return offset; } int dissect_wifi_dpp_public_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 subtype; guint remaining_len; proto_item *dpp_item; proto_tree *dpp_tree, *attr_tree; guint16 attributes_len; int offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "wifi_dpp"); /* The Crypto suite comes before the DPP frame type */ subtype = tvb_get_guint8(tvb, offset + 1); col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s", val_to_str(subtype, dpp_public_action_subtypes, "Unknown (%u)")); remaining_len = tvb_reported_length_remaining(tvb, offset); dpp_item = proto_tree_add_item(tree, proto_wifi_dpp, tvb, offset, -1, ENC_NA); dpp_tree = proto_item_add_subtree(dpp_item, ett_wifi_dpp_pa); proto_item_append_text(dpp_item, ": %s", val_to_str(subtype, dpp_public_action_subtypes, "Unknown (%u)")); proto_tree_add_item(dpp_tree, hf_wifi_dpp_crypto_suite, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; remaining_len--; proto_tree_add_item(dpp_tree, hf_wifi_dpp_public_action_subtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* Skip the OUI Subtype/DPP Request type */ remaining_len--; if (remaining_len) { attr_tree = proto_tree_add_subtree_format(dpp_tree, tvb, offset, remaining_len, ett_wifi_dpp_attributes, NULL, "DPP Attributes"); attributes_len = dissect_wifi_dpp_attributes(pinfo, attr_tree, tvb, offset); offset += attributes_len; } return offset; } static int dissect_wifi_dpp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { int offset = 0; guint8 action; tvbuff_t *newtvb; col_set_str(pinfo->cinfo, COL_PROTOCOL, "dpp"); /* * We get a length, followed by Action field, OUI, OUI type and then a * DPP public action */ proto_tree_add_item(tree, hf_wifi_dpp_tcp_pdu_length, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; action = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_wifi_dpp_tcp_pdu_action_field, tvb, offset, 1, ENC_NA); offset += 1; if (action == 0x09) { proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui, tvb, offset, 3, ENC_NA); offset += 3; proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui_type, tvb, offset, 1, ENC_NA); offset += 1; newtvb = tvb_new_subset_remaining(tvb, offset); offset += dissect_wifi_dpp_public_action(newtvb, pinfo, tree, NULL); } else if (action == 0x0a) { col_append_str(pinfo->cinfo, COL_INFO, ", DPP - Configuration Request"); proto_tree_add_item(tree, hf_wifi_dpp_tcp_dialog_token, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_adv_proto_elt, tvb, offset, 3, ENC_NA); offset += 3; proto_tree_add_item(tree, hf_wifi_dpp_tcp_vendor_specific, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_vendor_spec_len, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui, tvb, offset, 3, ENC_NA); offset += 3; proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_config, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_query_req_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; offset += dissect_wifi_dpp_config_proto(pinfo, tree, tvb, offset); } else if (action == 0x0b || action == 0x0d) { guint16 qr_len; col_append_str(pinfo->cinfo, COL_INFO, ", DPP - Configuration Response"); proto_tree_add_item(tree, hf_wifi_dpp_tcp_dialog_token, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_status_code, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (action == 0x0d) { proto_tree_add_item(tree, hf_wifi_dpp_gas_query_resp_frag_id, tvb, offset, 1, ENC_NA); offset += 1; } proto_tree_add_item(tree, hf_wifi_dpp_tcp_comeback_delay, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_wifi_dpp_tcp_adv_proto_elt, tvb, offset, 3, ENC_NA); offset += 3; proto_tree_add_item(tree, hf_wifi_dpp_tcp_vendor_specific, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_vendor_spec_len, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui, tvb, offset, 3, ENC_NA); offset += 3; proto_tree_add_item(tree, hf_wifi_dpp_tcp_oui_type, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wifi_dpp_tcp_config, tvb, offset, 1, ENC_NA); offset += 1; qr_len = tvb_get_letohs(tvb, offset); proto_tree_add_item(tree, hf_wifi_dpp_tcp_query_resp_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; if (qr_len) { offset += dissect_wifi_dpp_config_proto(pinfo, tree, tvb, offset); } } return offset; } static guint get_wifi_dpp_tcp_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint pkt_len; pkt_len = tvb_get_ntohl(tvb, offset); return pkt_len + 4; } /* * We need 4 bytes for the length ... */ #define DPP_TCP_HEADER_LEN 4 static int dissect_wifi_dpp_tcp_pdus(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { if (!tvb_bytes_exist(tvb, 0, DPP_TCP_HEADER_LEN)) return 0; tcp_dissect_pdus(tvb, pinfo, tree, TRUE, DPP_TCP_HEADER_LEN, get_wifi_dpp_tcp_len, dissect_wifi_dpp_tcp_pdu, data); return tvb_reported_length(tvb); } void proto_register_wifi_dpp(void) { static module_t *wifi_dpp_module; static hf_register_info hf[] = { { &hf_wifi_dpp_status, { "Wi-Fi DPP Status", "dpp.status", FT_UINT8, BASE_HEX, VALS(dpp_status_codes), 0x0, NULL, HFILL }}, { &hf_wifi_dpp_init_hash, { "Wi-Fi DPP Initiator Hash", "dpp.init.hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_resp_hash, { "Wi-Fi DPP Responder Hash", "dpp.resp.hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_key_x, { "Wi-Fi DPP Key X value", "dpp.key.x", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_key_y, { "Wi-Fi DPP Key Y value", "dpp.key.y", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_trans_id, { "Wi-Fi DPP Transaction ID", "dpp.trans_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_finite_cyclic_group, { "Wi-Fi DPP Finite Cyclic Group", "dpp.finite_cyclic_group", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_capabilities, { "Wi-Fi DPP Capabilities", "dpp.capabilities", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_code_identifier, { "Wi-Fi DPP Code Identifier", "dpp.code_identifier", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_enc_key_attribute, { "Wi-Fi DPP Encrypted Key Attribute", "dpp.pkex.enckey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_primary_wrapped_data, { "Wi-Fi DPP Primary Wrapped Data", "dpp.primary.wrapped_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_connector_attr, { "Wi-Fi DPP Connector Attribute", "dpp.connector_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_initiator_nonce, { "Wi-Fi DPP Initiator Nonce", "dpp.initiator_nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_operating_class, { "Operating Class", "dpp.operating_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_channel, { "Channel", "dpp.channel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_protocol_version, { "Protocol Version", "dpp.protocol_version", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(dpp_protocol_version_rvals), 0x0, NULL, HFILL }}, { &hf_wifi_dpp_a_nonce, { "A-NONCE", "dpp.a_nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_e_prime_id, { "E'-id", "dpp.e_prime_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_ie_attr_id, { "Wi-Fi DPP IE Attribute ID", "dpp.ie.attr_id", FT_UINT16, BASE_HEX, VALS(dpp_ie_attr_ids), 0x0, NULL, HFILL }}, { &hf_wifi_dpp_ie_attr_len, { "Wi-Fi DPP IE Attribute Len", "dpp.ie.attr_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_ie_generic, { "Wi-Fi DPP IE generic", "dpp.ie.generic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_action_subtype, { "Wi-Fi DPP Action Subtype", "dpp.action.subtype", FT_UINT8, BASE_DEC, VALS(dpp_action_subtypes), 0x0, NULL, HFILL }}, { &hf_wifi_dpp_action_dialog_token, { "Wi-Fi DPP Action Dialog Token", "dpp.action.dialog_token", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_crypto_suite, { "Wi-Fi DPP Cryptographic Suite", "dpp.public_action.crypto_suite", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_public_action_subtype, { "Wi-Fi DPP Public Action Subtype", "dpp.public_action.subtype", FT_UINT8, BASE_DEC, VALS(dpp_public_action_subtypes), 0x0, NULL, HFILL }}, { &hf_wifi_dpp_unknown_anqp_item, { "Wi-fi DPP Unknown ANQP Item", "dpp.unknown_anqp_item", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_pdu_length, { "DPP TCP PDU length", "dpp.tcp.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_pdu_action_field, { "DPP TCP PDU Action type", "dpp.tcp.action_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_oui, { "DPP TCP PDU OUI", "dpp.tcp.oui", FT_UINT24, BASE_OUI, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_oui_type, { "DPP TCP PDU OUI type", "dpp.tcp.oui_type", FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_dialog_token, { "DPP TCP PDU Dialog Token", "dpp.tcp.dialog_token", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_adv_proto_elt, { "DPP TCP PDU Advertisement Protocol Element", "dpp.tcp.adv_proto_elt", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_vendor_specific, { "DPP TCP PDU Vendor Specific tag", "dpp.tcp.vendor_spec_tag", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_vendor_spec_len, { "DPP TCP PDU Vendor Specific len", "dpp.tcp.vendor_spec_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_config, { "DPP TCP PDU Configuration", "dpp.tcp.config", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_query_req_len, { "DPP TCP PDU Query Req len", "dpp.tcp.query_req_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_gas_query_resp_frag_id, { "DPP TCP PDU GAS Query Response Fragment ID", "dpp.tp.query_resp_frag_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_status_code, { "DPP TCP PDU Status Code", "dpp.tcp.status_code", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_comeback_delay, { "DPP TCP PDU Comeback Delay", "dpp.tcp.comeback_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wifi_dpp_tcp_query_resp_len, { "DPP TCP PDU Query Resp Len", "dpp.tcp.query_resp_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_wifi_dpp_ie_generic, &ett_wifi_dpp_attributes, &ett_wifi_dpp_pa, &ett_wifi_dpp_attribute, &ett_wifi_dpp_attr_header, &ett_wifi_dpp_attr_value, }; proto_wifi_dpp = proto_register_protocol("Wi-Fi Device Provisioning Protocol", "Wi-Fi DPP", "dpp"); proto_register_field_array(proto_wifi_dpp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register the preferred TCP port? Is there one? */ wifi_dpp_module = prefs_register_protocol(proto_wifi_dpp, NULL); prefs_register_uint_preference(wifi_dpp_module, "tcp.port", "DPP TCP Port", "The TCP port DPP over TCP uses", 10, &wifi_dpp_tcp_port); } void proto_reg_handoff_wifi_dpp(void) { static gboolean initialized = FALSE; static dissector_handle_t wifi_dpp_tcp_handle; static int current_port; dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_DPP, create_dissector_handle(dissect_wifi_dpp, proto_wifi_dpp)); dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_DPP, create_dissector_handle(dissect_wifi_dpp_ie, proto_wifi_dpp)); dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_SUBTYPE_DPP, create_dissector_handle(dissect_wifi_dpp_public_action, proto_wifi_dpp)); /* * Register the TCP port */ if (!initialized) { wifi_dpp_tcp_handle = create_dissector_handle(dissect_wifi_dpp_tcp_pdus, proto_wifi_dpp); initialized = TRUE; } else { dissector_delete_uint("tcp.port", current_port, wifi_dpp_tcp_handle); } current_port = wifi_dpp_tcp_port; dissector_add_uint("tcp.port", current_port, wifi_dpp_tcp_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wifi-dpp.h
/* * packet-wifi-dpp.h * * * SPDX-License-Identifier: GPL-2.0-or-later */ int dissect_wifi_dpp_public_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_);
C
wireshark/epan/dissectors/packet-wifi-nan.c
/* packet-wifi-nan.c * * Wi-Fi Neighbour Awareness Networking (NAN) * * Copyright 2019 Samsung Electronics * * SPDX-License-Identifier: GPL-2.0-or-later */ #include <config.h> #include <epan/packet.h> #include <epan/expert.h> #include "packet-ieee80211.h" #include <wsutil/str_util.h> void proto_reg_handoff_nan(void); void proto_register_nan(void); static dissector_table_t ie_handle_table; #define WFA_ACTION_OUI_TYPE 0x18 #define WFA_NAN_IE_OUI_TYPE 0x13 #define WFA_SERVICE_DISCOVERY_SUBTYPE 0x13 #define NAN_MASTER_IND_LENGTH 2 #define NAN_CLUSTER_LENGTH 13 #define NAN_SDA_MIN_LENGTH 9 #define NAN_SDEA_MIN_LENGTH 3 #define NAN_CONNECTION_CAP_LENGTH 2 #define NAN_WLAN_INFRA_MIN_LENGTH 15 #define NAN_P2P_OP_MIN_LENGTH 9 #define NAN_IBSS_MIN_LENGTH 14 #define NAN_MESH_MIN_LENGTH 8 #define NAN_RANGING_MIN_LENGTH 8 #define NAN_CLUSTER_DISC_LENGTH 22 #define NAN_DEVICE_CAP_LENGTH 9 #define NAN_NDP_MIN_LENGTH 11 #define NAN_NDPE_MIN_LENGTH 11 #define NAN_AVAILABILITY_MIN_LENGTH 8 #define NAN_NDC_MIN_LENGTH 11 #define NAN_NDL_MIN_LENGTH 4 #define NAN_NDL_QOS_LENGTH 3 #define NAN_UNALIGNED_SCH_MIN_LENGTH 16 #define NAN_RANGING_SETUP_MIN_LENGTH 4 #define NAN_EXTENDED_WLAN_INFRA_LENGTH 20 #define NAN_EXTENDED_P2P_OP_LENGTH 14 #define NAN_EXTENDED_IBSS_LENGTH 19 #define NAN_EXTENDED_MESH_MIN_LENGTH 13 #define NAN_CIPHER_SUITE_INFO_MIN_LENGTH 3 #define NAN_SECURITY_CONTEXT_INFO_MIN_LENGTH 4 #define NAN_PUBLIC_AVAIL_MIN_LENGTH 4 #define NAN_VENDOR_SPECIFIC_MIN_LENGTH 3 #define NAN_UNALIGNED_SCH_BAND_ID_EXIST 0 #define NAN_UNALIGNED_SCH_CHANNEL_ENTRY_EXIST 1 #define NAN_UNALIGNED_SCH_CHANNEL_ENTRY_W_AUX_EXIST 2 static int proto_nan = -1; static expert_field ei_nan_elem_len_invalid = EI_INIT; static expert_field ei_nan_unknown_attr_id = EI_INIT; static expert_field ei_nan_unknown_op_class = EI_INIT; static expert_field ei_nan_unknown_beacon_type = EI_INIT; static gint ett_nan = -1; static gint ett_attributes = -1; static gint ett_map_control = -1; static gint ett_type_status = -1; static gint ett_time_bitmap_ctrl = -1; static gint ett_non_nan_op_channel = -1; static gint ett_non_nan_beacon = -1; static gint ett_cluster_anchor_master_info = -1; static gint ett_sda_service_ctr = -1; static gint ett_sda_srf_ctr = -1; static gint ett_sdea_ctr = -1; static gint ett_sdea_range_limit = -1; static gint ett_sdea_service_info = -1; static gint ett_connection_cap_field = -1; static gint ett_further_av_map_entry_ctrl = -1; static gint ett_device_cap_map_id = -1; static gint ett_device_cap_committed_dw = -1; static gint ett_device_cap_supported_bands = -1; static gint ett_device_cap_op_mode = -1; static gint ett_device_cap_antennas = -1; static gint ett_device_cap_capabilities = -1; static gint ett_ndp_control = -1; static gint ett_ndpe_tlv = -1; static gint ett_availability_ctr = -1; static gint ett_availability_entry = -1; static gint ett_availability_entry_ctr = -1; static gint ett_availability_entry_entries = -1; static gint ett_availability_entry_entries_channel = -1; static gint ett_ndc_ctr = -1; static gint ett_ndc_entries = -1; static gint ett_device_ndc_map_id = -1; static gint ett_ndl_control = -1; static gint ett_ndl_schedule_entries = -1; static gint ett_unaligned_sch_ctrl = -1; static gint ett_unaligned_sch_ulw_overwrite = -1; static gint ett_unaligned_sch_ulw_ctrl = -1; static gint ett_ranging_setup_ftm_params = -1; static gint ett_ranging_setup_ctrl = -1; static gint ett_ranging_setup_schedule_entries = -1; static gint ett_ranging_info_location_info_availability = -1; static gint ett_p2p_device_role = -1; static gint ett_cipher_suite_info_list = -1; static gint ett_security_context_identifiers = -1; static gint ett_public_availability_sch_entries = -1; static gint ett_ie_tree = -1; static gint ett_availability_op_class = -1; static int hf_nan_attribute_type = -1; static int hf_nan_attribute_len = -1; static int hf_nan_action_subtype = -1; static int hf_nan_instance_id = -1; static int hf_nan_service_id = -1; static int hf_nan_map_id = -1; static int hf_nan_oui = -1; static int hf_nan_type_status = -1; static int hf_nan_reason_code = -1; static int hf_nan_status_1 = -1; static int hf_nan_status_2 = -1; static int hf_nan_bss_id = -1; static int hf_nan_availability_intervals_bitmap = -1; static int hf_nan_mac_address = -1; static int hf_nan_publish_id = -1; static int hf_nan_dialog_tokens = -1; static int hf_nan_time_bitmap = -1; static int hf_nan_time_bitmap_len = -1; static int hf_nan_time_bitmap_ctrl = -1; static int hf_nan_time_bitmap_ctrl_bit_duration = -1; static int hf_nan_time_bitmap_ctrl_period = -1; static int hf_nan_time_bitmap_ctrl_start_offset = -1; static int hf_nan_map_ctrl_map_id = -1; static int hf_nan_map_ctrl_availability_interval_duration = -1; static int hf_nan_map_ctrl_repeat = -1; static int hf_nan_map_ctrl_field = -1; static int hf_nan_non_op_channel_global_op_class = -1; static int hf_nan_non_op_channel_channel = -1; static int hf_nan_non_op_channel_center_freq = -1; static int hf_nan_non_beacon_tbtt_offset = -1; static int hf_nan_non_beacon_interval = -1; static int hf_nan_attr_master_preference = -1; static int hf_nan_attr_master_random_factor = -1; static int hf_nan_attr_cluster_anchor_master_rank = -1; static int hf_nan_attr_cluster_hop_count = -1; static int hf_nan_attr_cluster_beacon_transmission_time = -1; static int hf_nan_attr_sda_requestor_instance_id = -1; static int hf_nan_attr_sda_sc = -1; static int hf_nan_attr_sda_sc_type = -1; static int hf_nan_attr_sda_sc_matching_filter = -1; static int hf_nan_attr_sda_sc_service_response = -1; static int hf_nan_attr_sda_sc_service_info = -1; static int hf_nan_attr_sda_sc_discovery_range = -1; static int hf_nan_attr_sda_sc_binding_bitmap = -1; static int hf_nan_attr_sda_binding_bitmap = -1; static int hf_nan_attr_sda_matching_filter_len = -1; static int hf_nan_attr_sda_matching_filter_val = -1; static int hf_nan_attr_sda_service_response_filter_len = -1; static int hf_nan_attr_sda_srf_ctr = -1; static int hf_nan_attr_sda_srf_ctr_type = -1; static int hf_nan_attr_sda_srf_ctr_include = -1; static int hf_nan_attr_sda_srf_ctr_bloom_filter_index = -1; static int hf_nan_attr_sda_srf_address_set = -1; static int hf_nan_attr_sda_service_info_len = -1; static int hf_nan_attr_sda_service_info = -1; static int hf_nan_attr_sdea_ctr = -1; static int hf_nan_attr_sdea_ctr_fsd = -1; static int hf_nan_attr_sdea_ctr_fsd_w_gas = -1; static int hf_nan_attr_sdea_ctr_data_path = -1; static int hf_nan_attr_sdea_ctr_data_path_type = -1; static int hf_nan_attr_sdea_ctr_reserved_multicast_type = -1; static int hf_nan_attr_sdea_ctr_qos = -1; static int hf_nan_attr_sdea_ctr_security = -1; static int hf_nan_attr_sdea_ctr_ranging = -1; static int hf_nan_attr_sdea_ctr_range_limit = -1; static int hf_nan_attr_sdea_ctr_service_update_indicator = -1; static int hf_nan_attr_sdea_ingress_range_limit = -1; static int hf_nan_attr_sdea_egress_range_limit = -1; static int hf_nan_attr_sdea_service_update_indicator = -1; static int hf_nan_attr_sdea_service_info_length = -1; static int hf_nan_attr_sdea_service_info_protocol_type = -1; static int hf_nan_attr_sdea_service_info_specific = -1; static int hf_nan_attr_connection_cap_bitmap = -1; static int hf_nan_attr_connection_cap_wifi_direct = -1; static int hf_nan_attr_connection_cap_p2ps = -1; static int hf_nan_attr_connection_cap_tdls = -1; static int hf_nan_attr_connection_cap_wlan_infra = -1; static int hf_nan_attr_connection_cap_ibss = -1; static int hf_nan_attr_connection_cap_mesh = -1; static int hf_nan_attr_wlan_infra_device_role = -1; static int hf_nan_attr_p2p_device_role_device = -1; static int hf_nan_attr_p2p_device_role_group_owner = -1; static int hf_nan_attr_p2p_device_role_client = -1; static int hf_nan_attr_p2p_device_role = -1; static int hf_nan_attr_mesh_id = -1; static int hf_nan_attr_further_av_map_entry_av_interval_duration = -1; static int hf_nan_attr_further_av_map_op_class = -1; static int hf_nan_attr_further_av_map_channel_num = -1; static int hf_nan_attr_further_av_map_entry_ctrl = -1; static int hf_nan_attr_further_av_map_id = -1; static int hf_nan_attr_country_code = -1; static int hf_nan_attr_ranging_protocol = -1; static int hf_nan_attr_cluster_disc_id = -1; static int hf_nan_attr_cluster_disc_time_offset = -1; static int hf_nan_attr_cluster_disc_anchor_master_rank = -1; static int hf_nan_attr_device_cap_map_id_apply_to = -1; static int hf_nan_attr_device_cap_map_id_associated_maps = -1; static int hf_nan_attr_device_cap_committed_dw = -1; static int hf_nan_attr_device_cap_committed_dw_24ghz = -1; static int hf_nan_attr_device_cap_committed_dw_5ghz = -1; static int hf_nan_attr_device_cap_committed_dw_24ghz_overwrite = -1; static int hf_nan_attr_device_cap_committed_dw_5ghz_overwrite = -1; static int hf_nan_attr_device_cap_supported_bands = -1; static int hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces = -1; static int hf_nan_attr_device_cap_supported_bands_sub_1ghz = -1; static int hf_nan_attr_device_cap_supported_bands_24ghz = -1; static int hf_nan_attr_device_cap_supported_bands_reserved_36ghz = -1; static int hf_nan_attr_device_cap_supported_bands_5ghz = -1; static int hf_nan_attr_device_cap_supported_bands_reserved_60ghz = -1; static int hf_nan_attr_device_cap_op_mode = -1; static int hf_nan_attr_device_cap_op_mode_phy = -1; static int hf_nan_attr_device_cap_op_mode_vht8080 = -1; static int hf_nan_attr_device_cap_op_mode_vht160 = -1; static int hf_nan_attr_device_cap_op_mode_reserved_paging_ndl = -1; static int hf_nan_attr_device_cap_antennas = -1; static int hf_nan_attr_device_cap_antennas_tx = -1; static int hf_nan_attr_device_cap_antennas_rx = -1; static int hf_nan_attr_device_cap_max_channel_switch_time = -1; static int hf_nan_attr_device_cap_capabilities = -1; static int hf_nan_attr_device_cap_capabilities_dfs_master = -1; static int hf_nan_attr_device_cap_capabilities_extended_key_id = -1; static int hf_nan_attr_device_cap_capabilities_simul_ndp_reception = -1; static int hf_nan_attr_device_cap_capabilities_ndpe_attr_support = -1; static int hf_nan_attr_ndp_type = -1; static int hf_nan_attr_ndp_initiator = -1; static int hf_nan_attr_ndp_id = -1; static int hf_nan_attr_ndp_ctrl_confirm = -1; static int hf_nan_attr_ndp_ctrl_security_pres = -1; static int hf_nan_attr_ndp_ctrl_publish_id_pres = -1; static int hf_nan_attr_ndp_ctrl_responder_ndi_pres = -1; static int hf_nan_attr_ndp_ctrl_sepcific_info_pres = -1; static int hf_nan_attr_ndp_control = -1; static int hf_nan_attr_ndp_responder_ndi = -1; static int hf_nan_attr_ndp_specific_info = -1; static int hf_nan_attr_ndpe_tlv_type = -1; static int hf_nan_attr_ndpe_tlv_len = -1; static int hf_nan_attr_ndpe_tlv_ipv6_interface_identifier = -1; static int hf_nan_attr_availability_sequence_id = -1; static int hf_nan_attr_availability_ctr = -1; static int hf_nan_attr_availability_map_id = -1; static int hf_nan_attr_availability_committed_changed = -1; static int hf_nan_attr_availability_potential_changed = -1; static int hf_nan_attr_availability_public_availability_changed = -1; static int hf_nan_attr_availability_ndc_changed = -1; static int hf_nan_attr_availability_reserved_multicast_schedule_changed = -1; static int hf_nan_attr_availability_reserved_multicast_schedule_change_changed = -1; static int hf_nan_attr_availability_entry_len = -1; static int hf_nan_attr_availability_entry_ctr = -1; static int hf_nan_attr_availability_entry_ctr_type = -1; static int hf_nan_attr_availability_entry_ctr_pref = -1; static int hf_nan_attr_availability_entry_ctr_utilization = -1; static int hf_nan_attr_availability_entry_ctr_rx_nss = -1; static int hf_nan_attr_availability_entry_ctr_time_bitmap = -1; static int hf_nan_attr_availability_entry_entries_type = -1; static int hf_nan_attr_availability_entry_entries_non_contiguous_bw = -1; static int hf_nan_attr_availability_entry_entries_num_entries = -1; static int hf_nan_attr_availability_entry_entries_band = -1; static int hf_nan_attr_availability_entry_entries_channel_op_class = -1; static int hf_nan_attr_availability_entry_entries_channel_bitmap = -1; static int hf_nan_attr_availability_entry_entries_primary_channel_bitmap = -1; static int hf_nan_attr_availability_entry_entries_aux_channel_bitmap = -1; static int hf_nan_attr_availability_entry_entries_channel_set = -1; static int hf_nan_attr_availability_entry_entries_start_freq = -1; static int hf_nan_attr_availability_entry_entries_bandwidth = -1; static int hf_nan_attr_ndc_id = -1; static int hf_nan_attr_ndc_ctrl = -1; static int hf_nan_attr_ndc_ctrl_selected = -1; static int hf_nan_attr_ndc_map_id_related_sch = -1; static int hf_nan_attr_ndl_type = -1; static int hf_nan_attr_ndl_control = -1; static int hf_nan_attr_ndl_ctrl_peer_id = -1; static int hf_nan_attr_ndl_ctrl_immutable_schedule_pres = -1; static int hf_nan_attr_ndl_ctrl_ndc_pres = -1; static int hf_nan_attr_ndl_ctrl_qos = -1; static int hf_nan_attr_ndl_ctrl_type = -1; static int hf_nan_attr_ndl_ctrl_setup_reason = -1; static int hf_nan_attr_ndl_ctrl_max_idle_pres = -1; static int hf_nan_attr_ndl_reserved_peer_id = -1; static int hf_nan_attr_ndl_max_idle = -1; static int hf_nan_attr_ndlqos_min_time_slots = -1; static int hf_nan_attr_ndlqos_max_latency = -1; static int hf_nan_attr_unaligned_sch_ctrl = -1; static int hf_nan_attr_unaligned_sch_ctrl_schedule_id = -1; static int hf_nan_attr_unaligned_sch_ctrl_seq_id = -1; static int hf_nan_attr_unaligned_sch_starting_time = -1; static int hf_nan_attr_unaligned_sch_duration = -1; static int hf_nan_attr_unaligned_sch_period = -1; static int hf_nan_attr_unaligned_sch_count_down = -1; static int hf_nan_attr_unaligned_sch_ulw_overwrite = -1; static int hf_nan_attr_unaligned_sch_ulw_overwrite_all = -1; static int hf_nan_attr_unaligned_sch_ulw_overwrite_map_id = -1; static int hf_nan_attr_unaligned_sch_ulw_ctrl = -1; static int hf_nan_attr_unaligned_sch_ulw_ctrl_type = -1; static int hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av = -1; static int hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss = -1; static int hf_nan_attr_ranging_info_location_info_avail = -1; static int hf_nan_attr_ranging_info_location_info_avail_lci = -1; static int hf_nan_attr_ranging_info_location_info_avail_geospatial = -1; static int hf_nan_attr_ranging_info_location_info_avail_civic_location = -1; static int hf_nan_attr_ranging_info_location_info_avail_last_movement_pres = -1; static int hf_nan_attr_ranging_info_last_movement_indication = -1; static int hf_nan_attr_ranging_setup_type = -1; static int hf_nan_attr_ranging_setup_ctrl = -1; static int hf_nan_attr_ranging_setup_ctrl_report_req = -1; static int hf_nan_attr_ranging_setup_ctrl_ftm_params = -1; static int hf_nan_attr_ranging_setup_ctrl_entry_list = -1; static int hf_nan_attr_ranging_setup_ftm_params = -1; static int hf_nan_attr_ranging_setup_ftm_max_per_burst = -1; static int hf_nan_attr_ranging_setup_ftm_min_delta = -1; static int hf_nan_attr_ranging_setup_ftm_max_burst_duration = -1; static int hf_nan_attr_ranging_setup_ftm_format_bw = -1; static int hf_nan_attr_ftm_range_report = -1; static int hf_nan_attr_cipher_suite_capabilities = -1; static int hf_nan_attr_cipher_suite_id = -1; static int hf_nan_attr_security_context_identifier = -1; static int hf_nan_attr_security_context_identifier_len = -1; static int hf_nan_attr_security_context_identifier_type = -1; static int hf_nan_attr_shared_key_rsna_descriptor = -1; static int hf_nan_attr_vendor_specific_body = -1; static int hf_nan_attr_container_element_id = -1; static int hf_nan_attr_container_element_len = -1; enum { NAN_ATTR_MASTER_INDICATION = 0x00, NAN_ATTR_CLUSTER = 0x01, NAN_ATTR_SERVICE_ID_LIST = 0x02, NAN_ATTR_SERVICE_DESCRIPTOR = 0x03, NAN_ATTR_CONNECTION_CAPABILITY = 0x04, NAN_ATTR_WLAN_INFRA = 0x05, NAN_ATTR_P2P_OPERATION = 0x06, NAN_ATTR_IBSS = 0x07, NAN_ATTR_MESH = 0x08, NAN_ATTR_FURTHER_SERVICE_DISCOVERY = 0x09, NAN_ATTR_FURTHER_AVAILABILITY_MAP = 0x0A, NAN_ATTR_COUNTRY_CODE = 0x0B, NAN_ATTR_RANGING = 0x0C, NAN_ATTR_CLUSTER_DISCOVERY = 0x0D, NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION = 0x0E, NAN_ATTR_DEVICE_CAPABILITY = 0x0F, NAN_ATTR_NDP = 0x10, NAN_ATTR_RESERVED_NMSG = 0x11, NAN_ATTR_AVAILABILITY = 0x12, NAN_ATTR_NDC = 0x13, NAN_ATTR_NDL = 0x14, NAN_ATTR_NDL_QOS = 0x15, NAN_ATTR_RESERVED_MULTICAST_SCHEDULE = 0x16, NAN_ATTR_UNALIGNED_SCHEDULE = 0x17, NAN_ATTR_RESERVED_UNICAST_PAGING = 0x18, NAN_ATTR_RESERVED_MULTICAST_PAGING = 0x19, NAN_ATTR_RANGING_INFORMATION = 0x1A, NAN_ATTR_RANGING_SETUP = 0x1B, NAN_ATTR_FTM_RANGING_REPORT = 0x1C, NAN_ATTR_ELEMENT_CONTAINER = 0x1D, NAN_ATTR_EXTENDED_WLAN_INFRA = 0x1E, NAN_ATTR_EXTENDED_P2P_OPERATION = 0x1F, NAN_ATTR_EXTENDED_IBSS = 0x20, NAN_ATTR_EXTENDED_MESH = 0x21, NAN_ATTR_CIPHER_SUITE_INFO = 0x22, NAN_ATTR_SECURITY_CONTEXT_INFO = 0x23, NAN_ATTR_SHARED_KEY_DESCRIPTOR = 0x24, NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_CHANGE = 0x25, NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_OWNER_CHANGE = 0x26, NAN_ATTR_PUBLIC_AVAILABILITY = 0x27, NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST = 0x28, NAN_ATTR_NDP_EXTENSION = 0x29, NAN_ATTR_VENDOR_SPECIFIC = 0xDD }; static const value_string attribute_types[] = { { NAN_ATTR_MASTER_INDICATION, "Master Indication Attribute" }, { NAN_ATTR_CLUSTER, "Cluster Attribute" }, { NAN_ATTR_SERVICE_ID_LIST, "Service ID List Attribute" }, { NAN_ATTR_SERVICE_DESCRIPTOR, "Service Descriptor Attribute" }, { NAN_ATTR_CONNECTION_CAPABILITY, "NAN Connection Capability Attribute" }, { NAN_ATTR_WLAN_INFRA, "WLAN Infrastructure Attribute" }, { NAN_ATTR_P2P_OPERATION, "P2P Operation Attribute" }, { NAN_ATTR_IBSS, "IBSS Attribute" }, { NAN_ATTR_MESH, "Mesh Attribute" }, { NAN_ATTR_FURTHER_SERVICE_DISCOVERY, "Further NAN Service Discovery Attribute" }, { NAN_ATTR_FURTHER_AVAILABILITY_MAP, "Further Availability Map Attribute" }, { NAN_ATTR_COUNTRY_CODE, "Country Code Attribute" }, { NAN_ATTR_RANGING, "Ranging Attribute" }, { NAN_ATTR_CLUSTER_DISCOVERY, "Cluster Discovery Attribute" }, { NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION, "Service Descriptor Extension Attribute" }, { NAN_ATTR_DEVICE_CAPABILITY, "Device Capability" }, { NAN_ATTR_NDP, "NDP Attribute" }, { NAN_ATTR_RESERVED_NMSG, "Reserved (NMSG)" }, { NAN_ATTR_AVAILABILITY, "NAN Availability" }, { NAN_ATTR_NDC, "NDC Attribute" }, { NAN_ATTR_NDL, "NDL Attribute" }, { NAN_ATTR_NDL_QOS, "NDL QoS Attribute" }, { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE, "Reserved (Multicast Schedule)" }, { NAN_ATTR_UNALIGNED_SCHEDULE, "Unaligned Schedule Attribute" }, { NAN_ATTR_RESERVED_UNICAST_PAGING, "Reserved (Unicast Paging)" }, { NAN_ATTR_RESERVED_MULTICAST_PAGING, "Reserved (Multicast Paging)" }, { NAN_ATTR_RANGING_INFORMATION, "Ranging Information Attribute" }, { NAN_ATTR_RANGING_SETUP, "Ranging Setup Attribute" }, { NAN_ATTR_FTM_RANGING_REPORT, "FTM Ranging Report Attribute" }, { NAN_ATTR_ELEMENT_CONTAINER, "Element Container Attribute" }, { NAN_ATTR_EXTENDED_WLAN_INFRA, "Extended WLAN Infrastructure Attribute" }, { NAN_ATTR_EXTENDED_P2P_OPERATION, "Extended P2P Operation Attribute" }, { NAN_ATTR_EXTENDED_IBSS, "Extended IBSS Attribute" }, { NAN_ATTR_EXTENDED_MESH, "Extended Mesh Attribute" }, { NAN_ATTR_CIPHER_SUITE_INFO, "Cipher Suite Info Attribute" }, { NAN_ATTR_SECURITY_CONTEXT_INFO, "Security Context Info Attribute" }, { NAN_ATTR_SHARED_KEY_DESCRIPTOR, "Shared-Key Descriptor Attribute" }, { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_CHANGE, "Reserved (Multicast Schedule Change)" }, { NAN_ATTR_RESERVED_MULTICAST_SCHEDULE_OWNER_CHANGE, "Reserved (Multicast Schedule Owner Change)" }, { NAN_ATTR_PUBLIC_AVAILABILITY, "Public Availability Attribute" }, { NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST, "Subscribe Service ID List Attribute" }, { NAN_ATTR_NDP_EXTENSION, "NDP Extension Attribute" }, { NAN_ATTR_VENDOR_SPECIFIC, "Vendor Specific Attribute" }, { 0, NULL } }; // Bitmask fields shared by multiple attributes static int* const map_control_fields[] = { &hf_nan_map_ctrl_map_id, &hf_nan_map_ctrl_availability_interval_duration, &hf_nan_map_ctrl_repeat, NULL }; static int* const time_bitmap_ctr_fields[] = { &hf_nan_time_bitmap_ctrl_bit_duration, &hf_nan_time_bitmap_ctrl_period, &hf_nan_time_bitmap_ctrl_start_offset, NULL }; static const true_false_string srf_type_flags = { "Address Set is a Bloom filter", "Address Set is a sequence of MAC Addresses" }; static const true_false_string srf_include_flags = { "Only STAs Present in Address Set shall send a response", "STAs present in Address Set shall not send responses" }; static const true_false_string sdea_ctr_data_path_type_flags = { "Reserved", "Unicast NDP required (Reserved if NDP is not required)" }; static const true_false_string sdea_ctr_reserved_multicast_type_flags = { "Many to many (Reserved if NDP is not required)", "One to many (Reserved if NDP is not required)" }; static const true_false_string device_cap_map_id_apply_to_flags = { "Only specified map", "All maps" }; static const true_false_string device_cap_op_mode_phy_flags = { "VHT", "HT only" }; static const true_false_string availability_entry_entries_type_flags = { "Operating Classes and channel entries", "Indicated bands" }; static const true_false_string ndc_ctr_selected_flags = { "Selected NDC for a NDL Schedule", "NDC included for the peer's information" }; static const value_string map_ctrl_availability_interval_duration[] = { { 0, "16 TU" }, { 1, "32 TU" }, { 2, "64 TU" }, { 3, "Reserved" }, { 0, NULL } }; static const value_string service_ctr_type[] = { { 0, "Publish" }, { 1, "Subscribe" }, { 2, "Follow up" }, { 3, "Reserved" }, { 0, NULL } }; static const range_string service_info_protocol_type[] = { { 0, 0, "Reserved" }, { 1, 1, "Bonjour" }, { 2, 2, "Generic" }, { 3, 255, "Reserved" }, { 0, 0, NULL } }; static const value_string availability_entry_type[] = { { 0, "Reserved" }, { 1, "Committed" }, { 2, "Potential" }, { 3, "Committed + Potential" }, { 4, "Conditional" }, { 5, "Reserved" }, { 6, "Potential + Conditional" }, { 7, "Reserved" }, { 0, NULL } }; static const range_string availability_entry_time_bitmap_ctr_bit_duration_type[] = { { 0, 0, "16 TU" }, { 1, 1, "32 TU" }, { 2, 2, "64 TU" }, { 3, 3, "128 TU" }, { 4, 7, "Reserved" }, { 0, 0, NULL } }; static const value_string availability_entry_time_bitmap_ctr_period_type[] = { { 1, "128 TU" }, { 2, "256 TU" }, { 3, "512 TU" }, { 4, "1024 TU" }, { 5, "2048 TU" }, { 6, "4096 TU" }, { 7, "8192 TU" }, { 0, NULL } }; static const range_string availability_entry_entries_band_type[] = { { 0, 0, "Reserved (for TV white spaces)" }, { 1, 1, "Sub-1 GHz" }, { 2, 2, "2.4 GHz" }, { 3, 3, "Reserved (for 3.6 GHz)" }, { 4, 4, "4.9 and 5 GHz" }, { 5, 5, "Reserved (for 60 GHz)" }, { 6, 255, "Reserved" }, { 0, 0, NULL } }; static const range_string ndp_type_values[] = { { 0, 0, "Request" }, { 1, 1, "Response" }, { 2, 2, "Confirm" }, { 3, 3, "Security Install" }, { 4, 4, "Terminate" }, { 5, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string ndpe_tlv_type_values[] = { { 0, 0, "IPv6 Link Local" }, { 1, 1, "Service Info" }, { 2, 255, "Reserved" }, { 0, 0, NULL } }; static const range_string ndl_type_values[] = { { 0, 0, "Request" }, { 1, 1, "Response" }, { 2, 2, "Confirm" }, { 3, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string ranging_setup_type_values[] = { { 0, 0, "Request" }, { 1, 1, "Response" }, { 2, 2, "Termination" }, { 3, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string status_type1_values[] = { { 0, 0, "Continue" }, { 1, 1, "Accepted" }, { 2, 2, "Rejected" }, { 3, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string status_type2_values[] = { { 0, 0, "Accepted" }, { 1, 1, "Rejected" }, { 2, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string reason_code_values[] = { { 0, 0, "Reserved" }, { 1, 1, "UNSPECIFIED_REASON" }, { 2, 2, "RESOURCE_LIMITATION" }, { 3, 3, "INVALID_PARAMETERS" }, { 4, 4, "FTM_PARAMETERS_INCAPABLE" }, { 5, 5, "NO_MOVEMENT" }, { 6, 6, "INVALID_AVAILABILITY" }, { 7, 7, "IMMUTABLE_UNACCEPTABLE" }, { 8, 8, "SECURITY_POLICY" }, { 9, 9, "QoS_UNACCEPTABLE" }, { 10, 10, "NDP_REJECTED" }, { 11, 11, "NDL_UNACCEPTABLE" }, { 12, 12, "Ranging Schedule unacceptable" }, { 13, 255, "Reserved" }, { 0, 0, NULL } }; static const range_string action_frame_type_values[] = { { 0, 0, "Reserved " }, { 1, 1, "Ranging Request " }, { 2, 2, "Ranging Response " }, { 3, 3, "Ranging Termination " }, { 4, 4, "Ranging Report " }, { 5, 5, "Data Path Request " }, { 6, 6, "Data Path Response " }, { 7, 7, "Data Path Confirm " }, { 8, 8, "Data Path Key Installment " }, { 9, 9, "Data Path Termination " }, { 10, 10, "Schedule Request " }, { 11, 11, "Schedule Response " }, { 12, 12, "Schedule Confirm " }, { 13, 13, "Schedule Update Notification " }, { 14, 255, "Reserved " }, { 0, 0, NULL } }; static const value_string ndl_type_string[] = { { 0, "S-NDL" }, { 1, "Reserved (P-NDL)" }, { 0, NULL } }; static const value_string ndl_setup_reason[] = { { 0, "NDP" }, { 1, "FSD using GAS" }, { 2, "Reserved" }, { 3, "Reserved" }, { 0, NULL } }; static const value_string unaligned_sch_ulw_type[] = { { 0, "Followed by a Band ID field" }, { 1, "Followed by a Channel Entry field without Auxiliary Channel" }, { 2, "Followed by a Channel Entry field with Auxiliary Channel" }, { 3, "Reserved" }, { 0, NULL } }; static const range_string security_context_iden_type[] = { { 0, 0, "Reserved" }, { 1, 1, "PMKID" }, { 2, 255, "Reserved" }, { 0, 0, NULL } }; static const value_string device_role[] = { { 0, "AP" }, { 1, "Non-AP STA associated with AP" }, { 2, "Non-AP STA listening to AP" }, { 0, NULL } }; static const range_string furth_av_map_id[] = { {0, 15, "Identify Further Availability attribute"}, {16, 255, "Reserved"}, {0, 0, NULL} }; typedef struct _range_channel_set { guint32 value_min; guint32 value_max; const gint channel_set[16]; } range_channel_set; static const gint * rval_to_channel_set(const guint32 val, const range_channel_set* ra) { gint i = 0; if (ra) { while (*ra[i].channel_set) /* no such thing as channel 0 - end of list */ { if ((val >= ra[i].value_min) && (val <= ra[i].value_max)) { return ra[i].channel_set; } i++; } } return NULL; } // TODO: this table corresponds to the 802.11 global operating classes. // it's probably in the 802.11 dissector somewhere and ideally this // should be used instead... static const range_channel_set op_class_channel[] = { {1, 80, {-1}}, {81, 81, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, {82, 82, {14}}, {83, 83, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, {84, 84, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, {85, 85, {-3}}, {86, 86, {-3}}, {87, 87, {-3}}, {88, 93, {-1}}, {94, 94, {133, 137}}, {95, 95, {136, 138}}, {96, 96, {131, 132, 133, 134, 135, 136, 137, 138}}, {97, 100, {-1}}, {101, 101, {21, 25}}, {102, 102, {11, 13, 15, 17, 19}}, {103, 103, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}, {104, 104, {184, 192}}, {105, 105, {188, 196}}, {106, 106, {191, 195}}, {107, 107, {189, 191, 193, 195, 197}}, {108, 108, {188, 189, 190, 191, 192, 193, 194, 195, 196, 197}}, {109, 109, {184, 188, 192, 196}}, {110, 110, {183, 184, 185, 186, 187, 188, 189}}, {111, 111, {182, 183, 184, 185, 186, 187, 188, 189}}, {112, 112, {8, 12, 16}}, {113, 113, {7, 8, 9, 10, 11}}, {114, 114, {6, 7, 8, 9, 10, 11}}, {115, 115, {36, 40, 44, 48}}, {116, 116, {36, 44}}, {117, 117, {40, 48}}, {118, 118, {52, 56, 60, 64}}, {119, 119, {52, 60}}, {120, 120, {56, 64}}, {121, 121, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144}}, {122, 122, {100, 108, 116, 124, 132, 140}}, {123, 123, {103, 112, 120, 128, 136, 144}}, {124, 124, {149, 153, 157, 161}}, {125, 125, {149, 153, 157, 161,165, 169}}, {126, 126, {149, 157}}, {127, 127, {153, 161}}, {128, 128, {42, 58, 106, 122, 138, 155}}, {129, 129, {50, 114}}, {130, 130, {42, 58, 106, 122, 138, 155}}, {131, 179, {-1}}, {180, 180, {1, 2, 3, 4, 5, 6}}, {181, 191, {-1}}, {192, 254, {-2}}, {255, 255, {-1}}, {0, 0, {0}}, /* no such thing as channel 1 - end of list */ }; static const range_string op_channel_spacing[] = { {1, 80, "Reserved"}, {81, 82, "25"}, {83, 84, "40"}, {85, 85, "6, 7, 8"}, {86, 86, "12, 14, 16"}, {87, 87, "24, 28, 32"}, {88, 93, "Reserved"}, {94, 94, "20"}, {95, 95, "10"}, {96, 96, "5"}, {97, 100, "Reserved"}, {101, 101, "20"}, {102, 102, "10"}, {103, 103, "5"}, {104, 105, "40"}, {106, 106, "20"}, {107, 107, "10"}, {108, 108, "5"}, {109, 109, "20"}, {110, 110, "10"}, {111, 111, "5"}, {112, 112, "20"}, {113, 113, "10"}, {114, 114, "5"}, {115, 115, "20"}, {116, 117, "40"}, {118, 118, "20"}, {119, 120, "40"}, {121, 121, "20"}, {122, 123, "40"}, {124, 125, "20"}, {126, 127, "40"}, {128, 128, "80"}, {129, 129, "160"}, {130, 130, "80"}, {131, 179, "Reserved"}, {180, 180, "2160"}, {181, 191, "Reserved"}, {255, 255, "Reserved"}, {0, 0, NULL} }; static const range_string op_starting_freq[] = { {1, 80, "Reserved"}, {81, 81, "2.407"}, {82, 82, "2.414"}, {83, 83, "2.407"}, {84, 84, "2.407"}, {88, 93, "Reserved"}, {94, 95, "3"}, {96, 96, "3.0025"}, {97, 100, "Reserved"}, {101, 101, "4.85"}, {102, 102, "4.89"}, {103, 103, "4.9375"}, {104, 104, "4"}, {105, 107, "4"}, {108, 108, "4.0025"}, {109, 110, "4"}, {111, 111, "4.0025"}, {112, 113, "5"}, {114, 114, "5.0025"}, {115, 130, "5"}, {131, 179, "Reserved"}, {180, 180, "56.16"}, {181, 191, "Reserved"}, {255, 255, "Reserved"}, {0, 0, NULL} }; static void dissect_attr_master_indication(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_MASTER_IND_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } proto_tree_add_item(attr_tree, hf_nan_attr_master_preference, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_attr_master_random_factor, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } static void dissect_attr_cluster(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_CLUSTER_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } proto_tree* anchor_master_tree = proto_tree_add_subtree(attr_tree, tvb, offset + 3, 13, ett_cluster_anchor_master_info, NULL, "Anchor Master Information"); proto_tree_add_item(anchor_master_tree, hf_nan_attr_cluster_anchor_master_rank, tvb, offset + 3, 8, ENC_BIG_ENDIAN); proto_tree_add_item(anchor_master_tree, hf_nan_attr_cluster_hop_count, tvb, offset + 11, 1, ENC_BIG_ENDIAN); proto_tree_add_item(anchor_master_tree, hf_nan_attr_cluster_beacon_transmission_time, tvb, offset + 12, 4, ENC_BIG_ENDIAN); } static void dissect_attr_service_id_list(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len % 6 != 0 || attr_len == 0) { expert_add_info_format(pinfo, attr_tree, &ei_nan_elem_len_invalid, "Invalid Service ID length"); return; } int num_service_ids = attr_len / 6; offset += 3; for (int i = 1; i <= num_service_ids; ++i) { proto_tree_add_item(attr_tree, hf_nan_service_id, tvb, offset, 6, ENC_NA); offset += 6; } } static void dissect_attr_sda(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_SDA_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } proto_tree_add_item(attr_tree, hf_nan_service_id, tvb, offset + 3, 6, ENC_NA); proto_tree_add_item(attr_tree, hf_nan_instance_id, tvb, offset + 9, 1, ENC_BIG_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_attr_sda_requestor_instance_id, tvb, offset + 10, 1, ENC_BIG_ENDIAN); offset += 11; static int* const service_ctr_fields[] = { &hf_nan_attr_sda_sc_type, &hf_nan_attr_sda_sc_matching_filter, &hf_nan_attr_sda_sc_service_response, &hf_nan_attr_sda_sc_service_info, &hf_nan_attr_sda_sc_discovery_range, &hf_nan_attr_sda_sc_binding_bitmap, NULL }; proto_tree_add_bitmask(attr_tree, tvb, offset, hf_nan_attr_sda_sc, ett_sda_service_ctr, service_ctr_fields, ENC_LITTLE_ENDIAN); guint8 service_ctr_byte = tvb_get_guint8(tvb, offset); offset += 1; const guint8 BITMASK_TYPE_SUBSCRIBE = 0x01; const guint8 BITMASK_TYPE_FOLLOW_UP = 0x02; const guint8 BITMASK_MATCHING_FILTER_PRESENT = 0x04; const guint8 BITMASK_SERVICE_RESPONSE_FILTER_PRESENT = 0x08; const guint8 BITMASK_SERVICE_INFO_PRESENT = 0x10; const guint8 BITMASK_BITMAP_PRESENT = 0x40; if (service_ctr_byte & BITMASK_TYPE_SUBSCRIBE) { col_prepend_fstr(pinfo->cinfo, COL_INFO, "SDF Subscribe, "); } else if (service_ctr_byte & BITMASK_TYPE_FOLLOW_UP) { col_prepend_fstr(pinfo->cinfo, COL_INFO, "SDF Follow up, "); } else { col_prepend_fstr(pinfo->cinfo, COL_INFO, "SDF Publish, "); } if (service_ctr_byte & BITMASK_BITMAP_PRESENT) { proto_tree_add_item(attr_tree, hf_nan_attr_sda_binding_bitmap, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } if (service_ctr_byte & BITMASK_MATCHING_FILTER_PRESENT) { proto_tree_add_item(attr_tree, hf_nan_attr_sda_matching_filter_len, tvb, offset, 1, ENC_LITTLE_ENDIAN); gint mf_len = tvb_get_guint8(tvb, offset); gint dissected_mf_len = 0; offset += 1; while (dissected_mf_len < mf_len) { gint filter_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(attr_tree, hf_nan_attr_sda_matching_filter_val, tvb, offset + 1, filter_len, ENC_NA); offset += filter_len + 1; dissected_mf_len += filter_len + 1; } } if (service_ctr_byte & BITMASK_SERVICE_RESPONSE_FILTER_PRESENT) { proto_tree_add_item(attr_tree, hf_nan_attr_sda_service_response_filter_len, tvb, offset, 1, ENC_LITTLE_ENDIAN); gint srf_len = tvb_get_guint8(tvb, offset); static int* const srf_ctr_fields[] = { &hf_nan_attr_sda_srf_ctr_type, &hf_nan_attr_sda_srf_ctr_include, &hf_nan_attr_sda_srf_ctr_bloom_filter_index, NULL }; proto_tree_add_bitmask(attr_tree, tvb, offset + 1, hf_nan_attr_sda_srf_ctr, ett_sda_service_ctr, srf_ctr_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_attr_sda_srf_address_set, tvb, offset + 2, srf_len - 1, ENC_NA); offset += srf_len + 1; } if (service_ctr_byte & BITMASK_SERVICE_INFO_PRESENT) { guint32 service_info_len; /* XXX - use FT_UINT_BYTES? */ proto_tree_add_item_ret_uint(attr_tree, hf_nan_attr_sda_service_info_len, tvb, offset, 1, ENC_BIG_ENDIAN, &service_info_len); proto_tree_add_item(attr_tree, hf_nan_attr_sda_service_info, tvb, offset + 1, service_info_len, ENC_NA); // offset += service_info_len + 1; } } static void dissect_attr_sdea(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_SDEA_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } proto_tree_add_item(attr_tree, hf_nan_instance_id, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN); offset += 4; guint16 dissected_len = 1; static int* const sdea_ctr_fields[] = { &hf_nan_attr_sdea_ctr_fsd, &hf_nan_attr_sdea_ctr_fsd_w_gas, &hf_nan_attr_sdea_ctr_data_path, &hf_nan_attr_sdea_ctr_data_path_type, &hf_nan_attr_sdea_ctr_reserved_multicast_type, &hf_nan_attr_sdea_ctr_qos, &hf_nan_attr_sdea_ctr_security, &hf_nan_attr_sdea_ctr_ranging, &hf_nan_attr_sdea_ctr_range_limit, &hf_nan_attr_sdea_ctr_service_update_indicator, NULL }; proto_tree_add_bitmask(attr_tree, tvb, offset, hf_nan_attr_sdea_ctr, ett_sdea_ctr, sdea_ctr_fields, ENC_LITTLE_ENDIAN); guint16 sdea_ctr_byte = tvb_get_letohs(tvb, offset); offset += 2; dissected_len += 2; if (sdea_ctr_byte & 0x100) { proto_tree* range_lim_tree = proto_tree_add_subtree(attr_tree, tvb, offset, 4, ett_sdea_range_limit, NULL, "Range Limit"); proto_tree_add_item(range_lim_tree, hf_nan_attr_sdea_ingress_range_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(range_lim_tree, hf_nan_attr_sdea_egress_range_limit, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); offset += 4; dissected_len += 4; } if (sdea_ctr_byte & 0x200) { proto_tree_add_item(attr_tree, hf_nan_attr_sdea_service_update_indicator, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; dissected_len += 1; } // If Service Info field is present if (dissected_len < attr_len) { proto_tree_add_item(attr_tree, hf_nan_attr_sdea_service_info_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree* service_info_tree = proto_tree_add_subtree(attr_tree, tvb, offset + 2, attr_len - dissected_len - 2, ett_sdea_service_info, NULL, "Service Info"); proto_tree_add_item(service_info_tree, hf_nan_oui, tvb, offset + 2, 3, ENC_NA); proto_tree_add_item(service_info_tree, hf_nan_attr_sdea_service_info_protocol_type, tvb, offset + 5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(service_info_tree, hf_nan_attr_sdea_service_info_specific, tvb, offset + 6, attr_len - dissected_len - 6, ENC_NA); } } static void dissect_attr_connection_capability(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_CONNECTION_CAP_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } static int* const connection_cap_bitmap_fields[] = { &hf_nan_attr_connection_cap_wifi_direct, &hf_nan_attr_connection_cap_p2ps, &hf_nan_attr_connection_cap_tdls, &hf_nan_attr_connection_cap_wlan_infra, &hf_nan_attr_connection_cap_ibss, &hf_nan_attr_connection_cap_mesh, NULL }; proto_tree_add_bitmask(attr_tree, tvb, offset + 3, hf_nan_attr_connection_cap_bitmap, ett_connection_cap_field, connection_cap_bitmap_fields, ENC_LITTLE_ENDIAN); } static void dissect_attr_wlan_infra(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_WLAN_INFRA_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_bss_id, tvb, sub_offset, 6, ENC_LITTLE_ENDIAN); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; gint bitmap_length = attr_len - 14; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, bitmap_length, ENC_NA); sub_offset += bitmap_length; proto_tree_add_item(attr_tree, hf_nan_attr_wlan_infra_device_role, tvb, sub_offset, 1, ENC_BIG_ENDIAN); } static void dissect_attr_p2p_operation(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_P2P_OP_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; static int* const p2p_bitmap_fields[] = { &hf_nan_attr_p2p_device_role_device, &hf_nan_attr_p2p_device_role_group_owner, &hf_nan_attr_p2p_device_role_client, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_p2p_device_role, ett_p2p_device_role, p2p_bitmap_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_ibss(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_IBSS_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_bss_id, tvb, sub_offset, 6, ENC_LITTLE_ENDIAN); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_mesh(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_MESH_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; guint8 duration = tvb_get_bits8(tvb, sub_offset * 8 + 5, 2); guint bitmap_length; switch (duration) { case 0: bitmap_length = 4; break; case 1: bitmap_length = 2; break; case 2: bitmap_length = 1; break; default: bitmap_length = 0; } proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, bitmap_length, ENC_NA); sub_offset += bitmap_length; proto_tree_add_item(attr_tree, hf_nan_attr_mesh_id, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_further_service_discovery(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len) { guint sub_offset = offset + 3; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; gint bitmap_length = attr_len - 1; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, bitmap_length, ENC_NA); } static void dissect_attr_further_availability_map(proto_tree* attr_tree, tvbuff_t* tvb, gint offset) { guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_attr_further_av_map_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; static int* const availability_entry_control_fields[] = { &hf_nan_attr_further_av_map_entry_av_interval_duration, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_further_av_map_entry_ctrl, ett_further_av_map_entry_ctrl, availability_entry_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_attr_further_av_map_op_class, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_attr_further_av_map_channel_num, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_country_code(proto_tree* attr_tree, tvbuff_t* tvb, gint offset) { guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_attr_country_code, tvb, sub_offset, 2, ENC_ASCII); } static void dissect_attr_ranging(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_RANGING_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_ctrl_field, ett_map_control, map_control_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_attr_ranging_protocol, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_availability_intervals_bitmap, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_cluter_discovery(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_CLUSTER_DISC_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_attr_cluster_disc_id, tvb, sub_offset, 6, ENC_LITTLE_ENDIAN); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_attr_cluster_disc_time_offset, tvb, sub_offset, 8, ENC_LITTLE_ENDIAN); sub_offset += 8; proto_tree_add_item(attr_tree, hf_nan_attr_cluster_disc_anchor_master_rank, tvb, sub_offset, 8, ENC_LITTLE_ENDIAN); } static void dissect_attr_device_capability(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_DEVICE_CAP_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } static int* const device_cap_map_id_fields[] = { &hf_nan_attr_device_cap_map_id_apply_to, &hf_nan_attr_device_cap_map_id_associated_maps, NULL }; static int* const device_cap_committed_dw_fields[] = { &hf_nan_attr_device_cap_committed_dw_24ghz, &hf_nan_attr_device_cap_committed_dw_5ghz, &hf_nan_attr_device_cap_committed_dw_24ghz_overwrite, &hf_nan_attr_device_cap_committed_dw_5ghz_overwrite, NULL }; static int* const device_cap_supported_bands_fields[] = { &hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces, &hf_nan_attr_device_cap_supported_bands_sub_1ghz, &hf_nan_attr_device_cap_supported_bands_24ghz, &hf_nan_attr_device_cap_supported_bands_reserved_36ghz, &hf_nan_attr_device_cap_supported_bands_5ghz, &hf_nan_attr_device_cap_supported_bands_reserved_60ghz, NULL }; static int* const device_cap_op_mode_fields[] = { &hf_nan_attr_device_cap_op_mode_phy, &hf_nan_attr_device_cap_op_mode_vht8080, &hf_nan_attr_device_cap_op_mode_vht160, &hf_nan_attr_device_cap_op_mode_reserved_paging_ndl, NULL }; static int* const device_cap_antennas_fields[] = { &hf_nan_attr_device_cap_antennas_tx, &hf_nan_attr_device_cap_antennas_rx, NULL }; static int* const device_cap_capabilities_fields[] = { &hf_nan_attr_device_cap_capabilities_dfs_master, &hf_nan_attr_device_cap_capabilities_extended_key_id, &hf_nan_attr_device_cap_capabilities_simul_ndp_reception, &hf_nan_attr_device_cap_capabilities_ndpe_attr_support, NULL }; proto_tree_add_bitmask(attr_tree, tvb, offset + 3, hf_nan_map_id, ett_device_cap_map_id, device_cap_map_id_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 4, hf_nan_attr_device_cap_committed_dw, ett_device_cap_committed_dw, device_cap_committed_dw_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 6, hf_nan_attr_device_cap_supported_bands, ett_device_cap_supported_bands, device_cap_supported_bands_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 7, hf_nan_attr_device_cap_op_mode, ett_device_cap_op_mode, device_cap_op_mode_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 8, hf_nan_attr_device_cap_antennas, ett_device_cap_antennas, device_cap_antennas_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_attr_device_cap_max_channel_switch_time, tvb, offset + 9, 2, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 11, hf_nan_attr_device_cap_capabilities, ett_device_cap_capabilities, device_cap_capabilities_fields, ENC_LITTLE_ENDIAN); } static void dissect_attr_ndp(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_NDP_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_dialog_tokens, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; static int* const ndp_type_status_fields[] = { &hf_nan_attr_ndp_type, &hf_nan_status_1, NULL }; static int* const ndp_control_fields[] = { &hf_nan_attr_ndp_ctrl_confirm, &hf_nan_attr_ndp_ctrl_security_pres, &hf_nan_attr_ndp_ctrl_publish_id_pres, &hf_nan_attr_ndp_ctrl_responder_ndi_pres, &hf_nan_attr_ndp_ctrl_sepcific_info_pres, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_type_status, ett_type_status, ndp_type_status_fields, ENC_LITTLE_ENDIAN); guint8 bits_type = tvb_get_bits8(tvb, sub_offset * 8 + 4, 4); guint8 bit_offset = (sub_offset * 8) + 4; guint8 bits_status = tvb_get_bits8(tvb, bit_offset, 4); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_reason_code, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_attr_ndp_initiator, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_attr_ndp_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_ndp_control, ett_ndp_control, ndp_control_fields, ENC_LITTLE_ENDIAN); guint8 bits_ndp_info = tvb_get_bits8(tvb, (sub_offset * 8) + 2, 1); guint8 bits_publish_id = tvb_get_bits8(tvb, (sub_offset * 8) + 4, 1); sub_offset++; if (bits_publish_id == 1 && bits_type == 0) { proto_tree_add_item(attr_tree, hf_nan_publish_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; } if (bits_type == 1 && (bits_status == 0 || bits_status == 1)) { proto_tree_add_item(attr_tree, hf_nan_attr_ndp_responder_ndi, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; } if (bits_ndp_info) { proto_tree_add_item(attr_tree, hf_nan_attr_ndp_specific_info, tvb, sub_offset, -1, ENC_NA); } } static void dissect_attr_ndpe(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_NDPE_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } static int* const ndp_type_status_fields[] = { &hf_nan_attr_ndp_type, &hf_nan_status_1, NULL }; static int* const ndp_control_fields[] = { &hf_nan_attr_ndp_ctrl_confirm, &hf_nan_attr_ndp_ctrl_security_pres, &hf_nan_attr_ndp_ctrl_publish_id_pres, &hf_nan_attr_ndp_ctrl_responder_ndi_pres, NULL }; gint dissected_len = 0; proto_tree_add_item(attr_tree, hf_nan_dialog_tokens, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 4, hf_nan_type_status, ett_type_status, ndp_type_status_fields, ENC_LITTLE_ENDIAN); offset += 4; dissected_len += 4; guint8 bits_type = tvb_get_bits8(tvb, offset * 8 + 4, 4); guint32 bit_offset = (offset * 8) + 4; guint8 bits_status = tvb_get_bits8(tvb, bit_offset, 4); proto_tree_add_item(attr_tree, hf_nan_reason_code, tvb, offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_attr_ndp_initiator, tvb, offset + 2, 6, ENC_NA); proto_tree_add_item(attr_tree, hf_nan_attr_ndp_id, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 9, hf_nan_attr_ndp_control, ett_ndp_control, ndp_control_fields, ENC_LITTLE_ENDIAN); offset += 9; dissected_len += 9; guint8 bits_publish_id = tvb_get_bits8(tvb, (offset * 8) + 4, 1); offset++; dissected_len++; if (bits_publish_id == 1 && bits_type == 0) { proto_tree_add_item(attr_tree, hf_nan_publish_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; dissected_len++; } if (bits_type == 1 && (bits_status == 0 || bits_status == 1)) { proto_tree_add_item(attr_tree, hf_nan_attr_ndp_responder_ndi, tvb, offset, 6, ENC_NA); offset += 6; dissected_len += 6; } while (dissected_len < attr_len) { guint8 tlv_type = tvb_get_guint8(tvb, offset); guint16 tlv_len = tvb_get_letohs(tvb, offset + 1); proto_tree* tlv_tree = proto_tree_add_subtree(attr_tree, tvb, offset, tlv_len + 3, ett_ndpe_tlv, NULL, "TLV entry"); proto_tree_add_item(tlv_tree, hf_nan_attr_ndpe_tlv_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_tree, hf_nan_attr_ndpe_tlv_len, tvb, offset + 1, 2, ENC_LITTLE_ENDIAN); switch (tlv_type) { case 0: proto_tree_add_item(tlv_tree, hf_nan_attr_ndpe_tlv_ipv6_interface_identifier, tvb, offset + 3, 8, ENC_NA); offset += 11; dissected_len += 11; break; case 1: proto_tree_add_item(tlv_tree, hf_nan_oui, tvb, offset + 3, 3, ENC_NA); proto_tree_add_item(tlv_tree, hf_nan_attr_vendor_specific_body, tvb, offset + 6, tlv_len - 3, ENC_NA); offset += tlv_len + 3; dissected_len += tlv_len + 3; break; default: proto_tree_add_item(tlv_tree, hf_nan_attr_vendor_specific_body, tvb, offset + 3, tlv_len, ENC_NA); offset += tlv_len + 3; dissected_len += tlv_len + 3; break; } } } static void dissect_attr_availability(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_AVAILABILITY_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } static int* const availability_ctr_fields[] = { &hf_nan_attr_availability_map_id, &hf_nan_attr_availability_committed_changed, &hf_nan_attr_availability_potential_changed, &hf_nan_attr_availability_public_availability_changed, &hf_nan_attr_availability_ndc_changed, &hf_nan_attr_availability_reserved_multicast_schedule_changed, &hf_nan_attr_availability_reserved_multicast_schedule_change_changed, NULL }; static int* const availability_entry_ctr_fields[] = { &hf_nan_attr_availability_entry_ctr_type, &hf_nan_attr_availability_entry_ctr_pref, &hf_nan_attr_availability_entry_ctr_utilization, &hf_nan_attr_availability_entry_ctr_rx_nss, &hf_nan_attr_availability_entry_ctr_time_bitmap, NULL }; proto_tree_add_item(attr_tree, hf_nan_attr_availability_sequence_id, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(attr_tree, tvb, offset + 4, hf_nan_attr_availability_ctr, ett_device_cap_capabilities, availability_ctr_fields, ENC_LITTLE_ENDIAN); offset += 6; gint dissected_len = 3; while (dissected_len < attr_len) { guint16 entry_len = tvb_get_letohs(tvb, offset); guint8 entry_type = tvb_get_bits8(tvb, offset * 8 + 21, 3); guint8 hdr_len = 2; guint32 time_bitmap_len = 0; guint64 avail_entry; const gchar* entry_type_msg = val_to_str(entry_type, availability_entry_type, "Unknown type (%u)"); gchar* info_msg = wmem_strconcat(pinfo->pool, "Availability Type : ", entry_type_msg, NULL); proto_tree* entry_tree = proto_tree_add_subtree(attr_tree, tvb, offset, entry_len + 2, ett_availability_entry, NULL, info_msg); proto_tree_add_item(entry_tree, hf_nan_attr_availability_entry_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask_ret_uint64(entry_tree, tvb, offset + 2, hf_nan_attr_availability_entry_ctr, ett_availability_entry_ctr, availability_entry_ctr_fields, ENC_LITTLE_ENDIAN, &avail_entry); offset += 4; gboolean time_bitmap_present = avail_entry & (1 << 12); if (time_bitmap_present) { proto_tree_add_bitmask(entry_tree, tvb, offset, hf_nan_time_bitmap_ctrl, ett_time_bitmap_ctrl, time_bitmap_ctr_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item_ret_uint(entry_tree, hf_nan_time_bitmap_len, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN, &time_bitmap_len); proto_tree_add_item(entry_tree, hf_nan_time_bitmap, tvb, offset + 3, time_bitmap_len, ENC_NA); hdr_len = 5; offset += 3 + time_bitmap_len; } gint entries_len = entry_len - hdr_len - time_bitmap_len; proto_tree* entries_tree = proto_tree_add_subtree(entry_tree, tvb, offset, entries_len, ett_availability_entry_entries, NULL, "Band/Channel Entries"); guint64 entries_type, non_contiguous_bw, num_entries; proto_tree_add_bits_ret_val(entries_tree, hf_nan_attr_availability_entry_entries_type, tvb, offset * 8, 1, &entries_type, ENC_LITTLE_ENDIAN); proto_tree_add_bits_ret_val(entries_tree, hf_nan_attr_availability_entry_entries_non_contiguous_bw, tvb, offset * 8 + 1, 1, &non_contiguous_bw, ENC_LITTLE_ENDIAN); proto_tree_add_bits_ret_val(entries_tree, hf_nan_attr_availability_entry_entries_num_entries, tvb, offset * 8 + 4, 4, &num_entries, ENC_LITTLE_ENDIAN); offset += 1; for (guint8 i = 0; i < num_entries; i++) { switch (entries_type) { case 0: { proto_tree_add_item(entries_tree, hf_nan_attr_availability_entry_entries_band, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; break; } case 1: { int channel_entry_len = (non_contiguous_bw == 0) ? 4 : 6; proto_tree* channel_tree = proto_tree_add_subtree(entries_tree, tvb, offset, channel_entry_len, ett_availability_entry_entries_channel, NULL, "Channel Entry"); guint8 op_class = tvb_get_guint8(tvb, offset); guint16 bitmap = tvb_get_guint16(tvb, offset + 1, ENC_LITTLE_ENDIAN); proto_tree* op_class_tree = proto_tree_add_subtree(channel_tree, tvb, offset, 1, ett_availability_op_class, NULL, "Operating Class"); proto_tree_add_item(op_class_tree, hf_nan_attr_availability_entry_entries_start_freq, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(op_class_tree, hf_nan_attr_availability_entry_entries_bandwidth, tvb, offset, 1, ENC_LITTLE_ENDIAN); wmem_strbuf_t* str; str = wmem_strbuf_new(pinfo->pool, ""); for(unsigned i_bitmap = 0; i_bitmap < 16; ++i_bitmap) { if (bitmap & (1u << i_bitmap)) { const gint *channel_set = rval_to_channel_set(op_class, op_class_channel); if (channel_set == NULL) { expert_add_info(pinfo, channel_tree, &ei_nan_unknown_op_class); break; } gint channel = channel_set[i_bitmap]; switch (channel) { // TODO: replace these magic numbers (or use 802.11 dissector for this) case -3: wmem_strbuf_append_printf(str, "%s", "Derived from regulation "); break; case -2: wmem_strbuf_append_printf(str, "%s", "Vendor Specific "); break; case -1: wmem_strbuf_append_printf(str, "%s", "Reserved "); break; default: wmem_strbuf_append_printf(str, "%d ", channel); } } } proto_tree_add_string(channel_tree, hf_nan_attr_availability_entry_entries_channel_set, tvb, offset + 1, 2, wmem_strbuf_finalize(str)); proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_primary_channel_bitmap, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN); if (non_contiguous_bw == 1) { proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_aux_channel_bitmap, tvb, offset + 4, 2, ENC_LITTLE_ENDIAN); } offset += channel_entry_len; break; } } } dissected_len += entry_len + 2; } } static void dissect_attr_ndc(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_NDC_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } static int* const ndc_ctr_fields[] = { &hf_nan_attr_ndc_ctrl_selected, NULL }; static int* const ndc_map_id_fields[] = { &hf_nan_attr_ndc_map_id_related_sch, NULL }; proto_tree_add_item(attr_tree, hf_nan_attr_ndc_id, tvb, offset + 3, 6, ENC_NA); proto_tree_add_bitmask(attr_tree, tvb, offset + 9, hf_nan_attr_ndc_ctrl, ett_ndc_ctr, ndc_ctr_fields, ENC_LITTLE_ENDIAN); offset += 10; gint dissected_len = 7; while (dissected_len < attr_len) { guint8 time_bitmap_len = tvb_get_guint8(tvb, offset + 3); proto_tree* entry_tree = proto_tree_add_subtree(attr_tree, tvb, offset, time_bitmap_len + 4, ett_ndc_entries, NULL, "Schedule Entry"); proto_tree_add_bitmask(entry_tree, tvb, offset, hf_nan_map_id, ett_device_ndc_map_id, ndc_map_id_fields, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(entry_tree, tvb, offset + 1, hf_nan_time_bitmap_ctrl, ett_time_bitmap_ctrl, time_bitmap_ctr_fields, ENC_LITTLE_ENDIAN); proto_tree_add_item(entry_tree, hf_nan_time_bitmap_len, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(entry_tree, hf_nan_time_bitmap, tvb, offset + 4, time_bitmap_len, ENC_NA); offset += time_bitmap_len + 4; dissected_len += time_bitmap_len + 4; } } static void dissect_attr_ndl(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_NDL_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; proto_tree_add_item(attr_tree, hf_nan_dialog_tokens, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; static int* const ndl_type_status_fields[] = { &hf_nan_attr_ndl_type, &hf_nan_status_1, NULL }; static int* const ndl_control_fields[] = { &hf_nan_attr_ndl_ctrl_peer_id, &hf_nan_attr_ndl_ctrl_immutable_schedule_pres, &hf_nan_attr_ndl_ctrl_ndc_pres, &hf_nan_attr_ndl_ctrl_qos, &hf_nan_attr_ndl_ctrl_max_idle_pres, &hf_nan_attr_ndl_ctrl_type, &hf_nan_attr_ndl_ctrl_setup_reason, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_type_status, ett_type_status, ndl_type_status_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_reason_code, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_ndl_control, ett_ndl_control, ndl_control_fields, ENC_LITTLE_ENDIAN); guint8 peer_id_pres = tvb_get_bits8(tvb, sub_offset * 8 + 7, 1); guint8 immutable_sched_pres = tvb_get_bits8(tvb, sub_offset * 8 + 6, 1); guint8 idle_per = tvb_get_bits8(tvb, sub_offset * 8 + 3, 1); sub_offset++; dissected_len += 4; if (peer_id_pres) { proto_tree_add_item(attr_tree, hf_nan_attr_ndl_reserved_peer_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; dissected_len++; } if (idle_per) { proto_tree_add_item(attr_tree, hf_nan_attr_ndl_max_idle, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; dissected_len += 2; } if (immutable_sched_pres) { char* info_msg = "Immutable Schedule entry list"; proto_tree* sub_attr_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, attr_len - dissected_len, ett_ndl_schedule_entries, NULL, info_msg); while (dissected_len < attr_len) { proto_tree_add_item(sub_attr_tree, hf_nan_map_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(sub_attr_tree, tvb, sub_offset, hf_nan_time_bitmap_ctrl, ett_time_bitmap_ctrl, time_bitmap_ctr_fields, ENC_LITTLE_ENDIAN); sub_offset += 2; guint field_length = tvb_get_guint8(tvb, sub_offset); proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap_len, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap, tvb, sub_offset, field_length, ENC_NA); sub_offset += field_length; dissected_len += field_length + 4; } } } static void dissect_attr_ndl_qos(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_NDL_QOS_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_attr_ndlqos_min_time_slots, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_attr_ndlqos_max_latency, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); } static void dissect_attr_unaligned_schedule(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_UNALIGNED_SCH_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; static int* const control_fields[] = { &hf_nan_attr_unaligned_sch_ctrl_schedule_id, &hf_nan_attr_unaligned_sch_ctrl_seq_id, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_unaligned_sch_ctrl, ett_unaligned_sch_ctrl, control_fields, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(attr_tree, hf_nan_attr_unaligned_sch_starting_time, tvb, sub_offset, 4, ENC_LITTLE_ENDIAN); sub_offset += 4; proto_tree_add_item(attr_tree, hf_nan_attr_unaligned_sch_duration, tvb, sub_offset, 4, ENC_LITTLE_ENDIAN); sub_offset += 4; proto_tree_add_item(attr_tree, hf_nan_attr_unaligned_sch_period, tvb, sub_offset, 4, ENC_LITTLE_ENDIAN); sub_offset += 4; proto_tree_add_item(attr_tree, hf_nan_attr_unaligned_sch_count_down, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; static int* const ulw_overwrite_fields[] = { &hf_nan_attr_unaligned_sch_ulw_overwrite_all, &hf_nan_attr_unaligned_sch_ulw_overwrite_map_id, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_unaligned_sch_ulw_overwrite, ett_unaligned_sch_ulw_overwrite, ulw_overwrite_fields, ENC_LITTLE_ENDIAN); sub_offset++; dissected_len += 16; // ULW Control and Band ID or Channel Entry present if (dissected_len < attr_len) { static int* const ulw_control_fields[] = { &hf_nan_attr_unaligned_sch_ulw_ctrl_type, &hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av, &hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_unaligned_sch_ulw_ctrl, ett_unaligned_sch_ulw_ctrl, ulw_control_fields, ENC_LITTLE_ENDIAN); guint8 entry_type = tvb_get_bits8(tvb, sub_offset * 8 + 6, 2); sub_offset++; switch (entry_type) { case NAN_UNALIGNED_SCH_BAND_ID_EXIST: proto_tree_add_item(attr_tree, hf_nan_attr_availability_entry_entries_band, tvb, sub_offset, 1, ENC_LITTLE_ENDIAN); sub_offset++; break; case NAN_UNALIGNED_SCH_CHANNEL_ENTRY_EXIST: { proto_tree* channel_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_availability_entry_entries_channel, NULL, "Channel Entry"); proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_channel_op_class, tvb, sub_offset, 1, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_channel_bitmap, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_primary_channel_bitmap, tvb, sub_offset, 1, ENC_LITTLE_ENDIAN); break; } case NAN_UNALIGNED_SCH_CHANNEL_ENTRY_W_AUX_EXIST: { proto_tree* channel_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_availability_entry_entries_channel, NULL, "Channel Entry"); proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_channel_op_class, tvb, sub_offset, 1, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_channel_bitmap, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_primary_channel_bitmap, tvb, sub_offset, 1, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(channel_tree, hf_nan_attr_availability_entry_entries_aux_channel_bitmap, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); break; } } } } static void dissect_attr_ranging_info(proto_tree* attr_tree, tvbuff_t* tvb, gint offset) { guint sub_offset = offset + 3; static int* const location_info_availability_fields[] = { &hf_nan_attr_ranging_info_location_info_avail_lci, &hf_nan_attr_ranging_info_location_info_avail_geospatial, &hf_nan_attr_ranging_info_location_info_avail_civic_location, &hf_nan_attr_ranging_info_location_info_avail_last_movement_pres, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_ranging_info_location_info_avail, ett_ranging_info_location_info_availability, location_info_availability_fields, ENC_LITTLE_ENDIAN); gboolean loc_exists = tvb_get_bits8(tvb, sub_offset * 8 + 4, 1); sub_offset++; if (loc_exists) { proto_tree_add_item(attr_tree, hf_nan_attr_ranging_info_last_movement_indication, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); } } static void dissect_attr_ranging_setup(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_RANGING_SETUP_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; proto_tree_add_item(attr_tree, hf_nan_dialog_tokens, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; static int* const ranging_setup_type_status_fields[] = { &hf_nan_attr_ranging_setup_type, &hf_nan_status_2, NULL }; static int* const ranging_setup_ctrl_fields[] = { &hf_nan_attr_ranging_setup_ctrl_report_req, &hf_nan_attr_ranging_setup_ctrl_ftm_params, &hf_nan_attr_ranging_setup_ctrl_entry_list, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_type_status, ett_type_status, ranging_setup_type_status_fields, ENC_LITTLE_ENDIAN); sub_offset++; proto_tree_add_item(attr_tree, hf_nan_reason_code, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_ranging_setup_ctrl, ett_ranging_setup_ctrl, ranging_setup_ctrl_fields, ENC_LITTLE_ENDIAN); guint8 ftm_check = tvb_get_bits8(tvb, sub_offset * 8 + 6, 1); guint8 ranging_entry_check = tvb_get_bits8(tvb, sub_offset * 8 + 5, 1); sub_offset++; dissected_len += 4; if (ftm_check) { static int* const ranging_setup_ftm_param_fields[] = { &hf_nan_attr_ranging_setup_ftm_max_burst_duration, &hf_nan_attr_ranging_setup_ftm_min_delta, &hf_nan_attr_ranging_setup_ftm_max_per_burst, &hf_nan_attr_ranging_setup_ftm_format_bw, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_ranging_setup_ftm_params, ett_ranging_setup_ftm_params, ranging_setup_ftm_param_fields, ENC_LITTLE_ENDIAN); sub_offset += 3; dissected_len += 3; } if (ranging_entry_check) { char* info_msg = "Ranging Schedule Entry List"; proto_tree* sub_attr_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, attr_len - dissected_len, ett_ranging_setup_schedule_entries, NULL, info_msg); while (dissected_len < attr_len) { proto_tree_add_item(sub_attr_tree, hf_nan_map_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(sub_attr_tree, tvb, sub_offset, hf_nan_time_bitmap_ctrl, ett_time_bitmap_ctrl, time_bitmap_ctr_fields, ENC_LITTLE_ENDIAN); sub_offset += 2; guint field_length = tvb_get_guint8(tvb, sub_offset); proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap_len, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap, tvb, sub_offset, field_length, ENC_NA); sub_offset += field_length; dissected_len += field_length + 4; } } } static void dissect_attr_ftm_report(proto_tree* attr_tree, tvbuff_t* tvb, gint offset) { guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_attr_ftm_range_report, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_element_container(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { guint sub_offset = offset + 3; // Some header fields and trees are reused. static int* const container_map_id_fields[] = { &hf_nan_attr_device_cap_map_id_apply_to, &hf_nan_attr_device_cap_map_id_associated_maps, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_map_id, ett_device_cap_map_id, container_map_id_fields, ENC_LITTLE_ENDIAN); sub_offset += 1; guint dissected_length = 1; proto_tree* sub_tree; while (dissected_length < attr_len) { guint element_id = tvb_get_guint8(tvb, sub_offset); guint element_len = tvb_get_guint8(tvb, sub_offset + 1); const char* msg = val_to_str(element_id, ie_tag_num_vals, "Unknown element ID (%u)"); sub_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, element_len + 2, ett_ie_tree, NULL, msg); proto_tree_add_item(sub_tree, hf_nan_attr_container_element_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_tree, hf_nan_attr_container_element_len, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; ieee80211_tagged_field_data_t field_data = { 0 }; tvbuff_t* ie_tvb = tvb_new_subset_length_caplen(tvb, sub_offset, element_len, element_len); field_data.item_tag = sub_tree; dissector_try_uint_new(ie_handle_table, element_id, ie_tvb, pinfo, sub_tree, TRUE, &field_data); sub_offset += element_len; dissected_length += element_len + 2; } } static void dissect_attr_extended_wlan_infra(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_EXTENDED_WLAN_INFRA_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_bss_id, tvb, sub_offset, 6, ENC_LITTLE_ENDIAN); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_attr_wlan_infra_device_role, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset += 1; char* info_msg = "Non-NAN Operating Channel Information"; proto_tree* sub_attr_tree_op = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 3, ett_non_nan_op_channel, NULL, info_msg); proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_global_op_class, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_channel, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_center_freq, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; char* info_msg_beacon = "Non-NAN Beacon Information"; proto_tree* sub_attr_tree_beacon = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_non_nan_beacon, NULL, info_msg_beacon); proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_tbtt_offset, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_interval, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); // sub_offset += 2; } static void dissect_attr_extended_p2p_operation(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_EXTENDED_P2P_OP_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; static int* const ext_p2p_bitmap_fields[] = { &hf_nan_attr_p2p_device_role_device, &hf_nan_attr_p2p_device_role_group_owner, &hf_nan_attr_p2p_device_role_client, NULL }; proto_tree_add_bitmask(attr_tree, tvb, sub_offset, hf_nan_attr_p2p_device_role, ett_p2p_device_role, ext_p2p_bitmap_fields, ENC_LITTLE_ENDIAN); sub_offset += 1; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; char* info_msg = "Non-NAN Operating Channel Information"; proto_tree* sub_attr_tree_op = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 3, ett_non_nan_op_channel, NULL, info_msg); proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_global_op_class, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_channel, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_center_freq, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; char* info_msg_beacon = "Non-NAN Beacon Information"; proto_tree* sub_attr_tree_beacon = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_non_nan_beacon, NULL, info_msg_beacon); proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_tbtt_offset, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_interval, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); // sub_offset += 2; } static void dissect_attr_extended_ibss(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len != NAN_EXTENDED_IBSS_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_bss_id, tvb, sub_offset, 6, ENC_LITTLE_ENDIAN); sub_offset += 6; proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; char* info_msg = "Non-NAN Operating Channel Information"; proto_tree* sub_attr_tree_op = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 3, ett_non_nan_op_channel, NULL, info_msg); proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_global_op_class, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_channel, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_center_freq, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; char* info_msg_beacon = "Non-NAN Beacon Information"; proto_tree* sub_attr_tree_beacon = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_non_nan_beacon, NULL, info_msg_beacon); proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_tbtt_offset, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_interval, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); // sub_offset += 2; } static void dissect_attr_extended_mesh(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_EXTENDED_MESH_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint length = tvb_get_guint16(tvb, sub_offset - 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(attr_tree, hf_nan_mac_address, tvb, sub_offset, 6, ENC_NA); sub_offset += 6; char* info_msg = "Non-NAN Operating Channel Information"; proto_tree* sub_attr_tree_op = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 3, ett_non_nan_op_channel, NULL, info_msg); proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_global_op_class, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_channel, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree_op, hf_nan_non_op_channel_center_freq, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; char* info_msg_beacon = "Non-NAN Beacon Information"; proto_tree* sub_attr_tree_beacon = proto_tree_add_subtree(attr_tree, tvb, sub_offset, 4, ett_non_nan_beacon, NULL, info_msg_beacon); proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_tbtt_offset, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(sub_attr_tree_beacon, hf_nan_non_beacon_interval, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(attr_tree, hf_nan_attr_mesh_id, tvb, sub_offset, length - sub_offset + 3, ENC_NA); } static void dissect_attr_cipher_suite_info(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_CIPHER_SUITE_INFO_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; proto_tree_add_item(attr_tree, hf_nan_attr_cipher_suite_capabilities, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; dissected_len++; char* info_msg = "Cipher Suite List"; proto_tree* sub_attr_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, attr_len - dissected_len, ett_cipher_suite_info_list, NULL, info_msg); while (dissected_len < attr_len) { proto_tree_add_item(sub_attr_tree, hf_nan_attr_cipher_suite_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_publish_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; dissected_len += 2; } } static void dissect_attr_security_context_info(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_CIPHER_SUITE_INFO_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; while (dissected_len < attr_len) { guint field_length = tvb_get_guint16(tvb, sub_offset, ENC_LITTLE_ENDIAN); proto_item* sub_attr_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, field_length + 4, ett_attributes, NULL, "Security Context Identifier"); proto_tree_add_item(sub_attr_tree, hf_nan_attr_security_context_identifier_len, tvb, sub_offset, 2, ENC_LITTLE_ENDIAN); sub_offset += 2; proto_tree_add_item(sub_attr_tree, hf_nan_attr_security_context_identifier_type, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_publish_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_attr_security_context_identifier, tvb, sub_offset, field_length, ENC_NA); sub_offset += field_length; dissected_len += field_length + 4; } } static void dissect_attr_shared_key_descriptor(proto_tree* attr_tree, tvbuff_t* tvb, gint offset) { guint sub_offset = offset + 3; proto_tree_add_item(attr_tree, hf_nan_publish_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset += 1; proto_tree_add_item(attr_tree, hf_nan_attr_shared_key_rsna_descriptor, tvb, sub_offset, -1, ENC_NA); } static void dissect_attr_public_availability(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_PUBLIC_AVAIL_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; guint dissected_len = 0; proto_tree* sub_attr_tree = proto_tree_add_subtree(attr_tree, tvb, sub_offset, attr_len, ett_public_availability_sch_entries, NULL, "Public Availability Schedule Entry List"); while (dissected_len < attr_len) { proto_tree_add_item(sub_attr_tree, hf_nan_map_id, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_bitmask(sub_attr_tree, tvb, sub_offset, hf_nan_time_bitmap_ctrl, ett_time_bitmap_ctrl, time_bitmap_ctr_fields, ENC_LITTLE_ENDIAN); sub_offset += 2; guint field_length = tvb_get_guint8(tvb, sub_offset); proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap_len, tvb, sub_offset, 1, ENC_BIG_ENDIAN); sub_offset++; proto_tree_add_item(sub_attr_tree, hf_nan_time_bitmap, tvb, sub_offset, field_length, ENC_NA); sub_offset += field_length; dissected_len += field_length + 4; } } static void dissect_attr_vendor_specific(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, guint16 attr_len, packet_info* pinfo) { if (attr_len < NAN_VENDOR_SPECIFIC_MIN_LENGTH) { expert_add_info(pinfo, attr_tree, &ei_nan_elem_len_invalid); return; } guint sub_offset = offset + 3; tvbuff_t* ie_tvb = tvb_new_subset_length_caplen(tvb, sub_offset, -1, -1); ieee80211_tagged_field_data_t field_data = { 0 }; field_data.item_tag = attr_tree; dissector_try_uint_new(ie_handle_table, TAG_VENDOR_SPECIFIC_IE, ie_tvb, pinfo, attr_tree, TRUE, &field_data); } static void find_attribute_field(proto_tree* nan_tree, tvbuff_t* tvb, guint tvb_len, guint* offset, packet_info* pinfo) { if ((tvb_len - *offset) < 3) { proto_tree_add_expert_format(nan_tree, pinfo, &ei_nan_elem_len_invalid, tvb, *offset, -1, "Insufficient remaining packet bytes for NAN attribute"); *offset = tvb_len; return; } gint attr_id = tvb_get_guint8(tvb, *offset); guint16 attr_len = tvb_get_letohs(tvb, *offset + 1); if ((*offset + 3 + attr_len) > tvb_len) { proto_tree_add_expert_format(nan_tree, pinfo, &ei_nan_elem_len_invalid, tvb, *offset, -1, "Attribute length (%u) exceeds remaining packet length. Attribute id: %u", attr_len, attr_id); *offset = tvb_len; return; } proto_tree* attr_tree = proto_tree_add_subtree(nan_tree, tvb, *offset, attr_len + 3, ett_attributes, NULL, val_to_str(attr_id, attribute_types, "Unknown attribute ID (%u)")); proto_tree_add_item(attr_tree, hf_nan_attribute_type, tvb, *offset, 1, ENC_NA); proto_tree_add_item(attr_tree, hf_nan_attribute_len, tvb, *offset + 1, 2, ENC_LITTLE_ENDIAN); switch (attr_id) { case NAN_ATTR_SERVICE_DESCRIPTOR: dissect_attr_sda(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_MASTER_INDICATION: dissect_attr_master_indication(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_CLUSTER: dissect_attr_cluster(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_CIPHER_SUITE_INFO: dissect_attr_cipher_suite_info(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_SECURITY_CONTEXT_INFO: dissect_attr_security_context_info(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_SHARED_KEY_DESCRIPTOR: dissect_attr_shared_key_descriptor(attr_tree, tvb, *offset); break; case NAN_ATTR_PUBLIC_AVAILABILITY: dissect_attr_public_availability(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_ELEMENT_CONTAINER: dissect_attr_element_container(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_FTM_RANGING_REPORT: dissect_attr_ftm_report(attr_tree, tvb, *offset); break; case NAN_ATTR_RANGING_SETUP: dissect_attr_ranging_setup(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_RANGING_INFORMATION: dissect_attr_ranging_info(attr_tree, tvb, *offset); break; case NAN_ATTR_UNALIGNED_SCHEDULE: dissect_attr_unaligned_schedule(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_NDL_QOS: dissect_attr_ndl_qos(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_EXTENDED_WLAN_INFRA: dissect_attr_extended_wlan_infra(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_EXTENDED_P2P_OPERATION: dissect_attr_extended_p2p_operation(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_EXTENDED_IBSS: dissect_attr_extended_ibss(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_EXTENDED_MESH: dissect_attr_extended_mesh(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_CONNECTION_CAPABILITY: dissect_attr_connection_capability(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_CLUSTER_DISCOVERY: dissect_attr_cluter_discovery(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_RANGING: dissect_attr_ranging(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_COUNTRY_CODE: dissect_attr_country_code(attr_tree, tvb, *offset); break; case NAN_ATTR_FURTHER_AVAILABILITY_MAP: dissect_attr_further_availability_map(attr_tree, tvb, *offset); break; case NAN_ATTR_FURTHER_SERVICE_DISCOVERY: dissect_attr_further_service_discovery(attr_tree, tvb, *offset, attr_len); break; case NAN_ATTR_MESH: dissect_attr_mesh(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_IBSS: dissect_attr_ibss(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_P2P_OPERATION: dissect_attr_p2p_operation(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_WLAN_INFRA: dissect_attr_wlan_infra(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_NDP: dissect_attr_ndp(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_NDP_EXTENSION: dissect_attr_ndpe(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_SERVICE_DESCRIPTOR_EXTENSION: dissect_attr_sdea(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_DEVICE_CAPABILITY: dissect_attr_device_capability(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_AVAILABILITY: dissect_attr_availability(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_NDC: dissect_attr_ndc(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_SERVICE_ID_LIST: case NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST: dissect_attr_service_id_list(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_VENDOR_SPECIFIC: dissect_attr_vendor_specific(attr_tree, tvb, *offset, attr_len, pinfo); break; case NAN_ATTR_NDL: dissect_attr_ndl(attr_tree, tvb, *offset, attr_len, pinfo); break; default: expert_add_info(pinfo, attr_tree, &ei_nan_unknown_attr_id); } *offset += attr_len + 3; } static int dissect_nan_beacon(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { guint offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "NAN"); // // Workaround to identify NAN Discovery vs Synchronization beacon frames. // // We have to determine the beacon interval, but there is, unfortunately, // no mechanism by which a subdissector can request that an arbitrary // field value be provided to it by the calling dissector, so we can't // just ask for "wlan.fixed.beacon". // // Fortunaely, we are currently putting the Discovery vs. Sync information // only in the Info column, and the beacon interval is put at the end // of the Info column, as "BI={interval}", by the 802.11 dissector, so // we can just fetch the Info column string and, if it's present, extract // that value. // // An interval of 100, meaning .1024 seconds, means it's a Discovery // beacon, and an interval of 512, meaning .524288 seconds, means // it's a Sync beacon. // const gchar* info_text = col_get_text(pinfo->cinfo, COL_INFO); if (info_text != NULL && g_str_has_suffix(info_text, "100")) { col_prepend_fstr(pinfo->cinfo, COL_INFO, "Discovery "); } else if (info_text != NULL && g_str_has_suffix(info_text, "512")) { col_prepend_fstr(pinfo->cinfo, COL_INFO, "Sync "); } else { expert_add_info(pinfo, tree, &ei_nan_unknown_beacon_type); col_prepend_fstr(pinfo->cinfo, COL_INFO, "[Unknown] "); } proto_item* ti = proto_tree_add_item(tree, proto_nan, tvb, 0, -1, ENC_NA); proto_tree* nan_tree = proto_item_add_subtree(ti, ett_nan); guint tvb_len = tvb_reported_length(tvb); while (offset < tvb_len) { find_attribute_field(nan_tree, tvb, tvb_len, &offset, pinfo); } return tvb_captured_length(tvb); } static int dissect_nan_action(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { guint offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "NAN"); proto_tree* upper_tree = proto_tree_get_parent_tree(tree); proto_item* ti = proto_tree_add_item(upper_tree, proto_nan, tvb, 0, -1, ENC_NA); proto_tree* nan_tree = proto_item_add_subtree(ti, ett_nan); guint8 subtype = tvb_get_guint8(tvb, offset); const gchar* subtype_text = rval_to_str(subtype, action_frame_type_values, "Unknown type (%u)"); proto_item_set_text(ti, "%s", subtype_text); proto_tree_add_item(nan_tree, hf_nan_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); col_prepend_fstr(pinfo->cinfo, COL_INFO, "%s", subtype_text); offset++; guint tvb_len = tvb_reported_length(tvb); while (offset < tvb_len) { find_attribute_field(nan_tree, tvb, tvb_len, &offset, pinfo); } return tvb_captured_length(tvb); } static int dissect_nan_service_discovery(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { guint offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "NAN"); proto_item* ti = proto_tree_add_item(tree, proto_nan, tvb, 0, -1, ENC_NA); proto_tree* nan_tree = proto_item_add_subtree(ti, ett_nan); guint tvb_len = tvb_reported_length(tvb); while (offset < tvb_len) { find_attribute_field(nan_tree, tvb, tvb_len, &offset, pinfo); } return tvb_captured_length(tvb); } void proto_register_nan(void) { static hf_register_info hf[] = { { &hf_nan_attribute_type, { "Attribute Type", "nan.attribute.type", FT_UINT8, BASE_DEC, VALS(attribute_types), 0x0, NULL, HFILL } }, { &hf_nan_attribute_len, { "Attribute Length", "nan.attribute.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_action_subtype, { "Subtype", "nan.action.subtype", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(action_frame_type_values), 0x0, NULL, HFILL } }, { &hf_nan_instance_id, { "Instance ID", "nan.instance_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_service_id, { "Service ID", "nan.service_id", FT_BYTES, SEP_COLON, NULL, 0x0, NULL, HFILL } }, { &hf_nan_map_id, { "Map ID", "nan.map_id", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_oui, { "OUI", "nan.oui", FT_BYTES, SEP_COLON, NULL, 0x0, NULL, HFILL } }, { &hf_nan_type_status, { "Type and Status", "nan.type_status", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_reason_code, { "Reason Code", "nan.reason_code", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(reason_code_values), 0x0, NULL, HFILL } }, { &hf_nan_status_1, { "Status", "nan.status", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(status_type1_values), 0xF0, NULL, HFILL } }, { &hf_nan_status_2, { "Status", "nan.status", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(status_type2_values), 0xF0, NULL, HFILL } }, { &hf_nan_bss_id, { "BSS ID", "nan.bss_id", FT_UINT48, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_availability_intervals_bitmap, { "Availability Intervals Bitmap", "nan.availability_intervals_bitmap", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_mac_address, { "MAC Address", "nan.mac_address", FT_BYTES, SEP_COLON, NULL, 0x0, NULL, HFILL } }, { &hf_nan_publish_id, { "Publish ID", "nan.publish_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_dialog_tokens, { "Dialog Token", "nan.dialog_token", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_time_bitmap, { "Time Bitmap", "nan.time_bitmap", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_time_bitmap_len, { "Time Bitmap Length", "nan.time_bitmap.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_time_bitmap_ctrl, { "Time Bitmap Control", "nan.time_bitmap.ctrl", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_time_bitmap_ctrl_bit_duration, { "Bit Duration", "nan.time_bitmap.ctrl.bit_duration", FT_UINT16, BASE_DEC | BASE_RANGE_STRING, RVALS(availability_entry_time_bitmap_ctr_bit_duration_type), 0x0007, NULL, HFILL } }, { &hf_nan_time_bitmap_ctrl_period, { "Period", "nan.time_bitmap.ctrl.period", FT_UINT16, BASE_DEC, VALS(availability_entry_time_bitmap_ctr_period_type), 0x0038, NULL, HFILL } }, { &hf_nan_time_bitmap_ctrl_start_offset, { "Start Offset", "nan.time_bitmap.ctrl.start_offset", FT_UINT16, BASE_DEC, NULL, 0x7FC0, NULL, HFILL } }, { &hf_nan_map_ctrl_map_id, { "Map ID", "nan.map_ctrl.map_id", FT_UINT8, BASE_HEX_DEC, NULL, 0xF, NULL, HFILL } }, { &hf_nan_map_ctrl_availability_interval_duration, { "Availability Interval Duration", "nan.map_ctrl.interval_duration", FT_UINT8, BASE_DEC, VALS(map_ctrl_availability_interval_duration), 0x30, NULL, HFILL } }, { &hf_nan_map_ctrl_repeat, { "Repeat", "nan.map_ctrl.repeat", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL } }, { &hf_nan_map_ctrl_field, { "Map Control", "nan.map_ctrl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_non_op_channel_global_op_class, { "Global Operation Class", "nan.non_op_channel.global_op_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_non_op_channel_channel, { "Channel", "nan.non_op_channel.channel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_non_op_channel_center_freq, { "Channel Center Frequency", "nan.non_op_channel.center_freq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_non_beacon_tbtt_offset, { "TBTT Offset", "nan.non_beacon.tbtt_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_non_beacon_interval, { "Beacon Interval", "nan.non_beacon.interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_master_preference, { "Master Preference", "nan.master_indication.preference", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_master_random_factor, { "Random Factor", "nan.master_indication.random_factor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_anchor_master_rank, { "Anchor Master Rank", "nan.cluster.anchor_master_rank", FT_UINT64, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_hop_count, { "Hop Count to Anchor Master", "nan.cluster.hop_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_beacon_transmission_time, { "Anchor Master Beacon Transmission Time", "nan.cluster.beacon_transmission_time", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_requestor_instance_id, { "Requestor Instance ID", "nan.sda.requestor_instance_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_sc, { "Service Control", "nan.sda.sc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_sc_type, { "Service Control Type", "nan.sda.sc.type", FT_UINT8, BASE_HEX, VALS(service_ctr_type), 0x03, NULL, HFILL } }, { &hf_nan_attr_sda_sc_matching_filter, { "Matching Filter Present", "nan.sda.sc.matching_filter", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_nan_attr_sda_sc_service_response, { "Service Response Filter Present", "nan.sda.sc.service_response", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_nan_attr_sda_sc_service_info, { "Service Info Present", "nan.sda.sc.service_info", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_nan_attr_sda_sc_discovery_range, { "Discovery Range Limited", "nan.sda.sc.discovery_range", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_nan_attr_sda_sc_binding_bitmap, { "Binding Bitmap Present", "nan.sda.sc.binding_bitmap", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL } }, { &hf_nan_attr_sda_binding_bitmap, { "Binding Bitmap", "nan.sda.binding_bitmap", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_matching_filter_len, { "Matching Filter Length", "nan.sda.matching_filter_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_matching_filter_val, { "Matching Filter Value", "nan.sda.matching_filter_val", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_service_response_filter_len, { "Service Response Filter Length", "nan.sda.service_response_filter_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_srf_ctr, { "SRF Control", "nan.sda.srf_ctr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_srf_ctr_type, { "SRF Type", "nan.sda.srf_type", FT_BOOLEAN, 8, TFS(&srf_type_flags), 0x01, NULL, HFILL } }, { &hf_nan_attr_sda_srf_ctr_include, { "Include", "nan.sda.srf_include", FT_BOOLEAN, 8, TFS(&srf_include_flags), 0x02, NULL, HFILL } }, { &hf_nan_attr_sda_srf_ctr_bloom_filter_index, { "Bloom Filter Index", "nan.sda.srf_bloom_filter_index", FT_UINT8, BASE_DEC_HEX, NULL, 0x0C, NULL, HFILL } }, { &hf_nan_attr_sda_srf_address_set, { "Address Set", "nan.sda.srf_address_set", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_service_info_len, { "Service Info Length", "nan.sda.service_info_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sda_service_info, { "Service Info", "nan.sda.service_info", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr, { "SDEA Control", "nan.sdea.ctr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_fsd, { "FSD Required", "nan.sdea.ctr_fsd", FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_fsd_w_gas, { "FSD with GAS", "nan.sdea.ctr_fsd_w_gas", FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_data_path, { "Data Path Required", "nan.sdea.ctr_data_path", FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_data_path_type, { "Data Path Type", "nan.sdea.ctr_data_path_type", FT_BOOLEAN, 16, TFS(&sdea_ctr_data_path_type_flags), 0x0008, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_reserved_multicast_type, { "Reserved (Multicast Type)", "nan.sdea.ctr_reserved_multicast_type", FT_BOOLEAN, 16, TFS(&sdea_ctr_reserved_multicast_type_flags), 0x0010, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_qos, { "QoS Required", "nan.sdea.ctr_qos", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_security, { "Security Required", "nan.sdea.ctr_security", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_ranging, { "Ranging Required", "nan.sdea.ctr_ranging", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_range_limit, { "Range Limit Present", "nan.sdea.ctr_range_limit", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, { &hf_nan_attr_sdea_ctr_service_update_indicator, { "Service Update Indicator Present", "nan.sdea.ctr_service_update_indicator", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, { &hf_nan_attr_sdea_ingress_range_limit, { "Ingress Range Limit", "nan.sdea.range_limit_ingress", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_egress_range_limit, { "Egress Range Limit", "nan.sdea.range_limit_egress", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_service_update_indicator, { "Service Update Indicator", "nan.sdea.service_update_indicator", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_service_info_length, { "Service Info Length", "nan.sdea.service_info_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_service_info_protocol_type, { "Service Protocol Type", "nan.sdea.service_info_protocol_type", FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(service_info_protocol_type), 0x0, NULL, HFILL } }, { &hf_nan_attr_sdea_service_info_specific, { "Service Specific info", "nan.sdea.service_info_specific", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_connection_cap_bitmap, { "Connection Capability Bitmap", "nan.connection_cap.bitmap", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_connection_cap_wifi_direct, { "Wifi Direct", "nan.connection_cap.wifi_direct", FT_BOOLEAN, 16, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_connection_cap_p2ps, { "P2Ps", "nan.connection_cap.p2ps", FT_BOOLEAN, 16, NULL, 0x2, NULL, HFILL } }, { &hf_nan_attr_connection_cap_tdls, { "TDLS", "nan.connection_cap.tdls", FT_BOOLEAN, 16, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_connection_cap_wlan_infra, { "WLAN Infrastructure", "nan.connection_cap.wlan_infra", FT_BOOLEAN, 16, NULL, 0x8, NULL, HFILL } }, { &hf_nan_attr_connection_cap_ibss, { "IBSS", "nan.connection_cap.ibss", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, { &hf_nan_attr_connection_cap_mesh, { "Mesh", "nan.connection_cap.mesh", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, { &hf_nan_attr_wlan_infra_device_role, { "Device Role", "nan.wlan_infra.device_role", FT_UINT8, BASE_DEC, VALS(device_role), 0x0, NULL, HFILL } }, { &hf_nan_attr_p2p_device_role_device, { "P2P Device", "nan.p2p.device", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_p2p_device_role_group_owner, { "P2P Group Owner", "nan.p2p.group_owner", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL } }, { &hf_nan_attr_p2p_device_role_client, { "P2P Client", "nan.p2p.client", FT_BOOLEAN, 8, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_p2p_device_role, { "P2P Device Role", "nan.p2p.device_role", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_mesh_id, { "Mesh ID", "nan.mesh.id", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_further_av_map_id, { "Map ID", "nan.furth.av.map.id", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(furth_av_map_id), 0x0, NULL, HFILL } }, { &hf_nan_attr_further_av_map_entry_av_interval_duration, { "Availability Interval Duration", "nan.further_av_map.entry.av_interval_duration", FT_UINT8, BASE_DEC, VALS(map_ctrl_availability_interval_duration), 0x03, NULL, HFILL } }, { &hf_nan_attr_further_av_map_op_class, { "Operating Class", "nan.further_av_map.entry.op_class", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_further_av_map_channel_num, { "Channel Number", "nan.further_av_map.entry.channel_number", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_further_av_map_entry_ctrl, { "Entry Control Fields", "nan.further_av_map.entry.ctrl", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_country_code, { "Condensed Country String", "nan.country_code", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ranging_protocol, { "Ranging Protocol", "nan.ranging.protocol", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_disc_id, { "Cluster ID", "nan.cluster_disc.id", FT_UINT48, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_disc_time_offset, { "Cluster Time Offset", "nan.cluster_disc.time_offset", FT_UINT64, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cluster_disc_anchor_master_rank, { "Anchor Master Rank", "nan.cluster_disc.anchor_master_rank", FT_UINT64, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_map_id_apply_to, { "Apply to", "nan.device_cap.map_id_apply_to", FT_BOOLEAN, 8, TFS(&device_cap_map_id_apply_to_flags), 0x01, NULL, HFILL } }, { &hf_nan_attr_device_cap_map_id_associated_maps, { "Map ID", "nan.device_cap.map_id_associated_maps", FT_UINT8, BASE_HEX_DEC, NULL, 0x1E, NULL, HFILL } }, { &hf_nan_attr_device_cap_committed_dw, { "Committed DW Info", "nan.device_cap.committed_dw_info", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_committed_dw_24ghz, { "2.4 GHz DW", "nan.device_cap.committed_dw_info.24ghz", FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL } }, { &hf_nan_attr_device_cap_committed_dw_5ghz, { "5 GHz DW", "nan.device_cap.committed_dw_info.5ghz", FT_UINT16, BASE_DEC, NULL, 0x0038, NULL, HFILL } }, { &hf_nan_attr_device_cap_committed_dw_24ghz_overwrite, { "2.4 GHz DW Overwrite", "nan.device_cap.committed_dw_info.24ghz_overwrite", FT_UINT16, BASE_DEC, NULL, 0x03C0, NULL, HFILL } }, { &hf_nan_attr_device_cap_committed_dw_5ghz_overwrite, { "5 GHz DW Overwrite", "nan.device_cap.committed_dw_info.5ghz_overwrite", FT_UINT16, BASE_DEC, NULL, 0x3C00, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands, { "Supported Bands", "nan.device_cap.supported_bands", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_reserved_tv_whitespaces, { "Reserved (for TV white spaces)", "nan.device_cap.supported_bands.tv_whitespaces", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_sub_1ghz, { "Sub-1 GHz", "nan.device_cap.supported_bands.sub_1ghz", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_24ghz, { "2.4 GHz", "nan.device_cap.supported_bands.24ghz", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_reserved_36ghz, { "Reserved (for 3.6 GHz)", "nan.device_cap.supported_bands.reserved_36ghz", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_5ghz, { "4.9 and 5 GHz", "nan.device_cap.supported_bands.5ghz", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_nan_attr_device_cap_supported_bands_reserved_60ghz, { "Reserved (for 60 GHz)", "nan.device_cap.supported_bands.reserved_60ghz", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_nan_attr_device_cap_op_mode, { "Operation Mode", "nan.device_cap.op_mode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_op_mode_phy, { "PHY Mode", "nan.device_cap.op_mode.phy", FT_BOOLEAN, 8, TFS(&device_cap_op_mode_phy_flags), 0x01, NULL, HFILL } }, { &hf_nan_attr_device_cap_op_mode_vht8080, { "VHT 80+80", "nan.device_cap.op_mode.vht8080", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_nan_attr_device_cap_op_mode_vht160, { "VHT 160", "nan.device_cap.op_mode.vht160", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_nan_attr_device_cap_op_mode_reserved_paging_ndl, { "Reserved (Paging NDL Support)", "nan.device_cap.op_mode.reserved_paging_ndl", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_nan_attr_device_cap_antennas, { "Antennas", "nan.device_cap.antennas", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_antennas_tx, { "Number of TX antennas", "nan.device_cap.antennas.tx", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_nan_attr_device_cap_antennas_rx, { "Number of RX antennas", "nan.device_cap.antennas.rx", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_nan_attr_device_cap_max_channel_switch_time, { "Max Channel Switch Time (us)", "nan.device_cap.max_channel_switch_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_capabilities, { "Capabilities", "nan.device_cap.capabilities", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_device_cap_capabilities_dfs_master, { "DFS Master", "nan.device_cap.capabilities.dfs_master", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_nan_attr_device_cap_capabilities_extended_key_id, { "Extended key ID", "nan.device_cap.capabilities.extended_key_id", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_nan_attr_device_cap_capabilities_simul_ndp_reception, { "Simultaneous NDP data reception", "nan.device_cap.capabilities.simul_ndp_reception", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_nan_attr_device_cap_capabilities_ndpe_attr_support, { "NDPE attribute support", "nan.device_cap.capabilities.ndpe_attr_support", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL } }, { &hf_nan_attr_ndp_type, { "Type", "nan.ndp.type", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(ndp_type_values), 0xF, NULL, HFILL } }, { &hf_nan_attr_ndp_initiator, { "Initiator NDI", "nan.ndp.initiator_ndi", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndp_id, { "NDP ID", "nan.ndp.id", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndp_ctrl_confirm, { "Confirm Required", "nan.ndp.ctrl.confirm", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_ndp_ctrl_security_pres, { "Security Present", "nan.ndp.ctrl.security_pres", FT_BOOLEAN, 8, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_ndp_ctrl_publish_id_pres, { "Publish ID Present", "nan.ndp.ctrl.publish_id_pres", FT_BOOLEAN, 8, NULL, 0x8, NULL, HFILL } }, { &hf_nan_attr_ndp_ctrl_responder_ndi_pres, { "Responder NDI Present", "nan.ndp.ctrl.responder_ndi_pres", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_nan_attr_ndp_ctrl_sepcific_info_pres, { "NDP Specific Info Present", "nan.ndp.ctrl.specific_info_pres", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL } }, { &hf_nan_attr_ndp_control, { "NDP Control", "nan.ndp.ctrl", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndp_responder_ndi, { "Responder NDI", "nan.ndp.responder.ndi", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndp_specific_info, { "NDP Specific Info", "nan.ndp.specific_info", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndpe_tlv_type, { "Type", "nan.ndpe.tlv.type", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(ndpe_tlv_type_values), 0x0, NULL, HFILL } }, { &hf_nan_attr_ndpe_tlv_len, { "Length", "nan.ndpe.tlv.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndpe_tlv_ipv6_interface_identifier, { "Interface Identifier", "nan.ndpe.tlv.ipv6_interface_identifier", FT_BYTES, SEP_COLON, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_sequence_id, { "Sequence ID", "nan.availability.sequence_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_ctr, { "Attribute Control", "nan.availability.ctr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_map_id, { "Map ID", "nan.availability.map_id", FT_UINT16, BASE_HEX_DEC, NULL, 0x000F, NULL, HFILL } }, { &hf_nan_attr_availability_committed_changed, { "Committed Changed", "nan.availability.committed_changed", FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, { &hf_nan_attr_availability_potential_changed, { "Potential Changed", "nan.availability.potential_changed", FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, { &hf_nan_attr_availability_public_availability_changed, { "Public Availability Attribute Changed", "nan.availability.public_availability_changed", FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, { &hf_nan_attr_availability_ndc_changed, { "NDC Attribute Changed", "nan.availability.ndc_changed", FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, { &hf_nan_attr_availability_reserved_multicast_schedule_changed, { "Reserved (Multicast Schedule Attribute Changed)", "nan.availability.reserved_multicast_schedule_changed", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, { &hf_nan_attr_availability_reserved_multicast_schedule_change_changed, { "Reserved (Multicast Schedule Change Attribute Change Changed)", "nan.availability.reserved_multicast_schedule_change_changed", FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, { &hf_nan_attr_availability_entry_len, { "Length", "nan.availability.entry.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr, { "Entry Control", "nan.availability.entry.ctr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr_type, { "Availability Type", "nan.availability.entry.ctr.type", FT_UINT16, BASE_HEX, VALS(availability_entry_type), 0x0007, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr_pref, { "Usage Preference", "nan.availability.entry.ctr.pref", FT_UINT16, BASE_DEC, NULL, 0x0018, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr_utilization, { "Utilization", "nan.availability.entry.ctr.utilization", FT_UINT16, BASE_DEC, NULL, 0x00E0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr_rx_nss, { "Rx Nss", "nan.availability.entry.ctr.rx_nss", FT_UINT16, BASE_DEC, NULL, 0x0F00, NULL, HFILL } }, { &hf_nan_attr_availability_entry_ctr_time_bitmap, { "Time Bitmap Present", "nan.availability.entry.ctr.time_bitmap", FT_BOOLEAN, 16, NULL, 0x1000, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_type, { "Type", "nan.availability.entry.entries.type", FT_BOOLEAN, 8, TFS(&availability_entry_entries_type_flags), 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_non_contiguous_bw, { "Non-contiguous Bandwidth", "nan.availability.entry.entries.non_contiguous_bw", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_num_entries, { "Number of Entries", "nan.availability.entry.entries.num_entries", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_band, { "Band Entry", "nan.availability.entry.entries.band", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(availability_entry_entries_band_type), 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_channel_op_class, { "Operating Class", "nan.availability.entry.entries.channel.op_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_channel_bitmap, { "Channel Bitmap", "nan.availability.entry.entries.channel.bitmap", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_primary_channel_bitmap, { "Primary Channel Bitmap", "nan.availability.entry.entries.channel.primary_bitmap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_aux_channel_bitmap, { "Auxiliary Channel Bitmap", "nan.availability.entry.entries.channel.aux_bitmap", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_channel_set, { "Channel Bitmap - Channel Set", "nan.ava.chan.set", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_start_freq, { "Starting Frequency", "nan.av.entry.start.freq", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(op_starting_freq), 0x0, NULL, HFILL } }, { &hf_nan_attr_availability_entry_entries_bandwidth, { "Bandwidth", "nan.av.entry.bandwidth", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(op_channel_spacing), 0x0, NULL, HFILL } }, { &hf_nan_attr_ndc_id, { "NDC ID", "nan.ndc.id", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndc_ctrl, { "Control", "nan.ndc.ctrl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndc_ctrl_selected, { "Selected NDC", "nan.ndc.ctrl.selected", FT_BOOLEAN, 8, TFS(&ndc_ctr_selected_flags), 0x01, NULL, HFILL } }, { &hf_nan_attr_ndc_map_id_related_sch, { "NAN Availability associated with schedule time bitmap", "nan.ndc.map.id.rel", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL } }, { &hf_nan_attr_ndl_type, { "Type", "nan.ndl.type", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(ndl_type_values), 0xF, NULL, HFILL } }, { &hf_nan_attr_ndl_control, { "NDL Control", "nan.ndl.ctrl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_peer_id, { "NDL Peer ID Present", "nan.ndl.ctrl.peer_id", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_immutable_schedule_pres, { "Immutable Schedule Present", "nan.ndl.ctrl.immutable_schedule_pres", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_ndc_pres, { "NDC Attribute Present", "nan.ndl.ctrl.ndc_pres", FT_BOOLEAN, 8, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_qos, { "NDL QoS Present", "nan.ndl.ctrl.qos_pres", FT_BOOLEAN, 8, NULL, 0x8, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_max_idle_pres, { "Max Idle period Present", "nan.ndl.ctrl.max_idle_period_pres", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_type, { "NDL Type", "nan.ndl.ctrl.type", FT_UINT8, BASE_DEC, VALS(ndl_type_string), 0x20, NULL, HFILL } }, { &hf_nan_attr_ndl_ctrl_setup_reason, { "NDL Setup Reason", "nan.ndl.ctrl.setup_reason", FT_UINT8, BASE_DEC, VALS(ndl_setup_reason), 0xC0, NULL, HFILL } }, { &hf_nan_attr_ndl_reserved_peer_id, { "Reserved (NDL Peer ID)", "nan.ndl.peer_id", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndl_max_idle, { "Max Idle Period", "nan.ndl.max.idle", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndlqos_min_time_slots, { "Minimum Time Slots", "nan.ndl_qos.min_time_slots", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ndlqos_max_latency, { "Maximum Latency", "nan.ndl_qos.max_latency", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ctrl, { "Attribute Control", "nan.unaligned_schedule.ctrl", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ctrl_schedule_id, { "Schedule ID", "nan.unaligned_schedule.ctrl.schedule_id", FT_UINT16, BASE_HEX_DEC, NULL, 0xF, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ctrl_seq_id, { "Sequence ID", "nan.unaligned_schedule.ctrl.sequence_id", FT_UINT16, BASE_HEX_DEC, NULL, 0x0F00, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_starting_time, { "Starting Time", "nan.unaligned_schedule.starting_time", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_duration, { "Duration", "nan.unaligned_schedule.duration", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_period, { "Period", "nan.unaligned_schedule.period", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_count_down, { "Count Down", "nan.unaligned_schedule.count_down", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_overwrite, { "ULW Overwrite", "nan.unaligned_schedule.ulw_overwrite", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_overwrite_all, { "Overwrite All", "nan.unaligned_schedule.ulw_overwrite.overwrite_all", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_overwrite_map_id, { "Map ID", "nan.unaligned_schedule.ulw_overwrite.map_id", FT_UINT8, BASE_HEX_DEC, NULL, 0x1E, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_ctrl, { "ULW Control Field", "nan.attribute.ulw.ctrl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_ctrl_type, { "Type", "nan.unaligned_schedule.ulw_ctrl.type", FT_UINT8, BASE_DEC_HEX, VALS(unaligned_sch_ulw_type), 0x3, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_ctrl_channel_av, { "Channel Availability", "nan.unaligned_schedule.ulw_ctrl.channel_availability", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_nan_attr_unaligned_sch_ulw_ctrl_rxnss, { "Rx Nss", "nan.unaligned_schedule.ulw_ctrl.rx_nss", FT_UINT8, BASE_HEX, NULL, 0x78, NULL, HFILL } }, { &hf_nan_attr_ranging_info_location_info_avail, { "Location Info Availability", "nan.ranging_info.location_info_availability", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ranging_info_location_info_avail_lci, { "LCI Local Coordinates", "nan.ranging_info.location_info_availability.local_coord", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_ranging_info_location_info_avail_geospatial, { "Geospatial LCI WGS84", "nan.ranging_info.location_info_availability.geospatial", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL } }, { &hf_nan_attr_ranging_info_location_info_avail_civic_location, { "Civic Location", "nan.ranging_info.location_info_availability.civic_location", FT_BOOLEAN, 8, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_ranging_info_location_info_avail_last_movement_pres, { "Last Movement Indication", "nan.ranging_info.location_info_availability.last_movement_indication", FT_BOOLEAN, 8, NULL, 0x8, NULL, HFILL } }, { &hf_nan_attr_ranging_info_last_movement_indication, { "Last Movement Indication", "nan.ranging_info.last_movement_indication", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_type, { "Type", "nan.ranging_setup.type", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(ranging_setup_type_values), 0xF, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ctrl, { "Ranging Control", "nan.ranging_setup.ctrl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ctrl_report_req, { "Ranging Report Required", "nan.ranging_setup.ctrl.report_required", FT_BOOLEAN, 3, NULL, 0x1, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ctrl_ftm_params, { "FTM Parameters Present", "nan.ranging_setup.ctrl.ftm_params", FT_BOOLEAN, 3, NULL, 0x2, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ctrl_entry_list, { "Ranging Schedule Entry List Present", "nan.ranging_setup.ctrl.sch_entry_pres", FT_BOOLEAN, 3, NULL, 0x4, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ftm_params, { "FTM Parameters", "nan.ranging_setup.ftm", FT_UINT24, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ftm_max_burst_duration, { "Max Burst Duration", "nan.ranging_setup.ftm.max_burst_duration", FT_UINT24, BASE_HEX_DEC, NULL, 0xF, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ftm_min_delta, { "Min Delta FTM", "nan.ranging_setup.ftm.min_delta_ftm", FT_UINT24, BASE_HEX_DEC, NULL, 0x03F0, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ftm_max_per_burst, { "Max FTMs per Burst", "nan.ranging_setup.ftm.max_ftms_per_burst", FT_UINT24, BASE_HEX_DEC, NULL, 0x7C00, NULL, HFILL } }, { &hf_nan_attr_ranging_setup_ftm_format_bw, { "FTM Format and Bandwidth", "nan.ranging_setup.ftm.format_bw", FT_UINT24, BASE_HEX_DEC, NULL, 0x1F8000, NULL, HFILL } }, { &hf_nan_attr_ftm_range_report, { "FTM Range Report", "nan.ftm.range_report", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cipher_suite_capabilities, { "Capabilities", "nan.cipher_suite.capabilities", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_cipher_suite_id, { "Cipher Suite ID", "nan.cipher_suite.id", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_security_context_identifier, { "Security Context Identifier", "nan.security_context.identifier", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_security_context_identifier_len, { "Security Context Identifier Length", "nan.security_context.identifier_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_security_context_identifier_type, { "Security Context Identifier Type", "nan.security_context.identifier_type", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(security_context_iden_type), 0x0, NULL, HFILL } }, { &hf_nan_attr_shared_key_rsna_descriptor, { "IEEE 802.11 RSNA Key Descriptor", "nan.shared_key.rsna_key_descriptor", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_vendor_specific_body, { "Body", "nan.vendor_specific.body", FT_BYTES, SEP_DASH, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_container_element_id, { "Element Id", "nan.container.element.id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_nan_attr_container_element_len, { "Element Length", "nan.container.element.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; static gint* ett[] = { &ett_nan, &ett_attributes, &ett_type_status, &ett_map_control, &ett_time_bitmap_ctrl, &ett_non_nan_op_channel, &ett_non_nan_beacon, &ett_cluster_anchor_master_info, &ett_sda_service_ctr, &ett_sda_srf_ctr, &ett_sdea_ctr, &ett_sdea_range_limit, &ett_sdea_service_info, &ett_connection_cap_field, &ett_further_av_map_entry_ctrl, &ett_p2p_device_role, &ett_device_cap_map_id, &ett_device_cap_committed_dw, &ett_device_cap_supported_bands, &ett_device_cap_op_mode, &ett_device_cap_antennas, &ett_device_cap_capabilities, &ett_ndp_control, &ett_ndpe_tlv, &ett_availability_ctr, &ett_availability_entry, &ett_availability_entry_ctr, &ett_availability_entry_entries, &ett_availability_entry_entries_channel, &ett_availability_op_class, &ett_ndc_ctr, &ett_ndc_entries, &ett_device_ndc_map_id, &ett_ndl_control, &ett_ndl_schedule_entries, &ett_unaligned_sch_ctrl, &ett_unaligned_sch_ulw_overwrite, &ett_unaligned_sch_ulw_ctrl, &ett_ranging_info_location_info_availability, &ett_ranging_setup_ctrl, &ett_ranging_setup_ftm_params, &ett_ranging_setup_schedule_entries, &ett_cipher_suite_info_list, &ett_security_context_identifiers, &ett_public_availability_sch_entries, &ett_ie_tree, }; static ei_register_info ei[] = { { &ei_nan_elem_len_invalid, { "nan.expert.elem_len_invalid", PI_MALFORMED, PI_ERROR, "Element length invalid", EXPFILL } }, { &ei_nan_unknown_attr_id, { "nan.expert.unknown_attr_id", PI_PROTOCOL, PI_ERROR, "Unknown attribute ID", EXPFILL } }, { &ei_nan_unknown_op_class, { "nan.expert.unknown_op_class", PI_PROTOCOL, PI_COMMENT, "Unknown Operating Class - Channel Set unavailable", EXPFILL } }, { &ei_nan_unknown_beacon_type, { "nan.expert.unknown_beacon_type", PI_PROTOCOL, PI_WARN, "Unknown beacon type - Beacon type detection error", EXPFILL } }, }; proto_nan = proto_register_protocol( "NAN protocol", "NAN", "nan"); proto_register_field_array(proto_nan, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_module_t* expert_nan = expert_register_protocol(proto_nan); expert_register_field_array(expert_nan, ei, array_length(ei)); ie_handle_table = find_dissector_table("wlan.tag.number"); } void proto_reg_handoff_nan(void) { dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_ACTION_OUI_TYPE, create_dissector_handle(dissect_nan_action, proto_nan)); dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_SERVICE_DISCOVERY_SUBTYPE, create_dissector_handle(dissect_nan_service_discovery, proto_nan)); dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_NAN_IE_OUI_TYPE, create_dissector_handle(dissect_nan_beacon, proto_nan)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wifi-p2p.c
/* packet-wifi-p2p.c * * Wi-Fi P2P * * Copyright 2009-2010 Atheros Communications * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #include <epan/expert.h> #include "packet-ieee80211.h" void proto_register_p2p(void); void proto_reg_handoff_p2p(void); enum { P2P_ATTR_STATUS = 0, P2P_ATTR_MINOR_REASON_CODE = 1, P2P_ATTR_P2P_CAPABILITY = 2, P2P_ATTR_P2P_DEVICE_ID = 3, P2P_ATTR_GROUP_OWNER_INTENT = 4, P2P_ATTR_CONFIGURATION_TIMEOUT = 5, P2P_ATTR_LISTEN_CHANNEL = 6, P2P_ATTR_P2P_GROUP_BSSID = 7, P2P_ATTR_EXTENDED_LISTEN_TIMING = 8, P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS = 9, P2P_ATTR_P2P_MANAGEABILITY = 10, P2P_ATTR_CHANNEL_LIST = 11, P2P_ATTR_NOTICE_OF_ABSENCE = 12, P2P_ATTR_P2P_DEVICE_INFO = 13, P2P_ATTR_P2P_GROUP_INFO = 14, P2P_ATTR_P2P_GROUP_ID = 15, P2P_ATTR_P2P_INTERFACE = 16, P2P_ATTR_OPERATING_CHANNEL = 17, P2P_ATTR_INVITATION_FLAGS = 18, P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL = 19, /* 20 Unused */ P2P_ATTR_SERVICE_HASH = 21, P2P_ATTR_SESSION_INFORMATION_DATA_INFO = 22, P2P_ATTR_CONNECTION_CAPABILITY_INFO = 23, P2P_ATTR_ADVERTISEMENT_ID_INFO = 24, P2P_ATTR_ADVERTISED_SERVICE_INFO = 25, P2P_ATTR_SESSION_ID_INFO = 26, P2P_ATTR_FEATURE_CAPABILITY = 27, P2P_ATTR_PERSISTENT_GROUP_INFO = 28, /* 29-220 Reserved */ P2P_ATTR_VENDOR_SPECIFIC = 221 /* 222-255 Reserved */ }; static const value_string p2p_attr_types[] = { { P2P_ATTR_STATUS, "Status" }, { P2P_ATTR_MINOR_REASON_CODE, "Minor Reason Code" }, { P2P_ATTR_P2P_CAPABILITY, "P2P Capability" }, { P2P_ATTR_P2P_DEVICE_ID, "P2P Device ID" }, { P2P_ATTR_GROUP_OWNER_INTENT, "Group Owner Intent" }, { P2P_ATTR_CONFIGURATION_TIMEOUT, "Configuration Timeout" }, { P2P_ATTR_LISTEN_CHANNEL, "Listen Channel" }, { P2P_ATTR_P2P_GROUP_BSSID, "P2P Group BSSID" }, { P2P_ATTR_EXTENDED_LISTEN_TIMING, "Extended Listen Timing" }, { P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS, "Intended P2P Interface Address" }, { P2P_ATTR_P2P_MANAGEABILITY, "P2P Manageability" }, { P2P_ATTR_CHANNEL_LIST, "Channel List" }, { P2P_ATTR_NOTICE_OF_ABSENCE, "Notice of Absence" }, { P2P_ATTR_P2P_DEVICE_INFO, "P2P Device Info" }, { P2P_ATTR_P2P_GROUP_INFO, "P2P Group Info" }, { P2P_ATTR_P2P_GROUP_ID, "P2P Group ID" }, { P2P_ATTR_P2P_INTERFACE, "P2P Interface" }, { P2P_ATTR_OPERATING_CHANNEL, "Operating Channel" }, { P2P_ATTR_INVITATION_FLAGS, "Invitation Flags" }, { P2P_ATTR_VENDOR_SPECIFIC, "Vendor specific attribute" }, { P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL, "Out-of-Band Group Owner Negotiation Channel" }, { 20, "Unused" }, { P2P_ATTR_SERVICE_HASH, "Service Hash" }, { P2P_ATTR_SESSION_INFORMATION_DATA_INFO, "Session Information Data Info" }, { P2P_ATTR_CONNECTION_CAPABILITY_INFO, "Connection Capability Info" }, { P2P_ATTR_ADVERTISEMENT_ID_INFO, "Advertisement ID Info" }, { P2P_ATTR_ADVERTISED_SERVICE_INFO, "Advertised Service Info" }, { P2P_ATTR_SESSION_ID_INFO, "Session ID Info" }, { P2P_ATTR_FEATURE_CAPABILITY, "Feature Capability" }, { P2P_ATTR_PERSISTENT_GROUP_INFO, "Persistent Group Info" }, { 0, NULL } }; #define P2P_DEV_CAPAB_SERVICE_DISCOVERY 0x01 #define P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY 0x02 #define P2P_DEV_CAPAB_CONCURRENT_OPERATION 0x04 #define P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED 0x08 #define P2P_DEV_CAPAB_P2P_DEVICE_LIMIT 0x10 #define P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE 0x20 #define P2P_GROUP_CAPAB_P2P_GROUP_OWNER 0x01 #define P2P_GROUP_CAPAB_PERSISTENT_P2P_GROUP 0x02 #define P2P_GROUP_CAPAB_P2P_GROUP_LIMIT 0x04 #define P2P_GROUP_CAPAB_INTRA_BSS_DISTRIBUTION 0x08 #define P2P_GROUP_CAPAB_CROSS_CONNECTION 0x10 #define P2P_GROUP_CAPAB_PERSISTENT_RECONNECT 0x20 #define P2P_GROUP_CAPAB_GROUP_FORMATION 0x40 #define WPS_CONF_METH_USBA 0x0001 #define WPS_CONF_METH_ETHERNET 0x0002 #define WPS_CONF_METH_LABEL 0x0004 #define WPS_CONF_METH_DISPLAY 0x0008 #define WPS_CONF_METH_EXT_NFC_TOKEN 0x0010 #define WPS_CONF_METH_INT_NFC_TOKEN 0x0020 #define WPS_CONF_METH_NFC_INTERFACE 0x0040 #define WPS_CONF_METH_PUSHBUTTON 0x0080 #define WPS_CONF_METH_KEYPAD 0x0100 enum { P2P_ACT_GO_NEG_REQ = 0, P2P_ACT_GO_NEG_RESP = 1, P2P_ACT_GO_NEG_CONF = 2, P2P_ACT_INVITATION_REQ = 3, P2P_ACT_INVITATION_RESP = 4, P2P_ACT_DEV_DISC_REQ = 5, P2P_ACT_DEV_DISC_RESP = 6, P2P_ACT_PROV_DISC_REQ = 7, P2P_ACT_PROV_DISC_RESP = 8 }; static const value_string p2p_public_action_subtypes[] = { { P2P_ACT_GO_NEG_REQ, "GO Negotiation Request" }, { P2P_ACT_GO_NEG_RESP, "GO Negotiation Response" }, { P2P_ACT_GO_NEG_CONF, "GO Negotiation Confirmation" }, { P2P_ACT_INVITATION_REQ, "P2P Invitation Request" }, { P2P_ACT_INVITATION_RESP, "P2P Invitation Response" }, { P2P_ACT_DEV_DISC_REQ, "Device Discoverability Request" }, { P2P_ACT_DEV_DISC_RESP, "Device Discoverability Response" }, { P2P_ACT_PROV_DISC_REQ, "Provision Discovery Request" }, { P2P_ACT_PROV_DISC_RESP, "Provision Discovery Response" }, { 0, NULL } }; enum { P2P_ACT_NOA = 0, P2P_ACT_P2P_PRESENCE_REQ = 1, P2P_ACT_P2P_PRESENCE_RESP = 2, P2P_ACT_GO_DISC_REQ = 3 }; static const value_string p2p_action_subtypes[] = { { P2P_ACT_NOA, "Notice of Absence" }, { P2P_ACT_P2P_PRESENCE_REQ, "P2P Presence Request" }, { P2P_ACT_P2P_PRESENCE_RESP, "P2P Presence Response" }, { P2P_ACT_GO_DISC_REQ, "GO Discoverability Request" }, { 0, NULL } }; enum { P2P_STATUS_SUCCESS = 0, P2P_FAIL_INFORMATION_CURRENTLY_UNAVAILABLE = 1, P2P_FAIL_INCOMPATIBLE_PARAMETERS = 2, P2P_FAIL_LIMIT_REACHED = 3, P2P_FAIL_INVALID_PARAMETERS = 4, P2P_FAIL_UNABLE_TO_ACCOMMODATE = 5, P2P_FAIL_PREVIOUS_PROTOCOL_ERROR = 6, P2P_FAIL_NO_COMMON_CHANNELS = 7, P2P_FAIL_UNKNOWN_P2P_GROUP = 8, P2P_FAIL_BOTH_DEVICES_GO = 9, P2P_FAIL_INCOMPATIBLE_PROVISION_METHOD = 10, P2P_FAIL_REJECTED_BY_USER = 11, P2P_SUCCESS_ACCEPTED_BY_USER = 12 }; static const value_string p2p_status_codes[] = { { P2P_STATUS_SUCCESS, "Success" }, { P2P_FAIL_INFORMATION_CURRENTLY_UNAVAILABLE, "Fail; information is " "currently unavailable" }, { P2P_FAIL_INCOMPATIBLE_PARAMETERS, "Fail; incompatible parameters" }, { P2P_FAIL_LIMIT_REACHED, "Fail; limit reached" }, { P2P_FAIL_INVALID_PARAMETERS, "Fail; invalid parameters" }, { P2P_FAIL_UNABLE_TO_ACCOMMODATE, "Fail; unable to accommodate request" }, { P2P_FAIL_PREVIOUS_PROTOCOL_ERROR, "Fail; previous protocol error, or " "disruptive behavior" }, { P2P_FAIL_NO_COMMON_CHANNELS, "Fail; no common channels" }, { P2P_FAIL_UNKNOWN_P2P_GROUP, "Fail; unknown P2P Group" }, { P2P_FAIL_BOTH_DEVICES_GO, "Fail; both P2P Devices indicated an Intent of " "15 in Group Owner Negotiation" }, { P2P_FAIL_INCOMPATIBLE_PROVISION_METHOD, "Fail; incompatible provisioning " "method" }, { P2P_FAIL_REJECTED_BY_USER, "Fail; rejected by user" }, { P2P_SUCCESS_ACCEPTED_BY_USER, "Success; Accepted by user" }, { 0, NULL } }; enum { P2P_MINOR_RESERVED = 0, P2P_MINOR_DISCONNECT_DUE_TO_CROSS_CONNECTION = 1, P2P_MINOR_DISCONNECT_DUE_TO_NOT_P2P_MANAGED = 2, P2P_MINOR_DISCONNECT_DUE_TO_NO_COEXISTENCE = 3, P2P_MINOR_DISCONNECT_DUE_TO_OUTSIDE_POLICY = 4 }; static const value_string p2p_minor_reason_codes[] = { { P2P_MINOR_RESERVED, "Reserved" }, { P2P_MINOR_DISCONNECT_DUE_TO_CROSS_CONNECTION, "Disconnected because Cross Connection capability is not allow" }, { P2P_MINOR_DISCONNECT_DUE_TO_NOT_P2P_MANAGED, "Disconnected because P2P Infrastructure Managed not supported" }, { P2P_MINOR_DISCONNECT_DUE_TO_NO_COEXISTENCE, "Disconnected because concurrent device is not setting coexistence " "parameters" }, { P2P_MINOR_DISCONNECT_DUE_TO_OUTSIDE_POLICY, "Disconnected because P2P operation is outside the IT defined policy" }, { 0, NULL } }; static const value_string invitation_types[] = { { 0, "Join active P2P Group" }, { 1, "Reinvoke Persistent Group" }, { 0, NULL } }; static const value_string p2p_service_protocol_types[] = { { 0, "All Service Protocol Types" }, { 1, "Bonjour" }, { 2, "UPnP" }, { 3, "WS-Discovery" }, { 4, "Wi-Fi Display" }, { 0, NULL } }; static const value_string p2p_sd_status_codes[] = { { 0, "Success" }, { 1, "Service Protocol Type not available" }, { 2, "Requested information not available" }, { 3, "Bad Request" }, { 0, NULL } }; static const value_string p2p_oob_group_owner_negotiation_channel_role_indication_vals[] = { { 0, "Indicate that the P2P device is not in a group" }, { 1, "Indicate that the P2P device is a Group Client" }, { 2, "Indicate that the P2P device is a Group Owner" }, { 0, NULL } }; static int proto_p2p = -1; static gint ett_p2p_tlv = -1; static gint ett_p2p_service_tlv = -1; static gint ett_p2p_advertised_service = -1; static gint ett_p2p_client_descr = -1; static int hf_p2p_attr_type = -1; static int hf_p2p_attr_len = -1; /* static int hf_p2p_attr_capab = -1; */ static int hf_p2p_attr_capab_device = -1; static int hf_p2p_attr_capab_device_service_discovery = -1; static int hf_p2p_attr_capab_device_client_discoverability = -1; static int hf_p2p_attr_capab_device_concurrent_operation = -1; static int hf_p2p_attr_capab_device_infrastructure_managed = -1; static int hf_p2p_attr_capab_device_limit = -1; static int hf_p2p_attr_capab_invitation_procedure = -1; static int hf_p2p_attr_capab_group = -1; static int hf_p2p_attr_capab_group_owner = -1; static int hf_p2p_attr_capab_group_persistent = -1; static int hf_p2p_attr_capab_group_limit = -1; static int hf_p2p_attr_capab_group_intra_bss_distribution = -1; static int hf_p2p_attr_capab_group_cross_connection = -1; static int hf_p2p_attr_capab_group_persistent_reconnect = -1; static int hf_p2p_attr_capab_group_group_formation = -1; static int hf_p2p_attr_capab_group_ip_address_allocation = -1; static int hf_p2p_attr_device_id = -1; static int hf_p2p_attr_status = -1; static int hf_p2p_attr_go_intent = -1; static int hf_p2p_attr_go_intent_tie_breaker = -1; /* static int hf_p2p_attr_listen_channel = -1; */ static int hf_p2p_attr_listen_channel_country = -1; static int hf_p2p_attr_listen_channel_oper_class = -1; static int hf_p2p_attr_listen_channel_number = -1; /* static int hf_p2p_attr_operating_channel = -1; */ static int hf_p2p_attr_operating_channel_country = -1; static int hf_p2p_attr_operating_channel_oper_class = -1; static int hf_p2p_attr_operating_channel_number = -1; /* static int hf_p2p_attr_channel_list = -1; */ static int hf_p2p_attr_channel_list_country = -1; static int hf_p2p_attr_channel_list_oper_class = -1; static int hf_p2p_attr_channel_list_num_chan = -1; static int hf_p2p_attr_channel_list_chan = -1; /* static int hf_p2p_attr_dev_info = -1; */ static int hf_p2p_attr_dev_info_p2p_dev_addr = -1; static int hf_p2p_attr_dev_info_pri_dev_type = -1; static int hf_p2p_attr_dev_info_pri_dev_type_category = -1; static int hf_p2p_attr_dev_info_pri_dev_type_oui = -1; static int hf_p2p_attr_dev_info_pri_dev_type_subcategory = -1; static int hf_p2p_attr_dev_info_num_sec = -1; static int hf_p2p_attr_dev_info_sec_dev_type = -1; static int hf_p2p_attr_dev_info_dev_name_type = -1; static int hf_p2p_attr_dev_info_dev_name_len = -1; static int hf_p2p_attr_dev_info_dev_name = -1; static int hf_p2p_attr_dev_info_config_methods = -1; static int hf_p2p_attr_dev_info_config_methods_usba = -1; static int hf_p2p_attr_dev_info_config_methods_ethernet = -1; static int hf_p2p_attr_dev_info_config_methods_label = -1; static int hf_p2p_attr_dev_info_config_methods_display = -1; static int hf_p2p_attr_dev_info_config_methods_ext_nfc_token = -1; static int hf_p2p_attr_dev_info_config_methods_int_nfc_token = -1; static int hf_p2p_attr_dev_info_config_methods_nfc_interface = -1; static int hf_p2p_attr_dev_info_config_methods_pushbutton = -1; static int hf_p2p_attr_dev_info_config_methods_keypad = -1; static int hf_p2p_attr_config_timeout_go = -1; static int hf_p2p_attr_config_timeout_client = -1; static int hf_p2p_attr_intended_interface_addr = -1; static int hf_p2p_attr_extended_listen_timing_period = -1; static int hf_p2p_attr_extended_listen_timing_interval = -1; static int hf_p2p_attr_p2p_group_id_dev_addr = -1; static int hf_p2p_attr_p2p_group_id_ssid = -1; static int hf_p2p_attr_p2p_group_bssid = -1; static int hf_p2p_attr_noa_index = -1; static int hf_p2p_attr_noa_params = -1; static int hf_p2p_attr_noa_params_opp_ps = -1; static int hf_p2p_attr_noa_params_ctwindow = -1; static int hf_p2p_attr_noa_count_type = -1; static int hf_p2p_attr_noa_duration = -1; static int hf_p2p_attr_noa_interval = -1; static int hf_p2p_attr_noa_start_time = -1; /* static int hf_p2p_attr_gi = -1; */ static int hf_p2p_attr_gi_length = -1; static int hf_p2p_attr_gi_p2p_dev_addr = -1; static int hf_p2p_attr_gi_p2p_iface_addr = -1; static int hf_p2p_attr_gi_dev_capab = -1; static int hf_p2p_attr_gi_dev_capab_service_discovery = -1; static int hf_p2p_attr_gi_dev_capab_client_discoverability = -1; static int hf_p2p_attr_gi_dev_capab_concurrent_operation = -1; static int hf_p2p_attr_gi_dev_capab_infrastructure_managed = -1; static int hf_p2p_attr_gi_dev_capab_limit = -1; /* static int hf_p2p_attr_gi_dev_capab_invitation_procedure = -1; */ static int hf_p2p_attr_gi_config_methods = -1; /* static int hf_p2p_attr_gi_config_methods_usba = -1; */ /* static int hf_p2p_attr_gi_config_methods_ethernet = -1; */ /* static int hf_p2p_attr_gi_config_methods_label = -1; */ /* static int hf_p2p_attr_gi_config_methods_display = -1; */ /* static int hf_p2p_attr_gi_config_methods_ext_nfc_token = -1; */ /* static int hf_p2p_attr_gi_config_methods_int_nfc_token = -1; */ /* static int hf_p2p_attr_gi_config_methods_nfc_interface = -1; */ /* static int hf_p2p_attr_gi_config_methods_pushbutton = -1; */ /* static int hf_p2p_attr_gi_config_methods_keypad = -1; */ static int hf_p2p_attr_gi_pri_dev_type = -1; static int hf_p2p_attr_gi_pri_dev_type_category = -1; static int hf_p2p_attr_gi_pri_dev_type_oui = -1; static int hf_p2p_attr_gi_pri_dev_type_subcategory = -1; static int hf_p2p_attr_gi_num_sec_dev_types = -1; static int hf_p2p_attr_gi_sec_dev_type = -1; static int hf_p2p_attr_gi_dev_name_type = -1; static int hf_p2p_attr_gi_dev_name_len = -1; static int hf_p2p_attr_gi_dev_name = -1; static int hf_p2p_attr_invitation_flags = -1; static int hf_p2p_attr_invitation_flags_type = -1; static int hf_p2p_attr_manageability_bitmap = -1; static int hf_p2p_attr_manageability_bitmap_mgmt = -1; static int hf_p2p_attr_manageability_bitmap_cross_connect = -1; static int hf_p2p_attr_manageability_bitmap_coex_opt = -1; static int hf_p2p_attr_minor_reason_code = -1; static int hf_p2p_attr_oob_group_owner_negotiation_channel_country = -1; static int hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class = -1; static int hf_p2p_attr_oob_group_owner_negotiation_channel_number = -1; static int hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication = -1; static int hf_p2p_attr_service_hash = -1; static int hf_p2p_attr_session_information = -1; static int hf_p2p_attr_connection_capability = -1; static int hf_p2p_attr_advertisement_id = -1; static int hf_p2p_attr_advertisement_id_service_mac_address = -1; static int hf_p2p_attr_advertised_service_advertisement_id = -1; static int hf_p2p_attr_advertised_service_config_methods = -1; static int hf_p2p_attr_advertised_service_service_name_length = -1; static int hf_p2p_attr_advertised_service_service_name = -1; static int hf_p2p_attr_session_id = -1; static int hf_p2p_attr_session_id_session_mac_address = -1; static int hf_p2p_attr_feature_capability = -1; static int hf_p2p_attr_persistent_group_p2p_device_address = -1; static int hf_p2p_attr_persistent_group_ssid = -1; static int hf_p2p_anqp_service_update_indicator = -1; static int hf_p2p_anqp_length = -1; static int hf_p2p_anqp_service_protocol_type = -1; static int hf_p2p_anqp_service_transaction_id = -1; static int hf_p2p_anqp_query_data = -1; static int hf_p2p_anqp_status_code = -1; static int hf_p2p_anqp_response_data = -1; static int hf_p2p_action_subtype = -1; static int hf_p2p_action_dialog_token = -1; static int hf_p2p_public_action_subtype = -1; static int hf_p2p_public_action_dialog_token = -1; static expert_field ei_wifi_p2p_attr_dev_info_dev_name_type = EI_INIT; static expert_field ei_wifi_p2p_attr_len = EI_INIT; static expert_field ei_wifi_p2p_anqp_length = EI_INIT; static expert_field ei_wifi_p2p_anqp_unexpected_padding = EI_INIT; static dissector_handle_t wifi_display_ie_handle; static void dissect_wifi_p2p_capability(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_service_discovery, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_client_discoverability, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_concurrent_operation, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_infrastructure_managed, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_device_limit, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_invitation_procedure, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_owner, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_persistent, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_limit, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_intra_bss_distribution, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_cross_connection, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_persistent_reconnect, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_group_formation, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_capab_group_ip_address_allocation, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Device 0x%x Group 0x%x", tvb_get_guint8(tvb, offset + 3), tvb_get_guint8(tvb, offset + 4)); } static void dissect_device_id(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_device_id, tvb, offset + 3, 6, ENC_NA); proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset+3)); } static void dissect_group_owner_intent(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_go_intent, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_go_intent_tie_breaker, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Intent %u Tie breaker %u", tvb_get_guint8(tvb, offset + 3) >> 1, tvb_get_guint8(tvb, offset + 3) & 0x01); } static void dissect_status(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_status, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": %u (%s)", tvb_get_guint8(tvb, offset + 3), val_to_str(tvb_get_guint8(tvb, offset + 3), p2p_status_codes, "Unknown Status Code (%u)")); } static void dissect_listen_channel(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_country, tvb, offset + 3, 3, ENC_ASCII); proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_oper_class, tvb, offset + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_listen_channel_number, tvb, offset + 7, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Operating Class %u " "Channel Number %u", tvb_get_guint8(tvb, offset + 6), tvb_get_guint8(tvb, offset + 7)); } static void dissect_operating_channel(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_country, tvb, offset + 3, 3, ENC_ASCII); proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_oper_class, tvb, offset + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_operating_channel_number, tvb, offset + 7, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Operating Class %u " "Channel Number %u", tvb_get_guint8(tvb, offset + 6), tvb_get_guint8(tvb, offset + 7)); } static void dissect_channel_list(proto_item *tlv_root, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset = offset + 3; guint8 num_chan; proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_country, tvb, s_offset, 3, ENC_ASCII); s_offset += 3; while (offset + 3 + slen > s_offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_oper_class, tvb, s_offset, 1, ENC_BIG_ENDIAN); s_offset++; proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_num_chan, tvb, s_offset, 1, ENC_BIG_ENDIAN); num_chan = tvb_get_guint8(tvb, s_offset); s_offset++; proto_tree_add_item(tlv_root, hf_p2p_attr_channel_list_chan, tvb, s_offset, num_chan, ENC_NA); s_offset += num_chan; } } static void dissect_wifi_p2p_device_info(packet_info *pinfo, proto_item *tlv_root, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset, nlen; guint8 num_sec; guint16 attr_type, attr_len; proto_item *item; s_offset = offset + 3; proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_p2p_dev_addr, tvb, s_offset, 6, ENC_NA); s_offset += 6; proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_usba, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_ethernet, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_label, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_display, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_ext_nfc_token, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_int_nfc_token, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_nfc_interface, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_pushbutton, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_config_methods_keypad, tvb, s_offset, 2, ENC_BIG_ENDIAN); s_offset += 2; proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type, tvb, s_offset, 8, ENC_NA); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_category, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_oui, tvb, s_offset + 2, 4, ENC_NA); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_pri_dev_type_subcategory, tvb, s_offset + 6, 2, ENC_BIG_ENDIAN); s_offset += 8; num_sec = tvb_get_guint8(tvb, s_offset); proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_num_sec, tvb, s_offset, 1, ENC_BIG_ENDIAN); s_offset++; while (num_sec > 0) { proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_sec_dev_type, tvb, s_offset, 8, ENC_NA); s_offset += 8; num_sec--; } item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name_type, tvb, s_offset, 2, ENC_BIG_ENDIAN); attr_type = tvb_get_ntohs(tvb, s_offset); if (attr_type != 0x1011) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_dev_info_dev_name_type, "Incorrect Device Name attribute type"); } s_offset += 2; item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name_len, tvb, s_offset, 2, ENC_BIG_ENDIAN); attr_len = tvb_get_ntohs(tvb, s_offset); s_offset += 2; if (attr_len > offset + 3 + slen - s_offset) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute length"); return; } nlen = offset + 3 + slen - s_offset; if (nlen > 0) item = proto_tree_add_item(tlv_root, hf_p2p_attr_dev_info_dev_name, tvb, s_offset, nlen > attr_len ? attr_len : nlen, ENC_ASCII); if (nlen != attr_len) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute"); } } static void dissect_configuration_timeout(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_config_timeout_go, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_config_timeout_client, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": GO %u msec, client %u msec", tvb_get_guint8(tvb, offset + 3) * 10, tvb_get_guint8(tvb, offset + 4) * 10); } static void dissect_intended_interface_addr(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_intended_interface_addr, tvb, offset + 3, 6, ENC_NA); proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset + 3)); } static void dissect_extended_listen_timing(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { guint16 period, interval; period = tvb_get_letohs(tvb, offset + 3); interval = tvb_get_letohs(tvb, offset + 5); proto_tree_add_uint(tlv_root, hf_p2p_attr_extended_listen_timing_period, tvb, offset + 3, 2, period); proto_tree_add_uint(tlv_root, hf_p2p_attr_extended_listen_timing_interval, tvb, offset + 5, 2, interval); proto_item_append_text(tlv_item, ": Availability Period %u msec, " "Availability Interval %u msec", period, interval); } static void dissect_wifi_p2p_group_id(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset; s_offset = offset + 3; proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_id_dev_addr, tvb, s_offset, 6, ENC_NA); proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(wmem_packet_scope(), tvb, offset + 3)); s_offset += 6; proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_id_ssid, tvb, s_offset, offset + 3 + slen - s_offset, ENC_ASCII); } static void dissect_wifi_p2p_group_bssid(packet_info *pinfo, proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset; if (slen != 6) { expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Invalid ethernet address"); return; } s_offset = offset + 3; proto_tree_add_item(tlv_root, hf_p2p_attr_p2p_group_bssid, tvb, s_offset, 6, ENC_NA); proto_item_append_text(tlv_item, ": %s", tvb_ether_to_str(pinfo->pool, tvb, offset + 3)); } static void dissect_notice_of_absence(packet_info *pinfo, proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset = offset + 3; if (slen < 2) { expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Too short NoA"); return; } proto_tree_add_item(tlv_root, hf_p2p_attr_noa_index, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params, tvb, s_offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params_opp_ps, tvb, s_offset + 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_noa_params_ctwindow, tvb, s_offset + 1, 1, ENC_BIG_ENDIAN); s_offset += 2; while (offset + 3 + slen >= s_offset + 13) { proto_tree_add_item(tlv_root, hf_p2p_attr_noa_count_type, tvb, s_offset, 1, ENC_BIG_ENDIAN); s_offset++; proto_tree_add_item(tlv_root, hf_p2p_attr_noa_duration, tvb, s_offset, 4, ENC_LITTLE_ENDIAN); s_offset += 4; proto_tree_add_item(tlv_root, hf_p2p_attr_noa_interval, tvb, s_offset, 4, ENC_LITTLE_ENDIAN); s_offset += 4; proto_tree_add_item(tlv_root, hf_p2p_attr_noa_start_time, tvb, s_offset, 4, ENC_LITTLE_ENDIAN); s_offset += 4; } } static void dissect_wifi_p2p_group_info(packet_info *pinfo, proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset, guint16 slen) { int s_offset = offset + 3; int next_offset, ci_len, num_sec, left, nlen; guint16 attr_type, attr_len; proto_item *item; proto_tree *tree; while (offset + 3 + slen > s_offset) { if (offset + 3 + slen - s_offset < 25) { expert_add_info_format(pinfo, tlv_item, &ei_wifi_p2p_attr_len, "Too short P2P Client Info Descriptor"); break; } ci_len = tvb_get_guint8(tvb, s_offset); tree = proto_tree_add_subtree(tlv_root, tvb, s_offset, 1 + ci_len, ett_p2p_client_descr, NULL, "P2P Client Info Descriptor"); item = proto_tree_add_item(tree, hf_p2p_attr_gi_length, tvb, s_offset, 1, ENC_BIG_ENDIAN); if (ci_len < 24 || s_offset + ci_len > offset + 3 + slen) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid P2P Client Info Descriptor Length"); break; } s_offset++; next_offset = s_offset + ci_len; proto_tree_add_item(tree, hf_p2p_attr_gi_p2p_dev_addr, tvb, s_offset, 6, ENC_NA); proto_item_append_text(tree, ": %s", tvb_ether_to_str(pinfo->pool, tvb, s_offset)); s_offset += 6; proto_tree_add_item(tree, hf_p2p_attr_gi_p2p_iface_addr, tvb, s_offset, 6, ENC_NA); s_offset += 6; proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_service_discovery, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_client_discoverability, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_concurrent_operation, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_infrastructure_managed, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_dev_capab_limit, tvb, s_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_capab_invitation_procedure, tvb, s_offset, 1, ENC_BIG_ENDIAN); s_offset++; proto_tree_add_item(tree, hf_p2p_attr_gi_config_methods, tvb, s_offset, 2, ENC_BIG_ENDIAN); s_offset += 2; proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type, tvb, s_offset, 8, ENC_NA); proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_category, tvb, s_offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_oui, tvb, s_offset + 2, 4, ENC_NA); proto_tree_add_item(tree, hf_p2p_attr_gi_pri_dev_type_subcategory, tvb, s_offset + 6, 2, ENC_BIG_ENDIAN); s_offset += 8; item = proto_tree_add_item(tree, hf_p2p_attr_gi_num_sec_dev_types, tvb, s_offset, 1, ENC_BIG_ENDIAN); num_sec = tvb_get_guint8(tvb, s_offset); s_offset++; left = offset + 3 + slen - s_offset; if (left < 8 * num_sec) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Secondary Device Type List"); break; } while (num_sec > 0) { proto_tree_add_item(tree, hf_p2p_attr_gi_sec_dev_type, tvb, s_offset, 8, ENC_NA); s_offset += 8; num_sec--; } item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name_type, tvb, s_offset, 2, ENC_BIG_ENDIAN); attr_type = tvb_get_ntohs(tvb, s_offset); if (attr_type != 0x1011) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_dev_info_dev_name_type, "Incorrect Device Name attribute type"); } s_offset += 2; item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name_len, tvb, s_offset, 2, ENC_BIG_ENDIAN); attr_len = tvb_get_ntohs(tvb, s_offset); s_offset += 2; if (attr_len > offset + 3 + slen - s_offset) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute length"); break; } nlen = next_offset - s_offset; if (nlen > 0) item = proto_tree_add_item(tree, hf_p2p_attr_gi_dev_name, tvb, s_offset, nlen > attr_len ? attr_len : nlen, ENC_ASCII); if (nlen != attr_len) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_attr_len, "Invalid Device Name attribute"); } s_offset = next_offset; } } static void dissect_invitation_flags(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_invitation_flags, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_invitation_flags_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Invitation Flags 0x%x", tvb_get_guint8(tvb, offset + 3)); } static void dissect_manageability(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_mgmt, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_cross_connect, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_manageability_bitmap_coex_opt, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Bitmap field 0x%x", tvb_get_guint8(tvb, offset + 3)); } static void dissect_minor_reason_code(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_minor_reason_code, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": %u (%s)", tvb_get_guint8(tvb, offset + 3), val_to_str(tvb_get_guint8(tvb, offset + 3), p2p_minor_reason_codes, "Unknown Minor Reason Code (%u)")); } static void dissect_oob_group_owner_negotiation_channel(proto_item *tlv_root, proto_item *tlv_item, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_country, tvb, offset + 3, 3, ENC_ASCII); proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class, tvb, offset + 6, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_number, tvb, offset + 7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication, tvb, offset + 7, 1, ENC_BIG_ENDIAN); proto_item_append_text(tlv_item, ": Operating Class %u " "Channel Number %u", tvb_get_guint8(tvb, offset + 6), tvb_get_guint8(tvb, offset + 7)); } static void dissect_service_hash(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset, int slen) { int s_offset = offset + 3; while(s_offset < offset + 3 + slen) { proto_tree_add_item(tlv_root, hf_p2p_attr_service_hash, tvb, s_offset, 6, ENC_NA); s_offset += 6; } } static void dissect_session_information(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset, int slen) { proto_tree_add_item(tlv_root, hf_p2p_attr_session_information, tvb, offset+3, slen, ENC_ASCII); } static void dissect_connection_capability(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_connection_capability, tvb, offset+3, 1, ENC_NA); } static void dissect_advertisement_id(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_advertisement_id, tvb, offset+3, 4, ENC_NA); proto_tree_add_item(tlv_root, hf_p2p_attr_advertisement_id_service_mac_address, tvb, offset+7, 6, ENC_NA); } static void dissect_advertised_service(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset, int slen) { proto_item *subtree; int s_offset = offset + 3; int len_service_name; subtree = proto_tree_add_subtree(tlv_root, tvb, s_offset, slen, ett_p2p_advertised_service, NULL, "Advertised Service"); while (s_offset < offset + 3 + slen) { proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_advertisement_id, tvb, s_offset, 4, ENC_BIG_ENDIAN); s_offset += 4; proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_config_methods, tvb, s_offset, 2, ENC_BIG_ENDIAN); s_offset += 2; proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_service_name_length, tvb, s_offset, 2, ENC_BIG_ENDIAN); len_service_name = tvb_get_guint8(tvb, s_offset); s_offset += 1; proto_tree_add_item(subtree, hf_p2p_attr_advertised_service_service_name, tvb, s_offset, len_service_name, ENC_ASCII); s_offset += len_service_name; } } static void dissect_session_id(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset) { proto_tree_add_item(tlv_root, hf_p2p_attr_session_id, tvb, offset+3, 4, ENC_NA); proto_tree_add_item(tlv_root, hf_p2p_attr_session_id_session_mac_address, tvb, offset+7, 6, ENC_NA); } static void dissect_feature_capability(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset, int slen) { proto_tree_add_item(tlv_root, hf_p2p_attr_feature_capability, tvb, offset+3, slen, ENC_NA); } static void dissect_persistent_group(proto_item *tlv_root, proto_item *tlv_item _U_, tvbuff_t *tvb, int offset, int slen) { proto_tree_add_item(tlv_root, hf_p2p_attr_persistent_group_p2p_device_address, tvb, offset+3, 6, ENC_NA); proto_tree_add_item(tlv_root, hf_p2p_attr_persistent_group_ssid, tvb, offset+3+6, slen+6, ENC_ASCII); } static int dissect_wifi_p2p_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { guint16 slen = 0; guint8 stype = 0; int offset = 0; int size = tvb_reported_length(tvb); proto_item *tlv_root, *tlv_item; while (size > 0) { if (size < 3) { expert_add_info_format(pinfo, NULL, &ei_wifi_p2p_attr_len, "Packet too short for P2P IE"); break; } stype = tvb_get_guint8(tvb, offset); slen = tvb_get_letohs(tvb, offset + 1); tlv_root = proto_tree_add_subtree(tree, tvb, offset, 3 + slen, ett_p2p_tlv, &tlv_item, val_to_str(stype, p2p_attr_types, "Unknown attribute type (%u)")); proto_tree_add_item(tlv_root, hf_p2p_attr_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_uint(tlv_root, hf_p2p_attr_len, tvb, offset + 1, 2, slen); switch(stype) { case P2P_ATTR_P2P_CAPABILITY: dissect_wifi_p2p_capability(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_P2P_DEVICE_ID: dissect_device_id(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_GROUP_OWNER_INTENT: dissect_group_owner_intent(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_STATUS: dissect_status(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_LISTEN_CHANNEL: dissect_listen_channel(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_OPERATING_CHANNEL: dissect_operating_channel(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_CHANNEL_LIST: dissect_channel_list(tlv_root, tvb, offset, slen); break; case P2P_ATTR_P2P_DEVICE_INFO: dissect_wifi_p2p_device_info(pinfo, tlv_root, tvb, offset, slen); break; case P2P_ATTR_CONFIGURATION_TIMEOUT: dissect_configuration_timeout(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_INTENDED_P2P_INTERFACE_ADDRESS: dissect_intended_interface_addr(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_EXTENDED_LISTEN_TIMING: dissect_extended_listen_timing(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_P2P_GROUP_ID: dissect_wifi_p2p_group_id(tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_P2P_GROUP_BSSID: dissect_wifi_p2p_group_bssid(pinfo, tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_NOTICE_OF_ABSENCE: dissect_notice_of_absence(pinfo, tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_P2P_GROUP_INFO: dissect_wifi_p2p_group_info(pinfo, tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_INVITATION_FLAGS: dissect_invitation_flags(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_P2P_MANAGEABILITY: dissect_manageability(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_MINOR_REASON_CODE: dissect_minor_reason_code(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_OOB_GROUP_OWNER_NEGOTIATION_CHANNEL: dissect_oob_group_owner_negotiation_channel(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_SERVICE_HASH: dissect_service_hash(tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_SESSION_INFORMATION_DATA_INFO: dissect_session_information(tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_CONNECTION_CAPABILITY_INFO: dissect_connection_capability(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_ADVERTISEMENT_ID_INFO: dissect_advertisement_id(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_ADVERTISED_SERVICE_INFO: dissect_advertised_service(tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_SESSION_ID_INFO: dissect_session_id(tlv_root, tlv_item, tvb, offset); break; case P2P_ATTR_FEATURE_CAPABILITY: dissect_feature_capability(tlv_root, tlv_item, tvb, offset, slen); break; case P2P_ATTR_PERSISTENT_GROUP_INFO: dissect_persistent_group(tlv_root, tlv_item, tvb, offset, slen); break; } offset += 3 + slen; size -= 3 + slen; } return tvb_captured_length(tvb); } static int dissect_wifi_p2p_public_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { int offset = 0; guint8 subtype; proto_tree_add_item(tree, hf_p2p_public_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); subtype = tvb_get_guint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, ", P2P - %s", val_to_str(subtype, p2p_public_action_subtypes, "Unknown (%u)")); offset++; proto_tree_add_item(tree, hf_p2p_public_action_dialog_token, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Followed by variable length IEs dissected by packet-ieee80211.c */ return offset; } static int dissect_wifi_p2p_action(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { int offset = 0; proto_tree_add_item(tree, hf_p2p_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_p2p_action_dialog_token, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Followed by variable length IEs dissected by packet-ieee80211.c */ return offset; } static int dissect_wifi_p2p_anqp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) { int offset = 0; proto_item *item; anqp_info_dissector_data_t* anqp_data = (anqp_info_dissector_data_t*)data; tvbuff_t *next_tvb; DISSECTOR_ASSERT(anqp_data); item = proto_tree_add_item(tree, hf_p2p_anqp_service_update_indicator, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; while (tvb_reported_length_remaining(tvb, offset) >= (anqp_data->request ? 4 : 5)) { guint16 len; proto_tree *tlv; guint8 type, id, sd_proto; len = tvb_get_letohs(tvb, offset); if (len < 2) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short Service TLV field"); return offset; } if (len > tvb_reported_length_remaining(tvb, offset + 2)) { expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short frame for Service TLV field"); return offset; } type = tvb_get_guint8(tvb, offset + 2); id = tvb_get_guint8(tvb, offset + 3); tlv = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_p2p_service_tlv, &item, "Service TLV (Transaction ID: %u Type: %s)", id, val_to_str(type, p2p_service_protocol_types, "Unknown (%u)")); proto_tree_add_item(tlv, hf_p2p_anqp_length, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; sd_proto = tvb_get_guint8(tvb, offset); proto_tree_add_item(tlv, hf_p2p_anqp_service_protocol_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv, hf_p2p_anqp_service_transaction_id, tvb, offset + 1, 1, ENC_BIG_ENDIAN); if (anqp_data->request) { proto_tree_add_item(tlv, hf_p2p_anqp_query_data, tvb, offset + 2, len - 2, ENC_NA); } else { proto_tree_add_item(tlv, hf_p2p_anqp_status_code, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv, hf_p2p_anqp_response_data, tvb, offset + 3, len - 3, ENC_NA); if (sd_proto == 4) { next_tvb = tvb_new_subset_length(tvb, offset + 3, len - 3); call_dissector(wifi_display_ie_handle, next_tvb, pinfo, tlv); } } offset += len; } if (tvb_reported_length_remaining(tvb, offset) > 0) { expert_add_info(pinfo, item, &ei_wifi_p2p_anqp_unexpected_padding); } return tvb_captured_length(tvb); } void proto_register_p2p(void) { static hf_register_info hf[] = { { &hf_p2p_attr_type, { "Attribute Type", "wifi_p2p.type", FT_UINT8, BASE_DEC, VALS(p2p_attr_types), 0x0, NULL, HFILL }}, { &hf_p2p_attr_len, { "Attribute Length", "wifi_p2p.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_capab, { "P2P Capability", "wifi_p2p.p2p_capability", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_capab_device, { "Device Capability Bitmap", "wifi_p2p.p2p_capability.device_capability", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_capab_device_service_discovery, { "Service Discovery", "wifi_p2p.p2p_capability.device_capability.service_discovery", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_SERVICE_DISCOVERY, NULL, HFILL }}, { &hf_p2p_attr_capab_device_client_discoverability, { "P2P Client Discoverability", "wifi_p2p.p2p_capability.device_capability.client_discoverability", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY, NULL, HFILL }}, { &hf_p2p_attr_capab_device_concurrent_operation, { "Concurrent Operation", "wifi_p2p.p2p_capability.device_capability.concurrent_operation", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_CONCURRENT_OPERATION, NULL, HFILL }}, { &hf_p2p_attr_capab_device_infrastructure_managed, { "P2P Infrastructure Managed", "wifi_p2p.p2p_capability.device_capability.infrastructure_managed", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED, NULL, HFILL }}, { &hf_p2p_attr_capab_device_limit, { "P2P Device Limit", "wifi_p2p.p2p_capability.device_capability.device_limit", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_DEVICE_LIMIT, NULL, HFILL }}, { &hf_p2p_attr_capab_invitation_procedure, { "P2P Invitation Procedure", "wifi_p2p.p2p_capability.device_capability.invitation_procedure", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE, NULL, HFILL }}, { &hf_p2p_attr_capab_group, { "Group Capability Bitmap", "wifi_p2p.p2p_capability.group_capability", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_capab_group_owner, { "P2P Group Owner", "wifi_p2p.p2p_capability.group_capability.group_owner", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_P2P_GROUP_OWNER, NULL, HFILL }}, { &hf_p2p_attr_capab_group_persistent, { "Persistent P2P Group", "wifi_p2p.p2p_capability.group_capability.persistent_group", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_PERSISTENT_P2P_GROUP, NULL, HFILL }}, { &hf_p2p_attr_capab_group_limit, { "P2P Group Limit", "wifi_p2p.p2p_capability.group_capability.group_limit", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_P2P_GROUP_LIMIT, NULL, HFILL }}, { &hf_p2p_attr_capab_group_intra_bss_distribution, { "Intra-BSS Distribution", "wifi_p2p.p2p_capability.group_capability.intra_bss_distribution", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_INTRA_BSS_DISTRIBUTION, NULL, HFILL }}, { &hf_p2p_attr_capab_group_cross_connection, { "Cross Connection", "wifi_p2p.p2p_capability.group_capability.cross_connection", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_CROSS_CONNECTION, NULL, HFILL }}, { &hf_p2p_attr_capab_group_persistent_reconnect, { "Persistent Reconnect", "wifi_p2p.p2p_capability.group_capability.persistent_reconnect", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_PERSISTENT_RECONNECT, NULL, HFILL }}, { &hf_p2p_attr_capab_group_group_formation, { "Group Formation", "wifi_p2p.p2p_capability.group_capability.group_formation", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_GROUP_FORMATION, NULL, HFILL }}, { &hf_p2p_attr_capab_group_ip_address_allocation, { "IP Address Allocation", "wifi_p2p.p2p_capability.group_capability.ip_address_allocation", FT_UINT8, BASE_HEX, NULL, P2P_GROUP_CAPAB_GROUP_FORMATION, NULL, HFILL }}, { &hf_p2p_attr_device_id, { "Device ID", "wifi_p2p.device_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_status, { "Status Code", "wifi_p2p.status", FT_UINT8, BASE_DEC, VALS(p2p_status_codes), 0x0, NULL, HFILL }}, { &hf_p2p_attr_go_intent, { "Group Owner Intent", "wifi_p2p.go_intent", FT_UINT8, BASE_DEC, NULL, 0x1e, NULL, HFILL }}, { &hf_p2p_attr_go_intent_tie_breaker, { "Group Owner Intent Tie Breaker", "wifi_p2p.go_intent_tie_breaker", FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }}, #if 0 { &hf_p2p_attr_listen_channel, { "Listen Channel", "wifi_p2p.listen_channel", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_listen_channel_country, { "Country String", "wifi_p2p.listen_channel.country_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_listen_channel_oper_class, { "Operating Class", "wifi_p2p.listen_channel.operating_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_listen_channel_number, { "Channel Number", "wifi_p2p.listen_channel.channel_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_operating_channel, { "Operating Channel", "wifi_p2p.operating_channel", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_operating_channel_country, { "Country String", "wifi_p2p.operating_channel.country_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_operating_channel_oper_class, { "Operating Class", "wifi_p2p.operating_channel.operating_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_operating_channel_number, { "Channel Number", "wifi_p2p.operating_channel.channel_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_channel_list, { "Channel List", "wifi_p2p.channel_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_channel_list_country, { "Country String", "wifi_p2p.channel_list.country_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_channel_list_oper_class, { "Operating Class", "wifi_p2p.channel_list.operating_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_channel_list_num_chan, { "Number of Channels", "wifi_p2p.channel_list.num_chan", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_channel_list_chan, { "Channel List", "wifi_p2p.channel_list.channel_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_dev_info, { "Device Info", "wifi_p2p.dev_info", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_dev_info_p2p_dev_addr, { "P2P Device address", "wifi_p2p.dev_info.p2p_dev_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_pri_dev_type, { "Primary Device Type", "wifi_p2p.dev_info.pri_dev_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_pri_dev_type_category, { "Primary Device Type: Category", "wifi_p2p.dev_info.pri_dev_type.category", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_pri_dev_type_oui, { "Primary Device Type: OUI", "wifi_p2p.dev_info.pri_dev_type.oui", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_pri_dev_type_subcategory, { "Primary Device Type: Subcategory", "wifi_p2p.dev_info.pri_dev_type.subcategory", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_num_sec, { "Number of Secondary Device Types", "wifi_p2p.dev_info.num_sec", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_sec_dev_type, { "Secondary Device Type", "wifi_p2p.dev_info.sec_dev_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_dev_name_type, { "Device Name attribute type", "wifi_p2p.dev_info.dev_name_type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_dev_name_len, { "Device Name attribute length", "wifi_p2p.dev_info.dev_name_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_dev_name, { "Device Name", "wifi_p2p.dev_info.dev_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods, { "Config Methods", "wifi_p2p.dev_info.config_methods", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_usba, { "USBA (Flash Drive)", "wifi_p2p.dev_info.config_methods.usba", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_USBA, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_ethernet, { "Ethernet", "wifi_p2p.dev_info.config_methods.ethernet", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_ETHERNET, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_label, { "Label", "wifi_p2p.dev_info.config_methods.label", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_LABEL, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_display, { "Display", "wifi_p2p.dev_info.config_methods.display", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_DISPLAY, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_ext_nfc_token, { "External NFC Token", "wifi_p2p.dev_info.config_methods.ext_nfc_token", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_EXT_NFC_TOKEN, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_int_nfc_token, { "Integrated NFC Token", "wifi_p2p.dev_info.config_methods.int_nfc_token", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_INT_NFC_TOKEN, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_nfc_interface, { "NFC Interface", "wifi_p2p.dev_info.config_methods.nfc_interface", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_NFC_INTERFACE, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_pushbutton, { "PushButton", "wifi_p2p.dev_info.config_methods.pushbutton", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_PUSHBUTTON, NULL, HFILL }}, { &hf_p2p_attr_dev_info_config_methods_keypad, { "Keypad", "wifi_p2p.dev_info.config_methods.keypad", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_KEYPAD, NULL, HFILL }}, { &hf_p2p_attr_config_timeout_go, { "GO Configuration Timeout", "wifi_p2p.config_timeout.go", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_config_timeout_client, { "Client Configuration Timeout", "wifi_p2p.config_timeout.client", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_intended_interface_addr, { "P2P Interface Address", "wifi_p2p.intended_interface_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_extended_listen_timing_period, { "Availability Period", "wifi_p2p.extended_listen_timing.period", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_extended_listen_timing_interval, { "Availability Interval", "wifi_p2p.extended_listen_timing.interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_p2p_group_id_dev_addr, { "P2P Device address", "wifi_p2p.p2p_group_id.p2p_dev_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_p2p_group_id_ssid, { "SSID", "wifi_p2p.p2p_group_id.ssid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_p2p_group_bssid, { "BSSID", "wifi_p2p.p2p_group_bssid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_index, { "Index", "wifi_p2p.noa.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_params, { "CTWindow and OppPS Parameters", "wifi_p2p.noa.params", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_params_opp_ps, { "OppPS", "wifi_p2p.noa.params.opp_ps", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL }}, { &hf_p2p_attr_noa_params_ctwindow, { "CTWindow", "wifi_p2p.noa.params.ctwindow", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }}, { &hf_p2p_attr_noa_count_type, { "Count/Type", "wifi_p2p.noa.count_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_duration, { "Duration", "wifi_p2p.noa.duration", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_interval, { "Interval", "wifi_p2p.noa.interval", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_noa_start_time, { "Start Time", "wifi_p2p.noa.start_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_gi, { "Device Info", "wifi_p2p.group_info", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, #endif { &hf_p2p_attr_gi_length, { "P2P Client Info Descriptor Length", "wifi_p2p.group_info.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_p2p_dev_addr, { "P2P Device address", "wifi_p2p.group_info.p2p_dev_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_p2p_iface_addr, { "P2P Interface address", "wifi_p2p.group_info.p2p_interface_addr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab, { "Device Capability Bitmap", "wifi_p2p.group_info.device_capability", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab_service_discovery, { "Service Discovery", "wifi_p2p.group_info.device_capability.service_discovery", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_SERVICE_DISCOVERY, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab_client_discoverability, { "P2P Client Discoverability", "wifi_p2p.group_info.device_capability.client_discoverability", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_CLIENT_DISCOVERABILITY, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab_concurrent_operation, { "Concurrent Operation", "wifi_p2p.group_info.device_capability.concurrent_operation", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_CONCURRENT_OPERATION, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab_infrastructure_managed, { "P2P Infrastructure Managed", "wifi_p2p.group_info.device_capability.infrastructure_managed", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INFRASTRUCTURE_MANAGED, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_capab_limit, { "P2P Device Limit", "wifi_p2p.group_info.device_capability.device_limit", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_DEVICE_LIMIT, NULL, HFILL }}, #if 0 { &hf_p2p_attr_gi_dev_capab_invitation_procedure, { "P2P Invitation Procedure", "wifi_p2p.group_info.device_capability.invitation_procedure", FT_UINT8, BASE_HEX, NULL, P2P_DEV_CAPAB_P2P_INVITATION_PROCEDURE, NULL, HFILL }}, #endif { &hf_p2p_attr_gi_pri_dev_type, { "Primary Device Type", "wifi_p2p.group_info.pri_dev_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_pri_dev_type_category, { "Primary Device Type: Category", "wifi_p2p.group_info.pri_dev_type.category", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_pri_dev_type_oui, { "Primary Device Type: OUI", "wifi_p2p.group_info.pri_dev_type.oui", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_pri_dev_type_subcategory, { "Primary Device Type: Subcategory", "wifi_p2p.group_info.pri_dev_type.subcategory", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_num_sec_dev_types, { "Number of Secondary Device Types", "wifi_p2p.group_info.num_sec", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_sec_dev_type, { "Secondary Device Type", "wifi_p2p.group_info.sec_dev_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_name_type, { "Device Name attribute type", "wifi_p2p.group_info.dev_name_type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_name_len, { "Device Name attribute length", "wifi_p2p.group_info.dev_name_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_dev_name, { "Device Name", "wifi_p2p.group_info.dev_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_gi_config_methods, { "Config Methods", "wifi_p2p.group_info.config_methods", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, #if 0 { &hf_p2p_attr_gi_config_methods_usba, { "USBA (Flash Drive)", "wifi_p2p.group_info.config_methods.usba", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_USBA, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_ethernet, { "Ethernet", "wifi_p2p.group_info.config_methods.ethernet", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_ETHERNET, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_label, { "Label", "wifi_p2p.group_info.config_methods.label", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_LABEL, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_display, { "Display", "wifi_p2p.group_info.config_methods.display", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_DISPLAY, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_ext_nfc_token, { "External NFC Token", "wifi_p2p.group_info.config_methods.ext_nfc_token", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_EXT_NFC_TOKEN, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_int_nfc_token, { "Integrated NFC Token", "wifi_p2p.group_info.config_methods.int_nfc_token", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_INT_NFC_TOKEN, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_nfc_interface, { "NFC Interface", "wifi_p2p.group_info.config_methods.nfc_interface", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_NFC_INTERFACE, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_pushbutton, { "PushButton", "wifi_p2p.group_info.config_methods.pushbutton", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_PUSHBUTTON, NULL, HFILL }}, #endif #if 0 { &hf_p2p_attr_gi_config_methods_keypad, { "Keypad", "wifi_p2p.group_info.config_methods.keypad", FT_UINT16, BASE_HEX, NULL, WPS_CONF_METH_KEYPAD, NULL, HFILL }}, #endif { &hf_p2p_attr_invitation_flags, { "Invitation Flags", "wifi_p2p.invitation_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_invitation_flags_type, { "Invitation Type", "wifi_p2p.invitation_flags.type", FT_UINT8, BASE_HEX, VALS(invitation_types), 0x01, NULL, HFILL }}, { &hf_p2p_attr_manageability_bitmap, { "Manageability Bitmap field", "wifi_p2p.manageability.bitmap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_manageability_bitmap_mgmt, { "P2P Device Management", "wifi_p2p.manageability.bitmap.dev_mgmt", FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }}, { &hf_p2p_attr_manageability_bitmap_cross_connect, { "Cross Connection Permitted", "wifi_p2p.manageability.bitmap.cross_connect", FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }}, { &hf_p2p_attr_manageability_bitmap_coex_opt, { "Coexistence Optional", "wifi_p2p.manageability.bitmap.coex_opt", FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }}, { &hf_p2p_attr_minor_reason_code, { "Minor Reason Code", "wifi_p2p.minor_reason_code", FT_UINT8, BASE_DEC, VALS(p2p_minor_reason_codes), 0x0, NULL, HFILL }}, { &hf_p2p_attr_oob_group_owner_negotiation_channel_country, { "Country String", "wifi_p2p.oob_group_owner_negotiation_channel.country_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_oob_group_owner_negotiation_channel_oper_class, { "Operating Class", "wifi_p2p.oob_group_owner_negotiation_channel.operating_class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_oob_group_owner_negotiation_channel_number, { "Channel Number", "wifi_p2p.oob_group_owner_negotiation_channel.channel_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_oob_group_owner_negotiation_channel_role_indication, { "Role Indication", "wifi_p2p.oob_group_owner_negotiation_channel.role_indication", FT_UINT8, BASE_DEC, VALS(p2p_oob_group_owner_negotiation_channel_role_indication_vals), 0x0, NULL, HFILL }}, { &hf_p2p_attr_service_hash, { "Service Hash", "wifi_p2p.service_hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_session_information, { "Service Information", "wifi_p2p.session_information", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_connection_capability, { "Connection Capability Information", "wifi_p2p.connection_capability", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertisement_id, { "Advertisement ID", "wifi_p2p.advertisement_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertisement_id_service_mac_address, { "Service MAC Address", "wifi_p2p.advertisement_id.service_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertised_service_advertisement_id, { "Advertisement ID", "wifi_p2p.advertised_service.advertisement_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertised_service_config_methods, { "Service Config Methods", "wifi_p2p.advertised_service.config_methods", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertised_service_service_name_length, { "Service Name Length", "wifi_p2p.advertised_service.service_name_length", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_advertised_service_service_name, { "Service Name", "wifi_p2p.advertised_service.service_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_session_id, { "Session ID", "wifi_p2p.session_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_session_id_session_mac_address, { "Session MAC Address", "wifi_p2p.session_id.session_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_feature_capability, { "Feature Capability", "wifi_p2p.feature_capability", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_persistent_group_p2p_device_address, { "P2P device address", "wifi_p2p.persistent_group.p2p_device_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_attr_persistent_group_ssid, { "SSID", "wifi_p2p.persistent_group.ssid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_anqp_service_update_indicator, { "Service Update Indicator", "wifi_p2p.anqp.service_update_indicator", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_anqp_length, { "Length", "wifi_p2p.anqp.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_anqp_service_protocol_type, { "Service Protocol Type", "wifi_p2p.anqp.service_protocol_type", FT_UINT8, BASE_DEC, VALS(p2p_service_protocol_types), 0x0, NULL, HFILL }}, { &hf_p2p_anqp_service_transaction_id, { "Service Transaction ID", "wifi_p2p.anqp.service_transaction_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_anqp_query_data, { "Query Data", "wifi_p2p.anqp.query_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_anqp_status_code, { "Status Code", "wifi_p2p.anqp.status_code", FT_UINT8, BASE_DEC, VALS(p2p_sd_status_codes), 0x0, "Service Query Status Code", HFILL }}, { &hf_p2p_anqp_response_data, { "Response Data", "wifi_p2p.anqp.response_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_action_subtype, { "P2P Action Subtype", "wifi_p2p.action.subtype", FT_UINT8, BASE_DEC, VALS(p2p_action_subtypes), 0x0, NULL, HFILL }}, { &hf_p2p_action_dialog_token, { "P2P Action Dialog Token", "wifi_p2p.action.dialog_token", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_p2p_public_action_subtype, { "P2P Public Action Subtype", "wifi_p2p.public_action.subtype", FT_UINT8, BASE_DEC, VALS(p2p_public_action_subtypes), 0x0, NULL, HFILL }}, { &hf_p2p_public_action_dialog_token, { "P2P Public Action Dialog Token", "wifi_p2p.public_action.dialog_token", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }} }; static gint *ett[] = { &ett_p2p_tlv, &ett_p2p_service_tlv, &ett_p2p_advertised_service, &ett_p2p_client_descr }; static ei_register_info ei[] = { { &ei_wifi_p2p_attr_dev_info_dev_name_type, { "wifi_p2p.dev_info.dev_name_type.invalid", PI_MALFORMED, PI_ERROR, "Incorrect Device Name attribute type", EXPFILL }}, { &ei_wifi_p2p_attr_len, { "wifi_p2p.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid attribute length", EXPFILL }}, { &ei_wifi_p2p_anqp_length, { "wifi_p2p.anqp.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid anqp_length", EXPFILL }}, { &ei_wifi_p2p_anqp_unexpected_padding, { "wifi_p2p.anqp.unexpected_padding", PI_MALFORMED, PI_ERROR, "Unexpected padding in the end of P2P ANQP", EXPFILL }}, }; expert_module_t* expert_p2p; proto_p2p = proto_register_protocol("Wi-Fi Peer-to-Peer", "Wi-Fi P2P", "wifi_p2p"); proto_register_field_array(proto_p2p, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_p2p = expert_register_protocol(proto_p2p); expert_register_field_array(expert_p2p, ei, array_length(ei)); } void proto_reg_handoff_p2p(void) { dissector_add_uint("wlan.action.wifi_alliance.subtype", WFA_SUBTYPE_P2P, create_dissector_handle(dissect_wifi_p2p_action, proto_p2p)); dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_P2P, create_dissector_handle(dissect_wifi_p2p_anqp, proto_p2p)); dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_P2P, create_dissector_handle(dissect_wifi_p2p_ie, proto_p2p)); dissector_add_uint("wlan.pa.wifi_alliance.subtype", WFA_SUBTYPE_P2P, create_dissector_handle(dissect_wifi_p2p_public_action, proto_p2p)); wifi_display_ie_handle = find_dissector_add_dependency("wifi_display_ie", proto_p2p); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-windows-common.c
/* packet-windows-common.c * Routines for dissecting various Windows data types * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/exceptions.h> #include "packet-smb-sidsnooping.h" #include "packet-windows-common.h" #include "packet-smb.h" /* for "sid_name_snooping" */ /* The types used in [MS-DTYP] v20180912 should be interpreted as * follows (all multi-byte integer types are little endian): * typedef guint8 MS_BYTE; * typedef guint16 MS_WORD; * typedef guint32 MS_DWORD; * typedef guint64 MS_QWORD; * typedef guint64 MS_ULONG64; * typedef guint64 MS_DWORD64; * typedef gint64 MS_LONG64; */ enum cond_ace_token { #define DEF_COND_ACE_TOKEN(VAL, VAR, STR) COND_ACE_TOKEN_ ## VAR = VAL, #define DEF_COND_ACE_TOKEN_WITH_DATA DEF_COND_ACE_TOKEN #include "cond_ace_token_enum.h" COND_ACE_TOKEN_UNKNOWN = -1 }; static const value_string ace_cond_token_vals[] = { #define DEF_COND_ACE_TOKEN(VAL, VAR, STR) {VAL, STR}, #define DEF_COND_ACE_TOKEN_WITH_DATA DEF_COND_ACE_TOKEN #include "cond_ace_token_enum.h" { 0, NULL } }; static gboolean ace_cond_token_has_data(guint8 token) { switch (token) { #define DEF_COND_ACE_TOKEN(VAL, VAR, STR) #define DEF_COND_ACE_TOKEN_WITH_DATA(VAL, VAR, STR) case VAL: #include "cond_ace_token_enum.h" return TRUE; } return FALSE; } static const value_string ace_cond_base_vals[] = { { 0x01, "OCT" }, { 0x02, "DEC" }, { 0x03, "HEX" }, { 0, NULL } }; static const value_string ace_cond_sign_vals[] = { { 0x01, "PLUS" }, { 0x02, "MINUS" }, { 0x03, "NONE" }, { 0, NULL } }; #define CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64 0x0001 #define CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64 0x0002 #define CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING 0x0003 #define CLAIM_SECURITY_ATTRIBUTE_TYPE_SID 0x0005 #define CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN 0x0006 #define CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING 0x0010 static const value_string ace_sra_type_vals[] = { { CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64, "INT64" }, { CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64, "UINT64" }, { CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING, "STRING" }, { CLAIM_SECURITY_ATTRIBUTE_TYPE_SID, "SID"}, { CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN, "BOOLEAN" }, { CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING, "OCTET_STRING" }, { 0, NULL } }; static int hf_nt_sec_desc_revision = -1; static int hf_nt_sec_desc_type_owner_defaulted = -1; static int hf_nt_sec_desc_type_group_defaulted = -1; static int hf_nt_sec_desc_type_dacl_present = -1; static int hf_nt_sec_desc_type_dacl_defaulted = -1; static int hf_nt_sec_desc_type_sacl_present = -1; static int hf_nt_sec_desc_type_sacl_defaulted = -1; static int hf_nt_sec_desc_type_dacl_trusted = -1; static int hf_nt_sec_desc_type_server_security = -1; static int hf_nt_sec_desc_type_dacl_auto_inherit_req = -1; static int hf_nt_sec_desc_type_sacl_auto_inherit_req = -1; static int hf_nt_sec_desc_type_dacl_auto_inherited = -1; static int hf_nt_sec_desc_type_sacl_auto_inherited = -1; static int hf_nt_sec_desc_type_dacl_protected = -1; static int hf_nt_sec_desc_type_sacl_protected = -1; static int hf_nt_sec_desc_type_rm_control_valid = -1; static int hf_nt_sec_desc_type_self_relative = -1; static int hf_nt_sid = -1; static int hf_nt_sid_revision = -1; static int hf_nt_sid_num_auth = -1; static int hf_nt_sid_auth_dec = -1; static int hf_nt_sid_auth_hex = -1; static int hf_nt_sid_subauth = -1; static int hf_nt_sid_rid_dec = -1; static int hf_nt_sid_rid_hex = -1; static int hf_nt_sid_wkwn = -1; static int hf_nt_sid_domain = -1; static int hf_nt_acl_revision = -1; static int hf_nt_acl_size = -1; static int hf_nt_acl_num_aces = -1; static int hf_nt_ace_flags_object_inherit = -1; static int hf_nt_ace_flags_container_inherit = -1; static int hf_nt_ace_flags_non_propagate_inherit = -1; static int hf_nt_ace_flags_inherit_only = -1; static int hf_nt_ace_flags_inherited_ace = -1; static int hf_nt_ace_flags_successful_access = -1; static int hf_nt_ace_flags_failed_access = -1; static int hf_nt_ace_type = -1; static int hf_nt_ace_size = -1; static int hf_nt_ace_flags_object_type_present = -1; static int hf_nt_ace_flags_inherited_object_type_present = -1; static int hf_nt_ace_guid = -1; static int hf_nt_ace_inherited_guid = -1; /* Conditional ACE dissect */ static int hf_nt_ace_cond = -1; static int hf_nt_ace_cond_token = -1; static int hf_nt_ace_cond_sign = -1; static int hf_nt_ace_cond_base = -1; static int hf_nt_ace_cond_value_int8 = -1; static int hf_nt_ace_cond_value_int16 = -1; static int hf_nt_ace_cond_value_int32 = -1; static int hf_nt_ace_cond_value_int64 = -1; static int hf_nt_ace_cond_value_string = -1; static int hf_nt_ace_cond_value_octet_string = -1; static int hf_nt_ace_cond_local_attr = -1; static int hf_nt_ace_cond_user_attr = -1; static int hf_nt_ace_cond_resource_attr = -1; static int hf_nt_ace_cond_device_attr = -1; /* System Resource Attribute ACE dissect */ static int hf_nt_ace_sra = -1; static int hf_nt_ace_sra_name_offset = -1; static int hf_nt_ace_sra_name = -1; static int hf_nt_ace_sra_type = -1; static int hf_nt_ace_sra_reserved = -1; static int hf_nt_ace_sra_flags = -1; static int hf_nt_ace_sra_flags_manual = -1; static int hf_nt_ace_sra_flags_policy_derived = -1; static int hf_nt_ace_sra_flags_non_inheritable = -1; static int hf_nt_ace_sra_flags_case_sensitive = -1; static int hf_nt_ace_sra_flags_deny_only = -1; static int hf_nt_ace_sra_flags_disabled_by_default = -1; static int hf_nt_ace_sra_flags_disabled = -1; static int hf_nt_ace_sra_flags_mandatory = -1; static int hf_nt_ace_sra_value_count = -1; static int hf_nt_ace_sra_value_offset = -1; static int hf_nt_ace_sra_value_int64 = -1; static int hf_nt_ace_sra_value_uint64 = -1; static int hf_nt_ace_sra_value_string = -1; static int hf_nt_ace_sra_value_sid = -1; static int hf_nt_ace_sra_value_boolean = -1; static int hf_nt_ace_sra_value_octet_string = -1; static int hf_nt_security_information_sacl = -1; static int hf_nt_security_information_dacl = -1; static int hf_nt_security_information_group = -1; static int hf_nt_security_information_owner = -1; /* Generated from convert_proto_tree_add_text.pl */ static int hf_nt_security_information = -1; static int hf_nt_sec_desc_type = -1; static int hf_nt_offset_to_dacl = -1; static int hf_nt_offset_to_owner_sid = -1; static int hf_nt_ace_flags_object = -1; static int hf_nt_offset_to_group_sid = -1; static int hf_nt_ace_flags = -1; static int hf_nt_offset_to_sacl = -1; static gint ett_nt_sec_desc = -1; static gint ett_nt_sec_desc_type = -1; static gint ett_nt_sid = -1; static gint ett_nt_acl = -1; static gint ett_nt_ace = -1; static gint ett_nt_ace_flags = -1; static gint ett_nt_ace_object = -1; static gint ett_nt_ace_object_flags = -1; static gint ett_nt_security_information = -1; static gint ett_nt_ace_cond = -1; static gint ett_nt_ace_cond_data = -1; static gint ett_nt_ace_sra = -1; static gint ett_nt_ace_sra_flags = -1; static gint ett_nt_ace_sra_value_offsets = -1; static gint ett_nt_ace_sra_values = -1; static expert_field ei_nt_owner_sid_beyond_data = EI_INIT; static expert_field ei_nt_owner_sid_beyond_reassembled_data = EI_INIT; static expert_field ei_nt_ace_extends_beyond_data = EI_INIT; static expert_field ei_nt_ace_extends_beyond_reassembled_data = EI_INIT; static expert_field ei_nt_group_sid_beyond_data = EI_INIT; static expert_field ei_nt_group_sid_beyond_reassembled_data = EI_INIT; static expert_field ei_nt_item_offs_out_of_range = EI_INIT; /* WERR error codes */ VALUE_STRING_ARRAY2_GLOBAL_DEF(WERR_errors); /* XXX: Remove GLOBAL_DEF once all PIDL generated dissectors ref WERR_errors_ext */ value_string_ext WERR_errors_ext = VALUE_STRING_EXT_INIT(WERR_errors); /* * HRES error codes. */ VALUE_STRING_ARRAY2_GLOBAL_DEF(HRES_errors); /* XXX: Remove GLOBAL_DEF once all PIDL generated dissectors ref HRES_errors_ext */ value_string_ext HRES_errors_ext = VALUE_STRING_EXT_INIT(HRES_errors); /* * DOS error codes. */ VALUE_STRING_ARRAY(DOS_errors); value_string_ext DOS_errors_ext = VALUE_STRING_EXT_INIT(DOS_errors); /* * NT error codes. * * From * * https://web.archive.org/web/20100503121824/http://www.wildpackets.com/elements/misc/SMB_NT_Status_Codes.txt * * See also MS-ERREF section 2.3.1 "NTSTATUS Values": * * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 */ const value_string NT_errors[] = { { 0x00000000, "STATUS_SUCCESS" }, /*{ 0x00000000, "STATUS_WAIT_0" }, */ { 0x00000001, "STATUS_WAIT_1" }, { 0x00000002, "STATUS_WAIT_2" }, { 0x00000003, "STATUS_WAIT_3" }, { 0x0000003F, "STATUS_WAIT_63" }, { 0x00000080, "STATUS_ABANDONED" }, /*{ 0x00000080, "STATUS_ABANDONED_WAIT_0" },*/ { 0x000000BF, "STATUS_ABANDONED_WAIT_63" }, { 0x000000C0, "STATUS_USER_APC" }, { 0x00000100, "STATUS_KERNEL_APC" }, { 0x00000101, "STATUS_ALERTED" }, { 0x00000102, "STATUS_TIMEOUT" }, { 0x00000103, "STATUS_PENDING" }, { 0x00000104, "STATUS_REPARSE" }, { 0x00000105, "STATUS_MORE_ENTRIES" }, { 0x00000106, "STATUS_NOT_ALL_ASSIGNED" }, { 0x00000107, "STATUS_SOME_NOT_MAPPED" }, { 0x00000108, "STATUS_OPLOCK_BREAK_IN_PROGRESS" }, { 0x00000109, "STATUS_VOLUME_MOUNTED" }, { 0x0000010A, "STATUS_RXACT_COMMITTED" }, { 0x0000010B, "STATUS_NOTIFY_CLEANUP" }, { 0x0000010C, "STATUS_NOTIFY_ENUM_DIR" }, { 0x0000010D, "STATUS_NO_QUOTAS_FOR_ACCOUNT" }, { 0x0000010E, "STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED" }, { 0x00000110, "STATUS_PAGE_FAULT_TRANSITION" }, { 0x00000111, "STATUS_PAGE_FAULT_DEMAND_ZERO" }, { 0x00000112, "STATUS_PAGE_FAULT_COPY_ON_WRITE" }, { 0x00000113, "STATUS_PAGE_FAULT_GUARD_PAGE" }, { 0x00000114, "STATUS_PAGE_FAULT_PAGING_FILE" }, { 0x00000115, "STATUS_CACHE_PAGE_LOCKED" }, { 0x00000116, "STATUS_CRASH_DUMP" }, { 0x00000117, "STATUS_BUFFER_ALL_ZEROS" }, { 0x00000118, "STATUS_REPARSE_OBJECT" }, { 0x0000045C, "STATUS_NO_SHUTDOWN_IN_PROGRESS" }, { 0x40000000, "STATUS_OBJECT_NAME_EXISTS" }, { 0x40000001, "STATUS_THREAD_WAS_SUSPENDED" }, { 0x40000002, "STATUS_WORKING_SET_LIMIT_RANGE" }, { 0x40000003, "STATUS_IMAGE_NOT_AT_BASE" }, { 0x40000004, "STATUS_RXACT_STATE_CREATED" }, { 0x40000005, "STATUS_SEGMENT_NOTIFICATION" }, { 0x40000006, "STATUS_LOCAL_USER_SESSION_KEY" }, { 0x40000007, "STATUS_BAD_CURRENT_DIRECTORY" }, { 0x40000008, "STATUS_SERIAL_MORE_WRITES" }, { 0x40000009, "STATUS_REGISTRY_RECOVERED" }, { 0x4000000A, "STATUS_FT_READ_RECOVERY_FROM_BACKUP" }, { 0x4000000B, "STATUS_FT_WRITE_RECOVERY" }, { 0x4000000C, "STATUS_SERIAL_COUNTER_TIMEOUT" }, { 0x4000000D, "STATUS_NULL_LM_PASSWORD" }, { 0x4000000E, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH" }, { 0x4000000F, "STATUS_RECEIVE_PARTIAL" }, { 0x40000010, "STATUS_RECEIVE_EXPEDITED" }, { 0x40000011, "STATUS_RECEIVE_PARTIAL_EXPEDITED" }, { 0x40000012, "STATUS_EVENT_DONE" }, { 0x40000013, "STATUS_EVENT_PENDING" }, { 0x40000014, "STATUS_CHECKING_FILE_SYSTEM" }, { 0x40000015, "STATUS_FATAL_APP_EXIT" }, { 0x40000016, "STATUS_PREDEFINED_HANDLE" }, { 0x40000017, "STATUS_WAS_UNLOCKED" }, { 0x40000018, "STATUS_SERVICE_NOTIFICATION" }, { 0x40000019, "STATUS_WAS_LOCKED" }, { 0x4000001A, "STATUS_LOG_HARD_ERROR" }, { 0x4000001B, "STATUS_ALREADY_WIN32" }, { 0x4000001C, "STATUS_WX86_UNSIMULATE" }, { 0x4000001D, "STATUS_WX86_CONTINUE" }, { 0x4000001E, "STATUS_WX86_SINGLE_STEP" }, { 0x4000001F, "STATUS_WX86_BREAKPOINT" }, { 0x40000020, "STATUS_WX86_EXCEPTION_CONTINUE" }, { 0x40000021, "STATUS_WX86_EXCEPTION_LASTCHANCE" }, { 0x40000022, "STATUS_WX86_EXCEPTION_CHAIN" }, { 0x40000023, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE" }, { 0x40000024, "STATUS_NO_YIELD_PERFORMED" }, { 0x40000025, "STATUS_TIMER_RESUME_IGNORED" }, { 0x40000294, "STATUS_WAKE_SYSTEM" }, { 0x40020056, "RPC_NT_UUID_LOCAL_ONLY" }, { 0x400200AF, "RPC_NT_SEND_INCOMPLETE" }, { 0x80000001, "STATUS_GUARD_PAGE_VIOLATION" }, { 0x80000002, "STATUS_DATATYPE_MISALIGNMENT" }, { 0x80000003, "STATUS_BREAKPOINT" }, { 0x80000004, "STATUS_SINGLE_STEP" }, { 0x80000005, "STATUS_BUFFER_OVERFLOW" }, { 0x80000006, "STATUS_NO_MORE_FILES" }, { 0x80000007, "STATUS_WAKE_SYSTEM_DEBUGGER" }, { 0x8000000A, "STATUS_HANDLES_CLOSED" }, { 0x8000000B, "STATUS_NO_INHERITANCE" }, { 0x8000000C, "STATUS_GUID_SUBSTITUTION_MADE" }, { 0x8000000D, "STATUS_PARTIAL_COPY" }, { 0x8000000E, "STATUS_DEVICE_PAPER_EMPTY" }, { 0x8000000F, "STATUS_DEVICE_POWERED_OFF" }, { 0x80000010, "STATUS_DEVICE_OFF_LINE" }, { 0x80000011, "STATUS_DEVICE_BUSY" }, { 0x80000012, "STATUS_NO_MORE_EAS" }, { 0x80000013, "STATUS_INVALID_EA_NAME" }, { 0x80000014, "STATUS_EA_LIST_INCONSISTENT" }, { 0x80000015, "STATUS_INVALID_EA_FLAG" }, { 0x80000016, "STATUS_VERIFY_REQUIRED" }, { 0x80000017, "STATUS_EXTRANEOUS_INFORMATION" }, { 0x80000018, "STATUS_RXACT_COMMIT_NECESSARY" }, { 0x8000001A, "STATUS_NO_MORE_ENTRIES" }, { 0x8000001B, "STATUS_FILEMARK_DETECTED" }, { 0x8000001C, "STATUS_MEDIA_CHANGED" }, { 0x8000001D, "STATUS_BUS_RESET" }, { 0x8000001E, "STATUS_END_OF_MEDIA" }, { 0x8000001F, "STATUS_BEGINNING_OF_MEDIA" }, { 0x80000020, "STATUS_MEDIA_CHECK" }, { 0x80000021, "STATUS_SETMARK_DETECTED" }, { 0x80000022, "STATUS_NO_DATA_DETECTED" }, { 0x80000023, "STATUS_REDIRECTOR_HAS_OPEN_HANDLES" }, { 0x80000024, "STATUS_SERVER_HAS_OPEN_HANDLES" }, { 0x80000025, "STATUS_ALREADY_DISCONNECTED" }, { 0x80000026, "STATUS_LONGJUMP" }, { 0x8000002D, "STATUS_STOPPED_ON_SYMLINK" }, { 0x80000288, "STATUS_DEVICE_REQUIRES_CLEANING" }, { 0x80000289, "STATUS_DEVICE_DOOR_OPEN" }, { 0x80040111, "MAPI_E_LOGON_FAILED" }, { 0x80090300, "SEC_E_INSUFFICIENT_MEMORY" }, { 0x80090301, "SEC_E_INVALID_HANDLE" }, { 0x80090302, "SEC_E_UNSUPPORTED_FUNCTION" }, { 0x8009030B, "SEC_E_NO_IMPERSONATION" }, { 0x8009030D, "SEC_E_UNKNOWN_CREDENTIALS" }, { 0x8009030E, "SEC_E_NO_CREDENTIALS" }, { 0x8009030F, "SEC_E_MESSAGE_ALTERED" }, { 0x80090310, "SEC_E_OUT_OF_SEQUENCE" }, { 0x80090311, "SEC_E_NO_AUTHENTICATING_AUTHORITY" }, { 0xC0000001, "STATUS_UNSUCCESSFUL" }, { 0xC0000002, "STATUS_NOT_IMPLEMENTED" }, { 0xC0000003, "STATUS_INVALID_INFO_CLASS" }, { 0xC0000004, "STATUS_INFO_LENGTH_MISMATCH" }, { 0xC0000005, "STATUS_ACCESS_VIOLATION" }, { 0xC0000006, "STATUS_IN_PAGE_ERROR" }, { 0xC0000007, "STATUS_PAGEFILE_QUOTA" }, { 0xC0000008, "STATUS_INVALID_HANDLE" }, { 0xC0000009, "STATUS_BAD_INITIAL_STACK" }, { 0xC000000A, "STATUS_BAD_INITIAL_PC" }, { 0xC000000B, "STATUS_INVALID_CID" }, { 0xC000000C, "STATUS_TIMER_NOT_CANCELED" }, { 0xC000000D, "STATUS_INVALID_PARAMETER" }, { 0xC000000E, "STATUS_NO_SUCH_DEVICE" }, { 0xC000000F, "STATUS_NO_SUCH_FILE" }, { 0xC0000010, "STATUS_INVALID_DEVICE_REQUEST" }, { 0xC0000011, "STATUS_END_OF_FILE" }, { 0xC0000012, "STATUS_WRONG_VOLUME" }, { 0xC0000013, "STATUS_NO_MEDIA_IN_DEVICE" }, { 0xC0000014, "STATUS_UNRECOGNIZED_MEDIA" }, { 0xC0000015, "STATUS_NONEXISTENT_SECTOR" }, { 0xC0000016, "STATUS_MORE_PROCESSING_REQUIRED" }, { 0xC0000017, "STATUS_NO_MEMORY" }, { 0xC0000018, "STATUS_CONFLICTING_ADDRESSES" }, { 0xC0000019, "STATUS_NOT_MAPPED_VIEW" }, { 0xC000001A, "STATUS_UNABLE_TO_FREE_VM" }, { 0xC000001B, "STATUS_UNABLE_TO_DELETE_SECTION" }, { 0xC000001C, "STATUS_INVALID_SYSTEM_SERVICE" }, { 0xC000001D, "STATUS_ILLEGAL_INSTRUCTION" }, { 0xC000001E, "STATUS_INVALID_LOCK_SEQUENCE" }, { 0xC000001F, "STATUS_INVALID_VIEW_SIZE" }, { 0xC0000020, "STATUS_INVALID_FILE_FOR_SECTION" }, { 0xC0000021, "STATUS_ALREADY_COMMITTED" }, { 0xC0000022, "STATUS_ACCESS_DENIED" }, { 0xC0000023, "STATUS_BUFFER_TOO_SMALL" }, { 0xC0000024, "STATUS_OBJECT_TYPE_MISMATCH" }, { 0xC0000025, "STATUS_NONCONTINUABLE_EXCEPTION" }, { 0xC0000026, "STATUS_INVALID_DISPOSITION" }, { 0xC0000027, "STATUS_UNWIND" }, { 0xC0000028, "STATUS_BAD_STACK" }, { 0xC0000029, "STATUS_INVALID_UNWIND_TARGET" }, { 0xC000002A, "STATUS_NOT_LOCKED" }, { 0xC000002B, "STATUS_PARITY_ERROR" }, { 0xC000002C, "STATUS_UNABLE_TO_DECOMMIT_VM" }, { 0xC000002D, "STATUS_NOT_COMMITTED" }, { 0xC000002E, "STATUS_INVALID_PORT_ATTRIBUTES" }, { 0xC000002F, "STATUS_PORT_MESSAGE_TOO_LONG" }, { 0xC0000030, "STATUS_INVALID_PARAMETER_MIX" }, { 0xC0000031, "STATUS_INVALID_QUOTA_LOWER" }, { 0xC0000032, "STATUS_DISK_CORRUPT_ERROR" }, { 0xC0000033, "STATUS_OBJECT_NAME_INVALID" }, { 0xC0000034, "STATUS_OBJECT_NAME_NOT_FOUND" }, { 0xC0000035, "STATUS_OBJECT_NAME_COLLISION" }, { 0xC0000037, "STATUS_PORT_DISCONNECTED" }, { 0xC0000038, "STATUS_DEVICE_ALREADY_ATTACHED" }, { 0xC0000039, "STATUS_OBJECT_PATH_INVALID" }, { 0xC000003A, "STATUS_OBJECT_PATH_NOT_FOUND" }, { 0xC000003B, "STATUS_OBJECT_PATH_SYNTAX_BAD" }, { 0xC000003C, "STATUS_DATA_OVERRUN" }, { 0xC000003D, "STATUS_DATA_LATE_ERROR" }, { 0xC000003E, "STATUS_DATA_ERROR" }, { 0xC000003F, "STATUS_CRC_ERROR" }, { 0xC0000040, "STATUS_SECTION_TOO_BIG" }, { 0xC0000041, "STATUS_PORT_CONNECTION_REFUSED" }, { 0xC0000042, "STATUS_INVALID_PORT_HANDLE" }, { 0xC0000043, "STATUS_SHARING_VIOLATION" }, { 0xC0000044, "STATUS_QUOTA_EXCEEDED" }, { 0xC0000045, "STATUS_INVALID_PAGE_PROTECTION" }, { 0xC0000046, "STATUS_MUTANT_NOT_OWNED" }, { 0xC0000047, "STATUS_SEMAPHORE_LIMIT_EXCEEDED" }, { 0xC0000048, "STATUS_PORT_ALREADY_SET" }, { 0xC0000049, "STATUS_SECTION_NOT_IMAGE" }, { 0xC000004A, "STATUS_SUSPEND_COUNT_EXCEEDED" }, { 0xC000004B, "STATUS_THREAD_IS_TERMINATING" }, { 0xC000004C, "STATUS_BAD_WORKING_SET_LIMIT" }, { 0xC000004D, "STATUS_INCOMPATIBLE_FILE_MAP" }, { 0xC000004E, "STATUS_SECTION_PROTECTION" }, { 0xC000004F, "STATUS_EAS_NOT_SUPPORTED" }, { 0xC0000050, "STATUS_EA_TOO_LARGE" }, { 0xC0000051, "STATUS_NONEXISTENT_EA_ENTRY" }, { 0xC0000052, "STATUS_NO_EAS_ON_FILE" }, { 0xC0000053, "STATUS_EA_CORRUPT_ERROR" }, { 0xC0000054, "STATUS_FILE_LOCK_CONFLICT" }, { 0xC0000055, "STATUS_LOCK_NOT_GRANTED" }, { 0xC0000056, "STATUS_DELETE_PENDING" }, { 0xC0000057, "STATUS_CTL_FILE_NOT_SUPPORTED" }, { 0xC0000058, "STATUS_UNKNOWN_REVISION" }, { 0xC0000059, "STATUS_REVISION_MISMATCH" }, { 0xC000005A, "STATUS_INVALID_OWNER" }, { 0xC000005B, "STATUS_INVALID_PRIMARY_GROUP" }, { 0xC000005C, "STATUS_NO_IMPERSONATION_TOKEN" }, { 0xC000005D, "STATUS_CANT_DISABLE_MANDATORY" }, { 0xC000005E, "STATUS_NO_LOGON_SERVERS" }, { 0xC000005F, "STATUS_NO_SUCH_LOGON_SESSION" }, { 0xC0000060, "STATUS_NO_SUCH_PRIVILEGE" }, { 0xC0000061, "STATUS_PRIVILEGE_NOT_HELD" }, { 0xC0000062, "STATUS_INVALID_ACCOUNT_NAME" }, { 0xC0000063, "STATUS_USER_EXISTS" }, { 0xC0000064, "STATUS_NO_SUCH_USER" }, { 0xC0000065, "STATUS_GROUP_EXISTS" }, { 0xC0000066, "STATUS_NO_SUCH_GROUP" }, { 0xC0000067, "STATUS_MEMBER_IN_GROUP" }, { 0xC0000068, "STATUS_MEMBER_NOT_IN_GROUP" }, { 0xC0000069, "STATUS_LAST_ADMIN" }, { 0xC000006A, "STATUS_WRONG_PASSWORD" }, { 0xC000006B, "STATUS_ILL_FORMED_PASSWORD" }, { 0xC000006C, "STATUS_PASSWORD_RESTRICTION" }, { 0xC000006D, "STATUS_LOGON_FAILURE" }, { 0xC000006E, "STATUS_ACCOUNT_RESTRICTION" }, { 0xC000006F, "STATUS_INVALID_LOGON_HOURS" }, { 0xC0000070, "STATUS_INVALID_WORKSTATION" }, { 0xC0000071, "STATUS_PASSWORD_EXPIRED" }, { 0xC0000072, "STATUS_ACCOUNT_DISABLED" }, { 0xC0000073, "STATUS_NONE_MAPPED" }, { 0xC0000074, "STATUS_TOO_MANY_LUIDS_REQUESTED" }, { 0xC0000075, "STATUS_LUIDS_EXHAUSTED" }, { 0xC0000076, "STATUS_INVALID_SUB_AUTHORITY" }, { 0xC0000077, "STATUS_INVALID_ACL" }, { 0xC0000078, "STATUS_INVALID_SID" }, { 0xC0000079, "STATUS_INVALID_SECURITY_DESCR" }, { 0xC000007A, "STATUS_PROCEDURE_NOT_FOUND" }, { 0xC000007B, "STATUS_INVALID_IMAGE_FORMAT" }, { 0xC000007C, "STATUS_NO_TOKEN" }, { 0xC000007D, "STATUS_BAD_INHERITANCE_ACL" }, { 0xC000007E, "STATUS_RANGE_NOT_LOCKED" }, { 0xC000007F, "STATUS_DISK_FULL" }, { 0xC0000080, "STATUS_SERVER_DISABLED" }, { 0xC0000081, "STATUS_SERVER_NOT_DISABLED" }, { 0xC0000082, "STATUS_TOO_MANY_GUIDS_REQUESTED" }, { 0xC0000083, "STATUS_GUIDS_EXHAUSTED" }, { 0xC0000084, "STATUS_INVALID_ID_AUTHORITY" }, { 0xC0000085, "STATUS_AGENTS_EXHAUSTED" }, { 0xC0000086, "STATUS_INVALID_VOLUME_LABEL" }, { 0xC0000087, "STATUS_SECTION_NOT_EXTENDED" }, { 0xC0000088, "STATUS_NOT_MAPPED_DATA" }, { 0xC0000089, "STATUS_RESOURCE_DATA_NOT_FOUND" }, { 0xC000008A, "STATUS_RESOURCE_TYPE_NOT_FOUND" }, { 0xC000008B, "STATUS_RESOURCE_NAME_NOT_FOUND" }, { 0xC000008C, "STATUS_ARRAY_BOUNDS_EXCEEDED" }, { 0xC000008D, "STATUS_FLOAT_DENORMAL_OPERAND" }, { 0xC000008E, "STATUS_FLOAT_DIVIDE_BY_ZERO" }, { 0xC000008F, "STATUS_FLOAT_INEXACT_RESULT" }, { 0xC0000090, "STATUS_FLOAT_INVALID_OPERATION" }, { 0xC0000091, "STATUS_FLOAT_OVERFLOW" }, { 0xC0000092, "STATUS_FLOAT_STACK_CHECK" }, { 0xC0000093, "STATUS_FLOAT_UNDERFLOW" }, { 0xC0000094, "STATUS_INTEGER_DIVIDE_BY_ZERO" }, { 0xC0000095, "STATUS_INTEGER_OVERFLOW" }, { 0xC0000096, "STATUS_PRIVILEGED_INSTRUCTION" }, { 0xC0000097, "STATUS_TOO_MANY_PAGING_FILES" }, { 0xC0000098, "STATUS_FILE_INVALID" }, { 0xC0000099, "STATUS_ALLOTTED_SPACE_EXCEEDED" }, { 0xC000009A, "STATUS_INSUFFICIENT_RESOURCES" }, { 0xC000009B, "STATUS_DFS_EXIT_PATH_FOUND" }, { 0xC000009C, "STATUS_DEVICE_DATA_ERROR" }, { 0xC000009D, "STATUS_DEVICE_NOT_CONNECTED" }, { 0xC000009E, "STATUS_DEVICE_POWER_FAILURE" }, { 0xC000009F, "STATUS_FREE_VM_NOT_AT_BASE" }, { 0xC00000A0, "STATUS_MEMORY_NOT_ALLOCATED" }, { 0xC00000A1, "STATUS_WORKING_SET_QUOTA" }, { 0xC00000A2, "STATUS_MEDIA_WRITE_PROTECTED" }, { 0xC00000A3, "STATUS_DEVICE_NOT_READY" }, { 0xC00000A4, "STATUS_INVALID_GROUP_ATTRIBUTES" }, { 0xC00000A5, "STATUS_BAD_IMPERSONATION_LEVEL" }, { 0xC00000A6, "STATUS_CANT_OPEN_ANONYMOUS" }, { 0xC00000A7, "STATUS_BAD_VALIDATION_CLASS" }, { 0xC00000A8, "STATUS_BAD_TOKEN_TYPE" }, { 0xC00000A9, "STATUS_BAD_MASTER_BOOT_RECORD" }, { 0xC00000AA, "STATUS_INSTRUCTION_MISALIGNMENT" }, { 0xC00000AB, "STATUS_INSTANCE_NOT_AVAILABLE" }, { 0xC00000AC, "STATUS_PIPE_NOT_AVAILABLE" }, { 0xC00000AD, "STATUS_INVALID_PIPE_STATE" }, { 0xC00000AE, "STATUS_PIPE_BUSY" }, { 0xC00000AF, "STATUS_ILLEGAL_FUNCTION" }, { 0xC00000B0, "STATUS_PIPE_DISCONNECTED" }, { 0xC00000B1, "STATUS_PIPE_CLOSING" }, { 0xC00000B2, "STATUS_PIPE_CONNECTED" }, { 0xC00000B3, "STATUS_PIPE_LISTENING" }, { 0xC00000B4, "STATUS_INVALID_READ_MODE" }, { 0xC00000B5, "STATUS_IO_TIMEOUT" }, { 0xC00000B6, "STATUS_FILE_FORCED_CLOSED" }, { 0xC00000B7, "STATUS_PROFILING_NOT_STARTED" }, { 0xC00000B8, "STATUS_PROFILING_NOT_STOPPED" }, { 0xC00000B9, "STATUS_COULD_NOT_INTERPRET" }, { 0xC00000BA, "STATUS_FILE_IS_A_DIRECTORY" }, { 0xC00000BB, "STATUS_NOT_SUPPORTED" }, { 0xC00000BC, "STATUS_REMOTE_NOT_LISTENING" }, { 0xC00000BD, "STATUS_DUPLICATE_NAME" }, { 0xC00000BE, "STATUS_BAD_NETWORK_PATH" }, { 0xC00000BF, "STATUS_NETWORK_BUSY" }, { 0xC00000C0, "STATUS_DEVICE_DOES_NOT_EXIST" }, { 0xC00000C1, "STATUS_TOO_MANY_COMMANDS" }, { 0xC00000C2, "STATUS_ADAPTER_HARDWARE_ERROR" }, { 0xC00000C3, "STATUS_INVALID_NETWORK_RESPONSE" }, { 0xC00000C4, "STATUS_UNEXPECTED_NETWORK_ERROR" }, { 0xC00000C5, "STATUS_BAD_REMOTE_ADAPTER" }, { 0xC00000C6, "STATUS_PRINT_QUEUE_FULL" }, { 0xC00000C7, "STATUS_NO_SPOOL_SPACE" }, { 0xC00000C8, "STATUS_PRINT_CANCELLED" }, { 0xC00000C9, "STATUS_NETWORK_NAME_DELETED" }, { 0xC00000CA, "STATUS_NETWORK_ACCESS_DENIED" }, { 0xC00000CB, "STATUS_BAD_DEVICE_TYPE" }, { 0xC00000CC, "STATUS_BAD_NETWORK_NAME" }, { 0xC00000CD, "STATUS_TOO_MANY_NAMES" }, { 0xC00000CE, "STATUS_TOO_MANY_SESSIONS" }, { 0xC00000CF, "STATUS_SHARING_PAUSED" }, { 0xC00000D0, "STATUS_REQUEST_NOT_ACCEPTED" }, { 0xC00000D1, "STATUS_REDIRECTOR_PAUSED" }, { 0xC00000D2, "STATUS_NET_WRITE_FAULT" }, { 0xC00000D3, "STATUS_PROFILING_AT_LIMIT" }, { 0xC00000D4, "STATUS_NOT_SAME_DEVICE" }, { 0xC00000D5, "STATUS_FILE_RENAMED" }, { 0xC00000D6, "STATUS_VIRTUAL_CIRCUIT_CLOSED" }, { 0xC00000D7, "STATUS_NO_SECURITY_ON_OBJECT" }, { 0xC00000D8, "STATUS_CANT_WAIT" }, { 0xC00000D9, "STATUS_PIPE_EMPTY" }, { 0xC00000DA, "STATUS_CANT_ACCESS_DOMAIN_INFO" }, { 0xC00000DB, "STATUS_CANT_TERMINATE_SELF" }, { 0xC00000DC, "STATUS_INVALID_SERVER_STATE" }, { 0xC00000DD, "STATUS_INVALID_DOMAIN_STATE" }, { 0xC00000DE, "STATUS_INVALID_DOMAIN_ROLE" }, { 0xC00000DF, "STATUS_NO_SUCH_DOMAIN" }, { 0xC00000E0, "STATUS_DOMAIN_EXISTS" }, { 0xC00000E1, "STATUS_DOMAIN_LIMIT_EXCEEDED" }, { 0xC00000E2, "STATUS_OPLOCK_NOT_GRANTED" }, { 0xC00000E3, "STATUS_INVALID_OPLOCK_PROTOCOL" }, { 0xC00000E4, "STATUS_INTERNAL_DB_CORRUPTION" }, { 0xC00000E5, "STATUS_INTERNAL_ERROR" }, { 0xC00000E6, "STATUS_GENERIC_NOT_MAPPED" }, { 0xC00000E7, "STATUS_BAD_DESCRIPTOR_FORMAT" }, { 0xC00000E8, "STATUS_INVALID_USER_BUFFER" }, { 0xC00000E9, "STATUS_UNEXPECTED_IO_ERROR" }, { 0xC00000EA, "STATUS_UNEXPECTED_MM_CREATE_ERR" }, { 0xC00000EB, "STATUS_UNEXPECTED_MM_MAP_ERROR" }, { 0xC00000EC, "STATUS_UNEXPECTED_MM_EXTEND_ERR" }, { 0xC00000ED, "STATUS_NOT_LOGON_PROCESS" }, { 0xC00000EE, "STATUS_LOGON_SESSION_EXISTS" }, { 0xC00000EF, "STATUS_INVALID_PARAMETER_1" }, { 0xC00000F0, "STATUS_INVALID_PARAMETER_2" }, { 0xC00000F1, "STATUS_INVALID_PARAMETER_3" }, { 0xC00000F2, "STATUS_INVALID_PARAMETER_4" }, { 0xC00000F3, "STATUS_INVALID_PARAMETER_5" }, { 0xC00000F4, "STATUS_INVALID_PARAMETER_6" }, { 0xC00000F5, "STATUS_INVALID_PARAMETER_7" }, { 0xC00000F6, "STATUS_INVALID_PARAMETER_8" }, { 0xC00000F7, "STATUS_INVALID_PARAMETER_9" }, { 0xC00000F8, "STATUS_INVALID_PARAMETER_10" }, { 0xC00000F9, "STATUS_INVALID_PARAMETER_11" }, { 0xC00000FA, "STATUS_INVALID_PARAMETER_12" }, { 0xC00000FB, "STATUS_REDIRECTOR_NOT_STARTED" }, { 0xC00000FC, "STATUS_REDIRECTOR_STARTED" }, { 0xC00000FD, "STATUS_STACK_OVERFLOW" }, { 0xC00000FE, "STATUS_NO_SUCH_PACKAGE" }, { 0xC00000FF, "STATUS_BAD_FUNCTION_TABLE" }, { 0xC0000100, "STATUS_VARIABLE_NOT_FOUND" }, { 0xC0000101, "STATUS_DIRECTORY_NOT_EMPTY" }, { 0xC0000102, "STATUS_FILE_CORRUPT_ERROR" }, { 0xC0000103, "STATUS_NOT_A_DIRECTORY" }, { 0xC0000104, "STATUS_BAD_LOGON_SESSION_STATE" }, { 0xC0000105, "STATUS_LOGON_SESSION_COLLISION" }, { 0xC0000106, "STATUS_NAME_TOO_LONG" }, { 0xC0000107, "STATUS_FILES_OPEN" }, { 0xC0000108, "STATUS_CONNECTION_IN_USE" }, { 0xC0000109, "STATUS_MESSAGE_NOT_FOUND" }, { 0xC000010A, "STATUS_PROCESS_IS_TERMINATING" }, { 0xC000010B, "STATUS_INVALID_LOGON_TYPE" }, { 0xC000010C, "STATUS_NO_GUID_TRANSLATION" }, { 0xC000010D, "STATUS_CANNOT_IMPERSONATE" }, { 0xC000010E, "STATUS_IMAGE_ALREADY_LOADED" }, { 0xC000010F, "STATUS_ABIOS_NOT_PRESENT" }, { 0xC0000110, "STATUS_ABIOS_LID_NOT_EXIST" }, { 0xC0000111, "STATUS_ABIOS_LID_ALREADY_OWNED" }, { 0xC0000112, "STATUS_ABIOS_NOT_LID_OWNER" }, { 0xC0000113, "STATUS_ABIOS_INVALID_COMMAND" }, { 0xC0000114, "STATUS_ABIOS_INVALID_LID" }, { 0xC0000115, "STATUS_ABIOS_SELECTOR_NOT_AVAILABLE" }, { 0xC0000116, "STATUS_ABIOS_INVALID_SELECTOR" }, { 0xC0000117, "STATUS_NO_LDT" }, { 0xC0000118, "STATUS_INVALID_LDT_SIZE" }, { 0xC0000119, "STATUS_INVALID_LDT_OFFSET" }, { 0xC000011A, "STATUS_INVALID_LDT_DESCRIPTOR" }, { 0xC000011B, "STATUS_INVALID_IMAGE_NE_FORMAT" }, { 0xC000011C, "STATUS_RXACT_INVALID_STATE" }, { 0xC000011D, "STATUS_RXACT_COMMIT_FAILURE" }, { 0xC000011E, "STATUS_MAPPED_FILE_SIZE_ZERO" }, { 0xC000011F, "STATUS_TOO_MANY_OPENED_FILES" }, { 0xC0000120, "STATUS_CANCELLED" }, { 0xC0000121, "STATUS_CANNOT_DELETE" }, { 0xC0000122, "STATUS_INVALID_COMPUTER_NAME" }, { 0xC0000123, "STATUS_FILE_DELETED" }, { 0xC0000124, "STATUS_SPECIAL_ACCOUNT" }, { 0xC0000125, "STATUS_SPECIAL_GROUP" }, { 0xC0000126, "STATUS_SPECIAL_USER" }, { 0xC0000127, "STATUS_MEMBERS_PRIMARY_GROUP" }, { 0xC0000128, "STATUS_FILE_CLOSED" }, { 0xC0000129, "STATUS_TOO_MANY_THREADS" }, { 0xC000012A, "STATUS_THREAD_NOT_IN_PROCESS" }, { 0xC000012B, "STATUS_TOKEN_ALREADY_IN_USE" }, { 0xC000012C, "STATUS_PAGEFILE_QUOTA_EXCEEDED" }, { 0xC000012D, "STATUS_COMMITMENT_LIMIT" }, { 0xC000012E, "STATUS_INVALID_IMAGE_LE_FORMAT" }, { 0xC000012F, "STATUS_INVALID_IMAGE_NOT_MZ" }, { 0xC0000130, "STATUS_INVALID_IMAGE_PROTECT" }, { 0xC0000131, "STATUS_INVALID_IMAGE_WIN_16" }, { 0xC0000132, "STATUS_LOGON_SERVER_CONFLICT" }, { 0xC0000133, "STATUS_TIME_DIFFERENCE_AT_DC" }, { 0xC0000134, "STATUS_SYNCHRONIZATION_REQUIRED" }, { 0xC0000135, "STATUS_DLL_NOT_FOUND" }, { 0xC0000136, "STATUS_OPEN_FAILED" }, { 0xC0000137, "STATUS_IO_PRIVILEGE_FAILED" }, { 0xC0000138, "STATUS_ORDINAL_NOT_FOUND" }, { 0xC0000139, "STATUS_ENTRYPOINT_NOT_FOUND" }, { 0xC000013A, "STATUS_CONTROL_C_EXIT" }, { 0xC000013B, "STATUS_LOCAL_DISCONNECT" }, { 0xC000013C, "STATUS_REMOTE_DISCONNECT" }, { 0xC000013D, "STATUS_REMOTE_RESOURCES" }, { 0xC000013E, "STATUS_LINK_FAILED" }, { 0xC000013F, "STATUS_LINK_TIMEOUT" }, { 0xC0000140, "STATUS_INVALID_CONNECTION" }, { 0xC0000141, "STATUS_INVALID_ADDRESS" }, { 0xC0000142, "STATUS_DLL_INIT_FAILED" }, { 0xC0000143, "STATUS_MISSING_SYSTEMFILE" }, { 0xC0000144, "STATUS_UNHANDLED_EXCEPTION" }, { 0xC0000145, "STATUS_APP_INIT_FAILURE" }, { 0xC0000146, "STATUS_PAGEFILE_CREATE_FAILED" }, { 0xC0000147, "STATUS_NO_PAGEFILE" }, { 0xC0000148, "STATUS_INVALID_LEVEL" }, { 0xC0000149, "STATUS_WRONG_PASSWORD_CORE" }, { 0xC000014A, "STATUS_ILLEGAL_FLOAT_CONTEXT" }, { 0xC000014B, "STATUS_PIPE_BROKEN" }, { 0xC000014C, "STATUS_REGISTRY_CORRUPT" }, { 0xC000014D, "STATUS_REGISTRY_IO_FAILED" }, { 0xC000014E, "STATUS_NO_EVENT_PAIR" }, { 0xC000014F, "STATUS_UNRECOGNIZED_VOLUME" }, { 0xC0000150, "STATUS_SERIAL_NO_DEVICE_INITED" }, { 0xC0000151, "STATUS_NO_SUCH_ALIAS" }, { 0xC0000152, "STATUS_MEMBER_NOT_IN_ALIAS" }, { 0xC0000153, "STATUS_MEMBER_IN_ALIAS" }, { 0xC0000154, "STATUS_ALIAS_EXISTS" }, { 0xC0000155, "STATUS_LOGON_NOT_GRANTED" }, { 0xC0000156, "STATUS_TOO_MANY_SECRETS" }, { 0xC0000157, "STATUS_SECRET_TOO_LONG" }, { 0xC0000158, "STATUS_INTERNAL_DB_ERROR" }, { 0xC0000159, "STATUS_FULLSCREEN_MODE" }, { 0xC000015A, "STATUS_TOO_MANY_CONTEXT_IDS" }, { 0xC000015B, "STATUS_LOGON_TYPE_NOT_GRANTED" }, { 0xC000015C, "STATUS_NOT_REGISTRY_FILE" }, { 0xC000015D, "STATUS_NT_CROSS_ENCRYPTION_REQUIRED" }, { 0xC000015E, "STATUS_DOMAIN_CTRLR_CONFIG_ERROR" }, { 0xC000015F, "STATUS_FT_MISSING_MEMBER" }, { 0xC0000160, "STATUS_ILL_FORMED_SERVICE_ENTRY" }, { 0xC0000161, "STATUS_ILLEGAL_CHARACTER" }, { 0xC0000162, "STATUS_UNMAPPABLE_CHARACTER" }, { 0xC0000163, "STATUS_UNDEFINED_CHARACTER" }, { 0xC0000164, "STATUS_FLOPPY_VOLUME" }, { 0xC0000165, "STATUS_FLOPPY_ID_MARK_NOT_FOUND" }, { 0xC0000166, "STATUS_FLOPPY_WRONG_CYLINDER" }, { 0xC0000167, "STATUS_FLOPPY_UNKNOWN_ERROR" }, { 0xC0000168, "STATUS_FLOPPY_BAD_REGISTERS" }, { 0xC0000169, "STATUS_DISK_RECALIBRATE_FAILED" }, { 0xC000016A, "STATUS_DISK_OPERATION_FAILED" }, { 0xC000016B, "STATUS_DISK_RESET_FAILED" }, { 0xC000016C, "STATUS_SHARED_IRQ_BUSY" }, { 0xC000016D, "STATUS_FT_ORPHANING" }, { 0xC000016E, "STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT" }, { 0xC0000172, "STATUS_PARTITION_FAILURE" }, { 0xC0000173, "STATUS_INVALID_BLOCK_LENGTH" }, { 0xC0000174, "STATUS_DEVICE_NOT_PARTITIONED" }, { 0xC0000175, "STATUS_UNABLE_TO_LOCK_MEDIA" }, { 0xC0000176, "STATUS_UNABLE_TO_UNLOAD_MEDIA" }, { 0xC0000177, "STATUS_EOM_OVERFLOW" }, { 0xC0000178, "STATUS_NO_MEDIA" }, { 0xC000017A, "STATUS_NO_SUCH_MEMBER" }, { 0xC000017B, "STATUS_INVALID_MEMBER" }, { 0xC000017C, "STATUS_KEY_DELETED" }, { 0xC000017D, "STATUS_NO_LOG_SPACE" }, { 0xC000017E, "STATUS_TOO_MANY_SIDS" }, { 0xC000017F, "STATUS_LM_CROSS_ENCRYPTION_REQUIRED" }, { 0xC0000180, "STATUS_KEY_HAS_CHILDREN" }, { 0xC0000181, "STATUS_CHILD_MUST_BE_VOLATILE" }, { 0xC0000182, "STATUS_DEVICE_CONFIGURATION_ERROR" }, { 0xC0000183, "STATUS_DRIVER_INTERNAL_ERROR" }, { 0xC0000184, "STATUS_INVALID_DEVICE_STATE" }, { 0xC0000185, "STATUS_IO_DEVICE_ERROR" }, { 0xC0000186, "STATUS_DEVICE_PROTOCOL_ERROR" }, { 0xC0000187, "STATUS_BACKUP_CONTROLLER" }, { 0xC0000188, "STATUS_LOG_FILE_FULL" }, { 0xC0000189, "STATUS_TOO_LATE" }, { 0xC000018A, "STATUS_NO_TRUST_LSA_SECRET" }, { 0xC000018B, "STATUS_NO_TRUST_SAM_ACCOUNT" }, { 0xC000018C, "STATUS_TRUSTED_DOMAIN_FAILURE" }, { 0xC000018D, "STATUS_TRUSTED_RELATIONSHIP_FAILURE" }, { 0xC000018E, "STATUS_EVENTLOG_FILE_CORRUPT" }, { 0xC000018F, "STATUS_EVENTLOG_CANT_START" }, { 0xC0000190, "STATUS_TRUST_FAILURE" }, { 0xC0000191, "STATUS_MUTANT_LIMIT_EXCEEDED" }, { 0xC0000192, "STATUS_NETLOGON_NOT_STARTED" }, { 0xC0000193, "STATUS_ACCOUNT_EXPIRED" }, { 0xC0000194, "STATUS_POSSIBLE_DEADLOCK" }, { 0xC0000195, "STATUS_NETWORK_CREDENTIAL_CONFLICT" }, { 0xC0000196, "STATUS_REMOTE_SESSION_LIMIT" }, { 0xC0000197, "STATUS_EVENTLOG_FILE_CHANGED" }, { 0xC0000198, "STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT" }, { 0xC0000199, "STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT" }, { 0xC000019A, "STATUS_NOLOGON_SERVER_TRUST_ACCOUNT" }, { 0xC000019B, "STATUS_DOMAIN_TRUST_INCONSISTENT" }, { 0xC000019C, "STATUS_FS_DRIVER_REQUIRED" }, { 0xC0000202, "STATUS_NO_USER_SESSION_KEY" }, { 0xC0000203, "STATUS_USER_SESSION_DELETED" }, { 0xC0000204, "STATUS_RESOURCE_LANG_NOT_FOUND" }, { 0xC0000205, "STATUS_INSUFF_SERVER_RESOURCES" }, { 0xC0000206, "STATUS_INVALID_BUFFER_SIZE" }, { 0xC0000207, "STATUS_INVALID_ADDRESS_COMPONENT" }, { 0xC0000208, "STATUS_INVALID_ADDRESS_WILDCARD" }, { 0xC0000209, "STATUS_TOO_MANY_ADDRESSES" }, { 0xC000020A, "STATUS_ADDRESS_ALREADY_EXISTS" }, { 0xC000020B, "STATUS_ADDRESS_CLOSED" }, { 0xC000020C, "STATUS_CONNECTION_DISCONNECTED" }, { 0xC000020D, "STATUS_CONNECTION_RESET" }, { 0xC000020E, "STATUS_TOO_MANY_NODES" }, { 0xC000020F, "STATUS_TRANSACTION_ABORTED" }, { 0xC0000210, "STATUS_TRANSACTION_TIMED_OUT" }, { 0xC0000211, "STATUS_TRANSACTION_NO_RELEASE" }, { 0xC0000212, "STATUS_TRANSACTION_NO_MATCH" }, { 0xC0000213, "STATUS_TRANSACTION_RESPONDED" }, { 0xC0000214, "STATUS_TRANSACTION_INVALID_ID" }, { 0xC0000215, "STATUS_TRANSACTION_INVALID_TYPE" }, { 0xC0000216, "STATUS_NOT_SERVER_SESSION" }, { 0xC0000217, "STATUS_NOT_CLIENT_SESSION" }, { 0xC0000218, "STATUS_CANNOT_LOAD_REGISTRY_FILE" }, { 0xC0000219, "STATUS_DEBUG_ATTACH_FAILED" }, { 0xC000021A, "STATUS_SYSTEM_PROCESS_TERMINATED" }, { 0xC000021B, "STATUS_DATA_NOT_ACCEPTED" }, { 0xC000021C, "STATUS_NO_BROWSER_SERVERS_FOUND" }, { 0xC000021D, "STATUS_VDM_HARD_ERROR" }, { 0xC000021E, "STATUS_DRIVER_CANCEL_TIMEOUT" }, { 0xC000021F, "STATUS_REPLY_MESSAGE_MISMATCH" }, { 0xC0000220, "STATUS_MAPPED_ALIGNMENT" }, { 0xC0000221, "STATUS_IMAGE_CHECKSUM_MISMATCH" }, { 0xC0000222, "STATUS_LOST_WRITEBEHIND_DATA" }, { 0xC0000223, "STATUS_CLIENT_SERVER_PARAMETERS_INVALID" }, { 0xC0000224, "STATUS_PASSWORD_MUST_CHANGE" }, { 0xC0000225, "STATUS_NOT_FOUND" }, { 0xC0000226, "STATUS_NOT_TINY_STREAM" }, { 0xC0000227, "STATUS_RECOVERY_FAILURE" }, { 0xC0000228, "STATUS_STACK_OVERFLOW_READ" }, { 0xC0000229, "STATUS_FAIL_CHECK" }, { 0xC000022A, "STATUS_DUPLICATE_OBJECTID" }, { 0xC000022B, "STATUS_OBJECTID_EXISTS" }, { 0xC000022C, "STATUS_CONVERT_TO_LARGE" }, { 0xC000022D, "STATUS_RETRY" }, { 0xC000022E, "STATUS_FOUND_OUT_OF_SCOPE" }, { 0xC000022F, "STATUS_ALLOCATE_BUCKET" }, { 0xC0000230, "STATUS_PROPSET_NOT_FOUND" }, { 0xC0000231, "STATUS_MARSHALL_OVERFLOW" }, { 0xC0000232, "STATUS_INVALID_VARIANT" }, { 0xC0000233, "STATUS_DOMAIN_CONTROLLER_NOT_FOUND" }, { 0xC0000234, "STATUS_ACCOUNT_LOCKED_OUT" }, { 0xC0000235, "STATUS_HANDLE_NOT_CLOSABLE" }, { 0xC0000236, "STATUS_CONNECTION_REFUSED" }, { 0xC0000237, "STATUS_GRACEFUL_DISCONNECT" }, { 0xC0000238, "STATUS_ADDRESS_ALREADY_ASSOCIATED" }, { 0xC0000239, "STATUS_ADDRESS_NOT_ASSOCIATED" }, { 0xC000023A, "STATUS_CONNECTION_INVALID" }, { 0xC000023B, "STATUS_CONNECTION_ACTIVE" }, { 0xC000023C, "STATUS_NETWORK_UNREACHABLE" }, { 0xC000023D, "STATUS_HOST_UNREACHABLE" }, { 0xC000023E, "STATUS_PROTOCOL_UNREACHABLE" }, { 0xC000023F, "STATUS_PORT_UNREACHABLE" }, { 0xC0000240, "STATUS_REQUEST_ABORTED" }, { 0xC0000241, "STATUS_CONNECTION_ABORTED" }, { 0xC0000242, "STATUS_BAD_COMPRESSION_BUFFER" }, { 0xC0000243, "STATUS_USER_MAPPED_FILE" }, { 0xC0000244, "STATUS_AUDIT_FAILED" }, { 0xC0000245, "STATUS_TIMER_RESOLUTION_NOT_SET" }, { 0xC0000246, "STATUS_CONNECTION_COUNT_LIMIT" }, { 0xC0000247, "STATUS_LOGIN_TIME_RESTRICTION" }, { 0xC0000248, "STATUS_LOGIN_WKSTA_RESTRICTION" }, { 0xC0000249, "STATUS_IMAGE_MP_UP_MISMATCH" }, { 0xC0000250, "STATUS_INSUFFICIENT_LOGON_INFO" }, { 0xC0000251, "STATUS_BAD_DLL_ENTRYPOINT" }, { 0xC0000252, "STATUS_BAD_SERVICE_ENTRYPOINT" }, { 0xC0000253, "STATUS_LPC_REPLY_LOST" }, { 0xC0000254, "STATUS_IP_ADDRESS_CONFLICT1" }, { 0xC0000255, "STATUS_IP_ADDRESS_CONFLICT2" }, { 0xC0000256, "STATUS_REGISTRY_QUOTA_LIMIT" }, { 0xC0000257, "STATUS_PATH_NOT_COVERED" }, { 0xC0000258, "STATUS_NO_CALLBACK_ACTIVE" }, { 0xC0000259, "STATUS_LICENSE_QUOTA_EXCEEDED" }, { 0xC000025A, "STATUS_PWD_TOO_SHORT" }, { 0xC000025B, "STATUS_PWD_TOO_RECENT" }, { 0xC000025C, "STATUS_PWD_HISTORY_CONFLICT" }, { 0xC000025E, "STATUS_PLUGPLAY_NO_DEVICE" }, { 0xC000025F, "STATUS_UNSUPPORTED_COMPRESSION" }, { 0xC0000260, "STATUS_INVALID_HW_PROFILE" }, { 0xC0000261, "STATUS_INVALID_PLUGPLAY_DEVICE_PATH" }, { 0xC0000262, "STATUS_DRIVER_ORDINAL_NOT_FOUND" }, { 0xC0000263, "STATUS_DRIVER_ENTRYPOINT_NOT_FOUND" }, { 0xC0000264, "STATUS_RESOURCE_NOT_OWNED" }, { 0xC0000265, "STATUS_TOO_MANY_LINKS" }, { 0xC0000266, "STATUS_QUOTA_LIST_INCONSISTENT" }, { 0xC0000267, "STATUS_FILE_IS_OFFLINE" }, { 0xC0000268, "STATUS_EVALUATION_EXPIRATION" }, { 0xC0000269, "STATUS_ILLEGAL_DLL_RELOCATION" }, { 0xC000026A, "STATUS_LICENSE_VIOLATION" }, { 0xC000026B, "STATUS_DLL_INIT_FAILED_LOGOFF" }, { 0xC000026C, "STATUS_DRIVER_UNABLE_TO_LOAD" }, { 0xC000026D, "STATUS_DFS_UNAVAILABLE" }, { 0xC000026E, "STATUS_VOLUME_DISMOUNTED" }, { 0xC000026F, "STATUS_WX86_INTERNAL_ERROR" }, { 0xC0000270, "STATUS_WX86_FLOAT_STACK_CHECK" }, { 0xC0000271, "STATUS_VALIDATE_CONTINUE" }, { 0xC0000272, "STATUS_NO_MATCH" }, { 0xC0000273, "STATUS_NO_MORE_MATCHES" }, { 0xC0000275, "STATUS_NOT_A_REPARSE_POINT" }, { 0xC0000276, "STATUS_IO_REPARSE_TAG_INVALID" }, { 0xC0000277, "STATUS_IO_REPARSE_TAG_MISMATCH" }, { 0xC0000278, "STATUS_IO_REPARSE_DATA_INVALID" }, { 0xC0000279, "STATUS_IO_REPARSE_TAG_NOT_HANDLED" }, { 0xC0000280, "STATUS_REPARSE_POINT_NOT_RESOLVED" }, { 0xC0000281, "STATUS_DIRECTORY_IS_A_REPARSE_POINT" }, { 0xC0000282, "STATUS_RANGE_LIST_CONFLICT" }, { 0xC0000283, "STATUS_SOURCE_ELEMENT_EMPTY" }, { 0xC0000284, "STATUS_DESTINATION_ELEMENT_FULL" }, { 0xC0000285, "STATUS_ILLEGAL_ELEMENT_ADDRESS" }, { 0xC0000286, "STATUS_MAGAZINE_NOT_PRESENT" }, { 0xC0000287, "STATUS_REINITIALIZATION_NEEDED" }, { 0xC000028A, "STATUS_ENCRYPTION_FAILED" }, { 0xC000028B, "STATUS_DECRYPTION_FAILED" }, { 0xC000028C, "STATUS_RANGE_NOT_FOUND" }, { 0xC000028D, "STATUS_NO_RECOVERY_POLICY" }, { 0xC000028E, "STATUS_NO_EFS" }, { 0xC000028F, "STATUS_WRONG_EFS" }, { 0xC0000290, "STATUS_NO_USER_KEYS" }, { 0xC0000291, "STATUS_FILE_NOT_ENCRYPTED" }, { 0xC0000292, "STATUS_NOT_EXPORT_FORMAT" }, { 0xC0000293, "STATUS_FILE_ENCRYPTED" }, { 0xC0000295, "STATUS_WMI_GUID_NOT_FOUND" }, { 0xC0000296, "STATUS_WMI_INSTANCE_NOT_FOUND" }, { 0xC0000297, "STATUS_WMI_ITEMID_NOT_FOUND" }, { 0xC0000298, "STATUS_WMI_TRY_AGAIN" }, { 0xC0000299, "STATUS_SHARED_POLICY" }, { 0xC000029A, "STATUS_POLICY_OBJECT_NOT_FOUND" }, { 0xC000029B, "STATUS_POLICY_ONLY_IN_DS" }, { 0xC000029C, "STATUS_VOLUME_NOT_UPGRADED" }, { 0xC000029D, "STATUS_REMOTE_STORAGE_NOT_ACTIVE" }, { 0xC000029E, "STATUS_REMOTE_STORAGE_MEDIA_ERROR" }, { 0xC000029F, "STATUS_NO_TRACKING_SERVICE" }, { 0xC00002A0, "STATUS_SERVER_SID_MISMATCH" }, { 0xC00002A1, "STATUS_DS_NO_ATTRIBUTE_OR_VALUE" }, { 0xC00002A2, "STATUS_DS_INVALID_ATTRIBUTE_SYNTAX" }, { 0xC00002A3, "STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED" }, { 0xC00002A4, "STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS" }, { 0xC00002A5, "STATUS_DS_BUSY" }, { 0xC00002A6, "STATUS_DS_UNAVAILABLE" }, { 0xC00002A7, "STATUS_DS_NO_RIDS_ALLOCATED" }, { 0xC00002A8, "STATUS_DS_NO_MORE_RIDS" }, { 0xC00002A9, "STATUS_DS_INCORRECT_ROLE_OWNER" }, { 0xC00002AA, "STATUS_DS_RIDMGR_INIT_ERROR" }, { 0xC00002AB, "STATUS_DS_OBJ_CLASS_VIOLATION" }, { 0xC00002AC, "STATUS_DS_CANT_ON_NON_LEAF" }, { 0xC00002AD, "STATUS_DS_CANT_ON_RDN" }, { 0xC00002AE, "STATUS_DS_CANT_MOD_OBJ_CLASS" }, { 0xC00002AF, "STATUS_DS_CROSS_DOM_MOVE_FAILED" }, { 0xC00002B0, "STATUS_DS_GC_NOT_AVAILABLE" }, { 0xC00002B1, "STATUS_DIRECTORY_SERVICE_REQUIRED" }, { 0xC00002B2, "STATUS_REPARSE_ATTRIBUTE_CONFLICT" }, { 0xC00002B3, "STATUS_CANT_ENABLE_DENY_ONLY" }, { 0xC00002B4, "STATUS_FLOAT_MULTIPLE_FAULTS" }, { 0xC00002B5, "STATUS_FLOAT_MULTIPLE_TRAPS" }, { 0xC00002B6, "STATUS_DEVICE_REMOVED" }, { 0xC00002B7, "STATUS_JOURNAL_DELETE_IN_PROGRESS" }, { 0xC00002B8, "STATUS_JOURNAL_NOT_ACTIVE" }, { 0xC00002B9, "STATUS_NOINTERFACE" }, { 0xC00002C1, "STATUS_DS_ADMIN_LIMIT_EXCEEDED" }, { 0xC00002C2, "STATUS_DRIVER_FAILED_SLEEP" }, { 0xC00002C3, "STATUS_MUTUAL_AUTHENTICATION_FAILED" }, { 0xC00002C4, "STATUS_CORRUPT_SYSTEM_FILE" }, { 0xC00002C5, "STATUS_DATATYPE_MISALIGNMENT_ERROR" }, { 0xC00002C6, "STATUS_WMI_READ_ONLY" }, { 0xC00002C7, "STATUS_WMI_SET_FAILURE" }, { 0xC00002C8, "STATUS_COMMITMENT_MINIMUM" }, { 0xC00002C9, "STATUS_REG_NAT_CONSUMPTION" }, { 0xC00002CA, "STATUS_TRANSPORT_FULL" }, { 0xC00002CB, "STATUS_DS_SAM_INIT_FAILURE" }, { 0xC00002CC, "STATUS_ONLY_IF_CONNECTED" }, { 0xC00002CD, "STATUS_DS_SENSITIVE_GROUP_VIOLATION" }, { 0xC00002CE, "STATUS_PNP_RESTART_ENUMERATION" }, { 0xC00002CF, "STATUS_JOURNAL_ENTRY_DELETED" }, { 0xC00002D0, "STATUS_DS_CANT_MOD_PRIMARYGROUPID" }, { 0xC00002D1, "STATUS_SYSTEM_IMAGE_BAD_SIGNATURE" }, { 0xC00002D2, "STATUS_PNP_REBOOT_REQUIRED" }, { 0xC00002D3, "STATUS_POWER_STATE_INVALID" }, { 0xC00002D4, "STATUS_DS_INVALID_GROUP_TYPE" }, { 0xC00002D5, "STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN" }, { 0xC00002D6, "STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN" }, { 0xC00002D7, "STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER" }, { 0xC00002D8, "STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER" }, { 0xC00002D9, "STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER" }, { 0xC00002DA, "STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER" }, { 0xC00002DB, "STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER" }, { 0xC00002DC, "STATUS_DS_HAVE_PRIMARY_MEMBERS" }, { 0xC00002DD, "STATUS_WMI_NOT_SUPPORTED" }, { 0xC00002DE, "STATUS_INSUFFICIENT_POWER" }, { 0xC00002DF, "STATUS_SAM_NEED_BOOTKEY_PASSWORD" }, { 0xC00002E0, "STATUS_SAM_NEED_BOOTKEY_FLOPPY" }, { 0xC00002E1, "STATUS_DS_CANT_START" }, { 0xC00002E2, "STATUS_DS_INIT_FAILURE" }, { 0xC00002E3, "STATUS_SAM_INIT_FAILURE" }, { 0xC00002E4, "STATUS_DS_GC_REQUIRED" }, { 0xC00002E5, "STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY" }, { 0xC00002E6, "STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS" }, { 0xC00002E7, "STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED" }, { 0xC00002E8, "STATUS_MULTIPLE_FAULT_VIOLATION" }, { 0xC0000300, "STATUS_NOT_SUPPORTED_ON_SBS" }, { 0xC000035C, "STATUS_NETWORK_SESSION_EXPIRED" }, { 0xC0000463, "STATUS_DEVICE_FEATURE_NOT_SUPPORTED" }, { 0xC0000464, "STATUS_DEVICE_UNREACHABLE" }, { 0xC0000465, "STATUS_INVALID_TOKEN" }, { 0xC0009898, "STATUS_WOW_ASSERTION" }, { 0xC0020001, "RPC_NT_INVALID_STRING_BINDING" }, { 0xC0020002, "RPC_NT_WRONG_KIND_OF_BINDING" }, { 0xC0020003, "RPC_NT_INVALID_BINDING" }, { 0xC0020004, "RPC_NT_PROTSEQ_NOT_SUPPORTED" }, { 0xC0020005, "RPC_NT_INVALID_RPC_PROTSEQ" }, { 0xC0020006, "RPC_NT_INVALID_STRING_UUID" }, { 0xC0020007, "RPC_NT_INVALID_ENDPOINT_FORMAT" }, { 0xC0020008, "RPC_NT_INVALID_NET_ADDR" }, { 0xC0020009, "RPC_NT_NO_ENDPOINT_FOUND" }, { 0xC002000A, "RPC_NT_INVALID_TIMEOUT" }, { 0xC002000B, "RPC_NT_OBJECT_NOT_FOUND" }, { 0xC002000C, "RPC_NT_ALREADY_REGISTERED" }, { 0xC002000D, "RPC_NT_TYPE_ALREADY_REGISTERED" }, { 0xC002000E, "RPC_NT_ALREADY_LISTENING" }, { 0xC002000F, "RPC_NT_NO_PROTSEQS_REGISTERED" }, { 0xC0020010, "RPC_NT_NOT_LISTENING" }, { 0xC0020011, "RPC_NT_UNKNOWN_MGR_TYPE" }, { 0xC0020012, "RPC_NT_UNKNOWN_IF" }, { 0xC0020013, "RPC_NT_NO_BINDINGS" }, { 0xC0020014, "RPC_NT_NO_PROTSEQS" }, { 0xC0020015, "RPC_NT_CANT_CREATE_ENDPOINT" }, { 0xC0020016, "RPC_NT_OUT_OF_RESOURCES" }, { 0xC0020017, "RPC_NT_SERVER_UNAVAILABLE" }, { 0xC0020018, "RPC_NT_SERVER_TOO_BUSY" }, { 0xC0020019, "RPC_NT_INVALID_NETWORK_OPTIONS" }, { 0xC002001A, "RPC_NT_NO_CALL_ACTIVE" }, { 0xC002001B, "RPC_NT_CALL_FAILED" }, { 0xC002001C, "RPC_NT_CALL_FAILED_DNE" }, { 0xC002001D, "RPC_NT_PROTOCOL_ERROR" }, { 0xC002001F, "RPC_NT_UNSUPPORTED_TRANS_SYN" }, { 0xC0020021, "RPC_NT_UNSUPPORTED_TYPE" }, { 0xC0020022, "RPC_NT_INVALID_TAG" }, { 0xC0020023, "RPC_NT_INVALID_BOUND" }, { 0xC0020024, "RPC_NT_NO_ENTRY_NAME" }, { 0xC0020025, "RPC_NT_INVALID_NAME_SYNTAX" }, { 0xC0020026, "RPC_NT_UNSUPPORTED_NAME_SYNTAX" }, { 0xC0020028, "RPC_NT_UUID_NO_ADDRESS" }, { 0xC0020029, "RPC_NT_DUPLICATE_ENDPOINT" }, { 0xC002002A, "RPC_NT_UNKNOWN_AUTHN_TYPE" }, { 0xC002002B, "RPC_NT_MAX_CALLS_TOO_SMALL" }, { 0xC002002C, "RPC_NT_STRING_TOO_LONG" }, { 0xC002002D, "RPC_NT_PROTSEQ_NOT_FOUND" }, { 0xC002002E, "RPC_NT_PROCNUM_OUT_OF_RANGE" }, { 0xC002002F, "RPC_NT_BINDING_HAS_NO_AUTH" }, { 0xC0020030, "RPC_NT_UNKNOWN_AUTHN_SERVICE" }, { 0xC0020031, "RPC_NT_UNKNOWN_AUTHN_LEVEL" }, { 0xC0020032, "RPC_NT_INVALID_AUTH_IDENTITY" }, { 0xC0020033, "RPC_NT_UNKNOWN_AUTHZ_SERVICE" }, { 0xC0020034, "EPT_NT_INVALID_ENTRY" }, { 0xC0020035, "EPT_NT_CANT_PERFORM_OP" }, { 0xC0020036, "EPT_NT_NOT_REGISTERED" }, { 0xC0020037, "RPC_NT_NOTHING_TO_EXPORT" }, { 0xC0020038, "RPC_NT_INCOMPLETE_NAME" }, { 0xC0020039, "RPC_NT_INVALID_VERS_OPTION" }, { 0xC002003A, "RPC_NT_NO_MORE_MEMBERS" }, { 0xC002003B, "RPC_NT_NOT_ALL_OBJS_UNEXPORTED" }, { 0xC002003C, "RPC_NT_INTERFACE_NOT_FOUND" }, { 0xC002003D, "RPC_NT_ENTRY_ALREADY_EXISTS" }, { 0xC002003E, "RPC_NT_ENTRY_NOT_FOUND" }, { 0xC002003F, "RPC_NT_NAME_SERVICE_UNAVAILABLE" }, { 0xC0020040, "RPC_NT_INVALID_NAF_ID" }, { 0xC0020041, "RPC_NT_CANNOT_SUPPORT" }, { 0xC0020042, "RPC_NT_NO_CONTEXT_AVAILABLE" }, { 0xC0020043, "RPC_NT_INTERNAL_ERROR" }, { 0xC0020044, "RPC_NT_ZERO_DIVIDE" }, { 0xC0020045, "RPC_NT_ADDRESS_ERROR" }, { 0xC0020046, "RPC_NT_FP_DIV_ZERO" }, { 0xC0020047, "RPC_NT_FP_UNDERFLOW" }, { 0xC0020048, "RPC_NT_FP_OVERFLOW" }, { 0xC0020049, "RPC_NT_CALL_IN_PROGRESS" }, { 0xC002004A, "RPC_NT_NO_MORE_BINDINGS" }, { 0xC002004B, "RPC_NT_GROUP_MEMBER_NOT_FOUND" }, { 0xC002004C, "EPT_NT_CANT_CREATE" }, { 0xC002004D, "RPC_NT_INVALID_OBJECT" }, { 0xC002004F, "RPC_NT_NO_INTERFACES" }, { 0xC0020050, "RPC_NT_CALL_CANCELLED" }, { 0xC0020051, "RPC_NT_BINDING_INCOMPLETE" }, { 0xC0020052, "RPC_NT_COMM_FAILURE" }, { 0xC0020053, "RPC_NT_UNSUPPORTED_AUTHN_LEVEL" }, { 0xC0020054, "RPC_NT_NO_PRINC_NAME" }, { 0xC0020055, "RPC_NT_NOT_RPC_ERROR" }, { 0xC0020057, "RPC_NT_SEC_PKG_ERROR" }, { 0xC0020058, "RPC_NT_NOT_CANCELLED" }, { 0xC0021007, "RPC_P_RECEIVE_ALERTED" }, { 0xC0021008, "RPC_P_CONNECTION_CLOSED" }, { 0xC0021009, "RPC_P_RECEIVE_FAILED" }, { 0xC002100A, "RPC_P_SEND_FAILED" }, { 0xC002100B, "RPC_P_TIMEOUT" }, { 0xC002100C, "RPC_P_SERVER_TRANSPORT_ERROR" }, { 0xC002100E, "RPC_P_EXCEPTION_OCCURED" }, { 0xC0021012, "RPC_P_CONNECTION_SHUTDOWN" }, { 0xC0021015, "RPC_P_THREAD_LISTENING" }, { 0xC0030001, "RPC_NT_NO_MORE_ENTRIES" }, { 0xC0030002, "RPC_NT_SS_CHAR_TRANS_OPEN_FAIL" }, { 0xC0030003, "RPC_NT_SS_CHAR_TRANS_SHORT_FILE" }, { 0xC0030004, "RPC_NT_SS_IN_NULL_CONTEXT" }, { 0xC0030005, "RPC_NT_SS_CONTEXT_MISMATCH" }, { 0xC0030006, "RPC_NT_SS_CONTEXT_DAMAGED" }, { 0xC0030007, "RPC_NT_SS_HANDLES_MISMATCH" }, { 0xC0030008, "RPC_NT_SS_CANNOT_GET_CALL_HANDLE" }, { 0xC0030009, "RPC_NT_NULL_REF_POINTER" }, { 0xC003000A, "RPC_NT_ENUM_VALUE_OUT_OF_RANGE" }, { 0xC003000B, "RPC_NT_BYTE_COUNT_TOO_SMALL" }, { 0xC003000C, "RPC_NT_BAD_STUB_DATA" }, { 0xC0030059, "RPC_NT_INVALID_ES_ACTION" }, { 0xC003005A, "RPC_NT_WRONG_ES_VERSION" }, { 0xC003005B, "RPC_NT_WRONG_STUB_VERSION" }, { 0xC003005C, "RPC_NT_INVALID_PIPE_OBJECT" }, { 0xC003005D, "RPC_NT_INVALID_PIPE_OPERATION" }, { 0xC003005E, "RPC_NT_WRONG_PIPE_VERSION" }, { 0xC05C0000, "STATUS_SVHDX_ERROR_STORED" }, { 0xC05CFF00, "STATUS_SVHDX_ERROR_NOT_AVAILABLE" }, { 0xC05CFF01, "STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE" }, { 0xC05CFF02, "STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED" }, { 0xC05CFF03, "STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED" }, { 0xC05CFF04, "STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED" }, { 0xC05CFF05, "STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED" }, { 0xC05CFF06, "STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED" }, { 0xC05CFF07, "STATUS_SVHDX_RESERVATION_CONFLICT" }, { 0xC05CFF08, "STATUS_SVHDX_WRONG_FILE_TYPE" }, { 0xC05CFF09, "STATUS_SVHDX_VERSION_MISMATCH" }, { 0xC05CFF0A, "STATUS_VHD_SHARED" }, { 0, NULL } }; value_string_ext NT_errors_ext = VALUE_STRING_EXT_INIT(NT_errors); /* These are the MS country codes from https://web.archive.org/web/20081224015707/http://www.unicode.org/unicode/onlinedat/countries.html For countries that share the same number, I choose to use only the name of the largest country. Apologies for this. If this offends you, here is the table to change that. This also includes the code of 0 for "Default", which isn't in that list, but is in Microsoft's SDKs and the Cygnus "winnls.h" header file. Presumably it means "don't override the setting on the user's machine". Future versions of Microsoft's "winnls.h" header file might include additional codes; the current version matches the Unicode Consortium's table. */ static const value_string ms_country_codes[] = { { 0, "Default"}, { 1, "USA"}, { 2, "Canada"}, { 7, "Russia"}, { 20, "Egypt"}, { 27, "South Africa"}, { 30, "Greece"}, { 31, "Netherlands"}, { 32, "Belgium"}, { 33, "France"}, { 34, "Spain"}, { 36, "Hungary"}, { 39, "Italy"}, { 40, "Romania"}, { 41, "Switzerland"}, { 43, "Austria"}, { 44, "United Kingdom"}, { 45, "Denmark"}, { 46, "Sweden"}, { 47, "Norway"}, { 48, "Poland"}, { 49, "Germany"}, { 51, "Peru"}, { 52, "Mexico"}, { 54, "Argentina"}, { 55, "Brazil"}, { 56, "Chile"}, { 57, "Colombia"}, { 58, "Venezuela"}, { 60, "Malaysia"}, { 61, "Australia"}, { 62, "Indonesia"}, { 63, "Philippines"}, { 64, "New Zealand"}, { 65, "Singapore"}, { 66, "Thailand"}, { 81, "Japan"}, { 82, "South Korea"}, { 84, "Viet Nam"}, { 86, "China"}, { 90, "Turkey"}, { 91, "India"}, { 92, "Pakistan"}, {212, "Morocco"}, {213, "Algeria"}, {216, "Tunisia"}, {218, "Libya"}, {254, "Kenya"}, {263, "Zimbabwe"}, {298, "Faroe Islands"}, {351, "Portugal"}, {352, "Luxembourg"}, {353, "Ireland"}, {354, "Iceland"}, {355, "Albania"}, {358, "Finland"}, {359, "Bulgaria"}, {370, "Lithuania"}, {371, "Latvia"}, {372, "Estonia"}, {374, "Armenia"}, {375, "Belarus"}, {380, "Ukraine"}, {381, "Serbia"}, {385, "Croatia"}, {386, "Slovenia"}, {389, "Macedonia"}, {420, "Czech Republic"}, {421, "Slovak Republic"}, {501, "Belize"}, {502, "Guatemala"}, {503, "El Salvador"}, {504, "Honduras"}, {505, "Nicaragua"}, {506, "Costa Rica"}, {507, "Panama"}, {591, "Bolivia"}, {593, "Ecuador"}, {595, "Paraguay"}, {598, "Uruguay"}, {673, "Brunei Darussalam"}, {852, "Hong Kong"}, {853, "Macau"}, {886, "Taiwan"}, {960, "Maldives"}, {961, "Lebanon"}, {962, "Jordan"}, {963, "Syria"}, {964, "Iraq"}, {965, "Kuwait"}, {966, "Saudi Arabia"}, {967, "Yemen"}, {968, "Oman"}, {971, "United Arab Emirates"}, {972, "Israel"}, {973, "Bahrain"}, {974, "Qatar"}, {976, "Mongolia"}, {981, "Iran"}, {994, "Azerbaijan"}, {995, "Georgia"}, {996, "Kyrgyzstan"}, {0, NULL} }; value_string_ext ms_country_codes_ext = VALUE_STRING_EXT_INIT(ms_country_codes); /*module_t* module;*/ /*pref_t* sid_display_hex;*/ /* * Translate an 8-byte FILETIME value, given as the upper and lower 32 bits, * to an "nstime_t". * A FILETIME is a 64-bit integer, giving the time since Jan 1, 1601, * midnight "UTC", in 100ns units. * Return TRUE if the conversion succeeds, FALSE otherwise. * * According to the Samba code, it appears to be kludge-GMT (at least for * file listings). This means it's the GMT you get by taking a local time * and adding the server time zone offset. This is NOT the same as GMT in * some cases. However, we don't know the server time zone, so we don't * do that adjustment. * * This code is based on the Samba code: * * Unix SMB/Netbios implementation. * Version 1.9. * time handling functions * Copyright (C) Andrew Tridgell 1992-1998 */ static gboolean nt_time_to_nstime(guint32 filetime_high, guint32 filetime_low, nstime_t *tv, gboolean onesec_resolution) { guint64 d; if (filetime_high == 0) return FALSE; d = ((guint64)filetime_high << 32) | filetime_low; if (onesec_resolution) { d *= 10000000; } return filetime_to_nstime(tv, d); } int dissect_nt_64bit_time_opt(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date, gboolean onesec_resolution _U_) { return dissect_nt_64bit_time_ex(tvb, tree, offset, hf_date, NULL, FALSE); } int dissect_nt_64bit_time_ex(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date, proto_item **createdItem, gboolean onesec_resolution) { guint32 filetime_high, filetime_low; nstime_t ts; /* XXX there seems also to be another special time value which is fairly common : 0x40000000 00000000 the meaning of this one is yet unknown */ if (tree) { proto_item *item = NULL; filetime_low = tvb_get_letohl(tvb, offset); filetime_high = tvb_get_letohl(tvb, offset + 4); if (filetime_low == 0 && filetime_high == 0) { ts.secs = 0; ts.nsecs = 0; item = proto_tree_add_time_format_value(tree, hf_date, tvb, offset, 8, &ts, "No time specified (0)"); } else if(filetime_low==0 && filetime_high==0x80000000){ ts.secs = filetime_low; ts.nsecs = filetime_high; item = proto_tree_add_time_format_value(tree, hf_date, tvb, offset, 8, &ts, "Infinity (relative time)"); } else if(filetime_low==0xffffffff && filetime_high==0x7fffffff){ ts.secs = filetime_low; ts.nsecs = filetime_high; item = proto_tree_add_time_format_value(tree, hf_date, tvb, offset, 8, &ts, "Infinity (absolute time)"); } else { if (nt_time_to_nstime(filetime_high, filetime_low, &ts, onesec_resolution)) { proto_tree_add_time(tree, hf_date, tvb, offset, 8, &ts); } else { item = proto_tree_add_time_format_value(tree, hf_date, tvb, offset, 8, &ts, "Time can't be converted"); } } if (createdItem != NULL) { *createdItem = item; } } offset += 8; return offset; } int dissect_nt_64bit_time(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date) { return dissect_nt_64bit_time_opt(tvb, tree, offset, hf_date, FALSE); } /* Well-known SIDs defined in https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems */ static const sid_strings well_known_sids[] = { {"S-1-0", "Null Authority"}, {"S-1-0-0", "Nobody"}, {"S-1-1", "World Authority"}, {"S-1-1-0", "Everyone"}, {"S-1-2", "Local Authority"}, {"S-1-2-0", "Local"}, {"S-1-2-1", "Console Logon"}, {"S-1-3", "Creator Authority"}, {"S-1-3-0", "Creator Owner"}, {"S-1-3-1", "Creator Group"}, {"S-1-3-2", "Creator Owner Server"}, {"S-1-3-3", "Creator Group Server"}, {"S-1-3-4", "Owner Rights"}, {"S-1-4", "Non-unique Authority"}, {"S-1-5", "NT Authority"}, {"S-1-5-1", "Dialup"}, {"S-1-5-2", "Network"}, {"S-1-5-3", "Batch"}, {"S-1-5-4", "Interactive"}, {"S-1-5-5", "Logon Session"}, /* S-1-5-5-X-Y has 6 fields */ {"S-1-5-6", "Service"}, {"S-1-5-7", "Anonymous"}, {"S-1-5-8", "Proxy"}, {"S-1-5-9", "Enterprise Domain Controllers"}, {"S-1-5-10", "Principal Self"}, {"S-1-5-11", "Authenticated Users"}, {"S-1-5-12", "Restricted Code"}, {"S-1-5-13", "Terminal Server Users"}, {"S-1-5-14", "Remote Interactive Logon"}, {"S-1-5-15", "All users in this organization"}, {"S-1-5-17", "Default IIS user account"}, {"S-1-5-18", "Local System"}, {"S-1-5-19", "Local Service"}, {"S-1-5-20", "Network Service"}, /* * S-1-5-21-<d1>-<d2>-<d3>-<RID> where "<d1>-<d2>-<d3>" is the NT domain * RIDs are defined in 'wkwn_S_1_5_21_rids' */ {"S-1-5-21", "Domain SID"}, {"S-1-5-21-0-0-0-496", "Compounded Authentication"}, {"S-1-5-21-0-0-0-497", "Claims Valid"}, /* S-1-5-32-<RID>: Builtin local group SIDs */ {"S-1-5-32", "Local Group"}, {"S-1-5-32-544", "Administrators"}, {"S-1-5-32-545", "Users"}, {"S-1-5-32-546", "Guests"}, {"S-1-5-32-547", "Power Users"}, {"S-1-5-32-548", "Account Operators"}, {"S-1-5-32-549", "Server Operators"}, {"S-1-5-32-550", "Print Operators"}, {"S-1-5-32-551", "Backup Operators"}, {"S-1-5-32-552", "Replicators"}, {"S-1-5-32-554", "Pre-Windows 2000 Compatible Access"}, {"S-1-5-32-555", "Remote Desktop Users"}, {"S-1-5-32-556", "Network Configuration Operators"}, {"S-1-5-32-557", "Incoming Forest Trust Builders"}, {"S-1-5-32-558", "Performance Monitor Users"}, {"S-1-5-32-559", "Performance Log Users"}, {"S-1-5-32-560", "Windows Authorization Access Group"}, {"S-1-5-32-561", "Terminal Server License Servers"}, {"S-1-5-32-562", "Distributed COM Users"}, {"S-1-5-32-568", "IIS Users"}, {"S-1-5-32-569", "Cryptographic Operators"}, {"S-1-5-32-573", "Event Log Readers"}, {"S-1-5-32-574", "Certificate Service DCOM Access"}, {"S-1-5-32-575", "RDS Remote Access Servers"}, {"S-1-5-32-576", "RDS Endpoint Servers"}, {"S-1-5-32-577", "RDS Management Servers"}, {"S-1-5-32-578", "Hyper-V Admins"}, {"S-1-5-32-579", "Access Control Assistance Operators"}, {"S-1-5-32-580", "Remote Management Users"}, {"S-1-5-33", "Write Restricted Code"}, {"S-1-5-64", "Authentication"}, {"S-1-5-64-10", "NTLM"}, {"S-1-5-64-14", "SChannel"}, {"S-1-5-64-21", "Digest"}, {"S-1-5-80", "NT Service"}, {"S-1-5-84-0-0-0-0-0", "User Mode Drivers"}, {"S-1-5-113", "Local Account"}, {"S-1-5-114", "Local Administrator Account"}, {"S-1-5-1000", "Other Organisation"}, {"S-1-15-2-1", "All App Packages"}, {"S-1-16", "Mandatory Level"}, {"S-1-16-0", "Untrusted"}, {"S-1-16-4096", "Low"}, {"S-1-16-8192", "Medium"}, {"S-1-16-8448", "Medium Plus"}, {"S-1-16-12288", "High"}, {"S-1-16-16384", "System"}, {"S-1-16-20480", "Protected Process"}, {"S-1-16-28672", "Secure Process"}, {"S-1-18-1", "Authentication Authority Asserted Identity"}, {"S-1-18-2", "Service Asserted Identity"}, {"S-1-18-3", "Fresh Public Key Identity"}, {"S-1-18-4", "Key Trust Identity"}, {"S-1-18-5", "Key Property Multifactor Authentication"}, {"S-1-18-6", "Key Property Attestation"}, {NULL, NULL} }; static const char* match_wkwn_sids(const char* sid) { int i = 0; while (well_known_sids[i].name) { if (strcmp(well_known_sids[i].sid, sid)==0) { return(well_known_sids[i].name); } i++; } return NULL; } /* For SIDs in the form 'S-1-5-21-X-Y-Z-<RID>', '21-X-Y-Z' is referred to as the "domain SID" (NT domain) or "machine SID" (local machine). The following are well-known RIDs which are appended to domain/machine SIDs as defined in https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems */ static const value_string wkwn_S_1_5_21_rids[] = { {498, "Enterprise Read-only Domain Controllers"}, {500, "Administrator"}, {501, "Guest"}, {502, "KRBTGT"}, {512, "Domain Admins"}, {513, "Domain Users"}, {514, "Domain Guests"}, {515, "Domain Computers"}, {516, "Domain Controllers"}, {517, "Cert Publishers"}, {518, "Schema Administrators"}, {519, "Enterprise Admins"}, {520, "Group Policy Creator Owners"}, {521, "Read-only Domain Controllers"}, {553, "RAS and IAS Servers"}, {571, "Allowed RODC Password Replication Group"}, {572, "Denied RODC Password Replication Group"}, {0, NULL} }; static value_string_ext wkwn_S_1_5_21_rids_ext = VALUE_STRING_EXT_INIT(wkwn_S_1_5_21_rids); /* Dissect an NT SID. Label it with 'name' and return a string version * of the SID in the 'sid_str' parameter which has a packet lifetime * scope and should NOT be freed by the caller. hf_sid can be -1 if * the caller doesn't care what name is used and then "nt.sid" will be * the default instead. If the caller wants a more appropriate hf * field, it will just pass a FT_STRING hf field here */ int dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const char *name, char **sid_str, int hf_sid) { int offset_sid_start = offset, sa_offset, rid_offset=0, wkwn_sid1_len=0, wkwn_sid2_len = 0, i; guint8 revision, num_auth; guint32 sa_field, rid=0; guint64 authority=0; wmem_strbuf_t *sa_str = NULL, *sid_in_dec_str = NULL, *sid_in_hex_str = NULL, *label_str = NULL, *domain_str = NULL, *wkwn_sid1_str = NULL, *wkwn_sid2_str = NULL; const char *mapped_name = NULL, *mapped_rid = NULL; gboolean domain_sid = FALSE, s_1_5_32 = FALSE, s_1_5_64 = FALSE, locally_defined = FALSE, S_1_16 = FALSE; proto_item *item = NULL, *hidden_item; proto_tree *subtree = NULL; /* Revision of SID */ revision = tvb_get_guint8(tvb, offset); offset++; /* Number of subauthority fields */ num_auth = tvb_get_guint8(tvb, offset); offset++; if(sid_str) *sid_str=NULL; if(hf_sid==-1){ /* if no tree, just return the offset of the end_of_SID+1 */ if (!parent_tree) return(offset+(6+(num_auth*4))); hf_sid=hf_nt_sid; } /* Identifier Authority */ for(i=0; i<6; i++){ authority = (authority << 8) + tvb_get_guint8(tvb, offset); offset++; } sid_in_dec_str = wmem_strbuf_create(wmem_packet_scope()); wmem_strbuf_append_printf (sid_in_dec_str, "S-%u-%" PRIu64, revision, authority); /* If sid_display_hex is set, sid_in_dec_str is still needed for looking up well-known SIDs*/ if (sid_display_hex) { sid_in_hex_str = wmem_strbuf_create(wmem_packet_scope()); wmem_strbuf_append_printf (sid_in_hex_str, "S-%x-%" PRIx64, revision, authority); } wkwn_sid1_str = wmem_strbuf_create(wmem_packet_scope()); label_str = wmem_strbuf_create(wmem_packet_scope()); if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-16")==0) S_1_16 = TRUE; /* Check for Scoped Policy ID (S-1-17-<subauth1>...) */ if (authority == 17) { mapped_name = "Central Access Policy"; } /* Look for well-known SIDs in format 'S-1-<Identifier Authority>' (i.e., exactly 3 fields) */ if (num_auth==0 || S_1_16 || mapped_name) { if (!mapped_name) mapped_name = match_wkwn_sids(wmem_strbuf_get_str(sid_in_dec_str)); if (mapped_name) { wmem_strbuf_append(label_str, mapped_name); wmem_strbuf_append(wkwn_sid1_str, (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str))); wkwn_sid1_len = 8; } } sa_offset = offset; sa_str = wmem_strbuf_create(wmem_packet_scope()); wkwn_sid2_str = wmem_strbuf_create(wmem_packet_scope()); domain_str = wmem_strbuf_create(wmem_packet_scope()); /* Build the sub-authorities and full SID strings */ for(i=1; i<num_auth+1; i++) { /* * XXX should not be letohl but native byteorder according to * Samba header files. * * However, considering that there were never any NT ports * to big-endian platforms (PowerPC and MIPS ran little-endian, * and IA-64 runs little-endian, as does x86-64), we can (?) * assume that non le byte encodings will be "uncommon"? */ sa_field = tvb_get_letohl(tvb, offset); wmem_strbuf_append_printf(sid_in_dec_str, "-%u", sa_field); wmem_strbuf_append_printf(sa_str, (i==1 ? (sid_display_hex ? "%x" : "%u") : (sid_display_hex ? "-%x" : "-%u")), sa_field); if (sid_display_hex) wmem_strbuf_append_printf(sid_in_hex_str, "-%x", sa_field); if (i==1) { /* Look for well-known SIDs at level one ("S-1-<authority>-<value>") */ if (S_1_16) { /* Mandatory Level (S-1-16) */ mapped_rid = match_wkwn_sids(wmem_strbuf_get_str(sid_in_dec_str)); if (mapped_rid) { /* Get the RID */ wmem_strbuf_append_printf(label_str, "%s-%s", mapped_name, mapped_rid); rid = sa_field; rid_offset = offset; wmem_strbuf_append(wkwn_sid2_str, (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str))); wkwn_sid1_len=12; } } else { mapped_name = match_wkwn_sids(wmem_strbuf_get_str(sid_in_dec_str)); if (mapped_name) { wmem_strbuf_append(label_str, mapped_name); wmem_strbuf_append(wkwn_sid1_str, (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str))); wkwn_sid1_len = 12; } /* The following three SID types have (unique) RIDs */ if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-5-21")==0) { /* Domain SID */ domain_sid = TRUE; } else if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-5-32")==0) { /* Local Group (S-1-5-32) SID */ s_1_5_32 = TRUE; } else if (strcmp(wmem_strbuf_get_str(sid_in_dec_str), "S-1-5-64")==0) { /* Authentication (S-1-5-64) SID */ s_1_5_64 = TRUE; } } } else if (i==2 && !domain_sid) { /* The only well-known SIDS with two subauthority fields ("level 2 SIDs") are Local Group (S-1-5-32), and Authentication (S-1-5-64). */ if (s_1_5_32 || s_1_5_64) { mapped_rid = match_wkwn_sids(wmem_strbuf_get_str(sid_in_dec_str)); if (mapped_rid) { /* Get the RID */ wmem_strbuf_append_printf(label_str, "-%s", mapped_rid); rid = sa_field; rid_offset = offset; wmem_strbuf_append(wkwn_sid2_str, (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str))); wkwn_sid2_len=16; } else { /* The RID not well-known. */ locally_defined = TRUE; } } else { if (mapped_name) { /* A level 1 well-known SID appended with locally defined value */ locally_defined = TRUE; } } } else { /* 3 or more sub-auth fields - NOTE: Except for domain SIDs, there are no wkwn SIDs with 3 or more sub-auth fields so we don't lookup SIDs here. Logon Session SIDs have 3 sub-auth fields but the last two are locally defined. */ if (domain_sid) { if (num_auth >= 4) { if (i >= 2 && i <=4 ) { /* Add the field to the domain string (d1-d2-d3) */ wmem_strbuf_append_printf(domain_str, (i==2 ? (sid_display_hex ? "%x" : "%u") : (sid_display_hex ? "-%x" : "-%u")), sa_field); } else if (i==5) { rid = sa_field; rid_offset = offset; mapped_rid = val_to_str_ext_const(rid, &wkwn_S_1_5_21_rids_ext, "Domain RID"); wmem_strbuf_append_printf(label_str, "-%s", mapped_rid); } else { locally_defined = TRUE; } } else { mapped_name = "Corrupt domain SID"; } } else { if (mapped_name) { /* A locally defined value appended to a level 2 well-known SID*/ locally_defined = TRUE; } } } offset+=4; } /* End of for loop */ if ( !(mapped_name || domain_sid || s_1_5_32 || s_1_5_64) ) { /* If requested, try to map the NON-well-known SID to an object name discovered in this capture */ if (sid_name_snooping) { mapped_name = find_sid_name(wmem_strbuf_get_str(sid_in_dec_str)); } else { mapped_name = "<Unknown SID type>"; } } if (locally_defined) { wmem_strbuf_append_printf(label_str, "-<locally defined>"); } /* It's tree time Display the full SID string in hex or dec */ item = proto_tree_add_string_format( parent_tree, hf_sid, tvb, offset_sid_start, (offset - offset_sid_start), (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str)), "%s: %s", name, (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str)) ); if (wmem_strbuf_get_len(label_str) > 0) { proto_item_append_text(item, " (%s)", wmem_strbuf_get_str(label_str)); } subtree = proto_item_add_subtree(item, ett_nt_sid); /* Add revision, num_auth, and authority */ proto_tree_add_item(subtree, hf_nt_sid_revision, tvb, offset_sid_start, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_nt_sid_num_auth, tvb, offset_sid_start+1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_uint64(subtree, (sid_display_hex ? hf_nt_sid_auth_hex : hf_nt_sid_auth_dec), tvb, offset_sid_start+2, 6, authority); /* Add subauthorities */ proto_tree_add_string_format_value(subtree, hf_nt_sid_subauth, tvb, sa_offset, num_auth*4, wmem_strbuf_get_str(sa_str), "%s", wmem_strbuf_get_str(sa_str)); if (rid) { item = proto_tree_add_item (subtree, (sid_display_hex ? hf_nt_sid_rid_hex : hf_nt_sid_rid_dec), tvb, rid_offset, 4, ENC_LITTLE_ENDIAN); if (mapped_rid) proto_item_append_text(item, " (%s)", mapped_rid); } /* Add well-known SID and domain strings if present */ if (wmem_strbuf_get_len(wkwn_sid1_str) > 0) { hidden_item = proto_tree_add_string_format_value( subtree, hf_nt_sid_wkwn, tvb, offset_sid_start, wkwn_sid1_len, wmem_strbuf_get_str(wkwn_sid1_str), "%s", wmem_strbuf_get_str(wkwn_sid1_str)); if (mapped_name) { proto_item_append_text(hidden_item, " (%s)", mapped_name); } proto_item_set_hidden(hidden_item); } if (wmem_strbuf_get_len(wkwn_sid2_str) > 0) { hidden_item = proto_tree_add_string_format_value( subtree, hf_nt_sid_wkwn, tvb, offset_sid_start, wkwn_sid2_len, wmem_strbuf_get_str(wkwn_sid2_str), "%s", wmem_strbuf_get_str(wkwn_sid2_str)); if (wmem_strbuf_get_len(label_str) > 0) { proto_item_append_text(hidden_item, " (%s)", wmem_strbuf_get_str(label_str)); } proto_item_set_hidden(hidden_item); } if (domain_sid && wmem_strbuf_get_len(domain_str) > 0) { hidden_item = proto_tree_add_string_format_value( subtree, hf_nt_sid_domain, tvb, offset_sid_start + 12, 12, wmem_strbuf_get_str(domain_str), "%s", wmem_strbuf_get_str(domain_str)); proto_item_set_hidden(hidden_item); } /* If requested, return SID string with mapped name */ if(sid_str){ if(wmem_strbuf_get_len(label_str) > 0){ *sid_str = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", (sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str)), wmem_strbuf_get_str(label_str)); } else { *sid_str = wmem_strdup(wmem_packet_scope(), sid_display_hex ? wmem_strbuf_get_str(sid_in_hex_str) : wmem_strbuf_get_str(sid_in_dec_str)); } if(!(*sid_str)){ *sid_str=wmem_strdup(wmem_packet_scope(), "corrupted SID"); } } return offset; } /* Dissect SYSTEM_RESOURCE_ATTRIBUTE_ACE Value, see [MS-DTYP] v20180912 section 2.4.4.15 */ static int dissect_nt_ace_system_resource_attribute_value(tvbuff_t *tvb, int value_offset, proto_tree *tree, guint16 value_type, proto_item *sra_item) { guint value_len; guint32 blob_len; proto_item *value_item = NULL; char *value_str = NULL; /* packet scope, do not free */ gboolean quote = FALSE; switch (value_type) { case CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64: value_len = sizeof(gint64); value_item = proto_tree_add_item(tree, hf_nt_ace_sra_value_int64, tvb, value_offset, value_len, ENC_LITTLE_ENDIAN); value_offset += value_len; break; case CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64: value_len = sizeof(guint64); value_item = proto_tree_add_item(tree, hf_nt_ace_sra_value_uint64, tvb, value_offset, value_len, ENC_LITTLE_ENDIAN); value_offset += value_len; break; case CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING: value_len = tvb_unicode_strsize(tvb, value_offset); value_item = proto_tree_add_item(tree, hf_nt_ace_sra_value_string, tvb, value_offset, value_len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); quote = TRUE; value_offset += value_len; break; case CLAIM_SECURITY_ATTRIBUTE_TYPE_SID: value_offset = dissect_nt_sid(tvb, value_offset, tree, "SID", &value_str, hf_nt_ace_sra_value_sid); break; case CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN: value_len = sizeof(guint64); value_item = proto_tree_add_item(tree, hf_nt_ace_sra_value_boolean, tvb, value_offset, value_len, ENC_LITTLE_ENDIAN); value_offset += value_len; break; case CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING: blob_len = tvb_get_letohl(tvb, value_offset); value_offset += sizeof(blob_len); value_item = proto_tree_add_item(tree, hf_nt_ace_sra_value_octet_string, tvb, value_offset, blob_len, ENC_NA); /* do not append binary to sra_item */ value_str = "<bin>"; value_offset += blob_len; break; default: break; } if (sra_item) { if ((value_str == NULL) && value_item) { value_str = proto_item_get_display_repr(wmem_packet_scope(), value_item); } if (value_str == NULL) { /* missing system resource attribute value */ value_str = "???"; } if (value_str) { proto_item_append_text(sra_item, (quote) ? "\"%s\"" : "%s", value_str); } } return value_offset; } /* Dissect SYSTEM_RESOURCE_ATTRIBUTE_ACE, see [MS-DTYP] v20180912 section 2.4.4.15 */ static int dissect_nt_ace_system_resource_attribute(tvbuff_t *tvb, int offset, guint16 size, proto_tree *parent_tree) { /* The caller has already dissected Header, Mask and Sid. Therefore this function only dissects Attribute Data. This data takes the form of a CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1. The following code dissects the structure piecemeal */ int start_offset = offset; guint32 name; /* offset, relative to start_offset */ guint16 value_type; guint32 value_count; /* Add a subtree to hold the system resource attribute details */ proto_item *sra_item; proto_tree *sra_tree; sra_item = proto_tree_add_item(parent_tree, hf_nt_ace_sra, tvb, offset, size, ENC_NA); sra_tree = proto_item_add_subtree(sra_item, ett_nt_ace_sra); /* Name offset */ name = tvb_get_letohl(tvb, offset); proto_tree_add_uint(sra_tree, hf_nt_ace_sra_name_offset, tvb, offset, sizeof(name), name); int name_offset = (start_offset + name); guint name_len = tvb_unicode_strsize(tvb, name_offset); proto_item *name_item; name_item = proto_tree_add_item(sra_tree, hf_nt_ace_sra_name, tvb, name_offset, name_len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); proto_item_append_text(sra_item, ": %s=", proto_item_get_display_repr(wmem_packet_scope(), name_item)); offset += sizeof(name); /* ValueType */ value_type = tvb_get_letohs(tvb, offset); proto_tree_add_uint(sra_tree, hf_nt_ace_sra_type, tvb, offset, sizeof(value_type), value_type); offset += sizeof(value_type); /* Reserved */ proto_tree_add_item(sra_tree, hf_nt_ace_sra_reserved, tvb, offset, sizeof(guint16), ENC_LITTLE_ENDIAN); offset += sizeof(guint16); /* Flags */ static int * const flags[] = { &hf_nt_ace_sra_flags_policy_derived, &hf_nt_ace_sra_flags_manual, &hf_nt_ace_sra_flags_mandatory, &hf_nt_ace_sra_flags_disabled, &hf_nt_ace_sra_flags_disabled_by_default, &hf_nt_ace_sra_flags_deny_only, &hf_nt_ace_sra_flags_case_sensitive, &hf_nt_ace_sra_flags_non_inheritable, NULL }; proto_tree_add_bitmask(sra_tree, tvb, offset, hf_nt_ace_sra_flags, ett_nt_ace_sra_flags, flags, ENC_LITTLE_ENDIAN); offset += sizeof(guint32); /* ValueCount */ value_count = tvb_get_letohl(tvb, offset); proto_tree_add_uint(sra_tree, hf_nt_ace_sra_value_count, tvb, offset, sizeof(value_count), value_count); offset += sizeof(value_count); /* Value Offsets and Values */ guint32 value_offset; proto_tree *value_offset_tree = sra_tree; proto_tree *value_tree = sra_tree; if (value_count > 1) { /* Use independent value offset and value trees when there are multiple values. */ int value_offset_tree_offset = offset; int value_offset_tree_len = value_count * sizeof(value_offset); value_offset_tree = proto_tree_add_subtree(sra_tree, tvb, value_offset_tree_offset, value_offset_tree_len, ett_nt_ace_sra_value_offsets, NULL, "Value Offsets"); /* The range associated with the value tree will include some non-value data (but that's fine as the value items it contains will have accurate ranges) */ int value_tree_offset = value_offset_tree_offset + value_offset_tree_len; int value_tree_len = (start_offset + size) - value_tree_offset; value_tree = proto_tree_add_subtree(sra_tree, tvb, value_tree_offset, value_tree_len, ett_nt_ace_sra_values, NULL, "Values"); } proto_item_append_text(sra_item, "{"); for (guint32 i = 0; i < value_count; ++i) { if (i) { proto_item_append_text(sra_item, ", "); } value_offset = tvb_get_letohl(tvb, offset); proto_tree_add_uint(value_offset_tree, hf_nt_ace_sra_value_offset, tvb, offset, sizeof(value_offset), value_offset); dissect_nt_ace_system_resource_attribute_value(tvb, start_offset + value_offset, value_tree, value_type, sra_item); offset += sizeof(value_offset); } proto_item_append_text(sra_item, "}"); return start_offset + size; } /* Dissect Condition ACE token, see [MS-DTYP] v20180912 section 2.4.4.17.4 */ static int dissect_nt_conditional_ace_token(tvbuff_t *tvb, int offset, guint16 size, proto_tree *parent_tree) { int start_offset = offset; proto_tree *tree = parent_tree; proto_item *item = NULL; guint8 token = tvb_get_guint8(tvb, offset); guint32 len; item = proto_tree_add_uint(tree, hf_nt_ace_cond_token, tvb, offset, sizeof(token), token); if (ace_cond_token_has_data(token)) { tree = proto_item_add_subtree(item, ett_nt_ace_cond_data); } offset += sizeof(token); switch (token) { case COND_ACE_TOKEN_INT8: proto_tree_add_item(tree, hf_nt_ace_cond_value_int8, tvb, offset, sizeof(guint64), ENC_LITTLE_ENDIAN); offset += sizeof(guint64); proto_tree_add_item(tree, hf_nt_ace_cond_sign, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); proto_tree_add_item(tree, hf_nt_ace_cond_base, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); break; case COND_ACE_TOKEN_INT16: proto_tree_add_item(tree, hf_nt_ace_cond_value_int16, tvb, offset, sizeof(guint64), ENC_LITTLE_ENDIAN); offset += sizeof(guint64); proto_tree_add_item(tree, hf_nt_ace_cond_sign, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); proto_tree_add_item(tree, hf_nt_ace_cond_base, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); break; case COND_ACE_TOKEN_INT32: proto_tree_add_item(tree, hf_nt_ace_cond_value_int32, tvb, offset, sizeof(guint64), ENC_LITTLE_ENDIAN); offset += sizeof(guint64); proto_tree_add_item(tree, hf_nt_ace_cond_sign, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); proto_tree_add_item(tree, hf_nt_ace_cond_base, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); break; case COND_ACE_TOKEN_INT64: proto_tree_add_item(tree, hf_nt_ace_cond_value_int64, tvb, offset, sizeof(guint64), ENC_LITTLE_ENDIAN); offset += sizeof(guint64); proto_tree_add_item(tree, hf_nt_ace_cond_sign, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); proto_tree_add_item(tree, hf_nt_ace_cond_base, tvb, offset, sizeof(guint8), ENC_LITTLE_ENDIAN); offset += sizeof(guint8); break; case COND_ACE_TOKEN_UNICODE_STRING: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_value_string, tvb, offset, len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len; break; case COND_ACE_TOKEN_OCTET_STRING: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_value_octet_string, tvb, offset, len, ENC_NA); offset += len; break; case COND_ACE_TOKEN_COMPOSITE: /* Create another tree for composite */ len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); if (len) { int remaining = size - (offset - start_offset); if (remaining >= (int)len) { int end_offset = offset + len; while (offset < end_offset) offset = dissect_nt_conditional_ace_token(tvb, offset, remaining, tree); } else { /* malformed: composite len is longer * than the remaining data in the ace */ offset += remaining; } } break; case COND_ACE_TOKEN_SID: offset += sizeof(len); offset = dissect_nt_sid(tvb, offset, tree, "SID", NULL, -1); break; case COND_ACE_TOKEN_LOCAL_ATTRIBUTE: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_local_attr, tvb, offset, len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len; break; case COND_ACE_TOKEN_USER_ATTRIBUTE: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_user_attr, tvb, offset, len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len; break; case COND_ACE_TOKEN_RESOURCE_ATTRIBUTE: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_resource_attr, tvb, offset, len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len; break; case COND_ACE_TOKEN_DEVICE_ATTRIBUTE: len = tvb_get_letohl(tvb, offset); /* in bytes */ offset += sizeof(len); proto_tree_add_item(tree, hf_nt_ace_cond_device_attr, tvb, offset, len, ENC_UTF_16 | ENC_LITTLE_ENDIAN); offset += len; break; default: DISSECTOR_ASSERT(!ace_cond_token_has_data(token)); break; } proto_item_set_len(item, offset - start_offset); return offset; } /* Dissect Conditional ACE (if present), see [MS-DTYP] v20180912 section 2.4.4.17.4 */ static int dissect_nt_conditional_ace(tvbuff_t *tvb, int offset, guint16 size, proto_tree *parent_tree) { int start_offset = offset; /* Conditional ACE Application Data starts with "artx" */ if (size >= 4) { const guint32 artx = 0x78747261; /* "xtra" (LE) */ guint32 prefix = tvb_get_letohl(tvb, offset); offset += sizeof(prefix); if (prefix == artx) { /* Add a subtree to hold the condition expression tokens */ proto_item *item = NULL; item = proto_tree_add_item(parent_tree, hf_nt_ace_cond, tvb, start_offset, size, ENC_NA); parent_tree = proto_item_add_subtree(item, ett_nt_ace_cond); /* Add the tokens to the subtree */ int remaining; while (TRUE) { remaining = size - (offset - start_offset); if (remaining <= 0) break; offset = dissect_nt_conditional_ace_token(tvb, offset, remaining, parent_tree); } } } return start_offset + size; } /* Dissect an access mask. All this stuff is kind of explained at https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask-format */ static gint ett_nt_access_mask = -1; static gint ett_nt_access_mask_generic = -1; static gint ett_nt_access_mask_standard = -1; static gint ett_nt_access_mask_specific = -1; static int hf_access_sacl = -1; static int hf_access_maximum_allowed = -1; static int hf_access_generic_read = -1; static int hf_access_generic_write = -1; static int hf_access_generic_execute = -1; static int hf_access_generic_all = -1; static int hf_access_standard_delete = -1; static int hf_access_standard_read_control = -1; static int hf_access_standard_synchronise = -1; static int hf_access_standard_write_dac = -1; static int hf_access_standard_write_owner = -1; static int hf_access_specific_15 = -1; static int hf_access_specific_14 = -1; static int hf_access_specific_13 = -1; static int hf_access_specific_12 = -1; static int hf_access_specific_11 = -1; static int hf_access_specific_10 = -1; static int hf_access_specific_9 = -1; static int hf_access_specific_8 = -1; static int hf_access_specific_7 = -1; static int hf_access_specific_6 = -1; static int hf_access_specific_5 = -1; static int hf_access_specific_4 = -1; static int hf_access_specific_3 = -1; static int hf_access_specific_2 = -1; static int hf_access_specific_1 = -1; static int hf_access_specific_0 = -1; /* Map generic permissions to specific permissions */ static void map_generic_access(guint32 *access_mask, struct generic_mapping *mapping) { if (*access_mask & GENERIC_READ_ACCESS) { *access_mask &= ~GENERIC_READ_ACCESS; *access_mask |= mapping->generic_read; } if (*access_mask & GENERIC_WRITE_ACCESS) { *access_mask &= ~GENERIC_WRITE_ACCESS; *access_mask |= mapping->generic_write; } if (*access_mask & GENERIC_EXECUTE_ACCESS) { *access_mask &= ~GENERIC_EXECUTE_ACCESS; *access_mask |= mapping->generic_execute; } if (*access_mask & GENERIC_ALL_ACCESS) { *access_mask &= ~GENERIC_ALL_ACCESS; *access_mask |= mapping->generic_all; } } /* Map standard permissions to specific permissions */ static void map_standard_access(guint32 *access_mask, struct standard_mapping *mapping) { if (*access_mask & READ_CONTROL_ACCESS) { *access_mask &= ~READ_CONTROL_ACCESS; *access_mask |= mapping->std_read; } if (*access_mask & (DELETE_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS| SYNCHRONIZE_ACCESS)) { *access_mask &= ~(DELETE_ACCESS|WRITE_DAC_ACCESS| WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS); *access_mask |= mapping->std_all; } } int dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep, int hfindex, struct access_mask_info *ami, guint32 *perms) { proto_item *item; proto_tree *subtree, *generic_tree, *standard_tree, *specific_tree; guint32 access; static int * const generic_access_flags[] = { &hf_access_generic_read, &hf_access_generic_write, &hf_access_generic_execute, &hf_access_generic_all, &hf_access_maximum_allowed, &hf_access_sacl, NULL }; static int * const standard_access_flags[] = { &hf_access_standard_synchronise, &hf_access_standard_write_owner, &hf_access_standard_write_dac, &hf_access_standard_read_control, &hf_access_standard_delete, NULL }; static int * const access_specific_flags[] = { &hf_access_specific_15, &hf_access_specific_14, &hf_access_specific_13, &hf_access_specific_12, &hf_access_specific_11, &hf_access_specific_10, &hf_access_specific_9, &hf_access_specific_8, &hf_access_specific_7, &hf_access_specific_6, &hf_access_specific_5, &hf_access_specific_4, &hf_access_specific_3, &hf_access_specific_2, &hf_access_specific_1, &hf_access_specific_0, NULL }; if (drep != NULL) { /* * Called from a DCE RPC protocol dissector, for a * protocol where a 32-bit NDR integer contains * an NT access mask; extract the access mask * with an NDR call. */ offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, di, drep, hfindex, &access); } else { /* * Called from SMB, where the access mask is just a * 4-byte little-endian quantity with no special * NDR alignment requirement; extract it with * "tvb_get_letohl()". */ access = tvb_get_letohl(tvb, offset); offset += 4; } if (perms) { *perms = access; } item = proto_tree_add_uint(tree, hfindex, tvb, offset - 4, 4, access); subtree = proto_item_add_subtree(item, ett_nt_access_mask); /* Generic access rights */ generic_tree = proto_tree_add_subtree_format(subtree, tvb, offset - 4, 4, ett_nt_access_mask_generic, NULL, "Generic rights: 0x%08x", access & GENERIC_RIGHTS_MASK); proto_tree_add_bitmask_list_value(generic_tree, tvb, offset - 4, 4, generic_access_flags, access); /* Standard access rights */ standard_tree = proto_tree_add_subtree_format(subtree, tvb, offset - 4, 4, ett_nt_access_mask_standard, NULL, "Standard rights: 0x%08x", access & STANDARD_RIGHTS_MASK); proto_tree_add_bitmask_list_value(standard_tree, tvb, offset - 4, 4, standard_access_flags, access); /* Specific access rights. Call the specific_rights_fn pointer if we have one, otherwise just display bits 0-15 in boring fashion. */ if (ami && ami->specific_rights_name) specific_tree = proto_tree_add_subtree_format(subtree, tvb, offset - 4, 4, ett_nt_access_mask_specific, &item, "%s specific rights: 0x%08x", ami->specific_rights_name, access & SPECIFIC_RIGHTS_MASK); else specific_tree = proto_tree_add_subtree_format(subtree, tvb, offset - 4, 4, ett_nt_access_mask_specific, &item, "Specific rights: 0x%08x", access & SPECIFIC_RIGHTS_MASK); if (ami && ami->specific_rights_fn) { guint32 mapped_access = access; proto_tree *specific_mapped; specific_mapped = proto_item_add_subtree( item, ett_nt_access_mask_specific); ami->specific_rights_fn( tvb, offset - 4, specific_tree, access); if (ami->generic_mapping) map_generic_access(&access, ami->generic_mapping); if (ami->standard_mapping) map_standard_access(&access, ami->standard_mapping); if (access != mapped_access) { ami->specific_rights_fn( tvb, offset - 4, specific_mapped, mapped_access); } return offset; } proto_tree_add_bitmask_list_value(specific_tree, tvb, offset - 4, 4, access_specific_flags, access); return offset; } static int hf_nt_access_mask = -1; #define ACL_REVISION_NT4 2 #define ACL_REVISION_ADS 4 static const value_string acl_revision_vals[] = { { ACL_REVISION_NT4, "NT4"}, { ACL_REVISION_ADS, "AD"}, {0,NULL} }; #define ACE_TYPE_ACCESS_ALLOWED 0 #define ACE_TYPE_ACCESS_DENIED 1 #define ACE_TYPE_SYSTEM_AUDIT 2 #define ACE_TYPE_SYSTEM_ALARM 3 #define ACE_TYPE_ALLOWED_COMPOUND 4 #define ACE_TYPE_ACCESS_ALLOWED_OBJECT 5 #define ACE_TYPE_ACCESS_DENIED_OBJECT 6 #define ACE_TYPE_SYSTEM_AUDIT_OBJECT 7 #define ACE_TYPE_SYSTEM_ALARM_OBJECT 8 #define ACE_TYPE_ACCESS_ALLOWED_CALLBACK 9 #define ACE_TYPE_ACCESS_DENIED_CALLBACK 10 #define ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT 11 #define ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT 12 #define ACE_TYPE_SYSTEM_AUDIT_CALLBACK 13 #define ACE_TYPE_SYSTEM_ALARM_CALLBACK 14 #define ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT 15 #define ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT 16 #define ACE_TYPE_SYSTEM_MANDATORY_LABEL 17 #define ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE 18 #define ACE_TYPE_SYSTEM_SCOPED_POLICY_ID 19 static const value_string ace_type_vals[] = { { ACE_TYPE_ACCESS_ALLOWED, "Access Allowed"}, { ACE_TYPE_ACCESS_DENIED, "Access Denied"}, { ACE_TYPE_SYSTEM_AUDIT, "System Audit"}, { ACE_TYPE_SYSTEM_ALARM, "System Alarm"}, { ACE_TYPE_ALLOWED_COMPOUND, "Allowed Compound"}, { ACE_TYPE_ACCESS_ALLOWED_OBJECT, "Allowed Object"}, { ACE_TYPE_ACCESS_DENIED_OBJECT, "Denied Object"}, { ACE_TYPE_SYSTEM_AUDIT_OBJECT, "Audit Object"}, { ACE_TYPE_SYSTEM_ALARM_OBJECT, "Alarm Object"}, { ACE_TYPE_ACCESS_ALLOWED_CALLBACK, "Allowed Callback"}, { ACE_TYPE_ACCESS_DENIED_CALLBACK, "Denied Callback"}, { ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT, "Allowed Callback Object"}, { ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT, "Denied Callback Object"}, { ACE_TYPE_SYSTEM_AUDIT_CALLBACK, "Audit Callback"}, { ACE_TYPE_SYSTEM_ALARM_CALLBACK, "Alarm Callback"}, { ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT, "Audit Callback Object"}, { ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT, "Alarm Callback Object"}, { ACE_TYPE_SYSTEM_MANDATORY_LABEL, "Mandatory label"}, { ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE, "Resource Attribute"}, { ACE_TYPE_SYSTEM_SCOPED_POLICY_ID, "Scoped Policy ID" }, { 0, NULL} }; static const true_false_string tfs_ace_flags_object_inherit = { "Subordinate files will inherit this ACE", "Subordinate files will not inherit this ACE" }; static const true_false_string tfs_ace_flags_container_inherit = { "Subordinate containers will inherit this ACE", "Subordinate containers will not inherit this ACE" }; static const true_false_string tfs_ace_flags_non_propagate_inherit = { "Subordinate object will not propagate the inherited ACE further", "Subordinate object will propagate the inherited ACE further" }; static const true_false_string tfs_ace_flags_inherit_only = { "This ACE does not apply to the current object", "This ACE applies to the current object" }; static const true_false_string tfs_ace_flags_inherited_ace = { "This ACE was inherited from its parent object", "This ACE was not inherited from its parent object" }; static const true_false_string tfs_ace_flags_successful_access = { "Successful accesses will be audited", "Successful accesses will not be audited" }; static const true_false_string tfs_ace_flags_failed_access = { "Failed accesses will be audited", "Failed accesses will not be audited" }; static const true_false_string flags_sec_info_sacl = { "Request SACL", "Do NOT request SACL" }; static const true_false_string flags_sec_info_dacl = { "Request DACL", "Do NOT request DACL" }; static const true_false_string flags_sec_info_group = { "Request GROUP", "Do NOT request group" }; static const true_false_string flags_sec_info_owner = { "Request OWNER", "Do NOT request owner" }; static const true_false_string flags_ace_sra_info_manual = { "Manually Assigned", "NOT Manually Assigned" }; static const true_false_string flags_ace_sra_info_policy_derived = { "Policy Derived", "NOT Policy Derived" }; static const true_false_string flags_ace_sra_info_non_inheritable = { "Non-Inheritable", "Inheritable" }; static const true_false_string flags_ace_sra_info_case_sensitive = { "Case Sensitive", "NOT Case Sensitive" }; static const true_false_string flags_ace_sra_info_deny_only = { "Deny Only", "NOT Deny Only" }; static const true_false_string flags_ace_sra_info_disabled_by_default = { "Disabled By Default", "NOT Disabled By Default" }; static const true_false_string flags_ace_sra_info_disabled = { "Disabled", "NOT Disabled" }; static const true_false_string flags_ace_sra_info_mandatory = { "Mandatory", "NOT Mandatory" }; #define APPEND_ACE_TEXT(flag, item, string) \ if(flag){ \ if(item) \ proto_item_append_text(item, string, sep); \ sep = ", "; \ } static int dissect_nt_ace_object(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_item *item; proto_tree *tree; proto_item *flags_item; guint32 flags; int old_offset=offset; const char *sep = " "; static int * const ace_flags[] = { &hf_nt_ace_flags_object_type_present, &hf_nt_ace_flags_inherited_object_type_present, NULL }; tree = proto_tree_add_subtree(parent_tree, tvb, offset, 0, ett_nt_ace_object, &item, "ACE Object"); /* flags */ flags=tvb_get_letohl(tvb, offset); flags_item = proto_tree_add_bitmask(tree, tvb, offset, hf_nt_ace_flags_object, ett_nt_ace_object_flags, ace_flags, ENC_LITTLE_ENDIAN); APPEND_ACE_TEXT(flags&0x00000001, flags_item, "%sObject Type Present"); APPEND_ACE_TEXT(flags&0x00000002, flags_item, "%sInherited Object Type Present"); offset+=4; /* is there a GUID ? */ if(flags&0x00000001){ proto_tree_add_item(tree, hf_nt_ace_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset+=16; } /* is there an inherited GUID ? */ if(flags&0x00000002){ proto_tree_add_item(tree, hf_nt_ace_inherited_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN); offset+=16; } proto_item_set_len(item, offset-old_offset); return offset; } static int dissect_nt_v2_ace_flags(tvbuff_t *tvb, int offset, proto_tree *parent_tree, guint8 *data) { proto_item *item = NULL; guint8 mask; const char *sep = " "; static int * const ace_flags[] = { &hf_nt_ace_flags_failed_access, &hf_nt_ace_flags_successful_access, &hf_nt_ace_flags_inherited_ace, &hf_nt_ace_flags_inherit_only, &hf_nt_ace_flags_non_propagate_inherit, &hf_nt_ace_flags_container_inherit, &hf_nt_ace_flags_object_inherit, NULL }; mask = tvb_get_guint8(tvb, offset); if (data) *data = mask; item = proto_tree_add_bitmask(parent_tree, tvb, offset, hf_nt_ace_flags, ett_nt_ace_flags, ace_flags, ENC_NA); APPEND_ACE_TEXT(mask&0x80, item, "%sFailed Access"); APPEND_ACE_TEXT(mask&0x40, item, "%sSuccessful Access"); APPEND_ACE_TEXT(mask&0x10, item, "%sInherited ACE"); APPEND_ACE_TEXT(mask&0x08, item, "%sInherit Only"); APPEND_ACE_TEXT(mask&0x04, item, "%sNo Propagate Inherit"); APPEND_ACE_TEXT(mask&0x02, item, "%sContainer Inherit"); APPEND_ACE_TEXT(mask&0x01, item, "%sObject Inherit"); offset += 1; return offset; } static int dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, struct access_mask_info *ami) { proto_item *item; proto_tree *tree; int old_offset = offset; char *sid_str = NULL; guint16 size; guint16 data_size; guint8 type; guint8 flags; guint32 perms = 0; tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_nt_ace, &item, "NT ACE: "); /* type */ type = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_nt_ace_type, tvb, offset, 1, type); offset += 1; /* flags */ offset = dissect_nt_v2_ace_flags(tvb, offset, tree, &flags); /* size */ size = tvb_get_letohs(tvb, offset); if (size < 4) { /* * BOGUS - the size includes the ACE header length, * which is 4. */ proto_tree_add_uint_format_value(tree, hf_nt_ace_size, tvb, offset, 2, size, "%u (bogus, must be >= 4)", size); return old_offset; /* our caller quits in this case */ } proto_tree_add_uint(tree, hf_nt_ace_size, tvb, offset, 2, size); offset += 2; /* some ACE types we not yet handle store other things than access mask * and SID in here. * sometimes things that are not related at all to access control. * naughty naughty. -- ronnie */ switch(type){ case ACE_TYPE_ACCESS_ALLOWED: case ACE_TYPE_ACCESS_DENIED: case ACE_TYPE_SYSTEM_AUDIT: case ACE_TYPE_SYSTEM_ALARM: case ACE_TYPE_ALLOWED_COMPOUND: case ACE_TYPE_ACCESS_ALLOWED_OBJECT: case ACE_TYPE_ACCESS_DENIED_OBJECT: case ACE_TYPE_SYSTEM_AUDIT_OBJECT: case ACE_TYPE_SYSTEM_ALARM_OBJECT: case ACE_TYPE_ACCESS_ALLOWED_CALLBACK: case ACE_TYPE_ACCESS_DENIED_CALLBACK: case ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT: case ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_AUDIT_CALLBACK: case ACE_TYPE_SYSTEM_ALARM_CALLBACK: case ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_MANDATORY_LABEL: case ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE: case ACE_TYPE_SYSTEM_SCOPED_POLICY_ID: /* access mask */ offset = dissect_nt_access_mask( tvb, offset, pinfo, tree, NULL, drep, hf_nt_access_mask, ami, &perms); /* these aces contain an extra object */ switch(type){ case ACE_TYPE_ACCESS_ALLOWED_OBJECT: case ACE_TYPE_ACCESS_DENIED_OBJECT: case ACE_TYPE_SYSTEM_AUDIT_OBJECT: case ACE_TYPE_SYSTEM_ALARM_OBJECT: case ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT: case ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT: offset=dissect_nt_ace_object(tvb, offset, tree); } /* SID */ offset = dissect_nt_sid(tvb, offset, tree, "SID", &sid_str, -1); if (item) proto_item_append_text( item, "%s, flags 0x%02x, %s, mask 0x%08x", sid_str, flags, val_to_str(type, ace_type_vals, "Unknown ACE type (0x%02x)"), perms); data_size = size - (offset - old_offset); /* Dissect Dynamic Access Control related ACE types (if present). That is, Conditional ACE and Resource Attributes. See [MS-DTYP] v20180912 section 2.4.4.17 */ switch (type) { case ACE_TYPE_ACCESS_ALLOWED_CALLBACK: case ACE_TYPE_ACCESS_DENIED_CALLBACK: case ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT: case ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT: case ACE_TYPE_SYSTEM_AUDIT_CALLBACK: case ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT: dissect_nt_conditional_ace(tvb, offset, data_size, tree); break; case ACE_TYPE_SYSTEM_RESOURCE_ATTRIBUTE: dissect_nt_ace_system_resource_attribute(tvb, offset, data_size, tree); break; } break; }; proto_item_set_len(item, offset-old_offset); /* Sometimes there is some spare space at the end of the ACE so use the size field to work out where the end is. */ return old_offset + size; } static int dissect_nt_acl(tvbuff_t *tvb, int offset_a, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, const char *name, struct access_mask_info *ami) { proto_item *item; proto_tree *tree; int old_offset = offset_a; int pre_ace_offset; guint16 revision; guint32 num_aces; volatile int offset_v = offset_a; volatile gboolean missing_data = FALSE; volatile gboolean bad_ace = FALSE; tree = proto_tree_add_subtree_format(parent_tree, tvb, offset_v, -1, ett_nt_acl, &item, "NT %s ACL", name); /* revision */ /* * XXX - is this *really* 2 bytes? The page at * * https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-_acl * * indicates that it's one byte of revision and one byte of * zero padding, which means the code that used to be here * was correct - and this code would give the same results * as long as the padding is zero, so if this dissects it * correctly when the padding is zero, and the padding is * always zero, the old code would dissect it correctly * also. */ revision = tvb_get_letohs(tvb, offset_v); proto_tree_add_uint(tree, hf_nt_acl_revision, tvb, offset_v, 2, revision); offset_v += 2; switch(revision){ case ACL_REVISION_NT4: case ACL_REVISION_ADS: case 3: /* weirdo type */ /* size */ proto_tree_add_item(tree, hf_nt_acl_size, tvb, offset_v, 2, ENC_LITTLE_ENDIAN); offset_v += 2; /* number of ace structures */ /* * XXX - is this *really* 4 bytes? The page referred to above * says it's 2 bytes of count followed by two bytes of * zero padding. */ num_aces = tvb_get_letohl(tvb, offset_v); proto_tree_add_uint(tree, hf_nt_acl_num_aces, tvb, offset_v, 4, num_aces); offset_v += 4; while(num_aces-- && !missing_data && !bad_ace) { pre_ace_offset = offset_v; /* * These are at an offset_v later in the packet; don't * fail if we can't fetch them, just note the problem * and dissect the stuff before it. */ TRY { offset_v = dissect_nt_v2_ace(tvb, offset_v, pinfo, tree, drep, ami); if (pre_ace_offset == offset_v) { /* * Bogus ACE, with a length < 4. */ bad_ace = TRUE; } } CATCH(ContainedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_ace_extends_beyond_data, tvb, offset_v, 0); missing_data = TRUE; } CATCH(ReportedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_ace_extends_beyond_reassembled_data, tvb, offset_v, 0); missing_data = TRUE; } ENDTRY; } } proto_item_set_len(item, offset_v-old_offset); return offset_v; } static const true_false_string tfs_sec_desc_type_owner_defaulted = { "OWNER is DEFAULTED", "Owner is NOT defaulted" }; static const true_false_string tfs_sec_desc_type_group_defaulted = { "GROUP is DEFAULTED", "Group is NOT defaulted" }; static const true_false_string tfs_sec_desc_type_dacl_present = { "DACL is PRESENT", "DACL is NOT present" }; static const true_false_string tfs_sec_desc_type_dacl_defaulted = { "DACL is DEFAULTED", "DACL is NOT defaulted" }; static const true_false_string tfs_sec_desc_type_sacl_present = { "SACL is PRESENT", "SACL is NOT present" }; static const true_false_string tfs_sec_desc_type_sacl_defaulted = { "SACL is DEFAULTED", "SACL is NOT defaulted" }; static const true_false_string tfs_sec_desc_type_dacl_trusted = { "DACL TRUSTED is TRUE", "Dacl trusted is FALSE" }; static const true_false_string tfs_sec_desc_type_server_security = { "SERVER SECURITY is TRUE", "Server security is FALSE" }; static const true_false_string tfs_sec_desc_type_dacl_auto_inherit_req = { "DACL has AUTO INHERIT REQUIRED", "DACL does NOT require auto inherit" }; static const true_false_string tfs_sec_desc_type_sacl_auto_inherit_req = { "SACL has AUTO INHERIT REQUIRED", "SACL does NOT require auto inherit" }; static const true_false_string tfs_sec_desc_type_dacl_auto_inherited = { "DACL is AUTO INHERITED", "DACL is NOT auto inherited" }; static const true_false_string tfs_sec_desc_type_sacl_auto_inherited = { "SACL is AUTO INHERITED", "SACL is NOT auto inherited" }; static const true_false_string tfs_sec_desc_type_dacl_protected = { "The DACL is PROTECTED", "The DACL is NOT protected" }; static const true_false_string tfs_sec_desc_type_sacl_protected = { "The SACL is PROTECTED", "The SACL is NOT protected" }; static const true_false_string tfs_sec_desc_type_rm_control_valid = { "Rm control valid is TRUE", "Rm control valid is FALSE" }; static const true_false_string tfs_sec_desc_type_self_relative = { "This SecDesc is SELF RELATIVE", "This SecDesc is NOT self relative" }; static int dissect_nt_sec_desc_type(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { static int * const flags[] = { &hf_nt_sec_desc_type_self_relative, &hf_nt_sec_desc_type_rm_control_valid, &hf_nt_sec_desc_type_sacl_protected, &hf_nt_sec_desc_type_dacl_protected, &hf_nt_sec_desc_type_sacl_auto_inherited, &hf_nt_sec_desc_type_dacl_auto_inherited, &hf_nt_sec_desc_type_sacl_auto_inherit_req, &hf_nt_sec_desc_type_dacl_auto_inherit_req, &hf_nt_sec_desc_type_server_security, &hf_nt_sec_desc_type_dacl_trusted, &hf_nt_sec_desc_type_sacl_defaulted, &hf_nt_sec_desc_type_sacl_present, &hf_nt_sec_desc_type_dacl_defaulted, &hf_nt_sec_desc_type_dacl_present, &hf_nt_sec_desc_type_group_defaulted, &hf_nt_sec_desc_type_owner_defaulted, NULL }; proto_tree_add_bitmask(parent_tree, tvb, offset, hf_nt_sec_desc_type, ett_nt_sec_desc_type, flags, ENC_LITTLE_ENDIAN); offset += 2; return offset; } int dissect_nt_security_information(tvbuff_t *tvb, int offset, proto_tree *parent_tree) { proto_item *item = NULL; guint32 mask; static int * const flags[] = { &hf_nt_security_information_sacl, &hf_nt_security_information_dacl, &hf_nt_security_information_group, &hf_nt_security_information_owner, NULL }; mask = tvb_get_letohl(tvb, offset); item = proto_tree_add_bitmask(parent_tree, tvb, offset, hf_nt_security_information, ett_nt_security_information, flags, ENC_LITTLE_ENDIAN); if (mask & 0x00000008) { proto_item_append_text(item, " SACL"); } if (mask & 0x00000004) { proto_item_append_text(item, " DACL"); } if (mask & 0x00000002) { proto_item_append_text(item, " GROUP"); } if (mask & 0x00000001) { proto_item_append_text(item, " OWNER"); } offset += 4; return offset; } int dissect_nt_sec_desc(tvbuff_t *tvb, int offset_a, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, gboolean len_supplied _U_, int len, struct access_mask_info *ami) { proto_item *item = NULL; proto_tree *tree = NULL; guint16 revision; int start_offset = offset_a; volatile int offset_v=offset_a; volatile int end_offset; volatile int item_offset; guint32 owner_sid_offset; proto_item *it_owner_sid_offs = NULL; volatile guint32 group_sid_offset; proto_item * volatile it_gr_sid_offs = NULL; volatile guint32 sacl_offset; proto_item * volatile it_sacl_offs = NULL; volatile guint32 dacl_offset; proto_item * volatile it_dacl_offs = NULL; tree = proto_tree_add_subtree(parent_tree, tvb, offset_v, -1, ett_nt_sec_desc, &item, "NT Security Descriptor"); /* revision */ revision = tvb_get_letohs(tvb, offset_v); proto_tree_add_uint(tree, hf_nt_sec_desc_revision, tvb, offset_v, 2, revision); offset_v += 2; switch(revision){ case 1: /* only version we will ever see of this structure?*/ /* type */ offset_v = dissect_nt_sec_desc_type(tvb, offset_v, tree); /* offset_v to owner sid */ owner_sid_offset = tvb_get_letohl(tvb, offset_v); if(owner_sid_offset != 0 && owner_sid_offset < 20){ /* Bogus value - points into fixed portion of descriptor */ proto_tree_add_uint_format_value(tree, hf_nt_offset_to_owner_sid, tvb, offset_v, 4, owner_sid_offset, "%u (bogus, must be >= 20)", owner_sid_offset); owner_sid_offset = 0; } else it_owner_sid_offs = proto_tree_add_item(tree, hf_nt_offset_to_owner_sid, tvb, offset_v, 4, ENC_LITTLE_ENDIAN); offset_v += 4; /* offset to group sid */ group_sid_offset = tvb_get_letohl(tvb, offset_v); if(group_sid_offset != 0 && group_sid_offset < 20){ /* Bogus value - points into fixed portion of descriptor */ proto_tree_add_uint_format_value(tree, hf_nt_offset_to_group_sid, tvb, offset_v, 4, group_sid_offset, "%u (bogus, must be >= 20)", group_sid_offset); group_sid_offset = 0; } else it_gr_sid_offs = proto_tree_add_item(tree, hf_nt_offset_to_group_sid, tvb, offset_v, 4, ENC_LITTLE_ENDIAN); offset_v += 4; /* offset to sacl */ sacl_offset = tvb_get_letohl(tvb, offset_v); if(sacl_offset != 0 && sacl_offset < 20){ /* Bogus value - points into fixed portion of descriptor */ proto_tree_add_uint_format_value(tree, hf_nt_offset_to_sacl, tvb, offset_v, 4, sacl_offset, "%u (bogus, must be >= 20)", sacl_offset); sacl_offset = 0; } else it_sacl_offs = proto_tree_add_item(tree, hf_nt_offset_to_sacl, tvb, offset_v, 4, ENC_LITTLE_ENDIAN); offset_v += 4; /* offset to dacl */ dacl_offset = tvb_get_letohl(tvb, offset_v); if(dacl_offset != 0 && dacl_offset < 20){ /* Bogus value - points into fixed portion of descriptor */ proto_tree_add_uint_format_value(tree, hf_nt_offset_to_dacl, tvb, offset_v, 4, dacl_offset, "%u (bogus, must be >= 20)", dacl_offset); dacl_offset = 0; } else it_dacl_offs = proto_tree_add_item(tree, hf_nt_offset_to_dacl, tvb, offset_v, 4, ENC_LITTLE_ENDIAN); offset_v += 4; end_offset = offset_v; /*owner SID*/ if(owner_sid_offset){ item_offset = start_offset+owner_sid_offset; if (item_offset < start_offset) { expert_add_info(pinfo, it_owner_sid_offs, &ei_nt_item_offs_out_of_range); break; } TRY{ offset_v = dissect_nt_sid(tvb, item_offset, tree, "Owner", NULL, -1); if (offset_v > end_offset) end_offset = offset_v; } CATCH(ContainedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_owner_sid_beyond_data, tvb, item_offset, 0); } CATCH(ReportedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_owner_sid_beyond_reassembled_data, tvb, item_offset, 0); } ENDTRY; } /*group SID*/ if(group_sid_offset){ item_offset = start_offset+group_sid_offset; if (item_offset < start_offset) { expert_add_info(pinfo, it_gr_sid_offs, &ei_nt_item_offs_out_of_range); break; } TRY { offset_v = dissect_nt_sid(tvb, item_offset, tree, "Group", NULL, -1); if (offset_v > end_offset) end_offset = offset_v; } CATCH(ContainedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_group_sid_beyond_data, tvb, item_offset, 0); } CATCH(ReportedBoundsError) { proto_tree_add_expert(tree, pinfo, &ei_nt_group_sid_beyond_reassembled_data, tvb, item_offset, 0); } ENDTRY; } /* sacl */ if(sacl_offset){ item_offset = start_offset+sacl_offset; if (item_offset < start_offset) { expert_add_info(pinfo, it_sacl_offs, &ei_nt_item_offs_out_of_range); break; } offset_v = dissect_nt_acl(tvb, item_offset, pinfo, tree, drep, "System (SACL)", ami); if (offset_v > end_offset) end_offset = offset_v; } /* dacl */ if(dacl_offset){ item_offset = start_offset+dacl_offset; if (item_offset < start_offset) { expert_add_info(pinfo, it_dacl_offs, &ei_nt_item_offs_out_of_range); break; } offset_v = dissect_nt_acl(tvb, item_offset, pinfo, tree, drep, "User (DACL)", ami); if (offset_v > end_offset) end_offset = offset_v; } break; default: end_offset = offset_v; break; } len = end_offset - start_offset; proto_item_set_len(item, len); return offset_v; } /* * XXX - we should have a way to register fields not associated with a * protocol. * * XXX - make-reg-dotc.py doesn't check for an argument list of "(void)", * so we have to give this a name other than "proto_register_..." so that * it doesn't end up being called from "register.c". */ void proto_do_register_windows_common(int proto_smb) { static hf_register_info hf[] = { /* Security descriptors */ { &hf_nt_sec_desc_revision, { "Revision", "nt.sec_desc.revision", FT_UINT16, BASE_DEC, NULL, 0, "Version of NT Security Descriptor structure", HFILL }}, { &hf_nt_sec_desc_type_owner_defaulted, { "Owner Defaulted", "nt.sec_desc.type.owner_defaulted", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_owner_defaulted), 0x0001, "Is Owner Defaulted set?", HFILL }}, { &hf_nt_sec_desc_type_group_defaulted, { "Group Defaulted", "nt.sec_desc.type.group_defaulted", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_group_defaulted), 0x0002, "Is Group Defaulted?", HFILL }}, { &hf_nt_sec_desc_type_dacl_present, { "DACL Present", "nt.sec_desc.type.dacl_present", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_present), 0x0004, "Does this SecDesc have DACL present?", HFILL }}, { &hf_nt_sec_desc_type_dacl_defaulted, { "DACL Defaulted", "nt.sec_desc.type.dacl_defaulted", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_defaulted), 0x0008, "Does this SecDesc have DACL Defaulted?", HFILL }}, { &hf_nt_sec_desc_type_sacl_present, { "SACL Present", "nt.sec_desc.type.sacl_present", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_sacl_present), 0x0010, "Is the SACL present?", HFILL }}, { &hf_nt_sec_desc_type_sacl_defaulted, { "SACL Defaulted", "nt.sec_desc.type.sacl_defaulted", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_sacl_defaulted), 0x0020, "Does this SecDesc have SACL Defaulted?", HFILL }}, { &hf_nt_sec_desc_type_dacl_auto_inherit_req, { "DACL Auto Inherit Required", "nt.sec_desc.type.dacl_auto_inherit_req", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_auto_inherit_req), 0x0100, "Does this SecDesc have DACL Auto Inherit Required set?", HFILL }}, { &hf_nt_sec_desc_type_dacl_trusted, { "DACL Trusted", "nt.sec_desc.type.dacl_trusted", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_trusted), 0x0040, "Does this SecDesc have DACL TRUSTED set?", HFILL }}, { &hf_nt_sec_desc_type_server_security, { "Server Security", "nt.sec_desc.type.server_security", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_server_security), 0x0080, "Does this SecDesc have SERVER SECURITY set?", HFILL }}, { &hf_nt_sec_desc_type_sacl_auto_inherit_req, { "SACL Auto Inherit Required", "nt.sec_desc.type.sacl_auto_inherit_req", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_sacl_auto_inherit_req), 0x0200, "Does this SecDesc have SACL Auto Inherit Required set?", HFILL }}, { &hf_nt_sec_desc_type_dacl_auto_inherited, { "DACL Auto Inherited", "nt.sec_desc.type.dacl_auto_inherited", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_auto_inherited), 0x0400, "Is this DACL auto inherited", HFILL }}, { &hf_nt_sec_desc_type_sacl_auto_inherited, { "SACL Auto Inherited", "nt.sec_desc.type.sacl_auto_inherited", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_sacl_auto_inherited), 0x0800, "Is this SACL auto inherited", HFILL }}, { &hf_nt_sec_desc_type_dacl_protected, { "DACL Protected", "nt.sec_desc.type.dacl_protected", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_dacl_protected), 0x1000, "Is the DACL structure protected?", HFILL }}, { &hf_nt_sec_desc_type_sacl_protected, { "SACL Protected", "nt.sec_desc.type.sacl_protected", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_sacl_protected), 0x2000, "Is the SACL structure protected?", HFILL }}, { &hf_nt_sec_desc_type_self_relative, { "Self Relative", "nt.sec_desc.type.self_relative", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_self_relative), 0x8000, "Is this SecDesc self relative?", HFILL }}, { &hf_nt_sec_desc_type_rm_control_valid, { "RM Control Valid", "nt.sec_desc.type.rm_control_valid", FT_BOOLEAN, 16, TFS(&tfs_sec_desc_type_rm_control_valid), 0x4000, "Is RM Control Valid set?", HFILL }}, /* SIDs */ { &hf_nt_sid, { "SID", "nt.sid", FT_STRING, BASE_NONE, NULL, 0, "SID: Security Identifier", HFILL }}, { &hf_nt_sid_revision, { "Revision", "nt.sid.revision", FT_UINT8, BASE_DEC, NULL, 0, "Version of SID structure", HFILL }}, { &hf_nt_sid_num_auth, { "Num Auth", "nt.sid.num_auth", FT_UINT8, BASE_DEC, NULL, 0, "Number of authorities for this SID", HFILL }}, { &hf_nt_sid_auth_dec, { "Authority", "nt.sid.auth", FT_UINT64, BASE_DEC, NULL, 0, "Identifier Authority", HFILL }}, { &hf_nt_sid_auth_hex, { "Authority", "nt.sid.auth", FT_UINT64, BASE_HEX, NULL, 0, "Identifier Authority", HFILL }}, { &hf_nt_sid_subauth, { "Subauthorities", "nt.sid.subauth", FT_STRING, BASE_NONE, NULL, 0, "Subauthorities fields", HFILL }}, { &hf_nt_sid_rid_dec, { "RID", "nt.sid.rid", FT_UINT32, BASE_DEC, NULL, 0, "Relative IDentifier: identifies a user or group", HFILL }}, { &hf_nt_sid_rid_hex, { "RID", "nt.sid.rid", FT_UINT32, BASE_HEX, NULL, 0, "Relative IDentifier: identifies a user or group", HFILL }}, { &hf_nt_sid_wkwn, { "Well-known SID", "nt.sid.wkwn", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_sid_domain, { "Domain", "nt.sid.domain", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, /* ACLs */ { &hf_nt_acl_revision, { "Revision", "nt.acl.revision", FT_UINT16, BASE_DEC, VALS(acl_revision_vals), 0, "Version of NT ACL structure", HFILL }}, { &hf_nt_acl_size, { "Size", "nt.acl.size", FT_UINT16, BASE_DEC, NULL, 0, "Size of NT ACL structure", HFILL }}, { &hf_nt_acl_num_aces, { "Num ACEs", "nt.acl.num_aces", FT_UINT32, BASE_DEC, NULL, 0, "Number of ACE structures for this ACL", HFILL }}, /* ACEs */ { &hf_nt_ace_type, { "Type", "nt.ace.type", FT_UINT8, BASE_DEC, VALS(ace_type_vals), 0, "Type of ACE", HFILL }}, { &hf_nt_ace_size, { "Size", "nt.ace.size", FT_UINT16, BASE_DEC, NULL, 0, "Size of this ACE", HFILL }}, { &hf_nt_ace_flags_object_inherit, { "Object Inherit", "nt.ace.flags.object_inherit", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_object_inherit), 0x01, "Will subordinate files inherit this ACE?", HFILL }}, { &hf_nt_ace_flags_container_inherit, { "Container Inherit", "nt.ace.flags.container_inherit", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_container_inherit), 0x02, "Will subordinate containers inherit this ACE?", HFILL }}, { &hf_nt_ace_flags_non_propagate_inherit, { "Non-Propagate Inherit", "nt.ace.flags.non_propagate_inherit", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_non_propagate_inherit), 0x04, "Will subordinate object propagate this ACE further?", HFILL }}, { &hf_nt_ace_flags_inherit_only, { "Inherit Only", "nt.ace.flags.inherit_only", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_inherit_only), 0x08, "Does this ACE apply to the current object?", HFILL }}, { &hf_nt_ace_flags_inherited_ace, { "Inherited ACE", "nt.ace.flags.inherited_ace", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_inherited_ace), 0x10, "Was this ACE inherited from its parent object?", HFILL }}, { &hf_nt_ace_flags_successful_access, { "Audit Successful Accesses", "nt.ace.flags.successful_access", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_successful_access), 0x40, "Should successful accesses be audited?", HFILL }}, { &hf_nt_ace_flags_failed_access, { "Audit Failed Accesses", "nt.ace.flags.failed_access", FT_BOOLEAN, 8, TFS(&tfs_ace_flags_failed_access), 0x80, "Should failed accesses be audited?", HFILL }}, /* Access masks */ { &hf_nt_access_mask, { "Access required", "nt.access_mask", FT_UINT32, BASE_HEX, NULL, 0x0, "Access mask", HFILL }}, { &hf_access_generic_read, { "Generic read", "nt.access_mask.generic_read", FT_BOOLEAN, 32, TFS(&tfs_set_notset), GENERIC_READ_ACCESS, NULL, HFILL }}, { &hf_access_generic_write, { "Generic write", "nt.access_mask.generic_write", FT_BOOLEAN, 32, TFS(&tfs_set_notset), GENERIC_WRITE_ACCESS, NULL, HFILL }}, { &hf_access_generic_execute, { "Generic execute", "nt.access_mask.generic_execute", FT_BOOLEAN, 32, TFS(&tfs_set_notset), GENERIC_EXECUTE_ACCESS, NULL, HFILL }}, { &hf_access_generic_all, { "Generic all", "nt.access_mask.generic_all", FT_BOOLEAN, 32, TFS(&tfs_set_notset), GENERIC_ALL_ACCESS, NULL, HFILL }}, { &hf_access_maximum_allowed, { "Maximum allowed", "nt.access_mask.maximum_allowed", FT_BOOLEAN, 32, TFS(&tfs_set_notset), MAXIMUM_ALLOWED_ACCESS, NULL, HFILL }}, { &hf_access_sacl, { "Access SACL", "nt.access_mask.access_sacl", FT_BOOLEAN, 32, TFS(&tfs_set_notset), ACCESS_SACL_ACCESS, NULL, HFILL }}, { &hf_access_standard_read_control, { "Read control", "nt.access_mask.read_control", FT_BOOLEAN, 32, TFS(&tfs_set_notset), READ_CONTROL_ACCESS, NULL, HFILL }}, { &hf_access_standard_delete, { "Delete", "nt.access_mask.delete", FT_BOOLEAN, 32, TFS(&tfs_set_notset), DELETE_ACCESS, NULL, HFILL }}, { &hf_access_standard_synchronise, { "Synchronise", "nt.access_mask.synchronise", FT_BOOLEAN, 32, TFS(&tfs_set_notset), SYNCHRONIZE_ACCESS, NULL, HFILL }}, { &hf_access_standard_write_dac, { "Write DAC", "nt.access_mask.write_dac", FT_BOOLEAN, 32, TFS(&tfs_set_notset), WRITE_DAC_ACCESS, NULL, HFILL }}, { &hf_access_standard_write_owner, { "Write owner", "nt.access_mask.write_owner", FT_BOOLEAN, 32, TFS(&tfs_set_notset), WRITE_OWNER_ACCESS, NULL, HFILL }}, { &hf_access_specific_15, { "Specific access, bit 15", "nt.access_mask.specific_15", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00008000, NULL, HFILL }}, { &hf_access_specific_14, { "Specific access, bit 14", "nt.access_mask.specific_14", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00004000, NULL, HFILL }}, { &hf_access_specific_13, { "Specific access, bit 13", "nt.access_mask.specific_13", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00002000, NULL, HFILL }}, { &hf_access_specific_12, { "Specific access, bit 12", "nt.access_mask.specific_12", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00001000, NULL, HFILL }}, { &hf_access_specific_11, { "Specific access, bit 11", "nt.access_mask.specific_11", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800, NULL, HFILL }}, { &hf_access_specific_10, { "Specific access, bit 10", "nt.access_mask.specific_10", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400, NULL, HFILL }}, { &hf_access_specific_9, { "Specific access, bit 9", "nt.access_mask.specific_9", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200, NULL, HFILL }}, { &hf_access_specific_8, { "Specific access, bit 8", "nt.access_mask.specific_8", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100, NULL, HFILL }}, { &hf_access_specific_7, { "Specific access, bit 7", "nt.access_mask.specific_7", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080, NULL, HFILL }}, { &hf_access_specific_6, { "Specific access, bit 6", "nt.access_mask.specific_6", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }}, { &hf_access_specific_5, { "Specific access, bit 5", "nt.access_mask.specific_5", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }}, { &hf_access_specific_4, { "Specific access, bit 4", "nt.access_mask.specific_4", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }}, { &hf_access_specific_3, { "Specific access, bit 3", "nt.access_mask.specific_3", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }}, { &hf_access_specific_2, { "Specific access, bit 2", "nt.access_mask.specific_2", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }}, { &hf_access_specific_1, { "Specific access, bit 1", "nt.access_mask.specific_1", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }}, { &hf_access_specific_0, { "Specific access, bit 0", "nt.access_mask.specific_0", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }}, { &hf_nt_ace_flags_object_type_present, { "Object Type Present", "nt.ace.object.flags.object_type_present", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }}, { &hf_nt_ace_flags_inherited_object_type_present, { "Inherited Object Type Present", "nt.ace.object.flags.inherited_object_type_present", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }}, { &hf_nt_ace_guid, { "GUID", "nt.ace.object.guid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_inherited_guid, { "Inherited GUID", "nt.ace.object.inherited_guid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond, { "Conditional Expression", "nt.ace.cond", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_token, { "Token", "nt.ace.cond.token", FT_UINT8, BASE_HEX, VALS(ace_cond_token_vals), 0, "Type of Token", HFILL }}, { &hf_nt_ace_cond_sign, { "SIGN", "nt.ace.cond.sign", FT_UINT8, BASE_HEX, VALS(ace_cond_sign_vals), 0, NULL, HFILL }}, { &hf_nt_ace_cond_base, { "BASE", "nt.ace.cond.base", FT_UINT8, BASE_HEX, VALS(ace_cond_base_vals), 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_int8, { "INT8", "nt.ace.cond.value_int8", FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_int16, { "INT16", "nt.ace.cond.value_int16", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_int32, { "INT32", "nt.ace.cond.value_int32", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_int64, { "INT64", "nt.ace.cond.value_int64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_string, { "UNICODE_STRING", "nt.ace.cond.value_string", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_value_octet_string, { "OCTET_STRING", "nt.ace.cond.value_octet_string", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_nt_ace_cond_local_attr, { "LOCAL_ATTRIBUTE", "nt.ace.cond.local_attr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_user_attr, { "USER_ATTRIBUTE", "nt.ace.cond.user_attr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_resource_attr, { "RESOURCE_ATTRIBUTE", "nt.ace.cond.resource_attr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_cond_device_attr, { "DEVICE_ATTRIBUTE", "nt.ace.cond.device_attr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra, { "Resource Attribute", "nt.ace.sra", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_name_offset, { "Name Offset", "nt.ace.sra.name_offset", FT_UINT32, BASE_DEC, NULL, 0, "Offset to Name of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_name, { "Name", "nt.ace.sra.name", FT_STRING, BASE_NONE, NULL, 0, "Name of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_type, { "Type", "nt.ace.sra.type", FT_UINT16, BASE_DEC, VALS(ace_sra_type_vals), 0, "Type of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_reserved, { "Reserved", "nt.ace.sra.reserved", FT_UINT16, BASE_HEX, NULL, 0, "Reserved of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_flags, { "Flags", "nt.ace.sra.flags", FT_UINT32, BASE_HEX, NULL, 0, "Flags of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_flags_manual, { "Manual", "nt.ace.sra.flags.manual", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_manual), 0x00010000, NULL, HFILL }}, { &hf_nt_ace_sra_flags_policy_derived, { "Policy Derived", "nt.ace.sra.flags.policy_derived", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_policy_derived), 0x00020000, NULL, HFILL }}, { &hf_nt_ace_sra_flags_non_inheritable, { "Non-Inheritable", "nt.ace.sra.flags.non_inheritable", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_non_inheritable), 0x00000001, NULL, HFILL }}, { &hf_nt_ace_sra_flags_case_sensitive, { "Case Sensitive", "nt.ace.sra.flags.case_sensitive", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_case_sensitive), 0x00000002, NULL, HFILL }}, { &hf_nt_ace_sra_flags_deny_only, { "Deny Only", "nt.ace.sra.flags.deny_only", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_deny_only), 0x00000004, NULL, HFILL }}, { &hf_nt_ace_sra_flags_disabled_by_default, { "Disabled By Default", "nt.ace.sra.flags.disabled_by_default", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_disabled_by_default), 0x00000008, NULL, HFILL }}, { &hf_nt_ace_sra_flags_disabled, { "Disabled", "nt.ace.sra.flags.disabled", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_disabled), 0x00000010, NULL, HFILL }}, { &hf_nt_ace_sra_flags_mandatory, { "Mandatory", "nt.ace.sra.flags.mandatory", FT_BOOLEAN, 32, TFS(&flags_ace_sra_info_mandatory), 0x00000020, NULL, HFILL }}, { &hf_nt_ace_sra_value_count, { "Value Count", "nt.ace.sra.value_count", FT_UINT32, BASE_DEC, NULL, 0, "Value Count of Resource Attribute", HFILL }}, { &hf_nt_ace_sra_value_offset, { "Value Offset", "nt.ace.sra.name_offset", FT_UINT32, BASE_DEC, NULL, 0, "Offset to a Resource Attribute Value", HFILL }}, { &hf_nt_ace_sra_value_int64, { "INT64", "nt.ace.sra.value_int64", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_value_uint64, { "UINT64", "nt.ace.sra.value_uint64", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_value_string, { "STRING", "nt.ace.sra.value_string", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_value_sid, { "SID", "nt.ace.sra.value_sid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_value_boolean, { "BOOLEAN", "nt.ace.sra.value_boolean", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_nt_ace_sra_value_octet_string, { "OCTET_STRING", "nt.ace.sra.value_octet_string", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_nt_security_information_sacl, { "SACL", "nt.sec_info.sacl", FT_BOOLEAN, 32, TFS(&flags_sec_info_sacl), 0x00000008, NULL, HFILL }}, { &hf_nt_security_information_dacl, { "DACL", "nt.sec_info.dacl", FT_BOOLEAN, 32, TFS(&flags_sec_info_dacl), 0x00000004, NULL, HFILL }}, { &hf_nt_security_information_group, { "Group", "nt.sec_info.group", FT_BOOLEAN, 32, TFS(&flags_sec_info_group), 0x00000002, NULL, HFILL }}, { &hf_nt_security_information_owner, { "Owner", "nt.sec_info.owner", FT_BOOLEAN, 32, TFS(&flags_sec_info_owner), 0x00000001, NULL, HFILL }}, /* Generated from convert_proto_tree_add_text.pl */ { &hf_nt_ace_flags_object, { "ACE Object Flags", "nt.ace.object.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_nt_ace_flags, { "NT ACE Flags", "nt.ace.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_nt_sec_desc_type, { "Type", "nt.sec_desc.type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_nt_security_information, { "SEC INFO", "nt.sec_info", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_nt_offset_to_owner_sid, { "Offset to owner SID", "nt.offset_to_owner_sid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_nt_offset_to_group_sid, { "Offset to group SID", "nt.offset_to_group_sid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_nt_offset_to_sacl, { "Offset to SACL", "nt.offset_to_sacl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_nt_offset_to_dacl, { "Offset to DACL", "nt.offset_to_dacl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_nt_sec_desc, &ett_nt_sec_desc_type, &ett_nt_sid, &ett_nt_acl, &ett_nt_ace, &ett_nt_ace_flags, &ett_nt_ace_object, &ett_nt_ace_object_flags, &ett_nt_access_mask, &ett_nt_access_mask_generic, &ett_nt_access_mask_standard, &ett_nt_access_mask_specific, &ett_nt_security_information, &ett_nt_ace_cond, &ett_nt_ace_cond_data, &ett_nt_ace_sra, &ett_nt_ace_sra_flags, &ett_nt_ace_sra_value_offsets, &ett_nt_ace_sra_values, }; static ei_register_info ei[] = { { &ei_nt_ace_extends_beyond_data, { "nt.ace_extends_beyond_data", PI_MALFORMED, PI_ERROR, "ACE Extends beyond end of data", EXPFILL }}, { &ei_nt_ace_extends_beyond_reassembled_data, { "nt.ace_extends_beyond_reassembled_data", PI_MALFORMED, PI_ERROR, "ACE Extends beyond end of reassembled data", EXPFILL }}, { &ei_nt_owner_sid_beyond_data, { "nt.owner_sid.beyond_data", PI_MALFORMED, PI_ERROR, "Owner SID beyond end of data", EXPFILL }}, { &ei_nt_owner_sid_beyond_reassembled_data, { "nt.owner_sid.beyond_reassembled_data", PI_MALFORMED, PI_ERROR, "Owner SID beyond end of reassembled data", EXPFILL }}, { &ei_nt_group_sid_beyond_data, { "nt.group_sid.beyond_data", PI_MALFORMED, PI_ERROR, "Group SID beyond end of data", EXPFILL }}, { &ei_nt_group_sid_beyond_reassembled_data, { "nt.group_sid.beyond_reassembled_data", PI_MALFORMED, PI_ERROR, "Group SID beyond end of reassembled data", EXPFILL }}, { &ei_nt_item_offs_out_of_range, { "nt.item_offset.out_of_range", PI_MALFORMED, PI_ERROR, "Item offset is out of range", EXPFILL }}, }; expert_module_t* expert_nt; proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_smb, hf, array_length(hf)); expert_nt = expert_register_protocol(proto_smb); expert_register_field_array(expert_nt, ei, array_length(ei)); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-windows-common.h
/* packet-windows-common.h * Declarations for dissecting various Windows data types * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_WINDOWS_COMMON_H__ #define __PACKET_WINDOWS_COMMON_H__ #include "ws_symbol_export.h" #include "packet-dcerpc.h" /* Win32 errors. * These defines specify the WERR error codes often encountered in ms DCE/RPC * interfaces (those that do not return NT status that is) * * The list is generated from the samba doserr.h file by running : (echo "#include \"doserr.h\"";echo "#define W_ERROR(x) x";cat doserr.h | grep "^#define WERR" | grep -v "FOOBAR" | sed -e "s/^#define[ \t]//" | while read WERR junk;do echo int foo${WERR}=${WERR}";" ; done ) | cpp | grep "^int foo" | sed -e "s/^int foo/#define /" -e "s/=/ /" -e "s/;$//" * * [11/18/2013] The WERR_errors list was hand-edited to have all values be decimal, and then sorted by value. * * [11/19/2013] XXX - The samba doserr.h file no longer contains any WERR related entries. * WERR_errors list below left as is for now. */ #define WERR_errors_VALUE_STRING_LIST(XXX) \ XXX( WERR_OK , 0 ) /* 0x00000000 */ \ XXX( WERR_INVALID_FUNCTION , 1 ) /* 0x00000001 */ \ XXX( WERR_FILE_NOT_FOUND , 2 ) /* 0x00000002 */ \ XXX( WERR_PATH_NOT_FOUND , 3 ) /* 0x00000003 */ \ XXX( WERR_TOO_MANY_OPEN_FILES , 4 ) /* 0x00000004 */ \ XXX( WERR_ACCESS_DENIED , 5 ) /* 0x00000005 */ \ XXX( WERR_INVALID_HANDLE , 6 ) /* 0x00000006 */ \ XXX( WERR_ARENA_TRASHED , 7 ) /* 0x00000007 */ \ XXX( WERR_NOT_ENOUGH_MEMORY , 8 ) /* 0x00000008 */ \ XXX( WERR_INVALID_BLOCK , 9 ) /* 0x00000009 */ \ XXX( WERR_BAD_ENVIRONMENT , 10 ) /* 0x0000000a */ \ XXX( WERR_BAD_FORMAT , 11 ) /* 0x0000000b */ \ XXX( WERR_INVALID_ACCESS , 12 ) /* 0x0000000c */ \ XXX( WERR_INVALID_DATA , 13 ) /* 0x0000000d */ \ XXX( WERR_OUTOFMEMORY , 14 ) /* 0x0000000e */ \ XXX( WERR_INVALID_DRIVE , 15 ) /* 0x0000000f */ \ XXX( WERR_CURRENT_DIRECTORY , 16 ) /* 0x00000010 */ \ XXX( WERR_NOT_SAME_DEVICE , 17 ) /* 0x00000011 */ \ XXX( WERR_NO_MORE_FILES , 18 ) /* 0x00000012 */ \ XXX( WERR_WRITE_PROTECT , 19 ) /* 0x00000013 */ \ XXX( WERR_BAD_UNIT , 20 ) /* 0x00000014 */ \ XXX( WERR_NOT_READY , 21 ) /* 0x00000015 */ \ XXX( WERR_BAD_COMMAND , 22 ) /* 0x00000016 */ \ XXX( WERR_CRC , 23 ) /* 0x00000017 */ \ XXX( WERR_BAD_LENGTH , 24 ) /* 0x00000018 */ \ XXX( WERR_SEEK , 25 ) /* 0x00000019 */ \ XXX( WERR_NOT_DOS_DISK , 26 ) /* 0x0000001a */ \ XXX( WERR_SECTOR_NOT_FOUND , 27 ) /* 0x0000001b */ \ XXX( WERR_OUT_OF_PAPER , 28 ) /* 0x0000001c */ \ XXX( WERR_WRITE_FAULT , 29 ) /* 0x0000001d */ \ XXX( WERR_READ_FAULT , 30 ) /* 0x0000001e */ \ XXX( WERR_GEN_FAILURE , 31 ) /* 0x0000001f */ \ XXX( WERR_SHARING_VIOLATION , 32 ) /* 0x00000020 */ \ XXX( WERR_LOCK_VIOLATION , 33 ) /* 0x00000021 */ \ XXX( WERR_WRONG_DISK , 34 ) /* 0x00000022 */ \ XXX( WERR_CM_NO_MORE_HW_PROFILES , 35 ) /* 0x00000023 */ \ XXX( WERR_SHARING_BUFFER_EXCEEDED , 36 ) /* 0x00000024 */ \ XXX( WERR_CM_NO_SUCH_VALUE , 37 ) /* 0x00000025 */ \ XXX( WERR_HANDLE_EOF , 38 ) /* 0x00000026 */ \ XXX( WERR_HANDLE_DISK_FULL , 39 ) /* 0x00000027 */ \ XXX( WERR_NOT_SUPPORTED , 50 ) /* 0x00000032 */ \ XXX( WERR_REM_NOT_LIST , 51 ) /* 0x00000033 */ \ XXX( WERR_DUP_NAME , 52 ) /* 0x00000034 */ \ XXX( WERR_BAD_NETPATH , 53 ) /* 0x00000035 */ \ XXX( WERR_NETWORK_BUSY , 54 ) /* 0x00000036 */ \ XXX( WERR_DEV_NOT_EXIST , 55 ) /* 0x00000037 */ \ XXX( WERR_TOO_MANY_CMDS , 56 ) /* 0x00000038 */ \ XXX( WERR_ADAP_HDW_ERR , 57 ) /* 0x00000039 */ \ XXX( WERR_BAD_NET_RESP , 58 ) /* 0x0000003a */ \ XXX( WERR_UNEXP_NET_ERR , 59 ) /* 0x0000003b */ \ XXX( WERR_BAD_REM_ADAP , 60 ) /* 0x0000003c */ \ XXX( WERR_PRINTQ_FULL , 61 ) /* 0x0000003d */ \ XXX( WERR_NO_SPOOL_SPACE , 62 ) /* 0x0000003e */ \ XXX( WERR_PRINT_CANCELLED , 63 ) /* 0x0000003f */ \ XXX( WERR_NETNAME_DELETED , 64 ) /* 0x00000040 */ \ XXX( WERR_NETWORK_ACCESS_DENIED , 65 ) /* 0x00000041 */ \ XXX( WERR_BAD_DEV_TYPE , 66 ) /* 0x00000042 */ \ XXX( WERR_BAD_NET_NAME , 67 ) /* 0x00000043 */ \ XXX( WERR_TOO_MANY_NAMES , 68 ) /* 0x00000044 */ \ XXX( WERR_TOO_MANY_SESS , 69 ) /* 0x00000045 */ \ XXX( WERR_SHARING_PAUSED , 70 ) /* 0x00000046 */ \ XXX( WERR_REQ_NOT_ACCEP , 71 ) /* 0x00000047 */ \ XXX( WERR_REDIR_PAUSED , 72 ) /* 0x00000048 */ \ XXX( WERR_FILE_EXISTS , 80 ) /* 0x00000050 */ \ XXX( WERR_CANNOT_MAKE , 82 ) /* 0x00000052 */ \ XXX( WERR_FAIL_I24 , 83 ) /* 0x00000053 */ \ XXX( WERR_OUT_OF_STRUCTURES , 84 ) /* 0x00000054 */ \ XXX( WERR_ALREADY_ASSIGNED , 85 ) /* 0x00000055 */ \ XXX( WERR_INVALID_PASSWORD , 86 ) /* 0x00000056 */ \ XXX( WERR_INVALID_PARAMETER , 87 ) /* 0x00000057 */ \ XXX( WERR_NET_WRITE_FAULT , 88 ) /* 0x00000058 */ \ XXX( WERR_NO_PROC_SLOTS , 89 ) /* 0x00000059 */ \ XXX( WERR_TOO_MANY_SEMAPHORES , 100 ) /* 0x00000064 */ \ XXX( WERR_EXCL_SEM_ALREADY_OWNED , 101 ) /* 0x00000065 */ \ XXX( WERR_SEM_IS_SET , 102 ) /* 0x00000066 */ \ XXX( WERR_TOO_MANY_SEM_REQUESTS , 103 ) /* 0x00000067 */ \ XXX( WERR_INVALID_AT_INTERRUPT_TIME , 104 ) /* 0x00000068 */ \ XXX( WERR_SEM_OWNER_DIED , 105 ) /* 0x00000069 */ \ XXX( WERR_SEM_USER_LIMIT , 106 ) /* 0x0000006a */ \ XXX( WERR_DISK_CHANGE , 107 ) /* 0x0000006b */ \ XXX( WERR_DRIVE_LOCKED , 108 ) /* 0x0000006c */ \ XXX( WERR_BROKEN_PIPE , 109 ) /* 0x0000006d */ \ XXX( WERR_OPEN_FAILED , 110 ) /* 0x0000006e */ \ XXX( WERR_BUFFER_OVERFLOW , 111 ) /* 0x0000006f */ \ XXX( WERR_DISK_FULL , 112 ) /* 0x00000070 */ \ XXX( WERR_NO_MORE_SEARCH_HANDLES , 113 ) /* 0x00000071 */ \ XXX( WERR_INVALID_TARGET_HANDLE , 114 ) /* 0x00000072 */ \ XXX( WERR_INVALID_CATEGORY , 117 ) /* 0x00000075 */ \ XXX( WERR_INVALID_VERIFY_SWITCH , 118 ) /* 0x00000076 */ \ XXX( WERR_BAD_DRIVER_LEVEL , 119 ) /* 0x00000077 */ \ XXX( WERR_CALL_NOT_IMPLEMENTED , 120 ) /* 0x00000078 */ \ XXX( WERR_SEM_TIMEOUT , 121 ) /* 0x00000079 */ \ XXX( WERR_INSUFFICIENT_BUFFER , 122 ) /* 0x0000007a */ \ XXX( WERR_INVALID_NAME , 123 ) /* 0x0000007b */ \ XXX( WERR_INVALID_LEVEL , 124 ) /* 0x0000007c */ \ XXX( WERR_NO_VOLUME_LABEL , 125 ) /* 0x0000007d */ \ XXX( WERR_MOD_NOT_FOUND , 126 ) /* 0x0000007e */ \ XXX( WERR_PROC_NOT_FOUND , 127 ) /* 0x0000007f */ \ XXX( WERR_WAIT_NO_CHILDREN , 128 ) /* 0x00000080 */ \ XXX( WERR_CHILD_NOT_COMPLETE , 129 ) /* 0x00000081 */ \ XXX( WERR_DIRECT_ACCESS_HANDLE , 130 ) /* 0x00000082 */ \ XXX( WERR_NEGATIVE_SEEK , 131 ) /* 0x00000083 */ \ XXX( WERR_SEEK_ON_DEVICE , 132 ) /* 0x00000084 */ \ XXX( WERR_NOT_SUBSTED , 137 ) /* 0x00000089 */ \ XXX( WERR_JOIN_TO_JOIN , 138 ) /* 0x0000008a */ \ XXX( WERR_SUBST_TO_SUBST , 139 ) /* 0x0000008b */ \ XXX( WERR_JOIN_TO_SUBST , 140 ) /* 0x0000008c */ \ XXX( WERR_SAME_DRIVE , 143 ) /* 0x0000008f */ \ XXX( WERR_DIR_NOT_ROOT , 144 ) /* 0x00000090 */ \ XXX( WERR_DIR_NOT_EMPTY , 145 ) /* 0x00000091 */ \ XXX( WERR_IS_SUBST_PATH , 146 ) /* 0x00000092 */ \ XXX( WERR_IS_JOIN_PATH , 147 ) /* 0x00000093 */ \ XXX( WERR_PATH_BUSY , 148 ) /* 0x00000094 */ \ XXX( WERR_IS_SUBST_TARGET , 149 ) /* 0x00000095 */ \ XXX( WERR_SYSTEM_TRACE , 150 ) /* 0x00000096 */ \ XXX( WERR_INVALID_EVENT_COUNT , 151 ) /* 0x00000097 */ \ XXX( WERR_TOO_MANY_MUXWAITERS , 152 ) /* 0x00000098 */ \ XXX( WERR_INVALID_LIST_FORMAT , 153 ) /* 0x00000099 */ \ XXX( WERR_LABEL_TOO_LONG , 154 ) /* 0x0000009a */ \ XXX( WERR_TOO_MANY_TCBS , 155 ) /* 0x0000009b */ \ XXX( WERR_SIGNAL_REFUSED , 156 ) /* 0x0000009c */ \ XXX( WERR_DISCARDED , 157 ) /* 0x0000009d */ \ XXX( WERR_NOT_LOCKED , 158 ) /* 0x0000009e */ \ XXX( WERR_BAD_THREADID_ADDR , 159 ) /* 0x0000009f */ \ XXX( WERR_BAD_ARGUMENTS , 160 ) /* 0x000000a0 */ \ XXX( WERR_BAD_PATHNAME , 161 ) /* 0x000000a1 */ \ XXX( WERR_SIGNAL_PENDING , 162 ) /* 0x000000a2 */ \ XXX( WERR_MAX_THRDS_REACHED , 164 ) /* 0x000000a4 */ \ XXX( WERR_LOCK_FAILED , 167 ) /* 0x000000a7 */ \ XXX( WERR_BUSY , 170 ) /* 0x000000aa */ \ XXX( WERR_CANCEL_VIOLATION , 173 ) /* 0x000000ad */ \ XXX( WERR_ATOMIC_LOCKS_NOT_SUPPORTED , 174 ) /* 0x000000ae */ \ XXX( WERR_INVALID_SEGMENT_NUMBER , 180 ) /* 0x000000b4 */ \ XXX( WERR_INVALID_ORDINAL , 182 ) /* 0x000000b6 */ \ XXX( WERR_ALREADY_EXISTS , 183 ) /* 0x000000b7 */ \ XXX( WERR_INVALID_FLAG_NUMBER , 186 ) /* 0x000000ba */ \ XXX( WERR_SEM_NOT_FOUND , 187 ) /* 0x000000bb */ \ XXX( WERR_INVALID_STARTING_CODESEG , 188 ) /* 0x000000bc */ \ XXX( WERR_INVALID_STACKSEG , 189 ) /* 0x000000bd */ \ XXX( WERR_INVALID_MODULETYPE , 190 ) /* 0x000000be */ \ XXX( WERR_INVALID_EXE_SIGNATURE , 191 ) /* 0x000000bf */ \ XXX( WERR_EXE_MARKED_INVALID , 192 ) /* 0x000000c0 */ \ XXX( WERR_BAD_EXE_FORMAT , 193 ) /* 0x000000c1 */ \ XXX( WERR_ITERATED_DATA_EXCEEDS_64K , 194 ) /* 0x000000c2 */ \ XXX( WERR_INVALID_MINALLOCSIZE , 195 ) /* 0x000000c3 */ \ XXX( WERR_DYNLINK_FROM_INVALID_RING , 196 ) /* 0x000000c4 */ \ XXX( WERR_IOPL_NOT_ENABLED , 197 ) /* 0x000000c5 */ \ XXX( WERR_INVALID_SEGDPL , 198 ) /* 0x000000c6 */ \ XXX( WERR_AUTODATASEG_EXCEEDS_64K , 199 ) /* 0x000000c7 */ \ XXX( WERR_RING2SEG_MUST_BE_MOVABLE , 200 ) /* 0x000000c8 */ \ XXX( WERR_RELOC_CHAIN_XEEDS_SEGLIM , 201 ) /* 0x000000c9 */ \ XXX( WERR_INFLOOP_IN_RELOC_CHAIN , 202 ) /* 0x000000ca */ \ XXX( WERR_ENVVAR_NOT_FOUND , 203 ) /* 0x000000cb */ \ XXX( WERR_NO_SIGNAL_SENT , 205 ) /* 0x000000cd */ \ XXX( WERR_FILENAME_EXCED_RANGE , 206 ) /* 0x000000ce */ \ XXX( WERR_RING2_STACK_IN_USE , 207 ) /* 0x000000cf */ \ XXX( WERR_META_EXPANSION_TOO_LONG , 208 ) /* 0x000000d0 */ \ XXX( WERR_INVALID_SIGNAL_NUMBER , 209 ) /* 0x000000d1 */ \ XXX( WERR_THREAD_1_INACTIVE , 210 ) /* 0x000000d2 */ \ XXX( WERR_LOCKED , 212 ) /* 0x000000d4 */ \ XXX( WERR_TOO_MANY_MODULES , 214 ) /* 0x000000d6 */ \ XXX( WERR_NESTING_NOT_ALLOWED , 215 ) /* 0x000000d7 */ \ XXX( WERR_EXE_MACHINE_TYPE_MISMATCH , 216 ) /* 0x000000d8 */ \ XXX( WERR_EXE_CANNOT_MODIFY_SIGNED_BINARY , 217 ) /* 0x000000d9 */ \ XXX( WERR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY , 218 ) /* 0x000000da */ \ XXX( WERR_FILE_CHECKED_OUT , 220 ) /* 0x000000dc */ \ XXX( WERR_CHECKOUT_REQUIRED , 221 ) /* 0x000000dd */ \ XXX( WERR_BAD_FILE_TYPE , 222 ) /* 0x000000de */ \ XXX( WERR_FILE_TOO_LARGE , 223 ) /* 0x000000df */ \ XXX( WERR_FORMS_AUTH_REQUIRED , 224 ) /* 0x000000e0 */ \ XXX( WERR_VIRUS_INFECTED , 225 ) /* 0x000000e1 */ \ XXX( WERR_VIRUS_DELETED , 226 ) /* 0x000000e2 */ \ XXX( WERR_PIPE_LOCAL , 229 ) /* 0x000000e5 */ \ XXX( WERR_BAD_PIPE , 230 ) /* 0x000000e6 */ \ XXX( WERR_PIPE_BUSY , 231 ) /* 0x000000e7 */ \ XXX( WERR_NO_DATA , 232 ) /* 0x000000e8 */ \ XXX( WERR_PIPE_NOT_CONNECTED , 233 ) /* 0x000000e9 */ \ XXX( WERR_MORE_DATA , 234 ) /* 0x000000ea */ \ XXX( WERR_VC_DISCONNECTED , 240 ) /* 0x000000f0 */ \ XXX( WERR_INVALID_EA_NAME , 254 ) /* 0x000000fe */ \ XXX( WERR_EA_LIST_INCONSISTENT , 255 ) /* 0x000000ff */ \ XXX( WERR_WAIT_TIMEOUT , 258 ) /* 0x00000102 */ \ XXX( WERR_NO_MORE_ITEMS , 259 ) /* 0x00000103 */ \ XXX( WERR_STATUS_MORE_ENTRIES , 261 ) /* 0x00000105 */ \ XXX( WERR_CANNOT_COPY , 266 ) /* 0x0000010a */ \ XXX( WERR_DIRECTORY , 267 ) /* 0x0000010b */ \ XXX( WERR_EAS_DIDNT_FIT , 275 ) /* 0x00000113 */ \ XXX( WERR_EA_FILE_CORRUPT , 276 ) /* 0x00000114 */ \ XXX( WERR_EA_TABLE_FULL , 277 ) /* 0x00000115 */ \ XXX( WERR_INVALID_EA_HANDLE , 278 ) /* 0x00000116 */ \ XXX( WERR_EAS_NOT_SUPPORTED , 282 ) /* 0x0000011a */ \ XXX( WERR_NOT_OWNER , 288 ) /* 0x00000120 */ \ XXX( WERR_TOO_MANY_POSTS , 298 ) /* 0x0000012a */ \ XXX( WERR_PARTIAL_COPY , 299 ) /* 0x0000012b */ \ XXX( WERR_OPLOCK_NOT_GRANTED , 300 ) /* 0x0000012c */ \ XXX( WERR_INVALID_OPLOCK_PROTOCOL , 301 ) /* 0x0000012d */ \ XXX( WERR_DISK_TOO_FRAGMENTED , 302 ) /* 0x0000012e */ \ XXX( WERR_DELETE_PENDING , 303 ) /* 0x0000012f */ \ XXX( WERR_MR_MID_NOT_FOUND , 317 ) /* 0x0000013d */ \ XXX( WERR_SCOPE_NOT_FOUND , 318 ) /* 0x0000013e */ \ XXX( WERR_FAIL_NOACTION_REBOOT , 350 ) /* 0x0000015e */ \ XXX( WERR_FAIL_SHUTDOWN , 351 ) /* 0x0000015f */ \ XXX( WERR_FAIL_RESTART , 352 ) /* 0x00000160 */ \ XXX( WERR_MAX_SESSIONS_REACHED , 353 ) /* 0x00000161 */ \ XXX( WERR_THREAD_MODE_ALREADY_BACKGROUND , 400 ) /* 0x00000190 */ \ XXX( WERR_THREAD_MODE_NOT_BACKGROUND , 401 ) /* 0x00000191 */ \ XXX( WERR_PROCESS_MODE_ALREADY_BACKGROUND , 402 ) /* 0x00000192 */ \ XXX( WERR_PROCESS_MODE_NOT_BACKGROUND , 403 ) /* 0x00000193 */ \ XXX( WERR_INVALID_ADDRESS , 487 ) /* 0x000001e7 */ \ XXX( WERR_USER_PROFILE_LOAD , 500 ) /* 0x000001f4 */ \ XXX( WERR_ARITHMETIC_OVERFLOW , 534 ) /* 0x00000216 */ \ XXX( WERR_PIPE_CONNECTED , 535 ) /* 0x00000217 */ \ XXX( WERR_PIPE_LISTENING , 536 ) /* 0x00000218 */ \ XXX( WERR_VERIFIER_STOP , 537 ) /* 0x00000219 */ \ XXX( WERR_ABIOS_ERROR , 538 ) /* 0x0000021a */ \ XXX( WERR_WX86_WARNING , 539 ) /* 0x0000021b */ \ XXX( WERR_WX86_ERROR , 540 ) /* 0x0000021c */ \ XXX( WERR_TIMER_NOT_CANCELED , 541 ) /* 0x0000021d */ \ XXX( WERR_UNWIND , 542 ) /* 0x0000021e */ \ XXX( WERR_BAD_STACK , 543 ) /* 0x0000021f */ \ XXX( WERR_INVALID_UNWIND_TARGET , 544 ) /* 0x00000220 */ \ XXX( WERR_INVALID_PORT_ATTRIBUTES , 545 ) /* 0x00000221 */ \ XXX( WERR_PORT_MESSAGE_TOO_LONG , 546 ) /* 0x00000222 */ \ XXX( WERR_INVALID_QUOTA_LOWER , 547 ) /* 0x00000223 */ \ XXX( WERR_DEVICE_ALREADY_ATTACHED , 548 ) /* 0x00000224 */ \ XXX( WERR_INSTRUCTION_MISALIGNMENT , 549 ) /* 0x00000225 */ \ XXX( WERR_PROFILING_NOT_STARTED , 550 ) /* 0x00000226 */ \ XXX( WERR_PROFILING_NOT_STOPPED , 551 ) /* 0x00000227 */ \ XXX( WERR_COULD_NOT_INTERPRET , 552 ) /* 0x00000228 */ \ XXX( WERR_PROFILING_AT_LIMIT , 553 ) /* 0x00000229 */ \ XXX( WERR_CANT_WAIT , 554 ) /* 0x0000022a */ \ XXX( WERR_CANT_TERMINATE_SELF , 555 ) /* 0x0000022b */ \ XXX( WERR_UNEXPECTED_MM_CREATE_ERR , 556 ) /* 0x0000022c */ \ XXX( WERR_UNEXPECTED_MM_MAP_ERROR , 557 ) /* 0x0000022d */ \ XXX( WERR_UNEXPECTED_MM_EXTEND_ERR , 558 ) /* 0x0000022e */ \ XXX( WERR_BAD_FUNCTION_TABLE , 559 ) /* 0x0000022f */ \ XXX( WERR_NO_GUID_TRANSLATION , 560 ) /* 0x00000230 */ \ XXX( WERR_INVALID_LDT_SIZE , 561 ) /* 0x00000231 */ \ XXX( WERR_INVALID_LDT_OFFSET , 563 ) /* 0x00000233 */ \ XXX( WERR_INVALID_LDT_DESCRIPTOR , 564 ) /* 0x00000234 */ \ XXX( WERR_TOO_MANY_THREADS , 565 ) /* 0x00000235 */ \ XXX( WERR_THREAD_NOT_IN_PROCESS , 566 ) /* 0x00000236 */ \ XXX( WERR_PAGEFILE_QUOTA_EXCEEDED , 567 ) /* 0x00000237 */ \ XXX( WERR_LOGON_SERVER_CONFLICT , 568 ) /* 0x00000238 */ \ XXX( WERR_SYNCHRONIZATION_REQUIRED , 569 ) /* 0x00000239 */ \ XXX( WERR_NET_OPEN_FAILED , 570 ) /* 0x0000023a */ \ XXX( WERR_IO_PRIVILEGE_FAILED , 571 ) /* 0x0000023b */ \ XXX( WERR_CONTROL_C_EXIT , 572 ) /* 0x0000023c */ \ XXX( WERR_MISSING_SYSTEMFILE , 573 ) /* 0x0000023d */ \ XXX( WERR_UNHANDLED_EXCEPTION , 574 ) /* 0x0000023e */ \ XXX( WERR_APP_INIT_FAILURE , 575 ) /* 0x0000023f */ \ XXX( WERR_PAGEFILE_CREATE_FAILED , 576 ) /* 0x00000240 */ \ XXX( WERR_INVALID_IMAGE_HASH , 577 ) /* 0x00000241 */ \ XXX( WERR_NO_PAGEFILE , 578 ) /* 0x00000242 */ \ XXX( WERR_ILLEGAL_FLOAT_CONTEXT , 579 ) /* 0x00000243 */ \ XXX( WERR_NO_EVENT_PAIR , 580 ) /* 0x00000244 */ \ XXX( WERR_DOMAIN_CTRLR_CONFIG_ERROR , 581 ) /* 0x00000245 */ \ XXX( WERR_ILLEGAL_CHARACTER , 582 ) /* 0x00000246 */ \ XXX( WERR_UNDEFINED_CHARACTER , 583 ) /* 0x00000247 */ \ XXX( WERR_FLOPPY_VOLUME , 584 ) /* 0x00000248 */ \ XXX( WERR_BIOS_FAILED_TO_CONNECT_INTERRUPT , 585 ) /* 0x00000249 */ \ XXX( WERR_BACKUP_CONTROLLER , 586 ) /* 0x0000024a */ \ XXX( WERR_MUTANT_LIMIT_EXCEEDED , 587 ) /* 0x0000024b */ \ XXX( WERR_FS_DRIVER_REQUIRED , 588 ) /* 0x0000024c */ \ XXX( WERR_CANNOT_LOAD_REGISTRY_FILE , 589 ) /* 0x0000024d */ \ XXX( WERR_DEBUG_ATTACH_FAILED , 590 ) /* 0x0000024e */ \ XXX( WERR_SYSTEM_PROCESS_TERMINATED , 591 ) /* 0x0000024f */ \ XXX( WERR_DATA_NOT_ACCEPTED , 592 ) /* 0x00000250 */ \ XXX( WERR_VDM_HARD_ERROR , 593 ) /* 0x00000251 */ \ XXX( WERR_DRIVER_CANCEL_TIMEOUT , 594 ) /* 0x00000252 */ \ XXX( WERR_REPLY_MESSAGE_MISMATCH , 595 ) /* 0x00000253 */ \ XXX( WERR_LOST_WRITEBEHIND_DATA , 596 ) /* 0x00000254 */ \ XXX( WERR_CLIENT_SERVER_PARAMETERS_INVALID , 597 ) /* 0x00000255 */ \ XXX( WERR_NOT_TINY_STREAM , 598 ) /* 0x00000256 */ \ XXX( WERR_STACK_OVERFLOW_READ , 599 ) /* 0x00000257 */ \ XXX( WERR_CONVERT_TO_LARGE , 600 ) /* 0x00000258 */ \ XXX( WERR_FOUND_OUT_OF_SCOPE , 601 ) /* 0x00000259 */ \ XXX( WERR_ALLOCATE_BUCKET , 602 ) /* 0x0000025a */ \ XXX( WERR_MARSHALL_OVERFLOW , 603 ) /* 0x0000025b */ \ XXX( WERR_INVALID_VARIANT , 604 ) /* 0x0000025c */ \ XXX( WERR_BAD_COMPRESSION_BUFFER , 605 ) /* 0x0000025d */ \ XXX( WERR_AUDIT_FAILED , 606 ) /* 0x0000025e */ \ XXX( WERR_TIMER_RESOLUTION_NOT_SET , 607 ) /* 0x0000025f */ \ XXX( WERR_INSUFFICIENT_LOGON_INFO , 608 ) /* 0x00000260 */ \ XXX( WERR_BAD_DLL_ENTRYPOINT , 609 ) /* 0x00000261 */ \ XXX( WERR_BAD_SERVICE_ENTRYPOINT , 610 ) /* 0x00000262 */ \ XXX( WERR_IP_ADDRESS_CONFLICT1 , 611 ) /* 0x00000263 */ \ XXX( WERR_IP_ADDRESS_CONFLICT2 , 612 ) /* 0x00000264 */ \ XXX( WERR_REGISTRY_QUOTA_LIMIT , 613 ) /* 0x00000265 */ \ XXX( WERR_NO_CALLBACK_ACTIVE , 614 ) /* 0x00000266 */ \ XXX( WERR_PWD_TOO_SHORT , 615 ) /* 0x00000267 */ \ XXX( WERR_PWD_TOO_RECENT , 616 ) /* 0x00000268 */ \ XXX( WERR_PWD_HISTORY_CONFLICT , 617 ) /* 0x00000269 */ \ XXX( WERR_UNSUPPORTED_COMPRESSION , 618 ) /* 0x0000026a */ \ XXX( WERR_INVALID_HW_PROFILE , 619 ) /* 0x0000026b */ \ XXX( WERR_INVALID_PLUGPLAY_DEVICE_PATH , 620 ) /* 0x0000026c */ \ XXX( WERR_QUOTA_LIST_INCONSISTENT , 621 ) /* 0x0000026d */ \ XXX( WERR_EVALUATION_EXPIRATION , 622 ) /* 0x0000026e */ \ XXX( WERR_ILLEGAL_DLL_RELOCATION , 623 ) /* 0x0000026f */ \ XXX( WERR_DLL_INIT_FAILED_LOGOFF , 624 ) /* 0x00000270 */ \ XXX( WERR_VALIDATE_CONTINUE , 625 ) /* 0x00000271 */ \ XXX( WERR_NO_MORE_MATCHES , 626 ) /* 0x00000272 */ \ XXX( WERR_RANGE_LIST_CONFLICT , 627 ) /* 0x00000273 */ \ XXX( WERR_SERVER_SID_MISMATCH , 628 ) /* 0x00000274 */ \ XXX( WERR_CANT_ENABLE_DENY_ONLY , 629 ) /* 0x00000275 */ \ XXX( WERR_FLOAT_MULTIPLE_FAULTS , 630 ) /* 0x00000276 */ \ XXX( WERR_FLOAT_MULTIPLE_TRAPS , 631 ) /* 0x00000277 */ \ XXX( WERR_NOINTERFACE , 632 ) /* 0x00000278 */ \ XXX( WERR_DRIVER_FAILED_SLEEP , 633 ) /* 0x00000279 */ \ XXX( WERR_CORRUPT_SYSTEM_FILE , 634 ) /* 0x0000027a */ \ XXX( WERR_COMMITMENT_MINIMUM , 635 ) /* 0x0000027b */ \ XXX( WERR_PNP_RESTART_ENUMERATION , 636 ) /* 0x0000027c */ \ XXX( WERR_SYSTEM_IMAGE_BAD_SIGNATURE , 637 ) /* 0x0000027d */ \ XXX( WERR_PNP_REBOOT_REQUIRED , 638 ) /* 0x0000027e */ \ XXX( WERR_INSUFFICIENT_POWER , 639 ) /* 0x0000027f */ \ XXX( WERR_MULTIPLE_FAULT_VIOLATION , 640 ) /* 0x00000280 */ \ XXX( WERR_SYSTEM_SHUTDOWN , 641 ) /* 0x00000281 */ \ XXX( WERR_PORT_NOT_SET , 642 ) /* 0x00000282 */ \ XXX( WERR_DS_VERSION_CHECK_FAILURE , 643 ) /* 0x00000283 */ \ XXX( WERR_RANGE_NOT_FOUND , 644 ) /* 0x00000284 */ \ XXX( WERR_NOT_SAFE_MODE_DRIVER , 646 ) /* 0x00000286 */ \ XXX( WERR_FAILED_DRIVER_ENTRY , 647 ) /* 0x00000287 */ \ XXX( WERR_DEVICE_ENUMERATION_ERROR , 648 ) /* 0x00000288 */ \ XXX( WERR_MOUNT_POINT_NOT_RESOLVED , 649 ) /* 0x00000289 */ \ XXX( WERR_INVALID_DEVICE_OBJECT_PARAMETER , 650 ) /* 0x0000028a */ \ XXX( WERR_MCA_OCCURED , 651 ) /* 0x0000028b */ \ XXX( WERR_DRIVER_DATABASE_ERROR , 652 ) /* 0x0000028c */ \ XXX( WERR_SYSTEM_HIVE_TOO_LARGE , 653 ) /* 0x0000028d */ \ XXX( WERR_DRIVER_FAILED_PRIOR_UNLOAD , 654 ) /* 0x0000028e */ \ XXX( WERR_VOLSNAP_PREPARE_HIBERNATE , 655 ) /* 0x0000028f */ \ XXX( WERR_HIBERNATION_FAILURE , 656 ) /* 0x00000290 */ \ XXX( WERR_FILE_SYSTEM_LIMITATION , 665 ) /* 0x00000299 */ \ XXX( WERR_ASSERTION_FAILURE , 668 ) /* 0x0000029c */ \ XXX( WERR_ACPI_ERROR , 669 ) /* 0x0000029d */ \ XXX( WERR_WOW_ASSERTION , 670 ) /* 0x0000029e */ \ XXX( WERR_PNP_BAD_MPS_TABLE , 671 ) /* 0x0000029f */ \ XXX( WERR_PNP_TRANSLATION_FAILED , 672 ) /* 0x000002a0 */ \ XXX( WERR_PNP_IRQ_TRANSLATION_FAILED , 673 ) /* 0x000002a1 */ \ XXX( WERR_PNP_INVALID_ID , 674 ) /* 0x000002a2 */ \ XXX( WERR_WAKE_SYSTEM_DEBUGGER , 675 ) /* 0x000002a3 */ \ XXX( WERR_HANDLES_CLOSED , 676 ) /* 0x000002a4 */ \ XXX( WERR_EXTRANEOUS_INFORMATION , 677 ) /* 0x000002a5 */ \ XXX( WERR_RXACT_COMMIT_NECESSARY , 678 ) /* 0x000002a6 */ \ XXX( WERR_MEDIA_CHECK , 679 ) /* 0x000002a7 */ \ XXX( WERR_GUID_SUBSTITUTION_MADE , 680 ) /* 0x000002a8 */ \ XXX( WERR_STOPPED_ON_SYMLINK , 681 ) /* 0x000002a9 */ \ XXX( WERR_LONGJUMP , 682 ) /* 0x000002aa */ \ XXX( WERR_PLUGPLAY_QUERY_VETOED , 683 ) /* 0x000002ab */ \ XXX( WERR_UNWIND_CONSOLIDATE , 684 ) /* 0x000002ac */ \ XXX( WERR_REGISTRY_HIVE_RECOVERED , 685 ) /* 0x000002ad */ \ XXX( WERR_DLL_MIGHT_BE_INSECURE , 686 ) /* 0x000002ae */ \ XXX( WERR_DLL_MIGHT_BE_INCOMPATIBLE , 687 ) /* 0x000002af */ \ XXX( WERR_DBG_EXCEPTION_NOT_HANDLED , 688 ) /* 0x000002b0 */ \ XXX( WERR_DBG_REPLY_LATER , 689 ) /* 0x000002b1 */ \ XXX( WERR_DBG_UNABLE_TO_PROVIDE_HANDLE , 690 ) /* 0x000002b2 */ \ XXX( WERR_DBG_TERMINATE_THREAD , 691 ) /* 0x000002b3 */ \ XXX( WERR_DBG_TERMINATE_PROCESS , 692 ) /* 0x000002b4 */ \ XXX( WERR_DBG_CONTROL_C , 693 ) /* 0x000002b5 */ \ XXX( WERR_DBG_PRINTEXCEPTION_C , 694 ) /* 0x000002b6 */ \ XXX( WERR_DBG_RIPEXCEPTION , 695 ) /* 0x000002b7 */ \ XXX( WERR_DBG_CONTROL_BREAK , 696 ) /* 0x000002b8 */ \ XXX( WERR_DBG_COMMAND_EXCEPTION , 697 ) /* 0x000002b9 */ \ XXX( WERR_OBJECT_NAME_EXISTS , 698 ) /* 0x000002ba */ \ XXX( WERR_THREAD_WAS_SUSPENDED , 699 ) /* 0x000002bb */ \ XXX( WERR_IMAGE_NOT_AT_BASE , 700 ) /* 0x000002bc */ \ XXX( WERR_RXACT_STATE_CREATED , 701 ) /* 0x000002bd */ \ XXX( WERR_SEGMENT_NOTIFICATION , 702 ) /* 0x000002be */ \ XXX( WERR_BAD_CURRENT_DIRECTORY , 703 ) /* 0x000002bf */ \ XXX( WERR_FT_READ_RECOVERY_FROM_BACKUP , 704 ) /* 0x000002c0 */ \ XXX( WERR_FT_WRITE_RECOVERY , 705 ) /* 0x000002c1 */ \ XXX( WERR_IMAGE_MACHINE_TYPE_MISMATCH , 706 ) /* 0x000002c2 */ \ XXX( WERR_RECEIVE_PARTIAL , 707 ) /* 0x000002c3 */ \ XXX( WERR_RECEIVE_EXPEDITED , 708 ) /* 0x000002c4 */ \ XXX( WERR_RECEIVE_PARTIAL_EXPEDITED , 709 ) /* 0x000002c5 */ \ XXX( WERR_EVENT_DONE , 710 ) /* 0x000002c6 */ \ XXX( WERR_EVENT_PENDING , 711 ) /* 0x000002c7 */ \ XXX( WERR_CHECKING_FILE_SYSTEM , 712 ) /* 0x000002c8 */ \ XXX( WERR_FATAL_APP_EXIT , 713 ) /* 0x000002c9 */ \ XXX( WERR_PREDEFINED_HANDLE , 714 ) /* 0x000002ca */ \ XXX( WERR_WAS_UNLOCKED , 715 ) /* 0x000002cb */ \ XXX( WERR_SERVICE_NOTIFICATION , 716 ) /* 0x000002cc */ \ XXX( WERR_WAS_LOCKED , 717 ) /* 0x000002cd */ \ XXX( WERR_LOG_HARD_ERROR , 718 ) /* 0x000002ce */ \ XXX( WERR_ALREADY_WIN32 , 719 ) /* 0x000002cf */ \ XXX( WERR_IMAGE_MACHINE_TYPE_MISMATCH_EXE , 720 ) /* 0x000002d0 */ \ XXX( WERR_NO_YIELD_PERFORMED , 721 ) /* 0x000002d1 */ \ XXX( WERR_TIMER_RESUME_IGNORED , 722 ) /* 0x000002d2 */ \ XXX( WERR_ARBITRATION_UNHANDLED , 723 ) /* 0x000002d3 */ \ XXX( WERR_CARDBUS_NOT_SUPPORTED , 724 ) /* 0x000002d4 */ \ XXX( WERR_MP_PROCESSOR_MISMATCH , 725 ) /* 0x000002d5 */ \ XXX( WERR_HIBERNATED , 726 ) /* 0x000002d6 */ \ XXX( WERR_RESUME_HIBERNATION , 727 ) /* 0x000002d7 */ \ XXX( WERR_FIRMWARE_UPDATED , 728 ) /* 0x000002d8 */ \ XXX( WERR_DRIVERS_LEAKING_LOCKED_PAGES , 729 ) /* 0x000002d9 */ \ XXX( WERR_WAKE_SYSTEM , 730 ) /* 0x000002da */ \ XXX( WERR_WAIT_1 , 731 ) /* 0x000002db */ \ XXX( WERR_WAIT_2 , 732 ) /* 0x000002dc */ \ XXX( WERR_WAIT_3 , 733 ) /* 0x000002dd */ \ XXX( WERR_WAIT_63 , 734 ) /* 0x000002de */ \ XXX( WERR_ABANDONED_WAIT_0 , 735 ) /* 0x000002df */ \ XXX( WERR_ABANDONED_WAIT_63 , 736 ) /* 0x000002e0 */ \ XXX( WERR_USER_APC , 737 ) /* 0x000002e1 */ \ XXX( WERR_KERNEL_APC , 738 ) /* 0x000002e2 */ \ XXX( WERR_ALERTED , 739 ) /* 0x000002e3 */ \ XXX( WERR_ELEVATION_REQUIRED , 740 ) /* 0x000002e4 */ \ XXX( WERR_REPARSE , 741 ) /* 0x000002e5 */ \ XXX( WERR_OPLOCK_BREAK_IN_PROGRESS , 742 ) /* 0x000002e6 */ \ XXX( WERR_VOLUME_MOUNTED , 743 ) /* 0x000002e7 */ \ XXX( WERR_RXACT_COMMITTED , 744 ) /* 0x000002e8 */ \ XXX( WERR_NOTIFY_CLEANUP , 745 ) /* 0x000002e9 */ \ XXX( WERR_PRIMARY_TRANSPORT_CONNECT_FAILED , 746 ) /* 0x000002ea */ \ XXX( WERR_PAGE_FAULT_TRANSITION , 747 ) /* 0x000002eb */ \ XXX( WERR_PAGE_FAULT_DEMAND_ZERO , 748 ) /* 0x000002ec */ \ XXX( WERR_PAGE_FAULT_COPY_ON_WRITE , 749 ) /* 0x000002ed */ \ XXX( WERR_PAGE_FAULT_GUARD_PAGE , 750 ) /* 0x000002ee */ \ XXX( WERR_PAGE_FAULT_PAGING_FILE , 751 ) /* 0x000002ef */ \ XXX( WERR_CACHE_PAGE_LOCKED , 752 ) /* 0x000002f0 */ \ XXX( WERR_CRASH_DUMP , 753 ) /* 0x000002f1 */ \ XXX( WERR_BUFFER_ALL_ZEROS , 754 ) /* 0x000002f2 */ \ XXX( WERR_REPARSE_OBJECT , 755 ) /* 0x000002f3 */ \ XXX( WERR_RESOURCE_REQUIREMENTS_CHANGED , 756 ) /* 0x000002f4 */ \ XXX( WERR_TRANSLATION_COMPLETE , 757 ) /* 0x000002f5 */ \ XXX( WERR_NOTHING_TO_TERMINATE , 758 ) /* 0x000002f6 */ \ XXX( WERR_PROCESS_NOT_IN_JOB , 759 ) /* 0x000002f7 */ \ XXX( WERR_PROCESS_IN_JOB , 760 ) /* 0x000002f8 */ \ XXX( WERR_VOLSNAP_HIBERNATE_READY , 761 ) /* 0x000002f9 */ \ XXX( WERR_FSFILTER_OP_COMPLETED_SUCCESSFULLY , 762 ) /* 0x000002fa */ \ XXX( WERR_INTERRUPT_VECTOR_ALREADY_CONNECTED , 763 ) /* 0x000002fb */ \ XXX( WERR_INTERRUPT_STILL_CONNECTED , 764 ) /* 0x000002fc */ \ XXX( WERR_WAIT_FOR_OPLOCK , 765 ) /* 0x000002fd */ \ XXX( WERR_DBG_EXCEPTION_HANDLED , 766 ) /* 0x000002fe */ \ XXX( WERR_DBG_CONTINUE , 767 ) /* 0x000002ff */ \ XXX( WERR_CALLBACK_POP_STACK , 768 ) /* 0x00000300 */ \ XXX( WERR_COMPRESSION_DISABLED , 769 ) /* 0x00000301 */ \ XXX( WERR_CANTFETCHBACKWARDS , 770 ) /* 0x00000302 */ \ XXX( WERR_CANTSCROLLBACKWARDS , 771 ) /* 0x00000303 */ \ XXX( WERR_ROWSNOTRELEASED , 772 ) /* 0x00000304 */ \ XXX( WERR_BAD_ACCESSOR_FLAGS , 773 ) /* 0x00000305 */ \ XXX( WERR_ERRORS_ENCOUNTERED , 774 ) /* 0x00000306 */ \ XXX( WERR_NOT_CAPABLE , 775 ) /* 0x00000307 */ \ XXX( WERR_REQUEST_OUT_OF_SEQUENCE , 776 ) /* 0x00000308 */ \ XXX( WERR_VERSION_PARSE_ERROR , 777 ) /* 0x00000309 */ \ XXX( WERR_BADSTARTPOSITION , 778 ) /* 0x0000030a */ \ XXX( WERR_MEMORY_HARDWARE , 779 ) /* 0x0000030b */ \ XXX( WERR_DISK_REPAIR_DISABLED , 780 ) /* 0x0000030c */ \ XXX( WERR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE, 781 ) /* 0x0000030d */ \ XXX( WERR_SYSTEM_POWERSTATE_TRANSITION , 782 ) /* 0x0000030e */ \ XXX( WERR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION , 783 ) /* 0x0000030f */ \ XXX( WERR_MCA_EXCEPTION , 784 ) /* 0x00000310 */ \ XXX( WERR_ACCESS_AUDIT_BY_POLICY , 785 ) /* 0x00000311 */ \ XXX( WERR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY , 786 ) /* 0x00000312 */ \ XXX( WERR_ABANDON_HIBERFILE , 787 ) /* 0x00000313 */ \ XXX( WERR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED , 788 ) /* 0x00000314 */ \ XXX( WERR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR , 789 ) /* 0x00000315 */ \ XXX( WERR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR , 790 ) /* 0x00000316 */ \ XXX( WERR_EA_ACCESS_DENIED , 994 ) /* 0x000003e2 */ \ XXX( WERR_OPERATION_ABORTED , 995 ) /* 0x000003e3 */ \ XXX( WERR_IO_INCOMPLETE , 996 ) /* 0x000003e4 */ \ XXX( WERR_IO_PENDING , 997 ) /* 0x000003e5 */ \ XXX( WERR_NOACCESS , 998 ) /* 0x000003e6 */ \ XXX( WERR_SWAPERROR , 999 ) /* 0x000003e7 */ \ XXX( WERR_STACK_OVERFLOW , 1001 ) /* 0x000003e9 */ \ XXX( WERR_INVALID_MESSAGE , 1002 ) /* 0x000003ea */ \ XXX( WERR_CAN_NOT_COMPLETE , 1003 ) /* 0x000003eb */ \ XXX( WERR_INVALID_FLAGS , 1004 ) /* 0x000003ec */ \ XXX( WERR_UNRECOGNIZED_VOLUME , 1005 ) /* 0x000003ed */ \ XXX( WERR_FILE_INVALID , 1006 ) /* 0x000003ee */ \ XXX( WERR_FULLSCREEN_MODE , 1007 ) /* 0x000003ef */ \ XXX( WERR_NO_TOKEN , 1008 ) /* 0x000003f0 */ \ XXX( WERR_BADDB , 1009 ) /* 0x000003f1 */ \ XXX( WERR_BADKEY , 1010 ) /* 0x000003f2 */ \ XXX( WERR_CANTOPEN , 1011 ) /* 0x000003f3 */ \ XXX( WERR_CANTREAD , 1012 ) /* 0x000003f4 */ \ XXX( WERR_CANTWRITE , 1013 ) /* 0x000003f5 */ \ XXX( WERR_REGISTRY_RECOVERED , 1014 ) /* 0x000003f6 */ \ XXX( WERR_REGISTRY_CORRUPT , 1015 ) /* 0x000003f7 */ \ XXX( WERR_REGISTRY_IO_FAILED , 1016 ) /* 0x000003f8 */ \ XXX( WERR_NOT_REGISTRY_FILE , 1017 ) /* 0x000003f9 */ \ XXX( WERR_KEY_DELETED , 1018 ) /* 0x000003fa */ \ XXX( WERR_NO_LOG_SPACE , 1019 ) /* 0x000003fb */ \ XXX( WERR_KEY_HAS_CHILDREN , 1020 ) /* 0x000003fc */ \ XXX( WERR_CHILD_MUST_BE_VOLATILE , 1021 ) /* 0x000003fd */ \ XXX( WERR_NOTIFY_ENUM_DIR , 1022 ) /* 0x000003fe */ \ XXX( WERR_DEPENDENT_SERVICES_RUNNING , 1051 ) /* 0x0000041b */ \ XXX( WERR_INVALID_SERVICE_CONTROL , 1052 ) /* 0x0000041c */ \ XXX( WERR_SERVICE_REQUEST_TIMEOUT , 1053 ) /* 0x0000041d */ \ XXX( WERR_SERVICE_NO_THREAD , 1054 ) /* 0x0000041e */ \ XXX( WERR_SERVICE_DATABASE_LOCKED , 1055 ) /* 0x0000041f */ \ XXX( WERR_SERVICE_ALREADY_RUNNING , 1056 ) /* 0x00000420 */ \ XXX( WERR_INVALID_SERVICE_ACCOUNT , 1057 ) /* 0x00000421 */ \ XXX( WERR_SERVICE_DISABLED , 1058 ) /* 0x00000422 */ \ XXX( WERR_CIRCULAR_DEPENDENCY , 1059 ) /* 0x00000423 */ \ XXX( WERR_SERVICE_DOES_NOT_EXIST , 1060 ) /* 0x00000424 */ \ XXX( WERR_SERVICE_CANNOT_ACCEPT_CTRL , 1061 ) /* 0x00000425 */ \ XXX( WERR_SERVICE_NOT_ACTIVE , 1062 ) /* 0x00000426 */ \ XXX( WERR_FAILED_SERVICE_CONTROLLER_CONNECT , 1063 ) /* 0x00000427 */ \ XXX( WERR_EXCEPTION_IN_SERVICE , 1064 ) /* 0x00000428 */ \ XXX( WERR_DATABASE_DOES_NOT_EXIST , 1065 ) /* 0x00000429 */ \ XXX( WERR_SERVICE_SPECIFIC_ERROR , 1066 ) /* 0x0000042a */ \ XXX( WERR_PROCESS_ABORTED , 1067 ) /* 0x0000042b */ \ XXX( WERR_SERVICE_DEPENDENCY_FAIL , 1068 ) /* 0x0000042c */ \ XXX( WERR_SERVICE_LOGON_FAILED , 1069 ) /* 0x0000042d */ \ XXX( WERR_SERVICE_START_HANG , 1070 ) /* 0x0000042e */ \ XXX( WERR_INVALID_SERVICE_LOCK , 1071 ) /* 0x0000042f */ \ XXX( WERR_SERVICE_MARKED_FOR_DELETE , 1072 ) /* 0x00000430 */ \ XXX( WERR_SERVICE_EXISTS , 1073 ) /* 0x00000431 */ \ XXX( WERR_ALREADY_RUNNING_LKG , 1074 ) /* 0x00000432 */ \ XXX( WERR_SERVICE_DEPENDENCY_DELETED , 1075 ) /* 0x00000433 */ \ XXX( WERR_BOOT_ALREADY_ACCEPTED , 1076 ) /* 0x00000434 */ \ XXX( WERR_SERVICE_NEVER_STARTED , 1077 ) /* 0x00000435 */ \ XXX( WERR_DUPLICATE_SERVICE_NAME , 1078 ) /* 0x00000436 */ \ XXX( WERR_DIFFERENT_SERVICE_ACCOUNT , 1079 ) /* 0x00000437 */ \ XXX( WERR_CANNOT_DETECT_DRIVER_FAILURE , 1080 ) /* 0x00000438 */ \ XXX( WERR_CANNOT_DETECT_PROCESS_ABORT , 1081 ) /* 0x00000439 */ \ XXX( WERR_NO_RECOVERY_PROGRAM , 1082 ) /* 0x0000043a */ \ XXX( WERR_SERVICE_NOT_IN_EXE , 1083 ) /* 0x0000043b */ \ XXX( WERR_NOT_SAFEBOOT_SERVICE , 1084 ) /* 0x0000043c */ \ XXX( WERR_END_OF_MEDIA , 1100 ) /* 0x0000044c */ \ XXX( WERR_FILEMARK_DETECTED , 1101 ) /* 0x0000044d */ \ XXX( WERR_BEGINNING_OF_MEDIA , 1102 ) /* 0x0000044e */ \ XXX( WERR_SETMARK_DETECTED , 1103 ) /* 0x0000044f */ \ XXX( WERR_NO_DATA_DETECTED , 1104 ) /* 0x00000450 */ \ XXX( WERR_PARTITION_FAILURE , 1105 ) /* 0x00000451 */ \ XXX( WERR_INVALID_BLOCK_LENGTH , 1106 ) /* 0x00000452 */ \ XXX( WERR_DEVICE_NOT_PARTITIONED , 1107 ) /* 0x00000453 */ \ XXX( WERR_UNABLE_TO_LOCK_MEDIA , 1108 ) /* 0x00000454 */ \ XXX( WERR_UNABLE_TO_UNLOAD_MEDIA , 1109 ) /* 0x00000455 */ \ XXX( WERR_MEDIA_CHANGED , 1110 ) /* 0x00000456 */ \ XXX( WERR_BUS_RESET , 1111 ) /* 0x00000457 */ \ XXX( WERR_NO_MEDIA_IN_DRIVE , 1112 ) /* 0x00000458 */ \ XXX( WERR_NO_UNICODE_TRANSLATION , 1113 ) /* 0x00000459 */ \ XXX( WERR_DLL_INIT_FAILED , 1114 ) /* 0x0000045a */ \ XXX( WERR_SHUTDOWN_IN_PROGRESS , 1115 ) /* 0x0000045b */ \ XXX( WERR_NO_SHUTDOWN_IN_PROGRESS , 1116 ) /* 0x0000045c */ \ XXX( WERR_IO_DEVICE , 1117 ) /* 0x0000045d */ \ XXX( WERR_SERIAL_NO_DEVICE , 1118 ) /* 0x0000045e */ \ XXX( WERR_IRQ_BUSY , 1119 ) /* 0x0000045f */ \ XXX( WERR_MORE_WRITES , 1120 ) /* 0x00000460 */ \ XXX( WERR_COUNTER_TIMEOUT , 1121 ) /* 0x00000461 */ \ XXX( WERR_FLOPPY_ID_MARK_NOT_FOUND , 1122 ) /* 0x00000462 */ \ XXX( WERR_FLOPPY_WRONG_CYLINDER , 1123 ) /* 0x00000463 */ \ XXX( WERR_FLOPPY_UNKNOWN_ERROR , 1124 ) /* 0x00000464 */ \ XXX( WERR_FLOPPY_BAD_REGISTERS , 1125 ) /* 0x00000465 */ \ XXX( WERR_DISK_RECALIBRATE_FAILED , 1126 ) /* 0x00000466 */ \ XXX( WERR_DISK_OPERATION_FAILED , 1127 ) /* 0x00000467 */ \ XXX( WERR_DISK_RESET_FAILED , 1128 ) /* 0x00000468 */ \ XXX( WERR_EOM_OVERFLOW , 1129 ) /* 0x00000469 */ \ XXX( WERR_NOT_ENOUGH_SERVER_MEMORY , 1130 ) /* 0x0000046a */ \ XXX( WERR_POSSIBLE_DEADLOCK , 1131 ) /* 0x0000046b */ \ XXX( WERR_MAPPED_ALIGNMENT , 1132 ) /* 0x0000046c */ \ XXX( WERR_SET_POWER_STATE_VETOED , 1140 ) /* 0x00000474 */ \ XXX( WERR_SET_POWER_STATE_FAILED , 1141 ) /* 0x00000475 */ \ XXX( WERR_TOO_MANY_LINKS , 1142 ) /* 0x00000476 */ \ XXX( WERR_OLD_WIN_VERSION , 1150 ) /* 0x0000047e */ \ XXX( WERR_APP_WRONG_OS , 1151 ) /* 0x0000047f */ \ XXX( WERR_SINGLE_INSTANCE_APP , 1152 ) /* 0x00000480 */ \ XXX( WERR_RMODE_APP , 1153 ) /* 0x00000481 */ \ XXX( WERR_INVALID_DLL , 1154 ) /* 0x00000482 */ \ XXX( WERR_NO_ASSOCIATION , 1155 ) /* 0x00000483 */ \ XXX( WERR_DDE_FAIL , 1156 ) /* 0x00000484 */ \ XXX( WERR_DLL_NOT_FOUND , 1157 ) /* 0x00000485 */ \ XXX( WERR_NO_MORE_USER_HANDLES , 1158 ) /* 0x00000486 */ \ XXX( WERR_MESSAGE_SYNC_ONLY , 1159 ) /* 0x00000487 */ \ XXX( WERR_SOURCE_ELEMENT_EMPTY , 1160 ) /* 0x00000488 */ \ XXX( WERR_DESTINATION_ELEMENT_FULL , 1161 ) /* 0x00000489 */ \ XXX( WERR_ILLEGAL_ELEMENT_ADDRESS , 1162 ) /* 0x0000048a */ \ XXX( WERR_MAGAZINE_NOT_PRESENT , 1163 ) /* 0x0000048b */ \ XXX( WERR_DEVICE_REINITIALIZATION_NEEDED , 1164 ) /* 0x0000048c */ \ XXX( WERR_DEVICE_REQUIRES_CLEANING , 1165 ) /* 0x0000048d */ \ XXX( WERR_DEVICE_DOOR_OPEN , 1166 ) /* 0x0000048e */ \ XXX( WERR_DEVICE_NOT_CONNECTED , 1167 ) /* 0x0000048f */ \ XXX( WERR_NOT_FOUND , 1168 ) /* 0x00000490 */ \ XXX( WERR_NO_MATCH , 1169 ) /* 0x00000491 */ \ XXX( WERR_SET_NOT_FOUND , 1170 ) /* 0x00000492 */ \ XXX( WERR_POINT_NOT_FOUND , 1171 ) /* 0x00000493 */ \ XXX( WERR_NO_TRACKING_SERVICE , 1172 ) /* 0x00000494 */ \ XXX( WERR_NO_VOLUME_ID , 1173 ) /* 0x00000495 */ \ XXX( WERR_UNABLE_TO_REMOVE_REPLACED , 1175 ) /* 0x00000497 */ \ XXX( WERR_UNABLE_TO_MOVE_REPLACEMENT , 1176 ) /* 0x00000498 */ \ XXX( WERR_UNABLE_TO_MOVE_REPLACEMENT_2 , 1177 ) /* 0x00000499 */ \ XXX( WERR_JOURNAL_DELETE_IN_PROGRESS , 1178 ) /* 0x0000049a */ \ XXX( WERR_JOURNAL_NOT_ACTIVE , 1179 ) /* 0x0000049b */ \ XXX( WERR_POTENTIAL_FILE_FOUND , 1180 ) /* 0x0000049c */ \ XXX( WERR_JOURNAL_ENTRY_DELETED , 1181 ) /* 0x0000049d */ \ XXX( WERR_SHUTDOWN_IS_SCHEDULED , 1190 ) /* 0x000004a6 */ \ XXX( WERR_SHUTDOWN_USERS_LOGGED_ON , 1191 ) /* 0x000004a7 */ \ XXX( WERR_BAD_DEVICE , 1200 ) /* 0x000004b0 */ \ XXX( WERR_CONNECTION_UNAVAIL , 1201 ) /* 0x000004b1 */ \ XXX( WERR_DEVICE_ALREADY_REMEMBERED , 1202 ) /* 0x000004b2 */ \ XXX( WERR_NO_NET_OR_BAD_PATH , 1203 ) /* 0x000004b3 */ \ XXX( WERR_BAD_PROVIDER , 1204 ) /* 0x000004b4 */ \ XXX( WERR_CANNOT_OPEN_PROFILE , 1205 ) /* 0x000004b5 */ \ XXX( WERR_BAD_PROFILE , 1206 ) /* 0x000004b6 */ \ XXX( WERR_NOT_CONTAINER , 1207 ) /* 0x000004b7 */ \ XXX( WERR_EXTENDED_ERROR , 1208 ) /* 0x000004b8 */ \ XXX( WERR_INVALID_GROUPNAME , 1209 ) /* 0x000004b9 */ \ XXX( WERR_INVALID_COMPUTERNAME , 1210 ) /* 0x000004ba */ \ XXX( WERR_INVALID_EVENTNAME , 1211 ) /* 0x000004bb */ \ XXX( WERR_INVALID_DOMAINNAME , 1212 ) /* 0x000004bc */ \ XXX( WERR_INVALID_SERVICENAME , 1213 ) /* 0x000004bd */ \ XXX( WERR_INVALID_NETNAME , 1214 ) /* 0x000004be */ \ XXX( WERR_INVALID_SHARENAME , 1215 ) /* 0x000004bf */ \ XXX( WERR_INVALID_PASSWORDNAME , 1216 ) /* 0x000004c0 */ \ XXX( WERR_INVALID_MESSAGENAME , 1217 ) /* 0x000004c1 */ \ XXX( WERR_INVALID_MESSAGEDEST , 1218 ) /* 0x000004c2 */ \ XXX( WERR_SESSION_CREDENTIAL_CONFLICT , 1219 ) /* 0x000004c3 */ \ XXX( WERR_REMOTE_SESSION_LIMIT_EXCEEDED , 1220 ) /* 0x000004c4 */ \ XXX( WERR_DUP_DOMAINNAME , 1221 ) /* 0x000004c5 */ \ XXX( WERR_NO_NETWORK , 1222 ) /* 0x000004c6 */ \ XXX( WERR_CANCELLED , 1223 ) /* 0x000004c7 */ \ XXX( WERR_USER_MAPPED_FILE , 1224 ) /* 0x000004c8 */ \ XXX( WERR_CONNECTION_REFUSED , 1225 ) /* 0x000004c9 */ \ XXX( WERR_GRACEFUL_DISCONNECT , 1226 ) /* 0x000004ca */ \ XXX( WERR_ADDRESS_ALREADY_ASSOCIATED , 1227 ) /* 0x000004cb */ \ XXX( WERR_ADDRESS_NOT_ASSOCIATED , 1228 ) /* 0x000004cc */ \ XXX( WERR_CONNECTION_INVALID , 1229 ) /* 0x000004cd */ \ XXX( WERR_CONNECTION_ACTIVE , 1230 ) /* 0x000004ce */ \ XXX( WERR_NETWORK_UNREACHABLE , 1231 ) /* 0x000004cf */ \ XXX( WERR_HOST_UNREACHABLE , 1232 ) /* 0x000004d0 */ \ XXX( WERR_PROTOCOL_UNREACHABLE , 1233 ) /* 0x000004d1 */ \ XXX( WERR_PORT_UNREACHABLE , 1234 ) /* 0x000004d2 */ \ XXX( WERR_REQUEST_ABORTED , 1235 ) /* 0x000004d3 */ \ XXX( WERR_CONNECTION_ABORTED , 1236 ) /* 0x000004d4 */ \ XXX( WERR_RETRY , 1237 ) /* 0x000004d5 */ \ XXX( WERR_CONNECTION_COUNT_LIMIT , 1238 ) /* 0x000004d6 */ \ XXX( WERR_LOGIN_TIME_RESTRICTION , 1239 ) /* 0x000004d7 */ \ XXX( WERR_LOGIN_WKSTA_RESTRICTION , 1240 ) /* 0x000004d8 */ \ XXX( WERR_INCORRECT_ADDRESS , 1241 ) /* 0x000004d9 */ \ XXX( WERR_ALREADY_REGISTERED , 1242 ) /* 0x000004da */ \ XXX( WERR_SERVICE_NOT_FOUND , 1243 ) /* 0x000004db */ \ XXX( WERR_NOT_AUTHENTICATED , 1244 ) /* 0x000004dc */ \ XXX( WERR_NOT_LOGGED_ON , 1245 ) /* 0x000004dd */ \ XXX( WERR_CONTINUE , 1246 ) /* 0x000004de */ \ XXX( WERR_ALREADY_INITIALIZED , 1247 ) /* 0x000004df */ \ XXX( WERR_NO_MORE_DEVICES , 1248 ) /* 0x000004e0 */ \ XXX( WERR_NO_SUCH_SITE , 1249 ) /* 0x000004e1 */ \ XXX( WERR_DOMAIN_CONTROLLER_EXISTS , 1250 ) /* 0x000004e2 */ \ XXX( WERR_ONLY_IF_CONNECTED , 1251 ) /* 0x000004e3 */ \ XXX( WERR_OVERRIDE_NOCHANGES , 1252 ) /* 0x000004e4 */ \ XXX( WERR_BAD_USER_PROFILE , 1253 ) /* 0x000004e5 */ \ XXX( WERR_NOT_SUPPORTED_ON_SBS , 1254 ) /* 0x000004e6 */ \ XXX( WERR_SERVER_SHUTDOWN_IN_PROGRESS , 1255 ) /* 0x000004e7 */ \ XXX( WERR_HOST_DOWN , 1256 ) /* 0x000004e8 */ \ XXX( WERR_NON_ACCOUNT_SID , 1257 ) /* 0x000004e9 */ \ XXX( WERR_NON_DOMAIN_SID , 1258 ) /* 0x000004ea */ \ XXX( WERR_APPHELP_BLOCK , 1259 ) /* 0x000004eb */ \ XXX( WERR_ACCESS_DISABLED_BY_POLICY , 1260 ) /* 0x000004ec */ \ XXX( WERR_REG_NAT_CONSUMPTION , 1261 ) /* 0x000004ed */ \ XXX( WERR_CSCSHARE_OFFLINE , 1262 ) /* 0x000004ee */ \ XXX( WERR_PKINIT_FAILURE , 1263 ) /* 0x000004ef */ \ XXX( WERR_SMARTCARD_SUBSYSTEM_FAILURE , 1264 ) /* 0x000004f0 */ \ XXX( WERR_DOWNGRADE_DETECTED , 1265 ) /* 0x000004f1 */ \ XXX( WERR_MACHINE_LOCKED , 1271 ) /* 0x000004f7 */ \ XXX( WERR_CALLBACK_SUPPLIED_INVALID_DATA , 1273 ) /* 0x000004f9 */ \ XXX( WERR_SYNC_FOREGROUND_REFRESH_REQUIRED , 1274 ) /* 0x000004fa */ \ XXX( WERR_DRIVER_BLOCKED , 1275 ) /* 0x000004fb */ \ XXX( WERR_INVALID_IMPORT_OF_NON_DLL , 1276 ) /* 0x000004fc */ \ XXX( WERR_ACCESS_DISABLED_WEBBLADE , 1277 ) /* 0x000004fd */ \ XXX( WERR_ACCESS_DISABLED_WEBBLADE_TAMPER , 1278 ) /* 0x000004fe */ \ XXX( WERR_RECOVERY_FAILURE , 1279 ) /* 0x000004ff */ \ XXX( WERR_ALREADY_FIBER , 1280 ) /* 0x00000500 */ \ XXX( WERR_ALREADY_THREAD , 1281 ) /* 0x00000501 */ \ XXX( WERR_STACK_BUFFER_OVERRUN , 1282 ) /* 0x00000502 */ \ XXX( WERR_PARAMETER_QUOTA_EXCEEDED , 1283 ) /* 0x00000503 */ \ XXX( WERR_DEBUGGER_INACTIVE , 1284 ) /* 0x00000504 */ \ XXX( WERR_DELAY_LOAD_FAILED , 1285 ) /* 0x00000505 */ \ XXX( WERR_VDM_DISALLOWED , 1286 ) /* 0x00000506 */ \ XXX( WERR_UNIDENTIFIED_ERROR , 1287 ) /* 0x00000507 */ \ XXX( WERR_BEYOND_VDL , 1289 ) /* 0x00000509 */ \ XXX( WERR_INCOMPATIBLE_SERVICE_SID_TYPE , 1290 ) /* 0x0000050a */ \ XXX( WERR_DRIVER_PROCESS_TERMINATED , 1291 ) /* 0x0000050b */ \ XXX( WERR_IMPLEMENTATION_LIMIT , 1292 ) /* 0x0000050c */ \ XXX( WERR_PROCESS_IS_PROTECTED , 1293 ) /* 0x0000050d */ \ XXX( WERR_SERVICE_NOTIFY_CLIENT_LAGGING , 1294 ) /* 0x0000050e */ \ XXX( WERR_DISK_QUOTA_EXCEEDED , 1295 ) /* 0x0000050f */ \ XXX( WERR_CONTENT_BLOCKED , 1296 ) /* 0x00000510 */ \ XXX( WERR_INCOMPATIBLE_SERVICE_PRIVILEGE , 1297 ) /* 0x00000511 */ \ XXX( WERR_INVALID_LABEL , 1299 ) /* 0x00000513 */ \ XXX( WERR_NOT_ALL_ASSIGNED , 1300 ) /* 0x00000514 */ \ XXX( WERR_SOME_NOT_MAPPED , 1301 ) /* 0x00000515 */ \ XXX( WERR_NO_QUOTAS_FOR_ACCOUNT , 1302 ) /* 0x00000516 */ \ XXX( WERR_LOCAL_USER_SESSION_KEY , 1303 ) /* 0x00000517 */ \ XXX( WERR_NULL_LM_PASSWORD , 1304 ) /* 0x00000518 */ \ XXX( WERR_UNKNOWN_REVISION , 1305 ) /* 0x00000519 */ \ XXX( WERR_REVISION_MISMATCH , 1306 ) /* 0x0000051a */ \ XXX( WERR_INVALID_OWNER , 1307 ) /* 0x0000051b */ \ XXX( WERR_INVALID_PRIMARY_GROUP , 1308 ) /* 0x0000051c */ \ XXX( WERR_NO_IMPERSONATION_TOKEN , 1309 ) /* 0x0000051d */ \ XXX( WERR_CANT_DISABLE_MANDATORY , 1310 ) /* 0x0000051e */ \ XXX( WERR_NO_LOGON_SERVERS , 1311 ) /* 0x0000051f */ \ XXX( WERR_NO_SUCH_LOGON_SESSION , 1312 ) /* 0x00000520 */ \ XXX( WERR_NO_SUCH_PRIVILEGE , 1313 ) /* 0x00000521 */ \ XXX( WERR_PRIVILEGE_NOT_HELD , 1314 ) /* 0x00000522 */ \ XXX( WERR_INVALID_ACCOUNT_NAME , 1315 ) /* 0x00000523 */ \ XXX( WERR_USER_EXISTS , 1316 ) /* 0x00000524 */ \ XXX( WERR_NO_SUCH_USER , 1317 ) /* 0x00000525 */ \ XXX( WERR_GROUP_EXISTS , 1318 ) /* 0x00000526 */ \ XXX( WERR_NO_SUCH_GROUP , 1319 ) /* 0x00000527 */ \ XXX( WERR_MEMBER_IN_GROUP , 1320 ) /* 0x00000528 */ \ XXX( WERR_MEMBER_NOT_IN_GROUP , 1321 ) /* 0x00000529 */ \ XXX( WERR_LAST_ADMIN , 1322 ) /* 0x0000052a */ \ XXX( WERR_WRONG_PASSWORD , 1323 ) /* 0x0000052b */ \ XXX( WERR_ILL_FORMED_PASSWORD , 1324 ) /* 0x0000052c */ \ XXX( WERR_PASSWORD_RESTRICTION , 1325 ) /* 0x0000052d */ \ XXX( WERR_LOGON_FAILURE , 1326 ) /* 0x0000052e */ \ XXX( WERR_ACCOUNT_RESTRICTION , 1327 ) /* 0x0000052f */ \ XXX( WERR_INVALID_LOGON_HOURS , 1328 ) /* 0x00000530 */ \ XXX( WERR_INVALID_WORKSTATION , 1329 ) /* 0x00000531 */ \ XXX( WERR_PASSWORD_EXPIRED , 1330 ) /* 0x00000532 */ \ XXX( WERR_ACCOUNT_DISABLED , 1331 ) /* 0x00000533 */ \ XXX( WERR_NONE_MAPPED , 1332 ) /* 0x00000534 */ \ XXX( WERR_TOO_MANY_LUIDS_REQUESTED , 1333 ) /* 0x00000535 */ \ XXX( WERR_LUIDS_EXHAUSTED , 1334 ) /* 0x00000536 */ \ XXX( WERR_INVALID_SUB_AUTHORITY , 1335 ) /* 0x00000537 */ \ XXX( WERR_INVALID_ACL , 1336 ) /* 0x00000538 */ \ XXX( WERR_INVALID_SID , 1337 ) /* 0x00000539 */ \ XXX( WERR_INVALID_SECURITY_DESCR , 1338 ) /* 0x0000053a */ \ XXX( WERR_BAD_INHERITANCE_ACL , 1340 ) /* 0x0000053c */ \ XXX( WERR_SERVER_DISABLED , 1341 ) /* 0x0000053d */ \ XXX( WERR_SERVER_NOT_DISABLED , 1342 ) /* 0x0000053e */ \ XXX( WERR_INVALID_ID_AUTHORITY , 1343 ) /* 0x0000053f */ \ XXX( WERR_ALLOTTED_SPACE_EXCEEDED , 1344 ) /* 0x00000540 */ \ XXX( WERR_INVALID_GROUP_ATTRIBUTES , 1345 ) /* 0x00000541 */ \ XXX( WERR_BAD_IMPERSONATION_LEVEL , 1346 ) /* 0x00000542 */ \ XXX( WERR_CANT_OPEN_ANONYMOUS , 1347 ) /* 0x00000543 */ \ XXX( WERR_BAD_VALIDATION_CLASS , 1348 ) /* 0x00000544 */ \ XXX( WERR_BAD_TOKEN_TYPE , 1349 ) /* 0x00000545 */ \ XXX( WERR_NO_SECURITY_ON_OBJECT , 1350 ) /* 0x00000546 */ \ XXX( WERR_CANT_ACCESS_DOMAIN_INFO , 1351 ) /* 0x00000547 */ \ XXX( WERR_INVALID_SERVER_STATE , 1352 ) /* 0x00000548 */ \ XXX( WERR_INVALID_DOMAIN_STATE , 1353 ) /* 0x00000549 */ \ XXX( WERR_INVALID_DOMAIN_ROLE , 1354 ) /* 0x0000054a */ \ XXX( WERR_NO_SUCH_DOMAIN , 1355 ) /* 0x0000054b */ \ XXX( WERR_DOMAIN_EXISTS , 1356 ) /* 0x0000054c */ \ XXX( WERR_DOMAIN_LIMIT_EXCEEDED , 1357 ) /* 0x0000054d */ \ XXX( WERR_INTERNAL_DB_CORRUPTION , 1358 ) /* 0x0000054e */ \ XXX( WERR_INTERNAL_ERROR , 1359 ) /* 0x0000054f */ \ XXX( WERR_GENERIC_NOT_MAPPED , 1360 ) /* 0x00000550 */ \ XXX( WERR_BAD_DESCRIPTOR_FORMAT , 1361 ) /* 0x00000551 */ \ XXX( WERR_NOT_LOGON_PROCESS , 1362 ) /* 0x00000552 */ \ XXX( WERR_LOGON_SESSION_EXISTS , 1363 ) /* 0x00000553 */ \ XXX( WERR_NO_SUCH_PACKAGE , 1364 ) /* 0x00000554 */ \ XXX( WERR_BAD_LOGON_SESSION_STATE , 1365 ) /* 0x00000555 */ \ XXX( WERR_LOGON_SESSION_COLLISION , 1366 ) /* 0x00000556 */ \ XXX( WERR_INVALID_LOGON_TYPE , 1367 ) /* 0x00000557 */ \ XXX( WERR_CANNOT_IMPERSONATE , 1368 ) /* 0x00000558 */ \ XXX( WERR_RXACT_INVALID_STATE , 1369 ) /* 0x00000559 */ \ XXX( WERR_RXACT_COMMIT_FAILURE , 1370 ) /* 0x0000055a */ \ XXX( WERR_SPECIAL_ACCOUNT , 1371 ) /* 0x0000055b */ \ XXX( WERR_SPECIAL_GROUP , 1372 ) /* 0x0000055c */ \ XXX( WERR_SPECIAL_USER , 1373 ) /* 0x0000055d */ \ XXX( WERR_MEMBERS_PRIMARY_GROUP , 1374 ) /* 0x0000055e */ \ XXX( WERR_TOKEN_ALREADY_IN_USE , 1375 ) /* 0x0000055f */ \ XXX( WERR_NO_SUCH_ALIAS , 1376 ) /* 0x00000560 */ \ XXX( WERR_MEMBER_NOT_IN_ALIAS , 1377 ) /* 0x00000561 */ \ XXX( WERR_MEMBER_IN_ALIAS , 1378 ) /* 0x00000562 */ \ XXX( WERR_ALIAS_EXISTS , 1379 ) /* 0x00000563 */ \ XXX( WERR_LOGON_NOT_GRANTED , 1380 ) /* 0x00000564 */ \ XXX( WERR_TOO_MANY_SECRETS , 1381 ) /* 0x00000565 */ \ XXX( WERR_SECRET_TOO_LONG , 1382 ) /* 0x00000566 */ \ XXX( WERR_INTERNAL_DB_ERROR , 1383 ) /* 0x00000567 */ \ XXX( WERR_TOO_MANY_CONTEXT_IDS , 1384 ) /* 0x00000568 */ \ XXX( WERR_LOGON_TYPE_NOT_GRANTED , 1385 ) /* 0x00000569 */ \ XXX( WERR_NT_CROSS_ENCRYPTION_REQUIRED , 1386 ) /* 0x0000056a */ \ XXX( WERR_NO_SUCH_MEMBER , 1387 ) /* 0x0000056b */ \ XXX( WERR_INVALID_MEMBER , 1388 ) /* 0x0000056c */ \ XXX( WERR_TOO_MANY_SIDS , 1389 ) /* 0x0000056d */ \ XXX( WERR_LM_CROSS_ENCRYPTION_REQUIRED , 1390 ) /* 0x0000056e */ \ XXX( WERR_NO_INHERITANCE , 1391 ) /* 0x0000056f */ \ XXX( WERR_FILE_CORRUPT , 1392 ) /* 0x00000570 */ \ XXX( WERR_DISK_CORRUPT , 1393 ) /* 0x00000571 */ \ XXX( WERR_NO_USER_SESSION_KEY , 1394 ) /* 0x00000572 */ \ XXX( WERR_LICENSE_QUOTA_EXCEEDED , 1395 ) /* 0x00000573 */ \ XXX( WERR_WRONG_TARGET_NAME , 1396 ) /* 0x00000574 */ \ XXX( WERR_MUTUAL_AUTH_FAILED , 1397 ) /* 0x00000575 */ \ XXX( WERR_TIME_SKEW , 1398 ) /* 0x00000576 */ \ XXX( WERR_CURRENT_DOMAIN_NOT_ALLOWED , 1399 ) /* 0x00000577 */ \ XXX( WERR_INVALID_WINDOW_HANDLE , 1400 ) /* 0x00000578 */ \ XXX( WERR_INVALID_MENU_HANDLE , 1401 ) /* 0x00000579 */ \ XXX( WERR_INVALID_CURSOR_HANDLE , 1402 ) /* 0x0000057a */ \ XXX( WERR_INVALID_ACCEL_HANDLE , 1403 ) /* 0x0000057b */ \ XXX( WERR_INVALID_HOOK_HANDLE , 1404 ) /* 0x0000057c */ \ XXX( WERR_INVALID_DWP_HANDLE , 1405 ) /* 0x0000057d */ \ XXX( WERR_TLW_WITH_WSCHILD , 1406 ) /* 0x0000057e */ \ XXX( WERR_CANNOT_FIND_WND_CLASS , 1407 ) /* 0x0000057f */ \ XXX( WERR_WINDOW_OF_OTHER_THREAD , 1408 ) /* 0x00000580 */ \ XXX( WERR_HOTKEY_ALREADY_REGISTERED , 1409 ) /* 0x00000581 */ \ XXX( WERR_CLASS_ALREADY_EXISTS , 1410 ) /* 0x00000582 */ \ XXX( WERR_CLASS_DOES_NOT_EXIST , 1411 ) /* 0x00000583 */ \ XXX( WERR_CLASS_HAS_WINDOWS , 1412 ) /* 0x00000584 */ \ XXX( WERR_INVALID_INDEX , 1413 ) /* 0x00000585 */ \ XXX( WERR_INVALID_ICON_HANDLE , 1414 ) /* 0x00000586 */ \ XXX( WERR_PRIVATE_DIALOG_INDEX , 1415 ) /* 0x00000587 */ \ XXX( WERR_LISTBOX_ID_NOT_FOUND , 1416 ) /* 0x00000588 */ \ XXX( WERR_NO_WILDCARD_CHARACTERS , 1417 ) /* 0x00000589 */ \ XXX( WERR_CLIPBOARD_NOT_OPEN , 1418 ) /* 0x0000058a */ \ XXX( WERR_HOTKEY_NOT_REGISTERED , 1419 ) /* 0x0000058b */ \ XXX( WERR_WINDOW_NOT_DIALOG , 1420 ) /* 0x0000058c */ \ XXX( WERR_CONTROL_ID_NOT_FOUND , 1421 ) /* 0x0000058d */ \ XXX( WERR_INVALID_COMBOBOX_MESSAGE , 1422 ) /* 0x0000058e */ \ XXX( WERR_WINDOW_NOT_COMBOBOX , 1423 ) /* 0x0000058f */ \ XXX( WERR_INVALID_EDIT_HEIGHT , 1424 ) /* 0x00000590 */ \ XXX( WERR_DC_NOT_FOUND , 1425 ) /* 0x00000591 */ \ XXX( WERR_INVALID_HOOK_FILTER , 1426 ) /* 0x00000592 */ \ XXX( WERR_INVALID_FILTER_PROC , 1427 ) /* 0x00000593 */ \ XXX( WERR_HOOK_NEEDS_HMOD , 1428 ) /* 0x00000594 */ \ XXX( WERR_GLOBAL_ONLY_HOOK , 1429 ) /* 0x00000595 */ \ XXX( WERR_JOURNAL_HOOK_SET , 1430 ) /* 0x00000596 */ \ XXX( WERR_HOOK_NOT_INSTALLED , 1431 ) /* 0x00000597 */ \ XXX( WERR_INVALID_LB_MESSAGE , 1432 ) /* 0x00000598 */ \ XXX( WERR_SETCOUNT_ON_BAD_LB , 1433 ) /* 0x00000599 */ \ XXX( WERR_LB_WITHOUT_TABSTOPS , 1434 ) /* 0x0000059a */ \ XXX( WERR_DESTROY_OBJECT_OF_OTHER_THREAD , 1435 ) /* 0x0000059b */ \ XXX( WERR_CHILD_WINDOW_MENU , 1436 ) /* 0x0000059c */ \ XXX( WERR_NO_SYSTEM_MENU , 1437 ) /* 0x0000059d */ \ XXX( WERR_INVALID_MSGBOX_STYLE , 1438 ) /* 0x0000059e */ \ XXX( WERR_INVALID_SPI_VALUE , 1439 ) /* 0x0000059f */ \ XXX( WERR_SCREEN_ALREADY_LOCKED , 1440 ) /* 0x000005a0 */ \ XXX( WERR_HWNDS_HAVE_DIFF_PARENT , 1441 ) /* 0x000005a1 */ \ XXX( WERR_NOT_CHILD_WINDOW , 1442 ) /* 0x000005a2 */ \ XXX( WERR_INVALID_GW_COMMAND , 1443 ) /* 0x000005a3 */ \ XXX( WERR_INVALID_THREAD_ID , 1444 ) /* 0x000005a4 */ \ XXX( WERR_NON_MDICHILD_WINDOW , 1445 ) /* 0x000005a5 */ \ XXX( WERR_POPUP_ALREADY_ACTIVE , 1446 ) /* 0x000005a6 */ \ XXX( WERR_NO_SCROLLBARS , 1447 ) /* 0x000005a7 */ \ XXX( WERR_INVALID_SCROLLBAR_RANGE , 1448 ) /* 0x000005a8 */ \ XXX( WERR_INVALID_SHOWWIN_COMMAND , 1449 ) /* 0x000005a9 */ \ XXX( WERR_NO_SYSTEM_RESOURCES , 1450 ) /* 0x000005aa */ \ XXX( WERR_NONPAGED_SYSTEM_RESOURCES , 1451 ) /* 0x000005ab */ \ XXX( WERR_PAGED_SYSTEM_RESOURCES , 1452 ) /* 0x000005ac */ \ XXX( WERR_WORKING_SET_QUOTA , 1453 ) /* 0x000005ad */ \ XXX( WERR_PAGEFILE_QUOTA , 1454 ) /* 0x000005ae */ \ XXX( WERR_COMMITMENT_LIMIT , 1455 ) /* 0x000005af */ \ XXX( WERR_MENU_ITEM_NOT_FOUND , 1456 ) /* 0x000005b0 */ \ XXX( WERR_INVALID_KEYBOARD_HANDLE , 1457 ) /* 0x000005b1 */ \ XXX( WERR_HOOK_TYPE_NOT_ALLOWED , 1458 ) /* 0x000005b2 */ \ XXX( WERR_REQUIRES_INTERACTIVE_WINDOWSTATION , 1459 ) /* 0x000005b3 */ \ XXX( WERR_TIMEOUT , 1460 ) /* 0x000005b4 */ \ XXX( WERR_INVALID_MONITOR_HANDLE , 1461 ) /* 0x000005b5 */ \ XXX( WERR_INCORRECT_SIZE , 1462 ) /* 0x000005b6 */ \ XXX( WERR_SYMLINK_CLASS_DISABLED , 1463 ) /* 0x000005b7 */ \ XXX( WERR_SYMLINK_NOT_SUPPORTED , 1464 ) /* 0x000005b8 */ \ XXX( WERR_EVENTLOG_FILE_CORRUPT , 1500 ) /* 0x000005dc */ \ XXX( WERR_EVENTLOG_CANT_START , 1501 ) /* 0x000005dd */ \ XXX( WERR_LOG_FILE_FULL , 1502 ) /* 0x000005de */ \ XXX( WERR_EVENTLOG_FILE_CHANGED , 1503 ) /* 0x000005df */ \ XXX( WERR_INVALID_TASK_NAME , 1550 ) /* 0x0000060e */ \ XXX( WERR_INVALID_TASK_INDEX , 1551 ) /* 0x0000060f */ \ XXX( WERR_THREAD_ALREADY_IN_TASK , 1552 ) /* 0x00000610 */ \ XXX( WERR_INSTALL_SERVICE_FAILURE , 1601 ) /* 0x00000641 */ \ XXX( WERR_INSTALL_USEREXIT , 1602 ) /* 0x00000642 */ \ XXX( WERR_INSTALL_FAILURE , 1603 ) /* 0x00000643 */ \ XXX( WERR_INSTALL_SUSPEND , 1604 ) /* 0x00000644 */ \ XXX( WERR_UNKNOWN_PRODUCT , 1605 ) /* 0x00000645 */ \ XXX( WERR_UNKNOWN_FEATURE , 1606 ) /* 0x00000646 */ \ XXX( WERR_UNKNOWN_COMPONENT , 1607 ) /* 0x00000647 */ \ XXX( WERR_UNKNOWN_PROPERTY , 1608 ) /* 0x00000648 */ \ XXX( WERR_INVALID_HANDLE_STATE , 1609 ) /* 0x00000649 */ \ XXX( WERR_BAD_CONFIGURATION , 1610 ) /* 0x0000064a */ \ XXX( WERR_INDEX_ABSENT , 1611 ) /* 0x0000064b */ \ XXX( WERR_INSTALL_SOURCE_ABSENT , 1612 ) /* 0x0000064c */ \ XXX( WERR_INSTALL_PACKAGE_VERSION , 1613 ) /* 0x0000064d */ \ XXX( WERR_PRODUCT_UNINSTALLED , 1614 ) /* 0x0000064e */ \ XXX( WERR_BAD_QUERY_SYNTAX , 1615 ) /* 0x0000064f */ \ XXX( WERR_INVALID_FIELD , 1616 ) /* 0x00000650 */ \ XXX( WERR_DEVICE_REMOVED , 1617 ) /* 0x00000651 */ \ XXX( WERR_INSTALL_ALREADY_RUNNING , 1618 ) /* 0x00000652 */ \ XXX( WERR_INSTALL_PACKAGE_OPEN_FAILED , 1619 ) /* 0x00000653 */ \ XXX( WERR_INSTALL_PACKAGE_INVALID , 1620 ) /* 0x00000654 */ \ XXX( WERR_INSTALL_UI_FAILURE , 1621 ) /* 0x00000655 */ \ XXX( WERR_INSTALL_LOG_FAILURE , 1622 ) /* 0x00000656 */ \ XXX( WERR_INSTALL_LANGUAGE_UNSUPPORTED , 1623 ) /* 0x00000657 */ \ XXX( WERR_INSTALL_TRANSFORM_FAILURE , 1624 ) /* 0x00000658 */ \ XXX( WERR_INSTALL_PACKAGE_REJECTED , 1625 ) /* 0x00000659 */ \ XXX( WERR_FUNCTION_NOT_CALLED , 1626 ) /* 0x0000065a */ \ XXX( WERR_FUNCTION_FAILED , 1627 ) /* 0x0000065b */ \ XXX( WERR_INVALID_TABLE , 1628 ) /* 0x0000065c */ \ XXX( WERR_DATATYPE_MISMATCH , 1629 ) /* 0x0000065d */ \ XXX( WERR_UNSUPPORTED_TYPE , 1630 ) /* 0x0000065e */ \ XXX( WERR_CREATE_FAILED , 1631 ) /* 0x0000065f */ \ XXX( WERR_INSTALL_TEMP_UNWRITABLE , 1632 ) /* 0x00000660 */ \ XXX( WERR_INSTALL_PLATFORM_UNSUPPORTED , 1633 ) /* 0x00000661 */ \ XXX( WERR_INSTALL_NOTUSED , 1634 ) /* 0x00000662 */ \ XXX( WERR_PATCH_PACKAGE_OPEN_FAILED , 1635 ) /* 0x00000663 */ \ XXX( WERR_PATCH_PACKAGE_INVALID , 1636 ) /* 0x00000664 */ \ XXX( WERR_PATCH_PACKAGE_UNSUPPORTED , 1637 ) /* 0x00000665 */ \ XXX( WERR_PRODUCT_VERSION , 1638 ) /* 0x00000666 */ \ XXX( WERR_INVALID_COMMAND_LINE , 1639 ) /* 0x00000667 */ \ XXX( WERR_INSTALL_REMOTE_DISALLOWED , 1640 ) /* 0x00000668 */ \ XXX( WERR_SUCCESS_REBOOT_INITIATED , 1641 ) /* 0x00000669 */ \ XXX( WERR_PATCH_TARGET_NOT_FOUND , 1642 ) /* 0x0000066a */ \ XXX( WERR_PATCH_PACKAGE_REJECTED , 1643 ) /* 0x0000066b */ \ XXX( WERR_INSTALL_TRANSFORM_REJECTED , 1644 ) /* 0x0000066c */ \ XXX( WERR_INSTALL_REMOTE_PROHIBITED , 1645 ) /* 0x0000066d */ \ XXX( WERR_PATCH_REMOVAL_UNSUPPORTED , 1646 ) /* 0x0000066e */ \ XXX( WERR_UNKNOWN_PATCH , 1647 ) /* 0x0000066f */ \ XXX( WERR_PATCH_NO_SEQUENCE , 1648 ) /* 0x00000670 */ \ XXX( WERR_PATCH_REMOVAL_DISALLOWED , 1649 ) /* 0x00000671 */ \ XXX( WERR_INVALID_PATCH_XML , 1650 ) /* 0x00000672 */ \ XXX( WERR_PATCH_MANAGED_ADVERTISED_PRODUCT , 1651 ) /* 0x00000673 */ \ XXX( WERR_INSTALL_SERVICE_SAFEBOOT , 1652 ) /* 0x00000674 */ \ XXX( WERR_RPC_S_INVALID_STRING_BINDING , 1700 ) /* 0x000006a4 */ \ XXX( WERR_RPC_S_WRONG_KIND_OF_BINDING , 1701 ) /* 0x000006a5 */ \ XXX( WERR_RPC_S_INVALID_BINDING , 1702 ) /* 0x000006a6 */ \ XXX( WERR_RPC_S_PROTSEQ_NOT_SUPPORTED , 1703 ) /* 0x000006a7 */ \ XXX( WERR_RPC_S_INVALID_RPC_PROTSEQ , 1704 ) /* 0x000006a8 */ \ XXX( WERR_RPC_S_INVALID_STRING_UUID , 1705 ) /* 0x000006a9 */ \ XXX( WERR_RPC_S_INVALID_ENDPOINT_FORMAT , 1706 ) /* 0x000006aa */ \ XXX( WERR_RPC_S_INVALID_NET_ADDR , 1707 ) /* 0x000006ab */ \ XXX( WERR_RPC_S_NO_ENDPOINT_FOUND , 1708 ) /* 0x000006ac */ \ XXX( WERR_RPC_S_INVALID_TIMEOUT , 1709 ) /* 0x000006ad */ \ XXX( WERR_RPC_S_OBJECT_NOT_FOUND , 1710 ) /* 0x000006ae */ \ XXX( WERR_RPC_S_ALREADY_REGISTERED , 1711 ) /* 0x000006af */ \ XXX( WERR_RPC_S_TYPE_ALREADY_REGISTERED , 1712 ) /* 0x000006b0 */ \ XXX( WERR_RPC_S_ALREADY_LISTENING , 1713 ) /* 0x000006b1 */ \ XXX( WERR_RPC_S_NO_PROTSEQS_REGISTERED , 1714 ) /* 0x000006b2 */ \ XXX( WERR_RPC_S_NOT_LISTENING , 1715 ) /* 0x000006b3 */ \ XXX( WERR_RPC_S_UNKNOWN_MGR_TYPE , 1716 ) /* 0x000006b4 */ \ XXX( WERR_RPC_S_UNKNOWN_IF , 1717 ) /* 0x000006b5 */ \ XXX( WERR_RPC_S_NO_BINDINGS , 1718 ) /* 0x000006b6 */ \ XXX( WERR_RPC_S_NO_PROTSEQS , 1719 ) /* 0x000006b7 */ \ XXX( WERR_RPC_S_CANT_CREATE_ENDPOINT , 1720 ) /* 0x000006b8 */ \ XXX( WERR_RPC_S_OUT_OF_RESOURCES , 1721 ) /* 0x000006b9 */ \ XXX( WERR_RPC_S_SERVER_UNAVAILABLE , 1722 ) /* 0x000006ba */ \ XXX( WERR_RPC_S_SERVER_TOO_BUSY , 1723 ) /* 0x000006bb */ \ XXX( WERR_RPC_S_INVALID_NETWORK_OPTIONS , 1724 ) /* 0x000006bc */ \ XXX( WERR_RPC_S_NO_CALL_ACTIVE , 1725 ) /* 0x000006bd */ \ XXX( WERR_RPC_S_CALL_FAILED , 1726 ) /* 0x000006be */ \ XXX( WERR_RPC_S_CALL_FAILED_DNE , 1727 ) /* 0x000006bf */ \ XXX( WERR_RPC_S_PROTOCOL_ERROR , 1728 ) /* 0x000006c0 */ \ XXX( WERR_RPC_S_PROXY_ACCESS_DENIED , 1729 ) /* 0x000006c1 */ \ XXX( WERR_RPC_S_UNSUPPORTED_TRANS_SYN , 1730 ) /* 0x000006c2 */ \ XXX( WERR_RPC_S_UNSUPPORTED_TYPE , 1732 ) /* 0x000006c4 */ \ XXX( WERR_RPC_S_INVALID_TAG , 1733 ) /* 0x000006c5 */ \ XXX( WERR_RPC_S_INVALID_BOUND , 1734 ) /* 0x000006c6 */ \ XXX( WERR_RPC_S_NO_ENTRY_NAME , 1735 ) /* 0x000006c7 */ \ XXX( WERR_RPC_S_INVALID_NAME_SYNTAX , 1736 ) /* 0x000006c8 */ \ XXX( WERR_RPC_S_UNSUPPORTED_NAME_SYNTAX , 1737 ) /* 0x000006c9 */ \ XXX( WERR_RPC_S_UUID_NO_ADDRESS , 1739 ) /* 0x000006cb */ \ XXX( WERR_RPC_S_DUPLICATE_ENDPOINT , 1740 ) /* 0x000006cc */ \ XXX( WERR_RPC_S_UNKNOWN_AUTHN_TYPE , 1741 ) /* 0x000006cd */ \ XXX( WERR_RPC_S_MAX_CALLS_TOO_SMALL , 1742 ) /* 0x000006ce */ \ XXX( WERR_RPC_S_STRING_TOO_LONG , 1743 ) /* 0x000006cf */ \ XXX( WERR_RPC_S_PROTSEQ_NOT_FOUND , 1744 ) /* 0x000006d0 */ \ XXX( WERR_RPC_S_PROCNUM_OUT_OF_RANGE , 1745 ) /* 0x000006d1 */ \ XXX( WERR_RPC_S_BINDING_HAS_NO_AUTH , 1746 ) /* 0x000006d2 */ \ XXX( WERR_RPC_S_UNKNOWN_AUTHN_SERVICE , 1747 ) /* 0x000006d3 */ \ XXX( WERR_RPC_S_UNKNOWN_AUTHN_LEVEL , 1748 ) /* 0x000006d4 */ \ XXX( WERR_RPC_S_INVALID_AUTH_IDENTITY , 1749 ) /* 0x000006d5 */ \ XXX( WERR_RPC_S_UNKNOWN_AUTHZ_SERVICE , 1750 ) /* 0x000006d6 */ \ XXX( WERR_EPT_S_INVALID_ENTRY , 1751 ) /* 0x000006d7 */ \ XXX( WERR_EPT_S_CANT_PERFORM_OP , 1752 ) /* 0x000006d8 */ \ XXX( WERR_EPT_S_NOT_REGISTERED , 1753 ) /* 0x000006d9 */ \ XXX( WERR_RPC_S_NOTHING_TO_EXPORT , 1754 ) /* 0x000006da */ \ XXX( WERR_RPC_S_INCOMPLETE_NAME , 1755 ) /* 0x000006db */ \ XXX( WERR_RPC_S_INVALID_VERS_OPTION , 1756 ) /* 0x000006dc */ \ XXX( WERR_RPC_S_NO_MORE_MEMBERS , 1757 ) /* 0x000006dd */ \ XXX( WERR_RPC_S_NOT_ALL_OBJS_UNEXPORTED , 1758 ) /* 0x000006de */ \ XXX( WERR_RPC_S_INTERFACE_NOT_FOUND , 1759 ) /* 0x000006df */ \ XXX( WERR_RPC_S_ENTRY_ALREADY_EXISTS , 1760 ) /* 0x000006e0 */ \ XXX( WERR_RPC_S_ENTRY_NOT_FOUND , 1761 ) /* 0x000006e1 */ \ XXX( WERR_RPC_S_NAME_SERVICE_UNAVAILABLE , 1762 ) /* 0x000006e2 */ \ XXX( WERR_RPC_S_INVALID_NAF_ID , 1763 ) /* 0x000006e3 */ \ XXX( WERR_RPC_S_CANNOT_SUPPORT , 1764 ) /* 0x000006e4 */ \ XXX( WERR_RPC_S_NO_CONTEXT_AVAILABLE , 1765 ) /* 0x000006e5 */ \ XXX( WERR_RPC_S_INTERNAL_ERROR , 1766 ) /* 0x000006e6 */ \ XXX( WERR_RPC_S_ZERO_DIVIDE , 1767 ) /* 0x000006e7 */ \ XXX( WERR_RPC_S_ADDRESS_ERROR , 1768 ) /* 0x000006e8 */ \ XXX( WERR_RPC_S_FP_DIV_ZERO , 1769 ) /* 0x000006e9 */ \ XXX( WERR_RPC_S_FP_UNDERFLOW , 1770 ) /* 0x000006ea */ \ XXX( WERR_RPC_S_FP_OVERFLOW , 1771 ) /* 0x000006eb */ \ XXX( WERR_RPC_X_NO_MORE_ENTRIES , 1772 ) /* 0x000006ec */ \ XXX( WERR_RPC_X_SS_CHAR_TRANS_OPEN_FAIL , 1773 ) /* 0x000006ed */ \ XXX( WERR_RPC_X_SS_CHAR_TRANS_SHORT_FILE , 1774 ) /* 0x000006ee */ \ XXX( WERR_RPC_X_SS_IN_NULL_CONTEXT , 1775 ) /* 0x000006ef */ \ XXX( WERR_RPC_X_SS_CONTEXT_DAMAGED , 1777 ) /* 0x000006f1 */ \ XXX( WERR_RPC_X_SS_HANDLES_MISMATCH , 1778 ) /* 0x000006f2 */ \ XXX( WERR_RPC_X_SS_CANNOT_GET_CALL_HANDLE , 1779 ) /* 0x000006f3 */ \ XXX( WERR_RPC_X_NULL_REF_POINTER , 1780 ) /* 0x000006f4 */ \ XXX( WERR_RPC_X_ENUM_VALUE_OUT_OF_RANGE , 1781 ) /* 0x000006f5 */ \ XXX( WERR_RPC_X_BYTE_COUNT_TOO_SMALL , 1782 ) /* 0x000006f6 */ \ XXX( WERR_RPC_X_BAD_STUB_DATA , 1783 ) /* 0x000006f7 */ \ XXX( WERR_INVALID_USER_BUFFER , 1784 ) /* 0x000006f8 */ \ XXX( WERR_UNRECOGNIZED_MEDIA , 1785 ) /* 0x000006f9 */ \ XXX( WERR_NO_TRUST_LSA_SECRET , 1786 ) /* 0x000006fa */ \ XXX( WERR_NO_TRUST_SAM_ACCOUNT , 1787 ) /* 0x000006fb */ \ XXX( WERR_TRUSTED_DOMAIN_FAILURE , 1788 ) /* 0x000006fc */ \ XXX( WERR_TRUSTED_RELATIONSHIP_FAILURE , 1789 ) /* 0x000006fd */ \ XXX( WERR_TRUST_FAILURE , 1790 ) /* 0x000006fe */ \ XXX( WERR_RPC_S_CALL_IN_PROGRESS , 1791 ) /* 0x000006ff */ \ XXX( WERR_NETLOGON_NOT_STARTED , 1792 ) /* 0x00000700 */ \ XXX( WERR_ACCOUNT_EXPIRED , 1793 ) /* 0x00000701 */ \ XXX( WERR_REDIRECTOR_HAS_OPEN_HANDLES , 1794 ) /* 0x00000702 */ \ XXX( WERR_PRINTER_DRIVER_ALREADY_INSTALLED , 1795 ) /* 0x00000703 */ \ XXX( WERR_UNKNOWN_PORT , 1796 ) /* 0x00000704 */ \ XXX( WERR_UNKNOWN_PRINTER_DRIVER , 1797 ) /* 0x00000705 */ \ XXX( WERR_UNKNOWN_PRINTPROCESSOR , 1798 ) /* 0x00000706 */ \ XXX( WERR_INVALID_SEPARATOR_FILE , 1799 ) /* 0x00000707 */ \ XXX( WERR_INVALID_PRIORITY , 1800 ) /* 0x00000708 */ \ XXX( WERR_INVALID_PRINTER_NAME , 1801 ) /* 0x00000709 */ \ XXX( WERR_PRINTER_ALREADY_EXISTS , 1802 ) /* 0x0000070a */ \ XXX( WERR_INVALID_PRINTER_COMMAND , 1803 ) /* 0x0000070b */ \ XXX( WERR_INVALID_DATATYPE , 1804 ) /* 0x0000070c */ \ XXX( WERR_INVALID_ENVIRONMENT , 1805 ) /* 0x0000070d */ \ XXX( WERR_RPC_S_NO_MORE_BINDINGS , 1806 ) /* 0x0000070e */ \ XXX( WERR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT , 1807 ) /* 0x0000070f */ \ XXX( WERR_NOLOGON_WORKSTATION_TRUST_ACCOUNT , 1808 ) /* 0x00000710 */ \ XXX( WERR_NOLOGON_SERVER_TRUST_ACCOUNT , 1809 ) /* 0x00000711 */ \ XXX( WERR_DOMAIN_TRUST_INCONSISTENT , 1810 ) /* 0x00000712 */ \ XXX( WERR_SERVER_HAS_OPEN_HANDLES , 1811 ) /* 0x00000713 */ \ XXX( WERR_RESOURCE_DATA_NOT_FOUND , 1812 ) /* 0x00000714 */ \ XXX( WERR_RESOURCE_TYPE_NOT_FOUND , 1813 ) /* 0x00000715 */ \ XXX( WERR_RESOURCE_NAME_NOT_FOUND , 1814 ) /* 0x00000716 */ \ XXX( WERR_RESOURCE_LANG_NOT_FOUND , 1815 ) /* 0x00000717 */ \ XXX( WERR_NOT_ENOUGH_QUOTA , 1816 ) /* 0x00000718 */ \ XXX( WERR_RPC_S_NO_INTERFACES , 1817 ) /* 0x00000719 */ \ XXX( WERR_RPC_S_CALL_CANCELLED , 1818 ) /* 0x0000071a */ \ XXX( WERR_RPC_S_BINDING_INCOMPLETE , 1819 ) /* 0x0000071b */ \ XXX( WERR_RPC_S_COMM_FAILURE , 1820 ) /* 0x0000071c */ \ XXX( WERR_RPC_S_UNSUPPORTED_AUTHN_LEVEL , 1821 ) /* 0x0000071d */ \ XXX( WERR_RPC_S_NO_PRINC_NAME , 1822 ) /* 0x0000071e */ \ XXX( WERR_RPC_S_NOT_RPC_ERROR , 1823 ) /* 0x0000071f */ \ XXX( WERR_RPC_S_UUID_LOCAL_ONLY , 1824 ) /* 0x00000720 */ \ XXX( WERR_RPC_S_SEC_PKG_ERROR , 1825 ) /* 0x00000721 */ \ XXX( WERR_RPC_S_NOT_CANCELLED , 1826 ) /* 0x00000722 */ \ XXX( WERR_RPC_X_INVALID_ES_ACTION , 1827 ) /* 0x00000723 */ \ XXX( WERR_RPC_X_WRONG_ES_VERSION , 1828 ) /* 0x00000724 */ \ XXX( WERR_RPC_X_WRONG_STUB_VERSION , 1829 ) /* 0x00000725 */ \ XXX( WERR_RPC_X_INVALID_PIPE_OBJECT , 1830 ) /* 0x00000726 */ \ XXX( WERR_RPC_X_WRONG_PIPE_ORDER , 1831 ) /* 0x00000727 */ \ XXX( WERR_RPC_X_WRONG_PIPE_VERSION , 1832 ) /* 0x00000728 */ \ XXX( WERR_RPC_S_GROUP_MEMBER_NOT_FOUND , 1898 ) /* 0x0000076a */ \ XXX( WERR_EPT_S_CANT_CREATE , 1899 ) /* 0x0000076b */ \ XXX( WERR_RPC_S_INVALID_OBJECT , 1900 ) /* 0x0000076c */ \ XXX( WERR_INVALID_TIME , 1901 ) /* 0x0000076d */ \ XXX( WERR_INVALID_FORM_NAME , 1902 ) /* 0x0000076e */ \ XXX( WERR_INVALID_FORM_SIZE , 1903 ) /* 0x0000076f */ \ XXX( WERR_ALREADY_WAITING , 1904 ) /* 0x00000770 */ \ XXX( WERR_PRINTER_DELETED , 1905 ) /* 0x00000771 */ \ XXX( WERR_INVALID_PRINTER_STATE , 1906 ) /* 0x00000772 */ \ XXX( WERR_PASSWORD_MUST_CHANGE , 1907 ) /* 0x00000773 */ \ XXX( WERR_DOMAIN_CONTROLLER_NOT_FOUND , 1908 ) /* 0x00000774 */ \ XXX( WERR_ACCOUNT_LOCKED_OUT , 1909 ) /* 0x00000775 */ \ XXX( WERR_OR_INVALID_OXID , 1910 ) /* 0x00000776 */ \ XXX( WERR_OR_INVALID_OID , 1911 ) /* 0x00000777 */ \ XXX( WERR_OR_INVALID_SET , 1912 ) /* 0x00000778 */ \ XXX( WERR_RPC_S_SEND_INCOMPLETE , 1913 ) /* 0x00000779 */ \ XXX( WERR_RPC_S_INVALID_ASYNC_HANDLE , 1914 ) /* 0x0000077a */ \ XXX( WERR_RPC_S_INVALID_ASYNC_CALL , 1915 ) /* 0x0000077b */ \ XXX( WERR_RPC_X_PIPE_CLOSED , 1916 ) /* 0x0000077c */ \ XXX( WERR_RPC_X_PIPE_DISCIPLINE_ERROR , 1917 ) /* 0x0000077d */ \ XXX( WERR_RPC_X_PIPE_EMPTY , 1918 ) /* 0x0000077e */ \ XXX( WERR_NO_SITENAME , 1919 ) /* 0x0000077f */ \ XXX( WERR_CANT_ACCESS_FILE , 1920 ) /* 0x00000780 */ \ XXX( WERR_CANT_RESOLVE_FILENAME , 1921 ) /* 0x00000781 */ \ XXX( WERR_RPC_S_ENTRY_TYPE_MISMATCH , 1922 ) /* 0x00000782 */ \ XXX( WERR_RPC_S_NOT_ALL_OBJS_EXPORTED , 1923 ) /* 0x00000783 */ \ XXX( WERR_RPC_S_INTERFACE_NOT_EXPORTED , 1924 ) /* 0x00000784 */ \ XXX( WERR_RPC_S_PROFILE_NOT_ADDED , 1925 ) /* 0x00000785 */ \ XXX( WERR_RPC_S_PRF_ELT_NOT_ADDED , 1926 ) /* 0x00000786 */ \ XXX( WERR_RPC_S_PRF_ELT_NOT_REMOVED , 1927 ) /* 0x00000787 */ \ XXX( WERR_RPC_S_GRP_ELT_NOT_ADDED , 1928 ) /* 0x00000788 */ \ XXX( WERR_RPC_S_GRP_ELT_NOT_REMOVED , 1929 ) /* 0x00000789 */ \ XXX( WERR_KM_DRIVER_BLOCKED , 1930 ) /* 0x0000078a */ \ XXX( WERR_CONTEXT_EXPIRED , 1931 ) /* 0x0000078b */ \ XXX( WERR_PER_USER_TRUST_QUOTA_EXCEEDED , 1932 ) /* 0x0000078c */ \ XXX( WERR_ALL_USER_TRUST_QUOTA_EXCEEDED , 1933 ) /* 0x0000078d */ \ XXX( WERR_USER_DELETE_TRUST_QUOTA_EXCEEDED , 1934 ) /* 0x0000078e */ \ XXX( WERR_AUTHENTICATION_FIREWALL_FAILED , 1935 ) /* 0x0000078f */ \ XXX( WERR_REMOTE_PRINT_CONNECTIONS_BLOCKED , 1936 ) /* 0x00000790 */ \ XXX( WERR_INVALID_PIXEL_FORMAT , 2000 ) /* 0x000007d0 */ \ XXX( WERR_BAD_DRIVER , 2001 ) /* 0x000007d1 */ \ XXX( WERR_INVALID_WINDOW_STYLE , 2002 ) /* 0x000007d2 */ \ XXX( WERR_METAFILE_NOT_SUPPORTED , 2003 ) /* 0x000007d3 */ \ XXX( WERR_TRANSFORM_NOT_SUPPORTED , 2004 ) /* 0x000007d4 */ \ XXX( WERR_CLIPPING_NOT_SUPPORTED , 2005 ) /* 0x000007d5 */ \ XXX( WERR_INVALID_CMM , 2010 ) /* 0x000007da */ \ XXX( WERR_INVALID_PROFILE , 2011 ) /* 0x000007db */ \ XXX( WERR_TAG_NOT_FOUND , 2012 ) /* 0x000007dc */ \ XXX( WERR_TAG_NOT_PRESENT , 2013 ) /* 0x000007dd */ \ XXX( WERR_DUPLICATE_TAG , 2014 ) /* 0x000007de */ \ XXX( WERR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE , 2015 ) /* 0x000007df */ \ XXX( WERR_PROFILE_NOT_FOUND , 2016 ) /* 0x000007e0 */ \ XXX( WERR_INVALID_COLORSPACE , 2017 ) /* 0x000007e1 */ \ XXX( WERR_ICM_NOT_ENABLED , 2018 ) /* 0x000007e2 */ \ XXX( WERR_DELETING_ICM_XFORM , 2019 ) /* 0x000007e3 */ \ XXX( WERR_INVALID_TRANSFORM , 2020 ) /* 0x000007e4 */ \ XXX( WERR_COLORSPACE_MISMATCH , 2021 ) /* 0x000007e5 */ \ XXX( WERR_INVALID_COLORINDEX , 2022 ) /* 0x000007e6 */ \ XXX( WERR_PROFILE_DOES_NOT_MATCH_DEVICE , 2023 ) /* 0x000007e7 */ \ XXX( WERR_NERR_NETNOTSTARTED , 2102 ) /* 0x00000836 */ \ XXX( WERR_NERR_UNKNOWNSERVER , 2103 ) /* 0x00000837 */ \ XXX( WERR_NERR_SHAREMEM , 2104 ) /* 0x00000838 */ \ XXX( WERR_NERR_NONETWORKRESOURCE , 2105 ) /* 0x00000839 */ \ XXX( WERR_NERR_REMOTEONLY , 2106 ) /* 0x0000083a */ \ XXX( WERR_NERR_DEVNOTREDIRECTED , 2107 ) /* 0x0000083b */ \ XXX( WERR_CONNECTED_OTHER_PASSWORD , 2108 ) /* 0x0000083c */ \ XXX( WERR_CONNECTED_OTHER_PASSWORD_DEFAULT , 2109 ) /* 0x0000083d */ \ XXX( WERR_NERR_SERVERNOTSTARTED , 2114 ) /* 0x00000842 */ \ XXX( WERR_NERR_ITEMNOTFOUND , 2115 ) /* 0x00000843 */ \ XXX( WERR_NERR_UNKNOWNDEVDIR , 2116 ) /* 0x00000844 */ \ XXX( WERR_NERR_REDIRECTEDPATH , 2117 ) /* 0x00000845 */ \ XXX( WERR_NERR_DUPLICATESHARE , 2118 ) /* 0x00000846 */ \ XXX( WERR_NERR_NOROOM , 2119 ) /* 0x00000847 */ \ XXX( WERR_NERR_TOOMANYITEMS , 2121 ) /* 0x00000849 */ \ XXX( WERR_NERR_INVALIDMAXUSERS , 2122 ) /* 0x0000084a */ \ XXX( WERR_NERR_BUFTOOSMALL , 2123 ) /* 0x0000084b */ \ XXX( WERR_NERR_REMOTEERR , 2127 ) /* 0x0000084f */ \ XXX( WERR_NERR_LANMANINIERROR , 2131 ) /* 0x00000853 */ \ XXX( WERR_NERR_NETWORKERROR , 2136 ) /* 0x00000858 */ \ XXX( WERR_NERR_WKSTAINCONSISTENTSTATE , 2137 ) /* 0x00000859 */ \ XXX( WERR_NERR_WKSTANOTSTARTED , 2138 ) /* 0x0000085a */ \ XXX( WERR_NERR_BROWSERNOTSTARTED , 2139 ) /* 0x0000085b */ \ XXX( WERR_NERR_INTERNALERROR , 2140 ) /* 0x0000085c */ \ XXX( WERR_NERR_BADTRANSACTCONFIG , 2141 ) /* 0x0000085d */ \ XXX( WERR_NERR_INVALIDAPI , 2142 ) /* 0x0000085e */ \ XXX( WERR_NERR_BADEVENTNAME , 2143 ) /* 0x0000085f */ \ XXX( WERR_NERR_DUPNAMEREBOOT , 2144 ) /* 0x00000860 */ \ XXX( WERR_NERR_CFGCOMPNOTFOUND , 2146 ) /* 0x00000862 */ \ XXX( WERR_NERR_CFGPARAMNOTFOUND , 2147 ) /* 0x00000863 */ \ XXX( WERR_NERR_LINETOOLONG , 2149 ) /* 0x00000865 */ \ XXX( WERR_NERR_QNOTFOUND , 2150 ) /* 0x00000866 */ \ XXX( WERR_NERR_JOBNOTFOUND , 2151 ) /* 0x00000867 */ \ XXX( WERR_NERR_DESTNOTFOUND , 2152 ) /* 0x00000868 */ \ XXX( WERR_NERR_DESTEXISTS , 2153 ) /* 0x00000869 */ \ XXX( WERR_NERR_QEXISTS , 2154 ) /* 0x0000086a */ \ XXX( WERR_NERR_QNOROOM , 2155 ) /* 0x0000086b */ \ XXX( WERR_NERR_JOBNOROOM , 2156 ) /* 0x0000086c */ \ XXX( WERR_NERR_DESTNOROOM , 2157 ) /* 0x0000086d */ \ XXX( WERR_NERR_DESTIDLE , 2158 ) /* 0x0000086e */ \ XXX( WERR_NERR_DESTINVALIDOP , 2159 ) /* 0x0000086f */ \ XXX( WERR_NERR_PROCNORESPOND , 2160 ) /* 0x00000870 */ \ XXX( WERR_NERR_SPOOLERNOTLOADED , 2161 ) /* 0x00000871 */ \ XXX( WERR_NERR_DESTINVALIDSTATE , 2162 ) /* 0x00000872 */ \ XXX( WERR_NERR_QINVALIDSTATE , 2163 ) /* 0x00000873 */ \ XXX( WERR_NERR_JOBINVALIDSTATE , 2164 ) /* 0x00000874 */ \ XXX( WERR_NERR_SPOOLNOMEMORY , 2165 ) /* 0x00000875 */ \ XXX( WERR_NERR_DRIVERNOTFOUND , 2166 ) /* 0x00000876 */ \ XXX( WERR_NERR_DATATYPEINVALID , 2167 ) /* 0x00000877 */ \ XXX( WERR_NERR_PROCNOTFOUND , 2168 ) /* 0x00000878 */ \ XXX( WERR_NERR_SERVICETABLELOCKED , 2180 ) /* 0x00000884 */ \ XXX( WERR_NERR_SERVICETABLEFULL , 2181 ) /* 0x00000885 */ \ XXX( WERR_NERR_SERVICEINSTALLED , 2182 ) /* 0x00000886 */ \ XXX( WERR_NERR_SERVICEENTRYLOCKED , 2183 ) /* 0x00000887 */ \ XXX( WERR_NERR_SERVICENOTINSTALLED , 2184 ) /* 0x00000888 */ \ XXX( WERR_NERR_BADSERVICENAME , 2185 ) /* 0x00000889 */ \ XXX( WERR_NERR_SERVICECTLTIMEOUT , 2186 ) /* 0x0000088a */ \ XXX( WERR_NERR_SERVICECTLBUSY , 2187 ) /* 0x0000088b */ \ XXX( WERR_NERR_BADSERVICEPROGNAME , 2188 ) /* 0x0000088c */ \ XXX( WERR_NERR_SERVICENOTCTRL , 2189 ) /* 0x0000088d */ \ XXX( WERR_NERR_SERVICEKILLPROC , 2190 ) /* 0x0000088e */ \ XXX( WERR_NERR_SERVICECTLNOTVALID , 2191 ) /* 0x0000088f */ \ XXX( WERR_NERR_NOTINDISPATCHTBL , 2192 ) /* 0x00000890 */ \ XXX( WERR_NERR_BADCONTROLRECV , 2193 ) /* 0x00000891 */ \ XXX( WERR_NERR_SERVICENOTSTARTING , 2194 ) /* 0x00000892 */ \ XXX( WERR_NERR_ALREADYLOGGEDON , 2200 ) /* 0x00000898 */ \ XXX( WERR_NERR_NOTLOGGEDON , 2201 ) /* 0x00000899 */ \ XXX( WERR_NERR_BADUSERNAME , 2202 ) /* 0x0000089a */ \ XXX( WERR_NERR_BADPASSWORD , 2203 ) /* 0x0000089b */ \ XXX( WERR_NERR_UNABLETOADDNAME_W , 2204 ) /* 0x0000089c */ \ XXX( WERR_NERR_UNABLETOADDNAME_F , 2205 ) /* 0x0000089d */ \ XXX( WERR_NERR_UNABLETODELNAME_W , 2206 ) /* 0x0000089e */ \ XXX( WERR_NERR_UNABLETODELNAME_F , 2207 ) /* 0x0000089f */ \ XXX( WERR_NERR_LOGONSPAUSED , 2209 ) /* 0x000008a1 */ \ XXX( WERR_NERR_LOGONSERVERCONFLICT , 2210 ) /* 0x000008a2 */ \ XXX( WERR_NERR_LOGONNOUSERPATH , 2211 ) /* 0x000008a3 */ \ XXX( WERR_NERR_LOGONSCRIPTERROR , 2212 ) /* 0x000008a4 */ \ XXX( WERR_NERR_STANDALONELOGON , 2214 ) /* 0x000008a6 */ \ XXX( WERR_NERR_LOGONSERVERNOTFOUND , 2215 ) /* 0x000008a7 */ \ XXX( WERR_NERR_LOGONDOMAINEXISTS , 2216 ) /* 0x000008a8 */ \ XXX( WERR_NERR_NONVALIDATEDLOGON , 2217 ) /* 0x000008a9 */ \ XXX( WERR_NERR_ACFNOTFOUND , 2219 ) /* 0x000008ab */ \ XXX( WERR_NERR_GROUPNOTFOUND , 2220 ) /* 0x000008ac */ \ XXX( WERR_NERR_USERNOTFOUND , 2221 ) /* 0x000008ad */ \ XXX( WERR_NERR_RESOURCENOTFOUND , 2222 ) /* 0x000008ae */ \ XXX( WERR_NERR_GROUPEXISTS , 2223 ) /* 0x000008af */ \ XXX( WERR_NERR_USEREXISTS , 2224 ) /* 0x000008b0 */ \ XXX( WERR_NERR_RESOURCEEXISTS , 2225 ) /* 0x000008b1 */ \ XXX( WERR_NERR_NOTPRIMARY , 2226 ) /* 0x000008b2 */ \ XXX( WERR_NERR_ACFNOTLOADED , 2227 ) /* 0x000008b3 */ \ XXX( WERR_NERR_ACFNOROOM , 2228 ) /* 0x000008b4 */ \ XXX( WERR_NERR_ACFFILEIOFAIL , 2229 ) /* 0x000008b5 */ \ XXX( WERR_NERR_ACFTOOMANYLISTS , 2230 ) /* 0x000008b6 */ \ XXX( WERR_NERR_USERLOGON , 2231 ) /* 0x000008b7 */ \ XXX( WERR_NERR_ACFNOPARENT , 2232 ) /* 0x000008b8 */ \ XXX( WERR_NERR_CANNOTGROWSEGMENT , 2233 ) /* 0x000008b9 */ \ XXX( WERR_NERR_SPEGROUPOP , 2234 ) /* 0x000008ba */ \ XXX( WERR_NERR_NOTINCACHE , 2235 ) /* 0x000008bb */ \ XXX( WERR_NERR_USERINGROUP , 2236 ) /* 0x000008bc */ \ XXX( WERR_NERR_USERNOTINGROUP , 2237 ) /* 0x000008bd */ \ XXX( WERR_NERR_ACCOUNTUNDEFINED , 2238 ) /* 0x000008be */ \ XXX( WERR_NERR_ACCOUNTEXPIRED , 2239 ) /* 0x000008bf */ \ XXX( WERR_NERR_INVALIDWORKSTATION , 2240 ) /* 0x000008c0 */ \ XXX( WERR_NERR_INVALIDLOGONHOURS , 2241 ) /* 0x000008c1 */ \ XXX( WERR_NERR_PASSWORDEXPIRED , 2242 ) /* 0x000008c2 */ \ XXX( WERR_NERR_PASSWORDCANTCHANGE , 2243 ) /* 0x000008c3 */ \ XXX( WERR_NERR_PASSWORDHISTCONFLICT , 2244 ) /* 0x000008c4 */ \ XXX( WERR_NERR_PASSWORDTOOSHORT , 2245 ) /* 0x000008c5 */ \ XXX( WERR_NERR_PASSWORDTOORECENT , 2246 ) /* 0x000008c6 */ \ XXX( WERR_NERR_INVALIDDATABASE , 2247 ) /* 0x000008c7 */ \ XXX( WERR_NERR_DATABASEUPTODATE , 2248 ) /* 0x000008c8 */ \ XXX( WERR_NERR_SYNCREQUIRED , 2249 ) /* 0x000008c9 */ \ XXX( WERR_NERR_USENOTFOUND , 2250 ) /* 0x000008ca */ \ XXX( WERR_NERR_BADASGTYPE , 2251 ) /* 0x000008cb */ \ XXX( WERR_NERR_DEVICEISSHARED , 2252 ) /* 0x000008cc */ \ XXX( WERR_NERR_NOCOMPUTERNAME , 2270 ) /* 0x000008de */ \ XXX( WERR_NERR_MSGALREADYSTARTED , 2271 ) /* 0x000008df */ \ XXX( WERR_NERR_MSGINITFAILED , 2272 ) /* 0x000008e0 */ \ XXX( WERR_NERR_NAMENOTFOUND , 2273 ) /* 0x000008e1 */ \ XXX( WERR_NERR_ALREADYFORWARDED , 2274 ) /* 0x000008e2 */ \ XXX( WERR_NERR_ADDFORWARDED , 2275 ) /* 0x000008e3 */ \ XXX( WERR_NERR_ALREADYEXISTS , 2276 ) /* 0x000008e4 */ \ XXX( WERR_NERR_TOOMANYNAMES , 2277 ) /* 0x000008e5 */ \ XXX( WERR_NERR_DELCOMPUTERNAME , 2278 ) /* 0x000008e6 */ \ XXX( WERR_NERR_LOCALFORWARD , 2279 ) /* 0x000008e7 */ \ XXX( WERR_NERR_GRPMSGPROCESSOR , 2280 ) /* 0x000008e8 */ \ XXX( WERR_NERR_PAUSEDREMOTE , 2281 ) /* 0x000008e9 */ \ XXX( WERR_NERR_BADRECEIVE , 2282 ) /* 0x000008ea */ \ XXX( WERR_NERR_NAMEINUSE , 2283 ) /* 0x000008eb */ \ XXX( WERR_NERR_MSGNOTSTARTED , 2284 ) /* 0x000008ec */ \ XXX( WERR_NERR_NOTLOCALNAME , 2285 ) /* 0x000008ed */ \ XXX( WERR_NERR_NOFORWARDNAME , 2286 ) /* 0x000008ee */ \ XXX( WERR_NERR_REMOTEFULL , 2287 ) /* 0x000008ef */ \ XXX( WERR_NERR_NAMENOTFORWARDED , 2288 ) /* 0x000008f0 */ \ XXX( WERR_NERR_TRUNCATEDBROADCAST , 2289 ) /* 0x000008f1 */ \ XXX( WERR_NERR_INVALIDDEVICE , 2294 ) /* 0x000008f6 */ \ XXX( WERR_NERR_WRITEFAULT , 2295 ) /* 0x000008f7 */ \ XXX( WERR_NERR_DUPLICATENAME , 2297 ) /* 0x000008f9 */ \ XXX( WERR_NERR_DELETELATER , 2298 ) /* 0x000008fa */ \ XXX( WERR_NERR_INCOMPLETEDEL , 2299 ) /* 0x000008fb */ \ XXX( WERR_NERR_MULTIPLENETS , 2300 ) /* 0x000008fc */ \ XXX( WERR_NERR_NETNAMENOTFOUND , 2310 ) /* 0x00000906 */ \ XXX( WERR_NERR_DEVICENOTSHARED , 2311 ) /* 0x00000907 */ \ XXX( WERR_NERR_CLIENTNAMENOTFOUND , 2312 ) /* 0x00000908 */ \ XXX( WERR_NERR_FILEIDNOTFOUND , 2314 ) /* 0x0000090a */ \ XXX( WERR_NERR_EXECFAILURE , 2315 ) /* 0x0000090b */ \ XXX( WERR_NERR_TMPFILE , 2316 ) /* 0x0000090c */ \ XXX( WERR_NERR_TOOMUCHDATA , 2317 ) /* 0x0000090d */ \ XXX( WERR_NERR_DEVICESHARECONFLICT , 2318 ) /* 0x0000090e */ \ XXX( WERR_NERR_BROWSERTABLEINCOMPLETE , 2319 ) /* 0x0000090f */ \ XXX( WERR_NERR_NOTLOCALDOMAIN , 2320 ) /* 0x00000910 */ \ XXX( WERR_NERR_ISDFSSHARE , 2321 ) /* 0x00000911 */ \ XXX( WERR_NERR_DEVINVALIDOPCODE , 2331 ) /* 0x0000091b */ \ XXX( WERR_NERR_DEVNOTFOUND , 2332 ) /* 0x0000091c */ \ XXX( WERR_NERR_DEVNOTOPEN , 2333 ) /* 0x0000091d */ \ XXX( WERR_NERR_BADQUEUEDEVSTRING , 2334 ) /* 0x0000091e */ \ XXX( WERR_NERR_BADQUEUEPRIORITY , 2335 ) /* 0x0000091f */ \ XXX( WERR_NERR_NOCOMMDEVS , 2337 ) /* 0x00000921 */ \ XXX( WERR_NERR_QUEUENOTFOUND , 2338 ) /* 0x00000922 */ \ XXX( WERR_NERR_BADDEVSTRING , 2340 ) /* 0x00000924 */ \ XXX( WERR_NERR_BADDEV , 2341 ) /* 0x00000925 */ \ XXX( WERR_NERR_INUSEBYSPOOLER , 2342 ) /* 0x00000926 */ \ XXX( WERR_NERR_COMMDEVINUSE , 2343 ) /* 0x00000927 */ \ XXX( WERR_NERR_INVALIDCOMPUTER , 2351 ) /* 0x0000092f */ \ XXX( WERR_NERR_MAXLENEXCEEDED , 2354 ) /* 0x00000932 */ \ XXX( WERR_NERR_BADCOMPONENT , 2356 ) /* 0x00000934 */ \ XXX( WERR_NERR_CANTTYPE , 2357 ) /* 0x00000935 */ \ XXX( WERR_NERR_TOOMANYENTRIES , 2362 ) /* 0x0000093a */ \ XXX( WERR_NERR_PROFILEFILETOOBIG , 2370 ) /* 0x00000942 */ \ XXX( WERR_NERR_PROFILEOFFSET , 2371 ) /* 0x00000943 */ \ XXX( WERR_NERR_PROFILECLEANUP , 2372 ) /* 0x00000944 */ \ XXX( WERR_NERR_PROFILEUNKNOWNCMD , 2373 ) /* 0x00000945 */ \ XXX( WERR_NERR_PROFILELOADERR , 2374 ) /* 0x00000946 */ \ XXX( WERR_NERR_PROFILESAVEERR , 2375 ) /* 0x00000947 */ \ XXX( WERR_NERR_LOGOVERFLOW , 2377 ) /* 0x00000949 */ \ XXX( WERR_NERR_LOGFILECHANGED , 2378 ) /* 0x0000094a */ \ XXX( WERR_NERR_LOGFILECORRUPT , 2379 ) /* 0x0000094b */ \ XXX( WERR_NERR_SOURCEISDIR , 2380 ) /* 0x0000094c */ \ XXX( WERR_NERR_BADSOURCE , 2381 ) /* 0x0000094d */ \ XXX( WERR_NERR_BADDEST , 2382 ) /* 0x0000094e */ \ XXX( WERR_NERR_DIFFERENTSERVERS , 2383 ) /* 0x0000094f */ \ XXX( WERR_NERR_RUNSRVPAUSED , 2385 ) /* 0x00000951 */ \ XXX( WERR_NERR_ERRCOMMRUNSRV , 2389 ) /* 0x00000955 */ \ XXX( WERR_NERR_ERROREXECINGGHOST , 2391 ) /* 0x00000957 */ \ XXX( WERR_NERR_SHARENOTFOUND , 2392 ) /* 0x00000958 */ \ XXX( WERR_NERR_INVALIDLANA , 2400 ) /* 0x00000960 */ \ XXX( WERR_NERR_OPENFILES , 2401 ) /* 0x00000961 */ \ XXX( WERR_NERR_ACTIVECONNS , 2402 ) /* 0x00000962 */ \ XXX( WERR_NERR_BADPASSWORDCORE , 2403 ) /* 0x00000963 */ \ XXX( WERR_NERR_DEVINUSE , 2404 ) /* 0x00000964 */ \ XXX( WERR_NERR_LOCALDRIVE , 2405 ) /* 0x00000965 */ \ XXX( WERR_NERR_ALERTEXISTS , 2430 ) /* 0x0000097e */ \ XXX( WERR_NERR_TOOMANYALERTS , 2431 ) /* 0x0000097f */ \ XXX( WERR_NERR_NOSUCHALERT , 2432 ) /* 0x00000980 */ \ XXX( WERR_NERR_BADRECIPIENT , 2433 ) /* 0x00000981 */ \ XXX( WERR_NERR_ACCTLIMITEXCEEDED , 2434 ) /* 0x00000982 */ \ XXX( WERR_NERR_INVALIDLOGSEEK , 2440 ) /* 0x00000988 */ \ XXX( WERR_NERR_BADUASCONFIG , 2450 ) /* 0x00000992 */ \ XXX( WERR_NERR_INVALIDUASOP , 2451 ) /* 0x00000993 */ \ XXX( WERR_NERR_LASTADMIN , 2452 ) /* 0x00000994 */ \ XXX( WERR_NERR_DCNOTFOUND , 2453 ) /* 0x00000995 */ \ XXX( WERR_NERR_LOGONTRACKINGERROR , 2454 ) /* 0x00000996 */ \ XXX( WERR_NERR_NETLOGONNOTSTARTED , 2455 ) /* 0x00000997 */ \ XXX( WERR_NERR_CANNOTGROWUASFILE , 2456 ) /* 0x00000998 */ \ XXX( WERR_NERR_TIMEDIFFATDC , 2457 ) /* 0x00000999 */ \ XXX( WERR_NERR_PASSWORDMISMATCH , 2458 ) /* 0x0000099a */ \ XXX( WERR_NERR_NOSUCHSERVER , 2460 ) /* 0x0000099c */ \ XXX( WERR_NERR_NOSUCHSESSION , 2461 ) /* 0x0000099d */ \ XXX( WERR_NERR_NOSUCHCONNECTION , 2462 ) /* 0x0000099e */ \ XXX( WERR_NERR_TOOMANYSERVERS , 2463 ) /* 0x0000099f */ \ XXX( WERR_NERR_TOOMANYSESSIONS , 2464 ) /* 0x000009a0 */ \ XXX( WERR_NERR_TOOMANYCONNECTIONS , 2465 ) /* 0x000009a1 */ \ XXX( WERR_NERR_TOOMANYFILES , 2466 ) /* 0x000009a2 */ \ XXX( WERR_NERR_NOALTERNATESERVERS , 2467 ) /* 0x000009a3 */ \ XXX( WERR_NERR_TRYDOWNLEVEL , 2470 ) /* 0x000009a6 */ \ XXX( WERR_NERR_UPSDRIVERNOTSTARTED , 2480 ) /* 0x000009b0 */ \ XXX( WERR_NERR_UPSINVALIDCONFIG , 2481 ) /* 0x000009b1 */ \ XXX( WERR_NERR_UPSINVALIDCOMMPORT , 2482 ) /* 0x000009b2 */ \ XXX( WERR_NERR_UPSSIGNALASSERTED , 2483 ) /* 0x000009b3 */ \ XXX( WERR_NERR_UPSSHUTDOWNFAILED , 2484 ) /* 0x000009b4 */ \ XXX( WERR_NERR_BADDOSRETCODE , 2500 ) /* 0x000009c4 */ \ XXX( WERR_NERR_PROGNEEDSEXTRAMEM , 2501 ) /* 0x000009c5 */ \ XXX( WERR_NERR_BADDOSFUNCTION , 2502 ) /* 0x000009c6 */ \ XXX( WERR_NERR_REMOTEBOOTFAILED , 2503 ) /* 0x000009c7 */ \ XXX( WERR_NERR_BADFILECHECKSUM , 2504 ) /* 0x000009c8 */ \ XXX( WERR_NERR_NORPLBOOTSYSTEM , 2505 ) /* 0x000009c9 */ \ XXX( WERR_NERR_RPLLOADRNETBIOSERR , 2506 ) /* 0x000009ca */ \ XXX( WERR_NERR_RPLLOADRDISKERR , 2507 ) /* 0x000009cb */ \ XXX( WERR_NERR_IMAGEPARAMERR , 2508 ) /* 0x000009cc */ \ XXX( WERR_NERR_TOOMANYIMAGEPARAMS , 2509 ) /* 0x000009cd */ \ XXX( WERR_NERR_NONDOSFLOPPYUSED , 2510 ) /* 0x000009ce */ \ XXX( WERR_NERR_RPLBOOTRESTART , 2511 ) /* 0x000009cf */ \ XXX( WERR_NERR_RPLSRVRCALLFAILED , 2512 ) /* 0x000009d0 */ \ XXX( WERR_NERR_CANTCONNECTRPLSRVR , 2513 ) /* 0x000009d1 */ \ XXX( WERR_NERR_CANTOPENIMAGEFILE , 2514 ) /* 0x000009d2 */ \ XXX( WERR_NERR_CALLINGRPLSRVR , 2515 ) /* 0x000009d3 */ \ XXX( WERR_NERR_STARTINGRPLBOOT , 2516 ) /* 0x000009d4 */ \ XXX( WERR_NERR_RPLBOOTSERVICETERM , 2517 ) /* 0x000009d5 */ \ XXX( WERR_NERR_RPLBOOTSTARTFAILED , 2518 ) /* 0x000009d6 */ \ XXX( WERR_NERR_RPL_CONNECTED , 2519 ) /* 0x000009d7 */ \ XXX( WERR_NERR_BROWSERCONFIGUREDTONOTRUN , 2550 ) /* 0x000009f6 */ \ XXX( WERR_NERR_RPLNOADAPTERSSTARTED , 2610 ) /* 0x00000a32 */ \ XXX( WERR_NERR_RPLBADREGISTRY , 2611 ) /* 0x00000a33 */ \ XXX( WERR_NERR_RPLBADDATABASE , 2612 ) /* 0x00000a34 */ \ XXX( WERR_NERR_RPLRPLFILESSHARE , 2613 ) /* 0x00000a35 */ \ XXX( WERR_NERR_RPLNOTRPLSERVER , 2614 ) /* 0x00000a36 */ \ XXX( WERR_NERR_RPLCANNOTENUM , 2615 ) /* 0x00000a37 */ \ XXX( WERR_NERR_RPLWKSTAINFOCORRUPTED , 2616 ) /* 0x00000a38 */ \ XXX( WERR_NERR_RPLWKSTANOTFOUND , 2617 ) /* 0x00000a39 */ \ XXX( WERR_NERR_RPLWKSTANAMEUNAVAILABLE , 2618 ) /* 0x00000a3a */ \ XXX( WERR_NERR_RPLPROFILEINFOCORRUPTED , 2619 ) /* 0x00000a3b */ \ XXX( WERR_NERR_RPLPROFILENOTFOUND , 2620 ) /* 0x00000a3c */ \ XXX( WERR_NERR_RPLPROFILENAMEUNAVAILABLE , 2621 ) /* 0x00000a3d */ \ XXX( WERR_NERR_RPLPROFILENOTEMPTY , 2622 ) /* 0x00000a3e */ \ XXX( WERR_NERR_RPLCONFIGINFOCORRUPTED , 2623 ) /* 0x00000a3f */ \ XXX( WERR_NERR_RPLCONFIGNOTFOUND , 2624 ) /* 0x00000a40 */ \ XXX( WERR_NERR_RPLADAPTERINFOCORRUPTED , 2625 ) /* 0x00000a41 */ \ XXX( WERR_NERR_RPLINTERNAL , 2626 ) /* 0x00000a42 */ \ XXX( WERR_NERR_RPLVENDORINFOCORRUPTED , 2627 ) /* 0x00000a43 */ \ XXX( WERR_NERR_RPLBOOTINFOCORRUPTED , 2628 ) /* 0x00000a44 */ \ XXX( WERR_NERR_RPLWKSTANEEDSUSERACCT , 2629 ) /* 0x00000a45 */ \ XXX( WERR_NERR_RPLNEEDSRPLUSERACCT , 2630 ) /* 0x00000a46 */ \ XXX( WERR_NERR_RPLBOOTNOTFOUND , 2631 ) /* 0x00000a47 */ \ XXX( WERR_NERR_RPLINCOMPATIBLEPROFILE , 2632 ) /* 0x00000a48 */ \ XXX( WERR_NERR_RPLADAPTERNAMEUNAVAILABLE , 2633 ) /* 0x00000a49 */ \ XXX( WERR_NERR_RPLCONFIGNOTEMPTY , 2634 ) /* 0x00000a4a */ \ XXX( WERR_NERR_RPLBOOTINUSE , 2635 ) /* 0x00000a4b */ \ XXX( WERR_NERR_RPLBACKUPDATABASE , 2636 ) /* 0x00000a4c */ \ XXX( WERR_NERR_RPLADAPTERNOTFOUND , 2637 ) /* 0x00000a4d */ \ XXX( WERR_NERR_RPLVENDORNOTFOUND , 2638 ) /* 0x00000a4e */ \ XXX( WERR_NERR_RPLVENDORNAMEUNAVAILABLE , 2639 ) /* 0x00000a4f */ \ XXX( WERR_NERR_RPLBOOTNAMEUNAVAILABLE , 2640 ) /* 0x00000a50 */ \ XXX( WERR_NERR_RPLCONFIGNAMEUNAVAILABLE , 2641 ) /* 0x00000a51 */ \ XXX( WERR_NERR_DFSINTERNALCORRUPTION , 2660 ) /* 0x00000a64 */ \ XXX( WERR_NERR_DFSVOLUMEDATACORRUPT , 2661 ) /* 0x00000a65 */ \ XXX( WERR_NERR_DFSNOSUCHVOLUME , 2662 ) /* 0x00000a66 */ \ XXX( WERR_NERR_DFSVOLUMEALREADYEXISTS , 2663 ) /* 0x00000a67 */ \ XXX( WERR_NERR_DFSALREADYSHARED , 2664 ) /* 0x00000a68 */ \ XXX( WERR_NERR_DFSNOSUCHSHARE , 2665 ) /* 0x00000a69 */ \ XXX( WERR_NERR_DFSNOTALEAFVOLUME , 2666 ) /* 0x00000a6a */ \ XXX( WERR_NERR_DFSLEAFVOLUME , 2667 ) /* 0x00000a6b */ \ XXX( WERR_NERR_DFSVOLUMEHASMULTIPLESERVERS , 2668 ) /* 0x00000a6c */ \ XXX( WERR_NERR_DFSCANTCREATEJUNCTIONPOINT , 2669 ) /* 0x00000a6d */ \ XXX( WERR_NERR_DFSSERVERNOTDFSAWARE , 2670 ) /* 0x00000a6e */ \ XXX( WERR_NERR_DFSBADRENAMEPATH , 2671 ) /* 0x00000a6f */ \ XXX( WERR_NERR_DFSVOLUMEISOFFLINE , 2672 ) /* 0x00000a70 */ \ XXX( WERR_NERR_DFSNOSUCHSERVER , 2673 ) /* 0x00000a71 */ \ XXX( WERR_NERR_DFSCYCLICALNAME , 2674 ) /* 0x00000a72 */ \ XXX( WERR_NERR_DFSNOTSUPPORTEDINSERVERDFS , 2675 ) /* 0x00000a73 */ \ XXX( WERR_NERR_DFSDUPLICATESERVICE , 2676 ) /* 0x00000a74 */ \ XXX( WERR_NERR_DFSCANTREMOVELASTSERVERSHARE , 2677 ) /* 0x00000a75 */ \ XXX( WERR_NERR_DFSVOLUMEISINTERDFS , 2678 ) /* 0x00000a76 */ \ XXX( WERR_NERR_DFSINCONSISTENT , 2679 ) /* 0x00000a77 */ \ XXX( WERR_NERR_DFSSERVERUPGRADED , 2680 ) /* 0x00000a78 */ \ XXX( WERR_NERR_DFSDATAISIDENTICAL , 2681 ) /* 0x00000a79 */ \ XXX( WERR_NERR_DFSCANTREMOVEDFSROOT , 2682 ) /* 0x00000a7a */ \ XXX( WERR_NERR_DFSCHILDORPARENTINDFS , 2683 ) /* 0x00000a7b */ \ XXX( WERR_NERR_DFSINTERNALERROR , 2690 ) /* 0x00000a82 */ \ XXX( WERR_NERR_SETUPALREADYJOINED , 2691 ) /* 0x00000a83 */ \ XXX( WERR_NERR_SETUPNOTJOINED , 2692 ) /* 0x00000a84 */ \ XXX( WERR_NERR_SETUPDOMAINCONTROLLER , 2693 ) /* 0x00000a85 */ \ XXX( WERR_NERR_DEFAULTJOINREQUIRED , 2694 ) /* 0x00000a86 */ \ XXX( WERR_NERR_INVALIDWORKGROUPNAME , 2695 ) /* 0x00000a87 */ \ XXX( WERR_NERR_NAMEUSESINCOMPATIBLECODEPAGE , 2696 ) /* 0x00000a88 */ \ XXX( WERR_NERR_COMPUTERACCOUNTNOTFOUND , 2697 ) /* 0x00000a89 */ \ XXX( WERR_NERR_PERSONALSKU , 2698 ) /* 0x00000a8a */ \ XXX( WERR_NERR_PASSWORDMUSTCHANGE , 2701 ) /* 0x00000a8d */ \ XXX( WERR_NERR_ACCOUNTLOCKEDOUT , 2702 ) /* 0x00000a8e */ \ XXX( WERR_NERR_PASSWORDTOOLONG , 2703 ) /* 0x00000a8f */ \ XXX( WERR_NERR_PASSWORDNOTCOMPLEXENOUGH , 2704 ) /* 0x00000a90 */ \ XXX( WERR_NERR_PASSWORDFILTERERROR , 2705 ) /* 0x00000a91 */ \ XXX( WERR_UNKNOWN_PRINT_MONITOR , 3000 ) /* 0x00000bb8 */ \ XXX( WERR_PRINTER_DRIVER_IN_USE , 3001 ) /* 0x00000bb9 */ \ XXX( WERR_SPOOL_FILE_NOT_FOUND , 3002 ) /* 0x00000bba */ \ XXX( WERR_SPL_NO_STARTDOC , 3003 ) /* 0x00000bbb */ \ XXX( WERR_SPL_NO_ADDJOB , 3004 ) /* 0x00000bbc */ \ XXX( WERR_PRINT_PROCESSOR_ALREADY_INSTALLED , 3005 ) /* 0x00000bbd */ \ XXX( WERR_PRINT_MONITOR_ALREADY_INSTALLED , 3006 ) /* 0x00000bbe */ \ XXX( WERR_INVALID_PRINT_MONITOR , 3007 ) /* 0x00000bbf */ \ XXX( WERR_PRINT_MONITOR_IN_USE , 3008 ) /* 0x00000bc0 */ \ XXX( WERR_PRINTER_HAS_JOBS_QUEUED , 3009 ) /* 0x00000bc1 */ \ XXX( WERR_SUCCESS_REBOOT_REQUIRED , 3010 ) /* 0x00000bc2 */ \ XXX( WERR_SUCCESS_RESTART_REQUIRED , 3011 ) /* 0x00000bc3 */ \ XXX( WERR_PRINTER_NOT_FOUND , 3012 ) /* 0x00000bc4 */ \ XXX( WERR_PRINTER_DRIVER_WARNED , 3013 ) /* 0x00000bc5 */ \ XXX( WERR_PRINTER_DRIVER_BLOCKED , 3014 ) /* 0x00000bc6 */ \ XXX( WERR_PRINTER_DRIVER_PACKAGE_IN_USE , 3015 ) /* 0x00000bc7 */ \ XXX( WERR_CORE_DRIVER_PACKAGE_NOT_FOUND , 3016 ) /* 0x00000bc8 */ \ XXX( WERR_FAIL_REBOOT_REQUIRED , 3017 ) /* 0x00000bc9 */ \ XXX( WERR_FAIL_REBOOT_INITIATED , 3018 ) /* 0x00000bca */ \ XXX( WERR_IO_REISSUE_AS_CACHED , 3950 ) /* 0x00000f6e */ \ XXX( WERR_WINS_INTERNAL , 4000 ) /* 0x00000fa0 */ \ XXX( WERR_CAN_NOT_DEL_LOCAL_WINS , 4001 ) /* 0x00000fa1 */ \ XXX( WERR_STATIC_INIT , 4002 ) /* 0x00000fa2 */ \ XXX( WERR_INC_BACKUP , 4003 ) /* 0x00000fa3 */ \ XXX( WERR_FULL_BACKUP , 4004 ) /* 0x00000fa4 */ \ XXX( WERR_REC_NON_EXISTENT , 4005 ) /* 0x00000fa5 */ \ XXX( WERR_RPL_NOT_ALLOWED , 4006 ) /* 0x00000fa6 */ \ XXX( WERR_DHCP_ADDRESS_CONFLICT , 4100 ) /* 0x00001004 */ \ XXX( WERR_WMI_GUID_NOT_FOUND , 4200 ) /* 0x00001068 */ \ XXX( WERR_WMI_INSTANCE_NOT_FOUND , 4201 ) /* 0x00001069 */ \ XXX( WERR_WMI_ITEMID_NOT_FOUND , 4202 ) /* 0x0000106a */ \ XXX( WERR_WMI_TRY_AGAIN , 4203 ) /* 0x0000106b */ \ XXX( WERR_WMI_DP_NOT_FOUND , 4204 ) /* 0x0000106c */ \ XXX( WERR_WMI_UNRESOLVED_INSTANCE_REF , 4205 ) /* 0x0000106d */ \ XXX( WERR_WMI_ALREADY_ENABLED , 4206 ) /* 0x0000106e */ \ XXX( WERR_WMI_GUID_DISCONNECTED , 4207 ) /* 0x0000106f */ \ XXX( WERR_WMI_SERVER_UNAVAILABLE , 4208 ) /* 0x00001070 */ \ XXX( WERR_WMI_DP_FAILED , 4209 ) /* 0x00001071 */ \ XXX( WERR_WMI_INVALID_MOF , 4210 ) /* 0x00001072 */ \ XXX( WERR_WMI_INVALID_REGINFO , 4211 ) /* 0x00001073 */ \ XXX( WERR_WMI_ALREADY_DISABLED , 4212 ) /* 0x00001074 */ \ XXX( WERR_WMI_READ_ONLY , 4213 ) /* 0x00001075 */ \ XXX( WERR_WMI_SET_FAILURE , 4214 ) /* 0x00001076 */ \ XXX( WERR_INVALID_MEDIA , 4300 ) /* 0x000010cc */ \ XXX( WERR_INVALID_LIBRARY , 4301 ) /* 0x000010cd */ \ XXX( WERR_INVALID_MEDIA_POOL , 4302 ) /* 0x000010ce */ \ XXX( WERR_DRIVE_MEDIA_MISMATCH , 4303 ) /* 0x000010cf */ \ XXX( WERR_MEDIA_OFFLINE , 4304 ) /* 0x000010d0 */ \ XXX( WERR_LIBRARY_OFFLINE , 4305 ) /* 0x000010d1 */ \ XXX( WERR_EMPTY , 4306 ) /* 0x000010d2 */ \ XXX( WERR_NOT_EMPTY , 4307 ) /* 0x000010d3 */ \ XXX( WERR_MEDIA_UNAVAILABLE , 4308 ) /* 0x000010d4 */ \ XXX( WERR_RESOURCE_DISABLED , 4309 ) /* 0x000010d5 */ \ XXX( WERR_INVALID_CLEANER , 4310 ) /* 0x000010d6 */ \ XXX( WERR_UNABLE_TO_CLEAN , 4311 ) /* 0x000010d7 */ \ XXX( WERR_OBJECT_NOT_FOUND , 4312 ) /* 0x000010d8 */ \ XXX( WERR_DATABASE_FAILURE , 4313 ) /* 0x000010d9 */ \ XXX( WERR_DATABASE_FULL , 4314 ) /* 0x000010da */ \ XXX( WERR_MEDIA_INCOMPATIBLE , 4315 ) /* 0x000010db */ \ XXX( WERR_RESOURCE_NOT_PRESENT , 4316 ) /* 0x000010dc */ \ XXX( WERR_INVALID_OPERATION , 4317 ) /* 0x000010dd */ \ XXX( WERR_MEDIA_NOT_AVAILABLE , 4318 ) /* 0x000010de */ \ XXX( WERR_DEVICE_NOT_AVAILABLE , 4319 ) /* 0x000010df */ \ XXX( WERR_REQUEST_REFUSED , 4320 ) /* 0x000010e0 */ \ XXX( WERR_INVALID_DRIVE_OBJECT , 4321 ) /* 0x000010e1 */ \ XXX( WERR_LIBRARY_FULL , 4322 ) /* 0x000010e2 */ \ XXX( WERR_MEDIUM_NOT_ACCESSIBLE , 4323 ) /* 0x000010e3 */ \ XXX( WERR_UNABLE_TO_LOAD_MEDIUM , 4324 ) /* 0x000010e4 */ \ XXX( WERR_UNABLE_TO_INVENTORY_DRIVE , 4325 ) /* 0x000010e5 */ \ XXX( WERR_UNABLE_TO_INVENTORY_SLOT , 4326 ) /* 0x000010e6 */ \ XXX( WERR_UNABLE_TO_INVENTORY_TRANSPORT , 4327 ) /* 0x000010e7 */ \ XXX( WERR_TRANSPORT_FULL , 4328 ) /* 0x000010e8 */ \ XXX( WERR_CONTROLLING_IEPORT , 4329 ) /* 0x000010e9 */ \ XXX( WERR_UNABLE_TO_EJECT_MOUNTED_MEDIA , 4330 ) /* 0x000010ea */ \ XXX( WERR_CLEANER_SLOT_SET , 4331 ) /* 0x000010eb */ \ XXX( WERR_CLEANER_SLOT_NOT_SET , 4332 ) /* 0x000010ec */ \ XXX( WERR_CLEANER_CARTRIDGE_SPENT , 4333 ) /* 0x000010ed */ \ XXX( WERR_UNEXPECTED_OMID , 4334 ) /* 0x000010ee */ \ XXX( WERR_CANT_DELETE_LAST_ITEM , 4335 ) /* 0x000010ef */ \ XXX( WERR_MESSAGE_EXCEEDS_MAX_SIZE , 4336 ) /* 0x000010f0 */ \ XXX( WERR_VOLUME_CONTAINS_SYS_FILES , 4337 ) /* 0x000010f1 */ \ XXX( WERR_INDIGENOUS_TYPE , 4338 ) /* 0x000010f2 */ \ XXX( WERR_NO_SUPPORTING_DRIVES , 4339 ) /* 0x000010f3 */ \ XXX( WERR_CLEANER_CARTRIDGE_INSTALLED , 4340 ) /* 0x000010f4 */ \ XXX( WERR_IEPORT_FULL , 4341 ) /* 0x000010f5 */ \ XXX( WERR_FILE_OFFLINE , 4350 ) /* 0x000010fe */ \ XXX( WERR_REMOTE_STORAGE_NOT_ACTIVE , 4351 ) /* 0x000010ff */ \ XXX( WERR_REMOTE_STORAGE_MEDIA_ERROR , 4352 ) /* 0x00001100 */ \ XXX( WERR_NOT_A_REPARSE_POINT , 4390 ) /* 0x00001126 */ \ XXX( WERR_REPARSE_ATTRIBUTE_CONFLICT , 4391 ) /* 0x00001127 */ \ XXX( WERR_INVALID_REPARSE_DATA , 4392 ) /* 0x00001128 */ \ XXX( WERR_REPARSE_TAG_INVALID , 4393 ) /* 0x00001129 */ \ XXX( WERR_REPARSE_TAG_MISMATCH , 4394 ) /* 0x0000112a */ \ XXX( WERR_VOLUME_NOT_SIS_ENABLED , 4500 ) /* 0x00001194 */ \ XXX( WERR_DEPENDENT_RESOURCE_EXISTS , 5001 ) /* 0x00001389 */ \ XXX( WERR_DEPENDENCY_NOT_FOUND , 5002 ) /* 0x0000138a */ \ XXX( WERR_DEPENDENCY_ALREADY_EXISTS , 5003 ) /* 0x0000138b */ \ XXX( WERR_RESOURCE_NOT_ONLINE , 5004 ) /* 0x0000138c */ \ XXX( WERR_HOST_NODE_NOT_AVAILABLE , 5005 ) /* 0x0000138d */ \ XXX( WERR_RESOURCE_NOT_AVAILABLE , 5006 ) /* 0x0000138e */ \ XXX( WERR_RESOURCE_NOT_FOUND , 5007 ) /* 0x0000138f */ \ XXX( WERR_SHUTDOWN_CLUSTER , 5008 ) /* 0x00001390 */ \ XXX( WERR_CANT_EVICT_ACTIVE_NODE , 5009 ) /* 0x00001391 */ \ XXX( WERR_OBJECT_ALREADY_EXISTS , 5010 ) /* 0x00001392 */ \ XXX( WERR_OBJECT_IN_LIST , 5011 ) /* 0x00001393 */ \ XXX( WERR_GROUP_NOT_AVAILABLE , 5012 ) /* 0x00001394 */ \ XXX( WERR_GROUP_NOT_FOUND , 5013 ) /* 0x00001395 */ \ XXX( WERR_GROUP_NOT_ONLINE , 5014 ) /* 0x00001396 */ \ XXX( WERR_HOST_NODE_NOT_RESOURCE_OWNER , 5015 ) /* 0x00001397 */ \ XXX( WERR_HOST_NODE_NOT_GROUP_OWNER , 5016 ) /* 0x00001398 */ \ XXX( WERR_RESMON_CREATE_FAILED , 5017 ) /* 0x00001399 */ \ XXX( WERR_RESMON_ONLINE_FAILED , 5018 ) /* 0x0000139a */ \ XXX( WERR_RESOURCE_ONLINE , 5019 ) /* 0x0000139b */ \ XXX( WERR_QUORUM_RESOURCE , 5020 ) /* 0x0000139c */ \ XXX( WERR_NOT_QUORUM_CAPABLE , 5021 ) /* 0x0000139d */ \ XXX( WERR_CLUSTER_SHUTTING_DOWN , 5022 ) /* 0x0000139e */ \ XXX( WERR_INVALID_STATE , 5023 ) /* 0x0000139f */ \ XXX( WERR_RESOURCE_PROPERTIES_STORED , 5024 ) /* 0x000013a0 */ \ XXX( WERR_NOT_QUORUM_CLASS , 5025 ) /* 0x000013a1 */ \ XXX( WERR_CORE_RESOURCE , 5026 ) /* 0x000013a2 */ \ XXX( WERR_QUORUM_RESOURCE_ONLINE_FAILED , 5027 ) /* 0x000013a3 */ \ XXX( WERR_QUORUMLOG_OPEN_FAILED , 5028 ) /* 0x000013a4 */ \ XXX( WERR_CLUSTERLOG_CORRUPT , 5029 ) /* 0x000013a5 */ \ XXX( WERR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE , 5030 ) /* 0x000013a6 */ \ XXX( WERR_CLUSTERLOG_EXCEEDS_MAXSIZE , 5031 ) /* 0x000013a7 */ \ XXX( WERR_CLUSTERLOG_CHKPOINT_NOT_FOUND , 5032 ) /* 0x000013a8 */ \ XXX( WERR_CLUSTERLOG_NOT_ENOUGH_SPACE , 5033 ) /* 0x000013a9 */ \ XXX( WERR_QUORUM_OWNER_ALIVE , 5034 ) /* 0x000013aa */ \ XXX( WERR_NETWORK_NOT_AVAILABLE , 5035 ) /* 0x000013ab */ \ XXX( WERR_NODE_NOT_AVAILABLE , 5036 ) /* 0x000013ac */ \ XXX( WERR_ALL_NODES_NOT_AVAILABLE , 5037 ) /* 0x000013ad */ \ XXX( WERR_RESOURCE_FAILED , 5038 ) /* 0x000013ae */ \ XXX( WERR_CLUSTER_INVALID_NODE , 5039 ) /* 0x000013af */ \ XXX( WERR_CLUSTER_NODE_EXISTS , 5040 ) /* 0x000013b0 */ \ XXX( WERR_CLUSTER_JOIN_IN_PROGRESS , 5041 ) /* 0x000013b1 */ \ XXX( WERR_CLUSTER_NODE_NOT_FOUND , 5042 ) /* 0x000013b2 */ \ XXX( WERR_CLUSTER_LOCAL_NODE_NOT_FOUND , 5043 ) /* 0x000013b3 */ \ XXX( WERR_CLUSTER_NETWORK_EXISTS , 5044 ) /* 0x000013b4 */ \ XXX( WERR_CLUSTER_NETWORK_NOT_FOUND , 5045 ) /* 0x000013b5 */ \ XXX( WERR_CLUSTER_NETINTERFACE_EXISTS , 5046 ) /* 0x000013b6 */ \ XXX( WERR_CLUSTER_NETINTERFACE_NOT_FOUND , 5047 ) /* 0x000013b7 */ \ XXX( WERR_CLUSTER_INVALID_REQUEST , 5048 ) /* 0x000013b8 */ \ XXX( WERR_CLUSTER_INVALID_NETWORK_PROVIDER , 5049 ) /* 0x000013b9 */ \ XXX( WERR_CLUSTER_NODE_DOWN , 5050 ) /* 0x000013ba */ \ XXX( WERR_CLUSTER_NODE_UNREACHABLE , 5051 ) /* 0x000013bb */ \ XXX( WERR_CLUSTER_NODE_NOT_MEMBER , 5052 ) /* 0x000013bc */ \ XXX( WERR_CLUSTER_JOIN_NOT_IN_PROGRESS , 5053 ) /* 0x000013bd */ \ XXX( WERR_CLUSTER_INVALID_NETWORK , 5054 ) /* 0x000013be */ \ XXX( WERR_CLUSTER_NODE_UP , 5056 ) /* 0x000013c0 */ \ XXX( WERR_CLUSTER_IPADDR_IN_USE , 5057 ) /* 0x000013c1 */ \ XXX( WERR_CLUSTER_NODE_NOT_PAUSED , 5058 ) /* 0x000013c2 */ \ XXX( WERR_CLUSTER_NO_SECURITY_CONTEXT , 5059 ) /* 0x000013c3 */ \ XXX( WERR_CLUSTER_NETWORK_NOT_INTERNAL , 5060 ) /* 0x000013c4 */ \ XXX( WERR_CLUSTER_NODE_ALREADY_UP , 5061 ) /* 0x000013c5 */ \ XXX( WERR_CLUSTER_NODE_ALREADY_DOWN , 5062 ) /* 0x000013c6 */ \ XXX( WERR_CLUSTER_NETWORK_ALREADY_ONLINE , 5063 ) /* 0x000013c7 */ \ XXX( WERR_CLUSTER_NETWORK_ALREADY_OFFLINE , 5064 ) /* 0x000013c8 */ \ XXX( WERR_CLUSTER_NODE_ALREADY_MEMBER , 5065 ) /* 0x000013c9 */ \ XXX( WERR_CLUSTER_LAST_INTERNAL_NETWORK , 5066 ) /* 0x000013ca */ \ XXX( WERR_CLUSTER_NETWORK_HAS_DEPENDENTS , 5067 ) /* 0x000013cb */ \ XXX( WERR_INVALID_OPERATION_ON_QUORUM , 5068 ) /* 0x000013cc */ \ XXX( WERR_DEPENDENCY_NOT_ALLOWED , 5069 ) /* 0x000013cd */ \ XXX( WERR_CLUSTER_NODE_PAUSED , 5070 ) /* 0x000013ce */ \ XXX( WERR_NODE_CANT_HOST_RESOURCE , 5071 ) /* 0x000013cf */ \ XXX( WERR_CLUSTER_NODE_NOT_READY , 5072 ) /* 0x000013d0 */ \ XXX( WERR_CLUSTER_NODE_SHUTTING_DOWN , 5073 ) /* 0x000013d1 */ \ XXX( WERR_CLUSTER_JOIN_ABORTED , 5074 ) /* 0x000013d2 */ \ XXX( WERR_CLUSTER_INCOMPATIBLE_VERSIONS , 5075 ) /* 0x000013d3 */ \ XXX( WERR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED , 5076 ) /* 0x000013d4 */ \ XXX( WERR_CLUSTER_SYSTEM_CONFIG_CHANGED , 5077 ) /* 0x000013d5 */ \ XXX( WERR_CLUSTER_RESOURCE_TYPE_NOT_FOUND , 5078 ) /* 0x000013d6 */ \ XXX( WERR_CLUSTER_RESTYPE_NOT_SUPPORTED , 5079 ) /* 0x000013d7 */ \ XXX( WERR_CLUSTER_RESNAME_NOT_FOUND , 5080 ) /* 0x000013d8 */ \ XXX( WERR_CLUSTER_NO_RPC_PACKAGES_REGISTERED , 5081 ) /* 0x000013d9 */ \ XXX( WERR_CLUSTER_OWNER_NOT_IN_PREFLIST , 5082 ) /* 0x000013da */ \ XXX( WERR_CLUSTER_DATABASE_SEQMISMATCH , 5083 ) /* 0x000013db */ \ XXX( WERR_RESMON_INVALID_STATE , 5084 ) /* 0x000013dc */ \ XXX( WERR_CLUSTER_GUM_NOT_LOCKER , 5085 ) /* 0x000013dd */ \ XXX( WERR_QUORUM_DISK_NOT_FOUND , 5086 ) /* 0x000013de */ \ XXX( WERR_DATABASE_BACKUP_CORRUPT , 5087 ) /* 0x000013df */ \ XXX( WERR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT , 5088 ) /* 0x000013e0 */ \ XXX( WERR_RESOURCE_PROPERTY_UNCHANGEABLE , 5089 ) /* 0x000013e1 */ \ XXX( WERR_CLUSTER_MEMBERSHIP_INVALID_STATE , 5890 ) /* 0x00001702 */ \ XXX( WERR_CLUSTER_QUORUMLOG_NOT_FOUND , 5891 ) /* 0x00001703 */ \ XXX( WERR_CLUSTER_MEMBERSHIP_HALT , 5892 ) /* 0x00001704 */ \ XXX( WERR_CLUSTER_INSTANCE_ID_MISMATCH , 5893 ) /* 0x00001705 */ \ XXX( WERR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP , 5894 ) /* 0x00001706 */ \ XXX( WERR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH , 5895 ) /* 0x00001707 */ \ XXX( WERR_CLUSTER_EVICT_WITHOUT_CLEANUP , 5896 ) /* 0x00001708 */ \ XXX( WERR_CLUSTER_PARAMETER_MISMATCH , 5897 ) /* 0x00001709 */ \ XXX( WERR_NODE_CANNOT_BE_CLUSTERED , 5898 ) /* 0x0000170a */ \ XXX( WERR_CLUSTER_WRONG_OS_VERSION , 5899 ) /* 0x0000170b */ \ XXX( WERR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME , 5900 ) /* 0x0000170c */ \ XXX( WERR_CLUSCFG_ALREADY_COMMITTED , 5901 ) /* 0x0000170d */ \ XXX( WERR_CLUSCFG_ROLLBACK_FAILED , 5902 ) /* 0x0000170e */ \ XXX( WERR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT , 5903 ) /* 0x0000170f */ \ XXX( WERR_CLUSTER_OLD_VERSION , 5904 ) /* 0x00001710 */ \ XXX( WERR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME , 5905 ) /* 0x00001711 */ \ XXX( WERR_CLUSTER_NO_NET_ADAPTERS , 5906 ) /* 0x00001712 */ \ XXX( WERR_CLUSTER_POISONED , 5907 ) /* 0x00001713 */ \ XXX( WERR_CLUSTER_GROUP_MOVING , 5908 ) /* 0x00001714 */ \ XXX( WERR_CLUSTER_RESOURCE_TYPE_BUSY , 5909 ) /* 0x00001715 */ \ XXX( WERR_RESOURCE_CALL_TIMED_OUT , 5910 ) /* 0x00001716 */ \ XXX( WERR_INVALID_CLUSTER_IPV6_ADDRESS , 5911 ) /* 0x00001717 */ \ XXX( WERR_CLUSTER_INTERNAL_INVALID_FUNCTION , 5912 ) /* 0x00001718 */ \ XXX( WERR_CLUSTER_PARAMETER_OUT_OF_BOUNDS , 5913 ) /* 0x00001719 */ \ XXX( WERR_CLUSTER_PARTIAL_SEND , 5914 ) /* 0x0000171a */ \ XXX( WERR_CLUSTER_REGISTRY_INVALID_FUNCTION , 5915 ) /* 0x0000171b */ \ XXX( WERR_CLUSTER_INVALID_STRING_TERMINATION , 5916 ) /* 0x0000171c */ \ XXX( WERR_CLUSTER_INVALID_STRING_FORMAT , 5917 ) /* 0x0000171d */ \ XXX( WERR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS , 5918 ) /* 0x0000171e */ \ XXX( WERR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS , 5919 ) /* 0x0000171f */ \ XXX( WERR_CLUSTER_NULL_DATA , 5920 ) /* 0x00001720 */ \ XXX( WERR_CLUSTER_PARTIAL_READ , 5921 ) /* 0x00001721 */ \ XXX( WERR_CLUSTER_PARTIAL_WRITE , 5922 ) /* 0x00001722 */ \ XXX( WERR_CLUSTER_CANT_DESERIALIZE_DATA , 5923 ) /* 0x00001723 */ \ XXX( WERR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT , 5924 ) /* 0x00001724 */ \ XXX( WERR_CLUSTER_NO_QUORUM , 5925 ) /* 0x00001725 */ \ XXX( WERR_CLUSTER_INVALID_IPV6_NETWORK , 5926 ) /* 0x00001726 */ \ XXX( WERR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK , 5927 ) /* 0x00001727 */ \ XXX( WERR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP , 5928 ) /* 0x00001728 */ \ XXX( WERR_ENCRYPTION_FAILED , 6000 ) /* 0x00001770 */ \ XXX( WERR_DECRYPTION_FAILED , 6001 ) /* 0x00001771 */ \ XXX( WERR_FILE_ENCRYPTED , 6002 ) /* 0x00001772 */ \ XXX( WERR_NO_RECOVERY_POLICY , 6003 ) /* 0x00001773 */ \ XXX( WERR_NO_EFS , 6004 ) /* 0x00001774 */ \ XXX( WERR_WRONG_EFS , 6005 ) /* 0x00001775 */ \ XXX( WERR_NO_USER_KEYS , 6006 ) /* 0x00001776 */ \ XXX( WERR_FILE_NOT_ENCRYPTED , 6007 ) /* 0x00001777 */ \ XXX( WERR_NOT_EXPORT_FORMAT , 6008 ) /* 0x00001778 */ \ XXX( WERR_FILE_READ_ONLY , 6009 ) /* 0x00001779 */ \ XXX( WERR_DIR_EFS_DISALLOWED , 6010 ) /* 0x0000177a */ \ XXX( WERR_EFS_SERVER_NOT_TRUSTED , 6011 ) /* 0x0000177b */ \ XXX( WERR_BAD_RECOVERY_POLICY , 6012 ) /* 0x0000177c */ \ XXX( WERR_EFS_ALG_BLOB_TOO_BIG , 6013 ) /* 0x0000177d */ \ XXX( WERR_VOLUME_NOT_SUPPORT_EFS , 6014 ) /* 0x0000177e */ \ XXX( WERR_EFS_DISABLED , 6015 ) /* 0x0000177f */ \ XXX( WERR_EFS_VERSION_NOT_SUPPORT , 6016 ) /* 0x00001780 */ \ XXX( WERR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE , 6017 ) /* 0x00001781 */ \ XXX( WERR_CS_ENCRYPTION_UNSUPPORTED_SERVER , 6018 ) /* 0x00001782 */ \ XXX( WERR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE , 6019 ) /* 0x00001783 */ \ XXX( WERR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE , 6020 ) /* 0x00001784 */ \ XXX( WERR_CS_ENCRYPTION_FILE_NOT_CSE , 6021 ) /* 0x00001785 */ \ XXX( WERR_NO_BROWSER_SERVERS_FOUND , 6118 ) /* 0x000017e6 */ \ XXX( WERR_LOG_SECTOR_INVALID , 6600 ) /* 0x000019c8 */ \ XXX( WERR_LOG_SECTOR_PARITY_INVALID , 6601 ) /* 0x000019c9 */ \ XXX( WERR_LOG_SECTOR_REMAPPED , 6602 ) /* 0x000019ca */ \ XXX( WERR_LOG_BLOCK_INCOMPLETE , 6603 ) /* 0x000019cb */ \ XXX( WERR_LOG_INVALID_RANGE , 6604 ) /* 0x000019cc */ \ XXX( WERR_LOG_BLOCKS_EXHAUSTED , 6605 ) /* 0x000019cd */ \ XXX( WERR_LOG_READ_CONTEXT_INVALID , 6606 ) /* 0x000019ce */ \ XXX( WERR_LOG_RESTART_INVALID , 6607 ) /* 0x000019cf */ \ XXX( WERR_LOG_BLOCK_VERSION , 6608 ) /* 0x000019d0 */ \ XXX( WERR_LOG_BLOCK_INVALID , 6609 ) /* 0x000019d1 */ \ XXX( WERR_LOG_READ_MODE_INVALID , 6610 ) /* 0x000019d2 */ \ XXX( WERR_LOG_NO_RESTART , 6611 ) /* 0x000019d3 */ \ XXX( WERR_LOG_METADATA_CORRUPT , 6612 ) /* 0x000019d4 */ \ XXX( WERR_LOG_METADATA_INVALID , 6613 ) /* 0x000019d5 */ \ XXX( WERR_LOG_METADATA_INCONSISTENT , 6614 ) /* 0x000019d6 */ \ XXX( WERR_LOG_RESERVATION_INVALID , 6615 ) /* 0x000019d7 */ \ XXX( WERR_LOG_CANT_DELETE , 6616 ) /* 0x000019d8 */ \ XXX( WERR_LOG_CONTAINER_LIMIT_EXCEEDED , 6617 ) /* 0x000019d9 */ \ XXX( WERR_LOG_START_OF_LOG , 6618 ) /* 0x000019da */ \ XXX( WERR_LOG_POLICY_ALREADY_INSTALLED , 6619 ) /* 0x000019db */ \ XXX( WERR_LOG_POLICY_NOT_INSTALLED , 6620 ) /* 0x000019dc */ \ XXX( WERR_LOG_POLICY_INVALID , 6621 ) /* 0x000019dd */ \ XXX( WERR_LOG_POLICY_CONFLICT , 6622 ) /* 0x000019de */ \ XXX( WERR_LOG_PINNED_ARCHIVE_TAIL , 6623 ) /* 0x000019df */ \ XXX( WERR_LOG_RECORD_NONEXISTENT , 6624 ) /* 0x000019e0 */ \ XXX( WERR_LOG_RECORDS_RESERVED_INVALID , 6625 ) /* 0x000019e1 */ \ XXX( WERR_LOG_SPACE_RESERVED_INVALID , 6626 ) /* 0x000019e2 */ \ XXX( WERR_LOG_TAIL_INVALID , 6627 ) /* 0x000019e3 */ \ XXX( WERR_LOG_FULL , 6628 ) /* 0x000019e4 */ \ XXX( WERR_COULD_NOT_RESIZE_LOG , 6629 ) /* 0x000019e5 */ \ XXX( WERR_LOG_MULTIPLEXED , 6630 ) /* 0x000019e6 */ \ XXX( WERR_LOG_DEDICATED , 6631 ) /* 0x000019e7 */ \ XXX( WERR_LOG_ARCHIVE_NOT_IN_PROGRESS , 6632 ) /* 0x000019e8 */ \ XXX( WERR_LOG_ARCHIVE_IN_PROGRESS , 6633 ) /* 0x000019e9 */ \ XXX( WERR_LOG_EPHEMERAL , 6634 ) /* 0x000019ea */ \ XXX( WERR_LOG_NOT_ENOUGH_CONTAINERS , 6635 ) /* 0x000019eb */ \ XXX( WERR_LOG_CLIENT_ALREADY_REGISTERED , 6636 ) /* 0x000019ec */ \ XXX( WERR_LOG_CLIENT_NOT_REGISTERED , 6637 ) /* 0x000019ed */ \ XXX( WERR_LOG_FULL_HANDLER_IN_PROGRESS , 6638 ) /* 0x000019ee */ \ XXX( WERR_LOG_CONTAINER_READ_FAILED , 6639 ) /* 0x000019ef */ \ XXX( WERR_LOG_CONTAINER_WRITE_FAILED , 6640 ) /* 0x000019f0 */ \ XXX( WERR_LOG_CONTAINER_OPEN_FAILED , 6641 ) /* 0x000019f1 */ \ XXX( WERR_LOG_CONTAINER_STATE_INVALID , 6642 ) /* 0x000019f2 */ \ XXX( WERR_LOG_STATE_INVALID , 6643 ) /* 0x000019f3 */ \ XXX( WERR_LOG_PINNED , 6644 ) /* 0x000019f4 */ \ XXX( WERR_LOG_METADATA_FLUSH_FAILED , 6645 ) /* 0x000019f5 */ \ XXX( WERR_LOG_INCONSISTENT_SECURITY , 6646 ) /* 0x000019f6 */ \ XXX( WERR_LOG_APPENDED_FLUSH_FAILED , 6647 ) /* 0x000019f7 */ \ XXX( WERR_LOG_PINNED_RESERVATION , 6648 ) /* 0x000019f8 */ \ XXX( WERR_INVALID_TRANSACTION , 6700 ) /* 0x00001a2c */ \ XXX( WERR_TRANSACTION_NOT_ACTIVE , 6701 ) /* 0x00001a2d */ \ XXX( WERR_TRANSACTION_REQUEST_NOT_VALID , 6702 ) /* 0x00001a2e */ \ XXX( WERR_TRANSACTION_NOT_REQUESTED , 6703 ) /* 0x00001a2f */ \ XXX( WERR_TRANSACTION_ALREADY_ABORTED , 6704 ) /* 0x00001a30 */ \ XXX( WERR_TRANSACTION_ALREADY_COMMITTED , 6705 ) /* 0x00001a31 */ \ XXX( WERR_TM_INITIALIZATION_FAILED , 6706 ) /* 0x00001a32 */ \ XXX( WERR_RESOURCEMANAGER_READ_ONLY , 6707 ) /* 0x00001a33 */ \ XXX( WERR_TRANSACTION_NOT_JOINED , 6708 ) /* 0x00001a34 */ \ XXX( WERR_TRANSACTION_SUPERIOR_EXISTS , 6709 ) /* 0x00001a35 */ \ XXX( WERR_CRM_PROTOCOL_ALREADY_EXISTS , 6710 ) /* 0x00001a36 */ \ XXX( WERR_TRANSACTION_PROPAGATION_FAILED , 6711 ) /* 0x00001a37 */ \ XXX( WERR_CRM_PROTOCOL_NOT_FOUND , 6712 ) /* 0x00001a38 */ \ XXX( WERR_TRANSACTION_INVALID_MARSHALL_BUFFER , 6713 ) /* 0x00001a39 */ \ XXX( WERR_CURRENT_TRANSACTION_NOT_VALID , 6714 ) /* 0x00001a3a */ \ XXX( WERR_TRANSACTION_NOT_FOUND , 6715 ) /* 0x00001a3b */ \ XXX( WERR_RESOURCEMANAGER_NOT_FOUND , 6716 ) /* 0x00001a3c */ \ XXX( WERR_ENLISTMENT_NOT_FOUND , 6717 ) /* 0x00001a3d */ \ XXX( WERR_TRANSACTIONMANAGER_NOT_FOUND , 6718 ) /* 0x00001a3e */ \ XXX( WERR_TRANSACTIONMANAGER_NOT_ONLINE , 6719 ) /* 0x00001a3f */ \ XXX( WERR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION , 6720 ) /* 0x00001a40 */ \ XXX( WERR_TRANSACTIONAL_CONFLICT , 6800 ) /* 0x00001a90 */ \ XXX( WERR_RM_NOT_ACTIVE , 6801 ) /* 0x00001a91 */ \ XXX( WERR_RM_METADATA_CORRUPT , 6802 ) /* 0x00001a92 */ \ XXX( WERR_DIRECTORY_NOT_RM , 6803 ) /* 0x00001a93 */ \ XXX( WERR_TRANSACTIONS_UNSUPPORTED_REMOTE , 6805 ) /* 0x00001a95 */ \ XXX( WERR_LOG_RESIZE_INVALID_SIZE , 6806 ) /* 0x00001a96 */ \ XXX( WERR_OBJECT_NO_LONGER_EXISTS , 6807 ) /* 0x00001a97 */ \ XXX( WERR_STREAM_MINIVERSION_NOT_FOUND , 6808 ) /* 0x00001a98 */ \ XXX( WERR_STREAM_MINIVERSION_NOT_VALID , 6809 ) /* 0x00001a99 */ \ XXX( WERR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION, 6810 ) /* 0x00001a9a */ \ XXX( WERR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT , 6811 ) /* 0x00001a9b */ \ XXX( WERR_CANT_CREATE_MORE_STREAM_MINIVERSIONS , 6812 ) /* 0x00001a9c */ \ XXX( WERR_REMOTE_FILE_VERSION_MISMATCH , 6814 ) /* 0x00001a9e */ \ XXX( WERR_HANDLE_NO_LONGER_VALID , 6815 ) /* 0x00001a9f */ \ XXX( WERR_NO_TXF_METADATA , 6816 ) /* 0x00001aa0 */ \ XXX( WERR_LOG_CORRUPTION_DETECTED , 6817 ) /* 0x00001aa1 */ \ XXX( WERR_CANT_RECOVER_WITH_HANDLE_OPEN , 6818 ) /* 0x00001aa2 */ \ XXX( WERR_RM_DISCONNECTED , 6819 ) /* 0x00001aa3 */ \ XXX( WERR_ENLISTMENT_NOT_SUPERIOR , 6820 ) /* 0x00001aa4 */ \ XXX( WERR_RECOVERY_NOT_NEEDED , 6821 ) /* 0x00001aa5 */ \ XXX( WERR_RM_ALREADY_STARTED , 6822 ) /* 0x00001aa6 */ \ XXX( WERR_FILE_IDENTITY_NOT_PERSISTENT , 6823 ) /* 0x00001aa7 */ \ XXX( WERR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY , 6824 ) /* 0x00001aa8 */ \ XXX( WERR_CANT_CROSS_RM_BOUNDARY , 6825 ) /* 0x00001aa9 */ \ XXX( WERR_TXF_DIR_NOT_EMPTY , 6826 ) /* 0x00001aaa */ \ XXX( WERR_INDOUBT_TRANSACTIONS_EXIST , 6827 ) /* 0x00001aab */ \ XXX( WERR_TM_VOLATILE , 6828 ) /* 0x00001aac */ \ XXX( WERR_ROLLBACK_TIMER_EXPIRED , 6829 ) /* 0x00001aad */ \ XXX( WERR_TXF_ATTRIBUTE_CORRUPT , 6830 ) /* 0x00001aae */ \ XXX( WERR_EFS_NOT_ALLOWED_IN_TRANSACTION , 6831 ) /* 0x00001aaf */ \ XXX( WERR_TRANSACTIONAL_OPEN_NOT_ALLOWED , 6832 ) /* 0x00001ab0 */ \ XXX( WERR_LOG_GROWTH_FAILED , 6833 ) /* 0x00001ab1 */ \ XXX( WERR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE , 6834 ) /* 0x00001ab2 */ \ XXX( WERR_TXF_METADATA_ALREADY_PRESENT , 6835 ) /* 0x00001ab3 */ \ XXX( WERR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET , 6836 ) /* 0x00001ab4 */ \ XXX( WERR_TRANSACTION_REQUIRED_PROMOTION , 6837 ) /* 0x00001ab5 */ \ XXX( WERR_CANNOT_EXECUTE_FILE_IN_TRANSACTION , 6838 ) /* 0x00001ab6 */ \ XXX( WERR_TRANSACTIONS_NOT_FROZEN , 6839 ) /* 0x00001ab7 */ \ XXX( WERR_TRANSACTION_FREEZE_IN_PROGRESS , 6840 ) /* 0x00001ab8 */ \ XXX( WERR_NOT_SNAPSHOT_VOLUME , 6841 ) /* 0x00001ab9 */ \ XXX( WERR_NO_SAVEPOINT_WITH_OPEN_FILES , 6842 ) /* 0x00001aba */ \ XXX( WERR_DATA_LOST_REPAIR , 6843 ) /* 0x00001abb */ \ XXX( WERR_SPARSE_NOT_ALLOWED_IN_TRANSACTION , 6844 ) /* 0x00001abc */ \ XXX( WERR_TM_IDENTITY_MISMATCH , 6845 ) /* 0x00001abd */ \ XXX( WERR_FLOATED_SECTION , 6846 ) /* 0x00001abe */ \ XXX( WERR_CANNOT_ACCEPT_TRANSACTED_WORK , 6847 ) /* 0x00001abf */ \ XXX( WERR_CANNOT_ABORT_TRANSACTIONS , 6848 ) /* 0x00001ac0 */ \ XXX( WERR_CTX_WINSTATION_NAME_INVALID , 7001 ) /* 0x00001b59 */ \ XXX( WERR_CTX_INVALID_PD , 7002 ) /* 0x00001b5a */ \ XXX( WERR_CTX_PD_NOT_FOUND , 7003 ) /* 0x00001b5b */ \ XXX( WERR_CTX_WD_NOT_FOUND , 7004 ) /* 0x00001b5c */ \ XXX( WERR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY , 7005 ) /* 0x00001b5d */ \ XXX( WERR_CTX_SERVICE_NAME_COLLISION , 7006 ) /* 0x00001b5e */ \ XXX( WERR_CTX_CLOSE_PENDING , 7007 ) /* 0x00001b5f */ \ XXX( WERR_CTX_NO_OUTBUF , 7008 ) /* 0x00001b60 */ \ XXX( WERR_CTX_MODEM_INF_NOT_FOUND , 7009 ) /* 0x00001b61 */ \ XXX( WERR_CTX_INVALID_MODEMNAME , 7010 ) /* 0x00001b62 */ \ XXX( WERR_CTX_MODEM_RESPONSE_ERROR , 7011 ) /* 0x00001b63 */ \ XXX( WERR_CTX_MODEM_RESPONSE_TIMEOUT , 7012 ) /* 0x00001b64 */ \ XXX( WERR_CTX_MODEM_RESPONSE_NO_CARRIER , 7013 ) /* 0x00001b65 */ \ XXX( WERR_CTX_MODEM_RESPONSE_NO_DIALTONE , 7014 ) /* 0x00001b66 */ \ XXX( WERR_CTX_MODEM_RESPONSE_BUSY , 7015 ) /* 0x00001b67 */ \ XXX( WERR_CTX_MODEM_RESPONSE_VOICE , 7016 ) /* 0x00001b68 */ \ XXX( WERR_CTX_TD_ERROR , 7017 ) /* 0x00001b69 */ \ XXX( WERR_CTX_WINSTATION_NOT_FOUND , 7022 ) /* 0x00001b6e */ \ XXX( WERR_CTX_WINSTATION_ALREADY_EXISTS , 7023 ) /* 0x00001b6f */ \ XXX( WERR_CTX_WINSTATION_BUSY , 7024 ) /* 0x00001b70 */ \ XXX( WERR_CTX_BAD_VIDEO_MODE , 7025 ) /* 0x00001b71 */ \ XXX( WERR_CTX_GRAPHICS_INVALID , 7035 ) /* 0x00001b7b */ \ XXX( WERR_CTX_LOGON_DISABLED , 7037 ) /* 0x00001b7d */ \ XXX( WERR_CTX_NOT_CONSOLE , 7038 ) /* 0x00001b7e */ \ XXX( WERR_CTX_CLIENT_QUERY_TIMEOUT , 7040 ) /* 0x00001b80 */ \ XXX( WERR_CTX_CONSOLE_DISCONNECT , 7041 ) /* 0x00001b81 */ \ XXX( WERR_CTX_CONSOLE_CONNECT , 7042 ) /* 0x00001b82 */ \ XXX( WERR_CTX_SHADOW_DENIED , 7044 ) /* 0x00001b84 */ \ XXX( WERR_CTX_WINSTATION_ACCESS_DENIED , 7045 ) /* 0x00001b85 */ \ XXX( WERR_CTX_INVALID_WD , 7049 ) /* 0x00001b89 */ \ XXX( WERR_CTX_SHADOW_INVALID , 7050 ) /* 0x00001b8a */ \ XXX( WERR_CTX_SHADOW_DISABLED , 7051 ) /* 0x00001b8b */ \ XXX( WERR_CTX_CLIENT_LICENSE_IN_USE , 7052 ) /* 0x00001b8c */ \ XXX( WERR_CTX_CLIENT_LICENSE_NOT_SET , 7053 ) /* 0x00001b8d */ \ XXX( WERR_CTX_LICENSE_NOT_AVAILABLE , 7054 ) /* 0x00001b8e */ \ XXX( WERR_CTX_LICENSE_CLIENT_INVALID , 7055 ) /* 0x00001b8f */ \ XXX( WERR_CTX_LICENSE_EXPIRED , 7056 ) /* 0x00001b90 */ \ XXX( WERR_CTX_SHADOW_NOT_RUNNING , 7057 ) /* 0x00001b91 */ \ XXX( WERR_CTX_SHADOW_ENDED_BY_MODE_CHANGE , 7058 ) /* 0x00001b92 */ \ XXX( WERR_ACTIVATION_COUNT_EXCEEDED , 7059 ) /* 0x00001b93 */ \ XXX( WERR_CTX_WINSTATIONS_DISABLED , 7060 ) /* 0x00001b94 */ \ XXX( WERR_CTX_ENCRYPTION_LEVEL_REQUIRED , 7061 ) /* 0x00001b95 */ \ XXX( WERR_CTX_SESSION_IN_USE , 7062 ) /* 0x00001b96 */ \ XXX( WERR_CTX_NO_FORCE_LOGOFF , 7063 ) /* 0x00001b97 */ \ XXX( WERR_CTX_ACCOUNT_RESTRICTION , 7064 ) /* 0x00001b98 */ \ XXX( WERR_RDP_PROTOCOL_ERROR , 7065 ) /* 0x00001b99 */ \ XXX( WERR_CTX_CDM_CONNECT , 7066 ) /* 0x00001b9a */ \ XXX( WERR_CTX_CDM_DISCONNECT , 7067 ) /* 0x00001b9b */ \ XXX( WERR_CTX_SECURITY_LAYER_ERROR , 7068 ) /* 0x00001b9c */ \ XXX( WERR_TS_INCOMPATIBLE_SESSIONS , 7069 ) /* 0x00001b9d */ \ XXX( WERR_FRS_ERR_INVALID_API_SEQUENCE , 8001 ) /* 0x00001f41 */ \ XXX( WERR_FRS_ERR_STARTING_SERVICE , 8002 ) /* 0x00001f42 */ \ XXX( WERR_FRS_ERR_STOPPING_SERVICE , 8003 ) /* 0x00001f43 */ \ XXX( WERR_FRS_ERR_INTERNAL_API , 8004 ) /* 0x00001f44 */ \ XXX( WERR_FRS_ERR_INTERNAL , 8005 ) /* 0x00001f45 */ \ XXX( WERR_FRS_ERR_SERVICE_COMM , 8006 ) /* 0x00001f46 */ \ XXX( WERR_FRS_ERR_INSUFFICIENT_PRIV , 8007 ) /* 0x00001f47 */ \ XXX( WERR_FRS_ERR_AUTHENTICATION , 8008 ) /* 0x00001f48 */ \ XXX( WERR_FRS_ERR_PARENT_INSUFFICIENT_PRIV , 8009 ) /* 0x00001f49 */ \ XXX( WERR_FRS_ERR_PARENT_AUTHENTICATION , 8010 ) /* 0x00001f4a */ \ XXX( WERR_FRS_ERR_CHILD_TO_PARENT_COMM , 8011 ) /* 0x00001f4b */ \ XXX( WERR_FRS_ERR_PARENT_TO_CHILD_COMM , 8012 ) /* 0x00001f4c */ \ XXX( WERR_FRS_ERR_SYSVOL_POPULATE , 8013 ) /* 0x00001f4d */ \ XXX( WERR_FRS_ERR_SYSVOL_POPULATE_TIMEOUT , 8014 ) /* 0x00001f4e */ \ XXX( WERR_FRS_ERR_SYSVOL_IS_BUSY , 8015 ) /* 0x00001f4f */ \ XXX( WERR_FRS_ERR_SYSVOL_DEMOTE , 8016 ) /* 0x00001f50 */ \ XXX( WERR_FRS_ERR_INVALID_SERVICE_PARAMETER , 8017 ) /* 0x00001f51 */ \ XXX( WERR_DS_NOT_INSTALLED , 8200 ) /* 0x00002008 */ \ XXX( WERR_DS_MEMBERSHIP_EVALUATED_LOCALLY , 8201 ) /* 0x00002009 */ \ XXX( WERR_DS_NO_ATTRIBUTE_OR_VALUE , 8202 ) /* 0x0000200a */ \ XXX( WERR_DS_INVALID_ATTRIBUTE_SYNTAX , 8203 ) /* 0x0000200b */ \ XXX( WERR_DS_ATTRIBUTE_TYPE_UNDEFINED , 8204 ) /* 0x0000200c */ \ XXX( WERR_DS_ATTRIBUTE_OR_VALUE_EXISTS , 8205 ) /* 0x0000200d */ \ XXX( WERR_DS_BUSY , 8206 ) /* 0x0000200e */ \ XXX( WERR_DS_UNAVAILABLE , 8207 ) /* 0x0000200f */ \ XXX( WERR_DS_NO_RIDS_ALLOCATED , 8208 ) /* 0x00002010 */ \ XXX( WERR_DS_NO_MORE_RIDS , 8209 ) /* 0x00002011 */ \ XXX( WERR_DS_INCORRECT_ROLE_OWNER , 8210 ) /* 0x00002012 */ \ XXX( WERR_DS_RIDMGR_INIT_ERROR , 8211 ) /* 0x00002013 */ \ XXX( WERR_DS_OBJ_CLASS_VIOLATION , 8212 ) /* 0x00002014 */ \ XXX( WERR_DS_CANT_ON_NON_LEAF , 8213 ) /* 0x00002015 */ \ XXX( WERR_DS_CANT_ON_RDN , 8214 ) /* 0x00002016 */ \ XXX( WERR_DS_CANT_MOD_OBJ_CLASS , 8215 ) /* 0x00002017 */ \ XXX( WERR_DS_CROSS_DOM_MOVE_ERROR , 8216 ) /* 0x00002018 */ \ XXX( WERR_DS_GC_NOT_AVAILABLE , 8217 ) /* 0x00002019 */ \ XXX( WERR_SHARED_POLICY , 8218 ) /* 0x0000201a */ \ XXX( WERR_POLICY_OBJECT_NOT_FOUND , 8219 ) /* 0x0000201b */ \ XXX( WERR_POLICY_ONLY_IN_DS , 8220 ) /* 0x0000201c */ \ XXX( WERR_PROMOTION_ACTIVE , 8221 ) /* 0x0000201d */ \ XXX( WERR_NO_PROMOTION_ACTIVE , 8222 ) /* 0x0000201e */ \ XXX( WERR_DS_OPERATIONS_ERROR , 8224 ) /* 0x00002020 */ \ XXX( WERR_DS_PROTOCOL_ERROR , 8225 ) /* 0x00002021 */ \ XXX( WERR_DS_TIMELIMIT_EXCEEDED , 8226 ) /* 0x00002022 */ \ XXX( WERR_DS_SIZELIMIT_EXCEEDED , 8227 ) /* 0x00002023 */ \ XXX( WERR_DS_ADMIN_LIMIT_EXCEEDED , 8228 ) /* 0x00002024 */ \ XXX( WERR_DS_COMPARE_FALSE , 8229 ) /* 0x00002025 */ \ XXX( WERR_DS_COMPARE_TRUE , 8230 ) /* 0x00002026 */ \ XXX( WERR_DS_AUTH_METHOD_NOT_SUPPORTED , 8231 ) /* 0x00002027 */ \ XXX( WERR_DS_STRONG_AUTH_REQUIRED , 8232 ) /* 0x00002028 */ \ XXX( WERR_DS_INAPPROPRIATE_AUTH , 8233 ) /* 0x00002029 */ \ XXX( WERR_DS_AUTH_UNKNOWN , 8234 ) /* 0x0000202a */ \ XXX( WERR_DS_REFERRAL , 8235 ) /* 0x0000202b */ \ XXX( WERR_DS_UNAVAILABLE_CRIT_EXTENSION , 8236 ) /* 0x0000202c */ \ XXX( WERR_DS_CONFIDENTIALITY_REQUIRED , 8237 ) /* 0x0000202d */ \ XXX( WERR_DS_INAPPROPRIATE_MATCHING , 8238 ) /* 0x0000202e */ \ XXX( WERR_DS_CONSTRAINT_VIOLATION , 8239 ) /* 0x0000202f */ \ XXX( WERR_DS_NO_SUCH_OBJECT , 8240 ) /* 0x00002030 */ \ XXX( WERR_DS_ALIAS_PROBLEM , 8241 ) /* 0x00002031 */ \ XXX( WERR_DS_INVALID_DN_SYNTAX , 8242 ) /* 0x00002032 */ \ XXX( WERR_DS_IS_LEAF , 8243 ) /* 0x00002033 */ \ XXX( WERR_DS_ALIAS_DEREF_PROBLEM , 8244 ) /* 0x00002034 */ \ XXX( WERR_DS_UNWILLING_TO_PERFORM , 8245 ) /* 0x00002035 */ \ XXX( WERR_DS_LOOP_DETECT , 8246 ) /* 0x00002036 */ \ XXX( WERR_DS_NAMING_VIOLATION , 8247 ) /* 0x00002037 */ \ XXX( WERR_DS_OBJECT_RESULTS_TOO_LARGE , 8248 ) /* 0x00002038 */ \ XXX( WERR_DS_AFFECTS_MULTIPLE_DSAS , 8249 ) /* 0x00002039 */ \ XXX( WERR_DS_SERVER_DOWN , 8250 ) /* 0x0000203a */ \ XXX( WERR_DS_LOCAL_ERROR , 8251 ) /* 0x0000203b */ \ XXX( WERR_DS_ENCODING_ERROR , 8252 ) /* 0x0000203c */ \ XXX( WERR_DS_DECODING_ERROR , 8253 ) /* 0x0000203d */ \ XXX( WERR_DS_FILTER_UNKNOWN , 8254 ) /* 0x0000203e */ \ XXX( WERR_DS_PARAM_ERROR , 8255 ) /* 0x0000203f */ \ XXX( WERR_DS_NOT_SUPPORTED , 8256 ) /* 0x00002040 */ \ XXX( WERR_DS_NO_RESULTS_RETURNED , 8257 ) /* 0x00002041 */ \ XXX( WERR_DS_CONTROL_NOT_FOUND , 8258 ) /* 0x00002042 */ \ XXX( WERR_DS_CLIENT_LOOP , 8259 ) /* 0x00002043 */ \ XXX( WERR_DS_REFERRAL_LIMIT_EXCEEDED , 8260 ) /* 0x00002044 */ \ XXX( WERR_DS_SORT_CONTROL_MISSING , 8261 ) /* 0x00002045 */ \ XXX( WERR_DS_OFFSET_RANGE_ERROR , 8262 ) /* 0x00002046 */ \ XXX( WERR_DS_ROOT_MUST_BE_NC , 8301 ) /* 0x0000206d */ \ XXX( WERR_DS_ADD_REPLICA_INHIBITED , 8302 ) /* 0x0000206e */ \ XXX( WERR_DS_ATT_NOT_DEF_IN_SCHEMA , 8303 ) /* 0x0000206f */ \ XXX( WERR_DS_MAX_OBJ_SIZE_EXCEEDED , 8304 ) /* 0x00002070 */ \ XXX( WERR_DS_OBJ_STRING_NAME_EXISTS , 8305 ) /* 0x00002071 */ \ XXX( WERR_DS_NO_RDN_DEFINED_IN_SCHEMA , 8306 ) /* 0x00002072 */ \ XXX( WERR_DS_RDN_DOESNT_MATCH_SCHEMA , 8307 ) /* 0x00002073 */ \ XXX( WERR_DS_NO_REQUESTED_ATTS_FOUND , 8308 ) /* 0x00002074 */ \ XXX( WERR_DS_USER_BUFFER_TO_SMALL , 8309 ) /* 0x00002075 */ \ XXX( WERR_DS_ATT_IS_NOT_ON_OBJ , 8310 ) /* 0x00002076 */ \ XXX( WERR_DS_ILLEGAL_MOD_OPERATION , 8311 ) /* 0x00002077 */ \ XXX( WERR_DS_OBJ_TOO_LARGE , 8312 ) /* 0x00002078 */ \ XXX( WERR_DS_BAD_INSTANCE_TYPE , 8313 ) /* 0x00002079 */ \ XXX( WERR_DS_MASTERDSA_REQUIRED , 8314 ) /* 0x0000207a */ \ XXX( WERR_DS_OBJECT_CLASS_REQUIRED , 8315 ) /* 0x0000207b */ \ XXX( WERR_DS_MISSING_REQUIRED_ATT , 8316 ) /* 0x0000207c */ \ XXX( WERR_DS_ATT_NOT_DEF_FOR_CLASS , 8317 ) /* 0x0000207d */ \ XXX( WERR_DS_ATT_ALREADY_EXISTS , 8318 ) /* 0x0000207e */ \ XXX( WERR_DS_CANT_ADD_ATT_VALUES , 8320 ) /* 0x00002080 */ \ XXX( WERR_DS_SINGLE_VALUE_CONSTRAINT , 8321 ) /* 0x00002081 */ \ XXX( WERR_DS_RANGE_CONSTRAINT , 8322 ) /* 0x00002082 */ \ XXX( WERR_DS_ATT_VAL_ALREADY_EXISTS , 8323 ) /* 0x00002083 */ \ XXX( WERR_DS_CANT_REM_MISSING_ATT , 8324 ) /* 0x00002084 */ \ XXX( WERR_DS_CANT_REM_MISSING_ATT_VAL , 8325 ) /* 0x00002085 */ \ XXX( WERR_DS_ROOT_CANT_BE_SUBREF , 8326 ) /* 0x00002086 */ \ XXX( WERR_DS_NO_CHAINING , 8327 ) /* 0x00002087 */ \ XXX( WERR_DS_NO_CHAINED_EVAL , 8328 ) /* 0x00002088 */ \ XXX( WERR_DS_NO_PARENT_OBJECT , 8329 ) /* 0x00002089 */ \ XXX( WERR_DS_PARENT_IS_AN_ALIAS , 8330 ) /* 0x0000208a */ \ XXX( WERR_DS_CANT_MIX_MASTER_AND_REPS , 8331 ) /* 0x0000208b */ \ XXX( WERR_DS_CHILDREN_EXIST , 8332 ) /* 0x0000208c */ \ XXX( WERR_DS_OBJ_NOT_FOUND , 8333 ) /* 0x0000208d */ \ XXX( WERR_DS_ALIASED_OBJ_MISSING , 8334 ) /* 0x0000208e */ \ XXX( WERR_DS_BAD_NAME_SYNTAX , 8335 ) /* 0x0000208f */ \ XXX( WERR_DS_ALIAS_POINTS_TO_ALIAS , 8336 ) /* 0x00002090 */ \ XXX( WERR_DS_CANT_DEREF_ALIAS , 8337 ) /* 0x00002091 */ \ XXX( WERR_DS_OUT_OF_SCOPE , 8338 ) /* 0x00002092 */ \ XXX( WERR_DS_OBJECT_BEING_REMOVED , 8339 ) /* 0x00002093 */ \ XXX( WERR_DS_CANT_DELETE_DSA_OBJ , 8340 ) /* 0x00002094 */ \ XXX( WERR_DS_GENERIC_ERROR , 8341 ) /* 0x00002095 */ \ XXX( WERR_DS_DSA_MUST_BE_INT_MASTER , 8342 ) /* 0x00002096 */ \ XXX( WERR_DS_CLASS_NOT_DSA , 8343 ) /* 0x00002097 */ \ XXX( WERR_DS_INSUFF_ACCESS_RIGHTS , 8344 ) /* 0x00002098 */ \ XXX( WERR_DS_ILLEGAL_SUPERIOR , 8345 ) /* 0x00002099 */ \ XXX( WERR_DS_ATTRIBUTE_OWNED_BY_SAM , 8346 ) /* 0x0000209a */ \ XXX( WERR_DS_NAME_TOO_MANY_PARTS , 8347 ) /* 0x0000209b */ \ XXX( WERR_DS_NAME_TOO_LONG , 8348 ) /* 0x0000209c */ \ XXX( WERR_DS_NAME_VALUE_TOO_LONG , 8349 ) /* 0x0000209d */ \ XXX( WERR_DS_NAME_UNPARSEABLE , 8350 ) /* 0x0000209e */ \ XXX( WERR_DS_NAME_TYPE_UNKNOWN , 8351 ) /* 0x0000209f */ \ XXX( WERR_DS_NOT_AN_OBJECT , 8352 ) /* 0x000020a0 */ \ XXX( WERR_DS_SEC_DESC_TOO_SHORT , 8353 ) /* 0x000020a1 */ \ XXX( WERR_DS_SEC_DESC_INVALID , 8354 ) /* 0x000020a2 */ \ XXX( WERR_DS_NO_DELETED_NAME , 8355 ) /* 0x000020a3 */ \ XXX( WERR_DS_SUBREF_MUST_HAVE_PARENT , 8356 ) /* 0x000020a4 */ \ XXX( WERR_DS_NCNAME_MUST_BE_NC , 8357 ) /* 0x000020a5 */ \ XXX( WERR_DS_CANT_ADD_SYSTEM_ONLY , 8358 ) /* 0x000020a6 */ \ XXX( WERR_DS_CLASS_MUST_BE_CONCRETE , 8359 ) /* 0x000020a7 */ \ XXX( WERR_DS_INVALID_DMD , 8360 ) /* 0x000020a8 */ \ XXX( WERR_DS_OBJ_GUID_EXISTS , 8361 ) /* 0x000020a9 */ \ XXX( WERR_DS_NOT_ON_BACKLINK , 8362 ) /* 0x000020aa */ \ XXX( WERR_DS_NO_CROSSREF_FOR_NC , 8363 ) /* 0x000020ab */ \ XXX( WERR_DS_SHUTTING_DOWN , 8364 ) /* 0x000020ac */ \ XXX( WERR_DS_UNKNOWN_OPERATION , 8365 ) /* 0x000020ad */ \ XXX( WERR_DS_INVALID_ROLE_OWNER , 8366 ) /* 0x000020ae */ \ XXX( WERR_DS_COULDNT_CONTACT_FSMO , 8367 ) /* 0x000020af */ \ XXX( WERR_DS_CROSS_NC_DN_RENAME , 8368 ) /* 0x000020b0 */ \ XXX( WERR_DS_CANT_MOD_SYSTEM_ONLY , 8369 ) /* 0x000020b1 */ \ XXX( WERR_DS_REPLICATOR_ONLY , 8370 ) /* 0x000020b2 */ \ XXX( WERR_DS_OBJ_CLASS_NOT_DEFINED , 8371 ) /* 0x000020b3 */ \ XXX( WERR_DS_OBJ_CLASS_NOT_SUBCLASS , 8372 ) /* 0x000020b4 */ \ XXX( WERR_DS_NAME_REFERENCE_INVALID , 8373 ) /* 0x000020b5 */ \ XXX( WERR_DS_CROSS_REF_EXISTS , 8374 ) /* 0x000020b6 */ \ XXX( WERR_DS_CANT_DEL_MASTER_CROSSREF , 8375 ) /* 0x000020b7 */ \ XXX( WERR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD , 8376 ) /* 0x000020b8 */ \ XXX( WERR_DS_NOTIFY_FILTER_TOO_COMPLEX , 8377 ) /* 0x000020b9 */ \ XXX( WERR_DS_DUP_RDN , 8378 ) /* 0x000020ba */ \ XXX( WERR_DS_DUP_OID , 8379 ) /* 0x000020bb */ \ XXX( WERR_DS_DUP_MAPI_ID , 8380 ) /* 0x000020bc */ \ XXX( WERR_DS_DUP_SCHEMA_ID_GUID , 8381 ) /* 0x000020bd */ \ XXX( WERR_DS_DUP_LDAP_DISPLAY_NAME , 8382 ) /* 0x000020be */ \ XXX( WERR_DS_SEMANTIC_ATT_TEST , 8383 ) /* 0x000020bf */ \ XXX( WERR_DS_SYNTAX_MISMATCH , 8384 ) /* 0x000020c0 */ \ XXX( WERR_DS_EXISTS_IN_MUST_HAVE , 8385 ) /* 0x000020c1 */ \ XXX( WERR_DS_EXISTS_IN_MAY_HAVE , 8386 ) /* 0x000020c2 */ \ XXX( WERR_DS_NONEXISTENT_MAY_HAVE , 8387 ) /* 0x000020c3 */ \ XXX( WERR_DS_NONEXISTENT_MUST_HAVE , 8388 ) /* 0x000020c4 */ \ XXX( WERR_DS_AUX_CLS_TEST_FAIL , 8389 ) /* 0x000020c5 */ \ XXX( WERR_DS_NONEXISTENT_POSS_SUP , 8390 ) /* 0x000020c6 */ \ XXX( WERR_DS_SUB_CLS_TEST_FAIL , 8391 ) /* 0x000020c7 */ \ XXX( WERR_DS_BAD_RDN_ATT_ID_SYNTAX , 8392 ) /* 0x000020c8 */ \ XXX( WERR_DS_EXISTS_IN_AUX_CLS , 8393 ) /* 0x000020c9 */ \ XXX( WERR_DS_EXISTS_IN_SUB_CLS , 8394 ) /* 0x000020ca */ \ XXX( WERR_DS_EXISTS_IN_POSS_SUP , 8395 ) /* 0x000020cb */ \ XXX( WERR_DS_RECALCSCHEMA_FAILED , 8396 ) /* 0x000020cc */ \ XXX( WERR_DS_TREE_DELETE_NOT_FINISHED , 8397 ) /* 0x000020cd */ \ XXX( WERR_DS_CANT_DELETE , 8398 ) /* 0x000020ce */ \ XXX( WERR_DS_ATT_SCHEMA_REQ_ID , 8399 ) /* 0x000020cf */ \ XXX( WERR_DS_BAD_ATT_SCHEMA_SYNTAX , 8400 ) /* 0x000020d0 */ \ XXX( WERR_DS_CANT_CACHE_ATT , 8401 ) /* 0x000020d1 */ \ XXX( WERR_DS_CANT_CACHE_CLASS , 8402 ) /* 0x000020d2 */ \ XXX( WERR_DS_CANT_REMOVE_ATT_CACHE , 8403 ) /* 0x000020d3 */ \ XXX( WERR_DS_CANT_REMOVE_CLASS_CACHE , 8404 ) /* 0x000020d4 */ \ XXX( WERR_DS_CANT_RETRIEVE_DN , 8405 ) /* 0x000020d5 */ \ XXX( WERR_DS_MISSING_SUPREF , 8406 ) /* 0x000020d6 */ \ XXX( WERR_DS_CANT_RETRIEVE_INSTANCE , 8407 ) /* 0x000020d7 */ \ XXX( WERR_DS_CODE_INCONSISTENCY , 8408 ) /* 0x000020d8 */ \ XXX( WERR_DS_DATABASE_ERROR , 8409 ) /* 0x000020d9 */ \ XXX( WERR_DS_MISSING_EXPECTED_ATT , 8411 ) /* 0x000020db */ \ XXX( WERR_DS_NCNAME_MISSING_CR_REF , 8412 ) /* 0x000020dc */ \ XXX( WERR_DS_SECURITY_CHECKING_ERROR , 8413 ) /* 0x000020dd */ \ XXX( WERR_DS_SCHEMA_NOT_LOADED , 8414 ) /* 0x000020de */ \ XXX( WERR_DS_SCHEMA_ALLOC_FAILED , 8415 ) /* 0x000020df */ \ XXX( WERR_DS_ATT_SCHEMA_REQ_SYNTAX , 8416 ) /* 0x000020e0 */ \ XXX( WERR_DS_GCVERIFY_ERROR , 8417 ) /* 0x000020e1 */ \ XXX( WERR_DS_DRA_SCHEMA_MISMATCH , 8418 ) /* 0x000020e2 */ \ XXX( WERR_DS_CANT_FIND_DSA_OBJ , 8419 ) /* 0x000020e3 */ \ XXX( WERR_DS_CANT_FIND_EXPECTED_NC , 8420 ) /* 0x000020e4 */ \ XXX( WERR_DS_CANT_FIND_NC_IN_CACHE , 8421 ) /* 0x000020e5 */ \ XXX( WERR_DS_CANT_RETRIEVE_CHILD , 8422 ) /* 0x000020e6 */ \ XXX( WERR_DS_SECURITY_ILLEGAL_MODIFY , 8423 ) /* 0x000020e7 */ \ XXX( WERR_DS_CANT_REPLACE_HIDDEN_REC , 8424 ) /* 0x000020e8 */ \ XXX( WERR_DS_BAD_HIERARCHY_FILE , 8425 ) /* 0x000020e9 */ \ XXX( WERR_DS_BUILD_HIERARCHY_TABLE_FAILED , 8426 ) /* 0x000020ea */ \ XXX( WERR_DS_CONFIG_PARAM_MISSING , 8427 ) /* 0x000020eb */ \ XXX( WERR_DS_COUNTING_AB_INDICES_FAILED , 8428 ) /* 0x000020ec */ \ XXX( WERR_DS_HIERARCHY_TABLE_MALLOC_FAILED , 8429 ) /* 0x000020ed */ \ XXX( WERR_DS_INTERNAL_FAILURE , 8430 ) /* 0x000020ee */ \ XXX( WERR_DS_UNKNOWN_ERROR , 8431 ) /* 0x000020ef */ \ XXX( WERR_DS_ROOT_REQUIRES_CLASS_TOP , 8432 ) /* 0x000020f0 */ \ XXX( WERR_DS_REFUSING_FSMO_ROLES , 8433 ) /* 0x000020f1 */ \ XXX( WERR_DS_MISSING_FSMO_SETTINGS , 8434 ) /* 0x000020f2 */ \ XXX( WERR_DS_UNABLE_TO_SURRENDER_ROLES , 8435 ) /* 0x000020f3 */ \ XXX( WERR_DS_DRA_GENERIC , 8436 ) /* 0x000020f4 */ \ XXX( WERR_DS_DRA_INVALID_PARAMETER , 8437 ) /* 0x000020f5 */ \ XXX( WERR_DS_DRA_BUSY , 8438 ) /* 0x000020f6 */ \ XXX( WERR_DS_DRA_BAD_DN , 8439 ) /* 0x000020f7 */ \ XXX( WERR_DS_DRA_BAD_NC , 8440 ) /* 0x000020f8 */ \ XXX( WERR_DS_DRA_DN_EXISTS , 8441 ) /* 0x000020f9 */ \ XXX( WERR_DS_DRA_INTERNAL_ERROR , 8442 ) /* 0x000020fa */ \ XXX( WERR_DS_DRA_INCONSISTENT_DIT , 8443 ) /* 0x000020fb */ \ XXX( WERR_DS_DRA_CONNECTION_FAILED , 8444 ) /* 0x000020fc */ \ XXX( WERR_DS_DRA_BAD_INSTANCE_TYPE , 8445 ) /* 0x000020fd */ \ XXX( WERR_DS_DRA_OUT_OF_MEM , 8446 ) /* 0x000020fe */ \ XXX( WERR_DS_DRA_MAIL_PROBLEM , 8447 ) /* 0x000020ff */ \ XXX( WERR_DS_DRA_REF_ALREADY_EXISTS , 8448 ) /* 0x00002100 */ \ XXX( WERR_DS_DRA_REF_NOT_FOUND , 8449 ) /* 0x00002101 */ \ XXX( WERR_DS_DRA_OBJ_IS_REP_SOURCE , 8450 ) /* 0x00002102 */ \ XXX( WERR_DS_DRA_DB_ERROR , 8451 ) /* 0x00002103 */ \ XXX( WERR_DS_DRA_NO_REPLICA , 8452 ) /* 0x00002104 */ \ XXX( WERR_DS_DRA_ACCESS_DENIED , 8453 ) /* 0x00002105 */ \ XXX( WERR_DS_DRA_NOT_SUPPORTED , 8454 ) /* 0x00002106 */ \ XXX( WERR_DS_DRA_RPC_CANCELLED , 8455 ) /* 0x00002107 */ \ XXX( WERR_DS_DRA_SOURCE_DISABLED , 8456 ) /* 0x00002108 */ \ XXX( WERR_DS_DRA_SINK_DISABLED , 8457 ) /* 0x00002109 */ \ XXX( WERR_DS_DRA_NAME_COLLISION , 8458 ) /* 0x0000210a */ \ XXX( WERR_DS_DRA_SOURCE_REINSTALLED , 8459 ) /* 0x0000210b */ \ XXX( WERR_DS_DRA_MISSING_PARENT , 8460 ) /* 0x0000210c */ \ XXX( WERR_DS_DRA_PREEMPTED , 8461 ) /* 0x0000210d */ \ XXX( WERR_DS_DRA_ABANDON_SYNC , 8462 ) /* 0x0000210e */ \ XXX( WERR_DS_DRA_SHUTDOWN , 8463 ) /* 0x0000210f */ \ XXX( WERR_DS_DRA_INCOMPATIBLE_PARTIAL_SET , 8464 ) /* 0x00002110 */ \ XXX( WERR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA , 8465 ) /* 0x00002111 */ \ XXX( WERR_DS_DRA_EXTN_CONNECTION_FAILED , 8466 ) /* 0x00002112 */ \ XXX( WERR_DS_INSTALL_SCHEMA_MISMATCH , 8467 ) /* 0x00002113 */ \ XXX( WERR_DS_DUP_LINK_ID , 8468 ) /* 0x00002114 */ \ XXX( WERR_DS_NAME_ERROR_RESOLVING , 8469 ) /* 0x00002115 */ \ XXX( WERR_DS_NAME_ERROR_NOT_FOUND , 8470 ) /* 0x00002116 */ \ XXX( WERR_DS_NAME_ERROR_NOT_UNIQUE , 8471 ) /* 0x00002117 */ \ XXX( WERR_DS_NAME_ERROR_NO_MAPPING , 8472 ) /* 0x00002118 */ \ XXX( WERR_DS_NAME_ERROR_DOMAIN_ONLY , 8473 ) /* 0x00002119 */ \ XXX( WERR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING , 8474 ) /* 0x0000211a */ \ XXX( WERR_DS_CONSTRUCTED_ATT_MOD , 8475 ) /* 0x0000211b */ \ XXX( WERR_DS_WRONG_OM_OBJ_CLASS , 8476 ) /* 0x0000211c */ \ XXX( WERR_DS_DRA_REPL_PENDING , 8477 ) /* 0x0000211d */ \ XXX( WERR_DS_DS_REQUIRED , 8478 ) /* 0x0000211e */ \ XXX( WERR_DS_INVALID_LDAP_DISPLAY_NAME , 8479 ) /* 0x0000211f */ \ XXX( WERR_DS_NON_BASE_SEARCH , 8480 ) /* 0x00002120 */ \ XXX( WERR_DS_CANT_RETRIEVE_ATTS , 8481 ) /* 0x00002121 */ \ XXX( WERR_DS_BACKLINK_WITHOUT_LINK , 8482 ) /* 0x00002122 */ \ XXX( WERR_DS_EPOCH_MISMATCH , 8483 ) /* 0x00002123 */ \ XXX( WERR_DS_SRC_NAME_MISMATCH , 8484 ) /* 0x00002124 */ \ XXX( WERR_DS_SRC_AND_DST_NC_IDENTICAL , 8485 ) /* 0x00002125 */ \ XXX( WERR_DS_DST_NC_MISMATCH , 8486 ) /* 0x00002126 */ \ XXX( WERR_DS_NOT_AUTHORITIVE_FOR_DST_NC , 8487 ) /* 0x00002127 */ \ XXX( WERR_DS_SRC_GUID_MISMATCH , 8488 ) /* 0x00002128 */ \ XXX( WERR_DS_CANT_MOVE_DELETED_OBJECT , 8489 ) /* 0x00002129 */ \ XXX( WERR_DS_PDC_OPERATION_IN_PROGRESS , 8490 ) /* 0x0000212a */ \ XXX( WERR_DS_CROSS_DOMAIN_CLEANUP_REQD , 8491 ) /* 0x0000212b */ \ XXX( WERR_DS_ILLEGAL_XDOM_MOVE_OPERATION , 8492 ) /* 0x0000212c */ \ XXX( WERR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS , 8493 ) /* 0x0000212d */ \ XXX( WERR_DS_NC_MUST_HAVE_NC_PARENT , 8494 ) /* 0x0000212e */ \ XXX( WERR_DS_CR_IMPOSSIBLE_TO_VALIDATE , 8495 ) /* 0x0000212f */ \ XXX( WERR_DS_DST_DOMAIN_NOT_NATIVE , 8496 ) /* 0x00002130 */ \ XXX( WERR_DS_MISSING_INFRASTRUCTURE_CONTAINER , 8497 ) /* 0x00002131 */ \ XXX( WERR_DS_CANT_MOVE_ACCOUNT_GROUP , 8498 ) /* 0x00002132 */ \ XXX( WERR_DS_CANT_MOVE_RESOURCE_GROUP , 8499 ) /* 0x00002133 */ \ XXX( WERR_DS_INVALID_SEARCH_FLAG , 8500 ) /* 0x00002134 */ \ XXX( WERR_DS_NO_TREE_DELETE_ABOVE_NC , 8501 ) /* 0x00002135 */ \ XXX( WERR_DS_COULDNT_LOCK_TREE_FOR_DELETE , 8502 ) /* 0x00002136 */ \ XXX( WERR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE , 8503 ) /* 0x00002137 */ \ XXX( WERR_DS_SAM_INIT_FAILURE , 8504 ) /* 0x00002138 */ \ XXX( WERR_DS_SENSITIVE_GROUP_VIOLATION , 8505 ) /* 0x00002139 */ \ XXX( WERR_DS_CANT_MOD_PRIMARYGROUPID , 8506 ) /* 0x0000213a */ \ XXX( WERR_DS_ILLEGAL_BASE_SCHEMA_MOD , 8507 ) /* 0x0000213b */ \ XXX( WERR_DS_NONSAFE_SCHEMA_CHANGE , 8508 ) /* 0x0000213c */ \ XXX( WERR_DS_SCHEMA_UPDATE_DISALLOWED , 8509 ) /* 0x0000213d */ \ XXX( WERR_DS_CANT_CREATE_UNDER_SCHEMA , 8510 ) /* 0x0000213e */ \ XXX( WERR_DS_INVALID_GROUP_TYPE , 8513 ) /* 0x00002141 */ \ XXX( WERR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN , 8514 ) /* 0x00002142 */ \ XXX( WERR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN , 8515 ) /* 0x00002143 */ \ XXX( WERR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER , 8516 ) /* 0x00002144 */ \ XXX( WERR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER , 8517 ) /* 0x00002145 */ \ XXX( WERR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER , 8518 ) /* 0x00002146 */ \ XXX( WERR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER , 8519 ) /* 0x00002147 */ \ XXX( WERR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER , 8520 ) /* 0x00002148 */ \ XXX( WERR_DS_HAVE_PRIMARY_MEMBERS , 8521 ) /* 0x00002149 */ \ XXX( WERR_DS_STRING_SD_CONVERSION_FAILED , 8522 ) /* 0x0000214a */ \ XXX( WERR_DS_NAMING_MASTER_GC , 8523 ) /* 0x0000214b */ \ XXX( WERR_DS_DNS_LOOKUP_FAILURE , 8524 ) /* 0x0000214c */ \ XXX( WERR_DS_COULDNT_UPDATE_SPNS , 8525 ) /* 0x0000214d */ \ XXX( WERR_DS_CANT_RETRIEVE_SD , 8526 ) /* 0x0000214e */ \ XXX( WERR_DS_KEY_NOT_UNIQUE , 8527 ) /* 0x0000214f */ \ XXX( WERR_DS_WRONG_LINKED_ATT_SYNTAX , 8528 ) /* 0x00002150 */ \ XXX( WERR_DS_SAM_NEED_BOOTKEY_PASSWORD , 8529 ) /* 0x00002151 */ \ XXX( WERR_DS_SAM_NEED_BOOTKEY_FLOPPY , 8530 ) /* 0x00002152 */ \ XXX( WERR_DS_CANT_START , 8531 ) /* 0x00002153 */ \ XXX( WERR_DS_INIT_FAILURE , 8532 ) /* 0x00002154 */ \ XXX( WERR_DS_NO_PKT_PRIVACY_ON_CONNECTION , 8533 ) /* 0x00002155 */ \ XXX( WERR_DS_SOURCE_DOMAIN_IN_FOREST , 8534 ) /* 0x00002156 */ \ XXX( WERR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST , 8535 ) /* 0x00002157 */ \ XXX( WERR_DS_DESTINATION_AUDITING_NOT_ENABLED , 8536 ) /* 0x00002158 */ \ XXX( WERR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN , 8537 ) /* 0x00002159 */ \ XXX( WERR_DS_SRC_OBJ_NOT_GROUP_OR_USER , 8538 ) /* 0x0000215a */ \ XXX( WERR_DS_SRC_SID_EXISTS_IN_FOREST , 8539 ) /* 0x0000215b */ \ XXX( WERR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH , 8540 ) /* 0x0000215c */ \ XXX( WERR_SAM_INIT_FAILURE , 8541 ) /* 0x0000215d */ \ XXX( WERR_DS_DRA_SCHEMA_INFO_SHIP , 8542 ) /* 0x0000215e */ \ XXX( WERR_DS_DRA_SCHEMA_CONFLICT , 8543 ) /* 0x0000215f */ \ XXX( WERR_DS_DRA_EARLIER_SCHEMA_CONFLICT , 8544 ) /* 0x00002160 */ \ XXX( WERR_DS_DRA_OBJ_NC_MISMATCH , 8545 ) /* 0x00002161 */ \ XXX( WERR_DS_NC_STILL_HAS_DSAS , 8546 ) /* 0x00002162 */ \ XXX( WERR_DS_GC_REQUIRED , 8547 ) /* 0x00002163 */ \ XXX( WERR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY , 8548 ) /* 0x00002164 */ \ XXX( WERR_DS_NO_FPO_IN_UNIVERSAL_GROUPS , 8549 ) /* 0x00002165 */ \ XXX( WERR_DS_CANT_ADD_TO_GC , 8550 ) /* 0x00002166 */ \ XXX( WERR_DS_NO_CHECKPOINT_WITH_PDC , 8551 ) /* 0x00002167 */ \ XXX( WERR_DS_SOURCE_AUDITING_NOT_ENABLED , 8552 ) /* 0x00002168 */ \ XXX( WERR_DS_CANT_CREATE_IN_NONDOMAIN_NC , 8553 ) /* 0x00002169 */ \ XXX( WERR_DS_INVALID_NAME_FOR_SPN , 8554 ) /* 0x0000216a */ \ XXX( WERR_DS_FILTER_USES_CONTRUCTED_ATTRS , 8555 ) /* 0x0000216b */ \ XXX( WERR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED , 8557 ) /* 0x0000216d */ \ XXX( WERR_DS_MUST_BE_RUN_ON_DST_DC , 8558 ) /* 0x0000216e */ \ XXX( WERR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER , 8559 ) /* 0x0000216f */ \ XXX( WERR_DS_CANT_TREE_DELETE_CRITICAL_OBJ , 8560 ) /* 0x00002170 */ \ XXX( WERR_DS_INIT_FAILURE_CONSOLE , 8561 ) /* 0x00002171 */ \ XXX( WERR_DS_SAM_INIT_FAILURE_CONSOLE , 8562 ) /* 0x00002172 */ \ XXX( WERR_DS_FOREST_VERSION_TOO_HIGH , 8563 ) /* 0x00002173 */ \ XXX( WERR_DS_DOMAIN_VERSION_TOO_HIGH , 8564 ) /* 0x00002174 */ \ XXX( WERR_DS_FOREST_VERSION_TOO_LOW , 8565 ) /* 0x00002175 */ \ XXX( WERR_DS_DOMAIN_VERSION_TOO_LOW , 8566 ) /* 0x00002176 */ \ XXX( WERR_DS_INCOMPATIBLE_VERSION , 8567 ) /* 0x00002177 */ \ XXX( WERR_DS_LOW_DSA_VERSION , 8568 ) /* 0x00002178 */ \ XXX( WERR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN , 8569 ) /* 0x00002179 */ \ XXX( WERR_DS_NOT_SUPPORTED_SORT_ORDER , 8570 ) /* 0x0000217a */ \ XXX( WERR_DS_NAME_NOT_UNIQUE , 8571 ) /* 0x0000217b */ \ XXX( WERR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 , 8572 ) /* 0x0000217c */ \ XXX( WERR_DS_OUT_OF_VERSION_STORE , 8573 ) /* 0x0000217d */ \ XXX( WERR_DS_INCOMPATIBLE_CONTROLS_USED , 8574 ) /* 0x0000217e */ \ XXX( WERR_DS_NO_REF_DOMAIN , 8575 ) /* 0x0000217f */ \ XXX( WERR_DS_RESERVED_LINK_ID , 8576 ) /* 0x00002180 */ \ XXX( WERR_DS_LINK_ID_NOT_AVAILABLE , 8577 ) /* 0x00002181 */ \ XXX( WERR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER , 8578 ) /* 0x00002182 */ \ XXX( WERR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE , 8579 ) /* 0x00002183 */ \ XXX( WERR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC , 8580 ) /* 0x00002184 */ \ XXX( WERR_DS_MODIFYDN_DISALLOWED_BY_FLAG , 8581 ) /* 0x00002185 */ \ XXX( WERR_DS_MODIFYDN_WRONG_GRANDPARENT , 8582 ) /* 0x00002186 */ \ XXX( WERR_DS_NAME_ERROR_TRUST_REFERRAL , 8583 ) /* 0x00002187 */ \ XXX( WERR_NOT_SUPPORTED_ON_STANDARD_SERVER , 8584 ) /* 0x00002188 */ \ XXX( WERR_DS_CANT_ACCESS_REMOTE_PART_OF_AD , 8585 ) /* 0x00002189 */ \ XXX( WERR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 , 8586 ) /* 0x0000218a */ \ XXX( WERR_DS_THREAD_LIMIT_EXCEEDED , 8587 ) /* 0x0000218b */ \ XXX( WERR_DS_NOT_CLOSEST , 8588 ) /* 0x0000218c */ \ XXX( WERR_DS_SINGLE_USER_MODE_FAILED , 8590 ) /* 0x0000218e */ \ XXX( WERR_DS_NTDSCRIPT_SYNTAX_ERROR , 8591 ) /* 0x0000218f */ \ XXX( WERR_DS_NTDSCRIPT_PROCESS_ERROR , 8592 ) /* 0x00002190 */ \ XXX( WERR_DS_DIFFERENT_REPL_EPOCHS , 8593 ) /* 0x00002191 */ \ XXX( WERR_DS_DRS_EXTENSIONS_CHANGED , 8594 ) /* 0x00002192 */ \ XXX( WERR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR, 8595 ) /* 0x00002193 */ \ XXX( WERR_DS_NO_MSDS_INTID , 8596 ) /* 0x00002194 */ \ XXX( WERR_DS_DUP_MSDS_INTID , 8597 ) /* 0x00002195 */ \ XXX( WERR_DS_EXISTS_IN_RDNATTID , 8598 ) /* 0x00002196 */ \ XXX( WERR_DS_AUTHORIZATION_FAILED , 8599 ) /* 0x00002197 */ \ XXX( WERR_DS_INVALID_SCRIPT , 8600 ) /* 0x00002198 */ \ XXX( WERR_DS_REMOTE_CROSSREF_OP_FAILED , 8601 ) /* 0x00002199 */ \ XXX( WERR_DS_CROSS_REF_BUSY , 8602 ) /* 0x0000219a */ \ XXX( WERR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN , 8603 ) /* 0x0000219b */ \ XXX( WERR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC , 8604 ) /* 0x0000219c */ \ XXX( WERR_DS_DUPLICATE_ID_FOUND , 8605 ) /* 0x0000219d */ \ XXX( WERR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT , 8606 ) /* 0x0000219e */ \ XXX( WERR_DS_GROUP_CONVERSION_ERROR , 8607 ) /* 0x0000219f */ \ XXX( WERR_DS_CANT_MOVE_APP_BASIC_GROUP , 8608 ) /* 0x000021a0 */ \ XXX( WERR_DS_CANT_MOVE_APP_QUERY_GROUP , 8609 ) /* 0x000021a1 */ \ XXX( WERR_DS_ROLE_NOT_VERIFIED , 8610 ) /* 0x000021a2 */ \ XXX( WERR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL , 8611 ) /* 0x000021a3 */ \ XXX( WERR_DS_DOMAIN_RENAME_IN_PROGRESS , 8612 ) /* 0x000021a4 */ \ XXX( WERR_DS_EXISTING_AD_CHILD_NC , 8613 ) /* 0x000021a5 */ \ XXX( WERR_DS_REPL_LIFETIME_EXCEEDED , 8614 ) /* 0x000021a6 */ \ XXX( WERR_DS_DISALLOWED_IN_SYSTEM_CONTAINER , 8615 ) /* 0x000021a7 */ \ XXX( WERR_DS_LDAP_SEND_QUEUE_FULL , 8616 ) /* 0x000021a8 */ \ XXX( WERR_DS_DRA_OUT_SCHEDULE_WINDOW , 8617 ) /* 0x000021a9 */ \ XXX( WERR_DS_POLICY_NOT_KNOWN , 8618 ) /* 0x000021aa */ \ XXX( WERR_NO_SITE_SETTINGS_OBJECT , 8619 ) /* 0x000021ab */ \ XXX( WERR_NO_SECRETS , 8620 ) /* 0x000021ac */ \ XXX( WERR_NO_WRITABLE_DC_FOUND , 8621 ) /* 0x000021ad */ \ XXX( WERR_DS_NO_SERVER_OBJECT , 8622 ) /* 0x000021ae */ \ XXX( WERR_DS_NO_NTDSA_OBJECT , 8623 ) /* 0x000021af */ \ XXX( WERR_DS_NON_ASQ_SEARCH , 8624 ) /* 0x000021b0 */ \ XXX( WERR_DS_AUDIT_FAILURE , 8625 ) /* 0x000021b1 */ \ XXX( WERR_DS_INVALID_SEARCH_FLAG_SUBTREE , 8626 ) /* 0x000021b2 */ \ XXX( WERR_DS_INVALID_SEARCH_FLAG_TUPLE , 8627 ) /* 0x000021b3 */ \ XXX( WERR_DS_HIGH_DSA_VERSION , 8642 ) /* 0x000021c2 */ \ XXX( WERR_DS_SPN_VALUE_NOT_UNIQUE_IN_FOREST , 8647 ) /* 0x000021c7 */ \ XXX( WERR_DS_UPN_VALUE_NOT_UNIQUE_IN_FOREST , 8648 ) /* 0x000021c8 */ \ XXX( WERR_DNS_ERROR_RCODE_FORMAT_ERROR , 9001 ) /* 0x00002329 */ \ XXX( WERR_DNS_ERROR_RCODE_SERVER_FAILURE , 9002 ) /* 0x0000232a */ \ XXX( WERR_DNS_ERROR_RCODE_NAME_ERROR , 9003 ) /* 0x0000232b */ \ XXX( WERR_DNS_ERROR_RCODE_NOT_IMPLEMENTED , 9004 ) /* 0x0000232c */ \ XXX( WERR_DNS_ERROR_RCODE_REFUSED , 9005 ) /* 0x0000232d */ \ XXX( WERR_DNS_ERROR_RCODE_YXDOMAIN , 9006 ) /* 0x0000232e */ \ XXX( WERR_DNS_ERROR_RCODE_YXRRSET , 9007 ) /* 0x0000232f */ \ XXX( WERR_DNS_ERROR_RCODE_NXRRSET , 9008 ) /* 0x00002330 */ \ XXX( WERR_DNS_ERROR_RCODE_NOTAUTH , 9009 ) /* 0x00002331 */ \ XXX( WERR_DNS_ERROR_RCODE_NOTZONE , 9010 ) /* 0x00002332 */ \ XXX( WERR_DNS_ERROR_RCODE_BADSIG , 9016 ) /* 0x00002338 */ \ XXX( WERR_DNS_ERROR_RCODE_BADKEY , 9017 ) /* 0x00002339 */ \ XXX( WERR_DNS_ERROR_RCODE_BADTIME , 9018 ) /* 0x0000233a */ \ XXX( WERR_DNS_ERROR_KEYMASTER_REQUIRED , 9101 ) /* 0x0000238d */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE , 9102 ) /* 0x0000238e */ \ XXX( WERR_DNS_ERROR_INVALID_NSEC3_PARAMETERS , 9103 ) /* 0x0000238f */ \ XXX( WERR_DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS , 9104 ) /* 0x00002390 */ \ XXX( WERR_DNS_ERROR_UNSUPPORTED_ALGORITHM , 9105 ) /* 0x00002391 */ \ XXX( WERR_DNS_ERROR_INVALID_KEY_SIZE , 9106 ) /* 0x00002392 */ \ XXX( WERR_DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE , 9107 ) /* 0x00002393 */ \ XXX( WERR_DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION , 9108 ) /* 0x00002394 */ \ XXX( WERR_DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR , 9109 ) /* 0x00002395 */ \ XXX( WERR_DNS_ERROR_UNEXPECTED_CNG_ERROR , 9110 ) /* 0x00002396 */ \ XXX( WERR_DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION , 9111 ) /* 0x00002397 */ \ XXX( WERR_DNS_ERROR_KSP_NOT_ACCESSIBLE , 9112 ) /* 0x00002398 */ \ XXX( WERR_DNS_ERROR_TOO_MANY_SKDS , 9113 ) /* 0x00002399 */ \ XXX( WERR_DNS_ERROR_INVALID_ROLLOVER_PERIOD , 9114 ) /* 0x0000239a */ \ XXX( WERR_DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET , 9115 ) /* 0x0000239b */ \ XXX( WERR_DNS_ERROR_ROLLOVER_IN_PROGRESS , 9116 ) /* 0x0000239c */ \ XXX( WERR_DNS_ERROR_STANDBY_KEY_NOT_PRESENT , 9117 ) /* 0x0000239d */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_ZSK , 9118 ) /* 0x0000239e */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD , 9119 ) /* 0x0000239f */ \ XXX( WERR_DNS_ERROR_ROLLOVER_ALREADY_QUEUED , 9120 ) /* 0x000023a0 */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE , 9121 ) /* 0x000023a1 */ \ XXX( WERR_DNS_ERROR_BAD_KEYMASTER , 9122 ) /* 0x000023a2 */ \ XXX( WERR_DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD , 9123 ) /* 0x000023a3 */ \ XXX( WERR_DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT , 9124 ) /* 0x000023a4 */ \ XXX( WERR_DNS_ERROR_DNSSEC_IS_DISABLED , 9125 ) /* 0x000023a5 */ \ XXX( WERR_DNS_ERROR_INVALID_XML , 9126 ) /* 0x000023a6 */ \ XXX( WERR_DNS_ERROR_NO_VALID_TRUST_ANCHORS , 9127 ) /* 0x000023a7 */ \ XXX( WERR_DNS_ERROR_ROLLOVER_NOT_POKEABLE , 9128 ) /* 0x000023a8 */ \ XXX( WERR_DNS_ERROR_NSEC3_NAME_COLLISION , 9129 ) /* 0x000023a9 */ \ XXX( WERR_DNS_INFO_NO_RECORDS , 9501 ) /* 0x0000251d */ \ XXX( WERR_DNS_ERROR_BAD_PACKET , 9502 ) /* 0x0000251e */ \ XXX( WERR_DNS_ERROR_NO_PACKET , 9503 ) /* 0x0000251f */ \ XXX( WERR_DNS_ERROR_RCODE , 9504 ) /* 0x00002520 */ \ XXX( WERR_DNS_ERROR_UNSECURE_PACKET , 9505 ) /* 0x00002521 */ \ XXX( WERR_DNS_REQUEST_PENDING , 9506 ) /* 0x00002522 */ \ XXX( WERR_DNS_ERROR_INVALID_TYPE , 9551 ) /* 0x0000254f */ \ XXX( WERR_DNS_ERROR_INVALID_IP_ADDRESS , 9552 ) /* 0x00002550 */ \ XXX( WERR_DNS_ERROR_INVALID_PROPERTY , 9553 ) /* 0x00002551 */ \ XXX( WERR_DNS_ERROR_TRY_AGAIN_LATER , 9554 ) /* 0x00002552 */ \ XXX( WERR_DNS_ERROR_NOT_UNIQUE , 9555 ) /* 0x00002553 */ \ XXX( WERR_DNS_ERROR_NON_RFC_NAME , 9556 ) /* 0x00002554 */ \ XXX( WERR_DNS_STATUS_FQDN , 9557 ) /* 0x00002555 */ \ XXX( WERR_DNS_STATUS_DOTTED_NAME , 9558 ) /* 0x00002556 */ \ XXX( WERR_DNS_STATUS_SINGLE_PART_NAME , 9559 ) /* 0x00002557 */ \ XXX( WERR_DNS_ERROR_INVALID_NAME_CHAR , 9560 ) /* 0x00002558 */ \ XXX( WERR_DNS_ERROR_NUMERIC_NAME , 9561 ) /* 0x00002559 */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER , 9562 ) /* 0x0000255a */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION , 9563 ) /* 0x0000255b */ \ XXX( WERR_DNS_ERROR_CANNOT_FIND_ROOT_HINTS , 9564 ) /* 0x0000255c */ \ XXX( WERR_DNS_ERROR_INCONSISTENT_ROOT_HINTS , 9565 ) /* 0x0000255d */ \ XXX( WERR_DNS_ERROR_DWORD_VALUE_TOO_SMALL , 9566 ) /* 0x0000255e */ \ XXX( WERR_DNS_ERROR_DWORD_VALUE_TOO_LARGE , 9567 ) /* 0x0000255f */ \ XXX( WERR_DNS_ERROR_BACKGROUND_LOADING , 9568 ) /* 0x00002560 */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_ON_RODC , 9569 ) /* 0x00002561 */ \ XXX( WERR_DNS_ERROR_NOT_ALLOWED_UNDER_DNAME , 9570 ) /* 0x00002562 */ \ XXX( WERR_DNS_ERROR_DELEGATION_REQUIRED , 9571 ) /* 0x00002563 */ \ XXX( WERR_DNS_ERROR_INVALID_POLICY_TABLE , 9572 ) /* 0x00002564 */ \ XXX( WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST , 9601 ) /* 0x00002581 */ \ XXX( WERR_DNS_ERROR_NO_ZONE_INFO , 9602 ) /* 0x00002582 */ \ XXX( WERR_DNS_ERROR_INVALID_ZONE_OPERATION , 9603 ) /* 0x00002583 */ \ XXX( WERR_DNS_ERROR_ZONE_CONFIGURATION_ERROR , 9604 ) /* 0x00002584 */ \ XXX( WERR_DNS_ERROR_ZONE_HAS_NO_SOA_RECORD , 9605 ) /* 0x00002585 */ \ XXX( WERR_DNS_ERROR_ZONE_HAS_NO_NS_RECORDS , 9606 ) /* 0x00002586 */ \ XXX( WERR_DNS_ERROR_ZONE_LOCKED , 9607 ) /* 0x00002587 */ \ XXX( WERR_DNS_ERROR_ZONE_CREATION_FAILED , 9608 ) /* 0x00002588 */ \ XXX( WERR_DNS_ERROR_ZONE_ALREADY_EXISTS , 9609 ) /* 0x00002589 */ \ XXX( WERR_DNS_ERROR_AUTOZONE_ALREADY_EXISTS , 9610 ) /* 0x0000258a */ \ XXX( WERR_DNS_ERROR_INVALID_ZONE_TYPE , 9611 ) /* 0x0000258b */ \ XXX( WERR_DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP , 9612 ) /* 0x0000258c */ \ XXX( WERR_DNS_ERROR_ZONE_NOT_SECONDARY , 9613 ) /* 0x0000258d */ \ XXX( WERR_DNS_ERROR_NEED_SECONDARY_ADDRESSES , 9614 ) /* 0x0000258e */ \ XXX( WERR_DNS_ERROR_WINS_INIT_FAILED , 9615 ) /* 0x0000258f */ \ XXX( WERR_DNS_ERROR_NEED_WINS_SERVERS , 9616 ) /* 0x00002590 */ \ XXX( WERR_DNS_ERROR_NBSTAT_INIT_FAILED , 9617 ) /* 0x00002591 */ \ XXX( WERR_DNS_ERROR_SOA_DELETE_INVALID , 9618 ) /* 0x00002592 */ \ XXX( WERR_DNS_ERROR_FORWARDER_ALREADY_EXISTS , 9619 ) /* 0x00002593 */ \ XXX( WERR_DNS_ERROR_ZONE_REQUIRES_MASTER_IP , 9620 ) /* 0x00002594 */ \ XXX( WERR_DNS_ERROR_ZONE_IS_SHUTDOWN , 9621 ) /* 0x00002595 */ \ XXX( WERR_DNS_ERROR_PRIMARY_REQUIRES_DATAFILE , 9651 ) /* 0x000025b3 */ \ XXX( WERR_DNS_ERROR_INVALID_DATAFILE_NAME , 9652 ) /* 0x000025b4 */ \ XXX( WERR_DNS_ERROR_DATAFILE_OPEN_FAILURE , 9653 ) /* 0x000025b5 */ \ XXX( WERR_DNS_ERROR_FILE_WRITEBACK_FAILED , 9654 ) /* 0x000025b6 */ \ XXX( WERR_DNS_ERROR_DATAFILE_PARSING , 9655 ) /* 0x000025b7 */ \ XXX( WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST , 9701 ) /* 0x000025e5 */ \ XXX( WERR_DNS_ERROR_RECORD_FORMAT , 9702 ) /* 0x000025e6 */ \ XXX( WERR_DNS_ERROR_NODE_CREATION_FAILED , 9703 ) /* 0x000025e7 */ \ XXX( WERR_DNS_ERROR_UNKNOWN_RECORD_TYPE , 9704 ) /* 0x000025e8 */ \ XXX( WERR_DNS_ERROR_RECORD_TIMED_OUT , 9705 ) /* 0x000025e9 */ \ XXX( WERR_DNS_ERROR_NAME_NOT_IN_ZONE , 9706 ) /* 0x000025ea */ \ XXX( WERR_DNS_ERROR_CNAME_LOOP , 9707 ) /* 0x000025eb */ \ XXX( WERR_DNS_ERROR_NODE_IS_CNAME , 9708 ) /* 0x000025ec */ \ XXX( WERR_DNS_ERROR_CNAME_COLLISION , 9709 ) /* 0x000025ed */ \ XXX( WERR_DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT , 9710 ) /* 0x000025ee */ \ XXX( WERR_DNS_ERROR_RECORD_ALREADY_EXISTS , 9711 ) /* 0x000025ef */ \ XXX( WERR_DNS_ERROR_SECONDARY_DATA , 9712 ) /* 0x000025f0 */ \ XXX( WERR_DNS_ERROR_NO_CREATE_CACHE_DATA , 9713 ) /* 0x000025f1 */ \ XXX( WERR_DNS_ERROR_NAME_DOES_NOT_EXIST , 9714 ) /* 0x000025f2 */ \ XXX( WERR_DNS_WARNING_PTR_CREATE_FAILED , 9715 ) /* 0x000025f3 */ \ XXX( WERR_DNS_WARNING_DOMAIN_UNDELETED , 9716 ) /* 0x000025f4 */ \ XXX( WERR_DNS_ERROR_DS_UNAVAILABLE , 9717 ) /* 0x000025f5 */ \ XXX( WERR_DNS_ERROR_DS_ZONE_ALREADY_EXISTS , 9718 ) /* 0x000025f6 */ \ XXX( WERR_DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE , 9719 ) /* 0x000025f7 */ \ XXX( WERR_DNS_ERROR_NODE_IS_DNMAE , 9720 ) /* 0x000025f8 */ \ XXX( WERR_DNS_ERROR_DNAME_COLLISION , 9721 ) /* 0x000025f9 */ \ XXX( WERR_DNS_ERROR_ALIAS_LOOP , 9722 ) /* 0x000025fa */ \ XXX( WERR_DNS_INFO_AXFR_COMPLETE , 9751 ) /* 0x00002617 */ \ XXX( WERR_DNS_ERROR_AXFR , 9752 ) /* 0x00002618 */ \ XXX( WERR_DNS_INFO_ADDED_LOCAL_WINS , 9753 ) /* 0x00002619 */ \ XXX( WERR_DNS_STATUS_CONTINUE_NEEDED , 9801 ) /* 0x00002649 */ \ XXX( WERR_DNS_ERROR_NO_TCPIP , 9851 ) /* 0x0000267b */ \ XXX( WERR_DNS_ERROR_NO_DNS_SERVERS , 9852 ) /* 0x0000267c */ \ XXX( WERR_DNS_ERROR_DP_DOES_NOT_EXIST , 9901 ) /* 0x000026ad */ \ XXX( WERR_DNS_ERROR_DP_ALREADY_EXISTS , 9902 ) /* 0x000026ae */ \ XXX( WERR_DNS_ERROR_DP_NOT_ENLISTED , 9903 ) /* 0x000026af */ \ XXX( WERR_DNS_ERROR_DP_ALREADY_ENLISTED , 9904 ) /* 0x000026b0 */ \ XXX( WERR_DNS_ERROR_DP_NOT_AVAILABLE , 9905 ) /* 0x000026b1 */ \ XXX( WERR_DNS_ERROR_DP_FSMO_ERROR , 9906 ) /* 0x000026b2 */ \ XXX( WERR_IPSEC_QM_POLICY_EXISTS , 13000 ) /* 0x000032c8 */ \ XXX( WERR_IPSEC_QM_POLICY_NOT_FOUND , 13001 ) /* 0x000032c9 */ \ XXX( WERR_IPSEC_QM_POLICY_IN_USE , 13002 ) /* 0x000032ca */ \ XXX( WERR_IPSEC_MM_POLICY_EXISTS , 13003 ) /* 0x000032cb */ \ XXX( WERR_IPSEC_MM_POLICY_NOT_FOUND , 13004 ) /* 0x000032cc */ \ XXX( WERR_IPSEC_MM_POLICY_IN_USE , 13005 ) /* 0x000032cd */ \ XXX( WERR_IPSEC_MM_FILTER_EXISTS , 13006 ) /* 0x000032ce */ \ XXX( WERR_IPSEC_MM_FILTER_NOT_FOUND , 13007 ) /* 0x000032cf */ \ XXX( WERR_IPSEC_TRANSPORT_FILTER_EXISTS , 13008 ) /* 0x000032d0 */ \ XXX( WERR_IPSEC_TRANSPORT_FILTER_NOT_FOUND , 13009 ) /* 0x000032d1 */ \ XXX( WERR_IPSEC_MM_AUTH_EXISTS , 13010 ) /* 0x000032d2 */ \ XXX( WERR_IPSEC_MM_AUTH_NOT_FOUND , 13011 ) /* 0x000032d3 */ \ XXX( WERR_IPSEC_MM_AUTH_IN_USE , 13012 ) /* 0x000032d4 */ \ XXX( WERR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND , 13013 ) /* 0x000032d5 */ \ XXX( WERR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND , 13014 ) /* 0x000032d6 */ \ XXX( WERR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND , 13015 ) /* 0x000032d7 */ \ XXX( WERR_IPSEC_TUNNEL_FILTER_EXISTS , 13016 ) /* 0x000032d8 */ \ XXX( WERR_IPSEC_TUNNEL_FILTER_NOT_FOUND , 13017 ) /* 0x000032d9 */ \ XXX( WERR_IPSEC_MM_FILTER_PENDING_DELETION , 13018 ) /* 0x000032da */ \ XXX( WERR_IPSEC_TRANSPORT_FILTER_ENDING_DELETION , 13019 ) /* 0x000032db */ \ XXX( WERR_IPSEC_TUNNEL_FILTER_PENDING_DELETION , 13020 ) /* 0x000032dc */ \ XXX( WERR_IPSEC_MM_POLICY_PENDING_ELETION , 13021 ) /* 0x000032dd */ \ XXX( WERR_IPSEC_MM_AUTH_PENDING_DELETION , 13022 ) /* 0x000032de */ \ XXX( WERR_IPSEC_QM_POLICY_PENDING_DELETION , 13023 ) /* 0x000032df */ \ XXX( WERR_IPSEC_IKE_NEG_STATUS_BEGIN , 13800 ) /* 0x000035e8 */ \ XXX( WERR_IPSEC_IKE_AUTH_FAIL , 13801 ) /* 0x000035e9 */ \ XXX( WERR_IPSEC_IKE_ATTRIB_FAIL , 13802 ) /* 0x000035ea */ \ XXX( WERR_IPSEC_IKE_NEGOTIATION_PENDING , 13803 ) /* 0x000035eb */ \ XXX( WERR_IPSEC_IKE_GENERAL_PROCESSING_ERROR , 13804 ) /* 0x000035ec */ \ XXX( WERR_IPSEC_IKE_TIMED_OUT , 13805 ) /* 0x000035ed */ \ XXX( WERR_IPSEC_IKE_NO_CERT , 13806 ) /* 0x000035ee */ \ XXX( WERR_IPSEC_IKE_SA_DELETED , 13807 ) /* 0x000035ef */ \ XXX( WERR_IPSEC_IKE_SA_REAPED , 13808 ) /* 0x000035f0 */ \ XXX( WERR_IPSEC_IKE_MM_ACQUIRE_DROP , 13809 ) /* 0x000035f1 */ \ XXX( WERR_IPSEC_IKE_QM_ACQUIRE_DROP , 13810 ) /* 0x000035f2 */ \ XXX( WERR_IPSEC_IKE_QUEUE_DROP_MM , 13811 ) /* 0x000035f3 */ \ XXX( WERR_IPSEC_IKE_QUEUE_DROP_NO_MM , 13812 ) /* 0x000035f4 */ \ XXX( WERR_IPSEC_IKE_DROP_NO_RESPONSE , 13813 ) /* 0x000035f5 */ \ XXX( WERR_IPSEC_IKE_MM_DELAY_DROP , 13814 ) /* 0x000035f6 */ \ XXX( WERR_IPSEC_IKE_QM_DELAY_DROP , 13815 ) /* 0x000035f7 */ \ XXX( WERR_IPSEC_IKE_ERROR , 13816 ) /* 0x000035f8 */ \ XXX( WERR_IPSEC_IKE_CRL_FAILED , 13817 ) /* 0x000035f9 */ \ XXX( WERR_IPSEC_IKE_INVALID_KEY_USAGE , 13818 ) /* 0x000035fa */ \ XXX( WERR_IPSEC_IKE_INVALID_CERT_TYPE , 13819 ) /* 0x000035fb */ \ XXX( WERR_IPSEC_IKE_NO_PRIVATE_KEY , 13820 ) /* 0x000035fc */ \ XXX( WERR_IPSEC_IKE_DH_FAIL , 13822 ) /* 0x000035fe */ \ XXX( WERR_IPSEC_IKE_INVALID_HEADER , 13824 ) /* 0x00003600 */ \ XXX( WERR_IPSEC_IKE_NO_POLICY , 13825 ) /* 0x00003601 */ \ XXX( WERR_IPSEC_IKE_INVALID_SIGNATURE , 13826 ) /* 0x00003602 */ \ XXX( WERR_IPSEC_IKE_KERBEROS_ERROR , 13827 ) /* 0x00003603 */ \ XXX( WERR_IPSEC_IKE_NO_PUBLIC_KEY , 13828 ) /* 0x00003604 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR , 13829 ) /* 0x00003605 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_SA , 13830 ) /* 0x00003606 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_PROP , 13831 ) /* 0x00003607 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_TRANS , 13832 ) /* 0x00003608 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_KE , 13833 ) /* 0x00003609 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_ID , 13834 ) /* 0x0000360a */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_CERT , 13835 ) /* 0x0000360b */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_CERT_REQ , 13836 ) /* 0x0000360c */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_HASH , 13837 ) /* 0x0000360d */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_SIG , 13838 ) /* 0x0000360e */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_NONCE , 13839 ) /* 0x0000360f */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_NOTIFY , 13840 ) /* 0x00003610 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_DELETE , 13841 ) /* 0x00003611 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_VENDOR , 13842 ) /* 0x00003612 */ \ XXX( WERR_IPSEC_IKE_INVALID_PAYLOAD , 13843 ) /* 0x00003613 */ \ XXX( WERR_IPSEC_IKE_LOAD_SOFT_SA , 13844 ) /* 0x00003614 */ \ XXX( WERR_IPSEC_IKE_SOFT_SA_TORN_DOWN , 13845 ) /* 0x00003615 */ \ XXX( WERR_IPSEC_IKE_INVALID_COOKIE , 13846 ) /* 0x00003616 */ \ XXX( WERR_IPSEC_IKE_NO_PEER_CERT , 13847 ) /* 0x00003617 */ \ XXX( WERR_IPSEC_IKE_PEER_CRL_FAILED , 13848 ) /* 0x00003618 */ \ XXX( WERR_IPSEC_IKE_POLICY_CHANGE , 13849 ) /* 0x00003619 */ \ XXX( WERR_IPSEC_IKE_NO_MM_POLICY , 13850 ) /* 0x0000361a */ \ XXX( WERR_IPSEC_IKE_NOTCBPRIV , 13851 ) /* 0x0000361b */ \ XXX( WERR_IPSEC_IKE_SECLOADFAIL , 13852 ) /* 0x0000361c */ \ XXX( WERR_IPSEC_IKE_FAILSSPINIT , 13853 ) /* 0x0000361d */ \ XXX( WERR_IPSEC_IKE_FAILQUERYSSP , 13854 ) /* 0x0000361e */ \ XXX( WERR_IPSEC_IKE_SRVACQFAIL , 13855 ) /* 0x0000361f */ \ XXX( WERR_IPSEC_IKE_SRVQUERYCRED , 13856 ) /* 0x00003620 */ \ XXX( WERR_IPSEC_IKE_GETSPIFAIL , 13857 ) /* 0x00003621 */ \ XXX( WERR_IPSEC_IKE_INVALID_FILTER , 13858 ) /* 0x00003622 */ \ XXX( WERR_IPSEC_IKE_OUT_OF_MEMORY , 13859 ) /* 0x00003623 */ \ XXX( WERR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED , 13860 ) /* 0x00003624 */ \ XXX( WERR_IPSEC_IKE_INVALID_POLICY , 13861 ) /* 0x00003625 */ \ XXX( WERR_IPSEC_IKE_UNKNOWN_DOI , 13862 ) /* 0x00003626 */ \ XXX( WERR_IPSEC_IKE_INVALID_SITUATION , 13863 ) /* 0x00003627 */ \ XXX( WERR_IPSEC_IKE_DH_FAILURE , 13864 ) /* 0x00003628 */ \ XXX( WERR_IPSEC_IKE_INVALID_GROUP , 13865 ) /* 0x00003629 */ \ XXX( WERR_IPSEC_IKE_ENCRYPT , 13866 ) /* 0x0000362a */ \ XXX( WERR_IPSEC_IKE_DECRYPT , 13867 ) /* 0x0000362b */ \ XXX( WERR_IPSEC_IKE_POLICY_MATCH , 13868 ) /* 0x0000362c */ \ XXX( WERR_IPSEC_IKE_UNSUPPORTED_ID , 13869 ) /* 0x0000362d */ \ XXX( WERR_IPSEC_IKE_INVALID_HASH , 13870 ) /* 0x0000362e */ \ XXX( WERR_IPSEC_IKE_INVALID_HASH_ALG , 13871 ) /* 0x0000362f */ \ XXX( WERR_IPSEC_IKE_INVALID_HASH_SIZE , 13872 ) /* 0x00003630 */ \ XXX( WERR_IPSEC_IKE_INVALID_ENCRYPT_ALG , 13873 ) /* 0x00003631 */ \ XXX( WERR_IPSEC_IKE_INVALID_AUTH_ALG , 13874 ) /* 0x00003632 */ \ XXX( WERR_IPSEC_IKE_INVALID_SIG , 13875 ) /* 0x00003633 */ \ XXX( WERR_IPSEC_IKE_LOAD_FAILED , 13876 ) /* 0x00003634 */ \ XXX( WERR_IPSEC_IKE_RPC_DELETE , 13877 ) /* 0x00003635 */ \ XXX( WERR_IPSEC_IKE_BENIGN_REINIT , 13878 ) /* 0x00003636 */ \ XXX( WERR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY , 13879 ) /* 0x00003637 */ \ XXX( WERR_IPSEC_IKE_INVALID_CERT_KEYLEN , 13881 ) /* 0x00003639 */ \ XXX( WERR_IPSEC_IKE_MM_LIMIT , 13882 ) /* 0x0000363a */ \ XXX( WERR_IPSEC_IKE_NEGOTIATION_DISABLED , 13883 ) /* 0x0000363b */ \ XXX( WERR_IPSEC_IKE_QM_LIMIT , 13884 ) /* 0x0000363c */ \ XXX( WERR_IPSEC_IKE_MM_EXPIRED , 13885 ) /* 0x0000363d */ \ XXX( WERR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID , 13886 ) /* 0x0000363e */ \ XXX( WERR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH , 13887 ) /* 0x0000363f */ \ XXX( WERR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID , 13888 ) /* 0x00003640 */ \ XXX( WERR_IPSEC_IKE_INVALID_UMATTS , 13889 ) /* 0x00003641 */ \ XXX( WERR_IPSEC_IKE_DOS_COOKIE_SENT , 13890 ) /* 0x00003642 */ \ XXX( WERR_IPSEC_IKE_SHUTTING_DOWN , 13891 ) /* 0x00003643 */ \ XXX( WERR_IPSEC_IKE_CGA_AUTH_FAILED , 13892 ) /* 0x00003644 */ \ XXX( WERR_IPSEC_IKE_PROCESS_ERR_NATOA , 13893 ) /* 0x00003645 */ \ XXX( WERR_IPSEC_IKE_INVALID_MM_FOR_QM , 13894 ) /* 0x00003646 */ \ XXX( WERR_IPSEC_IKE_QM_EXPIRED , 13895 ) /* 0x00003647 */ \ XXX( WERR_IPSEC_IKE_TOO_MANY_FILTERS , 13896 ) /* 0x00003648 */ \ XXX( WERR_IPSEC_IKE_NEG_STATUS_END , 13897 ) /* 0x00003649 */ \ XXX( WERR_SXS_SECTION_NOT_FOUND , 14000 ) /* 0x000036b0 */ \ XXX( WERR_SXS_CANT_GEN_ACTCTX , 14001 ) /* 0x000036b1 */ \ XXX( WERR_SXS_INVALID_ACTCTXDATA_FORMAT , 14002 ) /* 0x000036b2 */ \ XXX( WERR_SXS_ASSEMBLY_NOT_FOUND , 14003 ) /* 0x000036b3 */ \ XXX( WERR_SXS_MANIFEST_FORMAT_ERROR , 14004 ) /* 0x000036b4 */ \ XXX( WERR_SXS_MANIFEST_PARSE_ERROR , 14005 ) /* 0x000036b5 */ \ XXX( WERR_SXS_ACTIVATION_CONTEXT_DISABLED , 14006 ) /* 0x000036b6 */ \ XXX( WERR_SXS_KEY_NOT_FOUND , 14007 ) /* 0x000036b7 */ \ XXX( WERR_SXS_VERSION_CONFLICT , 14008 ) /* 0x000036b8 */ \ XXX( WERR_SXS_WRONG_SECTION_TYPE , 14009 ) /* 0x000036b9 */ \ XXX( WERR_SXS_THREAD_QUERIES_DISABLED , 14010 ) /* 0x000036ba */ \ XXX( WERR_SXS_PROCESS_DEFAULT_ALREADY_SET , 14011 ) /* 0x000036bb */ \ XXX( WERR_SXS_UNKNOWN_ENCODING_GROUP , 14012 ) /* 0x000036bc */ \ XXX( WERR_SXS_UNKNOWN_ENCODING , 14013 ) /* 0x000036bd */ \ XXX( WERR_SXS_INVALID_XML_NAMESPACE_URI , 14014 ) /* 0x000036be */ \ XXX( WERR_SXS_ROOT_MANIFEST_DEPENDENCY_OT_INSTALLED , 14015 ) /* 0x000036bf */ \ XXX( WERR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED , 14016 ) /* 0x000036c0 */ \ XXX( WERR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE , 14017 ) /* 0x000036c1 */ \ XXX( WERR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE, 14018 ) /* 0x000036c2 */ \ XXX( WERR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE, 14019 ) /* 0x000036c3 */ \ XXX( WERR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT, 14020 ) /* 0x000036c4 */ \ XXX( WERR_SXS_DUPLICATE_DLL_NAME , 14021 ) /* 0x000036c5 */ \ XXX( WERR_SXS_DUPLICATE_WINDOWCLASS_NAME , 14022 ) /* 0x000036c6 */ \ XXX( WERR_SXS_DUPLICATE_CLSID , 14023 ) /* 0x000036c7 */ \ XXX( WERR_SXS_DUPLICATE_IID , 14024 ) /* 0x000036c8 */ \ XXX( WERR_SXS_DUPLICATE_TLBID , 14025 ) /* 0x000036c9 */ \ XXX( WERR_SXS_DUPLICATE_PROGID , 14026 ) /* 0x000036ca */ \ XXX( WERR_SXS_DUPLICATE_ASSEMBLY_NAME , 14027 ) /* 0x000036cb */ \ XXX( WERR_SXS_FILE_HASH_MISMATCH , 14028 ) /* 0x000036cc */ \ XXX( WERR_SXS_POLICY_PARSE_ERROR , 14029 ) /* 0x000036cd */ \ XXX( WERR_SXS_XML_E_MISSINGQUOTE , 14030 ) /* 0x000036ce */ \ XXX( WERR_SXS_XML_E_COMMENTSYNTAX , 14031 ) /* 0x000036cf */ \ XXX( WERR_SXS_XML_E_BADSTARTNAMECHAR , 14032 ) /* 0x000036d0 */ \ XXX( WERR_SXS_XML_E_BADNAMECHAR , 14033 ) /* 0x000036d1 */ \ XXX( WERR_SXS_XML_E_BADCHARINSTRING , 14034 ) /* 0x000036d2 */ \ XXX( WERR_SXS_XML_E_XMLDECLSYNTAX , 14035 ) /* 0x000036d3 */ \ XXX( WERR_SXS_XML_E_BADCHARDATA , 14036 ) /* 0x000036d4 */ \ XXX( WERR_SXS_XML_E_MISSINGWHITESPACE , 14037 ) /* 0x000036d5 */ \ XXX( WERR_SXS_XML_E_EXPECTINGTAGEND , 14038 ) /* 0x000036d6 */ \ XXX( WERR_SXS_XML_E_MISSINGSEMICOLON , 14039 ) /* 0x000036d7 */ \ XXX( WERR_SXS_XML_E_UNBALANCEDPAREN , 14040 ) /* 0x000036d8 */ \ XXX( WERR_SXS_XML_E_INTERNALERROR , 14041 ) /* 0x000036d9 */ \ XXX( WERR_SXS_XML_E_UNEXPECTED_WHITESPACE , 14042 ) /* 0x000036da */ \ XXX( WERR_SXS_XML_E_INCOMPLETE_ENCODING , 14043 ) /* 0x000036db */ \ XXX( WERR_SXS_XML_E_MISSING_PAREN , 14044 ) /* 0x000036dc */ \ XXX( WERR_SXS_XML_E_EXPECTINGCLOSEQUOTE , 14045 ) /* 0x000036dd */ \ XXX( WERR_SXS_XML_E_MULTIPLE_COLONS , 14046 ) /* 0x000036de */ \ XXX( WERR_SXS_XML_E_INVALID_DECIMAL , 14047 ) /* 0x000036df */ \ XXX( WERR_SXS_XML_E_INVALID_HEXIDECIMAL , 14048 ) /* 0x000036e0 */ \ XXX( WERR_SXS_XML_E_INVALID_UNICODE , 14049 ) /* 0x000036e1 */ \ XXX( WERR_SXS_XML_E_WHITESPACEORQUESTIONMARK , 14050 ) /* 0x000036e2 */ \ XXX( WERR_SXS_XML_E_UNEXPECTEDENDTAG , 14051 ) /* 0x000036e3 */ \ XXX( WERR_SXS_XML_E_UNCLOSEDTAG , 14052 ) /* 0x000036e4 */ \ XXX( WERR_SXS_XML_E_DUPLICATEATTRIBUTE , 14053 ) /* 0x000036e5 */ \ XXX( WERR_SXS_XML_E_MULTIPLEROOTS , 14054 ) /* 0x000036e6 */ \ XXX( WERR_SXS_XML_E_INVALIDATROOTLEVEL , 14055 ) /* 0x000036e7 */ \ XXX( WERR_SXS_XML_E_BADXMLDECL , 14056 ) /* 0x000036e8 */ \ XXX( WERR_SXS_XML_E_MISSINGROOT , 14057 ) /* 0x000036e9 */ \ XXX( WERR_SXS_XML_E_UNEXPECTEDEOF , 14058 ) /* 0x000036ea */ \ XXX( WERR_SXS_XML_E_BADPEREFINSUBSET , 14059 ) /* 0x000036eb */ \ XXX( WERR_SXS_XML_E_UNCLOSEDSTARTTAG , 14060 ) /* 0x000036ec */ \ XXX( WERR_SXS_XML_E_UNCLOSEDENDTAG , 14061 ) /* 0x000036ed */ \ XXX( WERR_SXS_XML_E_UNCLOSEDSTRING , 14062 ) /* 0x000036ee */ \ XXX( WERR_SXS_XML_E_UNCLOSEDCOMMENT , 14063 ) /* 0x000036ef */ \ XXX( WERR_SXS_XML_E_UNCLOSEDDECL , 14064 ) /* 0x000036f0 */ \ XXX( WERR_SXS_XML_E_UNCLOSEDCDATA , 14065 ) /* 0x000036f1 */ \ XXX( WERR_SXS_XML_E_RESERVEDNAMESPACE , 14066 ) /* 0x000036f2 */ \ XXX( WERR_SXS_XML_E_INVALIDENCODING , 14067 ) /* 0x000036f3 */ \ XXX( WERR_SXS_XML_E_INVALIDSWITCH , 14068 ) /* 0x000036f4 */ \ XXX( WERR_SXS_XML_E_BADXMLCASE , 14069 ) /* 0x000036f5 */ \ XXX( WERR_SXS_XML_E_INVALID_STANDALONE , 14070 ) /* 0x000036f6 */ \ XXX( WERR_SXS_XML_E_UNEXPECTED_STANDALONE , 14071 ) /* 0x000036f7 */ \ XXX( WERR_SXS_XML_E_INVALID_VERSION , 14072 ) /* 0x000036f8 */ \ XXX( WERR_SXS_XML_E_MISSINGEQUALS , 14073 ) /* 0x000036f9 */ \ XXX( WERR_SXS_PROTECTION_RECOVERY_FAILED , 14074 ) /* 0x000036fa */ \ XXX( WERR_SXS_PROTECTION_PUBLIC_KEY_OO_SHORT , 14075 ) /* 0x000036fb */ \ XXX( WERR_SXS_PROTECTION_CATALOG_NOT_VALID , 14076 ) /* 0x000036fc */ \ XXX( WERR_SXS_UNTRANSLATABLE_HRESULT , 14077 ) /* 0x000036fd */ \ XXX( WERR_SXS_PROTECTION_CATALOG_FILE_MISSING , 14078 ) /* 0x000036fe */ \ XXX( WERR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE , 14079 ) /* 0x000036ff */ \ XXX( WERR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME , 14080 ) /* 0x00003700 */ \ XXX( WERR_SXS_ASSEMBLY_MISSING , 14081 ) /* 0x00003701 */ \ XXX( WERR_SXS_CORRUPT_ACTIVATION_STACK , 14082 ) /* 0x00003702 */ \ XXX( WERR_SXS_CORRUPTION , 14083 ) /* 0x00003703 */ \ XXX( WERR_SXS_EARLY_DEACTIVATION , 14084 ) /* 0x00003704 */ \ XXX( WERR_SXS_INVALID_DEACTIVATION , 14085 ) /* 0x00003705 */ \ XXX( WERR_SXS_MULTIPLE_DEACTIVATION , 14086 ) /* 0x00003706 */ \ XXX( WERR_SXS_PROCESS_TERMINATION_REQUESTED , 14087 ) /* 0x00003707 */ \ XXX( WERR_SXS_RELEASE_ACTIVATION_ONTEXT , 14088 ) /* 0x00003708 */ \ XXX( WERR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY , 14089 ) /* 0x00003709 */ \ XXX( WERR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE , 14090 ) /* 0x0000370a */ \ XXX( WERR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME , 14091 ) /* 0x0000370b */ \ XXX( WERR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE , 14092 ) /* 0x0000370c */ \ XXX( WERR_SXS_IDENTITY_PARSE_ERROR , 14093 ) /* 0x0000370d */ \ XXX( WERR_MALFORMED_SUBSTITUTION_STRING , 14094 ) /* 0x0000370e */ \ XXX( WERR_SXS_INCORRECT_PUBLIC_KEY_OKEN , 14095 ) /* 0x0000370f */ \ XXX( WERR_UNMAPPED_SUBSTITUTION_STRING , 14096 ) /* 0x00003710 */ \ XXX( WERR_SXS_ASSEMBLY_NOT_LOCKED , 14097 ) /* 0x00003711 */ \ XXX( WERR_SXS_COMPONENT_STORE_CORRUPT , 14098 ) /* 0x00003712 */ \ XXX( WERR_ADVANCED_INSTALLER_FAILED , 14099 ) /* 0x00003713 */ \ XXX( WERR_XML_ENCODING_MISMATCH , 14100 ) /* 0x00003714 */ \ XXX( WERR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT, 14101 ) /* 0x00003715 */ \ XXX( WERR_SXS_IDENTITIES_DIFFERENT , 14102 ) /* 0x00003716 */ \ XXX( WERR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT , 14103 ) /* 0x00003717 */ \ XXX( WERR_SXS_FILE_NOT_PART_OF_ASSEMBLY , 14104 ) /* 0x00003718 */ \ XXX( WERR_SXS_MANIFEST_TOO_BIG , 14105 ) /* 0x00003719 */ \ XXX( WERR_SXS_SETTING_NOT_REGISTERED , 14106 ) /* 0x0000371a */ \ XXX( WERR_SXS_TRANSACTION_CLOSURE_INCOMPLETE , 14107 ) /* 0x0000371b */ \ XXX( WERR_EVT_INVALID_CHANNEL_PATH , 15000 ) /* 0x00003a98 */ \ XXX( WERR_EVT_INVALID_QUERY , 15001 ) /* 0x00003a99 */ \ XXX( WERR_EVT_PUBLISHER_METADATA_NOT_FOUND , 15002 ) /* 0x00003a9a */ \ XXX( WERR_EVT_EVENT_TEMPLATE_NOT_FOUND , 15003 ) /* 0x00003a9b */ \ XXX( WERR_EVT_INVALID_PUBLISHER_NAME , 15004 ) /* 0x00003a9c */ \ XXX( WERR_EVT_INVALID_EVENT_DATA , 15005 ) /* 0x00003a9d */ \ XXX( WERR_EVT_CHANNEL_NOT_FOUND , 15007 ) /* 0x00003a9f */ \ XXX( WERR_EVT_MALFORMED_XML_TEXT , 15008 ) /* 0x00003aa0 */ \ XXX( WERR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL , 15009 ) /* 0x00003aa1 */ \ XXX( WERR_EVT_CONFIGURATION_ERROR , 15010 ) /* 0x00003aa2 */ \ XXX( WERR_EVT_QUERY_RESULT_STALE , 15011 ) /* 0x00003aa3 */ \ XXX( WERR_EVT_QUERY_RESULT_INVALID_POSITION , 15012 ) /* 0x00003aa4 */ \ XXX( WERR_EVT_NON_VALIDATING_MSXML , 15013 ) /* 0x00003aa5 */ \ XXX( WERR_EVT_FILTER_ALREADYSCOPED , 15014 ) /* 0x00003aa6 */ \ XXX( WERR_EVT_FILTER_NOTELTSET , 15015 ) /* 0x00003aa7 */ \ XXX( WERR_EVT_FILTER_INVARG , 15016 ) /* 0x00003aa8 */ \ XXX( WERR_EVT_FILTER_INVTEST , 15017 ) /* 0x00003aa9 */ \ XXX( WERR_EVT_FILTER_INVTYPE , 15018 ) /* 0x00003aaa */ \ XXX( WERR_EVT_FILTER_PARSEERR , 15019 ) /* 0x00003aab */ \ XXX( WERR_EVT_FILTER_UNSUPPORTEDOP , 15020 ) /* 0x00003aac */ \ XXX( WERR_EVT_FILTER_UNEXPECTEDTOKEN , 15021 ) /* 0x00003aad */ \ XXX( WERR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL, 15022 ) /* 0x00003aae */ \ XXX( WERR_EVT_INVALID_CHANNEL_PROPERTY_VALUE , 15023 ) /* 0x00003aaf */ \ XXX( WERR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE , 15024 ) /* 0x00003ab0 */ \ XXX( WERR_EVT_CHANNEL_CANNOT_ACTIVATE , 15025 ) /* 0x00003ab1 */ \ XXX( WERR_EVT_FILTER_TOO_COMPLEX , 15026 ) /* 0x00003ab2 */ \ XXX( WERR_EVT_MESSAGE_NOT_FOUND , 15027 ) /* 0x00003ab3 */ \ XXX( WERR_EVT_MESSAGE_ID_NOT_FOUND , 15028 ) /* 0x00003ab4 */ \ XXX( WERR_EVT_UNRESOLVED_VALUE_INSERT , 15029 ) /* 0x00003ab5 */ \ XXX( WERR_EVT_UNRESOLVED_PARAMETER_INSERT , 15030 ) /* 0x00003ab6 */ \ XXX( WERR_EVT_MAX_INSERTS_REACHED , 15031 ) /* 0x00003ab7 */ \ XXX( WERR_EVT_EVENT_DEFINITION_NOT_OUND , 15032 ) /* 0x00003ab8 */ \ XXX( WERR_EVT_MESSAGE_LOCALE_NOT_FOUND , 15033 ) /* 0x00003ab9 */ \ XXX( WERR_EVT_VERSION_TOO_OLD , 15034 ) /* 0x00003aba */ \ XXX( WERR_EVT_VERSION_TOO_NEW , 15035 ) /* 0x00003abb */ \ XXX( WERR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY , 15036 ) /* 0x00003abc */ \ XXX( WERR_EVT_PUBLISHER_DISABLED , 15037 ) /* 0x00003abd */ \ XXX( WERR_EC_SUBSCRIPTION_CANNOT_ACTIVATE , 15080 ) /* 0x00003ae8 */ \ XXX( WERR_EC_LOG_DISABLED , 15081 ) /* 0x00003ae9 */ \ XXX( WERR_MUI_FILE_NOT_FOUND , 15100 ) /* 0x00003afc */ \ XXX( WERR_MUI_INVALID_FILE , 15101 ) /* 0x00003afd */ \ XXX( WERR_MUI_INVALID_RC_CONFIG , 15102 ) /* 0x00003afe */ \ XXX( WERR_MUI_INVALID_LOCALE_NAME , 15103 ) /* 0x00003aff */ \ XXX( WERR_MUI_INVALID_ULTIMATEFALLBACK_NAME , 15104 ) /* 0x00003b00 */ \ XXX( WERR_MUI_FILE_NOT_LOADED , 15105 ) /* 0x00003b01 */ \ XXX( WERR_RESOURCE_ENUM_USER_STOP , 15106 ) /* 0x00003b02 */ \ XXX( WERR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED , 15107 ) /* 0x00003b03 */ \ XXX( WERR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME , 15108 ) /* 0x00003b04 */ \ XXX( WERR_MCA_INVALID_CAPABILITIES_STRING , 15200 ) /* 0x00003b60 */ \ XXX( WERR_MCA_INVALID_VCP_VERSION , 15201 ) /* 0x00003b61 */ \ XXX( WERR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION , 15202 ) /* 0x00003b62 */ \ XXX( WERR_MCA_MCCS_VERSION_MISMATCH , 15203 ) /* 0x00003b63 */ \ XXX( WERR_MCA_UNSUPPORTED_MCCS_VERSION , 15204 ) /* 0x00003b64 */ \ XXX( WERR_MCA_INTERNAL_ERROR , 15205 ) /* 0x00003b65 */ \ XXX( WERR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED , 15206 ) /* 0x00003b66 */ \ XXX( WERR_MCA_UNSUPPORTED_COLOR_TEMPERATURE , 15207 ) /* 0x00003b67 */ \ XXX( WERR_AMBIGUOUS_SYSTEM_DEVICE , 15250 ) /* 0x00003b92 */ \ XXX( WERR_SYSTEM_DEVICE_NOT_FOUND , 15299 ) /* 0x00003bc3 */ #if 0 /* WERR_... symbols not referenced within Wireshark */ VALUE_STRING_ENUM2(WERR_errors); #endif VALUE_STRING_ARRAY2_GLOBAL_DCL(WERR_errors); /* XXX: Remove once all PIDL generated dissectors ref WERR_errors_ext */ extern value_string_ext WERR_errors_ext; /* Win32 errors. * These defines specify the HRES error codes often encountered in ms DCE/RPC * interfaces (those that do not return NT status that is) * */ #define HRES_errors_VALUE_STRING_LIST(XXX) \ XXX( HRES_STG_S_CONVERTED , 197120U) /* 0x00030200 */ \ XXX( HRES_STG_S_BLOCK , 197121U) /* 0x00030201 */ \ XXX( HRES_STG_S_RETRYNOW , 197122U) /* 0x00030202 */ \ XXX( HRES_STG_S_MONITORING , 197123U) /* 0x00030203 */ \ XXX( HRES_STG_S_MULTIPLEOPENS , 197124U) /* 0x00030204 */ \ XXX( HRES_STG_S_CONSOLIDATIONFAILED , 197125U) /* 0x00030205 */ \ XXX( HRES_STG_S_CANNOTCONSOLIDATE , 197126U) /* 0x00030206 */ \ XXX( HRES_OLE_S_USEREG , 262144U) /* 0x00040000 */ \ XXX( HRES_OLE_S_STATIC , 262145U) /* 0x00040001 */ \ XXX( HRES_OLE_S_MAC_CLIPFORMAT , 262146U) /* 0x00040002 */ \ XXX( HRES_DRAGDROP_S_DROP , 262400U) /* 0x00040100 */ \ XXX( HRES_DRAGDROP_S_CANCEL , 262401U) /* 0x00040101 */ \ XXX( HRES_DRAGDROP_S_USEDEFAULTCURSORS , 262402U) /* 0x00040102 */ \ XXX( HRES_DATA_S_SAMEFORMATETC , 262448U) /* 0x00040130 */ \ XXX( HRES_VIEW_S_ALREADY_FROZEN , 262464U) /* 0x00040140 */ \ XXX( HRES_CACHE_S_FORMATETC_NOTSUPPORTED , 262512U) /* 0x00040170 */ \ XXX( HRES_CACHE_S_SAMECACHE , 262513U) /* 0x00040171 */ \ XXX( HRES_CACHE_S_SOMECACHES_NOTUPDATED , 262514U) /* 0x00040172 */ \ XXX( HRES_OLEOBJ_S_INVALIDVERB , 262528U) /* 0x00040180 */ \ XXX( HRES_OLEOBJ_S_CANNOT_DOVERB_NOW , 262529U) /* 0x00040181 */ \ XXX( HRES_OLEOBJ_S_INVALIDHWND , 262530U) /* 0x00040182 */ \ XXX( HRES_INPLACE_S_TRUNCATED , 262560U) /* 0x000401a0 */ \ XXX( HRES_CONVERT10_S_NO_PRESENTATION , 262592U) /* 0x000401c0 */ \ XXX( HRES_MK_S_REDUCED_TO_SELF , 262626U) /* 0x000401e2 */ \ XXX( HRES_MK_S_ME , 262628U) /* 0x000401e4 */ \ XXX( HRES_MK_S_HIM , 262629U) /* 0x000401e5 */ \ XXX( HRES_MK_S_US , 262630U) /* 0x000401e6 */ \ XXX( HRES_MK_S_MONIKERALREADYREGISTERED , 262631U) /* 0x000401e7 */ \ XXX( HRES_EVENT_S_SOME_SUBSCRIBERS_FAILED , 262656U) /* 0x00040200 */ \ XXX( HRES_EVENT_S_NOSUBSCRIBERS , 262658U) /* 0x00040202 */ \ XXX( HRES_SCHED_S_TASK_READY , 267008U) /* 0x00041300 */ \ XXX( HRES_SCHED_S_TASK_RUNNING , 267009U) /* 0x00041301 */ \ XXX( HRES_SCHED_S_TASK_DISABLED , 267010U) /* 0x00041302 */ \ XXX( HRES_SCHED_S_TASK_HAS_NOT_RUN , 267011U) /* 0x00041303 */ \ XXX( HRES_SCHED_S_TASK_NO_MORE_RUNS , 267012U) /* 0x00041304 */ \ XXX( HRES_SCHED_S_TASK_NOT_SCHEDULED , 267013U) /* 0x00041305 */ \ XXX( HRES_SCHED_S_TASK_TERMINATED , 267014U) /* 0x00041306 */ \ XXX( HRES_SCHED_S_TASK_NO_VALID_TRIGGERS , 267015U) /* 0x00041307 */ \ XXX( HRES_SCHED_S_EVENT_TRIGGER , 267016U) /* 0x00041308 */ \ XXX( HRES_SCHED_S_SOME_TRIGGERS_FAILED , 267035U) /* 0x0004131b */ \ XXX( HRES_SCHED_S_BATCH_LOGON_PROBLEM , 267036U) /* 0x0004131c */ \ XXX( HRES_XACT_S_ASYNC , 315392U) /* 0x0004d000 */ \ XXX( HRES_XACT_S_READONLY , 315394U) /* 0x0004d002 */ \ XXX( HRES_XACT_S_SOMENORETAIN , 315395U) /* 0x0004d003 */ \ XXX( HRES_XACT_S_OKINFORM , 315396U) /* 0x0004d004 */ \ XXX( HRES_XACT_S_MADECHANGESCONTENT , 315397U) /* 0x0004d005 */ \ XXX( HRES_XACT_S_MADECHANGESINFORM , 315398U) /* 0x0004d006 */ \ XXX( HRES_XACT_S_ALLNORETAIN , 315399U) /* 0x0004d007 */ \ XXX( HRES_XACT_S_ABORTING , 315400U) /* 0x0004d008 */ \ XXX( HRES_XACT_S_SINGLEPHASE , 315401U) /* 0x0004d009 */ \ XXX( HRES_XACT_S_LOCALLY_OK , 315402U) /* 0x0004d00a */ \ XXX( HRES_XACT_S_LASTRESOURCEMANAGER , 315408U) /* 0x0004d010 */ \ XXX( HRES_CO_S_NOTALLINTERFACES , 524306U) /* 0x00080012 */ \ XXX( HRES_CO_S_MACHINENAMENOTFOUND , 524307U) /* 0x00080013 */ \ XXX( HRES_SEC_I_CONTINUE_NEEDED , 590610U) /* 0x00090312 */ \ XXX( HRES_SEC_I_COMPLETE_NEEDED , 590611U) /* 0x00090313 */ \ XXX( HRES_SEC_I_COMPLETE_AND_CONTINUE , 590612U) /* 0x00090314 */ \ XXX( HRES_SEC_I_LOCAL_LOGON , 590613U) /* 0x00090315 */ \ XXX( HRES_SEC_I_CONTEXT_EXPIRED , 590615U) /* 0x00090317 */ \ XXX( HRES_SEC_I_INCOMPLETE_CREDENTIALS , 590624U) /* 0x00090320 */ \ XXX( HRES_SEC_I_RENEGOTIATE , 590625U) /* 0x00090321 */ \ XXX( HRES_SEC_I_NO_LSA_CONTEXT , 590627U) /* 0x00090323 */ \ XXX( HRES_SEC_I_SIGNATURE_NEEDED , 590684U) /* 0x0009035c */ \ XXX( HRES_CRYPT_I_NEW_PROTECTION_REQUIRED , 593938U) /* 0x00091012 */ \ XXX( HRES_NS_S_CALLPENDING , 851968U) /* 0x000d0000 */ \ XXX( HRES_NS_S_CALLABORTED , 851969U) /* 0x000d0001 */ \ XXX( HRES_NS_S_STREAM_TRUNCATED , 851970U) /* 0x000d0002 */ \ XXX( HRES_NS_S_REBUFFERING , 854984U) /* 0x000d0bc8 */ \ XXX( HRES_NS_S_DEGRADING_QUALITY , 854985U) /* 0x000d0bc9 */ \ XXX( HRES_NS_S_TRANSCRYPTOR_EOF , 855003U) /* 0x000d0bdb */ \ XXX( HRES_NS_S_WMP_UI_VERSIONMISMATCH , 856040U) /* 0x000d0fe8 */ \ XXX( HRES_NS_S_WMP_EXCEPTION , 856041U) /* 0x000d0fe9 */ \ XXX( HRES_NS_S_WMP_LOADED_GIF_IMAGE , 856128U) /* 0x000d1040 */ \ XXX( HRES_NS_S_WMP_LOADED_PNG_IMAGE , 856129U) /* 0x000d1041 */ \ XXX( HRES_NS_S_WMP_LOADED_BMP_IMAGE , 856130U) /* 0x000d1042 */ \ XXX( HRES_NS_S_WMP_LOADED_JPG_IMAGE , 856131U) /* 0x000d1043 */ \ XXX( HRES_NS_S_WMG_FORCE_DROP_FRAME , 856143U) /* 0x000d104f */ \ XXX( HRES_NS_S_WMR_ALREADYRENDERED , 856159U) /* 0x000d105f */ \ XXX( HRES_NS_S_WMR_PINTYPEPARTIALMATCH , 856160U) /* 0x000d1060 */ \ XXX( HRES_NS_S_WMR_PINTYPEFULLMATCH , 856161U) /* 0x000d1061 */ \ XXX( HRES_NS_S_WMG_ADVISE_DROP_FRAME , 856166U) /* 0x000d1066 */ \ XXX( HRES_NS_S_WMG_ADVISE_DROP_TO_KEYFRAME , 856167U) /* 0x000d1067 */ \ XXX( HRES_NS_S_NEED_TO_BUY_BURN_RIGHTS , 856283U) /* 0x000d10db */ \ XXX( HRES_NS_S_WMPCORE_PLAYLISTCLEARABORT , 856318U) /* 0x000d10fe */ \ XXX( HRES_NS_S_WMPCORE_PLAYLISTREMOVEITEMABORT , 856319U) /* 0x000d10ff */ \ XXX( HRES_NS_S_WMPCORE_PLAYLIST_CREATION_PENDING , 856322U) /* 0x000d1102 */ \ XXX( HRES_NS_S_WMPCORE_MEDIA_VALIDATION_PENDING , 856323U) /* 0x000d1103 */ \ XXX( HRES_NS_S_WMPCORE_PLAYLIST_REPEAT_SECONDARY_SEGMENTS_IGNORED, 856324U) /* 0x000d1104 */ \ XXX( HRES_NS_S_WMPCORE_COMMAND_NOT_AVAILABLE , 856325U) /* 0x000d1105 */ \ XXX( HRES_NS_S_WMPCORE_PLAYLIST_NAME_AUTO_GENERATED , 856326U) /* 0x000d1106 */ \ XXX( HRES_NS_S_WMPCORE_PLAYLIST_IMPORT_MISSING_ITEMS, 856327U) /* 0x000d1107 */ \ XXX( HRES_NS_S_WMPCORE_PLAYLIST_COLLAPSED_TO_SINGLE_MEDIA, 856328U) /* 0x000d1108 */ \ XXX( HRES_NS_S_WMPCORE_MEDIA_CHILD_PLAYLIST_OPEN_PENDING, 856329U) /* 0x000d1109 */ \ XXX( HRES_NS_S_WMPCORE_MORE_NODES_AVAIABLE , 856330U) /* 0x000d110a */ \ XXX( HRES_NS_S_WMPBR_SUCCESS , 856373U) /* 0x000d1135 */ \ XXX( HRES_NS_S_WMPBR_PARTIALSUCCESS , 856374U) /* 0x000d1136 */ \ XXX( HRES_NS_S_WMPEFFECT_TRANSPARENT , 856388U) /* 0x000d1144 */ \ XXX( HRES_NS_S_WMPEFFECT_OPAQUE , 856389U) /* 0x000d1145 */ \ XXX( HRES_NS_S_OPERATION_PENDING , 856398U) /* 0x000d114e */ \ XXX( HRES_NS_S_TRACK_BUY_REQUIRES_ALBUM_PURCHASE , 856921U) /* 0x000d1359 */ \ XXX( HRES_NS_S_NAVIGATION_COMPLETE_WITH_ERRORS , 856926U) /* 0x000d135e */ \ XXX( HRES_NS_S_TRACK_ALREADY_DOWNLOADED , 856929U) /* 0x000d1361 */ \ XXX( HRES_NS_S_PUBLISHING_POINT_STARTED_WITH_FAILED_SINKS, 857369U) /* 0x000d1519 */ \ XXX( HRES_NS_S_DRM_LICENSE_ACQUIRED , 861990U) /* 0x000d2726 */ \ XXX( HRES_NS_S_DRM_INDIVIDUALIZED , 861991U) /* 0x000d2727 */ \ XXX( HRES_NS_S_DRM_MONITOR_CANCELLED , 862022U) /* 0x000d2746 */ \ XXX( HRES_NS_S_DRM_ACQUIRE_CANCELLED , 862023U) /* 0x000d2747 */ \ XXX( HRES_NS_S_DRM_BURNABLE_TRACK , 862062U) /* 0x000d276e */ \ XXX( HRES_NS_S_DRM_BURNABLE_TRACK_WITH_PLAYLIST_RESTRICTION, 862063U) /* 0x000d276f */ \ XXX( HRES_NS_S_DRM_NEEDS_INDIVIDUALIZATION , 862174U) /* 0x000d27de */ \ XXX( HRES_NS_S_REBOOT_RECOMMENDED , 862968U) /* 0x000d2af8 */ \ XXX( HRES_NS_S_REBOOT_REQUIRED , 862969U) /* 0x000d2af9 */ \ XXX( HRES_NS_S_EOSRECEDING , 864009U) /* 0x000d2f09 */ \ XXX( HRES_NS_S_CHANGENOTICE , 864013U) /* 0x000d2f0d */ \ XXX( HRES_ERROR_FLT_IO_COMPLETE , 2031617U) /* 0x001f0001 */ \ XXX( HRES_ERROR_GRAPHICS_MODE_NOT_PINNED , 2499335U) /* 0x00262307 */ \ XXX( HRES_ERROR_GRAPHICS_NO_PREFERRED_MODE , 2499358U) /* 0x0026231e */ \ XXX( HRES_ERROR_GRAPHICS_DATASET_IS_EMPTY , 2499403U) /* 0x0026234b */ \ XXX( HRES_ERROR_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET, 2499404U) /* 0x0026234c */ \ XXX( HRES_ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED, 2499409U) /* 0x00262351 */ \ XXX( HRES_PLA_S_PROPERTY_IGNORED , 3145984U) /* 0x00300100 */ \ XXX( HRES_ERROR_NDIS_INDICATION_REQUIRED , 3407873U) /* 0x00340001 */ \ XXX( HRES_TRK_S_OUT_OF_SYNC , 233492736U) /* 0x0dead100 */ \ XXX( HRES_TRK_VOLUME_NOT_FOUND , 233492738U) /* 0x0dead102 */ \ XXX( HRES_TRK_VOLUME_NOT_OWNED , 233492739U) /* 0x0dead103 */ \ XXX( HRES_TRK_S_NOTIFICATION_QUOTA_EXCEEDED , 233492743U) /* 0x0dead107 */ \ XXX( HRES_NS_I_TIGER_START , 1074593871U) /* 0x400d004f */ \ XXX( HRES_NS_I_CUB_START , 1074593873U) /* 0x400d0051 */ \ XXX( HRES_NS_I_CUB_RUNNING , 1074593874U) /* 0x400d0052 */ \ XXX( HRES_NS_I_DISK_START , 1074593876U) /* 0x400d0054 */ \ XXX( HRES_NS_I_DISK_REBUILD_STARTED , 1074593878U) /* 0x400d0056 */ \ XXX( HRES_NS_I_DISK_REBUILD_FINISHED , 1074593879U) /* 0x400d0057 */ \ XXX( HRES_NS_I_DISK_REBUILD_ABORTED , 1074593880U) /* 0x400d0058 */ \ XXX( HRES_NS_I_LIMIT_FUNNELS , 1074593881U) /* 0x400d0059 */ \ XXX( HRES_NS_I_START_DISK , 1074593882U) /* 0x400d005a */ \ XXX( HRES_NS_I_STOP_DISK , 1074593883U) /* 0x400d005b */ \ XXX( HRES_NS_I_STOP_CUB , 1074593884U) /* 0x400d005c */ \ XXX( HRES_NS_I_KILL_USERSESSION , 1074593885U) /* 0x400d005d */ \ XXX( HRES_NS_I_KILL_CONNECTION , 1074593886U) /* 0x400d005e */ \ XXX( HRES_NS_I_REBUILD_DISK , 1074593887U) /* 0x400d005f */ \ XXX( HRES_MCMADM_I_NO_EVENTS , 1074593897U) /* 0x400d0069 */ \ XXX( HRES_NS_I_LOGGING_FAILED , 1074593902U) /* 0x400d006e */ \ XXX( HRES_NS_I_LIMIT_BANDWIDTH , 1074593904U) /* 0x400d0070 */ \ XXX( HRES_NS_I_CUB_UNFAIL_LINK , 1074594193U) /* 0x400d0191 */ \ XXX( HRES_NS_I_RESTRIPE_START , 1074594195U) /* 0x400d0193 */ \ XXX( HRES_NS_I_RESTRIPE_DONE , 1074594196U) /* 0x400d0194 */ \ XXX( HRES_NS_I_RESTRIPE_DISK_OUT , 1074594198U) /* 0x400d0196 */ \ XXX( HRES_NS_I_RESTRIPE_CUB_OUT , 1074594199U) /* 0x400d0197 */ \ XXX( HRES_NS_I_DISK_STOP , 1074594200U) /* 0x400d0198 */ \ XXX( HRES_NS_I_PLAYLIST_CHANGE_RECEDING , 1074599102U) /* 0x400d14be */ \ XXX( HRES_NS_I_RECONNECTED , 1074605823U) /* 0x400d2eff */ \ XXX( HRES_NS_I_NOLOG_STOP , 1074605825U) /* 0x400d2f01 */ \ XXX( HRES_NS_I_EXISTING_PACKETIZER , 1074605827U) /* 0x400d2f03 */ \ XXX( HRES_NS_I_MANUAL_PROXY , 1074605828U) /* 0x400d2f04 */ \ XXX( HRES_ERROR_GRAPHICS_DRIVER_MISMATCH , 1076240393U) /* 0x40262009 */ \ XXX( HRES_ERROR_GRAPHICS_UNKNOWN_CHILD_STATUS , 1076241455U) /* 0x4026242f */ \ XXX( HRES_ERROR_GRAPHICS_LEADLINK_START_DEFERRED , 1076241463U) /* 0x40262437 */ \ XXX( HRES_ERROR_GRAPHICS_POLLING_TOO_FREQUENTLY , 1076241465U) /* 0x40262439 */ \ XXX( HRES_ERROR_GRAPHICS_START_DEFERRED , 1076241466U) /* 0x4026243a */ \ XXX( HRES_E_PENDING , 2147483658U) /* 0x8000000a */ \ XXX( HRES_E_NOTIMPL , 2147500033U) /* 0x80004001 */ \ XXX( HRES_E_NOINTERFACE , 2147500034U) /* 0x80004002 */ \ XXX( HRES_E_POINTER , 2147500035U) /* 0x80004003 */ \ XXX( HRES_E_ABORT , 2147500036U) /* 0x80004004 */ \ XXX( HRES_E_FAIL , 2147500037U) /* 0x80004005 */ \ XXX( HRES_CO_E_INIT_TLS , 2147500038U) /* 0x80004006 */ \ XXX( HRES_CO_E_INIT_SHARED_ALLOCATOR , 2147500039U) /* 0x80004007 */ \ XXX( HRES_CO_E_INIT_MEMORY_ALLOCATOR , 2147500040U) /* 0x80004008 */ \ XXX( HRES_CO_E_INIT_CLASS_CACHE , 2147500041U) /* 0x80004009 */ \ XXX( HRES_CO_E_INIT_RPC_CHANNEL , 2147500042U) /* 0x8000400a */ \ XXX( HRES_CO_E_INIT_TLS_SET_CHANNEL_CONTROL , 2147500043U) /* 0x8000400b */ \ XXX( HRES_CO_E_INIT_TLS_CHANNEL_CONTROL , 2147500044U) /* 0x8000400c */ \ XXX( HRES_CO_E_INIT_UNACCEPTED_USER_ALLOCATOR , 2147500045U) /* 0x8000400d */ \ XXX( HRES_CO_E_INIT_SCM_MUTEX_EXISTS , 2147500046U) /* 0x8000400e */ \ XXX( HRES_CO_E_INIT_SCM_FILE_MAPPING_EXISTS , 2147500047U) /* 0x8000400f */ \ XXX( HRES_CO_E_INIT_SCM_MAP_VIEW_OF_FILE , 2147500048U) /* 0x80004010 */ \ XXX( HRES_CO_E_INIT_SCM_EXEC_FAILURE , 2147500049U) /* 0x80004011 */ \ XXX( HRES_CO_E_INIT_ONLY_SINGLE_THREADED , 2147500050U) /* 0x80004012 */ \ XXX( HRES_CO_E_CANT_REMOTE , 2147500051U) /* 0x80004013 */ \ XXX( HRES_CO_E_BAD_SERVER_NAME , 2147500052U) /* 0x80004014 */ \ XXX( HRES_CO_E_WRONG_SERVER_IDENTITY , 2147500053U) /* 0x80004015 */ \ XXX( HRES_CO_E_OLE1DDE_DISABLED , 2147500054U) /* 0x80004016 */ \ XXX( HRES_CO_E_RUNAS_SYNTAX , 2147500055U) /* 0x80004017 */ \ XXX( HRES_CO_E_CREATEPROCESS_FAILURE , 2147500056U) /* 0x80004018 */ \ XXX( HRES_CO_E_RUNAS_CREATEPROCESS_FAILURE , 2147500057U) /* 0x80004019 */ \ XXX( HRES_CO_E_RUNAS_LOGON_FAILURE , 2147500058U) /* 0x8000401a */ \ XXX( HRES_CO_E_LAUNCH_PERMSSION_DENIED , 2147500059U) /* 0x8000401b */ \ XXX( HRES_CO_E_START_SERVICE_FAILURE , 2147500060U) /* 0x8000401c */ \ XXX( HRES_CO_E_REMOTE_COMMUNICATION_FAILURE , 2147500061U) /* 0x8000401d */ \ XXX( HRES_CO_E_SERVER_START_TIMEOUT , 2147500062U) /* 0x8000401e */ \ XXX( HRES_CO_E_CLSREG_INCONSISTENT , 2147500063U) /* 0x8000401f */ \ XXX( HRES_CO_E_IIDREG_INCONSISTENT , 2147500064U) /* 0x80004020 */ \ XXX( HRES_CO_E_NOT_SUPPORTED , 2147500065U) /* 0x80004021 */ \ XXX( HRES_CO_E_RELOAD_DLL , 2147500066U) /* 0x80004022 */ \ XXX( HRES_CO_E_MSI_ERROR , 2147500067U) /* 0x80004023 */ \ XXX( HRES_CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT, 2147500068U) /* 0x80004024 */ \ XXX( HRES_CO_E_SERVER_PAUSED , 2147500069U) /* 0x80004025 */ \ XXX( HRES_CO_E_SERVER_NOT_PAUSED , 2147500070U) /* 0x80004026 */ \ XXX( HRES_CO_E_CLASS_DISABLED , 2147500071U) /* 0x80004027 */ \ XXX( HRES_CO_E_CLRNOTAVAILABLE , 2147500072U) /* 0x80004028 */ \ XXX( HRES_CO_E_ASYNC_WORK_REJECTED , 2147500073U) /* 0x80004029 */ \ XXX( HRES_CO_E_SERVER_INIT_TIMEOUT , 2147500074U) /* 0x8000402a */ \ XXX( HRES_CO_E_NO_SECCTX_IN_ACTIVATE , 2147500075U) /* 0x8000402b */ \ XXX( HRES_CO_E_TRACKER_CONFIG , 2147500080U) /* 0x80004030 */ \ XXX( HRES_CO_E_THREADPOOL_CONFIG , 2147500081U) /* 0x80004031 */ \ XXX( HRES_CO_E_SXS_CONFIG , 2147500082U) /* 0x80004032 */ \ XXX( HRES_CO_E_MALFORMED_SPN , 2147500083U) /* 0x80004033 */ \ XXX( HRES_E_UNEXPECTED , 2147549183U) /* 0x8000ffff */ \ XXX( HRES_RPC_E_CALL_REJECTED , 2147549185U) /* 0x80010001 */ \ XXX( HRES_RPC_E_CALL_CANCELED , 2147549186U) /* 0x80010002 */ \ XXX( HRES_RPC_E_CANTPOST_INSENDCALL , 2147549187U) /* 0x80010003 */ \ XXX( HRES_RPC_E_CANTCALLOUT_INASYNCCALL , 2147549188U) /* 0x80010004 */ \ XXX( HRES_RPC_E_CANTCALLOUT_INEXTERNALCALL , 2147549189U) /* 0x80010005 */ \ XXX( HRES_RPC_E_CONNECTION_TERMINATED , 2147549190U) /* 0x80010006 */ \ XXX( HRES_RPC_E_SERVER_DIED , 2147549191U) /* 0x80010007 */ \ XXX( HRES_RPC_E_CLIENT_DIED , 2147549192U) /* 0x80010008 */ \ XXX( HRES_RPC_E_INVALID_DATAPACKET , 2147549193U) /* 0x80010009 */ \ XXX( HRES_RPC_E_CANTTRANSMIT_CALL , 2147549194U) /* 0x8001000a */ \ XXX( HRES_RPC_E_CLIENT_CANTMARSHAL_DATA , 2147549195U) /* 0x8001000b */ \ XXX( HRES_RPC_E_CLIENT_CANTUNMARSHAL_DATA , 2147549196U) /* 0x8001000c */ \ XXX( HRES_RPC_E_SERVER_CANTMARSHAL_DATA , 2147549197U) /* 0x8001000d */ \ XXX( HRES_RPC_E_SERVER_CANTUNMARSHAL_DATA , 2147549198U) /* 0x8001000e */ \ XXX( HRES_RPC_E_INVALID_DATA , 2147549199U) /* 0x8001000f */ \ XXX( HRES_RPC_E_INVALID_PARAMETER , 2147549200U) /* 0x80010010 */ \ XXX( HRES_RPC_E_CANTCALLOUT_AGAIN , 2147549201U) /* 0x80010011 */ \ XXX( HRES_RPC_E_SERVER_DIED_DNE , 2147549202U) /* 0x80010012 */ \ XXX( HRES_RPC_E_SYS_CALL_FAILED , 2147549440U) /* 0x80010100 */ \ XXX( HRES_RPC_E_OUT_OF_RESOURCES , 2147549441U) /* 0x80010101 */ \ XXX( HRES_RPC_E_ATTEMPTED_MULTITHREAD , 2147549442U) /* 0x80010102 */ \ XXX( HRES_RPC_E_NOT_REGISTERED , 2147549443U) /* 0x80010103 */ \ XXX( HRES_RPC_E_FAULT , 2147549444U) /* 0x80010104 */ \ XXX( HRES_RPC_E_SERVERFAULT , 2147549445U) /* 0x80010105 */ \ XXX( HRES_RPC_E_CHANGED_MODE , 2147549446U) /* 0x80010106 */ \ XXX( HRES_RPC_E_INVALIDMETHOD , 2147549447U) /* 0x80010107 */ \ XXX( HRES_RPC_E_DISCONNECTED , 2147549448U) /* 0x80010108 */ \ XXX( HRES_RPC_E_RETRY , 2147549449U) /* 0x80010109 */ \ XXX( HRES_RPC_E_SERVERCALL_RETRYLATER , 2147549450U) /* 0x8001010a */ \ XXX( HRES_RPC_E_SERVERCALL_REJECTED , 2147549451U) /* 0x8001010b */ \ XXX( HRES_RPC_E_INVALID_CALLDATA , 2147549452U) /* 0x8001010c */ \ XXX( HRES_RPC_E_CANTCALLOUT_ININPUTSYNCCALL , 2147549453U) /* 0x8001010d */ \ XXX( HRES_RPC_E_WRONG_THREAD , 2147549454U) /* 0x8001010e */ \ XXX( HRES_RPC_E_THREAD_NOT_INIT , 2147549455U) /* 0x8001010f */ \ XXX( HRES_RPC_E_VERSION_MISMATCH , 2147549456U) /* 0x80010110 */ \ XXX( HRES_RPC_E_INVALID_HEADER , 2147549457U) /* 0x80010111 */ \ XXX( HRES_RPC_E_INVALID_EXTENSION , 2147549458U) /* 0x80010112 */ \ XXX( HRES_RPC_E_INVALID_IPID , 2147549459U) /* 0x80010113 */ \ XXX( HRES_RPC_E_INVALID_OBJECT , 2147549460U) /* 0x80010114 */ \ XXX( HRES_RPC_S_CALLPENDING , 2147549461U) /* 0x80010115 */ \ XXX( HRES_RPC_S_WAITONTIMER , 2147549462U) /* 0x80010116 */ \ XXX( HRES_RPC_E_CALL_COMPLETE , 2147549463U) /* 0x80010117 */ \ XXX( HRES_RPC_E_UNSECURE_CALL , 2147549464U) /* 0x80010118 */ \ XXX( HRES_RPC_E_TOO_LATE , 2147549465U) /* 0x80010119 */ \ XXX( HRES_RPC_E_NO_GOOD_SECURITY_PACKAGES , 2147549466U) /* 0x8001011a */ \ XXX( HRES_RPC_E_ACCESS_DENIED , 2147549467U) /* 0x8001011b */ \ XXX( HRES_RPC_E_REMOTE_DISABLED , 2147549468U) /* 0x8001011c */ \ XXX( HRES_RPC_E_INVALID_OBJREF , 2147549469U) /* 0x8001011d */ \ XXX( HRES_RPC_E_NO_CONTEXT , 2147549470U) /* 0x8001011e */ \ XXX( HRES_RPC_E_TIMEOUT , 2147549471U) /* 0x8001011f */ \ XXX( HRES_RPC_E_NO_SYNC , 2147549472U) /* 0x80010120 */ \ XXX( HRES_RPC_E_FULLSIC_REQUIRED , 2147549473U) /* 0x80010121 */ \ XXX( HRES_RPC_E_INVALID_STD_NAME , 2147549474U) /* 0x80010122 */ \ XXX( HRES_CO_E_FAILEDTOIMPERSONATE , 2147549475U) /* 0x80010123 */ \ XXX( HRES_CO_E_FAILEDTOGETSECCTX , 2147549476U) /* 0x80010124 */ \ XXX( HRES_CO_E_FAILEDTOOPENTHREADTOKEN , 2147549477U) /* 0x80010125 */ \ XXX( HRES_CO_E_FAILEDTOGETTOKENINFO , 2147549478U) /* 0x80010126 */ \ XXX( HRES_CO_E_TRUSTEEDOESNTMATCHCLIENT , 2147549479U) /* 0x80010127 */ \ XXX( HRES_CO_E_FAILEDTOQUERYCLIENTBLANKET , 2147549480U) /* 0x80010128 */ \ XXX( HRES_CO_E_FAILEDTOSETDACL , 2147549481U) /* 0x80010129 */ \ XXX( HRES_CO_E_ACCESSCHECKFAILED , 2147549482U) /* 0x8001012a */ \ XXX( HRES_CO_E_NETACCESSAPIFAILED , 2147549483U) /* 0x8001012b */ \ XXX( HRES_CO_E_WRONGTRUSTEENAMESYNTAX , 2147549484U) /* 0x8001012c */ \ XXX( HRES_CO_E_INVALIDSID , 2147549485U) /* 0x8001012d */ \ XXX( HRES_CO_E_CONVERSIONFAILED , 2147549486U) /* 0x8001012e */ \ XXX( HRES_CO_E_NOMATCHINGSIDFOUND , 2147549487U) /* 0x8001012f */ \ XXX( HRES_CO_E_LOOKUPACCSIDFAILED , 2147549488U) /* 0x80010130 */ \ XXX( HRES_CO_E_NOMATCHINGNAMEFOUND , 2147549489U) /* 0x80010131 */ \ XXX( HRES_CO_E_LOOKUPACCNAMEFAILED , 2147549490U) /* 0x80010132 */ \ XXX( HRES_CO_E_SETSERLHNDLFAILED , 2147549491U) /* 0x80010133 */ \ XXX( HRES_CO_E_FAILEDTOGETWINDIR , 2147549492U) /* 0x80010134 */ \ XXX( HRES_CO_E_PATHTOOLONG , 2147549493U) /* 0x80010135 */ \ XXX( HRES_CO_E_FAILEDTOGENUUID , 2147549494U) /* 0x80010136 */ \ XXX( HRES_CO_E_FAILEDTOCREATEFILE , 2147549495U) /* 0x80010137 */ \ XXX( HRES_CO_E_FAILEDTOCLOSEHANDLE , 2147549496U) /* 0x80010138 */ \ XXX( HRES_CO_E_EXCEEDSYSACLLIMIT , 2147549497U) /* 0x80010139 */ \ XXX( HRES_CO_E_ACESINWRONGORDER , 2147549498U) /* 0x8001013a */ \ XXX( HRES_CO_E_INCOMPATIBLESTREAMVERSION , 2147549499U) /* 0x8001013b */ \ XXX( HRES_CO_E_FAILEDTOOPENPROCESSTOKEN , 2147549500U) /* 0x8001013c */ \ XXX( HRES_CO_E_DECODEFAILED , 2147549501U) /* 0x8001013d */ \ XXX( HRES_CO_E_ACNOTINITIALIZED , 2147549503U) /* 0x8001013f */ \ XXX( HRES_CO_E_CANCEL_DISABLED , 2147549504U) /* 0x80010140 */ \ XXX( HRES_RPC_E_UNEXPECTED , 2147614719U) /* 0x8001ffff */ \ XXX( HRES_DISP_E_UNKNOWNINTERFACE , 2147614721U) /* 0x80020001 */ \ XXX( HRES_DISP_E_MEMBERNOTFOUND , 2147614723U) /* 0x80020003 */ \ XXX( HRES_DISP_E_PARAMNOTFOUND , 2147614724U) /* 0x80020004 */ \ XXX( HRES_DISP_E_TYPEMISMATCH , 2147614725U) /* 0x80020005 */ \ XXX( HRES_DISP_E_UNKNOWNNAME , 2147614726U) /* 0x80020006 */ \ XXX( HRES_DISP_E_NONAMEDARGS , 2147614727U) /* 0x80020007 */ \ XXX( HRES_DISP_E_BADVARTYPE , 2147614728U) /* 0x80020008 */ \ XXX( HRES_DISP_E_EXCEPTION , 2147614729U) /* 0x80020009 */ \ XXX( HRES_DISP_E_OVERFLOW , 2147614730U) /* 0x8002000a */ \ XXX( HRES_DISP_E_BADINDEX , 2147614731U) /* 0x8002000b */ \ XXX( HRES_DISP_E_UNKNOWNLCID , 2147614732U) /* 0x8002000c */ \ XXX( HRES_DISP_E_ARRAYISLOCKED , 2147614733U) /* 0x8002000d */ \ XXX( HRES_DISP_E_BADPARAMCOUNT , 2147614734U) /* 0x8002000e */ \ XXX( HRES_DISP_E_PARAMNOTOPTIONAL , 2147614735U) /* 0x8002000f */ \ XXX( HRES_DISP_E_BADCALLEE , 2147614736U) /* 0x80020010 */ \ XXX( HRES_DISP_E_NOTACOLLECTION , 2147614737U) /* 0x80020011 */ \ XXX( HRES_DISP_E_DIVBYZERO , 2147614738U) /* 0x80020012 */ \ XXX( HRES_DISP_E_BUFFERTOOSMALL , 2147614739U) /* 0x80020013 */ \ XXX( HRES_TYPE_E_BUFFERTOOSMALL , 2147647510U) /* 0x80028016 */ \ XXX( HRES_TYPE_E_FIELDNOTFOUND , 2147647511U) /* 0x80028017 */ \ XXX( HRES_TYPE_E_INVDATAREAD , 2147647512U) /* 0x80028018 */ \ XXX( HRES_TYPE_E_UNSUPFORMAT , 2147647513U) /* 0x80028019 */ \ XXX( HRES_TYPE_E_REGISTRYACCESS , 2147647516U) /* 0x8002801c */ \ XXX( HRES_TYPE_E_LIBNOTREGISTERED , 2147647517U) /* 0x8002801d */ \ XXX( HRES_TYPE_E_UNDEFINEDTYPE , 2147647527U) /* 0x80028027 */ \ XXX( HRES_TYPE_E_QUALIFIEDNAMEDISALLOWED , 2147647528U) /* 0x80028028 */ \ XXX( HRES_TYPE_E_INVALIDSTATE , 2147647529U) /* 0x80028029 */ \ XXX( HRES_TYPE_E_WRONGTYPEKIND , 2147647530U) /* 0x8002802a */ \ XXX( HRES_TYPE_E_ELEMENTNOTFOUND , 2147647531U) /* 0x8002802b */ \ XXX( HRES_TYPE_E_AMBIGUOUSNAME , 2147647532U) /* 0x8002802c */ \ XXX( HRES_TYPE_E_NAMECONFLICT , 2147647533U) /* 0x8002802d */ \ XXX( HRES_TYPE_E_UNKNOWNLCID , 2147647534U) /* 0x8002802e */ \ XXX( HRES_TYPE_E_DLLFUNCTIONNOTFOUND , 2147647535U) /* 0x8002802f */ \ XXX( HRES_TYPE_E_BADMODULEKIND , 2147649725U) /* 0x800288bd */ \ XXX( HRES_TYPE_E_SIZETOOBIG , 2147649733U) /* 0x800288c5 */ \ XXX( HRES_TYPE_E_DUPLICATEID , 2147649734U) /* 0x800288c6 */ \ XXX( HRES_TYPE_E_INVALIDID , 2147649743U) /* 0x800288cf */ \ XXX( HRES_TYPE_E_TYPEMISMATCH , 2147650720U) /* 0x80028ca0 */ \ XXX( HRES_TYPE_E_OUTOFBOUNDS , 2147650721U) /* 0x80028ca1 */ \ XXX( HRES_TYPE_E_IOERROR , 2147650722U) /* 0x80028ca2 */ \ XXX( HRES_TYPE_E_CANTCREATETMPFILE , 2147650723U) /* 0x80028ca3 */ \ XXX( HRES_TYPE_E_CANTLOADLIBRARY , 2147654730U) /* 0x80029c4a */ \ XXX( HRES_TYPE_E_INCONSISTENTPROPFUNCS , 2147654787U) /* 0x80029c83 */ \ XXX( HRES_TYPE_E_CIRCULARTYPE , 2147654788U) /* 0x80029c84 */ \ XXX( HRES_STG_E_INVALIDFUNCTION , 2147680257U) /* 0x80030001 */ \ XXX( HRES_STG_E_FILENOTFOUND , 2147680258U) /* 0x80030002 */ \ XXX( HRES_STG_E_PATHNOTFOUND , 2147680259U) /* 0x80030003 */ \ XXX( HRES_STG_E_TOOMANYOPENFILES , 2147680260U) /* 0x80030004 */ \ XXX( HRES_STG_E_ACCESSDENIED , 2147680261U) /* 0x80030005 */ \ XXX( HRES_STG_E_INVALIDHANDLE , 2147680262U) /* 0x80030006 */ \ XXX( HRES_STG_E_INSUFFICIENTMEMORY , 2147680264U) /* 0x80030008 */ \ XXX( HRES_STG_E_INVALIDPOINTER , 2147680265U) /* 0x80030009 */ \ XXX( HRES_STG_E_NOMOREFILES , 2147680274U) /* 0x80030012 */ \ XXX( HRES_STG_E_DISKISWRITEPROTECTED , 2147680275U) /* 0x80030013 */ \ XXX( HRES_STG_E_SEEKERROR , 2147680281U) /* 0x80030019 */ \ XXX( HRES_STG_E_WRITEFAULT , 2147680285U) /* 0x8003001d */ \ XXX( HRES_STG_E_READFAULT , 2147680286U) /* 0x8003001e */ \ XXX( HRES_STG_E_SHAREVIOLATION , 2147680288U) /* 0x80030020 */ \ XXX( HRES_STG_E_LOCKVIOLATION , 2147680289U) /* 0x80030021 */ \ XXX( HRES_STG_E_FILEALREADYEXISTS , 2147680336U) /* 0x80030050 */ \ XXX( HRES_STG_E_INVALIDPARAMETER , 2147680343U) /* 0x80030057 */ \ XXX( HRES_STG_E_MEDIUMFULL , 2147680368U) /* 0x80030070 */ \ XXX( HRES_STG_E_PROPSETMISMATCHED , 2147680496U) /* 0x800300f0 */ \ XXX( HRES_STG_E_ABNORMALAPIEXIT , 2147680506U) /* 0x800300fa */ \ XXX( HRES_STG_E_INVALIDHEADER , 2147680507U) /* 0x800300fb */ \ XXX( HRES_STG_E_INVALIDNAME , 2147680508U) /* 0x800300fc */ \ XXX( HRES_STG_E_UNKNOWN , 2147680509U) /* 0x800300fd */ \ XXX( HRES_STG_E_UNIMPLEMENTEDFUNCTION , 2147680510U) /* 0x800300fe */ \ XXX( HRES_STG_E_INVALIDFLAG , 2147680511U) /* 0x800300ff */ \ XXX( HRES_STG_E_INUSE , 2147680512U) /* 0x80030100 */ \ XXX( HRES_STG_E_NOTCURRENT , 2147680513U) /* 0x80030101 */ \ XXX( HRES_STG_E_REVERTED , 2147680514U) /* 0x80030102 */ \ XXX( HRES_STG_E_CANTSAVE , 2147680515U) /* 0x80030103 */ \ XXX( HRES_STG_E_OLDFORMAT , 2147680516U) /* 0x80030104 */ \ XXX( HRES_STG_E_OLDDLL , 2147680517U) /* 0x80030105 */ \ XXX( HRES_STG_E_SHAREREQUIRED , 2147680518U) /* 0x80030106 */ \ XXX( HRES_STG_E_NOTFILEBASEDSTORAGE , 2147680519U) /* 0x80030107 */ \ XXX( HRES_STG_E_EXTANTMARSHALLINGS , 2147680520U) /* 0x80030108 */ \ XXX( HRES_STG_E_DOCFILECORRUPT , 2147680521U) /* 0x80030109 */ \ XXX( HRES_STG_E_BADBASEADDRESS , 2147680528U) /* 0x80030110 */ \ XXX( HRES_STG_E_DOCFILETOOLARGE , 2147680529U) /* 0x80030111 */ \ XXX( HRES_STG_E_NOTSIMPLEFORMAT , 2147680530U) /* 0x80030112 */ \ XXX( HRES_STG_E_INCOMPLETE , 2147680769U) /* 0x80030201 */ \ XXX( HRES_STG_E_TERMINATED , 2147680770U) /* 0x80030202 */ \ XXX( HRES_STG_E_STATUS_COPY_PROTECTION_FAILURE , 2147681029U) /* 0x80030305 */ \ XXX( HRES_STG_E_CSS_AUTHENTICATION_FAILURE , 2147681030U) /* 0x80030306 */ \ XXX( HRES_STG_E_CSS_KEY_NOT_PRESENT , 2147681031U) /* 0x80030307 */ \ XXX( HRES_STG_E_CSS_KEY_NOT_ESTABLISHED , 2147681032U) /* 0x80030308 */ \ XXX( HRES_STG_E_CSS_SCRAMBLED_SECTOR , 2147681033U) /* 0x80030309 */ \ XXX( HRES_STG_E_CSS_REGION_MISMATCH , 2147681034U) /* 0x8003030a */ \ XXX( HRES_STG_E_RESETS_EXHAUSTED , 2147681035U) /* 0x8003030b */ \ XXX( HRES_OLE_E_OLEVERB , 2147745792U) /* 0x80040000 */ \ XXX( HRES_OLE_E_ADVF , 2147745793U) /* 0x80040001 */ \ XXX( HRES_OLE_E_ENUM_NOMORE , 2147745794U) /* 0x80040002 */ \ XXX( HRES_OLE_E_ADVISENOTSUPPORTED , 2147745795U) /* 0x80040003 */ \ XXX( HRES_OLE_E_NOCONNECTION , 2147745796U) /* 0x80040004 */ \ XXX( HRES_OLE_E_NOTRUNNING , 2147745797U) /* 0x80040005 */ \ XXX( HRES_OLE_E_NOCACHE , 2147745798U) /* 0x80040006 */ \ XXX( HRES_OLE_E_BLANK , 2147745799U) /* 0x80040007 */ \ XXX( HRES_OLE_E_CLASSDIFF , 2147745800U) /* 0x80040008 */ \ XXX( HRES_OLE_E_CANT_GETMONIKER , 2147745801U) /* 0x80040009 */ \ XXX( HRES_OLE_E_CANT_BINDTOSOURCE , 2147745802U) /* 0x8004000a */ \ XXX( HRES_OLE_E_STATIC , 2147745803U) /* 0x8004000b */ \ XXX( HRES_OLE_E_PROMPTSAVECANCELLED , 2147745804U) /* 0x8004000c */ \ XXX( HRES_OLE_E_INVALIDRECT , 2147745805U) /* 0x8004000d */ \ XXX( HRES_OLE_E_WRONGCOMPOBJ , 2147745806U) /* 0x8004000e */ \ XXX( HRES_OLE_E_INVALIDHWND , 2147745807U) /* 0x8004000f */ \ XXX( HRES_OLE_E_NOT_INPLACEACTIVE , 2147745808U) /* 0x80040010 */ \ XXX( HRES_OLE_E_CANTCONVERT , 2147745809U) /* 0x80040011 */ \ XXX( HRES_OLE_E_NOSTORAGE , 2147745810U) /* 0x80040012 */ \ XXX( HRES_DV_E_FORMATETC , 2147745892U) /* 0x80040064 */ \ XXX( HRES_DV_E_DVTARGETDEVICE , 2147745893U) /* 0x80040065 */ \ XXX( HRES_DV_E_STGMEDIUM , 2147745894U) /* 0x80040066 */ \ XXX( HRES_DV_E_STATDATA , 2147745895U) /* 0x80040067 */ \ XXX( HRES_DV_E_LINDEX , 2147745896U) /* 0x80040068 */ \ XXX( HRES_DV_E_TYMED , 2147745897U) /* 0x80040069 */ \ XXX( HRES_DV_E_CLIPFORMAT , 2147745898U) /* 0x8004006a */ \ XXX( HRES_DV_E_DVASPECT , 2147745899U) /* 0x8004006b */ \ XXX( HRES_DV_E_DVTARGETDEVICE_SIZE , 2147745900U) /* 0x8004006c */ \ XXX( HRES_DV_E_NOIVIEWOBJECT , 2147745901U) /* 0x8004006d */ \ XXX( HRES_DRAGDROP_E_NOTREGISTERED , 2147746048U) /* 0x80040100 */ \ XXX( HRES_DRAGDROP_E_ALREADYREGISTERED , 2147746049U) /* 0x80040101 */ \ XXX( HRES_DRAGDROP_E_INVALIDHWND , 2147746050U) /* 0x80040102 */ \ XXX( HRES_CLASS_E_NOAGGREGATION , 2147746064U) /* 0x80040110 */ \ XXX( HRES_CLASS_E_CLASSNOTAVAILABLE , 2147746065U) /* 0x80040111 */ \ XXX( HRES_CLASS_E_NOTLICENSED , 2147746066U) /* 0x80040112 */ \ XXX( HRES_VIEW_E_DRAW , 2147746112U) /* 0x80040140 */ \ XXX( HRES_REGDB_E_READREGDB , 2147746128U) /* 0x80040150 */ \ XXX( HRES_REGDB_E_WRITEREGDB , 2147746129U) /* 0x80040151 */ \ XXX( HRES_REGDB_E_KEYMISSING , 2147746130U) /* 0x80040152 */ \ XXX( HRES_REGDB_E_INVALIDVALUE , 2147746131U) /* 0x80040153 */ \ XXX( HRES_REGDB_E_CLASSNOTREG , 2147746132U) /* 0x80040154 */ \ XXX( HRES_REGDB_E_IIDNOTREG , 2147746133U) /* 0x80040155 */ \ XXX( HRES_REGDB_E_BADTHREADINGMODEL , 2147746134U) /* 0x80040156 */ \ XXX( HRES_CAT_E_CATIDNOEXIST , 2147746144U) /* 0x80040160 */ \ XXX( HRES_CAT_E_NODESCRIPTION , 2147746145U) /* 0x80040161 */ \ XXX( HRES_CS_E_PACKAGE_NOTFOUND , 2147746148U) /* 0x80040164 */ \ XXX( HRES_CS_E_NOT_DELETABLE , 2147746149U) /* 0x80040165 */ \ XXX( HRES_CS_E_CLASS_NOTFOUND , 2147746150U) /* 0x80040166 */ \ XXX( HRES_CS_E_INVALID_VERSION , 2147746151U) /* 0x80040167 */ \ XXX( HRES_CS_E_NO_CLASSSTORE , 2147746152U) /* 0x80040168 */ \ XXX( HRES_CS_E_OBJECT_NOTFOUND , 2147746153U) /* 0x80040169 */ \ XXX( HRES_CS_E_OBJECT_ALREADY_EXISTS , 2147746154U) /* 0x8004016a */ \ XXX( HRES_CS_E_INVALID_PATH , 2147746155U) /* 0x8004016b */ \ XXX( HRES_CS_E_NETWORK_ERROR , 2147746156U) /* 0x8004016c */ \ XXX( HRES_CS_E_ADMIN_LIMIT_EXCEEDED , 2147746157U) /* 0x8004016d */ \ XXX( HRES_CS_E_SCHEMA_MISMATCH , 2147746158U) /* 0x8004016e */ \ XXX( HRES_CS_E_INTERNAL_ERROR , 2147746159U) /* 0x8004016f */ \ XXX( HRES_CACHE_E_NOCACHE_UPDATED , 2147746160U) /* 0x80040170 */ \ XXX( HRES_OLEOBJ_E_NOVERBS , 2147746176U) /* 0x80040180 */ \ XXX( HRES_OLEOBJ_E_INVALIDVERB , 2147746177U) /* 0x80040181 */ \ XXX( HRES_INPLACE_E_NOTUNDOABLE , 2147746208U) /* 0x800401a0 */ \ XXX( HRES_INPLACE_E_NOTOOLSPACE , 2147746209U) /* 0x800401a1 */ \ XXX( HRES_CONVERT10_E_OLESTREAM_GET , 2147746240U) /* 0x800401c0 */ \ XXX( HRES_CONVERT10_E_OLESTREAM_PUT , 2147746241U) /* 0x800401c1 */ \ XXX( HRES_CONVERT10_E_OLESTREAM_FMT , 2147746242U) /* 0x800401c2 */ \ XXX( HRES_CONVERT10_E_OLESTREAM_BITMAP_TO_DIB , 2147746243U) /* 0x800401c3 */ \ XXX( HRES_CONVERT10_E_STG_FMT , 2147746244U) /* 0x800401c4 */ \ XXX( HRES_CONVERT10_E_STG_NO_STD_STREAM , 2147746245U) /* 0x800401c5 */ \ XXX( HRES_CONVERT10_E_STG_DIB_TO_BITMAP , 2147746246U) /* 0x800401c6 */ \ XXX( HRES_CLIPBRD_E_CANT_OPEN , 2147746256U) /* 0x800401d0 */ \ XXX( HRES_CLIPBRD_E_CANT_EMPTY , 2147746257U) /* 0x800401d1 */ \ XXX( HRES_CLIPBRD_E_CANT_SET , 2147746258U) /* 0x800401d2 */ \ XXX( HRES_CLIPBRD_E_BAD_DATA , 2147746259U) /* 0x800401d3 */ \ XXX( HRES_CLIPBRD_E_CANT_CLOSE , 2147746260U) /* 0x800401d4 */ \ XXX( HRES_MK_E_CONNECTMANUALLY , 2147746272U) /* 0x800401e0 */ \ XXX( HRES_MK_E_EXCEEDEDDEADLINE , 2147746273U) /* 0x800401e1 */ \ XXX( HRES_MK_E_NEEDGENERIC , 2147746274U) /* 0x800401e2 */ \ XXX( HRES_MK_E_UNAVAILABLE , 2147746275U) /* 0x800401e3 */ \ XXX( HRES_MK_E_SYNTAX , 2147746276U) /* 0x800401e4 */ \ XXX( HRES_MK_E_NOOBJECT , 2147746277U) /* 0x800401e5 */ \ XXX( HRES_MK_E_INVALIDEXTENSION , 2147746278U) /* 0x800401e6 */ \ XXX( HRES_MK_E_INTERMEDIATEINTERFACENOTSUPPORTED , 2147746279U) /* 0x800401e7 */ \ XXX( HRES_MK_E_NOTBINDABLE , 2147746280U) /* 0x800401e8 */ \ XXX( HRES_MK_E_NOTBOUND , 2147746281U) /* 0x800401e9 */ \ XXX( HRES_MK_E_CANTOPENFILE , 2147746282U) /* 0x800401ea */ \ XXX( HRES_MK_E_MUSTBOTHERUSER , 2147746283U) /* 0x800401eb */ \ XXX( HRES_MK_E_NOINVERSE , 2147746284U) /* 0x800401ec */ \ XXX( HRES_MK_E_NOSTORAGE , 2147746285U) /* 0x800401ed */ \ XXX( HRES_MK_E_NOPREFIX , 2147746286U) /* 0x800401ee */ \ XXX( HRES_MK_E_ENUMERATION_FAILED , 2147746287U) /* 0x800401ef */ \ XXX( HRES_CO_E_NOTINITIALIZED , 2147746288U) /* 0x800401f0 */ \ XXX( HRES_CO_E_ALREADYINITIALIZED , 2147746289U) /* 0x800401f1 */ \ XXX( HRES_CO_E_CANTDETERMINECLASS , 2147746290U) /* 0x800401f2 */ \ XXX( HRES_CO_E_CLASSSTRING , 2147746291U) /* 0x800401f3 */ \ XXX( HRES_CO_E_IIDSTRING , 2147746292U) /* 0x800401f4 */ \ XXX( HRES_CO_E_APPNOTFOUND , 2147746293U) /* 0x800401f5 */ \ XXX( HRES_CO_E_APPSINGLEUSE , 2147746294U) /* 0x800401f6 */ \ XXX( HRES_CO_E_ERRORINAPP , 2147746295U) /* 0x800401f7 */ \ XXX( HRES_CO_E_DLLNOTFOUND , 2147746296U) /* 0x800401f8 */ \ XXX( HRES_CO_E_ERRORINDLL , 2147746297U) /* 0x800401f9 */ \ XXX( HRES_CO_E_WRONGOSFORAPP , 2147746298U) /* 0x800401fa */ \ XXX( HRES_CO_E_OBJNOTREG , 2147746299U) /* 0x800401fb */ \ XXX( HRES_CO_E_OBJISREG , 2147746300U) /* 0x800401fc */ \ XXX( HRES_CO_E_OBJNOTCONNECTED , 2147746301U) /* 0x800401fd */ \ XXX( HRES_CO_E_APPDIDNTREG , 2147746302U) /* 0x800401fe */ \ XXX( HRES_CO_E_RELEASED , 2147746303U) /* 0x800401ff */ \ XXX( HRES_EVENT_E_ALL_SUBSCRIBERS_FAILED , 2147746305U) /* 0x80040201 */ \ XXX( HRES_EVENT_E_QUERYSYNTAX , 2147746307U) /* 0x80040203 */ \ XXX( HRES_EVENT_E_QUERYFIELD , 2147746308U) /* 0x80040204 */ \ XXX( HRES_EVENT_E_INTERNALEXCEPTION , 2147746309U) /* 0x80040205 */ \ XXX( HRES_EVENT_E_INTERNALERROR , 2147746310U) /* 0x80040206 */ \ XXX( HRES_EVENT_E_INVALID_PER_USER_SID , 2147746311U) /* 0x80040207 */ \ XXX( HRES_EVENT_E_USER_EXCEPTION , 2147746312U) /* 0x80040208 */ \ XXX( HRES_EVENT_E_TOO_MANY_METHODS , 2147746313U) /* 0x80040209 */ \ XXX( HRES_EVENT_E_MISSING_EVENTCLASS , 2147746314U) /* 0x8004020a */ \ XXX( HRES_EVENT_E_NOT_ALL_REMOVED , 2147746315U) /* 0x8004020b */ \ XXX( HRES_EVENT_E_COMPLUS_NOT_INSTALLED , 2147746316U) /* 0x8004020c */ \ XXX( HRES_EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT, 2147746317U) /* 0x8004020d */ \ XXX( HRES_EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT, 2147746318U) /* 0x8004020e */ \ XXX( HRES_EVENT_E_INVALID_EVENT_CLASS_PARTITION , 2147746319U) /* 0x8004020f */ \ XXX( HRES_EVENT_E_PER_USER_SID_NOT_LOGGED_ON , 2147746320U) /* 0x80040210 */ \ XXX( HRES_SCHED_E_TRIGGER_NOT_FOUND , 2147750665U) /* 0x80041309 */ \ XXX( HRES_SCHED_E_TASK_NOT_READY , 2147750666U) /* 0x8004130a */ \ XXX( HRES_SCHED_E_TASK_NOT_RUNNING , 2147750667U) /* 0x8004130b */ \ XXX( HRES_SCHED_E_SERVICE_NOT_INSTALLED , 2147750668U) /* 0x8004130c */ \ XXX( HRES_SCHED_E_CANNOT_OPEN_TASK , 2147750669U) /* 0x8004130d */ \ XXX( HRES_SCHED_E_INVALID_TASK , 2147750670U) /* 0x8004130e */ \ XXX( HRES_SCHED_E_ACCOUNT_INFORMATION_NOT_SET , 2147750671U) /* 0x8004130f */ \ XXX( HRES_SCHED_E_ACCOUNT_NAME_NOT_FOUND , 2147750672U) /* 0x80041310 */ \ XXX( HRES_SCHED_E_ACCOUNT_DBASE_CORRUPT , 2147750673U) /* 0x80041311 */ \ XXX( HRES_SCHED_E_NO_SECURITY_SERVICES , 2147750674U) /* 0x80041312 */ \ XXX( HRES_SCHED_E_UNKNOWN_OBJECT_VERSION , 2147750675U) /* 0x80041313 */ \ XXX( HRES_SCHED_E_UNSUPPORTED_ACCOUNT_OPTION , 2147750676U) /* 0x80041314 */ \ XXX( HRES_SCHED_E_SERVICE_NOT_RUNNING , 2147750677U) /* 0x80041315 */ \ XXX( HRES_SCHED_E_UNEXPECTEDNODE , 2147750678U) /* 0x80041316 */ \ XXX( HRES_SCHED_E_NAMESPACE , 2147750679U) /* 0x80041317 */ \ XXX( HRES_SCHED_E_INVALIDVALUE , 2147750680U) /* 0x80041318 */ \ XXX( HRES_SCHED_E_MISSINGNODE , 2147750681U) /* 0x80041319 */ \ XXX( HRES_SCHED_E_MALFORMEDXML , 2147750682U) /* 0x8004131a */ \ XXX( HRES_SCHED_E_TOO_MANY_NODES , 2147750685U) /* 0x8004131d */ \ XXX( HRES_SCHED_E_PAST_END_BOUNDARY , 2147750686U) /* 0x8004131e */ \ XXX( HRES_SCHED_E_ALREADY_RUNNING , 2147750687U) /* 0x8004131f */ \ XXX( HRES_SCHED_E_USER_NOT_LOGGED_ON , 2147750688U) /* 0x80041320 */ \ XXX( HRES_SCHED_E_INVALID_TASK_HASH , 2147750689U) /* 0x80041321 */ \ XXX( HRES_SCHED_E_SERVICE_NOT_AVAILABLE , 2147750690U) /* 0x80041322 */ \ XXX( HRES_SCHED_E_SERVICE_TOO_BUSY , 2147750691U) /* 0x80041323 */ \ XXX( HRES_SCHED_E_TASK_ATTEMPTED , 2147750692U) /* 0x80041324 */ \ XXX( HRES_XACT_E_ALREADYOTHERSINGLEPHASE , 2147799040U) /* 0x8004d000 */ \ XXX( HRES_XACT_E_CANTRETAIN , 2147799041U) /* 0x8004d001 */ \ XXX( HRES_XACT_E_COMMITFAILED , 2147799042U) /* 0x8004d002 */ \ XXX( HRES_XACT_E_COMMITPREVENTED , 2147799043U) /* 0x8004d003 */ \ XXX( HRES_XACT_E_HEURISTICABORT , 2147799044U) /* 0x8004d004 */ \ XXX( HRES_XACT_E_HEURISTICCOMMIT , 2147799045U) /* 0x8004d005 */ \ XXX( HRES_XACT_E_HEURISTICDAMAGE , 2147799046U) /* 0x8004d006 */ \ XXX( HRES_XACT_E_HEURISTICDANGER , 2147799047U) /* 0x8004d007 */ \ XXX( HRES_XACT_E_ISOLATIONLEVEL , 2147799048U) /* 0x8004d008 */ \ XXX( HRES_XACT_E_NOASYNC , 2147799049U) /* 0x8004d009 */ \ XXX( HRES_XACT_E_NOENLIST , 2147799050U) /* 0x8004d00a */ \ XXX( HRES_XACT_E_NOISORETAIN , 2147799051U) /* 0x8004d00b */ \ XXX( HRES_XACT_E_NORESOURCE , 2147799052U) /* 0x8004d00c */ \ XXX( HRES_XACT_E_NOTCURRENT , 2147799053U) /* 0x8004d00d */ \ XXX( HRES_XACT_E_NOTRANSACTION , 2147799054U) /* 0x8004d00e */ \ XXX( HRES_XACT_E_NOTSUPPORTED , 2147799055U) /* 0x8004d00f */ \ XXX( HRES_XACT_E_UNKNOWNRMGRID , 2147799056U) /* 0x8004d010 */ \ XXX( HRES_XACT_E_WRONGSTATE , 2147799057U) /* 0x8004d011 */ \ XXX( HRES_XACT_E_WRONGUOW , 2147799058U) /* 0x8004d012 */ \ XXX( HRES_XACT_E_XTIONEXISTS , 2147799059U) /* 0x8004d013 */ \ XXX( HRES_XACT_E_NOIMPORTOBJECT , 2147799060U) /* 0x8004d014 */ \ XXX( HRES_XACT_E_INVALIDCOOKIE , 2147799061U) /* 0x8004d015 */ \ XXX( HRES_XACT_E_INDOUBT , 2147799062U) /* 0x8004d016 */ \ XXX( HRES_XACT_E_NOTIMEOUT , 2147799063U) /* 0x8004d017 */ \ XXX( HRES_XACT_E_ALREADYINPROGRESS , 2147799064U) /* 0x8004d018 */ \ XXX( HRES_XACT_E_ABORTED , 2147799065U) /* 0x8004d019 */ \ XXX( HRES_XACT_E_LOGFULL , 2147799066U) /* 0x8004d01a */ \ XXX( HRES_XACT_E_TMNOTAVAILABLE , 2147799067U) /* 0x8004d01b */ \ XXX( HRES_XACT_E_CONNECTION_DOWN , 2147799068U) /* 0x8004d01c */ \ XXX( HRES_XACT_E_CONNECTION_DENIED , 2147799069U) /* 0x8004d01d */ \ XXX( HRES_XACT_E_REENLISTTIMEOUT , 2147799070U) /* 0x8004d01e */ \ XXX( HRES_XACT_E_TIP_CONNECT_FAILED , 2147799071U) /* 0x8004d01f */ \ XXX( HRES_XACT_E_TIP_PROTOCOL_ERROR , 2147799072U) /* 0x8004d020 */ \ XXX( HRES_XACT_E_TIP_PULL_FAILED , 2147799073U) /* 0x8004d021 */ \ XXX( HRES_XACT_E_DEST_TMNOTAVAILABLE , 2147799074U) /* 0x8004d022 */ \ XXX( HRES_XACT_E_TIP_DISABLED , 2147799075U) /* 0x8004d023 */ \ XXX( HRES_XACT_E_NETWORK_TX_DISABLED , 2147799076U) /* 0x8004d024 */ \ XXX( HRES_XACT_E_PARTNER_NETWORK_TX_DISABLED , 2147799077U) /* 0x8004d025 */ \ XXX( HRES_XACT_E_XA_TX_DISABLED , 2147799078U) /* 0x8004d026 */ \ XXX( HRES_XACT_E_UNABLE_TO_READ_DTC_CONFIG , 2147799079U) /* 0x8004d027 */ \ XXX( HRES_XACT_E_UNABLE_TO_LOAD_DTC_PROXY , 2147799080U) /* 0x8004d028 */ \ XXX( HRES_XACT_E_ABORTING , 2147799081U) /* 0x8004d029 */ \ XXX( HRES_XACT_E_CLERKNOTFOUND , 2147799168U) /* 0x8004d080 */ \ XXX( HRES_XACT_E_CLERKEXISTS , 2147799169U) /* 0x8004d081 */ \ XXX( HRES_XACT_E_RECOVERYINPROGRESS , 2147799170U) /* 0x8004d082 */ \ XXX( HRES_XACT_E_TRANSACTIONCLOSED , 2147799171U) /* 0x8004d083 */ \ XXX( HRES_XACT_E_INVALIDLSN , 2147799172U) /* 0x8004d084 */ \ XXX( HRES_XACT_E_REPLAYREQUEST , 2147799173U) /* 0x8004d085 */ \ XXX( HRES_XACT_E_CONNECTION_REQUEST_DENIED , 2147799296U) /* 0x8004d100 */ \ XXX( HRES_XACT_E_TOOMANY_ENLISTMENTS , 2147799297U) /* 0x8004d101 */ \ XXX( HRES_XACT_E_DUPLICATE_GUID , 2147799298U) /* 0x8004d102 */ \ XXX( HRES_XACT_E_NOTSINGLEPHASE , 2147799299U) /* 0x8004d103 */ \ XXX( HRES_XACT_E_RECOVERYALREADYDONE , 2147799300U) /* 0x8004d104 */ \ XXX( HRES_XACT_E_PROTOCOL , 2147799301U) /* 0x8004d105 */ \ XXX( HRES_XACT_E_RM_FAILURE , 2147799302U) /* 0x8004d106 */ \ XXX( HRES_XACT_E_RECOVERY_FAILED , 2147799303U) /* 0x8004d107 */ \ XXX( HRES_XACT_E_LU_NOT_FOUND , 2147799304U) /* 0x8004d108 */ \ XXX( HRES_XACT_E_DUPLICATE_LU , 2147799305U) /* 0x8004d109 */ \ XXX( HRES_XACT_E_LU_NOT_CONNECTED , 2147799306U) /* 0x8004d10a */ \ XXX( HRES_XACT_E_DUPLICATE_TRANSID , 2147799307U) /* 0x8004d10b */ \ XXX( HRES_XACT_E_LU_BUSY , 2147799308U) /* 0x8004d10c */ \ XXX( HRES_XACT_E_LU_NO_RECOVERY_PROCESS , 2147799309U) /* 0x8004d10d */ \ XXX( HRES_XACT_E_LU_DOWN , 2147799310U) /* 0x8004d10e */ \ XXX( HRES_XACT_E_LU_RECOVERING , 2147799311U) /* 0x8004d10f */ \ XXX( HRES_XACT_E_LU_RECOVERY_MISMATCH , 2147799312U) /* 0x8004d110 */ \ XXX( HRES_XACT_E_RM_UNAVAILABLE , 2147799313U) /* 0x8004d111 */ \ XXX( HRES_CONTEXT_E_ABORTED , 2147803138U) /* 0x8004e002 */ \ XXX( HRES_CONTEXT_E_ABORTING , 2147803139U) /* 0x8004e003 */ \ XXX( HRES_CONTEXT_E_NOCONTEXT , 2147803140U) /* 0x8004e004 */ \ XXX( HRES_CONTEXT_E_WOULD_DEADLOCK , 2147803141U) /* 0x8004e005 */ \ XXX( HRES_CONTEXT_E_SYNCH_TIMEOUT , 2147803142U) /* 0x8004e006 */ \ XXX( HRES_CONTEXT_E_OLDREF , 2147803143U) /* 0x8004e007 */ \ XXX( HRES_CONTEXT_E_ROLENOTFOUND , 2147803148U) /* 0x8004e00c */ \ XXX( HRES_CONTEXT_E_TMNOTAVAILABLE , 2147803151U) /* 0x8004e00f */ \ XXX( HRES_CO_E_ACTIVATIONFAILED , 2147803169U) /* 0x8004e021 */ \ XXX( HRES_CO_E_ACTIVATIONFAILED_EVENTLOGGED , 2147803170U) /* 0x8004e022 */ \ XXX( HRES_CO_E_ACTIVATIONFAILED_CATALOGERROR , 2147803171U) /* 0x8004e023 */ \ XXX( HRES_CO_E_ACTIVATIONFAILED_TIMEOUT , 2147803172U) /* 0x8004e024 */ \ XXX( HRES_CO_E_INITIALIZATIONFAILED , 2147803173U) /* 0x8004e025 */ \ XXX( HRES_CONTEXT_E_NOJIT , 2147803174U) /* 0x8004e026 */ \ XXX( HRES_CONTEXT_E_NOTRANSACTION , 2147803175U) /* 0x8004e027 */ \ XXX( HRES_CO_E_THREADINGMODEL_CHANGED , 2147803176U) /* 0x8004e028 */ \ XXX( HRES_CO_E_NOIISINTRINSICS , 2147803177U) /* 0x8004e029 */ \ XXX( HRES_CO_E_NOCOOKIES , 2147803178U) /* 0x8004e02a */ \ XXX( HRES_CO_E_DBERROR , 2147803179U) /* 0x8004e02b */ \ XXX( HRES_CO_E_NOTPOOLED , 2147803180U) /* 0x8004e02c */ \ XXX( HRES_CO_E_NOTCONSTRUCTED , 2147803181U) /* 0x8004e02d */ \ XXX( HRES_CO_E_NOSYNCHRONIZATION , 2147803182U) /* 0x8004e02e */ \ XXX( HRES_CO_E_ISOLEVELMISMATCH , 2147803183U) /* 0x8004e02f */ \ XXX( HRES_CO_E_CALL_OUT_OF_TX_SCOPE_NOT_ALLOWED , 2147803184U) /* 0x8004e030 */ \ XXX( HRES_CO_E_EXIT_TRANSACTION_SCOPE_NOT_CALLED , 2147803185U) /* 0x8004e031 */ \ XXX( HRES_E_ACCESSDENIED , 2147942405U) /* 0x80070005 */ \ XXX( HRES_E_OUTOFMEMORY , 2147942414U) /* 0x8007000e */ \ XXX( HRES_ERROR_NOT_SUPPORTED , 2147942450U) /* 0x80070032 */ \ XXX( HRES_E_INVALIDARG , 2147942487U) /* 0x80070057 */ \ XXX( HRES_CO_E_CLASS_CREATE_FAILED , 2148007937U) /* 0x80080001 */ \ XXX( HRES_CO_E_SCM_ERROR , 2148007938U) /* 0x80080002 */ \ XXX( HRES_CO_E_SCM_RPC_FAILURE , 2148007939U) /* 0x80080003 */ \ XXX( HRES_CO_E_BAD_PATH , 2148007940U) /* 0x80080004 */ \ XXX( HRES_CO_E_SERVER_EXEC_FAILURE , 2148007941U) /* 0x80080005 */ \ XXX( HRES_CO_E_OBJSRV_RPC_FAILURE , 2148007942U) /* 0x80080006 */ \ XXX( HRES_MK_E_NO_NORMALIZED , 2148007943U) /* 0x80080007 */ \ XXX( HRES_CO_E_SERVER_STOPPING , 2148007944U) /* 0x80080008 */ \ XXX( HRES_MEM_E_INVALID_ROOT , 2148007945U) /* 0x80080009 */ \ XXX( HRES_MEM_E_INVALID_LINK , 2148007952U) /* 0x80080010 */ \ XXX( HRES_MEM_E_INVALID_SIZE , 2148007953U) /* 0x80080011 */ \ XXX( HRES_CO_E_MISSING_DISPLAYNAME , 2148007957U) /* 0x80080015 */ \ XXX( HRES_CO_E_RUNAS_VALUE_MUST_BE_AAA , 2148007958U) /* 0x80080016 */ \ XXX( HRES_CO_E_ELEVATION_DISABLED , 2148007959U) /* 0x80080017 */ \ XXX( HRES_NTE_BAD_UID , 2148073473U) /* 0x80090001 */ \ XXX( HRES_NTE_BAD_HASH , 2148073474U) /* 0x80090002 */ \ XXX( HRES_NTE_BAD_KEY , 2148073475U) /* 0x80090003 */ \ XXX( HRES_NTE_BAD_LEN , 2148073476U) /* 0x80090004 */ \ XXX( HRES_NTE_BAD_DATA , 2148073477U) /* 0x80090005 */ \ XXX( HRES_NTE_BAD_SIGNATURE , 2148073478U) /* 0x80090006 */ \ XXX( HRES_NTE_BAD_VER , 2148073479U) /* 0x80090007 */ \ XXX( HRES_NTE_BAD_ALGID , 2148073480U) /* 0x80090008 */ \ XXX( HRES_NTE_BAD_FLAGS , 2148073481U) /* 0x80090009 */ \ XXX( HRES_NTE_BAD_TYPE , 2148073482U) /* 0x8009000a */ \ XXX( HRES_NTE_BAD_KEY_STATE , 2148073483U) /* 0x8009000b */ \ XXX( HRES_NTE_BAD_HASH_STATE , 2148073484U) /* 0x8009000c */ \ XXX( HRES_NTE_NO_KEY , 2148073485U) /* 0x8009000d */ \ XXX( HRES_NTE_NO_MEMORY , 2148073486U) /* 0x8009000e */ \ XXX( HRES_NTE_EXISTS , 2148073487U) /* 0x8009000f */ \ XXX( HRES_NTE_PERM , 2148073488U) /* 0x80090010 */ \ XXX( HRES_NTE_NOT_FOUND , 2148073489U) /* 0x80090011 */ \ XXX( HRES_NTE_DOUBLE_ENCRYPT , 2148073490U) /* 0x80090012 */ \ XXX( HRES_NTE_BAD_PROVIDER , 2148073491U) /* 0x80090013 */ \ XXX( HRES_NTE_BAD_PROV_TYPE , 2148073492U) /* 0x80090014 */ \ XXX( HRES_NTE_BAD_PUBLIC_KEY , 2148073493U) /* 0x80090015 */ \ XXX( HRES_NTE_BAD_KEYSET , 2148073494U) /* 0x80090016 */ \ XXX( HRES_NTE_PROV_TYPE_NOT_DEF , 2148073495U) /* 0x80090017 */ \ XXX( HRES_NTE_PROV_TYPE_ENTRY_BAD , 2148073496U) /* 0x80090018 */ \ XXX( HRES_NTE_KEYSET_NOT_DEF , 2148073497U) /* 0x80090019 */ \ XXX( HRES_NTE_KEYSET_ENTRY_BAD , 2148073498U) /* 0x8009001a */ \ XXX( HRES_NTE_PROV_TYPE_NO_MATCH , 2148073499U) /* 0x8009001b */ \ XXX( HRES_NTE_SIGNATURE_FILE_BAD , 2148073500U) /* 0x8009001c */ \ XXX( HRES_NTE_PROVIDER_DLL_FAIL , 2148073501U) /* 0x8009001d */ \ XXX( HRES_NTE_PROV_DLL_NOT_FOUND , 2148073502U) /* 0x8009001e */ \ XXX( HRES_NTE_BAD_KEYSET_PARAM , 2148073503U) /* 0x8009001f */ \ XXX( HRES_NTE_FAIL , 2148073504U) /* 0x80090020 */ \ XXX( HRES_NTE_SYS_ERR , 2148073505U) /* 0x80090021 */ \ XXX( HRES_NTE_SILENT_CONTEXT , 2148073506U) /* 0x80090022 */ \ XXX( HRES_NTE_TOKEN_KEYSET_STORAGE_FULL , 2148073507U) /* 0x80090023 */ \ XXX( HRES_NTE_TEMPORARY_PROFILE , 2148073508U) /* 0x80090024 */ \ XXX( HRES_NTE_FIXEDPARAMETER , 2148073509U) /* 0x80090025 */ \ XXX( HRES_NTE_INVALID_HANDLE , 2148073510U) /* 0x80090026 */ \ XXX( HRES_NTE_INVALID_PARAMETER , 2148073511U) /* 0x80090027 */ \ XXX( HRES_NTE_BUFFER_TOO_SMALL , 2148073512U) /* 0x80090028 */ \ XXX( HRES_NTE_NOT_SUPPORTED , 2148073513U) /* 0x80090029 */ \ XXX( HRES_NTE_NO_MORE_ITEMS , 2148073514U) /* 0x8009002a */ \ XXX( HRES_NTE_BUFFERS_OVERLAP , 2148073515U) /* 0x8009002b */ \ XXX( HRES_NTE_DECRYPTION_FAILURE , 2148073516U) /* 0x8009002c */ \ XXX( HRES_NTE_INTERNAL_ERROR , 2148073517U) /* 0x8009002d */ \ XXX( HRES_NTE_UI_REQUIRED , 2148073518U) /* 0x8009002e */ \ XXX( HRES_NTE_HMAC_NOT_SUPPORTED , 2148073519U) /* 0x8009002f */ \ XXX( HRES_SEC_E_INSUFFICIENT_MEMORY , 2148074240U) /* 0x80090300 */ \ XXX( HRES_SEC_E_INVALID_HANDLE , 2148074241U) /* 0x80090301 */ \ XXX( HRES_SEC_E_UNSUPPORTED_FUNCTION , 2148074242U) /* 0x80090302 */ \ XXX( HRES_SEC_E_TARGET_UNKNOWN , 2148074243U) /* 0x80090303 */ \ XXX( HRES_SEC_E_INTERNAL_ERROR , 2148074244U) /* 0x80090304 */ \ XXX( HRES_SEC_E_SECPKG_NOT_FOUND , 2148074245U) /* 0x80090305 */ \ XXX( HRES_SEC_E_NOT_OWNER , 2148074246U) /* 0x80090306 */ \ XXX( HRES_SEC_E_CANNOT_INSTALL , 2148074247U) /* 0x80090307 */ \ XXX( HRES_SEC_E_INVALID_TOKEN , 2148074248U) /* 0x80090308 */ \ XXX( HRES_SEC_E_CANNOT_PACK , 2148074249U) /* 0x80090309 */ \ XXX( HRES_SEC_E_QOP_NOT_SUPPORTED , 2148074250U) /* 0x8009030a */ \ XXX( HRES_SEC_E_NO_IMPERSONATION , 2148074251U) /* 0x8009030b */ \ XXX( HRES_SEC_E_LOGON_DENIED , 2148074252U) /* 0x8009030c */ \ XXX( HRES_SEC_E_UNKNOWN_CREDENTIALS , 2148074253U) /* 0x8009030d */ \ XXX( HRES_SEC_E_NO_CREDENTIALS , 2148074254U) /* 0x8009030e */ \ XXX( HRES_SEC_E_MESSAGE_ALTERED , 2148074255U) /* 0x8009030f */ \ XXX( HRES_SEC_E_OUT_OF_SEQUENCE , 2148074256U) /* 0x80090310 */ \ XXX( HRES_SEC_E_NO_AUTHENTICATING_AUTHORITY , 2148074257U) /* 0x80090311 */ \ XXX( HRES_SEC_E_BAD_PKGID , 2148074262U) /* 0x80090316 */ \ XXX( HRES_SEC_E_CONTEXT_EXPIRED , 2148074263U) /* 0x80090317 */ \ XXX( HRES_SEC_E_INCOMPLETE_MESSAGE , 2148074264U) /* 0x80090318 */ \ XXX( HRES_SEC_E_INCOMPLETE_CREDENTIALS , 2148074272U) /* 0x80090320 */ \ XXX( HRES_SEC_E_BUFFER_TOO_SMALL , 2148074273U) /* 0x80090321 */ \ XXX( HRES_SEC_E_WRONG_PRINCIPAL , 2148074274U) /* 0x80090322 */ \ XXX( HRES_SEC_E_TIME_SKEW , 2148074276U) /* 0x80090324 */ \ XXX( HRES_SEC_E_UNTRUSTED_ROOT , 2148074277U) /* 0x80090325 */ \ XXX( HRES_SEC_E_ILLEGAL_MESSAGE , 2148074278U) /* 0x80090326 */ \ XXX( HRES_SEC_E_CERT_UNKNOWN , 2148074279U) /* 0x80090327 */ \ XXX( HRES_SEC_E_CERT_EXPIRED , 2148074280U) /* 0x80090328 */ \ XXX( HRES_SEC_E_ENCRYPT_FAILURE , 2148074281U) /* 0x80090329 */ \ XXX( HRES_SEC_E_DECRYPT_FAILURE , 2148074288U) /* 0x80090330 */ \ XXX( HRES_SEC_E_ALGORITHM_MISMATCH , 2148074289U) /* 0x80090331 */ \ XXX( HRES_SEC_E_SECURITY_QOS_FAILED , 2148074290U) /* 0x80090332 */ \ XXX( HRES_SEC_E_UNFINISHED_CONTEXT_DELETED , 2148074291U) /* 0x80090333 */ \ XXX( HRES_SEC_E_NO_TGT_REPLY , 2148074292U) /* 0x80090334 */ \ XXX( HRES_SEC_E_NO_IP_ADDRESSES , 2148074293U) /* 0x80090335 */ \ XXX( HRES_SEC_E_WRONG_CREDENTIAL_HANDLE , 2148074294U) /* 0x80090336 */ \ XXX( HRES_SEC_E_CRYPTO_SYSTEM_INVALID , 2148074295U) /* 0x80090337 */ \ XXX( HRES_SEC_E_MAX_REFERRALS_EXCEEDED , 2148074296U) /* 0x80090338 */ \ XXX( HRES_SEC_E_MUST_BE_KDC , 2148074297U) /* 0x80090339 */ \ XXX( HRES_SEC_E_STRONG_CRYPTO_NOT_SUPPORTED , 2148074298U) /* 0x8009033a */ \ XXX( HRES_SEC_E_TOO_MANY_PRINCIPALS , 2148074299U) /* 0x8009033b */ \ XXX( HRES_SEC_E_NO_PA_DATA , 2148074300U) /* 0x8009033c */ \ XXX( HRES_SEC_E_PKINIT_NAME_MISMATCH , 2148074301U) /* 0x8009033d */ \ XXX( HRES_SEC_E_SMARTCARD_LOGON_REQUIRED , 2148074302U) /* 0x8009033e */ \ XXX( HRES_SEC_E_SHUTDOWN_IN_PROGRESS , 2148074303U) /* 0x8009033f */ \ XXX( HRES_SEC_E_KDC_INVALID_REQUEST , 2148074304U) /* 0x80090340 */ \ XXX( HRES_SEC_E_KDC_UNABLE_TO_REFER , 2148074305U) /* 0x80090341 */ \ XXX( HRES_SEC_E_KDC_UNKNOWN_ETYPE , 2148074306U) /* 0x80090342 */ \ XXX( HRES_SEC_E_UNSUPPORTED_PREAUTH , 2148074307U) /* 0x80090343 */ \ XXX( HRES_SEC_E_DELEGATION_REQUIRED , 2148074309U) /* 0x80090345 */ \ XXX( HRES_SEC_E_BAD_BINDINGS , 2148074310U) /* 0x80090346 */ \ XXX( HRES_SEC_E_MULTIPLE_ACCOUNTS , 2148074311U) /* 0x80090347 */ \ XXX( HRES_SEC_E_NO_KERB_KEY , 2148074312U) /* 0x80090348 */ \ XXX( HRES_SEC_E_CERT_WRONG_USAGE , 2148074313U) /* 0x80090349 */ \ XXX( HRES_SEC_E_DOWNGRADE_DETECTED , 2148074320U) /* 0x80090350 */ \ XXX( HRES_SEC_E_SMARTCARD_CERT_REVOKED , 2148074321U) /* 0x80090351 */ \ XXX( HRES_SEC_E_ISSUING_CA_UNTRUSTED , 2148074322U) /* 0x80090352 */ \ XXX( HRES_SEC_E_REVOCATION_OFFLINE_C , 2148074323U) /* 0x80090353 */ \ XXX( HRES_SEC_E_PKINIT_CLIENT_FAILURE , 2148074324U) /* 0x80090354 */ \ XXX( HRES_SEC_E_SMARTCARD_CERT_EXPIRED , 2148074325U) /* 0x80090355 */ \ XXX( HRES_SEC_E_NO_S4U_PROT_SUPPORT , 2148074326U) /* 0x80090356 */ \ XXX( HRES_SEC_E_CROSSREALM_DELEGATION_FAILURE , 2148074327U) /* 0x80090357 */ \ XXX( HRES_SEC_E_REVOCATION_OFFLINE_KDC , 2148074328U) /* 0x80090358 */ \ XXX( HRES_SEC_E_ISSUING_CA_UNTRUSTED_KDC , 2148074329U) /* 0x80090359 */ \ XXX( HRES_SEC_E_KDC_CERT_EXPIRED , 2148074330U) /* 0x8009035a */ \ XXX( HRES_SEC_E_KDC_CERT_REVOKED , 2148074331U) /* 0x8009035b */ \ XXX( HRES_SEC_E_INVALID_PARAMETER , 2148074333U) /* 0x8009035d */ \ XXX( HRES_SEC_E_DELEGATION_POLICY , 2148074334U) /* 0x8009035e */ \ XXX( HRES_SEC_E_POLICY_NLTM_ONLY , 2148074335U) /* 0x8009035f */ \ XXX( HRES_CRYPT_E_MSG_ERROR , 2148077569U) /* 0x80091001 */ \ XXX( HRES_CRYPT_E_UNKNOWN_ALGO , 2148077570U) /* 0x80091002 */ \ XXX( HRES_CRYPT_E_OID_FORMAT , 2148077571U) /* 0x80091003 */ \ XXX( HRES_CRYPT_E_INVALID_MSG_TYPE , 2148077572U) /* 0x80091004 */ \ XXX( HRES_CRYPT_E_UNEXPECTED_ENCODING , 2148077573U) /* 0x80091005 */ \ XXX( HRES_CRYPT_E_AUTH_ATTR_MISSING , 2148077574U) /* 0x80091006 */ \ XXX( HRES_CRYPT_E_HASH_VALUE , 2148077575U) /* 0x80091007 */ \ XXX( HRES_CRYPT_E_INVALID_INDEX , 2148077576U) /* 0x80091008 */ \ XXX( HRES_CRYPT_E_ALREADY_DECRYPTED , 2148077577U) /* 0x80091009 */ \ XXX( HRES_CRYPT_E_NOT_DECRYPTED , 2148077578U) /* 0x8009100a */ \ XXX( HRES_CRYPT_E_RECIPIENT_NOT_FOUND , 2148077579U) /* 0x8009100b */ \ XXX( HRES_CRYPT_E_CONTROL_TYPE , 2148077580U) /* 0x8009100c */ \ XXX( HRES_CRYPT_E_ISSUER_SERIALNUMBER , 2148077581U) /* 0x8009100d */ \ XXX( HRES_CRYPT_E_SIGNER_NOT_FOUND , 2148077582U) /* 0x8009100e */ \ XXX( HRES_CRYPT_E_ATTRIBUTES_MISSING , 2148077583U) /* 0x8009100f */ \ XXX( HRES_CRYPT_E_STREAM_MSG_NOT_READY , 2148077584U) /* 0x80091010 */ \ XXX( HRES_CRYPT_E_STREAM_INSUFFICIENT_DATA , 2148077585U) /* 0x80091011 */ \ XXX( HRES_CRYPT_E_BAD_LEN , 2148081665U) /* 0x80092001 */ \ XXX( HRES_CRYPT_E_BAD_ENCODE , 2148081666U) /* 0x80092002 */ \ XXX( HRES_CRYPT_E_FILE_ERROR , 2148081667U) /* 0x80092003 */ \ XXX( HRES_CRYPT_E_NOT_FOUND , 2148081668U) /* 0x80092004 */ \ XXX( HRES_CRYPT_E_EXISTS , 2148081669U) /* 0x80092005 */ \ XXX( HRES_CRYPT_E_NO_PROVIDER , 2148081670U) /* 0x80092006 */ \ XXX( HRES_CRYPT_E_SELF_SIGNED , 2148081671U) /* 0x80092007 */ \ XXX( HRES_CRYPT_E_DELETED_PREV , 2148081672U) /* 0x80092008 */ \ XXX( HRES_CRYPT_E_NO_MATCH , 2148081673U) /* 0x80092009 */ \ XXX( HRES_CRYPT_E_UNEXPECTED_MSG_TYPE , 2148081674U) /* 0x8009200a */ \ XXX( HRES_CRYPT_E_NO_KEY_PROPERTY , 2148081675U) /* 0x8009200b */ \ XXX( HRES_CRYPT_E_NO_DECRYPT_CERT , 2148081676U) /* 0x8009200c */ \ XXX( HRES_CRYPT_E_BAD_MSG , 2148081677U) /* 0x8009200d */ \ XXX( HRES_CRYPT_E_NO_SIGNER , 2148081678U) /* 0x8009200e */ \ XXX( HRES_CRYPT_E_PENDING_CLOSE , 2148081679U) /* 0x8009200f */ \ XXX( HRES_CRYPT_E_REVOKED , 2148081680U) /* 0x80092010 */ \ XXX( HRES_CRYPT_E_NO_REVOCATION_DLL , 2148081681U) /* 0x80092011 */ \ XXX( HRES_CRYPT_E_NO_REVOCATION_CHECK , 2148081682U) /* 0x80092012 */ \ XXX( HRES_CRYPT_E_REVOCATION_OFFLINE , 2148081683U) /* 0x80092013 */ \ XXX( HRES_CRYPT_E_NOT_IN_REVOCATION_DATABASE , 2148081684U) /* 0x80092014 */ \ XXX( HRES_CRYPT_E_INVALID_NUMERIC_STRING , 2148081696U) /* 0x80092020 */ \ XXX( HRES_CRYPT_E_INVALID_PRINTABLE_STRING , 2148081697U) /* 0x80092021 */ \ XXX( HRES_CRYPT_E_INVALID_IA5_STRING , 2148081698U) /* 0x80092022 */ \ XXX( HRES_CRYPT_E_INVALID_X500_STRING , 2148081699U) /* 0x80092023 */ \ XXX( HRES_CRYPT_E_NOT_CHAR_STRING , 2148081700U) /* 0x80092024 */ \ XXX( HRES_CRYPT_E_FILERESIZED , 2148081701U) /* 0x80092025 */ \ XXX( HRES_CRYPT_E_SECURITY_SETTINGS , 2148081702U) /* 0x80092026 */ \ XXX( HRES_CRYPT_E_NO_VERIFY_USAGE_DLL , 2148081703U) /* 0x80092027 */ \ XXX( HRES_CRYPT_E_NO_VERIFY_USAGE_CHECK , 2148081704U) /* 0x80092028 */ \ XXX( HRES_CRYPT_E_VERIFY_USAGE_OFFLINE , 2148081705U) /* 0x80092029 */ \ XXX( HRES_CRYPT_E_NOT_IN_CTL , 2148081706U) /* 0x8009202a */ \ XXX( HRES_CRYPT_E_NO_TRUSTED_SIGNER , 2148081707U) /* 0x8009202b */ \ XXX( HRES_CRYPT_E_MISSING_PUBKEY_PARA , 2148081708U) /* 0x8009202c */ \ XXX( HRES_CRYPT_E_OSS_ERROR , 2148085760U) /* 0x80093000 */ \ XXX( HRES_OSS_MORE_BUF , 2148085761U) /* 0x80093001 */ \ XXX( HRES_OSS_NEGATIVE_UINTEGER , 2148085762U) /* 0x80093002 */ \ XXX( HRES_OSS_PDU_RANGE , 2148085763U) /* 0x80093003 */ \ XXX( HRES_OSS_MORE_INPUT , 2148085764U) /* 0x80093004 */ \ XXX( HRES_OSS_DATA_ERROR , 2148085765U) /* 0x80093005 */ \ XXX( HRES_OSS_BAD_ARG , 2148085766U) /* 0x80093006 */ \ XXX( HRES_OSS_BAD_VERSION , 2148085767U) /* 0x80093007 */ \ XXX( HRES_OSS_OUT_MEMORY , 2148085768U) /* 0x80093008 */ \ XXX( HRES_OSS_PDU_MISMATCH , 2148085769U) /* 0x80093009 */ \ XXX( HRES_OSS_LIMITED , 2148085770U) /* 0x8009300a */ \ XXX( HRES_OSS_BAD_PTR , 2148085771U) /* 0x8009300b */ \ XXX( HRES_OSS_BAD_TIME , 2148085772U) /* 0x8009300c */ \ XXX( HRES_OSS_INDEFINITE_NOT_SUPPORTED , 2148085773U) /* 0x8009300d */ \ XXX( HRES_OSS_MEM_ERROR , 2148085774U) /* 0x8009300e */ \ XXX( HRES_OSS_BAD_TABLE , 2148085775U) /* 0x8009300f */ \ XXX( HRES_OSS_TOO_LONG , 2148085776U) /* 0x80093010 */ \ XXX( HRES_OSS_CONSTRAINT_VIOLATED , 2148085777U) /* 0x80093011 */ \ XXX( HRES_OSS_FATAL_ERROR , 2148085778U) /* 0x80093012 */ \ XXX( HRES_OSS_ACCESS_SERIALIZATION_ERROR , 2148085779U) /* 0x80093013 */ \ XXX( HRES_OSS_NULL_TBL , 2148085780U) /* 0x80093014 */ \ XXX( HRES_OSS_NULL_FCN , 2148085781U) /* 0x80093015 */ \ XXX( HRES_OSS_BAD_ENCRULES , 2148085782U) /* 0x80093016 */ \ XXX( HRES_OSS_UNAVAIL_ENCRULES , 2148085783U) /* 0x80093017 */ \ XXX( HRES_OSS_CANT_OPEN_TRACE_WINDOW , 2148085784U) /* 0x80093018 */ \ XXX( HRES_OSS_UNIMPLEMENTED , 2148085785U) /* 0x80093019 */ \ XXX( HRES_OSS_OID_DLL_NOT_LINKED , 2148085786U) /* 0x8009301a */ \ XXX( HRES_OSS_CANT_OPEN_TRACE_FILE , 2148085787U) /* 0x8009301b */ \ XXX( HRES_OSS_TRACE_FILE_ALREADY_OPEN , 2148085788U) /* 0x8009301c */ \ XXX( HRES_OSS_TABLE_MISMATCH , 2148085789U) /* 0x8009301d */ \ XXX( HRES_OSS_TYPE_NOT_SUPPORTED , 2148085790U) /* 0x8009301e */ \ XXX( HRES_OSS_REAL_DLL_NOT_LINKED , 2148085791U) /* 0x8009301f */ \ XXX( HRES_OSS_REAL_CODE_NOT_LINKED , 2148085792U) /* 0x80093020 */ \ XXX( HRES_OSS_OUT_OF_RANGE , 2148085793U) /* 0x80093021 */ \ XXX( HRES_OSS_COPIER_DLL_NOT_LINKED , 2148085794U) /* 0x80093022 */ \ XXX( HRES_OSS_CONSTRAINT_DLL_NOT_LINKED , 2148085795U) /* 0x80093023 */ \ XXX( HRES_OSS_COMPARATOR_DLL_NOT_LINKED , 2148085796U) /* 0x80093024 */ \ XXX( HRES_OSS_COMPARATOR_CODE_NOT_LINKED , 2148085797U) /* 0x80093025 */ \ XXX( HRES_OSS_MEM_MGR_DLL_NOT_LINKED , 2148085798U) /* 0x80093026 */ \ XXX( HRES_OSS_PDV_DLL_NOT_LINKED , 2148085799U) /* 0x80093027 */ \ XXX( HRES_OSS_PDV_CODE_NOT_LINKED , 2148085800U) /* 0x80093028 */ \ XXX( HRES_OSS_API_DLL_NOT_LINKED , 2148085801U) /* 0x80093029 */ \ XXX( HRES_OSS_BERDER_DLL_NOT_LINKED , 2148085802U) /* 0x8009302a */ \ XXX( HRES_OSS_PER_DLL_NOT_LINKED , 2148085803U) /* 0x8009302b */ \ XXX( HRES_OSS_OPEN_TYPE_ERROR , 2148085804U) /* 0x8009302c */ \ XXX( HRES_OSS_MUTEX_NOT_CREATED , 2148085805U) /* 0x8009302d */ \ XXX( HRES_OSS_CANT_CLOSE_TRACE_FILE , 2148085806U) /* 0x8009302e */ \ XXX( HRES_CRYPT_E_ASN1_ERROR , 2148086016U) /* 0x80093100 */ \ XXX( HRES_CRYPT_E_ASN1_INTERNAL , 2148086017U) /* 0x80093101 */ \ XXX( HRES_CRYPT_E_ASN1_EOD , 2148086018U) /* 0x80093102 */ \ XXX( HRES_CRYPT_E_ASN1_CORRUPT , 2148086019U) /* 0x80093103 */ \ XXX( HRES_CRYPT_E_ASN1_LARGE , 2148086020U) /* 0x80093104 */ \ XXX( HRES_CRYPT_E_ASN1_CONSTRAINT , 2148086021U) /* 0x80093105 */ \ XXX( HRES_CRYPT_E_ASN1_MEMORY , 2148086022U) /* 0x80093106 */ \ XXX( HRES_CRYPT_E_ASN1_OVERFLOW , 2148086023U) /* 0x80093107 */ \ XXX( HRES_CRYPT_E_ASN1_BADPDU , 2148086024U) /* 0x80093108 */ \ XXX( HRES_CRYPT_E_ASN1_BADARGS , 2148086025U) /* 0x80093109 */ \ XXX( HRES_CRYPT_E_ASN1_BADREAL , 2148086026U) /* 0x8009310a */ \ XXX( HRES_CRYPT_E_ASN1_BADTAG , 2148086027U) /* 0x8009310b */ \ XXX( HRES_CRYPT_E_ASN1_CHOICE , 2148086028U) /* 0x8009310c */ \ XXX( HRES_CRYPT_E_ASN1_RULE , 2148086029U) /* 0x8009310d */ \ XXX( HRES_CRYPT_E_ASN1_UTF8 , 2148086030U) /* 0x8009310e */ \ XXX( HRES_CRYPT_E_ASN1_PDU_TYPE , 2148086067U) /* 0x80093133 */ \ XXX( HRES_CRYPT_E_ASN1_NYI , 2148086068U) /* 0x80093134 */ \ XXX( HRES_CRYPT_E_ASN1_EXTENDED , 2148086273U) /* 0x80093201 */ \ XXX( HRES_CRYPT_E_ASN1_NOEOD , 2148086274U) /* 0x80093202 */ \ XXX( HRES_CERTSRV_E_BAD_REQUESTSUBJECT , 2148089857U) /* 0x80094001 */ \ XXX( HRES_CERTSRV_E_NO_REQUEST , 2148089858U) /* 0x80094002 */ \ XXX( HRES_CERTSRV_E_BAD_REQUESTSTATUS , 2148089859U) /* 0x80094003 */ \ XXX( HRES_CERTSRV_E_PROPERTY_EMPTY , 2148089860U) /* 0x80094004 */ \ XXX( HRES_CERTSRV_E_INVALID_CA_CERTIFICATE , 2148089861U) /* 0x80094005 */ \ XXX( HRES_CERTSRV_E_SERVER_SUSPENDED , 2148089862U) /* 0x80094006 */ \ XXX( HRES_CERTSRV_E_ENCODING_LENGTH , 2148089863U) /* 0x80094007 */ \ XXX( HRES_CERTSRV_E_ROLECONFLICT , 2148089864U) /* 0x80094008 */ \ XXX( HRES_CERTSRV_E_RESTRICTEDOFFICER , 2148089865U) /* 0x80094009 */ \ XXX( HRES_CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED , 2148089866U) /* 0x8009400a */ \ XXX( HRES_CERTSRV_E_NO_VALID_KRA , 2148089867U) /* 0x8009400b */ \ XXX( HRES_CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL , 2148089868U) /* 0x8009400c */ \ XXX( HRES_CERTSRV_E_NO_CAADMIN_DEFINED , 2148089869U) /* 0x8009400d */ \ XXX( HRES_CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE , 2148089870U) /* 0x8009400e */ \ XXX( HRES_CERTSRV_E_NO_DB_SESSIONS , 2148089871U) /* 0x8009400f */ \ XXX( HRES_CERTSRV_E_ALIGNMENT_FAULT , 2148089872U) /* 0x80094010 */ \ XXX( HRES_CERTSRV_E_ENROLL_DENIED , 2148089873U) /* 0x80094011 */ \ XXX( HRES_CERTSRV_E_TEMPLATE_DENIED , 2148089874U) /* 0x80094012 */ \ XXX( HRES_CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE , 2148089875U) /* 0x80094013 */ \ XXX( HRES_CERTSRV_E_UNSUPPORTED_CERT_TYPE , 2148091904U) /* 0x80094800 */ \ XXX( HRES_CERTSRV_E_NO_CERT_TYPE , 2148091905U) /* 0x80094801 */ \ XXX( HRES_CERTSRV_E_TEMPLATE_CONFLICT , 2148091906U) /* 0x80094802 */ \ XXX( HRES_CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED , 2148091907U) /* 0x80094803 */ \ XXX( HRES_CERTSRV_E_ARCHIVED_KEY_REQUIRED , 2148091908U) /* 0x80094804 */ \ XXX( HRES_CERTSRV_E_SMIME_REQUIRED , 2148091909U) /* 0x80094805 */ \ XXX( HRES_CERTSRV_E_BAD_RENEWAL_SUBJECT , 2148091910U) /* 0x80094806 */ \ XXX( HRES_CERTSRV_E_BAD_TEMPLATE_VERSION , 2148091911U) /* 0x80094807 */ \ XXX( HRES_CERTSRV_E_TEMPLATE_POLICY_REQUIRED , 2148091912U) /* 0x80094808 */ \ XXX( HRES_CERTSRV_E_SIGNATURE_POLICY_REQUIRED , 2148091913U) /* 0x80094809 */ \ XXX( HRES_CERTSRV_E_SIGNATURE_COUNT , 2148091914U) /* 0x8009480a */ \ XXX( HRES_CERTSRV_E_SIGNATURE_REJECTED , 2148091915U) /* 0x8009480b */ \ XXX( HRES_CERTSRV_E_ISSUANCE_POLICY_REQUIRED , 2148091916U) /* 0x8009480c */ \ XXX( HRES_CERTSRV_E_SUBJECT_UPN_REQUIRED , 2148091917U) /* 0x8009480d */ \ XXX( HRES_CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED , 2148091918U) /* 0x8009480e */ \ XXX( HRES_CERTSRV_E_SUBJECT_DNS_REQUIRED , 2148091919U) /* 0x8009480f */ \ XXX( HRES_CERTSRV_E_ARCHIVED_KEY_UNEXPECTED , 2148091920U) /* 0x80094810 */ \ XXX( HRES_CERTSRV_E_KEY_LENGTH , 2148091921U) /* 0x80094811 */ \ XXX( HRES_CERTSRV_E_SUBJECT_EMAIL_REQUIRED , 2148091922U) /* 0x80094812 */ \ XXX( HRES_CERTSRV_E_UNKNOWN_CERT_TYPE , 2148091923U) /* 0x80094813 */ \ XXX( HRES_CERTSRV_E_CERT_TYPE_OVERLAP , 2148091924U) /* 0x80094814 */ \ XXX( HRES_CERTSRV_E_TOO_MANY_SIGNATURES , 2148091925U) /* 0x80094815 */ \ XXX( HRES_CERTSRV_E_RENEWAL_BAD_PUBLIC_KEY , 2148091926U) /* 0x80094816 */ \ XXX( HRES_CERTSRV_E_INVALID_EK , 2148091927U) /* 0x80094817 */ \ XXX( HRES_CERTSRV_E_KEY_ATTESTATION , 2148091930U) /* 0x8009481a */ \ XXX( HRES_XENROLL_E_KEY_NOT_EXPORTABLE , 2148093952U) /* 0x80095000 */ \ XXX( HRES_XENROLL_E_CANNOT_ADD_ROOT_CERT , 2148093953U) /* 0x80095001 */ \ XXX( HRES_XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND , 2148093954U) /* 0x80095002 */ \ XXX( HRES_XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH , 2148093955U) /* 0x80095003 */ \ XXX( HRES_XENROLL_E_RESPONSE_KA_HASH_MISMATCH , 2148093956U) /* 0x80095004 */ \ XXX( HRES_XENROLL_E_KEYSPEC_SMIME_MISMATCH , 2148093957U) /* 0x80095005 */ \ XXX( HRES_TRUST_E_SYSTEM_ERROR , 2148098049U) /* 0x80096001 */ \ XXX( HRES_TRUST_E_NO_SIGNER_CERT , 2148098050U) /* 0x80096002 */ \ XXX( HRES_TRUST_E_COUNTER_SIGNER , 2148098051U) /* 0x80096003 */ \ XXX( HRES_TRUST_E_CERT_SIGNATURE , 2148098052U) /* 0x80096004 */ \ XXX( HRES_TRUST_E_TIME_STAMP , 2148098053U) /* 0x80096005 */ \ XXX( HRES_TRUST_E_BAD_DIGEST , 2148098064U) /* 0x80096010 */ \ XXX( HRES_TRUST_E_BASIC_CONSTRAINTS , 2148098073U) /* 0x80096019 */ \ XXX( HRES_TRUST_E_FINANCIAL_CRITERIA , 2148098078U) /* 0x8009601e */ \ XXX( HRES_MSSIPOTF_E_OUTOFMEMRANGE , 2148102145U) /* 0x80097001 */ \ XXX( HRES_MSSIPOTF_E_CANTGETOBJECT , 2148102146U) /* 0x80097002 */ \ XXX( HRES_MSSIPOTF_E_NOHEADTABLE , 2148102147U) /* 0x80097003 */ \ XXX( HRES_MSSIPOTF_E_BAD_MAGICNUMBER , 2148102148U) /* 0x80097004 */ \ XXX( HRES_MSSIPOTF_E_BAD_OFFSET_TABLE , 2148102149U) /* 0x80097005 */ \ XXX( HRES_MSSIPOTF_E_TABLE_TAGORDER , 2148102150U) /* 0x80097006 */ \ XXX( HRES_MSSIPOTF_E_TABLE_LONGWORD , 2148102151U) /* 0x80097007 */ \ XXX( HRES_MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT , 2148102152U) /* 0x80097008 */ \ XXX( HRES_MSSIPOTF_E_TABLES_OVERLAP , 2148102153U) /* 0x80097009 */ \ XXX( HRES_MSSIPOTF_E_TABLE_PADBYTES , 2148102154U) /* 0x8009700a */ \ XXX( HRES_MSSIPOTF_E_FILETOOSMALL , 2148102155U) /* 0x8009700b */ \ XXX( HRES_MSSIPOTF_E_TABLE_CHECKSUM , 2148102156U) /* 0x8009700c */ \ XXX( HRES_MSSIPOTF_E_FILE_CHECKSUM , 2148102157U) /* 0x8009700d */ \ XXX( HRES_MSSIPOTF_E_FAILED_POLICY , 2148102160U) /* 0x80097010 */ \ XXX( HRES_MSSIPOTF_E_FAILED_HINTS_CHECK , 2148102161U) /* 0x80097011 */ \ XXX( HRES_MSSIPOTF_E_NOT_OPENTYPE , 2148102162U) /* 0x80097012 */ \ XXX( HRES_MSSIPOTF_E_FILE , 2148102163U) /* 0x80097013 */ \ XXX( HRES_MSSIPOTF_E_CRYPT , 2148102164U) /* 0x80097014 */ \ XXX( HRES_MSSIPOTF_E_BADVERSION , 2148102165U) /* 0x80097015 */ \ XXX( HRES_MSSIPOTF_E_DSIG_STRUCTURE , 2148102166U) /* 0x80097016 */ \ XXX( HRES_MSSIPOTF_E_PCONST_CHECK , 2148102167U) /* 0x80097017 */ \ XXX( HRES_MSSIPOTF_E_STRUCTURE , 2148102168U) /* 0x80097018 */ \ XXX( HRES_ERROR_CRED_REQUIRES_CONFIRMATION , 2148102169U) /* 0x80097019 */ \ XXX( HRES_TRUST_E_PROVIDER_UNKNOWN , 2148204545U) /* 0x800b0001 */ \ XXX( HRES_TRUST_E_ACTION_UNKNOWN , 2148204546U) /* 0x800b0002 */ \ XXX( HRES_TRUST_E_SUBJECT_FORM_UNKNOWN , 2148204547U) /* 0x800b0003 */ \ XXX( HRES_TRUST_E_SUBJECT_NOT_TRUSTED , 2148204548U) /* 0x800b0004 */ \ XXX( HRES_DIGSIG_E_ENCODE , 2148204549U) /* 0x800b0005 */ \ XXX( HRES_DIGSIG_E_DECODE , 2148204550U) /* 0x800b0006 */ \ XXX( HRES_DIGSIG_E_EXTENSIBILITY , 2148204551U) /* 0x800b0007 */ \ XXX( HRES_DIGSIG_E_CRYPTO , 2148204552U) /* 0x800b0008 */ \ XXX( HRES_PERSIST_E_SIZEDEFINITE , 2148204553U) /* 0x800b0009 */ \ XXX( HRES_PERSIST_E_SIZEINDEFINITE , 2148204554U) /* 0x800b000a */ \ XXX( HRES_PERSIST_E_NOTSELFSIZING , 2148204555U) /* 0x800b000b */ \ XXX( HRES_TRUST_E_NOSIGNATURE , 2148204800U) /* 0x800b0100 */ \ XXX( HRES_CERT_E_EXPIRED , 2148204801U) /* 0x800b0101 */ \ XXX( HRES_CERT_E_VALIDITYPERIODNESTING , 2148204802U) /* 0x800b0102 */ \ XXX( HRES_CERT_E_ROLE , 2148204803U) /* 0x800b0103 */ \ XXX( HRES_CERT_E_PATHLENCONST , 2148204804U) /* 0x800b0104 */ \ XXX( HRES_CERT_E_CRITICAL , 2148204805U) /* 0x800b0105 */ \ XXX( HRES_CERT_E_PURPOSE , 2148204806U) /* 0x800b0106 */ \ XXX( HRES_CERT_E_ISSUERCHAINING , 2148204807U) /* 0x800b0107 */ \ XXX( HRES_CERT_E_MALFORMED , 2148204808U) /* 0x800b0108 */ \ XXX( HRES_CERT_E_UNTRUSTEDROOT , 2148204809U) /* 0x800b0109 */ \ XXX( HRES_CERT_E_CHAINING , 2148204810U) /* 0x800b010a */ \ XXX( HRES_TRUST_E_FAIL , 2148204811U) /* 0x800b010b */ \ XXX( HRES_CERT_E_REVOKED , 2148204812U) /* 0x800b010c */ \ XXX( HRES_CERT_E_UNTRUSTEDTESTROOT , 2148204813U) /* 0x800b010d */ \ XXX( HRES_CERT_E_REVOCATION_FAILURE , 2148204814U) /* 0x800b010e */ \ XXX( HRES_CERT_E_CN_NO_MATCH , 2148204815U) /* 0x800b010f */ \ XXX( HRES_CERT_E_WRONG_USAGE , 2148204816U) /* 0x800b0110 */ \ XXX( HRES_TRUST_E_EXPLICIT_DISTRUST , 2148204817U) /* 0x800b0111 */ \ XXX( HRES_CERT_E_UNTRUSTEDCA , 2148204818U) /* 0x800b0112 */ \ XXX( HRES_CERT_E_INVALID_POLICY , 2148204819U) /* 0x800b0113 */ \ XXX( HRES_CERT_E_INVALID_NAME , 2148204820U) /* 0x800b0114 */ \ XXX( HRES_NS_W_SERVER_BANDWIDTH_LIMIT , 2148335619U) /* 0x800d0003 */ \ XXX( HRES_NS_W_FILE_BANDWIDTH_LIMIT , 2148335620U) /* 0x800d0004 */ \ XXX( HRES_NS_W_UNKNOWN_EVENT , 2148335712U) /* 0x800d0060 */ \ XXX( HRES_NS_I_CATATONIC_FAILURE , 2148336025U) /* 0x800d0199 */ \ XXX( HRES_NS_I_CATATONIC_AUTO_UNFAIL , 2148336026U) /* 0x800d019a */ \ XXX( HRES_SPAPI_E_EXPECTED_SECTION_NAME , 2148466688U) /* 0x800f0000 */ \ XXX( HRES_SPAPI_E_BAD_SECTION_NAME_LINE , 2148466689U) /* 0x800f0001 */ \ XXX( HRES_SPAPI_E_SECTION_NAME_TOO_LONG , 2148466690U) /* 0x800f0002 */ \ XXX( HRES_SPAPI_E_GENERAL_SYNTAX , 2148466691U) /* 0x800f0003 */ \ XXX( HRES_SPAPI_E_WRONG_INF_STYLE , 2148466944U) /* 0x800f0100 */ \ XXX( HRES_SPAPI_E_SECTION_NOT_FOUND , 2148466945U) /* 0x800f0101 */ \ XXX( HRES_SPAPI_E_LINE_NOT_FOUND , 2148466946U) /* 0x800f0102 */ \ XXX( HRES_SPAPI_E_NO_BACKUP , 2148466947U) /* 0x800f0103 */ \ XXX( HRES_SPAPI_E_NO_ASSOCIATED_CLASS , 2148467200U) /* 0x800f0200 */ \ XXX( HRES_SPAPI_E_CLASS_MISMATCH , 2148467201U) /* 0x800f0201 */ \ XXX( HRES_SPAPI_E_DUPLICATE_FOUND , 2148467202U) /* 0x800f0202 */ \ XXX( HRES_SPAPI_E_NO_DRIVER_SELECTED , 2148467203U) /* 0x800f0203 */ \ XXX( HRES_SPAPI_E_KEY_DOES_NOT_EXIST , 2148467204U) /* 0x800f0204 */ \ XXX( HRES_SPAPI_E_INVALID_DEVINST_NAME , 2148467205U) /* 0x800f0205 */ \ XXX( HRES_SPAPI_E_INVALID_CLASS , 2148467206U) /* 0x800f0206 */ \ XXX( HRES_SPAPI_E_DEVINST_ALREADY_EXISTS , 2148467207U) /* 0x800f0207 */ \ XXX( HRES_SPAPI_E_DEVINFO_NOT_REGISTERED , 2148467208U) /* 0x800f0208 */ \ XXX( HRES_SPAPI_E_INVALID_REG_PROPERTY , 2148467209U) /* 0x800f0209 */ \ XXX( HRES_SPAPI_E_NO_INF , 2148467210U) /* 0x800f020a */ \ XXX( HRES_SPAPI_E_NO_SUCH_DEVINST , 2148467211U) /* 0x800f020b */ \ XXX( HRES_SPAPI_E_CANT_LOAD_CLASS_ICON , 2148467212U) /* 0x800f020c */ \ XXX( HRES_SPAPI_E_INVALID_CLASS_INSTALLER , 2148467213U) /* 0x800f020d */ \ XXX( HRES_SPAPI_E_DI_DO_DEFAULT , 2148467214U) /* 0x800f020e */ \ XXX( HRES_SPAPI_E_DI_NOFILECOPY , 2148467215U) /* 0x800f020f */ \ XXX( HRES_SPAPI_E_INVALID_HWPROFILE , 2148467216U) /* 0x800f0210 */ \ XXX( HRES_SPAPI_E_NO_DEVICE_SELECTED , 2148467217U) /* 0x800f0211 */ \ XXX( HRES_SPAPI_E_DEVINFO_LIST_LOCKED , 2148467218U) /* 0x800f0212 */ \ XXX( HRES_SPAPI_E_DEVINFO_DATA_LOCKED , 2148467219U) /* 0x800f0213 */ \ XXX( HRES_SPAPI_E_DI_BAD_PATH , 2148467220U) /* 0x800f0214 */ \ XXX( HRES_SPAPI_E_NO_CLASSINSTALL_PARAMS , 2148467221U) /* 0x800f0215 */ \ XXX( HRES_SPAPI_E_FILEQUEUE_LOCKED , 2148467222U) /* 0x800f0216 */ \ XXX( HRES_SPAPI_E_BAD_SERVICE_INSTALLSECT , 2148467223U) /* 0x800f0217 */ \ XXX( HRES_SPAPI_E_NO_CLASS_DRIVER_LIST , 2148467224U) /* 0x800f0218 */ \ XXX( HRES_SPAPI_E_NO_ASSOCIATED_SERVICE , 2148467225U) /* 0x800f0219 */ \ XXX( HRES_SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE , 2148467226U) /* 0x800f021a */ \ XXX( HRES_SPAPI_E_DEVICE_INTERFACE_ACTIVE , 2148467227U) /* 0x800f021b */ \ XXX( HRES_SPAPI_E_DEVICE_INTERFACE_REMOVED , 2148467228U) /* 0x800f021c */ \ XXX( HRES_SPAPI_E_BAD_INTERFACE_INSTALLSECT , 2148467229U) /* 0x800f021d */ \ XXX( HRES_SPAPI_E_NO_SUCH_INTERFACE_CLASS , 2148467230U) /* 0x800f021e */ \ XXX( HRES_SPAPI_E_INVALID_REFERENCE_STRING , 2148467231U) /* 0x800f021f */ \ XXX( HRES_SPAPI_E_INVALID_MACHINENAME , 2148467232U) /* 0x800f0220 */ \ XXX( HRES_SPAPI_E_REMOTE_COMM_FAILURE , 2148467233U) /* 0x800f0221 */ \ XXX( HRES_SPAPI_E_MACHINE_UNAVAILABLE , 2148467234U) /* 0x800f0222 */ \ XXX( HRES_SPAPI_E_NO_CONFIGMGR_SERVICES , 2148467235U) /* 0x800f0223 */ \ XXX( HRES_SPAPI_E_INVALID_PROPPAGE_PROVIDER , 2148467236U) /* 0x800f0224 */ \ XXX( HRES_SPAPI_E_NO_SUCH_DEVICE_INTERFACE , 2148467237U) /* 0x800f0225 */ \ XXX( HRES_SPAPI_E_DI_POSTPROCESSING_REQUIRED , 2148467238U) /* 0x800f0226 */ \ XXX( HRES_SPAPI_E_INVALID_COINSTALLER , 2148467239U) /* 0x800f0227 */ \ XXX( HRES_SPAPI_E_NO_COMPAT_DRIVERS , 2148467240U) /* 0x800f0228 */ \ XXX( HRES_SPAPI_E_NO_DEVICE_ICON , 2148467241U) /* 0x800f0229 */ \ XXX( HRES_SPAPI_E_INVALID_INF_LOGCONFIG , 2148467242U) /* 0x800f022a */ \ XXX( HRES_SPAPI_E_DI_DONT_INSTALL , 2148467243U) /* 0x800f022b */ \ XXX( HRES_SPAPI_E_INVALID_FILTER_DRIVER , 2148467244U) /* 0x800f022c */ \ XXX( HRES_SPAPI_E_NON_WINDOWS_NT_DRIVER , 2148467245U) /* 0x800f022d */ \ XXX( HRES_SPAPI_E_NON_WINDOWS_DRIVER , 2148467246U) /* 0x800f022e */ \ XXX( HRES_SPAPI_E_NO_CATALOG_FOR_OEM_INF , 2148467247U) /* 0x800f022f */ \ XXX( HRES_SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE , 2148467248U) /* 0x800f0230 */ \ XXX( HRES_SPAPI_E_NOT_DISABLEABLE , 2148467249U) /* 0x800f0231 */ \ XXX( HRES_SPAPI_E_CANT_REMOVE_DEVINST , 2148467250U) /* 0x800f0232 */ \ XXX( HRES_SPAPI_E_INVALID_TARGET , 2148467251U) /* 0x800f0233 */ \ XXX( HRES_SPAPI_E_DRIVER_NONNATIVE , 2148467252U) /* 0x800f0234 */ \ XXX( HRES_SPAPI_E_IN_WOW64 , 2148467253U) /* 0x800f0235 */ \ XXX( HRES_SPAPI_E_SET_SYSTEM_RESTORE_POINT , 2148467254U) /* 0x800f0236 */ \ XXX( HRES_SPAPI_E_INCORRECTLY_COPIED_INF , 2148467255U) /* 0x800f0237 */ \ XXX( HRES_SPAPI_E_SCE_DISABLED , 2148467256U) /* 0x800f0238 */ \ XXX( HRES_SPAPI_E_UNKNOWN_EXCEPTION , 2148467257U) /* 0x800f0239 */ \ XXX( HRES_SPAPI_E_PNP_REGISTRY_ERROR , 2148467258U) /* 0x800f023a */ \ XXX( HRES_SPAPI_E_REMOTE_REQUEST_UNSUPPORTED , 2148467259U) /* 0x800f023b */ \ XXX( HRES_SPAPI_E_NOT_AN_INSTALLED_OEM_INF , 2148467260U) /* 0x800f023c */ \ XXX( HRES_SPAPI_E_INF_IN_USE_BY_DEVICES , 2148467261U) /* 0x800f023d */ \ XXX( HRES_SPAPI_E_DI_FUNCTION_OBSOLETE , 2148467262U) /* 0x800f023e */ \ XXX( HRES_SPAPI_E_NO_AUTHENTICODE_CATALOG , 2148467263U) /* 0x800f023f */ \ XXX( HRES_SPAPI_E_AUTHENTICODE_DISALLOWED , 2148467264U) /* 0x800f0240 */ \ XXX( HRES_SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER , 2148467265U) /* 0x800f0241 */ \ XXX( HRES_SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED, 2148467266U) /* 0x800f0242 */ \ XXX( HRES_SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED, 2148467267U) /* 0x800f0243 */ \ XXX( HRES_SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH , 2148467268U) /* 0x800f0244 */ \ XXX( HRES_SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE , 2148467269U) /* 0x800f0245 */ \ XXX( HRES_SPAPI_E_DEVICE_INSTALLER_NOT_READY , 2148467270U) /* 0x800f0246 */ \ XXX( HRES_SPAPI_E_DRIVER_STORE_ADD_FAILED , 2148467271U) /* 0x800f0247 */ \ XXX( HRES_SPAPI_E_DEVICE_INSTALL_BLOCKED , 2148467272U) /* 0x800f0248 */ \ XXX( HRES_SPAPI_E_DRIVER_INSTALL_BLOCKED , 2148467273U) /* 0x800f0249 */ \ XXX( HRES_SPAPI_E_WRONG_INF_TYPE , 2148467274U) /* 0x800f024a */ \ XXX( HRES_SPAPI_E_FILE_HASH_NOT_IN_CATALOG , 2148467275U) /* 0x800f024b */ \ XXX( HRES_SPAPI_E_DRIVER_STORE_DELETE_FAILED , 2148467276U) /* 0x800f024c */ \ XXX( HRES_SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW , 2148467456U) /* 0x800f0300 */ \ XXX( HRES_SPAPI_E_ERROR_NOT_INSTALLED , 2148470784U) /* 0x800f1000 */ \ XXX( HRES_SCARD_F_INTERNAL_ERROR , 2148532225U) /* 0x80100001 */ \ XXX( HRES_SCARD_E_CANCELLED , 2148532226U) /* 0x80100002 */ \ XXX( HRES_SCARD_E_INVALID_HANDLE , 2148532227U) /* 0x80100003 */ \ XXX( HRES_SCARD_E_INVALID_PARAMETER , 2148532228U) /* 0x80100004 */ \ XXX( HRES_SCARD_E_INVALID_TARGET , 2148532229U) /* 0x80100005 */ \ XXX( HRES_SCARD_E_NO_MEMORY , 2148532230U) /* 0x80100006 */ \ XXX( HRES_SCARD_F_WAITED_TOO_LONG , 2148532231U) /* 0x80100007 */ \ XXX( HRES_SCARD_E_INSUFFICIENT_BUFFER , 2148532232U) /* 0x80100008 */ \ XXX( HRES_SCARD_E_UNKNOWN_READER , 2148532233U) /* 0x80100009 */ \ XXX( HRES_SCARD_E_TIMEOUT , 2148532234U) /* 0x8010000a */ \ XXX( HRES_SCARD_E_SHARING_VIOLATION , 2148532235U) /* 0x8010000b */ \ XXX( HRES_SCARD_E_NO_SMARTCARD , 2148532236U) /* 0x8010000c */ \ XXX( HRES_SCARD_E_UNKNOWN_CARD , 2148532237U) /* 0x8010000d */ \ XXX( HRES_SCARD_E_CANT_DISPOSE , 2148532238U) /* 0x8010000e */ \ XXX( HRES_SCARD_E_PROTO_MISMATCH , 2148532239U) /* 0x8010000f */ \ XXX( HRES_SCARD_E_NOT_READY , 2148532240U) /* 0x80100010 */ \ XXX( HRES_SCARD_E_INVALID_VALUE , 2148532241U) /* 0x80100011 */ \ XXX( HRES_SCARD_E_SYSTEM_CANCELLED , 2148532242U) /* 0x80100012 */ \ XXX( HRES_SCARD_F_COMM_ERROR , 2148532243U) /* 0x80100013 */ \ XXX( HRES_SCARD_F_UNKNOWN_ERROR , 2148532244U) /* 0x80100014 */ \ XXX( HRES_SCARD_E_INVALID_ATR , 2148532245U) /* 0x80100015 */ \ XXX( HRES_SCARD_E_NOT_TRANSACTED , 2148532246U) /* 0x80100016 */ \ XXX( HRES_SCARD_E_READER_UNAVAILABLE , 2148532247U) /* 0x80100017 */ \ XXX( HRES_SCARD_P_SHUTDOWN , 2148532248U) /* 0x80100018 */ \ XXX( HRES_SCARD_E_PCI_TOO_SMALL , 2148532249U) /* 0x80100019 */ \ XXX( HRES_SCARD_E_READER_UNSUPPORTED , 2148532250U) /* 0x8010001a */ \ XXX( HRES_SCARD_E_DUPLICATE_READER , 2148532251U) /* 0x8010001b */ \ XXX( HRES_SCARD_E_CARD_UNSUPPORTED , 2148532252U) /* 0x8010001c */ \ XXX( HRES_SCARD_E_NO_SERVICE , 2148532253U) /* 0x8010001d */ \ XXX( HRES_SCARD_E_SERVICE_STOPPED , 2148532254U) /* 0x8010001e */ \ XXX( HRES_SCARD_E_UNEXPECTED , 2148532255U) /* 0x8010001f */ \ XXX( HRES_SCARD_E_ICC_INSTALLATION , 2148532256U) /* 0x80100020 */ \ XXX( HRES_SCARD_E_ICC_CREATEORDER , 2148532257U) /* 0x80100021 */ \ XXX( HRES_SCARD_E_UNSUPPORTED_FEATURE , 2148532258U) /* 0x80100022 */ \ XXX( HRES_SCARD_E_DIR_NOT_FOUND , 2148532259U) /* 0x80100023 */ \ XXX( HRES_SCARD_E_FILE_NOT_FOUND , 2148532260U) /* 0x80100024 */ \ XXX( HRES_SCARD_E_NO_DIR , 2148532261U) /* 0x80100025 */ \ XXX( HRES_SCARD_E_NO_FILE , 2148532262U) /* 0x80100026 */ \ XXX( HRES_SCARD_E_NO_ACCESS , 2148532263U) /* 0x80100027 */ \ XXX( HRES_SCARD_E_WRITE_TOO_MANY , 2148532264U) /* 0x80100028 */ \ XXX( HRES_SCARD_E_BAD_SEEK , 2148532265U) /* 0x80100029 */ \ XXX( HRES_SCARD_E_INVALID_CHV , 2148532266U) /* 0x8010002a */ \ XXX( HRES_SCARD_E_UNKNOWN_RES_MNG , 2148532267U) /* 0x8010002b */ \ XXX( HRES_SCARD_E_NO_SUCH_CERTIFICATE , 2148532268U) /* 0x8010002c */ \ XXX( HRES_SCARD_E_CERTIFICATE_UNAVAILABLE , 2148532269U) /* 0x8010002d */ \ XXX( HRES_SCARD_E_NO_READERS_AVAILABLE , 2148532270U) /* 0x8010002e */ \ XXX( HRES_SCARD_E_COMM_DATA_LOST , 2148532271U) /* 0x8010002f */ \ XXX( HRES_SCARD_E_NO_KEY_CONTAINER , 2148532272U) /* 0x80100030 */ \ XXX( HRES_SCARD_E_SERVER_TOO_BUSY , 2148532273U) /* 0x80100031 */ \ XXX( HRES_SCARD_W_UNSUPPORTED_CARD , 2148532325U) /* 0x80100065 */ \ XXX( HRES_SCARD_W_UNRESPONSIVE_CARD , 2148532326U) /* 0x80100066 */ \ XXX( HRES_SCARD_W_UNPOWERED_CARD , 2148532327U) /* 0x80100067 */ \ XXX( HRES_SCARD_W_RESET_CARD , 2148532328U) /* 0x80100068 */ \ XXX( HRES_SCARD_W_REMOVED_CARD , 2148532329U) /* 0x80100069 */ \ XXX( HRES_SCARD_W_SECURITY_VIOLATION , 2148532330U) /* 0x8010006a */ \ XXX( HRES_SCARD_W_WRONG_CHV , 2148532331U) /* 0x8010006b */ \ XXX( HRES_SCARD_W_CHV_BLOCKED , 2148532332U) /* 0x8010006c */ \ XXX( HRES_SCARD_W_EOF , 2148532333U) /* 0x8010006d */ \ XXX( HRES_SCARD_W_CANCELLED_BY_USER , 2148532334U) /* 0x8010006e */ \ XXX( HRES_SCARD_W_CARD_NOT_AUTHENTICATED , 2148532335U) /* 0x8010006f */ \ XXX( HRES_COMADMIN_E_OBJECTERRORS , 2148598785U) /* 0x80110401 */ \ XXX( HRES_COMADMIN_E_OBJECTINVALID , 2148598786U) /* 0x80110402 */ \ XXX( HRES_COMADMIN_E_KEYMISSING , 2148598787U) /* 0x80110403 */ \ XXX( HRES_COMADMIN_E_ALREADYINSTALLED , 2148598788U) /* 0x80110404 */ \ XXX( HRES_COMADMIN_E_APP_FILE_WRITEFAIL , 2148598791U) /* 0x80110407 */ \ XXX( HRES_COMADMIN_E_APP_FILE_READFAIL , 2148598792U) /* 0x80110408 */ \ XXX( HRES_COMADMIN_E_APP_FILE_VERSION , 2148598793U) /* 0x80110409 */ \ XXX( HRES_COMADMIN_E_BADPATH , 2148598794U) /* 0x8011040a */ \ XXX( HRES_COMADMIN_E_APPLICATIONEXISTS , 2148598795U) /* 0x8011040b */ \ XXX( HRES_COMADMIN_E_ROLEEXISTS , 2148598796U) /* 0x8011040c */ \ XXX( HRES_COMADMIN_E_CANTCOPYFILE , 2148598797U) /* 0x8011040d */ \ XXX( HRES_COMADMIN_E_NOUSER , 2148598799U) /* 0x8011040f */ \ XXX( HRES_COMADMIN_E_INVALIDUSERIDS , 2148598800U) /* 0x80110410 */ \ XXX( HRES_COMADMIN_E_NOREGISTRYCLSID , 2148598801U) /* 0x80110411 */ \ XXX( HRES_COMADMIN_E_BADREGISTRYPROGID , 2148598802U) /* 0x80110412 */ \ XXX( HRES_COMADMIN_E_AUTHENTICATIONLEVEL , 2148598803U) /* 0x80110413 */ \ XXX( HRES_COMADMIN_E_USERPASSWDNOTVALID , 2148598804U) /* 0x80110414 */ \ XXX( HRES_COMADMIN_E_CLSIDORIIDMISMATCH , 2148598808U) /* 0x80110418 */ \ XXX( HRES_COMADMIN_E_REMOTEINTERFACE , 2148598809U) /* 0x80110419 */ \ XXX( HRES_COMADMIN_E_DLLREGISTERSERVER , 2148598810U) /* 0x8011041a */ \ XXX( HRES_COMADMIN_E_NOSERVERSHARE , 2148598811U) /* 0x8011041b */ \ XXX( HRES_COMADMIN_E_DLLLOADFAILED , 2148598813U) /* 0x8011041d */ \ XXX( HRES_COMADMIN_E_BADREGISTRYLIBID , 2148598814U) /* 0x8011041e */ \ XXX( HRES_COMADMIN_E_APPDIRNOTFOUND , 2148598815U) /* 0x8011041f */ \ XXX( HRES_COMADMIN_E_REGISTRARFAILED , 2148598819U) /* 0x80110423 */ \ XXX( HRES_COMADMIN_E_COMPFILE_DOESNOTEXIST , 2148598820U) /* 0x80110424 */ \ XXX( HRES_COMADMIN_E_COMPFILE_LOADDLLFAIL , 2148598821U) /* 0x80110425 */ \ XXX( HRES_COMADMIN_E_COMPFILE_GETCLASSOBJ , 2148598822U) /* 0x80110426 */ \ XXX( HRES_COMADMIN_E_COMPFILE_CLASSNOTAVAIL , 2148598823U) /* 0x80110427 */ \ XXX( HRES_COMADMIN_E_COMPFILE_BADTLB , 2148598824U) /* 0x80110428 */ \ XXX( HRES_COMADMIN_E_COMPFILE_NOTINSTALLABLE , 2148598825U) /* 0x80110429 */ \ XXX( HRES_COMADMIN_E_NOTCHANGEABLE , 2148598826U) /* 0x8011042a */ \ XXX( HRES_COMADMIN_E_NOTDELETEABLE , 2148598827U) /* 0x8011042b */ \ XXX( HRES_COMADMIN_E_SESSION , 2148598828U) /* 0x8011042c */ \ XXX( HRES_COMADMIN_E_COMP_MOVE_LOCKED , 2148598829U) /* 0x8011042d */ \ XXX( HRES_COMADMIN_E_COMP_MOVE_BAD_DEST , 2148598830U) /* 0x8011042e */ \ XXX( HRES_COMADMIN_E_REGISTERTLB , 2148598832U) /* 0x80110430 */ \ XXX( HRES_COMADMIN_E_SYSTEMAPP , 2148598835U) /* 0x80110433 */ \ XXX( HRES_COMADMIN_E_COMPFILE_NOREGISTRAR , 2148598836U) /* 0x80110434 */ \ XXX( HRES_COMADMIN_E_COREQCOMPINSTALLED , 2148598837U) /* 0x80110435 */ \ XXX( HRES_COMADMIN_E_SERVICENOTINSTALLED , 2148598838U) /* 0x80110436 */ \ XXX( HRES_COMADMIN_E_PROPERTYSAVEFAILED , 2148598839U) /* 0x80110437 */ \ XXX( HRES_COMADMIN_E_OBJECTEXISTS , 2148598840U) /* 0x80110438 */ \ XXX( HRES_COMADMIN_E_COMPONENTEXISTS , 2148598841U) /* 0x80110439 */ \ XXX( HRES_COMADMIN_E_REGFILE_CORRUPT , 2148598843U) /* 0x8011043b */ \ XXX( HRES_COMADMIN_E_PROPERTY_OVERFLOW , 2148598844U) /* 0x8011043c */ \ XXX( HRES_COMADMIN_E_NOTINREGISTRY , 2148598846U) /* 0x8011043e */ \ XXX( HRES_COMADMIN_E_OBJECTNOTPOOLABLE , 2148598847U) /* 0x8011043f */ \ XXX( HRES_COMADMIN_E_APPLID_MATCHES_CLSID , 2148598854U) /* 0x80110446 */ \ XXX( HRES_COMADMIN_E_ROLE_DOES_NOT_EXIST , 2148598855U) /* 0x80110447 */ \ XXX( HRES_COMADMIN_E_START_APP_NEEDS_COMPONENTS , 2148598856U) /* 0x80110448 */ \ XXX( HRES_COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM , 2148598857U) /* 0x80110449 */ \ XXX( HRES_COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY , 2148598858U) /* 0x8011044a */ \ XXX( HRES_COMADMIN_E_CAN_NOT_START_APP , 2148598859U) /* 0x8011044b */ \ XXX( HRES_COMADMIN_E_CAN_NOT_EXPORT_SYS_APP , 2148598860U) /* 0x8011044c */ \ XXX( HRES_COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT , 2148598861U) /* 0x8011044d */ \ XXX( HRES_COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER , 2148598862U) /* 0x8011044e */ \ XXX( HRES_COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE , 2148598863U) /* 0x8011044f */ \ XXX( HRES_COMADMIN_E_BASE_PARTITION_ONLY , 2148598864U) /* 0x80110450 */ \ XXX( HRES_COMADMIN_E_START_APP_DISABLED , 2148598865U) /* 0x80110451 */ \ XXX( HRES_COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME , 2148598871U) /* 0x80110457 */ \ XXX( HRES_COMADMIN_E_CAT_INVALID_PARTITION_NAME , 2148598872U) /* 0x80110458 */ \ XXX( HRES_COMADMIN_E_CAT_PARTITION_IN_USE , 2148598873U) /* 0x80110459 */ \ XXX( HRES_COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES , 2148598874U) /* 0x8011045a */ \ XXX( HRES_COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED, 2148598875U) /* 0x8011045b */ \ XXX( HRES_COMADMIN_E_AMBIGUOUS_APPLICATION_NAME , 2148598876U) /* 0x8011045c */ \ XXX( HRES_COMADMIN_E_AMBIGUOUS_PARTITION_NAME , 2148598877U) /* 0x8011045d */ \ XXX( HRES_COMADMIN_E_REGDB_NOTINITIALIZED , 2148598898U) /* 0x80110472 */ \ XXX( HRES_COMADMIN_E_REGDB_NOTOPEN , 2148598899U) /* 0x80110473 */ \ XXX( HRES_COMADMIN_E_REGDB_SYSTEMERR , 2148598900U) /* 0x80110474 */ \ XXX( HRES_COMADMIN_E_REGDB_ALREADYRUNNING , 2148598901U) /* 0x80110475 */ \ XXX( HRES_COMADMIN_E_MIG_VERSIONNOTSUPPORTED , 2148598912U) /* 0x80110480 */ \ XXX( HRES_COMADMIN_E_MIG_SCHEMANOTFOUND , 2148598913U) /* 0x80110481 */ \ XXX( HRES_COMADMIN_E_CAT_BITNESSMISMATCH , 2148598914U) /* 0x80110482 */ \ XXX( HRES_COMADMIN_E_CAT_UNACCEPTABLEBITNESS , 2148598915U) /* 0x80110483 */ \ XXX( HRES_COMADMIN_E_CAT_WRONGAPPBITNESS , 2148598916U) /* 0x80110484 */ \ XXX( HRES_COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED , 2148598917U) /* 0x80110485 */ \ XXX( HRES_COMADMIN_E_CAT_SERVERFAULT , 2148598918U) /* 0x80110486 */ \ XXX( HRES_COMQC_E_APPLICATION_NOT_QUEUED , 2148599296U) /* 0x80110600 */ \ XXX( HRES_COMQC_E_NO_QUEUEABLE_INTERFACES , 2148599297U) /* 0x80110601 */ \ XXX( HRES_COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE , 2148599298U) /* 0x80110602 */ \ XXX( HRES_COMQC_E_NO_IPERSISTSTREAM , 2148599299U) /* 0x80110603 */ \ XXX( HRES_COMQC_E_BAD_MESSAGE , 2148599300U) /* 0x80110604 */ \ XXX( HRES_COMQC_E_UNAUTHENTICATED , 2148599301U) /* 0x80110605 */ \ XXX( HRES_COMQC_E_UNTRUSTED_ENQUEUER , 2148599302U) /* 0x80110606 */ \ XXX( HRES_MSDTC_E_DUPLICATE_RESOURCE , 2148599553U) /* 0x80110701 */ \ XXX( HRES_COMADMIN_E_OBJECT_PARENT_MISSING , 2148599816U) /* 0x80110808 */ \ XXX( HRES_COMADMIN_E_OBJECT_DOES_NOT_EXIST , 2148599817U) /* 0x80110809 */ \ XXX( HRES_COMADMIN_E_APP_NOT_RUNNING , 2148599818U) /* 0x8011080a */ \ XXX( HRES_COMADMIN_E_INVALID_PARTITION , 2148599819U) /* 0x8011080b */ \ XXX( HRES_COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE, 2148599821U) /* 0x8011080d */ \ XXX( HRES_COMADMIN_E_USER_IN_SET , 2148599822U) /* 0x8011080e */ \ XXX( HRES_COMADMIN_E_CANTRECYCLELIBRARYAPPS , 2148599823U) /* 0x8011080f */ \ XXX( HRES_COMADMIN_E_CANTRECYCLESERVICEAPPS , 2148599825U) /* 0x80110811 */ \ XXX( HRES_COMADMIN_E_PROCESSALREADYRECYCLED , 2148599826U) /* 0x80110812 */ \ XXX( HRES_COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED , 2148599827U) /* 0x80110813 */ \ XXX( HRES_COMADMIN_E_CANTMAKEINPROCSERVICE , 2148599828U) /* 0x80110814 */ \ XXX( HRES_COMADMIN_E_PROGIDINUSEBYCLSID , 2148599829U) /* 0x80110815 */ \ XXX( HRES_COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET , 2148599830U) /* 0x80110816 */ \ XXX( HRES_COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED , 2148599831U) /* 0x80110817 */ \ XXX( HRES_COMADMIN_E_PARTITION_ACCESSDENIED , 2148599832U) /* 0x80110818 */ \ XXX( HRES_COMADMIN_E_PARTITION_MSI_ONLY , 2148599833U) /* 0x80110819 */ \ XXX( HRES_COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT, 2148599834U) /* 0x8011081a */ \ XXX( HRES_COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS, 2148599835U) /* 0x8011081b */ \ XXX( HRES_COMADMIN_E_COMP_MOVE_SOURCE , 2148599836U) /* 0x8011081c */ \ XXX( HRES_COMADMIN_E_COMP_MOVE_DEST , 2148599837U) /* 0x8011081d */ \ XXX( HRES_COMADMIN_E_COMP_MOVE_PRIVATE , 2148599838U) /* 0x8011081e */ \ XXX( HRES_COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET , 2148599839U) /* 0x8011081f */ \ XXX( HRES_COMADMIN_E_CANNOT_ALIAS_EVENTCLASS , 2148599840U) /* 0x80110820 */ \ XXX( HRES_COMADMIN_E_PRIVATE_ACCESSDENIED , 2148599841U) /* 0x80110821 */ \ XXX( HRES_COMADMIN_E_SAFERINVALID , 2148599842U) /* 0x80110822 */ \ XXX( HRES_COMADMIN_E_REGISTRY_ACCESSDENIED , 2148599843U) /* 0x80110823 */ \ XXX( HRES_COMADMIN_E_PARTITIONS_DISABLED , 2148599844U) /* 0x80110824 */ \ XXX( HRES_ERROR_FLT_NO_HANDLER_DEFINED , 2149515265U) /* 0x801f0001 */ \ XXX( HRES_ERROR_FLT_CONTEXT_ALREADY_DEFINED , 2149515266U) /* 0x801f0002 */ \ XXX( HRES_ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST , 2149515267U) /* 0x801f0003 */ \ XXX( HRES_ERROR_FLT_DISALLOW_FAST_IO , 2149515268U) /* 0x801f0004 */ \ XXX( HRES_ERROR_FLT_INVALID_NAME_REQUEST , 2149515269U) /* 0x801f0005 */ \ XXX( HRES_ERROR_FLT_NOT_SAFE_TO_POST_OPERATION , 2149515270U) /* 0x801f0006 */ \ XXX( HRES_ERROR_FLT_NOT_INITIALIZED , 2149515271U) /* 0x801f0007 */ \ XXX( HRES_ERROR_FLT_FILTER_NOT_READY , 2149515272U) /* 0x801f0008 */ \ XXX( HRES_ERROR_FLT_POST_OPERATION_CLEANUP , 2149515273U) /* 0x801f0009 */ \ XXX( HRES_ERROR_FLT_INTERNAL_ERROR , 2149515274U) /* 0x801f000a */ \ XXX( HRES_ERROR_FLT_DELETING_OBJECT , 2149515275U) /* 0x801f000b */ \ XXX( HRES_ERROR_FLT_MUST_BE_NONPAGED_POOL , 2149515276U) /* 0x801f000c */ \ XXX( HRES_ERROR_FLT_DUPLICATE_ENTRY , 2149515277U) /* 0x801f000d */ \ XXX( HRES_ERROR_FLT_CBDQ_DISABLED , 2149515278U) /* 0x801f000e */ \ XXX( HRES_ERROR_FLT_DO_NOT_ATTACH , 2149515279U) /* 0x801f000f */ \ XXX( HRES_ERROR_FLT_DO_NOT_DETACH , 2149515280U) /* 0x801f0010 */ \ XXX( HRES_ERROR_FLT_INSTANCE_ALTITUDE_COLLISION , 2149515281U) /* 0x801f0011 */ \ XXX( HRES_ERROR_FLT_INSTANCE_NAME_COLLISION , 2149515282U) /* 0x801f0012 */ \ XXX( HRES_ERROR_FLT_FILTER_NOT_FOUND , 2149515283U) /* 0x801f0013 */ \ XXX( HRES_ERROR_FLT_VOLUME_NOT_FOUND , 2149515284U) /* 0x801f0014 */ \ XXX( HRES_ERROR_FLT_INSTANCE_NOT_FOUND , 2149515285U) /* 0x801f0015 */ \ XXX( HRES_ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND , 2149515286U) /* 0x801f0016 */ \ XXX( HRES_ERROR_FLT_INVALID_CONTEXT_REGISTRATION , 2149515287U) /* 0x801f0017 */ \ XXX( HRES_ERROR_FLT_NAME_CACHE_MISS , 2149515288U) /* 0x801f0018 */ \ XXX( HRES_ERROR_FLT_NO_DEVICE_OBJECT , 2149515289U) /* 0x801f0019 */ \ XXX( HRES_ERROR_FLT_VOLUME_ALREADY_MOUNTED , 2149515290U) /* 0x801f001a */ \ XXX( HRES_ERROR_FLT_ALREADY_ENLISTED , 2149515291U) /* 0x801f001b */ \ XXX( HRES_ERROR_FLT_CONTEXT_ALREADY_LINKED , 2149515292U) /* 0x801f001c */ \ XXX( HRES_ERROR_FLT_NO_WAITER_FOR_REPLY , 2149515296U) /* 0x801f0020 */ \ XXX( HRES_ERROR_HUNG_DISPLAY_DRIVER_THREAD , 2149974017U) /* 0x80260001 */ \ XXX( HRES_ERROR_MONITOR_NO_DESCRIPTOR , 2149978113U) /* 0x80261001 */ \ XXX( HRES_ERROR_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT , 2149978114U) /* 0x80261002 */ \ XXX( HRES_DWM_E_COMPOSITIONDISABLED , 2149986305U) /* 0x80263001 */ \ XXX( HRES_DWM_E_REMOTING_NOT_SUPPORTED , 2149986306U) /* 0x80263002 */ \ XXX( HRES_DWM_E_NO_REDIRECTION_SURFACE_AVAILABLE , 2149986307U) /* 0x80263003 */ \ XXX( HRES_DWM_E_NOT_QUEUING_PRESENTS , 2149986308U) /* 0x80263004 */ \ XXX( HRES_TPM_E_ERROR_MASK , 2150105088U) /* 0x80280000 */ \ XXX( HRES_TPM_E_AUTHFAIL , 2150105089U) /* 0x80280001 */ \ XXX( HRES_TPM_E_BADINDEX , 2150105090U) /* 0x80280002 */ \ XXX( HRES_TPM_E_BAD_PARAMETER , 2150105091U) /* 0x80280003 */ \ XXX( HRES_TPM_E_AUDITFAILURE , 2150105092U) /* 0x80280004 */ \ XXX( HRES_TPM_E_CLEAR_DISABLED , 2150105093U) /* 0x80280005 */ \ XXX( HRES_TPM_E_DEACTIVATED , 2150105094U) /* 0x80280006 */ \ XXX( HRES_TPM_E_DISABLED , 2150105095U) /* 0x80280007 */ \ XXX( HRES_TPM_E_DISABLED_CMD , 2150105096U) /* 0x80280008 */ \ XXX( HRES_TPM_E_FAIL , 2150105097U) /* 0x80280009 */ \ XXX( HRES_TPM_E_BAD_ORDINAL , 2150105098U) /* 0x8028000a */ \ XXX( HRES_TPM_E_INSTALL_DISABLED , 2150105099U) /* 0x8028000b */ \ XXX( HRES_TPM_E_INVALID_KEYHANDLE , 2150105100U) /* 0x8028000c */ \ XXX( HRES_TPM_E_KEYNOTFOUND , 2150105101U) /* 0x8028000d */ \ XXX( HRES_TPM_E_INAPPROPRIATE_ENC , 2150105102U) /* 0x8028000e */ \ XXX( HRES_TPM_E_MIGRATEFAIL , 2150105103U) /* 0x8028000f */ \ XXX( HRES_TPM_E_INVALID_PCR_INFO , 2150105104U) /* 0x80280010 */ \ XXX( HRES_TPM_E_NOSPACE , 2150105105U) /* 0x80280011 */ \ XXX( HRES_TPM_E_NOSRK , 2150105106U) /* 0x80280012 */ \ XXX( HRES_TPM_E_NOTSEALED_BLOB , 2150105107U) /* 0x80280013 */ \ XXX( HRES_TPM_E_OWNER_SET , 2150105108U) /* 0x80280014 */ \ XXX( HRES_TPM_E_RESOURCES , 2150105109U) /* 0x80280015 */ \ XXX( HRES_TPM_E_SHORTRANDOM , 2150105110U) /* 0x80280016 */ \ XXX( HRES_TPM_E_SIZE , 2150105111U) /* 0x80280017 */ \ XXX( HRES_TPM_E_WRONGPCRVAL , 2150105112U) /* 0x80280018 */ \ XXX( HRES_TPM_E_BAD_PARAM_SIZE , 2150105113U) /* 0x80280019 */ \ XXX( HRES_TPM_E_SHA_THREAD , 2150105114U) /* 0x8028001a */ \ XXX( HRES_TPM_E_SHA_ERROR , 2150105115U) /* 0x8028001b */ \ XXX( HRES_TPM_E_FAILEDSELFTEST , 2150105116U) /* 0x8028001c */ \ XXX( HRES_TPM_E_AUTH2FAIL , 2150105117U) /* 0x8028001d */ \ XXX( HRES_TPM_E_BADTAG , 2150105118U) /* 0x8028001e */ \ XXX( HRES_TPM_E_IOERROR , 2150105119U) /* 0x8028001f */ \ XXX( HRES_TPM_E_ENCRYPT_ERROR , 2150105120U) /* 0x80280020 */ \ XXX( HRES_TPM_E_DECRYPT_ERROR , 2150105121U) /* 0x80280021 */ \ XXX( HRES_TPM_E_INVALID_AUTHHANDLE , 2150105122U) /* 0x80280022 */ \ XXX( HRES_TPM_E_NO_ENDORSEMENT , 2150105123U) /* 0x80280023 */ \ XXX( HRES_TPM_E_INVALID_KEYUSAGE , 2150105124U) /* 0x80280024 */ \ XXX( HRES_TPM_E_WRONG_ENTITYTYPE , 2150105125U) /* 0x80280025 */ \ XXX( HRES_TPM_E_INVALID_POSTINIT , 2150105126U) /* 0x80280026 */ \ XXX( HRES_TPM_E_INAPPROPRIATE_SIG , 2150105127U) /* 0x80280027 */ \ XXX( HRES_TPM_E_BAD_KEY_PROPERTY , 2150105128U) /* 0x80280028 */ \ XXX( HRES_TPM_E_BAD_MIGRATION , 2150105129U) /* 0x80280029 */ \ XXX( HRES_TPM_E_BAD_SCHEME , 2150105130U) /* 0x8028002a */ \ XXX( HRES_TPM_E_BAD_DATASIZE , 2150105131U) /* 0x8028002b */ \ XXX( HRES_TPM_E_BAD_MODE , 2150105132U) /* 0x8028002c */ \ XXX( HRES_TPM_E_BAD_PRESENCE , 2150105133U) /* 0x8028002d */ \ XXX( HRES_TPM_E_BAD_VERSION , 2150105134U) /* 0x8028002e */ \ XXX( HRES_TPM_E_NO_WRAP_TRANSPORT , 2150105135U) /* 0x8028002f */ \ XXX( HRES_TPM_E_AUDITFAIL_UNSUCCESSFUL , 2150105136U) /* 0x80280030 */ \ XXX( HRES_TPM_E_AUDITFAIL_SUCCESSFUL , 2150105137U) /* 0x80280031 */ \ XXX( HRES_TPM_E_NOTRESETABLE , 2150105138U) /* 0x80280032 */ \ XXX( HRES_TPM_E_NOTLOCAL , 2150105139U) /* 0x80280033 */ \ XXX( HRES_TPM_E_BAD_TYPE , 2150105140U) /* 0x80280034 */ \ XXX( HRES_TPM_E_INVALID_RESOURCE , 2150105141U) /* 0x80280035 */ \ XXX( HRES_TPM_E_NOTFIPS , 2150105142U) /* 0x80280036 */ \ XXX( HRES_TPM_E_INVALID_FAMILY , 2150105143U) /* 0x80280037 */ \ XXX( HRES_TPM_E_NO_NV_PERMISSION , 2150105144U) /* 0x80280038 */ \ XXX( HRES_TPM_E_REQUIRES_SIGN , 2150105145U) /* 0x80280039 */ \ XXX( HRES_TPM_E_KEY_NOTSUPPORTED , 2150105146U) /* 0x8028003a */ \ XXX( HRES_TPM_E_AUTH_CONFLICT , 2150105147U) /* 0x8028003b */ \ XXX( HRES_TPM_E_AREA_LOCKED , 2150105148U) /* 0x8028003c */ \ XXX( HRES_TPM_E_BAD_LOCALITY , 2150105149U) /* 0x8028003d */ \ XXX( HRES_TPM_E_READ_ONLY , 2150105150U) /* 0x8028003e */ \ XXX( HRES_TPM_E_PER_NOWRITE , 2150105151U) /* 0x8028003f */ \ XXX( HRES_TPM_E_FAMILYCOUNT , 2150105152U) /* 0x80280040 */ \ XXX( HRES_TPM_E_WRITE_LOCKED , 2150105153U) /* 0x80280041 */ \ XXX( HRES_TPM_E_BAD_ATTRIBUTES , 2150105154U) /* 0x80280042 */ \ XXX( HRES_TPM_E_INVALID_STRUCTURE , 2150105155U) /* 0x80280043 */ \ XXX( HRES_TPM_E_KEY_OWNER_CONTROL , 2150105156U) /* 0x80280044 */ \ XXX( HRES_TPM_E_BAD_COUNTER , 2150105157U) /* 0x80280045 */ \ XXX( HRES_TPM_E_NOT_FULLWRITE , 2150105158U) /* 0x80280046 */ \ XXX( HRES_TPM_E_CONTEXT_GAP , 2150105159U) /* 0x80280047 */ \ XXX( HRES_TPM_E_MAXNVWRITES , 2150105160U) /* 0x80280048 */ \ XXX( HRES_TPM_E_NOOPERATOR , 2150105161U) /* 0x80280049 */ \ XXX( HRES_TPM_E_RESOURCEMISSING , 2150105162U) /* 0x8028004a */ \ XXX( HRES_TPM_E_DELEGATE_LOCK , 2150105163U) /* 0x8028004b */ \ XXX( HRES_TPM_E_DELEGATE_FAMILY , 2150105164U) /* 0x8028004c */ \ XXX( HRES_TPM_E_DELEGATE_ADMIN , 2150105165U) /* 0x8028004d */ \ XXX( HRES_TPM_E_TRANSPORT_NOTEXCLUSIVE , 2150105166U) /* 0x8028004e */ \ XXX( HRES_TPM_E_OWNER_CONTROL , 2150105167U) /* 0x8028004f */ \ XXX( HRES_TPM_E_DAA_RESOURCES , 2150105168U) /* 0x80280050 */ \ XXX( HRES_TPM_E_DAA_INPUT_DATA0 , 2150105169U) /* 0x80280051 */ \ XXX( HRES_TPM_E_DAA_INPUT_DATA1 , 2150105170U) /* 0x80280052 */ \ XXX( HRES_TPM_E_DAA_ISSUER_SETTINGS , 2150105171U) /* 0x80280053 */ \ XXX( HRES_TPM_E_DAA_TPM_SETTINGS , 2150105172U) /* 0x80280054 */ \ XXX( HRES_TPM_E_DAA_STAGE , 2150105173U) /* 0x80280055 */ \ XXX( HRES_TPM_E_DAA_ISSUER_VALIDITY , 2150105174U) /* 0x80280056 */ \ XXX( HRES_TPM_E_DAA_WRONG_W , 2150105175U) /* 0x80280057 */ \ XXX( HRES_TPM_E_BAD_HANDLE , 2150105176U) /* 0x80280058 */ \ XXX( HRES_TPM_E_BAD_DELEGATE , 2150105177U) /* 0x80280059 */ \ XXX( HRES_TPM_E_BADCONTEXT , 2150105178U) /* 0x8028005a */ \ XXX( HRES_TPM_E_TOOMANYCONTEXTS , 2150105179U) /* 0x8028005b */ \ XXX( HRES_TPM_E_MA_TICKET_SIGNATURE , 2150105180U) /* 0x8028005c */ \ XXX( HRES_TPM_E_MA_DESTINATION , 2150105181U) /* 0x8028005d */ \ XXX( HRES_TPM_E_MA_SOURCE , 2150105182U) /* 0x8028005e */ \ XXX( HRES_TPM_E_MA_AUTHORITY , 2150105183U) /* 0x8028005f */ \ XXX( HRES_TPM_E_PERMANENTEK , 2150105185U) /* 0x80280061 */ \ XXX( HRES_TPM_E_BAD_SIGNATURE , 2150105186U) /* 0x80280062 */ \ XXX( HRES_TPM_E_NOCONTEXTSPACE , 2150105187U) /* 0x80280063 */ \ XXX( HRES_TPM_E_COMMAND_BLOCKED , 2150106112U) /* 0x80280400 */ \ XXX( HRES_TPM_E_INVALID_HANDLE , 2150106113U) /* 0x80280401 */ \ XXX( HRES_TPM_E_DUPLICATE_VHANDLE , 2150106114U) /* 0x80280402 */ \ XXX( HRES_TPM_E_EMBEDDED_COMMAND_BLOCKED , 2150106115U) /* 0x80280403 */ \ XXX( HRES_TPM_E_EMBEDDED_COMMAND_UNSUPPORTED , 2150106116U) /* 0x80280404 */ \ XXX( HRES_TPM_E_RETRY , 2150107136U) /* 0x80280800 */ \ XXX( HRES_TPM_E_NEEDS_SELFTEST , 2150107137U) /* 0x80280801 */ \ XXX( HRES_TPM_E_DOING_SELFTEST , 2150107138U) /* 0x80280802 */ \ XXX( HRES_TPM_E_DEFEND_LOCK_RUNNING , 2150107139U) /* 0x80280803 */ \ XXX( HRES_TBS_E_INTERNAL_ERROR , 2150121473U) /* 0x80284001 */ \ XXX( HRES_TBS_E_BAD_PARAMETER , 2150121474U) /* 0x80284002 */ \ XXX( HRES_TBS_E_INVALID_OUTPUT_POINTER , 2150121475U) /* 0x80284003 */ \ XXX( HRES_TBS_E_INVALID_CONTEXT , 2150121476U) /* 0x80284004 */ \ XXX( HRES_TBS_E_INSUFFICIENT_BUFFER , 2150121477U) /* 0x80284005 */ \ XXX( HRES_TBS_E_IOERROR , 2150121478U) /* 0x80284006 */ \ XXX( HRES_TBS_E_INVALID_CONTEXT_PARAM , 2150121479U) /* 0x80284007 */ \ XXX( HRES_TBS_E_SERVICE_NOT_RUNNING , 2150121480U) /* 0x80284008 */ \ XXX( HRES_TBS_E_TOO_MANY_TBS_CONTEXTS , 2150121481U) /* 0x80284009 */ \ XXX( HRES_TBS_E_TOO_MANY_RESOURCES , 2150121482U) /* 0x8028400a */ \ XXX( HRES_TBS_E_SERVICE_START_PENDING , 2150121483U) /* 0x8028400b */ \ XXX( HRES_TBS_E_PPI_NOT_SUPPORTED , 2150121484U) /* 0x8028400c */ \ XXX( HRES_TBS_E_COMMAND_CANCELED , 2150121485U) /* 0x8028400d */ \ XXX( HRES_TBS_E_BUFFER_TOO_LARGE , 2150121486U) /* 0x8028400e */ \ XXX( HRES_TPMAPI_E_INVALID_STATE , 2150170880U) /* 0x80290100 */ \ XXX( HRES_TPMAPI_E_NOT_ENOUGH_DATA , 2150170881U) /* 0x80290101 */ \ XXX( HRES_TPMAPI_E_TOO_MUCH_DATA , 2150170882U) /* 0x80290102 */ \ XXX( HRES_TPMAPI_E_INVALID_OUTPUT_POINTER , 2150170883U) /* 0x80290103 */ \ XXX( HRES_TPMAPI_E_INVALID_PARAMETER , 2150170884U) /* 0x80290104 */ \ XXX( HRES_TPMAPI_E_OUT_OF_MEMORY , 2150170885U) /* 0x80290105 */ \ XXX( HRES_TPMAPI_E_BUFFER_TOO_SMALL , 2150170886U) /* 0x80290106 */ \ XXX( HRES_TPMAPI_E_INTERNAL_ERROR , 2150170887U) /* 0x80290107 */ \ XXX( HRES_TPMAPI_E_ACCESS_DENIED , 2150170888U) /* 0x80290108 */ \ XXX( HRES_TPMAPI_E_AUTHORIZATION_FAILED , 2150170889U) /* 0x80290109 */ \ XXX( HRES_TPMAPI_E_INVALID_CONTEXT_HANDLE , 2150170890U) /* 0x8029010a */ \ XXX( HRES_TPMAPI_E_TBS_COMMUNICATION_ERROR , 2150170891U) /* 0x8029010b */ \ XXX( HRES_TPMAPI_E_TPM_COMMAND_ERROR , 2150170892U) /* 0x8029010c */ \ XXX( HRES_TPMAPI_E_MESSAGE_TOO_LARGE , 2150170893U) /* 0x8029010d */ \ XXX( HRES_TPMAPI_E_INVALID_ENCODING , 2150170894U) /* 0x8029010e */ \ XXX( HRES_TPMAPI_E_INVALID_KEY_SIZE , 2150170895U) /* 0x8029010f */ \ XXX( HRES_TPMAPI_E_ENCRYPTION_FAILED , 2150170896U) /* 0x80290110 */ \ XXX( HRES_TPMAPI_E_INVALID_KEY_PARAMS , 2150170897U) /* 0x80290111 */ \ XXX( HRES_TPMAPI_E_INVALID_MIGRATION_AUTHORIZATION_BLOB, 2150170898U) /* 0x80290112 */ \ XXX( HRES_TPMAPI_E_INVALID_PCR_INDEX , 2150170899U) /* 0x80290113 */ \ XXX( HRES_TPMAPI_E_INVALID_DELEGATE_BLOB , 2150170900U) /* 0x80290114 */ \ XXX( HRES_TPMAPI_E_INVALID_CONTEXT_PARAMS , 2150170901U) /* 0x80290115 */ \ XXX( HRES_TPMAPI_E_INVALID_KEY_BLOB , 2150170902U) /* 0x80290116 */ \ XXX( HRES_TPMAPI_E_INVALID_PCR_DATA , 2150170903U) /* 0x80290117 */ \ XXX( HRES_TPMAPI_E_INVALID_OWNER_AUTH , 2150170904U) /* 0x80290118 */ \ XXX( HRES_TBSIMP_E_BUFFER_TOO_SMALL , 2150171136U) /* 0x80290200 */ \ XXX( HRES_TBSIMP_E_CLEANUP_FAILED , 2150171137U) /* 0x80290201 */ \ XXX( HRES_TBSIMP_E_INVALID_CONTEXT_HANDLE , 2150171138U) /* 0x80290202 */ \ XXX( HRES_TBSIMP_E_INVALID_CONTEXT_PARAM , 2150171139U) /* 0x80290203 */ \ XXX( HRES_TBSIMP_E_TPM_ERROR , 2150171140U) /* 0x80290204 */ \ XXX( HRES_TBSIMP_E_HASH_BAD_KEY , 2150171141U) /* 0x80290205 */ \ XXX( HRES_TBSIMP_E_DUPLICATE_VHANDLE , 2150171142U) /* 0x80290206 */ \ XXX( HRES_TBSIMP_E_INVALID_OUTPUT_POINTER , 2150171143U) /* 0x80290207 */ \ XXX( HRES_TBSIMP_E_INVALID_PARAMETER , 2150171144U) /* 0x80290208 */ \ XXX( HRES_TBSIMP_E_RPC_INIT_FAILED , 2150171145U) /* 0x80290209 */ \ XXX( HRES_TBSIMP_E_SCHEDULER_NOT_RUNNING , 2150171146U) /* 0x8029020a */ \ XXX( HRES_TBSIMP_E_COMMAND_CANCELED , 2150171147U) /* 0x8029020b */ \ XXX( HRES_TBSIMP_E_OUT_OF_MEMORY , 2150171148U) /* 0x8029020c */ \ XXX( HRES_TBSIMP_E_LIST_NO_MORE_ITEMS , 2150171149U) /* 0x8029020d */ \ XXX( HRES_TBSIMP_E_LIST_NOT_FOUND , 2150171150U) /* 0x8029020e */ \ XXX( HRES_TBSIMP_E_NOT_ENOUGH_SPACE , 2150171151U) /* 0x8029020f */ \ XXX( HRES_TBSIMP_E_NOT_ENOUGH_TPM_CONTEXTS , 2150171152U) /* 0x80290210 */ \ XXX( HRES_TBSIMP_E_COMMAND_FAILED , 2150171153U) /* 0x80290211 */ \ XXX( HRES_TBSIMP_E_UNKNOWN_ORDINAL , 2150171154U) /* 0x80290212 */ \ XXX( HRES_TBSIMP_E_RESOURCE_EXPIRED , 2150171155U) /* 0x80290213 */ \ XXX( HRES_TBSIMP_E_INVALID_RESOURCE , 2150171156U) /* 0x80290214 */ \ XXX( HRES_TBSIMP_E_NOTHING_TO_UNLOAD , 2150171157U) /* 0x80290215 */ \ XXX( HRES_TBSIMP_E_HASH_TABLE_FULL , 2150171158U) /* 0x80290216 */ \ XXX( HRES_TBSIMP_E_TOO_MANY_TBS_CONTEXTS , 2150171159U) /* 0x80290217 */ \ XXX( HRES_TBSIMP_E_TOO_MANY_RESOURCES , 2150171160U) /* 0x80290218 */ \ XXX( HRES_TBSIMP_E_PPI_NOT_SUPPORTED , 2150171161U) /* 0x80290219 */ \ XXX( HRES_TBSIMP_E_TPM_INCOMPATIBLE , 2150171162U) /* 0x8029021a */ \ XXX( HRES_TPM_E_PPI_ACPI_FAILURE , 2150171392U) /* 0x80290300 */ \ XXX( HRES_TPM_E_PPI_USER_ABORT , 2150171393U) /* 0x80290301 */ \ XXX( HRES_TPM_E_PPI_BIOS_FAILURE , 2150171394U) /* 0x80290302 */ \ XXX( HRES_TPM_E_PPI_NOT_SUPPORTED , 2150171395U) /* 0x80290303 */ \ XXX( HRES_PLA_E_DCS_NOT_FOUND , 2150629378U) /* 0x80300002 */ \ XXX( HRES_PLA_E_TOO_MANY_FOLDERS , 2150629445U) /* 0x80300045 */ \ XXX( HRES_PLA_E_NO_MIN_DISK , 2150629488U) /* 0x80300070 */ \ XXX( HRES_PLA_E_DCS_IN_USE , 2150629546U) /* 0x803000aa */ \ XXX( HRES_PLA_E_DCS_ALREADY_EXISTS , 2150629559U) /* 0x803000b7 */ \ XXX( HRES_PLA_E_PROPERTY_CONFLICT , 2150629633U) /* 0x80300101 */ \ XXX( HRES_PLA_E_DCS_SINGLETON_REQUIRED , 2150629634U) /* 0x80300102 */ \ XXX( HRES_PLA_E_CREDENTIALS_REQUIRED , 2150629635U) /* 0x80300103 */ \ XXX( HRES_PLA_E_DCS_NOT_RUNNING , 2150629636U) /* 0x80300104 */ \ XXX( HRES_PLA_E_CONFLICT_INCL_EXCL_API , 2150629637U) /* 0x80300105 */ \ XXX( HRES_PLA_E_NETWORK_EXE_NOT_VALID , 2150629638U) /* 0x80300106 */ \ XXX( HRES_PLA_E_EXE_ALREADY_CONFIGURED , 2150629639U) /* 0x80300107 */ \ XXX( HRES_PLA_E_EXE_PATH_NOT_VALID , 2150629640U) /* 0x80300108 */ \ XXX( HRES_PLA_E_DC_ALREADY_EXISTS , 2150629641U) /* 0x80300109 */ \ XXX( HRES_PLA_E_DCS_START_WAIT_TIMEOUT , 2150629642U) /* 0x8030010a */ \ XXX( HRES_PLA_E_DC_START_WAIT_TIMEOUT , 2150629643U) /* 0x8030010b */ \ XXX( HRES_PLA_E_REPORT_WAIT_TIMEOUT , 2150629644U) /* 0x8030010c */ \ XXX( HRES_PLA_E_NO_DUPLICATES , 2150629645U) /* 0x8030010d */ \ XXX( HRES_PLA_E_EXE_FULL_PATH_REQUIRED , 2150629646U) /* 0x8030010e */ \ XXX( HRES_PLA_E_INVALID_SESSION_NAME , 2150629647U) /* 0x8030010f */ \ XXX( HRES_PLA_E_PLA_CHANNEL_NOT_ENABLED , 2150629648U) /* 0x80300110 */ \ XXX( HRES_PLA_E_TASKSCHED_CHANNEL_NOT_ENABLED , 2150629649U) /* 0x80300111 */ \ XXX( HRES_FVE_E_LOCKED_VOLUME , 2150694912U) /* 0x80310000 */ \ XXX( HRES_FVE_E_NOT_ENCRYPTED , 2150694913U) /* 0x80310001 */ \ XXX( HRES_FVE_E_NO_TPM_BIOS , 2150694914U) /* 0x80310002 */ \ XXX( HRES_FVE_E_NO_MBR_METRIC , 2150694915U) /* 0x80310003 */ \ XXX( HRES_FVE_E_NO_BOOTSECTOR_METRIC , 2150694916U) /* 0x80310004 */ \ XXX( HRES_FVE_E_NO_BOOTMGR_METRIC , 2150694917U) /* 0x80310005 */ \ XXX( HRES_FVE_E_WRONG_BOOTMGR , 2150694918U) /* 0x80310006 */ \ XXX( HRES_FVE_E_SECURE_KEY_REQUIRED , 2150694919U) /* 0x80310007 */ \ XXX( HRES_FVE_E_NOT_ACTIVATED , 2150694920U) /* 0x80310008 */ \ XXX( HRES_FVE_E_ACTION_NOT_ALLOWED , 2150694921U) /* 0x80310009 */ \ XXX( HRES_FVE_E_AD_SCHEMA_NOT_INSTALLED , 2150694922U) /* 0x8031000a */ \ XXX( HRES_FVE_E_AD_INVALID_DATATYPE , 2150694923U) /* 0x8031000b */ \ XXX( HRES_FVE_E_AD_INVALID_DATASIZE , 2150694924U) /* 0x8031000c */ \ XXX( HRES_FVE_E_AD_NO_VALUES , 2150694925U) /* 0x8031000d */ \ XXX( HRES_FVE_E_AD_ATTR_NOT_SET , 2150694926U) /* 0x8031000e */ \ XXX( HRES_FVE_E_AD_GUID_NOT_FOUND , 2150694927U) /* 0x8031000f */ \ XXX( HRES_FVE_E_BAD_INFORMATION , 2150694928U) /* 0x80310010 */ \ XXX( HRES_FVE_E_TOO_SMALL , 2150694929U) /* 0x80310011 */ \ XXX( HRES_FVE_E_SYSTEM_VOLUME , 2150694930U) /* 0x80310012 */ \ XXX( HRES_FVE_E_FAILED_WRONG_FS , 2150694931U) /* 0x80310013 */ \ XXX( HRES_FVE_E_FAILED_BAD_FS , 2150694932U) /* 0x80310014 */ \ XXX( HRES_FVE_E_NOT_SUPPORTED , 2150694933U) /* 0x80310015 */ \ XXX( HRES_FVE_E_BAD_DATA , 2150694934U) /* 0x80310016 */ \ XXX( HRES_FVE_E_VOLUME_NOT_BOUND , 2150694935U) /* 0x80310017 */ \ XXX( HRES_FVE_E_TPM_NOT_OWNED , 2150694936U) /* 0x80310018 */ \ XXX( HRES_FVE_E_NOT_DATA_VOLUME , 2150694937U) /* 0x80310019 */ \ XXX( HRES_FVE_E_AD_INSUFFICIENT_BUFFER , 2150694938U) /* 0x8031001a */ \ XXX( HRES_FVE_E_CONV_READ , 2150694939U) /* 0x8031001b */ \ XXX( HRES_FVE_E_CONV_WRITE , 2150694940U) /* 0x8031001c */ \ XXX( HRES_FVE_E_KEY_REQUIRED , 2150694941U) /* 0x8031001d */ \ XXX( HRES_FVE_E_CLUSTERING_NOT_SUPPORTED , 2150694942U) /* 0x8031001e */ \ XXX( HRES_FVE_E_VOLUME_BOUND_ALREADY , 2150694943U) /* 0x8031001f */ \ XXX( HRES_FVE_E_OS_NOT_PROTECTED , 2150694944U) /* 0x80310020 */ \ XXX( HRES_FVE_E_PROTECTION_DISABLED , 2150694945U) /* 0x80310021 */ \ XXX( HRES_FVE_E_RECOVERY_KEY_REQUIRED , 2150694946U) /* 0x80310022 */ \ XXX( HRES_FVE_E_FOREIGN_VOLUME , 2150694947U) /* 0x80310023 */ \ XXX( HRES_FVE_E_OVERLAPPED_UPDATE , 2150694948U) /* 0x80310024 */ \ XXX( HRES_FVE_E_TPM_SRK_AUTH_NOT_ZERO , 2150694949U) /* 0x80310025 */ \ XXX( HRES_FVE_E_FAILED_SECTOR_SIZE , 2150694950U) /* 0x80310026 */ \ XXX( HRES_FVE_E_FAILED_AUTHENTICATION , 2150694951U) /* 0x80310027 */ \ XXX( HRES_FVE_E_NOT_OS_VOLUME , 2150694952U) /* 0x80310028 */ \ XXX( HRES_FVE_E_AUTOUNLOCK_ENABLED , 2150694953U) /* 0x80310029 */ \ XXX( HRES_FVE_E_WRONG_BOOTSECTOR , 2150694954U) /* 0x8031002a */ \ XXX( HRES_FVE_E_WRONG_SYSTEM_FS , 2150694955U) /* 0x8031002b */ \ XXX( HRES_FVE_E_POLICY_PASSWORD_REQUIRED , 2150694956U) /* 0x8031002c */ \ XXX( HRES_FVE_E_CANNOT_SET_FVEK_ENCRYPTED , 2150694957U) /* 0x8031002d */ \ XXX( HRES_FVE_E_CANNOT_ENCRYPT_NO_KEY , 2150694958U) /* 0x8031002e */ \ XXX( HRES_FVE_E_BOOTABLE_CDDVD , 2150694960U) /* 0x80310030 */ \ XXX( HRES_FVE_E_PROTECTOR_EXISTS , 2150694961U) /* 0x80310031 */ \ XXX( HRES_FVE_E_RELATIVE_PATH , 2150694962U) /* 0x80310032 */ \ XXX( HRES_FWP_E_CALLOUT_NOT_FOUND , 2150760449U) /* 0x80320001 */ \ XXX( HRES_FWP_E_CONDITION_NOT_FOUND , 2150760450U) /* 0x80320002 */ \ XXX( HRES_FWP_E_FILTER_NOT_FOUND , 2150760451U) /* 0x80320003 */ \ XXX( HRES_FWP_E_LAYER_NOT_FOUND , 2150760452U) /* 0x80320004 */ \ XXX( HRES_FWP_E_PROVIDER_NOT_FOUND , 2150760453U) /* 0x80320005 */ \ XXX( HRES_FWP_E_PROVIDER_CONTEXT_NOT_FOUND , 2150760454U) /* 0x80320006 */ \ XXX( HRES_FWP_E_SUBLAYER_NOT_FOUND , 2150760455U) /* 0x80320007 */ \ XXX( HRES_FWP_E_NOT_FOUND , 2150760456U) /* 0x80320008 */ \ XXX( HRES_FWP_E_ALREADY_EXISTS , 2150760457U) /* 0x80320009 */ \ XXX( HRES_FWP_E_IN_USE , 2150760458U) /* 0x8032000a */ \ XXX( HRES_FWP_E_DYNAMIC_SESSION_IN_PROGRESS , 2150760459U) /* 0x8032000b */ \ XXX( HRES_FWP_E_WRONG_SESSION , 2150760460U) /* 0x8032000c */ \ XXX( HRES_FWP_E_NO_TXN_IN_PROGRESS , 2150760461U) /* 0x8032000d */ \ XXX( HRES_FWP_E_TXN_IN_PROGRESS , 2150760462U) /* 0x8032000e */ \ XXX( HRES_FWP_E_TXN_ABORTED , 2150760463U) /* 0x8032000f */ \ XXX( HRES_FWP_E_SESSION_ABORTED , 2150760464U) /* 0x80320010 */ \ XXX( HRES_FWP_E_INCOMPATIBLE_TXN , 2150760465U) /* 0x80320011 */ \ XXX( HRES_FWP_E_TIMEOUT , 2150760466U) /* 0x80320012 */ \ XXX( HRES_FWP_E_NET_EVENTS_DISABLED , 2150760467U) /* 0x80320013 */ \ XXX( HRES_FWP_E_INCOMPATIBLE_LAYER , 2150760468U) /* 0x80320014 */ \ XXX( HRES_FWP_E_KM_CLIENTS_ONLY , 2150760469U) /* 0x80320015 */ \ XXX( HRES_FWP_E_LIFETIME_MISMATCH , 2150760470U) /* 0x80320016 */ \ XXX( HRES_FWP_E_BUILTIN_OBJECT , 2150760471U) /* 0x80320017 */ \ XXX( HRES_FWP_E_TOO_MANY_BOOTTIME_FILTERS , 2150760472U) /* 0x80320018 */ \ XXX( HRES_FWP_E_NOTIFICATION_DROPPED , 2150760473U) /* 0x80320019 */ \ XXX( HRES_FWP_E_TRAFFIC_MISMATCH , 2150760474U) /* 0x8032001a */ \ XXX( HRES_FWP_E_INCOMPATIBLE_SA_STATE , 2150760475U) /* 0x8032001b */ \ XXX( HRES_FWP_E_NULL_POINTER , 2150760476U) /* 0x8032001c */ \ XXX( HRES_FWP_E_INVALID_ENUMERATOR , 2150760477U) /* 0x8032001d */ \ XXX( HRES_FWP_E_INVALID_FLAGS , 2150760478U) /* 0x8032001e */ \ XXX( HRES_FWP_E_INVALID_NET_MASK , 2150760479U) /* 0x8032001f */ \ XXX( HRES_FWP_E_INVALID_RANGE , 2150760480U) /* 0x80320020 */ \ XXX( HRES_FWP_E_INVALID_INTERVAL , 2150760481U) /* 0x80320021 */ \ XXX( HRES_FWP_E_ZERO_LENGTH_ARRAY , 2150760482U) /* 0x80320022 */ \ XXX( HRES_FWP_E_NULL_DISPLAY_NAME , 2150760483U) /* 0x80320023 */ \ XXX( HRES_FWP_E_INVALID_ACTION_TYPE , 2150760484U) /* 0x80320024 */ \ XXX( HRES_FWP_E_INVALID_WEIGHT , 2150760485U) /* 0x80320025 */ \ XXX( HRES_FWP_E_MATCH_TYPE_MISMATCH , 2150760486U) /* 0x80320026 */ \ XXX( HRES_FWP_E_TYPE_MISMATCH , 2150760487U) /* 0x80320027 */ \ XXX( HRES_FWP_E_OUT_OF_BOUNDS , 2150760488U) /* 0x80320028 */ \ XXX( HRES_FWP_E_RESERVED , 2150760489U) /* 0x80320029 */ \ XXX( HRES_FWP_E_DUPLICATE_CONDITION , 2150760490U) /* 0x8032002a */ \ XXX( HRES_FWP_E_DUPLICATE_KEYMOD , 2150760491U) /* 0x8032002b */ \ XXX( HRES_FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER , 2150760492U) /* 0x8032002c */ \ XXX( HRES_FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER , 2150760493U) /* 0x8032002d */ \ XXX( HRES_FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER , 2150760494U) /* 0x8032002e */ \ XXX( HRES_FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT , 2150760495U) /* 0x8032002f */ \ XXX( HRES_FWP_E_INCOMPATIBLE_AUTH_METHOD , 2150760496U) /* 0x80320030 */ \ XXX( HRES_FWP_E_INCOMPATIBLE_DH_GROUP , 2150760497U) /* 0x80320031 */ \ XXX( HRES_FWP_E_EM_NOT_SUPPORTED , 2150760498U) /* 0x80320032 */ \ XXX( HRES_FWP_E_NEVER_MATCH , 2150760499U) /* 0x80320033 */ \ XXX( HRES_FWP_E_PROVIDER_CONTEXT_MISMATCH , 2150760500U) /* 0x80320034 */ \ XXX( HRES_FWP_E_INVALID_PARAMETER , 2150760501U) /* 0x80320035 */ \ XXX( HRES_FWP_E_TOO_MANY_SUBLAYERS , 2150760502U) /* 0x80320036 */ \ XXX( HRES_FWP_E_CALLOUT_NOTIFICATION_FAILED , 2150760503U) /* 0x80320037 */ \ XXX( HRES_FWP_E_INCOMPATIBLE_AUTH_CONFIG , 2150760504U) /* 0x80320038 */ \ XXX( HRES_FWP_E_INCOMPATIBLE_CIPHER_CONFIG , 2150760505U) /* 0x80320039 */ \ XXX( HRES_ERROR_NDIS_INTERFACE_CLOSING , 2150891522U) /* 0x80340002 */ \ XXX( HRES_ERROR_NDIS_BAD_VERSION , 2150891524U) /* 0x80340004 */ \ XXX( HRES_ERROR_NDIS_BAD_CHARACTERISTICS , 2150891525U) /* 0x80340005 */ \ XXX( HRES_ERROR_NDIS_ADAPTER_NOT_FOUND , 2150891526U) /* 0x80340006 */ \ XXX( HRES_ERROR_NDIS_OPEN_FAILED , 2150891527U) /* 0x80340007 */ \ XXX( HRES_ERROR_NDIS_DEVICE_FAILED , 2150891528U) /* 0x80340008 */ \ XXX( HRES_ERROR_NDIS_MULTICAST_FULL , 2150891529U) /* 0x80340009 */ \ XXX( HRES_ERROR_NDIS_MULTICAST_EXISTS , 2150891530U) /* 0x8034000a */ \ XXX( HRES_ERROR_NDIS_MULTICAST_NOT_FOUND , 2150891531U) /* 0x8034000b */ \ XXX( HRES_ERROR_NDIS_REQUEST_ABORTED , 2150891532U) /* 0x8034000c */ \ XXX( HRES_ERROR_NDIS_RESET_IN_PROGRESS , 2150891533U) /* 0x8034000d */ \ XXX( HRES_ERROR_NDIS_INVALID_PACKET , 2150891535U) /* 0x8034000f */ \ XXX( HRES_ERROR_NDIS_INVALID_DEVICE_REQUEST , 2150891536U) /* 0x80340010 */ \ XXX( HRES_ERROR_NDIS_ADAPTER_NOT_READY , 2150891537U) /* 0x80340011 */ \ XXX( HRES_ERROR_NDIS_INVALID_LENGTH , 2150891540U) /* 0x80340014 */ \ XXX( HRES_ERROR_NDIS_INVALID_DATA , 2150891541U) /* 0x80340015 */ \ XXX( HRES_ERROR_NDIS_BUFFER_TOO_SHORT , 2150891542U) /* 0x80340016 */ \ XXX( HRES_ERROR_NDIS_INVALID_OID , 2150891543U) /* 0x80340017 */ \ XXX( HRES_ERROR_NDIS_ADAPTER_REMOVED , 2150891544U) /* 0x80340018 */ \ XXX( HRES_ERROR_NDIS_UNSUPPORTED_MEDIA , 2150891545U) /* 0x80340019 */ \ XXX( HRES_ERROR_NDIS_GROUP_ADDRESS_IN_USE , 2150891546U) /* 0x8034001a */ \ XXX( HRES_ERROR_NDIS_FILE_NOT_FOUND , 2150891547U) /* 0x8034001b */ \ XXX( HRES_ERROR_NDIS_ERROR_READING_FILE , 2150891548U) /* 0x8034001c */ \ XXX( HRES_ERROR_NDIS_ALREADY_MAPPED , 2150891549U) /* 0x8034001d */ \ XXX( HRES_ERROR_NDIS_RESOURCE_CONFLICT , 2150891550U) /* 0x8034001e */ \ XXX( HRES_ERROR_NDIS_MEDIA_DISCONNECTED , 2150891551U) /* 0x8034001f */ \ XXX( HRES_ERROR_NDIS_INVALID_ADDRESS , 2150891554U) /* 0x80340022 */ \ XXX( HRES_ERROR_NDIS_PAUSED , 2150891562U) /* 0x8034002a */ \ XXX( HRES_ERROR_NDIS_INTERFACE_NOT_FOUND , 2150891563U) /* 0x8034002b */ \ XXX( HRES_ERROR_NDIS_UNSUPPORTED_REVISION , 2150891564U) /* 0x8034002c */ \ XXX( HRES_ERROR_NDIS_INVALID_PORT , 2150891565U) /* 0x8034002d */ \ XXX( HRES_ERROR_NDIS_INVALID_PORT_STATE , 2150891566U) /* 0x8034002e */ \ XXX( HRES_ERROR_NDIS_NOT_SUPPORTED , 2150891707U) /* 0x803400bb */ \ XXX( HRES_ERROR_NDIS_DOT11_AUTO_CONFIG_ENABLED , 2150899712U) /* 0x80342000 */ \ XXX( HRES_ERROR_NDIS_DOT11_MEDIA_IN_USE , 2150899713U) /* 0x80342001 */ \ XXX( HRES_ERROR_NDIS_DOT11_POWER_STATE_INVALID , 2150899714U) /* 0x80342002 */ \ XXX( HRES_TRK_E_NOT_FOUND , 2380976155U) /* 0x8dead01b */ \ XXX( HRES_TRK_E_VOLUME_QUOTA_EXCEEDED , 2380976156U) /* 0x8dead01c */ \ XXX( HRES_TRK_SERVER_TOO_BUSY , 2380976158U) /* 0x8dead01e */ \ XXX( HRES_ERROR_AUDITING_DISABLED , 3221815297U) /* 0xc0090001 */ \ XXX( HRES_ERROR_ALL_SIDS_FILTERED , 3221815298U) /* 0xc0090002 */ \ XXX( HRES_ERROR_BIZRULES_NOT_ENABLED , 3221815299U) /* 0xc0090003 */ \ XXX( HRES_NS_E_NOCONNECTION , 3222077445U) /* 0xc00d0005 */ \ XXX( HRES_NS_E_CANNOTCONNECT , 3222077446U) /* 0xc00d0006 */ \ XXX( HRES_NS_E_CANNOTDESTROYTITLE , 3222077447U) /* 0xc00d0007 */ \ XXX( HRES_NS_E_CANNOTRENAMETITLE , 3222077448U) /* 0xc00d0008 */ \ XXX( HRES_NS_E_CANNOTOFFLINEDISK , 3222077449U) /* 0xc00d0009 */ \ XXX( HRES_NS_E_CANNOTONLINEDISK , 3222077450U) /* 0xc00d000a */ \ XXX( HRES_NS_E_NOREGISTEREDWALKER , 3222077451U) /* 0xc00d000b */ \ XXX( HRES_NS_E_NOFUNNEL , 3222077452U) /* 0xc00d000c */ \ XXX( HRES_NS_E_NO_LOCALPLAY , 3222077453U) /* 0xc00d000d */ \ XXX( HRES_NS_E_NETWORK_BUSY , 3222077454U) /* 0xc00d000e */ \ XXX( HRES_NS_E_TOO_MANY_SESS , 3222077455U) /* 0xc00d000f */ \ XXX( HRES_NS_E_ALREADY_CONNECTED , 3222077456U) /* 0xc00d0010 */ \ XXX( HRES_NS_E_INVALID_INDEX , 3222077457U) /* 0xc00d0011 */ \ XXX( HRES_NS_E_PROTOCOL_MISMATCH , 3222077458U) /* 0xc00d0012 */ \ XXX( HRES_NS_E_TIMEOUT , 3222077459U) /* 0xc00d0013 */ \ XXX( HRES_NS_E_NET_WRITE , 3222077460U) /* 0xc00d0014 */ \ XXX( HRES_NS_E_NET_READ , 3222077461U) /* 0xc00d0015 */ \ XXX( HRES_NS_E_DISK_WRITE , 3222077462U) /* 0xc00d0016 */ \ XXX( HRES_NS_E_DISK_READ , 3222077463U) /* 0xc00d0017 */ \ XXX( HRES_NS_E_FILE_WRITE , 3222077464U) /* 0xc00d0018 */ \ XXX( HRES_NS_E_FILE_READ , 3222077465U) /* 0xc00d0019 */ \ XXX( HRES_NS_E_FILE_NOT_FOUND , 3222077466U) /* 0xc00d001a */ \ XXX( HRES_NS_E_FILE_EXISTS , 3222077467U) /* 0xc00d001b */ \ XXX( HRES_NS_E_INVALID_NAME , 3222077468U) /* 0xc00d001c */ \ XXX( HRES_NS_E_FILE_OPEN_FAILED , 3222077469U) /* 0xc00d001d */ \ XXX( HRES_NS_E_FILE_ALLOCATION_FAILED , 3222077470U) /* 0xc00d001e */ \ XXX( HRES_NS_E_FILE_INIT_FAILED , 3222077471U) /* 0xc00d001f */ \ XXX( HRES_NS_E_FILE_PLAY_FAILED , 3222077472U) /* 0xc00d0020 */ \ XXX( HRES_NS_E_SET_DISK_UID_FAILED , 3222077473U) /* 0xc00d0021 */ \ XXX( HRES_NS_E_INDUCED , 3222077474U) /* 0xc00d0022 */ \ XXX( HRES_NS_E_CCLINK_DOWN , 3222077475U) /* 0xc00d0023 */ \ XXX( HRES_NS_E_INTERNAL , 3222077476U) /* 0xc00d0024 */ \ XXX( HRES_NS_E_BUSY , 3222077477U) /* 0xc00d0025 */ \ XXX( HRES_NS_E_UNRECOGNIZED_STREAM_TYPE , 3222077478U) /* 0xc00d0026 */ \ XXX( HRES_NS_E_NETWORK_SERVICE_FAILURE , 3222077479U) /* 0xc00d0027 */ \ XXX( HRES_NS_E_NETWORK_RESOURCE_FAILURE , 3222077480U) /* 0xc00d0028 */ \ XXX( HRES_NS_E_CONNECTION_FAILURE , 3222077481U) /* 0xc00d0029 */ \ XXX( HRES_NS_E_SHUTDOWN , 3222077482U) /* 0xc00d002a */ \ XXX( HRES_NS_E_INVALID_REQUEST , 3222077483U) /* 0xc00d002b */ \ XXX( HRES_NS_E_INSUFFICIENT_BANDWIDTH , 3222077484U) /* 0xc00d002c */ \ XXX( HRES_NS_E_NOT_REBUILDING , 3222077485U) /* 0xc00d002d */ \ XXX( HRES_NS_E_LATE_OPERATION , 3222077486U) /* 0xc00d002e */ \ XXX( HRES_NS_E_INVALID_DATA , 3222077487U) /* 0xc00d002f */ \ XXX( HRES_NS_E_FILE_BANDWIDTH_LIMIT , 3222077488U) /* 0xc00d0030 */ \ XXX( HRES_NS_E_OPEN_FILE_LIMIT , 3222077489U) /* 0xc00d0031 */ \ XXX( HRES_NS_E_BAD_CONTROL_DATA , 3222077490U) /* 0xc00d0032 */ \ XXX( HRES_NS_E_NO_STREAM , 3222077491U) /* 0xc00d0033 */ \ XXX( HRES_NS_E_STREAM_END , 3222077492U) /* 0xc00d0034 */ \ XXX( HRES_NS_E_SERVER_NOT_FOUND , 3222077493U) /* 0xc00d0035 */ \ XXX( HRES_NS_E_DUPLICATE_NAME , 3222077494U) /* 0xc00d0036 */ \ XXX( HRES_NS_E_DUPLICATE_ADDRESS , 3222077495U) /* 0xc00d0037 */ \ XXX( HRES_NS_E_BAD_MULTICAST_ADDRESS , 3222077496U) /* 0xc00d0038 */ \ XXX( HRES_NS_E_BAD_ADAPTER_ADDRESS , 3222077497U) /* 0xc00d0039 */ \ XXX( HRES_NS_E_BAD_DELIVERY_MODE , 3222077498U) /* 0xc00d003a */ \ XXX( HRES_NS_E_INVALID_CHANNEL , 3222077499U) /* 0xc00d003b */ \ XXX( HRES_NS_E_INVALID_STREAM , 3222077500U) /* 0xc00d003c */ \ XXX( HRES_NS_E_INVALID_ARCHIVE , 3222077501U) /* 0xc00d003d */ \ XXX( HRES_NS_E_NOTITLES , 3222077502U) /* 0xc00d003e */ \ XXX( HRES_NS_E_INVALID_CLIENT , 3222077503U) /* 0xc00d003f */ \ XXX( HRES_NS_E_INVALID_BLACKHOLE_ADDRESS , 3222077504U) /* 0xc00d0040 */ \ XXX( HRES_NS_E_INCOMPATIBLE_FORMAT , 3222077505U) /* 0xc00d0041 */ \ XXX( HRES_NS_E_INVALID_KEY , 3222077506U) /* 0xc00d0042 */ \ XXX( HRES_NS_E_INVALID_PORT , 3222077507U) /* 0xc00d0043 */ \ XXX( HRES_NS_E_INVALID_TTL , 3222077508U) /* 0xc00d0044 */ \ XXX( HRES_NS_E_STRIDE_REFUSED , 3222077509U) /* 0xc00d0045 */ \ XXX( HRES_NS_E_MMSAUTOSERVER_CANTFINDWALKER , 3222077510U) /* 0xc00d0046 */ \ XXX( HRES_NS_E_MAX_BITRATE , 3222077511U) /* 0xc00d0047 */ \ XXX( HRES_NS_E_LOGFILEPERIOD , 3222077512U) /* 0xc00d0048 */ \ XXX( HRES_NS_E_MAX_CLIENTS , 3222077513U) /* 0xc00d0049 */ \ XXX( HRES_NS_E_LOG_FILE_SIZE , 3222077514U) /* 0xc00d004a */ \ XXX( HRES_NS_E_MAX_FILERATE , 3222077515U) /* 0xc00d004b */ \ XXX( HRES_NS_E_WALKER_UNKNOWN , 3222077516U) /* 0xc00d004c */ \ XXX( HRES_NS_E_WALKER_SERVER , 3222077517U) /* 0xc00d004d */ \ XXX( HRES_NS_E_WALKER_USAGE , 3222077518U) /* 0xc00d004e */ \ XXX( HRES_NS_E_TIGER_FAIL , 3222077520U) /* 0xc00d0050 */ \ XXX( HRES_NS_E_CUB_FAIL , 3222077523U) /* 0xc00d0053 */ \ XXX( HRES_NS_E_DISK_FAIL , 3222077525U) /* 0xc00d0055 */ \ XXX( HRES_NS_E_MAX_FUNNELS_ALERT , 3222077536U) /* 0xc00d0060 */ \ XXX( HRES_NS_E_ALLOCATE_FILE_FAIL , 3222077537U) /* 0xc00d0061 */ \ XXX( HRES_NS_E_PAGING_ERROR , 3222077538U) /* 0xc00d0062 */ \ XXX( HRES_NS_E_BAD_BLOCK0_VERSION , 3222077539U) /* 0xc00d0063 */ \ XXX( HRES_NS_E_BAD_DISK_UID , 3222077540U) /* 0xc00d0064 */ \ XXX( HRES_NS_E_BAD_FSMAJOR_VERSION , 3222077541U) /* 0xc00d0065 */ \ XXX( HRES_NS_E_BAD_STAMPNUMBER , 3222077542U) /* 0xc00d0066 */ \ XXX( HRES_NS_E_PARTIALLY_REBUILT_DISK , 3222077543U) /* 0xc00d0067 */ \ XXX( HRES_NS_E_ENACTPLAN_GIVEUP , 3222077544U) /* 0xc00d0068 */ \ XXX( HRES_MCMADM_E_REGKEY_NOT_FOUND , 3222077546U) /* 0xc00d006a */ \ XXX( HRES_NS_E_NO_FORMATS , 3222077547U) /* 0xc00d006b */ \ XXX( HRES_NS_E_NO_REFERENCES , 3222077548U) /* 0xc00d006c */ \ XXX( HRES_NS_E_WAVE_OPEN , 3222077549U) /* 0xc00d006d */ \ XXX( HRES_NS_E_CANNOTCONNECTEVENTS , 3222077551U) /* 0xc00d006f */ \ XXX( HRES_NS_E_NO_DEVICE , 3222077553U) /* 0xc00d0071 */ \ XXX( HRES_NS_E_NO_SPECIFIED_DEVICE , 3222077554U) /* 0xc00d0072 */ \ XXX( HRES_NS_E_MONITOR_GIVEUP , 3222077640U) /* 0xc00d00c8 */ \ XXX( HRES_NS_E_REMIRRORED_DISK , 3222077641U) /* 0xc00d00c9 */ \ XXX( HRES_NS_E_INSUFFICIENT_DATA , 3222077642U) /* 0xc00d00ca */ \ XXX( HRES_NS_E_ASSERT , 3222077643U) /* 0xc00d00cb */ \ XXX( HRES_NS_E_BAD_ADAPTER_NAME , 3222077644U) /* 0xc00d00cc */ \ XXX( HRES_NS_E_NOT_LICENSED , 3222077645U) /* 0xc00d00cd */ \ XXX( HRES_NS_E_NO_SERVER_CONTACT , 3222077646U) /* 0xc00d00ce */ \ XXX( HRES_NS_E_TOO_MANY_TITLES , 3222077647U) /* 0xc00d00cf */ \ XXX( HRES_NS_E_TITLE_SIZE_EXCEEDED , 3222077648U) /* 0xc00d00d0 */ \ XXX( HRES_NS_E_UDP_DISABLED , 3222077649U) /* 0xc00d00d1 */ \ XXX( HRES_NS_E_TCP_DISABLED , 3222077650U) /* 0xc00d00d2 */ \ XXX( HRES_NS_E_HTTP_DISABLED , 3222077651U) /* 0xc00d00d3 */ \ XXX( HRES_NS_E_LICENSE_EXPIRED , 3222077652U) /* 0xc00d00d4 */ \ XXX( HRES_NS_E_TITLE_BITRATE , 3222077653U) /* 0xc00d00d5 */ \ XXX( HRES_NS_E_EMPTY_PROGRAM_NAME , 3222077654U) /* 0xc00d00d6 */ \ XXX( HRES_NS_E_MISSING_CHANNEL , 3222077655U) /* 0xc00d00d7 */ \ XXX( HRES_NS_E_NO_CHANNELS , 3222077656U) /* 0xc00d00d8 */ \ XXX( HRES_NS_E_INVALID_INDEX2 , 3222077657U) /* 0xc00d00d9 */ \ XXX( HRES_NS_E_CUB_FAIL_LINK , 3222077840U) /* 0xc00d0190 */ \ XXX( HRES_NS_E_BAD_CUB_UID , 3222077842U) /* 0xc00d0192 */ \ XXX( HRES_NS_E_GLITCH_MODE , 3222077845U) /* 0xc00d0195 */ \ XXX( HRES_NS_E_NO_MEDIA_PROTOCOL , 3222077851U) /* 0xc00d019b */ \ XXX( HRES_NS_E_NOTHING_TO_DO , 3222079473U) /* 0xc00d07f1 */ \ XXX( HRES_NS_E_NO_MULTICAST , 3222079474U) /* 0xc00d07f2 */ \ XXX( HRES_NS_E_INVALID_INPUT_FORMAT , 3222080440U) /* 0xc00d0bb8 */ \ XXX( HRES_NS_E_MSAUDIO_NOT_INSTALLED , 3222080441U) /* 0xc00d0bb9 */ \ XXX( HRES_NS_E_UNEXPECTED_MSAUDIO_ERROR , 3222080442U) /* 0xc00d0bba */ \ XXX( HRES_NS_E_INVALID_OUTPUT_FORMAT , 3222080443U) /* 0xc00d0bbb */ \ XXX( HRES_NS_E_NOT_CONFIGURED , 3222080444U) /* 0xc00d0bbc */ \ XXX( HRES_NS_E_PROTECTED_CONTENT , 3222080445U) /* 0xc00d0bbd */ \ XXX( HRES_NS_E_LICENSE_REQUIRED , 3222080446U) /* 0xc00d0bbe */ \ XXX( HRES_NS_E_TAMPERED_CONTENT , 3222080447U) /* 0xc00d0bbf */ \ XXX( HRES_NS_E_LICENSE_OUTOFDATE , 3222080448U) /* 0xc00d0bc0 */ \ XXX( HRES_NS_E_LICENSE_INCORRECT_RIGHTS , 3222080449U) /* 0xc00d0bc1 */ \ XXX( HRES_NS_E_AUDIO_CODEC_NOT_INSTALLED , 3222080450U) /* 0xc00d0bc2 */ \ XXX( HRES_NS_E_AUDIO_CODEC_ERROR , 3222080451U) /* 0xc00d0bc3 */ \ XXX( HRES_NS_E_VIDEO_CODEC_NOT_INSTALLED , 3222080452U) /* 0xc00d0bc4 */ \ XXX( HRES_NS_E_VIDEO_CODEC_ERROR , 3222080453U) /* 0xc00d0bc5 */ \ XXX( HRES_NS_E_INVALIDPROFILE , 3222080454U) /* 0xc00d0bc6 */ \ XXX( HRES_NS_E_INCOMPATIBLE_VERSION , 3222080455U) /* 0xc00d0bc7 */ \ XXX( HRES_NS_E_OFFLINE_MODE , 3222080458U) /* 0xc00d0bca */ \ XXX( HRES_NS_E_NOT_CONNECTED , 3222080459U) /* 0xc00d0bcb */ \ XXX( HRES_NS_E_TOO_MUCH_DATA , 3222080460U) /* 0xc00d0bcc */ \ XXX( HRES_NS_E_UNSUPPORTED_PROPERTY , 3222080461U) /* 0xc00d0bcd */ \ XXX( HRES_NS_E_8BIT_WAVE_UNSUPPORTED , 3222080462U) /* 0xc00d0bce */ \ XXX( HRES_NS_E_NO_MORE_SAMPLES , 3222080463U) /* 0xc00d0bcf */ \ XXX( HRES_NS_E_INVALID_SAMPLING_RATE , 3222080464U) /* 0xc00d0bd0 */ \ XXX( HRES_NS_E_MAX_PACKET_SIZE_TOO_SMALL , 3222080465U) /* 0xc00d0bd1 */ \ XXX( HRES_NS_E_LATE_PACKET , 3222080466U) /* 0xc00d0bd2 */ \ XXX( HRES_NS_E_DUPLICATE_PACKET , 3222080467U) /* 0xc00d0bd3 */ \ XXX( HRES_NS_E_SDK_BUFFERTOOSMALL , 3222080468U) /* 0xc00d0bd4 */ \ XXX( HRES_NS_E_INVALID_NUM_PASSES , 3222080469U) /* 0xc00d0bd5 */ \ XXX( HRES_NS_E_ATTRIBUTE_READ_ONLY , 3222080470U) /* 0xc00d0bd6 */ \ XXX( HRES_NS_E_ATTRIBUTE_NOT_ALLOWED , 3222080471U) /* 0xc00d0bd7 */ \ XXX( HRES_NS_E_INVALID_EDL , 3222080472U) /* 0xc00d0bd8 */ \ XXX( HRES_NS_E_DATA_UNIT_EXTENSION_TOO_LARGE , 3222080473U) /* 0xc00d0bd9 */ \ XXX( HRES_NS_E_CODEC_DMO_ERROR , 3222080474U) /* 0xc00d0bda */ \ XXX( HRES_NS_E_FEATURE_DISABLED_BY_GROUP_POLICY , 3222080476U) /* 0xc00d0bdc */ \ XXX( HRES_NS_E_FEATURE_DISABLED_IN_SKU , 3222080477U) /* 0xc00d0bdd */ \ XXX( HRES_NS_E_NO_CD , 3222081440U) /* 0xc00d0fa0 */ \ XXX( HRES_NS_E_CANT_READ_DIGITAL , 3222081441U) /* 0xc00d0fa1 */ \ XXX( HRES_NS_E_DEVICE_DISCONNECTED , 3222081442U) /* 0xc00d0fa2 */ \ XXX( HRES_NS_E_DEVICE_NOT_SUPPORT_FORMAT , 3222081443U) /* 0xc00d0fa3 */ \ XXX( HRES_NS_E_SLOW_READ_DIGITAL , 3222081444U) /* 0xc00d0fa4 */ \ XXX( HRES_NS_E_MIXER_INVALID_LINE , 3222081445U) /* 0xc00d0fa5 */ \ XXX( HRES_NS_E_MIXER_INVALID_CONTROL , 3222081446U) /* 0xc00d0fa6 */ \ XXX( HRES_NS_E_MIXER_INVALID_VALUE , 3222081447U) /* 0xc00d0fa7 */ \ XXX( HRES_NS_E_MIXER_UNKNOWN_MMRESULT , 3222081448U) /* 0xc00d0fa8 */ \ XXX( HRES_NS_E_USER_STOP , 3222081449U) /* 0xc00d0fa9 */ \ XXX( HRES_NS_E_MP3_FORMAT_NOT_FOUND , 3222081450U) /* 0xc00d0faa */ \ XXX( HRES_NS_E_CD_READ_ERROR_NO_CORRECTION , 3222081451U) /* 0xc00d0fab */ \ XXX( HRES_NS_E_CD_READ_ERROR , 3222081452U) /* 0xc00d0fac */ \ XXX( HRES_NS_E_CD_SLOW_COPY , 3222081453U) /* 0xc00d0fad */ \ XXX( HRES_NS_E_CD_COPYTO_CD , 3222081454U) /* 0xc00d0fae */ \ XXX( HRES_NS_E_MIXER_NODRIVER , 3222081455U) /* 0xc00d0faf */ \ XXX( HRES_NS_E_REDBOOK_ENABLED_WHILE_COPYING , 3222081456U) /* 0xc00d0fb0 */ \ XXX( HRES_NS_E_CD_REFRESH , 3222081457U) /* 0xc00d0fb1 */ \ XXX( HRES_NS_E_CD_DRIVER_PROBLEM , 3222081458U) /* 0xc00d0fb2 */ \ XXX( HRES_NS_E_WONT_DO_DIGITAL , 3222081459U) /* 0xc00d0fb3 */ \ XXX( HRES_NS_E_WMPXML_NOERROR , 3222081460U) /* 0xc00d0fb4 */ \ XXX( HRES_NS_E_WMPXML_ENDOFDATA , 3222081461U) /* 0xc00d0fb5 */ \ XXX( HRES_NS_E_WMPXML_PARSEERROR , 3222081462U) /* 0xc00d0fb6 */ \ XXX( HRES_NS_E_WMPXML_ATTRIBUTENOTFOUND , 3222081463U) /* 0xc00d0fb7 */ \ XXX( HRES_NS_E_WMPXML_PINOTFOUND , 3222081464U) /* 0xc00d0fb8 */ \ XXX( HRES_NS_E_WMPXML_EMPTYDOC , 3222081465U) /* 0xc00d0fb9 */ \ XXX( HRES_NS_E_WMP_PATH_ALREADY_IN_LIBRARY , 3222081466U) /* 0xc00d0fba */ \ XXX( HRES_NS_E_WMP_FILESCANALREADYSTARTED , 3222081470U) /* 0xc00d0fbe */ \ XXX( HRES_NS_E_WMP_HME_INVALIDOBJECTID , 3222081471U) /* 0xc00d0fbf */ \ XXX( HRES_NS_E_WMP_MF_CODE_EXPIRED , 3222081472U) /* 0xc00d0fc0 */ \ XXX( HRES_NS_E_WMP_HME_NOTSEARCHABLEFORITEMS , 3222081473U) /* 0xc00d0fc1 */ \ XXX( HRES_NS_E_WMP_ADDTOLIBRARY_FAILED , 3222081479U) /* 0xc00d0fc7 */ \ XXX( HRES_NS_E_WMP_WINDOWSAPIFAILURE , 3222081480U) /* 0xc00d0fc8 */ \ XXX( HRES_NS_E_WMP_RECORDING_NOT_ALLOWED , 3222081481U) /* 0xc00d0fc9 */ \ XXX( HRES_NS_E_DEVICE_NOT_READY , 3222081482U) /* 0xc00d0fca */ \ XXX( HRES_NS_E_DAMAGED_FILE , 3222081483U) /* 0xc00d0fcb */ \ XXX( HRES_NS_E_MPDB_GENERIC , 3222081484U) /* 0xc00d0fcc */ \ XXX( HRES_NS_E_FILE_FAILED_CHECKS , 3222081485U) /* 0xc00d0fcd */ \ XXX( HRES_NS_E_MEDIA_LIBRARY_FAILED , 3222081486U) /* 0xc00d0fce */ \ XXX( HRES_NS_E_SHARING_VIOLATION , 3222081487U) /* 0xc00d0fcf */ \ XXX( HRES_NS_E_NO_ERROR_STRING_FOUND , 3222081488U) /* 0xc00d0fd0 */ \ XXX( HRES_NS_E_WMPOCX_NO_REMOTE_CORE , 3222081489U) /* 0xc00d0fd1 */ \ XXX( HRES_NS_E_WMPOCX_NO_ACTIVE_CORE , 3222081490U) /* 0xc00d0fd2 */ \ XXX( HRES_NS_E_WMPOCX_NOT_RUNNING_REMOTELY , 3222081491U) /* 0xc00d0fd3 */ \ XXX( HRES_NS_E_WMPOCX_NO_REMOTE_WINDOW , 3222081492U) /* 0xc00d0fd4 */ \ XXX( HRES_NS_E_WMPOCX_ERRORMANAGERNOTAVAILABLE , 3222081493U) /* 0xc00d0fd5 */ \ XXX( HRES_NS_E_PLUGIN_NOTSHUTDOWN , 3222081494U) /* 0xc00d0fd6 */ \ XXX( HRES_NS_E_WMP_CANNOT_FIND_FOLDER , 3222081495U) /* 0xc00d0fd7 */ \ XXX( HRES_NS_E_WMP_STREAMING_RECORDING_NOT_ALLOWED , 3222081496U) /* 0xc00d0fd8 */ \ XXX( HRES_NS_E_WMP_PLUGINDLL_NOTFOUND , 3222081497U) /* 0xc00d0fd9 */ \ XXX( HRES_NS_E_NEED_TO_ASK_USER , 3222081498U) /* 0xc00d0fda */ \ XXX( HRES_NS_E_WMPOCX_PLAYER_NOT_DOCKED , 3222081499U) /* 0xc00d0fdb */ \ XXX( HRES_NS_E_WMP_EXTERNAL_NOTREADY , 3222081500U) /* 0xc00d0fdc */ \ XXX( HRES_NS_E_WMP_MLS_STALE_DATA , 3222081501U) /* 0xc00d0fdd */ \ XXX( HRES_NS_E_WMP_UI_SUBCONTROLSNOTSUPPORTED , 3222081502U) /* 0xc00d0fde */ \ XXX( HRES_NS_E_WMP_UI_VERSIONMISMATCH , 3222081503U) /* 0xc00d0fdf */ \ XXX( HRES_NS_E_WMP_UI_NOTATHEMEFILE , 3222081504U) /* 0xc00d0fe0 */ \ XXX( HRES_NS_E_WMP_UI_SUBELEMENTNOTFOUND , 3222081505U) /* 0xc00d0fe1 */ \ XXX( HRES_NS_E_WMP_UI_VERSIONPARSE , 3222081506U) /* 0xc00d0fe2 */ \ XXX( HRES_NS_E_WMP_UI_VIEWIDNOTFOUND , 3222081507U) /* 0xc00d0fe3 */ \ XXX( HRES_NS_E_WMP_UI_PASSTHROUGH , 3222081508U) /* 0xc00d0fe4 */ \ XXX( HRES_NS_E_WMP_UI_OBJECTNOTFOUND , 3222081509U) /* 0xc00d0fe5 */ \ XXX( HRES_NS_E_WMP_UI_SECONDHANDLER , 3222081510U) /* 0xc00d0fe6 */ \ XXX( HRES_NS_E_WMP_UI_NOSKININZIP , 3222081511U) /* 0xc00d0fe7 */ \ XXX( HRES_NS_E_WMP_URLDOWNLOADFAILED , 3222081514U) /* 0xc00d0fea */ \ XXX( HRES_NS_E_WMPOCX_UNABLE_TO_LOAD_SKIN , 3222081515U) /* 0xc00d0feb */ \ XXX( HRES_NS_E_WMP_INVALID_SKIN , 3222081516U) /* 0xc00d0fec */ \ XXX( HRES_NS_E_WMP_SENDMAILFAILED , 3222081517U) /* 0xc00d0fed */ \ XXX( HRES_NS_E_WMP_LOCKEDINSKINMODE , 3222081518U) /* 0xc00d0fee */ \ XXX( HRES_NS_E_WMP_FAILED_TO_SAVE_FILE , 3222081519U) /* 0xc00d0fef */ \ XXX( HRES_NS_E_WMP_SAVEAS_READONLY , 3222081520U) /* 0xc00d0ff0 */ \ XXX( HRES_NS_E_WMP_FAILED_TO_SAVE_PLAYLIST , 3222081521U) /* 0xc00d0ff1 */ \ XXX( HRES_NS_E_WMP_FAILED_TO_OPEN_WMD , 3222081522U) /* 0xc00d0ff2 */ \ XXX( HRES_NS_E_WMP_CANT_PLAY_PROTECTED , 3222081523U) /* 0xc00d0ff3 */ \ XXX( HRES_NS_E_SHARING_STATE_OUT_OF_SYNC , 3222081524U) /* 0xc00d0ff4 */ \ XXX( HRES_NS_E_WMPOCX_REMOTE_PLAYER_ALREADY_RUNNING , 3222081530U) /* 0xc00d0ffa */ \ XXX( HRES_NS_E_WMP_RBC_JPGMAPPINGIMAGE , 3222081540U) /* 0xc00d1004 */ \ XXX( HRES_NS_E_WMP_JPGTRANSPARENCY , 3222081541U) /* 0xc00d1005 */ \ XXX( HRES_NS_E_WMP_INVALID_MAX_VAL , 3222081545U) /* 0xc00d1009 */ \ XXX( HRES_NS_E_WMP_INVALID_MIN_VAL , 3222081546U) /* 0xc00d100a */ \ XXX( HRES_NS_E_WMP_CS_JPGPOSITIONIMAGE , 3222081550U) /* 0xc00d100e */ \ XXX( HRES_NS_E_WMP_CS_NOTEVENLYDIVISIBLE , 3222081551U) /* 0xc00d100f */ \ XXX( HRES_NS_E_WMPZIP_NOTAZIPFILE , 3222081560U) /* 0xc00d1018 */ \ XXX( HRES_NS_E_WMPZIP_CORRUPT , 3222081561U) /* 0xc00d1019 */ \ XXX( HRES_NS_E_WMPZIP_FILENOTFOUND , 3222081562U) /* 0xc00d101a */ \ XXX( HRES_NS_E_WMP_IMAGE_FILETYPE_UNSUPPORTED , 3222081570U) /* 0xc00d1022 */ \ XXX( HRES_NS_E_WMP_IMAGE_INVALID_FORMAT , 3222081571U) /* 0xc00d1023 */ \ XXX( HRES_NS_E_WMP_GIF_UNEXPECTED_ENDOFFILE , 3222081572U) /* 0xc00d1024 */ \ XXX( HRES_NS_E_WMP_GIF_INVALID_FORMAT , 3222081573U) /* 0xc00d1025 */ \ XXX( HRES_NS_E_WMP_GIF_BAD_VERSION_NUMBER , 3222081574U) /* 0xc00d1026 */ \ XXX( HRES_NS_E_WMP_GIF_NO_IMAGE_IN_FILE , 3222081575U) /* 0xc00d1027 */ \ XXX( HRES_NS_E_WMP_PNG_INVALIDFORMAT , 3222081576U) /* 0xc00d1028 */ \ XXX( HRES_NS_E_WMP_PNG_UNSUPPORTED_BITDEPTH , 3222081577U) /* 0xc00d1029 */ \ XXX( HRES_NS_E_WMP_PNG_UNSUPPORTED_COMPRESSION , 3222081578U) /* 0xc00d102a */ \ XXX( HRES_NS_E_WMP_PNG_UNSUPPORTED_FILTER , 3222081579U) /* 0xc00d102b */ \ XXX( HRES_NS_E_WMP_PNG_UNSUPPORTED_INTERLACE , 3222081580U) /* 0xc00d102c */ \ XXX( HRES_NS_E_WMP_PNG_UNSUPPORTED_BAD_CRC , 3222081581U) /* 0xc00d102d */ \ XXX( HRES_NS_E_WMP_BMP_INVALID_BITMASK , 3222081582U) /* 0xc00d102e */ \ XXX( HRES_NS_E_WMP_BMP_TOPDOWN_DIB_UNSUPPORTED , 3222081583U) /* 0xc00d102f */ \ XXX( HRES_NS_E_WMP_BMP_BITMAP_NOT_CREATED , 3222081584U) /* 0xc00d1030 */ \ XXX( HRES_NS_E_WMP_BMP_COMPRESSION_UNSUPPORTED , 3222081585U) /* 0xc00d1031 */ \ XXX( HRES_NS_E_WMP_BMP_INVALID_FORMAT , 3222081586U) /* 0xc00d1032 */ \ XXX( HRES_NS_E_WMP_JPG_JERR_ARITHCODING_NOTIMPL , 3222081587U) /* 0xc00d1033 */ \ XXX( HRES_NS_E_WMP_JPG_INVALID_FORMAT , 3222081588U) /* 0xc00d1034 */ \ XXX( HRES_NS_E_WMP_JPG_BAD_DCTSIZE , 3222081589U) /* 0xc00d1035 */ \ XXX( HRES_NS_E_WMP_JPG_BAD_VERSION_NUMBER , 3222081590U) /* 0xc00d1036 */ \ XXX( HRES_NS_E_WMP_JPG_BAD_PRECISION , 3222081591U) /* 0xc00d1037 */ \ XXX( HRES_NS_E_WMP_JPG_CCIR601_NOTIMPL , 3222081592U) /* 0xc00d1038 */ \ XXX( HRES_NS_E_WMP_JPG_NO_IMAGE_IN_FILE , 3222081593U) /* 0xc00d1039 */ \ XXX( HRES_NS_E_WMP_JPG_READ_ERROR , 3222081594U) /* 0xc00d103a */ \ XXX( HRES_NS_E_WMP_JPG_FRACT_SAMPLE_NOTIMPL , 3222081595U) /* 0xc00d103b */ \ XXX( HRES_NS_E_WMP_JPG_IMAGE_TOO_BIG , 3222081596U) /* 0xc00d103c */ \ XXX( HRES_NS_E_WMP_JPG_UNEXPECTED_ENDOFFILE , 3222081597U) /* 0xc00d103d */ \ XXX( HRES_NS_E_WMP_JPG_SOF_UNSUPPORTED , 3222081598U) /* 0xc00d103e */ \ XXX( HRES_NS_E_WMP_JPG_UNKNOWN_MARKER , 3222081599U) /* 0xc00d103f */ \ XXX( HRES_NS_E_WMP_FAILED_TO_OPEN_IMAGE , 3222081604U) /* 0xc00d1044 */ \ XXX( HRES_NS_E_WMP_DAI_SONGTOOSHORT , 3222081609U) /* 0xc00d1049 */ \ XXX( HRES_NS_E_WMG_RATEUNAVAILABLE , 3222081610U) /* 0xc00d104a */ \ XXX( HRES_NS_E_WMG_PLUGINUNAVAILABLE , 3222081611U) /* 0xc00d104b */ \ XXX( HRES_NS_E_WMG_CANNOTQUEUE , 3222081612U) /* 0xc00d104c */ \ XXX( HRES_NS_E_WMG_PREROLLLICENSEACQUISITIONNOTALLOWED, 3222081613U) /* 0xc00d104d */ \ XXX( HRES_NS_E_WMG_UNEXPECTEDPREROLLSTATUS , 3222081614U) /* 0xc00d104e */ \ XXX( HRES_NS_E_WMG_INVALID_COPP_CERTIFICATE , 3222081617U) /* 0xc00d1051 */ \ XXX( HRES_NS_E_WMG_COPP_SECURITY_INVALID , 3222081618U) /* 0xc00d1052 */ \ XXX( HRES_NS_E_WMG_COPP_UNSUPPORTED , 3222081619U) /* 0xc00d1053 */ \ XXX( HRES_NS_E_WMG_INVALIDSTATE , 3222081620U) /* 0xc00d1054 */ \ XXX( HRES_NS_E_WMG_SINKALREADYEXISTS , 3222081621U) /* 0xc00d1055 */ \ XXX( HRES_NS_E_WMG_NOSDKINTERFACE , 3222081622U) /* 0xc00d1056 */ \ XXX( HRES_NS_E_WMG_NOTALLOUTPUTSRENDERED , 3222081623U) /* 0xc00d1057 */ \ XXX( HRES_NS_E_WMG_FILETRANSFERNOTALLOWED , 3222081624U) /* 0xc00d1058 */ \ XXX( HRES_NS_E_WMR_UNSUPPORTEDSTREAM , 3222081625U) /* 0xc00d1059 */ \ XXX( HRES_NS_E_WMR_PINNOTFOUND , 3222081626U) /* 0xc00d105a */ \ XXX( HRES_NS_E_WMR_WAITINGONFORMATSWITCH , 3222081627U) /* 0xc00d105b */ \ XXX( HRES_NS_E_WMR_NOSOURCEFILTER , 3222081628U) /* 0xc00d105c */ \ XXX( HRES_NS_E_WMR_PINTYPENOMATCH , 3222081629U) /* 0xc00d105d */ \ XXX( HRES_NS_E_WMR_NOCALLBACKAVAILABLE , 3222081630U) /* 0xc00d105e */ \ XXX( HRES_NS_E_WMR_SAMPLEPROPERTYNOTSET , 3222081634U) /* 0xc00d1062 */ \ XXX( HRES_NS_E_WMR_CANNOT_RENDER_BINARY_STREAM , 3222081635U) /* 0xc00d1063 */ \ XXX( HRES_NS_E_WMG_LICENSE_TAMPERED , 3222081636U) /* 0xc00d1064 */ \ XXX( HRES_NS_E_WMR_WILLNOT_RENDER_BINARY_STREAM , 3222081637U) /* 0xc00d1065 */ \ XXX( HRES_NS_E_WMX_UNRECOGNIZED_PLAYLIST_FORMAT , 3222081640U) /* 0xc00d1068 */ \ XXX( HRES_NS_E_ASX_INVALIDFORMAT , 3222081641U) /* 0xc00d1069 */ \ XXX( HRES_NS_E_ASX_INVALIDVERSION , 3222081642U) /* 0xc00d106a */ \ XXX( HRES_NS_E_ASX_INVALID_REPEAT_BLOCK , 3222081643U) /* 0xc00d106b */ \ XXX( HRES_NS_E_ASX_NOTHING_TO_WRITE , 3222081644U) /* 0xc00d106c */ \ XXX( HRES_NS_E_URLLIST_INVALIDFORMAT , 3222081645U) /* 0xc00d106d */ \ XXX( HRES_NS_E_WMX_ATTRIBUTE_DOES_NOT_EXIST , 3222081646U) /* 0xc00d106e */ \ XXX( HRES_NS_E_WMX_ATTRIBUTE_ALREADY_EXISTS , 3222081647U) /* 0xc00d106f */ \ XXX( HRES_NS_E_WMX_ATTRIBUTE_UNRETRIEVABLE , 3222081648U) /* 0xc00d1070 */ \ XXX( HRES_NS_E_WMX_ITEM_DOES_NOT_EXIST , 3222081649U) /* 0xc00d1071 */ \ XXX( HRES_NS_E_WMX_ITEM_TYPE_ILLEGAL , 3222081650U) /* 0xc00d1072 */ \ XXX( HRES_NS_E_WMX_ITEM_UNSETTABLE , 3222081651U) /* 0xc00d1073 */ \ XXX( HRES_NS_E_WMX_PLAYLIST_EMPTY , 3222081652U) /* 0xc00d1074 */ \ XXX( HRES_NS_E_MLS_SMARTPLAYLIST_FILTER_NOT_REGISTERED, 3222081653U) /* 0xc00d1075 */ \ XXX( HRES_NS_E_WMX_INVALID_FORMAT_OVER_NESTING , 3222081654U) /* 0xc00d1076 */ \ XXX( HRES_NS_E_WMPCORE_NOSOURCEURLSTRING , 3222081660U) /* 0xc00d107c */ \ XXX( HRES_NS_E_WMPCORE_COCREATEFAILEDFORGITOBJECT , 3222081661U) /* 0xc00d107d */ \ XXX( HRES_NS_E_WMPCORE_FAILEDTOGETMARSHALLEDEVENTHANDLERINTERFACE, 3222081662U) /* 0xc00d107e */ \ XXX( HRES_NS_E_WMPCORE_BUFFERTOOSMALL , 3222081663U) /* 0xc00d107f */ \ XXX( HRES_NS_E_WMPCORE_UNAVAILABLE , 3222081664U) /* 0xc00d1080 */ \ XXX( HRES_NS_E_WMPCORE_INVALIDPLAYLISTMODE , 3222081665U) /* 0xc00d1081 */ \ XXX( HRES_NS_E_WMPCORE_ITEMNOTINPLAYLIST , 3222081670U) /* 0xc00d1086 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLISTEMPTY , 3222081671U) /* 0xc00d1087 */ \ XXX( HRES_NS_E_WMPCORE_NOBROWSER , 3222081672U) /* 0xc00d1088 */ \ XXX( HRES_NS_E_WMPCORE_UNRECOGNIZED_MEDIA_URL , 3222081673U) /* 0xc00d1089 */ \ XXX( HRES_NS_E_WMPCORE_GRAPH_NOT_IN_LIST , 3222081674U) /* 0xc00d108a */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_EMPTY_OR_SINGLE_MEDIA, 3222081675U) /* 0xc00d108b */ \ XXX( HRES_NS_E_WMPCORE_ERRORSINKNOTREGISTERED , 3222081676U) /* 0xc00d108c */ \ XXX( HRES_NS_E_WMPCORE_ERRORMANAGERNOTAVAILABLE , 3222081677U) /* 0xc00d108d */ \ XXX( HRES_NS_E_WMPCORE_WEBHELPFAILED , 3222081678U) /* 0xc00d108e */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_ERROR_RESUME_FAILED , 3222081679U) /* 0xc00d108f */ \ XXX( HRES_NS_E_WMPCORE_NO_REF_IN_ENTRY , 3222081680U) /* 0xc00d1090 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ATTRIBUTE_NAME_EMPTY, 3222081681U) /* 0xc00d1091 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ATTRIBUTE_NAME_ILLEGAL, 3222081682U) /* 0xc00d1092 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ATTRIBUTE_VALUE_EMPTY, 3222081683U) /* 0xc00d1093 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ATTRIBUTE_VALUE_ILLEGAL, 3222081684U) /* 0xc00d1094 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ITEM_ATTRIBUTE_NAME_EMPTY, 3222081685U) /* 0xc00d1095 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ITEM_ATTRIBUTE_NAME_ILLEGAL, 3222081686U) /* 0xc00d1096 */ \ XXX( HRES_NS_E_WMPCORE_WMX_LIST_ITEM_ATTRIBUTE_VALUE_EMPTY, 3222081687U) /* 0xc00d1097 */ \ XXX( HRES_NS_E_WMPCORE_LIST_ENTRY_NO_REF , 3222081688U) /* 0xc00d1098 */ \ XXX( HRES_NS_E_WMPCORE_MISNAMED_FILE , 3222081689U) /* 0xc00d1099 */ \ XXX( HRES_NS_E_WMPCORE_CODEC_NOT_TRUSTED , 3222081690U) /* 0xc00d109a */ \ XXX( HRES_NS_E_WMPCORE_CODEC_NOT_FOUND , 3222081691U) /* 0xc00d109b */ \ XXX( HRES_NS_E_WMPCORE_CODEC_DOWNLOAD_NOT_ALLOWED , 3222081692U) /* 0xc00d109c */ \ XXX( HRES_NS_E_WMPCORE_ERROR_DOWNLOADING_PLAYLIST , 3222081693U) /* 0xc00d109d */ \ XXX( HRES_NS_E_WMPCORE_FAILED_TO_BUILD_PLAYLIST , 3222081694U) /* 0xc00d109e */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_ITEM_ALTERNATE_NONE , 3222081695U) /* 0xc00d109f */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_ITEM_ALTERNATE_EXHAUSTED, 3222081696U) /* 0xc00d10a0 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_ITEM_ALTERNATE_NAME_NOT_FOUND, 3222081697U) /* 0xc00d10a1 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_ITEM_ALTERNATE_MORPH_FAILED, 3222081698U) /* 0xc00d10a2 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_ITEM_ALTERNATE_INIT_FAILED, 3222081699U) /* 0xc00d10a3 */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_ALTERNATE_REF_EMPTY , 3222081700U) /* 0xc00d10a4 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_NO_EVENT_NAME , 3222081701U) /* 0xc00d10a5 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_EVENT_ATTRIBUTE_ABSENT, 3222081702U) /* 0xc00d10a6 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_EVENT_EMPTY , 3222081703U) /* 0xc00d10a7 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_STACK_EMPTY , 3222081704U) /* 0xc00d10a8 */ \ XXX( HRES_NS_E_WMPCORE_CURRENT_MEDIA_NOT_ACTIVE , 3222081705U) /* 0xc00d10a9 */ \ XXX( HRES_NS_E_WMPCORE_USER_CANCEL , 3222081707U) /* 0xc00d10ab */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_REPEAT_EMPTY , 3222081708U) /* 0xc00d10ac */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_REPEAT_START_MEDIA_NONE, 3222081709U) /* 0xc00d10ad */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_REPEAT_END_MEDIA_NONE, 3222081710U) /* 0xc00d10ae */ \ XXX( HRES_NS_E_WMPCORE_INVALID_PLAYLIST_URL , 3222081711U) /* 0xc00d10af */ \ XXX( HRES_NS_E_WMPCORE_MISMATCHED_RUNTIME , 3222081712U) /* 0xc00d10b0 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_IMPORT_FAILED_NO_ITEMS, 3222081713U) /* 0xc00d10b1 */ \ XXX( HRES_NS_E_WMPCORE_VIDEO_TRANSFORM_FILTER_INSERTION, 3222081714U) /* 0xc00d10b2 */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_UNAVAILABLE , 3222081715U) /* 0xc00d10b3 */ \ XXX( HRES_NS_E_WMPCORE_WMX_ENTRYREF_NO_REF , 3222081716U) /* 0xc00d10b4 */ \ XXX( HRES_NS_E_WMPCORE_NO_PLAYABLE_MEDIA_IN_PLAYLIST, 3222081717U) /* 0xc00d10b5 */ \ XXX( HRES_NS_E_WMPCORE_PLAYLIST_EMPTY_NESTED_PLAYLIST_SKIPPED_ITEMS, 3222081718U) /* 0xc00d10b6 */ \ XXX( HRES_NS_E_WMPCORE_BUSY , 3222081719U) /* 0xc00d10b7 */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_CHILD_PLAYLIST_UNAVAILABLE, 3222081720U) /* 0xc00d10b8 */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_NO_CHILD_PLAYLIST , 3222081721U) /* 0xc00d10b9 */ \ XXX( HRES_NS_E_WMPCORE_FILE_NOT_FOUND , 3222081722U) /* 0xc00d10ba */ \ XXX( HRES_NS_E_WMPCORE_TEMP_FILE_NOT_FOUND , 3222081723U) /* 0xc00d10bb */ \ XXX( HRES_NS_E_WMDM_REVOKED , 3222081724U) /* 0xc00d10bc */ \ XXX( HRES_NS_E_DDRAW_GENERIC , 3222081725U) /* 0xc00d10bd */ \ XXX( HRES_NS_E_DISPLAY_MODE_CHANGE_FAILED , 3222081726U) /* 0xc00d10be */ \ XXX( HRES_NS_E_PLAYLIST_CONTAINS_ERRORS , 3222081727U) /* 0xc00d10bf */ \ XXX( HRES_NS_E_CHANGING_PROXY_NAME , 3222081728U) /* 0xc00d10c0 */ \ XXX( HRES_NS_E_CHANGING_PROXY_PORT , 3222081729U) /* 0xc00d10c1 */ \ XXX( HRES_NS_E_CHANGING_PROXY_EXCEPTIONLIST , 3222081730U) /* 0xc00d10c2 */ \ XXX( HRES_NS_E_CHANGING_PROXYBYPASS , 3222081731U) /* 0xc00d10c3 */ \ XXX( HRES_NS_E_CHANGING_PROXY_PROTOCOL_NOT_FOUND , 3222081732U) /* 0xc00d10c4 */ \ XXX( HRES_NS_E_GRAPH_NOAUDIOLANGUAGE , 3222081733U) /* 0xc00d10c5 */ \ XXX( HRES_NS_E_GRAPH_NOAUDIOLANGUAGESELECTED , 3222081734U) /* 0xc00d10c6 */ \ XXX( HRES_NS_E_CORECD_NOTAMEDIACD , 3222081735U) /* 0xc00d10c7 */ \ XXX( HRES_NS_E_WMPCORE_MEDIA_URL_TOO_LONG , 3222081736U) /* 0xc00d10c8 */ \ XXX( HRES_NS_E_WMPFLASH_CANT_FIND_COM_SERVER , 3222081737U) /* 0xc00d10c9 */ \ XXX( HRES_NS_E_WMPFLASH_INCOMPATIBLEVERSION , 3222081738U) /* 0xc00d10ca */ \ XXX( HRES_NS_E_WMPOCXGRAPH_IE_DISALLOWS_ACTIVEX_CONTROLS, 3222081739U) /* 0xc00d10cb */ \ XXX( HRES_NS_E_NEED_CORE_REFERENCE , 3222081740U) /* 0xc00d10cc */ \ XXX( HRES_NS_E_MEDIACD_READ_ERROR , 3222081741U) /* 0xc00d10cd */ \ XXX( HRES_NS_E_IE_DISALLOWS_ACTIVEX_CONTROLS , 3222081742U) /* 0xc00d10ce */ \ XXX( HRES_NS_E_FLASH_PLAYBACK_NOT_ALLOWED , 3222081743U) /* 0xc00d10cf */ \ XXX( HRES_NS_E_UNABLE_TO_CREATE_RIP_LOCATION , 3222081744U) /* 0xc00d10d0 */ \ XXX( HRES_NS_E_WMPCORE_SOME_CODECS_MISSING , 3222081745U) /* 0xc00d10d1 */ \ XXX( HRES_NS_E_WMP_RIP_FAILED , 3222081746U) /* 0xc00d10d2 */ \ XXX( HRES_NS_E_WMP_FAILED_TO_RIP_TRACK , 3222081747U) /* 0xc00d10d3 */ \ XXX( HRES_NS_E_WMP_ERASE_FAILED , 3222081748U) /* 0xc00d10d4 */ \ XXX( HRES_NS_E_WMP_FORMAT_FAILED , 3222081749U) /* 0xc00d10d5 */ \ XXX( HRES_NS_E_WMP_CANNOT_BURN_NON_LOCAL_FILE , 3222081750U) /* 0xc00d10d6 */ \ XXX( HRES_NS_E_WMP_FILE_TYPE_CANNOT_BURN_TO_AUDIO_CD, 3222081751U) /* 0xc00d10d7 */ \ XXX( HRES_NS_E_WMP_FILE_DOES_NOT_FIT_ON_CD , 3222081752U) /* 0xc00d10d8 */ \ XXX( HRES_NS_E_WMP_FILE_NO_DURATION , 3222081753U) /* 0xc00d10d9 */ \ XXX( HRES_NS_E_PDA_FAILED_TO_BURN , 3222081754U) /* 0xc00d10da */ \ XXX( HRES_NS_E_FAILED_DOWNLOAD_ABORT_BURN , 3222081756U) /* 0xc00d10dc */ \ XXX( HRES_NS_E_WMPCORE_DEVICE_DRIVERS_MISSING , 3222081757U) /* 0xc00d10dd */ \ XXX( HRES_NS_E_WMPIM_USEROFFLINE , 3222081830U) /* 0xc00d1126 */ \ XXX( HRES_NS_E_WMPIM_USERCANCELED , 3222081831U) /* 0xc00d1127 */ \ XXX( HRES_NS_E_WMPIM_DIALUPFAILED , 3222081832U) /* 0xc00d1128 */ \ XXX( HRES_NS_E_WINSOCK_ERROR_STRING , 3222081833U) /* 0xc00d1129 */ \ XXX( HRES_NS_E_WMPBR_NOLISTENER , 3222081840U) /* 0xc00d1130 */ \ XXX( HRES_NS_E_WMPBR_BACKUPCANCEL , 3222081841U) /* 0xc00d1131 */ \ XXX( HRES_NS_E_WMPBR_RESTORECANCEL , 3222081842U) /* 0xc00d1132 */ \ XXX( HRES_NS_E_WMPBR_ERRORWITHURL , 3222081843U) /* 0xc00d1133 */ \ XXX( HRES_NS_E_WMPBR_NAMECOLLISION , 3222081844U) /* 0xc00d1134 */ \ XXX( HRES_NS_E_WMPBR_DRIVE_INVALID , 3222081847U) /* 0xc00d1137 */ \ XXX( HRES_NS_E_WMPBR_BACKUPRESTOREFAILED , 3222081848U) /* 0xc00d1138 */ \ XXX( HRES_NS_E_WMP_CONVERT_FILE_FAILED , 3222081880U) /* 0xc00d1158 */ \ XXX( HRES_NS_E_WMP_CONVERT_NO_RIGHTS_ERRORURL , 3222081881U) /* 0xc00d1159 */ \ XXX( HRES_NS_E_WMP_CONVERT_NO_RIGHTS_NOERRORURL , 3222081882U) /* 0xc00d115a */ \ XXX( HRES_NS_E_WMP_CONVERT_FILE_CORRUPT , 3222081883U) /* 0xc00d115b */ \ XXX( HRES_NS_E_WMP_CONVERT_PLUGIN_UNAVAILABLE_ERRORURL, 3222081884U) /* 0xc00d115c */ \ XXX( HRES_NS_E_WMP_CONVERT_PLUGIN_UNAVAILABLE_NOERRORURL, 3222081885U) /* 0xc00d115d */ \ XXX( HRES_NS_E_WMP_CONVERT_PLUGIN_UNKNOWN_FILE_OWNER, 3222081886U) /* 0xc00d115e */ \ XXX( HRES_NS_E_DVD_DISC_COPY_PROTECT_OUTPUT_NS , 3222081888U) /* 0xc00d1160 */ \ XXX( HRES_NS_E_DVD_DISC_COPY_PROTECT_OUTPUT_FAILED , 3222081889U) /* 0xc00d1161 */ \ XXX( HRES_NS_E_DVD_NO_SUBPICTURE_STREAM , 3222081890U) /* 0xc00d1162 */ \ XXX( HRES_NS_E_DVD_COPY_PROTECT , 3222081891U) /* 0xc00d1163 */ \ XXX( HRES_NS_E_DVD_AUTHORING_PROBLEM , 3222081892U) /* 0xc00d1164 */ \ XXX( HRES_NS_E_DVD_INVALID_DISC_REGION , 3222081893U) /* 0xc00d1165 */ \ XXX( HRES_NS_E_DVD_COMPATIBLE_VIDEO_CARD , 3222081894U) /* 0xc00d1166 */ \ XXX( HRES_NS_E_DVD_MACROVISION , 3222081895U) /* 0xc00d1167 */ \ XXX( HRES_NS_E_DVD_SYSTEM_DECODER_REGION , 3222081896U) /* 0xc00d1168 */ \ XXX( HRES_NS_E_DVD_DISC_DECODER_REGION , 3222081897U) /* 0xc00d1169 */ \ XXX( HRES_NS_E_DVD_NO_VIDEO_STREAM , 3222081898U) /* 0xc00d116a */ \ XXX( HRES_NS_E_DVD_NO_AUDIO_STREAM , 3222081899U) /* 0xc00d116b */ \ XXX( HRES_NS_E_DVD_GRAPH_BUILDING , 3222081900U) /* 0xc00d116c */ \ XXX( HRES_NS_E_DVD_NO_DECODER , 3222081901U) /* 0xc00d116d */ \ XXX( HRES_NS_E_DVD_PARENTAL , 3222081902U) /* 0xc00d116e */ \ XXX( HRES_NS_E_DVD_CANNOT_JUMP , 3222081903U) /* 0xc00d116f */ \ XXX( HRES_NS_E_DVD_DEVICE_CONTENTION , 3222081904U) /* 0xc00d1170 */ \ XXX( HRES_NS_E_DVD_NO_VIDEO_MEMORY , 3222081905U) /* 0xc00d1171 */ \ XXX( HRES_NS_E_DVD_CANNOT_COPY_PROTECTED , 3222081906U) /* 0xc00d1172 */ \ XXX( HRES_NS_E_DVD_REQUIRED_PROPERTY_NOT_SET , 3222081907U) /* 0xc00d1173 */ \ XXX( HRES_NS_E_DVD_INVALID_TITLE_CHAPTER , 3222081908U) /* 0xc00d1174 */ \ XXX( HRES_NS_E_NO_CD_BURNER , 3222081910U) /* 0xc00d1176 */ \ XXX( HRES_NS_E_DEVICE_IS_NOT_READY , 3222081911U) /* 0xc00d1177 */ \ XXX( HRES_NS_E_PDA_UNSUPPORTED_FORMAT , 3222081912U) /* 0xc00d1178 */ \ XXX( HRES_NS_E_NO_PDA , 3222081913U) /* 0xc00d1179 */ \ XXX( HRES_NS_E_PDA_UNSPECIFIED_ERROR , 3222081914U) /* 0xc00d117a */ \ XXX( HRES_NS_E_MEMSTORAGE_BAD_DATA , 3222081915U) /* 0xc00d117b */ \ XXX( HRES_NS_E_PDA_FAIL_SELECT_DEVICE , 3222081916U) /* 0xc00d117c */ \ XXX( HRES_NS_E_PDA_FAIL_READ_WAVE_FILE , 3222081917U) /* 0xc00d117d */ \ XXX( HRES_NS_E_IMAPI_LOSSOFSTREAMING , 3222081918U) /* 0xc00d117e */ \ XXX( HRES_NS_E_PDA_DEVICE_FULL , 3222081919U) /* 0xc00d117f */ \ XXX( HRES_NS_E_FAIL_LAUNCH_ROXIO_PLUGIN , 3222081920U) /* 0xc00d1180 */ \ XXX( HRES_NS_E_PDA_DEVICE_FULL_IN_SESSION , 3222081921U) /* 0xc00d1181 */ \ XXX( HRES_NS_E_IMAPI_MEDIUM_INVALIDTYPE , 3222081922U) /* 0xc00d1182 */ \ XXX( HRES_NS_E_PDA_MANUALDEVICE , 3222081923U) /* 0xc00d1183 */ \ XXX( HRES_NS_E_PDA_PARTNERSHIPNOTEXIST , 3222081924U) /* 0xc00d1184 */ \ XXX( HRES_NS_E_PDA_CANNOT_CREATE_ADDITIONAL_SYNC_RELATIONSHIP, 3222081925U) /* 0xc00d1185 */ \ XXX( HRES_NS_E_PDA_NO_TRANSCODE_OF_DRM , 3222081926U) /* 0xc00d1186 */ \ XXX( HRES_NS_E_PDA_TRANSCODECACHEFULL , 3222081927U) /* 0xc00d1187 */ \ XXX( HRES_NS_E_PDA_TOO_MANY_FILE_COLLISIONS , 3222081928U) /* 0xc00d1188 */ \ XXX( HRES_NS_E_PDA_CANNOT_TRANSCODE , 3222081929U) /* 0xc00d1189 */ \ XXX( HRES_NS_E_PDA_TOO_MANY_FILES_IN_DIRECTORY , 3222081930U) /* 0xc00d118a */ \ XXX( HRES_NS_E_PROCESSINGSHOWSYNCWIZARD , 3222081931U) /* 0xc00d118b */ \ XXX( HRES_NS_E_PDA_TRANSCODE_NOT_PERMITTED , 3222081932U) /* 0xc00d118c */ \ XXX( HRES_NS_E_PDA_INITIALIZINGDEVICES , 3222081933U) /* 0xc00d118d */ \ XXX( HRES_NS_E_PDA_OBSOLETE_SP , 3222081934U) /* 0xc00d118e */ \ XXX( HRES_NS_E_PDA_TITLE_COLLISION , 3222081935U) /* 0xc00d118f */ \ XXX( HRES_NS_E_PDA_DEVICESUPPORTDISABLED , 3222081936U) /* 0xc00d1190 */ \ XXX( HRES_NS_E_PDA_NO_LONGER_AVAILABLE , 3222081937U) /* 0xc00d1191 */ \ XXX( HRES_NS_E_PDA_ENCODER_NOT_RESPONDING , 3222081938U) /* 0xc00d1192 */ \ XXX( HRES_NS_E_PDA_CANNOT_SYNC_FROM_LOCATION , 3222081939U) /* 0xc00d1193 */ \ XXX( HRES_NS_E_WMP_PROTOCOL_PROBLEM , 3222081940U) /* 0xc00d1194 */ \ XXX( HRES_NS_E_WMP_NO_DISK_SPACE , 3222081941U) /* 0xc00d1195 */ \ XXX( HRES_NS_E_WMP_LOGON_FAILURE , 3222081942U) /* 0xc00d1196 */ \ XXX( HRES_NS_E_WMP_CANNOT_FIND_FILE , 3222081943U) /* 0xc00d1197 */ \ XXX( HRES_NS_E_WMP_SERVER_INACCESSIBLE , 3222081944U) /* 0xc00d1198 */ \ XXX( HRES_NS_E_WMP_UNSUPPORTED_FORMAT , 3222081945U) /* 0xc00d1199 */ \ XXX( HRES_NS_E_WMP_DSHOW_UNSUPPORTED_FORMAT , 3222081946U) /* 0xc00d119a */ \ XXX( HRES_NS_E_WMP_PLAYLIST_EXISTS , 3222081947U) /* 0xc00d119b */ \ XXX( HRES_NS_E_WMP_NONMEDIA_FILES , 3222081948U) /* 0xc00d119c */ \ XXX( HRES_NS_E_WMP_INVALID_ASX , 3222081949U) /* 0xc00d119d */ \ XXX( HRES_NS_E_WMP_ALREADY_IN_USE , 3222081950U) /* 0xc00d119e */ \ XXX( HRES_NS_E_WMP_IMAPI_FAILURE , 3222081951U) /* 0xc00d119f */ \ XXX( HRES_NS_E_WMP_WMDM_FAILURE , 3222081952U) /* 0xc00d11a0 */ \ XXX( HRES_NS_E_WMP_CODEC_NEEDED_WITH_4CC , 3222081953U) /* 0xc00d11a1 */ \ XXX( HRES_NS_E_WMP_CODEC_NEEDED_WITH_FORMATTAG , 3222081954U) /* 0xc00d11a2 */ \ XXX( HRES_NS_E_WMP_MSSAP_NOT_AVAILABLE , 3222081955U) /* 0xc00d11a3 */ \ XXX( HRES_NS_E_WMP_WMDM_INTERFACEDEAD , 3222081956U) /* 0xc00d11a4 */ \ XXX( HRES_NS_E_WMP_WMDM_NOTCERTIFIED , 3222081957U) /* 0xc00d11a5 */ \ XXX( HRES_NS_E_WMP_WMDM_LICENSE_NOTEXIST , 3222081958U) /* 0xc00d11a6 */ \ XXX( HRES_NS_E_WMP_WMDM_LICENSE_EXPIRED , 3222081959U) /* 0xc00d11a7 */ \ XXX( HRES_NS_E_WMP_WMDM_BUSY , 3222081960U) /* 0xc00d11a8 */ \ XXX( HRES_NS_E_WMP_WMDM_NORIGHTS , 3222081961U) /* 0xc00d11a9 */ \ XXX( HRES_NS_E_WMP_WMDM_INCORRECT_RIGHTS , 3222081962U) /* 0xc00d11aa */ \ XXX( HRES_NS_E_WMP_IMAPI_GENERIC , 3222081963U) /* 0xc00d11ab */ \ XXX( HRES_NS_E_WMP_IMAPI_DEVICE_NOTPRESENT , 3222081965U) /* 0xc00d11ad */ \ XXX( HRES_NS_E_WMP_IMAPI_DEVICE_BUSY , 3222081966U) /* 0xc00d11ae */ \ XXX( HRES_NS_E_WMP_IMAPI_LOSS_OF_STREAMING , 3222081967U) /* 0xc00d11af */ \ XXX( HRES_NS_E_WMP_SERVER_UNAVAILABLE , 3222081968U) /* 0xc00d11b0 */ \ XXX( HRES_NS_E_WMP_FILE_OPEN_FAILED , 3222081969U) /* 0xc00d11b1 */ \ XXX( HRES_NS_E_WMP_VERIFY_ONLINE , 3222081970U) /* 0xc00d11b2 */ \ XXX( HRES_NS_E_WMP_SERVER_NOT_RESPONDING , 3222081971U) /* 0xc00d11b3 */ \ XXX( HRES_NS_E_WMP_DRM_CORRUPT_BACKUP , 3222081972U) /* 0xc00d11b4 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_SERVER_UNAVAILABLE , 3222081973U) /* 0xc00d11b5 */ \ XXX( HRES_NS_E_WMP_NETWORK_FIREWALL , 3222081974U) /* 0xc00d11b6 */ \ XXX( HRES_NS_E_WMP_NO_REMOVABLE_MEDIA , 3222081975U) /* 0xc00d11b7 */ \ XXX( HRES_NS_E_WMP_PROXY_CONNECT_TIMEOUT , 3222081976U) /* 0xc00d11b8 */ \ XXX( HRES_NS_E_WMP_NEED_UPGRADE , 3222081977U) /* 0xc00d11b9 */ \ XXX( HRES_NS_E_WMP_AUDIO_HW_PROBLEM , 3222081978U) /* 0xc00d11ba */ \ XXX( HRES_NS_E_WMP_INVALID_PROTOCOL , 3222081979U) /* 0xc00d11bb */ \ XXX( HRES_NS_E_WMP_INVALID_LIBRARY_ADD , 3222081980U) /* 0xc00d11bc */ \ XXX( HRES_NS_E_WMP_MMS_NOT_SUPPORTED , 3222081981U) /* 0xc00d11bd */ \ XXX( HRES_NS_E_WMP_NO_PROTOCOLS_SELECTED , 3222081982U) /* 0xc00d11be */ \ XXX( HRES_NS_E_WMP_GOFULLSCREEN_FAILED , 3222081983U) /* 0xc00d11bf */ \ XXX( HRES_NS_E_WMP_NETWORK_ERROR , 3222081984U) /* 0xc00d11c0 */ \ XXX( HRES_NS_E_WMP_CONNECT_TIMEOUT , 3222081985U) /* 0xc00d11c1 */ \ XXX( HRES_NS_E_WMP_MULTICAST_DISABLED , 3222081986U) /* 0xc00d11c2 */ \ XXX( HRES_NS_E_WMP_SERVER_DNS_TIMEOUT , 3222081987U) /* 0xc00d11c3 */ \ XXX( HRES_NS_E_WMP_PROXY_NOT_FOUND , 3222081988U) /* 0xc00d11c4 */ \ XXX( HRES_NS_E_WMP_TAMPERED_CONTENT , 3222081989U) /* 0xc00d11c5 */ \ XXX( HRES_NS_E_WMP_OUTOFMEMORY , 3222081990U) /* 0xc00d11c6 */ \ XXX( HRES_NS_E_WMP_AUDIO_CODEC_NOT_INSTALLED , 3222081991U) /* 0xc00d11c7 */ \ XXX( HRES_NS_E_WMP_VIDEO_CODEC_NOT_INSTALLED , 3222081992U) /* 0xc00d11c8 */ \ XXX( HRES_NS_E_WMP_IMAPI_DEVICE_INVALIDTYPE , 3222081993U) /* 0xc00d11c9 */ \ XXX( HRES_NS_E_WMP_DRM_DRIVER_AUTH_FAILURE , 3222081994U) /* 0xc00d11ca */ \ XXX( HRES_NS_E_WMP_NETWORK_RESOURCE_FAILURE , 3222081995U) /* 0xc00d11cb */ \ XXX( HRES_NS_E_WMP_UPGRADE_APPLICATION , 3222081996U) /* 0xc00d11cc */ \ XXX( HRES_NS_E_WMP_UNKNOWN_ERROR , 3222081997U) /* 0xc00d11cd */ \ XXX( HRES_NS_E_WMP_INVALID_KEY , 3222081998U) /* 0xc00d11ce */ \ XXX( HRES_NS_E_WMP_CD_ANOTHER_USER , 3222081999U) /* 0xc00d11cf */ \ XXX( HRES_NS_E_WMP_DRM_NEEDS_AUTHORIZATION , 3222082000U) /* 0xc00d11d0 */ \ XXX( HRES_NS_E_WMP_BAD_DRIVER , 3222082001U) /* 0xc00d11d1 */ \ XXX( HRES_NS_E_WMP_ACCESS_DENIED , 3222082002U) /* 0xc00d11d2 */ \ XXX( HRES_NS_E_WMP_LICENSE_RESTRICTS , 3222082003U) /* 0xc00d11d3 */ \ XXX( HRES_NS_E_WMP_INVALID_REQUEST , 3222082004U) /* 0xc00d11d4 */ \ XXX( HRES_NS_E_WMP_CD_STASH_NO_SPACE , 3222082005U) /* 0xc00d11d5 */ \ XXX( HRES_NS_E_WMP_DRM_NEW_HARDWARE , 3222082006U) /* 0xc00d11d6 */ \ XXX( HRES_NS_E_WMP_DRM_INVALID_SIG , 3222082007U) /* 0xc00d11d7 */ \ XXX( HRES_NS_E_WMP_DRM_CANNOT_RESTORE , 3222082008U) /* 0xc00d11d8 */ \ XXX( HRES_NS_E_WMP_BURN_DISC_OVERFLOW , 3222082009U) /* 0xc00d11d9 */ \ XXX( HRES_NS_E_WMP_DRM_GENERIC_LICENSE_FAILURE , 3222082010U) /* 0xc00d11da */ \ XXX( HRES_NS_E_WMP_DRM_NO_SECURE_CLOCK , 3222082011U) /* 0xc00d11db */ \ XXX( HRES_NS_E_WMP_DRM_NO_RIGHTS , 3222082012U) /* 0xc00d11dc */ \ XXX( HRES_NS_E_WMP_DRM_INDIV_FAILED , 3222082013U) /* 0xc00d11dd */ \ XXX( HRES_NS_E_WMP_SERVER_NONEWCONNECTIONS , 3222082014U) /* 0xc00d11de */ \ XXX( HRES_NS_E_WMP_MULTIPLE_ERROR_IN_PLAYLIST , 3222082015U) /* 0xc00d11df */ \ XXX( HRES_NS_E_WMP_IMAPI2_ERASE_FAIL , 3222082016U) /* 0xc00d11e0 */ \ XXX( HRES_NS_E_WMP_IMAPI2_ERASE_DEVICE_BUSY , 3222082017U) /* 0xc00d11e1 */ \ XXX( HRES_NS_E_WMP_DRM_COMPONENT_FAILURE , 3222082018U) /* 0xc00d11e2 */ \ XXX( HRES_NS_E_WMP_DRM_NO_DEVICE_CERT , 3222082019U) /* 0xc00d11e3 */ \ XXX( HRES_NS_E_WMP_SERVER_SECURITY_ERROR , 3222082020U) /* 0xc00d11e4 */ \ XXX( HRES_NS_E_WMP_AUDIO_DEVICE_LOST , 3222082021U) /* 0xc00d11e5 */ \ XXX( HRES_NS_E_WMP_IMAPI_MEDIA_INCOMPATIBLE , 3222082022U) /* 0xc00d11e6 */ \ XXX( HRES_NS_E_SYNCWIZ_DEVICE_FULL , 3222082030U) /* 0xc00d11ee */ \ XXX( HRES_NS_E_SYNCWIZ_CANNOT_CHANGE_SETTINGS , 3222082031U) /* 0xc00d11ef */ \ XXX( HRES_NS_E_TRANSCODE_DELETECACHEERROR , 3222082032U) /* 0xc00d11f0 */ \ XXX( HRES_NS_E_CD_NO_BUFFERS_READ , 3222082040U) /* 0xc00d11f8 */ \ XXX( HRES_NS_E_CD_EMPTY_TRACK_QUEUE , 3222082041U) /* 0xc00d11f9 */ \ XXX( HRES_NS_E_CD_NO_READER , 3222082042U) /* 0xc00d11fa */ \ XXX( HRES_NS_E_CD_ISRC_INVALID , 3222082043U) /* 0xc00d11fb */ \ XXX( HRES_NS_E_CD_MEDIA_CATALOG_NUMBER_INVALID , 3222082044U) /* 0xc00d11fc */ \ XXX( HRES_NS_E_SLOW_READ_DIGITAL_WITH_ERRORCORRECTION, 3222082045U) /* 0xc00d11fd */ \ XXX( HRES_NS_E_CD_SPEEDDETECT_NOT_ENOUGH_READS , 3222082046U) /* 0xc00d11fe */ \ XXX( HRES_NS_E_CD_QUEUEING_DISABLED , 3222082047U) /* 0xc00d11ff */ \ XXX( HRES_NS_E_WMP_DRM_ACQUIRING_LICENSE , 3222082050U) /* 0xc00d1202 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_EXPIRED , 3222082051U) /* 0xc00d1203 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_NOTACQUIRED , 3222082052U) /* 0xc00d1204 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_NOTENABLED , 3222082053U) /* 0xc00d1205 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_UNUSABLE , 3222082054U) /* 0xc00d1206 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_CONTENT_REVOKED , 3222082055U) /* 0xc00d1207 */ \ XXX( HRES_NS_E_WMP_DRM_LICENSE_NOSAP , 3222082056U) /* 0xc00d1208 */ \ XXX( HRES_NS_E_WMP_DRM_UNABLE_TO_ACQUIRE_LICENSE , 3222082057U) /* 0xc00d1209 */ \ XXX( HRES_NS_E_WMP_LICENSE_REQUIRED , 3222082058U) /* 0xc00d120a */ \ XXX( HRES_NS_E_WMP_PROTECTED_CONTENT , 3222082059U) /* 0xc00d120b */ \ XXX( HRES_NS_E_WMP_POLICY_VALUE_NOT_CONFIGURED , 3222082090U) /* 0xc00d122a */ \ XXX( HRES_NS_E_PDA_CANNOT_SYNC_FROM_INTERNET , 3222082100U) /* 0xc00d1234 */ \ XXX( HRES_NS_E_PDA_CANNOT_SYNC_INVALID_PLAYLIST , 3222082101U) /* 0xc00d1235 */ \ XXX( HRES_NS_E_PDA_FAILED_TO_SYNCHRONIZE_FILE , 3222082102U) /* 0xc00d1236 */ \ XXX( HRES_NS_E_PDA_SYNC_FAILED , 3222082103U) /* 0xc00d1237 */ \ XXX( HRES_NS_E_PDA_DELETE_FAILED , 3222082104U) /* 0xc00d1238 */ \ XXX( HRES_NS_E_PDA_FAILED_TO_RETRIEVE_FILE , 3222082105U) /* 0xc00d1239 */ \ XXX( HRES_NS_E_PDA_DEVICE_NOT_RESPONDING , 3222082106U) /* 0xc00d123a */ \ XXX( HRES_NS_E_PDA_FAILED_TO_TRANSCODE_PHOTO , 3222082107U) /* 0xc00d123b */ \ XXX( HRES_NS_E_PDA_FAILED_TO_ENCRYPT_TRANSCODED_FILE, 3222082108U) /* 0xc00d123c */ \ XXX( HRES_NS_E_PDA_CANNOT_TRANSCODE_TO_AUDIO , 3222082109U) /* 0xc00d123d */ \ XXX( HRES_NS_E_PDA_CANNOT_TRANSCODE_TO_VIDEO , 3222082110U) /* 0xc00d123e */ \ XXX( HRES_NS_E_PDA_CANNOT_TRANSCODE_TO_IMAGE , 3222082111U) /* 0xc00d123f */ \ XXX( HRES_NS_E_PDA_RETRIEVED_FILE_FILENAME_TOO_LONG , 3222082112U) /* 0xc00d1240 */ \ XXX( HRES_NS_E_PDA_CEWMDM_DRM_ERROR , 3222082113U) /* 0xc00d1241 */ \ XXX( HRES_NS_E_INCOMPLETE_PLAYLIST , 3222082114U) /* 0xc00d1242 */ \ XXX( HRES_NS_E_PDA_SYNC_RUNNING , 3222082115U) /* 0xc00d1243 */ \ XXX( HRES_NS_E_PDA_SYNC_LOGIN_ERROR , 3222082116U) /* 0xc00d1244 */ \ XXX( HRES_NS_E_PDA_TRANSCODE_CODEC_NOT_FOUND , 3222082117U) /* 0xc00d1245 */ \ XXX( HRES_NS_E_CANNOT_SYNC_DRM_TO_NON_JANUS_DEVICE , 3222082118U) /* 0xc00d1246 */ \ XXX( HRES_NS_E_CANNOT_SYNC_PREVIOUS_SYNC_RUNNING , 3222082119U) /* 0xc00d1247 */ \ XXX( HRES_NS_E_WMP_HWND_NOTFOUND , 3222082140U) /* 0xc00d125c */ \ XXX( HRES_NS_E_BKGDOWNLOAD_WRONG_NO_FILES , 3222082141U) /* 0xc00d125d */ \ XXX( HRES_NS_E_BKGDOWNLOAD_COMPLETECANCELLEDJOB , 3222082142U) /* 0xc00d125e */ \ XXX( HRES_NS_E_BKGDOWNLOAD_CANCELCOMPLETEDJOB , 3222082143U) /* 0xc00d125f */ \ XXX( HRES_NS_E_BKGDOWNLOAD_NOJOBPOINTER , 3222082144U) /* 0xc00d1260 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_INVALIDJOBSIGNATURE , 3222082145U) /* 0xc00d1261 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_FAILED_TO_CREATE_TEMPFILE, 3222082146U) /* 0xc00d1262 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_PLUGIN_FAILEDINITIALIZE , 3222082147U) /* 0xc00d1263 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_PLUGIN_FAILEDTOMOVEFILE , 3222082148U) /* 0xc00d1264 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_CALLFUNCFAILED , 3222082149U) /* 0xc00d1265 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_CALLFUNCTIMEOUT , 3222082150U) /* 0xc00d1266 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_CALLFUNCENDED , 3222082151U) /* 0xc00d1267 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_WMDUNPACKFAILED , 3222082152U) /* 0xc00d1268 */ \ XXX( HRES_NS_E_BKGDOWNLOAD_FAILEDINITIALIZE , 3222082153U) /* 0xc00d1269 */ \ XXX( HRES_NS_E_INTERFACE_NOT_REGISTERED_IN_GIT , 3222082154U) /* 0xc00d126a */ \ XXX( HRES_NS_E_BKGDOWNLOAD_INVALID_FILE_NAME , 3222082155U) /* 0xc00d126b */ \ XXX( HRES_NS_E_IMAGE_DOWNLOAD_FAILED , 3222082190U) /* 0xc00d128e */ \ XXX( HRES_NS_E_WMP_UDRM_NOUSERLIST , 3222082240U) /* 0xc00d12c0 */ \ XXX( HRES_NS_E_WMP_DRM_NOT_ACQUIRING , 3222082241U) /* 0xc00d12c1 */ \ XXX( HRES_NS_E_WMP_BSTR_TOO_LONG , 3222082290U) /* 0xc00d12f2 */ \ XXX( HRES_NS_E_WMP_AUTOPLAY_INVALID_STATE , 3222082300U) /* 0xc00d12fc */ \ XXX( HRES_NS_E_WMP_COMPONENT_REVOKED , 3222082310U) /* 0xc00d1306 */ \ XXX( HRES_NS_E_CURL_NOTSAFE , 3222082340U) /* 0xc00d1324 */ \ XXX( HRES_NS_E_CURL_INVALIDCHAR , 3222082341U) /* 0xc00d1325 */ \ XXX( HRES_NS_E_CURL_INVALIDHOSTNAME , 3222082342U) /* 0xc00d1326 */ \ XXX( HRES_NS_E_CURL_INVALIDPATH , 3222082343U) /* 0xc00d1327 */ \ XXX( HRES_NS_E_CURL_INVALIDSCHEME , 3222082344U) /* 0xc00d1328 */ \ XXX( HRES_NS_E_CURL_INVALIDURL , 3222082345U) /* 0xc00d1329 */ \ XXX( HRES_NS_E_CURL_CANTWALK , 3222082347U) /* 0xc00d132b */ \ XXX( HRES_NS_E_CURL_INVALIDPORT , 3222082348U) /* 0xc00d132c */ \ XXX( HRES_NS_E_CURLHELPER_NOTADIRECTORY , 3222082349U) /* 0xc00d132d */ \ XXX( HRES_NS_E_CURLHELPER_NOTAFILE , 3222082350U) /* 0xc00d132e */ \ XXX( HRES_NS_E_CURL_CANTDECODE , 3222082351U) /* 0xc00d132f */ \ XXX( HRES_NS_E_CURLHELPER_NOTRELATIVE , 3222082352U) /* 0xc00d1330 */ \ XXX( HRES_NS_E_CURL_INVALIDBUFFERSIZE , 3222082353U) /* 0xc00d1331 */ \ XXX( HRES_NS_E_SUBSCRIPTIONSERVICE_PLAYBACK_DISALLOWED, 3222082390U) /* 0xc00d1356 */ \ XXX( HRES_NS_E_CANNOT_BUY_OR_DOWNLOAD_FROM_MULTIPLE_SERVICES, 3222082391U) /* 0xc00d1357 */ \ XXX( HRES_NS_E_CANNOT_BUY_OR_DOWNLOAD_CONTENT , 3222082392U) /* 0xc00d1358 */ \ XXX( HRES_NS_E_NOT_CONTENT_PARTNER_TRACK , 3222082394U) /* 0xc00d135a */ \ XXX( HRES_NS_E_TRACK_DOWNLOAD_REQUIRES_ALBUM_PURCHASE, 3222082395U) /* 0xc00d135b */ \ XXX( HRES_NS_E_TRACK_DOWNLOAD_REQUIRES_PURCHASE , 3222082396U) /* 0xc00d135c */ \ XXX( HRES_NS_E_TRACK_PURCHASE_MAXIMUM_EXCEEDED , 3222082397U) /* 0xc00d135d */ \ XXX( HRES_NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED , 3222082399U) /* 0xc00d135f */ \ XXX( HRES_NS_E_SUBSCRIPTIONSERVICE_DOWNLOAD_TIMEOUT , 3222082400U) /* 0xc00d1360 */ \ XXX( HRES_NS_E_CONTENT_PARTNER_STILL_INITIALIZING , 3222082402U) /* 0xc00d1362 */ \ XXX( HRES_NS_E_OPEN_CONTAINING_FOLDER_FAILED , 3222082403U) /* 0xc00d1363 */ \ XXX( HRES_NS_E_ADVANCEDEDIT_TOO_MANY_PICTURES , 3222082410U) /* 0xc00d136a */ \ XXX( HRES_NS_E_REDIRECT , 3222082440U) /* 0xc00d1388 */ \ XXX( HRES_NS_E_STALE_PRESENTATION , 3222082441U) /* 0xc00d1389 */ \ XXX( HRES_NS_E_NAMESPACE_WRONG_PERSIST , 3222082442U) /* 0xc00d138a */ \ XXX( HRES_NS_E_NAMESPACE_WRONG_TYPE , 3222082443U) /* 0xc00d138b */ \ XXX( HRES_NS_E_NAMESPACE_NODE_CONFLICT , 3222082444U) /* 0xc00d138c */ \ XXX( HRES_NS_E_NAMESPACE_NODE_NOT_FOUND , 3222082445U) /* 0xc00d138d */ \ XXX( HRES_NS_E_NAMESPACE_BUFFER_TOO_SMALL , 3222082446U) /* 0xc00d138e */ \ XXX( HRES_NS_E_NAMESPACE_TOO_MANY_CALLBACKS , 3222082447U) /* 0xc00d138f */ \ XXX( HRES_NS_E_NAMESPACE_DUPLICATE_CALLBACK , 3222082448U) /* 0xc00d1390 */ \ XXX( HRES_NS_E_NAMESPACE_CALLBACK_NOT_FOUND , 3222082449U) /* 0xc00d1391 */ \ XXX( HRES_NS_E_NAMESPACE_NAME_TOO_LONG , 3222082450U) /* 0xc00d1392 */ \ XXX( HRES_NS_E_NAMESPACE_DUPLICATE_NAME , 3222082451U) /* 0xc00d1393 */ \ XXX( HRES_NS_E_NAMESPACE_EMPTY_NAME , 3222082452U) /* 0xc00d1394 */ \ XXX( HRES_NS_E_NAMESPACE_INDEX_TOO_LARGE , 3222082453U) /* 0xc00d1395 */ \ XXX( HRES_NS_E_NAMESPACE_BAD_NAME , 3222082454U) /* 0xc00d1396 */ \ XXX( HRES_NS_E_NAMESPACE_WRONG_SECURITY , 3222082455U) /* 0xc00d1397 */ \ XXX( HRES_NS_E_CACHE_ARCHIVE_CONFLICT , 3222082540U) /* 0xc00d13ec */ \ XXX( HRES_NS_E_CACHE_ORIGIN_SERVER_NOT_FOUND , 3222082541U) /* 0xc00d13ed */ \ XXX( HRES_NS_E_CACHE_ORIGIN_SERVER_TIMEOUT , 3222082542U) /* 0xc00d13ee */ \ XXX( HRES_NS_E_CACHE_NOT_BROADCAST , 3222082543U) /* 0xc00d13ef */ \ XXX( HRES_NS_E_CACHE_CANNOT_BE_CACHED , 3222082544U) /* 0xc00d13f0 */ \ XXX( HRES_NS_E_CACHE_NOT_MODIFIED , 3222082545U) /* 0xc00d13f1 */ \ XXX( HRES_NS_E_CANNOT_REMOVE_PUBLISHING_POINT , 3222082640U) /* 0xc00d1450 */ \ XXX( HRES_NS_E_CANNOT_REMOVE_PLUGIN , 3222082641U) /* 0xc00d1451 */ \ XXX( HRES_NS_E_WRONG_PUBLISHING_POINT_TYPE , 3222082642U) /* 0xc00d1452 */ \ XXX( HRES_NS_E_UNSUPPORTED_LOAD_TYPE , 3222082643U) /* 0xc00d1453 */ \ XXX( HRES_NS_E_INVALID_PLUGIN_LOAD_TYPE_CONFIGURATION, 3222082644U) /* 0xc00d1454 */ \ XXX( HRES_NS_E_INVALID_PUBLISHING_POINT_NAME , 3222082645U) /* 0xc00d1455 */ \ XXX( HRES_NS_E_TOO_MANY_MULTICAST_SINKS , 3222082646U) /* 0xc00d1456 */ \ XXX( HRES_NS_E_PUBLISHING_POINT_INVALID_REQUEST_WHILE_STARTED, 3222082647U) /* 0xc00d1457 */ \ XXX( HRES_NS_E_MULTICAST_PLUGIN_NOT_ENABLED , 3222082648U) /* 0xc00d1458 */ \ XXX( HRES_NS_E_INVALID_OPERATING_SYSTEM_VERSION , 3222082649U) /* 0xc00d1459 */ \ XXX( HRES_NS_E_PUBLISHING_POINT_REMOVED , 3222082650U) /* 0xc00d145a */ \ XXX( HRES_NS_E_INVALID_PUSH_PUBLISHING_POINT_START_REQUEST, 3222082651U) /* 0xc00d145b */ \ XXX( HRES_NS_E_UNSUPPORTED_LANGUAGE , 3222082652U) /* 0xc00d145c */ \ XXX( HRES_NS_E_WRONG_OS_VERSION , 3222082653U) /* 0xc00d145d */ \ XXX( HRES_NS_E_PUBLISHING_POINT_STOPPED , 3222082654U) /* 0xc00d145e */ \ XXX( HRES_NS_E_PLAYLIST_ENTRY_ALREADY_PLAYING , 3222082740U) /* 0xc00d14b4 */ \ XXX( HRES_NS_E_EMPTY_PLAYLIST , 3222082741U) /* 0xc00d14b5 */ \ XXX( HRES_NS_E_PLAYLIST_PARSE_FAILURE , 3222082742U) /* 0xc00d14b6 */ \ XXX( HRES_NS_E_PLAYLIST_UNSUPPORTED_ENTRY , 3222082743U) /* 0xc00d14b7 */ \ XXX( HRES_NS_E_PLAYLIST_ENTRY_NOT_IN_PLAYLIST , 3222082744U) /* 0xc00d14b8 */ \ XXX( HRES_NS_E_PLAYLIST_ENTRY_SEEK , 3222082745U) /* 0xc00d14b9 */ \ XXX( HRES_NS_E_PLAYLIST_RECURSIVE_PLAYLISTS , 3222082746U) /* 0xc00d14ba */ \ XXX( HRES_NS_E_PLAYLIST_TOO_MANY_NESTED_PLAYLISTS , 3222082747U) /* 0xc00d14bb */ \ XXX( HRES_NS_E_PLAYLIST_SHUTDOWN , 3222082748U) /* 0xc00d14bc */ \ XXX( HRES_NS_E_PLAYLIST_END_RECEDING , 3222082749U) /* 0xc00d14bd */ \ XXX( HRES_NS_E_DATAPATH_NO_SINK , 3222082840U) /* 0xc00d1518 */ \ XXX( HRES_NS_E_INVALID_PUSH_TEMPLATE , 3222082842U) /* 0xc00d151a */ \ XXX( HRES_NS_E_INVALID_PUSH_PUBLISHING_POINT , 3222082843U) /* 0xc00d151b */ \ XXX( HRES_NS_E_CRITICAL_ERROR , 3222082844U) /* 0xc00d151c */ \ XXX( HRES_NS_E_NO_NEW_CONNECTIONS , 3222082845U) /* 0xc00d151d */ \ XXX( HRES_NS_E_WSX_INVALID_VERSION , 3222082846U) /* 0xc00d151e */ \ XXX( HRES_NS_E_HEADER_MISMATCH , 3222082847U) /* 0xc00d151f */ \ XXX( HRES_NS_E_PUSH_DUPLICATE_PUBLISHING_POINT_NAME , 3222082848U) /* 0xc00d1520 */ \ XXX( HRES_NS_E_NO_SCRIPT_ENGINE , 3222082940U) /* 0xc00d157c */ \ XXX( HRES_NS_E_PLUGIN_ERROR_REPORTED , 3222082941U) /* 0xc00d157d */ \ XXX( HRES_NS_E_SOURCE_PLUGIN_NOT_FOUND , 3222082942U) /* 0xc00d157e */ \ XXX( HRES_NS_E_PLAYLIST_PLUGIN_NOT_FOUND , 3222082943U) /* 0xc00d157f */ \ XXX( HRES_NS_E_DATA_SOURCE_ENUMERATION_NOT_SUPPORTED, 3222082944U) /* 0xc00d1580 */ \ XXX( HRES_NS_E_MEDIA_PARSER_INVALID_FORMAT , 3222082945U) /* 0xc00d1581 */ \ XXX( HRES_NS_E_SCRIPT_DEBUGGER_NOT_INSTALLED , 3222082946U) /* 0xc00d1582 */ \ XXX( HRES_NS_E_FEATURE_REQUIRES_ENTERPRISE_SERVER , 3222082947U) /* 0xc00d1583 */ \ XXX( HRES_NS_E_WIZARD_RUNNING , 3222082948U) /* 0xc00d1584 */ \ XXX( HRES_NS_E_INVALID_LOG_URL , 3222082949U) /* 0xc00d1585 */ \ XXX( HRES_NS_E_INVALID_MTU_RANGE , 3222082950U) /* 0xc00d1586 */ \ XXX( HRES_NS_E_INVALID_PLAY_STATISTICS , 3222082951U) /* 0xc00d1587 */ \ XXX( HRES_NS_E_LOG_NEED_TO_BE_SKIPPED , 3222082952U) /* 0xc00d1588 */ \ XXX( HRES_NS_E_HTTP_TEXT_DATACONTAINER_SIZE_LIMIT_EXCEEDED, 3222082953U) /* 0xc00d1589 */ \ XXX( HRES_NS_E_PORT_IN_USE , 3222082954U) /* 0xc00d158a */ \ XXX( HRES_NS_E_PORT_IN_USE_HTTP , 3222082955U) /* 0xc00d158b */ \ XXX( HRES_NS_E_HTTP_TEXT_DATACONTAINER_INVALID_SERVER_RESPONSE, 3222082956U) /* 0xc00d158c */ \ XXX( HRES_NS_E_ARCHIVE_REACH_QUOTA , 3222082957U) /* 0xc00d158d */ \ XXX( HRES_NS_E_ARCHIVE_ABORT_DUE_TO_BCAST , 3222082958U) /* 0xc00d158e */ \ XXX( HRES_NS_E_ARCHIVE_GAP_DETECTED , 3222082959U) /* 0xc00d158f */ \ XXX( HRES_NS_E_AUTHORIZATION_FILE_NOT_FOUND , 3222082960U) /* 0xc00d1590 */ \ XXX( HRES_NS_E_BAD_MARKIN , 3222084440U) /* 0xc00d1b58 */ \ XXX( HRES_NS_E_BAD_MARKOUT , 3222084441U) /* 0xc00d1b59 */ \ XXX( HRES_NS_E_NOMATCHING_MEDIASOURCE , 3222084442U) /* 0xc00d1b5a */ \ XXX( HRES_NS_E_UNSUPPORTED_SOURCETYPE , 3222084443U) /* 0xc00d1b5b */ \ XXX( HRES_NS_E_TOO_MANY_AUDIO , 3222084444U) /* 0xc00d1b5c */ \ XXX( HRES_NS_E_TOO_MANY_VIDEO , 3222084445U) /* 0xc00d1b5d */ \ XXX( HRES_NS_E_NOMATCHING_ELEMENT , 3222084446U) /* 0xc00d1b5e */ \ XXX( HRES_NS_E_MISMATCHED_MEDIACONTENT , 3222084447U) /* 0xc00d1b5f */ \ XXX( HRES_NS_E_CANNOT_DELETE_ACTIVE_SOURCEGROUP , 3222084448U) /* 0xc00d1b60 */ \ XXX( HRES_NS_E_AUDIODEVICE_BUSY , 3222084449U) /* 0xc00d1b61 */ \ XXX( HRES_NS_E_AUDIODEVICE_UNEXPECTED , 3222084450U) /* 0xc00d1b62 */ \ XXX( HRES_NS_E_AUDIODEVICE_BADFORMAT , 3222084451U) /* 0xc00d1b63 */ \ XXX( HRES_NS_E_VIDEODEVICE_BUSY , 3222084452U) /* 0xc00d1b64 */ \ XXX( HRES_NS_E_VIDEODEVICE_UNEXPECTED , 3222084453U) /* 0xc00d1b65 */ \ XXX( HRES_NS_E_INVALIDCALL_WHILE_ENCODER_RUNNING , 3222084454U) /* 0xc00d1b66 */ \ XXX( HRES_NS_E_NO_PROFILE_IN_SOURCEGROUP , 3222084455U) /* 0xc00d1b67 */ \ XXX( HRES_NS_E_VIDEODRIVER_UNSTABLE , 3222084456U) /* 0xc00d1b68 */ \ XXX( HRES_NS_E_VIDCAPSTARTFAILED , 3222084457U) /* 0xc00d1b69 */ \ XXX( HRES_NS_E_VIDSOURCECOMPRESSION , 3222084458U) /* 0xc00d1b6a */ \ XXX( HRES_NS_E_VIDSOURCESIZE , 3222084459U) /* 0xc00d1b6b */ \ XXX( HRES_NS_E_ICMQUERYFORMAT , 3222084460U) /* 0xc00d1b6c */ \ XXX( HRES_NS_E_VIDCAPCREATEWINDOW , 3222084461U) /* 0xc00d1b6d */ \ XXX( HRES_NS_E_VIDCAPDRVINUSE , 3222084462U) /* 0xc00d1b6e */ \ XXX( HRES_NS_E_NO_MEDIAFORMAT_IN_SOURCE , 3222084463U) /* 0xc00d1b6f */ \ XXX( HRES_NS_E_NO_VALID_OUTPUT_STREAM , 3222084464U) /* 0xc00d1b70 */ \ XXX( HRES_NS_E_NO_VALID_SOURCE_PLUGIN , 3222084465U) /* 0xc00d1b71 */ \ XXX( HRES_NS_E_NO_ACTIVE_SOURCEGROUP , 3222084466U) /* 0xc00d1b72 */ \ XXX( HRES_NS_E_NO_SCRIPT_STREAM , 3222084467U) /* 0xc00d1b73 */ \ XXX( HRES_NS_E_INVALIDCALL_WHILE_ARCHIVAL_RUNNING , 3222084468U) /* 0xc00d1b74 */ \ XXX( HRES_NS_E_INVALIDPACKETSIZE , 3222084469U) /* 0xc00d1b75 */ \ XXX( HRES_NS_E_PLUGIN_CLSID_INVALID , 3222084470U) /* 0xc00d1b76 */ \ XXX( HRES_NS_E_UNSUPPORTED_ARCHIVETYPE , 3222084471U) /* 0xc00d1b77 */ \ XXX( HRES_NS_E_UNSUPPORTED_ARCHIVEOPERATION , 3222084472U) /* 0xc00d1b78 */ \ XXX( HRES_NS_E_ARCHIVE_FILENAME_NOTSET , 3222084473U) /* 0xc00d1b79 */ \ XXX( HRES_NS_E_SOURCEGROUP_NOTPREPARED , 3222084474U) /* 0xc00d1b7a */ \ XXX( HRES_NS_E_PROFILE_MISMATCH , 3222084475U) /* 0xc00d1b7b */ \ XXX( HRES_NS_E_INCORRECTCLIPSETTINGS , 3222084476U) /* 0xc00d1b7c */ \ XXX( HRES_NS_E_NOSTATSAVAILABLE , 3222084477U) /* 0xc00d1b7d */ \ XXX( HRES_NS_E_NOTARCHIVING , 3222084478U) /* 0xc00d1b7e */ \ XXX( HRES_NS_E_INVALIDCALL_WHILE_ENCODER_STOPPED , 3222084479U) /* 0xc00d1b7f */ \ XXX( HRES_NS_E_NOSOURCEGROUPS , 3222084480U) /* 0xc00d1b80 */ \ XXX( HRES_NS_E_INVALIDINPUTFPS , 3222084481U) /* 0xc00d1b81 */ \ XXX( HRES_NS_E_NO_DATAVIEW_SUPPORT , 3222084482U) /* 0xc00d1b82 */ \ XXX( HRES_NS_E_CODEC_UNAVAILABLE , 3222084483U) /* 0xc00d1b83 */ \ XXX( HRES_NS_E_ARCHIVE_SAME_AS_INPUT , 3222084484U) /* 0xc00d1b84 */ \ XXX( HRES_NS_E_SOURCE_NOTSPECIFIED , 3222084485U) /* 0xc00d1b85 */ \ XXX( HRES_NS_E_NO_REALTIME_TIMECOMPRESSION , 3222084486U) /* 0xc00d1b86 */ \ XXX( HRES_NS_E_UNSUPPORTED_ENCODER_DEVICE , 3222084487U) /* 0xc00d1b87 */ \ XXX( HRES_NS_E_UNEXPECTED_DISPLAY_SETTINGS , 3222084488U) /* 0xc00d1b88 */ \ XXX( HRES_NS_E_NO_AUDIODATA , 3222084489U) /* 0xc00d1b89 */ \ XXX( HRES_NS_E_INPUTSOURCE_PROBLEM , 3222084490U) /* 0xc00d1b8a */ \ XXX( HRES_NS_E_WME_VERSION_MISMATCH , 3222084491U) /* 0xc00d1b8b */ \ XXX( HRES_NS_E_NO_REALTIME_PREPROCESS , 3222084492U) /* 0xc00d1b8c */ \ XXX( HRES_NS_E_NO_REPEAT_PREPROCESS , 3222084493U) /* 0xc00d1b8d */ \ XXX( HRES_NS_E_CANNOT_PAUSE_LIVEBROADCAST , 3222084494U) /* 0xc00d1b8e */ \ XXX( HRES_NS_E_DRM_PROFILE_NOT_SET , 3222084495U) /* 0xc00d1b8f */ \ XXX( HRES_NS_E_DUPLICATE_DRMPROFILE , 3222084496U) /* 0xc00d1b90 */ \ XXX( HRES_NS_E_INVALID_DEVICE , 3222084497U) /* 0xc00d1b91 */ \ XXX( HRES_NS_E_SPEECHEDL_ON_NON_MIXEDMODE , 3222084498U) /* 0xc00d1b92 */ \ XXX( HRES_NS_E_DRM_PASSWORD_TOO_LONG , 3222084499U) /* 0xc00d1b93 */ \ XXX( HRES_NS_E_DEVCONTROL_FAILED_SEEK , 3222084500U) /* 0xc00d1b94 */ \ XXX( HRES_NS_E_INTERLACE_REQUIRE_SAMESIZE , 3222084501U) /* 0xc00d1b95 */ \ XXX( HRES_NS_E_TOO_MANY_DEVICECONTROL , 3222084502U) /* 0xc00d1b96 */ \ XXX( HRES_NS_E_NO_MULTIPASS_FOR_LIVEDEVICE , 3222084503U) /* 0xc00d1b97 */ \ XXX( HRES_NS_E_MISSING_AUDIENCE , 3222084504U) /* 0xc00d1b98 */ \ XXX( HRES_NS_E_AUDIENCE_CONTENTTYPE_MISMATCH , 3222084505U) /* 0xc00d1b99 */ \ XXX( HRES_NS_E_MISSING_SOURCE_INDEX , 3222084506U) /* 0xc00d1b9a */ \ XXX( HRES_NS_E_NUM_LANGUAGE_MISMATCH , 3222084507U) /* 0xc00d1b9b */ \ XXX( HRES_NS_E_LANGUAGE_MISMATCH , 3222084508U) /* 0xc00d1b9c */ \ XXX( HRES_NS_E_VBRMODE_MISMATCH , 3222084509U) /* 0xc00d1b9d */ \ XXX( HRES_NS_E_INVALID_INPUT_AUDIENCE_INDEX , 3222084510U) /* 0xc00d1b9e */ \ XXX( HRES_NS_E_INVALID_INPUT_LANGUAGE , 3222084511U) /* 0xc00d1b9f */ \ XXX( HRES_NS_E_INVALID_INPUT_STREAM , 3222084512U) /* 0xc00d1ba0 */ \ XXX( HRES_NS_E_EXPECT_MONO_WAV_INPUT , 3222084513U) /* 0xc00d1ba1 */ \ XXX( HRES_NS_E_INPUT_WAVFORMAT_MISMATCH , 3222084514U) /* 0xc00d1ba2 */ \ XXX( HRES_NS_E_RECORDQ_DISK_FULL , 3222084515U) /* 0xc00d1ba3 */ \ XXX( HRES_NS_E_NO_PAL_INVERSE_TELECINE , 3222084516U) /* 0xc00d1ba4 */ \ XXX( HRES_NS_E_ACTIVE_SG_DEVICE_DISCONNECTED , 3222084517U) /* 0xc00d1ba5 */ \ XXX( HRES_NS_E_ACTIVE_SG_DEVICE_CONTROL_DISCONNECTED, 3222084518U) /* 0xc00d1ba6 */ \ XXX( HRES_NS_E_NO_FRAMES_SUBMITTED_TO_ANALYZER , 3222084519U) /* 0xc00d1ba7 */ \ XXX( HRES_NS_E_INPUT_DOESNOT_SUPPORT_SMPTE , 3222084520U) /* 0xc00d1ba8 */ \ XXX( HRES_NS_E_NO_SMPTE_WITH_MULTIPLE_SOURCEGROUPS , 3222084521U) /* 0xc00d1ba9 */ \ XXX( HRES_NS_E_BAD_CONTENTEDL , 3222084522U) /* 0xc00d1baa */ \ XXX( HRES_NS_E_INTERLACEMODE_MISMATCH , 3222084523U) /* 0xc00d1bab */ \ XXX( HRES_NS_E_NONSQUAREPIXELMODE_MISMATCH , 3222084524U) /* 0xc00d1bac */ \ XXX( HRES_NS_E_SMPTEMODE_MISMATCH , 3222084525U) /* 0xc00d1bad */ \ XXX( HRES_NS_E_END_OF_TAPE , 3222084526U) /* 0xc00d1bae */ \ XXX( HRES_NS_E_NO_MEDIA_IN_AUDIENCE , 3222084527U) /* 0xc00d1baf */ \ XXX( HRES_NS_E_NO_AUDIENCES , 3222084528U) /* 0xc00d1bb0 */ \ XXX( HRES_NS_E_NO_AUDIO_COMPAT , 3222084529U) /* 0xc00d1bb1 */ \ XXX( HRES_NS_E_INVALID_VBR_COMPAT , 3222084530U) /* 0xc00d1bb2 */ \ XXX( HRES_NS_E_NO_PROFILE_NAME , 3222084531U) /* 0xc00d1bb3 */ \ XXX( HRES_NS_E_INVALID_VBR_WITH_UNCOMP , 3222084532U) /* 0xc00d1bb4 */ \ XXX( HRES_NS_E_MULTIPLE_VBR_AUDIENCES , 3222084533U) /* 0xc00d1bb5 */ \ XXX( HRES_NS_E_UNCOMP_COMP_COMBINATION , 3222084534U) /* 0xc00d1bb6 */ \ XXX( HRES_NS_E_MULTIPLE_AUDIO_CODECS , 3222084535U) /* 0xc00d1bb7 */ \ XXX( HRES_NS_E_MULTIPLE_AUDIO_FORMATS , 3222084536U) /* 0xc00d1bb8 */ \ XXX( HRES_NS_E_AUDIO_BITRATE_STEPDOWN , 3222084537U) /* 0xc00d1bb9 */ \ XXX( HRES_NS_E_INVALID_AUDIO_PEAKRATE , 3222084538U) /* 0xc00d1bba */ \ XXX( HRES_NS_E_INVALID_AUDIO_PEAKRATE_2 , 3222084539U) /* 0xc00d1bbb */ \ XXX( HRES_NS_E_INVALID_AUDIO_BUFFERMAX , 3222084540U) /* 0xc00d1bbc */ \ XXX( HRES_NS_E_MULTIPLE_VIDEO_CODECS , 3222084541U) /* 0xc00d1bbd */ \ XXX( HRES_NS_E_MULTIPLE_VIDEO_SIZES , 3222084542U) /* 0xc00d1bbe */ \ XXX( HRES_NS_E_INVALID_VIDEO_BITRATE , 3222084543U) /* 0xc00d1bbf */ \ XXX( HRES_NS_E_VIDEO_BITRATE_STEPDOWN , 3222084544U) /* 0xc00d1bc0 */ \ XXX( HRES_NS_E_INVALID_VIDEO_PEAKRATE , 3222084545U) /* 0xc00d1bc1 */ \ XXX( HRES_NS_E_INVALID_VIDEO_PEAKRATE_2 , 3222084546U) /* 0xc00d1bc2 */ \ XXX( HRES_NS_E_INVALID_VIDEO_WIDTH , 3222084547U) /* 0xc00d1bc3 */ \ XXX( HRES_NS_E_INVALID_VIDEO_HEIGHT , 3222084548U) /* 0xc00d1bc4 */ \ XXX( HRES_NS_E_INVALID_VIDEO_FPS , 3222084549U) /* 0xc00d1bc5 */ \ XXX( HRES_NS_E_INVALID_VIDEO_KEYFRAME , 3222084550U) /* 0xc00d1bc6 */ \ XXX( HRES_NS_E_INVALID_VIDEO_IQUALITY , 3222084551U) /* 0xc00d1bc7 */ \ XXX( HRES_NS_E_INVALID_VIDEO_CQUALITY , 3222084552U) /* 0xc00d1bc8 */ \ XXX( HRES_NS_E_INVALID_VIDEO_BUFFER , 3222084553U) /* 0xc00d1bc9 */ \ XXX( HRES_NS_E_INVALID_VIDEO_BUFFERMAX , 3222084554U) /* 0xc00d1bca */ \ XXX( HRES_NS_E_INVALID_VIDEO_BUFFERMAX_2 , 3222084555U) /* 0xc00d1bcb */ \ XXX( HRES_NS_E_INVALID_VIDEO_WIDTH_ALIGN , 3222084556U) /* 0xc00d1bcc */ \ XXX( HRES_NS_E_INVALID_VIDEO_HEIGHT_ALIGN , 3222084557U) /* 0xc00d1bcd */ \ XXX( HRES_NS_E_MULTIPLE_SCRIPT_BITRATES , 3222084558U) /* 0xc00d1bce */ \ XXX( HRES_NS_E_INVALID_SCRIPT_BITRATE , 3222084559U) /* 0xc00d1bcf */ \ XXX( HRES_NS_E_MULTIPLE_FILE_BITRATES , 3222084560U) /* 0xc00d1bd0 */ \ XXX( HRES_NS_E_INVALID_FILE_BITRATE , 3222084561U) /* 0xc00d1bd1 */ \ XXX( HRES_NS_E_SAME_AS_INPUT_COMBINATION , 3222084562U) /* 0xc00d1bd2 */ \ XXX( HRES_NS_E_SOURCE_CANNOT_LOOP , 3222084563U) /* 0xc00d1bd3 */ \ XXX( HRES_NS_E_INVALID_FOLDDOWN_COEFFICIENTS , 3222084564U) /* 0xc00d1bd4 */ \ XXX( HRES_NS_E_DRMPROFILE_NOTFOUND , 3222084565U) /* 0xc00d1bd5 */ \ XXX( HRES_NS_E_INVALID_TIMECODE , 3222084566U) /* 0xc00d1bd6 */ \ XXX( HRES_NS_E_NO_AUDIO_TIMECOMPRESSION , 3222084567U) /* 0xc00d1bd7 */ \ XXX( HRES_NS_E_NO_TWOPASS_TIMECOMPRESSION , 3222084568U) /* 0xc00d1bd8 */ \ XXX( HRES_NS_E_TIMECODE_REQUIRES_VIDEOSTREAM , 3222084569U) /* 0xc00d1bd9 */ \ XXX( HRES_NS_E_NO_MBR_WITH_TIMECODE , 3222084570U) /* 0xc00d1bda */ \ XXX( HRES_NS_E_INVALID_INTERLACEMODE , 3222084571U) /* 0xc00d1bdb */ \ XXX( HRES_NS_E_INVALID_INTERLACE_COMPAT , 3222084572U) /* 0xc00d1bdc */ \ XXX( HRES_NS_E_INVALID_NONSQUAREPIXEL_COMPAT , 3222084573U) /* 0xc00d1bdd */ \ XXX( HRES_NS_E_INVALID_SOURCE_WITH_DEVICE_CONTROL , 3222084574U) /* 0xc00d1bde */ \ XXX( HRES_NS_E_CANNOT_GENERATE_BROADCAST_INFO_FOR_QUALITYVBR, 3222084575U) /* 0xc00d1bdf */ \ XXX( HRES_NS_E_EXCEED_MAX_DRM_PROFILE_LIMIT , 3222084576U) /* 0xc00d1be0 */ \ XXX( HRES_NS_E_DEVICECONTROL_UNSTABLE , 3222084577U) /* 0xc00d1be1 */ \ XXX( HRES_NS_E_INVALID_PIXEL_ASPECT_RATIO , 3222084578U) /* 0xc00d1be2 */ \ XXX( HRES_NS_E_AUDIENCE__LANGUAGE_CONTENTTYPE_MISMATCH, 3222084579U) /* 0xc00d1be3 */ \ XXX( HRES_NS_E_INVALID_PROFILE_CONTENTTYPE , 3222084580U) /* 0xc00d1be4 */ \ XXX( HRES_NS_E_TRANSFORM_PLUGIN_NOT_FOUND , 3222084581U) /* 0xc00d1be5 */ \ XXX( HRES_NS_E_TRANSFORM_PLUGIN_INVALID , 3222084582U) /* 0xc00d1be6 */ \ XXX( HRES_NS_E_EDL_REQUIRED_FOR_DEVICE_MULTIPASS , 3222084583U) /* 0xc00d1be7 */ \ XXX( HRES_NS_E_INVALID_VIDEO_WIDTH_FOR_INTERLACED_ENCODING, 3222084584U) /* 0xc00d1be8 */ \ XXX( HRES_NS_E_MARKIN_UNSUPPORTED , 3222084585U) /* 0xc00d1be9 */ \ XXX( HRES_NS_E_DRM_INVALID_APPLICATION , 3222087441U) /* 0xc00d2711 */ \ XXX( HRES_NS_E_DRM_LICENSE_STORE_ERROR , 3222087442U) /* 0xc00d2712 */ \ XXX( HRES_NS_E_DRM_SECURE_STORE_ERROR , 3222087443U) /* 0xc00d2713 */ \ XXX( HRES_NS_E_DRM_LICENSE_STORE_SAVE_ERROR , 3222087444U) /* 0xc00d2714 */ \ XXX( HRES_NS_E_DRM_SECURE_STORE_UNLOCK_ERROR , 3222087445U) /* 0xc00d2715 */ \ XXX( HRES_NS_E_DRM_INVALID_CONTENT , 3222087446U) /* 0xc00d2716 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_OPEN_LICENSE , 3222087447U) /* 0xc00d2717 */ \ XXX( HRES_NS_E_DRM_INVALID_LICENSE , 3222087448U) /* 0xc00d2718 */ \ XXX( HRES_NS_E_DRM_INVALID_MACHINE , 3222087449U) /* 0xc00d2719 */ \ XXX( HRES_NS_E_DRM_ENUM_LICENSE_FAILED , 3222087451U) /* 0xc00d271b */ \ XXX( HRES_NS_E_DRM_INVALID_LICENSE_REQUEST , 3222087452U) /* 0xc00d271c */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_INITIALIZE , 3222087453U) /* 0xc00d271d */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_ACQUIRE_LICENSE , 3222087454U) /* 0xc00d271e */ \ XXX( HRES_NS_E_DRM_INVALID_LICENSE_ACQUIRED , 3222087455U) /* 0xc00d271f */ \ XXX( HRES_NS_E_DRM_NO_RIGHTS , 3222087456U) /* 0xc00d2720 */ \ XXX( HRES_NS_E_DRM_KEY_ERROR , 3222087457U) /* 0xc00d2721 */ \ XXX( HRES_NS_E_DRM_ENCRYPT_ERROR , 3222087458U) /* 0xc00d2722 */ \ XXX( HRES_NS_E_DRM_DECRYPT_ERROR , 3222087459U) /* 0xc00d2723 */ \ XXX( HRES_NS_E_DRM_LICENSE_INVALID_XML , 3222087461U) /* 0xc00d2725 */ \ XXX( HRES_NS_E_DRM_NEEDS_INDIVIDUALIZATION , 3222087464U) /* 0xc00d2728 */ \ XXX( HRES_NS_E_DRM_ALREADY_INDIVIDUALIZED , 3222087465U) /* 0xc00d2729 */ \ XXX( HRES_NS_E_DRM_ACTION_NOT_QUERIED , 3222087466U) /* 0xc00d272a */ \ XXX( HRES_NS_E_DRM_ACQUIRING_LICENSE , 3222087467U) /* 0xc00d272b */ \ XXX( HRES_NS_E_DRM_INDIVIDUALIZING , 3222087468U) /* 0xc00d272c */ \ XXX( HRES_NS_E_BACKUP_RESTORE_FAILURE , 3222087469U) /* 0xc00d272d */ \ XXX( HRES_NS_E_BACKUP_RESTORE_BAD_REQUEST_ID , 3222087470U) /* 0xc00d272e */ \ XXX( HRES_NS_E_DRM_PARAMETERS_MISMATCHED , 3222087471U) /* 0xc00d272f */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_LICENSE_OBJECT , 3222087472U) /* 0xc00d2730 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_INDI_OBJECT , 3222087473U) /* 0xc00d2731 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_ENCRYPT_OBJECT , 3222087474U) /* 0xc00d2732 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_DECRYPT_OBJECT , 3222087475U) /* 0xc00d2733 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_PROPERTIES_OBJECT, 3222087476U) /* 0xc00d2734 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_BACKUP_OBJECT , 3222087477U) /* 0xc00d2735 */ \ XXX( HRES_NS_E_DRM_INDIVIDUALIZE_ERROR , 3222087478U) /* 0xc00d2736 */ \ XXX( HRES_NS_E_DRM_LICENSE_OPEN_ERROR , 3222087479U) /* 0xc00d2737 */ \ XXX( HRES_NS_E_DRM_LICENSE_CLOSE_ERROR , 3222087480U) /* 0xc00d2738 */ \ XXX( HRES_NS_E_DRM_GET_LICENSE_ERROR , 3222087481U) /* 0xc00d2739 */ \ XXX( HRES_NS_E_DRM_QUERY_ERROR , 3222087482U) /* 0xc00d273a */ \ XXX( HRES_NS_E_DRM_REPORT_ERROR , 3222087483U) /* 0xc00d273b */ \ XXX( HRES_NS_E_DRM_GET_LICENSESTRING_ERROR , 3222087484U) /* 0xc00d273c */ \ XXX( HRES_NS_E_DRM_GET_CONTENTSTRING_ERROR , 3222087485U) /* 0xc00d273d */ \ XXX( HRES_NS_E_DRM_MONITOR_ERROR , 3222087486U) /* 0xc00d273e */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_SET_PARAMETER , 3222087487U) /* 0xc00d273f */ \ XXX( HRES_NS_E_DRM_INVALID_APPDATA , 3222087488U) /* 0xc00d2740 */ \ XXX( HRES_NS_E_DRM_INVALID_APPDATA_VERSION , 3222087489U) /* 0xc00d2741 */ \ XXX( HRES_NS_E_DRM_BACKUP_EXISTS , 3222087490U) /* 0xc00d2742 */ \ XXX( HRES_NS_E_DRM_BACKUP_CORRUPT , 3222087491U) /* 0xc00d2743 */ \ XXX( HRES_NS_E_DRM_BACKUPRESTORE_BUSY , 3222087492U) /* 0xc00d2744 */ \ XXX( HRES_NS_E_BACKUP_RESTORE_BAD_DATA , 3222087493U) /* 0xc00d2745 */ \ XXX( HRES_NS_E_DRM_LICENSE_UNUSABLE , 3222087496U) /* 0xc00d2748 */ \ XXX( HRES_NS_E_DRM_INVALID_PROPERTY , 3222087497U) /* 0xc00d2749 */ \ XXX( HRES_NS_E_DRM_SECURE_STORE_NOT_FOUND , 3222087498U) /* 0xc00d274a */ \ XXX( HRES_NS_E_DRM_CACHED_CONTENT_ERROR , 3222087499U) /* 0xc00d274b */ \ XXX( HRES_NS_E_DRM_INDIVIDUALIZATION_INCOMPLETE , 3222087500U) /* 0xc00d274c */ \ XXX( HRES_NS_E_DRM_DRIVER_AUTH_FAILURE , 3222087501U) /* 0xc00d274d */ \ XXX( HRES_NS_E_DRM_NEED_UPGRADE_MSSAP , 3222087502U) /* 0xc00d274e */ \ XXX( HRES_NS_E_DRM_REOPEN_CONTENT , 3222087503U) /* 0xc00d274f */ \ XXX( HRES_NS_E_DRM_DRIVER_DIGIOUT_FAILURE , 3222087504U) /* 0xc00d2750 */ \ XXX( HRES_NS_E_DRM_INVALID_SECURESTORE_PASSWORD , 3222087505U) /* 0xc00d2751 */ \ XXX( HRES_NS_E_DRM_APPCERT_REVOKED , 3222087506U) /* 0xc00d2752 */ \ XXX( HRES_NS_E_DRM_RESTORE_FRAUD , 3222087507U) /* 0xc00d2753 */ \ XXX( HRES_NS_E_DRM_HARDWARE_INCONSISTENT , 3222087508U) /* 0xc00d2754 */ \ XXX( HRES_NS_E_DRM_SDMI_TRIGGER , 3222087509U) /* 0xc00d2755 */ \ XXX( HRES_NS_E_DRM_SDMI_NOMORECOPIES , 3222087510U) /* 0xc00d2756 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_HEADER_OBJECT , 3222087511U) /* 0xc00d2757 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_KEYS_OBJECT , 3222087512U) /* 0xc00d2758 */ \ XXX( HRES_NS_E_DRM_LICENSE_NOTACQUIRED , 3222087513U) /* 0xc00d2759 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_CODING_OBJECT , 3222087514U) /* 0xc00d275a */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_STATE_DATA_OBJECT, 3222087515U) /* 0xc00d275b */ \ XXX( HRES_NS_E_DRM_BUFFER_TOO_SMALL , 3222087516U) /* 0xc00d275c */ \ XXX( HRES_NS_E_DRM_UNSUPPORTED_PROPERTY , 3222087517U) /* 0xc00d275d */ \ XXX( HRES_NS_E_DRM_ERROR_BAD_NET_RESP , 3222087518U) /* 0xc00d275e */ \ XXX( HRES_NS_E_DRM_STORE_NOTALLSTORED , 3222087519U) /* 0xc00d275f */ \ XXX( HRES_NS_E_DRM_SECURITY_COMPONENT_SIGNATURE_INVALID, 3222087520U) /* 0xc00d2760 */ \ XXX( HRES_NS_E_DRM_INVALID_DATA , 3222087521U) /* 0xc00d2761 */ \ XXX( HRES_NS_E_DRM_POLICY_DISABLE_ONLINE , 3222087522U) /* 0xc00d2762 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_AUTHENTICATION_OBJECT, 3222087523U) /* 0xc00d2763 */ \ XXX( HRES_NS_E_DRM_NOT_CONFIGURED , 3222087524U) /* 0xc00d2764 */ \ XXX( HRES_NS_E_DRM_DEVICE_ACTIVATION_CANCELED , 3222087525U) /* 0xc00d2765 */ \ XXX( HRES_NS_E_BACKUP_RESTORE_TOO_MANY_RESETS , 3222087526U) /* 0xc00d2766 */ \ XXX( HRES_NS_E_DRM_DEBUGGING_NOT_ALLOWED , 3222087527U) /* 0xc00d2767 */ \ XXX( HRES_NS_E_DRM_OPERATION_CANCELED , 3222087528U) /* 0xc00d2768 */ \ XXX( HRES_NS_E_DRM_RESTRICTIONS_NOT_RETRIEVED , 3222087529U) /* 0xc00d2769 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_PLAYLIST_OBJECT , 3222087530U) /* 0xc00d276a */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_PLAYLIST_BURN_OBJECT, 3222087531U) /* 0xc00d276b */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_DEVICE_REGISTRATION_OBJECT, 3222087532U) /* 0xc00d276c */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_METERING_OBJECT , 3222087533U) /* 0xc00d276d */ \ XXX( HRES_NS_E_DRM_TRACK_EXCEEDED_PLAYLIST_RESTICTION, 3222087536U) /* 0xc00d2770 */ \ XXX( HRES_NS_E_DRM_TRACK_EXCEEDED_TRACKBURN_RESTRICTION, 3222087537U) /* 0xc00d2771 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_GET_DEVICE_CERT , 3222087538U) /* 0xc00d2772 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_GET_SECURE_CLOCK , 3222087539U) /* 0xc00d2773 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_SET_SECURE_CLOCK , 3222087540U) /* 0xc00d2774 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_GET_SECURE_CLOCK_FROM_SERVER, 3222087541U) /* 0xc00d2775 */ \ XXX( HRES_NS_E_DRM_POLICY_METERING_DISABLED , 3222087542U) /* 0xc00d2776 */ \ XXX( HRES_NS_E_DRM_TRANSFER_CHAINED_LICENSES_UNSUPPORTED, 3222087543U) /* 0xc00d2777 */ \ XXX( HRES_NS_E_DRM_SDK_VERSIONMISMATCH , 3222087544U) /* 0xc00d2778 */ \ XXX( HRES_NS_E_DRM_LIC_NEEDS_DEVICE_CLOCK_SET , 3222087545U) /* 0xc00d2779 */ \ XXX( HRES_NS_E_LICENSE_HEADER_MISSING_URL , 3222087546U) /* 0xc00d277a */ \ XXX( HRES_NS_E_DEVICE_NOT_WMDRM_DEVICE , 3222087547U) /* 0xc00d277b */ \ XXX( HRES_NS_E_DRM_INVALID_APPCERT , 3222087548U) /* 0xc00d277c */ \ XXX( HRES_NS_E_DRM_PROTOCOL_FORCEFUL_TERMINATION_ON_PETITION, 3222087549U) /* 0xc00d277d */ \ XXX( HRES_NS_E_DRM_PROTOCOL_FORCEFUL_TERMINATION_ON_CHALLENGE, 3222087550U) /* 0xc00d277e */ \ XXX( HRES_NS_E_DRM_CHECKPOINT_FAILED , 3222087551U) /* 0xc00d277f */ \ XXX( HRES_NS_E_DRM_BB_UNABLE_TO_INITIALIZE , 3222087552U) /* 0xc00d2780 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_LOAD_HARDWARE_ID , 3222087553U) /* 0xc00d2781 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_OPEN_DATA_STORE , 3222087554U) /* 0xc00d2782 */ \ XXX( HRES_NS_E_DRM_DATASTORE_CORRUPT , 3222087555U) /* 0xc00d2783 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_INMEMORYSTORE_OBJECT, 3222087556U) /* 0xc00d2784 */ \ XXX( HRES_NS_E_DRM_STUBLIB_REQUIRED , 3222087557U) /* 0xc00d2785 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_CERTIFICATE_OBJECT, 3222087558U) /* 0xc00d2786 */ \ XXX( HRES_NS_E_DRM_MIGRATION_TARGET_NOT_ONLINE , 3222087559U) /* 0xc00d2787 */ \ XXX( HRES_NS_E_DRM_INVALID_MIGRATION_IMAGE , 3222087560U) /* 0xc00d2788 */ \ XXX( HRES_NS_E_DRM_MIGRATION_TARGET_STATES_CORRUPTED, 3222087561U) /* 0xc00d2789 */ \ XXX( HRES_NS_E_DRM_MIGRATION_IMPORTER_NOT_AVAILABLE , 3222087562U) /* 0xc00d278a */ \ XXX( HRES_NS_DRM_E_MIGRATION_UPGRADE_WITH_DIFF_SID , 3222087563U) /* 0xc00d278b */ \ XXX( HRES_NS_DRM_E_MIGRATION_SOURCE_MACHINE_IN_USE , 3222087564U) /* 0xc00d278c */ \ XXX( HRES_NS_DRM_E_MIGRATION_TARGET_MACHINE_LESS_THAN_LH, 3222087565U) /* 0xc00d278d */ \ XXX( HRES_NS_DRM_E_MIGRATION_IMAGE_ALREADY_EXISTS , 3222087566U) /* 0xc00d278e */ \ XXX( HRES_NS_E_DRM_HARDWAREID_MISMATCH , 3222087567U) /* 0xc00d278f */ \ XXX( HRES_NS_E_INVALID_DRMV2CLT_STUBLIB , 3222087568U) /* 0xc00d2790 */ \ XXX( HRES_NS_E_DRM_MIGRATION_INVALID_LEGACYV2_DATA , 3222087569U) /* 0xc00d2791 */ \ XXX( HRES_NS_E_DRM_MIGRATION_LICENSE_ALREADY_EXISTS , 3222087570U) /* 0xc00d2792 */ \ XXX( HRES_NS_E_DRM_MIGRATION_INVALID_LEGACYV2_SST_PASSWORD, 3222087571U) /* 0xc00d2793 */ \ XXX( HRES_NS_E_DRM_MIGRATION_NOT_SUPPORTED , 3222087572U) /* 0xc00d2794 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_CREATE_MIGRATION_IMPORTER_OBJECT, 3222087573U) /* 0xc00d2795 */ \ XXX( HRES_NS_E_DRM_CHECKPOINT_MISMATCH , 3222087574U) /* 0xc00d2796 */ \ XXX( HRES_NS_E_DRM_CHECKPOINT_CORRUPT , 3222087575U) /* 0xc00d2797 */ \ XXX( HRES_NS_E_REG_FLUSH_FAILURE , 3222087576U) /* 0xc00d2798 */ \ XXX( HRES_NS_E_HDS_KEY_MISMATCH , 3222087577U) /* 0xc00d2799 */ \ XXX( HRES_NS_E_DRM_MIGRATION_OPERATION_CANCELLED , 3222087578U) /* 0xc00d279a */ \ XXX( HRES_NS_E_DRM_MIGRATION_OBJECT_IN_USE , 3222087579U) /* 0xc00d279b */ \ XXX( HRES_NS_E_DRM_MALFORMED_CONTENT_HEADER , 3222087580U) /* 0xc00d279c */ \ XXX( HRES_NS_E_DRM_LICENSE_EXPIRED , 3222087640U) /* 0xc00d27d8 */ \ XXX( HRES_NS_E_DRM_LICENSE_NOTENABLED , 3222087641U) /* 0xc00d27d9 */ \ XXX( HRES_NS_E_DRM_LICENSE_APPSECLOW , 3222087642U) /* 0xc00d27da */ \ XXX( HRES_NS_E_DRM_STORE_NEEDINDI , 3222087643U) /* 0xc00d27db */ \ XXX( HRES_NS_E_DRM_STORE_NOTALLOWED , 3222087644U) /* 0xc00d27dc */ \ XXX( HRES_NS_E_DRM_LICENSE_APP_NOTALLOWED , 3222087645U) /* 0xc00d27dd */ \ XXX( HRES_NS_E_DRM_LICENSE_CERT_EXPIRED , 3222087647U) /* 0xc00d27df */ \ XXX( HRES_NS_E_DRM_LICENSE_SECLOW , 3222087648U) /* 0xc00d27e0 */ \ XXX( HRES_NS_E_DRM_LICENSE_CONTENT_REVOKED , 3222087649U) /* 0xc00d27e1 */ \ XXX( HRES_NS_E_DRM_DEVICE_NOT_REGISTERED , 3222087650U) /* 0xc00d27e2 */ \ XXX( HRES_NS_E_DRM_LICENSE_NOSAP , 3222087690U) /* 0xc00d280a */ \ XXX( HRES_NS_E_DRM_LICENSE_NOSVP , 3222087691U) /* 0xc00d280b */ \ XXX( HRES_NS_E_DRM_LICENSE_NOWDM , 3222087692U) /* 0xc00d280c */ \ XXX( HRES_NS_E_DRM_LICENSE_NOTRUSTEDCODEC , 3222087693U) /* 0xc00d280d */ \ XXX( HRES_NS_E_DRM_SOURCEID_NOT_SUPPORTED , 3222087694U) /* 0xc00d280e */ \ XXX( HRES_NS_E_DRM_NEEDS_UPGRADE_TEMPFILE , 3222087741U) /* 0xc00d283d */ \ XXX( HRES_NS_E_DRM_NEED_UPGRADE_PD , 3222087742U) /* 0xc00d283e */ \ XXX( HRES_NS_E_DRM_SIGNATURE_FAILURE , 3222087743U) /* 0xc00d283f */ \ XXX( HRES_NS_E_DRM_LICENSE_SERVER_INFO_MISSING , 3222087744U) /* 0xc00d2840 */ \ XXX( HRES_NS_E_DRM_BUSY , 3222087745U) /* 0xc00d2841 */ \ XXX( HRES_NS_E_DRM_PD_TOO_MANY_DEVICES , 3222087746U) /* 0xc00d2842 */ \ XXX( HRES_NS_E_DRM_INDIV_FRAUD , 3222087747U) /* 0xc00d2843 */ \ XXX( HRES_NS_E_DRM_INDIV_NO_CABS , 3222087748U) /* 0xc00d2844 */ \ XXX( HRES_NS_E_DRM_INDIV_SERVICE_UNAVAILABLE , 3222087749U) /* 0xc00d2845 */ \ XXX( HRES_NS_E_DRM_RESTORE_SERVICE_UNAVAILABLE , 3222087750U) /* 0xc00d2846 */ \ XXX( HRES_NS_E_DRM_CLIENT_CODE_EXPIRED , 3222087751U) /* 0xc00d2847 */ \ XXX( HRES_NS_E_DRM_NO_UPLINK_LICENSE , 3222087752U) /* 0xc00d2848 */ \ XXX( HRES_NS_E_DRM_INVALID_KID , 3222087753U) /* 0xc00d2849 */ \ XXX( HRES_NS_E_DRM_LICENSE_INITIALIZATION_ERROR , 3222087754U) /* 0xc00d284a */ \ XXX( HRES_NS_E_DRM_CHAIN_TOO_LONG , 3222087756U) /* 0xc00d284c */ \ XXX( HRES_NS_E_DRM_UNSUPPORTED_ALGORITHM , 3222087757U) /* 0xc00d284d */ \ XXX( HRES_NS_E_DRM_LICENSE_DELETION_ERROR , 3222087758U) /* 0xc00d284e */ \ XXX( HRES_NS_E_DRM_INVALID_CERTIFICATE , 3222087840U) /* 0xc00d28a0 */ \ XXX( HRES_NS_E_DRM_CERTIFICATE_REVOKED , 3222087841U) /* 0xc00d28a1 */ \ XXX( HRES_NS_E_DRM_LICENSE_UNAVAILABLE , 3222087842U) /* 0xc00d28a2 */ \ XXX( HRES_NS_E_DRM_DEVICE_LIMIT_REACHED , 3222087843U) /* 0xc00d28a3 */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_VERIFY_PROXIMITY , 3222087844U) /* 0xc00d28a4 */ \ XXX( HRES_NS_E_DRM_MUST_REGISTER , 3222087845U) /* 0xc00d28a5 */ \ XXX( HRES_NS_E_DRM_MUST_APPROVE , 3222087846U) /* 0xc00d28a6 */ \ XXX( HRES_NS_E_DRM_MUST_REVALIDATE , 3222087847U) /* 0xc00d28a7 */ \ XXX( HRES_NS_E_DRM_INVALID_PROXIMITY_RESPONSE , 3222087848U) /* 0xc00d28a8 */ \ XXX( HRES_NS_E_DRM_INVALID_SESSION , 3222087849U) /* 0xc00d28a9 */ \ XXX( HRES_NS_E_DRM_DEVICE_NOT_OPEN , 3222087850U) /* 0xc00d28aa */ \ XXX( HRES_NS_E_DRM_DEVICE_ALREADY_REGISTERED , 3222087851U) /* 0xc00d28ab */ \ XXX( HRES_NS_E_DRM_UNSUPPORTED_PROTOCOL_VERSION , 3222087852U) /* 0xc00d28ac */ \ XXX( HRES_NS_E_DRM_UNSUPPORTED_ACTION , 3222087853U) /* 0xc00d28ad */ \ XXX( HRES_NS_E_DRM_CERTIFICATE_SECURITY_LEVEL_INADEQUATE, 3222087854U) /* 0xc00d28ae */ \ XXX( HRES_NS_E_DRM_UNABLE_TO_OPEN_PORT , 3222087855U) /* 0xc00d28af */ \ XXX( HRES_NS_E_DRM_BAD_REQUEST , 3222087856U) /* 0xc00d28b0 */ \ XXX( HRES_NS_E_DRM_INVALID_CRL , 3222087857U) /* 0xc00d28b1 */ \ XXX( HRES_NS_E_DRM_ATTRIBUTE_TOO_LONG , 3222087858U) /* 0xc00d28b2 */ \ XXX( HRES_NS_E_DRM_EXPIRED_LICENSEBLOB , 3222087859U) /* 0xc00d28b3 */ \ XXX( HRES_NS_E_DRM_INVALID_LICENSEBLOB , 3222087860U) /* 0xc00d28b4 */ \ XXX( HRES_NS_E_DRM_INCLUSION_LIST_REQUIRED , 3222087861U) /* 0xc00d28b5 */ \ XXX( HRES_NS_E_DRM_DRMV2CLT_REVOKED , 3222087862U) /* 0xc00d28b6 */ \ XXX( HRES_NS_E_DRM_RIV_TOO_SMALL , 3222087863U) /* 0xc00d28b7 */ \ XXX( HRES_NS_E_OUTPUT_PROTECTION_LEVEL_UNSUPPORTED , 3222087940U) /* 0xc00d2904 */ \ XXX( HRES_NS_E_COMPRESSED_DIGITAL_VIDEO_PROTECTION_LEVEL_UNSUPPORTED, 3222087941U) /* 0xc00d2905 */ \ XXX( HRES_NS_E_UNCOMPRESSED_DIGITAL_VIDEO_PROTECTION_LEVEL_UNSUPPORTED, 3222087942U) /* 0xc00d2906 */ \ XXX( HRES_NS_E_ANALOG_VIDEO_PROTECTION_LEVEL_UNSUPPORTED, 3222087943U) /* 0xc00d2907 */ \ XXX( HRES_NS_E_COMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED, 3222087944U) /* 0xc00d2908 */ \ XXX( HRES_NS_E_UNCOMPRESSED_DIGITAL_AUDIO_PROTECTION_LEVEL_UNSUPPORTED, 3222087945U) /* 0xc00d2909 */ \ XXX( HRES_NS_E_OUTPUT_PROTECTION_SCHEME_UNSUPPORTED , 3222087946U) /* 0xc00d290a */ \ XXX( HRES_NS_E_REBOOT_RECOMMENDED , 3222088442U) /* 0xc00d2afa */ \ XXX( HRES_NS_E_REBOOT_REQUIRED , 3222088443U) /* 0xc00d2afb */ \ XXX( HRES_NS_E_SETUP_INCOMPLETE , 3222088444U) /* 0xc00d2afc */ \ XXX( HRES_NS_E_SETUP_DRM_MIGRATION_FAILED , 3222088445U) /* 0xc00d2afd */ \ XXX( HRES_NS_E_SETUP_IGNORABLE_FAILURE , 3222088446U) /* 0xc00d2afe */ \ XXX( HRES_NS_E_SETUP_DRM_MIGRATION_FAILED_AND_IGNORABLE_FAILURE, 3222088447U) /* 0xc00d2aff */ \ XXX( HRES_NS_E_SETUP_BLOCKED , 3222088448U) /* 0xc00d2b00 */ \ XXX( HRES_NS_E_UNKNOWN_PROTOCOL , 3222089440U) /* 0xc00d2ee0 */ \ XXX( HRES_NS_E_REDIRECT_TO_PROXY , 3222089441U) /* 0xc00d2ee1 */ \ XXX( HRES_NS_E_INTERNAL_SERVER_ERROR , 3222089442U) /* 0xc00d2ee2 */ \ XXX( HRES_NS_E_BAD_REQUEST , 3222089443U) /* 0xc00d2ee3 */ \ XXX( HRES_NS_E_ERROR_FROM_PROXY , 3222089444U) /* 0xc00d2ee4 */ \ XXX( HRES_NS_E_PROXY_TIMEOUT , 3222089445U) /* 0xc00d2ee5 */ \ XXX( HRES_NS_E_SERVER_UNAVAILABLE , 3222089446U) /* 0xc00d2ee6 */ \ XXX( HRES_NS_E_REFUSED_BY_SERVER , 3222089447U) /* 0xc00d2ee7 */ \ XXX( HRES_NS_E_INCOMPATIBLE_SERVER , 3222089448U) /* 0xc00d2ee8 */ \ XXX( HRES_NS_E_MULTICAST_DISABLED , 3222089449U) /* 0xc00d2ee9 */ \ XXX( HRES_NS_E_INVALID_REDIRECT , 3222089450U) /* 0xc00d2eea */ \ XXX( HRES_NS_E_ALL_PROTOCOLS_DISABLED , 3222089451U) /* 0xc00d2eeb */ \ XXX( HRES_NS_E_MSBD_NO_LONGER_SUPPORTED , 3222089452U) /* 0xc00d2eec */ \ XXX( HRES_NS_E_PROXY_NOT_FOUND , 3222089453U) /* 0xc00d2eed */ \ XXX( HRES_NS_E_CANNOT_CONNECT_TO_PROXY , 3222089454U) /* 0xc00d2eee */ \ XXX( HRES_NS_E_SERVER_DNS_TIMEOUT , 3222089455U) /* 0xc00d2eef */ \ XXX( HRES_NS_E_PROXY_DNS_TIMEOUT , 3222089456U) /* 0xc00d2ef0 */ \ XXX( HRES_NS_E_CLOSED_ON_SUSPEND , 3222089457U) /* 0xc00d2ef1 */ \ XXX( HRES_NS_E_CANNOT_READ_PLAYLIST_FROM_MEDIASERVER, 3222089458U) /* 0xc00d2ef2 */ \ XXX( HRES_NS_E_SESSION_NOT_FOUND , 3222089459U) /* 0xc00d2ef3 */ \ XXX( HRES_NS_E_REQUIRE_STREAMING_CLIENT , 3222089460U) /* 0xc00d2ef4 */ \ XXX( HRES_NS_E_PLAYLIST_ENTRY_HAS_CHANGED , 3222089461U) /* 0xc00d2ef5 */ \ XXX( HRES_NS_E_PROXY_ACCESSDENIED , 3222089462U) /* 0xc00d2ef6 */ \ XXX( HRES_NS_E_PROXY_SOURCE_ACCESSDENIED , 3222089463U) /* 0xc00d2ef7 */ \ XXX( HRES_NS_E_NETWORK_SINK_WRITE , 3222089464U) /* 0xc00d2ef8 */ \ XXX( HRES_NS_E_FIREWALL , 3222089465U) /* 0xc00d2ef9 */ \ XXX( HRES_NS_E_MMS_NOT_SUPPORTED , 3222089466U) /* 0xc00d2efa */ \ XXX( HRES_NS_E_SERVER_ACCESSDENIED , 3222089467U) /* 0xc00d2efb */ \ XXX( HRES_NS_E_RESOURCE_GONE , 3222089468U) /* 0xc00d2efc */ \ XXX( HRES_NS_E_NO_EXISTING_PACKETIZER , 3222089469U) /* 0xc00d2efd */ \ XXX( HRES_NS_E_BAD_SYNTAX_IN_SERVER_RESPONSE , 3222089470U) /* 0xc00d2efe */ \ XXX( HRES_NS_E_RESET_SOCKET_CONNECTION , 3222089472U) /* 0xc00d2f00 */ \ XXX( HRES_NS_E_TOO_MANY_HOPS , 3222089474U) /* 0xc00d2f02 */ \ XXX( HRES_NS_E_TOO_MUCH_DATA_FROM_SERVER , 3222089477U) /* 0xc00d2f05 */ \ XXX( HRES_NS_E_CONNECT_TIMEOUT , 3222089478U) /* 0xc00d2f06 */ \ XXX( HRES_NS_E_PROXY_CONNECT_TIMEOUT , 3222089479U) /* 0xc00d2f07 */ \ XXX( HRES_NS_E_SESSION_INVALID , 3222089480U) /* 0xc00d2f08 */ \ XXX( HRES_NS_E_PACKETSINK_UNKNOWN_FEC_STREAM , 3222089482U) /* 0xc00d2f0a */ \ XXX( HRES_NS_E_PUSH_CANNOTCONNECT , 3222089483U) /* 0xc00d2f0b */ \ XXX( HRES_NS_E_INCOMPATIBLE_PUSH_SERVER , 3222089484U) /* 0xc00d2f0c */ \ XXX( HRES_NS_E_END_OF_PLAYLIST , 3222090440U) /* 0xc00d32c8 */ \ XXX( HRES_NS_E_USE_FILE_SOURCE , 3222090441U) /* 0xc00d32c9 */ \ XXX( HRES_NS_E_PROPERTY_NOT_FOUND , 3222090442U) /* 0xc00d32ca */ \ XXX( HRES_NS_E_PROPERTY_READ_ONLY , 3222090444U) /* 0xc00d32cc */ \ XXX( HRES_NS_E_TABLE_KEY_NOT_FOUND , 3222090445U) /* 0xc00d32cd */ \ XXX( HRES_NS_E_INVALID_QUERY_OPERATOR , 3222090447U) /* 0xc00d32cf */ \ XXX( HRES_NS_E_INVALID_QUERY_PROPERTY , 3222090448U) /* 0xc00d32d0 */ \ XXX( HRES_NS_E_PROPERTY_NOT_SUPPORTED , 3222090450U) /* 0xc00d32d2 */ \ XXX( HRES_NS_E_SCHEMA_CLASSIFY_FAILURE , 3222090452U) /* 0xc00d32d4 */ \ XXX( HRES_NS_E_METADATA_FORMAT_NOT_SUPPORTED , 3222090453U) /* 0xc00d32d5 */ \ XXX( HRES_NS_E_METADATA_NO_EDITING_CAPABILITY , 3222090454U) /* 0xc00d32d6 */ \ XXX( HRES_NS_E_METADATA_CANNOT_SET_LOCALE , 3222090455U) /* 0xc00d32d7 */ \ XXX( HRES_NS_E_METADATA_LANGUAGE_NOT_SUPORTED , 3222090456U) /* 0xc00d32d8 */ \ XXX( HRES_NS_E_METADATA_NO_RFC1766_NAME_FOR_LOCALE , 3222090457U) /* 0xc00d32d9 */ \ XXX( HRES_NS_E_METADATA_NOT_AVAILABLE , 3222090458U) /* 0xc00d32da */ \ XXX( HRES_NS_E_METADATA_CACHE_DATA_NOT_AVAILABLE , 3222090459U) /* 0xc00d32db */ \ XXX( HRES_NS_E_METADATA_INVALID_DOCUMENT_TYPE , 3222090460U) /* 0xc00d32dc */ \ XXX( HRES_NS_E_METADATA_IDENTIFIER_NOT_AVAILABLE , 3222090461U) /* 0xc00d32dd */ \ XXX( HRES_NS_E_METADATA_CANNOT_RETRIEVE_FROM_OFFLINE_CACHE, 3222090462U) /* 0xc00d32de */ \ XXX( HRES_ERROR_MONITOR_INVALID_DESCRIPTOR_CHECKSUM , 3223719939U) /* 0xc0261003 */ \ XXX( HRES_ERROR_MONITOR_INVALID_STANDARD_TIMING_BLOCK, 3223719940U) /* 0xc0261004 */ \ XXX( HRES_ERROR_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED, 3223719941U) /* 0xc0261005 */ \ XXX( HRES_ERROR_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK, 3223719942U) /* 0xc0261006 */ \ XXX( HRES_ERROR_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK, 3223719943U) /* 0xc0261007 */ \ XXX( HRES_ERROR_MONITOR_NO_MORE_DESCRIPTOR_DATA , 3223719944U) /* 0xc0261008 */ \ XXX( HRES_ERROR_MONITOR_INVALID_DETAILED_TIMING_BLOCK, 3223719945U) /* 0xc0261009 */ \ XXX( HRES_ERROR_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER , 3223724032U) /* 0xc0262000 */ \ XXX( HRES_ERROR_GRAPHICS_INSUFFICIENT_DMA_BUFFER , 3223724033U) /* 0xc0262001 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_DISPLAY_ADAPTER , 3223724034U) /* 0xc0262002 */ \ XXX( HRES_ERROR_GRAPHICS_ADAPTER_WAS_RESET , 3223724035U) /* 0xc0262003 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_DRIVER_MODEL , 3223724036U) /* 0xc0262004 */ \ XXX( HRES_ERROR_GRAPHICS_PRESENT_MODE_CHANGED , 3223724037U) /* 0xc0262005 */ \ XXX( HRES_ERROR_GRAPHICS_PRESENT_OCCLUDED , 3223724038U) /* 0xc0262006 */ \ XXX( HRES_ERROR_GRAPHICS_PRESENT_DENIED , 3223724039U) /* 0xc0262007 */ \ XXX( HRES_ERROR_GRAPHICS_CANNOTCOLORCONVERT , 3223724040U) /* 0xc0262008 */ \ XXX( HRES_ERROR_GRAPHICS_NO_VIDEO_MEMORY , 3223724288U) /* 0xc0262100 */ \ XXX( HRES_ERROR_GRAPHICS_CANT_LOCK_MEMORY , 3223724289U) /* 0xc0262101 */ \ XXX( HRES_ERROR_GRAPHICS_ALLOCATION_BUSY , 3223724290U) /* 0xc0262102 */ \ XXX( HRES_ERROR_GRAPHICS_TOO_MANY_REFERENCES , 3223724291U) /* 0xc0262103 */ \ XXX( HRES_ERROR_GRAPHICS_TRY_AGAIN_LATER , 3223724292U) /* 0xc0262104 */ \ XXX( HRES_ERROR_GRAPHICS_TRY_AGAIN_NOW , 3223724293U) /* 0xc0262105 */ \ XXX( HRES_ERROR_GRAPHICS_ALLOCATION_INVALID , 3223724294U) /* 0xc0262106 */ \ XXX( HRES_ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE, 3223724295U) /* 0xc0262107 */ \ XXX( HRES_ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED, 3223724296U) /* 0xc0262108 */ \ XXX( HRES_ERROR_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION, 3223724297U) /* 0xc0262109 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_ALLOCATION_USAGE , 3223724304U) /* 0xc0262110 */ \ XXX( HRES_ERROR_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION, 3223724305U) /* 0xc0262111 */ \ XXX( HRES_ERROR_GRAPHICS_ALLOCATION_CLOSED , 3223724306U) /* 0xc0262112 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_ALLOCATION_INSTANCE, 3223724307U) /* 0xc0262113 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_ALLOCATION_HANDLE , 3223724308U) /* 0xc0262114 */ \ XXX( HRES_ERROR_GRAPHICS_WRONG_ALLOCATION_DEVICE , 3223724309U) /* 0xc0262115 */ \ XXX( HRES_ERROR_GRAPHICS_ALLOCATION_CONTENT_LOST , 3223724310U) /* 0xc0262116 */ \ XXX( HRES_ERROR_GRAPHICS_GPU_EXCEPTION_ON_DEVICE , 3223724544U) /* 0xc0262200 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY , 3223724800U) /* 0xc0262300 */ \ XXX( HRES_ERROR_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED, 3223724801U) /* 0xc0262301 */ \ XXX( HRES_ERROR_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED, 3223724802U) /* 0xc0262302 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN , 3223724803U) /* 0xc0262303 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, 3223724804U) /* 0xc0262304 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET, 3223724805U) /* 0xc0262305 */ \ XXX( HRES_ERROR_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED, 3223724806U) /* 0xc0262306 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_SOURCEMODESET, 3223724808U) /* 0xc0262308 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_TARGETMODESET, 3223724809U) /* 0xc0262309 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_FREQUENCY , 3223724810U) /* 0xc026230a */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_ACTIVE_REGION , 3223724811U) /* 0xc026230b */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_TOTAL_REGION , 3223724812U) /* 0xc026230c */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE, 3223724816U) /* 0xc0262310 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE, 3223724817U) /* 0xc0262311 */ \ XXX( HRES_ERROR_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET, 3223724818U) /* 0xc0262312 */ \ XXX( HRES_ERROR_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY , 3223724819U) /* 0xc0262313 */ \ XXX( HRES_ERROR_GRAPHICS_MODE_ALREADY_IN_MODESET , 3223724820U) /* 0xc0262314 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET, 3223724821U) /* 0xc0262315 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET, 3223724822U) /* 0xc0262316 */ \ XXX( HRES_ERROR_GRAPHICS_SOURCE_ALREADY_IN_SET , 3223724823U) /* 0xc0262317 */ \ XXX( HRES_ERROR_GRAPHICS_TARGET_ALREADY_IN_SET , 3223724824U) /* 0xc0262318 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_PRESENT_PATH , 3223724825U) /* 0xc0262319 */ \ XXX( HRES_ERROR_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY, 3223724826U) /* 0xc026231a */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET, 3223724827U) /* 0xc026231b */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE, 3223724828U) /* 0xc026231c */ \ XXX( HRES_ERROR_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET , 3223724829U) /* 0xc026231d */ \ XXX( HRES_ERROR_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET, 3223724831U) /* 0xc026231f */ \ XXX( HRES_ERROR_GRAPHICS_STALE_MODESET , 3223724832U) /* 0xc0262320 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITOR_SOURCEMODESET, 3223724833U) /* 0xc0262321 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITOR_SOURCE_MODE, 3223724834U) /* 0xc0262322 */ \ XXX( HRES_ERROR_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN, 3223724835U) /* 0xc0262323 */ \ XXX( HRES_ERROR_GRAPHICS_MODE_ID_MUST_BE_UNIQUE , 3223724836U) /* 0xc0262324 */ \ XXX( HRES_ERROR_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION, 3223724837U) /* 0xc0262325 */ \ XXX( HRES_ERROR_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES, 3223724838U) /* 0xc0262326 */ \ XXX( HRES_ERROR_GRAPHICS_PATH_NOT_IN_TOPOLOGY , 3223724839U) /* 0xc0262327 */ \ XXX( HRES_ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE, 3223724840U) /* 0xc0262328 */ \ XXX( HRES_ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET, 3223724841U) /* 0xc0262329 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITORDESCRIPTORSET, 3223724842U) /* 0xc026232a */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MONITORDESCRIPTOR , 3223724843U) /* 0xc026232b */ \ XXX( HRES_ERROR_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET, 3223724844U) /* 0xc026232c */ \ XXX( HRES_ERROR_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET, 3223724845U) /* 0xc026232d */ \ XXX( HRES_ERROR_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE, 3223724846U) /* 0xc026232e */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE, 3223724847U) /* 0xc026232f */ \ XXX( HRES_ERROR_GRAPHICS_RESOURCES_NOT_RELATED , 3223724848U) /* 0xc0262330 */ \ XXX( HRES_ERROR_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE , 3223724849U) /* 0xc0262331 */ \ XXX( HRES_ERROR_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE , 3223724850U) /* 0xc0262332 */ \ XXX( HRES_ERROR_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET , 3223724851U) /* 0xc0262333 */ \ XXX( HRES_ERROR_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER, 3223724852U) /* 0xc0262334 */ \ XXX( HRES_ERROR_GRAPHICS_NO_VIDPNMGR , 3223724853U) /* 0xc0262335 */ \ XXX( HRES_ERROR_GRAPHICS_NO_ACTIVE_VIDPN , 3223724854U) /* 0xc0262336 */ \ XXX( HRES_ERROR_GRAPHICS_STALE_VIDPN_TOPOLOGY , 3223724855U) /* 0xc0262337 */ \ XXX( HRES_ERROR_GRAPHICS_MONITOR_NOT_CONNECTED , 3223724856U) /* 0xc0262338 */ \ XXX( HRES_ERROR_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY , 3223724857U) /* 0xc0262339 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE, 3223724858U) /* 0xc026233a */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VISIBLEREGION_SIZE , 3223724859U) /* 0xc026233b */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_STRIDE , 3223724860U) /* 0xc026233c */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PIXELFORMAT , 3223724861U) /* 0xc026233d */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_COLORBASIS , 3223724862U) /* 0xc026233e */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PIXELVALUEACCESSMODE, 3223724863U) /* 0xc026233f */ \ XXX( HRES_ERROR_GRAPHICS_TARGET_NOT_IN_TOPOLOGY , 3223724864U) /* 0xc0262340 */ \ XXX( HRES_ERROR_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT, 3223724865U) /* 0xc0262341 */ \ XXX( HRES_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE , 3223724866U) /* 0xc0262342 */ \ XXX( HRES_ERROR_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN , 3223724867U) /* 0xc0262343 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL, 3223724868U) /* 0xc0262344 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION, 3223724869U) /* 0xc0262345 */ \ XXX( HRES_ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED, 3223724870U) /* 0xc0262346 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_GAMMA_RAMP , 3223724871U) /* 0xc0262347 */ \ XXX( HRES_ERROR_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED , 3223724872U) /* 0xc0262348 */ \ XXX( HRES_ERROR_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED, 3223724873U) /* 0xc0262349 */ \ XXX( HRES_ERROR_GRAPHICS_MODE_NOT_IN_MODESET , 3223724874U) /* 0xc026234a */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON, 3223724877U) /* 0xc026234d */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_PATH_CONTENT_TYPE , 3223724878U) /* 0xc026234e */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_COPYPROTECTION_TYPE, 3223724879U) /* 0xc026234f */ \ XXX( HRES_ERROR_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS, 3223724880U) /* 0xc0262350 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_SCANLINE_ORDERING , 3223724882U) /* 0xc0262352 */ \ XXX( HRES_ERROR_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED, 3223724883U) /* 0xc0262353 */ \ XXX( HRES_ERROR_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS, 3223724884U) /* 0xc0262354 */ \ XXX( HRES_ERROR_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT, 3223724885U) /* 0xc0262355 */ \ XXX( HRES_ERROR_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM, 3223724886U) /* 0xc0262356 */ \ XXX( HRES_ERROR_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED, 3223725056U) /* 0xc0262400 */ \ XXX( HRES_ERROR_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED, 3223725057U) /* 0xc0262401 */ \ XXX( HRES_ERROR_GRAPHICS_NOT_A_LINKED_ADAPTER , 3223725104U) /* 0xc0262430 */ \ XXX( HRES_ERROR_GRAPHICS_LEADLINK_NOT_ENUMERATED , 3223725105U) /* 0xc0262431 */ \ XXX( HRES_ERROR_GRAPHICS_CHAINLINKS_NOT_ENUMERATED , 3223725106U) /* 0xc0262432 */ \ XXX( HRES_ERROR_GRAPHICS_ADAPTER_CHAIN_NOT_READY , 3223725107U) /* 0xc0262433 */ \ XXX( HRES_ERROR_GRAPHICS_CHAINLINKS_NOT_STARTED , 3223725108U) /* 0xc0262434 */ \ XXX( HRES_ERROR_GRAPHICS_CHAINLINKS_NOT_POWERED_ON , 3223725109U) /* 0xc0262435 */ \ XXX( HRES_ERROR_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE, 3223725110U) /* 0xc0262436 */ \ XXX( HRES_ERROR_GRAPHICS_NOT_POST_DEVICE_DRIVER , 3223725112U) /* 0xc0262438 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_NOT_SUPPORTED , 3223725312U) /* 0xc0262500 */ \ XXX( HRES_ERROR_GRAPHICS_COPP_NOT_SUPPORTED , 3223725313U) /* 0xc0262501 */ \ XXX( HRES_ERROR_GRAPHICS_UAB_NOT_SUPPORTED , 3223725314U) /* 0xc0262502 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS, 3223725315U) /* 0xc0262503 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_PARAMETER_ARRAY_TOO_SMALL, 3223725316U) /* 0xc0262504 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_NO_VIDEO_OUTPUTS_EXIST , 3223725317U) /* 0xc0262505 */ \ XXX( HRES_ERROR_GRAPHICS_PVP_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME, 3223725318U) /* 0xc0262506 */ \ XXX( HRES_ERROR_GRAPHICS_PVP_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP, 3223725319U) /* 0xc0262507 */ \ XXX( HRES_ERROR_GRAPHICS_PVP_MIRRORING_DEVICES_NOT_SUPPORTED, 3223725320U) /* 0xc0262508 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_INVALID_POINTER , 3223725322U) /* 0xc026250a */ \ XXX( HRES_ERROR_GRAPHICS_OPM_INTERNAL_ERROR , 3223725323U) /* 0xc026250b */ \ XXX( HRES_ERROR_GRAPHICS_OPM_INVALID_HANDLE , 3223725324U) /* 0xc026250c */ \ XXX( HRES_ERROR_GRAPHICS_PVP_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE, 3223725325U) /* 0xc026250d */ \ XXX( HRES_ERROR_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH, 3223725326U) /* 0xc026250e */ \ XXX( HRES_ERROR_GRAPHICS_OPM_SPANNING_MODE_ENABLED , 3223725327U) /* 0xc026250f */ \ XXX( HRES_ERROR_GRAPHICS_OPM_THEATER_MODE_ENABLED , 3223725328U) /* 0xc0262510 */ \ XXX( HRES_ERROR_GRAPHICS_PVP_HFS_FAILED , 3223725329U) /* 0xc0262511 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_INVALID_SRM , 3223725330U) /* 0xc0262512 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP, 3223725331U) /* 0xc0262513 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP, 3223725332U) /* 0xc0262514 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA, 3223725333U) /* 0xc0262515 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_HDCP_SRM_NEVER_SET , 3223725334U) /* 0xc0262516 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_RESOLUTION_TOO_HIGH , 3223725335U) /* 0xc0262517 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE, 3223725336U) /* 0xc0262518 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_NO_LONGER_EXISTS, 3223725337U) /* 0xc0262519 */ \ XXX( HRES_ERROR_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS, 3223725338U) /* 0xc026251a */ \ XXX( HRES_ERROR_GRAPHICS_I2C_NOT_SUPPORTED , 3223725440U) /* 0xc0262580 */ \ XXX( HRES_ERROR_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST , 3223725441U) /* 0xc0262581 */ \ XXX( HRES_ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA, 3223725442U) /* 0xc0262582 */ \ XXX( HRES_ERROR_GRAPHICS_I2C_ERROR_RECEIVING_DATA , 3223725443U) /* 0xc0262583 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED , 3223725444U) /* 0xc0262584 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_INVALID_DATA , 3223725445U) /* 0xc0262585 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE, 3223725446U) /* 0xc0262586 */ \ XXX( HRES_ERROR_GRAPHICS_MCA_INVALID_CAPABILITIES_STRING, 3223725447U) /* 0xc0262587 */ \ XXX( HRES_ERROR_GRAPHICS_MCA_INTERNAL_ERROR , 3223725448U) /* 0xc0262588 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND, 3223725449U) /* 0xc0262589 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH, 3223725450U) /* 0xc026258a */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM, 3223725451U) /* 0xc026258b */ \ XXX( HRES_ERROR_GRAPHICS_PMEA_INVALID_MONITOR , 3223725526U) /* 0xc02625d6 */ \ XXX( HRES_ERROR_GRAPHICS_PMEA_INVALID_D3D_DEVICE , 3223725527U) /* 0xc02625d7 */ \ XXX( HRES_ERROR_GRAPHICS_DDCCI_CURRENT_CURRENT_VALUE_GREATER_THAN_MAXIMUM_VALUE, 3223725528U) /* 0xc02625d8 */ \ XXX( HRES_ERROR_GRAPHICS_MCA_INVALID_VCP_VERSION , 3223725529U) /* 0xc02625d9 */ \ XXX( HRES_ERROR_GRAPHICS_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION, 3223725530U) /* 0xc02625da */ \ XXX( HRES_ERROR_GRAPHICS_MCA_MCCS_VERSION_MISMATCH , 3223725531U) /* 0xc02625db */ \ XXX( HRES_ERROR_GRAPHICS_MCA_UNSUPPORTED_MCCS_VERSION, 3223725532U) /* 0xc02625dc */ \ XXX( HRES_ERROR_GRAPHICS_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED, 3223725534U) /* 0xc02625de */ \ XXX( HRES_ERROR_GRAPHICS_MCA_UNSUPPORTED_COLOR_TEMPERATURE, 3223725535U) /* 0xc02625df */ \ XXX( HRES_ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED, 3223725536U) /* 0xc02625e0 */ \ #if 0 /* HRES_... symbols not referenced within Wireshark */ VALUE_STRING_ENUM2(HRES_errors); #endif VALUE_STRING_ARRAY2_GLOBAL_DCL(HRES_errors); /* XXX: Remove once all PIDL generated dissectors ref HRES_errors_ext */ extern value_string_ext HRES_errors_ext; /* * DOS error codes used by other dissectors. * At least some of these are from the SMB X/Open spec, as errors for * the ERRDOS error class, but they might be error codes returned from * DOS. */ #define DOS_errors_VALUE_STRING_LIST(XXX) \ XXX( SMBE_DOS_success, 0, "Success") \ XXX( SMBE_DOS_badfunc, 1, "Invalid function (or system call)") \ XXX( SMBE_DOS_badfile, 2, "File not found (pathname error)") \ XXX( SMBE_DOS_badpath, 3, "Directory not found") \ XXX( SMBE_DOS_nofids, 4, "Too many open files") \ XXX( SMBE_DOS_noaccess, 5, "Access denied") \ XXX( SMBE_DOS_badfid, 6, "Invalid fid") \ XXX( SMBE_DOS_badmcb, 7, "Memory control blocks destroyed") /* ??? */ \ XXX( SMBE_DOS_nomem, 8, "Out of memory") \ XXX( SMBE_DOS_badmem, 9, "Invalid memory block address") \ XXX( SMBE_DOS_badenv, 10, "Invalid environment") \ XXX( SMBE_DOS_badformat, 11, "Invalid format") /* ??? */ \ XXX( SMBE_DOS_badaccess, 12, "Invalid open mode") \ XXX( SMBE_DOS_baddata, 13, "Invalid data (only from ioctl call)") \ XXX( SMBE_DOS_res, 14, "Reserved error code?") /* out of memory ? */ \ XXX( SMBE_DOS_baddrive, 15, "Invalid drive") \ XXX( SMBE_DOS_remcd, 16, "Attempt to delete current directory") \ XXX( SMBE_DOS_diffdevice, 17, "Rename/move across different filesystems") \ XXX( SMBE_DOS_nofiles, 18, "No more files found in file search") \ XXX( SMBE_DOS_general, 31, "General failure") /* Also "SMBE_HRD" */ \ XXX( SMBE_DOS_badshare, 32, "Share mode on file conflict with open mode") \ XXX( SMBE_DOS_lock, 33, "Lock request conflicts with existing lock") \ XXX( SMBE_DOS_unsup, 50, "Request unsupported, returned by Win 95") /* RJS 20Jun98 */ \ XXX( SMBE_DOS_netnamedel, 64, "Network name deleted or not available") \ XXX( SMBE_DOS_noipc, 66, "Don't support ipc") \ XXX( SMBE_DOS_nosuchshare, 67, "Requested share does not exist") \ XXX( SMBE_DOS_filexists, 80, "File in operation already exists") \ XXX( SMBE_DOS_invalidparam, 87, "Invalid parameter") \ XXX( SMBE_DOS_cannotopen, 110, "Cannot open the file specified") \ XXX( SMBE_DOS_bufferoverflow, 111, "Buffer overflow") \ XXX( SMBE_DOS_insufficientbuffer, 122, "Insufficient buffer") \ XXX( SMBE_DOS_invalidname, 123, "Invalid name") \ XXX( SMBE_DOS_unknownlevel, 124, "Unknown info level") \ XXX( SMBE_DOS_notlocked, 158, "This region is not locked by this locking context.") \ XXX( SMBE_DOS_invalidpath, 161, "Invalid Path") \ XXX( SMBE_DOS_cancelviolation, 173, "Cancel violation") \ XXX( SMBE_DOS_noatomiclocks, 174, "No atomic clocks") \ XXX( SMBE_DOS_alreadyexists, 183, "File already exists") /* 'rename" ? */ \ XXX( SMBE_DOS_badpipe, 230, "Named pipe invalid") \ XXX( SMBE_DOS_pipebusy, 231, "All instances of pipe are busy") \ XXX( SMBE_DOS_pipeclosing, 232, "Named pipe close in progress") \ XXX( SMBE_DOS_notconnected, 233, "No process on other end of named pipe") \ XXX( SMBE_DOS_moredata, 234, "More data to be returned") \ XXX( SMBE_DOS_eainconsistent, 255, "ea inconsistent") /* from EMC */ \ XXX( SMBE_DOS_nomoreitems, 259, "No more items") \ XXX( SMBE_DOS_baddirectory, 267, "Invalid directory name in a path.") \ XXX( SMBE_DOS_eas_didnt_fit, 275, "Extended attributes didn't fit") \ XXX( SMBE_DOS_eas_nsup, 282, "Extended attributes not supported") \ XXX( SMBE_DOS_notify_buf_small, 1022, "Buffer too small to return change notify.") \ XXX( SMBE_DOS_invalidowner, 1307, "Invalid security descriptor owner") /* NT printer driver system only */ \ XXX( SMBE_DOS_logonfailure, 1326, "Unknown username or bad password") \ XXX( SMBE_DOS_invalidsecuritydescriptor, 1338, "Invalid security descriptor") /* NT printer driver system only */ \ XXX( SMBE_DOS_serverunavailable, 1722, "Server unavailable") \ XXX( SMBE_DOS_driveralreadyinstalled, 1795, "Printer driver already installed") /* NT printer driver system only */ \ XXX( SMBE_DOS_unknownprinterport, 1796, "Error unknown port") /* NT printer driver system only */ \ XXX( SMBE_DOS_unknownprinterdriver, 1797, "Unknown printer driver") /* NT printer driver system only */ \ XXX( SMBE_DOS_unknownprintprocessor, 1798, "Unknown print processor") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidseparatorfile, 1799, "Invalid separator file") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidjobpriority, 1800, "Invalid priority") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidprintername, 1801, "Invalid printer name") /* NT printer driver system only */ \ XXX( SMBE_DOS_printeralreadyexists, 1802, "Printer already exists") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidprintercommand, 1803, "Invalid printer command") /* NT printer driver system only */ \ XXX( SMBE_DOS_invaliddatatype, 1804, "Invalid datatype") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidenvironment, 1805, "Invalid environment") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidformsize, 1903, "Invalid form size") /* NT printer driver system only */ \ XXX( SMBE_DOS_buftoosmall, 2123, "Buffer too small") \ XXX( SMBE_DOS_unknownipc, 2142, "Unknown IPC Operation") \ XXX( SMBE_DOS_nosuchprintjob, 2151, "No such print job") /* NT printer driver system only ?? */ \ XXX( SMBE_DOS_invgroup, 2455, "Invalid Group") \ XXX( SMBE_DOS_unknownprintmonitor, 3000, "Unknown print monitor") /* NT printer driver system only */ \ XXX( SMBE_DOS_printerdriverinuse, 3001, "Printer driver in use") /* NT printer driver system only */ \ XXX( SMBE_DOS_spoolfilenotfound, 3002, "Spool file not found") /* NT printer driver system only */ \ XXX( SMBE_DOS_nostartdoc, 3003, "Error_spl_no_startdoc") /* NT printer driver system only */ \ XXX( SMBE_DOS_noaddjob, 3004, "Spl no addjob") /* NT printer driver system only */ \ XXX( SMBE_DOS_printprocessoralreadyinstalled, 3005, "Print processor already installed") /* NT printer driver system only */ \ XXX( SMBE_DOS_printmonitoralreadyinstalled, 3006, "Print monitor already installed") /* NT printer driver system only */ \ XXX( SMBE_DOS_invalidprintmonitor, 3007, "Invalid print monitor") /* NT printer driver system only */ \ XXX( SMBE_DOS_printmonitorinuse, 3008, "Print monitor in use") /* NT printer driver system only */ \ XXX( SMBE_DOS_printerhasjobsqueued, 3009, "Printer has jobs queued") /* NT printer driver system only */ VALUE_STRING_ENUM(DOS_errors); extern value_string_ext DOS_errors_ext; /* * NT error codes used by other dissectors. */ extern const value_string NT_errors[]; /* XXX: Remove once all PIDL generated dissectors ref NT_errors_ext */ extern value_string_ext NT_errors_ext; extern value_string_ext ms_country_codes_ext; WS_DLL_PUBLIC int dissect_nt_64bit_time(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date); WS_DLL_PUBLIC int dissect_nt_64bit_time_opt(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date, gboolean onesec_resolution); WS_DLL_PUBLIC int dissect_nt_64bit_time_ex(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date, proto_item **createdItem, gboolean onesec_resolution); /* * SIDs and RIDs */ typedef struct _sid_strings { const char* sid; const char* name; } sid_strings; /* Dissect a NT SID. Label it with 'name' and return a string version * of the SID in the 'sid_str' parameter which has a packet lifetime * scope and should NOT be freed by the caller. hf_sid can be -1 if * the caller doesn't care what name is used and then "nt.sid" will be * the default instead. If the caller wants a more appropriate hf * field, it will just pass a FT_STRING hf field here */ WS_DLL_PUBLIC int dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const char *name, char **sid_str, int hf_sid); WS_DLL_PUBLIC int dissect_nt_sid_ret_item(tvbuff_t *tvb, int offset, proto_tree *parent_tree, const char *name, char **sid_str, int hf_sid, proto_item **item_ret); /* * Stuff for dissecting NT access masks */ /* * Access mask values */ /* Generic rights */ #define GENERIC_RIGHTS_MASK 0xF0000000 #define GENERIC_ALL_ACCESS 0x10000000 #define GENERIC_EXECUTE_ACCESS 0x20000000 #define GENERIC_WRITE_ACCESS 0x40000000 #define GENERIC_READ_ACCESS 0x80000000 /* Misc/reserved */ #define ACCESS_SACL_ACCESS 0x00800000 #define SYSTEM_SECURITY_ACCESS 0x01000000 #define MAXIMUM_ALLOWED_ACCESS 0x02000000 /* Standard rights */ #define STANDARD_RIGHTS_MASK 0x00FF0000 #define DELETE_ACCESS 0x00010000 #define READ_CONTROL_ACCESS 0x00020000 #define WRITE_DAC_ACCESS 0x00040000 #define WRITE_OWNER_ACCESS 0x00080000 #define SYNCHRONIZE_ACCESS 0x00100000 /* Specific rights */ #define SPECIFIC_RIGHTS_MASK 0x0000FFFF /* Specific rights defined per-object */ typedef void (nt_access_mask_fn_t)(tvbuff_t *tvb, gint offset, proto_tree *tree, guint32 access); /* Map generic access permissions to specific permissions */ struct generic_mapping { guint32 generic_read; guint32 generic_write; guint32 generic_execute; guint32 generic_all; }; /* Map standard access permissions to specific permissions */ struct standard_mapping { guint32 std_read; guint32 std_write; guint32 std_execute; guint32 std_all; }; struct access_mask_info { const char *specific_rights_name; nt_access_mask_fn_t *specific_rights_fn; struct generic_mapping *generic_mapping; struct standard_mapping *standard_mapping; }; int dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep, int hfindex, struct access_mask_info *ami, guint32 *perms); int dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, guint8 *drep, gboolean len_supplied, int len, struct access_mask_info *ami); void proto_do_register_windows_common(int proto_smb); int dissect_nt_security_information(tvbuff_t *tvb, int offset, proto_tree *parent_tree); #endif
C
wireshark/epan/dissectors/packet-winsrepl.c
/* * packet-winsrepl.c * * Routines for WINS Replication packet dissection * * Copyright 2005 Stefan Metzmacher <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/exceptions.h> #include <epan/prefs.h> #include <epan/to_str.h> #include "packet-netbios.h" #include "packet-tcp.h" void proto_register_winsrepl(void); void proto_reg_handoff_winsrepl(void); static dissector_handle_t winsrepl_handle; static gboolean winsrepl_reassemble = TRUE; static int proto_winsrepl = -1; static int hf_winsrepl_size = -1; static int hf_winsrepl_opcode = -1; static int hf_winsrepl_assoc_ctx = -1; static int hf_winsrepl_mess_type = -1; static int hf_winsrepl_start_minor_version = -1; static int hf_winsrepl_start_major_version = -1; static int hf_winsrepl_stop_reason = -1; static int hf_winsrepl_replication_command = -1; static int hf_winsrepl_owner_address = -1; static int hf_winsrepl_owner_max_version = -1; static int hf_winsrepl_owner_min_version = -1; static int hf_winsrepl_owner_type = -1; static int hf_winsrepl_table_partner_count = -1; static int hf_winsrepl_table_initiator = -1; static int hf_winsrepl_ip_owner = -1; static int hf_winsrepl_ip_ip = -1; static int hf_winsrepl_addr_list_num_ips = -1; static int hf_winsrepl_name_len = -1; static int hf_winsrepl_name_flags = -1; static int hf_winsrepl_name_flags_rectype = -1; static int hf_winsrepl_name_flags_recstate = -1; static int hf_winsrepl_name_flags_local = -1; static int hf_winsrepl_name_flags_hosttype = -1; static int hf_winsrepl_name_flags_static = -1; static int hf_winsrepl_name_group_flag = -1; static int hf_winsrepl_name_version_id = -1; static int hf_winsrepl_name_unknown = -1; static int hf_winsrepl_reply_num_names = -1; static gint ett_winsrepl = -1; static gint ett_winsrepl_start = -1; static gint ett_winsrepl_stop = -1; static gint ett_winsrepl_replication = -1; static gint ett_winsrepl_owner = -1; static gint ett_winsrepl_table_reply = -1; static gint ett_winsrepl_ip = -1; static gint ett_winsrepl_addr_list = -1; static gint ett_winsrepl_name = -1; static gint ett_winsrepl_send_reply = -1; static gint ett_winsrepl_flags = -1; static expert_field ei_winsrepl_name_len = EI_INIT; #define WINS_REPLICATION_PORT ( 42 ) #define WREPL_OPCODE_BITS ( 0x7800 ) enum wrepl_replication_cmd { WREPL_REPL_TABLE_QUERY=0, WREPL_REPL_TABLE_REPLY=1, WREPL_REPL_SEND_REQUEST=2, WREPL_REPL_SEND_REPLY=3, WREPL_REPL_UPDATE=4, WREPL_REPL_UPDATE2=5, WREPL_REPL_INFORM=8, WREPL_REPL_INFORM2=9 }; enum wrepl_mess_type { WREPL_START_ASSOCIATION=0, WREPL_START_ASSOCIATION_REPLY=1, WREPL_STOP_ASSOCIATION=2, WREPL_REPLICATION=3 }; static const value_string replication_cmd_vals[] = { {WREPL_REPL_TABLE_QUERY, "WREPL_REPL_TABLE_QUERY"}, {WREPL_REPL_TABLE_REPLY, "WREPL_REPL_TABLE_REPLY"}, {WREPL_REPL_SEND_REQUEST, "WREPL_REPL_SEND_REQUEST"}, {WREPL_REPL_SEND_REPLY, "WREPL_REPL_SEND_REPLY"}, {WREPL_REPL_UPDATE, "WREPL_REPL_UPDATE"}, {WREPL_REPL_UPDATE2, "WREPL_REPL_UPDATE2"}, {WREPL_REPL_INFORM, "WREPL_REPL_INFORM"}, {WREPL_REPL_INFORM2, "WREPL_REPL_INFORM2"}, {0, NULL} }; static const value_string message_type_vals[] = { {WREPL_START_ASSOCIATION, "WREPL_START_ASSOCIATION"}, {WREPL_START_ASSOCIATION_REPLY, "WREPL_START_ASSOCIATION_REPLY"}, {WREPL_STOP_ASSOCIATION, "WREPL_STOP_ASSOCIATION"}, {WREPL_REPLICATION, "WREPL_REPLICATION"}, {0, NULL} }; #define WREPL_NAME_TYPE_MASK 0x03 #define WREPL_NAME_TYPE_UNIQUE 0x00 #define WREPL_NAME_TYPE_NORMAL_GROUP 0x01 #define WREPL_NAME_TYPE_SPECIAL_GROUP 0x02 #define WREPL_NAME_TYPE_MULTIHOMED 0x03 static const value_string rectype_vals[] = { {WREPL_NAME_TYPE_UNIQUE, "Unique"}, {WREPL_NAME_TYPE_NORMAL_GROUP, "Normal group"}, {WREPL_NAME_TYPE_SPECIAL_GROUP, "Special group"}, {WREPL_NAME_TYPE_MULTIHOMED, "Multihomed"}, {0, NULL} }; static const value_string recstate_vals[] = { {0x00, "Active"}, {0x01, "Released"}, {0x02, "Tombstoned"}, {0x03, "Deleted"}, {0, NULL} }; static const value_string hosttype_vals[] = { {0x00, "B-node"}, {0x01, "P-node"}, {0x02, "M-node"}, {0x03, "H-node"}, {0, NULL} }; static int dissect_winsrepl_start(tvbuff_t *winsrepl_tvb, _U_ packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { proto_tree *start_tree; start_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_start, NULL, "WREPL_START_ASSOCIATION"); /* ASSOC_CTX */ proto_tree_add_item(start_tree, hf_winsrepl_assoc_ctx, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; /* MINOR VERSION */ proto_tree_add_item(start_tree, hf_winsrepl_start_minor_version, winsrepl_tvb, winsrepl_offset, 2, ENC_BIG_ENDIAN); winsrepl_offset += 2; /* MAJOR VERSION */ proto_tree_add_item(start_tree, hf_winsrepl_start_major_version, winsrepl_tvb, winsrepl_offset, 2, ENC_BIG_ENDIAN); winsrepl_offset += 2; return winsrepl_offset; } static int dissect_winsrepl_stop(tvbuff_t *winsrepl_tvb, _U_ packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { guint32 reason; proto_item *stop_item; proto_tree *stop_tree; stop_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_stop, &stop_item, "WREPL_STOP_ASSOCIATION"); /* REASON */ reason = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_uint(stop_tree, hf_winsrepl_stop_reason, winsrepl_tvb, winsrepl_offset, 4, reason); winsrepl_offset += 4; proto_item_append_text(stop_item, ", Reason: 0x%08X", reason); return winsrepl_offset; } static int dissect_winsrepl_table_query(tvbuff_t *winsrepl_tvb _U_, packet_info *pinfo _U_, int winsrepl_offset, proto_tree *winsrepl_tree _U_) { /* Nothing to do here */ return winsrepl_offset; } static int dissect_winsrepl_wins_owner(tvbuff_t *winsrepl_tvb, _U_ packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree, proto_tree *sub_tree, guint32 idx) { proto_tree *owner_tree = NULL; if (sub_tree) { owner_tree = proto_tree_add_subtree_format(sub_tree, winsrepl_tvb, winsrepl_offset, 24, ett_winsrepl_owner, NULL, "WINS Owner [%u]", idx); } else if (winsrepl_tree) { owner_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, 24, ett_winsrepl_owner, NULL, "WINS Owner"); } /* ADDRESS */ proto_tree_add_item(owner_tree, hf_winsrepl_owner_address, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; /* MAX_VERSION */ proto_tree_add_item(owner_tree, hf_winsrepl_owner_max_version, winsrepl_tvb, winsrepl_offset, 8, ENC_BIG_ENDIAN); winsrepl_offset += 8; /* MIN_VERSION */ proto_tree_add_item(owner_tree, hf_winsrepl_owner_min_version, winsrepl_tvb, winsrepl_offset, 8, ENC_BIG_ENDIAN); winsrepl_offset += 8; /* TYPE */ proto_tree_add_item(owner_tree, hf_winsrepl_owner_type, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; return winsrepl_offset; } static int dissect_winsrepl_table_reply(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { proto_tree *table_tree; guint32 partner_count; guint32 i; table_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_table_reply, NULL, "WREPL_REPL_TABLE_REPLY"); /* PARTNER COUNT */ partner_count = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_uint(table_tree, hf_winsrepl_table_partner_count, winsrepl_tvb, winsrepl_offset, 4, partner_count); winsrepl_offset += 4; for (i=0; i < partner_count; i++) { winsrepl_offset = dissect_winsrepl_wins_owner(winsrepl_tvb, pinfo, winsrepl_offset, table_tree, table_tree, i); } /* INITIATOR */ proto_tree_add_item(table_tree, hf_winsrepl_table_initiator, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; return winsrepl_offset; } static int dissect_winsrepl_send_request(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { winsrepl_offset = dissect_winsrepl_wins_owner(winsrepl_tvb, pinfo, winsrepl_offset, winsrepl_tree, NULL, 0); return winsrepl_offset; } static int dissect_winsrepl_wins_ip(tvbuff_t *winsrepl_tvb, _U_ packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree, guint32 *addr, proto_tree *sub_tree, guint32 idx) { proto_item *ip_item = NULL; proto_tree *ip_tree = NULL; if (sub_tree) { ip_tree = proto_tree_add_subtree_format(sub_tree, winsrepl_tvb, winsrepl_offset, 8, ett_winsrepl_ip, &ip_item, "WINS IP [%u]", idx); } else if (winsrepl_tree) { ip_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, 8, ett_winsrepl_ip, &ip_item, "WINS IP"); } /* OWNER */ proto_tree_add_item(ip_tree, hf_winsrepl_ip_owner, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; /* IP */ *addr = tvb_get_ipv4(winsrepl_tvb, winsrepl_offset); proto_tree_add_ipv4(ip_tree, hf_winsrepl_ip_ip, winsrepl_tvb, winsrepl_offset, 4, *addr); proto_item_append_text(ip_item, ": %s", tvb_ip_to_str(pinfo->pool, winsrepl_tvb, winsrepl_offset)); winsrepl_offset += 4; return winsrepl_offset; } static int dissect_winsrepl_wins_address_list(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree, proto_item *parent_item) { proto_item *addr_list_item; proto_tree *addr_list_tree; int old_offset = winsrepl_offset; guint32 num_ips; guint32 ip; guint32 i; address addr; gchar* addr_str; addr_list_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_addr_list, &addr_list_item, "WINS Address List"); /* NUM_IPS */ num_ips = tvb_get_letohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_uint(addr_list_tree, hf_winsrepl_addr_list_num_ips, winsrepl_tvb, winsrepl_offset, 4, num_ips); winsrepl_offset += 4; for (i=0; i < num_ips; i++) { winsrepl_offset = dissect_winsrepl_wins_ip(winsrepl_tvb, pinfo, winsrepl_offset, addr_list_tree, &ip, addr_list_tree, i); set_address(&addr, AT_IPv4, 4, &ip); addr_str = address_to_str(pinfo->pool, &addr); if (i == 0) { proto_item_append_text(parent_item, ": %s", addr_str); proto_item_append_text(addr_list_item, ": %s", addr_str); } else { proto_item_append_text(parent_item, ", %s", addr_str); proto_item_append_text(addr_list_item, ", %s", addr_str); } } proto_item_set_len(addr_list_item, winsrepl_offset - old_offset); return winsrepl_offset; } static int dissect_winsrepl_wins_name(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree, proto_tree *sub_tree, guint32 idx) { proto_item *name_item = NULL, *ti; proto_tree *name_tree = NULL; int old_offset = winsrepl_offset; tvbuff_t *name_tvb = NULL; guint32 name_len; char name_str[(NETBIOS_NAME_LEN - 1)*4 + 1]; int name_type; guint32 flags; static int * const name_flags[] = { &hf_winsrepl_name_flags_rectype, &hf_winsrepl_name_flags_recstate, &hf_winsrepl_name_flags_local, &hf_winsrepl_name_flags_hosttype, &hf_winsrepl_name_flags_static, NULL }; if (sub_tree) { name_tree = proto_tree_add_subtree_format(sub_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_name, &name_item, "WINS Name [%u]", idx); } else if (winsrepl_tree) { name_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_name, &name_item, "WINS Name"); } /* NAME_LEN */ name_len = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); ti = proto_tree_add_uint(name_tree, hf_winsrepl_name_len, winsrepl_tvb, winsrepl_offset, 4, name_len); winsrepl_offset += 4; if (name_len == 0) { expert_add_info(pinfo, ti, &ei_winsrepl_name_len); return winsrepl_offset; } /* NAME: TODO! */ /* * XXX - apparently, according to the Samba code for handling * WINS replication, there's a bug in a lot of versions of Windows, * including W2K SP2, wherein the first and last bytes of the * name (the last byte being the name type) are swapped if * the type is 0x1b. I think I've seen this in at least * one capture. */ name_tvb = tvb_new_subset_length(winsrepl_tvb, winsrepl_offset, name_len); netbios_add_name("Name", name_tvb, 0, name_tree); name_type = get_netbios_name(name_tvb, 0, name_str, (NETBIOS_NAME_LEN - 1)*4 + 1); proto_item_append_text(name_item, ": %s<%02x>", name_str, name_type); winsrepl_offset += name_len; /* ALIGN to 4 Byte */ /* winsrepl_offset += ((winsrepl_offset & (4-1)) == 0 ? 0 : (4 - (winsrepl_offset & (4-1)))); */ /* Windows including w2k8 add 4 padding bytes, when it's already 4 byte * aligned... This happens when the name has a "scope" part */ winsrepl_offset += 4 - (winsrepl_offset & (4-1)); /* FLAGS */ /* * XXX - there appear to be more flag bits, but I didn't see * anything in the Samba code about them. */ flags = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_bitmask(name_tree, winsrepl_tvb, winsrepl_offset, hf_winsrepl_name_flags, ett_winsrepl_flags, name_flags, ENC_BIG_ENDIAN); winsrepl_offset += 4; /* GROUP_FLAG */ /* XXX - is this just a Boolean? */ proto_tree_add_item(name_tree, hf_winsrepl_name_group_flag, winsrepl_tvb, winsrepl_offset, 4, ENC_LITTLE_ENDIAN); winsrepl_offset += 4; /* Version ID */ proto_tree_add_item(name_tree, hf_winsrepl_name_version_id, winsrepl_tvb, winsrepl_offset, 8, ENC_BIG_ENDIAN); winsrepl_offset += 8; switch (flags & WREPL_NAME_TYPE_MASK) { case WREPL_NAME_TYPE_UNIQUE: case WREPL_NAME_TYPE_NORMAL_GROUP: /* Single address */ proto_tree_add_item(name_tree, hf_winsrepl_ip_ip, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(name_item, ": %s", tvb_ip_to_str(pinfo->pool, winsrepl_tvb, winsrepl_offset)); winsrepl_offset += 4; break; case WREPL_NAME_TYPE_SPECIAL_GROUP: case WREPL_NAME_TYPE_MULTIHOMED: /* Address list */ winsrepl_offset = dissect_winsrepl_wins_address_list(winsrepl_tvb, pinfo, winsrepl_offset, name_tree, name_item); break; } /* UNKNOWN, little or big endian??? */ proto_tree_add_item(name_tree, hf_winsrepl_name_unknown, winsrepl_tvb, winsrepl_offset, 4, ENC_BIG_ENDIAN); winsrepl_offset += 4; proto_item_set_len(name_item, winsrepl_offset - old_offset); return winsrepl_offset; } static int dissect_winsrepl_send_reply(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { proto_tree *rep_tree; guint32 num_names; guint32 i; rep_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_send_reply, NULL, "WREPL_REPL_SEND_REPLY"); /* NUM NAMES */ num_names = tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_uint(rep_tree, hf_winsrepl_reply_num_names, winsrepl_tvb, winsrepl_offset, 4, num_names); winsrepl_offset += 4; for (i=0; i < num_names; i++) { winsrepl_offset = dissect_winsrepl_wins_name(winsrepl_tvb, pinfo, winsrepl_offset, rep_tree, rep_tree, i); } return winsrepl_offset; } static int dissect_winsrepl_update(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo, winsrepl_offset, winsrepl_tree); return winsrepl_offset; } static int dissect_winsrepl_update2(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo, winsrepl_offset, winsrepl_tree); return winsrepl_offset; } static int dissect_winsrepl_inform(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo, winsrepl_offset, winsrepl_tree); return winsrepl_offset; } static int dissect_winsrepl_inform2(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_tree *winsrepl_tree) { winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo, winsrepl_offset, winsrepl_tree); return winsrepl_offset; } static int dissect_winsrepl_replication(tvbuff_t *winsrepl_tvb, packet_info *pinfo, int winsrepl_offset, proto_item *winsrepl_item, proto_tree *winsrepl_tree) { proto_item *repl_item; proto_tree *repl_tree; enum wrepl_replication_cmd command; repl_tree = proto_tree_add_subtree(winsrepl_tree, winsrepl_tvb, winsrepl_offset, -1, ett_winsrepl_replication, &repl_item, "WREPL_REPLICATION"); /* REPLICATION_CMD */ command = (enum wrepl_replication_cmd)tvb_get_ntohl(winsrepl_tvb, winsrepl_offset); proto_tree_add_uint(repl_tree, hf_winsrepl_replication_command, winsrepl_tvb, winsrepl_offset, 4, command); winsrepl_offset += 4; switch (command) { case WREPL_REPL_TABLE_QUERY: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_TABLE_QUERY"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_TABLE_QUERY"); proto_item_append_text(repl_item, ", WREPL_REPL_TABLE_QUERY"); winsrepl_offset = dissect_winsrepl_table_query(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_TABLE_REPLY: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_TABLE_REPLY"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_TABLE_REPLY"); proto_item_append_text(repl_item, ", WREPL_REPL_TABLE_REPLY"); winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_SEND_REQUEST: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_SEND_REQUEST"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_SEND_REQUEST"); proto_item_append_text(repl_item, ", WREPL_REPL_SEND_REQUEST"); winsrepl_offset = dissect_winsrepl_send_request(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_SEND_REPLY: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_SEND_REPLY"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_SEND_REPLY"); proto_item_append_text(repl_item, ", WREPL_REPL_SEND_REPLY"); winsrepl_offset = dissect_winsrepl_send_reply(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_UPDATE: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_UPDATE"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_UPDATE"); proto_item_append_text(repl_item, ", WREPL_REPL_UPDATE"); winsrepl_offset = dissect_winsrepl_update(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_UPDATE2: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_UPDATE2"); proto_item_append_text(winsrepl_item, ",WREPL_REPL_UPDATE2"); proto_item_append_text(repl_item, ",WREPL_REPL_UPDATE2"); winsrepl_offset = dissect_winsrepl_update2(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_INFORM: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_INFORM"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_INFORM"); proto_item_append_text(repl_item, ", WREPL_REPL_INFORM"); winsrepl_offset = dissect_winsrepl_inform(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; case WREPL_REPL_INFORM2: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_REPL_INFORM2"); proto_item_append_text(winsrepl_item, ", WREPL_REPL_INFORM2"); proto_item_append_text(repl_item, ", WREPL_REPL_INFORM2"); winsrepl_offset = dissect_winsrepl_inform2(winsrepl_tvb, pinfo, winsrepl_offset, repl_tree); break; } return winsrepl_offset; } static int dissect_winsrepl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) { int offset = 0; proto_item *winsrepl_item; proto_tree *winsrepl_tree; enum wrepl_mess_type mess_type; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WINS-Replication"); col_clear(pinfo->cinfo, COL_INFO); winsrepl_item = proto_tree_add_item(parent_tree, proto_winsrepl, tvb, offset, -1, ENC_NA); winsrepl_tree = proto_item_add_subtree(winsrepl_item, ett_winsrepl); /* SIZE */ proto_tree_add_item(winsrepl_tree, hf_winsrepl_size, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* OPCODE */ proto_tree_add_item(winsrepl_tree, hf_winsrepl_opcode, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* ASSOC_CTX */ proto_tree_add_item(winsrepl_tree, hf_winsrepl_assoc_ctx, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* MESSAGE_TYPE */ mess_type = (enum wrepl_mess_type)tvb_get_ntohl(tvb, offset); proto_tree_add_uint(winsrepl_tree, hf_winsrepl_mess_type, tvb, offset, 4, mess_type); offset += 4; switch (mess_type) { case WREPL_START_ASSOCIATION: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_START_ASSOCIATION"); proto_item_append_text(winsrepl_item, ", WREPL_START_ASSOCIATION"); dissect_winsrepl_start(tvb, pinfo, offset, winsrepl_tree); break; case WREPL_START_ASSOCIATION_REPLY: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_START_ASSOCIATION_REPLY"); proto_item_append_text(winsrepl_item, ", WREPL_START_ASSOCIATION_REPLY"); dissect_winsrepl_start(tvb, pinfo, offset, winsrepl_tree); break; case WREPL_STOP_ASSOCIATION: col_set_str(pinfo->cinfo, COL_INFO, "WREPL_STOP_ASSOCIATION"); proto_item_append_text(winsrepl_item, ", WREPL_STOP_ASSOCIATION"); dissect_winsrepl_stop(tvb, pinfo, offset, winsrepl_tree); break; case WREPL_REPLICATION: dissect_winsrepl_replication(tvb, pinfo, offset, winsrepl_item, winsrepl_tree); break; } return tvb_captured_length(tvb); } static guint get_winsrepl_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { guint pdu_len; pdu_len=tvb_get_ntohl(tvb, offset); return pdu_len+4; } static int dissect_winsrepl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { tcp_dissect_pdus(tvb, pinfo, parent_tree, winsrepl_reassemble, 4, get_winsrepl_pdu_len, dissect_winsrepl_pdu, data); return tvb_captured_length(tvb); } void proto_register_winsrepl(void) { static hf_register_info hf[] = { { &hf_winsrepl_size, { "Packet Size", "winsrepl.size", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Packet Size", HFILL }}, { &hf_winsrepl_opcode, { "Opcode", "winsrepl.opcode", FT_UINT32, BASE_HEX, NULL, 0x0, "WINS Replication Opcode", HFILL }}, { &hf_winsrepl_assoc_ctx, { "Assoc_Ctx", "winsrepl.assoc_ctx", FT_UINT32, BASE_HEX, NULL, 0x0, "WINS Replication Assoc_Ctx", HFILL }}, { &hf_winsrepl_mess_type, { "Message_Type", "winsrepl.message_type", FT_UINT32, BASE_DEC, VALS(message_type_vals), 0x0, "WINS Replication Message_Type", HFILL }}, { &hf_winsrepl_start_minor_version, { "Minor Version", "winsrepl.minor_version", FT_UINT16, BASE_DEC, NULL, 0x0, "WINS Replication Minor Version", HFILL }}, { &hf_winsrepl_start_major_version, { "Major Version", "winsrepl.major_version", FT_UINT16, BASE_DEC, NULL, 0x0, "WINS Replication Major Version", HFILL }}, { &hf_winsrepl_stop_reason, { "Reason", "winsrepl.reason", FT_UINT32, BASE_HEX, NULL, 0x0, "WINS Replication Reason", HFILL }}, { &hf_winsrepl_replication_command, { "Replication Command", "winsrepl.repl_cmd", FT_UINT32, BASE_HEX, VALS(replication_cmd_vals), 0x0, "WINS Replication Command", HFILL }}, { &hf_winsrepl_owner_address, { "Owner Address", "winsrepl.owner_address", FT_IPv4, BASE_NONE, NULL, 0x0, "WINS Replication Owner Address", HFILL }}, { &hf_winsrepl_owner_max_version, { "Max Version", "winsrepl.max_version", FT_UINT64, BASE_DEC, NULL, 0x0, "WINS Replication Max Version", HFILL }}, { &hf_winsrepl_owner_min_version, { "Min Version", "winsrepl.min_version", FT_UINT64, BASE_DEC, NULL, 0x0, "WINS Replication Min Version", HFILL }}, { &hf_winsrepl_owner_type, { "Owner Type", "winsrepl.owner_type", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Owner Type", HFILL }}, { &hf_winsrepl_table_partner_count, { "Partner Count", "winsrepl.partner_count", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Partner Count", HFILL }}, { &hf_winsrepl_table_initiator, { "Initiator", "winsrepl.initiator", FT_IPv4, BASE_NONE, NULL, 0x0, "WINS Replication Initiator", HFILL }}, { &hf_winsrepl_ip_owner, { "IP Owner", "winsrepl.ip_owner", FT_IPv4, BASE_NONE, NULL, 0x0, "WINS Replication IP Owner", HFILL }}, { &hf_winsrepl_ip_ip, { "IP Address", "winsrepl.ip_address", FT_IPv4, BASE_NONE, NULL, 0x0, "WINS Replication IP Address", HFILL }}, { &hf_winsrepl_addr_list_num_ips, { "Num IPs", "winsrepl.num_ips", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Num IPs", HFILL }}, { &hf_winsrepl_name_len, { "Name Len", "winsrepl.name_len", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Name Len", HFILL }}, { &hf_winsrepl_name_flags, { "Name Flags", "winsrepl.name_flags", FT_UINT32, BASE_HEX, NULL, 0x0, "WINS Replication Name Flags", HFILL }}, { &hf_winsrepl_name_flags_rectype, { "Record Type", "winsrepl.name_flags.rectype", FT_UINT32, BASE_HEX, VALS(rectype_vals), 0x00000003, "WINS Replication Name Flags Record Type", HFILL }}, { &hf_winsrepl_name_flags_recstate, { "Record State", "winsrepl.name_flags.recstate", FT_UINT32, BASE_HEX, VALS(recstate_vals), 0x0000000C, "WINS Replication Name Flags Record State", HFILL }}, { &hf_winsrepl_name_flags_local, { "Local", "winsrepl.name_flags.local", FT_BOOLEAN, 32, NULL, 0x00000010, "WINS Replication Name Flags Local Flag", HFILL }}, { &hf_winsrepl_name_flags_hosttype, { "Host Type", "winsrepl.name_flags.hosttype", FT_UINT32, BASE_HEX, VALS(hosttype_vals), 0x00000060, "WINS Replication Name Flags Host Type", HFILL }}, { &hf_winsrepl_name_flags_static, { "Static", "winsrepl.name_flags.static", FT_BOOLEAN, 32, NULL, 0x00000080, "WINS Replication Name Flags Static Flag", HFILL }}, { &hf_winsrepl_name_group_flag, { "Name Group Flag", "winsrepl.name_group_flag", FT_UINT32, BASE_HEX, NULL, 0x0, "WINS Replication Name Group Flag", HFILL }}, { &hf_winsrepl_name_version_id, { "Name Version Id", "winsrepl.name_version_id", FT_UINT64, BASE_DEC, NULL, 0x0, "WINS Replication Name Version Id", HFILL }}, { &hf_winsrepl_name_unknown, { "Unknown IP", "winsrepl.unknown", FT_IPv4, BASE_NONE, NULL, 0x0, "WINS Replication Unknown IP", HFILL }}, { &hf_winsrepl_reply_num_names, { "Num Names", "winsrepl.num_names", FT_UINT32, BASE_DEC, NULL, 0x0, "WINS Replication Num Names", HFILL }}, }; static gint *ett[] = { &ett_winsrepl, &ett_winsrepl_start, &ett_winsrepl_stop, &ett_winsrepl_replication, &ett_winsrepl_owner, &ett_winsrepl_table_reply, &ett_winsrepl_ip, &ett_winsrepl_addr_list, &ett_winsrepl_name, &ett_winsrepl_send_reply, &ett_winsrepl_flags, }; static ei_register_info ei[] = { { &ei_winsrepl_name_len, { "winsrepl.name_len.invalid", PI_MALFORMED, PI_ERROR, "Bad name length", EXPFILL }}, }; module_t *winsrepl_module; expert_module_t* expert_winsrepl; proto_winsrepl = proto_register_protocol("WINS (Windows Internet Name Service) Replication", "WINS-Replication", "winsrepl"); proto_register_subtree_array(ett, array_length(ett)); proto_register_field_array(proto_winsrepl, hf, array_length(hf)); expert_winsrepl = expert_register_protocol(proto_winsrepl); expert_register_field_array(expert_winsrepl, ei, array_length(ei)); winsrepl_handle = register_dissector("winsrepl", dissect_winsrepl, proto_winsrepl); winsrepl_module = prefs_register_protocol(proto_winsrepl, NULL); prefs_register_bool_preference(winsrepl_module, "reassemble", "Reassemble WINS-Replication messages spanning multiple TCP segments", "Whether the WINS-Replication dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &winsrepl_reassemble); } void proto_reg_handoff_winsrepl(void) { dissector_add_uint_with_preference("tcp.port", WINS_REPLICATION_PORT, winsrepl_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-wireguard.c
/* packet-wireguard.c * Routines for WireGuard dissection * Copyright 2018, Peter Wu <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Protocol details: https://www.wireguard.com/protocol/ */ #include <config.h> #include <errno.h> #define WS_LOG_DOMAIN "packet-wireguard" #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> #include <epan/proto_data.h> #include <epan/conversation.h> #include <epan/uat.h> #include <wsutil/file_util.h> #include <wsutil/filesystem.h> #include <wsutil/wsgcrypt.h> #include <wsutil/curve25519.h> #include <wsutil/wslog.h> #include <epan/secrets.h> #include <wiretap/secrets-types.h> void proto_reg_handoff_wg(void); void proto_register_wg(void); static int proto_wg = -1; static int hf_wg_type = -1; static int hf_wg_reserved = -1; static int hf_wg_sender = -1; static int hf_wg_ephemeral = -1; static int hf_wg_encrypted_static = -1; static int hf_wg_static = -1; static int hf_wg_encrypted_timestamp = -1; static int hf_wg_timestamp_tai64_label = -1; static int hf_wg_timestamp_nanoseconds = -1; static int hf_wg_timestamp_value = -1; static int hf_wg_mac1 = -1; static int hf_wg_mac2 = -1; static int hf_wg_receiver = -1; static int hf_wg_encrypted_empty = -1; static int hf_wg_handshake_ok = -1; static int hf_wg_nonce = -1; static int hf_wg_encrypted_cookie = -1; static int hf_wg_counter = -1; static int hf_wg_encrypted_packet = -1; static int hf_wg_stream = -1; static int hf_wg_response_in = -1; static int hf_wg_response_to = -1; static int hf_wg_receiver_pubkey = -1; static int hf_wg_receiver_pubkey_known_privkey = -1; static int hf_wg_ephemeral_known_privkey = -1; static int hf_wg_static_known_pubkey = -1; static int hf_wg_static_known_privkey = -1; static gint ett_wg = -1; static gint ett_timestamp = -1; static gint ett_key_info = -1; static expert_field ei_wg_bad_packet_length = EI_INIT; static expert_field ei_wg_keepalive = EI_INIT; static expert_field ei_wg_decryption_error = EI_INIT; static gboolean pref_dissect_packet = TRUE; static const char *pref_keylog_file; static dissector_handle_t ip_handle; static dissector_handle_t wg_handle; // Length of AEAD authentication tag #define AUTH_TAG_LENGTH 16 typedef enum { WG_TYPE_HANDSHAKE_INITIATION = 1, WG_TYPE_HANDSHAKE_RESPONSE = 2, WG_TYPE_COOKIE_REPLY = 3, WG_TYPE_TRANSPORT_DATA = 4 } wg_message_type; static const value_string wg_type_names[] = { { 0x01, "Handshake Initiation" }, { 0x02, "Handshake Response" }, { 0x03, "Cookie Reply" }, { 0x04, "Transport Data" }, { 0x00, NULL } }; /* Decryption types. {{{ */ /* * Most operations operate on 32 byte units (keys and hash output). */ typedef struct { #define WG_KEY_LEN 32 guchar data[WG_KEY_LEN]; } wg_qqword; /* * Static key with the MAC1 key pre-computed and an optional private key. */ typedef struct wg_skey { wg_qqword pub_key; wg_qqword mac1_key; wg_qqword priv_key; /* Optional, set to all zeroes if missing. */ } wg_skey_t; /* * Pre-shared key, needed while processing the handshake response message. At * that point, ephemeral keys (from either the initiator or responder) should be * known. Thus link the PSK to such ephemeral keys. * * Usually a "wg_ekey_t" contains an empty list (if there is no PSK, i.e. an * all-zeroes PSK) or one item (if a PSK is configured). In the unlikely event * that an ephemeral key is reused, support more than one PSK. */ typedef struct wg_psk { wg_qqword psk_data; struct wg_psk *next; } wg_psk_t; /* * Ephemeral key. */ typedef struct wg_ekey { wg_qqword pub_key; wg_qqword priv_key; /* Optional, set to all zeroes if missing. */ wg_psk_t *psk_list; /* Optional, possible PSKs to try. */ } wg_ekey_t; /* * Set of (long-term) static keys (for guessing the peer based on MAC1). * Maps the public key to the "wg_skey_t" structure. * Keys are populated from the UAT and key log file. */ static GHashTable *wg_static_keys = NULL; /* * Set of ephemeral keys (for decryption). Maps the public key to the * "wg_ekey_t" structure. The private key MUST be available. * Keys are populated from the key log file and wmem_file_scope allocated. */ static wmem_map_t *wg_ephemeral_keys; /* * Key log file handle. Opened on demand (when keys are actually looked up), * closed when the capture file closes. */ static FILE *wg_keylog_file; /* * The most recently parsed ephemeral key. If a PSK is configured, the key log * file must have a PSK line after other keys. If not, then it is assumed that * the session does not use a PSK. * * This pointer is cleared when the key log file is reset (i.e. when the capture * file closes). */ static wg_ekey_t *wg_keylog_last_ekey; enum wg_psk_iter_state { WG_PSK_ITER_STATE_ENTER = 0, WG_PSK_ITER_STATE_INITIATOR, WG_PSK_ITER_STATE_RESPONDER, WG_PSK_ITER_STATE_EXIT }; /* See wg_psk_iter_next. */ typedef struct { enum wg_psk_iter_state state; wg_psk_t *next_psk; } wg_psk_iter_context; /* UAT adapter for populating wg_static_keys. */ enum { WG_KEY_UAT_PUBLIC, WG_KEY_UAT_PRIVATE }; static const value_string wg_key_uat_type_vals[] = { { WG_KEY_UAT_PUBLIC, "Public" }, { WG_KEY_UAT_PRIVATE, "Private" }, { 0, NULL } }; typedef struct { guint key_type; /* See "wg_key_uat_type_vals". */ char *key; } wg_key_uat_record_t; static wg_key_uat_record_t *wg_key_records; static guint num_wg_key_records; /* * Input keying material for key derivation/decryption during the handshake. * For the Initiation message, Spub_r and either Spriv_r or Epriv_i must be set. * For the Response message, Epriv_r + Spriv_r or Epriv_r + Epub_i. * * The static and ephemeral keys are reset upon UAT changes or are invalidated * when the capture file closes. */ typedef struct { const wg_skey_t *initiator_skey; /* Spub_i based on Initiation.static (decrypted, null if decryption failed) */ const wg_skey_t *responder_skey; /* Spub_r based on Initiation.MAC1 (+Spriv_r if available) */ guint8 timestamp[12]; /* Initiation.timestamp (decrypted) */ bool timestamp_ok : 1; /* Whether the timestamp was successfully decrypted */ bool empty_ok : 1; /* Whether the empty field was successfully decrypted */ /* The following fields are only valid on the initial pass. */ const wg_ekey_t *initiator_ekey; /* Epub_i matching Initiation.Ephemeral (+Epriv_i if available) */ const wg_ekey_t *responder_ekey; /* Epub_r matching Response.Ephemeral (+Epriv_r if available) */ wg_qqword handshake_hash; /* Handshake hash H_i */ wg_qqword chaining_key; /* Chaining key C_i */ /* Transport ciphers. */ gcry_cipher_hd_t initiator_recv_cipher; gcry_cipher_hd_t responder_recv_cipher; } wg_handshake_state_t; /** Hash(CONSTRUCTION), initialized by wg_decrypt_init. */ static wg_qqword hash_of_construction; /** Hash(Hash(CONSTRUCTION) || IDENTIFIER), initialized by wg_decrypt_init. */ static wg_qqword hash_of_c_identifier; /* Decryption types. }}} */ /* * Information required to process and link messages as required on the first * sequential pass. After that it can be erased. */ typedef struct { address initiator_address; address responder_address; guint16 initiator_port; guint16 responder_port; } wg_initial_info_t; /* * A "session" between two peer is identified by a "sender" id as independently * chosen by each side. In case both peer IDs collide, the source IP and UDP * port number could be used to distinguish sessions. As IDs can be recycled * over time, lookups should use the most recent initiation (or response). * * XXX record timestamps (time since last message, for validating timers). */ typedef struct { guint32 stream; /* Session identifier (akin to udp.stream). */ guint32 initiator_frame; guint32 response_frame; /* Responder or Cookie Reply message. */ wg_initial_info_t initial; /* Valid only on the first pass. */ wg_handshake_state_t *hs; /* Handshake state to enable decryption. */ } wg_session_t; /* Per-packet state. */ typedef struct { wg_session_t *session; gboolean receiver_is_initiator; /* Whether this transport data packet is sent to an Initiator. */ } wg_packet_info_t; /* Map from Sender/Receiver IDs to a list of session information. */ static wmem_map_t *sessions; static guint32 wg_session_count; /* Key conversion routines. {{{ */ /* Import external random data as private key. */ static void set_private_key(wg_qqword *privkey, const wg_qqword *inkey) { // The 254th bit of a Curve25519 secret will always be set in calculations, // use this property to recognize whether a private key is set. *privkey = *inkey; privkey->data[31] |= 64; } /* Whether a private key is initialized (see set_private_key). */ static inline gboolean has_private_key(const wg_qqword *secret) { return !!(secret->data[31] & 64); } /** * Compute the Curve25519 public key from a private key. */ static void priv_to_pub(wg_qqword *pub, const wg_qqword *priv) { int r = crypto_scalarmult_curve25519_base(pub->data, priv->data); /* The computation should always be possible. */ DISSECTOR_ASSERT(r == 0); } static void dh_x25519(wg_qqword *shared_secret, const wg_qqword *priv, const wg_qqword *pub) { /* * If the point ("pub") is of small order, of if the result is all zeros, -1 * could be returned with Sodium. We are just interpreting the trace, so * just ignore the condition for now. */ (void)crypto_scalarmult_curve25519(shared_secret->data, priv->data, pub->data); } /* * Returns the string representation (base64) of a public key. * The returned value is allocated with wmem_packet_scope. */ static const char * pubkey_to_string(const wg_qqword *pubkey) { gchar *str = g_base64_encode(pubkey->data, WG_KEY_LEN); gchar *ret = wmem_strdup(wmem_packet_scope(), str); g_free(str); return ret; } static gboolean decode_base64_key(wg_qqword *out, const char *str) { gsize out_len; gchar tmp[45]; if (strlen(str) + 1 != sizeof(tmp)) { return FALSE; } memcpy(tmp, str, sizeof(tmp)); g_base64_decode_inplace(tmp, &out_len); if (out_len != WG_KEY_LEN) { return FALSE; } memcpy(out->data, tmp, WG_KEY_LEN); return TRUE; } /* Key conversion routines. }}} */ static gboolean wg_pubkey_equal(gconstpointer v1, gconstpointer v2) { const wg_qqword *pubkey1 = (const wg_qqword *)v1; const wg_qqword *pubkey2 = (const wg_qqword *)v2; return !memcmp(pubkey1->data, pubkey2->data, WG_KEY_LEN); } /* Protocol-specific crypto routines. {{{ */ /** * Computes MAC1. Caller must ensure that GCRY_MD_BLAKE2S_256 is available. */ static void wg_mac1_key(const wg_qqword *static_public, wg_qqword *mac_key_out) { gcry_md_hd_t hd; if (gcry_md_open(&hd, GCRY_MD_BLAKE2S_256, 0) == 0) { const char wg_label_mac1[] = "mac1----"; gcry_md_write(hd, wg_label_mac1, strlen(wg_label_mac1)); gcry_md_write(hd, static_public->data, sizeof(wg_qqword)); memcpy(mac_key_out->data, gcry_md_read(hd, 0), sizeof(wg_qqword)); gcry_md_close(hd); return; } // caller should have checked this. DISSECTOR_ASSERT_NOT_REACHED(); } /* * Verify that MAC(mac_key, data) matches "mac_output". */ static gboolean wg_mac_verify(const wg_qqword *mac_key, const guchar *data, guint data_len, const guint8 mac_output[16]) { gboolean ok = FALSE; gcry_md_hd_t hd; if (gcry_md_open(&hd, GCRY_MD_BLAKE2S_128, 0) == 0) { gcry_error_t r; // not documented by Libgcrypt, but required for keyed blake2s r = gcry_md_setkey(hd, mac_key->data, WG_KEY_LEN); DISSECTOR_ASSERT(r == 0); gcry_md_write(hd, data, data_len); ok = memcmp(mac_output, gcry_md_read(hd, 0), 16) == 0; gcry_md_close(hd); } else { // caller should have checked this. DISSECTOR_ASSERT_NOT_REACHED(); } return ok; } /** * Update the new chained hash value: h = Hash(h || data). */ static void wg_mix_hash(wg_qqword *h, const void *data, size_t data_len) { gcry_md_hd_t hd; if (gcry_md_open(&hd, GCRY_MD_BLAKE2S_256, 0)) { DISSECTOR_ASSERT_NOT_REACHED(); } gcry_md_write(hd, h->data, sizeof(wg_qqword)); gcry_md_write(hd, data, data_len); memcpy(h, gcry_md_read(hd, 0), sizeof(wg_qqword)); gcry_md_close(hd); } /** * Computes KDF_n(key, input) where n is the number of derived keys. */ static void wg_kdf(const wg_qqword *key, const guint8 *input, guint input_len, guint n, wg_qqword *out) { guint8 prk[32]; /* Blake2s_256 hash output. */ gcry_error_t err; err = hkdf_extract(GCRY_MD_BLAKE2S_256, key->data, sizeof(wg_qqword), input, input_len, prk); DISSECTOR_ASSERT(err == 0); err = hkdf_expand(GCRY_MD_BLAKE2S_256, prk, sizeof(prk), NULL, 0, out->data, 32 * n); DISSECTOR_ASSERT(err == 0); } /* * Must be called before attempting decryption. */ static gboolean wg_decrypt_init(void) { if (gcry_md_test_algo(GCRY_MD_BLAKE2S_128) != 0 || gcry_md_test_algo(GCRY_MD_BLAKE2S_256) != 0 || gcry_cipher_test_algo(GCRY_CIPHER_CHACHA20) != 0) { return FALSE; } static const char construction[] = "Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s"; gcry_md_hash_buffer(GCRY_MD_BLAKE2S_256, hash_of_construction.data, construction, strlen(construction)); static const char wg_identifier[] = "WireGuard v1 zx2c4 [email protected]"; memcpy(&hash_of_c_identifier, hash_of_construction.data, sizeof(wg_qqword)); wg_mix_hash(&hash_of_c_identifier, wg_identifier, strlen(wg_identifier)); return TRUE; } static gcry_cipher_hd_t wg_create_cipher(const wg_qqword *key) { gcry_cipher_hd_t hd; if (gcry_cipher_open(&hd, GCRY_CIPHER_CHACHA20, GCRY_CIPHER_MODE_POLY1305, 0)) { return NULL; } if (gcry_cipher_setkey(hd, key->data, sizeof(*key))) { gcry_cipher_close(hd); hd = NULL; } return hd; } static bool wg_handshake_state_destroy_cb(wmem_allocator_t *allocator _U_, wmem_cb_event_t event _U_, void *user_data) { wg_handshake_state_t *hs = (wg_handshake_state_t *)user_data; if (hs->initiator_recv_cipher) { gcry_cipher_close(hs->initiator_recv_cipher); hs->initiator_recv_cipher = NULL; } if (hs->responder_recv_cipher) { gcry_cipher_close(hs->responder_recv_cipher); hs->responder_recv_cipher = NULL; } return FALSE; } /* * Decrypt ciphertext using the ChaCha20-Poly1305 cipher. The auth tag must be * included with the ciphertext. */ static gboolean wg_aead_decrypt(gcry_cipher_hd_t hd, guint64 counter, const guchar *ctext, guint ctext_len, const guchar *aad, guint aad_len, guchar *out, guint out_len) { DISSECTOR_ASSERT(ctext_len >= AUTH_TAG_LENGTH); ctext_len -= AUTH_TAG_LENGTH; const guchar *auth_tag = ctext + ctext_len; counter = GUINT64_TO_LE(counter); guchar nonce[12] = { 0 }; memcpy(nonce + 4, &counter, 8); return gcry_cipher_setiv(hd, nonce, sizeof(nonce)) == 0 && gcry_cipher_authenticate(hd, aad, aad_len) == 0 && gcry_cipher_decrypt(hd, out, out_len, ctext, ctext_len) == 0 && gcry_cipher_checktag(hd, auth_tag, AUTH_TAG_LENGTH) == 0; } /** * Decrypt ciphertext using the ChaCha20-Poly1305 cipher. The auth tag must be * included with the ciphertext. */ static gboolean aead_decrypt(const wg_qqword *key, guint64 counter, const guchar *ctext, guint ctext_len, const guchar *aad, guint aad_len, guchar *out, guint out_len) { DISSECTOR_ASSERT(ctext_len >= AUTH_TAG_LENGTH); gcry_cipher_hd_t hd = wg_create_cipher(key); DISSECTOR_ASSERT(hd); gboolean ok = wg_aead_decrypt(hd, counter, ctext, ctext_len, aad, aad_len, out, out_len); gcry_cipher_close(hd); return ok; } /* Protocol-specific crypto routines. }}} */ /* * Add a static public or private key to "wg_static_keys". */ static void wg_add_static_key(const wg_qqword *tmp_key, gboolean is_private) { wg_skey_t *key = g_new0(wg_skey_t, 1); if (is_private) { set_private_key(&key->priv_key, tmp_key); priv_to_pub(&key->pub_key, tmp_key); } else { key->pub_key = *tmp_key; } // If a previous pubkey exists, skip adding the new key. Do add the // secret if it has become known in meantime. wg_skey_t *oldkey = (wg_skey_t *)g_hash_table_lookup(wg_static_keys, &key->pub_key); if (oldkey) { if (!has_private_key(&oldkey->priv_key) && is_private) { oldkey->priv_key = key->priv_key; } g_free(key); return; } // New key, precompute the MAC1 label. wg_mac1_key(&key->pub_key, &key->mac1_key); g_hash_table_insert(wg_static_keys, &key->pub_key, key); } /** * Stores the given ephemeral private key. */ static wg_ekey_t * wg_add_ephemeral_privkey(const wg_qqword *priv_key) { wg_qqword pub_key; priv_to_pub(&pub_key, priv_key); wg_ekey_t *key = (wg_ekey_t *)wmem_map_lookup(wg_ephemeral_keys, &pub_key); if (!key) { key = wmem_new0(wmem_file_scope(), wg_ekey_t); key->pub_key = pub_key; set_private_key(&key->priv_key, priv_key); wmem_map_insert(wg_ephemeral_keys, &key->pub_key, key); } return key; } /* PSK handling. {{{ */ static void wg_add_psk(wg_ekey_t *ekey, const wg_qqword *psk) { wg_psk_t *psk_entry = wmem_new0(wmem_file_scope(), wg_psk_t); psk_entry->psk_data = *psk; psk_entry->next = ekey->psk_list; ekey->psk_list = psk_entry; } /* * Retrieves the next PSK to try and returns TRUE if one is found or FALSE if * there are no more to try. */ static gboolean wg_psk_iter_next(wg_psk_iter_context *psk_iter, const wg_handshake_state_t *hs, wg_qqword *psk_out) { wg_psk_t *psk = psk_iter->next_psk; while (!psk) { /* * Yield PSKs based on Epub_i, then those based on Epub_r, then yield an * all-zeroes key and finally fail in the terminating state. */ switch (psk_iter->state) { case WG_PSK_ITER_STATE_ENTER: psk = hs->initiator_ekey->psk_list; psk_iter->state = WG_PSK_ITER_STATE_INITIATOR; break; case WG_PSK_ITER_STATE_INITIATOR: psk = hs->responder_ekey->psk_list; psk_iter->state = WG_PSK_ITER_STATE_RESPONDER; break; case WG_PSK_ITER_STATE_RESPONDER: memset(psk_out->data, 0, WG_KEY_LEN); psk_iter->state = WG_PSK_ITER_STATE_EXIT; return TRUE; case WG_PSK_ITER_STATE_EXIT: return FALSE; } } *psk_out = psk->psk_data; psk_iter->next_psk = psk->next; return TRUE; } /* PSK handling. }}} */ /* UAT and key configuration. {{{ */ static void wg_keylog_reset(void) { if (wg_keylog_file) { fclose(wg_keylog_file); wg_keylog_file = NULL; wg_keylog_last_ekey = NULL; } } static void wg_keylog_process_lines(const void *data, guint datalen); static void wg_keylog_read(void) { if (!pref_keylog_file || !*pref_keylog_file) { return; } // Reopen file if it got deleted/overwritten. if (wg_keylog_file && file_needs_reopen(ws_fileno(wg_keylog_file), pref_keylog_file)) { ws_debug("Key log file got changed or deleted, trying to re-open."); wg_keylog_reset(); } if (!wg_keylog_file) { wg_keylog_file = ws_fopen(pref_keylog_file, "r"); if (!wg_keylog_file) { ws_debug("Failed to open key log file %s: %s", pref_keylog_file, g_strerror(errno)); return; } ws_debug("Opened key log file %s", pref_keylog_file); } /* File format: each line follows the format "<type>=<key>" (leading spaces * and spaces around '=' as produced by extract-handshakes.sh are ignored). * For available <type>s, see below. <key> is the base64-encoded key (44 * characters). * * Example: * LOCAL_STATIC_PRIVATE_KEY = AKeZaHwBxjiKLFnkY2unvEdOTtg4AL+M9dQXfopFVFk= * REMOTE_STATIC_PUBLIC_KEY = YDCttCs9e1J52/g9vEnwJJa+2x6RqaayAYMpSVQfGEY= * LOCAL_EPHEMERAL_PRIVATE_KEY = sLGLJSOQfyz7JNJ5ZDzFf3Uz1rkiCMMjbWerNYcPFFU= * PRESHARED_KEY = AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= */ for (;;) { char buf[512]; if (!fgets(buf, sizeof(buf), wg_keylog_file)) { if (feof(wg_keylog_file)) { clearerr(wg_keylog_file); } else if (ferror(wg_keylog_file)) { ws_debug("Error while reading %s, closing it.", pref_keylog_file); wg_keylog_reset(); } break; } wg_keylog_process_lines((const guint8 *)buf, (guint)strlen(buf)); } } static void wg_keylog_process_lines(const void *data, guint datalen) { const char *next_line = (const char *)data; const char *line_end = next_line + datalen; while (next_line && next_line < line_end) { /* Note: line is NOT nul-terminated. */ const char *line = next_line; next_line = (const char *)memchr(line, '\n', line_end - line); gssize linelen; if (next_line) { linelen = next_line - line; next_line++; /* drop LF */ } else { linelen = (gssize)(line_end - line); } if (linelen > 0 && line[linelen - 1] == '\r') { linelen--; /* drop CR */ } ws_debug("Read WG key log line: %.*s", (int)linelen, line); /* Strip leading spaces. */ const char *p = line; while (p < line_end && *p == ' ') { ++p; } char key_type[sizeof("LOCAL_EPHEMERAL_PRIVATE_KEY")]; char key_value[45] = { 0 }; const char *p0 = p; p = (const char *)memchr(p0, '=', line_end - p); if (p && p0 != p) { /* Extract "key-type" from "key-type = key-value" */ gsize key_type_len = p - p0; while (key_type_len && p0[key_type_len - 1] == ' ') { --key_type_len; } if (key_type_len && key_type_len < sizeof(key_type)) { memcpy(key_type, p0, key_type_len); key_type[key_type_len] = '\0'; /* Skip '=' and any spaces. */ p = p + 1; while (p < line_end && *p == ' ') { ++p; } gsize key_value_len = (line + linelen) - p; if (key_value_len && key_value_len < sizeof(key_value)) { memcpy(key_value, p, key_value_len); } } } wg_qqword key; if (!key_value[0] || !decode_base64_key(&key, key_value)) { ws_debug("Unrecognized key log line: %.*s", (int)linelen, line); continue; } if (!strcmp(key_type, "LOCAL_STATIC_PRIVATE_KEY")) { wg_add_static_key(&key, TRUE); } else if (!strcmp(key_type, "REMOTE_STATIC_PUBLIC_KEY")) { wg_add_static_key(&key, FALSE); } else if (!strcmp(key_type, "LOCAL_EPHEMERAL_PRIVATE_KEY")) { wg_keylog_last_ekey = wg_add_ephemeral_privkey(&key); } else if (!strcmp(key_type, "PRESHARED_KEY")) { /* Link the PSK to the last ephemeral key. */ if (wg_keylog_last_ekey) { wg_add_psk(wg_keylog_last_ekey, &key); wg_keylog_last_ekey = NULL; } else { ws_debug("Ignored PSK as no new ephemeral key was found"); } } else { ws_debug("Unrecognized key log line: %.*s", (int)linelen, line); } } } static void* wg_key_uat_record_copy_cb(void *dest, const void *source, size_t len _U_) { const wg_key_uat_record_t* o = (const wg_key_uat_record_t*)source; wg_key_uat_record_t* d = (wg_key_uat_record_t*)dest; d->key_type = o->key_type; d->key = g_strdup(o->key); return dest; } static gboolean wg_key_uat_record_update_cb(void *r, char **error) { wg_key_uat_record_t *rec = (wg_key_uat_record_t *)r; wg_qqword key; /* Check for valid base64-encoding. */ if (!decode_base64_key(&key, rec->key)) { *error = g_strdup("Invalid key"); return FALSE; } return TRUE; } static void wg_key_uat_record_free_cb(void *r) { wg_key_uat_record_t *rec = (wg_key_uat_record_t *)r; g_free(rec->key); } static void wg_key_uat_apply(void) { if (!wg_static_keys) { // The first field of "wg_skey_t" is the pubkey (and the table key), // its initial four bytes should be good enough as key hash. wg_static_keys = g_hash_table_new_full(g_int_hash, wg_pubkey_equal, NULL, g_free); } else { g_hash_table_remove_all(wg_static_keys); } // As static keys from the key log file also end up in "wg_static_keys", // reset the file pointer such that it will be fully read later. wg_keylog_reset(); /* Convert base64-encoded strings to wg_skey_t and derive pubkey. */ for (guint i = 0; i < num_wg_key_records; i++) { wg_key_uat_record_t *rec = &wg_key_records[i]; wg_qqword tmp_key; /* Either public or private, not sure yet. */ /* Populate public (and private) keys. */ gboolean decoded = decode_base64_key(&tmp_key, rec->key); DISSECTOR_ASSERT(decoded); wg_add_static_key(&tmp_key, rec->key_type == WG_KEY_UAT_PRIVATE); } } static void wg_key_uat_reset(void) { /* Erase keys when the UAT is unloaded. */ if (wg_static_keys != NULL) { g_hash_table_destroy(wg_static_keys); wg_static_keys = NULL; } } UAT_VS_DEF(wg_key_uat, key_type, wg_key_uat_record_t, guint, WG_KEY_UAT_PUBLIC, "Public") UAT_CSTRING_CB_DEF(wg_key_uat, key, wg_key_uat_record_t) /* UAT and key configuration. }}} */ /** * Tries to decrypt the initiation message. * Assumes responder_skey and initiator_ekey to be set. */ static void wg_process_initiation(tvbuff_t *tvb, wg_handshake_state_t *hs) { DISSECTOR_ASSERT(hs->responder_skey); DISSECTOR_ASSERT(hs->initiator_ekey); DISSECTOR_ASSERT(hs->initiator_skey == NULL); wg_qqword decrypted_static = {{ 0 }}; const gboolean has_Spriv_r = has_private_key(&hs->responder_skey->priv_key); const gboolean has_Epriv_i = has_private_key(&hs->initiator_ekey->priv_key); // Either Spriv_r or Epriv_i + Spriv_i are needed. If the first two are not // available, fail early. Spriv_i will be looked up later. if (!has_Spriv_r && !has_Epriv_i) { return; } const wg_qqword *ephemeral = (const wg_qqword *)tvb_get_ptr(tvb, 8, WG_KEY_LEN); #define WG_ENCRYPTED_STATIC_LENGTH (32 + AUTH_TAG_LENGTH) const guint8 *encrypted_static = (const guint8 *)tvb_get_ptr(tvb, 40, WG_ENCRYPTED_STATIC_LENGTH); #define WG_ENCRYPTED_TIMESTAMP_LENGTH (12 + AUTH_TAG_LENGTH) const guint8 *encrypted_timestamp = (const guint8 *)tvb_get_ptr(tvb, 88, WG_ENCRYPTED_TIMESTAMP_LENGTH); wg_qqword c_and_k[2], h; wg_qqword *c = &c_and_k[0], *k = &c_and_k[1]; // c = Hash(CONSTRUCTION) memcpy(c->data, hash_of_construction.data, sizeof(wg_qqword)); // h = Hash(c || IDENTIFIER) memcpy(h.data, hash_of_c_identifier.data, sizeof(wg_qqword)); // h = Hash(h || Spub_r) wg_mix_hash(&h, hs->responder_skey->pub_key.data, sizeof(wg_qqword)); // c = KDF1(c, msg.ephemeral) wg_kdf(c, ephemeral->data, WG_KEY_LEN, 1, c); // h = Hash(h || msg.ephemeral) wg_mix_hash(&h, ephemeral, WG_KEY_LEN); // dh1 = DH(Spriv_r, msg.ephemeral) if kType = R // dh1 = DH(Epriv_i, Spub_r) if kType = I wg_qqword dh1 = {{ 0 }}; if (has_Spriv_r) { dh_x25519(&dh1, &hs->responder_skey->priv_key, ephemeral); } else { dh_x25519(&dh1, &hs->initiator_ekey->priv_key, &hs->responder_skey->pub_key); } // (c, k) = KDF2(c, dh1) wg_kdf(c, dh1.data, sizeof(dh1), 2, c_and_k); // Spub_i = AEAD-Decrypt(k, 0, msg.static, h) if (!aead_decrypt(k, 0, encrypted_static, WG_ENCRYPTED_STATIC_LENGTH, h.data, sizeof(wg_qqword), decrypted_static.data, sizeof(decrypted_static))) { return; } // Save static public key to the context and lookup private key if possible. wg_skey_t *skey_i = (wg_skey_t *)g_hash_table_lookup(wg_static_keys, &decrypted_static); if (!skey_i) { skey_i = wmem_new0(wmem_file_scope(), wg_skey_t); skey_i->pub_key = decrypted_static; } hs->initiator_skey = skey_i; // If Spriv_r is not available, then Epriv_i + Spriv_i must be available. if (!has_Spriv_r && !has_private_key(&hs->initiator_skey->priv_key)) { return; } // h = Hash(h || msg.static) wg_mix_hash(&h, encrypted_static, WG_ENCRYPTED_STATIC_LENGTH); // dh2 = DH(Spriv_r, Spub_i) if kType = R // dh2 = DH(Spriv_i, Spub_r) if kType = I wg_qqword dh2 = {{ 0 }}; if (has_Spriv_r) { dh_x25519(&dh2, &hs->responder_skey->priv_key, &hs->initiator_skey->pub_key); } else { dh_x25519(&dh2, &hs->initiator_skey->priv_key, &hs->responder_skey->pub_key); } // (c, k) = KDF2(c, dh2) wg_kdf(c, dh2.data, sizeof(wg_qqword), 2, c_and_k); // timestamp = AEAD-Decrypt(k, 0, msg.timestamp, h) if (!aead_decrypt(k, 0, encrypted_timestamp, WG_ENCRYPTED_TIMESTAMP_LENGTH, h.data, sizeof(wg_qqword), hs->timestamp, sizeof(hs->timestamp))) { return; } hs->timestamp_ok = TRUE; // h = Hash(h || msg.timestamp) wg_mix_hash(&h, encrypted_timestamp, WG_ENCRYPTED_TIMESTAMP_LENGTH); // save (h, k) context for responder message processing hs->handshake_hash = h; hs->chaining_key = *c; } static void wg_process_response(tvbuff_t *tvb, wg_handshake_state_t *hs) { DISSECTOR_ASSERT(hs->initiator_ekey); DISSECTOR_ASSERT(hs->initiator_skey); DISSECTOR_ASSERT(hs->responder_ekey); DISSECTOR_ASSERT(hs->responder_skey); // XXX when multiple responses are linkable to a single handshake state, // they should probably fork into a new state or be discarded when equal. if (hs->initiator_recv_cipher || hs->responder_recv_cipher) { ws_warning("%s FIXME multiple responses linked to a single session", G_STRFUNC); return; } DISSECTOR_ASSERT(!hs->initiator_recv_cipher); DISSECTOR_ASSERT(!hs->responder_recv_cipher); const gboolean has_Epriv_i = has_private_key(&hs->initiator_ekey->priv_key); const gboolean has_Spriv_i = has_private_key(&hs->initiator_skey->priv_key); const gboolean has_Epriv_r = has_private_key(&hs->responder_ekey->priv_key); // Either Epriv_i + Spriv_i or Epriv_r + Epub_i + Spub_i are required. if (!(has_Epriv_i && has_Spriv_i) && !has_Epriv_r) { return; } const wg_qqword *ephemeral = (const wg_qqword *)tvb_get_ptr(tvb, 12, WG_KEY_LEN); const guint8 *encrypted_empty = (const guint8 *)tvb_get_ptr(tvb, 44, AUTH_TAG_LENGTH); wg_qqword ctk[3], h; wg_qqword *c = &ctk[0], *t = &ctk[1], *k = &ctk[2]; h = hs->handshake_hash; *c = hs->chaining_key; // c = KDF1(c, msg.ephemeral) wg_kdf(c, ephemeral->data, WG_KEY_LEN, 1, c); // h = Hash(h || msg.ephemeral) wg_mix_hash(&h, ephemeral, WG_KEY_LEN); // dh1 = DH(Epriv_i, msg.ephemeral) if kType == I // dh1 = DH(Epriv_r, Epub_i) if kType == R wg_qqword dh1; if (has_Epriv_i && has_Spriv_i) { dh_x25519(&dh1, &hs->initiator_ekey->priv_key, ephemeral); } else { dh_x25519(&dh1, &hs->responder_ekey->priv_key, &hs->initiator_ekey->pub_key); } // c = KDF1(c, dh1) wg_kdf(c, dh1.data, sizeof(dh1), 1, c); // dh2 = DH(Spriv_i, msg.ephemeral) if kType == I // dh2 = DH(Epriv_r, Spub_i) if kType == R wg_qqword dh2; if (has_Epriv_i && has_Spriv_i) { dh_x25519(&dh2, &hs->initiator_skey->priv_key, ephemeral); } else { dh_x25519(&dh2, &hs->responder_ekey->priv_key, &hs->initiator_skey->pub_key); } // c = KDF1(c, dh2) wg_kdf(c, dh2.data, sizeof(dh2), 1, c); wg_qqword h_before_psk = h, c_before_psk = *c, psk; wg_psk_iter_context psk_iter = { WG_PSK_ITER_STATE_ENTER, NULL }; while (wg_psk_iter_next(&psk_iter, hs, &psk)) { // c, t, k = KDF3(c, PSK) wg_kdf(c, psk.data, WG_KEY_LEN, 3, ctk); // h = Hash(h || t) wg_mix_hash(&h, t, sizeof(wg_qqword)); // empty = AEAD-Decrypt(k, 0, msg.empty, h) if (!aead_decrypt(k, 0, encrypted_empty, AUTH_TAG_LENGTH, h.data, sizeof(wg_qqword), NULL, 0)) { /* Possibly bad PSK, reset and try another. */ h = h_before_psk; *c = c_before_psk; continue; } hs->empty_ok = TRUE; break; } if (!hs->empty_ok) { return; } // h = Hash(h || msg.empty) wg_mix_hash(&h, encrypted_empty, AUTH_TAG_LENGTH); // Calculate transport keys and create ciphers. // (Tsend_i = Trecv_r, Trecv_i = Tsend_r) = KDF2(C, "") wg_qqword transport_keys[2]; wg_kdf(c, NULL, 0, 2, transport_keys); hs->initiator_recv_cipher = wg_create_cipher(&transport_keys[1]); hs->responder_recv_cipher = wg_create_cipher(&transport_keys[0]); } static void wg_sessions_insert(guint32 id, wg_session_t *session) { wmem_list_t *list = (wmem_list_t *)wmem_map_lookup(sessions, GUINT_TO_POINTER(id)); if (!list) { list = wmem_list_new(wmem_file_scope()); wmem_map_insert(sessions, GUINT_TO_POINTER(id), list); } wmem_list_append(list, session); } static wg_session_t * wg_session_new(void) { wg_session_t *session = wmem_new0(wmem_file_scope(), wg_session_t); session->stream = wg_session_count++; return session; } /* Updates the peer address based on the source address. */ static void wg_session_update_address(wg_session_t *session, packet_info *pinfo, gboolean sender_is_initiator) { DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); if (sender_is_initiator) { copy_address_wmem(wmem_file_scope(), &session->initial.initiator_address, &pinfo->src); session->initial.initiator_port = (guint16)pinfo->srcport; } else { copy_address_wmem(wmem_file_scope(), &session->initial.responder_address, &pinfo->src); session->initial.responder_port = (guint16)pinfo->srcport; } } /* Finds an initiation message based on the given Receiver ID that was not * previously associated with a responder message. Returns the session if a * matching initation message can be found or NULL otherwise. */ static wg_session_t * wg_sessions_lookup_initiation(packet_info *pinfo, guint32 receiver_id) { DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); /* Look for the initiation message matching this Receiver ID. */ wmem_list_t *list = (wmem_list_t *)wmem_map_lookup(sessions, GUINT_TO_POINTER(receiver_id)); if (!list) { return NULL; } /* Walk backwards to find the most recent message first. All packets are * guaranteed to arrive before this frame because this is the first pass. */ for (wmem_list_frame_t *item = wmem_list_tail(list); item; item = wmem_list_frame_prev(item)) { wg_session_t *session = (wg_session_t *)wmem_list_frame_data(item); if (session->initial.initiator_port != pinfo->destport || !addresses_equal(&session->initial.initiator_address, &pinfo->dst)) { /* Responder messages are expected to be sent to the initiator. */ continue; } if (session->response_frame && session->response_frame != pinfo->num) { /* This session was linked elsewhere. */ continue; } /* This assumes no malicious messages and no contrived sequences: * Any initiator or responder message is not duplicated nor are these * mutated. If this must be detected, the caller could decrypt or check * mac1 to distinguish valid messages. */ return session; } return NULL; } /* Finds a session with a completed handshake that matches the Receiver ID. */ static wg_session_t * wg_sessions_lookup(packet_info *pinfo, guint32 receiver_id, gboolean *receiver_is_initiator) { DISSECTOR_ASSERT(!PINFO_FD_VISITED(pinfo)); wmem_list_t *list = (wmem_list_t *)wmem_map_lookup(sessions, GUINT_TO_POINTER(receiver_id)); if (!list) { return NULL; } /* Walk backwards to find the most recent message first. */ for (wmem_list_frame_t *item = wmem_list_tail(list); item; item = wmem_list_frame_prev(item)) { wg_session_t *session = (wg_session_t *)wmem_list_frame_data(item); if (!session->response_frame) { /* Ignore sessions that are not fully established. */ continue; } if (session->initial.initiator_port == pinfo->destport && addresses_equal(&session->initial.initiator_address, &pinfo->dst)) { *receiver_is_initiator = TRUE; } else if (session->initial.responder_port == pinfo->destport && addresses_equal(&session->initial.responder_address, &pinfo->dst)) { *receiver_is_initiator = FALSE; } else { /* Both peers do not match the destination, ignore. */ continue; } return session; } return NULL; } /* * Finds the static public key for the receiver of this message based on the * MAC1 value. * TODO on PINFO_FD_VISITED, reuse previously discovered keys from session? */ static const wg_skey_t * wg_mac1_key_probe(tvbuff_t *tvb, gboolean is_initiation) { const int mac1_offset = is_initiation ? 116 : 60; // Shortcut: skip MAC1 validation if no pubkeys are configured. if (g_hash_table_size(wg_static_keys) == 0) { return NULL; } guint8 *mac1_msgdata = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, mac1_offset); const guint8 *mac1_output = tvb_get_ptr(tvb, mac1_offset, 16); // MAC1 is computed over a message with three reserved bytes set to zero. mac1_msgdata[1] = mac1_msgdata[2] = mac1_msgdata[3] = 0; // Find public key that matches the 16-byte MAC1 field. GHashTableIter iter; gpointer value; g_hash_table_iter_init(&iter, wg_static_keys); while (g_hash_table_iter_next(&iter, NULL, &value)) { const wg_skey_t *skey = (wg_skey_t *)value; if (wg_mac_verify(&skey->mac1_key, mac1_msgdata, (guint)mac1_offset, mac1_output)) { return skey; } } return NULL; } /* * Builds the handshake decryption state when sufficient keying material is * available from the initiation message. */ static wg_handshake_state_t * wg_prepare_handshake_keys(const wg_skey_t *skey_r, tvbuff_t *tvb) { wg_handshake_state_t *hs; gboolean has_r_keys = skey_r && has_private_key(&skey_r->priv_key); wg_ekey_t *ekey_i = (wg_ekey_t *)wmem_map_lookup(wg_ephemeral_keys, tvb_get_ptr(tvb, 8, WG_KEY_LEN)); // If neither private keys are available, do not create a session. if (!has_r_keys && !ekey_i) { return NULL; } // Even if Spriv_r is available, store Epub_i for Response decryption. if (!ekey_i) { ekey_i = wmem_new0(wmem_file_scope(), wg_ekey_t); tvb_memcpy(tvb, ekey_i->pub_key.data, 8, WG_KEY_LEN); } hs = wmem_new0(wmem_file_scope(), wg_handshake_state_t); hs->responder_skey = skey_r; hs->initiator_ekey = ekey_i; wmem_register_callback(wmem_file_scope(), wg_handshake_state_destroy_cb, hs); return hs; } /* * Processes a Response message, storing additional keys in the state. */ static void wg_prepare_handshake_responder_keys(wg_handshake_state_t *hs, tvbuff_t *tvb) { wg_ekey_t *ekey_r = (wg_ekey_t *)wmem_map_lookup(wg_ephemeral_keys, tvb_get_ptr(tvb, 12, WG_KEY_LEN)); // Response decryption needs Epriv_r (or Epub_r + additional secrets). if (!ekey_r) { ekey_r = wmem_new0(wmem_file_scope(), wg_ekey_t); tvb_memcpy(tvb, ekey_r->pub_key.data, 12, WG_KEY_LEN); } hs->responder_ekey = ekey_r; } /* Converts a TAI64 label to the seconds since the Unix epoch. * See https://cr.yp.to/libtai/tai64.html */ static gboolean tai64n_to_unix(guint64 tai64_label, guint32 nanoseconds, nstime_t *nstime) { const guint64 pow2_62 = 1ULL << 62; if (tai64_label < pow2_62 || tai64_label >= (1ULL << 63) || nanoseconds > 999999999) { // Seconds before 1970 and values larger than 2^63 (reserved) cannot // be represented. Nanoseconds must also be valid. return FALSE; } // TODO this can result in loss of precision nstime->secs = (time_t)(tai64_label - pow2_62); nstime->nsecs = (int)nanoseconds; return TRUE; } static void wg_dissect_key_extra(proto_tree *tree, tvbuff_t *tvb, const wg_qqword *pubkey, gboolean is_ephemeral) { guint32 has_private = FALSE; proto_item *ti; if (is_ephemeral) { wg_ekey_t *ekey = (wg_ekey_t *)wmem_map_lookup(wg_ephemeral_keys, pubkey->data); has_private = ekey && has_private_key(&ekey->priv_key); } else { wg_skey_t *skey = (wg_skey_t *)g_hash_table_lookup(wg_static_keys, pubkey->data); has_private = skey && has_private_key(&skey->priv_key); ti = proto_tree_add_boolean(tree, hf_wg_static_known_pubkey, tvb, 0, 0, !!skey); proto_item_set_generated(ti); } int hf_known_privkey = is_ephemeral ? hf_wg_ephemeral_known_privkey : hf_wg_static_known_privkey; ti = proto_tree_add_boolean(tree, hf_known_privkey, tvb, 0, 0, has_private); proto_item_set_generated(ti); } static void wg_dissect_pubkey(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean is_ephemeral) { const guint8 *pubkey = tvb_get_ptr(tvb, offset, 32); gchar *str = g_base64_encode(pubkey, 32); gchar *key_str = wmem_strdup(wmem_packet_scope(), str); g_free(str); int hf_id = is_ephemeral ? hf_wg_ephemeral : hf_wg_static; proto_item *ti = proto_tree_add_string(tree, hf_id, tvb, offset, 32, key_str); proto_tree *key_tree = proto_item_add_subtree(ti, ett_key_info); wg_dissect_key_extra(key_tree, tvb, (const wg_qqword *)pubkey, is_ephemeral); } static void wg_dissect_decrypted_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_handshake_state_t *hs) { tvbuff_t *new_tvb; if (!hs || !hs->initiator_skey) { return; } new_tvb = tvb_new_child_real_data(tvb, hs->initiator_skey->pub_key.data, WG_KEY_LEN, WG_KEY_LEN); add_new_data_source(pinfo, new_tvb, "Decrypted Static"); wg_dissect_pubkey(wg_tree, new_tvb, 0, FALSE); } static void wg_dissect_decrypted_timestamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, wg_handshake_state_t *hs) { guint64 tai64_label; guint32 nanoseconds; nstime_t nstime; proto_item *ti; tvbuff_t *new_tvb; if (!hs || !hs->timestamp_ok) { return; } new_tvb = tvb_new_child_real_data(tvb, hs->timestamp, sizeof(hs->timestamp), sizeof(hs->timestamp)); add_new_data_source(pinfo, new_tvb, "Decrypted Timestamp"); tai64_label = tvb_get_guint64(new_tvb, 0, ENC_BIG_ENDIAN); nanoseconds = tvb_get_guint32(new_tvb, 8, ENC_BIG_ENDIAN); if (tai64n_to_unix(tai64_label, nanoseconds, &nstime)) { ti = proto_tree_add_time(tree, hf_wg_timestamp_value, new_tvb, 0, 12, &nstime); tree = proto_item_add_subtree(ti, ett_timestamp); } proto_tree_add_item(tree, hf_wg_timestamp_tai64_label, new_tvb, 0, 8, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_wg_timestamp_nanoseconds, new_tvb, 8, 4, ENC_BIG_ENDIAN); } static void wg_dissect_decrypted_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packet_info_t *wg_pinfo, guint64 counter, gint plain_length) { wg_handshake_state_t *hs = wg_pinfo->session->hs; gcry_cipher_hd_t cipher = wg_pinfo->receiver_is_initiator ? hs->initiator_recv_cipher : hs->responder_recv_cipher; if (!cipher) { return; } DISSECTOR_ASSERT(plain_length >= 0); const gint ctext_len = plain_length + AUTH_TAG_LENGTH; const guchar *ctext = tvb_get_ptr(tvb, 16, ctext_len); guchar *plain = (guchar *)wmem_alloc0(pinfo->pool, (guint)plain_length); if (!wg_aead_decrypt(cipher, counter, ctext, (guint)ctext_len, NULL, 0, plain, (guint)plain_length)) { proto_tree_add_expert(wg_tree, pinfo, &ei_wg_decryption_error, tvb, 16, ctext_len); return; } if (plain_length == 0) { return; } tvbuff_t *new_tvb = tvb_new_child_real_data(tvb, plain, (guint)plain_length, plain_length); add_new_data_source(pinfo, new_tvb, "Decrypted Packet"); proto_tree *tree = proto_item_get_parent(wg_tree); if (!pref_dissect_packet) { // (IP packet not shown, preference "Dissect transport data" is disabled) call_data_dissector(new_tvb, pinfo, tree); } else { call_dissector(ip_handle, new_tvb, pinfo, tree); } } static void wg_dissect_mac1_pubkey(proto_tree *tree, tvbuff_t *tvb, const wg_skey_t *skey) { proto_item *ti; if (!skey) { return; } ti = proto_tree_add_string(tree, hf_wg_receiver_pubkey, tvb, 0, 0, pubkey_to_string(&skey->pub_key)); proto_item_set_generated(ti); proto_tree *key_tree = proto_item_add_subtree(ti, ett_key_info); ti = proto_tree_add_boolean(key_tree, hf_wg_receiver_pubkey_known_privkey, tvb, 0, 0, !!has_private_key(&skey->priv_key)); proto_item_set_generated(ti); } static int wg_dissect_handshake_initiation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packet_info_t *wg_pinfo) { guint32 sender_id; proto_item *ti; wg_keylog_read(); const wg_skey_t *skey_r = wg_mac1_key_probe(tvb, TRUE); wg_handshake_state_t *hs = NULL; if (!PINFO_FD_VISITED(pinfo)) { if (skey_r) { hs = wg_prepare_handshake_keys(skey_r, tvb); if (hs) { wg_process_initiation(tvb, hs); } } } else if (wg_pinfo && wg_pinfo->session) { hs = wg_pinfo->session->hs; } proto_tree_add_item_ret_uint(wg_tree, hf_wg_sender, tvb, 4, 4, ENC_LITTLE_ENDIAN, &sender_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", sender=0x%08X", sender_id); wg_dissect_pubkey(wg_tree, tvb, 8, TRUE); proto_tree_add_item(wg_tree, hf_wg_encrypted_static, tvb, 40, 32 + AUTH_TAG_LENGTH, ENC_NA); wg_dissect_decrypted_static(tvb, pinfo, wg_tree, hs); proto_tree_add_item(wg_tree, hf_wg_encrypted_timestamp, tvb, 88, 12 + AUTH_TAG_LENGTH, ENC_NA); wg_dissect_decrypted_timestamp(tvb, pinfo, wg_tree, hs); proto_tree_add_item(wg_tree, hf_wg_mac1, tvb, 116, 16, ENC_NA); wg_dissect_mac1_pubkey(wg_tree, tvb, skey_r); proto_tree_add_item(wg_tree, hf_wg_mac2, tvb, 132, 16, ENC_NA); if (!PINFO_FD_VISITED(pinfo)) { /* XXX should an initiation message with the same contents (except MAC2) be * considered part of the same "session"? */ wg_session_t *session = wg_session_new(); session->initiator_frame = pinfo->num; wg_session_update_address(session, pinfo, TRUE); session->hs = hs; wg_sessions_insert(sender_id, session); wg_pinfo->session = session; } wg_session_t *session = wg_pinfo ? wg_pinfo->session : NULL; if (session) { ti = proto_tree_add_uint(wg_tree, hf_wg_stream, tvb, 0, 0, session->stream); proto_item_set_generated(ti); } if (session && session->response_frame) { ti = proto_tree_add_uint(wg_tree, hf_wg_response_in, tvb, 0, 0, session->response_frame); proto_item_set_generated(ti); } return 148; } static int wg_dissect_handshake_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packet_info_t *wg_pinfo) { guint32 sender_id, receiver_id; proto_item *ti; wg_session_t *session; wg_keylog_read(); const wg_skey_t *skey_i = wg_mac1_key_probe(tvb, FALSE); proto_tree_add_item_ret_uint(wg_tree, hf_wg_sender, tvb, 4, 4, ENC_LITTLE_ENDIAN, &sender_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", sender=0x%08X", sender_id); proto_tree_add_item_ret_uint(wg_tree, hf_wg_receiver, tvb, 8, 4, ENC_LITTLE_ENDIAN, &receiver_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", receiver=0x%08X", receiver_id); if (!PINFO_FD_VISITED(pinfo)) { session = wg_sessions_lookup_initiation(pinfo, receiver_id); if (session && session->hs) { wg_prepare_handshake_responder_keys(session->hs, tvb); wg_process_response(tvb, session->hs); } } else { session = wg_pinfo ? wg_pinfo->session : NULL; } wg_dissect_pubkey(wg_tree, tvb, 12, TRUE); proto_tree_add_item(wg_tree, hf_wg_encrypted_empty, tvb, 44, 16, ENC_NA); if (session && session->hs) { ti = proto_tree_add_boolean(wg_tree, hf_wg_handshake_ok, tvb, 0, 0, !!session->hs->empty_ok); proto_item_set_generated(ti); } proto_tree_add_item(wg_tree, hf_wg_mac1, tvb, 60, 16, ENC_NA); wg_dissect_mac1_pubkey(wg_tree, tvb, skey_i); proto_tree_add_item(wg_tree, hf_wg_mac2, tvb, 76, 16, ENC_NA); if (!PINFO_FD_VISITED(pinfo)) { /* XXX should probably check whether decryption succeeds before linking * and somehow mark that this response is related but not correct. */ if (session) { session->response_frame = pinfo->num; wg_session_update_address(session, pinfo, FALSE); wg_sessions_insert(sender_id, session); wg_pinfo->session = session; } } if (session) { ti = proto_tree_add_uint(wg_tree, hf_wg_stream, tvb, 0, 0, session->stream); proto_item_set_generated(ti); ti = proto_tree_add_uint(wg_tree, hf_wg_response_to, tvb, 0, 0, session->initiator_frame); proto_item_set_generated(ti); } return 92; } static int wg_dissect_handshake_cookie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packet_info_t *wg_pinfo) { guint32 receiver_id; proto_item *ti; proto_tree_add_item_ret_uint(wg_tree, hf_wg_receiver, tvb, 4, 4, ENC_LITTLE_ENDIAN, &receiver_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", receiver=0x%08X", receiver_id); proto_tree_add_item(wg_tree, hf_wg_nonce, tvb, 8, 24, ENC_NA); proto_tree_add_item(wg_tree, hf_wg_encrypted_cookie, tvb, 32, 16 + AUTH_TAG_LENGTH, ENC_NA); wg_session_t *session; if (!PINFO_FD_VISITED(pinfo)) { /* Check for Cookie Reply from Responder to Initiator. */ session = wg_sessions_lookup_initiation(pinfo, receiver_id); if (session) { session->response_frame = pinfo->num; wg_session_update_address(session, pinfo, FALSE); wg_pinfo->session = session; } /* XXX check for cookie reply from Initiator to Responder */ } else { session = wg_pinfo ? wg_pinfo->session : NULL; } if (session) { ti = proto_tree_add_uint(wg_tree, hf_wg_stream, tvb, 0, 0, session->stream); proto_item_set_generated(ti); /* XXX check for cookie reply from Initiator to Responder */ ti = proto_tree_add_uint(wg_tree, hf_wg_response_to, tvb, 0, 0, session->initiator_frame); proto_item_set_generated(ti); } return 64; } static int wg_dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packet_info_t *wg_pinfo) { guint32 receiver_id; guint64 counter; proto_item *ti; proto_tree_add_item_ret_uint(wg_tree, hf_wg_receiver, tvb, 4, 4, ENC_LITTLE_ENDIAN, &receiver_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", receiver=0x%08X", receiver_id); proto_tree_add_item_ret_uint64(wg_tree, hf_wg_counter, tvb, 8, 8, ENC_LITTLE_ENDIAN, &counter); col_append_fstr(pinfo->cinfo, COL_INFO, ", counter=%" PRIu64, counter); gint packet_length = tvb_captured_length_remaining(tvb, 16); if (packet_length < AUTH_TAG_LENGTH) { proto_tree_add_expert(wg_tree, pinfo, &ei_wg_bad_packet_length, tvb, 16, packet_length); return 16 + packet_length; } else if (packet_length != AUTH_TAG_LENGTH) { /* Keepalive messages are already marked, no need to append data length. */ col_append_fstr(pinfo->cinfo, COL_INFO, ", datalen=%d", packet_length - AUTH_TAG_LENGTH); } ti = proto_tree_add_item(wg_tree, hf_wg_encrypted_packet, tvb, 16, packet_length, ENC_NA); if (packet_length == AUTH_TAG_LENGTH) { expert_add_info(pinfo, ti, &ei_wg_keepalive); } wg_session_t *session; if (!PINFO_FD_VISITED(pinfo)) { gboolean receiver_is_initiator; session = wg_sessions_lookup(pinfo, receiver_id, &receiver_is_initiator); if (session) { wg_session_update_address(session, pinfo, !receiver_is_initiator); wg_pinfo->session = session; wg_pinfo->receiver_is_initiator = receiver_is_initiator; } } else { session = wg_pinfo ? wg_pinfo->session : NULL; } if (session) { ti = proto_tree_add_uint(wg_tree, hf_wg_stream, tvb, 0, 0, session->stream); proto_item_set_generated(ti); } if (session && session->hs) { wg_dissect_decrypted_packet(tvb, pinfo, wg_tree, wg_pinfo, counter, packet_length - AUTH_TAG_LENGTH); } return 16 + packet_length; } static gboolean wg_is_valid_message_length(guint8 message_type, guint length) { switch (message_type) { case WG_TYPE_HANDSHAKE_INITIATION: return length == 148; case WG_TYPE_HANDSHAKE_RESPONSE: return length == 92; case WG_TYPE_COOKIE_REPLY: return length == 64; case WG_TYPE_TRANSPORT_DATA: return length >= 32; default: return FALSE; } } static int dissect_wg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *wg_tree; guint32 message_type; const char *message_type_str; wg_packet_info_t *wg_pinfo; message_type = tvb_get_guint8(tvb, 0); message_type_str = try_val_to_str(message_type, wg_type_names); if (!message_type_str) return 0; if (!wg_is_valid_message_length(message_type, tvb_reported_length(tvb))) { return 0; } /* Special case: zero-length data message is a Keepalive message. */ if (message_type == WG_TYPE_TRANSPORT_DATA && tvb_reported_length(tvb) == 32) { message_type_str = "Keepalive"; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "WireGuard"); col_set_str(pinfo->cinfo, COL_INFO, message_type_str); ti = proto_tree_add_item(tree, proto_wg, tvb, 0, -1, ENC_NA); wg_tree = proto_item_add_subtree(ti, ett_wg); proto_tree_add_item(wg_tree, hf_wg_type, tvb, 0, 1, ENC_NA); proto_tree_add_item(wg_tree, hf_wg_reserved, tvb, 1, 3, ENC_NA); if (!PINFO_FD_VISITED(pinfo)) { wg_pinfo = wmem_new0(wmem_file_scope(), wg_packet_info_t); p_add_proto_data(wmem_file_scope(), pinfo, proto_wg, 0, wg_pinfo); } else { /* * Note: this may be NULL if the heuristics dissector sets a * conversation dissector later in the stream, for example due to a new * Handshake Initiation message. Previous messages are potentially * Transport Data messages which might not be detected through * heuristics. */ wg_pinfo = (wg_packet_info_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_wg, 0); } switch ((wg_message_type)message_type) { case WG_TYPE_HANDSHAKE_INITIATION: return wg_dissect_handshake_initiation(tvb, pinfo, wg_tree, wg_pinfo); case WG_TYPE_HANDSHAKE_RESPONSE: return wg_dissect_handshake_response(tvb, pinfo, wg_tree, wg_pinfo); case WG_TYPE_COOKIE_REPLY: return wg_dissect_handshake_cookie(tvb, pinfo, wg_tree, wg_pinfo); case WG_TYPE_TRANSPORT_DATA: return wg_dissect_data(tvb, pinfo, wg_tree, wg_pinfo); } DISSECTOR_ASSERT_NOT_REACHED(); } static gboolean dissect_wg_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { /* * Heuristics to detect the WireGuard protocol: * - The first byte must be one of the valid four messages. * - The total packet length depends on the message type, and is fixed for * three of them. The Data type has a minimum length however. * - The next three bytes are reserved and zero in the official protocol. * Cloudflare's implementation however uses this field for load balancing * purposes, so this condition is not checked here for most messages. * It is checked for data messages to avoid false positives. */ guint32 message_type; gboolean reserved_is_zeroes; if (tvb_reported_length(tvb) < 4) return FALSE; message_type = tvb_get_guint8(tvb, 0); reserved_is_zeroes = tvb_get_ntoh24(tvb, 1) == 0; if (!wg_is_valid_message_length(message_type, tvb_reported_length(tvb))) { return FALSE; } switch (message_type) { case WG_TYPE_COOKIE_REPLY: case WG_TYPE_TRANSPORT_DATA: if (!reserved_is_zeroes) return FALSE; break; } /* * Assuming that this is a new handshake, make sure that future messages are * directed to our dissector. This ensures that cookie replies and data * messages using non-zero reserved bytes are still properly recognized. * An edge case occurs when the address or port change. In that case, Data * messages using non-zero reserved bytes will not be recognized. The user * can use Decode As for this case. */ if (message_type == WG_TYPE_HANDSHAKE_INITIATION) { conversation_t *conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation, wg_handle); } dissect_wg(tvb, pinfo, tree, NULL); return TRUE; } static void wg_init(void) { wg_session_count = 0; } void proto_register_wg(void) { module_t *wg_module; expert_module_t *expert_wg; static hf_register_info hf[] = { /* Initiation message */ { &hf_wg_type, { "Type", "wg.type", FT_UINT8, BASE_DEC, VALS(wg_type_names), 0x0, NULL, HFILL } }, { &hf_wg_reserved, { "Reserved", "wg.reserved", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wg_sender, { "Sender", "wg.sender", FT_UINT32, BASE_HEX, NULL, 0x0, "Identifier as chosen by the sender", HFILL } }, { &hf_wg_ephemeral, { "Ephemeral", "wg.ephemeral", FT_STRING, BASE_NONE, NULL, 0x0, "Ephemeral public key of sender", HFILL } }, { &hf_wg_encrypted_static, { "Encrypted Static", "wg.encrypted_static", FT_NONE, BASE_NONE, NULL, 0x0, "Encrypted long-term static public key of sender", HFILL } }, { &hf_wg_static, { "Static Public Key", "wg.static", FT_STRING, BASE_NONE, NULL, 0x0, "Long-term static public key of sender", HFILL } }, { &hf_wg_encrypted_timestamp, { "Encrypted Timestamp", "wg.encrypted_timestamp", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wg_timestamp_tai64_label, { "TAI64 Label", "wg.timestamp.tai64_label", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wg_timestamp_nanoseconds, { "Nanoseconds", "wg.timestamp.nanoseconds", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wg_timestamp_value, { "Timestamp", "wg.timestamp.value", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, { &hf_wg_mac1, { "mac1", "wg.mac1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wg_mac2, { "mac2", "wg.mac2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Response message */ { &hf_wg_receiver, { "Receiver", "wg.receiver", FT_UINT32, BASE_HEX, NULL, 0x0, "Identifier as chosen by receiver", HFILL } }, { &hf_wg_encrypted_empty, { "Encrypted Empty", "wg.encrypted_empty", FT_NONE, BASE_NONE, NULL, 0x0, "Authenticated encryption of an empty string", HFILL } }, { &hf_wg_handshake_ok, { "Handshake decryption successful", "wg.handshake_ok", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Whether decryption keys were successfully derived", HFILL } }, /* Cookie message */ { &hf_wg_nonce, { "Nonce", "wg.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wg_encrypted_cookie, { "Encrypted Cookie", "wg.encrypted_cookie", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* TODO decrypted cookie field. */ /* Data message */ { &hf_wg_counter, { "Counter", "wg.counter", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wg_encrypted_packet, { "Encrypted Packet", "wg.encrypted_packet", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Association tracking. */ { &hf_wg_stream, { "Stream index", "wg.stream", FT_UINT32, BASE_DEC, NULL, 0x0, "Identifies a session in this capture file", HFILL } }, { &hf_wg_response_in, { "Response in Frame", "wg.response_in", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0, "The response to this initiation message is in this frame", HFILL } }, { &hf_wg_response_to, { "Response to Frame", "wg.response_to", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, "This is a response to the initiation message in this frame", HFILL } }, /* Additional fields. */ { &hf_wg_receiver_pubkey, { "Receiver Static Public Key", "wg.receiver_pubkey", FT_STRING, BASE_NONE, NULL, 0x0, "Public key of the receiver (matched based on MAC1)", HFILL } }, { &hf_wg_receiver_pubkey_known_privkey, { "Has Private Key", "wg.receiver_pubkey.known_privkey", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Whether the corresponding private key is known (configured via prefs)", HFILL } }, { &hf_wg_ephemeral_known_privkey, { "Has Private Key", "wg.ephemeral.known_privkey", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Whether the corresponding private key is known (configured via prefs)", HFILL } }, { &hf_wg_static_known_pubkey, { "Known Public Key", "wg.static.known_pubkey", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Whether this public key is known (configured via prefs)", HFILL } }, { &hf_wg_static_known_privkey, { "Has Private Key", "wg.static.known_privkey", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Whether the corresponding private key is known (configured via prefs)", HFILL } }, }; static gint *ett[] = { &ett_wg, &ett_timestamp, &ett_key_info, }; static ei_register_info ei[] = { { &ei_wg_bad_packet_length, { "wg.bad_packet_length", PI_MALFORMED, PI_ERROR, "Packet length is too small", EXPFILL } }, { &ei_wg_keepalive, { "wg.keepalive", PI_SEQUENCE, PI_CHAT, "This is a Keepalive message", EXPFILL } }, { &ei_wg_decryption_error, { "wg.decryption_error", PI_DECRYPTION, PI_WARN, "Packet data decryption failed", EXPFILL } }, }; /* UAT for header fields */ static uat_field_t wg_key_uat_fields[] = { UAT_FLD_VS(wg_key_uat, key_type, "Key type", wg_key_uat_type_vals, "Public or Private"), UAT_FLD_CSTRING(wg_key_uat, key, "Key", "Base64-encoded key"), UAT_END_FIELDS }; proto_wg = proto_register_protocol("WireGuard Protocol", "WireGuard", "wg"); proto_register_field_array(proto_wg, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wg = expert_register_protocol(proto_wg); expert_register_field_array(expert_wg, ei, array_length(ei)); wg_handle = register_dissector("wg", dissect_wg, proto_wg); wg_module = prefs_register_protocol(proto_wg, NULL); uat_t *wg_keys_uat = uat_new("WireGuard static keys", sizeof(wg_key_uat_record_t), "wg_keys", /* filename */ TRUE, /* from_profile */ &wg_key_records, /* data_ptr */ &num_wg_key_records, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ NULL, /* Help section (currently a wiki page) */ wg_key_uat_record_copy_cb, /* copy_cb */ wg_key_uat_record_update_cb, /* update_cb */ wg_key_uat_record_free_cb, /* free_cb */ wg_key_uat_apply, /* post_update_cb */ wg_key_uat_reset, /* reset_cb */ wg_key_uat_fields); prefs_register_uat_preference(wg_module, "keys", "WireGuard static keys", "A table of long-term static keys to enable WireGuard peer identification or partial decryption", wg_keys_uat); prefs_register_bool_preference(wg_module, "dissect_packet", "Dissect transport data", "Whether the IP dissector should dissect decrypted transport data.", &pref_dissect_packet); prefs_register_filename_preference(wg_module, "keylog_file", "Key log filename", "The path to the file which contains a list of secrets in the following format:\n" "\"<key-type> = <base64-encoded-key>\" (without quotes, leading spaces and spaces around '=' are ignored).\n" "<key-type> is one of: LOCAL_STATIC_PRIVATE_KEY, REMOTE_STATIC_PUBLIC_KEY, " "LOCAL_EPHEMERAL_PRIVATE_KEY or PRESHARED_KEY.", &pref_keylog_file, FALSE); if (!wg_decrypt_init()) { ws_warning("%s: decryption will not be possible due to lack of algorithms support", G_STRFUNC); } secrets_register_type(SECRETS_TYPE_WIREGUARD, wg_keylog_process_lines); wg_ephemeral_keys = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int_hash, wg_pubkey_equal); register_init_routine(wg_init); register_cleanup_routine(wg_keylog_reset); sessions = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal); } void proto_reg_handoff_wg(void) { dissector_add_uint_with_preference("udp.port", 0, wg_handle); heur_dissector_add("udp", dissect_wg_heur, "WireGuard", "wg", proto_wg, HEURISTIC_ENABLE); ip_handle = find_dissector("ip"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wisun.c
/* packet-wisun.c * * Wi-SUN IE Dissectors for Wireshark * By Owen Kirby <[email protected]> * Copyright 2007 Exegin Technologies Limited * Copyright 2022-2023 Silicon Laboratories Inc. * * SPDX-License-Identifier: GPL-2.0-or-later *------------------------------------------------------------ */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/proto_data.h> #include <wsutil/pint.h> #include <epan/reassemble.h> #include <epan/oids.h> #include <epan/oui.h> #include "packet-ieee802154.h" void proto_register_wisun(void); void proto_reg_handoff_wisun(void); /* EDFE support */ typedef struct { ieee802154_map_rec initiator; ieee802154_map_rec target; } edfe_exchange_t; // for each exchange, maps both source address and destination address to a // (distinct) tree that uses the frame number of the first exchange frame to // map to the shared edfe_exchange_t static wmem_map_t* edfe_byaddr; static dissector_handle_t eapol_handle; // for the eapol relay static dissector_handle_t ieee802154_nofcs_handle; // for Netricity Segment Control static reassembly_table netricity_reassembly_table; /* Wi-SUN Header IE Sub-ID Values. */ #define WISUN_SUBID_UTT 0x01 #define WISUN_SUBID_BT 0x02 #define WISUN_SUBID_FC 0x03 #define WISUN_SUBID_RSL 0x04 #define WISUN_SUBID_MHDS 0x05 #define WISUN_SUBID_VH 0x06 #define WISUN_SUBID_N_NFT 0x07 #define WISUN_SUBID_N_LQI 0x08 #define WISUN_SUBID_EA 0x09 /* Wi-SUN Header IE Sub-ID Values for FAN 1.1 */ #define WISUN_SUBID_LUTT 0x0A #define WISUN_SUBID_LBT 0x0B #define WISUN_SUBID_NR 0x0C #define WISUN_SUBID_LUS 0x0D #define WISUN_SUBID_FLUS 0x0E #define WISUN_SUBID_LBS 0x0F #define WISUN_SUBID_LND 0x10 #define WISUN_SUBID_LTO 0x11 #define WISUN_SUBID_PANID 0x12 #define WISUN_SUBID_RT 0x1D #define WISUN_SUBID_LBC 0x80 /* Wi-SUN Payload/Nested ID values. */ #define WISUN_PIE_SUBID_US 0x01 #define WISUN_PIE_SUBID_BS 0x02 #define WISUN_PIE_SUBID_VP 0x03 #define WISUN_PIE_SUBID_PAN 0x04 #define WISUN_PIE_SUBID_NETNAME 0x05 #define WISUN_PIE_SUBID_PANVER 0x06 #define WISUN_PIE_SUBID_GTKHASH 0x07 /* Wi-SUN Payload IE Sub-ID Values for FAN 1.1 */ #define WISUN_PIE_SUBID_POM 0x08 #define WISUN_PIE_SUBID_LCP 0x04 #define WISUN_PIE_SUBID_LFNVER 0x40 #define WISUN_PIE_SUBID_LGTKHASH 0x41 #define WISUN_PIE_SUBID_LBATS 0x09 #define WISUN_PIE_SUBID_JM 0x0a #define WISUN_LGTKHASH_LGTK0_INCLUDED_MASK 0x01 #define WISUN_LGTKHASH_LGTK1_INCLUDED_MASK 0x02 #define WISUN_LGTKHASH_LGTK2_INCLUDED_MASK 0x04 #define WISUN_CHANNEL_PLAN 0x07 #define WISUN_CHANNEL_FUNCTION 0x38 #define WISUN_CHANNEL_EXCLUDE 0xc0 #define WISUN_CHANNEL_PLAN_REGULATORY 0 #define WISUN_CHANNEL_PLAN_EXPLICIT 1 #define WISUN_CHANNEL_PLAN_REGULATORY_ID 2 #define WISUN_CHANNEL_FUNCTION_FIXED 0 #define WISUN_CHANNEL_FUNCTION_TR51CF 1 #define WISUN_CHANNEL_FUNCTION_DH1CF 2 #define WISUN_CHANNEL_FUNCTION_VENDOR 3 #define WISUN_CHANNEL_EXCLUDE_NONE 0 #define WISUN_CHANNEL_EXCLUDE_RANGE 1 #define WISUN_CHANNEL_EXCLUDE_MASK 2 #define WISUN_CH_PLAN_EXPLICIT_FREQ 0x00ffffff #define WISUN_CH_PLAN_EXPLICIT_RESERVED 0xf0000000 #define WISUN_CH_PLAN_EXPLICIT_SPACING 0x0f000000 #define WISUN_EAPOL_RELAY_UDP_PORT 10253 #define WISUN_WSIE_NODE_ROLE_ID_FFN_BR 0x00 #define WISUN_WSIE_NODE_ROLE_ID_FFN 0x01 #define WISUN_WSIE_NODE_ROLE_ID_LFN 0x02 #define WISUN_WSIE_NODE_ROLE_MASK 0x03 #define WISUN_PIE_PHY_OPERATING_MODES_MASK 0x0F #define WISUN_PIE_PHY_TYPE 0xF0 #define WISUN_PIE_JM_ID_PLF 1 #define WISUN_PIE_JM_ID_MASK 0x3f #define WISUN_PIE_JM_LEN_MASK 0xc0 #define WISUN_CMD_MDR 0x03 static int proto_wisun = -1; static int hf_wisun_subid = -1; static int hf_wisun_unknown_ie = -1; static int hf_wisun_uttie = -1; static int hf_wisun_uttie_type = -1; static int hf_wisun_uttie_ufsi = -1; static int hf_wisun_btie = -1; static int hf_wisun_btie_slot = -1; static int hf_wisun_btie_bio = -1; static int hf_wisun_fcie = -1; static int hf_wisun_fcie_tx = -1; static int hf_wisun_fcie_rx = -1; static int hf_wisun_fcie_src = -1; static int hf_wisun_fcie_initial_frame = -1; static int hf_wisun_rslie = -1; static int hf_wisun_rslie_rsl = -1; static int hf_wisun_vhie = -1; static int hf_wisun_vhie_vid = -1; static int hf_wisun_eaie = -1; static int hf_wisun_eaie_eui = -1; // LFN (FAN 1.1) static int hf_wisun_luttie = -1; static int hf_wisun_luttie_usn = -1; static int hf_wisun_luttie_uio = -1; static int hf_wisun_lbtie = -1; static int hf_wisun_lbtie_slot = -1; static int hf_wisun_lbtie_bio = -1; static int hf_wisun_nrie = -1; static int hf_wisun_nrie_nr_id = -1; static int hf_wisun_nrie_timing_accuracy = -1; static int hf_wisun_nrie_listening_interval_min = -1; static int hf_wisun_nrie_listening_interval_max = -1; static int hf_wisun_lusie = -1; static int hf_wisun_lusie_listen_interval = -1; static int hf_wisun_lusie_channel_plan_tag = -1; static int hf_wisun_flusie = -1; static int hf_wisun_flusie_dwell_interval = -1; static int hf_wisun_flusie_channel_plan_tag = -1; static int hf_wisun_lbsie = -1; static int hf_wisun_lbsie_broadcast_interval = -1; static int hf_wisun_lbsie_broadcast_id = -1; static int hf_wisun_lbsie_channel_plan_tag = -1; static int hf_wisun_lbsie_broadcast_sync_period = -1; static int hf_wisun_lndie = -1; static int hf_wisun_lndie_response_threshold = -1; static int hf_wisun_lndie_response_delay = -1; static int hf_wisun_lndie_discovery_slot_time = -1; static int hf_wisun_lndie_discovery_slots = -1; static int hf_wisun_lndie_discovery_first_slot = -1; static int hf_wisun_ltoie = -1; static int hf_wisun_ltoie_offset = -1; static int hf_wisun_ltoie_listening_interval = -1; static int hf_wisun_panidie = -1; static int hf_wisun_panidie_panid = -1; static int hf_wisun_rtie = -1; static int hf_wisun_rtie_rendezvous_time = -1; static int hf_wisun_rtie_wakeup_interval = -1; static int hf_wisun_lbcie = -1; static int hf_wisun_lbcie_broadcast_interval = -1; static int hf_wisun_lbcie_broadcast_sync_period = -1; static int hf_wisun_pie = -1; static int hf_wisun_wsie = -1; static int hf_wisun_wsie_type = -1; static int hf_wisun_wsie_id = -1; static int hf_wisun_wsie_length = -1; static int hf_wisun_wsie_id_short = -1; static int hf_wisun_wsie_length_short = -1; static int hf_wisun_usie = -1; static int hf_wisun_usie_dwell_interval = -1; static int hf_wisun_usie_clock_drift = -1; static int hf_wisun_usie_timing_accuracy = -1; static int hf_wisun_usie_channel_control = -1; static int hf_wisun_usie_channel_plan = -1; static int hf_wisun_usie_channel_function = -1; static int hf_wisun_usie_channel_exclude = -1; static int hf_wisun_usie_regulatory_domain = -1; static int hf_wisun_usie_operating_class = -1; static int hf_wisun_usie_channel_plan_id = -1; static int hf_wisun_usie_explicit = -1; static int hf_wisun_usie_explicit_frequency = -1; static int hf_wisun_usie_explicit_reserved = -1; static int hf_wisun_usie_explicit_spacing = -1; static int hf_wisun_usie_number_channels = -1; static int hf_wisun_usie_fixed_channel = -1; static int hf_wisun_usie_hop_count = -1; static int hf_wisun_usie_hop_list = -1; static int hf_wisun_usie_number_ranges = -1; static int hf_wisun_usie_exclude_range_start = -1; static int hf_wisun_usie_exclude_range_end = -1; static int hf_wisun_usie_exclude_mask = -1; static int hf_wisun_bsie = -1; static int hf_wisun_bsie_bcast_interval = -1; static int hf_wisun_bsie_bcast_schedule_id = -1; static int hf_wisun_vpie = -1; static int hf_wisun_vpie_vid = -1; static int hf_wisun_lcpie = -1; static int hf_wisun_panie = -1; static int hf_wisun_panie_size = -1; static int hf_wisun_panie_cost = -1; static int hf_wisun_panie_flags = -1; static int hf_wisun_panie_flag_parent_bsie = -1; static int hf_wisun_panie_flag_routing_method = -1; static int hf_wisun_panie_flag_lfn_window_style = -1; static int hf_wisun_panie_flag_version = -1; static int hf_wisun_netnameie = -1; static int hf_wisun_netnameie_name = -1; static int hf_wisun_panverie = -1; static int hf_wisun_panverie_version = -1; static int hf_wisun_gtkhashie = -1; static int hf_wisun_gtkhashie_gtk0 = -1; static int hf_wisun_gtkhashie_gtk1 = -1; static int hf_wisun_gtkhashie_gtk2 = -1; static int hf_wisun_gtkhashie_gtk3 = -1; static int hf_wisun_pomie = -1; static int hf_wisun_pomie_hdr = -1; static int hf_wisun_pomie_number_operating_modes = -1; static int hf_wisun_pomie_mdr_command_capable_flag = -1; static int hf_wisun_pomie_reserved = -1; static int hf_wisun_pomie_phy_mode_id = -1; static int hf_wisun_pomie_phy_type = -1; static int hf_wisun_pomie_phy_mode_fsk = -1; static int hf_wisun_pomie_phy_mode_ofdm = -1; static int hf_wisun_lfnverie = -1; static int hf_wisun_lfnverie_version = -1; static int hf_wisun_lgtkhashie = -1; static int hf_wisun_lgtkhashie_flags = -1; static int hf_wisun_lgtkhashie_flag_includes_lgtk0 = -1; static int hf_wisun_lgtkhashie_flag_includes_lgtk1 = -1; static int hf_wisun_lgtkhashie_flag_includes_lgtk2 = -1; static int hf_wisun_lgtkhashie_flag_active_lgtk_index = -1; static int hf_wisun_lgtkhashie_gtk0 = -1; static int hf_wisun_lgtkhashie_gtk1 = -1; static int hf_wisun_lgtkhashie_gtk2 = -1; static int hf_wisun_lbatsie = -1; static int hf_wisun_lbatsie_additional_tx = -1; static int hf_wisun_lbatsie_next_tx_delay = -1; static int hf_wisun_jmie = -1; static int hf_wisun_jmie_version = -1; static int hf_wisun_jmie_metric_hdr = -1; static int hf_wisun_jmie_metric_id = -1; static int hf_wisun_jmie_metric_len = -1; static int hf_wisun_jmie_metric_plf = -1; static int hf_wisun_jmie_metric_plf_data = -1; static int hf_wisun_jmie_metric_unknown = -1; static int proto_wisun_sec = -1; static int hf_wisun_sec_function = -1; static int hf_wisun_sec_error_type = -1; static int hf_wisun_sec_error_nonce = -1; // EAPOL Relay static dissector_handle_t wisun_eapol_relay_handle; static int proto_wisun_eapol_relay = -1; static int hf_wisun_eapol_relay_sup = -1; static int hf_wisun_eapol_relay_kmp_id = -1; static int hf_wisun_eapol_relay_direction = -1; static int hf_wisun_cmd_subid = -1; static int hf_wisun_cmd_mdr_phy_mode_id = -1; static int hf_wisun_cmd_mdr_phy_type = -1; static int hf_wisun_cmd_mdr_phy_mode_fsk = -1; static int hf_wisun_cmd_mdr_phy_mode_ofdm = -1; // Netricity static int proto_wisun_netricity_sc; static int hf_wisun_netricity_nftie = -1; static int hf_wisun_netricity_nftie_type = -1; static int hf_wisun_netricity_lqiie = -1; static int hf_wisun_netricity_lqiie_lqi = -1; static int hf_wisun_netricity_sc_flags = -1; static int hf_wisun_netricity_sc_reserved = -1; static int hf_wisun_netricity_sc_tone_map_request = -1; static int hf_wisun_netricity_sc_contention_control = -1; static int hf_wisun_netricity_sc_channel_access_priority = -1; static int hf_wisun_netricity_sc_last_segment = -1; static int hf_wisun_netricity_sc_segment_count = -1; static int hf_wisun_netricity_sc_segment_length = -1; // Reassembly static int hf_wisun_netricity_scr_segments = -1; static int hf_wisun_netricity_scr_segment = -1; static int hf_wisun_netricity_scr_segment_overlap = -1; static int hf_wisun_netricity_scr_segment_overlap_conflicts = -1; static int hf_wisun_netricity_scr_segment_multiple_tails = -1; static int hf_wisun_netricity_scr_segment_too_long_segment = -1; static int hf_wisun_netricity_scr_segment_error = -1; static int hf_wisun_netricity_scr_segment_count = -1; static int hf_wisun_netricity_scr_reassembled_in = -1; static int hf_wisun_netricity_scr_reassembled_length = -1; static gint ett_wisun_phy_mode_id = -1; static gint ett_wisun_unknown_ie = -1; static gint ett_wisun_uttie = -1; static gint ett_wisun_btie = -1; static gint ett_wisun_fcie = -1; static gint ett_wisun_rslie = -1; static gint ett_wisun_vhie = -1; static gint ett_wisun_eaie = -1; static gint ett_wisun_pie = -1; static gint ett_wisun_wsie_bitmap = -1; static gint ett_wisun_usie = -1; static gint ett_wisun_bsie = -1; static gint ett_wisun_vpie = -1; static gint ett_wisun_lcpie = -1; static gint ett_wisun_usie_channel_control; static gint ett_wisun_usie_explicit; static gint ett_wisun_luttie = -1; static gint ett_wisun_nrie = -1; static gint ett_wisun_lusie = -1; static gint ett_wisun_flusie = -1; static gint ett_wisun_lbsie = -1; static gint ett_wisun_lndie = -1; static gint ett_wisun_ltoie = -1; static gint ett_wisun_panidie = -1; static gint ett_wisun_rtie = -1; static gint ett_wisun_lbcie = -1; static gint ett_wisun_panie = -1; static gint ett_wisun_panie_flags = -1; static gint ett_wisun_netnameie = -1; static gint ett_wisun_panverie = -1; static gint ett_wisun_gtkhashie = -1; static gint ett_wisun_pomie = -1; static gint ett_wisun_pomie_hdr = -1; static gint ett_wisun_lfnverie = -1; static gint ett_wisun_lgtkhashie = -1; static gint ett_wisun_lgtkhashie_flags = -1; static gint ett_wisun_lbatsie = -1; static gint ett_wisun_jmie = -1; static gint ett_wisun_jmie_metric_hdr = -1; static gint ett_wisun_jmie_metric_plf = -1; static gint ett_wisun_jmie_metric_unknown = -1; static gint ett_wisun_sec = -1; static gint ett_wisun_eapol_relay = -1; // Netricity static gint ett_wisun_netricity_nftie = -1; static gint ett_wisun_netricity_lqiie = -1; static gint ett_wisun_netricity_sc = -1; static gint ett_wisun_netricity_sc_bitmask = -1; static gint ett_wisun_netricity_scr_segment = -1; static gint ett_wisun_netricity_scr_segments = -1; static const fragment_items netricity_scr_frag_items = { /* Fragment subtrees */ &ett_wisun_netricity_scr_segment, &ett_wisun_netricity_scr_segments, /* Fragment fields */ &hf_wisun_netricity_scr_segments, &hf_wisun_netricity_scr_segment, &hf_wisun_netricity_scr_segment_overlap, &hf_wisun_netricity_scr_segment_overlap_conflicts, &hf_wisun_netricity_scr_segment_multiple_tails, &hf_wisun_netricity_scr_segment_too_long_segment, &hf_wisun_netricity_scr_segment_error, &hf_wisun_netricity_scr_segment_count, /* Reassembled in field */ &hf_wisun_netricity_scr_reassembled_in, /* Reassembled length field */ &hf_wisun_netricity_scr_reassembled_length, /* Reassembled data field */ NULL, /* Tag */ "Netricity Segments" }; static const value_string wisun_wsie_types[] = { { 0, "Short" }, { 1, "Long" }, { 0, NULL } }; static const value_string wisun_subid_vals[] = { { WISUN_SUBID_UTT, "Unicast Timing IE" }, { WISUN_SUBID_BT, "Broadcast Timing IE" }, { WISUN_SUBID_FC, "Flow Control IE" }, { WISUN_SUBID_RSL, "Received Signal Level IE" }, { WISUN_SUBID_MHDS, "Multi-Hop Delivery Service IE" }, { WISUN_SUBID_VH, "Vendor Header IE" }, { WISUN_SUBID_N_NFT, "Netricity Frame Type IE" }, { WISUN_SUBID_N_LQI, "Link Quality Index IE" }, { WISUN_SUBID_EA, "EAPOL Authenticator EUI-64 IE" }, { WISUN_SUBID_LUTT, "LFN Unicast Timing and Frame Type IE" }, { WISUN_SUBID_LBT, "LFN Broadcast Timing IE" }, { WISUN_SUBID_NR, "Node Role IE" }, { WISUN_SUBID_LUS, "LFN Unicast Schedule IE" }, { WISUN_SUBID_FLUS, "FFN for LFN Unicast Schedule IE" }, { WISUN_SUBID_LBS, "LFN Broadcast Schedule IE" }, { WISUN_SUBID_LND, "LFN Network Discovery IE" }, { WISUN_SUBID_LTO, "LFN Timing Offset IE" }, { WISUN_SUBID_PANID, "PAN Identifier IE" }, { WISUN_SUBID_RT, "Rendezvous Time IE" }, { WISUN_SUBID_LBC, "LFN Broadcast Configuration IE" }, { 0, NULL } }; static const value_string wisun_wsie_names[] = { { WISUN_PIE_SUBID_US, "Unicast Schedule IE" }, { WISUN_PIE_SUBID_BS, "Broadcast Schedule IE" }, { WISUN_PIE_SUBID_VP, "Vendor Payload IE" }, { WISUN_PIE_SUBID_LCP, "LFN Channel Plan IE" }, { 0, NULL } }; static const value_string wisun_wsie_names_short[] = { { WISUN_PIE_SUBID_PAN, "PAN Information IE" }, { WISUN_PIE_SUBID_NETNAME, "Network Name IE" }, { WISUN_PIE_SUBID_PANVER, "PAN Version IE" }, { WISUN_PIE_SUBID_GTKHASH, "GTK Hash IE" }, { WISUN_PIE_SUBID_POM, "PHY Operating Modes IE" }, { WISUN_PIE_SUBID_LFNVER, "LFN Version IE" }, { WISUN_PIE_SUBID_LGTKHASH, "LFN GTK Hash IE" }, { WISUN_PIE_SUBID_LBATS, "LFN Broadcast Additional Transmit Schedule IE" }, { WISUN_PIE_SUBID_JM, "Join Metrics IE" }, { 0, NULL } }; static const value_string wisun_frame_type_vals[] = { { 0, "PAN Advertisement" }, { 1, "PAN Advertisement Solicit" }, { 2, "PAN Configuration" }, { 3, "PAN Configuration Solicit" }, { 4, "Data" }, { 5, "Acknowledgment" }, { 6, "EAPOL" }, { 7, "Reserved" }, { 8, "Reserved" }, { 9, "LFN PAN Advertisement" }, { 10, "LFN PAN Advertisement Solicit" }, { 11, "LFN PAN Configuration" }, { 12, "LFN PAN Configuration Solicit" }, { 13, "LFN Time Synchronization" }, { 14, "Reserved" }, { 15, "Reserved (Extended Type)" }, { 0, NULL } }; static const value_string wisun_usie_clock_drift_names[] = { { 0, "Better than 1ppm" }, { 255, "Not provided" }, { 0, NULL } }; static const value_string wisun_channel_plan_names[] = { { WISUN_CHANNEL_PLAN_REGULATORY, "Regulatory Domain and Operating Class" }, { WISUN_CHANNEL_PLAN_EXPLICIT, "Explicit Spacing and Number" }, { WISUN_CHANNEL_PLAN_REGULATORY_ID, "Regulatory Domain and Channel Plan ID" }, { 0, NULL } }; static const range_string wisun_channel_plan_id_names[] = { { 0, 0, "Reserved" }, { 1, 1, "902_928_200" }, { 2, 2, "902_928_400" }, { 3, 3, "902_928_600" }, { 4, 4, "902_928_800" }, { 5, 5, "902_928_1200" }, { 6, 20, "Reserved" }, { 21, 21, "920_928_200" }, { 22, 22, "920_928_400" }, { 23, 23, "920_928_600" }, { 24, 24, "920_928_800" }, { 25, 31, "Reserved" }, { 32, 32, "863_870_100" }, { 33, 33, "863_870_200" }, { 34, 34, "870_876_100" }, { 35, 35, "870_876_200" }, { 36, 36, "863_876_100" }, { 37, 37, "863_876_200" }, { 38, 63, "Reserved" }, { 0, 0, NULL } }; static const value_string wisun_channel_function_names[] = { { WISUN_CHANNEL_FUNCTION_FIXED, "Fixed Channel" }, { WISUN_CHANNEL_FUNCTION_TR51CF, "TR51 Channel Function" }, { WISUN_CHANNEL_FUNCTION_DH1CF, "Direct Hash Channel Function" }, { WISUN_CHANNEL_FUNCTION_VENDOR, "Vendor Defined Channel Function" }, { 0, NULL } }; static const value_string wisun_channel_exclude_names[] = { { WISUN_CHANNEL_EXCLUDE_NONE, "None" }, { WISUN_CHANNEL_EXCLUDE_RANGE, "Ranges" }, { WISUN_CHANNEL_EXCLUDE_MASK, "Bitmask" }, { 0, NULL } }; static const value_string wisun_channel_regulatory_domains_names[] = { { 0, "World" }, { 1, "North America" }, { 2, "Japan" }, { 3, "Europe" }, { 4, "China" }, { 5, "India" }, { 6, "Mexico" }, { 7, "Brazil" }, { 8, "Australia / NZ" }, { 9, "Korea" }, { 10, "Philippines" }, { 11, "Malaysia" }, { 12, "Hong Kong" }, { 13, "Singapore" }, { 14, "Thailand" }, { 15, "Vietnam" }, { 0, NULL } }; static const value_string wisun_channel_spacing_names[] = { { 0, "200 kHz" }, { 1, "400 kHz" }, { 2, "600 kHz" }, { 3, "100 kHz" }, { 4, "800 kHz" }, { 5, "1000 kHz" }, { 6, "1200 kHz" }, { 7, "2400 kHz" }, { 0, NULL } }; static const value_string wisun_routing_methods[] = { { 0, "MHDS" }, { 1, "RPL" }, { 0, NULL } }; static const value_string wisun_window_style[] = { { 0, "LFN Managed Transmission" }, { 1, "FFN Managed Transmission" }, { 0, NULL } }; static const value_string wisun_metric_id[] = { { WISUN_PIE_JM_ID_PLF, "PAN Load Factor" }, { 0, NULL } }; static const value_string wisun_metric_len[] = { { 0, "0" }, { 1, "1" }, { 2, "2" }, { 3, "4" }, { 0, NULL } }; static const value_string wisun_sec_functions[] = { { 0x01, "SM Error" }, { 0, NULL } }; static const value_string wisun_sec_sm_errors[] = { { 0x01, "No Session" }, { 0x02, "Unavailable Key" }, { 0x03, "Unsupported Security" }, { 0x04, "Invalid Parameter" }, { 0x06, "Unsupported Security" }, { 0, NULL } }; static const value_string wisun_wsie_node_role_vals[] = { { 0, "FFN Border Router" }, { 1, "FFN Router" }, { 2, "LFN" }, { 3, "Reserved" }, { 4, "Reserved" }, { 5, "Reserved" }, { 6, "Reserved" }, { 7, "Reserved" }, { 0, NULL } }; static const value_string wisun_phy_type_vals[] = { { 0, "FSK without FEC" }, { 1, "FSK with NRNSC FEC" }, { 2, "OFDM Option1" }, { 3, "OFDM Option2" }, { 4, "OFDM Option3" }, { 5, "OFDM Option4" }, { 0, NULL } }; static const range_string wisun_phy_mode_fsk_vals[] = { { 0, 0, "Reserved" }, { 1, 1, "FSK Mode 1a" }, { 2, 2, "FSK Mode 1b" }, { 3, 3, "FSK Mode 2a" }, { 4, 4, "FSK Mode 2b" }, { 5, 5, "FSK Mode 3" }, { 6, 6, "FSK Mode 4a" }, { 7, 7, "FSK Mode 4b" }, { 8, 8, "FSK Mode 5" }, { 9, 15, "Reserved" }, { 0, 0, NULL } }; static const range_string wisun_phy_mode_ofdm_vals[] = { { 0, 0, "MCS0" }, { 1, 1, "MCS1" }, { 2, 2, "MCS2" }, { 3, 3, "MCS3" }, { 4, 4, "MCS4" }, { 5, 5, "MCS5" }, { 6, 6, "MCS6" }, { 7, 15, "Reserved" }, { 0, 0, NULL } }; static const value_string wisun_cmd_vals[] = { { 3, "MDR Command" }, { 0, NULL } }; static const true_false_string wisun_netricity_sc_contention_control_tfs = { "Contention-free access", "Contention allowed in next contention state" }; static int * const wisun_format_nested_ie[] = { &hf_wisun_wsie_type, &hf_wisun_wsie_id, &hf_wisun_wsie_length, NULL }; static int * const wisun_format_nested_ie_short[] = { &hf_wisun_wsie_type, &hf_wisun_wsie_id_short, &hf_wisun_wsie_length_short, NULL }; static expert_field ei_wisun_subid_unsupported = EI_INIT; static expert_field ei_wisun_wsie_unsupported = EI_INIT; static expert_field ei_wisun_usie_channel_plan_invalid = EI_INIT; static expert_field ei_wisun_edfe_start_not_found = EI_INIT; static expert_field ei_wisun_usie_explicit_reserved_bits_not_zero = EI_INIT; static expert_field ei_wisun_jmie_metric_unsupported = EI_INIT; static guint wisun_add_wbxml_uint(tvbuff_t *tvb, proto_tree *tree, int hf, guint offset) { guint val = 0; guint len = 0; guint8 b; do { b = tvb_get_guint8(tvb, offset + len++); val = (val << 7) | (b & 0x7f); } while (b & 0x80); proto_tree_add_uint(tree, hf, tvb, offset, len, val); return len; } static void wisun_add_phy_mode_id(tvbuff_t *tvb, proto_tree *tree, const guint offset, const int hf, int *const hf_type, int *const hf_fsk, int *const hf_ofdm) { guint8 phy_type = (tvb_get_guint8(tvb, offset) & WISUN_PIE_PHY_TYPE) >> 4; int *const wisun_phy_mode_fsk_fields[] = { hf_type, hf_fsk, NULL }; int *const wisun_phy_mode_ofdm_fields[] = { hf_type, hf_ofdm, NULL }; if (phy_type < 2) { // 0 and 1 are FSK modes proto_tree_add_bitmask(tree, tvb, offset, hf, ett_wisun_phy_mode_id, wisun_phy_mode_fsk_fields, ENC_NA); } else { // The rest are OFDM modes proto_tree_add_bitmask(tree, tvb, offset, hf, ett_wisun_phy_mode_id, wisun_phy_mode_ofdm_fields, ENC_NA); } } /*----------------------------------------------- * Wi-SUN Header IE Dissection *---------------------------------------------*/ static proto_tree * wisun_create_hie_tree(tvbuff_t *tvb, proto_tree *tree, int hf, gint ett) { proto_tree *subtree = ieee802154_create_hie_tree(tvb, tree, hf, ett); proto_tree_add_item(subtree, hf_wisun_subid, tvb, 2, 1, ENC_LITTLE_ENDIAN); return subtree; } static int dissect_wisun_uttie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) { guint8 frame_type = tvb_get_guint8(tvb, offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(frame_type, wisun_frame_type_vals, "Unknown Wi-SUN Frame")); proto_tree_add_item(tree, hf_wisun_uttie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_uttie_ufsi, tvb, offset+1, 3, ENC_LITTLE_ENDIAN); return 4; } static int dissect_wisun_btie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_btie_slot, tvb, offset, 2, ENC_LITTLE_ENDIAN); /* as of FAN TPS 1v14, this is 3 bytes instead of 4 */ proto_tree_add_item(tree, hf_wisun_btie_bio, tvb, offset+2, 3, ENC_LITTLE_ENDIAN); return 5; } static void edfe_insert_exchange(guint64* addr, edfe_exchange_t* exchange) { wmem_tree_t* byframe = (wmem_tree_t *)wmem_map_lookup(edfe_byaddr, addr); if (!byframe) { byframe = wmem_tree_new(wmem_file_scope()); wmem_map_insert(edfe_byaddr, addr, byframe); } wmem_tree_insert32(byframe, exchange->initiator.start_fnum, exchange); } static int dissect_wisun_fcie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, ieee802154_packet *packet) { guint32 tx; proto_tree_add_item_ret_uint(tree, hf_wisun_fcie_tx, tvb, offset, 1, ENC_LITTLE_ENDIAN, &tx); guint32 rx; proto_tree_add_item_ret_uint(tree, hf_wisun_fcie_rx, tvb, offset+1, 1, ENC_LITTLE_ENDIAN, &rx); // EDFE processing ieee802154_hints_t* hints = (ieee802154_hints_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_get_id_by_filter_name(IEEE802154_PROTOABBREV_WPAN), 0); if (packet && hints && packet->dst_addr_mode == IEEE802154_FCF_ADDR_EXT) { // first packet has source address if (!hints->map_rec && packet->src_addr_mode == IEEE802154_FCF_ADDR_EXT) { edfe_exchange_t* ex = wmem_new(wmem_file_scope(), edfe_exchange_t); ex->initiator.proto = "Wi-SUN"; ex->target.proto = "Wi-SUN"; ex->initiator.start_fnum = pinfo->num; ex->target.start_fnum = pinfo->num; ex->initiator.end_fnum = ~(guint)0; ex->target.end_fnum = ~(guint)0; ex->initiator.addr64 = packet->src64; ex->target.addr64 = packet->dst64; edfe_insert_exchange(&ex->initiator.addr64, ex); edfe_insert_exchange(&ex->target.addr64, ex); } else if (packet->src_addr_mode == IEEE802154_FCF_ADDR_NONE) { if (!hints->map_rec) { wmem_tree_t* byframe = (wmem_tree_t *)wmem_map_lookup(edfe_byaddr, &packet->dst64); if (byframe) { edfe_exchange_t *ex = (edfe_exchange_t *)wmem_tree_lookup32_le(byframe, pinfo->num); if (ex && pinfo->num <= ex->initiator.end_fnum) { hints->map_rec = ex->initiator.addr64 == packet->dst64 ? &ex->target : &ex->initiator; if (tx == 0 && rx == 0) { // last frame ex->initiator.end_fnum = pinfo->num; } } } } if (hints->map_rec) { // Set address to ensure that 6LoWPAN reassembly works // Adapted from packet-ieee802.15.4.c guint64 *p_addr = wmem_new(pinfo->pool, guint64); /* Copy and convert the address to network byte order. */ *p_addr = pntoh64(&(hints->map_rec->addr64)); set_address(&pinfo->dl_src, AT_EUI64, 8, p_addr); copy_address_shallow(&pinfo->src, &pinfo->dl_src); proto_item* src = proto_tree_add_eui64(tree, hf_wisun_fcie_src, tvb, 0, 0, hints->map_rec->addr64); proto_item_set_generated(src); proto_item* frm = proto_tree_add_uint(tree, hf_wisun_fcie_initial_frame, tvb, 0, 0, hints->map_rec->start_fnum); proto_item_set_generated(frm); } else { expert_add_info(pinfo, tree, &ei_wisun_edfe_start_not_found); } } } return 2; } static int dissect_wisun_rslie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { guint32 rsl = tvb_get_guint8(tvb, offset); if (rsl == 0xff) { // "A value of 255 MUST be used to indicate not measured" [FANTPS 1v21] proto_tree_add_uint_format_value(tree, hf_wisun_rslie_rsl, tvb, offset, 1, rsl, "not measured"); } else { // "This provides a range of -174 (0) to +80 (254) dBm" [FANTPS 1v21] proto_tree_add_uint_format_value(tree, hf_wisun_rslie_rsl, tvb, offset, 1, rsl, "%d dBm", rsl-174); } return 1; } static int dissect_wisun_vhie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) { guint vidlen = wisun_add_wbxml_uint(tvb, tree, hf_wisun_vhie_vid, offset); call_data_dissector(tvb_new_subset_remaining(tvb, offset + vidlen), pinfo, tree); return tvb_reported_length(tvb); } static int dissect_wisun_eaie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_eaie_eui, tvb, offset, 8, ENC_BIG_ENDIAN); return 8; } static int dissect_wisun_luttie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) { guint8 frame_type = tvb_get_guint8(tvb, offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(frame_type, wisun_frame_type_vals, "Unknown LFN Wi-SUN Frame")); proto_tree_add_item(tree, hf_wisun_uttie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_luttie_usn, tvb, offset+1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_luttie_uio, tvb, offset+3, 3, ENC_LITTLE_ENDIAN); return 6; } static int dissect_wisun_nrie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { guint8 node_role = tvb_get_guint8(tvb, offset) & WISUN_WSIE_NODE_ROLE_MASK; proto_tree_add_item(tree, hf_wisun_nrie_nr_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_wisun_usie_clock_drift, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; guint clock_drift = tvb_get_guint8(tvb, offset); // "Resolution is 10 microseconds and the valid range of the field value is 0-255 (0 to 2.55msec)" [FANTPS 1v21] proto_tree_add_uint_format_value(tree, hf_wisun_nrie_timing_accuracy, tvb, offset, 1, clock_drift, "%1.2fms", clock_drift/100.0); offset++; if (node_role == WISUN_WSIE_NODE_ROLE_ID_LFN) { proto_tree_add_item(tree, hf_wisun_nrie_listening_interval_min, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; proto_tree_add_item(tree, hf_wisun_nrie_listening_interval_max, tvb, offset, 3, ENC_LITTLE_ENDIAN); offset += 3; } return offset; } static int dissect_wisun_lusie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_lusie_listen_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lusie_channel_plan_tag, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); return 4; } static int dissect_wisun_lbtie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_lbtie_slot, tvb, offset, 2, ENC_LITTLE_ENDIAN); /* as of FAN TPS 1v14, this is 3 bytes instead of 4 */ proto_tree_add_item(tree, hf_wisun_lbtie_bio, tvb, offset+2, 3, ENC_LITTLE_ENDIAN); return 5; } static int dissect_wisun_flusie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_flusie_dwell_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_flusie_channel_plan_tag, tvb, offset+1, 1, ENC_LITTLE_ENDIAN); return 2; } static int dissect_wisun_lbsie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_lbsie_broadcast_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lbsie_broadcast_id, tvb, offset+3, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lbsie_channel_plan_tag, tvb, offset+5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lbsie_broadcast_sync_period, tvb, offset+6, 1, ENC_LITTLE_ENDIAN); return 7; } static int dissect_wisun_lndie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_lndie_response_threshold, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lndie_response_delay, tvb, offset+1, 3, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lndie_discovery_slot_time, tvb, offset+4, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lndie_discovery_slots, tvb, offset+5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lndie_discovery_first_slot, tvb, offset+6, 2, ENC_LITTLE_ENDIAN); return 8; } static int dissect_wisun_ltoie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_ltoie_offset, tvb, offset, 3, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_ltoie_listening_interval, tvb, offset+3, 3, ENC_LITTLE_ENDIAN); return 6; } static int dissect_wisun_panidie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_panidie_panid, tvb, offset, 2, ENC_LITTLE_ENDIAN); return 2; } static int dissect_wisun_rtie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_rtie_rendezvous_time, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_rtie_wakeup_interval, tvb, offset+2, 2, ENC_LITTLE_ENDIAN); return 4; } static int dissect_wisun_lbcie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { proto_tree_add_item(tree, hf_wisun_lbcie_broadcast_interval, tvb, offset, 3, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_wisun_lbcie_broadcast_sync_period, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); return 4; } static int dissect_wisun_netricity_nftie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { guint8 frame_type = tvb_get_guint8(tvb, offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN Netricity"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(frame_type, wisun_frame_type_vals, "Unknown Wi-SUN Netricity Frame")); proto_tree_add_item(tree, hf_wisun_netricity_nftie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); return 1; } static int dissect_wisun_netricity_lqiie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) { guint8 lqi = tvb_get_guint8(tvb, offset); switch (lqi) { case 0: // "-10 dB or lower (0x00)" [IEEE1901.2-2013] proto_tree_add_uint_format_value(tree, hf_wisun_netricity_lqiie_lqi, tvb, offset, 1, lqi, "0 (SNR -10 dB or lower)"); break; case 255: // "A value of 255 MUST be used to indicate 'not measured'" [NTPS 1v04] proto_tree_add_uint_format_value(tree, hf_wisun_netricity_lqiie_lqi, tvb, offset, 1, lqi, "255 (not measured)"); break; default: // "where the value of -9.75 dB is represented as 0x01 and the value of 52.75 dB is represented as 0xFE" [IEEE1901.2-2013] proto_tree_add_uint_format_value(tree, hf_wisun_netricity_lqiie_lqi, tvb, offset, 1, lqi, "%d (SNR %1.2f dB)", lqi, (lqi-1) * (52.75+9.75) / (0xfe - 0x01) - 9.75); } return 1; } static int dissect_wisun_hie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint offset; proto_tree *subtree; guint8 subid = tvb_get_guint8(tvb, 2); ieee802154_packet *packet = (ieee802154_packet*)data; offset = 3; switch (subid) { case WISUN_SUBID_UTT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_uttie, ett_wisun_uttie); offset += dissect_wisun_uttie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_BT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_btie, ett_wisun_btie); offset += dissect_wisun_btie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_FC: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_fcie, ett_wisun_fcie); offset += dissect_wisun_fcie(tvb, pinfo, subtree, offset, packet); break; case WISUN_SUBID_RSL: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_rslie, ett_wisun_rslie); offset += dissect_wisun_rslie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_VH: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_vhie, ett_wisun_vhie); offset += dissect_wisun_vhie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_N_NFT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_netricity_nftie, ett_wisun_netricity_nftie); offset += dissect_wisun_netricity_nftie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_N_LQI: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_netricity_lqiie, ett_wisun_netricity_lqiie); offset += dissect_wisun_netricity_lqiie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_EA: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_eaie, ett_wisun_eaie); offset += dissect_wisun_eaie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LUTT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_luttie, ett_wisun_luttie); offset += dissect_wisun_luttie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LBT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_lbtie, ett_wisun_btie); offset += dissect_wisun_lbtie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_NR: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_nrie, ett_wisun_nrie); offset += dissect_wisun_nrie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LUS: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_lusie, ett_wisun_lusie); offset += dissect_wisun_lusie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_FLUS: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_flusie, ett_wisun_flusie); offset += dissect_wisun_flusie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LBS: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_lbsie, ett_wisun_lbsie); offset += dissect_wisun_lbsie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LND: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_lndie, ett_wisun_lndie); offset += dissect_wisun_lndie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LTO: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_ltoie, ett_wisun_ltoie); offset += dissect_wisun_ltoie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_PANID: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_panidie, ett_wisun_panidie); offset += dissect_wisun_panidie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_RT: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_rtie, ett_wisun_rtie); offset += dissect_wisun_rtie(tvb, pinfo, subtree, offset); break; case WISUN_SUBID_LBC: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_lbcie, ett_wisun_lbcie); offset += dissect_wisun_lbcie(tvb, pinfo, subtree, offset); break; default: subtree = wisun_create_hie_tree(tvb, tree, hf_wisun_unknown_ie, ett_wisun_unknown_ie); expert_add_info(pinfo, subtree, &ei_wisun_subid_unsupported); call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, subtree); offset = tvb_reported_length(tvb); break; } return offset; } /*----------------------------------------------- * Wi-SUN Payload IE Dissection *---------------------------------------------*/ static int dissect_wisun_schedule_common(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tree *tree) { static int * const fields_usie_channel[] = { &hf_wisun_usie_channel_plan, &hf_wisun_usie_channel_function, &hf_wisun_usie_channel_exclude, NULL }; static int * const fields_usie_channel_plan_explicit[] = { &hf_wisun_usie_explicit_frequency, &hf_wisun_usie_explicit_spacing, &hf_wisun_usie_explicit_reserved, NULL }; gint count; proto_item *ti; guint8 control = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_wisun_usie_channel_control, ett_wisun_usie_channel_control, fields_usie_channel, ENC_LITTLE_ENDIAN, BMT_NO_FLAGS); offset++; switch ((control & WISUN_CHANNEL_PLAN) >> 0) { case WISUN_CHANNEL_PLAN_REGULATORY: proto_tree_add_item(tree, hf_wisun_usie_regulatory_domain, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_wisun_usie_operating_class, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; break; case WISUN_CHANNEL_PLAN_EXPLICIT: ti = proto_tree_add_bitmask(tree, tvb, offset, hf_wisun_usie_explicit, ett_wisun_usie_explicit, fields_usie_channel_plan_explicit, ENC_LITTLE_ENDIAN); offset += 3; if (tvb_get_guint8(tvb, offset) & 0xf0) { expert_add_info(pinfo, ti, &ei_wisun_usie_explicit_reserved_bits_not_zero); } offset++; proto_tree_add_item(tree, hf_wisun_usie_number_channels, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; case WISUN_CHANNEL_PLAN_REGULATORY_ID: proto_tree_add_item(tree, hf_wisun_usie_regulatory_domain, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_wisun_usie_channel_plan_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; break; default: expert_add_info(pinfo, tree, &ei_wisun_usie_channel_plan_invalid); return tvb_reported_length(tvb); } switch ((control & WISUN_CHANNEL_FUNCTION) >> 3) { case WISUN_CHANNEL_FUNCTION_FIXED: proto_tree_add_item(tree, hf_wisun_usie_fixed_channel, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; break; case WISUN_CHANNEL_FUNCTION_VENDOR: count = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_wisun_usie_hop_count, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; while (count--) { proto_tree_add_item(tree, hf_wisun_usie_hop_list, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; } break; default: /* Hopping list is implied by the hashing function. */ break; } switch ((control & WISUN_CHANNEL_EXCLUDE) >> 6) { case WISUN_CHANNEL_EXCLUDE_RANGE: count = tvb_get_guint8(tvb, offset); proto_tree_add_item(tree, hf_wisun_usie_number_ranges, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; while (count) { proto_tree_add_item(tree, hf_wisun_usie_exclude_range_start, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(tree, hf_wisun_usie_exclude_range_end, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; count--; } break; case WISUN_CHANNEL_EXCLUDE_MASK: count = tvb_reported_length_remaining(tvb, offset); proto_tree_add_item(tree, hf_wisun_usie_exclude_mask, tvb, offset, count, ENC_NA); offset += count; break; default: /* Assume there is nothing to exclude. */ break; } return offset; } static int dissect_wisun_usie_btie_common(tvbuff_t *tvb, packet_info *pinfo _U_, guint offset, proto_tree *tree) { proto_tree_add_item(tree, hf_wisun_usie_dwell_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(tree, hf_wisun_usie_clock_drift, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; guint clock_drift = tvb_get_guint8(tvb, offset); // "Resolution is 10 microseconds and the valid range of the field value is 0-255 (0 to 2.55msec)" [FANTPS 1v21] proto_tree_add_uint_format_value(tree, hf_wisun_usie_timing_accuracy, tvb, offset, 1, clock_drift, "%1.2fms", clock_drift/100.0); offset++; return offset; } static int dissect_wisun_usie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint offset = 0; item = proto_tree_add_item(tree, hf_wisun_usie, tvb, 0, tvb_reported_length_remaining(tvb, 0), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_usie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie, ENC_LITTLE_ENDIAN); offset += 2; offset = dissect_wisun_usie_btie_common(tvb, pinfo, offset, subtree); return dissect_wisun_schedule_common(tvb, pinfo, offset, subtree); } static int dissect_wisun_bsie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint offset = 0; item = proto_tree_add_item(tree, hf_wisun_bsie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_bsie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wisun_bsie_bcast_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(subtree, hf_wisun_bsie_bcast_schedule_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; offset = dissect_wisun_usie_btie_common(tvb, pinfo, offset, subtree); return dissect_wisun_schedule_common(tvb, pinfo, offset, subtree); } static int dissect_wisun_vpie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint vidlen; item = proto_tree_add_item(tree, hf_wisun_vpie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_vpie); vidlen = wisun_add_wbxml_uint(tvb, subtree, hf_wisun_vpie_vid, 2); call_data_dissector(tvb_new_subset_remaining(tvb, 2 + vidlen), pinfo, subtree); return tvb_reported_length(tvb); } static int dissect_wisun_lcpie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint offset = 0; item = proto_tree_add_item(tree, hf_wisun_lcpie, tvb, 0, tvb_reported_length_remaining(tvb, 0), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_lcpie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wisun_lusie_channel_plan_tag, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; return dissect_wisun_schedule_common(tvb, pinfo, offset, subtree); } static int dissect_wisun_panie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint offset = 0; guint32 routingCost; static int * const fields_panie_flags[] = { &hf_wisun_panie_flag_parent_bsie, &hf_wisun_panie_flag_routing_method, &hf_wisun_panie_flag_lfn_window_style, &hf_wisun_panie_flag_version, NULL }; item = proto_tree_add_item(tree, hf_wisun_panie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_panie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wisun_panie_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item_ret_uint(subtree, hf_wisun_panie_cost, tvb, offset, 2, ENC_LITTLE_ENDIAN, &routingCost); offset += 2; proto_tree_add_bitmask_with_flags(subtree, tvb, offset, hf_wisun_panie_flags, ett_wisun_panie_flags, fields_panie_flags, ENC_LITTLE_ENDIAN, BMT_NO_FLAGS); offset++; col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "Routing Cost: %d", routingCost); return offset; } static int dissect_wisun_netnameie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_netnameie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_netnameie); proto_tree_add_bitmask(subtree, tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_wisun_netnameie_name, tvb, 2, tvb_reported_length_remaining(tvb, 2), ENC_ASCII); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "Netname: %s", tvb_get_string_enc(pinfo->pool, tvb, 2, tvb_reported_length_remaining(tvb, 2), ENC_ASCII)); return tvb_reported_length(tvb); } static int dissect_wisun_panverie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_panverie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_panverie); proto_tree_add_bitmask(subtree, tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_wisun_panverie_version, tvb, 2, 2, ENC_LITTLE_ENDIAN); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "PAN Version: %d", tvb_get_guint16(tvb, 2, ENC_LITTLE_ENDIAN)); return tvb_reported_length(tvb); } static int dissect_wisun_gtkhashie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_gtkhashie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_gtkhashie); proto_tree_add_bitmask(subtree, tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_wisun_gtkhashie_gtk0, tvb, 2, 8, ENC_NA); proto_tree_add_item(subtree, hf_wisun_gtkhashie_gtk1, tvb, 10, 8, ENC_NA); proto_tree_add_item(subtree, hf_wisun_gtkhashie_gtk2, tvb, 18, 8, ENC_NA); proto_tree_add_item(subtree, hf_wisun_gtkhashie_gtk3, tvb, 26, 8, ENC_NA); return 34; } static int dissect_wisun_pomie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint8 number_operating_modes; guint8 offset = 0; static int* const wisun_pomie_fields[] = { &hf_wisun_pomie_number_operating_modes, &hf_wisun_pomie_mdr_command_capable_flag, &hf_wisun_pomie_reserved, NULL }; item = proto_tree_add_item(tree, hf_wisun_pomie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_pomie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); offset += 2; number_operating_modes = tvb_get_guint8(tvb, offset) & WISUN_PIE_PHY_OPERATING_MODES_MASK; proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_pomie_hdr, ett_wisun_pomie_hdr, wisun_pomie_fields, ENC_NA); offset++; for (guint8 i = 0; i < number_operating_modes; i++) { wisun_add_phy_mode_id(tvb, subtree, offset, hf_wisun_pomie_phy_mode_id, &hf_wisun_pomie_phy_type, &hf_wisun_pomie_phy_mode_fsk, &hf_wisun_pomie_phy_mode_ofdm); offset++; } return tvb_reported_length(tvb); } static int dissect_wisun_lfnverie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_lfnverie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_lfnverie); proto_tree_add_bitmask(subtree, tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_wisun_lfnverie_version, tvb, 2, 2, ENC_LITTLE_ENDIAN); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "LFN Version: %d", tvb_get_guint16(tvb, 2, ENC_LITTLE_ENDIAN)); return tvb_reported_length(tvb); } static int dissect_wisun_lgtkhashie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *item; proto_tree *subtree; guint8 offset = 0; guint8 lgtkhash_control = 0; static int * const fields_lgtkhashie_flags[] = { &hf_wisun_lgtkhashie_flag_includes_lgtk0, &hf_wisun_lgtkhashie_flag_includes_lgtk1, &hf_wisun_lgtkhashie_flag_includes_lgtk2, &hf_wisun_lgtkhashie_flag_active_lgtk_index, NULL }; item = proto_tree_add_item(tree, hf_wisun_lgtkhashie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_lgtkhashie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); offset += 2; lgtkhash_control = tvb_get_guint8(tvb, offset); proto_tree_add_bitmask_with_flags(subtree, tvb, offset, hf_wisun_lgtkhashie_flags, ett_wisun_lgtkhashie_flags, fields_lgtkhashie_flags, ENC_LITTLE_ENDIAN, BMT_NO_FLAGS); offset++; if (lgtkhash_control & WISUN_LGTKHASH_LGTK0_INCLUDED_MASK) { proto_tree_add_item(subtree, hf_wisun_lgtkhashie_gtk0, tvb, offset, 8, ENC_NA); offset += 8; } if (lgtkhash_control & WISUN_LGTKHASH_LGTK1_INCLUDED_MASK) { proto_tree_add_item(subtree, hf_wisun_lgtkhashie_gtk1, tvb, offset, 8, ENC_NA); offset += 8; } if (lgtkhash_control & WISUN_LGTKHASH_LGTK2_INCLUDED_MASK) { proto_tree_add_item(subtree, hf_wisun_lgtkhashie_gtk2, tvb, offset, 8, ENC_NA); offset += 8; } return offset; } static int dissect_wisun_lbatsie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { guint8 offset = 0; proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_lbatsie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_lbatsie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wisun_lbatsie_additional_tx, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(subtree, hf_wisun_lbatsie_next_tx_delay, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; return offset; } static int dissect_wisun_jmie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { static int * const fields_jmie_metric_hdr[] = { &hf_wisun_jmie_metric_id, &hf_wisun_jmie_metric_len, NULL }; guint8 offset = 0; proto_item *item; proto_tree *subtree; item = proto_tree_add_item(tree, hf_wisun_jmie, tvb, 0, tvb_reported_length(tvb), ENC_NA); subtree = proto_item_add_subtree(item, ett_wisun_jmie); proto_tree_add_bitmask(subtree, tvb, offset, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie_short, ENC_LITTLE_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wisun_jmie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; while (tvb_reported_length_remaining(tvb, offset) > 0) { guint8 metric_hdr = tvb_get_guint8(tvb, offset); guint8 metric_len = (metric_hdr & WISUN_PIE_JM_LEN_MASK) >> 6; proto_tree *metric_subtree; if (metric_len == 3) metric_len = 4; switch (metric_hdr & WISUN_PIE_JM_ID_MASK) { case WISUN_PIE_JM_ID_PLF: item = proto_tree_add_item(subtree, hf_wisun_jmie_metric_plf, tvb, offset, 1 + metric_len, ENC_NA); metric_subtree = proto_item_add_subtree(item, ett_wisun_jmie_metric_plf); proto_tree_add_bitmask(metric_subtree, tvb, offset, hf_wisun_jmie_metric_hdr, ett_wisun_jmie_metric_hdr, fields_jmie_metric_hdr, ENC_NA); offset += 1; proto_tree_add_item(metric_subtree, hf_wisun_jmie_metric_plf_data, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; default: item = proto_tree_add_item(subtree, hf_wisun_jmie_metric_unknown, tvb, offset, 1 + metric_len, ENC_NA); metric_subtree = proto_item_add_subtree(item, ett_wisun_jmie_metric_unknown); proto_tree_add_bitmask(metric_subtree, tvb, offset, hf_wisun_jmie_metric_hdr, ett_wisun_jmie_metric_hdr, fields_jmie_metric_hdr, ENC_NA); offset += 1; expert_add_info(pinfo, metric_subtree, &ei_wisun_jmie_metric_unsupported); call_data_dissector(tvb_new_subset_length(tvb, offset, metric_len), pinfo, metric_subtree); break; } offset += metric_len; } return offset; } static int dissect_wisun_pie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ies_tree, void *data) { proto_tree *tree = ieee802154_create_pie_tree(tvb, ies_tree, hf_wisun_pie, ett_wisun_pie); guint offset = 2; while (tvb_reported_length_remaining(tvb, offset) > 1) { /* Wi-SUN Payload IE contains nested IE's using the same format as IEEE802.15.4 */ guint16 wsie_ie = tvb_get_letohs(tvb, offset); guint16 wsie_len; tvbuff_t * wsie_tvb; if (wsie_ie & IEEE802154_PSIE_TYPE_MASK) { /* long format: Table 7-17-Sub-ID allocation for long format */ wsie_len = (wsie_ie & IEEE802154_PSIE_LENGTH_MASK_LONG); wsie_tvb = tvb_new_subset_length(tvb, offset, wsie_len + 2); switch ((wsie_ie & IEEE802154_PSIE_ID_MASK_LONG) >> 11) { case WISUN_PIE_SUBID_US: dissect_wisun_usie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_BS: dissect_wisun_bsie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_VP: dissect_wisun_vpie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_LCP: dissect_wisun_lcpie(wsie_tvb, pinfo, tree, data); break; default:{ proto_item *item = proto_tree_add_item(tree, hf_wisun_unknown_ie, wsie_tvb, 0, tvb_reported_length(wsie_tvb), ENC_NA); proto_tree *subtree = proto_item_add_subtree(item, ett_wisun_unknown_ie); proto_tree_add_bitmask(subtree, wsie_tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie, ENC_LITTLE_ENDIAN); expert_add_info(pinfo, subtree, &ei_wisun_wsie_unsupported); call_data_dissector(tvb_new_subset_remaining(wsie_tvb, 2), pinfo, subtree); break; } } } else { /* short format: Table 7-16-Sub-ID allocation for short format */ wsie_len = (wsie_ie & IEEE802154_PSIE_LENGTH_MASK_SHORT); wsie_tvb = tvb_new_subset_length(tvb, offset, wsie_len + 2); switch ((wsie_ie & IEEE802154_PSIE_ID_MASK_SHORT) >> 8) { case WISUN_PIE_SUBID_PAN: dissect_wisun_panie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_NETNAME: dissect_wisun_netnameie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_PANVER: dissect_wisun_panverie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_GTKHASH: dissect_wisun_gtkhashie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_POM: dissect_wisun_pomie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_LFNVER: dissect_wisun_lfnverie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_LGTKHASH: dissect_wisun_lgtkhashie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_LBATS: dissect_wisun_lbatsie(wsie_tvb, pinfo, tree, data); break; case WISUN_PIE_SUBID_JM: dissect_wisun_jmie(wsie_tvb, pinfo, tree, data); break; default:{ proto_item *item = proto_tree_add_item(tree, hf_wisun_unknown_ie, wsie_tvb, 0, tvb_reported_length(wsie_tvb), ENC_NA); proto_tree *subtree = proto_item_add_subtree(item, ett_wisun_unknown_ie); proto_tree_add_bitmask(subtree, wsie_tvb, 0, hf_wisun_wsie, ett_wisun_wsie_bitmap, wisun_format_nested_ie, ENC_LITTLE_ENDIAN); expert_add_info(pinfo, subtree, &ei_wisun_wsie_unsupported); call_data_dissector(tvb_new_subset_remaining(wsie_tvb, 2), pinfo, subtree); break; } } } offset += tvb_reported_length(wsie_tvb); } return offset; } static int dissect_wisun_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint8 offset = 0; guint8 cmd_subid; cmd_subid = tvb_get_guint8(tvb, offset); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN"); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd_subid, wisun_cmd_vals, "Unknown Wi-SUN MAC Command")); proto_tree_add_item(tree, hf_wisun_cmd_subid, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; switch (cmd_subid) { case WISUN_CMD_MDR: wisun_add_phy_mode_id(tvb, tree, offset, hf_wisun_cmd_mdr_phy_mode_id, &hf_wisun_cmd_mdr_phy_type, &hf_wisun_cmd_mdr_phy_mode_fsk, &hf_wisun_cmd_mdr_phy_mode_ofdm); break; default: call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree); break; } return offset; } /*----------------------------------------------- * Wi-SUN FAN Security Extensions Dissection *---------------------------------------------*/ static int dissect_wisun_sec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ws_root; proto_tree *ws_tree; guint8 function = tvb_get_guint8(tvb, 0); const char *function_name = val_to_str_const(function, wisun_sec_functions, "Unknown Function"); /* Create the protocol tree. */ ws_root = proto_tree_add_protocol_format(tree, proto_wisun_sec, tvb, 0, -1, "Wi-SUN %s", function_name); ws_tree = proto_item_add_subtree(ws_root, ett_wisun_sec); /* Add the protocol name. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN"); col_set_str(pinfo->cinfo, COL_INFO, function_name); /* Decode based on the function code. */ proto_tree_add_item(ws_tree, hf_wisun_sec_function, tvb, 0, 1, ENC_LITTLE_ENDIAN); switch (function) { case 0x01:{ const char *err_name = val_to_str_const(tvb_get_guint8(tvb, 1), wisun_sec_sm_errors, "Unknown Error"); col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", err_name); proto_item_append_text(ws_root, ": %s", err_name); proto_tree_add_item(ws_tree, hf_wisun_sec_error_type, tvb, 1, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(ws_tree, hf_wisun_sec_error_nonce, tvb, 2, tvb_reported_length_remaining(tvb, 2), ENC_NA); return tvb_reported_length(tvb); } default: call_data_dissector(tvb_new_subset_remaining(tvb, 2), pinfo, ws_tree); return tvb_reported_length(tvb); } } /*----------------------------------------------- * Wi-SUN FAN EAPOL Relay *---------------------------------------------*/ static int dissect_wisun_eapol_relay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint offset = 0; proto_item *subitem = proto_tree_add_item(tree, proto_wisun_eapol_relay, tvb, offset, 9, ENC_NA); proto_tree *subtree = proto_item_add_subtree(subitem, ett_wisun_eapol_relay); proto_tree_add_item(subtree, hf_wisun_eapol_relay_sup, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; proto_tree_add_item(subtree, hf_wisun_eapol_relay_kmp_id, tvb, offset, 1, ENC_NA); offset += 1; int up = 0; // eapol.type == EAP_PACKET? if (tvb_get_guint8(tvb, offset+1) == 0) { up = tvb_get_guint8(tvb, offset+4) == 2; // eap.code == EAP_CODE_RESPONSE } else { up = (tvb_get_guint8(tvb, offset+6) & 0x80) == 0; // Key Info ACK==0 } proto_item* diritem = proto_tree_add_boolean(subtree, hf_wisun_eapol_relay_direction, tvb, offset, 0, (guint32) up); proto_item_set_generated(diritem); int r = call_dissector(eapol_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree); // UTF-8 arrow up or down col_append_str(pinfo->cinfo, COL_INFO, up ? " [Relay \xe2\x86\x91]" : " [Relay \xe2\x86\x93]"); return offset + r; } /*----------------------------------------------- * Wi-SUN Netricity Segment Control *---------------------------------------------*/ static int dissect_wisun_netricity_sc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { static int * const fields_sc[] = { &hf_wisun_netricity_sc_reserved, &hf_wisun_netricity_sc_tone_map_request, &hf_wisun_netricity_sc_contention_control, &hf_wisun_netricity_sc_channel_access_priority, &hf_wisun_netricity_sc_last_segment, NULL }; guint offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wi-SUN Netricity"); proto_item *subitem = proto_tree_add_item(tree, proto_wisun_netricity_sc, tvb, offset, -1, ENC_NA); proto_tree *subtree = proto_item_add_subtree(subitem, ett_wisun_netricity_sc); gboolean is_last = tvb_get_guint8(tvb, 0) & 1; proto_tree_add_bitmask(subtree, tvb, offset++, hf_wisun_netricity_sc_flags, ett_wisun_netricity_sc_bitmask, fields_sc, ENC_BIG_ENDIAN); guint32 seg_count; guint32 seg_len; proto_tree_add_item_ret_uint(subtree, hf_wisun_netricity_sc_segment_count, tvb, offset, 2, ENC_BIG_ENDIAN, &seg_count); proto_tree_add_item_ret_uint(subtree, hf_wisun_netricity_sc_segment_length, tvb, offset, 2, ENC_BIG_ENDIAN, &seg_len); offset += 2; gboolean is_segmented = !is_last || seg_count != 0; proto_tree *ieee802154_tree; ieee802154_packet *packet; tvbuff_t *frame = tvb_new_subset_remaining(tvb, offset); // if security is used, all segments have the flag set in the FCF, but only the first has the Auxiliary Security Header guint mhr_len = ieee802154_dissect_header(frame, pinfo, is_segmented ? subtree : tree, seg_count == 0 ? 0 : IEEE802154_DISSECT_HEADER_OPTION_NO_AUX_SEC_HDR, &ieee802154_tree, &packet); if (!mhr_len) { return tvb_captured_length(tvb); } frame = tvb_new_subset_length(frame, 0, mhr_len + seg_len); if (is_segmented) { gboolean save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; fragment_head *frag_msg = fragment_add_seq_check(&netricity_reassembly_table, frame, seg_count == 0 ? 0 : mhr_len, pinfo, packet->seqno, NULL, seg_count, (seg_count == 0 ? mhr_len : 0) + seg_len, !is_last); tvbuff_t *reframe = process_reassembled_data(tvb, offset, pinfo, "Reassembled segments", frag_msg, &netricity_scr_frag_items, NULL, subtree); if (reframe) { call_dissector(ieee802154_nofcs_handle, reframe, pinfo, tree); col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled %u segments)", seg_count + 1); } else { call_data_dissector(tvb_new_subset_remaining(frame, mhr_len), pinfo, subtree); col_append_fstr(pinfo->cinfo, COL_INFO, " (Segment %u)", seg_count); } pinfo->fragmented = save_fragmented; } else { tvbuff_t *payload = ieee802154_decrypt_payload(frame, mhr_len, pinfo, ieee802154_tree, packet); if (payload) { guint pie_size = ieee802154_dissect_payload_ies(payload, pinfo, ieee802154_tree, packet); payload = tvb_new_subset_remaining(payload, pie_size); ieee802154_dissect_frame_payload(payload, pinfo, ieee802154_tree, packet, TRUE); } } return tvb_captured_length(tvb); } /*----------------------------------------------- * Wi-SUN Protocol Registration *---------------------------------------------*/ void proto_register_wisun(void) { static hf_register_info hf[] = { /* Wi-SUN Header IEs */ { &hf_wisun_subid, { "Header Sub ID", "wisun.subid", FT_UINT8, BASE_HEX|BASE_SPECIAL_VALS, VALS(wisun_subid_vals), 0x0, NULL, HFILL } }, { &hf_wisun_unknown_ie, { "Unknown IE", "wisun.unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_uttie, { "UTT-IE", "wisun.uttie", FT_NONE, BASE_NONE, NULL, 0x0, "Unicast Timing IE", HFILL } }, { &hf_wisun_uttie_type, { "Frame Type", "wisun.uttie.type", FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(wisun_frame_type_vals), 0x0, NULL, HFILL } }, { &hf_wisun_uttie_ufsi, { "UFSI", "wisun.uttie.ufsi", FT_UINT24, BASE_DEC, NULL, 0x0, "Unicast Fractional Sequence Interval", HFILL } }, { &hf_wisun_btie, { "BT-IE", "wisun.btie", FT_NONE, BASE_NONE, NULL, 0x0, "Broadcast Timing IE", HFILL } }, { &hf_wisun_btie_slot, { "BSN", "wisun.btie.slot", FT_UINT24, BASE_DEC, NULL, 0x0, "Broadcast Slot Number", HFILL } }, { &hf_wisun_btie_bio, { "BIO", "wisun.btie.bio", FT_UINT24, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, "Broadcast Interval Offset", HFILL } }, { &hf_wisun_fcie, { "FC-IE", "wisun.fcie", FT_NONE, BASE_NONE, NULL, 0x0, "Flow Control IE", HFILL } }, { &hf_wisun_fcie_tx, { "Transmit Flow Control", "wisun.fcie.tx", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_fcie_rx, { "Receive Flow Control", "wisun.fcie.rx", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_fcie_src, { "Source Address", "wisun.fcie.src", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_fcie_initial_frame, { "Initial Frame", "wisun.fcie.initial_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0, NULL, HFILL } }, { &hf_wisun_rslie, { "RSL-IE", "wisun.rslie", FT_NONE, BASE_NONE, NULL, 0x0, "Received Signal Level IE", HFILL } }, { &hf_wisun_rslie_rsl, { "Received Signal Level", "wisun.rslie.rsl", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_vhie, { "VH-IE", "wisun.vhie", FT_NONE, BASE_NONE, NULL, 0x0, "Vendor Header IE", HFILL } }, { &hf_wisun_vhie_vid, { "Vendor ID", "wisun.vhie.vid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_eaie, { "EA-IE", "wisun.eaie", FT_NONE, BASE_NONE, NULL, 0x0, "EAPOL Authenticator IE", HFILL } }, { &hf_wisun_eaie_eui, { "Authenticator EUI-64", "wisun.eaie.eui", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_luttie, { "LUTT-IE", "wisun.luttie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Unicast Timing and Frame Type IE", HFILL } }, { &hf_wisun_luttie_usn, { "USN", "wisun.luttie.usn", FT_UINT16, BASE_DEC, NULL, 0x0, "Unicast Slot Number", HFILL } }, { &hf_wisun_luttie_uio, { "UIO", "wisun.luttie.uio", FT_UINT24, BASE_DEC, NULL, 0x0, "Unicast Interval Offset", HFILL } }, { &hf_wisun_lbtie, { "LBT-IE", "wisun.lbtie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Broadcast Timing IE", HFILL } }, { &hf_wisun_lbtie_slot, { "LFN BSN", "wisun.lbtie.slot", FT_UINT24, BASE_DEC, NULL, 0x0, "LFN Broadcast Slot Number", HFILL } }, { &hf_wisun_lbtie_bio, { "LFN BIO", "wisun.lbtie.bio", FT_UINT24, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, "LFN Broadcast Interval Offset", HFILL } }, { &hf_wisun_nrie, { "NR-IE", "wisun.nrie", FT_NONE, BASE_NONE, NULL, 0x0, "Node Role IE", HFILL } }, { &hf_wisun_nrie_nr_id, { "Node Role ID", "wisun.nrie.nr_id", FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(wisun_wsie_node_role_vals), 0x0, NULL, HFILL } }, { &hf_wisun_nrie_timing_accuracy, { "Timing Accuracy", "wisun.nrie.timing_accuracy", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_nrie_listening_interval_min, { "Listening Interval Min", "wisun.nriw.listening_interval_min", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_nrie_listening_interval_max, { "Listening Interval Max", "wisun.nriw.listening_interval_max", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lusie, { "LUS-IE", "wisun.lusie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Unicast Schedule IE", HFILL } }, { &hf_wisun_lusie_listen_interval, { "Listen Interval", "wisun.lusie.listen", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lusie_channel_plan_tag, { "Channel Plan Tag", "wisun.lusie.channeltag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_flusie, { "FLUS-IE", "wisun.flusie", FT_NONE, BASE_NONE, NULL, 0x0, "FFN for LFN Unicast Schedule IE", HFILL } }, { &hf_wisun_flusie_dwell_interval, { "Dwell Interval", "wisun.flusie.dwell", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_flusie_channel_plan_tag, { "Channel Plan Tag", "wisun.flusie.channeltag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbsie, { "LBS-IE", "wisun.lbsie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Broadcast Schedule IE", HFILL } }, { &hf_wisun_lbsie_broadcast_interval, { "Broadcast Interval", "wisun.lbsie.broadcast", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbsie_broadcast_id, { "Broadcast Schedule Identifier", "wisun.lbsie.broadcast_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbsie_channel_plan_tag, { "Channel Plan Tag", "wisun.lbsie.channeltag", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbsie_broadcast_sync_period, { "Broadcast Sync Period", "wisun.lbsie.broadcast_sync_period", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie, { "LFN Network Discovery IE", "wisun.lndie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie_response_threshold, { "Response Threshold", "wisun.lndie.response_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie_response_delay, { "Response Delay", "wisun.lndie.response_delay", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie_discovery_slot_time, { "Discovery Slot Time (DST)", "wisun.lndie.discovery_slot_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie_discovery_slots, { "Discovery Slots", "wisun.lndie.discovery_slots", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lndie_discovery_first_slot, { "Discovery First Slot", "wisun.lndie.discovery_first_slot", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_ltoie, { "LTO-IE", "wisun.ltoie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Timing Offset IE", HFILL } }, { &hf_wisun_ltoie_offset, { "Offset", "wisun.ltoie.offset", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_ltoie_listening_interval, { "Adjusted Listening Interval", "wisun.ltoie.listening_interval", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panidie, { "PANID-IE", "wisun.panidie", FT_NONE, BASE_NONE, NULL, 0x0, "PAN Identifier IE", HFILL } }, { &hf_wisun_panidie_panid, { "PAN Identifier", "wisun.panidie.panid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_rtie, { "Rendezvous Time IE", "wisun.rtie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_rtie_rendezvous_time, { "Rendezvous Time", "wisun.rtie.rendezvous", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_rtie_wakeup_interval, { "Wake-up Interval", "wisun.rtie.wakeup", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbcie, { "LFN Broadcast Configuration IE", "wisun.lbcie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbcie_broadcast_interval, { "Broadcast Interval", "wisun.lbcie.broadcast", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbcie_broadcast_sync_period, { "Broadcast Sync Period", "wisun.lbcie.broadcast_sync_period", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Wi-SUN Payload IE */ { &hf_wisun_pie, { "Wi-SUN Payload IE", "wisun.pie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_wsie, { "Wi-SUN Sub IE", "wisun.wsie", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_wsie_type, { "Type", "wisun.wsie.type", FT_UINT16, BASE_DEC, VALS(wisun_wsie_types), IEEE802154_PSIE_TYPE_MASK, NULL, HFILL } }, { &hf_wisun_wsie_id, { "Sub ID", "wisun.wsie.id", FT_UINT16, BASE_HEX, VALS(wisun_wsie_names), IEEE802154_PSIE_ID_MASK_LONG, NULL, HFILL } }, { &hf_wisun_wsie_length, { "Length", "wisun.wsie.length", FT_UINT16, BASE_DEC, NULL, IEEE802154_PSIE_LENGTH_MASK_LONG, NULL, HFILL } }, { &hf_wisun_wsie_id_short, { "Sub ID", "wisun.wsie.id", FT_UINT16, BASE_HEX, VALS(wisun_wsie_names_short), IEEE802154_PSIE_ID_MASK_SHORT, NULL, HFILL } }, { &hf_wisun_wsie_length_short, { "Length", "wisun.wsie.length", FT_UINT16, BASE_DEC, NULL, IEEE802154_PSIE_LENGTH_MASK_SHORT, NULL, HFILL } }, { &hf_wisun_usie, { "Unicast Schedule IE", "wisun.usie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_dwell_interval, { "Dwell Interval", "wisun.usie.dwell", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_usie_clock_drift, { "Clock Drift", "wisun.usie.drift", FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(wisun_usie_clock_drift_names), 0x0, "Clock Drift in +/- ppm", HFILL } }, { &hf_wisun_usie_timing_accuracy, { "Timing Accuracy", "wisun.usie.accuracy", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_channel_control, { "Channel Control", "wisun.usie.channel", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_channel_plan, { "Channel Plan", "wisun.usie.channel.plan", FT_UINT8, BASE_DEC, VALS(wisun_channel_plan_names), WISUN_CHANNEL_PLAN, NULL, HFILL } }, { &hf_wisun_usie_channel_function, { "Channel Function", "wisun.usie.channel.function", FT_UINT8, BASE_DEC, VALS(wisun_channel_function_names), WISUN_CHANNEL_FUNCTION, NULL, HFILL } }, { &hf_wisun_usie_channel_exclude, { "Excluded Channels", "wisun.usie.channel.exclude", FT_UINT8, BASE_DEC, VALS(wisun_channel_exclude_names), WISUN_CHANNEL_EXCLUDE, NULL, HFILL } }, { &hf_wisun_usie_regulatory_domain, { "Regulatory Domain", "wisun.usie.domain", FT_UINT8, BASE_DEC, VALS(wisun_channel_regulatory_domains_names), 0x0, NULL, HFILL } }, { &hf_wisun_usie_operating_class, { "Operating Class", "wisun.usie.class", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_channel_plan_id, { "Channel Plan ID", "wisun.usie.channel_plan_id", FT_UINT8, BASE_DEC|BASE_RANGE_STRING, RVALS(wisun_channel_plan_id_names), 0x0, NULL, HFILL } }, { &hf_wisun_usie_explicit, { "Explicit Channel Plan", "wisun.usie.explicit", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_explicit_frequency, { "CH0 Frequency", "wisun.usie.explicit.frequency", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_khz, WISUN_CH_PLAN_EXPLICIT_FREQ, NULL, HFILL } }, { &hf_wisun_usie_explicit_reserved, { "Reserved", "wisun.usie.explicit.reserved", FT_UINT32, BASE_DEC, NULL, WISUN_CH_PLAN_EXPLICIT_RESERVED, NULL, HFILL } }, { &hf_wisun_usie_explicit_spacing, { "Channel Spacing", "wisun.usie.explicit.spacing", FT_UINT32, BASE_DEC, VALS(wisun_channel_spacing_names), WISUN_CH_PLAN_EXPLICIT_SPACING, NULL, HFILL } }, { &hf_wisun_usie_number_channels, { "Number of Channels", "wisun.usie.num_channels", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_fixed_channel, { "Fixed Channel", "wisun.usie.fixed_channel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_hop_count, { "Chanel Hop Count", "wisun.usie.hop_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_hop_list, { "Channel Hop List", "wisun.usie.hop_list", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_number_ranges, { "Number of Excluded Ranges", "wisun.usie.num_ranges", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_exclude_range_start, { "Excluded Channel Range Start", "wisun.usie.exclude.range.start", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_exclude_range_end, { "Excluded Channel Range End", "wisun.usie.exclude.range.end", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_usie_exclude_mask, { "Excluded Channel Mask", "wisun.usie.exclude.mask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_bsie, { "BS-IE", "wisun.bsie", FT_NONE, BASE_NONE, NULL, 0x0, "Broadcast Schedule IE", HFILL } }, { &hf_wisun_bsie_bcast_interval, { "Broadcast Interval", "wisun.bsie.interval", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_bsie_bcast_schedule_id, { "Broadcast Schedule ID", "wisun.bsie.schedule", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_vpie, { "Vendor Payload IE", "wisun.vpie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_vpie_vid, { "Vendor ID", "wisun.vpie.vid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lcpie, { "LCP-IE", "wisun.lcpie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Channel Plan IE", HFILL } }, { &hf_wisun_panie, { "PAN-IE", "wisun.panie", FT_NONE, BASE_NONE, NULL, 0x0, "PAN Information IE", HFILL } }, { &hf_wisun_panie_size, { "PAN Size", "wisun.panie.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panie_cost, { "Routing Cost", "wisun.panie.cost", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panie_flags, { "PAN Flags", "wisun.panie.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panie_flag_parent_bsie, { "Use Parent BS-IE", "wisun.panie.flags.parent_bsie", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_wisun_panie_flag_routing_method, { "Routing Method", "wisun.panie.flags.routing_method", FT_UINT8, BASE_HEX, VALS(wisun_routing_methods), 0x02, NULL, HFILL } }, { &hf_wisun_panie_flag_lfn_window_style, { "LFN Window Style", "wisun.panie.flags.lfn_window_style", FT_UINT8, BASE_DEC, VALS(wisun_window_style), 0x04, NULL, HFILL } }, { &hf_wisun_panie_flag_version, { "FAN TPS Version", "wisun.panie.flags.version", FT_UINT8, BASE_DEC, NULL, 0xe0, NULL, HFILL } }, { &hf_wisun_netnameie, { "Network Name IE", "wisun.netnameie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_netnameie_name, { "Network Name", "wisun.netnameie.name", FT_STRING, ENC_ASCII, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panverie, { "PAN Version IE", "wisun.panverie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_panverie_version, { "PAN Version", "wisun.panverie.version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_gtkhashie, { "GTK Hash IE", "wisun.gtkhashie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_gtkhashie_gtk0, { "GTK0 Hash", "wisun.gtkhashie.gtk0", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_gtkhashie_gtk1, { "GTK1 Hash", "wisun.gtkhashie.gtk1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_gtkhashie_gtk2, { "GTK2 Hash", "wisun.gtkhashie.gtk2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_gtkhashie_gtk3, { "GTK3 Hash", "wisun.gtkhashie.gtk3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_pomie, { "POM-IE", "wisun.pomie", FT_NONE, BASE_NONE, NULL, 0x0, "PHY Operating Modes IE", HFILL } }, { &hf_wisun_pomie_hdr, { "PHY Operating Modes Header", "wisun.pomie.hdr", FT_UINT8, BASE_HEX | BASE_NO_DISPLAY_VALUE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_pomie_number_operating_modes, { "Number of PHY Operating Modes", "wisun.pomie.number_operating_modes", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_wisun_pomie_mdr_command_capable_flag, { "MDR Command Capable Flag", "wisun.pomie.mdr_command_capable_flag", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL } }, { &hf_wisun_pomie_reserved, { "Reserved", "wisun.pomie.reserved", FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL } }, { &hf_wisun_pomie_phy_mode_id, { "PHY Operating Modes ID", "wisun.pomie.phy_mode_id", FT_UINT8, BASE_HEX | BASE_NO_DISPLAY_VALUE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_pomie_phy_type, { "PHY Type", "wisun.pomie.phy_type", FT_UINT8, BASE_HEX, VALS(wisun_phy_type_vals), WISUN_PIE_PHY_TYPE, NULL, HFILL } }, { &hf_wisun_pomie_phy_mode_fsk, { "PHY Mode FSK", "wisun.pomie.phy_mode_fsk", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(wisun_phy_mode_fsk_vals), WISUN_PIE_PHY_OPERATING_MODES_MASK, NULL, HFILL } }, { &hf_wisun_pomie_phy_mode_ofdm, { "PHY Mode OFDM", "wisun.pomie.phy_mode_ofdm", FT_UINT8, BASE_HEX | BASE_RANGE_STRING, RVALS(wisun_phy_mode_ofdm_vals), WISUN_PIE_PHY_OPERATING_MODES_MASK, NULL, HFILL } }, { &hf_wisun_lfnverie, { "PAN Version IE", "wisun.lfnverie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lfnverie_version, { "PAN Version", "wisun.lfnverie.version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lgtkhashie, { "LFN GTK Hash IE", "wisun.lgtkhashie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lgtkhashie_flags, { "LFN GTK Hash Flags", "wisun.lgtkhashie.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lgtkhashie_flag_includes_lgtk0, { "LFN GTK Hash Flag Includes LGTK0", "wisun.lgtkhashie.flag.includes_lgtk0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL } }, { &hf_wisun_lgtkhashie_flag_includes_lgtk1, { "LFN GTK Hash Flag Includes LGTK1", "wisun.lgtkhashie.flag.includes_lgtk1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL } }, { &hf_wisun_lgtkhashie_flag_includes_lgtk2, { "LFN GTK Hash Flag Includes LGTK2", "wisun.lgtkhashie.flag.includes_lgtk2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL } }, { &hf_wisun_lgtkhashie_flag_active_lgtk_index, { "LFN GTK Hash Flag Active LGTK Index", "wisun.lgtkhashie.flag.active_lgtk_index", FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL } }, { &hf_wisun_lgtkhashie_gtk0, { "LGTK0 Hash", "wisun.lgtkhashie.lgtk0", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lgtkhashie_gtk1, { "LGTK1 Hash", "wisun.lgtkhashie.lgtk1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lgtkhashie_gtk2, { "LGTK2 Hash", "wisun.lgtkhashie.lgtk2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbatsie, { "LBATS-IE", "wisun.lbatsie", FT_NONE, BASE_NONE, NULL, 0x0, "LFN Broadcast Additional Transmit Schedule IE", HFILL } }, { &hf_wisun_lbatsie_additional_tx, { "Additional Transmissions", "wisun.lbatsie.additional_tx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_lbatsie_next_tx_delay, { "Next Transmit Delay", "wisun.lbatsie.next_tx_delay", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL } }, { &hf_wisun_jmie, { "JM-IE", "wisun.jmie", FT_NONE, BASE_NONE, NULL, 0x0, "Join Metrics IE", HFILL } }, { &hf_wisun_jmie_version, { "Content Version", "wisun.jmie.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_jmie_metric_hdr, { "Metric Header", "wisun.jmie.metric.hdr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_jmie_metric_id, { "Metric ID", "wisun.jmie.metric.id", FT_UINT8, BASE_DEC, VALS(wisun_metric_id), WISUN_PIE_JM_ID_MASK, NULL, HFILL } }, { &hf_wisun_jmie_metric_len, { "Metric Length", "wisun.jmie.metric.len", FT_UINT8, BASE_DEC, VALS(wisun_metric_len), WISUN_PIE_JM_LEN_MASK, NULL, HFILL } }, { &hf_wisun_jmie_metric_plf, { "JM-PLF", "wisun.jmie.metric.plf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_jmie_metric_plf_data, { "PAN Load Factor", "wisun.jmie.metric.plf.data", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0x0, NULL, HFILL } }, { &hf_wisun_jmie_metric_unknown, { "Unknown Metric", "wisun.jmie.metric.unknown", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* Wi-SUN FAN Security Extension */ { &hf_wisun_sec_function, { "Function Code", "wisun.sec.function", FT_UINT8, BASE_HEX, VALS(wisun_sec_functions), 0x0, NULL, HFILL } }, { &hf_wisun_sec_error_type, { "Error Type", "wisun.sec.error", FT_UINT8, BASE_HEX, VALS(wisun_sec_sm_errors), 0x0, NULL, HFILL } }, { &hf_wisun_sec_error_nonce, { "Initiator Nonce", "wisun.sec.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, /* EAPOL Relay */ { &hf_wisun_eapol_relay_sup, { "SUP EUI-64", "wisun.eapol_relay.sup", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wisun_eapol_relay_kmp_id, { "KMP ID", "wisun.eapol_relay.kmp_id", FT_UINT8, BASE_DEC, VALS(ieee802154_mpx_kmp_id_vals), 0x0, NULL, HFILL }}, { &hf_wisun_eapol_relay_direction, { "Direction", "wisun.eapol_relay.direction", FT_BOOLEAN, BASE_NONE, TFS(&tfs_up_down), 0x0, NULL, HFILL }}, { &hf_wisun_cmd_subid, { "Command Sub-ID", "wisun.cmd", FT_UINT8, BASE_DEC, VALS(wisun_cmd_vals), 0x0, "Wi-SUN MAC Command Sub-ID", HFILL }}, { &hf_wisun_cmd_mdr_phy_mode_id, { "PHY Mode ID", "wisun.cmd.mdr.phy_mode_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wisun_cmd_mdr_phy_type, { "PHY Type", "wisun.cmd.mdr.phy_type", FT_UINT8, BASE_HEX, VALS(wisun_phy_type_vals), WISUN_PIE_PHY_TYPE, NULL, HFILL } }, { &hf_wisun_cmd_mdr_phy_mode_fsk, { "PHY Mode FSK", "wisun.cmd.mdr.phy_mode_fsk", FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(wisun_phy_mode_fsk_vals), WISUN_PIE_PHY_OPERATING_MODES_MASK, NULL, HFILL } }, { &hf_wisun_cmd_mdr_phy_mode_ofdm, { "PHY Mode OFDM", "wisun.cmd.mdr.phy_mode_ofdm", FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(wisun_phy_mode_ofdm_vals), WISUN_PIE_PHY_OPERATING_MODES_MASK, NULL, HFILL } }, /* Wi-SUN Netricity */ { &hf_wisun_netricity_nftie, { "Netricity Frame Type IE", "wisun.netricity.nftie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_netricity_nftie_type, { "Frame Type", "wisun.netricity.nftie.type", FT_UINT8, BASE_DEC, VALS(wisun_frame_type_vals), 0x0, NULL, HFILL } }, { &hf_wisun_netricity_lqiie, { "Link Quality Index IE", "wisun.netricity.lqiie", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_netricity_lqiie_lqi, { "Link Quality Index", "wisun.netricity.lqiie.lqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* Wi-SUN Netricity Segment Control Field and reassembly */ { &hf_wisun_netricity_sc_flags, { "Segment Control", "wisun.netricity.sc.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wisun_netricity_sc_reserved, { "Reserved", "wisun.netricity.sc.reserved", FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL } }, { &hf_wisun_netricity_sc_tone_map_request, { "Tone Map Request", "wisun.netricity.sc.tone_map_request", FT_BOOLEAN, 8, NULL, 1<<3, NULL, HFILL } }, { &hf_wisun_netricity_sc_contention_control, { "Contention Control", "wisun.netricity.sc.contention_control", FT_BOOLEAN, 8, TFS(&wisun_netricity_sc_contention_control_tfs), 1<<2, NULL, HFILL } }, { &hf_wisun_netricity_sc_channel_access_priority, { "Channel access priority", "wisun.netricity.sc.channel_access_priority", FT_BOOLEAN, 8, TFS(&tfs_high_normal), 1<<1, NULL, HFILL } }, { &hf_wisun_netricity_sc_last_segment, { "Last Segment", "wisun.netricity.sc.last_segment", FT_BOOLEAN, 8, NULL, 1<<0, NULL, HFILL } }, { &hf_wisun_netricity_sc_segment_count, { "Segment Count", "wisun.netricity.sc.segment_count", FT_UINT16, BASE_DEC, NULL, 0xfc00, NULL, HFILL } }, { &hf_wisun_netricity_sc_segment_length, { "Segment Length", "wisun.netricity.sc.segment_length", FT_UINT16, BASE_DEC, NULL, 0x03ff, NULL, HFILL } }, { &hf_wisun_netricity_scr_segments, { "Message segments", "wisun.netricity.scr.segments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment, { "Message segment", "wisun.netricity.scr.segment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_overlap, { "Message segment overlap", "wisun.netricity.scr.segment.overlap", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_overlap_conflicts, { "Message segment overlapping with conflicting data", "wisun.netricity.scr.segment.overlap.conflicts", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_multiple_tails, { "Message has multiple tail segments", "wisun.netricity.scr.segment.multiple_tails", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_too_long_segment, { "Message segment too long", "wisun.netricity.scr.segment.too_long_segment", FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_error, { "Message segment reassembly error", "wisun.netricity.scr.segment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_segment_count, { "Message segment count", "wisun.netricity.scr.segment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_reassembled_in, { "Reassembled in", "wisun.netricity.scr.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wisun_netricity_scr_reassembled_length, { "Reassembled length", "wisun.netricity.scr.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, }; /* Subtrees */ static gint *ett[] = { &ett_wisun_phy_mode_id, &ett_wisun_unknown_ie, &ett_wisun_uttie, &ett_wisun_btie, &ett_wisun_fcie, &ett_wisun_rslie, &ett_wisun_vhie, &ett_wisun_eaie, &ett_wisun_pie, &ett_wisun_wsie_bitmap, &ett_wisun_usie, &ett_wisun_bsie, &ett_wisun_vpie, &ett_wisun_lcpie, &ett_wisun_panie, &ett_wisun_panie_flags, &ett_wisun_netnameie, &ett_wisun_panverie, &ett_wisun_pomie, &ett_wisun_pomie_hdr, &ett_wisun_gtkhashie, &ett_wisun_lfnverie, &ett_wisun_lgtkhashie, &ett_wisun_lgtkhashie_flags, &ett_wisun_lbatsie, &ett_wisun_jmie, &ett_wisun_jmie_metric_hdr, &ett_wisun_jmie_metric_plf, &ett_wisun_jmie_metric_unknown, &ett_wisun_sec, &ett_wisun_eapol_relay, &ett_wisun_netricity_nftie, &ett_wisun_netricity_lqiie, &ett_wisun_netricity_sc, &ett_wisun_netricity_sc_bitmask, &ett_wisun_netricity_scr_segment, &ett_wisun_netricity_scr_segments, &ett_wisun_luttie, &ett_wisun_nrie, &ett_wisun_lusie, &ett_wisun_flusie, &ett_wisun_lbsie, &ett_wisun_lndie, &ett_wisun_ltoie, &ett_wisun_panidie, &ett_wisun_rtie, &ett_wisun_lbcie, }; static ei_register_info ei[] = { { &ei_wisun_subid_unsupported, { "wisun.subid.unsupported", PI_PROTOCOL, PI_WARN, "Unsupported Header Sub ID", EXPFILL }}, { &ei_wisun_usie_channel_plan_invalid, { "wisun.usie.channel.plan.invalid", PI_PROTOCOL, PI_WARN, "Invalid Channel Plan", EXPFILL }}, { &ei_wisun_wsie_unsupported, { "wisun.wsie.unsupported", PI_PROTOCOL, PI_WARN, "Unsupported Sub-IE ID", EXPFILL }}, { &ei_wisun_edfe_start_not_found, { "wisun.edfe.start_not_found", PI_SEQUENCE, PI_WARN, "EDFE Transfer: start frame not found", EXPFILL }}, { &ei_wisun_usie_explicit_reserved_bits_not_zero, { "wisun.usie.explicit.reserved.invalid", PI_MALFORMED, PI_ERROR, "Reserved bits not zero", EXPFILL }}, { &ei_wisun_jmie_metric_unsupported, { "wisun.jmie.metric.unsupported", PI_PROTOCOL, PI_WARN, "Unsupported Metric ID", EXPFILL }}, }; expert_module_t* expert_wisun; proto_wisun = proto_register_protocol("Wi-SUN Field Area Network", "Wi-SUN", "wisun"); proto_wisun_sec = proto_register_protocol("Wi-SUN FAN Security Extension", "Wi-SUN WM-SEC", "wisun.sec"); proto_wisun_eapol_relay = proto_register_protocol("Wi-SUN FAN EAPOL Relay", "Wi-SUN EAPOL Relay", "wisun.eapol_relay"); proto_wisun_netricity_sc = proto_register_protocol("Wi-SUN Netricity Segment", "Wi-SUN Netricity Segment", "wisun.netricity.sc"); proto_register_field_array(proto_wisun, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wisun = expert_register_protocol(proto_wisun); expert_register_field_array(expert_wisun, ei, array_length(ei)); register_dissector("wisun.sec", dissect_wisun_sec, proto_wisun_sec); edfe_byaddr = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal); wisun_eapol_relay_handle = register_dissector("wisun.eapol_relay", dissect_wisun_eapol_relay, proto_wisun_eapol_relay); register_dissector("wisun.netricity.sc", dissect_wisun_netricity_sc, proto_wisun_netricity_sc); reassembly_table_register(&netricity_reassembly_table, &addresses_reassembly_table_functions); } void proto_reg_handoff_wisun(void) { dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_WISUN, create_dissector_handle(dissect_wisun_hie, proto_wisun)); dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_WISUN, create_dissector_handle(dissect_wisun_pie, proto_wisun)); dissector_add_uint(IEEE802154_CMD_VENDOR_DTABLE, OUI_WISUN, create_dissector_handle(dissect_wisun_cmd, proto_wisun)); oid_add_from_string("id-kp-wisun-fan-device", "1.3.6.1.4.1.45605.1"); // For EAPOL relay dissector_add_uint("udp.port", WISUN_EAPOL_RELAY_UDP_PORT, wisun_eapol_relay_handle); eapol_handle = find_dissector("eapol"); // For Netricity reassembly ieee802154_nofcs_handle = find_dissector("wpan_nofcs"); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wlancertextn.c
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-wlancertextn.c */ /* asn2wrs.py -b -L -p wlancertextn -c ./wlancertextn.cnf -s ./packet-wlancertextn-template -D . -O ../.. WLANCERTEXTN.asn */ /* packet-wlancertextn.c * Routines for Wireless Certificate Extension (RFC3770) * Ronnie Sahlberg 2005 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/oids.h> #include <epan/asn1.h> #include "packet-ber.h" #include "packet-wlancertextn.h" #include "packet-x509af.h" #include "packet-x509ce.h" #include "packet-x509sat.h" #define PNAME "Wlan Certificate Extension" #define PSNAME "WLANCERTEXTN" #define PFNAME "wlancertextn" void proto_register_wlancertextn(void); void proto_reg_handoff_wlancertextn(void); /* Initialize the protocol and registered fields */ static int proto_wlancertextn = -1; static int hf_wlancertextn_SSIDList_PDU = -1; /* SSIDList */ static int hf_wlancertextn_SSIDList_item = -1; /* SSID */ /* Initialize the subtree pointers */ static gint ett_wlancertextn_SSIDList = -1; static int dissect_wlancertextn_SSID(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); return offset; } static const ber_sequence_t SSIDList_sequence_of[1] = { { &hf_wlancertextn_SSIDList_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_wlancertextn_SSID }, }; static int dissect_wlancertextn_SSIDList(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, SSIDList_sequence_of, hf_index, ett_wlancertextn_SSIDList); return offset; } /*--- PDUs ---*/ static int dissect_SSIDList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); offset = dissect_wlancertextn_SSIDList(FALSE, tvb, offset, &asn1_ctx, tree, hf_wlancertextn_SSIDList_PDU); return offset; } /*--- proto_register_wlancertextn ----------------------------------------------*/ void proto_register_wlancertextn(void) { /* List of fields */ static hf_register_info hf[] = { { &hf_wlancertextn_SSIDList_PDU, { "SSIDList", "wlancertextn.SSIDList", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_wlancertextn_SSIDList_item, { "SSID", "wlancertextn.SSID", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, }; /* List of subtrees */ static gint *ett[] = { &ett_wlancertextn_SSIDList, }; /* Register protocol */ proto_wlancertextn = proto_register_protocol(PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array(proto_wlancertextn, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /*--- proto_reg_handoff_wlancertextn -------------------------------------------*/ void proto_reg_handoff_wlancertextn(void) { register_ber_oid_dissector("1.3.6.1.5.5.7.1.13", dissect_SSIDList_PDU, proto_wlancertextn, "id-pe-wlanSSID"); register_ber_oid_dissector("1.3.6.1.5.5.7.10.6", dissect_SSIDList_PDU, proto_wlancertextn, "id-aca-wlanSSID"); oid_add_from_string("id-kp-eapOverPPP","1.3.6.1.5.5.7.3.13"); oid_add_from_string("id-kp-eapOverLAN","1.3.6.1.5.5.7.3.14"); }
C/C++
wireshark/epan/dissectors/packet-wlancertextn.h
/* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-wlancertextn.h */ /* asn2wrs.py -b -L -p wlancertextn -c ./wlancertextn.cnf -s ./packet-wlancertextn-template -D . -O ../.. WLANCERTEXTN.asn */ /* packet-wlancertextn.h * Routines for Wireless Certificate Extensions (RFC3770) packet dissection * Ronnie Sahlberg 2005 * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_WLANCERTEXTN_H #define PACKET_WLANCERTEXTN_H /*#include "packet-wlancertextn-exp.h"*/ #endif /* PACKET_WLANCERTEXTN_H */
C
wireshark/epan/dissectors/packet-wlccp.c
/* packet-wlccp.c * Routines for Cisco Wireless LAN Context Control Protocol dissection * * Copyright 2005, Joerg Mayer (see AUTHORS file) * Copyright 2006, Stephen Fisher (see AUTHORS file) * Copyright 2007, Kevin A. Noll <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * The CISCOWL dissector was merged into this one. * * SPDX-License-Identifier: GPL-2.0-or-later */ /* Version 0x00 was reverse engineered */ /* Version 0xC1 Protocol reference: US Patent Application 0050220054 */ /* and considerable reverse engineering due to the patent application*/ /* being incomplete */ /* More clues to version 0x00 of the protocol: * * Header (Eth V2 or SNAP) * Length (2 bytes) * Type (2 bytes) * 0202: Unknown, Length 36 (14 + 20 + 2) * 4001: Unknown, Length 48 (14 + 32 + 2) * 4601: Unknown, Length 34 (14 + 18 + 2) * 4081 on Eth V2: Name, Version Length 84 (14 + 48 + 20 + 2) * 4081 on 802.3: Name Length 72 (14 + 56 + 2) * Dst MAC (6 bytes) * Src MAC (6 bytes) * Unknown1 (2 bytes) Unknown19 + Unknown2 may be a MAC address on type 0202 * Unknown2 (4 bytes) see Unknown19 * 0 (17 bytes) * Device IP (4 bytes) * 0 (2 bytes) * Device name (8 bytes) * 0 (20 bytes) * Unknown3 (2 bytes) * Unknown4 (4 bytes) * Version string (10 bytes) * 0 (4 bytes) * 0 (2 bytes) */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include <epan/oui.h> #include "packet-llc.h" void proto_register_wlccp(void); void proto_reg_handoff_wlccp(void); /* The UDP port that WLCCP is expected to ride on */ /* WLCCP also uses an LLC OUI type and an ethertype */ #define WLCCP_UDP_PORT 2887 /* Not IANA registered */ /* SAP is 2-bit version and 6-bit Type */ #define SAP_VERSION_MASK (0xC0) #define SAP_VALUE_MASK (0x3f) static const value_string wlccp_sap_vs[] = { { 0x0, "Context Management" }, { 0x1, "Security" }, { 0x2, "Radio Resource Management" }, { 0x3, "QOS" }, { 0x4, "Network Management" }, { 0x5, "MIP" }, { 0, NULL } }; #define WLCCP_SAP_CCM (0x00) #define WLCCP_SAP_SEC (0x01) #define WLCCP_SAP_RRM (0x02) #define WLCCP_SAP_QOS (0x03) #define WLCCP_SAP_NM (0x04) #define WLCCP_SAP_MIP (0x05) static const value_string wlccp_node_type_vs[] = { { 0x00, "None" }, { 0x01, "Access Point (AP)" }, { 0x02, "Subnet Context Manager (SCM)" }, { 0x04, "Local Context Manager (LCM)" }, { 0x08, "Campus Context Manager (CCM)" }, { 0x10, "Infrastructure (ICN)" }, { 0x40, "Client" }, /* { 0x8000, "Multi Mask?" }, */ { 0, NULL } }; /* The Message Type field contains a 2-bit Sub-Type and a 6-bit Base Message Type */ #define MT_SUBTYPE (0xC0) #define MT_BASE_MSG_TYPE (0x3F) static const value_string wlccp_subtype_vs[] = { { 0x0, "Request" }, { 0x1, "Reply" }, { 0x2, "Confirm" }, { 0x3, "Ack" }, { 0, NULL } }; /* The Message Type definitions are a combination of the SAP and the Type_ID */ /* fields. These mappings are not well documented and have been gathered from a */ /* combination of the WLCCP patent application, experimentation, and WLCCP */ /* device logs. */ /* For SAP=0 */ static const value_string wlccp_msg_type_vs_0[] = { { 0x1, "SCM Advertise" }, { 0x2, "CCM Advertise" }, { 0x3, "Registration" }, { 0x4, "DeRegistration" }, { 0x5, "Detach" }, { 0x6, "Context" }, { 0x7, "Path Update" }, { 0x8, "Path Check" }, { 0x9, "PreRegistration" }, { 0x0a, "Trace" }, { 0x0b, "cmAAA EAP Authent" }, { 0x0c, "cmPathInit Path Authent" }, { 0x0f, "cmWIDS" }, { 0, NULL } }; /* For SAP=1 */ static const value_string wlccp_msg_type_vs_1[] = { /* { 0x1, "Unknown" }, */ { 0, NULL } }; /* For SAP=2 */ static const value_string wlccp_msg_type_vs_2[] = { { 0x1, "rmReq" }, { 0x2, "rmReqRoutingResp" }, { 0x3, "rmReport" }, { 0, NULL } }; /* For SAP=3 */ static const value_string wlccp_msg_type_vs_3[] = { /* { 0x1, "Unknown" }, */ { 0, NULL } }; /* For SAP=4 */ static const value_string wlccp_msg_type_vs_4[] = { { 0x01, "nmAck" }, { 0x10, "nmConfigRequest" }, { 0x11, "nmConfigReply" }, { 0x20, "nmApRegistration" }, { 0x21, "nmScmStateChange" }, { 0x22, "nmScmKeepActive" }, { 0x30, "nmClientEventReport" }, { 0x31, "nmAllClientRefreshRequest" }, { 0, NULL } }; /* For SAP=5 */ static const value_string wlccp_msg_type_vs_5[] = { /* { 0x1, "Unknown" }, */ { 0, NULL } }; /* Mask definitions for the CM Flags field */ #define F_RETRY (1<<15) #define F_RESPONSE_REQUEST (1<<14) #define F_TLV (1<<13) #define F_INBOUND (1<<12) #define F_OUTBOUND (1<<11) #define F_HOPWISE_ROUTING (1<<10) #define F_ROOT_CM (1<<9) #define F_RELAY (1<<8) #define F_MIC (1<<7) /* Mask definitions for the RM Flags field */ #define RM_F_REQUEST_REPLY (1<<0) #define RM_F_MIC (1<<1) /* Mask definitions for the NM Flags field */ /* the NM flags are the same as the CM flags except there is no INBOUND, OUTBOUND, HOPWISE_ROUTING, ROOT_CM, or RELAY flag, and the RESPONSE_REQUEST flag is renamed ACK_REQD */ #define F_ACK_REQD (1<<14) /* Mask definitions for the SCM Flags field */ #define F_SCM_LAYER2UPDATE (1<<3) #define F_SCM_UNATTACHED (1<<2) #define F_SCM_UNSCHEDULED (1<<1) #define F_SCM_ACTIVE (1<<0) /* Mask definitions for the SCM Priority Flags field */ #define F_SCM_PRIORITY 0xfe #define F_SCM_PREFERRED 0x01 /* Mask definitions for the SCM Bridge Priority Flags field */ #define F_SCM_BRIDGE_PRIORITY 0xfe #define F_SCM_BRIDGE_DISABLE 0x01 /* The TLV Type definitions are a combination of the TLV Group and the */ /* TLV Type ID fields. These mappings are not well documented and have been */ /* gathered from a combination of the WLCCP patent application, */ /* experimentation, and WLCCP device logs */ /* The TLV Group/Type Field contains some flags and the Group ID and Type ID */ #define TLV_F_CONTAINER (0x8000) #define TLV_F_ENCRYPTED (0x4000) #define TLV_F_RESVD (0x3000) #define TLV_F_RESVD2 (0x2000) #define TLV_F_RESVD3 (0x1000) #define TLV_F_REQUEST (0x0080) #define TLV_GROUP_ID (0x0F00) #define TLV_TYPE_ID (0x007F) static const value_string wlccp_tlv_group_vs[] = { { 0x0, "WLCCP Group" }, { 0x1, "Security Group" }, { 0x2, "RRM Group" }, { 0x3, "QOS Group" }, { 0x4, "NM Group" }, { 0x5, "MIP Group" }, { 0, NULL } }; #define WLCCP_TLV_GROUP_WLCCP (0x00) #define WLCCP_TLV_GROUP_SEC (0x01) #define WLCCP_TLV_GROUP_RRM (0x02) #define WLCCP_TLV_GROUP_QOS (0x03) #define WLCCP_TLV_GROUP_NM (0x04) #define WLCCP_TLV_GROUP_MIP (0x05) /* Group 0 */ static const value_string wlccp_tlv_typeID_0[] = { { 0x00, "NULL TLV" }, { 0x09, "ipv4Address" }, { 0x01, "Container" }, { 0x02, "AP Port Info" }, { 0x03, "ipv4 Subnet ID" }, { 0x04, "Secondary LAN Address List" }, { 0x05, "Multicast Ethernet Address List" }, { 0x06, "ipv4 Multicast Address List" }, { 0x07, "AP Port List" }, { 0x08, "Requestor SSID" }, { 0, NULL } }; /* Group 1 */ static const value_string wlccp_tlv_typeID_1[] = { { 0x01, "initSession" }, { 0x02, "inSecureContextReq" }, { 0x06, "authenticator" }, { 0x08, "mic" }, { 0x0a, "inSecureContextReply" }, { 0, NULL } }; /* Group 2 */ static const value_string wlccp_tlv_typeID_2[] = { { 0x03, "rmReport" }, { 0x04, "aggrRmReport" }, { 0x15, "frameReport" }, { 0x17, "ccaReport" }, { 0x19, "rpiHistReport" }, { 0x1e, "commonBeaconReport" }, { 0x1f, "aggrBeaconReport" }, { 0x5b, "mfpRouting" }, { 0x5c, "mfpConfig" }, { 0, NULL } }; /* Group 3 */ static const value_string wlccp_tlv_typeID_3[] = { /* { 0x01, "Unknown" } */ { 0, NULL }, }; /* Group 4 */ static const value_string wlccp_tlv_typeID_4[] = { /* { 0x01, "Unknown" } */ { 0, NULL }, }; /* Group 5 */ static const value_string wlccp_tlv_typeID_5[] = { /* { 0x01, "Unknown" } */ { 0, NULL }, }; static const value_string wlccp_aaa_msg_type_vs[] = { { 0x0, "Start" }, { 0x1, "Finish" }, { 0x2, "EAPOL" }, { 0x3, "Cisco Accounting" }, { 0, NULL } }; static const value_string wlccp_eapol_auth_type_vs[] = { { 0x0, "EAP Only" }, { 0x1, "MAC Only" }, { 0x2, "MAC then EAP" }, { 0x3, "MAC and EAP" }, { 0x4, "LEAP only" }, { 0x5, "MAC then LEAP" }, { 0x6, "MAC and LEAP" }, { 0, NULL } }; static const value_string wlccp_key_mgmt_type_vs[] = { { 0x0, "None" }, { 0x1, "CCKM" }, { 0x2, "Legacy 802.1x" }, { 0x3, "SSN/TGi" }, { 0, NULL } }; static const value_string eapol_type_vs[] = { { 0x0, "EAP Packet" }, { 0x1, "EAP Start" }, { 0x2, "Unknown" }, { 0x3, "Key" }, { 0, NULL } }; static const value_string wlccp_status_vs[] = { {0, "Success" }, { 0, NULL } }; static const value_string cisco_pid_vals[] = { { 0x0000, "WLCCP" }, { 0, NULL } }; static const value_string wlccp_mode_vs[] = { { 0x0, "apSelected" }, {0x01, "series" }, {0x3, "parallel" }, {0, NULL } }; static const value_string phy_type_80211_vs[] = { { 0x01, "FHSS 2.4 GHz" }, { 0x02, "DSSS 2.4 GHz" }, { 0x03, "IR Baseband" }, { 0x04, "OFDM 5GHz" }, { 0x05, "HRDSSS" }, { 0x06, "ERP" }, { 0, NULL } }; /* 802.11 capabilities flags */ #define F_80211_ESS 0x0001 #define F_80211_IBSS 0x0002 #define F_80211_CFPOLL 0x0004 #define F_80211_CFPOLL_REQ 0x0008 #define F_80211_PRIVACY 0x0010 #define F_80211_SHORT_PREAMBLE 0x0020 #define F_80211_PBCC 0x0040 #define F_80211_CH_AGILITY 0x0080 #define F_80211_SPEC_MGMT 0x0100 #define F_80211_QOS 0x0200 #define F_80211_SHORT_TIME_SLOT 0x0400 #define F_80211_APSD 0x0800 #define F_80211_RESVD 0x1000 #define F_80211_DSSS_OFDM 0x2000 #define F_80211_DLYD_BLK_ACK 0x4000 #define F_80211_IMM_BLK_ACK 0x8000 /* struct subdissector_returns_t { static int consumed static gboolean mic_flag; static gboolean tlv_flag; }; * struct flags_t declaration * */ /* Forward declarations we need below */ static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_sec_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_qos_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_mip_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); static guint dissect_wlccp_tlvs(proto_tree *_tree, tvbuff_t *tvb, guint tlv_offset, guint _depth); static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); static void set_mic_flag(gboolean flag); static void set_tlv_flag(gboolean flag); static gboolean get_tlv_flag(void); static gboolean get_mic_flag(void); /* Initialize some utlity variables */ static gboolean mic_flag=0, tlv_flag=0; /* Initialize the protocol and registered fields */ static int proto_wlccp = -1; static int hf_llc_wlccp_pid = -1; static int hf_wlccp_dstmac = -1; static int hf_wlccp_srcmac = -1; static int hf_wlccp_hostname = -1; /* WLCCP Fixed header fields */ static int hf_wlccp_version = -1; static int hf_wlccp_sap = -1; /* SAP Tree */ static int hf_wlccp_sap_version = -1; static int hf_wlccp_sap_id = -1; static int hf_wlccp_destination_node_type = -1; static int hf_wlccp_length = -1; static int hf_wlccp_type = -1; /* Message Type Tree */ static int hf_wlccp_subtype = -1; static int hf_wlccp_base_message_type_0 = -1; static int hf_wlccp_base_message_type_1 = -1; static int hf_wlccp_base_message_type_2 = -1; static int hf_wlccp_base_message_type_3 = -1; static int hf_wlccp_base_message_type_4 = -1; static int hf_wlccp_base_message_type_5 = -1; static int hf_wlccp_base_message_type_unknown = -1; static int hf_wlccp_hops = -1; static int hf_wlccp_nm_version = -1; static int hf_wlccp_msg_id = -1; static int hf_wlccp_flags = -1; /* Flags Tree */ static int hf_wlccp_rm_flags = -1; static int hf_wlccp_retry_flag = -1; static int hf_wlccp_response_request_flag = -1; static int hf_wlccp_ack_required_flag = -1; static int hf_wlccp_tlv_flag = -1; static int hf_wlccp_inbound_flag = -1; static int hf_wlccp_outbound_flag = -1; static int hf_wlccp_hopwise_routing_flag = -1; static int hf_wlccp_root_cm_flag = -1; static int hf_wlccp_relay_flag = -1; static int hf_wlccp_mic_flag = -1; static int hf_wlccp_rm_request_reply_flag = -1; static int hf_wlccp_rm_mic_flag = -1; static int hf_wlccp_originator = -1; /* Originator Tree */ static int hf_wlccp_originator_node_type = -1; /* static int hf_wlccp_originator_id = -1; */ static int hf_wlccp_responder = -1; /* Responder Tree */ static int hf_wlccp_responder_node_type = -1; /*static int hf_wlccp_responder_id = -1; */ /* static int hf_wlccp_relay_node = -1;*/ /* Relay Node Tree */ static int hf_wlccp_relay_node_type = -1; static int hf_wlccp_relay_node_id = -1; /* static int hf_wlccp_priority = -1; */ /* static int hf_wlccp_age = -1; */ /* static int hf_wlccp_period = -1; */ static int hf_wlccp_ipv4_address = -1; /* SCM Advertisement */ static int hf_wlccp_scm_hop_address = -1; static int hf_wlccp_scm_flags = -1; /* SCM Flags Tree */ static int hf_wlccp_scm_active_flag = -1; static int hf_wlccp_scm_unscheduled_flag = -1; static int hf_wlccp_scm_unattached_flag = -1; static int hf_wlccp_scm_layer2update_flag = -1; static int hf_wlccp_scm_election_group = -1; static int hf_wlccp_scm_attach_count = -1; static int hf_wlccp_scm_priority_flags = -1; /* SCM Priority Flags */ static int hf_wlccp_scm_priority = -1; static int hf_wlccp_scm_preferred_flag = -1; static int hf_wlccp_scm_bridge_priority_flags = -1; /* SCM Bridge Priority Flags */ static int hf_wlccp_scm_bridge_priority = -1; static int hf_wlccp_scm_bridge_disable_flag = -1; static int hf_wlccp_scm_node_id = -1; static int hf_wlccp_scm_unknown_short = -1; static int hf_wlccp_scm_instance_age = -1; static int hf_wlccp_scm_path_cost = -1; static int hf_wlccp_scm_hop_count = -1; static int hf_wlccp_scm_advperiod = -1; /*kan for apRegistration messages*/ static int hf_wlccp_timestamp = -1; static int hf_wlccp_apregstatus = -1; static int hf_wlccp_ap_node_id = -1; static int hf_wlccp_ap_node_type = -1; static int hf_wlccp_ap_node_id_address = -1; /*kan for nmPathInit messages */ static int hf_wlccp_requ_node_type = -1; static int hf_wlccp_requ_node_id = -1; static int hf_wlccp_status = -1; static int hf_wlccp_path_init_rsvd = -1; /*kan - for cmAAA messages */ static int hf_wlccp_aaa_msg_type = -1; static int hf_wlccp_aaa_auth_type = -1; static int hf_wlccp_keymgmt_type = -1; /*kan - for cmAAA EAPOL messages */ static int hf_wlccp_eapol_msg = -1; static int hf_wlccp_eapol_version = -1; static int hf_wlccp_eapol_type = -1; static int hf_wlccp_eap_msg_length = -1; static int hf_wlccp_eap_msg = -1; /*kan - for cmAAA Proprietary message */ static int hf_wlccp_cisco_acctg_msg = -1; /*kan - for cmWIDS */ static int hf_wlccp_wids_msg_type = -1; /*kan - for nmConfigRequest and nmConfigReply */ static int hf_wlccp_nmconfig = -1; static int hf_wlccp_scmstate_change = -1; static int hf_wlccp_scmstate_change_reason = -1; static int hf_wlccp_scmattach_state = -1; static int hf_wlccp_nmcapability = -1; static int hf_wlccp_refresh_req_id = -1; static int hf_wlccp_tlv = -1; static int hf_tlv_flags = -1; static int hf_wlccp_null_tlv = -1; static int hf_wlccp_tlv_type = -1; static int hf_wlccp_tlv_type0 = -1; static int hf_wlccp_tlv_type1 = -1; static int hf_wlccp_tlv_type2 = -1; static int hf_wlccp_tlv_type3 = -1; static int hf_wlccp_tlv_type4 = -1; static int hf_wlccp_tlv_type5 = -1; static int hf_wlccp_tlv_group = -1; static int hf_wlccp_tlv_container_flag = -1; static int hf_wlccp_tlv_encrypted_flag = -1; static int hf_wlccp_tlv_request_flag = -1; static int hf_wlccp_tlv_reserved_bit = -1; static int hf_wlccp_tlv_length = -1; /* static int hf_wlccp_tlv_value = -1; */ static int hf_wlccp_path_length = -1; static int hf_wlccp_mic_msg_seq_count = -1; static int hf_wlccp_mic_length = -1; static int hf_wlccp_mic_value = -1; static int hf_wlccp_key_seq_count = -1; static int hf_wlccp_dest_node_type = -1; static int hf_wlccp_dest_node_id = -1; static int hf_wlccp_supp_node_type = -1; static int hf_wlccp_supp_node_id = -1; static int hf_wlccp_key_mgmt_type = -1; static int hf_wlccp_nonce = -1; static int hf_wlccp_session_timeout = -1; static int hf_wlccp_src_node_type = -1; static int hf_wlccp_src_node_id = -1; static int hf_wlccp_token = -1; static int hf_wlccp_mode = -1; static int hf_wlccp_scan_mode = -1; static int hf_wlccp_rss = -1; static int hf_wlccp_srcidx = -1; static int hf_wlccp_parent_tsf = -1; static int hf_wlccp_target_tsf = -1; static int hf_wlccp_channel = -1; static int hf_wlccp_phy_type = -1; static int hf_wlccp_bssid = -1; static int hf_wlccp_beacon_interval = -1; /* static int hf_wlccp_capabilities = -1; */ static int hf_wlccp_tlv80211 = -1; static int hf_wlccp_duration = -1; static int hf_wlccp_rpidensity = -1; static int hf_wlccp_ccabusy = -1; static int hf_wlccp_sta_type = -1; static int hf_wlccp_stamac = -1; static int hf_wlccp_token2 = -1; static int hf_wlccp_interval = -1; static int hf_wlccp_count = -1; static int hf_framereport_elements = -1; static int hf_wlccp_numframes = -1; static int hf_wlccp_mfpcapability = -1; static int hf_wlccp_mfpflags = -1; static int hf_wlccp_mfpconfig = -1; static int hf_wlccp_clientmac = -1; static int hf_time_elapsed = -1; static int hf_wlccp_parent_ap_mac = -1; static int hf_wlccp_auth_type =-1; static int hf_reg_lifetime = -1; static int hf_wlccp_radius_user_name = -1; static int hf_wds_reason = -1; static int hf_wlccp_80211_capabilities = -1; static int hf_80211_cap_ess = -1; static int hf_80211_cap_ibss = -1; static int hf_80211_cap_cf_pollable = -1; static int hf_80211_cap_cf_poll_req = -1; static int hf_80211_cap_privacy = -1; static int hf_80211_short_preamble = -1; static int hf_80211_pbcc = -1; static int hf_80211_chan_agility = -1; static int hf_80211_spectrum_mgmt = -1; static int hf_80211_qos = -1; static int hf_80211_short_time_slot = -1; static int hf_80211_apsd = -1; static int hf_80211_reserved = -1; static int hf_80211_dsss_ofdm = -1; static int hf_80211_dlyd_block_ack = -1; static int hf_80211_imm_block_ack = -1; static int hf_wlccp_tlv_unknown_value = -1; /* Initialize the subtree pointers */ static gint ett_wlccp = -1; static gint ett_wlccp_sap_tree = -1; static gint ett_wlccp_type = -1; static gint ett_wlccp_cm_flags = -1; static gint ett_wlccp_scm_flags = -1; static gint ett_wlccp_scm_priority_flags = -1; static gint ett_wlccp_scm_bridge_priority_flags = -1; static gint ett_wlccp_rm_flags = -1; static gint ett_wlccp_nm_flags = -1; static gint ett_wlccp_flags = -1; static gint ett_wlccp_ap_node_id = -1; static gint ett_wlccp_eapol_msg_tree = -1; static gint ett_wlccp_eap_tree = -1; static gint ett_wlccp_tlv_tree = -1; static gint ett_tlv_flags_tree = -1; static gint ett_tlv_sub_tree = -1; static gint ett_80211_capability_flags_tree = -1; static gint ett_framereport_elements_tree = -1; /* Code to actually dissect the packets */ static int dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *wlccp_tree, *wlccp_sap_tree, *wlccp_type_tree; guint offset = 0, old_offset; guint8 version=0, sap_id=0; guint16 type; guint8 base_message_type=0, message_sub_type=0; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLCCP"); if(tvb_get_guint8(tvb, 0) == 0xC1) /* Get the version number */ { sap_id = tvb_get_guint8(tvb,1) & SAP_VALUE_MASK; base_message_type=(tvb_get_guint8(tvb,6)) & MT_BASE_MSG_TYPE; message_sub_type=(tvb_get_guint8(tvb, 6) & MT_SUBTYPE ) >> 6; switch (sap_id) { case WLCCP_SAP_CCM: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_0, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_CCM */ case WLCCP_SAP_SEC: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_1, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_SEC */ case WLCCP_SAP_RRM: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_2, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_RRM */ case WLCCP_SAP_QOS: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_3, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_QOS */ case WLCCP_SAP_NM: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_4, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_NM */ case WLCCP_SAP_MIP: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", val_to_str_const(base_message_type, wlccp_msg_type_vs_5, "Unknown"), val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* case WLCCP_SAP_MIP */ default: { col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", "Unknown", val_to_str_const(message_sub_type, wlccp_subtype_vs, "Unknown")); break; } /* default for switch sap */ } /* switch sap */ } /* if version=0xC1 (tvb_get_guint8(tvb, 0) == 0xC1)*/ if (tree) { /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_wlccp, tvb, 0, -1, ENC_NA); wlccp_tree = proto_item_add_subtree(ti, ett_wlccp); proto_tree_add_item(wlccp_tree, hf_wlccp_version, tvb, offset, 1, ENC_BIG_ENDIAN); /* interpretation of the packet is determined by WLCCP version */ version = tvb_get_guint8(tvb, 0); offset += 1; if(version == 0x0) { proto_tree_add_item(wlccp_tree, hf_wlccp_length, tvb, 1, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wlccp_tree, hf_wlccp_type, tvb, 2, 2, ENC_BIG_ENDIAN); type = tvb_get_ntohs(tvb, 2); proto_tree_add_item(wlccp_tree, hf_wlccp_dstmac, tvb, 4, 6, ENC_NA); proto_tree_add_item(wlccp_tree, hf_wlccp_srcmac, tvb, 10, 6, ENC_NA); if(type == 0x4081) { proto_tree_add_item(wlccp_tree, hf_wlccp_ipv4_address, tvb, 38, 4, ENC_BIG_ENDIAN); proto_tree_add_item(wlccp_tree, hf_wlccp_hostname, tvb, 44, 28, ENC_ASCII); } /* if type = 0x4081 */ } /* if version == 0x00 */ if(version == 0xC1) { { /* SAP Field */ ti = proto_tree_add_item(wlccp_tree, hf_wlccp_sap, tvb, offset, 1, ENC_BIG_ENDIAN); wlccp_sap_tree = proto_item_add_subtree(ti, ett_wlccp_sap_tree); proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_version, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_id, tvb, offset, 1, ENC_BIG_ENDIAN); sap_id = tvb_get_guint8(tvb,offset) & SAP_VALUE_MASK; offset += 1; } /* SAP Field */ proto_tree_add_item(wlccp_tree, hf_wlccp_destination_node_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(wlccp_tree, hf_wlccp_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; { /* Message Type Field */ ti = proto_tree_add_item(wlccp_tree, hf_wlccp_type, tvb, offset, 1, ENC_BIG_ENDIAN); wlccp_type_tree = proto_item_add_subtree(ti, ett_wlccp_type); proto_tree_add_item(wlccp_type_tree, hf_wlccp_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); switch (sap_id) { case WLCCP_SAP_CCM: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_0, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_CCM */ case WLCCP_SAP_SEC: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_1, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_SEC */ case WLCCP_SAP_RRM: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_2, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_RRM */ case WLCCP_SAP_QOS: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_3, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_QOS */ case WLCCP_SAP_NM: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_4, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_NM */ case WLCCP_SAP_MIP: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_5, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* case WLCCP_SAP_MIP */ default: { proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_unknown, tvb, offset, 1, ENC_BIG_ENDIAN); break; } /* default for switch sap */ } /* switch sap */ base_message_type=(tvb_get_guint8(tvb,offset) & MT_BASE_MSG_TYPE ); offset += 1; } /* Message Type Field */ /* after the Message Type Field things change based on SAP and Message Type */ set_mic_flag(FALSE); set_tlv_flag(FALSE); switch (sap_id) { case WLCCP_SAP_CCM: { offset = dissect_wlccp_ccm_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_CCM */ case WLCCP_SAP_SEC: { offset = dissect_wlccp_sec_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_SEC */ case WLCCP_SAP_RRM: { offset = dissect_wlccp_rrm_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_RRM */ case WLCCP_SAP_QOS: { offset = dissect_wlccp_qos_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_QOS */ case WLCCP_SAP_NM: { offset = dissect_wlccp_nm_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_NM */ case WLCCP_SAP_MIP: { offset = dissect_wlccp_mip_msg(wlccp_tree, tvb, offset, base_message_type); break; } /* case WLCCP_SAP_MIP */ default: { /* what should we do if we get an undefined SAP? */ break; } /* default for switch sap */ } /* switch sap */ if(get_tlv_flag() || get_mic_flag()) { if (tvb_reported_length_remaining(tvb,offset) < 4) { /* something is wrong if the TLV flag is set and there's not enough left in the buffer */ /* proto_tree_add_string(wlccp_tree, NULL, tvb, offset, -1, "MIC Flag=%d and TLV Flag=%d, but no data left to decode."); */ } /* if bytes_left <=0 */ else { while (tvb_reported_length_remaining(tvb,offset) >= 4) { old_offset = offset; offset = dissect_wlccp_tlvs(wlccp_tree, tvb, offset, 0); DISSECTOR_ASSERT(offset > old_offset); } /* while bytes_left */ ; } /*else bytes_left < 4 */ } /* if tlv_flag || mic_flag */ } /* if version == 0xC1 */ } /* if tree */ return tvb_captured_length(tvb); } /* dissect_wlccp */ /*******************************************************************************************/ /* some utility functions */ /* these could be implemented with a struct */ static void set_mic_flag(gboolean flag) { mic_flag=flag; } /*set_mic_flag */ static void set_tlv_flag(gboolean flag) { tlv_flag=flag; } /* set_tlv_flag */ static gboolean get_tlv_flag(void) { return(tlv_flag); } /* get_tlv_flag */ static gboolean get_mic_flag(void) { return(mic_flag); } /* get_mic_flag */ /*******************************************************************************************/ static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) { proto_item *_ti; proto_tree *_wlccp_eapol_msg_tree, *_wlccp_cm_flags_tree, *_wlccp_scm_flags_tree, *_wlccp_scm_priority_flags_tree, *_wlccp_scm_bridge_priority_flags_tree; gboolean _relay_flag=0, _mic_flag=0, _tlv_flag=0; guint8 _aaa_msg_type=0, _eapol_type=0; guint16 _eap_msg_length=0; proto_tree_add_item(_tree, hf_wlccp_hops, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_msg_id, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; /* Decode the CM Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_flags, _tvb, _offset, 2, ENC_BIG_ENDIAN); _wlccp_cm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_cm_flags); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_retry_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_response_request_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_tlv_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1; set_tlv_flag(_tlv_flag); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_inbound_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_outbound_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_hopwise_routing_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_root_cm_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_relay_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _relay_flag = (tvb_get_ntohs(_tvb, _offset)>>8) & 1; proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_mic_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1; set_mic_flag(_mic_flag); _offset += 2; /* End Decode the CM Flags Field */ proto_tree_add_item(_tree, hf_wlccp_originator_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_originator, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_responder_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_responder, _tvb, _offset, 6, ENC_NA); _offset += 6; if(_relay_flag) { proto_tree_add_item(_tree, hf_wlccp_relay_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_relay_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; } /* if _relay_flag */ switch (_base_message_type) { case 0x01: { proto_tree_add_item(_tree, hf_wlccp_scm_hop_address, _tvb, _offset, 6, ENC_NA); _offset += 6; /* Decode the SCM Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_scm_flags, _tvb, _offset, 2, ENC_BIG_ENDIAN); _wlccp_scm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_flags); proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_layer2update_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_unattached_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_unscheduled_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_scm_flags_tree, hf_wlccp_scm_active_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; /* End Decode the SCM Flags Field */ proto_tree_add_item(_tree, hf_wlccp_scm_election_group, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_scm_attach_count, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* Decode the SCM Priority Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_scm_priority_flags, _tvb, _offset, 1, ENC_BIG_ENDIAN); _wlccp_scm_priority_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_priority_flags); proto_tree_add_item(_wlccp_scm_priority_flags_tree, hf_wlccp_scm_priority, _tvb, _offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_scm_priority_flags_tree, hf_wlccp_scm_preferred_flag, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* End Decode the SCM Priority Flags Field */ /* Decode the SCM Bridge Priority Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_scm_bridge_priority_flags, _tvb, _offset, 1, ENC_BIG_ENDIAN); _wlccp_scm_bridge_priority_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_scm_bridge_priority_flags); proto_tree_add_item(_wlccp_scm_bridge_priority_flags_tree, hf_wlccp_scm_bridge_priority, _tvb, _offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_scm_bridge_priority_flags_tree, hf_wlccp_scm_bridge_disable_flag, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* End Decode the SCM Bridge Priority Flags Field */ proto_tree_add_item(_tree, hf_wlccp_scm_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_scm_unknown_short, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_scm_instance_age, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_scm_path_cost, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_scm_hop_count, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_scm_advperiod, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; break; } /* case 0x01 */ case 0x02: { break; } /* case 0x02 */ case 0x03: { break; } /* case 0x03 */ case 0x04: { break; } /* case 0x04 */ case 0x05: { break; } /* case 0x05 */ case 0x06: { break; } /* case 0x06 */ case 0x07: { break; } /* case 0x07 */ case 0x08: { break; } /* case 0x08 */ case 0x09: { break; } /* case 0x09 */ case 0x0a: { break; } /* case 0x0a */ case 0x0b: /* cmAAA */ { proto_tree_add_item(_tree, hf_wlccp_requ_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_requ_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; /*kan - according to the patent application these fields vary based on one another. For now we decode what we know about and then we'll come back and add the rest */ proto_tree_add_item(_tree, hf_wlccp_aaa_msg_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _aaa_msg_type=tvb_get_guint8(_tvb,_offset); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_aaa_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_keymgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* kan - I'm pretty sure this EAPOL tree only applies sometimes, but it's the only complete example that I have to test against for now. For that matter, it may be possible to just hand this piece of the packet over to the EAPOL dissector and let it handle things. To be investigated further */ if (_aaa_msg_type == 0x2) /*EAPOL*/ { _ti = proto_tree_add_item(_tree, hf_wlccp_eapol_msg, _tvb, _offset, 6, ENC_NA); _wlccp_eapol_msg_tree = proto_item_add_subtree( _ti, ett_wlccp_eapol_msg_tree); /* THIS NEEDS TO BE CHECKED */ /*kan - skip some unknown bytes */ _offset += 2; proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_version, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _eapol_type=tvb_get_guint8(_tvb, _offset); _offset += 1; if (_eapol_type == 0) { proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg_length, _tvb, _offset, 2, ENC_BIG_ENDIAN); _eap_msg_length=tvb_get_ntohs(_tvb, _offset); _offset += 2; proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg, _tvb, _offset, _eap_msg_length, ENC_NA); _offset += _eap_msg_length; } /* if _eapol_type == 0 */ } /* if _aaa_msg_type ==0x2 */ if (_aaa_msg_type == 0x3) /*Cisco proprietary message*/ { proto_tree_add_item(_tree, hf_wlccp_cisco_acctg_msg, _tvb, _offset, -1, ENC_NA); } /* if aaa_msg_type == 0x3 */ break; } /* case 0x0b */ case 0x0c: /* cmPathInit */ { proto_tree_add_item(_tree, hf_wlccp_requ_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_requ_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; /*kan - there's a reserved alignment byte right here*/ proto_tree_add_item(_tree, hf_wlccp_path_init_rsvd, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset +=1; break; } /* case 0x0c */ case 0x0f: /* cmWIDS */ { proto_tree_add_item(_tree, hf_wlccp_wids_msg_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset +=1; break; } /* case 0x0f */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_ccm_msg */ static guint dissect_wlccp_sec_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) { /* at the momemt we have no more data to use to write this dissector code */ /* it's just a place holder for now */ switch (_base_message_type) { case 0x01: { break; } /* case 0x01 */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_sec_msg */ static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) { proto_tree *_wlccp_rm_flags_tree; proto_item *_ti; gboolean _mic_flag=0; /* Decode the RM Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_rm_flags, _tvb, _offset, 1, ENC_BIG_ENDIAN); _wlccp_rm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_rm_flags); proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_mic_flag, _tvb, _offset, 1, ENC_BIG_ENDIAN); _mic_flag = (tvb_get_guint8(_tvb, _offset) & RM_F_MIC) >> 1; set_mic_flag(_mic_flag); set_tlv_flag(TRUE); proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_request_reply_flag, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* End Decode the RM Flags Field */ proto_tree_add_item(_tree, hf_wlccp_msg_id, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_originator_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_originator, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_responder_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_responder, _tvb, _offset, 6, ENC_NA); _offset += 6; switch (_base_message_type) { case 0x01: /* rmReq */ { break; } /* case 0x01 */ case 0x02: /* rmReqRoutingResp */ { break; } /* case 0x01 */ case 0x03: /* rmReport */ { break; } /* case 0x01 */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_rrm_msg */ static guint dissect_wlccp_qos_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) { /* at the momemt we have no more data to use to write this dissector code */ /* it's just a place holder for now */ switch (_base_message_type) { case 0x01: { break; } /* case 0x01 */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_qos_msg */ static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) { proto_item *_ti; proto_tree *_wlccp_ap_node_id_tree, *_wlccp_nm_flags_tree; gboolean _mic_flag=0, _tlv_flag=0; proto_tree_add_item(_tree, hf_wlccp_nm_version, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_msg_id, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; /* Decode the NM Flags Field */ _ti = proto_tree_add_item(_tree, hf_wlccp_flags, _tvb, _offset, 2, ENC_BIG_ENDIAN); _wlccp_nm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_nm_flags); proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_retry_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_ack_required_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_tlv_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1; set_tlv_flag(_tlv_flag); proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_mic_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1; set_mic_flag(_mic_flag); _offset += 2; /* End Decode the NM Flags Field */ proto_tree_add_item(_tree, hf_wlccp_originator_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_originator, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_responder_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_responder, _tvb, _offset, 6, ENC_NA); _offset += 6; switch (_base_message_type) { case 0x01: /* nmAck */ { break; } /* case 0x01 */ case 0x10: /* nmConfigRequest */ { proto_tree_add_item(_tree, hf_wlccp_nmconfig, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* kan - there appears to be some padding or other unknowns here */ _offset += 3; break; } /* case 0x10 */ case 0x11: /* nmConfigReply */ { proto_tree_add_item(_tree, hf_wlccp_nmconfig, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* kan - there appears to be some padding or other unknowns here */ _offset += 3; break; } /* case 0x11 */ case 0x20: /* nmApRegistration */ { proto_tree_add_item(_tree, hf_wlccp_timestamp, _tvb, _offset, 8, ENC_BIG_ENDIAN); _offset += 8; proto_tree_add_item(_tree, hf_wlccp_apregstatus, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; _offset += 3; /*kan - skip some apparently unused bytes */ _ti = proto_tree_add_item(_tree, hf_wlccp_ap_node_id, _tvb, _offset, 8, ENC_NA); _wlccp_ap_node_id_tree = proto_item_add_subtree( _ti, ett_wlccp_ap_node_id); proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_id_address, _tvb, _offset, 6, ENC_NA); _offset += 6; break; } /* case 0x20 */ case 0x21: /* nmScmStateChange */ { proto_tree_add_item(_tree, hf_wlccp_timestamp, _tvb, _offset, 8, ENC_BIG_ENDIAN); _offset += 8; proto_tree_add_item(_tree, hf_wlccp_scmstate_change, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_scmstate_change_reason, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /*kan - skip some apparently unused bytes */ _offset += 2; break; } /* case 0x21 */ case 0x22: /* nmScmKeepActive */ { proto_tree_add_item(_tree, hf_wlccp_scmattach_state, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_nmconfig, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_nmcapability, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /*kan - skip some apparently unused bytes */ _offset += 1; break; } /* case 0x22 */ case 0x30: /* nmClientEventReport */ { proto_tree_add_item(_tree, hf_wlccp_timestamp, _tvb, _offset, 8, ENC_BIG_ENDIAN); _offset += 8; break; } /* case 0x30 */ case 0x31: /* nmAllClientRefreshRequest */ { proto_tree_add_item(_tree, hf_wlccp_refresh_req_id, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; break; } /* case 0x31 */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_nm_msg */ static guint dissect_wlccp_mip_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) { /* at the momemt we have no more data to use to write this dissector code */ /* it's just a place holder for now */ switch (_base_message_type) { case 0x01: { break; } /* case 0x01 */ default: { break; } /* default for switch _base_message_type */ } /* switch _base_message_type */ return(_offset); } /* dissect_wlccp_mip_msg */ /***************************************************************************************************/ static guint dissect_wlccp_tlvs( proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint _depth) { proto_item *_ti, *_temp_ti; proto_tree *_tlv_tree; proto_tree *_tlv_flags_tree; gboolean _container_flag=0; gint _group_id=0, _type_id=0; guint _length=0; guint _tlv_end=0; guint _old_offset; /* the TLV length is 2 bytes into the TLV, and we need it now */ _length = tvb_get_ntohs(_tvb,_offset+2); /* figure out where the end of this TLV is so we know when to stop dissecting it */ _tlv_end = _offset + _length; /* this TLV is _length bytes long */ _ti = proto_tree_add_item(_tree, hf_wlccp_tlv, _tvb, _offset, _length, ENC_NA); /* create the TLV sub tree */ _tlv_tree = proto_item_add_subtree(_ti, ett_wlccp_tlv_tree); /* save the pointer because we'll add some text to it later */ _temp_ti = _ti; /* add an arbitrary safety factor in case we foul up the dissector recursion */ DISSECTOR_ASSERT(_depth < 100); /* add the flags field to the tlv_tree */ _ti = proto_tree_add_item(_tlv_tree, hf_tlv_flags, _tvb, _offset, 2, ENC_BIG_ENDIAN); _tlv_flags_tree = proto_item_add_subtree(_ti, ett_tlv_flags_tree); /* first 2 bytes are the flags, Group and Type bit 0 = container, bit 1 = encrypted, bits 2-3 = reserved, bits 4-7 = group ID, bit 5 = request, bits 9-15 = type ID */ /* the TLV group and type IDs are contained in the flags field, extract them */ _group_id = (tvb_get_ntohs(_tvb,_offset) & TLV_GROUP_ID) >> 8; _type_id = (tvb_get_ntohs(_tvb,_offset) & TLV_TYPE_ID); /* add the flags to the tree */ proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_container_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_encrypted_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_reserved_bit, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_group, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_request_flag, _tvb, _offset, 2, ENC_BIG_ENDIAN); /* a hack to show the right string representation of the type_id in the tree */ switch (_group_id) { case WLCCP_TLV_GROUP_WLCCP: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type0, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_WLCCP */ case WLCCP_TLV_GROUP_SEC: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type1, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_SEC */ case WLCCP_TLV_GROUP_RRM: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type2, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_RRM */ case WLCCP_TLV_GROUP_QOS: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type3, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_QOS */ case WLCCP_TLV_GROUP_NM: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type4, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_NM */ case WLCCP_TLV_GROUP_MIP: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type5, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case WLCCP_TLV_GROUP_MIP */ default: { proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); break; } /* case default for switch _group_id */ } /* switch _group_id */ _container_flag = (tvb_get_ntohs(_tvb, _offset) & TLV_F_CONTAINER) >> 15; /* according to the patent, some behavior changes if the request flag is set */ /* it would be nice if it said how, but I don't think it matters for decoding purposes */ _offset += 2; /* finished with the flags field */ /* add the length field to the tlv_tree */ proto_tree_add_item(_tlv_tree, hf_wlccp_tlv_length, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; /* finished with the length field */ /* now decode the fixed fields in each TLV */ switch (_group_id) { case WLCCP_TLV_GROUP_WLCCP: { _offset = dissect_wlccp_ccm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_WLCCP */ case WLCCP_TLV_GROUP_SEC: { _offset = dissect_wlccp_sec_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_SEC */ case WLCCP_TLV_GROUP_RRM: { _offset = dissect_wlccp_rrm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_RRM */ case WLCCP_TLV_GROUP_QOS: { _offset = dissect_wlccp_qos_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_QOS */ case WLCCP_TLV_GROUP_NM: { _offset = dissect_wlccp_nm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_NM */ case WLCCP_TLV_GROUP_MIP: { _offset = dissect_wlccp_mip_tlv(_tlv_tree, _tvb, _offset, _type_id, _length - 4, _temp_ti); break; } /* case WLCCP_TLV_GROUP_MIP */ default: { if (_offset < _tlv_end) _offset = _tlv_end; break; } /* case default for switch _group_id */ } /* switch _group_id */ /* done with decoding the fixed TLV fields */ /* If this TLV is a container, then build a sub tree and decode the contained TLVs */ if (_container_flag && (_offset >= _tlv_end) ) { /* something is wrong if there's not enough left in the buffer */ } /* if container_flag and _offset >= _tlv_end */ else /* _container_flag && _offset >= tlv_end */ { if (_container_flag && (_offset < _tlv_end) ) { while (_offset < _tlv_end) { _old_offset = _offset; _offset = dissect_wlccp_tlvs(_tlv_tree, _tvb, _offset, _depth++); DISSECTOR_ASSERT(_offset > _old_offset); } /* while bytes_left >= 4*/ } /* _container_flag && (tvb_length_remaining(_tvb,_offset) >= 4) */ } /*_container_flag && (tvb_length_remaining(_tvb,_offset) < 4) */ /* done with decoding the contained TLVs */ return(_tlv_end > _offset ? _tlv_end : _offset); } /* dissect_wlccp_tlvs */ /* ************************************************************************************************************* */ /* ALL THE TLV SUB-DISSECTORS NEED A DEFAULT CASE, OTHERWISE WE'LL GET INTO AN INFINITE RECURSION LOOP INSIDE */ /* THE CALLING FUNCTION dissect_wlccp_tlvs. BESIDES, IT'S JUST GOOD FORM :-) */ static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { case 0x00: /* NULL TLV */ { proto_item_append_text(_ti, " NULL TLV"); proto_tree_add_item(_tree, hf_wlccp_null_tlv , _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* case tlv_type_id = 0x09 */ case 0x09: /* ipv4Address */ { proto_item_append_text(_ti, " IPv4Address"); proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; break; } /* case tlv_type_id = 0x09 */ default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* case default for tlv_group_id=0x00 */ } /* switch _type_id */ return(_offset); } /* dissect_wlccp_ccm_tlv */ static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { case 0x01: /* initSession */ { proto_item_append_text(_ti, " initSession"); /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_path_length, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 2; break; } /* case 0x01 */ case 0x02: /* inSecureContextReq */ { proto_item_append_text(_ti, " inSecureContextReq"); proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; /* skip unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA); _offset += 32; break; } /* case 0x02 */ case 0x06: /* authenticator */ { proto_item_append_text(_ti, " authenticator"); proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_src_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_src_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; /* skip unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA); _offset += 32; break; } /* case 0x06 */ case 0x08: /* MIC */ { guint16 _mic_length=0; proto_item_append_text(_ti, " mic"); proto_tree_add_item(_tree, hf_wlccp_mic_msg_seq_count, _tvb, _offset, 8, ENC_BIG_ENDIAN); _offset += 8; proto_tree_add_item(_tree, hf_wlccp_mic_length, _tvb, _offset, 2, ENC_BIG_ENDIAN); _mic_length = tvb_get_ntohs(_tvb,_offset); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_mic_value, _tvb, _offset, _mic_length, ENC_NA); _offset += _mic_length; break; } case 0x0a: /* inSecureContextReply */ { proto_item_append_text(_ti, " inSecureContextReply"); proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, ENC_NA); _offset += 32; proto_tree_add_item(_tree, hf_wlccp_session_timeout, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; break; } /* case 0x0a */ default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* default case for switch (_type_id) */ } /* switch _type_id */ return(_offset); } /* dissect_wlccp_sec_tlv */ static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { case 0x02: /* aggrRmReq */ { proto_item_append_text(_ti, " aggrRmReq"); proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_interval, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case tlv_type_id = 0x02 */ case 0x03 : /* rmReport */ { proto_item_append_text(_ti, " rmReport"); proto_tree_add_item(_tree, hf_wlccp_sta_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA); _offset += 6; break; } /* case tlv_type_id = 0x03 */ case 0x04: /* aggrRmReport */ { proto_item_append_text(_ti, " aggrRmReport"); /* no fields */ break; } /* case tlv_type_id = 0x04 */ case 0x12: /* beaconRequest */ { proto_item_append_text(_ti, " beaconRequest"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_scan_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x12 */ case 0x14: /* frameRequest */ { guint _count=0, _counter=0; proto_item_append_text(_ti, " frameRequest"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_count, _tvb, _offset, 1, ENC_BIG_ENDIAN); _count = tvb_get_guint8(_tvb,_offset); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; for (_counter=0; _counter < _count; _counter++) { proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; } /* for _counter=0 */ break; } /* case 0x14 */ case 0x15: /* frameReport */ { proto_item *_fr_ti; proto_tree *_fr_elems_tree; guint _counter=0, _arraylen=0; proto_item_append_text(_ti, " frameReport"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; _arraylen=(_length-10)/14; if (_arraylen > 0) { _fr_ti = proto_tree_add_item(_tree, hf_framereport_elements, _tvb, _offset, (_length-10), ENC_NA); _fr_elems_tree = proto_item_add_subtree(_fr_ti, ett_framereport_elements_tree); for(_counter=0; _counter < _arraylen; _counter++) { proto_tree_add_item(_fr_elems_tree, hf_wlccp_numframes, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_fr_elems_tree, hf_wlccp_rss, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_fr_elems_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_fr_elems_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA); _offset += 6; } /* for _counter=0 */ } /* if _arraylen > 0 */ break; } /* case 0x15 */ case 0x16: /* ccaRequest */ { proto_item_append_text(_ti, " ccaRequest"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x16 */ case 0x17: /* ccaReport */ { proto_item_append_text(_ti, " ccaReport"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_ccabusy, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; break; } /* case tlv_type_id = 0x17 */ case 0x18: /* rpiHistRequest */ { proto_item_append_text(_ti, " rpiHistRequest"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x18 */ case 0x19: /* rpiHistReport */ { guint _rpi_density_length=0; proto_item_append_text(_ti, " rpiHistReport"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; _rpi_density_length = _length - 6 - 4; proto_tree_add_item(_tree, hf_wlccp_rpidensity, _tvb, _offset, _rpi_density_length, ENC_NA); _offset += _rpi_density_length; break; } /* case tlv_type_id = 0x19 */ case 0x1c: /* nullRequest */ { proto_item_append_text(_ti, " nullRequest"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x1c */ case 0x1e: /* commonBeaconReport */ { proto_tree *_80211_capabilities_tree; proto_item *_new_ti; guint _tlv80211length=0; proto_item_append_text(_ti, " commonBeaconReport"); proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_phy_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_beacon_interval, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; /* if we assume the next field is the capabilities field from the 802.11 beacon, then we have a 16-bit field thhf_wlccp_statusat contains the following (802.11-2007): bit 0 = ESS bit 1 = IBSS bit 2 = CF pollable bit 3 = CF Poll Request bit 4 = privacy bit 5 = Short Preamble bit 6 = PBCC bit 7 = Channel Agility bit 8 = Spectrum Management bit 9 = QoS bit 10 = Short Slot Time bit 11 = APSD bit 12 = Reserved bit 13 = DSSS-OFDM bit 14 = Delayed Block Ack bit 15 = Immediate Block Ack */ _new_ti = proto_tree_add_item(_tree, hf_wlccp_80211_capabilities, _tvb, _offset, 2, ENC_BIG_ENDIAN); _80211_capabilities_tree = proto_item_add_subtree(_new_ti, ett_80211_capability_flags_tree); proto_tree_add_item(_80211_capabilities_tree, hf_80211_imm_block_ack, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_dlyd_block_ack, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_dsss_ofdm, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_reserved, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_apsd, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_time_slot, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_qos, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_spectrum_mgmt, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_chan_agility, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_pbcc, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_preamble, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_privacy, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_poll_req, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_pollable, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ibss, _tvb, _offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ess, _tvb, _offset, 2, ENC_BIG_ENDIAN); /* proto_tree_add_item(_tree, hf_wlccp_capabilities, _tvb, _offset, 2, ENC_BIG_ENDIAN); */ _offset += 2; _tlv80211length = _length - 13 - 4; /* This TLV could be decoded per the 802.11 information element spec's */ proto_tree_add_item(_tree, hf_wlccp_tlv80211, _tvb, _offset, _tlv80211length, ENC_NA); _offset += _tlv80211length; break; } /* case tlv_type_id = 0x1e */ case 0x1f: /* aggrBeaconReport */ { proto_item_append_text(_ti, " aggrBeaconReport"); proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_rss, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_parent_tsf, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_target_tsf, _tvb, _offset, 8, ENC_BIG_ENDIAN); _offset += 8; break; } /* case tlv_type_id = 0x1f */ case 0x20: /* rmReqRoutingList */ { guint _counter=0, _arraylen=0; proto_item_append_text(_ti, " rmReqRoutingList"); _arraylen=(_length)/16; if (_arraylen > 0) { for(_counter=0; _counter < _arraylen; _counter++) { proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, ENC_NA); _offset += 6; } /* for _counter=0 */ } /* if _arraylen > 0 */ break; } /* case 0x20 */ case 0x21: /* rmReqRoutingResp */ { guint _counter=0, _arraylen=0; proto_item_append_text(_ti, " rmReqRoutingResp"); proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; _arraylen=(_length)/11; if (_arraylen > 0) { for(_counter=0; _counter < _arraylen; _counter++) { proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; } /* for _counter=0 */ } /* if _arraylen > 0 */ break; } /* case 0x21 */ case 0x22: /* rmReqAck */ { proto_item_append_text(_ti, " rmReqAck"); proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; break; } /* case 0x22 */ case 0x58: /* mfpCapability */ { proto_item_append_text(_ti, " mfpCapability"); proto_tree_add_item(_tree, hf_wlccp_mfpcapability, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x58 */ case 0x5b: /* mfpRouting */ { proto_item_append_text(_ti, " mfpRouting"); proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wlccp_mfpflags, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x5b */ case 0x5c: /* mfpConfig */ { proto_item_append_text(_ti, " mfpConfig"); proto_tree_add_item(_tree, hf_wlccp_mfpconfig, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; break; } /* case 0x5c */ default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* case default */ } /* switch type_id */ return(_offset); } /* dissect_wlccp_rrm_tlv */ static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* default case for switch (_type_id) */ } /* switch _type_id */ return(_offset); } /* dissect_wlccp_qos_tlv */ static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { case 0x20: /* nmClientEventIntoWDS */ { guint _radius_user_name_length = 0; proto_item_append_text(_ti, " nmClientEventIntoWDS"); proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; _radius_user_name_length = _length - 23 - 4; proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, ENC_ASCII); _offset += _radius_user_name_length; break; } /* case 0x20 */ case 0x21: /* nmClientEventOutOfWDS */ { proto_item_append_text(_ti, " nmClientEventOutOfWDS"); proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_wds_reason, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; break; } /* case 0x21 */ case 0x22: /* nmClientEventIntraWDS */ { proto_item_append_text(_ti, " nmClientEventIntraWDS"); proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 3; break; } /* case 0x22 */ case 0x24: /* nmClientEventIPAddressUpdate */ { proto_item_append_text(_ti, " nmClientEventIPAddressUpdate"); proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA); _offset += 6; /* skip some unused bytes */ _offset += 2; proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; break; } /* case 0x24 */ case 0x26: /* nmClientEventRefresh */ { guint _radius_user_name_length = 0; proto_item_append_text(_ti, " nmClientEventRefresh"); proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, ENC_NA); _offset += 6; proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, ENC_BIG_ENDIAN); _offset += 1; /* skip some unused bytes */ _offset += 1; _radius_user_name_length = _length - 23 - 4; proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, ENC_ASCII); _offset += _radius_user_name_length; break; } /* case 0x26 */ case 0x27: /* nmClientEventRefreshDone */ { proto_item_append_text(_ti, " nmClientEventRefreshDone"); /* skip some unused bytes */ _offset += 6; proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, ENC_BIG_ENDIAN); _offset += 2; proto_tree_add_item(_tree, hf_wlccp_refresh_req_id, _tvb, _offset, 4, ENC_BIG_ENDIAN); _offset += 4; break; } /* case 0x27 */ default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* default case for switch (_type_id) */ } /* switch _type_id */ return(_offset); } /* dissect_wlccp_nm_tlv */ static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) { switch (_type_id) { default: { /* for unknown types, just add them to the tree as a blob */ proto_item_append_text(_ti, " Unknown"); proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length, ENC_NA); _offset += _length; break; } /* default case for switch (_type_id) */ } /* switch _type_id */ return(_offset); } /* dissect_wlccp_mip_tlv */ /* Register the protocol with Wireshark */ void proto_register_wlccp(void) { /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_wlccp_version, { "Version", "wlccp.version", FT_UINT8, BASE_HEX, NULL, 0x0, "Protocol ID/Version", HFILL } }, { &hf_wlccp_srcmac, { "Src MAC", "wlccp.srcmac", FT_ETHER, BASE_NONE, NULL, 0x0, "Source MAC address", HFILL } }, { &hf_wlccp_dstmac, { "Dst MAC", "wlccp.dstmac", FT_ETHER, BASE_NONE, NULL, 0x0, "Destination MAC address", HFILL } }, { &hf_wlccp_hostname, { "Hostname", "wlccp.hostname", FT_STRING, BASE_NONE, NULL, 0x0, "Hostname of device", HFILL } }, { &hf_wlccp_sap, { "SAP", "wlccp.sap", FT_UINT8, BASE_HEX, NULL, 0x0, "Service Access Point", HFILL } }, { &hf_wlccp_sap_version, { "SAP Version", "wlccp.sap_version", FT_UINT8, BASE_DEC, NULL, SAP_VERSION_MASK, "Service Access Point Version", HFILL } }, { &hf_wlccp_sap_id, { "SAP ID", "wlccp.sap_id", FT_UINT8, BASE_DEC, VALS(wlccp_sap_vs), SAP_VALUE_MASK, "Service Access Point ID", HFILL } }, { &hf_wlccp_destination_node_type, { "Destination node type", "wlccp.destination_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Node type of the hop destination", HFILL } }, { &hf_wlccp_length, { "Length", "wlccp.length", FT_UINT16, BASE_DEC, NULL, 0x0, "Length of WLCCP payload (bytes)", HFILL } }, { &hf_wlccp_type, { "Message Type", "wlccp.type", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_subtype, { "Subtype", "wlccp.subtype", FT_UINT8, BASE_DEC, VALS(wlccp_subtype_vs), MT_SUBTYPE, "Message Subtype", HFILL } }, { &hf_wlccp_base_message_type_0, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_0), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_1, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_1), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_2, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_2), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_3, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_3), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_4, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_4), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_5, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_5), MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_base_message_type_unknown, { "Base message type", "wlccp.base_message_type", FT_UINT8, BASE_HEX_DEC, NULL, MT_BASE_MSG_TYPE, NULL, HFILL } }, { &hf_wlccp_hops, { "Hops", "wlccp.hops", FT_UINT8, BASE_DEC, NULL, 0x0, "Number of WLCCP hops", HFILL } }, { &hf_wlccp_nm_version, { "NM Version", "wlccp.nm_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_msg_id, { "Message ID", "wlccp.msg_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Sequence number used to match request/reply pairs", HFILL } }, { &hf_wlccp_flags, { "Flags", "wlccp.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_rm_flags, { "RM Flags", "wlccp.rm_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_retry_flag, { "Retry flag", "wlccp.retry_flag", FT_UINT16, BASE_DEC, NULL, F_RETRY, "Set on for retransmissions", HFILL } }, { &hf_wlccp_response_request_flag, { "Response request flag", "wlccp.response_request_flag", FT_UINT16, BASE_DEC, NULL, F_RESPONSE_REQUEST, "Set on to request a reply", HFILL } }, { &hf_wlccp_rm_request_reply_flag, { "Request Reply flag", "wlccp.request_reply_flag", FT_UINT8, BASE_DEC, NULL, RM_F_REQUEST_REPLY, "Set on to request a reply", HFILL } }, { &hf_wlccp_ack_required_flag, { "Ack Required flag", "wlccp.ack_required_flag", FT_UINT16, BASE_DEC, NULL, F_ACK_REQD, "Set on to require an acknowledgement", HFILL } }, { &hf_wlccp_tlv_flag, { "TLV flag", "wlccp.tlv_flag", FT_UINT16, BASE_DEC, NULL, F_TLV, "Set to indicate that optional TLVs follow the fixed fields", HFILL } }, { &hf_wlccp_inbound_flag, { "Inbound flag", "wlccp.inbound_flag", FT_UINT16, BASE_DEC, NULL, F_INBOUND, "Message is inbound to the top of the topology tree", HFILL } }, { &hf_wlccp_outbound_flag, { "Outbound flag", "wlccp.outbound_flag", FT_UINT16, BASE_DEC, NULL, F_OUTBOUND, "Message is outbound from the top of the topology tree", HFILL } }, { &hf_wlccp_hopwise_routing_flag, { "Hopwise-routing flag", "wlccp.hopwise_routing_flag", FT_UINT16, BASE_DEC, NULL, F_HOPWISE_ROUTING, "On to force intermediate access points to process the message also", HFILL } }, { &hf_wlccp_root_cm_flag, { "Root context manager flag", "wlccp.root_cm_flag", FT_UINT16, BASE_DEC, NULL, F_ROOT_CM, "Set to on to send message to the root context manager of the topology tree", HFILL } }, { &hf_wlccp_relay_flag, { "Relay flag", "wlccp.relay_flag", FT_UINT16, BASE_DEC, NULL, F_RELAY, "Signifies that this header is immediately followed by a relay node field", HFILL } }, { &hf_wlccp_mic_flag, { "MIC flag", "wlccp.mic_flag", FT_UINT16, BASE_DEC, NULL, F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL } }, { &hf_wlccp_rm_mic_flag, { "MIC flag", "wlccp.mic_flag", FT_UINT8, BASE_DEC, NULL, RM_F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL } }, { &hf_wlccp_originator_node_type, { "Originator node type", "wlccp.originator_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Originating device's node type", HFILL } }, { &hf_wlccp_originator, { "Originator", "wlccp.originator", FT_ETHER, BASE_NONE, NULL, 0x0, "Originating device's MAC address", HFILL } }, { &hf_wlccp_responder_node_type, { "Responder node type", "wlccp.responder_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Responding device's node type", HFILL } }, { &hf_wlccp_responder, { "Responder", "wlccp.responder", FT_ETHER, BASE_NONE, NULL, 0x0, "Responding device's MAC address", HFILL } }, { &hf_wlccp_requ_node_type, { "Requestor node type", "wlccp.requ_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Requesting device's node type", HFILL } }, { &hf_wlccp_requ_node_id, { "Requestor", "wlccp.requestor", FT_ETHER, BASE_NONE, NULL, 0x0, "Requestor device's MAC address", HFILL } }, { &hf_wlccp_status, { "Status", "wlccp.status", FT_UINT8, BASE_DEC, VALS(wlccp_status_vs), 0x0, NULL, HFILL } }, { &hf_wlccp_path_init_rsvd, { "Reserved", "wlccp.path_init_reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_relay_node_type, { "Relay node type", "wlccp.relay_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Type of node which relayed this message", HFILL } }, { &hf_wlccp_relay_node_id, { "Relay node ID", "wlccp.relay_node_id", FT_ETHER, BASE_NONE, NULL, 0x0, "Node which relayed this message", HFILL } }, #if 0 { &hf_wlccp_priority, { "WDS priority", "wlccp.priority", FT_UINT8, BASE_DEC, NULL, 0, "WDS priority of this access point", HFILL } }, #endif #if 0 { &hf_wlccp_age, { "Age", "wlccp.age", FT_UINT32, BASE_DEC, NULL, 0, "Time since AP became a WDS master", HFILL } }, #endif #if 0 { &hf_wlccp_period, { "Period", "wlccp.period", FT_UINT8, BASE_DEC, NULL, 0, "Interval between announcements (seconds)", HFILL } }, #endif { &hf_wlccp_ipv4_address, { "IPv4 Address", "wlccp.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scm_hop_address, { "Hop Address", "wlccp.scm_hop_address", FT_ETHER, BASE_NONE, NULL, 0x0, "Source 802 Port Address", HFILL } }, { &hf_wlccp_scm_flags, { "SCM flags", "wlccp.scm_flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_scm_active_flag, { "Active flag", "wlccp.scm_active_flag", FT_UINT16, BASE_DEC, NULL, F_SCM_ACTIVE, "Set to on in advertisements from the active SCM", HFILL } }, { &hf_wlccp_scm_unscheduled_flag, { "Unscheduled flag", "wlccp.scm_unscheduled_flag", FT_UINT16, BASE_DEC, NULL, F_SCM_UNSCHEDULED, "Set to on in unscheduled advertisement messages", HFILL } }, { &hf_wlccp_scm_unattached_flag, { "Unattached flag", "wlccp.scm_unattached_flag", FT_UINT16, BASE_DEC, NULL, F_SCM_UNATTACHED, "Set to on in advertisements from an unattached node", HFILL } }, { &hf_wlccp_scm_layer2update_flag, { "Layer2 Update flag", "wlccp.scm_layer2update_flag", FT_UINT16, BASE_DEC, NULL, F_SCM_LAYER2UPDATE, "Set to on if WLCCP Layer 2 path updates are enabled", HFILL } }, { &hf_wlccp_scm_election_group, { "SCM Election Group", "wlccp.scm_election_group", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scm_attach_count, { "Attach Count", "wlccp.scm_attach_count", FT_UINT8, BASE_DEC, NULL, 0, "Attach count of the hop source", HFILL } }, { &hf_wlccp_scm_priority_flags, { "SCM Priority flags", "wlccp.scm_priority_flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scm_priority, { "SCM Priority", "wlccp.scm_priority", FT_UINT8, BASE_DEC, NULL, F_SCM_PRIORITY, NULL, HFILL } }, { &hf_wlccp_scm_preferred_flag, { "Preferred flag", "wlccp.scm_preferred_flag", FT_UINT8, BASE_DEC, NULL, F_SCM_PREFERRED, "Set to off if the SCM is the preferred SCM", HFILL } }, { &hf_wlccp_scm_bridge_priority_flags, { "Bridge Priority flags", "wlccp.scm_bridge_priority_flags", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scm_bridge_priority, { "Bridge priority", "wlccp.scm_bridge_priority", FT_UINT8, BASE_DEC, NULL, F_SCM_BRIDGE_PRIORITY, "Used to negotiate the designated bridge on a non-STP secondary Ethernet LAN", HFILL } }, { &hf_wlccp_scm_bridge_disable_flag, { "Bridge disable flag", "wlccp.scm_bridge_disable_flag", FT_UINT8, BASE_DEC, NULL, F_SCM_BRIDGE_DISABLE, "Set to on to indicate that secondary briding is disabled", HFILL } }, { &hf_wlccp_scm_node_id, { "SCM Node ID", "wlccp.scm_node_id", FT_ETHER, BASE_NONE, NULL, 0x0, "Node ID of the SCM", HFILL } }, { &hf_wlccp_scm_unknown_short, { "Unknown Short", "wlccp.scm_unknown_short", FT_UINT16, BASE_HEX, NULL, 0x0, "SCM Unknown Short Value", HFILL } }, { &hf_wlccp_scm_instance_age, { "Instance Age", "wlccp.scm_instance_age", FT_UINT32, BASE_DEC, NULL, 0, "Instance age of the SCM in seconds", HFILL } }, { &hf_wlccp_scm_path_cost, { "Path cost", "wlccp.scm_path_cost", FT_UINT16, BASE_DEC, NULL, 0x0, "Sum of port costs on the path to the SCM", HFILL } }, { &hf_wlccp_scm_hop_count, { "Hop Count", "wlccp.scm_hop_count", FT_UINT8, BASE_DEC, NULL, 0, "Number of wireless hops on the path to SCM", HFILL } }, { &hf_wlccp_scm_advperiod, { "Advertisement Period", "wlccp.scm_advperiod", FT_UINT8, BASE_DEC, NULL, 0, "Average number of seconds between SCM advertisements", HFILL } }, { &hf_wlccp_timestamp, { "Timestamp", "wlccp.timestamp", FT_UINT64, BASE_DEC, NULL, 0, "Registration Timestamp", HFILL } }, { &hf_wlccp_apregstatus, { "Registration Status", "wlccp.apregstatus", FT_UINT8, BASE_HEX, NULL, 0, "AP Registration Status", HFILL } }, { &hf_wlccp_ap_node_id, { "AP Node ID", "wlccp.apnodeid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_ap_node_type, { "AP Node Type", "wlccp.apnodetype", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_ap_node_id_address, { "AP Node Address", "wlccp.apnodeidaddress", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_aaa_msg_type, { "AAA Message Type", "wlccp.aaa_msg_type", FT_UINT8, BASE_HEX, VALS(wlccp_aaa_msg_type_vs), 0, NULL, HFILL } }, { &hf_wlccp_aaa_auth_type, { "AAA Authentication Type", "wlccp.aaa_auth_type", FT_UINT8, BASE_HEX, VALS(wlccp_eapol_auth_type_vs), 0, NULL, HFILL } }, { &hf_wlccp_keymgmt_type, { "AAA Key Management Type", "wlccp.aaa_keymgmt_type", FT_UINT8, BASE_HEX, VALS(wlccp_key_mgmt_type_vs), 0, NULL, HFILL } }, { &hf_wlccp_eapol_msg, { "EAPOL Message", "wlccp.eapol_msg", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_eapol_version, { "EAPOL Version", "wlccp.eapol_version", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_eapol_type, { "EAPOL Type", "wlccp.eapol_type", FT_UINT8, BASE_HEX, VALS(eapol_type_vs), 0, NULL, HFILL } }, { &hf_wlccp_eap_msg_length, { "EAP Packet Length", "wlccp.eap_pkt_length", FT_UINT16, BASE_DEC, NULL, 0, "EAPOL Type", HFILL } }, { &hf_wlccp_eap_msg, { "EAP Message", "wlccp.eap_msg", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_cisco_acctg_msg, { "Cisco Accounting Message", "wlccp.cisco_acctg_msg", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_wids_msg_type, { "WIDS Message Type", "wlccp.wids_msg_type", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_nmconfig, { "NM Config", "wlccp.nmconfig", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scmstate_change, { "SCM State Change", "wlccp.scmstate_change", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scmstate_change_reason, { "SCM State Change Reason", "wlccp.scmstate_change_reason", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scmattach_state, { "SCM Attach State", "wlccp.scmattach_state", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_nmcapability, { "NM Capability", "wlccp.nm_capability", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_refresh_req_id, { "Refresh Request ID", "wlccp.refresh_request_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_tlv, { "WLCCP TLV", "wlccp.tlv", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_tlv_flags, { "TLV Flags", "wlccp.tlv_flags", FT_UINT16, BASE_HEX, NULL, 0, "TLV Flags, Group and Type", HFILL } }, { &hf_wlccp_null_tlv, { "NULL TLV", "wlccp.null_tlv", FT_BYTES, BASE_NONE, NULL , 0, NULL, HFILL } }, { &hf_wlccp_tlv_type, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, NULL , TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type0, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_0), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type1, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_1), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type2, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_2), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type3, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_3), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type4, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_4), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_type5, { "TLV Type", "wlccp.tlv_type", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_5), TLV_TYPE_ID, "TLV Type ID", HFILL } }, { &hf_wlccp_tlv_group, { "TLV Group", "wlccp.tlv_group", FT_UINT16, BASE_DEC, VALS(wlccp_tlv_group_vs) , TLV_GROUP_ID, "TLV Group ID", HFILL } }, { &hf_wlccp_tlv_container_flag, { "TLV Container Flag", "wlccp.tlv_container_flag", FT_UINT16, BASE_DEC, NULL, TLV_F_CONTAINER, "Set on if the TLV is a container", HFILL } }, { &hf_wlccp_tlv_encrypted_flag, { "TLV Encrypted Flag", "wlccp.tlv_encrypted_flag", FT_UINT16, BASE_DEC, NULL, TLV_F_ENCRYPTED, "Set on if the TLV is encrypted", HFILL } }, { &hf_wlccp_tlv_reserved_bit, { "Reserved bits", "wlccp.tlv_reserved_bit", FT_UINT16, BASE_DEC, NULL, TLV_F_RESVD, "Reserved", HFILL } }, { &hf_wlccp_tlv_request_flag, { "TLV Request Flag", "wlccp.tlv_request_flag", FT_UINT16, BASE_DEC, NULL, TLV_F_REQUEST, "Set on if the TLV is a request", HFILL } }, { &hf_wlccp_tlv_length, { "TLV Length", "wlccp.tlv_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_path_length, { "Path Length", "wlccp.path_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mic_msg_seq_count, { "MIC Message Sequence Count", "wlccp.mic_msg_seq_count", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mic_length, { "MIC Length", "wlccp.mic_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mic_value, { "MIC Value", "wlccp.mic_value", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_dest_node_type, { "Destination node type", "wlccp.dest_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, NULL, HFILL } }, { &hf_wlccp_dest_node_id, { "Destination node ID", "wlccp.dest_node_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_supp_node_type, { "Destination node type", "wlccp.supp_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, NULL, HFILL } }, { &hf_wlccp_supp_node_id, { "Supporting node ID", "wlccp.supp_node_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_src_node_type, { "Source node type", "wlccp.source_node_type", FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, NULL, HFILL } }, { &hf_wlccp_src_node_id, { "Source node ID", "wlccp.source_node_id", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_key_mgmt_type, { "Key Management type", "wlccp.key_mgmt_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_wlccp_key_seq_count, { "Key Sequence Count", "wlccp.key_seq_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_session_timeout, { "Session Timeout", "wlccp.session_timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_nonce, { "Nonce Value", "wlccp.nonce_value", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_token, { "Token", "wlccp.token", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_scan_mode, { "Scan Mode", "wlccp.scan_mode", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mode, { "Mode", "wlccp.mode", FT_UINT8, BASE_HEX, VALS(wlccp_mode_vs), 0, NULL, HFILL } }, { &hf_wlccp_rss, { "RSS", "wlccp.rss", FT_INT8, BASE_DEC, NULL, 0, "Received Signal Strength", HFILL } }, { &hf_wlccp_srcidx, { "Source Index", "wlccp.srcidx", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_parent_tsf, { "Parent TSF", "wlccp.parenttsf", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_target_tsf, { "Target TSF", "wlccp.targettsf", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_channel, { "Channel", "wlccp.channel", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_phy_type, { "PHY Type", "wlccp.phy_type", FT_UINT8, BASE_DEC, VALS(phy_type_80211_vs), 0, NULL, HFILL } }, { &hf_wlccp_bssid, { "BSS ID", "wlccp.bssid", FT_ETHER, BASE_NONE, NULL, 0, "Basic Service Set ID", HFILL } }, { &hf_wlccp_beacon_interval, { "Beacon Interval", "wlccp.beacon_interval", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, /* { &hf_wlccp_capabilities, { "Capabilities", "wlccp.capabilities", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, */ { &hf_wlccp_80211_capabilities, { "802.11 Capabilities Flags", "wlccp.80211_capabilities", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_80211_cap_ess, { "ESS flag", "wlccp.80211_ess_flag", FT_UINT16, BASE_DEC, NULL, F_80211_ESS, "Set on by APs in Beacon or Probe Response", HFILL } }, { &hf_80211_cap_ibss, { "IBSS flag", "wlccp.80211_ibss_flag", FT_UINT16, BASE_DEC, NULL, F_80211_IBSS, "Set on by STAs in Beacon or Probe Response", HFILL } }, { &hf_80211_cap_cf_pollable, { "CF Pollable flag", "wlccp.80211_cf_pollable_flag", FT_UINT16, BASE_DEC, NULL, F_80211_CFPOLL, NULL, HFILL } }, { &hf_80211_cap_cf_poll_req, { "CF Poll Request flag", "wlccp.80211_cf_poll_req_flag", FT_UINT16, BASE_DEC, NULL, F_80211_CFPOLL_REQ, NULL, HFILL } }, { &hf_80211_cap_privacy, { "Privacy flag", "wlccp.80211_privacy", FT_UINT16, BASE_DEC, NULL, F_80211_PRIVACY, "Set on indicate confidentiality is required in the BSS", HFILL } }, { &hf_80211_short_preamble, { "Short Preamble flag", "wlccp.80211_short_preamble_flag", FT_UINT16, BASE_DEC, NULL, F_80211_SHORT_PREAMBLE, NULL, HFILL } }, { &hf_80211_pbcc, { "PBCC flag", "wlccp.80211_pbcc_flag", FT_UINT16, BASE_DEC, NULL, F_80211_PBCC, NULL, HFILL } }, { &hf_80211_chan_agility, { "Channel Agility flag", "wlccp.80211_chan_agility_flag", FT_UINT16, BASE_DEC, NULL, F_80211_CH_AGILITY, NULL, HFILL } }, { &hf_80211_spectrum_mgmt, { "Spectrum Management flag", "wlccp.80211_spectrum_mgmt_flag", FT_UINT16, BASE_DEC, NULL, F_80211_SPEC_MGMT, NULL, HFILL } }, { &hf_80211_qos, { "QOS flag", "wlccp.80211_qos_flag", FT_UINT16, BASE_DEC, NULL, F_80211_QOS, NULL, HFILL } }, { &hf_80211_short_time_slot, { "Short Time Slot flag", "wlccp.80211_short_time_slot_flag", FT_UINT16, BASE_DEC, NULL, F_80211_SHORT_TIME_SLOT, NULL, HFILL } }, { &hf_80211_apsd, { "APSD flag", "wlccp.80211_apsd_flag", FT_UINT16, BASE_DEC, NULL, F_80211_APSD, NULL, HFILL } }, { &hf_80211_reserved, { "Reserved", "wlccp.80211_reserved", FT_UINT16, BASE_DEC, NULL, F_80211_RESVD, NULL, HFILL } }, { &hf_80211_dsss_ofdm, { "DSSS-OFDM Flag", "wlccp.dsss_ofdm_flag", FT_UINT16, BASE_DEC, NULL, F_80211_DSSS_OFDM, NULL, HFILL } }, { &hf_80211_dlyd_block_ack, { "Delayed Block Ack Flag", "wlccp.dsss_dlyd_block_ack_flag", FT_UINT16, BASE_DEC, NULL, F_80211_DLYD_BLK_ACK, NULL, HFILL } }, { &hf_80211_imm_block_ack, { "Immediate Block Ack Flag", "wlccp.dsss_imm_block_ack_flag", FT_UINT16, BASE_DEC, NULL, F_80211_IMM_BLK_ACK, NULL, HFILL } }, { &hf_wlccp_tlv80211, { "802.11 TLV Value", "wlccp.tlv80211", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_duration, { "Duration", "wlccp.duration", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_rpidensity, { "RPI Density", "wlccp.rpi_denisty", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_ccabusy, { "CCA Busy", "wlccp.cca_busy", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_stamac, { "Station MAC", "wlccp.station_mac", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_sta_type, { "Station Type", "wlccp.station_type", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_token2, { "2 Byte Token", "wlccp.token2", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_interval, { "Interval", "wlccp.interval", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_framereport_elements, { "Frame Report Elements", "wlccp.framereport_elements", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_count, { "Element Count", "wlccp.element_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_numframes, { "Number of frames", "wlccp.numframes", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mfpcapability, { "MFP Capability", "wlccp.mfp_capability", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mfpflags, { "MFP Flags", "wlccp.mfp_flags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_mfpconfig, { "MFP Config", "wlccp.mfp_config", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_clientmac, { "Client MAC", "wlccp.client_mac", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_reg_lifetime, { "Reg. LifeTime", "wlccp.reg_lifetime", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_time_elapsed, { "Elapsed Time", "wlccp.time_elapsed", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_wlccp_parent_ap_mac, { "Parent AP MAC", "wlccp.parent_ap_mac", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_wlccp_auth_type, { "Authentication Type", "wlccp.auth_type", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_radius_user_name, { "RADIUS Username", "wlccp.radius_username", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wds_reason, { "Reason Code", "wlccp.wds_reason", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_wlccp_tlv_unknown_value, { "Unknown TLV Contents", "wlccp.tlv_unknown_value", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } } }; /* hf_register_info hf */ static hf_register_info oui_hf[] = { { &hf_llc_wlccp_pid, { "PID", "llc.wlccp_pid", FT_UINT16, BASE_HEX, VALS(cisco_pid_vals), 0x0, NULL, HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wlccp, &ett_wlccp_sap_tree, &ett_wlccp_type, &ett_wlccp_flags, &ett_wlccp_cm_flags, &ett_wlccp_scm_flags, &ett_wlccp_scm_priority_flags, &ett_wlccp_scm_bridge_priority_flags, &ett_wlccp_rm_flags, &ett_wlccp_nm_flags, &ett_wlccp_ap_node_id, &ett_wlccp_eapol_msg_tree, &ett_wlccp_eap_tree, &ett_wlccp_tlv_tree, &ett_tlv_flags_tree, &ett_tlv_sub_tree, &ett_80211_capability_flags_tree, &ett_framereport_elements_tree }; /* static gint *ett[] */ /* Register the protocol name and description */ proto_wlccp = proto_register_protocol("Cisco Wireless LAN Context Control Protocol", "WLCCP", "wlccp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_wlccp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); llc_add_oui(OUI_CISCOWL, "llc.wlccp_pid", "LLC Cisco WLCCP OUI PID", oui_hf, proto_wlccp); } void proto_reg_handoff_wlccp(void) { dissector_handle_t wlccp_handle; wlccp_handle = create_dissector_handle(dissect_wlccp, proto_wlccp); dissector_add_uint("ethertype", ETHERTYPE_WLCCP, wlccp_handle); dissector_add_uint_with_preference("udp.port", WLCCP_UDP_PORT, wlccp_handle); dissector_add_uint("llc.wlccp_pid", 0x0000, wlccp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-wol.c
/* packet-wol.c * Routines for WOL dissection * Copyright 2007, Christopher Maynard <Chris.Maynard[AT]gtech.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * This dissector for "Wake On LAN" was not copied from any other existing * dissector. It uses the template from SVN23520 docs/README.devloper, which * was the latest one available at the time of this writing. This dissector is * a heuristic one though, so appropriate changes have made to the template * as needed. * * The "Wake On LAN" dissector was written based primarily on the AMD white * paper, available from: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/20213.pdf. * * In addition, testing of the dissector was conducted using 2 utilities * downloaded from http://www.moldaner.de/wakeonlan/wakeonlan.html and * http://www.depicus.com/wake-on-lan/, as well as with the ether-wake utility * on a Linux Fedora Core 4 system. * * From what I can tell from the tools available, even though the white paper * indicates that the so-called, "MagicPacket" can be located anywhere within * the Ethernet frame, in practice, there seem to be only 2 variations of the * implementation of the MagicPacket. Ether-wake implements it as an Ethernet * frame with ether type 0x0842 (ETHERTYPE_WOL), and the other tools all seem * to implement it as a UDP packet, both with the payload as nothing but the * MagicPacket. * * To keep things simple, this dissector will only indicate a frame as * Wake-On-Lan if the MagicPacket is found for a frame marked as etherytpe * 0x0842 or if it's a UDP packet. To fully support Wake-On-Lan dissection * though, we would need a way to have this dissector called only if the frame * hasn't already been classified as some other type of dissector ... but I * don't know how to do that? The only alternative I am aware of would be to * register as a heuristic dissector for pretty much every possible protocol * there is, which seems unreasonable to do to me. * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/addr_resolv.h> #include <epan/etypes.h> void proto_register_wol(void); void proto_reg_handoff_wol(void); /* Initialize the protocol and registered fields */ static int proto_wol = -1; static int hf_wol_sync = -1; static int hf_wol_mac = -1; static int hf_wol_passwd = -1; /* Initialize the subtree pointers */ static gint ett_wol = -1; static gint ett_wol_macblock = -1; /* Code to actually dissect the packets */ static int dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { guint len; gint offset; guint8 *mac; const guint8 *passwd; guint64 qword; address mac_addr; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *wol_tree; proto_tree *mac_tree; /* First, if at all possible, do some heuristics to check if the packet cannot * possibly belong to your protocol. This is especially important for * protocols directly on top of TCP or UDP where port collisions are * common place (e.g., even though your protocol uses a well known port, * someone else may set up, for example, a web server on that port which, * if someone analyzed that web server's traffic in Wireshark, would result * in Wireshark handing an HTTP packet to your dissector). For example: */ /* Check that there's enough data */ len = tvb_reported_length(tvb); if ( len < 102 ) /* wol's smallest packet size is 102 */ return (0); /* Get some values from the packet header, probably using tvb_get_*() */ /* Regardless of what the AMD white paper states, don't search the entire * tvb for the synchronization stream. My feeling is that this could be * quite expensive and seriously hinder Wireshark performance. For now, * unless we need to change it later, just compare the 1st 6 bytes. */ qword = tvb_get_ntoh48(tvb,0); if(qword != G_GUINT64_CONSTANT(0xffffffffffff)) return (0); /* So far so good. Now get the next 6 bytes, which we'll assume is the * target's MAC address, and do 15 memory chunk comparisons, since if this * is a real MagicPacket, the target's MAC will be duplicated 16 times. */ mac = (guint8 *)tvb_memdup(pinfo->pool, tvb, 6, 6); for ( offset = 12; offset < 102; offset += 6 ) if ( tvb_memeql(tvb, offset, mac, 6) != 0 ) return (0); /* OK, we're going to assume it's a MagicPacket. If there's a password, * grab it now, and in case there's any extra bytes after the only 3 valid * and expected lengths, truncate the length so the extra byte(s) aren't * included as being part of the WOL payload. */ if ( len >= 106 && len < 108 ) { len = 106; passwd = tvb_ip_to_str(pinfo->pool, tvb, 102); } else if ( len >= 108 ) { len = 108; passwd = tvb_ether_to_str(pinfo->pool, tvb, 102); } else { len = 102; passwd = NULL; } /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WOL"); /* This field shows up as the "Info" column in the display; you should use it, if possible, to summarize what's in the packet, so that a user looking at the list of packets can tell what type of packet it is. See section 1.5 for more information. If you are setting the column to a constant string, use "col_set_str()", as it's more efficient than the other "col_set_XXX()" calls. If you're setting it to a string you've constructed, or will be appending to the column later, use "col_add_str()". "col_add_fstr()" can be used instead of "col_add_str()"; it takes "printf()"-like arguments. Don't use "col_add_fstr()" with a format string of "%s" - just use "col_add_str()" or "col_set_str()", as it's more efficient than "col_add_fstr()". If you will be fetching any data from the packet before filling in the Info column, clear that column first, in case the calls to fetch data from the packet throw an exception because they're fetching data past the end of the packet, so that the Info column doesn't have data left over from the previous dissector; do col_clear(pinfo->cinfo, COL_INFO); */ set_address(&mac_addr, AT_ETHER, 6, mac); col_add_fstr(pinfo->cinfo, COL_INFO, "MagicPacket for %s", address_with_resolution_to_str(pinfo->pool, &mac_addr)); /* NOTE: ether-wake uses a dotted-decimal format for specifying a * 4-byte password or an Ethernet mac address format for specifying * a 6-byte password, so display them in that format, even if the * password isn't really an IP or MAC address. */ if ( passwd ) col_append_fstr(pinfo->cinfo, COL_INFO, ", password %s", passwd); /* A protocol dissector can be called in 2 different ways: (a) Operational dissection In this mode, Wireshark is only interested in the way protocols interact, protocol conversations are created, packets are reassembled and handed over to higher-level protocol dissectors. In this mode Wireshark does not build a so-called "protocol tree". (b) Detailed dissection In this mode, Wireshark is also interested in all details of a given protocol, so a "protocol tree" is created. Wireshark distinguishes between the 2 modes with the proto_tree pointer: (a) <=> tree == NULL (b) <=> tree != NULL In the interest of speed, if "tree" is NULL, avoid building a protocol tree and adding stuff to it, or even looking at any packet data needed only if you're building the protocol tree, if possible. Note, however, that you must fill in column information, create conversations, reassemble packets, build any other persistent state needed for dissection, and call subdissectors regardless of whether "tree" is NULL or not. This might be inconvenient to do without doing most of the dissection work; the routines for adding items to the protocol tree can be passed a null protocol tree pointer, in which case they'll return a null item pointer, and "proto_item_add_subtree()" returns a null tree pointer if passed a null item pointer, so, if you're careful not to dereference any null tree or item pointers, you can accomplish this by doing all the dissection work. This might not be as efficient as skipping that work if you're not building a protocol tree, but if the code would have a lot of tests whether "tree" is null if you skipped that work, you might still be better off just doing all that work regardless of whether "tree" is null or not. */ if (tree) { /* NOTE: The offset and length values in the call to "proto_tree_add_item()" define what data bytes to highlight in the hex display window when the line in the protocol tree display corresponding to that item is selected. Supplying a length of -1 is the way to highlight all data from the offset to the end of the packet. */ /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_wol, tvb, 0, len, ENC_NA); proto_item_append_text(ti, ", MAC: %s", address_with_resolution_to_str(pinfo->pool, &mac_addr)); if ( passwd ) proto_item_append_text(ti, ", password: %s", passwd); wol_tree = proto_item_add_subtree(ti, ett_wol); /* add an item to the subtree, see section 1.6 for more information */ proto_tree_add_item(wol_tree, hf_wol_sync, tvb, 0, 6, ENC_NA); /* Continue adding tree items to process the packet here */ mac_tree = proto_tree_add_subtree_format(wol_tree, tvb, 6, 96, ett_wol_macblock, NULL, "MAC: %s", address_with_resolution_to_str(pinfo->pool, &mac_addr)); for ( offset = 6; offset < 102; offset += 6 ) proto_tree_add_ether(mac_tree, hf_wol_mac, tvb, offset, 6, mac); if ( len == 106 ) proto_tree_add_bytes_format_value(wol_tree, hf_wol_passwd, tvb, offset, 4, passwd, "%s", passwd); else if ( len == 108 ) proto_tree_add_bytes_format_value(wol_tree, hf_wol_passwd, tvb, offset, 6, passwd, "%s", passwd); } return (len); } static int dissect_wol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { return dissect_wol_pdu(tvb, pinfo, tree, data); } static gboolean dissect_wolheur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { if (dissect_wol_pdu(tvb, pinfo, tree, data) > 0) return TRUE; return FALSE; } /* Register the protocol with Wireshark */ /* this format is require because a script is used to build the C function that calls all the protocol registration. */ void proto_register_wol(void) { /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_wol_sync, { "Sync stream", "wol.sync", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wol_mac, { "MAC", "wol.mac", FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_wol_passwd, { "Password", "wol.passwd", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }} }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wol, &ett_wol_macblock }; /* Register the protocol name and description */ proto_wol = proto_register_protocol("Wake On LAN", "WOL", "wol"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_wol, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* If this dissector uses sub-dissector registration add a registration routine. This exact format is required because a script is used to find these routines and create the code that calls these routines. */ void proto_reg_handoff_wol(void) { dissector_handle_t wol_handle; /* Use create_dissector_handle() to indicate that dissect_wol() * returns the number of bytes it dissected (or 0 if it thinks the packet * does not belong to PROTONAME). */ wol_handle = create_dissector_handle(dissect_wol, proto_wol); /* We don't really want to register with EVERY possible dissector, * do we? I know that the AMD white paper specifies that the * MagicPacket could be present in any frame, but are we seriously * going to register WOL with every other dissector!? I think not. * * Unless anyone has a better idea, just register with only those that * are in "common usage" and grow this list as needed. Yeah, I'm sure * we'll miss some, but how else to do this ... add a thousand of * these dissector_add_uint()'s and heur_dissector_add()'s??? */ dissector_add_uint("ethertype", ETHERTYPE_WOL, wol_handle); heur_dissector_add("udp", dissect_wolheur, "Wake On LAN over UDP", "wol_udp", proto_wol, HEURISTIC_ENABLE); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wow.c
/* packet-wow.c * Routines for World of Warcraft (WoW) protocol dissection * Copyright 2008-2009, Stephen Fisher (see AUTHORS file) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* This dissector is based on the MaNGOS project's source code, Stanford's * SRP protocol documents (http://srp.stanford.edu) and RFC 2945: "The SRP * Authentication and Key Exchange System." */ #include "config.h" #include <epan/packet.h> #include <epan/prefs.h> #include <epan/charsets.h> #include "packet-tcp.h" void proto_register_wow(void); void proto_reg_handoff_wow(void); typedef enum { AUTH_LOGON_CHALLENGE = 0x00, AUTH_LOGON_PROOF = 0x01, AUTH_LOGON_RECONNECT = 0x02, AUTH_LOGON_RECONNECT_PROOF = 0x03, REALM_LIST = 0x10, XFER_INITIATE = 0x30, XFER_DATA = 0x31, XFER_ACCEPT = 0x32, XFER_RESUME = 0x33, XFER_CANCEL = 0x34 } auth_cmd_e; static const value_string cmd_vs[] = { { AUTH_LOGON_CHALLENGE, "Authentication Logon Challenge" }, { AUTH_LOGON_PROOF, "Authentication Logon Proof" }, { AUTH_LOGON_RECONNECT, "Authentication Reconnect Challenge" }, { AUTH_LOGON_RECONNECT_PROOF, "Authentication Reconnect Proof" }, { REALM_LIST, "Realm List" }, { XFER_INITIATE, "Transfer Initiate" }, { XFER_DATA, "Transfer Data" }, { XFER_ACCEPT, "Transfer Accept" }, { XFER_RESUME, "Transfer Resume" }, { XFER_CANCEL, "Transfer Cancel" }, { 0, NULL } }; typedef enum { SUCCESS = 0x00, FAIL_UNKNOWN0 = 0x01, FAIL_UNKNOWN1 = 0x02, FAIL_BANNED = 0x03, FAIL_UNKNOWN_ACCOUNT = 0x04, FAIL_INCORRECT_PASSWORD = 0x05, FAIL_ALREADY_ONLINE = 0x06, FAIL_NO_TIME = 0x07, FAIL_DB_BUSY = 0x08, FAIL_VERSION_INVALID = 0x09, FAIL_VERSION_UPDATE = 0x0A, FAIL_INVALID_SERVER = 0x0B, FAIL_SUSPENDED = 0x0C, FAIL_NOACCESS = 0x0D, SUCCESS_SURVEY = 0x0E, FAIL_PARENTAL_CONTROL = 0x0F } auth_error_e; static const value_string error_vs[] = { { SUCCESS, "Success" }, { FAIL_UNKNOWN0, "Unknown" }, { FAIL_UNKNOWN1, "Unknown" }, { FAIL_BANNED, "Account banned" }, { FAIL_UNKNOWN_ACCOUNT, "Unknown account" }, { FAIL_INCORRECT_PASSWORD, "Incorrect password" }, { FAIL_ALREADY_ONLINE, "Already online" }, { FAIL_NO_TIME, "No game time on account" }, { FAIL_DB_BUSY, "Database busy (could not log in)" }, { FAIL_VERSION_INVALID, "Invalid game version" }, { FAIL_VERSION_UPDATE, "Failed version update" }, { FAIL_INVALID_SERVER, "Invalid server" }, { FAIL_SUSPENDED, "Account suspended" }, { FAIL_NOACCESS, "Unable to connect" }, { SUCCESS_SURVEY, "Survey success" }, { FAIL_PARENTAL_CONTROL, "Blocked by parental controls" }, { 0, NULL } }; typedef enum { FLAG_NONE = 0x0, FLAG_INVALID = 0x1, FLAG_OFFLINE = 0x2, FLAG_SPECIFY_BUILD = 0x4, FLAG_UNK1 = 0x8, FLAG_UNK2 = 0x10, FLAG_FORCE_RECOMMENDED = 0x20, FLAG_FORCE_NEW_PLAYERS = 0x40, FLAG_FORCE_FULL = 0x80 } auth_realm_flag_e; static const value_string realm_flags_vs[] = { { FLAG_NONE, "" }, { FLAG_INVALID, "Locked" }, { FLAG_OFFLINE, "Offline" }, { FLAG_SPECIFY_BUILD, "Realm version info appended" }, { FLAG_UNK1, "Unknown" }, { FLAG_UNK2, "Unknown" }, { FLAG_FORCE_RECOMMENDED, "Realm status is 'Recommended' in blue text" }, { FLAG_FORCE_NEW_PLAYERS, "Realm status is 'Recommended' in green text" }, { FLAG_FORCE_FULL, "Realm status is 'Full' in red text" }, { 0, NULL } }; static const value_string realm_type_vs[] = { { 0, "Normal" }, { 1, "Player versus player" }, { 4, "Normal (2)" }, { 6, "Role playing normal" }, { 8, "Role playing player versus player)" }, { 0, NULL } }; #define WOW_PORT 3724 #define WOW_CLIENT_TO_SERVER pinfo->destport == WOW_PORT #define WOW_SERVER_TO_CLIENT pinfo->srcport == WOW_PORT /* Initialize the protocol and registered fields */ static int proto_wow = -1; /* More than 1 packet */ static int hf_wow_command = -1; static int hf_wow_error = -1; static int hf_wow_protocol_version = -1; static int hf_wow_pkt_size = -1; static int hf_wow_two_factor_pin_salt = -1; static int hf_wow_num_keys = -1; static int hf_wow_two_factor_enabled = -1; static int hf_wow_challenge_data = -1; /* Logon Challenge Client to Server */ static int hf_wow_gamename = -1; static int hf_wow_version1 = -1; static int hf_wow_version2 = -1; static int hf_wow_version3 = -1; static int hf_wow_build = -1; static int hf_wow_platform = -1; static int hf_wow_os = -1; static int hf_wow_country = -1; static int hf_wow_timezone_bias = -1; static int hf_wow_ip = -1; static int hf_wow_srp_i_len = -1; static int hf_wow_srp_i = -1; /* Logon Challenge Server to Client */ static int hf_wow_srp_b = -1; static int hf_wow_srp_g_len = -1; static int hf_wow_srp_g = -1; static int hf_wow_srp_n_len = -1; static int hf_wow_srp_n = -1; static int hf_wow_srp_s = -1; static int hf_wow_crc_salt = -1; static int hf_wow_two_factor_pin_grid_seed = -1; /* Logon Proof Client to Server */ static int hf_wow_srp_a = -1; static int hf_wow_srp_m1 = -1; static int hf_wow_crc_hash = -1; static int hf_wow_two_factor_pin_hash = -1; /* Logon Proof Server to Client */ static int hf_wow_srp_m2 = -1; static int hf_wow_hardware_survey_id = -1; static int hf_wow_account_flags = -1; static int hf_wow_unknown_flags = -1; /* Reconnect Challenge Server to Client */ static int hf_wow_checksum_salt = -1; /* Reconnect Proof Client to Server */ static int hf_wow_client_proof = -1; static int hf_wow_client_checksum = -1; /* Realm List Server to Client */ static int hf_wow_num_realms = -1; static int hf_wow_realm_type = -1; static int hf_wow_realm_locked = -1; static int hf_wow_realm_flags = -1; static int hf_wow_realm_category = -1; static int hf_wow_realm_name = -1; static int hf_wow_realm_socket = -1; static int hf_wow_realm_population_level = -1; static int hf_wow_realm_num_characters = -1; static int hf_wow_realm_id = -1; static gboolean wow_preference_desegment = TRUE; static gint ett_wow = -1; static gint ett_wow_realms = -1; struct game_version { gint8 major_version; gint8 minor_version; gint8 patch_version; gint16 revision; }; static struct game_version client_game_version = { -1, -1, -1, -1 }; // WoW uses a kind of SemVer. // So 1.0.0 is always greater than any 0.x.y, and // 1.2.0 is always greater than any 1.1.y static gboolean version_is_at_or_above(int major, int minor, int patch) { if (client_game_version.major_version > major) { return TRUE; } else if (client_game_version.major_version < major) { return FALSE; } // Major versions must be equal if (client_game_version.minor_version > minor) { return TRUE; } else if (client_game_version.minor_version < minor) { return FALSE; } // Both major and minor versions are equal if (client_game_version.patch_version > patch) { return TRUE; } else if (client_game_version.patch_version < patch) { return FALSE; } // All versions are identical return TRUE; } static void parse_logon_proof_client_to_server(tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 two_factor_enabled; proto_tree_add_item(wow_tree, hf_wow_srp_a, tvb, offset, 32, ENC_NA); offset += 32; proto_tree_add_item(wow_tree, hf_wow_srp_m1, tvb, offset, 20, ENC_NA); offset += 20; proto_tree_add_item(wow_tree, hf_wow_crc_hash, tvb, offset, 20, ENC_NA); offset += 20; proto_tree_add_item(wow_tree, hf_wow_num_keys, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (!version_is_at_or_above(1, 12, 0)) { return; } two_factor_enabled = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_two_factor_enabled, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (!two_factor_enabled) { return; } proto_tree_add_item(wow_tree, hf_wow_two_factor_pin_salt, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(wow_tree, hf_wow_two_factor_pin_hash, tvb, offset, 20, ENC_NA); } static void parse_logon_proof_server_to_client(tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 error; error = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (error != SUCCESS) { // Following fields are only present when not an error. return; } proto_tree_add_item(wow_tree, hf_wow_srp_m2, tvb, offset, 20, ENC_NA); offset += 20; if (version_is_at_or_above(2, 4, 0)) { proto_tree_add_item(wow_tree, hf_wow_account_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; } proto_tree_add_item(wow_tree, hf_wow_hardware_survey_id, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (version_is_at_or_above(2, 0, 3)) { proto_tree_add_item(wow_tree, hf_wow_unknown_flags, tvb, offset, 2, ENC_LITTLE_ENDIAN); } } static void parse_realm_list_server_to_client(packet_info *pinfo, tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 num_realms, ii, number_of_realms_field_size, realm_name_offset, realm_type_field_size, realm_flags; gchar *string, *realm_name; gint len; proto_tree *wow_realms_tree; proto_tree_add_item(wow_tree, hf_wow_pkt_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; offset += 4; /* Unknown field; always 0 */ if (version_is_at_or_above(2, 4, 3)) { /* Possibly valid for versions starting at 2.0.0 as well */ number_of_realms_field_size = 2; realm_name_offset = 3; realm_type_field_size = 1; } else { number_of_realms_field_size = 1; realm_name_offset = 5; realm_type_field_size = 4; } proto_tree_add_item(wow_tree, hf_wow_num_realms, tvb, offset, number_of_realms_field_size, ENC_LITTLE_ENDIAN); num_realms = tvb_get_guint8(tvb, offset); offset += number_of_realms_field_size; for(ii = 0; ii < num_realms; ii++) { realm_name = tvb_get_stringz_enc(pinfo->pool, tvb, offset + realm_name_offset, &len, ENC_UTF_8); wow_realms_tree = proto_tree_add_subtree(wow_tree, tvb, offset, 0, ett_wow_realms, NULL, realm_name); proto_tree_add_item(wow_realms_tree, hf_wow_realm_type, tvb, offset, realm_type_field_size, ENC_LITTLE_ENDIAN); offset += realm_type_field_size; if (version_is_at_or_above(2, 4, 3)) { /* Possibly valid for versions starting at 2.0.0 as well */ proto_tree_add_item(wow_realms_tree, hf_wow_realm_locked, tvb, offset, 1, ENC_NA); offset += 1; } realm_flags = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_realms_tree, hf_wow_realm_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_string(wow_realms_tree, hf_wow_realm_name, tvb, offset, len, realm_name); offset += len; string = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &len, ENC_UTF_8); proto_tree_add_string(wow_realms_tree, hf_wow_realm_socket, tvb, offset, len, string); offset += len; proto_tree_add_item(wow_realms_tree, hf_wow_realm_population_level, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(wow_realms_tree, hf_wow_realm_num_characters, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_realms_tree, hf_wow_realm_category, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_realms_tree, hf_wow_realm_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (version_is_at_or_above(2, 4, 3) && (realm_flags & FLAG_SPECIFY_BUILD)) { proto_tree_add_item(wow_realms_tree, hf_wow_version1, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_realms_tree, hf_wow_version2, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_realms_tree, hf_wow_version3, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_realms_tree, hf_wow_build, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; } } } static void parse_logon_reconnect_proof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wow_tree, guint32 offset) { if (WOW_CLIENT_TO_SERVER) { proto_tree_add_item(wow_tree, hf_wow_challenge_data, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(wow_tree, hf_wow_client_proof, tvb, offset, 20, ENC_NA); offset += 20; proto_tree_add_item(wow_tree, hf_wow_client_checksum, tvb, offset, 20, ENC_NA); offset += 20; proto_tree_add_item(wow_tree, hf_wow_num_keys, tvb, offset, 1, ENC_LITTLE_ENDIAN); } else if (WOW_SERVER_TO_CLIENT) { proto_tree_add_item(wow_tree, hf_wow_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); } } static void parse_logon_reconnect_challenge_server_to_client(tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 error = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (error != SUCCESS) { // Following fields are only present when not an error. return; } proto_tree_add_item(wow_tree, hf_wow_challenge_data, tvb, offset, 16, ENC_NA); offset += 16; proto_tree_add_item(wow_tree, hf_wow_checksum_salt, tvb, offset, 16, ENC_NA); } static void parse_logon_challenge_client_to_server(packet_info *pinfo, tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 srp_i_len; char buffer[5]; gchar *string; proto_tree_add_item(wow_tree, hf_wow_protocol_version, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; proto_tree_add_item(wow_tree, hf_wow_pkt_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5); string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4); proto_tree_add_string(wow_tree, hf_wow_gamename, tvb, offset, 4, string); offset += 4; client_game_version.major_version = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_version1, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; client_game_version.minor_version = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_version2, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; client_game_version.patch_version = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_version3, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; client_game_version.revision = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_item(wow_tree, hf_wow_build, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5); string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4); proto_tree_add_string(wow_tree, hf_wow_platform, tvb, offset, 4, string); offset += 4; tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5); string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4); proto_tree_add_string(wow_tree, hf_wow_os, tvb, offset, 4, string); offset += 4; tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5); string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4); proto_tree_add_string(wow_tree, hf_wow_country, tvb, offset, 4, string); offset += 4; proto_tree_add_item(wow_tree, hf_wow_timezone_bias, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(wow_tree, hf_wow_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(wow_tree, hf_wow_srp_i_len, tvb, offset, 1, ENC_LITTLE_ENDIAN); srp_i_len = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_item(wow_tree, hf_wow_srp_i, tvb, offset, srp_i_len, ENC_UTF_8); } static void parse_logon_challenge_server_to_client(tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) { guint8 error, srp_g_len, srp_n_len, two_factor_enabled; proto_tree_add_item(wow_tree, hf_wow_protocol_version, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; error = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_error, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (error != SUCCESS) { // Following fields are only present when not an error. return; } proto_tree_add_item(wow_tree, hf_wow_srp_b, tvb, offset, 32, ENC_NA); offset += 32; proto_tree_add_item(wow_tree, hf_wow_srp_g_len, tvb, offset, 1, ENC_LITTLE_ENDIAN); srp_g_len = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_item(wow_tree, hf_wow_srp_g, tvb, offset, srp_g_len, ENC_NA); offset += srp_g_len; proto_tree_add_item(wow_tree, hf_wow_srp_n_len, tvb, offset, 1, ENC_LITTLE_ENDIAN); srp_n_len = tvb_get_guint8(tvb, offset); offset += 1; proto_tree_add_item(wow_tree, hf_wow_srp_n, tvb, offset, srp_n_len, ENC_NA); offset += srp_n_len; proto_tree_add_item(wow_tree, hf_wow_srp_s, tvb, offset, 32, ENC_NA); offset += 32; proto_tree_add_item(wow_tree, hf_wow_crc_salt, tvb, offset, 16, ENC_NA); offset += 16; if (!version_is_at_or_above(1, 12, 0)) { /* The two factor fields were added in the 1.12 update. */ return; } two_factor_enabled = tvb_get_guint8(tvb, offset); proto_tree_add_item(wow_tree, hf_wow_two_factor_enabled, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; if (!two_factor_enabled) { return; } proto_tree_add_item(wow_tree, hf_wow_two_factor_pin_grid_seed, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; proto_tree_add_item(wow_tree, hf_wow_two_factor_pin_salt, tvb, offset, 16, ENC_NA); } static guint get_wow_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset, void *data _U_) { gint8 size_field_offset = -1; guint8 cmd; guint16 pkt_len; cmd = tvb_get_guint8(tvb, offset); if(WOW_SERVER_TO_CLIENT && cmd == REALM_LIST) size_field_offset = 1; if(WOW_CLIENT_TO_SERVER && cmd == AUTH_LOGON_CHALLENGE) size_field_offset = 2; pkt_len = tvb_get_letohs(tvb, size_field_offset); return pkt_len + size_field_offset + 2; } static int dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *wow_tree; guint8 cmd; guint32 offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WOW"); col_clear(pinfo->cinfo, COL_INFO); cmd = tvb_get_guint8(tvb, offset); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cmd, cmd_vs, "Unrecognized packet type")); if(!tree) { return tvb_captured_length(tvb); } ti = proto_tree_add_item(tree, proto_wow, tvb, 0, -1, ENC_NA); wow_tree = proto_item_add_subtree(ti, ett_wow); proto_tree_add_item(wow_tree, hf_wow_command, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; switch(cmd) { case AUTH_LOGON_RECONNECT_PROOF: parse_logon_reconnect_proof(tvb, pinfo, wow_tree, offset); break; case AUTH_LOGON_RECONNECT: if (WOW_SERVER_TO_CLIENT) { parse_logon_reconnect_challenge_server_to_client(tvb, wow_tree, offset); } else if (WOW_CLIENT_TO_SERVER) { parse_logon_challenge_client_to_server(pinfo, tvb, wow_tree, offset); } break; case AUTH_LOGON_CHALLENGE : if(WOW_CLIENT_TO_SERVER) { parse_logon_challenge_client_to_server(pinfo, tvb, wow_tree, offset); } else if(WOW_SERVER_TO_CLIENT) { parse_logon_challenge_server_to_client(tvb, wow_tree, offset); } break; case AUTH_LOGON_PROOF : if (WOW_CLIENT_TO_SERVER) { parse_logon_proof_client_to_server(tvb, wow_tree, offset); } else if (WOW_SERVER_TO_CLIENT) { parse_logon_proof_server_to_client(tvb, wow_tree, offset); } break; case REALM_LIST : if(WOW_CLIENT_TO_SERVER) { } else if(WOW_SERVER_TO_CLIENT) { parse_realm_list_server_to_client(pinfo, tvb, wow_tree, offset); } break; } return tvb_captured_length(tvb); } static gboolean dissect_wow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { gint8 size_field_offset = -1; guint8 cmd; cmd = tvb_get_guint8(tvb, 0); if(WOW_SERVER_TO_CLIENT && cmd == REALM_LIST) size_field_offset = 1; if(WOW_CLIENT_TO_SERVER && cmd == AUTH_LOGON_CHALLENGE) size_field_offset = 2; if(size_field_offset > -1) { tcp_dissect_pdus(tvb, pinfo, tree, wow_preference_desegment, size_field_offset+2, get_wow_pdu_len, dissect_wow_pdu, data); } else { /* Doesn't have a size field, so it cannot span multiple segments. Therefore, dissect this packet normally. */ dissect_wow_pdu(tvb, pinfo, tree, data); } return TRUE; } void proto_register_wow(void) { module_t *wow_module; /* For our preferences */ static hf_register_info hf[] = { { &hf_wow_command, { "Command", "wow.cmd", FT_UINT8, BASE_HEX, VALS(cmd_vs), 0, "Type of packet", HFILL } }, { &hf_wow_protocol_version, { "Protocol version", "wow.protocol_version", FT_UINT8, BASE_DEC, 0, 0, "Version of packet", HFILL } }, { &hf_wow_error, { "Error", "wow.error", FT_UINT8, BASE_HEX, VALS(error_vs), 0, NULL, HFILL } }, { &hf_wow_pkt_size, { "Packet size", "wow.pkt_size", FT_UINT16, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_gamename, { "Game name", "wow.gamename", FT_STRING, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_version1, { "Version 1", "wow.version1", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_version2, { "Version 2", "wow.version2", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_version3, { "Version 3", "wow.version3", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_build, { "Build", "wow.build", FT_UINT16, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_platform, { "Platform", "wow.platform", FT_STRING, BASE_NONE, 0, 0, "CPU architecture of client system", HFILL } }, { &hf_wow_os, { "Operating system", "wow.os", FT_STRING, BASE_NONE, 0, 0, "Operating system of client system", HFILL } }, { &hf_wow_country, { "Country", "wow.country", FT_STRING, BASE_NONE, 0, 0, "Language and country of client system", HFILL } }, { &hf_wow_timezone_bias, { "Timezone bias", "wow.timezone_bias", FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_ip, { "IP address", "wow.ip", FT_IPv4, BASE_NONE, 0, 0, "Client's actual IP address", HFILL } }, { &hf_wow_srp_i_len, { "SRP I length", "wow.srp.i_len", FT_UINT8, BASE_DEC, 0, 0, "Secure Remote Password protocol 'I' value length", HFILL } }, { &hf_wow_srp_i, { "SRP I", "wow.srp.i", FT_STRING, BASE_NONE, 0, 0, "Secure Remote Password protocol 'I' value (username)", HFILL } }, { &hf_wow_srp_b, { "SRP B", "wow.srp.b", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'B' value (one of the public ephemeral values)", HFILL } }, { &hf_wow_srp_g_len, { "SRP g length", "wow.srp.g_len", FT_UINT8, BASE_DEC, 0, 0, "Secure Remote Password protocol 'g' value length", HFILL } }, { &hf_wow_srp_g, { "SRP g", "wow.srp.g", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'g' value", HFILL } }, { &hf_wow_srp_n_len, { "SRP N length", "wow.srp.n_len", FT_UINT8, BASE_DEC, 0, 0, "Secure Remote Password protocol 'N' value length", HFILL } }, { &hf_wow_srp_n, { "SRP N", "wow.srp.n", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'N' value (a large safe prime)", HFILL } }, { &hf_wow_srp_s, { "SRP s", "wow.srp.s", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 's' (user's salt) value", HFILL } }, { &hf_wow_crc_salt, { "CRC salt", "wow.crc_salt", FT_BYTES, BASE_NONE, 0, 0, "Salt to be used for the hash in the reply packet", HFILL } }, { &hf_wow_two_factor_enabled, { "Two factor enabled", "wow.two_factor_enabled", FT_BOOLEAN, BASE_NONE, 0, 0, "Enables two factor authentication", HFILL } }, { &hf_wow_srp_a, { "SRP A", "wow.srp.a", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'A' value (one of the public ephemeral values)", HFILL } }, { &hf_wow_srp_m1, { "SRP M1", "wow.srp.m1", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'M1' value", HFILL } }, { &hf_wow_crc_hash, { "CRC hash", "wow.crc_hash", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_num_keys, { "Number of keys", "wow.num_keys", FT_UINT8, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_hardware_survey_id, { "Hardware Survey ID", "wow.hardware_survey_id", FT_UINT32, BASE_DEC, 0, 0, "ID of a hardware survey that the client should run", HFILL } }, { &hf_wow_account_flags, { "Account Flags", "wow.account_flags", FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL } }, { &hf_wow_unknown_flags, { "Unknown Flags", "wow.unknown_flags", FT_UINT16, BASE_HEX, 0, 0, NULL, HFILL } }, { &hf_wow_srp_m2, { "SRP M2", "wow.srp.m2", FT_BYTES, BASE_NONE, 0, 0, "Secure Remote Password protocol 'M2' value", HFILL } }, { &hf_wow_challenge_data, { "Reconnection Challenge Data", "wow.reconnect_challenge_data", FT_BYTES, BASE_NONE, 0, 0, "Random data used for reconnection calculation", HFILL } }, { &hf_wow_checksum_salt, { "Reconnection Checksum Salt", "wow.reconnect_checksum_salt", FT_BYTES, BASE_NONE, 0, 0, "Unknown. Unused in 1.12", HFILL } }, { &hf_wow_client_proof, { "Reconnection Client Proof", "wow.reconnect_proof", FT_BYTES, BASE_NONE, 0, 0, "Client proof of knowing session key based on challenge data", HFILL } }, { &hf_wow_client_checksum, { "Reconnection Checksum", "wow.reconnect_checksum", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_two_factor_pin_grid_seed, { "Two Factor PIN Grid Seed", "wow.two_factor_pin_grid_seed", FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL } }, { &hf_wow_two_factor_pin_salt, { "Two Factor PIN Salt", "wow.two_factor_pin_salt", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_two_factor_pin_hash, { "Two Factor PIN Hash", "wow.two_factor_pin_hash", FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_num_realms, { "Number of realms", "wow.num_realms", FT_UINT16, BASE_DEC, 0, 0, NULL, HFILL } }, { &hf_wow_realm_type, { "Type", "wow.realm_type", FT_UINT8, BASE_DEC, VALS(realm_type_vs), 0, "Also known as realm icon", HFILL } }, { &hf_wow_realm_locked, { "Locked", "wow.realm_locked", FT_BOOLEAN, BASE_NONE, 0, 0, "Realm appears as locked in client", HFILL } }, { &hf_wow_realm_flags, { "Flags", "wow.realm_flags", FT_UINT8, BASE_DEC, VALS(realm_flags_vs), 0, NULL, HFILL } }, { &hf_wow_realm_category, { "Category", "wow.realm_category", FT_UINT8, BASE_DEC, 0, 0, "Language category the realm should be shown in", HFILL } }, { &hf_wow_realm_name, { "Name", "wow.realm_name", FT_STRINGZ, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_realm_socket, { "Server socket", "wow.realm_socket", FT_STRINGZ, BASE_NONE, 0, 0, "IP address and port to connect to on the server to reach this realm", HFILL } }, { &hf_wow_realm_population_level, { "Population level", "wow.realm_population_level", FT_FLOAT, BASE_NONE, 0, 0, NULL, HFILL } }, { &hf_wow_realm_num_characters, { "Number of characters", "wow.realm_num_characters", FT_UINT8, BASE_DEC, 0, 0, "Number of characters the user has in this realm", HFILL } }, { &hf_wow_realm_id, { "Realm id", "wow.realm_id", FT_UINT8, BASE_DEC, 0, 0, "Used for initial sorting the in client menu", HFILL } } }; static gint *ett[] = { &ett_wow, &ett_wow_realms }; proto_wow = proto_register_protocol("World of Warcraft", "WOW", "wow"); proto_register_field_array(proto_wow, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); wow_module = prefs_register_protocol(proto_wow, NULL); prefs_register_bool_preference(wow_module, "desegment", "Reassemble wow messages spanning multiple TCP segments.", "Whether the wow dissector should reassemble messages spanning multiple TCP segments. To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &wow_preference_desegment); } void proto_reg_handoff_wow(void) { dissector_handle_t wow_handle; wow_handle = create_dissector_handle(dissect_wow, proto_wow); dissector_add_uint_with_preference("tcp.port", WOW_PORT, wow_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C
wireshark/epan/dissectors/packet-woww.c
/* packet-woww.c * Routines for World of Warcraft World dissection * Copyright 2021, Gtker <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * The protocol is used for World of Warcraft World packets. * These are seen when a client is connected to a world server and plays the game. * The WOW protocol (no extra W) packets are Login packets, and they are handled in * the packet-wow.c file. * * The message definitions are automatically generated from the `wowm` files at * https://github.com/gtker/wow_messages. * * More info on world packets and login packets: * https://wowdev.wiki/World_Packet * https://wowdev.wiki/Login_Packet * * Currently this dissector is valid for 1.12.x, the most popular Vanilla version. * * All World packets contain a header with: * * A 16 bit big endian size field. * * A (32 or 16 bit) little endian opcode field. * Server to client opcodes are 16 bits while client to server opcodes are 32 bits. * * All world packets other than SMSG_AUTH_CHALLENGE and CMSG_AUTH_SESSION have * "encrypted" headers based on a 40 byte session key, however it is relatively * easily broken. * * SMSG packets are Server messages (from server) and CMSG packets are Client messages * (from client). MSG packets can be either. * * # SESSION KEY DEDUCTION: * * The header is encrypted through the formula `E = (x ^ S) + L` where: * * E is the encrypted value. * * x is the plain unencrypted value. * * S is a byte of the session key. * * L is the last encrypted value. * * The header is decrypted through the formula `x = (E - L) ^ S` with the same values. * * Notably, this allows us to deduce the session key value S if we know what the * unencrypted value x is. The L value is simply the last encrypted value sent. * * Fortunately, the client sends opcodes as 32bit little endian values, but there are no * opcodes that use the two most significant bytes meaning we can always count on them being 0. * This means we can now deduce the session key value S through `S = 0 ^ (E - L)` (where 0 is x). * Because of this we can deduce 2 bytes of the session key every client packet. */ #include <config.h> #include <epan/packet.h> #include <epan/conversation.h> #include <epan/wmem_scopes.h> #include <ptvcursor.h> void proto_reg_handoff_woww(void); void proto_register_woww(void); static dissector_handle_t woww_handle; static int proto_woww = -1; /* Fields that all packets have */ static int hf_woww_size = -1; static int hf_woww_opcode = -1; static int hf_woww_string_length = -1; static int hf_woww_aura_mask = -1; static int hf_woww_aura = -1; static int hf_woww_amount_of_masks = -1; static int hf_woww_update_mask = -1; static int hf_woww_update_mask_index = -1; static int hf_woww_update_mask_value = -1; static int hf_woww_amount_of_splines = -1; static int hf_woww_packed_spline = -1; /* AUTOGENERATED_START_HF */ static int hf_woww_absorb = -1; static int hf_woww_absorbed = -1; static int hf_woww_absorbed_damage = -1; static int hf_woww_account_data_type = -1; static int hf_woww_action = -1; static int hf_woww_action_bar = -1; static int hf_woww_action_bars = -1; static int hf_woww_action_type = -1; static int hf_woww_activate_taxi_reply = -1; static int hf_woww_actual_roll = -1; static int hf_woww_addon_crc = -1; static int hf_woww_addon_extra_crc = -1; static int hf_woww_addon_has_signature = -1; static int hf_woww_addon_name = -1; static int hf_woww_addon_type = -1; static int hf_woww_agility = -1; static int hf_woww_ai_reaction = -1; static int hf_woww_allow_movement = -1; static int hf_woww_allowed_class = -1; static int hf_woww_allowed_genders = -1; static int hf_woww_allowed_guild_id = -1; static int hf_woww_allowed_maximum_level = -1; static int hf_woww_allowed_minimum_level = -1; static int hf_woww_allowed_race = -1; static int hf_woww_ammo_display_id = -1; static int hf_woww_ammo_inventory_type = -1; static int hf_woww_ammo_type = -1; static int hf_woww_amount = -1; static int hf_woww_amount_bought = -1; static int hf_woww_amount_for_sale = -1; static int hf_woww_amount_of_accounts_in_guild = -1; static int hf_woww_amount_of_auras = -1; static int hf_woww_amount_of_carriers = -1; static int hf_woww_amount_of_characters = -1; static int hf_woww_amount_of_characters_in_guild = -1; static int hf_woww_amount_of_choice_item_rewards = -1; static int hf_woww_amount_of_cooldowns = -1; static int hf_woww_amount_of_damages = -1; static int hf_woww_amount_of_effects = -1; static int hf_woww_amount_of_emotes = -1; static int hf_woww_amount_of_entries = -1; static int hf_woww_amount_of_events = -1; static int hf_woww_amount_of_extra_fields = -1; static int hf_woww_amount_of_faction_standings = -1; static int hf_woww_amount_of_factions = -1; static int hf_woww_amount_of_friends = -1; static int hf_woww_amount_of_gossip_items = -1; static int hf_woww_amount_of_hits = -1; static int hf_woww_amount_of_ignored = -1; static int hf_woww_amount_of_item_rewards = -1; static int hf_woww_amount_of_items = -1; static int hf_woww_amount_of_logs = -1; static int hf_woww_amount_of_mails = -1; static int hf_woww_amount_of_members = -1; static int hf_woww_amount_of_misses = -1; static int hf_woww_amount_of_nodes = -1; static int hf_woww_amount_of_objects = -1; static int hf_woww_amount_of_outbid_items = -1; static int hf_woww_amount_of_petitions = -1; static int hf_woww_amount_of_pets = -1; static int hf_woww_amount_of_players = -1; static int hf_woww_amount_of_quests = -1; static int hf_woww_amount_of_raid_infos = -1; static int hf_woww_amount_of_reactions = -1; static int hf_woww_amount_of_records = -1; static int hf_woww_amount_of_required_items = -1; static int hf_woww_amount_of_rights = -1; static int hf_woww_amount_of_signatures = -1; static int hf_woww_amount_of_spells = -1; static int hf_woww_amount_of_states = -1; static int hf_woww_amount_of_strings = -1; static int hf_woww_amount_of_targets = -1; static int hf_woww_amount_of_teammates = -1; static int hf_woww_amount_of_zones = -1; static int hf_woww_angle = -1; static int hf_woww_animation_id = -1; static int hf_woww_answer = -1; static int hf_woww_answer_comment = -1; static int hf_woww_apply = -1; static int hf_woww_arcane_resistance = -1; static int hf_woww_area = -1; static int hf_woww_argument = -1; static int hf_woww_armor = -1; static int hf_woww_attacker = -1; static int hf_woww_auction_command_action = -1; static int hf_woww_auction_command_result = -1; static int hf_woww_auction_command_result_two = -1; static int hf_woww_auction_duration_in_minutes = -1; static int hf_woww_auction_house = -1; static int hf_woww_auction_id = -1; static int hf_woww_auction_main_category = -1; static int hf_woww_auction_out_bid = -1; static int hf_woww_auction_outbid = -1; static int hf_woww_auction_slot_id = -1; static int hf_woww_auction_sub_category = -1; static int hf_woww_auctioneer = -1; static int hf_woww_aura_duration = -1; static int hf_woww_aura_slot = -1; static int hf_woww_aura_type = -1; static int hf_woww_auto_decline_time = -1; static int hf_woww_auto_finish = -1; static int hf_woww_autocast_enabled = -1; static int hf_woww_average_wait_time_in_ms = -1; static int hf_woww_background_color = -1; static int hf_woww_backwards_running_speed = -1; static int hf_woww_backwards_swimming_speed = -1; static int hf_woww_bag = -1; static int hf_woww_bag_family = -1; static int hf_woww_bag_index = -1; static int hf_woww_bag_slot = -1; static int hf_woww_bag_type_subclass = -1; static int hf_woww_battlefield_port_action = -1; static int hf_woww_battleground_bracket = -1; static int hf_woww_battleground_end_status = -1; static int hf_woww_battleground_winner = -1; static int hf_woww_battlegrounds = -1; static int hf_woww_battlemaster = -1; static int hf_woww_bg_type_id = -1; static int hf_woww_bid = -1; static int hf_woww_bidder = -1; static int hf_woww_billing_flags = -1; static int hf_woww_billing_rested = -1; static int hf_woww_billing_time = -1; static int hf_woww_block = -1; static int hf_woww_blocked = -1; static int hf_woww_blocked_amount = -1; static int hf_woww_body = -1; static int hf_woww_body_text = -1; static int hf_woww_bonding = -1; static int hf_woww_bonus_honor = -1; static int hf_woww_border_color = -1; static int hf_woww_border_style = -1; static int hf_woww_bug_type = -1; static int hf_woww_build = -1; static int hf_woww_button = -1; static int hf_woww_buy_bank_slot_result = -1; static int hf_woww_buy_price = -1; static int hf_woww_buy_result = -1; static int hf_woww_buyback_slot = -1; static int hf_woww_buyout = -1; static int hf_woww_buyout_amount = -1; static int hf_woww_cash_on_delivery_amount = -1; static int hf_woww_cast_failure_reason = -1; static int hf_woww_cast_flags = -1; static int hf_woww_cast_item = -1; static int hf_woww_caster = -1; static int hf_woww_category_cooldown = -1; static int hf_woww_channel = -1; static int hf_woww_channel_flags = -1; static int hf_woww_channel_member_flags = -1; static int hf_woww_channel_name = -1; static int hf_woww_channel_password = -1; static int hf_woww_character_flags = -1; static int hf_woww_character_guid = -1; static int hf_woww_character_name = -1; static int hf_woww_charter_display_id = -1; static int hf_woww_charter_entry = -1; static int hf_woww_charter_owner = -1; static int hf_woww_chat_credit = -1; static int hf_woww_chat_data_line_count = -1; static int hf_woww_chat_data_size_uncompressed = -1; static int hf_woww_chat_notify = -1; static int hf_woww_chat_type = -1; static int hf_woww_checked_timestamp = -1; static int hf_woww_cinematic_sequence_id = -1; static int hf_woww_civilian = -1; static int hf_woww_class = -1; static int hf_woww_class_mask = -1; static int hf_woww_client_instance_id = -1; static int hf_woww_client_proof = -1; static int hf_woww_client_seed = -1; static int hf_woww_code = -1; static int hf_woww_coded = -1; static int hf_woww_comment = -1; static int hf_woww_compressed_chat_data = -1; static int hf_woww_compressed_data = -1; static int hf_woww_compressed_move_opcode = -1; static int hf_woww_container_slots = -1; static int hf_woww_content = -1; static int hf_woww_cooldown = -1; static int hf_woww_cooldown_count = -1; static int hf_woww_cooldown_time = -1; static int hf_woww_corpse = -1; static int hf_woww_corpse_query_result = -1; static int hf_woww_cos_angle = -1; static int hf_woww_cost_in_copper = -1; static int hf_woww_count = -1; static int hf_woww_countdown_time = -1; static int hf_woww_counter = -1; static int hf_woww_created_day = -1; static int hf_woww_created_month = -1; static int hf_woww_created_year = -1; static int hf_woww_creature = -1; static int hf_woww_creature_entry = -1; static int hf_woww_creature_family = -1; static int hf_woww_creature_id = -1; static int hf_woww_creature_rank = -1; static int hf_woww_creature_type = -1; static int hf_woww_critical = -1; static int hf_woww_current_health = -1; static int hf_woww_current_power = -1; static int hf_woww_damage = -1; static int hf_woww_damage_float = -1; static int hf_woww_damage_maximum = -1; static int hf_woww_damage_minimum = -1; static int hf_woww_damage_state = -1; static int hf_woww_damage_uint = -1; static int hf_woww_data = -1; static int hf_woww_data_type = -1; static int hf_woww_datetime = -1; static int hf_woww_days_since_last_updated = -1; static int hf_woww_days_since_oldest_ticket_creation = -1; static int hf_woww_days_since_ticket_creation = -1; static int hf_woww_deadline = -1; static int hf_woww_deaths = -1; static int hf_woww_debug_log_format = -1; static int hf_woww_decompressed_addon_info_size = -1; static int hf_woww_decompressed_size = -1; static int hf_woww_delay = -1; static int hf_woww_delay_time = -1; static int hf_woww_description = -1; static int hf_woww_destination_bag = -1; static int hf_woww_destination_node = -1; static int hf_woww_destination_slot = -1; static int hf_woww_destionation_slot = -1; static int hf_woww_details = -1; static int hf_woww_dismount_result = -1; static int hf_woww_display_id = -1; static int hf_woww_duel_winner_reason = -1; static int hf_woww_durability = -1; static int hf_woww_duration = -1; static int hf_woww_eff = -1; static int hf_woww_emblem_color = -1; static int hf_woww_emblem_style = -1; static int hf_woww_emote_delay = -1; static int hf_woww_emote_enum = -1; static int hf_woww_emote_int = -1; static int hf_woww_enable_pvp = -1; static int hf_woww_enchantment = -1; static int hf_woww_encrypted_data = -1; static int hf_woww_end_text = -1; static int hf_woww_ended_without_interruption = -1; static int hf_woww_enemy = -1; static int hf_woww_energize_amount = -1; static int hf_woww_energize_power = -1; static int hf_woww_energy = -1; static int hf_woww_entry = -1; static int hf_woww_entry_id = -1; static int hf_woww_environmental_damage_type = -1; static int hf_woww_equip_error = -1; static int hf_woww_equipment_display_id = -1; static int hf_woww_equipped_item_class = -1; static int hf_woww_equipped_item_inventory_type_mask = -1; static int hf_woww_equipped_item_subclass_mask = -1; static int hf_woww_event_descriptions = -1; static int hf_woww_exp_group_bonus = -1; static int hf_woww_experience = -1; static int hf_woww_experience_award_type = -1; static int hf_woww_experience_reward = -1; static int hf_woww_experience_without_rested = -1; static int hf_woww_expiration_time = -1; static int hf_woww_extend_flag = -1; static int hf_woww_extra_attacks = -1; static int hf_woww_face = -1; static int hf_woww_facial_hair = -1; static int hf_woww_faction = -1; static int hf_woww_faction_flag = -1; static int hf_woww_fall_time = -1; static int hf_woww_far_sight_operation = -1; static int hf_woww_feed_pet_item = -1; static int hf_woww_fields = -1; static int hf_woww_fire_resistance = -1; static int hf_woww_first_bag_display_id = -1; static int hf_woww_first_bag_inventory_id = -1; static int hf_woww_first_login = -1; static int hf_woww_first_rank = -1; static int hf_woww_flags = -1; static int hf_woww_focus = -1; static int hf_woww_friend_result = -1; static int hf_woww_friend_status = -1; static int hf_woww_frost_resistance = -1; static int hf_woww_gain_multiplier = -1; static int hf_woww_gameobject = -1; static int hf_woww_gender = -1; static int hf_woww_gift_bag_index = -1; static int hf_woww_gift_slot = -1; static int hf_woww_gift_wrapper = -1; static int hf_woww_gm_ticket_escalation_status = -1; static int hf_woww_gm_ticket_queue_status = -1; static int hf_woww_gm_ticket_response = -1; static int hf_woww_gm_ticket_status = -1; static int hf_woww_gm_ticket_status_response = -1; static int hf_woww_gm_ticket_type = -1; static int hf_woww_gold = -1; static int hf_woww_gossip_list_id = -1; static int hf_woww_grade = -1; static int hf_woww_greeting = -1; static int hf_woww_group_loot_setting = -1; static int hf_woww_group_member_online_status = -1; static int hf_woww_group_number = -1; static int hf_woww_group_type = -1; static int hf_woww_group_update_flags = -1; static int hf_woww_guid = -1; static int hf_woww_guids = -1; static int hf_woww_guild = -1; static int hf_woww_guild_charter_cost = -1; static int hf_woww_guild_command = -1; static int hf_woww_guild_command_result = -1; static int hf_woww_guild_emblem_result = -1; static int hf_woww_guild_event = -1; static int hf_woww_guild_id = -1; static int hf_woww_guild_info = -1; static int hf_woww_guild_member_status = -1; static int hf_woww_guild_name = -1; static int hf_woww_hair_color = -1; static int hf_woww_hair_style = -1; static int hf_woww_happiness = -1; static int hf_woww_has_transport = -1; static int hf_woww_heal_amount = -1; static int hf_woww_heal_critical = -1; static int hf_woww_health = -1; static int hf_woww_higher_bidder = -1; static int hf_woww_highest_bid = -1; static int hf_woww_highest_bidder = -1; static int hf_woww_hit_info = -1; static int hf_woww_hits = -1; static int hf_woww_holy_resistance = -1; static int hf_woww_homebind_timer = -1; static int hf_woww_honor_points = -1; static int hf_woww_honorable_kills = -1; static int hf_woww_horizontal_speed = -1; static int hf_woww_icon = -1; static int hf_woww_id = -1; static int hf_woww_ignored = -1; static int hf_woww_inactive = -1; static int hf_woww_index = -1; static int hf_woww_info_block = -1; static int hf_woww_info_type = -1; static int hf_woww_initiator = -1; static int hf_woww_initiator_name = -1; static int hf_woww_instance_id = -1; static int hf_woww_instance_reset_failed_reason = -1; static int hf_woww_intellect = -1; static int hf_woww_interrupted_spell = -1; static int hf_woww_inventory_result = -1; static int hf_woww_inventory_type = -1; static int hf_woww_invited_player = -1; static int hf_woww_is_applied = -1; static int hf_woww_is_frozen = -1; static int hf_woww_is_online = -1; static int hf_woww_issue_date = -1; static int hf_woww_item = -1; static int hf_woww_item_bag_index = -1; static int hf_woww_item_charges = -1; static int hf_woww_item_class = -1; static int hf_woww_item_class_and_sub_class = -1; static int hf_woww_item_count = -1; static int hf_woww_item_creator = -1; static int hf_woww_item_display_id = -1; static int hf_woww_item_enchant_id = -1; static int hf_woww_item_enchantment = -1; static int hf_woww_item_flag = -1; static int hf_woww_item_icon = -1; static int hf_woww_item_id = -1; static int hf_woww_item_level = -1; static int hf_woww_item_limit_category_id = -1; static int hf_woww_item_name = -1; static int hf_woww_item_owner = -1; static int hf_woww_item_quality = -1; static int hf_woww_item_random_properties_id = -1; static int hf_woww_item_random_property_id = -1; static int hf_woww_item_random_suffix = -1; static int hf_woww_item_random_suffix_id = -1; static int hf_woww_item_set = -1; static int hf_woww_item_slot = -1; static int hf_woww_item_slot_int = -1; static int hf_woww_item_spell_charges = -1; static int hf_woww_item_stack_count = -1; static int hf_woww_item_stack_size = -1; static int hf_woww_item_stat_type = -1; static int hf_woww_item_sub_class_mask = -1; static int hf_woww_item_suffix_factor = -1; static int hf_woww_item_template = -1; static int hf_woww_item_text_id = -1; static int hf_woww_item_to_damage = -1; static int hf_woww_items_required = -1; static int hf_woww_join_as_group = -1; static int hf_woww_key_version = -1; static int hf_woww_kill_count = -1; static int hf_woww_killing_blows = -1; static int hf_woww_lag = -1; static int hf_woww_language = -1; static int hf_woww_last_week_honor = -1; static int hf_woww_last_week_honorable = -1; static int hf_woww_leader = -1; static int hf_woww_level = -1; static int hf_woww_level_played_time = -1; static int hf_woww_lifetime_dishonorable = -1; static int hf_woww_lifetime_honorable = -1; static int hf_woww_list_from = -1; static int hf_woww_list_start_item = -1; static int hf_woww_listed_players = -1; static int hf_woww_living_orientation = -1; static int hf_woww_location_name = -1; static int hf_woww_lock_id = -1; static int hf_woww_log_format = -1; static int hf_woww_logout_result = -1; static int hf_woww_logout_speed = -1; static int hf_woww_loot = -1; static int hf_woww_loot_master = -1; static int hf_woww_loot_method = -1; static int hf_woww_loot_method_error = -1; static int hf_woww_loot_slot = -1; static int hf_woww_loot_slot_type = -1; static int hf_woww_looted_target = -1; static int hf_woww_loyalty = -1; static int hf_woww_mail_action = -1; static int hf_woww_mail_id = -1; static int hf_woww_mail_result = -1; static int hf_woww_mail_result_two = -1; static int hf_woww_mail_template_id = -1; static int hf_woww_mail_type = -1; static int hf_woww_mailbox = -1; static int hf_woww_mailbox_id = -1; static int hf_woww_mana = -1; static int hf_woww_map = -1; static int hf_woww_master_loot = -1; static int hf_woww_material = -1; static int hf_woww_max_count = -1; static int hf_woww_max_durability = -1; static int hf_woww_max_health = -1; static int hf_woww_max_items = -1; static int hf_woww_max_level_money_reward = -1; static int hf_woww_max_power = -1; static int hf_woww_maximum = -1; static int hf_woww_maximum_level = -1; static int hf_woww_maximum_signatures = -1; static int hf_woww_meeting_stone_failure = -1; static int hf_woww_meeting_stone_status = -1; static int hf_woww_member = -1; static int hf_woww_message = -1; static int hf_woww_message_id = -1; static int hf_woww_message_of_the_day = -1; static int hf_woww_minimum = -1; static int hf_woww_minimum_bid = -1; static int hf_woww_minimum_level = -1; static int hf_woww_minimum_signatures = -1; static int hf_woww_misc = -1; static int hf_woww_misc_value = -1; static int hf_woww_money = -1; static int hf_woww_money_in_trade = -1; static int hf_woww_money_reward = -1; static int hf_woww_monster = -1; static int hf_woww_monster_move_type = -1; static int hf_woww_monster_name = -1; static int hf_woww_motd = -1; static int hf_woww_mount_result = -1; static int hf_woww_move_event = -1; static int hf_woww_movement_counter = -1; static int hf_woww_movement_flags = -1; static int hf_woww_multiplier = -1; static int hf_woww_name = -1; static int hf_woww_nature_resistance = -1; static int hf_woww_nearest_node = -1; static int hf_woww_new_bid = -1; static int hf_woww_new_guild_leader_name = -1; static int hf_woww_new_item_chat_alert = -1; static int hf_woww_new_item_creation_type = -1; static int hf_woww_new_item_source = -1; static int hf_woww_new_level = -1; static int hf_woww_new_name = -1; static int hf_woww_new_owner = -1; static int hf_woww_new_speed = -1; static int hf_woww_new_spell_id = -1; static int hf_woww_next_page_id = -1; static int hf_woww_next_quest_in_chain = -1; static int hf_woww_next_resurrect_time = -1; static int hf_woww_node_count = -1; static int hf_woww_nodes = -1; static int hf_woww_note = -1; static int hf_woww_notification = -1; static int hf_woww_npc = -1; static int hf_woww_number_of_battlegrounds = -1; static int hf_woww_number_of_choices = -1; static int hf_woww_object_type = -1; static int hf_woww_object_unk = -1; static int hf_woww_objective_text = -1; static int hf_woww_objective_texts = -1; static int hf_woww_objectives = -1; static int hf_woww_offer_reward_text = -1; static int hf_woww_officer_note = -1; static int hf_woww_old_mover = -1; static int hf_woww_old_spell_id = -1; static int hf_woww_online_players = -1; static int hf_woww_op = -1; static int hf_woww_opponent_name = -1; static int hf_woww_orientation = -1; static int hf_woww_out_bid = -1; static int hf_woww_outbid_item_ids = -1; static int hf_woww_outfit_id = -1; static int hf_woww_owner = -1; static int hf_woww_page_id = -1; static int hf_woww_page_text = -1; static int hf_woww_page_text_material = -1; static int hf_woww_party_operation = -1; static int hf_woww_party_result = -1; static int hf_woww_party_status = -1; static int hf_woww_periodic_log = -1; static int hf_woww_pet = -1; static int hf_woww_pet_command_state = -1; static int hf_woww_pet_current_health = -1; static int hf_woww_pet_current_power = -1; static int hf_woww_pet_display_id = -1; static int hf_woww_pet_enabled = -1; static int hf_woww_pet_feedback = -1; static int hf_woww_pet_level = -1; static int hf_woww_pet_max_health = -1; static int hf_woww_pet_max_power = -1; static int hf_woww_pet_name = -1; static int hf_woww_pet_name_timestamp = -1; static int hf_woww_pet_number = -1; static int hf_woww_pet_react_state = -1; static int hf_woww_pet_slot = -1; static int hf_woww_pet_talk_reason = -1; static int hf_woww_pet_tame_failure_reason = -1; static int hf_woww_petition = -1; static int hf_woww_petition_id = -1; static int hf_woww_petition_result = -1; static int hf_woww_pitch = -1; static int hf_woww_player = -1; static int hf_woww_player_chat_tag = -1; static int hf_woww_player_is_saved_to_a_raid = -1; static int hf_woww_player_name = -1; static int hf_woww_player_rank = -1; static int hf_woww_player_with_killing_blow = -1; static int hf_woww_point_map_id = -1; static int hf_woww_point_opt = -1; static int hf_woww_position = -1; static int hf_woww_position_x = -1; static int hf_woww_position_x_int = -1; static int hf_woww_position_y = -1; static int hf_woww_position_y_int = -1; static int hf_woww_power = -1; static int hf_woww_price = -1; static int hf_woww_probability = -1; static int hf_woww_public_key = -1; static int hf_woww_public_note = -1; static int hf_woww_pvp_corpse = -1; static int hf_woww_pvp_rank = -1; static int hf_woww_query = -1; static int hf_woww_quest_completable = -1; static int hf_woww_quest_failed_reason = -1; static int hf_woww_quest_flags = -1; static int hf_woww_quest_giver_status = -1; static int hf_woww_quest_icon = -1; static int hf_woww_quest_id = -1; static int hf_woww_quest_level = -1; static int hf_woww_quest_method = -1; static int hf_woww_quest_party_message = -1; static int hf_woww_quest_title = -1; static int hf_woww_quest_type = -1; static int hf_woww_question_id = -1; static int hf_woww_queue_position = -1; static int hf_woww_queue_slot = -1; static int hf_woww_race = -1; static int hf_woww_race_mask = -1; static int hf_woww_racial_leader = -1; static int hf_woww_rage = -1; static int hf_woww_raid_group_error = -1; static int hf_woww_raid_instance_message = -1; static int hf_woww_raid_target_index = -1; static int hf_woww_raid_target_update_type = -1; static int hf_woww_random_property = -1; static int hf_woww_random_property_id = -1; static int hf_woww_ranged_range_modification = -1; static int hf_woww_rank = -1; static int hf_woww_rank_id = -1; static int hf_woww_rank_name = -1; static int hf_woww_rank_names = -1; static int hf_woww_rank_progress_bar = -1; static int hf_woww_raw_data = -1; static int hf_woww_read_by_gm = -1; static int hf_woww_realm_name = -1; static int hf_woww_receiver = -1; static int hf_woww_records = -1; static int hf_woww_reputation_objective_value = -1; static int hf_woww_reputation_rank = -1; static int hf_woww_request_items_text = -1; static int hf_woww_requested_rank = -1; static int hf_woww_required_city_rank = -1; static int hf_woww_required_faction_rank = -1; static int hf_woww_required_honor_rank = -1; static int hf_woww_required_item_count = -1; static int hf_woww_required_item_id = -1; static int hf_woww_required_kill_count = -1; static int hf_woww_required_level = -1; static int hf_woww_required_money = -1; static int hf_woww_required_opposite_reputation_value = -1; static int hf_woww_required_skill_rank = -1; static int hf_woww_required_skill_value = -1; static int hf_woww_required_spell = -1; static int hf_woww_required_spell_focus = -1; static int hf_woww_required_spells = -1; static int hf_woww_reserved_for_future_use = -1; static int hf_woww_reset_time = -1; static int hf_woww_resist = -1; static int hf_woww_resisted = -1; static int hf_woww_reward = -1; static int hf_woww_reward_spell = -1; static int hf_woww_reward_spell_cast = -1; static int hf_woww_rights = -1; static int hf_woww_roll_number = -1; static int hf_woww_roll_vote = -1; static int hf_woww_round_time_in_ms = -1; static int hf_woww_running_speed = -1; static int hf_woww_scale = -1; static int hf_woww_search_strings = -1; static int hf_woww_searched_name = -1; static int hf_woww_self_player = -1; static int hf_woww_sell_item_result = -1; static int hf_woww_sell_price = -1; static int hf_woww_sender = -1; static int hf_woww_sender_id = -1; static int hf_woww_sender_name = -1; static int hf_woww_sequence_id = -1; static int hf_woww_server_id = -1; static int hf_woww_server_message_type = -1; static int hf_woww_server_seed = -1; static int hf_woww_set_assistant = -1; static int hf_woww_shadow_resistance = -1; static int hf_woww_sheath_state = -1; static int hf_woww_sheathe_type = -1; static int hf_woww_show_affiliation = -1; static int hf_woww_signer = -1; static int hf_woww_simple_spell_cast_result = -1; static int hf_woww_sin_angle = -1; static int hf_woww_size_struct = -1; static int hf_woww_skill = -1; static int hf_woww_skin = -1; static int hf_woww_skin_color = -1; static int hf_woww_slot = -1; static int hf_woww_slot_id = -1; static int hf_woww_slot_index = -1; static int hf_woww_sound_id = -1; static int hf_woww_source_bag = -1; static int hf_woww_source_item_id = -1; static int hf_woww_source_node = -1; static int hf_woww_source_slot = -1; static int hf_woww_speech_bubble_credit = -1; static int hf_woww_speed = -1; static int hf_woww_spell = -1; static int hf_woww_spell_art_kit = -1; static int hf_woww_spell_cast_result = -1; static int hf_woww_spell_cast_target_flags = -1; static int hf_woww_spell_category = -1; static int hf_woww_spell_category_cooldown = -1; static int hf_woww_spell_charges = -1; static int hf_woww_spell_cooldown = -1; static int hf_woww_spell_cost = -1; static int hf_woww_spell_count = -1; static int hf_woww_spell_data_id = -1; static int hf_woww_spell_effect = -1; static int hf_woww_spell_id = -1; static int hf_woww_spell_index = -1; static int hf_woww_spell_miss_info = -1; static int hf_woww_spell_on_lowest_slot = -1; static int hf_woww_spell_school = -1; static int hf_woww_spell_school_mask = -1; static int hf_woww_spell_trigger_type = -1; static int hf_woww_spell_visual_kit = -1; static int hf_woww_spells = -1; static int hf_woww_spirit = -1; static int hf_woww_spirit_released = -1; static int hf_woww_spline_elevation = -1; static int hf_woww_spline_flag = -1; static int hf_woww_spline_id = -1; static int hf_woww_stable_master = -1; static int hf_woww_stable_result = -1; static int hf_woww_stable_slots = -1; static int hf_woww_stack_count = -1; static int hf_woww_stackable = -1; static int hf_woww_stamina = -1; static int hf_woww_standing = -1; static int hf_woww_start_bid = -1; static int hf_woww_start_from_page = -1; static int hf_woww_start_quest = -1; static int hf_woww_starting_bid = -1; static int hf_woww_state = -1; static int hf_woww_stationery = -1; static int hf_woww_status = -1; static int hf_woww_status_id = -1; static int hf_woww_strength = -1; static int hf_woww_string = -1; static int hf_woww_sub_name = -1; static int hf_woww_subject = -1; static int hf_woww_suggestion = -1; static int hf_woww_summoner = -1; static int hf_woww_survey_id = -1; static int hf_woww_swap_with_name = -1; static int hf_woww_swimming_speed = -1; static int hf_woww_talent = -1; static int hf_woww_talent_point_cost = -1; static int hf_woww_talent_reset_cost = -1; static int hf_woww_target = -1; static int hf_woww_target_error = -1; static int hf_woww_target_player = -1; static int hf_woww_target_string = -1; static int hf_woww_targets = -1; static int hf_woww_taxi_mask_node_known = -1; static int hf_woww_text = -1; static int hf_woww_text_emote = -1; static int hf_woww_text_id = -1; static int hf_woww_texts = -1; static int hf_woww_this_week_honor = -1; static int hf_woww_this_week_honorable = -1; static int hf_woww_time = -1; static int hf_woww_time_in_queue_in_ms = -1; static int hf_woww_time_left = -1; static int hf_woww_time_offline = -1; static int hf_woww_time_passed = -1; static int hf_woww_time_remaining = -1; static int hf_woww_time_skipped = -1; static int hf_woww_time_to_bg_autoleave_in_ms = -1; static int hf_woww_time_to_bg_start_in_ms = -1; static int hf_woww_time_to_remove_in_queue_in_ms = -1; static int hf_woww_timer = -1; static int hf_woww_timer_type = -1; static int hf_woww_timescale = -1; static int hf_woww_timestamp = -1; static int hf_woww_title = -1; static int hf_woww_title_text_id = -1; static int hf_woww_today_honorable_and_dishonorable = -1; static int hf_woww_todo_amount_of_signers = -1; static int hf_woww_total_amount_of_auctions = -1; static int hf_woww_total_cost = -1; static int hf_woww_total_damage = -1; static int hf_woww_total_exp = -1; static int hf_woww_total_played_time = -1; static int hf_woww_trade_item = -1; static int hf_woww_trade_slot = -1; static int hf_woww_trade_slot_count = -1; static int hf_woww_trade_slot_number = -1; static int hf_woww_trade_status = -1; static int hf_woww_trainer_spell_state = -1; static int hf_woww_trainer_type = -1; static int hf_woww_training_failure_reason = -1; static int hf_woww_transfer_abort_reason = -1; static int hf_woww_transport = -1; static int hf_woww_transport_guid = -1; static int hf_woww_transport_orientation = -1; static int hf_woww_transport_progress_in_ms = -1; static int hf_woww_trigger_id = -1; static int hf_woww_turn_rate = -1; static int hf_woww_tutorial_data = -1; static int hf_woww_tutorial_flag = -1; static int hf_woww_type_flags = -1; static int hf_woww_unit_stand_state = -1; static int hf_woww_unit_target = -1; static int hf_woww_unknown_flags = -1; static int hf_woww_unknown_float = -1; static int hf_woww_unknown_guid = -1; static int hf_woww_unknown_int = -1; static int hf_woww_unread_mails = -1; static int hf_woww_unused = -1; static int hf_woww_update_available_flag = -1; static int hf_woww_update_flag = -1; static int hf_woww_update_type = -1; static int hf_woww_url = -1; static int hf_woww_url_info = -1; static int hf_woww_usable = -1; static int hf_woww_username = -1; static int hf_woww_v_cos = -1; static int hf_woww_v_sin = -1; static int hf_woww_value = -1; static int hf_woww_vendor = -1; static int hf_woww_vendor_slot = -1; static int hf_woww_vertical_speed = -1; static int hf_woww_victim = -1; static int hf_woww_walking_speed = -1; static int hf_woww_weather_change_type = -1; static int hf_woww_weather_type = -1; static int hf_woww_winning_player = -1; static int hf_woww_winning_roll = -1; static int hf_woww_wiping_npc = -1; static int hf_woww_won = -1; static int hf_woww_world_result = -1; static int hf_woww_wrapped = -1; static int hf_woww_x = -1; static int hf_woww_xy_speed = -1; static int hf_woww_y = -1; static int hf_woww_yesterday_honor = -1; static int hf_woww_yesterday_honorable = -1; static int hf_woww_z = -1; static int hf_woww_z_speed = -1; static int hf_woww_zone_or_sort = -1; static int hf_woww_zones = -1; /* AUTOGENERATED_END_HF */ #define WOWW_CLIENT_TO_SERVER pinfo->srcport > pinfo->destport #define WOWW_SERVER_TO_CLIENT pinfo->srcport < pinfo->destport // Allocate 8 because tree wants 32 bit aligned data #define WOWW_HEADER_ARRAY_ALLOC_SIZE 8 #define WOWW_HEADER_SIZE_FIELD_WIDTH 2 // The session key is the result of two SHA-1 hashes appended, so it is // _always_ 40 bytes. #define WOWW_SESSION_KEY_LENGTH 40 static gint ett_woww = -1; static gint ett_message = -1; static gint ett_character = -1; // Packets that do not have at least a u16 size field and a u16 opcode field are not valid. #define WOWW_MIN_LENGTH 4 // A participant can either be the server or a client. typedef struct WowwParticipant { // The previous encrypted value sent. Persists through headers. guint8 last_encrypted_value; // Index into the session key. Must always be in [0; WOWW_SESSION_KEY_LENGTH - 1]. // Named idx because there's a check for 'index' guint8 idx; // The first header is unencrypted. Tracks if that header has been encountered. gboolean unencrypted_packet_encountered; // If a server message is unable to be fully decrypted we stop decrypting any // any more, since it's impossible to know if the PDU contains multiple messages // and thus how many times the session key index should be incremented. guint64 stopped_at; } WowwParticipant_t; typedef struct WowwConversation { // Secret session key known to the client and host. guint8 session_key[WOWW_SESSION_KEY_LENGTH]; // Which values of the session key have been deduced. bool known_indices[WOWW_SESSION_KEY_LENGTH]; // Cache headers that have already been decrypted to save time // as well as reduce headaches from out of order packets. wmem_map_t* decrypted_headers; // Packets that are not fully decryptable when received will need // to be decrypted later. wmem_map_t* headers_need_decryption; // The client and server will have different indices/last values // because they send different amounts of packets and with different // header lengths. WowwParticipant_t client; WowwParticipant_t server; } WowwConversation_t; typedef struct { // Index into the session key, named idx because there's a check for 'index' guint8 idx; guint8 last_encrypted_value; } WowwPreviousValues_t; typedef struct { guint8 size[2]; guint8 opcode[]; } WowwDecryptedHeader_t; /* AUTOGENERATED_START_ENUM */ typedef enum { ADDON_TYPE_BANNED = 0x0, ADDON_TYPE_ENABLED = 0x1, ADDON_TYPE_BLIZZARD = 0x2, } e_addon_type; static const value_string e_addon_type_strings[] = { { ADDON_TYPE_BANNED, "Banned" }, { ADDON_TYPE_ENABLED, "Enabled" }, { ADDON_TYPE_BLIZZARD, "Blizzard" }, { 0, NULL } }; typedef enum { INFO_BLOCK_UNAVAILABLE = 0x0, INFO_BLOCK_AVAILABLE = 0x1, } e_info_block; static const value_string e_info_block_strings[] = { { INFO_BLOCK_UNAVAILABLE, "Unavailable" }, { INFO_BLOCK_AVAILABLE, "Available" }, { 0, NULL } }; typedef enum { KEY_VERSION_ZERO = 0x0, KEY_VERSION_ONE = 0x1, KEY_VERSION_TWO = 0x2, KEY_VERSION_THREE = 0x3, KEY_VERSION_FOUR = 0x4, KEY_VERSION_FIVE = 0x5, KEY_VERSION_SIX = 0x6, KEY_VERSION_SEVEN = 0x7, KEY_VERSION_EIGHT = 0x8, KEY_VERSION_NINE = 0x9, } e_key_version; static const value_string e_key_version_strings[] = { { KEY_VERSION_ZERO, "Zero" }, { KEY_VERSION_ONE, "One" }, { KEY_VERSION_TWO, "Two" }, { KEY_VERSION_THREE, "Three" }, { KEY_VERSION_FOUR, "Four" }, { KEY_VERSION_FIVE, "Five" }, { KEY_VERSION_SIX, "Six" }, { KEY_VERSION_SEVEN, "Seven" }, { KEY_VERSION_EIGHT, "Eight" }, { KEY_VERSION_NINE, "Nine" }, { 0, NULL } }; typedef enum { URL_INFO_UNAVAILABLE = 0x0, URL_INFO_AVAILABLE = 0x1, } e_url_info; static const value_string e_url_info_strings[] = { { URL_INFO_UNAVAILABLE, "Unavailable" }, { URL_INFO_AVAILABLE, "Available" }, { 0, NULL } }; typedef enum { AURA_TYPE_NONE = 0x00, AURA_TYPE_BIND_SIGHT = 0x01, AURA_TYPE_MOD_POSSESS = 0x02, AURA_TYPE_PERIODIC_DAMAGE = 0x03, AURA_TYPE_DUMMY = 0x04, AURA_TYPE_MOD_CONFUSE = 0x05, AURA_TYPE_MOD_CHARM = 0x06, AURA_TYPE_MOD_FEAR = 0x07, AURA_TYPE_PERIODIC_HEAL = 0x08, AURA_TYPE_MOD_ATTACKSPEED = 0x09, AURA_TYPE_MOD_THREAT = 0x0A, AURA_TYPE_MOD_TAUNT = 0x0B, AURA_TYPE_MOD_STUN = 0x0C, AURA_TYPE_MOD_DAMAGE_DONE = 0x0D, AURA_TYPE_MOD_DAMAGE_TAKEN = 0x0E, AURA_TYPE_DAMAGE_SHIELD = 0x0F, AURA_TYPE_MOD_STEALTH = 0x10, AURA_TYPE_MOD_STEALTH_DETECT = 0x11, AURA_TYPE_MOD_INVISIBILITY = 0x12, AURA_TYPE_MOD_INVISIBILITY_DETECTION = 0x13, AURA_TYPE_OBS_MOD_HEALTH = 0x14, AURA_TYPE_OBS_MOD_MANA = 0x15, AURA_TYPE_MOD_RESISTANCE = 0x16, AURA_TYPE_PERIODIC_TRIGGER_SPELL = 0x17, AURA_TYPE_PERIODIC_ENERGIZE = 0x18, AURA_TYPE_MOD_PACIFY = 0x19, AURA_TYPE_MOD_ROOT = 0x1A, AURA_TYPE_MOD_SILENCE = 0x1B, AURA_TYPE_REFLECT_SPELLS = 0x1C, AURA_TYPE_MOD_STAT = 0x1D, AURA_TYPE_MOD_SKILL = 0x1E, AURA_TYPE_MOD_INCREASE_SPEED = 0x1F, AURA_TYPE_MOD_INCREASE_MOUNTED_SPEED = 0x20, AURA_TYPE_MOD_DECREASE_SPEED = 0x21, AURA_TYPE_MOD_INCREASE_HEALTH = 0x22, AURA_TYPE_MOD_INCREASE_ENERGY = 0x23, AURA_TYPE_MOD_SHAPESHIFT = 0x24, AURA_TYPE_EFFECT_IMMUNITY = 0x25, AURA_TYPE_STATE_IMMUNITY = 0x26, AURA_TYPE_SCHOOL_IMMUNITY = 0x27, AURA_TYPE_DAMAGE_IMMUNITY = 0x28, AURA_TYPE_DISPEL_IMMUNITY = 0x29, AURA_TYPE_PROC_TRIGGER_SPELL = 0x2A, AURA_TYPE_PROC_TRIGGER_DAMAGE = 0x2B, AURA_TYPE_TRACK_CREATURES = 0x2C, AURA_TYPE_TRACK_RESOURCES = 0x2D, AURA_TYPE_UNKNOWN46 = 0x2E, AURA_TYPE_MOD_PARRY_PERCENT = 0x2F, AURA_TYPE_UNKNOWN48 = 0x30, AURA_TYPE_MOD_DODGE_PERCENT = 0x31, AURA_TYPE_MOD_BLOCK_SKILL = 0x32, AURA_TYPE_MOD_BLOCK_PERCENT = 0x33, AURA_TYPE_MOD_CRIT_PERCENT = 0x34, AURA_TYPE_PERIODIC_LEECH = 0x35, AURA_TYPE_MOD_HIT_CHANCE = 0x36, AURA_TYPE_MOD_SPELL_HIT_CHANCE = 0x37, AURA_TYPE_TRANSFORM = 0x38, AURA_TYPE_MOD_SPELL_CRIT_CHANCE = 0x39, AURA_TYPE_MOD_INCREASE_SWIM_SPEED = 0x3A, AURA_TYPE_MOD_DAMAGE_DONE_CREATURE = 0x3B, AURA_TYPE_MOD_PACIFY_SILENCE = 0x3C, AURA_TYPE_MOD_SCALE = 0x3D, AURA_TYPE_PERIODIC_HEALTH_FUNNEL = 0x3E, AURA_TYPE_PERIODIC_MANA_FUNNEL = 0x3F, AURA_TYPE_PERIODIC_MANA_LEECH = 0x40, AURA_TYPE_MOD_CASTING_SPEED_NOT_STACK = 0x41, AURA_TYPE_FEIGN_DEATH = 0x42, AURA_TYPE_MOD_DISARM = 0x43, AURA_TYPE_MOD_STALKED = 0x44, AURA_TYPE_SCHOOL_ABSORB = 0x45, AURA_TYPE_EXTRA_ATTACKS = 0x46, AURA_TYPE_MOD_SPELL_CRIT_CHANCE_SCHOOL = 0x47, AURA_TYPE_MOD_POWER_COST_SCHOOL_PCT = 0x48, AURA_TYPE_MOD_POWER_COST_SCHOOL = 0x49, AURA_TYPE_REFLECT_SPELLS_SCHOOL = 0x4A, AURA_TYPE_MOD_LANGUAGE = 0x4B, AURA_TYPE_FAR_SIGHT = 0x4C, AURA_TYPE_MECHANIC_IMMUNITY = 0x4D, AURA_TYPE_MOUNTED = 0x4E, AURA_TYPE_MOD_DAMAGE_PERCENT_DONE = 0x4F, AURA_TYPE_MOD_PERCENT_STAT = 0x50, AURA_TYPE_SPLIT_DAMAGE_PCT = 0x51, AURA_TYPE_WATER_BREATHING = 0x52, AURA_TYPE_MOD_BASE_RESISTANCE = 0x53, AURA_TYPE_MOD_REGEN = 0x54, AURA_TYPE_MOD_POWER_REGEN = 0x55, AURA_TYPE_CHANNEL_DEATH_ITEM = 0x56, AURA_TYPE_MOD_DAMAGE_PERCENT_TAKEN = 0x57, AURA_TYPE_MOD_HEALTH_REGEN_PERCENT = 0x58, AURA_TYPE_PERIODIC_DAMAGE_PERCENT = 0x59, AURA_TYPE_MOD_RESIST_CHANCE = 0x5A, AURA_TYPE_MOD_DETECT_RANGE = 0x5B, AURA_TYPE_PREVENTS_FLEEING = 0x5C, AURA_TYPE_MOD_UNATTACKABLE = 0x5D, AURA_TYPE_INTERRUPT_REGEN = 0x5E, AURA_TYPE_GHOST = 0x5F, AURA_TYPE_SPELL_MAGNET = 0x60, AURA_TYPE_MANA_SHIELD = 0x61, AURA_TYPE_MOD_SKILL_TALENT = 0x62, AURA_TYPE_MOD_ATTACK_POWER = 0x63, AURA_TYPE_AURAS_VISIBLE = 0x64, AURA_TYPE_MOD_RESISTANCE_PCT = 0x65, AURA_TYPE_MOD_MELEE_ATTACK_POWER_VERSUS = 0x66, AURA_TYPE_MOD_TOTAL_THREAT = 0x67, AURA_TYPE_WATER_WALK = 0x68, AURA_TYPE_FEATHER_FALL = 0x69, AURA_TYPE_HOVER = 0x6A, AURA_TYPE_ADD_FLAT_MODIFIER = 0x6B, AURA_TYPE_ADD_PCT_MODIFIER = 0x6C, AURA_TYPE_ADD_TARGET_TRIGGER = 0x6D, AURA_TYPE_MOD_POWER_REGEN_PERCENT = 0x6E, AURA_TYPE_ADD_CASTER_HIT_TRIGGER = 0x6F, AURA_TYPE_OVERRIDE_CLASS_SCRIPTS = 0x70, AURA_TYPE_MOD_RANGED_DAMAGE_TAKEN = 0x71, AURA_TYPE_MOD_RANGED_DAMAGE_TAKEN_PCT = 0x72, AURA_TYPE_MOD_HEALING = 0x73, AURA_TYPE_MOD_REGEN_DURING_COMBAT = 0x74, AURA_TYPE_MOD_MECHANIC_RESISTANCE = 0x75, AURA_TYPE_MOD_HEALING_PCT = 0x76, AURA_TYPE_SHARE_PET_TRACKING = 0x77, AURA_TYPE_UNTRACKABLE = 0x78, AURA_TYPE_EMPATHY = 0x79, AURA_TYPE_MOD_OFFHAND_DAMAGE_PCT = 0x7A, AURA_TYPE_MOD_TARGET_RESISTANCE = 0x7B, AURA_TYPE_MOD_RANGED_ATTACK_POWER = 0x7C, AURA_TYPE_MOD_MELEE_DAMAGE_TAKEN = 0x7D, AURA_TYPE_MOD_MELEE_DAMAGE_TAKEN_PCT = 0x7E, AURA_TYPE_RANGED_ATTACK_POWER_ATTACKER_BONUS = 0x7F, AURA_TYPE_MOD_POSSESS_PET = 0x80, AURA_TYPE_MOD_SPEED_ALWAYS = 0x81, AURA_TYPE_MOD_MOUNTED_SPEED_ALWAYS = 0x82, AURA_TYPE_MOD_RANGED_ATTACK_POWER_VERSUS = 0x83, AURA_TYPE_MOD_INCREASE_ENERGY_PERCENT = 0x84, AURA_TYPE_MOD_INCREASE_HEALTH_PERCENT = 0x85, AURA_TYPE_MOD_MANA_REGEN_INTERRUPT = 0x86, AURA_TYPE_MOD_HEALING_DONE = 0x87, AURA_TYPE_MOD_HEALING_DONE_PERCENT = 0x88, AURA_TYPE_MOD_TOTAL_STAT_PERCENTAGE = 0x89, AURA_TYPE_MOD_MELEE_HASTE = 0x8A, AURA_TYPE_FORCE_REACTION = 0x8B, AURA_TYPE_MOD_RANGED_HASTE = 0x8C, AURA_TYPE_MOD_RANGED_AMMO_HASTE = 0x8D, AURA_TYPE_MOD_BASE_RESISTANCE_PCT = 0x8E, AURA_TYPE_MOD_RESISTANCE_EXCLUSIVE = 0x8F, AURA_TYPE_SAFE_FALL = 0x90, AURA_TYPE_CHARISMA = 0x91, AURA_TYPE_PERSUADED = 0x92, AURA_TYPE_MECHANIC_IMMUNITY_MASK = 0x93, AURA_TYPE_RETAIN_COMBO_POINTS = 0x94, AURA_TYPE_RESIST_PUSHBACK = 0x95, AURA_TYPE_MOD_SHIELD_BLOCKVALUE_PCT = 0x96, AURA_TYPE_TRACK_STEALTHED = 0x97, AURA_TYPE_MOD_DETECTED_RANGE = 0x98, AURA_TYPE_SPLIT_DAMAGE_FLAT = 0x99, AURA_TYPE_MOD_STEALTH_LEVEL = 0x9A, AURA_TYPE_MOD_WATER_BREATHING = 0x9B, AURA_TYPE_MOD_REPUTATION_GAIN = 0x9C, AURA_TYPE_PET_DAMAGE_MULTI = 0x9D, AURA_TYPE_MOD_SHIELD_BLOCKVALUE = 0x9E, AURA_TYPE_NO_PVP_CREDIT = 0x9F, AURA_TYPE_MOD_AOE_AVOIDANCE = 0xA0, AURA_TYPE_MOD_HEALTH_REGEN_IN_COMBAT = 0xA1, AURA_TYPE_POWER_BURN_MANA = 0xA2, AURA_TYPE_MOD_CRIT_DAMAGE_BONUS = 0xA3, AURA_TYPE_UNKNOWN164 = 0xA4, AURA_TYPE_MELEE_ATTACK_POWER_ATTACKER_BONUS = 0xA5, AURA_TYPE_MOD_ATTACK_POWER_PCT = 0xA6, AURA_TYPE_MOD_RANGED_ATTACK_POWER_PCT = 0xA7, AURA_TYPE_MOD_DAMAGE_DONE_VERSUS = 0xA8, AURA_TYPE_MOD_CRIT_PERCENT_VERSUS = 0xA9, AURA_TYPE_DETECT_AMORE = 0xAA, AURA_TYPE_MOD_SPEED_NOT_STACK = 0xAB, AURA_TYPE_MOD_MOUNTED_SPEED_NOT_STACK = 0xAC, AURA_TYPE_ALLOW_CHAMPION_SPELLS = 0xAD, AURA_TYPE_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 0xAE, AURA_TYPE_MOD_SPELL_HEALING_OF_STAT_PERCENT = 0xAF, AURA_TYPE_SPIRIT_OF_REDEMPTION = 0xB0, AURA_TYPE_AOE_CHARM = 0xB1, AURA_TYPE_MOD_DEBUFF_RESISTANCE = 0xB2, AURA_TYPE_MOD_ATTACKER_SPELL_CRIT_CHANCE = 0xB3, AURA_TYPE_MOD_FLAT_SPELL_DAMAGE_VERSUS = 0xB4, AURA_TYPE_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS = 0xB5, AURA_TYPE_MOD_RESISTANCE_OF_STAT_PERCENT = 0xB6, AURA_TYPE_MOD_CRITICAL_THREAT = 0xB7, AURA_TYPE_MOD_ATTACKER_MELEE_HIT_CHANCE = 0xB8, AURA_TYPE_MOD_ATTACKER_RANGED_HIT_CHANCE = 0xB9, AURA_TYPE_MOD_ATTACKER_SPELL_HIT_CHANCE = 0xBA, AURA_TYPE_MOD_ATTACKER_MELEE_CRIT_CHANCE = 0xBB, AURA_TYPE_MOD_ATTACKER_RANGED_CRIT_CHANCE = 0xBC, AURA_TYPE_MOD_RATING = 0xBD, AURA_TYPE_MOD_FACTION_REPUTATION_GAIN = 0xBE, AURA_TYPE_USE_NORMAL_MOVEMENT_SPEED = 0xBF, } e_aura_type; static const value_string e_aura_type_strings[] = { { AURA_TYPE_NONE, "None" }, { AURA_TYPE_BIND_SIGHT, "Bind Sight" }, { AURA_TYPE_MOD_POSSESS, "Mod Possess" }, { AURA_TYPE_PERIODIC_DAMAGE, "Periodic Damage" }, { AURA_TYPE_DUMMY, "Dummy" }, { AURA_TYPE_MOD_CONFUSE, "Mod Confuse" }, { AURA_TYPE_MOD_CHARM, "Mod Charm" }, { AURA_TYPE_MOD_FEAR, "Mod Fear" }, { AURA_TYPE_PERIODIC_HEAL, "Periodic Heal" }, { AURA_TYPE_MOD_ATTACKSPEED, "Mod Attackspeed" }, { AURA_TYPE_MOD_THREAT, "Mod Threat" }, { AURA_TYPE_MOD_TAUNT, "Mod Taunt" }, { AURA_TYPE_MOD_STUN, "Mod Stun" }, { AURA_TYPE_MOD_DAMAGE_DONE, "Mod Damage Done" }, { AURA_TYPE_MOD_DAMAGE_TAKEN, "Mod Damage Taken" }, { AURA_TYPE_DAMAGE_SHIELD, "Damage Shield" }, { AURA_TYPE_MOD_STEALTH, "Mod Stealth" }, { AURA_TYPE_MOD_STEALTH_DETECT, "Mod Stealth Detect" }, { AURA_TYPE_MOD_INVISIBILITY, "Mod Invisibility" }, { AURA_TYPE_MOD_INVISIBILITY_DETECTION, "Mod Invisibility Detection" }, { AURA_TYPE_OBS_MOD_HEALTH, "Obs Mod Health" }, { AURA_TYPE_OBS_MOD_MANA, "Obs Mod Mana" }, { AURA_TYPE_MOD_RESISTANCE, "Mod Resistance" }, { AURA_TYPE_PERIODIC_TRIGGER_SPELL, "Periodic Trigger Spell" }, { AURA_TYPE_PERIODIC_ENERGIZE, "Periodic Energize" }, { AURA_TYPE_MOD_PACIFY, "Mod Pacify" }, { AURA_TYPE_MOD_ROOT, "Mod Root" }, { AURA_TYPE_MOD_SILENCE, "Mod Silence" }, { AURA_TYPE_REFLECT_SPELLS, "Reflect Spells" }, { AURA_TYPE_MOD_STAT, "Mod Stat" }, { AURA_TYPE_MOD_SKILL, "Mod Skill" }, { AURA_TYPE_MOD_INCREASE_SPEED, "Mod Increase Speed" }, { AURA_TYPE_MOD_INCREASE_MOUNTED_SPEED, "Mod Increase Mounted Speed" }, { AURA_TYPE_MOD_DECREASE_SPEED, "Mod Decrease Speed" }, { AURA_TYPE_MOD_INCREASE_HEALTH, "Mod Increase Health" }, { AURA_TYPE_MOD_INCREASE_ENERGY, "Mod Increase Energy" }, { AURA_TYPE_MOD_SHAPESHIFT, "Mod Shapeshift" }, { AURA_TYPE_EFFECT_IMMUNITY, "Effect Immunity" }, { AURA_TYPE_STATE_IMMUNITY, "State Immunity" }, { AURA_TYPE_SCHOOL_IMMUNITY, "School Immunity" }, { AURA_TYPE_DAMAGE_IMMUNITY, "Damage Immunity" }, { AURA_TYPE_DISPEL_IMMUNITY, "Dispel Immunity" }, { AURA_TYPE_PROC_TRIGGER_SPELL, "Proc Trigger Spell" }, { AURA_TYPE_PROC_TRIGGER_DAMAGE, "Proc Trigger Damage" }, { AURA_TYPE_TRACK_CREATURES, "Track Creatures" }, { AURA_TYPE_TRACK_RESOURCES, "Track Resources" }, { AURA_TYPE_UNKNOWN46, "Unknown46" }, { AURA_TYPE_MOD_PARRY_PERCENT, "Mod Parry Percent" }, { AURA_TYPE_UNKNOWN48, "Unknown48" }, { AURA_TYPE_MOD_DODGE_PERCENT, "Mod Dodge Percent" }, { AURA_TYPE_MOD_BLOCK_SKILL, "Mod Block Skill" }, { AURA_TYPE_MOD_BLOCK_PERCENT, "Mod Block Percent" }, { AURA_TYPE_MOD_CRIT_PERCENT, "Mod Crit Percent" }, { AURA_TYPE_PERIODIC_LEECH, "Periodic Leech" }, { AURA_TYPE_MOD_HIT_CHANCE, "Mod Hit Chance" }, { AURA_TYPE_MOD_SPELL_HIT_CHANCE, "Mod Spell Hit Chance" }, { AURA_TYPE_TRANSFORM, "Transform" }, { AURA_TYPE_MOD_SPELL_CRIT_CHANCE, "Mod Spell Crit Chance" }, { AURA_TYPE_MOD_INCREASE_SWIM_SPEED, "Mod Increase Swim Speed" }, { AURA_TYPE_MOD_DAMAGE_DONE_CREATURE, "Mod Damage Done Creature" }, { AURA_TYPE_MOD_PACIFY_SILENCE, "Mod Pacify Silence" }, { AURA_TYPE_MOD_SCALE, "Mod Scale" }, { AURA_TYPE_PERIODIC_HEALTH_FUNNEL, "Periodic Health Funnel" }, { AURA_TYPE_PERIODIC_MANA_FUNNEL, "Periodic Mana Funnel" }, { AURA_TYPE_PERIODIC_MANA_LEECH, "Periodic Mana Leech" }, { AURA_TYPE_MOD_CASTING_SPEED_NOT_STACK, "Mod Casting Speed Not Stack" }, { AURA_TYPE_FEIGN_DEATH, "Feign Death" }, { AURA_TYPE_MOD_DISARM, "Mod Disarm" }, { AURA_TYPE_MOD_STALKED, "Mod Stalked" }, { AURA_TYPE_SCHOOL_ABSORB, "School Absorb" }, { AURA_TYPE_EXTRA_ATTACKS, "Extra Attacks" }, { AURA_TYPE_MOD_SPELL_CRIT_CHANCE_SCHOOL, "Mod Spell Crit Chance School" }, { AURA_TYPE_MOD_POWER_COST_SCHOOL_PCT, "Mod Power Cost School Pct" }, { AURA_TYPE_MOD_POWER_COST_SCHOOL, "Mod Power Cost School" }, { AURA_TYPE_REFLECT_SPELLS_SCHOOL, "Reflect Spells School" }, { AURA_TYPE_MOD_LANGUAGE, "Mod Language" }, { AURA_TYPE_FAR_SIGHT, "Far Sight" }, { AURA_TYPE_MECHANIC_IMMUNITY, "Mechanic Immunity" }, { AURA_TYPE_MOUNTED, "Mounted" }, { AURA_TYPE_MOD_DAMAGE_PERCENT_DONE, "Mod Damage Percent Done" }, { AURA_TYPE_MOD_PERCENT_STAT, "Mod Percent Stat" }, { AURA_TYPE_SPLIT_DAMAGE_PCT, "Split Damage Pct" }, { AURA_TYPE_WATER_BREATHING, "Water Breathing" }, { AURA_TYPE_MOD_BASE_RESISTANCE, "Mod Base Resistance" }, { AURA_TYPE_MOD_REGEN, "Mod Regen" }, { AURA_TYPE_MOD_POWER_REGEN, "Mod Power Regen" }, { AURA_TYPE_CHANNEL_DEATH_ITEM, "Channel Death Item" }, { AURA_TYPE_MOD_DAMAGE_PERCENT_TAKEN, "Mod Damage Percent Taken" }, { AURA_TYPE_MOD_HEALTH_REGEN_PERCENT, "Mod Health Regen Percent" }, { AURA_TYPE_PERIODIC_DAMAGE_PERCENT, "Periodic Damage Percent" }, { AURA_TYPE_MOD_RESIST_CHANCE, "Mod Resist Chance" }, { AURA_TYPE_MOD_DETECT_RANGE, "Mod Detect Range" }, { AURA_TYPE_PREVENTS_FLEEING, "Prevents Fleeing" }, { AURA_TYPE_MOD_UNATTACKABLE, "Mod Unattackable" }, { AURA_TYPE_INTERRUPT_REGEN, "Interrupt Regen" }, { AURA_TYPE_GHOST, "Ghost" }, { AURA_TYPE_SPELL_MAGNET, "Spell Magnet" }, { AURA_TYPE_MANA_SHIELD, "Mana Shield" }, { AURA_TYPE_MOD_SKILL_TALENT, "Mod Skill Talent" }, { AURA_TYPE_MOD_ATTACK_POWER, "Mod Attack Power" }, { AURA_TYPE_AURAS_VISIBLE, "Auras Visible" }, { AURA_TYPE_MOD_RESISTANCE_PCT, "Mod Resistance Pct" }, { AURA_TYPE_MOD_MELEE_ATTACK_POWER_VERSUS, "Mod Melee Attack Power Versus" }, { AURA_TYPE_MOD_TOTAL_THREAT, "Mod Total Threat" }, { AURA_TYPE_WATER_WALK, "Water Walk" }, { AURA_TYPE_FEATHER_FALL, "Feather Fall" }, { AURA_TYPE_HOVER, "Hover" }, { AURA_TYPE_ADD_FLAT_MODIFIER, "Add Flat Modifier" }, { AURA_TYPE_ADD_PCT_MODIFIER, "Add Pct Modifier" }, { AURA_TYPE_ADD_TARGET_TRIGGER, "Add Target Trigger" }, { AURA_TYPE_MOD_POWER_REGEN_PERCENT, "Mod Power Regen Percent" }, { AURA_TYPE_ADD_CASTER_HIT_TRIGGER, "Add Caster Hit Trigger" }, { AURA_TYPE_OVERRIDE_CLASS_SCRIPTS, "Override Class Scripts" }, { AURA_TYPE_MOD_RANGED_DAMAGE_TAKEN, "Mod Ranged Damage Taken" }, { AURA_TYPE_MOD_RANGED_DAMAGE_TAKEN_PCT, "Mod Ranged Damage Taken Pct" }, { AURA_TYPE_MOD_HEALING, "Mod Healing" }, { AURA_TYPE_MOD_REGEN_DURING_COMBAT, "Mod Regen During Combat" }, { AURA_TYPE_MOD_MECHANIC_RESISTANCE, "Mod Mechanic Resistance" }, { AURA_TYPE_MOD_HEALING_PCT, "Mod Healing Pct" }, { AURA_TYPE_SHARE_PET_TRACKING, "Share Pet Tracking" }, { AURA_TYPE_UNTRACKABLE, "Untrackable" }, { AURA_TYPE_EMPATHY, "Empathy" }, { AURA_TYPE_MOD_OFFHAND_DAMAGE_PCT, "Mod Offhand Damage Pct" }, { AURA_TYPE_MOD_TARGET_RESISTANCE, "Mod Target Resistance" }, { AURA_TYPE_MOD_RANGED_ATTACK_POWER, "Mod Ranged Attack Power" }, { AURA_TYPE_MOD_MELEE_DAMAGE_TAKEN, "Mod Melee Damage Taken" }, { AURA_TYPE_MOD_MELEE_DAMAGE_TAKEN_PCT, "Mod Melee Damage Taken Pct" }, { AURA_TYPE_RANGED_ATTACK_POWER_ATTACKER_BONUS, "Ranged Attack Power Attacker Bonus" }, { AURA_TYPE_MOD_POSSESS_PET, "Mod Possess Pet" }, { AURA_TYPE_MOD_SPEED_ALWAYS, "Mod Speed Always" }, { AURA_TYPE_MOD_MOUNTED_SPEED_ALWAYS, "Mod Mounted Speed Always" }, { AURA_TYPE_MOD_RANGED_ATTACK_POWER_VERSUS, "Mod Ranged Attack Power Versus" }, { AURA_TYPE_MOD_INCREASE_ENERGY_PERCENT, "Mod Increase Energy Percent" }, { AURA_TYPE_MOD_INCREASE_HEALTH_PERCENT, "Mod Increase Health Percent" }, { AURA_TYPE_MOD_MANA_REGEN_INTERRUPT, "Mod Mana Regen Interrupt" }, { AURA_TYPE_MOD_HEALING_DONE, "Mod Healing Done" }, { AURA_TYPE_MOD_HEALING_DONE_PERCENT, "Mod Healing Done Percent" }, { AURA_TYPE_MOD_TOTAL_STAT_PERCENTAGE, "Mod Total Stat Percentage" }, { AURA_TYPE_MOD_MELEE_HASTE, "Mod Melee Haste" }, { AURA_TYPE_FORCE_REACTION, "Force Reaction" }, { AURA_TYPE_MOD_RANGED_HASTE, "Mod Ranged Haste" }, { AURA_TYPE_MOD_RANGED_AMMO_HASTE, "Mod Ranged Ammo Haste" }, { AURA_TYPE_MOD_BASE_RESISTANCE_PCT, "Mod Base Resistance Pct" }, { AURA_TYPE_MOD_RESISTANCE_EXCLUSIVE, "Mod Resistance Exclusive" }, { AURA_TYPE_SAFE_FALL, "Safe Fall" }, { AURA_TYPE_CHARISMA, "Charisma" }, { AURA_TYPE_PERSUADED, "Persuaded" }, { AURA_TYPE_MECHANIC_IMMUNITY_MASK, "Mechanic Immunity Mask" }, { AURA_TYPE_RETAIN_COMBO_POINTS, "Retain Combo Points" }, { AURA_TYPE_RESIST_PUSHBACK, "Resist Pushback" }, { AURA_TYPE_MOD_SHIELD_BLOCKVALUE_PCT, "Mod Shield Blockvalue Pct" }, { AURA_TYPE_TRACK_STEALTHED, "Track Stealthed" }, { AURA_TYPE_MOD_DETECTED_RANGE, "Mod Detected Range" }, { AURA_TYPE_SPLIT_DAMAGE_FLAT, "Split Damage Flat" }, { AURA_TYPE_MOD_STEALTH_LEVEL, "Mod Stealth Level" }, { AURA_TYPE_MOD_WATER_BREATHING, "Mod Water Breathing" }, { AURA_TYPE_MOD_REPUTATION_GAIN, "Mod Reputation Gain" }, { AURA_TYPE_PET_DAMAGE_MULTI, "Pet Damage Multi" }, { AURA_TYPE_MOD_SHIELD_BLOCKVALUE, "Mod Shield Blockvalue" }, { AURA_TYPE_NO_PVP_CREDIT, "No Pvp Credit" }, { AURA_TYPE_MOD_AOE_AVOIDANCE, "Mod Aoe Avoidance" }, { AURA_TYPE_MOD_HEALTH_REGEN_IN_COMBAT, "Mod Health Regen In Combat" }, { AURA_TYPE_POWER_BURN_MANA, "Power Burn Mana" }, { AURA_TYPE_MOD_CRIT_DAMAGE_BONUS, "Mod Crit Damage Bonus" }, { AURA_TYPE_UNKNOWN164, "Unknown164" }, { AURA_TYPE_MELEE_ATTACK_POWER_ATTACKER_BONUS, "Melee Attack Power Attacker Bonus" }, { AURA_TYPE_MOD_ATTACK_POWER_PCT, "Mod Attack Power Pct" }, { AURA_TYPE_MOD_RANGED_ATTACK_POWER_PCT, "Mod Ranged Attack Power Pct" }, { AURA_TYPE_MOD_DAMAGE_DONE_VERSUS, "Mod Damage Done Versus" }, { AURA_TYPE_MOD_CRIT_PERCENT_VERSUS, "Mod Crit Percent Versus" }, { AURA_TYPE_DETECT_AMORE, "Detect Amore" }, { AURA_TYPE_MOD_SPEED_NOT_STACK, "Mod Speed Not Stack" }, { AURA_TYPE_MOD_MOUNTED_SPEED_NOT_STACK, "Mod Mounted Speed Not Stack" }, { AURA_TYPE_ALLOW_CHAMPION_SPELLS, "Allow Champion Spells" }, { AURA_TYPE_MOD_SPELL_DAMAGE_OF_STAT_PERCENT, "Mod Spell Damage Of Stat Percent" }, { AURA_TYPE_MOD_SPELL_HEALING_OF_STAT_PERCENT, "Mod Spell Healing Of Stat Percent" }, { AURA_TYPE_SPIRIT_OF_REDEMPTION, "Spirit Of Redemption" }, { AURA_TYPE_AOE_CHARM, "Aoe Charm" }, { AURA_TYPE_MOD_DEBUFF_RESISTANCE, "Mod Debuff Resistance" }, { AURA_TYPE_MOD_ATTACKER_SPELL_CRIT_CHANCE, "Mod Attacker Spell Crit Chance" }, { AURA_TYPE_MOD_FLAT_SPELL_DAMAGE_VERSUS, "Mod Flat Spell Damage Versus" }, { AURA_TYPE_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS, "Mod Flat Spell Crit Damage Versus" }, { AURA_TYPE_MOD_RESISTANCE_OF_STAT_PERCENT, "Mod Resistance Of Stat Percent" }, { AURA_TYPE_MOD_CRITICAL_THREAT, "Mod Critical Threat" }, { AURA_TYPE_MOD_ATTACKER_MELEE_HIT_CHANCE, "Mod Attacker Melee Hit Chance" }, { AURA_TYPE_MOD_ATTACKER_RANGED_HIT_CHANCE, "Mod Attacker Ranged Hit Chance" }, { AURA_TYPE_MOD_ATTACKER_SPELL_HIT_CHANCE, "Mod Attacker Spell Hit Chance" }, { AURA_TYPE_MOD_ATTACKER_MELEE_CRIT_CHANCE, "Mod Attacker Melee Crit Chance" }, { AURA_TYPE_MOD_ATTACKER_RANGED_CRIT_CHANCE, "Mod Attacker Ranged Crit Chance" }, { AURA_TYPE_MOD_RATING, "Mod Rating" }, { AURA_TYPE_MOD_FACTION_REPUTATION_GAIN, "Mod Faction Reputation Gain" }, { AURA_TYPE_USE_NORMAL_MOVEMENT_SPEED, "Use Normal Movement Speed" }, { 0, NULL } }; typedef enum { SPELL_SCHOOL_NORMAL = 0x0, SPELL_SCHOOL_HOLY = 0x1, SPELL_SCHOOL_FIRE = 0x2, SPELL_SCHOOL_NATURE = 0x3, SPELL_SCHOOL_FROST = 0x4, SPELL_SCHOOL_SHADOW = 0x5, SPELL_SCHOOL_ARCANE = 0x6, } e_spell_school; static const value_string e_spell_school_strings[] = { { SPELL_SCHOOL_NORMAL, "Normal" }, { SPELL_SCHOOL_HOLY, "Holy" }, { SPELL_SCHOOL_FIRE, "Fire" }, { SPELL_SCHOOL_NATURE, "Nature" }, { SPELL_SCHOOL_FROST, "Frost" }, { SPELL_SCHOOL_SHADOW, "Shadow" }, { SPELL_SCHOOL_ARCANE, "Arcane" }, { 0, NULL } }; typedef enum { PVP_RANK_NO_RANK = 0x00, PVP_RANK_PARIAH = 0x01, PVP_RANK_OUTLAW = 0x02, PVP_RANK_EXILED = 0x03, PVP_RANK_DISHONORED = 0x04, PVP_RANK_RANK1 = 0x05, PVP_RANK_RANK2 = 0x06, PVP_RANK_RANK3 = 0x07, PVP_RANK_RANK4 = 0x08, PVP_RANK_RANK5 = 0x09, PVP_RANK_RANK6 = 0x0A, PVP_RANK_RANK7 = 0x0B, PVP_RANK_RANK8 = 0x0C, PVP_RANK_RANK9 = 0x0D, PVP_RANK_RANK10 = 0x0E, PVP_RANK_RANK11 = 0x0F, PVP_RANK_RANK12 = 0x10, PVP_RANK_RANK13 = 0x11, PVP_RANK_RANK14 = 0x12, PVP_RANK_FACTION_LEADER = 0x13, } e_pvp_rank; static const value_string e_pvp_rank_strings[] = { { PVP_RANK_NO_RANK, "No Rank" }, { PVP_RANK_PARIAH, "Pariah" }, { PVP_RANK_OUTLAW, "Outlaw" }, { PVP_RANK_EXILED, "Exiled" }, { PVP_RANK_DISHONORED, "Dishonored" }, { PVP_RANK_RANK1, "Rank1" }, { PVP_RANK_RANK2, "Rank2" }, { PVP_RANK_RANK3, "Rank3" }, { PVP_RANK_RANK4, "Rank4" }, { PVP_RANK_RANK5, "Rank5" }, { PVP_RANK_RANK6, "Rank6" }, { PVP_RANK_RANK7, "Rank7" }, { PVP_RANK_RANK8, "Rank8" }, { PVP_RANK_RANK9, "Rank9" }, { PVP_RANK_RANK10, "Rank10" }, { PVP_RANK_RANK11, "Rank11" }, { PVP_RANK_RANK12, "Rank12" }, { PVP_RANK_RANK13, "Rank13" }, { PVP_RANK_RANK14, "Rank14" }, { PVP_RANK_FACTION_LEADER, "Faction Leader" }, { 0, NULL } }; typedef enum { RACE_HUMAN = 0x1, RACE_ORC = 0x2, RACE_DWARF = 0x3, RACE_NIGHT_ELF = 0x4, RACE_UNDEAD = 0x5, RACE_TAUREN = 0x6, RACE_GNOME = 0x7, RACE_TROLL = 0x8, RACE_GOBLIN = 0x9, } e_race; static const value_string e_race_strings[] = { { RACE_HUMAN, "Human" }, { RACE_ORC, "Orc" }, { RACE_DWARF, "Dwarf" }, { RACE_NIGHT_ELF, "Night Elf" }, { RACE_UNDEAD, "Undead" }, { RACE_TAUREN, "Tauren" }, { RACE_GNOME, "Gnome" }, { RACE_TROLL, "Troll" }, { RACE_GOBLIN, "Goblin" }, { 0, NULL } }; typedef enum { CLASS_WARRIOR = 0x1, CLASS_PALADIN = 0x2, CLASS_HUNTER = 0x3, CLASS_ROGUE = 0x4, CLASS_PRIEST = 0x5, CLASS_SHAMAN = 0x7, CLASS_MAGE = 0x8, CLASS_WARLOCK = 0x9, CLASS_DRUID = 0xB, } e_class; static const value_string e_class_strings[] = { { CLASS_WARRIOR, "Warrior" }, { CLASS_PALADIN, "Paladin" }, { CLASS_HUNTER, "Hunter" }, { CLASS_ROGUE, "Rogue" }, { CLASS_PRIEST, "Priest" }, { CLASS_SHAMAN, "Shaman" }, { CLASS_MAGE, "Mage" }, { CLASS_WARLOCK, "Warlock" }, { CLASS_DRUID, "Druid" }, { 0, NULL } }; typedef enum { GENDER_MALE = 0x0, GENDER_FEMALE = 0x1, GENDER_NONE = 0x2, } e_gender; static const value_string e_gender_strings[] = { { GENDER_MALE, "Male" }, { GENDER_FEMALE, "Female" }, { GENDER_NONE, "None" }, { 0, NULL } }; typedef enum { AREA_NONE = 0x000, AREA_DUN_MOROGH = 0x001, AREA_LONGSHORE = 0x002, AREA_BADLANDS = 0x003, AREA_BLASTED_LANDS = 0x004, AREA_BLACKWATER_COVE = 0x007, AREA_SWAMP_OF_SORROWS = 0x008, AREA_NORTHSHIRE_VALLEY = 0x009, AREA_DUSKWOOD = 0x00A, AREA_WETLANDS = 0x00B, AREA_ELWYNN_FOREST = 0x00C, AREA_THE_WORLD_TREE = 0x00D, AREA_DUROTAR = 0x00E, AREA_DUSTWALLOW_MARSH = 0x00F, AREA_AZSHARA = 0x010, AREA_THE_BARRENS = 0x011, AREA_CRYSTAL_LAKE = 0x012, AREA_ZUL_GURUB0 = 0x013, AREA_MOONBROOK = 0x014, AREA_KUL_TIRAS = 0x015, AREA_PROGRAMMER_ISLE = 0x016, AREA_NORTHSHIRE_RIVER = 0x017, AREA_NORTHSHIRE_ABBEY = 0x018, AREA_BLACKROCK_MOUNTAIN0 = 0x019, AREA_LIGHTHOUSE = 0x01A, AREA_WESTERN_PLAGUELANDS = 0x01C, AREA_NINE = 0x01E, AREA_THE_CEMETARY = 0x020, AREA_STRANGLETHORN_VALE = 0x021, AREA_ECHO_RIDGE_MINE = 0x022, AREA_BOOTY_BAY = 0x023, AREA_ALTERAC_MOUNTAINS = 0x024, AREA_LAKE_NAZFERITI = 0x025, AREA_LOCH_MODAN = 0x026, AREA_WESTFALL0 = 0x028, AREA_DEADWIND_PASS = 0x029, AREA_DARKSHIRE = 0x02A, AREA_WILD_SHORE = 0x02B, AREA_REDRIDGE_MOUNTAINS = 0x02C, AREA_ARATHI_HIGHLANDS = 0x02D, AREA_BURNING_STEPPES = 0x02E, AREA_THE_HINTERLANDS = 0x02F, AREA_DEAD_MANS_HOLE = 0x031, AREA_SEARING_GORGE = 0x033, AREA_THIEVES_CAMP = 0x035, AREA_JASPERLODE_MINE = 0x036, AREA_VALLEY_OF_HEROES_UNUSED = 0x037, AREA_HEROES_VIGIL = 0x038, AREA_FARGODEEP_MINE = 0x039, AREA_NORTHSHIRE_VINEYARDS = 0x03B, AREA_FORESTS_EDGE = 0x03C, AREA_THUNDER_FALLS = 0x03D, AREA_BRACKWELL_PUMPKIN_PATCH = 0x03E, AREA_THE_STONEFIELD_FARM = 0x03F, AREA_THE_MACLURE_VINEYARDS = 0x040, AREA_ON_MAP_DUNGEON0 = 0x041, AREA_ON_MAP_DUNGEON1 = 0x042, AREA_ON_MAP_DUNGEON2 = 0x043, AREA_LAKE_EVERSTILL = 0x044, AREA_LAKESHIRE = 0x045, AREA_STONEWATCH = 0x046, AREA_STONEWATCH_FALLS = 0x047, AREA_THE_DARK_PORTAL = 0x048, AREA_THE_TAINTED_SCAR = 0x049, AREA_POOL_OF_TEARS = 0x04A, AREA_STONARD = 0x04B, AREA_FALLOW_SANCTUARY = 0x04C, AREA_ANVILMAR = 0x04D, AREA_STORMWIND_MOUNTAINS = 0x050, AREA_JEFF_NE_QUADRANT_CHANGED = 0x051, AREA_JEFF_NW_QUADRANT = 0x052, AREA_JEFF_SE_QUADRANT = 0x053, AREA_JEFF_SW_QUADRANT = 0x054, AREA_TIRISFAL_GLADES = 0x055, AREA_STONE_CAIRN_LAKE = 0x056, AREA_GOLDSHIRE = 0x057, AREA_EASTVALE_LOGGING_CAMP = 0x058, AREA_MIRROR_LAKE_ORCHARD = 0x059, AREA_TOWER_OF_AZORA = 0x05B, AREA_MIRROR_LAKE = 0x05C, AREA_VUL_GOL_OGRE_MOUND = 0x05D, AREA_RAVEN_HILL = 0x05E, AREA_REDRIDGE_CANYONS = 0x05F, AREA_TOWER_OF_ILGALAR = 0x060, AREA_ALTHERS_MILL = 0x061, AREA_RETHBAN_CAVERNS = 0x062, AREA_REBEL_CAMP = 0x063, AREA_NESINGWARYS_EXPEDITION = 0x064, AREA_KURZENS_COMPOUND = 0x065, AREA_RUINS_OF_ZUL_KUNDA = 0x066, AREA_RUINS_OF_ZUL_MAMWE = 0x067, AREA_THE_VILE_REEF = 0x068, AREA_MOSH_OGG_OGRE_MOUND = 0x069, AREA_THE_STOCKPILE = 0x06A, AREA_SALDEANS_FARM = 0x06B, AREA_SENTINEL_HILL = 0x06C, AREA_FURLBROWS_PUMPKIN_FARM = 0x06D, AREA_JANGOLODE_MINE = 0x06F, AREA_GOLD_COAST_QUARRY = 0x071, AREA_WESTFALL_LIGHTHOUSE = 0x073, AREA_MISTY_VALLEY = 0x074, AREA_GROM_GOL_BASE_CAMP = 0x075, AREA_WHELGARS_EXCAVATION_SITE = 0x076, AREA_WESTBROOK_GARRISON = 0x078, AREA_TRANQUIL_GARDENS_CEMETERY = 0x079, AREA_ZUULDAIA_RUINS = 0x07A, AREA_BAL_LAL_RUINS = 0x07B, AREA_KAL_AI_RUINS = 0x07D, AREA_TKASHI_RUINS = 0x07E, AREA_BALIA_MAH_RUINS = 0x07F, AREA_ZIATAJAI_RUINS = 0x080, AREA_MIZJAH_RUINS = 0x081, AREA_SILVERPINE_FOREST = 0x082, AREA_KHARANOS = 0x083, AREA_COLDRIDGE_VALLEY = 0x084, AREA_GNOMEREGAN0 = 0x085, AREA_GOL_BOLAR_QUARRY = 0x086, AREA_FROSTMANE_HOLD = 0x087, AREA_THE_GRIZZLED_DEN = 0x088, AREA_BREWNALL_VILLAGE = 0x089, AREA_MISTY_PINE_REFUGE = 0x08A, AREA_EASTERN_PLAGUELANDS = 0x08B, AREA_TELDRASSIL = 0x08D, AREA_IRONBANDS_EXCAVATION_SITE = 0x08E, AREA_MO_GROSH_STRONGHOLD = 0x08F, AREA_THELSAMAR = 0x090, AREA_ALGAZ_GATE = 0x091, AREA_STONEWROUGHT_DAM = 0x092, AREA_THE_FARSTRIDER_LODGE = 0x093, AREA_DARKSHORE = 0x094, AREA_SILVER_STREAM_MINE = 0x095, AREA_MENETHIL_HARBOR = 0x096, AREA_DESIGNER_ISLAND = 0x097, AREA_THE_BULWARK0 = 0x098, AREA_RUINS_OF_LORDAERON = 0x099, AREA_DEATHKNELL = 0x09A, AREA_NIGHT_WEBS_HOLLOW = 0x09B, AREA_SOLLIDEN_FARMSTEAD = 0x09C, AREA_AGAMAND_MILLS = 0x09D, AREA_AGAMAND_FAMILY_CRYPT = 0x09E, AREA_BRILL = 0x09F, AREA_WHISPERING_GARDENS = 0x0A0, AREA_TERRACE_OF_REPOSE = 0x0A1, AREA_BRIGHTWATER_LAKE = 0x0A2, AREA_GUNTHERS_RETREAT = 0x0A3, AREA_GARRENS_HAUNT = 0x0A4, AREA_BALNIR_FARMSTEAD = 0x0A5, AREA_COLD_HEARTH_MANOR = 0x0A6, AREA_CRUSADER_OUTPOST = 0x0A7, AREA_THE_NORTH_COAST = 0x0A8, AREA_WHISPERING_SHORE = 0x0A9, AREA_LORDAMERE_LAKE0 = 0x0AA, AREA_FENRIS_ISLE = 0x0AC, AREA_FAOLS_REST = 0x0AD, AREA_DOLANAAR = 0x0BA, AREA_DARNASSUS_UNUSED = 0x0BB, AREA_SHADOWGLEN = 0x0BC, AREA_STEELGRILLS_DEPOT = 0x0BD, AREA_HEARTHGLEN = 0x0BE, AREA_NORTHRIDGE_LUMBER_CAMP = 0x0C0, AREA_RUINS_OF_ANDORHAL = 0x0C1, AREA_SCHOOL_OF_NECROMANCY = 0x0C3, AREA_UTHERS_TOMB = 0x0C4, AREA_SORROW_HILL = 0x0C5, AREA_THE_WEEPING_CAVE = 0x0C6, AREA_FELSTONE_FIELD = 0x0C7, AREA_DALSONS_TEARS = 0x0C8, AREA_GAHRRONS_WITHERING = 0x0C9, AREA_THE_WRITHING_HAUNT = 0x0CA, AREA_MARDENHOLDE_KEEP = 0x0CB, AREA_PYREWOOD_VILLAGE = 0x0CC, AREA_DUN_MODR = 0x0CD, AREA_WESTFALL1 = 0x0CE, AREA_THE_GREAT_SEA0 = 0x0CF, AREA_UNUSED_IRONCLADCOVE = 0x0D0, AREA_SHADOWFANG_KEEP0 = 0x0D1, AREA_ON_MAP_DUNGEON3 = 0x0D2, AREA_ICEFLOW_LAKE = 0x0D3, AREA_HELMS_BED_LAKE = 0x0D4, AREA_DEEP_ELEM_MINE = 0x0D5, AREA_THE_GREAT_SEA1 = 0x0D6, AREA_MULGORE = 0x0D7, AREA_ALEXSTON_FARMSTEAD = 0x0DB, AREA_RED_CLOUD_MESA = 0x0DC, AREA_CAMP_NARACHE = 0x0DD, AREA_BLOODHOOF_VILLAGE = 0x0DE, AREA_STONEBULL_LAKE = 0x0DF, AREA_RAVAGED_CARAVAN = 0x0E0, AREA_RED_ROCKS = 0x0E1, AREA_THE_SKITTERING_DARK = 0x0E2, AREA_VALGANS_FIELD = 0x0E3, AREA_THE_SEPULCHER = 0x0E4, AREA_OLSENS_FARTHING = 0x0E5, AREA_THE_GREYMANE_WALL = 0x0E6, AREA_BERENS_PERIL = 0x0E7, AREA_THE_DAWNING_ISLES = 0x0E8, AREA_AMBERMILL = 0x0E9, AREA_FENRIS_KEEP = 0x0EB, AREA_SHADOWFANG_KEEP1 = 0x0EC, AREA_THE_DECREPIT_FERRY = 0x0ED, AREA_MALDENS_ORCHARD = 0x0EE, AREA_THE_IVAR_PATCH = 0x0EF, AREA_THE_DEAD_FIELD = 0x0F0, AREA_THE_ROTTING_ORCHARD = 0x0F1, AREA_BRIGHTWOOD_GROVE = 0x0F2, AREA_FORLORN_ROWE = 0x0F3, AREA_THE_WHIPPLE_ESTATE = 0x0F4, AREA_THE_YORGEN_FARMSTEAD = 0x0F5, AREA_THE_CAULDRON = 0x0F6, AREA_GRIMESILT_DIG_SITE = 0x0F7, AREA_DREADMAUL_ROCK = 0x0F9, AREA_RUINS_OF_THAURISSAN = 0x0FA, AREA_FLAME_CREST = 0x0FB, AREA_BLACKROCK_STRONGHOLD = 0x0FC, AREA_THE_PILLAR_OF_ASH = 0x0FD, AREA_BLACKROCK_MOUNTAIN1 = 0x0FE, AREA_ALTAR_OF_STORMS0 = 0x0FF, AREA_ALDRASSIL = 0x100, AREA_SHADOWTHREAD_CAVE = 0x101, AREA_FEL_ROCK = 0x102, AREA_LAKE_AL_AMETH = 0x103, AREA_STARBREEZE_VILLAGE = 0x104, AREA_GNARLPINE_HOLD = 0x105, AREA_BAN_ETHIL_BARROW_DEN = 0x106, AREA_THE_CLEFT = 0x107, AREA_THE_ORACLE_GLADE = 0x108, AREA_WELLSPRING_RIVER = 0x109, AREA_WELLSPRING_LAKE = 0x10A, AREA_HILLSBRAD_FOOTHILLS = 0x10B, AREA_AZSHARA_CRATER = 0x10C, AREA_DUN_ALGAZ0 = 0x10D, AREA_SOUTHSHORE0 = 0x10F, AREA_TARREN_MILL0 = 0x110, AREA_DURNHOLDE_KEEP0 = 0x113, AREA_UNUSED_STONEWROUGHT_PASS = 0x114, AREA_THE_FOOTHILL_CAVERNS = 0x115, AREA_LORDAMERE_INTERNMENT_CAMP = 0x116, AREA_DALARAN = 0x117, AREA_STRAHNBRAD = 0x118, AREA_RUINS_OF_ALTERAC = 0x119, AREA_CRUSHRIDGE_HOLD = 0x11A, AREA_SLAUGHTER_HOLLOW = 0x11B, AREA_THE_UPLANDS = 0x11C, AREA_SOUTHPOINT_TOWER0 = 0x11D, AREA_HILLSBRAD_FIELDS0 = 0x11E, AREA_HILLSBRAD = 0x11F, AREA_AZURELODE_MINE0 = 0x120, AREA_NETHANDER_STEAD0 = 0x121, AREA_DUN_GAROK0 = 0x122, AREA_THORADINS_WALL0 = 0x125, AREA_EASTERN_STRAND0 = 0x126, AREA_WESTERN_STRAND0 = 0x127, AREA_SOUTH_SEAS_UNUSED = 0x128, AREA_JAGUERO_ISLE = 0x129, AREA_BARADIN_BAY = 0x12A, AREA_MENETHIL_BAY = 0x12B, AREA_MISTY_REED_STRAND = 0x12C, AREA_THE_SAVAGE_COAST = 0x12D, AREA_THE_CRYSTAL_SHORE = 0x12E, AREA_SHELL_BEACH = 0x12F, AREA_NORTH_TIDES_RUN = 0x131, AREA_SOUTH_TIDES_RUN = 0x132, AREA_THE_OVERLOOK_CLIFFS = 0x133, AREA_THE_FORBIDDING_SEA0 = 0x134, AREA_IRONBEARDS_TOMB = 0x135, AREA_CRYSTALVEIN_MINE = 0x136, AREA_RUINS_OF_ABORAZ = 0x137, AREA_JANEIROS_POINT = 0x138, AREA_NORTHFOLD_MANOR = 0x139, AREA_GO_SHEK_FARM = 0x13A, AREA_DABYRIES_FARMSTEAD = 0x13B, AREA_BOULDERFIST_HALL = 0x13C, AREA_WITHERBARK_VILLAGE = 0x13D, AREA_DRYWHISKER_GORGE = 0x13E, AREA_REFUGE_POINTE = 0x140, AREA_HAMMERFALL = 0x141, AREA_BLACKWATER_SHIPWRECKS = 0x142, AREA_O_BREENS_CAMP = 0x143, AREA_STROMGARDE_KEEP = 0x144, AREA_THE_TOWER_OF_ARATHOR = 0x145, AREA_THE_SANCTUM = 0x146, AREA_FALDIRS_COVE = 0x147, AREA_THE_DROWNED_REEF = 0x148, AREA_THANDOL_SPAN0 = 0x14A, AREA_ASHENVALE = 0x14B, AREA_THE_GREAT_SEA2 = 0x14C, AREA_CIRCLE_OF_EAST_BINDING = 0x14D, AREA_CIRCLE_OF_WEST_BINDING = 0x14E, AREA_CIRCLE_OF_INNER_BINDING = 0x14F, AREA_CIRCLE_OF_OUTER_BINDING = 0x150, AREA_APOCRYPHANS_REST = 0x151, AREA_ANGOR_FORTRESS = 0x152, AREA_LETHLOR_RAVINE = 0x153, AREA_KARGATH = 0x154, AREA_CAMP_KOSH = 0x155, AREA_CAMP_BOFF = 0x156, AREA_CAMP_WURG = 0x157, AREA_CAMP_CAGG = 0x158, AREA_AGMONDS_END = 0x159, AREA_HAMMERTOES_DIGSITE = 0x15A, AREA_DUSTBELCH_GROTTO = 0x15B, AREA_AERIE_PEAK = 0x15C, AREA_WILDHAMMER_KEEP = 0x15D, AREA_QUEL_DANIL_LODGE = 0x15E, AREA_SKULK_ROCK = 0x15F, AREA_ZUN_WATHA = 0x160, AREA_SHADRA_ALOR = 0x161, AREA_JINTHA_ALOR = 0x162, AREA_THE_ALTAR_OF_ZUL = 0x163, AREA_SERADANE = 0x164, AREA_FERALAS = 0x165, AREA_BRAMBLEBLADE_RAVINE = 0x166, AREA_BAEL_MODAN = 0x167, AREA_THE_VENTURE_CO_MINE = 0x168, AREA_FELWOOD = 0x169, AREA_RAZOR_HILL = 0x16A, AREA_VALLEY_OF_TRIALS = 0x16B, AREA_THE_DEN = 0x16C, AREA_BURNING_BLADE_COVEN = 0x16D, AREA_KOLKAR_CRAG = 0x16E, AREA_SEN_JIN_VILLAGE = 0x16F, AREA_ECHO_ISLES = 0x170, AREA_THUNDER_RIDGE = 0x171, AREA_DRYGULCH_RAVINE = 0x172, AREA_DUSTWIND_CAVE = 0x173, AREA_TIRAGARDE_KEEP = 0x174, AREA_SCUTTLE_COAST = 0x175, AREA_BLADEFIST_BAY = 0x176, AREA_DEADEYE_SHORE = 0x177, AREA_SOUTHFURY_RIVER0 = 0x179, AREA_CAMP_TAURAJO = 0x17A, AREA_FAR_WATCH_POST = 0x17B, AREA_THE_CROSSROADS = 0x17C, AREA_BOULDER_LODE_MINE = 0x17D, AREA_THE_SLUDGE_FEN = 0x17E, AREA_THE_DRY_HILLS = 0x17F, AREA_DREADMIST_PEAK = 0x180, AREA_NORTHWATCH_HOLD = 0x181, AREA_THE_FORGOTTEN_POOLS = 0x182, AREA_LUSHWATER_OASIS = 0x183, AREA_THE_STAGNANT_OASIS = 0x184, AREA_FIELD_OF_GIANTS = 0x186, AREA_THE_MERCHANT_COAST = 0x187, AREA_RATCHET = 0x188, AREA_DARKSPEAR_STRAND = 0x189, AREA_DARROWMERE_LAKE_UNUSED = 0x18A, AREA_CAER_DARROW_UNUSED = 0x18B, AREA_WINTERHOOF_WATER_WELL = 0x18C, AREA_THUNDERHORN_WATER_WELL = 0x18D, AREA_WILDMANE_WATER_WELL = 0x18E, AREA_SKYLINE_RIDGE = 0x18F, AREA_THOUSAND_NEEDLES = 0x190, AREA_THE_TIDUS_STAIR = 0x191, AREA_SHADY_REST_INN = 0x193, AREA_BAEL_DUN_DIGSITE = 0x194, AREA_DESOLACE = 0x195, AREA_STONETALON_MOUNTAINS = 0x196, AREA_ORGRIMMAR_UNUSED = 0x197, AREA_GILLIJIMS_ISLE = 0x198, AREA_ISLAND_OF_DOCTOR_LAPIDIS = 0x199, AREA_RAZORWIND_CANYON = 0x19A, AREA_BATHRANS_HAUNT = 0x19B, AREA_THE_RUINS_OF_ORDIL_ARAN = 0x19C, AREA_MAESTRAS_POST = 0x19D, AREA_THE_ZORAM_STRAND = 0x19E, AREA_ASTRANAAR = 0x19F, AREA_THE_SHRINE_OF_AESSINA = 0x1A0, AREA_FIRE_SCAR_SHRINE = 0x1A1, AREA_THE_RUINS_OF_STARDUST = 0x1A2, AREA_THE_HOWLING_VALE = 0x1A3, AREA_SILVERWIND_REFUGE = 0x1A4, AREA_MYSTRAL_LAKE = 0x1A5, AREA_FALLEN_SKY_LAKE = 0x1A6, AREA_IRIS_LAKE = 0x1A8, AREA_MOONWELL = 0x1A9, AREA_RAYNEWOOD_RETREAT = 0x1AA, AREA_THE_SHADY_NOOK = 0x1AB, AREA_NIGHT_RUN = 0x1AC, AREA_XAVIAN = 0x1AD, AREA_SATYRNAAR = 0x1AE, AREA_SPLINTERTREE_POST = 0x1AF, AREA_THE_DOR_DANIL_BARROW_DEN = 0x1B0, AREA_FALFARREN_RIVER = 0x1B1, AREA_FELFIRE_HILL = 0x1B2, AREA_DEMON_FALL_CANYON = 0x1B3, AREA_DEMON_FALL_RIDGE = 0x1B4, AREA_WARSONG_LUMBER_CAMP = 0x1B5, AREA_BOUGH_SHADOW = 0x1B6, AREA_THE_SHIMMERING_FLATS = 0x1B7, AREA_TANARIS = 0x1B8, AREA_LAKE_FALATHIM = 0x1B9, AREA_AUBERDINE = 0x1BA, AREA_RUINS_OF_MATHYSTRA = 0x1BB, AREA_TOWER_OF_ALTHALAXX = 0x1BC, AREA_CLIFFSPRING_FALLS = 0x1BD, AREA_BASHAL_ARAN = 0x1BE, AREA_AMETH_ARAN = 0x1BF, AREA_GROVE_OF_THE_ANCIENTS = 0x1C0, AREA_THE_MASTERS_GLAIVE = 0x1C1, AREA_REMTRAVELS_EXCAVATION = 0x1C2, AREA_MISTS_EDGE = 0x1C4, AREA_THE_LONG_WASH = 0x1C5, AREA_WILDBEND_RIVER = 0x1C6, AREA_BLACKWOOD_DEN = 0x1C7, AREA_CLIFFSPRING_RIVER = 0x1C8, AREA_THE_VEILED_SEA0 = 0x1C9, AREA_GOLD_ROAD = 0x1CA, AREA_SCARLET_WATCH_POST = 0x1CB, AREA_SUN_ROCK_RETREAT = 0x1CC, AREA_WINDSHEAR_CRAG = 0x1CD, AREA_CRAGPOOL_LAKE = 0x1CF, AREA_MIRKFALLON_LAKE = 0x1D0, AREA_THE_CHARRED_VALE = 0x1D1, AREA_VALLEY_OF_THE_BLOODFURIES = 0x1D2, AREA_STONETALON_PEAK = 0x1D3, AREA_THE_TALON_DEN = 0x1D4, AREA_GREATWOOD_VALE = 0x1D5, AREA_THUNDER_BLUFF_UNUSED = 0x1D6, AREA_BRAVE_WIND_MESA = 0x1D7, AREA_FIRE_STONE_MESA = 0x1D8, AREA_MANTLE_ROCK = 0x1D9, AREA_HUNTER_RISE_UNUSED = 0x1DA, AREA_SPIRIT_RISE_UNUSED = 0x1DB, AREA_ELDER_RISE_UNUSED = 0x1DC, AREA_RUINS_OF_JUBUWAL = 0x1DD, AREA_POOLS_OF_ARLITHRIEN = 0x1DE, AREA_THE_RUSTMAUL_DIG_SITE = 0x1DF, AREA_CAMP_E_THOK = 0x1E0, AREA_SPLITHOOF_CRAG = 0x1E1, AREA_HIGHPERCH = 0x1E2, AREA_THE_SCREECHING_CANYON = 0x1E3, AREA_FREEWIND_POST = 0x1E4, AREA_THE_GREAT_LIFT0 = 0x1E5, AREA_GALAK_HOLD = 0x1E6, AREA_ROGUEFEATHER_DEN = 0x1E7, AREA_THE_WEATHERED_NOOK = 0x1E8, AREA_THALANAAR = 0x1E9, AREA_UN_GORO_CRATER = 0x1EA, AREA_RAZORFEN_KRAUL0 = 0x1EB, AREA_RAVEN_HILL_CEMETERY = 0x1EC, AREA_MOONGLADE = 0x1ED, AREA_DELETE_ME0 = 0x1EF, AREA_BRACKENWALL_VILLAGE = 0x1F0, AREA_SWAMPLIGHT_MANOR = 0x1F1, AREA_BLOODFEN_BURROW = 0x1F2, AREA_DARKMIST_CAVERN = 0x1F3, AREA_MOGGLE_POINT = 0x1F4, AREA_BEEZILS_WRECK = 0x1F5, AREA_WITCH_HILL = 0x1F6, AREA_SENTRY_POINT = 0x1F7, AREA_NORTH_POINT_TOWER = 0x1F8, AREA_WEST_POINT_TOWER = 0x1F9, AREA_LOST_POINT = 0x1FA, AREA_BLUEFEN = 0x1FB, AREA_STONEMAUL_RUINS = 0x1FC, AREA_THE_DEN_OF_FLAME = 0x1FD, AREA_THE_DRAGONMURK = 0x1FE, AREA_WYRMBOG = 0x1FF, AREA_ONYXIAS_LAIR_UNUSED = 0x200, AREA_THERAMORE_ISLE = 0x201, AREA_FOOTHOLD_CITADEL = 0x202, AREA_IRONCLAD_PRISON = 0x203, AREA_DUSTWALLOW_BAY = 0x204, AREA_TIDEFURY_COVE = 0x205, AREA_DREADMURK_SHORE = 0x206, AREA_ADDLES_STEAD = 0x218, AREA_FIRE_PLUME_RIDGE = 0x219, AREA_LAKKARI_TAR_PITS = 0x21A, AREA_TERROR_RUN = 0x21B, AREA_THE_SLITHERING_SCAR = 0x21C, AREA_MARSHALS_REFUGE = 0x21D, AREA_FUNGAL_ROCK = 0x21E, AREA_GOLAKKA_HOT_SPRINGS = 0x21F, AREA_THE_LOCH = 0x22C, AREA_BEGGARS_HAUNT = 0x240, AREA_KODO_GRAVEYARD = 0x254, AREA_GHOST_WALKER_POST = 0x255, AREA_SAR_THERIS_STRAND = 0x256, AREA_THUNDER_AXE_FORTRESS = 0x257, AREA_BOLGANS_HOLE = 0x258, AREA_MANNOROC_COVEN = 0x25A, AREA_SARGERON = 0x25B, AREA_MAGRAM_VILLAGE = 0x25C, AREA_GELKIS_VILLAGE = 0x25E, AREA_VALLEY_OF_SPEARS = 0x25F, AREA_NIJELS_POINT = 0x260, AREA_KOLKAR_VILLAGE = 0x261, AREA_HYJAL = 0x268, AREA_WINTERSPRING = 0x26A, AREA_BLACKWOLF_RIVER = 0x27C, AREA_KODO_ROCK = 0x27D, AREA_HIDDEN_PATH = 0x27E, AREA_SPIRIT_ROCK = 0x27F, AREA_SHRINE_OF_THE_DORMANT_FLAME = 0x280, AREA_LAKE_ELUNE_ARA = 0x290, AREA_THE_HARBORAGE = 0x291, AREA_OUTLAND = 0x2A4, AREA_CRAFTSMENS_TERRACE_UNUSED = 0x2B8, AREA_TRADESMENS_TERRACE_UNUSED = 0x2B9, AREA_THE_TEMPLE_GARDENS_UNUSED = 0x2BA, AREA_TEMPLE_OF_ELUNE_UNUSED = 0x2BB, AREA_CENARION_ENCLAVE_UNUSED = 0x2BC, AREA_WARRIORS_TERRACE_UNUSED = 0x2BD, AREA_RUT_THERAN_VILLAGE = 0x2BE, AREA_IRONBANDS_COMPOUND = 0x2CC, AREA_THE_STOCKADE = 0x2CD, AREA_WAILING_CAVERNS = 0x2CE, AREA_BLACKFATHOM_DEEPS0 = 0x2CF, AREA_FRAY_ISLAND = 0x2D0, AREA_GNOMEREGAN1 = 0x2D1, AREA_RAZORFEN_DOWNS0 = 0x2D2, AREA_BAN_ETHIL_HOLLOW = 0x2E0, AREA_SCARLET_MONASTERY = 0x31C, AREA_JERODS_LANDING = 0x31D, AREA_RIDGEPOINT_TOWER = 0x31E, AREA_THE_DARKENED_BANK = 0x31F, AREA_COLDRIDGE_PASS = 0x320, AREA_CHILL_BREEZE_VALLEY = 0x321, AREA_SHIMMER_RIDGE = 0x322, AREA_AMBERSTILL_RANCH = 0x323, AREA_THE_TUNDRID_HILLS = 0x324, AREA_SOUTH_GATE_PASS0 = 0x325, AREA_SOUTH_GATE_OUTPOST = 0x326, AREA_NORTH_GATE_PASS0 = 0x327, AREA_NORTH_GATE_OUTPOST = 0x328, AREA_GATES_OF_IRONFORGE = 0x329, AREA_STILLWATER_POND = 0x32A, AREA_NIGHTMARE_VALE = 0x32B, AREA_VENOMWEB_VALE = 0x32C, AREA_THE_BULWARK1 = 0x32D, AREA_SOUTHFURY_RIVER1 = 0x32E, AREA_SOUTHFURY_RIVER2 = 0x32F, AREA_RAZORMANE_GROUNDS = 0x330, AREA_SKULL_ROCK = 0x331, AREA_PALEMANE_ROCK = 0x332, AREA_WINDFURY_RIDGE = 0x333, AREA_THE_GOLDEN_PLAINS = 0x334, AREA_THE_ROLLING_PLAINS = 0x335, AREA_DUN_ALGAZ1 = 0x344, AREA_DUN_ALGAZ2 = 0x345, AREA_NORTH_GATE_PASS1 = 0x346, AREA_SOUTH_GATE_PASS1 = 0x347, AREA_TWILIGHT_GROVE = 0x358, AREA_GM_ISLAND = 0x36C, AREA_DELETE_ME1 = 0x36D, AREA_SOUTHFURY_RIVER3 = 0x36E, AREA_SOUTHFURY_RIVER4 = 0x36F, AREA_THANDOL_SPAN1 = 0x370, AREA_THANDOL_SPAN2 = 0x371, AREA_PURGATION_ISLE = 0x380, AREA_THE_JANSEN_STEAD = 0x394, AREA_THE_DEAD_ACRE = 0x395, AREA_THE_MOLSEN_FARM = 0x396, AREA_STENDELS_POND = 0x397, AREA_THE_DAGGER_HILLS = 0x398, AREA_DEMONTS_PLACE = 0x399, AREA_THE_DUST_PLAINS = 0x39A, AREA_STONESPLINTER_VALLEY = 0x39B, AREA_VALLEY_OF_KINGS = 0x39C, AREA_ALGAZ_STATION = 0x39D, AREA_BUCKLEBREE_FARM = 0x39E, AREA_THE_SHINING_STRAND = 0x39F, AREA_NORTH_TIDES_HOLLOW = 0x3A0, AREA_GRIZZLEPAW_RIDGE = 0x3A8, AREA_THE_VERDANT_FIELDS = 0x3BC, AREA_GADGETZAN = 0x3D0, AREA_STEAMWHEEDLE_PORT = 0x3D1, AREA_ZUL_FARRAK0 = 0x3D2, AREA_SANDSORROW_WATCH = 0x3D3, AREA_THISTLESHRUB_VALLEY = 0x3D4, AREA_THE_GAPING_CHASM = 0x3D5, AREA_THE_NOXIOUS_LAIR = 0x3D6, AREA_DUNEMAUL_COMPOUND = 0x3D7, AREA_EASTMOON_RUINS = 0x3D8, AREA_WATERSPRING_FIELD = 0x3D9, AREA_ZALASHJIS_DEN = 0x3DA, AREA_LANDS_END_BEACH = 0x3DB, AREA_WAVESTRIDER_BEACH = 0x3DC, AREA_ULDUM = 0x3DD, AREA_VALLEY_OF_THE_WATCHERS = 0x3DE, AREA_GUNSTANS_POST = 0x3DF, AREA_SOUTHMOON_RUINS = 0x3E0, AREA_RENDERS_CAMP = 0x3E4, AREA_RENDERS_VALLEY = 0x3E5, AREA_RENDERS_ROCK = 0x3E6, AREA_STONEWATCH_TOWER = 0x3E7, AREA_GALARDELL_VALLEY = 0x3E8, AREA_LAKERIDGE_HIGHWAY = 0x3E9, AREA_THREE_CORNERS = 0x3EA, AREA_DIREFORGE_HILL = 0x3F8, AREA_RAPTOR_RIDGE = 0x3F9, AREA_BLACK_CHANNEL_MARSH = 0x3FA, AREA_THE_GREEN_BELT0 = 0x3FB, AREA_MOSSHIDE_FEN = 0x3FC, AREA_THELGEN_ROCK = 0x3FD, AREA_BLUEGILL_MARSH = 0x3FE, AREA_SALTSPRAY_GLEN = 0x3FF, AREA_SUNDOWN_MARSH = 0x400, AREA_THE_GREEN_BELT1 = 0x401, AREA_ANGERFANG_ENCAMPMENT = 0x40C, AREA_GRIM_BATOL = 0x40D, AREA_DRAGONMAW_GATES = 0x40E, AREA_THE_LOST_FLEET = 0x40F, AREA_DARROW_HILL0 = 0x420, AREA_THORADINS_WALL1 = 0x421, AREA_WEBWINDER_PATH = 0x434, AREA_THE_HUSHED_BANK = 0x449, AREA_MANOR_MISTMANTLE = 0x44A, AREA_CAMP_MOJACHE = 0x44B, AREA_GRIMTOTEM_COMPOUND = 0x44C, AREA_THE_WRITHING_DEEP = 0x44D, AREA_WILDWIND_LAKE = 0x44E, AREA_GORDUNNI_OUTPOST = 0x44F, AREA_MOK_GORDUN = 0x450, AREA_FERAL_SCAR_VALE = 0x451, AREA_FRAYFEATHER_HIGHLANDS = 0x452, AREA_IDLEWIND_LAKE = 0x453, AREA_THE_FORGOTTEN_COAST = 0x454, AREA_EAST_PILLAR = 0x455, AREA_WEST_PILLAR = 0x456, AREA_DREAM_BOUGH = 0x457, AREA_JADEMIR_LAKE = 0x458, AREA_ONEIROS = 0x459, AREA_RUINS_OF_RAVENWIND = 0x45A, AREA_RAGE_SCAR_HOLD = 0x45B, AREA_FEATHERMOON_STRONGHOLD = 0x45C, AREA_RUINS_OF_SOLARSAL = 0x45D, AREA_LOWER_WILDS_UNUSED = 0x45E, AREA_THE_TWIN_COLOSSALS = 0x45F, AREA_SARDOR_ISLE = 0x460, AREA_ISLE_OF_DREAD = 0x461, AREA_HIGH_WILDERNESS = 0x470, AREA_LOWER_WILDS = 0x471, AREA_SOUTHERN_BARRENS = 0x484, AREA_SOUTHERN_GOLD_ROAD = 0x485, AREA_ZUL_FARRAK1 = 0x498, AREA_UNUSED_ALCAZ_ISLAND = 0x4AC, AREA_TIMBERMAW_HOLD0 = 0x4C0, AREA_VANNDIR_ENCAMPMENT = 0x4C1, AREA_TEST_AZSHARA = 0x4C2, AREA_LEGASH_ENCAMPMENT = 0x4C3, AREA_THALASSIAN_BASE_CAMP = 0x4C4, AREA_RUINS_OF_ELDARATH = 0x4C5, AREA_HETAERAS_CLUTCH = 0x4C6, AREA_TEMPLE_OF_ZIN_MALOR = 0x4C7, AREA_BEARS_HEAD = 0x4C8, AREA_URSOLAN = 0x4C9, AREA_TEMPLE_OF_ARKKORAN = 0x4CA, AREA_BAY_OF_STORMS = 0x4CB, AREA_THE_SHATTERED_STRAND = 0x4CC, AREA_TOWER_OF_ELDARA = 0x4CD, AREA_JAGGED_REEF = 0x4CE, AREA_SOUTHRIDGE_BEACH = 0x4CF, AREA_RAVENCREST_MONUMENT = 0x4D0, AREA_FORLORN_RIDGE = 0x4D1, AREA_LAKE_MENNAR = 0x4D2, AREA_SHADOWSONG_SHRINE = 0x4D3, AREA_HALDARR_ENCAMPMENT = 0x4D4, AREA_VALORMOK = 0x4D5, AREA_THE_RUINED_REACHES = 0x4E8, AREA_THE_TALONDEEP_PATH0 = 0x4FC, AREA_THE_TALONDEEP_PATH1 = 0x4FD, AREA_ROCKTUSK_FARM = 0x510, AREA_JAGGEDSWINE_FARM = 0x511, AREA_RAZORFEN_DOWNS1 = 0x524, AREA_LOST_RIGGER_COVE = 0x538, AREA_ULDAMAN0 = 0x539, AREA_LORDAMERE_LAKE1 = 0x53A, AREA_LORDAMERE_LAKE2 = 0x53B, AREA_GALLOWS_CORNER = 0x54D, AREA_SILITHUS = 0x561, AREA_EMERALD_FOREST = 0x575, AREA_SUNKEN_TEMPLE = 0x589, AREA_DREADMAUL_HOLD = 0x59D, AREA_NETHERGARDE_KEEP = 0x59E, AREA_DREADMAUL_POST = 0x59F, AREA_SERPENTS_COIL = 0x5A0, AREA_ALTAR_OF_STORMS1 = 0x5A1, AREA_FIREWATCH_RIDGE = 0x5A2, AREA_THE_SLAG_PIT = 0x5A3, AREA_THE_SEA_OF_CINDERS = 0x5A4, AREA_BLACKROCK_MOUNTAIN2 = 0x5A5, AREA_THORIUM_POINT = 0x5A6, AREA_GARRISON_ARMORY = 0x5B1, AREA_THE_TEMPLE_OF_ATAL_HAKKAR = 0x5C5, AREA_UNDERCITY = 0x5D9, AREA_ULDAMAN1 = 0x5ED, AREA_NOT_USED_DEADMINES = 0x5EE, AREA_STORMWIND_CITY = 0x5EF, AREA_IRONFORGE = 0x601, AREA_SPLITHOOF_HOLD = 0x615, AREA_THE_CAPE_OF_STRANGLETHORN = 0x629, AREA_SOUTHERN_SAVAGE_COAST = 0x62A, AREA_UNUSED_THE_DEADMINES_002 = 0x62B, AREA_UNUSED_IRONCLAD_COVE_003 = 0x62C, AREA_THE_DEADMINES = 0x62D, AREA_IRONCLAD_COVE = 0x62E, AREA_BLACKROCK_SPIRE = 0x62F, AREA_BLACKROCK_DEPTHS = 0x630, AREA_RAPTOR_GROUNDS_UNUSED = 0x63D, AREA_GROL_DOM_FARM_UNUSED = 0x63E, AREA_MORSHAN_BASE_CAMP = 0x63F, AREA_HONORS_STAND_UNUSED = 0x640, AREA_BLACKTHORN_RIDGE_UNUSED = 0x641, AREA_BRAMBLESCAR_UNUSED = 0x642, AREA_AGAMA_GOR_UNUSED = 0x643, AREA_VALLEY_OF_HEROES = 0x651, AREA_ORGRIMMAR = 0x665, AREA_THUNDER_BLUFF = 0x666, AREA_ELDER_RISE = 0x667, AREA_SPIRIT_RISE = 0x668, AREA_HUNTER_RISE = 0x669, AREA_DARNASSUS = 0x679, AREA_CENARION_ENCLAVE = 0x67A, AREA_CRAFTSMENS_TERRACE = 0x67B, AREA_WARRIORS_TERRACE = 0x67C, AREA_THE_TEMPLE_GARDENS = 0x67D, AREA_TRADESMENS_TERRACE = 0x67E, AREA_GAVINS_NAZE = 0x68D, AREA_SOFERAS_NAZE = 0x68E, AREA_CORRAHNS_DAGGER = 0x68F, AREA_THE_HEADLAND = 0x690, AREA_MISTY_SHORE = 0x691, AREA_DANDREDS_FOLD = 0x692, AREA_GROWLESS_CAVE = 0x693, AREA_CHILLWIND_POINT = 0x694, AREA_RAPTOR_GROUNDS = 0x6A1, AREA_BRAMBLESCAR = 0x6A2, AREA_THORN_HILL = 0x6A3, AREA_AGAMA_GOR = 0x6A4, AREA_BLACKTHORN_RIDGE = 0x6A5, AREA_HONORS_STAND = 0x6A6, AREA_THE_MORSHAN_RAMPART = 0x6A7, AREA_GROL_DOM_FARM = 0x6A8, AREA_RAZORFEN_KRAUL1 = 0x6B5, AREA_THE_GREAT_LIFT1 = 0x6B6, AREA_MISTVALE_VALLEY = 0x6C9, AREA_NEK_MANI_WELLSPRING = 0x6CA, AREA_BLOODSAIL_COMPOUND = 0x6CB, AREA_VENTURE_CO_BASE_CAMP = 0x6CC, AREA_GURUBASHI_ARENA = 0x6CD, AREA_SPIRIT_DEN = 0x6CE, AREA_THE_CRIMSON_VEIL = 0x6DD, AREA_THE_RIPTIDE = 0x6DE, AREA_THE_DAMSELS_LUCK = 0x6DF, AREA_VENTURE_CO_OPERATIONS_CENTER = 0x6E0, AREA_DEADWOOD_VILLAGE = 0x6E1, AREA_FELPAW_VILLAGE = 0x6E2, AREA_JAEDENAR = 0x6E3, AREA_BLOODVENOM_RIVER = 0x6E4, AREA_BLOODVENOM_FALLS = 0x6E5, AREA_SHATTER_SCAR_VALE = 0x6E6, AREA_IRONTREE_WOODS = 0x6E7, AREA_IRONTREE_CAVERN = 0x6E8, AREA_TIMBERMAW_HOLD1 = 0x6E9, AREA_SHADOW_HOLD = 0x6EA, AREA_SHRINE_OF_THE_DECEIVER = 0x6EB, AREA_ITHARIUSS_CAVE = 0x6F1, AREA_SORROWMURK = 0x6F2, AREA_DRAENIL_DUR_VILLAGE = 0x6F3, AREA_SPLINTERSPEAR_JUNCTION = 0x6F4, AREA_STAGALBOG = 0x705, AREA_THE_SHIFTING_MIRE = 0x706, AREA_STAGALBOG_CAVE = 0x719, AREA_WITHERBARK_CAVERNS = 0x72D, AREA_THORADINS_WALL2 = 0x741, AREA_BOULDER_GOR = 0x742, AREA_VALLEY_OF_FANGS = 0x755, AREA_THE_DUSTBOWL = 0x756, AREA_MIRAGE_FLATS = 0x757, AREA_FEATHERBEARDS_HOVEL = 0x758, AREA_SHINDIGGERS_CAMP = 0x759, AREA_PLAGUEMIST_RAVINE = 0x75A, AREA_VALORWIND_LAKE = 0x75B, AREA_AGOL_WATHA = 0x75C, AREA_HIRI_WATHA = 0x75D, AREA_THE_CREEPING_RUIN = 0x75E, AREA_BOGENS_LEDGE = 0x75F, AREA_THE_MAKERS_TERRACE = 0x769, AREA_DUSTWIND_GULCH = 0x76A, AREA_SHAOL_WATHA = 0x77D, AREA_NOONSHADE_RUINS = 0x791, AREA_BROKEN_PILLAR = 0x792, AREA_ABYSSAL_SANDS = 0x793, AREA_SOUTHBREAK_SHORE = 0x794, AREA_CAVERNS_OF_TIME0 = 0x795, AREA_THE_MARSHLANDS = 0x796, AREA_IRONSTONE_PLATEAU = 0x797, AREA_BLACKCHAR_CAVE = 0x7A5, AREA_TANNER_CAMP = 0x7A6, AREA_DUSTFIRE_VALLEY = 0x7A7, AREA_ZUL_GURUB1 = 0x7B9, AREA_MISTY_REED_POST = 0x7BA, AREA_BLOODVENOM_POST = 0x7CD, AREA_TALONBRANCH_GLADE = 0x7CE, AREA_STRATHOLME0 = 0x7E1, AREA_UNUSED_SHADOWFANG_KEEP_003 = 0x7F5, AREA_SCHOLOMANCE = 0x809, AREA_TWILIGHT_VALE = 0x81D, AREA_TWILIGHT_SHORE = 0x81E, AREA_ALCAZ_ISLAND = 0x81F, AREA_DARKCLOUD_PINNACLE = 0x831, AREA_DAWNING_WOOD_CATACOMBS = 0x832, AREA_STONEWATCH_KEEP = 0x833, AREA_MARAUDON = 0x834, AREA_STOUTLAGER_INN = 0x835, AREA_THUNDERBREW_DISTILLERY = 0x836, AREA_MENETHIL_KEEP = 0x837, AREA_DEEPWATER_TAVERN = 0x838, AREA_SHADOW_GRAVE = 0x845, AREA_BRILL_TOWN_HALL = 0x846, AREA_GALLOWS_END_TAVERN = 0x847, AREA_THE_POOLS_OF_VISION_UNUSED = 0x859, AREA_DREADMIST_DEN = 0x85A, AREA_BAEL_DUN_KEEP = 0x86D, AREA_EMBERSTRIFES_DEN = 0x86E, AREA_ONYXIAS_LAIR = 0x86F, AREA_WINDSHEAR_MINE = 0x870, AREA_ROLANDS_DOOM = 0x871, AREA_BATTLE_RING = 0x881, AREA_THE_POOLS_OF_VISION = 0x895, AREA_SHADOWBREAK_RAVINE = 0x896, AREA_BROKEN_SPEAR_VILLAGE = 0x8A9, AREA_WHITEREACH_POST = 0x8BD, AREA_GORNIA = 0x8BE, AREA_ZANES_EYE_CRATER = 0x8BF, AREA_MIRAGE_RACEWAY = 0x8C0, AREA_FROSTSABER_ROCK = 0x8C1, AREA_THE_HIDDEN_GROVE = 0x8C2, AREA_TIMBERMAW_POST = 0x8C3, AREA_WINTERFALL_VILLAGE = 0x8C4, AREA_MAZTHORIL = 0x8C5, AREA_FROSTFIRE_HOT_SPRINGS = 0x8C6, AREA_ICE_THISTLE_HILLS = 0x8C7, AREA_DUN_MANDARR = 0x8C8, AREA_FROSTWHISPER_GORGE = 0x8C9, AREA_OWL_WING_THICKET = 0x8CA, AREA_LAKE_KEL_THERIL = 0x8CB, AREA_THE_RUINS_OF_KEL_THERIL = 0x8CC, AREA_STARFALL_VILLAGE = 0x8CD, AREA_BAN_THALLOW_BARROW_DEN = 0x8CE, AREA_EVERLOOK = 0x8CF, AREA_DARKWHISPER_GORGE = 0x8D0, AREA_DEEPRUN_TRAM = 0x8D1, AREA_THE_FUNGAL_VALE = 0x8D2, AREA_UNUSED_THE_MARRIS_STEAD = 0x8D3, AREA_THE_MARRIS_STEAD = 0x8D4, AREA_THE_UNDERCROFT = 0x8D5, AREA_DARROWSHIRE = 0x8D6, AREA_CROWN_GUARD_TOWER = 0x8D7, AREA_CORINS_CROSSING = 0x8D8, AREA_SCARLET_BASE_CAMP = 0x8D9, AREA_TYRS_HAND = 0x8DA, AREA_THE_SCARLET_BASILICA = 0x8DB, AREA_LIGHTS_HOPE_CHAPEL = 0x8DC, AREA_BROWMAN_MILL = 0x8DD, AREA_THE_NOXIOUS_GLADE = 0x8DE, AREA_EASTWALL_TOWER = 0x8DF, AREA_NORTHDALE = 0x8E0, AREA_ZUL_MASHAR = 0x8E1, AREA_MAZRA_ALOR = 0x8E2, AREA_NORTHPASS_TOWER = 0x8E3, AREA_QUEL_LITHIEN_LODGE = 0x8E4, AREA_PLAGUEWOOD = 0x8E5, AREA_SCOURGEHOLD = 0x8E6, AREA_STRATHOLME1 = 0x8E7, AREA_UNUSED_STRATHOLME = 0x8E8, AREA_DARROWMERE_LAKE0 = 0x8F9, AREA_CAER_DARROW = 0x8FA, AREA_DARROWMERE_LAKE1 = 0x8FB, AREA_CAVERNS_OF_TIME1 = 0x8FC, AREA_THISTLEFUR_VILLAGE = 0x8FD, AREA_THE_QUAGMIRE = 0x8FE, AREA_WINDBREAK_CANYON = 0x8FF, AREA_SOUTH_SEAS0 = 0x90D, AREA_THE_GREAT_SEA3 = 0x90E, AREA_THE_GREAT_SEA4 = 0x90F, AREA_THE_GREAT_SEA5 = 0x910, AREA_THE_GREAT_SEA6 = 0x911, AREA_THE_VEILED_SEA1 = 0x912, AREA_THE_VEILED_SEA2 = 0x913, AREA_THE_VEILED_SEA3 = 0x914, AREA_THE_VEILED_SEA4 = 0x915, AREA_THE_VEILED_SEA5 = 0x916, AREA_RAZOR_HILL_BARRACKS = 0x921, AREA_SOUTH_SEAS1 = 0x922, AREA_THE_GREAT_SEA7 = 0x923, AREA_BLOODTOOTH_CAMP = 0x935, AREA_FOREST_SONG = 0x936, AREA_GREENPAW_VILLAGE = 0x937, AREA_SILVERWING_OUTPOST = 0x938, AREA_NIGHTHAVEN = 0x939, AREA_SHRINE_OF_REMULOS = 0x93A, AREA_STORMRAGE_BARROW_DENS = 0x93B, AREA_THE_GREAT_SEA8 = 0x93C, AREA_THE_GREAT_SEA9 = 0x93D, AREA_THE_BLACK_MORASS = 0x93E, AREA_OLD_HILLSBRAD_FOOTHILLS = 0x93F, AREA_TARREN_MILL1 = 0x940, AREA_SOUTHSHORE1 = 0x941, AREA_DURNHOLDE_KEEP1 = 0x942, AREA_DUN_GAROK1 = 0x943, AREA_HILLSBRAD_FIELDS1 = 0x944, AREA_EASTERN_STRAND1 = 0x945, AREA_NETHANDER_STEAD1 = 0x946, AREA_DARROW_HILL1 = 0x947, AREA_SOUTHPOINT_TOWER1 = 0x948, AREA_THORADINS_WALL3 = 0x949, AREA_WESTERN_STRAND1 = 0x94A, AREA_AZURELODE_MINE1 = 0x94B, AREA_THE_GREAT_SEA10 = 0x95D, AREA_THE_GREAT_SEA11 = 0x95E, AREA_THE_GREAT_SEA12 = 0x95F, AREA_THE_FORBIDDING_SEA1 = 0x960, AREA_THE_FORBIDDING_SEA2 = 0x961, AREA_THE_FORBIDDING_SEA3 = 0x962, AREA_THE_FORBIDDING_SEA4 = 0x963, AREA_TETHRIS_ARAN = 0x964, AREA_ETHEL_RETHOR = 0x965, AREA_RANAZJAR_ISLE = 0x966, AREA_KORMEKS_HUT = 0x967, AREA_SHADOWPREY_VILLAGE = 0x968, AREA_BLACKROCK_PASS = 0x971, AREA_MORGANS_VIGIL = 0x972, AREA_SLITHER_ROCK = 0x973, AREA_TERROR_WING_PATH = 0x974, AREA_DRACO_DAR = 0x975, AREA_RAGEFIRE_CHASM = 0x985, AREA_NIGHTSONG_WOODS = 0x999, AREA_THE_VEILED_SEA6 = 0x9AD, AREA_MORLOS_ARAN = 0x9AE, AREA_EMERALD_SANCTUARY = 0x9AF, AREA_JADEFIRE_GLEN = 0x9B0, AREA_RUINS_OF_CONSTELLAS = 0x9B1, AREA_BITTER_REACHES = 0x9C1, AREA_RISE_OF_THE_DEFILER = 0x9D5, AREA_LARISS_PAVILION = 0x9D6, AREA_WOODPAW_HILLS = 0x9D7, AREA_WOODPAW_DEN = 0x9D8, AREA_VERDANTIS_RIVER = 0x9D9, AREA_RUINS_OF_ISILDIEN = 0x9DA, AREA_GRIMTOTEM_POST = 0x9E9, AREA_CAMP_APARAJE = 0x9EA, AREA_MALAKA_JIN = 0x9EB, AREA_BOULDERSLIDE_RAVINE = 0x9EC, AREA_SISHIR_CANYON = 0x9ED, AREA_DIRE_MAUL0 = 0x9FD, AREA_DEADWIND_RAVINE = 0x9FE, AREA_DIAMONDHEAD_RIVER = 0x9FF, AREA_ARIDENS_CAMP = 0xA00, AREA_THE_VICE = 0xA01, AREA_KARAZHAN = 0xA02, AREA_MORGANS_PLOT = 0xA03, AREA_DIRE_MAUL1 = 0xA11, AREA_ALTERAC_VALLEY0 = 0xA25, AREA_SCRABBLESCREWS_CAMP = 0xA39, AREA_JADEFIRE_RUN = 0xA3A, AREA_THONDRORIL_RIVER0 = 0xA3B, AREA_THONDRORIL_RIVER1 = 0xA3C, AREA_LAKE_MERELDAR = 0xA3D, AREA_PESTILENT_SCAR = 0xA3E, AREA_THE_INFECTIS_SCAR = 0xA3F, AREA_BLACKWOOD_LAKE = 0xA40, AREA_EASTWALL_GATE = 0xA41, AREA_TERRORWEB_TUNNEL = 0xA42, AREA_TERRORDALE = 0xA43, AREA_KARGATHIA_KEEP = 0xA4D, AREA_VALLEY_OF_BONES = 0xA61, AREA_BLACKWING_LAIR = 0xA75, AREA_DEADMANS_CROSSING = 0xA89, AREA_MOLTEN_CORE = 0xA9D, AREA_THE_SCARAB_WALL = 0xAB1, AREA_SOUTHWIND_VILLAGE = 0xAB2, AREA_TWILIGHT_BASE_CAMP = 0xAB3, AREA_THE_CRYSTAL_VALE = 0xAB4, AREA_THE_SCARAB_DAIS = 0xAB5, AREA_HIVE_ASHI = 0xAB6, AREA_HIVE_ZORA = 0xAB7, AREA_HIVE_REGAL = 0xAB8, AREA_SHRINE_OF_THE_FALLEN_WARRIOR = 0xAC5, AREA_UNUSED_ALTERAC_VALLEY = 0xAD9, AREA_BLACKFATHOM_DEEPS1 = 0xAED, AREA_ON_MAP_DUNGEON4 = 0xB01, AREA_THE_MASTERS_CELLAR = 0xB15, AREA_STONEWROUGHT_PASS = 0xB16, AREA_ALTERAC_VALLEY1 = 0xB17, AREA_THE_RUMBLE_CAGE = 0xB29, AREA_CHUNK_TEST = 0xB3D, AREA_ZORAMGAR_OUTPOST = 0xB51, AREA_HALL_OF_LEGENDS = 0xB65, AREA_CHAMPIONS_HALL = 0xB66, AREA_GROSH_GOK_COMPOUND = 0xB79, AREA_SLEEPING_GORGE = 0xB7A, AREA_IRONDEEP_MINE = 0xB8D, AREA_STONEHEARTH_OUTPOST = 0xB8E, AREA_DUN_BALDAR = 0xB8F, AREA_ICEWING_PASS = 0xB90, AREA_FROSTWOLF_VILLAGE = 0xB91, AREA_TOWER_POINT = 0xB92, AREA_COLDTOOTH_MINE = 0xB93, AREA_WINTERAX_HOLD = 0xB94, AREA_ICEBLOOD_GARRISON = 0xBA1, AREA_FROSTWOLF_KEEP = 0xBA2, AREA_TOR_KREN_FARM = 0xBA3, AREA_FROST_DAGGER_PASS = 0xBC9, AREA_IRONSTONE_CAMP = 0xBDD, AREA_WEAZELS_CRATER = 0xBDE, AREA_TAHONDA_RUINS = 0xBDF, AREA_FIELD_OF_STRIFE = 0xBF1, AREA_ICEWING_CAVERN = 0xBF2, AREA_VALORS_REST = 0xC05, AREA_THE_SWARMING_PILLAR = 0xC19, AREA_TWILIGHT_POST = 0xC1A, AREA_TWILIGHT_OUTPOST = 0xC1B, AREA_RAVAGED_TWILIGHT_CAMP = 0xC1C, AREA_SHALZARUS_LAIR = 0xC2D, AREA_TALRENDIS_POINT = 0xC41, AREA_RETHRESS_SANCTUM = 0xC42, AREA_MOON_HORROR_DEN = 0xC43, AREA_SCALEBEARDS_CAVE = 0xC44, AREA_BOULDERSLIDE_CAVERN = 0xC55, AREA_WARSONG_LABOR_CAMP = 0xC69, AREA_CHILLWIND_CAMP = 0xC7D, AREA_THE_MAUL = 0xC91, AREA_THE_MAUL_UNUSED = 0xCA5, AREA_BONES_OF_GRAKKAROND = 0xCB9, AREA_WARSONG_GULCH = 0xCCD, AREA_FROSTWOLF_GRAVEYARD = 0xCE1, AREA_FROSTWOLF_PASS = 0xCE2, AREA_DUN_BALDAR_PASS = 0xCE3, AREA_ICEBLOOD_GRAVEYARD = 0xCE4, AREA_SNOWFALL_GRAVEYARD = 0xCE5, AREA_STONEHEARTH_GRAVEYARD = 0xCE6, AREA_STORMPIKE_GRAVEYARD = 0xCE7, AREA_ICEWING_BUNKER = 0xCE8, AREA_STONEHEARTH_BUNKER = 0xCE9, AREA_WILDPAW_RIDGE = 0xCEA, AREA_REVANTUSK_VILLAGE = 0xCF5, AREA_ROCK_OF_DUROTAN = 0xCF6, AREA_SILVERWING_GROVE = 0xCF7, AREA_WARSONG_LUMBER_MILL = 0xCF8, AREA_SILVERWING_HOLD = 0xCF9, AREA_WILDPAW_CAVERN = 0xD09, AREA_THE_VEILED_CLEFT = 0xD0A, AREA_YOJAMBA_ISLE = 0xD1D, AREA_ARATHI_BASIN = 0xD1E, AREA_THE_COIL = 0xD31, AREA_ALTAR_OF_HIR_EEK = 0xD32, AREA_SHADRA_ZAAR = 0xD33, AREA_HAKKARI_GROUNDS = 0xD34, AREA_NAZE_OF_SHIRVALLAH = 0xD35, AREA_TEMPLE_OF_BETHEKK = 0xD36, AREA_THE_BLOODFIRE_PIT = 0xD37, AREA_ALTAR_OF_THE_BLOOD_GOD = 0xD38, AREA_ZANZAS_RISE = 0xD45, AREA_EDGE_OF_MADNESS = 0xD46, AREA_TROLLBANE_HALL = 0xD59, AREA_DEFILERS_DEN = 0xD5A, AREA_PAGLES_POINTE = 0xD5B, AREA_FARM = 0xD5C, AREA_BLACKSMITH = 0xD5D, AREA_LUMBER_MILL = 0xD5E, AREA_GOLD_MINE = 0xD5F, AREA_STABLES = 0xD60, AREA_CENARION_HOLD = 0xD61, AREA_STAGHELM_POINT = 0xD62, AREA_BRONZEBEARD_ENCAMPMENT = 0xD63, AREA_AHN_QIRAJ = 0xD64, AREA_RUINS_OF_AHN_QIRAJ0 = 0xD65, AREA_TWILIGHTS_RUN = 0xD76, AREA_ORTELLS_HIDEOUT = 0xD77, AREA_SCARAB_TERRACE = 0xD78, AREA_GENERALS_TERRACE = 0xD79, AREA_THE_RESERVOIR = 0xD7A, AREA_THE_HATCHERY = 0xD7B, AREA_THE_COMB = 0xD7C, AREA_WATCHERS_TERRACE = 0xD7D, AREA_RUINS_OF_AHN_QIRAJ1 = 0xD7E, AREA_NAXXRAMAS = 0xD80, AREA_CITY = 0xD83, AREA_GATES_OF_AHN_QIRAJ = 0xD96, AREA_RAVENHOLDT_MANOR = 0xD9E, } e_area; static const value_string e_area_strings[] = { { AREA_NONE, "None" }, { AREA_DUN_MOROGH, "Dun Morogh" }, { AREA_LONGSHORE, "Longshore" }, { AREA_BADLANDS, "Badlands" }, { AREA_BLASTED_LANDS, "Blasted Lands" }, { AREA_BLACKWATER_COVE, "Blackwater Cove" }, { AREA_SWAMP_OF_SORROWS, "Swamp Of Sorrows" }, { AREA_NORTHSHIRE_VALLEY, "Northshire Valley" }, { AREA_DUSKWOOD, "Duskwood" }, { AREA_WETLANDS, "Wetlands" }, { AREA_ELWYNN_FOREST, "Elwynn Forest" }, { AREA_THE_WORLD_TREE, "The World Tree" }, { AREA_DUROTAR, "Durotar" }, { AREA_DUSTWALLOW_MARSH, "Dustwallow Marsh" }, { AREA_AZSHARA, "Azshara" }, { AREA_THE_BARRENS, "The Barrens" }, { AREA_CRYSTAL_LAKE, "Crystal Lake" }, { AREA_ZUL_GURUB0, "Zul Gurub0" }, { AREA_MOONBROOK, "Moonbrook" }, { AREA_KUL_TIRAS, "Kul Tiras" }, { AREA_PROGRAMMER_ISLE, "Programmer Isle" }, { AREA_NORTHSHIRE_RIVER, "Northshire River" }, { AREA_NORTHSHIRE_ABBEY, "Northshire Abbey" }, { AREA_BLACKROCK_MOUNTAIN0, "Blackrock Mountain0" }, { AREA_LIGHTHOUSE, "Lighthouse" }, { AREA_WESTERN_PLAGUELANDS, "Western Plaguelands" }, { AREA_NINE, "Nine" }, { AREA_THE_CEMETARY, "The Cemetary" }, { AREA_STRANGLETHORN_VALE, "Stranglethorn Vale" }, { AREA_ECHO_RIDGE_MINE, "Echo Ridge Mine" }, { AREA_BOOTY_BAY, "Booty Bay" }, { AREA_ALTERAC_MOUNTAINS, "Alterac Mountains" }, { AREA_LAKE_NAZFERITI, "Lake Nazferiti" }, { AREA_LOCH_MODAN, "Loch Modan" }, { AREA_WESTFALL0, "Westfall0" }, { AREA_DEADWIND_PASS, "Deadwind Pass" }, { AREA_DARKSHIRE, "Darkshire" }, { AREA_WILD_SHORE, "Wild Shore" }, { AREA_REDRIDGE_MOUNTAINS, "Redridge Mountains" }, { AREA_ARATHI_HIGHLANDS, "Arathi Highlands" }, { AREA_BURNING_STEPPES, "Burning Steppes" }, { AREA_THE_HINTERLANDS, "The Hinterlands" }, { AREA_DEAD_MANS_HOLE, "Dead Mans Hole" }, { AREA_SEARING_GORGE, "Searing Gorge" }, { AREA_THIEVES_CAMP, "Thieves Camp" }, { AREA_JASPERLODE_MINE, "Jasperlode Mine" }, { AREA_VALLEY_OF_HEROES_UNUSED, "Valley Of Heroes Unused" }, { AREA_HEROES_VIGIL, "Heroes Vigil" }, { AREA_FARGODEEP_MINE, "Fargodeep Mine" }, { AREA_NORTHSHIRE_VINEYARDS, "Northshire Vineyards" }, { AREA_FORESTS_EDGE, "Forests Edge" }, { AREA_THUNDER_FALLS, "Thunder Falls" }, { AREA_BRACKWELL_PUMPKIN_PATCH, "Brackwell Pumpkin Patch" }, { AREA_THE_STONEFIELD_FARM, "The Stonefield Farm" }, { AREA_THE_MACLURE_VINEYARDS, "The Maclure Vineyards" }, { AREA_ON_MAP_DUNGEON0, "On Map Dungeon0" }, { AREA_ON_MAP_DUNGEON1, "On Map Dungeon1" }, { AREA_ON_MAP_DUNGEON2, "On Map Dungeon2" }, { AREA_LAKE_EVERSTILL, "Lake Everstill" }, { AREA_LAKESHIRE, "Lakeshire" }, { AREA_STONEWATCH, "Stonewatch" }, { AREA_STONEWATCH_FALLS, "Stonewatch Falls" }, { AREA_THE_DARK_PORTAL, "The Dark Portal" }, { AREA_THE_TAINTED_SCAR, "The Tainted Scar" }, { AREA_POOL_OF_TEARS, "Pool Of Tears" }, { AREA_STONARD, "Stonard" }, { AREA_FALLOW_SANCTUARY, "Fallow Sanctuary" }, { AREA_ANVILMAR, "Anvilmar" }, { AREA_STORMWIND_MOUNTAINS, "Stormwind Mountains" }, { AREA_JEFF_NE_QUADRANT_CHANGED, "Jeff Ne Quadrant Changed" }, { AREA_JEFF_NW_QUADRANT, "Jeff Nw Quadrant" }, { AREA_JEFF_SE_QUADRANT, "Jeff Se Quadrant" }, { AREA_JEFF_SW_QUADRANT, "Jeff Sw Quadrant" }, { AREA_TIRISFAL_GLADES, "Tirisfal Glades" }, { AREA_STONE_CAIRN_LAKE, "Stone Cairn Lake" }, { AREA_GOLDSHIRE, "Goldshire" }, { AREA_EASTVALE_LOGGING_CAMP, "Eastvale Logging Camp" }, { AREA_MIRROR_LAKE_ORCHARD, "Mirror Lake Orchard" }, { AREA_TOWER_OF_AZORA, "Tower Of Azora" }, { AREA_MIRROR_LAKE, "Mirror Lake" }, { AREA_VUL_GOL_OGRE_MOUND, "Vul Gol Ogre Mound" }, { AREA_RAVEN_HILL, "Raven Hill" }, { AREA_REDRIDGE_CANYONS, "Redridge Canyons" }, { AREA_TOWER_OF_ILGALAR, "Tower Of Ilgalar" }, { AREA_ALTHERS_MILL, "Althers Mill" }, { AREA_RETHBAN_CAVERNS, "Rethban Caverns" }, { AREA_REBEL_CAMP, "Rebel Camp" }, { AREA_NESINGWARYS_EXPEDITION, "Nesingwarys Expedition" }, { AREA_KURZENS_COMPOUND, "Kurzens Compound" }, { AREA_RUINS_OF_ZUL_KUNDA, "Ruins Of Zul Kunda" }, { AREA_RUINS_OF_ZUL_MAMWE, "Ruins Of Zul Mamwe" }, { AREA_THE_VILE_REEF, "The Vile Reef" }, { AREA_MOSH_OGG_OGRE_MOUND, "Mosh Ogg Ogre Mound" }, { AREA_THE_STOCKPILE, "The Stockpile" }, { AREA_SALDEANS_FARM, "Saldeans Farm" }, { AREA_SENTINEL_HILL, "Sentinel Hill" }, { AREA_FURLBROWS_PUMPKIN_FARM, "Furlbrows Pumpkin Farm" }, { AREA_JANGOLODE_MINE, "Jangolode Mine" }, { AREA_GOLD_COAST_QUARRY, "Gold Coast Quarry" }, { AREA_WESTFALL_LIGHTHOUSE, "Westfall Lighthouse" }, { AREA_MISTY_VALLEY, "Misty Valley" }, { AREA_GROM_GOL_BASE_CAMP, "Grom Gol Base Camp" }, { AREA_WHELGARS_EXCAVATION_SITE, "Whelgars Excavation Site" }, { AREA_WESTBROOK_GARRISON, "Westbrook Garrison" }, { AREA_TRANQUIL_GARDENS_CEMETERY, "Tranquil Gardens Cemetery" }, { AREA_ZUULDAIA_RUINS, "Zuuldaia Ruins" }, { AREA_BAL_LAL_RUINS, "Bal Lal Ruins" }, { AREA_KAL_AI_RUINS, "Kal Ai Ruins" }, { AREA_TKASHI_RUINS, "Tkashi Ruins" }, { AREA_BALIA_MAH_RUINS, "Balia Mah Ruins" }, { AREA_ZIATAJAI_RUINS, "Ziatajai Ruins" }, { AREA_MIZJAH_RUINS, "Mizjah Ruins" }, { AREA_SILVERPINE_FOREST, "Silverpine Forest" }, { AREA_KHARANOS, "Kharanos" }, { AREA_COLDRIDGE_VALLEY, "Coldridge Valley" }, { AREA_GNOMEREGAN0, "Gnomeregan0" }, { AREA_GOL_BOLAR_QUARRY, "Gol Bolar Quarry" }, { AREA_FROSTMANE_HOLD, "Frostmane Hold" }, { AREA_THE_GRIZZLED_DEN, "The Grizzled Den" }, { AREA_BREWNALL_VILLAGE, "Brewnall Village" }, { AREA_MISTY_PINE_REFUGE, "Misty Pine Refuge" }, { AREA_EASTERN_PLAGUELANDS, "Eastern Plaguelands" }, { AREA_TELDRASSIL, "Teldrassil" }, { AREA_IRONBANDS_EXCAVATION_SITE, "Ironbands Excavation Site" }, { AREA_MO_GROSH_STRONGHOLD, "Mo Grosh Stronghold" }, { AREA_THELSAMAR, "Thelsamar" }, { AREA_ALGAZ_GATE, "Algaz Gate" }, { AREA_STONEWROUGHT_DAM, "Stonewrought Dam" }, { AREA_THE_FARSTRIDER_LODGE, "The Farstrider Lodge" }, { AREA_DARKSHORE, "Darkshore" }, { AREA_SILVER_STREAM_MINE, "Silver Stream Mine" }, { AREA_MENETHIL_HARBOR, "Menethil Harbor" }, { AREA_DESIGNER_ISLAND, "Designer Island" }, { AREA_THE_BULWARK0, "The Bulwark0" }, { AREA_RUINS_OF_LORDAERON, "Ruins Of Lordaeron" }, { AREA_DEATHKNELL, "Deathknell" }, { AREA_NIGHT_WEBS_HOLLOW, "Night Webs Hollow" }, { AREA_SOLLIDEN_FARMSTEAD, "Solliden Farmstead" }, { AREA_AGAMAND_MILLS, "Agamand Mills" }, { AREA_AGAMAND_FAMILY_CRYPT, "Agamand Family Crypt" }, { AREA_BRILL, "Brill" }, { AREA_WHISPERING_GARDENS, "Whispering Gardens" }, { AREA_TERRACE_OF_REPOSE, "Terrace Of Repose" }, { AREA_BRIGHTWATER_LAKE, "Brightwater Lake" }, { AREA_GUNTHERS_RETREAT, "Gunthers Retreat" }, { AREA_GARRENS_HAUNT, "Garrens Haunt" }, { AREA_BALNIR_FARMSTEAD, "Balnir Farmstead" }, { AREA_COLD_HEARTH_MANOR, "Cold Hearth Manor" }, { AREA_CRUSADER_OUTPOST, "Crusader Outpost" }, { AREA_THE_NORTH_COAST, "The North Coast" }, { AREA_WHISPERING_SHORE, "Whispering Shore" }, { AREA_LORDAMERE_LAKE0, "Lordamere Lake0" }, { AREA_FENRIS_ISLE, "Fenris Isle" }, { AREA_FAOLS_REST, "Faols Rest" }, { AREA_DOLANAAR, "Dolanaar" }, { AREA_DARNASSUS_UNUSED, "Darnassus Unused" }, { AREA_SHADOWGLEN, "Shadowglen" }, { AREA_STEELGRILLS_DEPOT, "Steelgrills Depot" }, { AREA_HEARTHGLEN, "Hearthglen" }, { AREA_NORTHRIDGE_LUMBER_CAMP, "Northridge Lumber Camp" }, { AREA_RUINS_OF_ANDORHAL, "Ruins Of Andorhal" }, { AREA_SCHOOL_OF_NECROMANCY, "School Of Necromancy" }, { AREA_UTHERS_TOMB, "Uthers Tomb" }, { AREA_SORROW_HILL, "Sorrow Hill" }, { AREA_THE_WEEPING_CAVE, "The Weeping Cave" }, { AREA_FELSTONE_FIELD, "Felstone Field" }, { AREA_DALSONS_TEARS, "Dalsons Tears" }, { AREA_GAHRRONS_WITHERING, "Gahrrons Withering" }, { AREA_THE_WRITHING_HAUNT, "The Writhing Haunt" }, { AREA_MARDENHOLDE_KEEP, "Mardenholde Keep" }, { AREA_PYREWOOD_VILLAGE, "Pyrewood Village" }, { AREA_DUN_MODR, "Dun Modr" }, { AREA_WESTFALL1, "Westfall1" }, { AREA_THE_GREAT_SEA0, "The Great Sea0" }, { AREA_UNUSED_IRONCLADCOVE, "Unused Ironcladcove" }, { AREA_SHADOWFANG_KEEP0, "Shadowfang Keep0" }, { AREA_ON_MAP_DUNGEON3, "On Map Dungeon3" }, { AREA_ICEFLOW_LAKE, "Iceflow Lake" }, { AREA_HELMS_BED_LAKE, "Helms Bed Lake" }, { AREA_DEEP_ELEM_MINE, "Deep Elem Mine" }, { AREA_THE_GREAT_SEA1, "The Great Sea1" }, { AREA_MULGORE, "Mulgore" }, { AREA_ALEXSTON_FARMSTEAD, "Alexston Farmstead" }, { AREA_RED_CLOUD_MESA, "Red Cloud Mesa" }, { AREA_CAMP_NARACHE, "Camp Narache" }, { AREA_BLOODHOOF_VILLAGE, "Bloodhoof Village" }, { AREA_STONEBULL_LAKE, "Stonebull Lake" }, { AREA_RAVAGED_CARAVAN, "Ravaged Caravan" }, { AREA_RED_ROCKS, "Red Rocks" }, { AREA_THE_SKITTERING_DARK, "The Skittering Dark" }, { AREA_VALGANS_FIELD, "Valgans Field" }, { AREA_THE_SEPULCHER, "The Sepulcher" }, { AREA_OLSENS_FARTHING, "Olsens Farthing" }, { AREA_THE_GREYMANE_WALL, "The Greymane Wall" }, { AREA_BERENS_PERIL, "Berens Peril" }, { AREA_THE_DAWNING_ISLES, "The Dawning Isles" }, { AREA_AMBERMILL, "Ambermill" }, { AREA_FENRIS_KEEP, "Fenris Keep" }, { AREA_SHADOWFANG_KEEP1, "Shadowfang Keep1" }, { AREA_THE_DECREPIT_FERRY, "The Decrepit Ferry" }, { AREA_MALDENS_ORCHARD, "Maldens Orchard" }, { AREA_THE_IVAR_PATCH, "The Ivar Patch" }, { AREA_THE_DEAD_FIELD, "The Dead Field" }, { AREA_THE_ROTTING_ORCHARD, "The Rotting Orchard" }, { AREA_BRIGHTWOOD_GROVE, "Brightwood Grove" }, { AREA_FORLORN_ROWE, "Forlorn Rowe" }, { AREA_THE_WHIPPLE_ESTATE, "The Whipple Estate" }, { AREA_THE_YORGEN_FARMSTEAD, "The Yorgen Farmstead" }, { AREA_THE_CAULDRON, "The Cauldron" }, { AREA_GRIMESILT_DIG_SITE, "Grimesilt Dig Site" }, { AREA_DREADMAUL_ROCK, "Dreadmaul Rock" }, { AREA_RUINS_OF_THAURISSAN, "Ruins Of Thaurissan" }, { AREA_FLAME_CREST, "Flame Crest" }, { AREA_BLACKROCK_STRONGHOLD, "Blackrock Stronghold" }, { AREA_THE_PILLAR_OF_ASH, "The Pillar Of Ash" }, { AREA_BLACKROCK_MOUNTAIN1, "Blackrock Mountain1" }, { AREA_ALTAR_OF_STORMS0, "Altar Of Storms0" }, { AREA_ALDRASSIL, "Aldrassil" }, { AREA_SHADOWTHREAD_CAVE, "Shadowthread Cave" }, { AREA_FEL_ROCK, "Fel Rock" }, { AREA_LAKE_AL_AMETH, "Lake Al Ameth" }, { AREA_STARBREEZE_VILLAGE, "Starbreeze Village" }, { AREA_GNARLPINE_HOLD, "Gnarlpine Hold" }, { AREA_BAN_ETHIL_BARROW_DEN, "Ban Ethil Barrow Den" }, { AREA_THE_CLEFT, "The Cleft" }, { AREA_THE_ORACLE_GLADE, "The Oracle Glade" }, { AREA_WELLSPRING_RIVER, "Wellspring River" }, { AREA_WELLSPRING_LAKE, "Wellspring Lake" }, { AREA_HILLSBRAD_FOOTHILLS, "Hillsbrad Foothills" }, { AREA_AZSHARA_CRATER, "Azshara Crater" }, { AREA_DUN_ALGAZ0, "Dun Algaz0" }, { AREA_SOUTHSHORE0, "Southshore0" }, { AREA_TARREN_MILL0, "Tarren Mill0" }, { AREA_DURNHOLDE_KEEP0, "Durnholde Keep0" }, { AREA_UNUSED_STONEWROUGHT_PASS, "Unused Stonewrought Pass" }, { AREA_THE_FOOTHILL_CAVERNS, "The Foothill Caverns" }, { AREA_LORDAMERE_INTERNMENT_CAMP, "Lordamere Internment Camp" }, { AREA_DALARAN, "Dalaran" }, { AREA_STRAHNBRAD, "Strahnbrad" }, { AREA_RUINS_OF_ALTERAC, "Ruins Of Alterac" }, { AREA_CRUSHRIDGE_HOLD, "Crushridge Hold" }, { AREA_SLAUGHTER_HOLLOW, "Slaughter Hollow" }, { AREA_THE_UPLANDS, "The Uplands" }, { AREA_SOUTHPOINT_TOWER0, "Southpoint Tower0" }, { AREA_HILLSBRAD_FIELDS0, "Hillsbrad Fields0" }, { AREA_HILLSBRAD, "Hillsbrad" }, { AREA_AZURELODE_MINE0, "Azurelode Mine0" }, { AREA_NETHANDER_STEAD0, "Nethander Stead0" }, { AREA_DUN_GAROK0, "Dun Garok0" }, { AREA_THORADINS_WALL0, "Thoradins Wall0" }, { AREA_EASTERN_STRAND0, "Eastern Strand0" }, { AREA_WESTERN_STRAND0, "Western Strand0" }, { AREA_SOUTH_SEAS_UNUSED, "South Seas Unused" }, { AREA_JAGUERO_ISLE, "Jaguero Isle" }, { AREA_BARADIN_BAY, "Baradin Bay" }, { AREA_MENETHIL_BAY, "Menethil Bay" }, { AREA_MISTY_REED_STRAND, "Misty Reed Strand" }, { AREA_THE_SAVAGE_COAST, "The Savage Coast" }, { AREA_THE_CRYSTAL_SHORE, "The Crystal Shore" }, { AREA_SHELL_BEACH, "Shell Beach" }, { AREA_NORTH_TIDES_RUN, "North Tides Run" }, { AREA_SOUTH_TIDES_RUN, "South Tides Run" }, { AREA_THE_OVERLOOK_CLIFFS, "The Overlook Cliffs" }, { AREA_THE_FORBIDDING_SEA0, "The Forbidding Sea0" }, { AREA_IRONBEARDS_TOMB, "Ironbeards Tomb" }, { AREA_CRYSTALVEIN_MINE, "Crystalvein Mine" }, { AREA_RUINS_OF_ABORAZ, "Ruins Of Aboraz" }, { AREA_JANEIROS_POINT, "Janeiros Point" }, { AREA_NORTHFOLD_MANOR, "Northfold Manor" }, { AREA_GO_SHEK_FARM, "Go Shek Farm" }, { AREA_DABYRIES_FARMSTEAD, "Dabyries Farmstead" }, { AREA_BOULDERFIST_HALL, "Boulderfist Hall" }, { AREA_WITHERBARK_VILLAGE, "Witherbark Village" }, { AREA_DRYWHISKER_GORGE, "Drywhisker Gorge" }, { AREA_REFUGE_POINTE, "Refuge Pointe" }, { AREA_HAMMERFALL, "Hammerfall" }, { AREA_BLACKWATER_SHIPWRECKS, "Blackwater Shipwrecks" }, { AREA_O_BREENS_CAMP, "O Breens Camp" }, { AREA_STROMGARDE_KEEP, "Stromgarde Keep" }, { AREA_THE_TOWER_OF_ARATHOR, "The Tower Of Arathor" }, { AREA_THE_SANCTUM, "The Sanctum" }, { AREA_FALDIRS_COVE, "Faldirs Cove" }, { AREA_THE_DROWNED_REEF, "The Drowned Reef" }, { AREA_THANDOL_SPAN0, "Thandol Span0" }, { AREA_ASHENVALE, "Ashenvale" }, { AREA_THE_GREAT_SEA2, "The Great Sea2" }, { AREA_CIRCLE_OF_EAST_BINDING, "Circle Of East Binding" }, { AREA_CIRCLE_OF_WEST_BINDING, "Circle Of West Binding" }, { AREA_CIRCLE_OF_INNER_BINDING, "Circle Of Inner Binding" }, { AREA_CIRCLE_OF_OUTER_BINDING, "Circle Of Outer Binding" }, { AREA_APOCRYPHANS_REST, "Apocryphans Rest" }, { AREA_ANGOR_FORTRESS, "Angor Fortress" }, { AREA_LETHLOR_RAVINE, "Lethlor Ravine" }, { AREA_KARGATH, "Kargath" }, { AREA_CAMP_KOSH, "Camp Kosh" }, { AREA_CAMP_BOFF, "Camp Boff" }, { AREA_CAMP_WURG, "Camp Wurg" }, { AREA_CAMP_CAGG, "Camp Cagg" }, { AREA_AGMONDS_END, "Agmonds End" }, { AREA_HAMMERTOES_DIGSITE, "Hammertoes Digsite" }, { AREA_DUSTBELCH_GROTTO, "Dustbelch Grotto" }, { AREA_AERIE_PEAK, "Aerie Peak" }, { AREA_WILDHAMMER_KEEP, "Wildhammer Keep" }, { AREA_QUEL_DANIL_LODGE, "Quel Danil Lodge" }, { AREA_SKULK_ROCK, "Skulk Rock" }, { AREA_ZUN_WATHA, "Zun Watha" }, { AREA_SHADRA_ALOR, "Shadra Alor" }, { AREA_JINTHA_ALOR, "Jintha Alor" }, { AREA_THE_ALTAR_OF_ZUL, "The Altar Of Zul" }, { AREA_SERADANE, "Seradane" }, { AREA_FERALAS, "Feralas" }, { AREA_BRAMBLEBLADE_RAVINE, "Brambleblade Ravine" }, { AREA_BAEL_MODAN, "Bael Modan" }, { AREA_THE_VENTURE_CO_MINE, "The Venture Co Mine" }, { AREA_FELWOOD, "Felwood" }, { AREA_RAZOR_HILL, "Razor Hill" }, { AREA_VALLEY_OF_TRIALS, "Valley Of Trials" }, { AREA_THE_DEN, "The Den" }, { AREA_BURNING_BLADE_COVEN, "Burning Blade Coven" }, { AREA_KOLKAR_CRAG, "Kolkar Crag" }, { AREA_SEN_JIN_VILLAGE, "Sen Jin Village" }, { AREA_ECHO_ISLES, "Echo Isles" }, { AREA_THUNDER_RIDGE, "Thunder Ridge" }, { AREA_DRYGULCH_RAVINE, "Drygulch Ravine" }, { AREA_DUSTWIND_CAVE, "Dustwind Cave" }, { AREA_TIRAGARDE_KEEP, "Tiragarde Keep" }, { AREA_SCUTTLE_COAST, "Scuttle Coast" }, { AREA_BLADEFIST_BAY, "Bladefist Bay" }, { AREA_DEADEYE_SHORE, "Deadeye Shore" }, { AREA_SOUTHFURY_RIVER0, "Southfury River0" }, { AREA_CAMP_TAURAJO, "Camp Taurajo" }, { AREA_FAR_WATCH_POST, "Far Watch Post" }, { AREA_THE_CROSSROADS, "The Crossroads" }, { AREA_BOULDER_LODE_MINE, "Boulder Lode Mine" }, { AREA_THE_SLUDGE_FEN, "The Sludge Fen" }, { AREA_THE_DRY_HILLS, "The Dry Hills" }, { AREA_DREADMIST_PEAK, "Dreadmist Peak" }, { AREA_NORTHWATCH_HOLD, "Northwatch Hold" }, { AREA_THE_FORGOTTEN_POOLS, "The Forgotten Pools" }, { AREA_LUSHWATER_OASIS, "Lushwater Oasis" }, { AREA_THE_STAGNANT_OASIS, "The Stagnant Oasis" }, { AREA_FIELD_OF_GIANTS, "Field Of Giants" }, { AREA_THE_MERCHANT_COAST, "The Merchant Coast" }, { AREA_RATCHET, "Ratchet" }, { AREA_DARKSPEAR_STRAND, "Darkspear Strand" }, { AREA_DARROWMERE_LAKE_UNUSED, "Darrowmere Lake Unused" }, { AREA_CAER_DARROW_UNUSED, "Caer Darrow Unused" }, { AREA_WINTERHOOF_WATER_WELL, "Winterhoof Water Well" }, { AREA_THUNDERHORN_WATER_WELL, "Thunderhorn Water Well" }, { AREA_WILDMANE_WATER_WELL, "Wildmane Water Well" }, { AREA_SKYLINE_RIDGE, "Skyline Ridge" }, { AREA_THOUSAND_NEEDLES, "Thousand Needles" }, { AREA_THE_TIDUS_STAIR, "The Tidus Stair" }, { AREA_SHADY_REST_INN, "Shady Rest Inn" }, { AREA_BAEL_DUN_DIGSITE, "Bael Dun Digsite" }, { AREA_DESOLACE, "Desolace" }, { AREA_STONETALON_MOUNTAINS, "Stonetalon Mountains" }, { AREA_ORGRIMMAR_UNUSED, "Orgrimmar Unused" }, { AREA_GILLIJIMS_ISLE, "Gillijims Isle" }, { AREA_ISLAND_OF_DOCTOR_LAPIDIS, "Island Of Doctor Lapidis" }, { AREA_RAZORWIND_CANYON, "Razorwind Canyon" }, { AREA_BATHRANS_HAUNT, "Bathrans Haunt" }, { AREA_THE_RUINS_OF_ORDIL_ARAN, "The Ruins Of Ordil Aran" }, { AREA_MAESTRAS_POST, "Maestras Post" }, { AREA_THE_ZORAM_STRAND, "The Zoram Strand" }, { AREA_ASTRANAAR, "Astranaar" }, { AREA_THE_SHRINE_OF_AESSINA, "The Shrine Of Aessina" }, { AREA_FIRE_SCAR_SHRINE, "Fire Scar Shrine" }, { AREA_THE_RUINS_OF_STARDUST, "The Ruins Of Stardust" }, { AREA_THE_HOWLING_VALE, "The Howling Vale" }, { AREA_SILVERWIND_REFUGE, "Silverwind Refuge" }, { AREA_MYSTRAL_LAKE, "Mystral Lake" }, { AREA_FALLEN_SKY_LAKE, "Fallen Sky Lake" }, { AREA_IRIS_LAKE, "Iris Lake" }, { AREA_MOONWELL, "Moonwell" }, { AREA_RAYNEWOOD_RETREAT, "Raynewood Retreat" }, { AREA_THE_SHADY_NOOK, "The Shady Nook" }, { AREA_NIGHT_RUN, "Night Run" }, { AREA_XAVIAN, "Xavian" }, { AREA_SATYRNAAR, "Satyrnaar" }, { AREA_SPLINTERTREE_POST, "Splintertree Post" }, { AREA_THE_DOR_DANIL_BARROW_DEN, "The Dor Danil Barrow Den" }, { AREA_FALFARREN_RIVER, "Falfarren River" }, { AREA_FELFIRE_HILL, "Felfire Hill" }, { AREA_DEMON_FALL_CANYON, "Demon Fall Canyon" }, { AREA_DEMON_FALL_RIDGE, "Demon Fall Ridge" }, { AREA_WARSONG_LUMBER_CAMP, "Warsong Lumber Camp" }, { AREA_BOUGH_SHADOW, "Bough Shadow" }, { AREA_THE_SHIMMERING_FLATS, "The Shimmering Flats" }, { AREA_TANARIS, "Tanaris" }, { AREA_LAKE_FALATHIM, "Lake Falathim" }, { AREA_AUBERDINE, "Auberdine" }, { AREA_RUINS_OF_MATHYSTRA, "Ruins Of Mathystra" }, { AREA_TOWER_OF_ALTHALAXX, "Tower Of Althalaxx" }, { AREA_CLIFFSPRING_FALLS, "Cliffspring Falls" }, { AREA_BASHAL_ARAN, "Bashal Aran" }, { AREA_AMETH_ARAN, "Ameth Aran" }, { AREA_GROVE_OF_THE_ANCIENTS, "Grove Of The Ancients" }, { AREA_THE_MASTERS_GLAIVE, "The Masters Glaive" }, { AREA_REMTRAVELS_EXCAVATION, "Remtravels Excavation" }, { AREA_MISTS_EDGE, "Mists Edge" }, { AREA_THE_LONG_WASH, "The Long Wash" }, { AREA_WILDBEND_RIVER, "Wildbend River" }, { AREA_BLACKWOOD_DEN, "Blackwood Den" }, { AREA_CLIFFSPRING_RIVER, "Cliffspring River" }, { AREA_THE_VEILED_SEA0, "The Veiled Sea0" }, { AREA_GOLD_ROAD, "Gold Road" }, { AREA_SCARLET_WATCH_POST, "Scarlet Watch Post" }, { AREA_SUN_ROCK_RETREAT, "Sun Rock Retreat" }, { AREA_WINDSHEAR_CRAG, "Windshear Crag" }, { AREA_CRAGPOOL_LAKE, "Cragpool Lake" }, { AREA_MIRKFALLON_LAKE, "Mirkfallon Lake" }, { AREA_THE_CHARRED_VALE, "The Charred Vale" }, { AREA_VALLEY_OF_THE_BLOODFURIES, "Valley Of The Bloodfuries" }, { AREA_STONETALON_PEAK, "Stonetalon Peak" }, { AREA_THE_TALON_DEN, "The Talon Den" }, { AREA_GREATWOOD_VALE, "Greatwood Vale" }, { AREA_THUNDER_BLUFF_UNUSED, "Thunder Bluff Unused" }, { AREA_BRAVE_WIND_MESA, "Brave Wind Mesa" }, { AREA_FIRE_STONE_MESA, "Fire Stone Mesa" }, { AREA_MANTLE_ROCK, "Mantle Rock" }, { AREA_HUNTER_RISE_UNUSED, "Hunter Rise Unused" }, { AREA_SPIRIT_RISE_UNUSED, "Spirit Rise Unused" }, { AREA_ELDER_RISE_UNUSED, "Elder Rise Unused" }, { AREA_RUINS_OF_JUBUWAL, "Ruins Of Jubuwal" }, { AREA_POOLS_OF_ARLITHRIEN, "Pools Of Arlithrien" }, { AREA_THE_RUSTMAUL_DIG_SITE, "The Rustmaul Dig Site" }, { AREA_CAMP_E_THOK, "Camp E Thok" }, { AREA_SPLITHOOF_CRAG, "Splithoof Crag" }, { AREA_HIGHPERCH, "Highperch" }, { AREA_THE_SCREECHING_CANYON, "The Screeching Canyon" }, { AREA_FREEWIND_POST, "Freewind Post" }, { AREA_THE_GREAT_LIFT0, "The Great Lift0" }, { AREA_GALAK_HOLD, "Galak Hold" }, { AREA_ROGUEFEATHER_DEN, "Roguefeather Den" }, { AREA_THE_WEATHERED_NOOK, "The Weathered Nook" }, { AREA_THALANAAR, "Thalanaar" }, { AREA_UN_GORO_CRATER, "Un Goro Crater" }, { AREA_RAZORFEN_KRAUL0, "Razorfen Kraul0" }, { AREA_RAVEN_HILL_CEMETERY, "Raven Hill Cemetery" }, { AREA_MOONGLADE, "Moonglade" }, { AREA_DELETE_ME0, "Delete Me0" }, { AREA_BRACKENWALL_VILLAGE, "Brackenwall Village" }, { AREA_SWAMPLIGHT_MANOR, "Swamplight Manor" }, { AREA_BLOODFEN_BURROW, "Bloodfen Burrow" }, { AREA_DARKMIST_CAVERN, "Darkmist Cavern" }, { AREA_MOGGLE_POINT, "Moggle Point" }, { AREA_BEEZILS_WRECK, "Beezils Wreck" }, { AREA_WITCH_HILL, "Witch Hill" }, { AREA_SENTRY_POINT, "Sentry Point" }, { AREA_NORTH_POINT_TOWER, "North Point Tower" }, { AREA_WEST_POINT_TOWER, "West Point Tower" }, { AREA_LOST_POINT, "Lost Point" }, { AREA_BLUEFEN, "Bluefen" }, { AREA_STONEMAUL_RUINS, "Stonemaul Ruins" }, { AREA_THE_DEN_OF_FLAME, "The Den Of Flame" }, { AREA_THE_DRAGONMURK, "The Dragonmurk" }, { AREA_WYRMBOG, "Wyrmbog" }, { AREA_ONYXIAS_LAIR_UNUSED, "Onyxias Lair Unused" }, { AREA_THERAMORE_ISLE, "Theramore Isle" }, { AREA_FOOTHOLD_CITADEL, "Foothold Citadel" }, { AREA_IRONCLAD_PRISON, "Ironclad Prison" }, { AREA_DUSTWALLOW_BAY, "Dustwallow Bay" }, { AREA_TIDEFURY_COVE, "Tidefury Cove" }, { AREA_DREADMURK_SHORE, "Dreadmurk Shore" }, { AREA_ADDLES_STEAD, "Addles Stead" }, { AREA_FIRE_PLUME_RIDGE, "Fire Plume Ridge" }, { AREA_LAKKARI_TAR_PITS, "Lakkari Tar Pits" }, { AREA_TERROR_RUN, "Terror Run" }, { AREA_THE_SLITHERING_SCAR, "The Slithering Scar" }, { AREA_MARSHALS_REFUGE, "Marshals Refuge" }, { AREA_FUNGAL_ROCK, "Fungal Rock" }, { AREA_GOLAKKA_HOT_SPRINGS, "Golakka Hot Springs" }, { AREA_THE_LOCH, "The Loch" }, { AREA_BEGGARS_HAUNT, "Beggars Haunt" }, { AREA_KODO_GRAVEYARD, "Kodo Graveyard" }, { AREA_GHOST_WALKER_POST, "Ghost Walker Post" }, { AREA_SAR_THERIS_STRAND, "Sar Theris Strand" }, { AREA_THUNDER_AXE_FORTRESS, "Thunder Axe Fortress" }, { AREA_BOLGANS_HOLE, "Bolgans Hole" }, { AREA_MANNOROC_COVEN, "Mannoroc Coven" }, { AREA_SARGERON, "Sargeron" }, { AREA_MAGRAM_VILLAGE, "Magram Village" }, { AREA_GELKIS_VILLAGE, "Gelkis Village" }, { AREA_VALLEY_OF_SPEARS, "Valley Of Spears" }, { AREA_NIJELS_POINT, "Nijels Point" }, { AREA_KOLKAR_VILLAGE, "Kolkar Village" }, { AREA_HYJAL, "Hyjal" }, { AREA_WINTERSPRING, "Winterspring" }, { AREA_BLACKWOLF_RIVER, "Blackwolf River" }, { AREA_KODO_ROCK, "Kodo Rock" }, { AREA_HIDDEN_PATH, "Hidden Path" }, { AREA_SPIRIT_ROCK, "Spirit Rock" }, { AREA_SHRINE_OF_THE_DORMANT_FLAME, "Shrine Of The Dormant Flame" }, { AREA_LAKE_ELUNE_ARA, "Lake Elune Ara" }, { AREA_THE_HARBORAGE, "The Harborage" }, { AREA_OUTLAND, "Outland" }, { AREA_CRAFTSMENS_TERRACE_UNUSED, "Craftsmens Terrace Unused" }, { AREA_TRADESMENS_TERRACE_UNUSED, "Tradesmens Terrace Unused" }, { AREA_THE_TEMPLE_GARDENS_UNUSED, "The Temple Gardens Unused" }, { AREA_TEMPLE_OF_ELUNE_UNUSED, "Temple Of Elune Unused" }, { AREA_CENARION_ENCLAVE_UNUSED, "Cenarion Enclave Unused" }, { AREA_WARRIORS_TERRACE_UNUSED, "Warriors Terrace Unused" }, { AREA_RUT_THERAN_VILLAGE, "Rut Theran Village" }, { AREA_IRONBANDS_COMPOUND, "Ironbands Compound" }, { AREA_THE_STOCKADE, "The Stockade" }, { AREA_WAILING_CAVERNS, "Wailing Caverns" }, { AREA_BLACKFATHOM_DEEPS0, "Blackfathom Deeps0" }, { AREA_FRAY_ISLAND, "Fray Island" }, { AREA_GNOMEREGAN1, "Gnomeregan1" }, { AREA_RAZORFEN_DOWNS0, "Razorfen Downs0" }, { AREA_BAN_ETHIL_HOLLOW, "Ban Ethil Hollow" }, { AREA_SCARLET_MONASTERY, "Scarlet Monastery" }, { AREA_JERODS_LANDING, "Jerods Landing" }, { AREA_RIDGEPOINT_TOWER, "Ridgepoint Tower" }, { AREA_THE_DARKENED_BANK, "The Darkened Bank" }, { AREA_COLDRIDGE_PASS, "Coldridge Pass" }, { AREA_CHILL_BREEZE_VALLEY, "Chill Breeze Valley" }, { AREA_SHIMMER_RIDGE, "Shimmer Ridge" }, { AREA_AMBERSTILL_RANCH, "Amberstill Ranch" }, { AREA_THE_TUNDRID_HILLS, "The Tundrid Hills" }, { AREA_SOUTH_GATE_PASS0, "South Gate Pass0" }, { AREA_SOUTH_GATE_OUTPOST, "South Gate Outpost" }, { AREA_NORTH_GATE_PASS0, "North Gate Pass0" }, { AREA_NORTH_GATE_OUTPOST, "North Gate Outpost" }, { AREA_GATES_OF_IRONFORGE, "Gates Of Ironforge" }, { AREA_STILLWATER_POND, "Stillwater Pond" }, { AREA_NIGHTMARE_VALE, "Nightmare Vale" }, { AREA_VENOMWEB_VALE, "Venomweb Vale" }, { AREA_THE_BULWARK1, "The Bulwark1" }, { AREA_SOUTHFURY_RIVER1, "Southfury River1" }, { AREA_SOUTHFURY_RIVER2, "Southfury River2" }, { AREA_RAZORMANE_GROUNDS, "Razormane Grounds" }, { AREA_SKULL_ROCK, "Skull Rock" }, { AREA_PALEMANE_ROCK, "Palemane Rock" }, { AREA_WINDFURY_RIDGE, "Windfury Ridge" }, { AREA_THE_GOLDEN_PLAINS, "The Golden Plains" }, { AREA_THE_ROLLING_PLAINS, "The Rolling Plains" }, { AREA_DUN_ALGAZ1, "Dun Algaz1" }, { AREA_DUN_ALGAZ2, "Dun Algaz2" }, { AREA_NORTH_GATE_PASS1, "North Gate Pass1" }, { AREA_SOUTH_GATE_PASS1, "South Gate Pass1" }, { AREA_TWILIGHT_GROVE, "Twilight Grove" }, { AREA_GM_ISLAND, "Gm Island" }, { AREA_DELETE_ME1, "Delete Me1" }, { AREA_SOUTHFURY_RIVER3, "Southfury River3" }, { AREA_SOUTHFURY_RIVER4, "Southfury River4" }, { AREA_THANDOL_SPAN1, "Thandol Span1" }, { AREA_THANDOL_SPAN2, "Thandol Span2" }, { AREA_PURGATION_ISLE, "Purgation Isle" }, { AREA_THE_JANSEN_STEAD, "The Jansen Stead" }, { AREA_THE_DEAD_ACRE, "The Dead Acre" }, { AREA_THE_MOLSEN_FARM, "The Molsen Farm" }, { AREA_STENDELS_POND, "Stendels Pond" }, { AREA_THE_DAGGER_HILLS, "The Dagger Hills" }, { AREA_DEMONTS_PLACE, "Demonts Place" }, { AREA_THE_DUST_PLAINS, "The Dust Plains" }, { AREA_STONESPLINTER_VALLEY, "Stonesplinter Valley" }, { AREA_VALLEY_OF_KINGS, "Valley Of Kings" }, { AREA_ALGAZ_STATION, "Algaz Station" }, { AREA_BUCKLEBREE_FARM, "Bucklebree Farm" }, { AREA_THE_SHINING_STRAND, "The Shining Strand" }, { AREA_NORTH_TIDES_HOLLOW, "North Tides Hollow" }, { AREA_GRIZZLEPAW_RIDGE, "Grizzlepaw Ridge" }, { AREA_THE_VERDANT_FIELDS, "The Verdant Fields" }, { AREA_GADGETZAN, "Gadgetzan" }, { AREA_STEAMWHEEDLE_PORT, "Steamwheedle Port" }, { AREA_ZUL_FARRAK0, "Zul Farrak0" }, { AREA_SANDSORROW_WATCH, "Sandsorrow Watch" }, { AREA_THISTLESHRUB_VALLEY, "Thistleshrub Valley" }, { AREA_THE_GAPING_CHASM, "The Gaping Chasm" }, { AREA_THE_NOXIOUS_LAIR, "The Noxious Lair" }, { AREA_DUNEMAUL_COMPOUND, "Dunemaul Compound" }, { AREA_EASTMOON_RUINS, "Eastmoon Ruins" }, { AREA_WATERSPRING_FIELD, "Waterspring Field" }, { AREA_ZALASHJIS_DEN, "Zalashjis Den" }, { AREA_LANDS_END_BEACH, "Lands End Beach" }, { AREA_WAVESTRIDER_BEACH, "Wavestrider Beach" }, { AREA_ULDUM, "Uldum" }, { AREA_VALLEY_OF_THE_WATCHERS, "Valley Of The Watchers" }, { AREA_GUNSTANS_POST, "Gunstans Post" }, { AREA_SOUTHMOON_RUINS, "Southmoon Ruins" }, { AREA_RENDERS_CAMP, "Renders Camp" }, { AREA_RENDERS_VALLEY, "Renders Valley" }, { AREA_RENDERS_ROCK, "Renders Rock" }, { AREA_STONEWATCH_TOWER, "Stonewatch Tower" }, { AREA_GALARDELL_VALLEY, "Galardell Valley" }, { AREA_LAKERIDGE_HIGHWAY, "Lakeridge Highway" }, { AREA_THREE_CORNERS, "Three Corners" }, { AREA_DIREFORGE_HILL, "Direforge Hill" }, { AREA_RAPTOR_RIDGE, "Raptor Ridge" }, { AREA_BLACK_CHANNEL_MARSH, "Black Channel Marsh" }, { AREA_THE_GREEN_BELT0, "The Green Belt0" }, { AREA_MOSSHIDE_FEN, "Mosshide Fen" }, { AREA_THELGEN_ROCK, "Thelgen Rock" }, { AREA_BLUEGILL_MARSH, "Bluegill Marsh" }, { AREA_SALTSPRAY_GLEN, "Saltspray Glen" }, { AREA_SUNDOWN_MARSH, "Sundown Marsh" }, { AREA_THE_GREEN_BELT1, "The Green Belt1" }, { AREA_ANGERFANG_ENCAMPMENT, "Angerfang Encampment" }, { AREA_GRIM_BATOL, "Grim Batol" }, { AREA_DRAGONMAW_GATES, "Dragonmaw Gates" }, { AREA_THE_LOST_FLEET, "The Lost Fleet" }, { AREA_DARROW_HILL0, "Darrow Hill0" }, { AREA_THORADINS_WALL1, "Thoradins Wall1" }, { AREA_WEBWINDER_PATH, "Webwinder Path" }, { AREA_THE_HUSHED_BANK, "The Hushed Bank" }, { AREA_MANOR_MISTMANTLE, "Manor Mistmantle" }, { AREA_CAMP_MOJACHE, "Camp Mojache" }, { AREA_GRIMTOTEM_COMPOUND, "Grimtotem Compound" }, { AREA_THE_WRITHING_DEEP, "The Writhing Deep" }, { AREA_WILDWIND_LAKE, "Wildwind Lake" }, { AREA_GORDUNNI_OUTPOST, "Gordunni Outpost" }, { AREA_MOK_GORDUN, "Mok Gordun" }, { AREA_FERAL_SCAR_VALE, "Feral Scar Vale" }, { AREA_FRAYFEATHER_HIGHLANDS, "Frayfeather Highlands" }, { AREA_IDLEWIND_LAKE, "Idlewind Lake" }, { AREA_THE_FORGOTTEN_COAST, "The Forgotten Coast" }, { AREA_EAST_PILLAR, "East Pillar" }, { AREA_WEST_PILLAR, "West Pillar" }, { AREA_DREAM_BOUGH, "Dream Bough" }, { AREA_JADEMIR_LAKE, "Jademir Lake" }, { AREA_ONEIROS, "Oneiros" }, { AREA_RUINS_OF_RAVENWIND, "Ruins Of Ravenwind" }, { AREA_RAGE_SCAR_HOLD, "Rage Scar Hold" }, { AREA_FEATHERMOON_STRONGHOLD, "Feathermoon Stronghold" }, { AREA_RUINS_OF_SOLARSAL, "Ruins Of Solarsal" }, { AREA_LOWER_WILDS_UNUSED, "Lower Wilds Unused" }, { AREA_THE_TWIN_COLOSSALS, "The Twin Colossals" }, { AREA_SARDOR_ISLE, "Sardor Isle" }, { AREA_ISLE_OF_DREAD, "Isle Of Dread" }, { AREA_HIGH_WILDERNESS, "High Wilderness" }, { AREA_LOWER_WILDS, "Lower Wilds" }, { AREA_SOUTHERN_BARRENS, "Southern Barrens" }, { AREA_SOUTHERN_GOLD_ROAD, "Southern Gold Road" }, { AREA_ZUL_FARRAK1, "Zul Farrak1" }, { AREA_UNUSED_ALCAZ_ISLAND, "Unused Alcaz Island" }, { AREA_TIMBERMAW_HOLD0, "Timbermaw Hold0" }, { AREA_VANNDIR_ENCAMPMENT, "Vanndir Encampment" }, { AREA_TEST_AZSHARA, "Test Azshara" }, { AREA_LEGASH_ENCAMPMENT, "Legash Encampment" }, { AREA_THALASSIAN_BASE_CAMP, "Thalassian Base Camp" }, { AREA_RUINS_OF_ELDARATH, "Ruins Of Eldarath" }, { AREA_HETAERAS_CLUTCH, "Hetaeras Clutch" }, { AREA_TEMPLE_OF_ZIN_MALOR, "Temple Of Zin Malor" }, { AREA_BEARS_HEAD, "Bears Head" }, { AREA_URSOLAN, "Ursolan" }, { AREA_TEMPLE_OF_ARKKORAN, "Temple Of Arkkoran" }, { AREA_BAY_OF_STORMS, "Bay Of Storms" }, { AREA_THE_SHATTERED_STRAND, "The Shattered Strand" }, { AREA_TOWER_OF_ELDARA, "Tower Of Eldara" }, { AREA_JAGGED_REEF, "Jagged Reef" }, { AREA_SOUTHRIDGE_BEACH, "Southridge Beach" }, { AREA_RAVENCREST_MONUMENT, "Ravencrest Monument" }, { AREA_FORLORN_RIDGE, "Forlorn Ridge" }, { AREA_LAKE_MENNAR, "Lake Mennar" }, { AREA_SHADOWSONG_SHRINE, "Shadowsong Shrine" }, { AREA_HALDARR_ENCAMPMENT, "Haldarr Encampment" }, { AREA_VALORMOK, "Valormok" }, { AREA_THE_RUINED_REACHES, "The Ruined Reaches" }, { AREA_THE_TALONDEEP_PATH0, "The Talondeep Path0" }, { AREA_THE_TALONDEEP_PATH1, "The Talondeep Path1" }, { AREA_ROCKTUSK_FARM, "Rocktusk Farm" }, { AREA_JAGGEDSWINE_FARM, "Jaggedswine Farm" }, { AREA_RAZORFEN_DOWNS1, "Razorfen Downs1" }, { AREA_LOST_RIGGER_COVE, "Lost Rigger Cove" }, { AREA_ULDAMAN0, "Uldaman0" }, { AREA_LORDAMERE_LAKE1, "Lordamere Lake1" }, { AREA_LORDAMERE_LAKE2, "Lordamere Lake2" }, { AREA_GALLOWS_CORNER, "Gallows Corner" }, { AREA_SILITHUS, "Silithus" }, { AREA_EMERALD_FOREST, "Emerald Forest" }, { AREA_SUNKEN_TEMPLE, "Sunken Temple" }, { AREA_DREADMAUL_HOLD, "Dreadmaul Hold" }, { AREA_NETHERGARDE_KEEP, "Nethergarde Keep" }, { AREA_DREADMAUL_POST, "Dreadmaul Post" }, { AREA_SERPENTS_COIL, "Serpents Coil" }, { AREA_ALTAR_OF_STORMS1, "Altar Of Storms1" }, { AREA_FIREWATCH_RIDGE, "Firewatch Ridge" }, { AREA_THE_SLAG_PIT, "The Slag Pit" }, { AREA_THE_SEA_OF_CINDERS, "The Sea Of Cinders" }, { AREA_BLACKROCK_MOUNTAIN2, "Blackrock Mountain2" }, { AREA_THORIUM_POINT, "Thorium Point" }, { AREA_GARRISON_ARMORY, "Garrison Armory" }, { AREA_THE_TEMPLE_OF_ATAL_HAKKAR, "The Temple Of Atal Hakkar" }, { AREA_UNDERCITY, "Undercity" }, { AREA_ULDAMAN1, "Uldaman1" }, { AREA_NOT_USED_DEADMINES, "Not Used Deadmines" }, { AREA_STORMWIND_CITY, "Stormwind City" }, { AREA_IRONFORGE, "Ironforge" }, { AREA_SPLITHOOF_HOLD, "Splithoof Hold" }, { AREA_THE_CAPE_OF_STRANGLETHORN, "The Cape Of Stranglethorn" }, { AREA_SOUTHERN_SAVAGE_COAST, "Southern Savage Coast" }, { AREA_UNUSED_THE_DEADMINES_002, "Unused The Deadmines 002" }, { AREA_UNUSED_IRONCLAD_COVE_003, "Unused Ironclad Cove 003" }, { AREA_THE_DEADMINES, "The Deadmines" }, { AREA_IRONCLAD_COVE, "Ironclad Cove" }, { AREA_BLACKROCK_SPIRE, "Blackrock Spire" }, { AREA_BLACKROCK_DEPTHS, "Blackrock Depths" }, { AREA_RAPTOR_GROUNDS_UNUSED, "Raptor Grounds Unused" }, { AREA_GROL_DOM_FARM_UNUSED, "Grol Dom Farm Unused" }, { AREA_MORSHAN_BASE_CAMP, "Morshan Base Camp" }, { AREA_HONORS_STAND_UNUSED, "Honors Stand Unused" }, { AREA_BLACKTHORN_RIDGE_UNUSED, "Blackthorn Ridge Unused" }, { AREA_BRAMBLESCAR_UNUSED, "Bramblescar Unused" }, { AREA_AGAMA_GOR_UNUSED, "Agama Gor Unused" }, { AREA_VALLEY_OF_HEROES, "Valley Of Heroes" }, { AREA_ORGRIMMAR, "Orgrimmar" }, { AREA_THUNDER_BLUFF, "Thunder Bluff" }, { AREA_ELDER_RISE, "Elder Rise" }, { AREA_SPIRIT_RISE, "Spirit Rise" }, { AREA_HUNTER_RISE, "Hunter Rise" }, { AREA_DARNASSUS, "Darnassus" }, { AREA_CENARION_ENCLAVE, "Cenarion Enclave" }, { AREA_CRAFTSMENS_TERRACE, "Craftsmens Terrace" }, { AREA_WARRIORS_TERRACE, "Warriors Terrace" }, { AREA_THE_TEMPLE_GARDENS, "The Temple Gardens" }, { AREA_TRADESMENS_TERRACE, "Tradesmens Terrace" }, { AREA_GAVINS_NAZE, "Gavins Naze" }, { AREA_SOFERAS_NAZE, "Soferas Naze" }, { AREA_CORRAHNS_DAGGER, "Corrahns Dagger" }, { AREA_THE_HEADLAND, "The Headland" }, { AREA_MISTY_SHORE, "Misty Shore" }, { AREA_DANDREDS_FOLD, "Dandreds Fold" }, { AREA_GROWLESS_CAVE, "Growless Cave" }, { AREA_CHILLWIND_POINT, "Chillwind Point" }, { AREA_RAPTOR_GROUNDS, "Raptor Grounds" }, { AREA_BRAMBLESCAR, "Bramblescar" }, { AREA_THORN_HILL, "Thorn Hill" }, { AREA_AGAMA_GOR, "Agama Gor" }, { AREA_BLACKTHORN_RIDGE, "Blackthorn Ridge" }, { AREA_HONORS_STAND, "Honors Stand" }, { AREA_THE_MORSHAN_RAMPART, "The Morshan Rampart" }, { AREA_GROL_DOM_FARM, "Grol Dom Farm" }, { AREA_RAZORFEN_KRAUL1, "Razorfen Kraul1" }, { AREA_THE_GREAT_LIFT1, "The Great Lift1" }, { AREA_MISTVALE_VALLEY, "Mistvale Valley" }, { AREA_NEK_MANI_WELLSPRING, "Nek Mani Wellspring" }, { AREA_BLOODSAIL_COMPOUND, "Bloodsail Compound" }, { AREA_VENTURE_CO_BASE_CAMP, "Venture Co Base Camp" }, { AREA_GURUBASHI_ARENA, "Gurubashi Arena" }, { AREA_SPIRIT_DEN, "Spirit Den" }, { AREA_THE_CRIMSON_VEIL, "The Crimson Veil" }, { AREA_THE_RIPTIDE, "The Riptide" }, { AREA_THE_DAMSELS_LUCK, "The Damsels Luck" }, { AREA_VENTURE_CO_OPERATIONS_CENTER, "Venture Co Operations Center" }, { AREA_DEADWOOD_VILLAGE, "Deadwood Village" }, { AREA_FELPAW_VILLAGE, "Felpaw Village" }, { AREA_JAEDENAR, "Jaedenar" }, { AREA_BLOODVENOM_RIVER, "Bloodvenom River" }, { AREA_BLOODVENOM_FALLS, "Bloodvenom Falls" }, { AREA_SHATTER_SCAR_VALE, "Shatter Scar Vale" }, { AREA_IRONTREE_WOODS, "Irontree Woods" }, { AREA_IRONTREE_CAVERN, "Irontree Cavern" }, { AREA_TIMBERMAW_HOLD1, "Timbermaw Hold1" }, { AREA_SHADOW_HOLD, "Shadow Hold" }, { AREA_SHRINE_OF_THE_DECEIVER, "Shrine Of The Deceiver" }, { AREA_ITHARIUSS_CAVE, "Ithariuss Cave" }, { AREA_SORROWMURK, "Sorrowmurk" }, { AREA_DRAENIL_DUR_VILLAGE, "Draenil Dur Village" }, { AREA_SPLINTERSPEAR_JUNCTION, "Splinterspear Junction" }, { AREA_STAGALBOG, "Stagalbog" }, { AREA_THE_SHIFTING_MIRE, "The Shifting Mire" }, { AREA_STAGALBOG_CAVE, "Stagalbog Cave" }, { AREA_WITHERBARK_CAVERNS, "Witherbark Caverns" }, { AREA_THORADINS_WALL2, "Thoradins Wall2" }, { AREA_BOULDER_GOR, "Boulder Gor" }, { AREA_VALLEY_OF_FANGS, "Valley Of Fangs" }, { AREA_THE_DUSTBOWL, "The Dustbowl" }, { AREA_MIRAGE_FLATS, "Mirage Flats" }, { AREA_FEATHERBEARDS_HOVEL, "Featherbeards Hovel" }, { AREA_SHINDIGGERS_CAMP, "Shindiggers Camp" }, { AREA_PLAGUEMIST_RAVINE, "Plaguemist Ravine" }, { AREA_VALORWIND_LAKE, "Valorwind Lake" }, { AREA_AGOL_WATHA, "Agol Watha" }, { AREA_HIRI_WATHA, "Hiri Watha" }, { AREA_THE_CREEPING_RUIN, "The Creeping Ruin" }, { AREA_BOGENS_LEDGE, "Bogens Ledge" }, { AREA_THE_MAKERS_TERRACE, "The Makers Terrace" }, { AREA_DUSTWIND_GULCH, "Dustwind Gulch" }, { AREA_SHAOL_WATHA, "Shaol Watha" }, { AREA_NOONSHADE_RUINS, "Noonshade Ruins" }, { AREA_BROKEN_PILLAR, "Broken Pillar" }, { AREA_ABYSSAL_SANDS, "Abyssal Sands" }, { AREA_SOUTHBREAK_SHORE, "Southbreak Shore" }, { AREA_CAVERNS_OF_TIME0, "Caverns Of Time0" }, { AREA_THE_MARSHLANDS, "The Marshlands" }, { AREA_IRONSTONE_PLATEAU, "Ironstone Plateau" }, { AREA_BLACKCHAR_CAVE, "Blackchar Cave" }, { AREA_TANNER_CAMP, "Tanner Camp" }, { AREA_DUSTFIRE_VALLEY, "Dustfire Valley" }, { AREA_ZUL_GURUB1, "Zul Gurub1" }, { AREA_MISTY_REED_POST, "Misty Reed Post" }, { AREA_BLOODVENOM_POST, "Bloodvenom Post" }, { AREA_TALONBRANCH_GLADE, "Talonbranch Glade" }, { AREA_STRATHOLME0, "Stratholme0" }, { AREA_UNUSED_SHADOWFANG_KEEP_003, "Unused Shadowfang Keep 003" }, { AREA_SCHOLOMANCE, "Scholomance" }, { AREA_TWILIGHT_VALE, "Twilight Vale" }, { AREA_TWILIGHT_SHORE, "Twilight Shore" }, { AREA_ALCAZ_ISLAND, "Alcaz Island" }, { AREA_DARKCLOUD_PINNACLE, "Darkcloud Pinnacle" }, { AREA_DAWNING_WOOD_CATACOMBS, "Dawning Wood Catacombs" }, { AREA_STONEWATCH_KEEP, "Stonewatch Keep" }, { AREA_MARAUDON, "Maraudon" }, { AREA_STOUTLAGER_INN, "Stoutlager Inn" }, { AREA_THUNDERBREW_DISTILLERY, "Thunderbrew Distillery" }, { AREA_MENETHIL_KEEP, "Menethil Keep" }, { AREA_DEEPWATER_TAVERN, "Deepwater Tavern" }, { AREA_SHADOW_GRAVE, "Shadow Grave" }, { AREA_BRILL_TOWN_HALL, "Brill Town Hall" }, { AREA_GALLOWS_END_TAVERN, "Gallows End Tavern" }, { AREA_THE_POOLS_OF_VISION_UNUSED, "The Pools Of Vision Unused" }, { AREA_DREADMIST_DEN, "Dreadmist Den" }, { AREA_BAEL_DUN_KEEP, "Bael Dun Keep" }, { AREA_EMBERSTRIFES_DEN, "Emberstrifes Den" }, { AREA_ONYXIAS_LAIR, "Onyxias Lair" }, { AREA_WINDSHEAR_MINE, "Windshear Mine" }, { AREA_ROLANDS_DOOM, "Rolands Doom" }, { AREA_BATTLE_RING, "Battle Ring" }, { AREA_THE_POOLS_OF_VISION, "The Pools Of Vision" }, { AREA_SHADOWBREAK_RAVINE, "Shadowbreak Ravine" }, { AREA_BROKEN_SPEAR_VILLAGE, "Broken Spear Village" }, { AREA_WHITEREACH_POST, "Whitereach Post" }, { AREA_GORNIA, "Gornia" }, { AREA_ZANES_EYE_CRATER, "Zanes Eye Crater" }, { AREA_MIRAGE_RACEWAY, "Mirage Raceway" }, { AREA_FROSTSABER_ROCK, "Frostsaber Rock" }, { AREA_THE_HIDDEN_GROVE, "The Hidden Grove" }, { AREA_TIMBERMAW_POST, "Timbermaw Post" }, { AREA_WINTERFALL_VILLAGE, "Winterfall Village" }, { AREA_MAZTHORIL, "Mazthoril" }, { AREA_FROSTFIRE_HOT_SPRINGS, "Frostfire Hot Springs" }, { AREA_ICE_THISTLE_HILLS, "Ice Thistle Hills" }, { AREA_DUN_MANDARR, "Dun Mandarr" }, { AREA_FROSTWHISPER_GORGE, "Frostwhisper Gorge" }, { AREA_OWL_WING_THICKET, "Owl Wing Thicket" }, { AREA_LAKE_KEL_THERIL, "Lake Kel Theril" }, { AREA_THE_RUINS_OF_KEL_THERIL, "The Ruins Of Kel Theril" }, { AREA_STARFALL_VILLAGE, "Starfall Village" }, { AREA_BAN_THALLOW_BARROW_DEN, "Ban Thallow Barrow Den" }, { AREA_EVERLOOK, "Everlook" }, { AREA_DARKWHISPER_GORGE, "Darkwhisper Gorge" }, { AREA_DEEPRUN_TRAM, "Deeprun Tram" }, { AREA_THE_FUNGAL_VALE, "The Fungal Vale" }, { AREA_UNUSED_THE_MARRIS_STEAD, "Unused The Marris Stead" }, { AREA_THE_MARRIS_STEAD, "The Marris Stead" }, { AREA_THE_UNDERCROFT, "The Undercroft" }, { AREA_DARROWSHIRE, "Darrowshire" }, { AREA_CROWN_GUARD_TOWER, "Crown Guard Tower" }, { AREA_CORINS_CROSSING, "Corins Crossing" }, { AREA_SCARLET_BASE_CAMP, "Scarlet Base Camp" }, { AREA_TYRS_HAND, "Tyrs Hand" }, { AREA_THE_SCARLET_BASILICA, "The Scarlet Basilica" }, { AREA_LIGHTS_HOPE_CHAPEL, "Lights Hope Chapel" }, { AREA_BROWMAN_MILL, "Browman Mill" }, { AREA_THE_NOXIOUS_GLADE, "The Noxious Glade" }, { AREA_EASTWALL_TOWER, "Eastwall Tower" }, { AREA_NORTHDALE, "Northdale" }, { AREA_ZUL_MASHAR, "Zul Mashar" }, { AREA_MAZRA_ALOR, "Mazra Alor" }, { AREA_NORTHPASS_TOWER, "Northpass Tower" }, { AREA_QUEL_LITHIEN_LODGE, "Quel Lithien Lodge" }, { AREA_PLAGUEWOOD, "Plaguewood" }, { AREA_SCOURGEHOLD, "Scourgehold" }, { AREA_STRATHOLME1, "Stratholme1" }, { AREA_UNUSED_STRATHOLME, "Unused Stratholme" }, { AREA_DARROWMERE_LAKE0, "Darrowmere Lake0" }, { AREA_CAER_DARROW, "Caer Darrow" }, { AREA_DARROWMERE_LAKE1, "Darrowmere Lake1" }, { AREA_CAVERNS_OF_TIME1, "Caverns Of Time1" }, { AREA_THISTLEFUR_VILLAGE, "Thistlefur Village" }, { AREA_THE_QUAGMIRE, "The Quagmire" }, { AREA_WINDBREAK_CANYON, "Windbreak Canyon" }, { AREA_SOUTH_SEAS0, "South Seas0" }, { AREA_THE_GREAT_SEA3, "The Great Sea3" }, { AREA_THE_GREAT_SEA4, "The Great Sea4" }, { AREA_THE_GREAT_SEA5, "The Great Sea5" }, { AREA_THE_GREAT_SEA6, "The Great Sea6" }, { AREA_THE_VEILED_SEA1, "The Veiled Sea1" }, { AREA_THE_VEILED_SEA2, "The Veiled Sea2" }, { AREA_THE_VEILED_SEA3, "The Veiled Sea3" }, { AREA_THE_VEILED_SEA4, "The Veiled Sea4" }, { AREA_THE_VEILED_SEA5, "The Veiled Sea5" }, { AREA_RAZOR_HILL_BARRACKS, "Razor Hill Barracks" }, { AREA_SOUTH_SEAS1, "South Seas1" }, { AREA_THE_GREAT_SEA7, "The Great Sea7" }, { AREA_BLOODTOOTH_CAMP, "Bloodtooth Camp" }, { AREA_FOREST_SONG, "Forest Song" }, { AREA_GREENPAW_VILLAGE, "Greenpaw Village" }, { AREA_SILVERWING_OUTPOST, "Silverwing Outpost" }, { AREA_NIGHTHAVEN, "Nighthaven" }, { AREA_SHRINE_OF_REMULOS, "Shrine Of Remulos" }, { AREA_STORMRAGE_BARROW_DENS, "Stormrage Barrow Dens" }, { AREA_THE_GREAT_SEA8, "The Great Sea8" }, { AREA_THE_GREAT_SEA9, "The Great Sea9" }, { AREA_THE_BLACK_MORASS, "The Black Morass" }, { AREA_OLD_HILLSBRAD_FOOTHILLS, "Old Hillsbrad Foothills" }, { AREA_TARREN_MILL1, "Tarren Mill1" }, { AREA_SOUTHSHORE1, "Southshore1" }, { AREA_DURNHOLDE_KEEP1, "Durnholde Keep1" }, { AREA_DUN_GAROK1, "Dun Garok1" }, { AREA_HILLSBRAD_FIELDS1, "Hillsbrad Fields1" }, { AREA_EASTERN_STRAND1, "Eastern Strand1" }, { AREA_NETHANDER_STEAD1, "Nethander Stead1" }, { AREA_DARROW_HILL1, "Darrow Hill1" }, { AREA_SOUTHPOINT_TOWER1, "Southpoint Tower1" }, { AREA_THORADINS_WALL3, "Thoradins Wall3" }, { AREA_WESTERN_STRAND1, "Western Strand1" }, { AREA_AZURELODE_MINE1, "Azurelode Mine1" }, { AREA_THE_GREAT_SEA10, "The Great Sea10" }, { AREA_THE_GREAT_SEA11, "The Great Sea11" }, { AREA_THE_GREAT_SEA12, "The Great Sea12" }, { AREA_THE_FORBIDDING_SEA1, "The Forbidding Sea1" }, { AREA_THE_FORBIDDING_SEA2, "The Forbidding Sea2" }, { AREA_THE_FORBIDDING_SEA3, "The Forbidding Sea3" }, { AREA_THE_FORBIDDING_SEA4, "The Forbidding Sea4" }, { AREA_TETHRIS_ARAN, "Tethris Aran" }, { AREA_ETHEL_RETHOR, "Ethel Rethor" }, { AREA_RANAZJAR_ISLE, "Ranazjar Isle" }, { AREA_KORMEKS_HUT, "Kormeks Hut" }, { AREA_SHADOWPREY_VILLAGE, "Shadowprey Village" }, { AREA_BLACKROCK_PASS, "Blackrock Pass" }, { AREA_MORGANS_VIGIL, "Morgans Vigil" }, { AREA_SLITHER_ROCK, "Slither Rock" }, { AREA_TERROR_WING_PATH, "Terror Wing Path" }, { AREA_DRACO_DAR, "Draco Dar" }, { AREA_RAGEFIRE_CHASM, "Ragefire Chasm" }, { AREA_NIGHTSONG_WOODS, "Nightsong Woods" }, { AREA_THE_VEILED_SEA6, "The Veiled Sea6" }, { AREA_MORLOS_ARAN, "Morlos Aran" }, { AREA_EMERALD_SANCTUARY, "Emerald Sanctuary" }, { AREA_JADEFIRE_GLEN, "Jadefire Glen" }, { AREA_RUINS_OF_CONSTELLAS, "Ruins Of Constellas" }, { AREA_BITTER_REACHES, "Bitter Reaches" }, { AREA_RISE_OF_THE_DEFILER, "Rise Of The Defiler" }, { AREA_LARISS_PAVILION, "Lariss Pavilion" }, { AREA_WOODPAW_HILLS, "Woodpaw Hills" }, { AREA_WOODPAW_DEN, "Woodpaw Den" }, { AREA_VERDANTIS_RIVER, "Verdantis River" }, { AREA_RUINS_OF_ISILDIEN, "Ruins Of Isildien" }, { AREA_GRIMTOTEM_POST, "Grimtotem Post" }, { AREA_CAMP_APARAJE, "Camp Aparaje" }, { AREA_MALAKA_JIN, "Malaka Jin" }, { AREA_BOULDERSLIDE_RAVINE, "Boulderslide Ravine" }, { AREA_SISHIR_CANYON, "Sishir Canyon" }, { AREA_DIRE_MAUL0, "Dire Maul0" }, { AREA_DEADWIND_RAVINE, "Deadwind Ravine" }, { AREA_DIAMONDHEAD_RIVER, "Diamondhead River" }, { AREA_ARIDENS_CAMP, "Aridens Camp" }, { AREA_THE_VICE, "The Vice" }, { AREA_KARAZHAN, "Karazhan" }, { AREA_MORGANS_PLOT, "Morgans Plot" }, { AREA_DIRE_MAUL1, "Dire Maul1" }, { AREA_ALTERAC_VALLEY0, "Alterac Valley0" }, { AREA_SCRABBLESCREWS_CAMP, "Scrabblescrews Camp" }, { AREA_JADEFIRE_RUN, "Jadefire Run" }, { AREA_THONDRORIL_RIVER0, "Thondroril River0" }, { AREA_THONDRORIL_RIVER1, "Thondroril River1" }, { AREA_LAKE_MERELDAR, "Lake Mereldar" }, { AREA_PESTILENT_SCAR, "Pestilent Scar" }, { AREA_THE_INFECTIS_SCAR, "The Infectis Scar" }, { AREA_BLACKWOOD_LAKE, "Blackwood Lake" }, { AREA_EASTWALL_GATE, "Eastwall Gate" }, { AREA_TERRORWEB_TUNNEL, "Terrorweb Tunnel" }, { AREA_TERRORDALE, "Terrordale" }, { AREA_KARGATHIA_KEEP, "Kargathia Keep" }, { AREA_VALLEY_OF_BONES, "Valley Of Bones" }, { AREA_BLACKWING_LAIR, "Blackwing Lair" }, { AREA_DEADMANS_CROSSING, "Deadmans Crossing" }, { AREA_MOLTEN_CORE, "Molten Core" }, { AREA_THE_SCARAB_WALL, "The Scarab Wall" }, { AREA_SOUTHWIND_VILLAGE, "Southwind Village" }, { AREA_TWILIGHT_BASE_CAMP, "Twilight Base Camp" }, { AREA_THE_CRYSTAL_VALE, "The Crystal Vale" }, { AREA_THE_SCARAB_DAIS, "The Scarab Dais" }, { AREA_HIVE_ASHI, "Hive Ashi" }, { AREA_HIVE_ZORA, "Hive Zora" }, { AREA_HIVE_REGAL, "Hive Regal" }, { AREA_SHRINE_OF_THE_FALLEN_WARRIOR, "Shrine Of The Fallen Warrior" }, { AREA_UNUSED_ALTERAC_VALLEY, "Unused Alterac Valley" }, { AREA_BLACKFATHOM_DEEPS1, "Blackfathom Deeps1" }, { AREA_ON_MAP_DUNGEON4, "On Map Dungeon4" }, { AREA_THE_MASTERS_CELLAR, "The Masters Cellar" }, { AREA_STONEWROUGHT_PASS, "Stonewrought Pass" }, { AREA_ALTERAC_VALLEY1, "Alterac Valley1" }, { AREA_THE_RUMBLE_CAGE, "The Rumble Cage" }, { AREA_CHUNK_TEST, "Chunk Test" }, { AREA_ZORAMGAR_OUTPOST, "Zoramgar Outpost" }, { AREA_HALL_OF_LEGENDS, "Hall Of Legends" }, { AREA_CHAMPIONS_HALL, "Champions Hall" }, { AREA_GROSH_GOK_COMPOUND, "Grosh Gok Compound" }, { AREA_SLEEPING_GORGE, "Sleeping Gorge" }, { AREA_IRONDEEP_MINE, "Irondeep Mine" }, { AREA_STONEHEARTH_OUTPOST, "Stonehearth Outpost" }, { AREA_DUN_BALDAR, "Dun Baldar" }, { AREA_ICEWING_PASS, "Icewing Pass" }, { AREA_FROSTWOLF_VILLAGE, "Frostwolf Village" }, { AREA_TOWER_POINT, "Tower Point" }, { AREA_COLDTOOTH_MINE, "Coldtooth Mine" }, { AREA_WINTERAX_HOLD, "Winterax Hold" }, { AREA_ICEBLOOD_GARRISON, "Iceblood Garrison" }, { AREA_FROSTWOLF_KEEP, "Frostwolf Keep" }, { AREA_TOR_KREN_FARM, "Tor Kren Farm" }, { AREA_FROST_DAGGER_PASS, "Frost Dagger Pass" }, { AREA_IRONSTONE_CAMP, "Ironstone Camp" }, { AREA_WEAZELS_CRATER, "Weazels Crater" }, { AREA_TAHONDA_RUINS, "Tahonda Ruins" }, { AREA_FIELD_OF_STRIFE, "Field Of Strife" }, { AREA_ICEWING_CAVERN, "Icewing Cavern" }, { AREA_VALORS_REST, "Valors Rest" }, { AREA_THE_SWARMING_PILLAR, "The Swarming Pillar" }, { AREA_TWILIGHT_POST, "Twilight Post" }, { AREA_TWILIGHT_OUTPOST, "Twilight Outpost" }, { AREA_RAVAGED_TWILIGHT_CAMP, "Ravaged Twilight Camp" }, { AREA_SHALZARUS_LAIR, "Shalzarus Lair" }, { AREA_TALRENDIS_POINT, "Talrendis Point" }, { AREA_RETHRESS_SANCTUM, "Rethress Sanctum" }, { AREA_MOON_HORROR_DEN, "Moon Horror Den" }, { AREA_SCALEBEARDS_CAVE, "Scalebeards Cave" }, { AREA_BOULDERSLIDE_CAVERN, "Boulderslide Cavern" }, { AREA_WARSONG_LABOR_CAMP, "Warsong Labor Camp" }, { AREA_CHILLWIND_CAMP, "Chillwind Camp" }, { AREA_THE_MAUL, "The Maul" }, { AREA_THE_MAUL_UNUSED, "The Maul Unused" }, { AREA_BONES_OF_GRAKKAROND, "Bones Of Grakkarond" }, { AREA_WARSONG_GULCH, "Warsong Gulch" }, { AREA_FROSTWOLF_GRAVEYARD, "Frostwolf Graveyard" }, { AREA_FROSTWOLF_PASS, "Frostwolf Pass" }, { AREA_DUN_BALDAR_PASS, "Dun Baldar Pass" }, { AREA_ICEBLOOD_GRAVEYARD, "Iceblood Graveyard" }, { AREA_SNOWFALL_GRAVEYARD, "Snowfall Graveyard" }, { AREA_STONEHEARTH_GRAVEYARD, "Stonehearth Graveyard" }, { AREA_STORMPIKE_GRAVEYARD, "Stormpike Graveyard" }, { AREA_ICEWING_BUNKER, "Icewing Bunker" }, { AREA_STONEHEARTH_BUNKER, "Stonehearth Bunker" }, { AREA_WILDPAW_RIDGE, "Wildpaw Ridge" }, { AREA_REVANTUSK_VILLAGE, "Revantusk Village" }, { AREA_ROCK_OF_DUROTAN, "Rock Of Durotan" }, { AREA_SILVERWING_GROVE, "Silverwing Grove" }, { AREA_WARSONG_LUMBER_MILL, "Warsong Lumber Mill" }, { AREA_SILVERWING_HOLD, "Silverwing Hold" }, { AREA_WILDPAW_CAVERN, "Wildpaw Cavern" }, { AREA_THE_VEILED_CLEFT, "The Veiled Cleft" }, { AREA_YOJAMBA_ISLE, "Yojamba Isle" }, { AREA_ARATHI_BASIN, "Arathi Basin" }, { AREA_THE_COIL, "The Coil" }, { AREA_ALTAR_OF_HIR_EEK, "Altar Of Hir Eek" }, { AREA_SHADRA_ZAAR, "Shadra Zaar" }, { AREA_HAKKARI_GROUNDS, "Hakkari Grounds" }, { AREA_NAZE_OF_SHIRVALLAH, "Naze Of Shirvallah" }, { AREA_TEMPLE_OF_BETHEKK, "Temple Of Bethekk" }, { AREA_THE_BLOODFIRE_PIT, "The Bloodfire Pit" }, { AREA_ALTAR_OF_THE_BLOOD_GOD, "Altar Of The Blood God" }, { AREA_ZANZAS_RISE, "Zanzas Rise" }, { AREA_EDGE_OF_MADNESS, "Edge Of Madness" }, { AREA_TROLLBANE_HALL, "Trollbane Hall" }, { AREA_DEFILERS_DEN, "Defilers Den" }, { AREA_PAGLES_POINTE, "Pagles Pointe" }, { AREA_FARM, "Farm" }, { AREA_BLACKSMITH, "Blacksmith" }, { AREA_LUMBER_MILL, "Lumber Mill" }, { AREA_GOLD_MINE, "Gold Mine" }, { AREA_STABLES, "Stables" }, { AREA_CENARION_HOLD, "Cenarion Hold" }, { AREA_STAGHELM_POINT, "Staghelm Point" }, { AREA_BRONZEBEARD_ENCAMPMENT, "Bronzebeard Encampment" }, { AREA_AHN_QIRAJ, "Ahn Qiraj" }, { AREA_RUINS_OF_AHN_QIRAJ0, "Ruins Of Ahn Qiraj0" }, { AREA_TWILIGHTS_RUN, "Twilights Run" }, { AREA_ORTELLS_HIDEOUT, "Ortells Hideout" }, { AREA_SCARAB_TERRACE, "Scarab Terrace" }, { AREA_GENERALS_TERRACE, "Generals Terrace" }, { AREA_THE_RESERVOIR, "The Reservoir" }, { AREA_THE_HATCHERY, "The Hatchery" }, { AREA_THE_COMB, "The Comb" }, { AREA_WATCHERS_TERRACE, "Watchers Terrace" }, { AREA_RUINS_OF_AHN_QIRAJ1, "Ruins Of Ahn Qiraj1" }, { AREA_NAXXRAMAS, "Naxxramas" }, { AREA_CITY, "City" }, { AREA_GATES_OF_AHN_QIRAJ, "Gates Of Ahn Qiraj" }, { AREA_RAVENHOLDT_MANOR, "Ravenholdt Manor" }, { 0, NULL } }; typedef enum { MAP_EASTERN_KINGDOMS = 0x000, MAP_KALIMDOR = 0x001, MAP_TESTING = 0x00D, MAP_SCOTT_TEST = 0x019, MAP_CASH_TEST = 0x01D, MAP_ALTERAC_VALLEY = 0x01E, MAP_SHADOWFANG_KEEP = 0x021, MAP_STORMWIND_STOCKADE = 0x022, MAP_STORMWIND_PRISON = 0x023, MAP_DEADMINES = 0x024, MAP_AZSHARA_CRATER = 0x025, MAP_COLLINS_TEST = 0x02A, MAP_WAILING_CAVERNS = 0x02B, MAP_MONASTERY_UNUSED = 0x02C, MAP_RAZORFEN_KRAUL = 0x02F, MAP_BLACKFATHOM_DEEPS = 0x030, MAP_ULDAMAN = 0x046, MAP_GNOMEREGAN = 0x05A, MAP_SUNKEN_TEMPLE = 0x06D, MAP_RAZORFEN_DOWNS = 0x081, MAP_EMERALD_DREAM = 0x0A9, MAP_SCARLET_MONASTERY = 0x0BD, MAP_ZUL_FARRAK = 0x0D1, MAP_BLACKROCK_SPIRE = 0x0E5, MAP_BLACKROCK_DEPTHS = 0x0E6, MAP_ONYXIAS_LAIR = 0x0F9, MAP_OPENING_OF_THE_DARK_PORTAL = 0x10D, MAP_SCHOLOMANCE = 0x121, MAP_ZUL_GURUB = 0x135, MAP_STRATHOLME = 0x149, MAP_MARAUDON = 0x15D, MAP_DEEPRUN_TRAM = 0x171, MAP_RAGEFIRE_CHASM = 0x185, MAP_MOLTEN_CORE = 0x199, MAP_DIRE_MAUL = 0x1AD, MAP_ALLIANCE_PVP_BARRACKS = 0x1C1, MAP_HORDE_PVP_BARRACKS = 0x1C2, MAP_DEVELOPMENT_LAND = 0x1C3, MAP_BLACKWING_LAIR = 0x1D5, MAP_WARSONG_GULCH = 0x1E9, MAP_RUINS_OF_AHN_QIRAJ = 0x1FD, MAP_ARATHI_BASIN = 0x211, MAP_AHN_QIRAJ_TEMPLE = 0x213, MAP_NAXXRAMAS = 0x215, } e_map; static const value_string e_map_strings[] = { { MAP_EASTERN_KINGDOMS, "Eastern Kingdoms" }, { MAP_KALIMDOR, "Kalimdor" }, { MAP_TESTING, "Testing" }, { MAP_SCOTT_TEST, "Scott Test" }, { MAP_CASH_TEST, "Cash Test" }, { MAP_ALTERAC_VALLEY, "Alterac Valley" }, { MAP_SHADOWFANG_KEEP, "Shadowfang Keep" }, { MAP_STORMWIND_STOCKADE, "Stormwind Stockade" }, { MAP_STORMWIND_PRISON, "Stormwind Prison" }, { MAP_DEADMINES, "Deadmines" }, { MAP_AZSHARA_CRATER, "Azshara Crater" }, { MAP_COLLINS_TEST, "Collins Test" }, { MAP_WAILING_CAVERNS, "Wailing Caverns" }, { MAP_MONASTERY_UNUSED, "Monastery Unused" }, { MAP_RAZORFEN_KRAUL, "Razorfen Kraul" }, { MAP_BLACKFATHOM_DEEPS, "Blackfathom Deeps" }, { MAP_ULDAMAN, "Uldaman" }, { MAP_GNOMEREGAN, "Gnomeregan" }, { MAP_SUNKEN_TEMPLE, "Sunken Temple" }, { MAP_RAZORFEN_DOWNS, "Razorfen Downs" }, { MAP_EMERALD_DREAM, "Emerald Dream" }, { MAP_SCARLET_MONASTERY, "Scarlet Monastery" }, { MAP_ZUL_FARRAK, "Zul Farrak" }, { MAP_BLACKROCK_SPIRE, "Blackrock Spire" }, { MAP_BLACKROCK_DEPTHS, "Blackrock Depths" }, { MAP_ONYXIAS_LAIR, "Onyxias Lair" }, { MAP_OPENING_OF_THE_DARK_PORTAL, "Opening Of The Dark Portal" }, { MAP_SCHOLOMANCE, "Scholomance" }, { MAP_ZUL_GURUB, "Zul Gurub" }, { MAP_STRATHOLME, "Stratholme" }, { MAP_MARAUDON, "Maraudon" }, { MAP_DEEPRUN_TRAM, "Deeprun Tram" }, { MAP_RAGEFIRE_CHASM, "Ragefire Chasm" }, { MAP_MOLTEN_CORE, "Molten Core" }, { MAP_DIRE_MAUL, "Dire Maul" }, { MAP_ALLIANCE_PVP_BARRACKS, "Alliance Pvp Barracks" }, { MAP_HORDE_PVP_BARRACKS, "Horde Pvp Barracks" }, { MAP_DEVELOPMENT_LAND, "Development Land" }, { MAP_BLACKWING_LAIR, "Blackwing Lair" }, { MAP_WARSONG_GULCH, "Warsong Gulch" }, { MAP_RUINS_OF_AHN_QIRAJ, "Ruins Of Ahn Qiraj" }, { MAP_ARATHI_BASIN, "Arathi Basin" }, { MAP_AHN_QIRAJ_TEMPLE, "Ahn Qiraj Temple" }, { MAP_NAXXRAMAS, "Naxxramas" }, { 0, NULL } }; typedef enum { CREATURE_FAMILY_NONE = 0x00, CREATURE_FAMILY_WOLF = 0x01, CREATURE_FAMILY_CAT = 0x02, CREATURE_FAMILY_SPIDER = 0x03, CREATURE_FAMILY_BEAR = 0x04, CREATURE_FAMILY_BOAR = 0x05, CREATURE_FAMILY_CROCOLISK = 0x06, CREATURE_FAMILY_CARRION_BIRD = 0x07, CREATURE_FAMILY_CRAB = 0x08, CREATURE_FAMILY_GORILLA = 0x09, CREATURE_FAMILY_RAPTOR = 0x0B, CREATURE_FAMILY_TALLSTRIDER = 0x0C, CREATURE_FAMILY_FELHUNTER = 0x0F, CREATURE_FAMILY_VOIDWALKER = 0x10, CREATURE_FAMILY_SUCCUBUS = 0x11, CREATURE_FAMILY_DOOMGUARD = 0x13, CREATURE_FAMILY_SCORPID = 0x14, CREATURE_FAMILY_TURTLE = 0x15, CREATURE_FAMILY_IMP = 0x17, CREATURE_FAMILY_BAT = 0x18, CREATURE_FAMILY_HYENA = 0x19, CREATURE_FAMILY_OWL = 0x1A, CREATURE_FAMILY_WIND_SERPENT = 0x1B, CREATURE_FAMILY_REMOTE_CONTROL = 0x1C, } e_creature_family; static const value_string e_creature_family_strings[] = { { CREATURE_FAMILY_NONE, "None" }, { CREATURE_FAMILY_WOLF, "Wolf" }, { CREATURE_FAMILY_CAT, "Cat" }, { CREATURE_FAMILY_SPIDER, "Spider" }, { CREATURE_FAMILY_BEAR, "Bear" }, { CREATURE_FAMILY_BOAR, "Boar" }, { CREATURE_FAMILY_CROCOLISK, "Crocolisk" }, { CREATURE_FAMILY_CARRION_BIRD, "Carrion Bird" }, { CREATURE_FAMILY_CRAB, "Crab" }, { CREATURE_FAMILY_GORILLA, "Gorilla" }, { CREATURE_FAMILY_RAPTOR, "Raptor" }, { CREATURE_FAMILY_TALLSTRIDER, "Tallstrider" }, { CREATURE_FAMILY_FELHUNTER, "Felhunter" }, { CREATURE_FAMILY_VOIDWALKER, "Voidwalker" }, { CREATURE_FAMILY_SUCCUBUS, "Succubus" }, { CREATURE_FAMILY_DOOMGUARD, "Doomguard" }, { CREATURE_FAMILY_SCORPID, "Scorpid" }, { CREATURE_FAMILY_TURTLE, "Turtle" }, { CREATURE_FAMILY_IMP, "Imp" }, { CREATURE_FAMILY_BAT, "Bat" }, { CREATURE_FAMILY_HYENA, "Hyena" }, { CREATURE_FAMILY_OWL, "Owl" }, { CREATURE_FAMILY_WIND_SERPENT, "Wind Serpent" }, { CREATURE_FAMILY_REMOTE_CONTROL, "Remote Control" }, { 0, NULL } }; typedef enum { INVENTORY_TYPE_NON_EQUIP = 0x00, INVENTORY_TYPE_HEAD = 0x01, INVENTORY_TYPE_NECK = 0x02, INVENTORY_TYPE_SHOULDERS = 0x03, INVENTORY_TYPE_BODY = 0x04, INVENTORY_TYPE_CHEST = 0x05, INVENTORY_TYPE_WAIST = 0x06, INVENTORY_TYPE_LEGS = 0x07, INVENTORY_TYPE_FEET = 0x08, INVENTORY_TYPE_WRISTS = 0x09, INVENTORY_TYPE_HANDS = 0x0A, INVENTORY_TYPE_FINGER = 0x0B, INVENTORY_TYPE_TRINKET = 0x0C, INVENTORY_TYPE_WEAPON = 0x0D, INVENTORY_TYPE_SHIELD = 0x0E, INVENTORY_TYPE_RANGED = 0x0F, INVENTORY_TYPE_CLOAK = 0x10, INVENTORY_TYPE_TWO_HANDED_WEAPON = 0x11, INVENTORY_TYPE_BAG = 0x12, INVENTORY_TYPE_TABARD = 0x13, INVENTORY_TYPE_ROBE = 0x14, INVENTORY_TYPE_WEAPON_MAIN_HAND = 0x15, INVENTORY_TYPE_WEAPON_OFF_HAND = 0x16, INVENTORY_TYPE_HOLDABLE = 0x17, INVENTORY_TYPE_AMMO = 0x18, INVENTORY_TYPE_THROWN = 0x19, INVENTORY_TYPE_RANGED_RIGHT = 0x1A, INVENTORY_TYPE_QUIVER = 0x1B, INVENTORY_TYPE_RELIC = 0x1C, } e_inventory_type; static const value_string e_inventory_type_strings[] = { { INVENTORY_TYPE_NON_EQUIP, "Non Equip" }, { INVENTORY_TYPE_HEAD, "Head" }, { INVENTORY_TYPE_NECK, "Neck" }, { INVENTORY_TYPE_SHOULDERS, "Shoulders" }, { INVENTORY_TYPE_BODY, "Body" }, { INVENTORY_TYPE_CHEST, "Chest" }, { INVENTORY_TYPE_WAIST, "Waist" }, { INVENTORY_TYPE_LEGS, "Legs" }, { INVENTORY_TYPE_FEET, "Feet" }, { INVENTORY_TYPE_WRISTS, "Wrists" }, { INVENTORY_TYPE_HANDS, "Hands" }, { INVENTORY_TYPE_FINGER, "Finger" }, { INVENTORY_TYPE_TRINKET, "Trinket" }, { INVENTORY_TYPE_WEAPON, "Weapon" }, { INVENTORY_TYPE_SHIELD, "Shield" }, { INVENTORY_TYPE_RANGED, "Ranged" }, { INVENTORY_TYPE_CLOAK, "Cloak" }, { INVENTORY_TYPE_TWO_HANDED_WEAPON, "Two Handed Weapon" }, { INVENTORY_TYPE_BAG, "Bag" }, { INVENTORY_TYPE_TABARD, "Tabard" }, { INVENTORY_TYPE_ROBE, "Robe" }, { INVENTORY_TYPE_WEAPON_MAIN_HAND, "Weapon Main Hand" }, { INVENTORY_TYPE_WEAPON_OFF_HAND, "Weapon Off Hand" }, { INVENTORY_TYPE_HOLDABLE, "Holdable" }, { INVENTORY_TYPE_AMMO, "Ammo" }, { INVENTORY_TYPE_THROWN, "Thrown" }, { INVENTORY_TYPE_RANGED_RIGHT, "Ranged Right" }, { INVENTORY_TYPE_QUIVER, "Quiver" }, { INVENTORY_TYPE_RELIC, "Relic" }, { 0, NULL } }; typedef enum { COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE = 0x0DD, COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE_TRANSPORT = 0x2AE, COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_SET_RUN_SPEED = 0x2FE, COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_UNROOT = 0x304, COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x30D, COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x30E, } e_compressed_move_opcode; static const value_string e_compressed_move_opcode_strings[] = { { COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE, "Smsg Monster Move" }, { COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE_TRANSPORT, "Smsg Monster Move Transport" }, { COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_SET_RUN_SPEED, "Smsg Spline Set Run Speed" }, { COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_UNROOT, "Smsg Spline Move Unroot" }, { COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_SET_RUN_MODE, "Smsg Spline Move Set Run Mode" }, { COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_MOVE_SET_WALK_MODE, "Smsg Spline Move Set Walk Mode" }, { 0, NULL } }; typedef enum { FACTION_NONE = 0x000, FACTION_PLAYER_HUMAN = 0x001, FACTION_PLAYER_ORC = 0x002, FACTION_PLAYER_DWARF = 0x003, FACTION_PLAYER_NIGHT_ELF = 0x004, FACTION_PLAYER_UNDEAD = 0x005, FACTION_PLAYER_TAUREN = 0x006, FACTION_CREATURE = 0x007, FACTION_PLAYER_GNOME = 0x008, FACTION_PLAYER_TROLL = 0x009, FACTION_MONSTER = 0x00E, FACTION_DEFIAS_BROTHERHOOD = 0x00F, FACTION_GNOLL_RIVERPAW = 0x010, FACTION_GNOLL_REDRIDGE = 0x011, FACTION_GNOLL_SHADOWHIDE = 0x012, FACTION_MURLOC = 0x013, FACTION_UNDEAD_SCOURGE = 0x014, FACTION_BOOTY_BAY = 0x015, FACTION_BEAST_SPIDER = 0x016, FACTION_BEAST_BOAR = 0x017, FACTION_WORGEN = 0x018, FACTION_KOBOLD = 0x019, FACTION_TROLL_BLOODSCALP = 0x01A, FACTION_TROLL_SKULLSPLITTER = 0x01B, FACTION_PREY = 0x01C, FACTION_BEAST_WOLF = 0x01D, FACTION_DEFIAS_BROTHERHOOD_TRAITOR = 0x01E, FACTION_FRIENDLY = 0x01F, FACTION_TROGG = 0x020, FACTION_TROLL_FROSTMANE = 0x021, FACTION_ORC_BLACKROCK = 0x022, FACTION_VILLIAN = 0x023, FACTION_VICTIM = 0x024, FACTION_BEAST_BEAR = 0x025, FACTION_OGRE = 0x026, FACTION_KURZENS_MERCENARIES = 0x027, FACTION_ESCORTEE = 0x028, FACTION_VENTURE_COMPANY = 0x029, FACTION_BEAST_RAPTOR = 0x02A, FACTION_BASILISK = 0x02B, FACTION_DRAGONFLIGHT_GREEN = 0x02C, FACTION_LOST_ONES = 0x02D, FACTION_BLACKSMITHING_ARMORSMITHING = 0x02E, FACTION_IRONFORGE = 0x02F, FACTION_DARK_IRON_DWARVES = 0x030, FACTION_HUMAN_NIGHT_WATCH = 0x031, FACTION_DRAGONFLIGHT_RED = 0x032, FACTION_GNOLL_MOSSHIDE = 0x033, FACTION_ORC_DRAGONMAW = 0x034, FACTION_GNOME_LEPER = 0x035, FACTION_GNOMEREGAN_EXILES = 0x036, FACTION_LEOPARD = 0x037, FACTION_SCARLET_CRUSADE = 0x038, FACTION_GNOLL_ROTHIDE = 0x039, FACTION_BEAST_GORILLA = 0x03A, FACTION_THORIUM_BROTHERHOOD = 0x03B, FACTION_NAGA = 0x03C, FACTION_DALARAN = 0x03D, FACTION_FORLORN_SPIRIT = 0x03E, FACTION_DARKHOWL = 0x03F, FACTION_GRELL = 0x040, FACTION_FURBOLG = 0x041, FACTION_HORDE_GENERIC = 0x042, FACTION_HORDE = 0x043, FACTION_UNDERCITY = 0x044, FACTION_DARNASSUS = 0x045, FACTION_SYNDICATE = 0x046, FACTION_HILLSBRAD_MILITIA = 0x047, FACTION_STORMWIND = 0x048, FACTION_DEMON = 0x049, FACTION_ELEMENTAL = 0x04A, FACTION_SPIRIT = 0x04B, FACTION_ORGRIMMAR = 0x04C, FACTION_TREASURE = 0x04D, FACTION_GNOLL_MUDSNOUT = 0x04E, FACTION_HILLSBRAD_SOUTHSHORE_MAYOR = 0x04F, FACTION_DRAGONFLIGHT_BLACK = 0x050, FACTION_THUNDER_BLUFF = 0x051, FACTION_TROLL_WITHERBARK = 0x052, FACTION_LEATHERWORKING_ELEMENTAL = 0x053, FACTION_QUILBOAR_RAZORMANE = 0x054, FACTION_QUILBOAR_BRISTLEBACK = 0x055, FACTION_LEATHERWORKING_DRAGONSCALE = 0x056, FACTION_BLOODSAIL_BUCCANEERS = 0x057, FACTION_BLACKFATHOM = 0x058, FACTION_MAKRURA = 0x059, FACTION_CENTAUR_KOLKAR = 0x05A, FACTION_CENTAUR_GALAK = 0x05B, FACTION_GELKIS_CLAN_CENTAUR = 0x05C, FACTION_MAGRAM_CLAN_CENTAUR = 0x05D, FACTION_MARAUDINE = 0x05E, FACTION_THERAMORE = 0x06C, FACTION_QUILBOAR_RAZORFEN = 0x06D, FACTION_QUILBOAR_RAZORMANE_2 = 0x06E, FACTION_QUILBOAR_DEATHSHEAD = 0x06F, FACTION_ENEMY = 0x080, FACTION_AMBIENT = 0x094, FACTION_NETHERGARDE_CARAVAN = 0x0A8, FACTION_STEAMWHEEDLE_CARTEL = 0x0A9, FACTION_ALLIANCE_GENERIC = 0x0BD, FACTION_NETHERGARDE = 0x0D1, FACTION_WAILING_CAVERNS = 0x0E5, FACTION_SILITHID = 0x0F9, FACTION_SILVERMOON_REMNANT = 0x10D, FACTION_ZANDALAR_TRIBE = 0x10E, FACTION_BLACKSMITHING_WEAPONSMITHING = 0x121, FACTION_SCORPID = 0x135, FACTION_BEAST_BAT = 0x136, FACTION_TITAN = 0x137, FACTION_TASKMASTER_FIZZULE = 0x149, FACTION_RAVENHOLDT = 0x15D, FACTION_GADGETZAN = 0x171, FACTION_GNOMEREGAN_BUG = 0x185, FACTION_HARPY = 0x199, FACTION_BURNING_BLADE = 0x1AD, FACTION_SHADOWSILK_POACHER = 0x1C1, FACTION_SEARING_SPIDER = 0x1C2, FACTION_ALLIANCE = 0x1D5, FACTION_RATCHET = 0x1D6, FACTION_WILDHAMMER_CLAN = 0x1D7, FACTION_GOBLIN_DARK_IRON_BAR_PATRON = 0x1E9, FACTION_THE_LEAGUE_OF_ARATHOR = 0x1FD, FACTION_THE_DEFILERS = 0x1FE, FACTION_GIANT = 0x1FF, FACTION_ARGENT_DAWN = 0x211, FACTION_DARKSPEAR_TROLLS = 0x212, FACTION_DRAGONFLIGHT_BRONZE = 0x213, FACTION_DRAGONFLIGHT_BLUE = 0x214, FACTION_LEATHERWORKING_TRIBAL = 0x225, FACTION_ENGINEERING_GOBLIN = 0x226, FACTION_ENGINEERING_GNOME = 0x227, FACTION_BLACKSMITHING_HAMMERSMITHING = 0x239, FACTION_BLACKSMITHING_AXESMITHING = 0x23A, FACTION_BLACKSMITHING_SWORDSMITHING = 0x23B, FACTION_TROLL_VILEBRANCH = 0x23C, FACTION_SOUTHSEA_FREEBOOTERS = 0x23D, FACTION_CAER_DARROW = 0x23E, FACTION_FURBOLG_UNCORRUPTED = 0x23F, FACTION_TIMBERMAW_HOLD = 0x240, FACTION_EVERLOOK = 0x241, FACTION_WINTERSABER_TRAINERS = 0x24D, FACTION_CENARION_CIRCLE = 0x261, FACTION_SHATTERSPEAR_TROLLS = 0x275, FACTION_RAVASAUR_TRAINERS = 0x276, FACTION_MAJORDOMO_EXECUTUS = 0x289, FACTION_BEAST_CARRION_BIRD = 0x29D, FACTION_BEAST_CAT = 0x29E, FACTION_BEAST_CRAB = 0x29F, FACTION_BEAST_CROCILISK = 0x2A0, FACTION_BEAST_HYENA = 0x2A1, FACTION_BEAST_OWL = 0x2A2, FACTION_BEAST_SCORPID = 0x2A3, FACTION_BEAST_TALLSTRIDER = 0x2A4, FACTION_BEAST_TURTLE = 0x2A5, FACTION_BEAST_WIND_SERPENT = 0x2A6, FACTION_TRAINING_DUMMY = 0x2A7, FACTION_DRAGONFLIGHT_BLACK_BAIT = 0x2B1, FACTION_BATTLEGROUND_NEUTRAL = 0x2C5, FACTION_FROSTWOLF_CLAN = 0x2D9, FACTION_STORMPIKE_GUARD = 0x2DA, FACTION_HYDRAXIAN_WATERLORDS = 0x2ED, FACTION_SULFURON_FIRELORDS = 0x2EE, FACTION_GIZLOCKS_DUMMY = 0x301, FACTION_GIZLOCKS_CHARM = 0x302, FACTION_GIZLOCK = 0x303, FACTION_MORO_GAI = 0x315, FACTION_SPIRIT_GUIDE_ALLIANCE = 0x316, FACTION_SHEN_DRALAR = 0x329, FACTION_OGRE_CAPTAIN_KROMCRUSH = 0x33D, FACTION_SPIRIT_GUIDE_HORDE = 0x351, FACTION_JAEDENAR = 0x365, FACTION_WARSONG_OUTRIDERS = 0x379, FACTION_SILVERWING_SENTINELS = 0x37A, FACTION_ALLIANCE_FORCES = 0x37B, FACTION_HORDE_FORCES = 0x37C, FACTION_REVANTUSK_TROLLS = 0x37D, FACTION_DARKMOON_FAIRE = 0x38D, FACTION_BROOD_OF_NOZDORMU = 0x38E, FACTION_MIGHT_OF_KALIMDOR = 0x390, FACTION_ARMIES_OF_C_THUN = 0x393, FACTION_SILITHID_ATTACKERS = 0x394, FACTION_THE_IRONFORGE_BRIGADE = 0x395, FACTION_RC_ENEMIES = 0x396, FACTION_RC_OBJECTS = 0x397, FACTION_RED = 0x398, FACTION_BLUE = 0x399, FACTION_SCOURGE_INVADERS = 0x3A0, FACTION_TEST_FACTION_NOT_A_REAL_FACTION = 0x3A3, FACTION_TOWOW_FLAG = 0x3B6, FACTION_TOWOW_FLAG_TRIGGER_ALLIANCE_DND = 0x3B7, FACTION_TOWOW_FLAG_TRIGGER_HORDE_DND = 0x3BA, } e_faction; static const value_string e_faction_strings[] = { { FACTION_NONE, "None" }, { FACTION_PLAYER_HUMAN, "Player Human" }, { FACTION_PLAYER_ORC, "Player Orc" }, { FACTION_PLAYER_DWARF, "Player Dwarf" }, { FACTION_PLAYER_NIGHT_ELF, "Player Night Elf" }, { FACTION_PLAYER_UNDEAD, "Player Undead" }, { FACTION_PLAYER_TAUREN, "Player Tauren" }, { FACTION_CREATURE, "Creature" }, { FACTION_PLAYER_GNOME, "Player Gnome" }, { FACTION_PLAYER_TROLL, "Player Troll" }, { FACTION_MONSTER, "Monster" }, { FACTION_DEFIAS_BROTHERHOOD, "Defias Brotherhood" }, { FACTION_GNOLL_RIVERPAW, "Gnoll Riverpaw" }, { FACTION_GNOLL_REDRIDGE, "Gnoll Redridge" }, { FACTION_GNOLL_SHADOWHIDE, "Gnoll Shadowhide" }, { FACTION_MURLOC, "Murloc" }, { FACTION_UNDEAD_SCOURGE, "Undead Scourge" }, { FACTION_BOOTY_BAY, "Booty Bay" }, { FACTION_BEAST_SPIDER, "Beast Spider" }, { FACTION_BEAST_BOAR, "Beast Boar" }, { FACTION_WORGEN, "Worgen" }, { FACTION_KOBOLD, "Kobold" }, { FACTION_TROLL_BLOODSCALP, "Troll Bloodscalp" }, { FACTION_TROLL_SKULLSPLITTER, "Troll Skullsplitter" }, { FACTION_PREY, "Prey" }, { FACTION_BEAST_WOLF, "Beast Wolf" }, { FACTION_DEFIAS_BROTHERHOOD_TRAITOR, "Defias Brotherhood Traitor" }, { FACTION_FRIENDLY, "Friendly" }, { FACTION_TROGG, "Trogg" }, { FACTION_TROLL_FROSTMANE, "Troll Frostmane" }, { FACTION_ORC_BLACKROCK, "Orc Blackrock" }, { FACTION_VILLIAN, "Villian" }, { FACTION_VICTIM, "Victim" }, { FACTION_BEAST_BEAR, "Beast Bear" }, { FACTION_OGRE, "Ogre" }, { FACTION_KURZENS_MERCENARIES, "Kurzens Mercenaries" }, { FACTION_ESCORTEE, "Escortee" }, { FACTION_VENTURE_COMPANY, "Venture Company" }, { FACTION_BEAST_RAPTOR, "Beast Raptor" }, { FACTION_BASILISK, "Basilisk" }, { FACTION_DRAGONFLIGHT_GREEN, "Dragonflight Green" }, { FACTION_LOST_ONES, "Lost Ones" }, { FACTION_BLACKSMITHING_ARMORSMITHING, "Blacksmithing Armorsmithing" }, { FACTION_IRONFORGE, "Ironforge" }, { FACTION_DARK_IRON_DWARVES, "Dark Iron Dwarves" }, { FACTION_HUMAN_NIGHT_WATCH, "Human Night Watch" }, { FACTION_DRAGONFLIGHT_RED, "Dragonflight Red" }, { FACTION_GNOLL_MOSSHIDE, "Gnoll Mosshide" }, { FACTION_ORC_DRAGONMAW, "Orc Dragonmaw" }, { FACTION_GNOME_LEPER, "Gnome Leper" }, { FACTION_GNOMEREGAN_EXILES, "Gnomeregan Exiles" }, { FACTION_LEOPARD, "Leopard" }, { FACTION_SCARLET_CRUSADE, "Scarlet Crusade" }, { FACTION_GNOLL_ROTHIDE, "Gnoll Rothide" }, { FACTION_BEAST_GORILLA, "Beast Gorilla" }, { FACTION_THORIUM_BROTHERHOOD, "Thorium Brotherhood" }, { FACTION_NAGA, "Naga" }, { FACTION_DALARAN, "Dalaran" }, { FACTION_FORLORN_SPIRIT, "Forlorn Spirit" }, { FACTION_DARKHOWL, "Darkhowl" }, { FACTION_GRELL, "Grell" }, { FACTION_FURBOLG, "Furbolg" }, { FACTION_HORDE_GENERIC, "Horde Generic" }, { FACTION_HORDE, "Horde" }, { FACTION_UNDERCITY, "Undercity" }, { FACTION_DARNASSUS, "Darnassus" }, { FACTION_SYNDICATE, "Syndicate" }, { FACTION_HILLSBRAD_MILITIA, "Hillsbrad Militia" }, { FACTION_STORMWIND, "Stormwind" }, { FACTION_DEMON, "Demon" }, { FACTION_ELEMENTAL, "Elemental" }, { FACTION_SPIRIT, "Spirit" }, { FACTION_ORGRIMMAR, "Orgrimmar" }, { FACTION_TREASURE, "Treasure" }, { FACTION_GNOLL_MUDSNOUT, "Gnoll Mudsnout" }, { FACTION_HILLSBRAD_SOUTHSHORE_MAYOR, "Hillsbrad Southshore Mayor" }, { FACTION_DRAGONFLIGHT_BLACK, "Dragonflight Black" }, { FACTION_THUNDER_BLUFF, "Thunder Bluff" }, { FACTION_TROLL_WITHERBARK, "Troll Witherbark" }, { FACTION_LEATHERWORKING_ELEMENTAL, "Leatherworking Elemental" }, { FACTION_QUILBOAR_RAZORMANE, "Quilboar Razormane" }, { FACTION_QUILBOAR_BRISTLEBACK, "Quilboar Bristleback" }, { FACTION_LEATHERWORKING_DRAGONSCALE, "Leatherworking Dragonscale" }, { FACTION_BLOODSAIL_BUCCANEERS, "Bloodsail Buccaneers" }, { FACTION_BLACKFATHOM, "Blackfathom" }, { FACTION_MAKRURA, "Makrura" }, { FACTION_CENTAUR_KOLKAR, "Centaur Kolkar" }, { FACTION_CENTAUR_GALAK, "Centaur Galak" }, { FACTION_GELKIS_CLAN_CENTAUR, "Gelkis Clan Centaur" }, { FACTION_MAGRAM_CLAN_CENTAUR, "Magram Clan Centaur" }, { FACTION_MARAUDINE, "Maraudine" }, { FACTION_THERAMORE, "Theramore" }, { FACTION_QUILBOAR_RAZORFEN, "Quilboar Razorfen" }, { FACTION_QUILBOAR_RAZORMANE_2, "Quilboar Razormane 2" }, { FACTION_QUILBOAR_DEATHSHEAD, "Quilboar Deathshead" }, { FACTION_ENEMY, "Enemy" }, { FACTION_AMBIENT, "Ambient" }, { FACTION_NETHERGARDE_CARAVAN, "Nethergarde Caravan" }, { FACTION_STEAMWHEEDLE_CARTEL, "Steamwheedle Cartel" }, { FACTION_ALLIANCE_GENERIC, "Alliance Generic" }, { FACTION_NETHERGARDE, "Nethergarde" }, { FACTION_WAILING_CAVERNS, "Wailing Caverns" }, { FACTION_SILITHID, "Silithid" }, { FACTION_SILVERMOON_REMNANT, "Silvermoon Remnant" }, { FACTION_ZANDALAR_TRIBE, "Zandalar Tribe" }, { FACTION_BLACKSMITHING_WEAPONSMITHING, "Blacksmithing Weaponsmithing" }, { FACTION_SCORPID, "Scorpid" }, { FACTION_BEAST_BAT, "Beast Bat" }, { FACTION_TITAN, "Titan" }, { FACTION_TASKMASTER_FIZZULE, "Taskmaster Fizzule" }, { FACTION_RAVENHOLDT, "Ravenholdt" }, { FACTION_GADGETZAN, "Gadgetzan" }, { FACTION_GNOMEREGAN_BUG, "Gnomeregan Bug" }, { FACTION_HARPY, "Harpy" }, { FACTION_BURNING_BLADE, "Burning Blade" }, { FACTION_SHADOWSILK_POACHER, "Shadowsilk Poacher" }, { FACTION_SEARING_SPIDER, "Searing Spider" }, { FACTION_ALLIANCE, "Alliance" }, { FACTION_RATCHET, "Ratchet" }, { FACTION_WILDHAMMER_CLAN, "Wildhammer Clan" }, { FACTION_GOBLIN_DARK_IRON_BAR_PATRON, "Goblin Dark Iron Bar Patron" }, { FACTION_THE_LEAGUE_OF_ARATHOR, "The League Of Arathor" }, { FACTION_THE_DEFILERS, "The Defilers" }, { FACTION_GIANT, "Giant" }, { FACTION_ARGENT_DAWN, "Argent Dawn" }, { FACTION_DARKSPEAR_TROLLS, "Darkspear Trolls" }, { FACTION_DRAGONFLIGHT_BRONZE, "Dragonflight Bronze" }, { FACTION_DRAGONFLIGHT_BLUE, "Dragonflight Blue" }, { FACTION_LEATHERWORKING_TRIBAL, "Leatherworking Tribal" }, { FACTION_ENGINEERING_GOBLIN, "Engineering Goblin" }, { FACTION_ENGINEERING_GNOME, "Engineering Gnome" }, { FACTION_BLACKSMITHING_HAMMERSMITHING, "Blacksmithing Hammersmithing" }, { FACTION_BLACKSMITHING_AXESMITHING, "Blacksmithing Axesmithing" }, { FACTION_BLACKSMITHING_SWORDSMITHING, "Blacksmithing Swordsmithing" }, { FACTION_TROLL_VILEBRANCH, "Troll Vilebranch" }, { FACTION_SOUTHSEA_FREEBOOTERS, "Southsea Freebooters" }, { FACTION_CAER_DARROW, "Caer Darrow" }, { FACTION_FURBOLG_UNCORRUPTED, "Furbolg Uncorrupted" }, { FACTION_TIMBERMAW_HOLD, "Timbermaw Hold" }, { FACTION_EVERLOOK, "Everlook" }, { FACTION_WINTERSABER_TRAINERS, "Wintersaber Trainers" }, { FACTION_CENARION_CIRCLE, "Cenarion Circle" }, { FACTION_SHATTERSPEAR_TROLLS, "Shatterspear Trolls" }, { FACTION_RAVASAUR_TRAINERS, "Ravasaur Trainers" }, { FACTION_MAJORDOMO_EXECUTUS, "Majordomo Executus" }, { FACTION_BEAST_CARRION_BIRD, "Beast Carrion Bird" }, { FACTION_BEAST_CAT, "Beast Cat" }, { FACTION_BEAST_CRAB, "Beast Crab" }, { FACTION_BEAST_CROCILISK, "Beast Crocilisk" }, { FACTION_BEAST_HYENA, "Beast Hyena" }, { FACTION_BEAST_OWL, "Beast Owl" }, { FACTION_BEAST_SCORPID, "Beast Scorpid" }, { FACTION_BEAST_TALLSTRIDER, "Beast Tallstrider" }, { FACTION_BEAST_TURTLE, "Beast Turtle" }, { FACTION_BEAST_WIND_SERPENT, "Beast Wind Serpent" }, { FACTION_TRAINING_DUMMY, "Training Dummy" }, { FACTION_DRAGONFLIGHT_BLACK_BAIT, "Dragonflight Black Bait" }, { FACTION_BATTLEGROUND_NEUTRAL, "Battleground Neutral" }, { FACTION_FROSTWOLF_CLAN, "Frostwolf Clan" }, { FACTION_STORMPIKE_GUARD, "Stormpike Guard" }, { FACTION_HYDRAXIAN_WATERLORDS, "Hydraxian Waterlords" }, { FACTION_SULFURON_FIRELORDS, "Sulfuron Firelords" }, { FACTION_GIZLOCKS_DUMMY, "Gizlocks Dummy" }, { FACTION_GIZLOCKS_CHARM, "Gizlocks Charm" }, { FACTION_GIZLOCK, "Gizlock" }, { FACTION_MORO_GAI, "Moro Gai" }, { FACTION_SPIRIT_GUIDE_ALLIANCE, "Spirit Guide Alliance" }, { FACTION_SHEN_DRALAR, "Shen Dralar" }, { FACTION_OGRE_CAPTAIN_KROMCRUSH, "Ogre Captain Kromcrush" }, { FACTION_SPIRIT_GUIDE_HORDE, "Spirit Guide Horde" }, { FACTION_JAEDENAR, "Jaedenar" }, { FACTION_WARSONG_OUTRIDERS, "Warsong Outriders" }, { FACTION_SILVERWING_SENTINELS, "Silverwing Sentinels" }, { FACTION_ALLIANCE_FORCES, "Alliance Forces" }, { FACTION_HORDE_FORCES, "Horde Forces" }, { FACTION_REVANTUSK_TROLLS, "Revantusk Trolls" }, { FACTION_DARKMOON_FAIRE, "Darkmoon Faire" }, { FACTION_BROOD_OF_NOZDORMU, "Brood Of Nozdormu" }, { FACTION_MIGHT_OF_KALIMDOR, "Might Of Kalimdor" }, { FACTION_ARMIES_OF_C_THUN, "Armies Of C Thun" }, { FACTION_SILITHID_ATTACKERS, "Silithid Attackers" }, { FACTION_THE_IRONFORGE_BRIGADE, "The Ironforge Brigade" }, { FACTION_RC_ENEMIES, "Rc Enemies" }, { FACTION_RC_OBJECTS, "Rc Objects" }, { FACTION_RED, "Red" }, { FACTION_BLUE, "Blue" }, { FACTION_SCOURGE_INVADERS, "Scourge Invaders" }, { FACTION_TEST_FACTION_NOT_A_REAL_FACTION, "Test Faction Not A Real Faction" }, { FACTION_TOWOW_FLAG, "Towow Flag" }, { FACTION_TOWOW_FLAG_TRIGGER_ALLIANCE_DND, "Towow Flag Trigger Alliance Dnd" }, { FACTION_TOWOW_FLAG_TRIGGER_HORDE_DND, "Towow Flag Trigger Horde Dnd" }, { 0, NULL } }; typedef enum { FRIEND_STATUS_OFFLINE = 0x0, FRIEND_STATUS_ONLINE = 0x1, FRIEND_STATUS_AFK = 0x2, FRIEND_STATUS_UNKNOWN3 = 0x3, FRIEND_STATUS_DND = 0x4, } e_friend_status; static const value_string e_friend_status_strings[] = { { FRIEND_STATUS_OFFLINE, "Offline" }, { FRIEND_STATUS_ONLINE, "Online" }, { FRIEND_STATUS_AFK, "Afk" }, { FRIEND_STATUS_UNKNOWN3, "Unknown3" }, { FRIEND_STATUS_DND, "Dnd" }, { 0, NULL } }; typedef enum { GUILD_MEMBER_STATUS_OFFLINE = 0x0, GUILD_MEMBER_STATUS_ONLINE = 0x1, } e_guild_member_status; static const value_string e_guild_member_status_strings[] = { { GUILD_MEMBER_STATUS_OFFLINE, "Offline" }, { GUILD_MEMBER_STATUS_ONLINE, "Online" }, { 0, NULL } }; typedef enum { SPELL_TRIGGER_TYPE_ON_USE = 0x0, SPELL_TRIGGER_TYPE_ON_EQUIP = 0x1, SPELL_TRIGGER_TYPE_CHANCE_ON_HIT = 0x2, } e_spell_trigger_type; static const value_string e_spell_trigger_type_strings[] = { { SPELL_TRIGGER_TYPE_ON_USE, "On Use" }, { SPELL_TRIGGER_TYPE_ON_EQUIP, "On Equip" }, { SPELL_TRIGGER_TYPE_CHANCE_ON_HIT, "Chance On Hit" }, { 0, NULL } }; typedef enum { ITEM_STAT_TYPE_MANA = 0x0, ITEM_STAT_TYPE_HEALTH = 0x1, ITEM_STAT_TYPE_AGILITY = 0x3, ITEM_STAT_TYPE_STRENGTH = 0x4, ITEM_STAT_TYPE_INTELLECT = 0x5, ITEM_STAT_TYPE_SPIRIT = 0x6, ITEM_STAT_TYPE_STAMINA = 0x7, } e_item_stat_type; static const value_string e_item_stat_type_strings[] = { { ITEM_STAT_TYPE_MANA, "Mana" }, { ITEM_STAT_TYPE_HEALTH, "Health" }, { ITEM_STAT_TYPE_AGILITY, "Agility" }, { ITEM_STAT_TYPE_STRENGTH, "Strength" }, { ITEM_STAT_TYPE_INTELLECT, "Intellect" }, { ITEM_STAT_TYPE_SPIRIT, "Spirit" }, { ITEM_STAT_TYPE_STAMINA, "Stamina" }, { 0, NULL } }; typedef enum { LOOT_SLOT_TYPE_TYPE_ALLOW_LOOT = 0x0, LOOT_SLOT_TYPE_TYPE_ROLL_ONGOING = 0x1, LOOT_SLOT_TYPE_TYPE_MASTER = 0x2, LOOT_SLOT_TYPE_TYPE_LOCKED = 0x3, LOOT_SLOT_TYPE_TYPE_OWNER = 0x4, } e_loot_slot_type; static const value_string e_loot_slot_type_strings[] = { { LOOT_SLOT_TYPE_TYPE_ALLOW_LOOT, "Type Allow Loot" }, { LOOT_SLOT_TYPE_TYPE_ROLL_ONGOING, "Type Roll Ongoing" }, { LOOT_SLOT_TYPE_TYPE_MASTER, "Type Master" }, { LOOT_SLOT_TYPE_TYPE_LOCKED, "Type Locked" }, { LOOT_SLOT_TYPE_TYPE_OWNER, "Type Owner" }, { 0, NULL } }; typedef enum { MAIL_TYPE_NORMAL = 0x0, MAIL_TYPE_AUCTION = 0x2, MAIL_TYPE_CREATURE = 0x3, MAIL_TYPE_GAMEOBJECT = 0x4, MAIL_TYPE_ITEM = 0x5, } e_mail_type; static const value_string e_mail_type_strings[] = { { MAIL_TYPE_NORMAL, "Normal" }, { MAIL_TYPE_AUCTION, "Auction" }, { MAIL_TYPE_CREATURE, "Creature" }, { MAIL_TYPE_GAMEOBJECT, "Gameobject" }, { MAIL_TYPE_ITEM, "Item" }, { 0, NULL } }; typedef enum { MONSTER_MOVE_TYPE_NORMAL = 0x0, MONSTER_MOVE_TYPE_STOP = 0x1, MONSTER_MOVE_TYPE_FACING_SPOT = 0x2, MONSTER_MOVE_TYPE_FACING_TARGET = 0x3, MONSTER_MOVE_TYPE_FACING_ANGLE = 0x4, } e_monster_move_type; static const value_string e_monster_move_type_strings[] = { { MONSTER_MOVE_TYPE_NORMAL, "Normal" }, { MONSTER_MOVE_TYPE_STOP, "Stop" }, { MONSTER_MOVE_TYPE_FACING_SPOT, "Facing Spot" }, { MONSTER_MOVE_TYPE_FACING_TARGET, "Facing Target" }, { MONSTER_MOVE_TYPE_FACING_ANGLE, "Facing Angle" }, { 0, NULL } }; typedef enum { LANGUAGE_UNIVERSAL = 0x00000000, LANGUAGE_ORCISH = 0x00000001, LANGUAGE_DARNASSIAN = 0x00000002, LANGUAGE_TAURAHE = 0x00000003, LANGUAGE_DWARVISH = 0x00000006, LANGUAGE_COMMON = 0x00000007, LANGUAGE_DEMONIC = 0x00000008, LANGUAGE_TITAN = 0x00000009, LANGUAGE_THALASSIAN = 0x0000000A, LANGUAGE_DRACONIC = 0x0000000B, LANGUAGE_KALIMAG = 0x0000000C, LANGUAGE_GNOMISH = 0x0000000D, LANGUAGE_TROLL = 0x0000000E, LANGUAGE_GUTTERSPEAK = 0x00000021, LANGUAGE_ADDON = -0x0000001, } e_language; static const value_string e_language_strings[] = { { LANGUAGE_UNIVERSAL, "Universal" }, { LANGUAGE_ORCISH, "Orcish" }, { LANGUAGE_DARNASSIAN, "Darnassian" }, { LANGUAGE_TAURAHE, "Taurahe" }, { LANGUAGE_DWARVISH, "Dwarvish" }, { LANGUAGE_COMMON, "Common" }, { LANGUAGE_DEMONIC, "Demonic" }, { LANGUAGE_TITAN, "Titan" }, { LANGUAGE_THALASSIAN, "Thalassian" }, { LANGUAGE_DRACONIC, "Draconic" }, { LANGUAGE_KALIMAG, "Kalimag" }, { LANGUAGE_GNOMISH, "Gnomish" }, { LANGUAGE_TROLL, "Troll" }, { LANGUAGE_GUTTERSPEAK, "Gutterspeak" }, { LANGUAGE_ADDON, "Addon" }, { 0, NULL } }; typedef enum { UPDATE_TYPE_VALUES = 0x0, UPDATE_TYPE_MOVEMENT = 0x1, UPDATE_TYPE_CREATE_OBJECT = 0x2, UPDATE_TYPE_CREATE_OBJECT2 = 0x3, UPDATE_TYPE_OUT_OF_RANGE_OBJECTS = 0x4, UPDATE_TYPE_NEAR_OBJECTS = 0x5, } e_update_type; static const value_string e_update_type_strings[] = { { UPDATE_TYPE_VALUES, "Values" }, { UPDATE_TYPE_MOVEMENT, "Movement" }, { UPDATE_TYPE_CREATE_OBJECT, "Create Object" }, { UPDATE_TYPE_CREATE_OBJECT2, "Create Object2" }, { UPDATE_TYPE_OUT_OF_RANGE_OBJECTS, "Out Of Range Objects" }, { UPDATE_TYPE_NEAR_OBJECTS, "Near Objects" }, { 0, NULL } }; typedef enum { OBJECT_TYPE_OBJECT = 0x0, OBJECT_TYPE_ITEM = 0x1, OBJECT_TYPE_CONTAINER = 0x2, OBJECT_TYPE_UNIT = 0x3, OBJECT_TYPE_PLAYER = 0x4, OBJECT_TYPE_GAME_OBJECT = 0x5, OBJECT_TYPE_DYNAMIC_OBJECT = 0x6, OBJECT_TYPE_CORPSE = 0x7, } e_object_type; static const value_string e_object_type_strings[] = { { OBJECT_TYPE_OBJECT, "Object" }, { OBJECT_TYPE_ITEM, "Item" }, { OBJECT_TYPE_CONTAINER, "Container" }, { OBJECT_TYPE_UNIT, "Unit" }, { OBJECT_TYPE_PLAYER, "Player" }, { OBJECT_TYPE_GAME_OBJECT, "Game Object" }, { OBJECT_TYPE_DYNAMIC_OBJECT, "Dynamic Object" }, { OBJECT_TYPE_CORPSE, "Corpse" }, { 0, NULL } }; typedef enum { RAID_TARGET_INDEX_UNKNOWN0 = 0x00, RAID_TARGET_INDEX_UNKNOWN1 = 0x01, RAID_TARGET_INDEX_UNKNOWN2 = 0x02, RAID_TARGET_INDEX_UNKNOWN3 = 0x03, RAID_TARGET_INDEX_UNKNOWN4 = 0x04, RAID_TARGET_INDEX_UNKNOWN5 = 0x05, RAID_TARGET_INDEX_UNKNOWN6 = 0x06, RAID_TARGET_INDEX_UNKNOWN7 = 0x07, RAID_TARGET_INDEX_UNKNOWN8 = 0x08, RAID_TARGET_INDEX_REQUEST_ICONS = 0xFF, } e_raid_target_index; static const value_string e_raid_target_index_strings[] = { { RAID_TARGET_INDEX_UNKNOWN0, "Unknown0" }, { RAID_TARGET_INDEX_UNKNOWN1, "Unknown1" }, { RAID_TARGET_INDEX_UNKNOWN2, "Unknown2" }, { RAID_TARGET_INDEX_UNKNOWN3, "Unknown3" }, { RAID_TARGET_INDEX_UNKNOWN4, "Unknown4" }, { RAID_TARGET_INDEX_UNKNOWN5, "Unknown5" }, { RAID_TARGET_INDEX_UNKNOWN6, "Unknown6" }, { RAID_TARGET_INDEX_UNKNOWN7, "Unknown7" }, { RAID_TARGET_INDEX_UNKNOWN8, "Unknown8" }, { RAID_TARGET_INDEX_REQUEST_ICONS, "Request Icons" }, { 0, NULL } }; typedef enum { SPELL_EFFECT_NONE = 0x00, SPELL_EFFECT_INSTAKILL = 0x01, SPELL_EFFECT_SCHOOL_DAMAGE = 0x02, SPELL_EFFECT_DUMMY = 0x03, SPELL_EFFECT_PORTAL_TELEPORT = 0x04, SPELL_EFFECT_TELEPORT_UNITS = 0x05, SPELL_EFFECT_APPLY_AURA = 0x06, SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 0x07, SPELL_EFFECT_POWER_DRAIN = 0x08, SPELL_EFFECT_HEALTH_LEECH = 0x09, SPELL_EFFECT_HEAL = 0x0A, SPELL_EFFECT_BIND = 0x0B, SPELL_EFFECT_PORTAL = 0x0C, SPELL_EFFECT_RITUAL_BASE = 0x0D, SPELL_EFFECT_RITUAL_SPECIALIZE = 0x0E, SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 0x0F, SPELL_EFFECT_QUEST_COMPLETE = 0x10, SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 0x11, SPELL_EFFECT_RESURRECT = 0x12, SPELL_EFFECT_ADD_EXTRA_ATTACKS = 0x13, SPELL_EFFECT_DODGE = 0x14, SPELL_EFFECT_EVADE = 0x15, SPELL_EFFECT_PARRY = 0x16, SPELL_EFFECT_BLOCK = 0x17, SPELL_EFFECT_CREATE_ITEM = 0x18, SPELL_EFFECT_WEAPON = 0x19, SPELL_EFFECT_DEFENSE = 0x1A, SPELL_EFFECT_PERSISTENT_AREA_AURA = 0x1B, SPELL_EFFECT_SUMMON = 0x1C, SPELL_EFFECT_LEAP = 0x1D, SPELL_EFFECT_ENERGIZE = 0x1E, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE = 0x1F, SPELL_EFFECT_TRIGGER_MISSILE = 0x20, SPELL_EFFECT_OPEN_LOCK = 0x21, SPELL_EFFECT_SUMMON_CHANGE_ITEM = 0x22, SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 0x23, SPELL_EFFECT_LEARN_SPELL = 0x24, SPELL_EFFECT_SPELL_DEFENSE = 0x25, SPELL_EFFECT_DISPEL = 0x26, SPELL_EFFECT_LANGUAGE = 0x27, SPELL_EFFECT_DUAL_WIELD = 0x28, SPELL_EFFECT_SUMMON_WILD = 0x29, SPELL_EFFECT_SUMMON_GUARDIAN = 0x2A, SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 0x2B, SPELL_EFFECT_SKILL_STEP = 0x2C, SPELL_EFFECT_ADD_HONOR = 0x2D, SPELL_EFFECT_SPAWN = 0x2E, SPELL_EFFECT_TRADE_SKILL = 0x2F, SPELL_EFFECT_STEALTH = 0x30, SPELL_EFFECT_DETECT = 0x31, SPELL_EFFECT_TRANS_DOOR = 0x32, SPELL_EFFECT_FORCE_CRITICAL_HIT = 0x33, SPELL_EFFECT_GUARANTEE_HIT = 0x34, SPELL_EFFECT_ENCHANT_ITEM = 0x35, SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 0x36, SPELL_EFFECT_TAMECREATURE = 0x37, SPELL_EFFECT_SUMMON_PET = 0x38, SPELL_EFFECT_LEARN_PET_SPELL = 0x39, SPELL_EFFECT_WEAPON_DAMAGE = 0x3A, SPELL_EFFECT_OPEN_LOCK_ITEM = 0x3B, SPELL_EFFECT_PROFICIENCY = 0x3C, SPELL_EFFECT_SEND_EVENT = 0x3D, SPELL_EFFECT_POWER_BURN = 0x3E, SPELL_EFFECT_THREAT = 0x3F, SPELL_EFFECT_TRIGGER_SPELL = 0x40, SPELL_EFFECT_HEALTH_FUNNEL = 0x41, SPELL_EFFECT_POWER_FUNNEL = 0x42, SPELL_EFFECT_HEAL_MAX_HEALTH = 0x43, SPELL_EFFECT_INTERRUPT_CAST = 0x44, SPELL_EFFECT_DISTRACT = 0x45, SPELL_EFFECT_PULL = 0x46, SPELL_EFFECT_PICKPOCKET = 0x47, SPELL_EFFECT_ADD_FARSIGHT = 0x48, SPELL_EFFECT_SUMMON_POSSESSED = 0x49, SPELL_EFFECT_SUMMON_TOTEM = 0x4A, SPELL_EFFECT_HEAL_MECHANICAL = 0x4B, SPELL_EFFECT_SUMMON_OBJECT_WILD = 0x4C, SPELL_EFFECT_SCRIPT_EFFECT = 0x4D, SPELL_EFFECT_ATTACK = 0x4E, SPELL_EFFECT_SANCTUARY = 0x4F, SPELL_EFFECT_ADD_COMBO_POINTS = 0x50, SPELL_EFFECT_CREATE_HOUSE = 0x51, SPELL_EFFECT_BIND_SIGHT = 0x52, SPELL_EFFECT_DUEL = 0x53, SPELL_EFFECT_STUCK = 0x54, SPELL_EFFECT_SUMMON_PLAYER = 0x55, SPELL_EFFECT_ACTIVATE_OBJECT = 0x56, SPELL_EFFECT_SUMMON_TOTEM_SLOT1 = 0x57, SPELL_EFFECT_SUMMON_TOTEM_SLOT2 = 0x58, SPELL_EFFECT_SUMMON_TOTEM_SLOT3 = 0x59, SPELL_EFFECT_SUMMON_TOTEM_SLOT4 = 0x5A, SPELL_EFFECT_THREAT_ALL = 0x5B, SPELL_EFFECT_ENCHANT_HELD_ITEM = 0x5C, SPELL_EFFECT_SUMMON_PHANTASM = 0x5D, SPELL_EFFECT_SELF_RESURRECT = 0x5E, SPELL_EFFECT_SKINNING = 0x5F, SPELL_EFFECT_CHARGE = 0x60, SPELL_EFFECT_SUMMON_CRITTER = 0x61, SPELL_EFFECT_KNOCK_BACK = 0x62, SPELL_EFFECT_DISENCHANT = 0x63, SPELL_EFFECT_INEBRIATE = 0x64, SPELL_EFFECT_FEED_PET = 0x65, SPELL_EFFECT_DISMISS_PET = 0x66, SPELL_EFFECT_REPUTATION = 0x67, SPELL_EFFECT_SUMMON_OBJECT_SLOT1 = 0x68, SPELL_EFFECT_SUMMON_OBJECT_SLOT2 = 0x69, SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 0x6A, SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 0x6B, SPELL_EFFECT_DISPEL_MECHANIC = 0x6C, SPELL_EFFECT_SUMMON_DEAD_PET = 0x6D, SPELL_EFFECT_DESTROY_ALL_TOTEMS = 0x6E, SPELL_EFFECT_DURABILITY_DAMAGE = 0x6F, SPELL_EFFECT_SUMMON_DEMON = 0x70, SPELL_EFFECT_RESURRECT_NEW = 0x71, SPELL_EFFECT_ATTACK_ME = 0x72, SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 0x73, SPELL_EFFECT_SKIN_PLAYER_CORPSE = 0x74, SPELL_EFFECT_SPIRIT_HEAL = 0x75, SPELL_EFFECT_SKILL = 0x76, SPELL_EFFECT_APPLY_AREA_AURA_PET = 0x77, SPELL_EFFECT_TELEPORT_GRAVEYARD = 0x78, SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 0x79, SPELL_EFFECT_UNKNOWN122 = 0x7A, SPELL_EFFECT_SEND_TAXI = 0x7B, SPELL_EFFECT_PLAYER_PULL = 0x7C, SPELL_EFFECT_MODIFY_THREAT_PERCENT = 0x7D, SPELL_EFFECT_UNKNOWN126 = 0x7E, SPELL_EFFECT_UNKNOWN127 = 0x7F, } e_spell_effect; static const value_string e_spell_effect_strings[] = { { SPELL_EFFECT_NONE, "None" }, { SPELL_EFFECT_INSTAKILL, "Instakill" }, { SPELL_EFFECT_SCHOOL_DAMAGE, "School Damage" }, { SPELL_EFFECT_DUMMY, "Dummy" }, { SPELL_EFFECT_PORTAL_TELEPORT, "Portal Teleport" }, { SPELL_EFFECT_TELEPORT_UNITS, "Teleport Units" }, { SPELL_EFFECT_APPLY_AURA, "Apply Aura" }, { SPELL_EFFECT_ENVIRONMENTAL_DAMAGE, "Environmental Damage" }, { SPELL_EFFECT_POWER_DRAIN, "Power Drain" }, { SPELL_EFFECT_HEALTH_LEECH, "Health Leech" }, { SPELL_EFFECT_HEAL, "Heal" }, { SPELL_EFFECT_BIND, "Bind" }, { SPELL_EFFECT_PORTAL, "Portal" }, { SPELL_EFFECT_RITUAL_BASE, "Ritual Base" }, { SPELL_EFFECT_RITUAL_SPECIALIZE, "Ritual Specialize" }, { SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL, "Ritual Activate Portal" }, { SPELL_EFFECT_QUEST_COMPLETE, "Quest Complete" }, { SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, "Weapon Damage Noschool" }, { SPELL_EFFECT_RESURRECT, "Resurrect" }, { SPELL_EFFECT_ADD_EXTRA_ATTACKS, "Add Extra Attacks" }, { SPELL_EFFECT_DODGE, "Dodge" }, { SPELL_EFFECT_EVADE, "Evade" }, { SPELL_EFFECT_PARRY, "Parry" }, { SPELL_EFFECT_BLOCK, "Block" }, { SPELL_EFFECT_CREATE_ITEM, "Create Item" }, { SPELL_EFFECT_WEAPON, "Weapon" }, { SPELL_EFFECT_DEFENSE, "Defense" }, { SPELL_EFFECT_PERSISTENT_AREA_AURA, "Persistent Area Aura" }, { SPELL_EFFECT_SUMMON, "Summon" }, { SPELL_EFFECT_LEAP, "Leap" }, { SPELL_EFFECT_ENERGIZE, "Energize" }, { SPELL_EFFECT_WEAPON_PERCENT_DAMAGE, "Weapon Percent Damage" }, { SPELL_EFFECT_TRIGGER_MISSILE, "Trigger Missile" }, { SPELL_EFFECT_OPEN_LOCK, "Open Lock" }, { SPELL_EFFECT_SUMMON_CHANGE_ITEM, "Summon Change Item" }, { SPELL_EFFECT_APPLY_AREA_AURA_PARTY, "Apply Area Aura Party" }, { SPELL_EFFECT_LEARN_SPELL, "Learn Spell" }, { SPELL_EFFECT_SPELL_DEFENSE, "Spell Defense" }, { SPELL_EFFECT_DISPEL, "Dispel" }, { SPELL_EFFECT_LANGUAGE, "Language" }, { SPELL_EFFECT_DUAL_WIELD, "Dual Wield" }, { SPELL_EFFECT_SUMMON_WILD, "Summon Wild" }, { SPELL_EFFECT_SUMMON_GUARDIAN, "Summon Guardian" }, { SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER, "Teleport Units Face Caster" }, { SPELL_EFFECT_SKILL_STEP, "Skill Step" }, { SPELL_EFFECT_ADD_HONOR, "Add Honor" }, { SPELL_EFFECT_SPAWN, "Spawn" }, { SPELL_EFFECT_TRADE_SKILL, "Trade Skill" }, { SPELL_EFFECT_STEALTH, "Stealth" }, { SPELL_EFFECT_DETECT, "Detect" }, { SPELL_EFFECT_TRANS_DOOR, "Trans Door" }, { SPELL_EFFECT_FORCE_CRITICAL_HIT, "Force Critical Hit" }, { SPELL_EFFECT_GUARANTEE_HIT, "Guarantee Hit" }, { SPELL_EFFECT_ENCHANT_ITEM, "Enchant Item" }, { SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY, "Enchant Item Temporary" }, { SPELL_EFFECT_TAMECREATURE, "Tamecreature" }, { SPELL_EFFECT_SUMMON_PET, "Summon Pet" }, { SPELL_EFFECT_LEARN_PET_SPELL, "Learn Pet Spell" }, { SPELL_EFFECT_WEAPON_DAMAGE, "Weapon Damage" }, { SPELL_EFFECT_OPEN_LOCK_ITEM, "Open Lock Item" }, { SPELL_EFFECT_PROFICIENCY, "Proficiency" }, { SPELL_EFFECT_SEND_EVENT, "Send Event" }, { SPELL_EFFECT_POWER_BURN, "Power Burn" }, { SPELL_EFFECT_THREAT, "Threat" }, { SPELL_EFFECT_TRIGGER_SPELL, "Trigger Spell" }, { SPELL_EFFECT_HEALTH_FUNNEL, "Health Funnel" }, { SPELL_EFFECT_POWER_FUNNEL, "Power Funnel" }, { SPELL_EFFECT_HEAL_MAX_HEALTH, "Heal Max Health" }, { SPELL_EFFECT_INTERRUPT_CAST, "Interrupt Cast" }, { SPELL_EFFECT_DISTRACT, "Distract" }, { SPELL_EFFECT_PULL, "Pull" }, { SPELL_EFFECT_PICKPOCKET, "Pickpocket" }, { SPELL_EFFECT_ADD_FARSIGHT, "Add Farsight" }, { SPELL_EFFECT_SUMMON_POSSESSED, "Summon Possessed" }, { SPELL_EFFECT_SUMMON_TOTEM, "Summon Totem" }, { SPELL_EFFECT_HEAL_MECHANICAL, "Heal Mechanical" }, { SPELL_EFFECT_SUMMON_OBJECT_WILD, "Summon Object Wild" }, { SPELL_EFFECT_SCRIPT_EFFECT, "Script Effect" }, { SPELL_EFFECT_ATTACK, "Attack" }, { SPELL_EFFECT_SANCTUARY, "Sanctuary" }, { SPELL_EFFECT_ADD_COMBO_POINTS, "Add Combo Points" }, { SPELL_EFFECT_CREATE_HOUSE, "Create House" }, { SPELL_EFFECT_BIND_SIGHT, "Bind Sight" }, { SPELL_EFFECT_DUEL, "Duel" }, { SPELL_EFFECT_STUCK, "Stuck" }, { SPELL_EFFECT_SUMMON_PLAYER, "Summon Player" }, { SPELL_EFFECT_ACTIVATE_OBJECT, "Activate Object" }, { SPELL_EFFECT_SUMMON_TOTEM_SLOT1, "Summon Totem Slot1" }, { SPELL_EFFECT_SUMMON_TOTEM_SLOT2, "Summon Totem Slot2" }, { SPELL_EFFECT_SUMMON_TOTEM_SLOT3, "Summon Totem Slot3" }, { SPELL_EFFECT_SUMMON_TOTEM_SLOT4, "Summon Totem Slot4" }, { SPELL_EFFECT_THREAT_ALL, "Threat All" }, { SPELL_EFFECT_ENCHANT_HELD_ITEM, "Enchant Held Item" }, { SPELL_EFFECT_SUMMON_PHANTASM, "Summon Phantasm" }, { SPELL_EFFECT_SELF_RESURRECT, "Self Resurrect" }, { SPELL_EFFECT_SKINNING, "Skinning" }, { SPELL_EFFECT_CHARGE, "Charge" }, { SPELL_EFFECT_SUMMON_CRITTER, "Summon Critter" }, { SPELL_EFFECT_KNOCK_BACK, "Knock Back" }, { SPELL_EFFECT_DISENCHANT, "Disenchant" }, { SPELL_EFFECT_INEBRIATE, "Inebriate" }, { SPELL_EFFECT_FEED_PET, "Feed Pet" }, { SPELL_EFFECT_DISMISS_PET, "Dismiss Pet" }, { SPELL_EFFECT_REPUTATION, "Reputation" }, { SPELL_EFFECT_SUMMON_OBJECT_SLOT1, "Summon Object Slot1" }, { SPELL_EFFECT_SUMMON_OBJECT_SLOT2, "Summon Object Slot2" }, { SPELL_EFFECT_SUMMON_OBJECT_SLOT3, "Summon Object Slot3" }, { SPELL_EFFECT_SUMMON_OBJECT_SLOT4, "Summon Object Slot4" }, { SPELL_EFFECT_DISPEL_MECHANIC, "Dispel Mechanic" }, { SPELL_EFFECT_SUMMON_DEAD_PET, "Summon Dead Pet" }, { SPELL_EFFECT_DESTROY_ALL_TOTEMS, "Destroy All Totems" }, { SPELL_EFFECT_DURABILITY_DAMAGE, "Durability Damage" }, { SPELL_EFFECT_SUMMON_DEMON, "Summon Demon" }, { SPELL_EFFECT_RESURRECT_NEW, "Resurrect New" }, { SPELL_EFFECT_ATTACK_ME, "Attack Me" }, { SPELL_EFFECT_DURABILITY_DAMAGE_PCT, "Durability Damage Pct" }, { SPELL_EFFECT_SKIN_PLAYER_CORPSE, "Skin Player Corpse" }, { SPELL_EFFECT_SPIRIT_HEAL, "Spirit Heal" }, { SPELL_EFFECT_SKILL, "Skill" }, { SPELL_EFFECT_APPLY_AREA_AURA_PET, "Apply Area Aura Pet" }, { SPELL_EFFECT_TELEPORT_GRAVEYARD, "Teleport Graveyard" }, { SPELL_EFFECT_NORMALIZED_WEAPON_DMG, "Normalized Weapon Dmg" }, { SPELL_EFFECT_UNKNOWN122, "Unknown122" }, { SPELL_EFFECT_SEND_TAXI, "Send Taxi" }, { SPELL_EFFECT_PLAYER_PULL, "Player Pull" }, { SPELL_EFFECT_MODIFY_THREAT_PERCENT, "Modify Threat Percent" }, { SPELL_EFFECT_UNKNOWN126, "Unknown126" }, { SPELL_EFFECT_UNKNOWN127, "Unknown127" }, { 0, NULL } }; typedef enum { POWER_MANA = 0x00, POWER_RAGE = 0x01, POWER_FOCUS = 0x02, POWER_ENERGY = 0x03, POWER_HAPPINESS = 0x04, POWER_HEALTH = 0xFE, } e_power; static const value_string e_power_strings[] = { { POWER_MANA, "Mana" }, { POWER_RAGE, "Rage" }, { POWER_FOCUS, "Focus" }, { POWER_ENERGY, "Energy" }, { POWER_HAPPINESS, "Happiness" }, { POWER_HEALTH, "Health" }, { 0, NULL } }; typedef enum { SPELL_MISS_INFO_NONE = 0x0, SPELL_MISS_INFO_MISS = 0x1, SPELL_MISS_INFO_RESIST = 0x2, SPELL_MISS_INFO_DODGE = 0x3, SPELL_MISS_INFO_PARRY = 0x4, SPELL_MISS_INFO_BLOCK = 0x5, SPELL_MISS_INFO_EVADE = 0x6, SPELL_MISS_INFO_IMMUNE = 0x7, SPELL_MISS_INFO_IMMUNE2 = 0x8, SPELL_MISS_INFO_DEFLECT = 0x9, SPELL_MISS_INFO_ABSORB = 0xA, SPELL_MISS_INFO_REFLECT = 0xB, } e_spell_miss_info; static const value_string e_spell_miss_info_strings[] = { { SPELL_MISS_INFO_NONE, "None" }, { SPELL_MISS_INFO_MISS, "Miss" }, { SPELL_MISS_INFO_RESIST, "Resist" }, { SPELL_MISS_INFO_DODGE, "Dodge" }, { SPELL_MISS_INFO_PARRY, "Parry" }, { SPELL_MISS_INFO_BLOCK, "Block" }, { SPELL_MISS_INFO_EVADE, "Evade" }, { SPELL_MISS_INFO_IMMUNE, "Immune" }, { SPELL_MISS_INFO_IMMUNE2, "Immune2" }, { SPELL_MISS_INFO_DEFLECT, "Deflect" }, { SPELL_MISS_INFO_ABSORB, "Absorb" }, { SPELL_MISS_INFO_REFLECT, "Reflect" }, { 0, NULL } }; typedef enum { TRAINER_SPELL_STATE_GREEN = 0x0, TRAINER_SPELL_STATE_RED = 0x1, TRAINER_SPELL_STATE_GRAY = 0x2, } e_trainer_spell_state; static const value_string e_trainer_spell_state_strings[] = { { TRAINER_SPELL_STATE_GREEN, "Green" }, { TRAINER_SPELL_STATE_RED, "Red" }, { TRAINER_SPELL_STATE_GRAY, "Gray" }, { 0, NULL } }; typedef enum { SKILL_NONE = 0x000, SKILL_FROST = 0x006, SKILL_FIRE = 0x008, SKILL_ARMS = 0x01A, SKILL_COMBAT = 0x026, SKILL_SUBTLETY = 0x027, SKILL_POISONS = 0x028, SKILL_SWORDS = 0x02B, SKILL_AXES = 0x02C, SKILL_BOWS = 0x02D, SKILL_GUNS = 0x02E, SKILL_BEAST_MASTERY = 0x032, SKILL_SURVIVAL = 0x033, SKILL_MACES = 0x036, SKILL_TWO_HANDED_SWORDS = 0x037, SKILL_HOLY = 0x038, SKILL_SHADOW = 0x04E, SKILL_DEFENSE = 0x05F, SKILL_LANGUAGE_COMMON = 0x062, SKILL_RACIAL_DWARVEN = 0x065, SKILL_LANGUAGE_ORCISH = 0x06D, SKILL_LANGUAGE_DWARVEN = 0x06F, SKILL_LANGUAGE_DARNASSIAN = 0x071, SKILL_LANGUAGE_TAURAHE = 0x073, SKILL_DUAL_WIELD = 0x076, SKILL_RACIAL_TAUREN = 0x07C, SKILL_ORC_RACIAL = 0x07D, SKILL_RACIAL_NIGHT_ELF = 0x07E, SKILL_FIRST_AID = 0x081, SKILL_FERAL_COMBAT = 0x086, SKILL_STAVES = 0x088, SKILL_LANGUAGE_THALASSIAN = 0x089, SKILL_LANGUAGE_DRACONIC = 0x08A, SKILL_LANGUAGE_DEMON_TONGUE = 0x08B, SKILL_LANGUAGE_TITAN = 0x08C, SKILL_LANGUAGE_OLD_TONGUE = 0x08D, SKILL_SURVIVAL2 = 0x08E, SKILL_RIDING_HORSE = 0x094, SKILL_RIDING_WOLF = 0x095, SKILL_RIDING_TIGER = 0x096, SKILL_RIDING_RAM = 0x098, SKILL_SWIMING = 0x09B, SKILL_TWO_HANDED_MACES = 0x0A0, SKILL_UNARMED = 0x0A2, SKILL_MARKSMANSHIP = 0x0A3, SKILL_BLACKSMITHING = 0x0A4, SKILL_LEATHERWORKING = 0x0A5, SKILL_ALCHEMY = 0x0AB, SKILL_TWO_HANDED_AXES = 0x0AC, SKILL_DAGGERS = 0x0AD, SKILL_THROWN = 0x0B0, SKILL_HERBALISM = 0x0B6, SKILL_GENERIC_DND = 0x0B7, SKILL_RETRIBUTION = 0x0B8, SKILL_COOKING = 0x0B9, SKILL_MINING = 0x0BA, SKILL_PET_IMP = 0x0BC, SKILL_PET_FELHUNTER = 0x0BD, SKILL_TAILORING = 0x0C5, SKILL_ENGINEERING = 0x0CA, SKILL_PET_SPIDER = 0x0CB, SKILL_PET_VOIDWALKER = 0x0CC, SKILL_PET_SUCCUBUS = 0x0CD, SKILL_PET_INFERNAL = 0x0CE, SKILL_PET_DOOMGUARD = 0x0CF, SKILL_PET_WOLF = 0x0D0, SKILL_PET_CAT = 0x0D1, SKILL_PET_BEAR = 0x0D2, SKILL_PET_BOAR = 0x0D3, SKILL_PET_CROCILISK = 0x0D4, SKILL_PET_CARRION_BIRD = 0x0D5, SKILL_PET_CRAB = 0x0D6, SKILL_PET_GORILLA = 0x0D7, SKILL_PET_RAPTOR = 0x0D9, SKILL_PET_TALLSTRIDER = 0x0DA, SKILL_RACIAL_UNDED = 0x0DC, SKILL_CROSSBOWS = 0x0E2, SKILL_WANDS = 0x0E4, SKILL_POLEARMS = 0x0E5, SKILL_PET_SCORPID = 0x0EC, SKILL_ARCANE = 0x0ED, SKILL_PET_TURTLE = 0x0FB, SKILL_ASSASSINATION = 0x0FD, SKILL_FURY = 0x100, SKILL_PROTECTION = 0x101, SKILL_BEAST_TRAINING = 0x105, SKILL_PROTECTION2 = 0x10B, SKILL_PET_TALENTS = 0x10E, SKILL_PLATE_MAIL = 0x125, SKILL_LANGUAGE_GNOMISH = 0x139, SKILL_LANGUAGE_TROLL = 0x13B, SKILL_ENCHANTING = 0x14D, SKILL_DEMONOLOGY = 0x162, SKILL_AFFLICTION = 0x163, SKILL_FISHING = 0x164, SKILL_ENHANCEMENT = 0x175, SKILL_RESTORATION = 0x176, SKILL_ELEMENTAL_COMBAT = 0x177, SKILL_SKINNING = 0x189, SKILL_MAIL = 0x19D, SKILL_LEATHER = 0x19E, SKILL_CLOTH = 0x19F, SKILL_SHIELD = 0x1B1, SKILL_FIST_WEAPONS = 0x1D9, SKILL_RIDING_RAPTOR = 0x215, SKILL_RIDING_MECHANOSTRIDER = 0x229, SKILL_RIDING_UNDEAD_HORSE = 0x22A, SKILL_RESTORATION2 = 0x23D, SKILL_BALANCE = 0x23E, SKILL_DESTRUCTION = 0x251, SKILL_HOLY2 = 0x252, SKILL_DISCIPLINE = 0x265, SKILL_LOCKPICKING = 0x279, SKILL_PET_BAT = 0x28D, SKILL_PET_HYENA = 0x28E, SKILL_PET_OWL = 0x28F, SKILL_PET_WIND_SERPENT = 0x290, SKILL_LANGUAGE_GUTTERSPEAK = 0x2A1, SKILL_RIDING_KODO = 0x2C9, SKILL_RACIAL_TROLL = 0x2DD, SKILL_RACIAL_GNOME = 0x2F1, SKILL_RACIAL_HUMAN = 0x2F2, SKILL_PET_EVENT_RC = 0x2F6, SKILL_RIDING = 0x2FA, } e_skill; static const value_string e_skill_strings[] = { { SKILL_NONE, "None" }, { SKILL_FROST, "Frost" }, { SKILL_FIRE, "Fire" }, { SKILL_ARMS, "Arms" }, { SKILL_COMBAT, "Combat" }, { SKILL_SUBTLETY, "Subtlety" }, { SKILL_POISONS, "Poisons" }, { SKILL_SWORDS, "Swords" }, { SKILL_AXES, "Axes" }, { SKILL_BOWS, "Bows" }, { SKILL_GUNS, "Guns" }, { SKILL_BEAST_MASTERY, "Beast Mastery" }, { SKILL_SURVIVAL, "Survival" }, { SKILL_MACES, "Maces" }, { SKILL_TWO_HANDED_SWORDS, "Two Handed Swords" }, { SKILL_HOLY, "Holy" }, { SKILL_SHADOW, "Shadow" }, { SKILL_DEFENSE, "Defense" }, { SKILL_LANGUAGE_COMMON, "Language Common" }, { SKILL_RACIAL_DWARVEN, "Racial Dwarven" }, { SKILL_LANGUAGE_ORCISH, "Language Orcish" }, { SKILL_LANGUAGE_DWARVEN, "Language Dwarven" }, { SKILL_LANGUAGE_DARNASSIAN, "Language Darnassian" }, { SKILL_LANGUAGE_TAURAHE, "Language Taurahe" }, { SKILL_DUAL_WIELD, "Dual Wield" }, { SKILL_RACIAL_TAUREN, "Racial Tauren" }, { SKILL_ORC_RACIAL, "Orc Racial" }, { SKILL_RACIAL_NIGHT_ELF, "Racial Night Elf" }, { SKILL_FIRST_AID, "First Aid" }, { SKILL_FERAL_COMBAT, "Feral Combat" }, { SKILL_STAVES, "Staves" }, { SKILL_LANGUAGE_THALASSIAN, "Language Thalassian" }, { SKILL_LANGUAGE_DRACONIC, "Language Draconic" }, { SKILL_LANGUAGE_DEMON_TONGUE, "Language Demon Tongue" }, { SKILL_LANGUAGE_TITAN, "Language Titan" }, { SKILL_LANGUAGE_OLD_TONGUE, "Language Old Tongue" }, { SKILL_SURVIVAL2, "Survival2" }, { SKILL_RIDING_HORSE, "Riding Horse" }, { SKILL_RIDING_WOLF, "Riding Wolf" }, { SKILL_RIDING_TIGER, "Riding Tiger" }, { SKILL_RIDING_RAM, "Riding Ram" }, { SKILL_SWIMING, "Swiming" }, { SKILL_TWO_HANDED_MACES, "Two Handed Maces" }, { SKILL_UNARMED, "Unarmed" }, { SKILL_MARKSMANSHIP, "Marksmanship" }, { SKILL_BLACKSMITHING, "Blacksmithing" }, { SKILL_LEATHERWORKING, "Leatherworking" }, { SKILL_ALCHEMY, "Alchemy" }, { SKILL_TWO_HANDED_AXES, "Two Handed Axes" }, { SKILL_DAGGERS, "Daggers" }, { SKILL_THROWN, "Thrown" }, { SKILL_HERBALISM, "Herbalism" }, { SKILL_GENERIC_DND, "Generic Dnd" }, { SKILL_RETRIBUTION, "Retribution" }, { SKILL_COOKING, "Cooking" }, { SKILL_MINING, "Mining" }, { SKILL_PET_IMP, "Pet Imp" }, { SKILL_PET_FELHUNTER, "Pet Felhunter" }, { SKILL_TAILORING, "Tailoring" }, { SKILL_ENGINEERING, "Engineering" }, { SKILL_PET_SPIDER, "Pet Spider" }, { SKILL_PET_VOIDWALKER, "Pet Voidwalker" }, { SKILL_PET_SUCCUBUS, "Pet Succubus" }, { SKILL_PET_INFERNAL, "Pet Infernal" }, { SKILL_PET_DOOMGUARD, "Pet Doomguard" }, { SKILL_PET_WOLF, "Pet Wolf" }, { SKILL_PET_CAT, "Pet Cat" }, { SKILL_PET_BEAR, "Pet Bear" }, { SKILL_PET_BOAR, "Pet Boar" }, { SKILL_PET_CROCILISK, "Pet Crocilisk" }, { SKILL_PET_CARRION_BIRD, "Pet Carrion Bird" }, { SKILL_PET_CRAB, "Pet Crab" }, { SKILL_PET_GORILLA, "Pet Gorilla" }, { SKILL_PET_RAPTOR, "Pet Raptor" }, { SKILL_PET_TALLSTRIDER, "Pet Tallstrider" }, { SKILL_RACIAL_UNDED, "Racial Unded" }, { SKILL_CROSSBOWS, "Crossbows" }, { SKILL_WANDS, "Wands" }, { SKILL_POLEARMS, "Polearms" }, { SKILL_PET_SCORPID, "Pet Scorpid" }, { SKILL_ARCANE, "Arcane" }, { SKILL_PET_TURTLE, "Pet Turtle" }, { SKILL_ASSASSINATION, "Assassination" }, { SKILL_FURY, "Fury" }, { SKILL_PROTECTION, "Protection" }, { SKILL_BEAST_TRAINING, "Beast Training" }, { SKILL_PROTECTION2, "Protection2" }, { SKILL_PET_TALENTS, "Pet Talents" }, { SKILL_PLATE_MAIL, "Plate Mail" }, { SKILL_LANGUAGE_GNOMISH, "Language Gnomish" }, { SKILL_LANGUAGE_TROLL, "Language Troll" }, { SKILL_ENCHANTING, "Enchanting" }, { SKILL_DEMONOLOGY, "Demonology" }, { SKILL_AFFLICTION, "Affliction" }, { SKILL_FISHING, "Fishing" }, { SKILL_ENHANCEMENT, "Enhancement" }, { SKILL_RESTORATION, "Restoration" }, { SKILL_ELEMENTAL_COMBAT, "Elemental Combat" }, { SKILL_SKINNING, "Skinning" }, { SKILL_MAIL, "Mail" }, { SKILL_LEATHER, "Leather" }, { SKILL_CLOTH, "Cloth" }, { SKILL_SHIELD, "Shield" }, { SKILL_FIST_WEAPONS, "Fist Weapons" }, { SKILL_RIDING_RAPTOR, "Riding Raptor" }, { SKILL_RIDING_MECHANOSTRIDER, "Riding Mechanostrider" }, { SKILL_RIDING_UNDEAD_HORSE, "Riding Undead Horse" }, { SKILL_RESTORATION2, "Restoration2" }, { SKILL_BALANCE, "Balance" }, { SKILL_DESTRUCTION, "Destruction" }, { SKILL_HOLY2, "Holy2" }, { SKILL_DISCIPLINE, "Discipline" }, { SKILL_LOCKPICKING, "Lockpicking" }, { SKILL_PET_BAT, "Pet Bat" }, { SKILL_PET_HYENA, "Pet Hyena" }, { SKILL_PET_OWL, "Pet Owl" }, { SKILL_PET_WIND_SERPENT, "Pet Wind Serpent" }, { SKILL_LANGUAGE_GUTTERSPEAK, "Language Gutterspeak" }, { SKILL_RIDING_KODO, "Riding Kodo" }, { SKILL_RACIAL_TROLL, "Racial Troll" }, { SKILL_RACIAL_GNOME, "Racial Gnome" }, { SKILL_RACIAL_HUMAN, "Racial Human" }, { SKILL_PET_EVENT_RC, "Pet Event Rc" }, { SKILL_RIDING, "Riding" }, { 0, NULL } }; typedef enum { ITEM_QUALITY_POOR = 0x0, ITEM_QUALITY_NORMAL = 0x1, ITEM_QUALITY_UNCOMMON = 0x2, ITEM_QUALITY_RARE = 0x3, ITEM_QUALITY_EPIC = 0x4, ITEM_QUALITY_LEGENDARY = 0x5, ITEM_QUALITY_ARTIFACT = 0x6, } e_item_quality; static const value_string e_item_quality_strings[] = { { ITEM_QUALITY_POOR, "Poor" }, { ITEM_QUALITY_NORMAL, "Normal" }, { ITEM_QUALITY_UNCOMMON, "Uncommon" }, { ITEM_QUALITY_RARE, "Rare" }, { ITEM_QUALITY_EPIC, "Epic" }, { ITEM_QUALITY_LEGENDARY, "Legendary" }, { ITEM_QUALITY_ARTIFACT, "Artifact" }, { 0, NULL } }; typedef enum { BATTLEFIELD_PORT_ACTION_LEAVE_QUEUE = 0x0, BATTLEFIELD_PORT_ACTION_ENTER_BATTLE = 0x1, } e_battlefield_port_action; static const value_string e_battlefield_port_action_strings[] = { { BATTLEFIELD_PORT_ACTION_LEAVE_QUEUE, "Leave Queue" }, { BATTLEFIELD_PORT_ACTION_ENTER_BATTLE, "Enter Battle" }, { 0, NULL } }; typedef enum { BUYBACK_SLOT_SLOT1 = 0x45, BUYBACK_SLOT_SLOT2 = 0x46, BUYBACK_SLOT_SLOT3 = 0x47, BUYBACK_SLOT_SLOT4 = 0x48, BUYBACK_SLOT_SLOT5 = 0x49, BUYBACK_SLOT_SLOT6 = 0x4A, BUYBACK_SLOT_SLOT7 = 0x4B, BUYBACK_SLOT_SLOT8 = 0x4C, BUYBACK_SLOT_SLOT9 = 0x4D, BUYBACK_SLOT_SLOT10 = 0x4E, BUYBACK_SLOT_SLOT11 = 0x4F, BUYBACK_SLOT_SLOT12 = 0x50, BUYBACK_SLOT_SLOT13 = 0x51, } e_buyback_slot; static const value_string e_buyback_slot_strings[] = { { BUYBACK_SLOT_SLOT1, "Slot1" }, { BUYBACK_SLOT_SLOT2, "Slot2" }, { BUYBACK_SLOT_SLOT3, "Slot3" }, { BUYBACK_SLOT_SLOT4, "Slot4" }, { BUYBACK_SLOT_SLOT5, "Slot5" }, { BUYBACK_SLOT_SLOT6, "Slot6" }, { BUYBACK_SLOT_SLOT7, "Slot7" }, { BUYBACK_SLOT_SLOT8, "Slot8" }, { BUYBACK_SLOT_SLOT9, "Slot9" }, { BUYBACK_SLOT_SLOT10, "Slot10" }, { BUYBACK_SLOT_SLOT11, "Slot11" }, { BUYBACK_SLOT_SLOT12, "Slot12" }, { BUYBACK_SLOT_SLOT13, "Slot13" }, { 0, NULL } }; typedef enum { EMOTE_ONESHOT_NONE = 0x000, EMOTE_ONESHOT_TALK = 0x001, EMOTE_ONESHOT_BOW = 0x002, EMOTE_ONESHOT_WAVE = 0x003, EMOTE_ONESHOT_CHEER = 0x004, EMOTE_ONESHOT_EXCLAMATION = 0x005, EMOTE_ONESHOT_QUESTION = 0x006, EMOTE_ONESHOT_EAT = 0x007, EMOTE_STATE_DANCE = 0x00A, EMOTE_ONESHOT_LAUGH = 0x00B, EMOTE_STATE_SLEEP = 0x00C, EMOTE_STATE_SIT = 0x00D, EMOTE_ONESHOT_RUDE = 0x00E, EMOTE_ONESHOT_ROAR = 0x00F, EMOTE_ONESHOT_KNEEL = 0x010, EMOTE_ONESHOT_KISS = 0x011, EMOTE_ONESHOT_CRY = 0x012, EMOTE_ONESHOT_CHICKEN = 0x013, EMOTE_ONESHOT_BEG = 0x014, EMOTE_ONESHOT_APPLAUD = 0x015, EMOTE_ONESHOT_SHOUT = 0x016, EMOTE_ONESHOT_FLEX = 0x017, EMOTE_ONESHOT_SHY = 0x018, EMOTE_ONESHOT_POINT = 0x019, EMOTE_STATE_STAND = 0x01A, EMOTE_STATE_READYUNARMED = 0x01B, EMOTE_STATE_WORK_SHEATHED = 0x01C, EMOTE_STATE_POINT = 0x01D, EMOTE_STATE_NONE = 0x01E, EMOTE_ONESHOT_WOUND = 0x021, EMOTE_ONESHOT_WOUNDCRITICAL = 0x022, EMOTE_ONESHOT_ATTACKUNARMED = 0x023, EMOTE_ONESHOT_ATTACK1H = 0x024, EMOTE_ONESHOT_ATTACK2HTIGHT = 0x025, EMOTE_ONESHOT_ATTACK2HLOOSE = 0x026, EMOTE_ONESHOT_PARRYUNARMED = 0x027, EMOTE_ONESHOT_PARRYSHIELD = 0x02B, EMOTE_ONESHOT_READYUNARMED = 0x02C, EMOTE_ONESHOT_READY1H = 0x02D, EMOTE_ONESHOT_READYBOW = 0x030, EMOTE_ONESHOT_SPELLPRECAST = 0x032, EMOTE_ONESHOT_SPELLCAST = 0x033, EMOTE_ONESHOT_BATTLEROAR = 0x035, EMOTE_ONESHOT_SPECIALATTACK1H = 0x036, EMOTE_ONESHOT_KICK = 0x03C, EMOTE_ONESHOT_ATTACKTHROWN = 0x03D, EMOTE_STATE_STUN = 0x040, EMOTE_STATE_DEAD = 0x041, EMOTE_ONESHOT_SALUTE = 0x042, EMOTE_STATE_KNEEL = 0x044, EMOTE_STATE_USESTANDING = 0x045, EMOTE_ONESHOT_WAVE_NOSHEATHE = 0x046, EMOTE_ONESHOT_CHEER_NOSHEATHE = 0x047, EMOTE_ONESHOT_EAT_NOSHEATHE = 0x05C, EMOTE_STATE_STUN_NOSHEATHE = 0x05D, EMOTE_ONESHOT_DANCE = 0x05E, EMOTE_ONESHOT_SALUTE_NOSHEATH = 0x071, EMOTE_STATE_USESTANDING_NOSHEATHE = 0x085, EMOTE_ONESHOT_LAUGH_NOSHEATHE = 0x099, EMOTE_STATE_WORK = 0x0AD, EMOTE_STATE_SPELLPRECAST = 0x0C1, EMOTE_ONESHOT_READYRIFLE = 0x0D5, EMOTE_STATE_READYRIFLE = 0x0D6, EMOTE_STATE_WORK_MINING = 0x0E9, EMOTE_STATE_WORK_CHOPWOOD = 0x0EA, EMOTE_STATE_APPLAUD = 0x0FD, EMOTE_ONESHOT_LIFTOFF = 0x0FE, EMOTE_ONESHOT_YES = 0x111, EMOTE_ONESHOT_NO = 0x112, EMOTE_ONESHOT_TRAIN = 0x113, EMOTE_ONESHOT_LAND = 0x125, EMOTE_STATE_AT_EASE = 0x139, EMOTE_STATE_READY1H = 0x14D, EMOTE_STATE_SPELLKNEELSTART = 0x161, EMOTE_STATE_SUBMERGED = 0x175, EMOTE_ONESHOT_SUBMERGE = 0x176, EMOTE_STATE_READY2H = 0x177, EMOTE_STATE_READYBOW = 0x178, EMOTE_ONESHOT_MOUNTSPECIAL = 0x179, EMOTE_STATE_TALK = 0x17A, EMOTE_STATE_FISHING = 0x17B, EMOTE_ONESHOT_FISHING = 0x17C, EMOTE_ONESHOT_LOOT = 0x17D, EMOTE_STATE_WHIRLWIND = 0x17E, EMOTE_STATE_DROWNED = 0x17F, EMOTE_STATE_HOLD_BOW = 0x180, EMOTE_STATE_HOLD_RIFLE = 0x181, EMOTE_STATE_HOLD_THROWN = 0x182, EMOTE_ONESHOT_DROWN = 0x183, EMOTE_ONESHOT_STOMP = 0x184, EMOTE_ONESHOT_ATTACKOFF = 0x185, EMOTE_ONESHOT_ATTACKOFFPIERCE = 0x186, EMOTE_STATE_ROAR = 0x187, EMOTE_STATE_LAUGH = 0x188, EMOTE_ONESHOT_CREATURE_SPECIAL = 0x189, EMOTE_ONESHOT_JUMPLANDRUN = 0x18A, EMOTE_ONESHOT_JUMPEND = 0x18B, EMOTE_ONESHOT_TALK_NOSHEATHE = 0x18C, EMOTE_ONESHOT_POINT_NOSHEATHE = 0x18D, EMOTE_STATE_CANNIBALIZE = 0x18E, EMOTE_ONESHOT_JUMPSTART = 0x18F, EMOTE_STATE_DANCESPECIAL = 0x190, EMOTE_ONESHOT_DANCESPECIAL = 0x191, EMOTE_ONESHOT_CUSTOMSPELL01 = 0x192, EMOTE_ONESHOT_CUSTOMSPELL02 = 0x193, EMOTE_ONESHOT_CUSTOMSPELL03 = 0x194, EMOTE_ONESHOT_CUSTOMSPELL04 = 0x195, EMOTE_ONESHOT_CUSTOMSPELL05 = 0x196, EMOTE_ONESHOT_CUSTOMSPELL06 = 0x197, EMOTE_ONESHOT_CUSTOMSPELL07 = 0x198, EMOTE_ONESHOT_CUSTOMSPELL08 = 0x199, EMOTE_ONESHOT_CUSTOMSPELL09 = 0x19A, EMOTE_ONESHOT_CUSTOMSPELL10 = 0x19B, EMOTE_STATE_EXCLAIM = 0x19C, EMOTE_STATE_SIT_CHAIR_MED = 0x19F, EMOTE_STATE_SPELLEFFECT_HOLD = 0x1A6, EMOTE_STATE_EAT_NO_SHEATHE = 0x1A7, } e_emote; static const value_string e_emote_strings[] = { { EMOTE_ONESHOT_NONE, "Oneshot None" }, { EMOTE_ONESHOT_TALK, "Oneshot Talk" }, { EMOTE_ONESHOT_BOW, "Oneshot Bow" }, { EMOTE_ONESHOT_WAVE, "Oneshot Wave" }, { EMOTE_ONESHOT_CHEER, "Oneshot Cheer" }, { EMOTE_ONESHOT_EXCLAMATION, "Oneshot Exclamation" }, { EMOTE_ONESHOT_QUESTION, "Oneshot Question" }, { EMOTE_ONESHOT_EAT, "Oneshot Eat" }, { EMOTE_STATE_DANCE, "State Dance" }, { EMOTE_ONESHOT_LAUGH, "Oneshot Laugh" }, { EMOTE_STATE_SLEEP, "State Sleep" }, { EMOTE_STATE_SIT, "State Sit" }, { EMOTE_ONESHOT_RUDE, "Oneshot Rude" }, { EMOTE_ONESHOT_ROAR, "Oneshot Roar" }, { EMOTE_ONESHOT_KNEEL, "Oneshot Kneel" }, { EMOTE_ONESHOT_KISS, "Oneshot Kiss" }, { EMOTE_ONESHOT_CRY, "Oneshot Cry" }, { EMOTE_ONESHOT_CHICKEN, "Oneshot Chicken" }, { EMOTE_ONESHOT_BEG, "Oneshot Beg" }, { EMOTE_ONESHOT_APPLAUD, "Oneshot Applaud" }, { EMOTE_ONESHOT_SHOUT, "Oneshot Shout" }, { EMOTE_ONESHOT_FLEX, "Oneshot Flex" }, { EMOTE_ONESHOT_SHY, "Oneshot Shy" }, { EMOTE_ONESHOT_POINT, "Oneshot Point" }, { EMOTE_STATE_STAND, "State Stand" }, { EMOTE_STATE_READYUNARMED, "State Readyunarmed" }, { EMOTE_STATE_WORK_SHEATHED, "State Work Sheathed" }, { EMOTE_STATE_POINT, "State Point" }, { EMOTE_STATE_NONE, "State None" }, { EMOTE_ONESHOT_WOUND, "Oneshot Wound" }, { EMOTE_ONESHOT_WOUNDCRITICAL, "Oneshot Woundcritical" }, { EMOTE_ONESHOT_ATTACKUNARMED, "Oneshot Attackunarmed" }, { EMOTE_ONESHOT_ATTACK1H, "Oneshot Attack1h" }, { EMOTE_ONESHOT_ATTACK2HTIGHT, "Oneshot Attack2htight" }, { EMOTE_ONESHOT_ATTACK2HLOOSE, "Oneshot Attack2hloose" }, { EMOTE_ONESHOT_PARRYUNARMED, "Oneshot Parryunarmed" }, { EMOTE_ONESHOT_PARRYSHIELD, "Oneshot Parryshield" }, { EMOTE_ONESHOT_READYUNARMED, "Oneshot Readyunarmed" }, { EMOTE_ONESHOT_READY1H, "Oneshot Ready1h" }, { EMOTE_ONESHOT_READYBOW, "Oneshot Readybow" }, { EMOTE_ONESHOT_SPELLPRECAST, "Oneshot Spellprecast" }, { EMOTE_ONESHOT_SPELLCAST, "Oneshot Spellcast" }, { EMOTE_ONESHOT_BATTLEROAR, "Oneshot Battleroar" }, { EMOTE_ONESHOT_SPECIALATTACK1H, "Oneshot Specialattack1h" }, { EMOTE_ONESHOT_KICK, "Oneshot Kick" }, { EMOTE_ONESHOT_ATTACKTHROWN, "Oneshot Attackthrown" }, { EMOTE_STATE_STUN, "State Stun" }, { EMOTE_STATE_DEAD, "State Dead" }, { EMOTE_ONESHOT_SALUTE, "Oneshot Salute" }, { EMOTE_STATE_KNEEL, "State Kneel" }, { EMOTE_STATE_USESTANDING, "State Usestanding" }, { EMOTE_ONESHOT_WAVE_NOSHEATHE, "Oneshot Wave Nosheathe" }, { EMOTE_ONESHOT_CHEER_NOSHEATHE, "Oneshot Cheer Nosheathe" }, { EMOTE_ONESHOT_EAT_NOSHEATHE, "Oneshot Eat Nosheathe" }, { EMOTE_STATE_STUN_NOSHEATHE, "State Stun Nosheathe" }, { EMOTE_ONESHOT_DANCE, "Oneshot Dance" }, { EMOTE_ONESHOT_SALUTE_NOSHEATH, "Oneshot Salute Nosheath" }, { EMOTE_STATE_USESTANDING_NOSHEATHE, "State Usestanding Nosheathe" }, { EMOTE_ONESHOT_LAUGH_NOSHEATHE, "Oneshot Laugh Nosheathe" }, { EMOTE_STATE_WORK, "State Work" }, { EMOTE_STATE_SPELLPRECAST, "State Spellprecast" }, { EMOTE_ONESHOT_READYRIFLE, "Oneshot Readyrifle" }, { EMOTE_STATE_READYRIFLE, "State Readyrifle" }, { EMOTE_STATE_WORK_MINING, "State Work Mining" }, { EMOTE_STATE_WORK_CHOPWOOD, "State Work Chopwood" }, { EMOTE_STATE_APPLAUD, "State Applaud" }, { EMOTE_ONESHOT_LIFTOFF, "Oneshot Liftoff" }, { EMOTE_ONESHOT_YES, "Oneshot Yes" }, { EMOTE_ONESHOT_NO, "Oneshot No" }, { EMOTE_ONESHOT_TRAIN, "Oneshot Train" }, { EMOTE_ONESHOT_LAND, "Oneshot Land" }, { EMOTE_STATE_AT_EASE, "State At Ease" }, { EMOTE_STATE_READY1H, "State Ready1h" }, { EMOTE_STATE_SPELLKNEELSTART, "State Spellkneelstart" }, { EMOTE_STATE_SUBMERGED, "State Submerged" }, { EMOTE_ONESHOT_SUBMERGE, "Oneshot Submerge" }, { EMOTE_STATE_READY2H, "State Ready2h" }, { EMOTE_STATE_READYBOW, "State Readybow" }, { EMOTE_ONESHOT_MOUNTSPECIAL, "Oneshot Mountspecial" }, { EMOTE_STATE_TALK, "State Talk" }, { EMOTE_STATE_FISHING, "State Fishing" }, { EMOTE_ONESHOT_FISHING, "Oneshot Fishing" }, { EMOTE_ONESHOT_LOOT, "Oneshot Loot" }, { EMOTE_STATE_WHIRLWIND, "State Whirlwind" }, { EMOTE_STATE_DROWNED, "State Drowned" }, { EMOTE_STATE_HOLD_BOW, "State Hold Bow" }, { EMOTE_STATE_HOLD_RIFLE, "State Hold Rifle" }, { EMOTE_STATE_HOLD_THROWN, "State Hold Thrown" }, { EMOTE_ONESHOT_DROWN, "Oneshot Drown" }, { EMOTE_ONESHOT_STOMP, "Oneshot Stomp" }, { EMOTE_ONESHOT_ATTACKOFF, "Oneshot Attackoff" }, { EMOTE_ONESHOT_ATTACKOFFPIERCE, "Oneshot Attackoffpierce" }, { EMOTE_STATE_ROAR, "State Roar" }, { EMOTE_STATE_LAUGH, "State Laugh" }, { EMOTE_ONESHOT_CREATURE_SPECIAL, "Oneshot Creature Special" }, { EMOTE_ONESHOT_JUMPLANDRUN, "Oneshot Jumplandrun" }, { EMOTE_ONESHOT_JUMPEND, "Oneshot Jumpend" }, { EMOTE_ONESHOT_TALK_NOSHEATHE, "Oneshot Talk Nosheathe" }, { EMOTE_ONESHOT_POINT_NOSHEATHE, "Oneshot Point Nosheathe" }, { EMOTE_STATE_CANNIBALIZE, "State Cannibalize" }, { EMOTE_ONESHOT_JUMPSTART, "Oneshot Jumpstart" }, { EMOTE_STATE_DANCESPECIAL, "State Dancespecial" }, { EMOTE_ONESHOT_DANCESPECIAL, "Oneshot Dancespecial" }, { EMOTE_ONESHOT_CUSTOMSPELL01, "Oneshot Customspell01" }, { EMOTE_ONESHOT_CUSTOMSPELL02, "Oneshot Customspell02" }, { EMOTE_ONESHOT_CUSTOMSPELL03, "Oneshot Customspell03" }, { EMOTE_ONESHOT_CUSTOMSPELL04, "Oneshot Customspell04" }, { EMOTE_ONESHOT_CUSTOMSPELL05, "Oneshot Customspell05" }, { EMOTE_ONESHOT_CUSTOMSPELL06, "Oneshot Customspell06" }, { EMOTE_ONESHOT_CUSTOMSPELL07, "Oneshot Customspell07" }, { EMOTE_ONESHOT_CUSTOMSPELL08, "Oneshot Customspell08" }, { EMOTE_ONESHOT_CUSTOMSPELL09, "Oneshot Customspell09" }, { EMOTE_ONESHOT_CUSTOMSPELL10, "Oneshot Customspell10" }, { EMOTE_STATE_EXCLAIM, "State Exclaim" }, { EMOTE_STATE_SIT_CHAIR_MED, "State Sit Chair Med" }, { EMOTE_STATE_SPELLEFFECT_HOLD, "State Spelleffect Hold" }, { EMOTE_STATE_EAT_NO_SHEATHE, "State Eat No Sheathe" }, { 0, NULL } }; typedef enum { FAR_SIGHT_OPERATION_REMOVE = 0x0, FAR_SIGHT_OPERATION_ADD = 0x1, } e_far_sight_operation; static const value_string e_far_sight_operation_strings[] = { { FAR_SIGHT_OPERATION_REMOVE, "Remove" }, { FAR_SIGHT_OPERATION_ADD, "Add" }, { 0, NULL } }; typedef enum { GM_TICKET_TYPE_STUCK = 0x1, GM_TICKET_TYPE_BEHAVIOR_HARASSMENT = 0x2, GM_TICKET_TYPE_GUILD = 0x3, GM_TICKET_TYPE_ITEM = 0x4, GM_TICKET_TYPE_ENVIRONMENTAL = 0x5, GM_TICKET_TYPE_NONQUEST_CREEP = 0x6, GM_TICKET_TYPE_QUEST_QUESTNPC = 0x7, GM_TICKET_TYPE_TECHNICAL = 0x8, GM_TICKET_TYPE_ACCOUNT_BILLING = 0x9, GM_TICKET_TYPE_CHARACTER = 0xA, } e_gm_ticket_type; static const value_string e_gm_ticket_type_strings[] = { { GM_TICKET_TYPE_STUCK, "Stuck" }, { GM_TICKET_TYPE_BEHAVIOR_HARASSMENT, "Behavior Harassment" }, { GM_TICKET_TYPE_GUILD, "Guild" }, { GM_TICKET_TYPE_ITEM, "Item" }, { GM_TICKET_TYPE_ENVIRONMENTAL, "Environmental" }, { GM_TICKET_TYPE_NONQUEST_CREEP, "Nonquest Creep" }, { GM_TICKET_TYPE_QUEST_QUESTNPC, "Quest Questnpc" }, { GM_TICKET_TYPE_TECHNICAL, "Technical" }, { GM_TICKET_TYPE_ACCOUNT_BILLING, "Account Billing" }, { GM_TICKET_TYPE_CHARACTER, "Character" }, { 0, NULL } }; typedef enum { TALENT_BURNING_SOUL = 0x017, TALENT_IMPROVED_FIRE_WARD = 0x018, TALENT_IMPROVED_SCORCH = 0x019, TALENT_IMPROVED_FIREBALL = 0x01A, TALENT_IMPROVED_FIRE_BLAST = 0x01B, TALENT_FLAME_THROWING = 0x01C, TALENT_PYROBLAST = 0x01D, TALENT_IMPACT = 0x01E, TALENT_IMPROVED_FLAMESTRIKE = 0x01F, TALENT_BLAST_WAVE = 0x020, TALENT_CRITICAL_MASS = 0x021, TALENT_IGNITE = 0x022, TALENT_FIRE_POWER = 0x023, TALENT_COMBUSTION = 0x024, TALENT_IMPROVED_FROSTBOLT = 0x025, TALENT_FROSTBITE = 0x026, TALENT_PIERCING_ICE = 0x03D, TALENT_IMPROVED_FROST_NOVA = 0x03E, TALENT_IMPROVED_BLIZZARD = 0x03F, TALENT_IMPROVED_CONE_OF_COLD = 0x040, TALENT_PERMAFROST = 0x041, TALENT_FROST_CHANNELING = 0x042, TALENT_SHATTER = 0x043, TALENT_WINTERS_CHILL = 0x044, TALENT_COLD_SNAP = 0x045, TALENT_FROST_WARDING = 0x046, TALENT_ICE_BARRIER = 0x047, TALENT_ICE_BLOCK = 0x048, TALENT_ICE_SHARDS = 0x049, TALENT_ARCANE_SUBTLETY = 0x04A, TALENT_ARCANE_CONCENTRATION = 0x04B, TALENT_ARCANE_FOCUS = 0x04C, TALENT_ARCANE_MIND = 0x04D, TALENT_MAGE_WAND_SPECIALIZATION = 0x04E, TALENT_IMPROVED_ARCANE_MISSILES = 0x050, TALENT_IMPROVED_ARCANE_EXPLOSION = 0x051, TALENT_MAGIC_ATTUNEMENT = 0x052, TALENT_IMPROVED_MANA_SHIELD = 0x053, TALENT_ARCANE_RESILIENCE = 0x055, TALENT_PRESENCE_OF_MIND = 0x056, TALENT_ARCANE_POWER = 0x057, TALENT_IMPROVED_COUNTERSPELL = 0x058, TALENT_DEEP_WOUNDS = 0x079, TALENT_WARRIOR_SWORD_SPECIALIZATION = 0x07B, TALENT_IMPROVED_HEROIC_STRIKE = 0x07C, TALENT_WARRIOR_MACE_SPECIALIZATION = 0x07D, TALENT_IMPROVED_CHARGE = 0x07E, TALENT_IMPROVED_REND = 0x07F, TALENT_IMPROVED_THUNDER_CLAP = 0x080, TALENT_IMPROVED_HAMSTRING = 0x081, TALENT_WARRIOR_DEFLECTION = 0x082, TALENT_IMPROVED_OVERPOWER = 0x083, TALENT_AXE_SPECIALIZATION = 0x084, TALENT_SWEEPING_STRIKES = 0x085, TALENT_POLEARM_SPECIALIZATION = 0x086, TALENT_MORTAL_STRIKE = 0x087, TALENT_WARRIOR_TWO_HANDED_WEAPON_SPECIALIZATION = 0x088, TALENT_ANGER_MANAGEMENT = 0x089, TALENT_WARRIOR_ANTICIPATION = 0x08A, TALENT_WARRIOR_TOUGHNESS = 0x08C, TALENT_IRON_WILL = 0x08D, TALENT_IMPROVED_BLOODRAGE = 0x08E, TALENT_IMPROVED_TAUNT = 0x08F, TALENT_DEFIANCE = 0x090, TALENT_IMPROVED_SHIELD_BLOCK = 0x091, TALENT_IMPROVED_SUNDER_ARMOR = 0x092, TALENT_IMPROVED_REVENGE = 0x093, TALENT_SHIELD_SLAM = 0x094, TALENT_IMPROVED_SHIELD_BASH = 0x095, TALENT_IMPROVED_SHIELD_WALL = 0x096, TALENT_IMPROVED_DISARM = 0x097, TALENT_CONCUSSION_BLOW = 0x098, TALENT_LAST_STAND = 0x099, TALENT_IMPROVED_BATTLE_SHOUT = 0x09A, TALENT_ENRAGE = 0x09B, TALENT_WARRIOR_FLURRY = 0x09C, TALENT_CRUELTY = 0x09D, TALENT_BOOMING_VOICE = 0x09E, TALENT_UNBRIDLED_WRATH = 0x09F, TALENT_PIERCING_HOWL = 0x0A0, TALENT_IMPROVED_DEMORALIZING_SHOUT = 0x0A1, TALENT_DEATH_WISH = 0x0A5, TALENT_IMPROVED_CLEAVE = 0x0A6, TALENT_BLOODTHIRST = 0x0A7, TALENT_IMPROVED_SLAM = 0x0A8, TALENT_ROGUE_PRECISION = 0x0B5, TALENT_DAGGER_SPECIALIZATION = 0x0B6, TALENT_FIST_WEAPON_SPECIALIZATION = 0x0B7, TALENT_ROGUE_MACE_SPECIALIZATION = 0x0B8, TALENT_ROGUE_LIGHTNING_REFLEXES = 0x0BA, TALENT_ROGUE_DEFLECTION = 0x0BB, TALENT_IMPROVED_SINISTER_STRIKE = 0x0C9, TALENT_IMPROVED_BACKSTAB = 0x0CA, TALENT_IMPROVED_GOUGE = 0x0CB, TALENT_ENDURANCE = 0x0CC, TALENT_ADRENALINE_RUSH = 0x0CD, TALENT_IMPROVED_KICK = 0x0CE, TALENT_ROGUE_DUAL_WIELD_SPECIALIZATION = 0x0DD, TALENT_IMPROVED_SPRINT = 0x0DE, TALENT_BLADE_FLURRY = 0x0DF, TALENT_MASTER_OF_DECEPTION = 0x0F1, TALENT_ROGUE_SWORD_SPECIALIZATION = 0x0F2, TALENT_CAMOUFLAGE = 0x0F4, TALENT_INITIATIVE = 0x0F5, TALENT_SETUP = 0x0F6, TALENT_ELUSIVENESS = 0x0F7, TALENT_OPPORTUNITY = 0x105, TALENT_IMPROVED_SAP = 0x106, TALENT_IMPROVED_AMBUSH = 0x107, TALENT_DIRTY_DEEDS = 0x109, TALENT_IMPROVED_POISONS = 0x10C, TALENT_LETHALITY = 0x10D, TALENT_MALICE = 0x10E, TALENT_REMORSELESS_ATTACKS = 0x110, TALENT_RUTHLESSNESS = 0x111, TALENT_MURDER = 0x112, TALENT_IMPROVED_EVISCERATE = 0x114, TALENT_IMPROVED_SLICE_AND_DICE = 0x115, TALENT_IMPROVED_EXPOSE_ARMOR = 0x116, TALENT_IMPROVED_KIDNEY_SHOT = 0x117, TALENT_COLD_BLOOD = 0x118, TALENT_RELENTLESS_STRIKES = 0x119, TALENT_SEAL_FATE = 0x11B, TALENT_PREPARATION = 0x11C, TALENT_RIPOSTE = 0x12D, TALENT_GHOSTLY_STRIKE = 0x12F, TALENT_MARTYRDOM = 0x141, TALENT_POWER_INFUSION = 0x142, TALENT_MENTAL_AGILITY = 0x155, TALENT_UNBREAKABLE_WILL = 0x156, TALENT_IMPROVED_POWER_WORD_SHIELD = 0x157, TALENT_IMPROVED_POWER_WORD_FORTITUDE = 0x158, TALENT_PRIEST_WAND_SPECIALIZATION = 0x159, TALENT_IMPROVED_INNER_FIRE = 0x15A, TALENT_MEDITATION = 0x15B, TALENT_INNER_FOCUS = 0x15C, TALENT_IMPROVED_MANA_BURN = 0x15E, TALENT_DIVINE_SPIRIT = 0x15F, TALENT_SILENT_RESOLVE = 0x160, TALENT_INSPIRATION = 0x169, TALENT_PREMEDITATION = 0x17D, TALENT_VIGOR = 0x17E, TALENT_HOLY_SPECIALIZATION = 0x191, TALENT_SPIRITUAL_GUIDANCE = 0x192, TALENT_SEARING_LIGHT = 0x193, TALENT_SPIRITUAL_HEALING = 0x194, TALENT_IMPROVED_RENEW = 0x196, TALENT_IMPROVED_HEALING = 0x198, TALENT_PRIEST_HEALING_FOCUS = 0x19A, TALENT_SPELL_WARDING = 0x19B, TALENT_IMPROVED_PRAYER_OF_HEALING = 0x19D, TALENT_ARCANE_INSTABILITY = 0x1A5, TALENT_HOLY_NOVA = 0x1BA, TALENT_SHADOW_WEAVING = 0x1CD, TALENT_DARKNESS = 0x1CE, TALENT_SHADOW_FOCUS = 0x1CF, TALENT_BLACKOUT = 0x1D0, TALENT_SPIRIT_TAP = 0x1D1, TALENT_SHADOW_AFFINITY = 0x1D2, TALENT_IMPROVED_MIND_BLAST = 0x1E1, TALENT_IMPROVED_SHADOW_WORD_PAIN = 0x1E2, TALENT_IMPROVED_FADE = 0x1E3, TALENT_VAMPIRIC_EMBRACE = 0x1E4, TALENT_MIND_FLAY = 0x1F5, TALENT_SHADOWFORM = 0x209, TALENT_SILENCE = 0x21D, TALENT_IMPROVED_PSYCHIC_SCREAM = 0x21E, TALENT_CALL_OF_FLAME = 0x231, TALENT_CALL_OF_THUNDER = 0x232, TALENT_CONCUSSION = 0x233, TALENT_CONVECTION = 0x234, TALENT_ELEMENTAL_FURY = 0x235, TALENT_IMPROVED_FIRE_TOTEMS = 0x237, TALENT_EARTHS_GRASP = 0x23C, TALENT_ELEMENTAL_MASTERY = 0x23D, TALENT_ELEMENTAL_FOCUS = 0x23E, TALENT_REVERBERATION = 0x23F, TALENT_ANCESTRAL_HEALING = 0x245, TALENT_TOTEMIC_MASTERY = 0x246, TALENT_NATURES_GUIDANCE = 0x247, TALENT_IMPROVED_HEALING_WAVE = 0x24A, TALENT_SHAMAN_HEALING_FOCUS = 0x24B, TALENT_RESTORATIVE_TOTEMS = 0x24C, TALENT_IMPROVED_REINCARNATION = 0x24D, TALENT_MANA_TIDE_TOTEM = 0x24E, TALENT_SHAMAN_NATURES_SWIFTNESS = 0x24F, TALENT_PURIFICATION = 0x250, TALENT_TIDAL_FOCUS = 0x251, TALENT_TIDAL_MASTERY = 0x252, TALENT_TOTEMIC_FOCUS = 0x253, TALENT_SHAMAN_ANTICIPATION = 0x259, TALENT_SHAMAN_FLURRY = 0x25A, TALENT_IMPROVED_GHOST_WOLF = 0x25D, TALENT_IMPROVED_LIGHTNING_SHIELD = 0x25F, TALENT_GUARDIAN_TOTEMS = 0x261, TALENT_ENHANCING_TOTEMS = 0x262, TALENT_ELEMENTAL_WEAPONS = 0x263, TALENT_SHAMAN_SHIELD_SPECIALIZATION = 0x264, TALENT_THUNDERING_STRIKES = 0x265, TALENT_ANCESTRAL_KNOWLEDGE = 0x266, TALENT_SHAMAN_TOUGHNESS = 0x267, TALENT_PARRY = 0x268, TALENT_TWO_HANDED_AXES_AND_MACES = 0x269, TALENT_TACTICAL_MASTERY = 0x281, TALENT_BLOOD_CRAZE = 0x295, TALENT_IMPALE = 0x296, TALENT_HEMORRHAGE = 0x2A9, TALENT_VILE_POISONS = 0x2AA, TALENT_WARRIOR_ONE_HANDED_WEAPON_SPECIALIZATION = 0x2BE, TALENT_LIGHTNING_MASTERY = 0x2D1, TALENT_ARCTIC_REACH = 0x2E5, TALENT_NATURES_GRASP = 0x2F9, TALENT_IMPROVED_WRATH = 0x2FA, TALENT_IMPROVED_MOONFIRE = 0x2FB, TALENT_NATURES_REACH = 0x2FC, TALENT_NATURAL_SHAPESHIFTER = 0x30D, TALENT_IMPROVED_THORNS = 0x30E, TALENT_MOONGLOW = 0x30F, TALENT_IMPROVED_STARFIRE = 0x310, TALENT_IMPROVED_ENTANGLING_ROOTS = 0x313, TALENT_OMEN_OF_CLARITY = 0x314, TALENT_NATURES_GRACE = 0x315, TALENT_MOONFURY = 0x316, TALENT_NATURAL_WEAPONS = 0x317, TALENT_DRUID_VENGEANCE = 0x318, TALENT_MOONKIN_FORM = 0x319, TALENT_DRUID_THICK_HIDE = 0x31A, TALENT_FERAL_AGGRESSION = 0x31B, TALENT_DRUID_FEROCITY = 0x31C, TALENT_BRUTAL_IMPACT = 0x31D, TALENT_SHARPENED_CLAWS = 0x31E, TALENT_FERAL_INSTINCT = 0x31F, TALENT_BLOOD_FRENZY = 0x320, TALENT_PRIMAL_FURY = 0x321, TALENT_IMPROVED_SHRED = 0x322, TALENT_PREDATORY_STRIKES = 0x323, TALENT_FERAL_CHARGE = 0x324, TALENT_SAVAGE_FURY = 0x325, TALENT_FELINE_SWIFTNESS = 0x327, TALENT_HEART_OF_THE_WILD = 0x328, TALENT_LEADER_OF_THE_PACK = 0x329, TALENT_IMPROVED_MARK_OF_THE_WILD = 0x335, TALENT_FUROR = 0x336, TALENT_NATURES_FOCUS = 0x337, TALENT_IMPROVED_HEALING_TOUCH = 0x338, TALENT_IMPROVED_REGROWTH = 0x339, TALENT_IMPROVED_ENRAGE = 0x33A, TALENT_INSECT_SWARM = 0x33B, TALENT_GIFT_OF_NATURE = 0x33C, TALENT_REFLECTION = 0x33D, TALENT_IMPROVED_REJUVENATION = 0x33E, TALENT_DRUID_NATURES_SWIFTNESS = 0x33F, TALENT_SUBTLETY = 0x349, TALENT_IMPROVED_TRANQUILITY = 0x34A, TALENT_TRANQUIL_SPIRIT = 0x34B, TALENT_SWIFTMEND = 0x34C, TALENT_SHADOW_REACH = 0x371, TALENT_STORMSTRIKE = 0x385, TALENT_IMPROVED_NATURES_GRASP = 0x399, TALENT_CATACLYSM = 0x3AD, TALENT_BANE = 0x3AF, TALENT_IMPROVED_SHADOW_BOLT = 0x3B0, TALENT_IMPROVED_IMMOLATE = 0x3C1, TALENT_SHADOWBURN = 0x3C3, TALENT_DESTRUCTIVE_REACH = 0x3C4, TALENT_IMPROVED_SEARING_PAIN = 0x3C5, TALENT_EMBERSTORM = 0x3C6, TALENT_RUIN = 0x3C7, TALENT_CONFLAGRATE = 0x3C8, TALENT_DEVASTATION = 0x3D5, TALENT_AFTERMATH = 0x3D6, TALENT_IMPROVED_FIREBOLT = 0x3D7, TALENT_IMPROVED_LASH_OF_PAIN = 0x3D8, TALENT_INTENSITY = 0x3D9, TALENT_PYROCLASM = 0x3DA, TALENT_FEL_CONCENTRATION = 0x3E9, TALENT_NIGHTFALL = 0x3EA, TALENT_IMPROVED_CORRUPTION = 0x3EB, TALENT_IMPROVED_DRAIN_LIFE = 0x3EC, TALENT_SUPPRESSION = 0x3ED, TALENT_IMPROVED_CURSE_OF_WEAKNESS = 0x3EE, TALENT_IMPROVED_LIFE_TAP = 0x3EF, TALENT_GRIM_REACH = 0x3FD, TALENT_DARK_PACT = 0x3FE, TALENT_SIPHON_LIFE = 0x411, TALENT_SHADOW_MASTERY = 0x412, TALENT_AMPLIFY_CURSE = 0x425, TALENT_CURSE_OF_EXHAUSTION = 0x439, TALENT_IMPROVED_CURSE_OF_EXHAUSTION = 0x43A, TALENT_IMPROVED_DRAIN_SOUL = 0x44D, TALENT_IMPROVED_DRAIN_MANA = 0x461, TALENT_AGGRESSION = 0x462, TALENT_SERRATED_BLADES = 0x463, TALENT_INCINERATE = 0x475, TALENT_ARCANE_MEDITATION = 0x476, TALENT_FAERIE_FIRE_FERAL = 0x48A, TALENT_DIVINE_FURY = 0x49D, TALENT_MENTAL_STRENGTH = 0x4B1, TALENT_FORCE_OF_WILL = 0x4B2, TALENT_IMPROVED_HEALTHSTONE = 0x4C5, TALENT_IMPROVED_IMP = 0x4C6, TALENT_DEMONIC_EMBRACE = 0x4C7, TALENT_IMPROVED_HEALTH_FUNNEL = 0x4C8, TALENT_IMPROVED_VOIDWALKER = 0x4C9, TALENT_FEL_DOMINATION = 0x4CA, TALENT_MASTER_SUMMONER = 0x4CB, TALENT_FEL_STAMINA = 0x4D9, TALENT_FEL_INTELLECT = 0x4DA, TALENT_IMPROVED_SUCCUBUS = 0x4DB, TALENT_MASTER_DEMONOLOGIST = 0x4DC, TALENT_IMPROVED_FIRESTONE = 0x4ED, TALENT_UNHOLY_POWER = 0x4EE, TALENT_IMPROVED_SPELLSTONE = 0x4EF, TALENT_DEMONIC_SACRIFICE = 0x501, TALENT_SOUL_LINK = 0x502, TALENT_IMPROVED_ENSLAVE_DEMON = 0x503, TALENT_IMPROVED_CURSE_OF_AGONY = 0x504, TALENT_HUMANOID_SLAYING = 0x515, TALENT_HUNTER_LIGHTNING_REFLEXES = 0x517, TALENT_ENTRAPMENT = 0x518, TALENT_IMPROVED_WING_CLIP = 0x519, TALENT_CLEVER_TRAPS = 0x51A, TALENT_DETERRENCE = 0x51C, TALENT_IMPROVED_FEIGN_DEATH = 0x51D, TALENT_SUREFOOTED = 0x51E, TALENT_HUNTER_DEFLECTION = 0x51F, TALENT_COUNTERATTACK = 0x520, TALENT_KILLER_INSTINCT = 0x529, TALENT_TRAP_MASTERY = 0x52A, TALENT_WYVERN_STING = 0x52D, TALENT_IMPROVED_CONCUSSIVE_SHOT = 0x53D, TALENT_EFFICIENCY = 0x53E, TALENT_IMPROVED_HUNTERS_MARK = 0x53F, TALENT_LETHAL_SHOTS = 0x540, TALENT_AIMED_SHOT = 0x541, TALENT_IMPROVED_ARCANE_SHOT = 0x542, TALENT_BARRAGE = 0x543, TALENT_IMPROVED_SERPENT_STING = 0x544, TALENT_MORTAL_SHOTS = 0x545, TALENT_IMPROVED_SCORPID_STING = 0x547, TALENT_HAWK_EYE = 0x548, TALENT_SCATTER_SHOT = 0x549, TALENT_TRUESHOT_AURA = 0x551, TALENT_RANGED_WEAPON_SPECIALIZATION = 0x552, TALENT_IMPROVED_ASPECT_OF_THE_MONKEY = 0x565, TALENT_IMPROVED_ASPECT_OF_THE_HAWK = 0x566, TALENT_PATHFINDING = 0x568, TALENT_IMPROVED_MEND_PET = 0x569, TALENT_BESTIAL_WRATH = 0x56A, TALENT_INTIMIDATION = 0x56B, TALENT_SPIRIT_BOND = 0x56C, TALENT_ENDURANCE_TRAINING = 0x56D, TALENT_BESTIAL_DISCIPLINE = 0x56E, TALENT_BESTIAL_SWIFTNESS = 0x56F, TALENT_HUNTER_FEROCITY = 0x571, TALENT_HUNTER_THICK_HIDE = 0x573, TALENT_UNLEASHED_FURY = 0x574, TALENT_FRENZY = 0x575, TALENT_IMPROVED_BLESSING_OF_MIGHT = 0x579, TALENT_PALADIN_VENGEANCE = 0x57A, TALENT_PALADIN_DEFLECTION = 0x57B, TALENT_IMPROVED_RETRIBUTION_AURA = 0x57D, TALENT_BENEDICTION = 0x57F, TALENT_SANCTITY_AURA = 0x581, TALENT_PALADIN_TWO_HANDED_WEAPON_SPECIALIZATION = 0x582, TALENT_CONVICTION = 0x583, TALENT_REDOUBT = 0x58D, TALENT_IMPROVED_DEVOTION_AURA = 0x58E, TALENT_PALADIN_TOUGHNESS = 0x58F, TALENT_PALADIN_SHIELD_SPECIALIZATION = 0x590, TALENT_GUARDIANS_FAVOR = 0x591, TALENT_RECKONING = 0x592, TALENT_PALADIN_ONE_HANDED_WEAPON_SPECIALIZATION = 0x595, TALENT_HOLY_SHIELD = 0x596, TALENT_BLESSING_OF_SANCTUARY = 0x597, TALENT_SPIRITUAL_FOCUS = 0x598, TALENT_DIVINE_FAVOR = 0x599, TALENT_CONSECRATION = 0x59B, TALENT_REPENTANCE = 0x5A1, TALENT_BLESSING_OF_KINGS = 0x5A2, TALENT_IMPROVED_LAY_ON_HANDS = 0x5A3, TALENT_HEALING_LIGHT = 0x5A4, TALENT_IMPROVED_BLESSING_OF_WISDOM = 0x5A6, TALENT_DIVINE_INTELLECT = 0x5A9, TALENT_DIVINE_STRENGTH = 0x5AA, TALENT_ILLUMINATION = 0x5B5, TALENT_IMPROVED_SEAL_OF_RIGHTEOUSNESS = 0x5B7, TALENT_IMPROVED_SEAL_OF_THE_CRUSADER = 0x5B8, TALENT_LASTING_JUDGEMENT = 0x5B9, TALENT_SEAL_OF_COMMAND = 0x5C9, TALENT_IMPROVED_RIGHTEOUS_FURY = 0x5DD, TALENT_HOLY_SHOCK = 0x5DE, TALENT_IMPROVED_HAMMER_OF_JUSTICE = 0x5F1, TALENT_IMPROVED_BERSERKER_RAGE = 0x605, TALENT_IMPROVED_EXECUTE = 0x606, TALENT_IMPROVED_INTERCEPT = 0x607, TALENT_SPIRIT_OF_REDEMPTION = 0x619, TALENT_WARRIOR_DUAL_WIELD_SPECIALIZATION = 0x62D, TALENT_WARRIOR_SHIELD_SPECIALIZATION = 0x641, TALENT_SAVAGE_STRIKES = 0x655, TALENT_SURVIVALIST = 0x656, TALENT_MONSTER_SLAYING = 0x657, TALENT_IMPROVED_EYES_OF_THE_BEAST = 0x658, TALENT_IMPROVED_REVIVE_PET = 0x659, TALENT_IMPROVED_CONCENTRATION_AURA = 0x65A, TALENT_HOLY_POWER = 0x65B, TALENT_UNYIELDING_FAITH = 0x65C, TALENT_PALADIN_ANTICIPATION = 0x65D, TALENT_PALADIN_PRECISION = 0x65E, TALENT_IMPROVED_JUDGEMENT = 0x65F, TALENT_EYE_FOR_AN_EYE = 0x660, TALENT_VINDICATION = 0x661, TALENT_PURSUIT_OF_JUSTICE = 0x662, TALENT_HOLY_REACH = 0x663, TALENT_BLESSED_RECOVERY = 0x664, TALENT_LIGHTWELL = 0x665, TALENT_IMPROVED_VAMPIRIC_EMBRACE = 0x666, TALENT_MASTER_OF_ELEMENTS = 0x667, TALENT_ELEMENTAL_WARDING = 0x668, TALENT_STORM_REACH = 0x669, TALENT_EYE_OF_THE_STORM = 0x66A, TALENT_WEAPON_MASTERY = 0x66B, TALENT_ELEMENTAL_DEVASTATION = 0x66D, TALENT_HEALING_GRACE = 0x66E, TALENT_IMPROVED_WEAPON_TOTEMS = 0x66F, TALENT_HEALING_WAY = 0x670, TALENT_ELEMENTAL_PRECISION = 0x671, TALENT_MAGIC_ABSORPTION = 0x672, TALENT_SLEIGHT_OF_HAND = 0x6A4, TALENT_HEIGHTENED_SENSES = 0x6A5, TALENT_DEADLINESS = 0x6A6, TALENT_WEAPON_EXPERTISE = 0x6A7, } e_talent; static const value_string e_talent_strings[] = { { TALENT_BURNING_SOUL, "Burning Soul" }, { TALENT_IMPROVED_FIRE_WARD, "Improved Fire Ward" }, { TALENT_IMPROVED_SCORCH, "Improved Scorch" }, { TALENT_IMPROVED_FIREBALL, "Improved Fireball" }, { TALENT_IMPROVED_FIRE_BLAST, "Improved Fire Blast" }, { TALENT_FLAME_THROWING, "Flame Throwing" }, { TALENT_PYROBLAST, "Pyroblast" }, { TALENT_IMPACT, "Impact" }, { TALENT_IMPROVED_FLAMESTRIKE, "Improved Flamestrike" }, { TALENT_BLAST_WAVE, "Blast Wave" }, { TALENT_CRITICAL_MASS, "Critical Mass" }, { TALENT_IGNITE, "Ignite" }, { TALENT_FIRE_POWER, "Fire Power" }, { TALENT_COMBUSTION, "Combustion" }, { TALENT_IMPROVED_FROSTBOLT, "Improved Frostbolt" }, { TALENT_FROSTBITE, "Frostbite" }, { TALENT_PIERCING_ICE, "Piercing Ice" }, { TALENT_IMPROVED_FROST_NOVA, "Improved Frost Nova" }, { TALENT_IMPROVED_BLIZZARD, "Improved Blizzard" }, { TALENT_IMPROVED_CONE_OF_COLD, "Improved Cone Of Cold" }, { TALENT_PERMAFROST, "Permafrost" }, { TALENT_FROST_CHANNELING, "Frost Channeling" }, { TALENT_SHATTER, "Shatter" }, { TALENT_WINTERS_CHILL, "Winters Chill" }, { TALENT_COLD_SNAP, "Cold Snap" }, { TALENT_FROST_WARDING, "Frost Warding" }, { TALENT_ICE_BARRIER, "Ice Barrier" }, { TALENT_ICE_BLOCK, "Ice Block" }, { TALENT_ICE_SHARDS, "Ice Shards" }, { TALENT_ARCANE_SUBTLETY, "Arcane Subtlety" }, { TALENT_ARCANE_CONCENTRATION, "Arcane Concentration" }, { TALENT_ARCANE_FOCUS, "Arcane Focus" }, { TALENT_ARCANE_MIND, "Arcane Mind" }, { TALENT_MAGE_WAND_SPECIALIZATION, "Mage Wand Specialization" }, { TALENT_IMPROVED_ARCANE_MISSILES, "Improved Arcane Missiles" }, { TALENT_IMPROVED_ARCANE_EXPLOSION, "Improved Arcane Explosion" }, { TALENT_MAGIC_ATTUNEMENT, "Magic Attunement" }, { TALENT_IMPROVED_MANA_SHIELD, "Improved Mana Shield" }, { TALENT_ARCANE_RESILIENCE, "Arcane Resilience" }, { TALENT_PRESENCE_OF_MIND, "Presence Of Mind" }, { TALENT_ARCANE_POWER, "Arcane Power" }, { TALENT_IMPROVED_COUNTERSPELL, "Improved Counterspell" }, { TALENT_DEEP_WOUNDS, "Deep Wounds" }, { TALENT_WARRIOR_SWORD_SPECIALIZATION, "Warrior Sword Specialization" }, { TALENT_IMPROVED_HEROIC_STRIKE, "Improved Heroic Strike" }, { TALENT_WARRIOR_MACE_SPECIALIZATION, "Warrior Mace Specialization" }, { TALENT_IMPROVED_CHARGE, "Improved Charge" }, { TALENT_IMPROVED_REND, "Improved Rend" }, { TALENT_IMPROVED_THUNDER_CLAP, "Improved Thunder Clap" }, { TALENT_IMPROVED_HAMSTRING, "Improved Hamstring" }, { TALENT_WARRIOR_DEFLECTION, "Warrior Deflection" }, { TALENT_IMPROVED_OVERPOWER, "Improved Overpower" }, { TALENT_AXE_SPECIALIZATION, "Axe Specialization" }, { TALENT_SWEEPING_STRIKES, "Sweeping Strikes" }, { TALENT_POLEARM_SPECIALIZATION, "Polearm Specialization" }, { TALENT_MORTAL_STRIKE, "Mortal Strike" }, { TALENT_WARRIOR_TWO_HANDED_WEAPON_SPECIALIZATION, "Warrior Two Handed Weapon Specialization" }, { TALENT_ANGER_MANAGEMENT, "Anger Management" }, { TALENT_WARRIOR_ANTICIPATION, "Warrior Anticipation" }, { TALENT_WARRIOR_TOUGHNESS, "Warrior Toughness" }, { TALENT_IRON_WILL, "Iron Will" }, { TALENT_IMPROVED_BLOODRAGE, "Improved Bloodrage" }, { TALENT_IMPROVED_TAUNT, "Improved Taunt" }, { TALENT_DEFIANCE, "Defiance" }, { TALENT_IMPROVED_SHIELD_BLOCK, "Improved Shield Block" }, { TALENT_IMPROVED_SUNDER_ARMOR, "Improved Sunder Armor" }, { TALENT_IMPROVED_REVENGE, "Improved Revenge" }, { TALENT_SHIELD_SLAM, "Shield Slam" }, { TALENT_IMPROVED_SHIELD_BASH, "Improved Shield Bash" }, { TALENT_IMPROVED_SHIELD_WALL, "Improved Shield Wall" }, { TALENT_IMPROVED_DISARM, "Improved Disarm" }, { TALENT_CONCUSSION_BLOW, "Concussion Blow" }, { TALENT_LAST_STAND, "Last Stand" }, { TALENT_IMPROVED_BATTLE_SHOUT, "Improved Battle Shout" }, { TALENT_ENRAGE, "Enrage" }, { TALENT_WARRIOR_FLURRY, "Warrior Flurry" }, { TALENT_CRUELTY, "Cruelty" }, { TALENT_BOOMING_VOICE, "Booming Voice" }, { TALENT_UNBRIDLED_WRATH, "Unbridled Wrath" }, { TALENT_PIERCING_HOWL, "Piercing Howl" }, { TALENT_IMPROVED_DEMORALIZING_SHOUT, "Improved Demoralizing Shout" }, { TALENT_DEATH_WISH, "Death Wish" }, { TALENT_IMPROVED_CLEAVE, "Improved Cleave" }, { TALENT_BLOODTHIRST, "Bloodthirst" }, { TALENT_IMPROVED_SLAM, "Improved Slam" }, { TALENT_ROGUE_PRECISION, "Rogue Precision" }, { TALENT_DAGGER_SPECIALIZATION, "Dagger Specialization" }, { TALENT_FIST_WEAPON_SPECIALIZATION, "Fist Weapon Specialization" }, { TALENT_ROGUE_MACE_SPECIALIZATION, "Rogue Mace Specialization" }, { TALENT_ROGUE_LIGHTNING_REFLEXES, "Rogue Lightning Reflexes" }, { TALENT_ROGUE_DEFLECTION, "Rogue Deflection" }, { TALENT_IMPROVED_SINISTER_STRIKE, "Improved Sinister Strike" }, { TALENT_IMPROVED_BACKSTAB, "Improved Backstab" }, { TALENT_IMPROVED_GOUGE, "Improved Gouge" }, { TALENT_ENDURANCE, "Endurance" }, { TALENT_ADRENALINE_RUSH, "Adrenaline Rush" }, { TALENT_IMPROVED_KICK, "Improved Kick" }, { TALENT_ROGUE_DUAL_WIELD_SPECIALIZATION, "Rogue Dual Wield Specialization" }, { TALENT_IMPROVED_SPRINT, "Improved Sprint" }, { TALENT_BLADE_FLURRY, "Blade Flurry" }, { TALENT_MASTER_OF_DECEPTION, "Master Of Deception" }, { TALENT_ROGUE_SWORD_SPECIALIZATION, "Rogue Sword Specialization" }, { TALENT_CAMOUFLAGE, "Camouflage" }, { TALENT_INITIATIVE, "Initiative" }, { TALENT_SETUP, "Setup" }, { TALENT_ELUSIVENESS, "Elusiveness" }, { TALENT_OPPORTUNITY, "Opportunity" }, { TALENT_IMPROVED_SAP, "Improved Sap" }, { TALENT_IMPROVED_AMBUSH, "Improved Ambush" }, { TALENT_DIRTY_DEEDS, "Dirty Deeds" }, { TALENT_IMPROVED_POISONS, "Improved Poisons" }, { TALENT_LETHALITY, "Lethality" }, { TALENT_MALICE, "Malice" }, { TALENT_REMORSELESS_ATTACKS, "Remorseless Attacks" }, { TALENT_RUTHLESSNESS, "Ruthlessness" }, { TALENT_MURDER, "Murder" }, { TALENT_IMPROVED_EVISCERATE, "Improved Eviscerate" }, { TALENT_IMPROVED_SLICE_AND_DICE, "Improved Slice And Dice" }, { TALENT_IMPROVED_EXPOSE_ARMOR, "Improved Expose Armor" }, { TALENT_IMPROVED_KIDNEY_SHOT, "Improved Kidney Shot" }, { TALENT_COLD_BLOOD, "Cold Blood" }, { TALENT_RELENTLESS_STRIKES, "Relentless Strikes" }, { TALENT_SEAL_FATE, "Seal Fate" }, { TALENT_PREPARATION, "Preparation" }, { TALENT_RIPOSTE, "Riposte" }, { TALENT_GHOSTLY_STRIKE, "Ghostly Strike" }, { TALENT_MARTYRDOM, "Martyrdom" }, { TALENT_POWER_INFUSION, "Power Infusion" }, { TALENT_MENTAL_AGILITY, "Mental Agility" }, { TALENT_UNBREAKABLE_WILL, "Unbreakable Will" }, { TALENT_IMPROVED_POWER_WORD_SHIELD, "Improved Power Word Shield" }, { TALENT_IMPROVED_POWER_WORD_FORTITUDE, "Improved Power Word Fortitude" }, { TALENT_PRIEST_WAND_SPECIALIZATION, "Priest Wand Specialization" }, { TALENT_IMPROVED_INNER_FIRE, "Improved Inner Fire" }, { TALENT_MEDITATION, "Meditation" }, { TALENT_INNER_FOCUS, "Inner Focus" }, { TALENT_IMPROVED_MANA_BURN, "Improved Mana Burn" }, { TALENT_DIVINE_SPIRIT, "Divine Spirit" }, { TALENT_SILENT_RESOLVE, "Silent Resolve" }, { TALENT_INSPIRATION, "Inspiration" }, { TALENT_PREMEDITATION, "Premeditation" }, { TALENT_VIGOR, "Vigor" }, { TALENT_HOLY_SPECIALIZATION, "Holy Specialization" }, { TALENT_SPIRITUAL_GUIDANCE, "Spiritual Guidance" }, { TALENT_SEARING_LIGHT, "Searing Light" }, { TALENT_SPIRITUAL_HEALING, "Spiritual Healing" }, { TALENT_IMPROVED_RENEW, "Improved Renew" }, { TALENT_IMPROVED_HEALING, "Improved Healing" }, { TALENT_PRIEST_HEALING_FOCUS, "Priest Healing Focus" }, { TALENT_SPELL_WARDING, "Spell Warding" }, { TALENT_IMPROVED_PRAYER_OF_HEALING, "Improved Prayer Of Healing" }, { TALENT_ARCANE_INSTABILITY, "Arcane Instability" }, { TALENT_HOLY_NOVA, "Holy Nova" }, { TALENT_SHADOW_WEAVING, "Shadow Weaving" }, { TALENT_DARKNESS, "Darkness" }, { TALENT_SHADOW_FOCUS, "Shadow Focus" }, { TALENT_BLACKOUT, "Blackout" }, { TALENT_SPIRIT_TAP, "Spirit Tap" }, { TALENT_SHADOW_AFFINITY, "Shadow Affinity" }, { TALENT_IMPROVED_MIND_BLAST, "Improved Mind Blast" }, { TALENT_IMPROVED_SHADOW_WORD_PAIN, "Improved Shadow Word Pain" }, { TALENT_IMPROVED_FADE, "Improved Fade" }, { TALENT_VAMPIRIC_EMBRACE, "Vampiric Embrace" }, { TALENT_MIND_FLAY, "Mind Flay" }, { TALENT_SHADOWFORM, "Shadowform" }, { TALENT_SILENCE, "Silence" }, { TALENT_IMPROVED_PSYCHIC_SCREAM, "Improved Psychic Scream" }, { TALENT_CALL_OF_FLAME, "Call Of Flame" }, { TALENT_CALL_OF_THUNDER, "Call Of Thunder" }, { TALENT_CONCUSSION, "Concussion" }, { TALENT_CONVECTION, "Convection" }, { TALENT_ELEMENTAL_FURY, "Elemental Fury" }, { TALENT_IMPROVED_FIRE_TOTEMS, "Improved Fire Totems" }, { TALENT_EARTHS_GRASP, "Earths Grasp" }, { TALENT_ELEMENTAL_MASTERY, "Elemental Mastery" }, { TALENT_ELEMENTAL_FOCUS, "Elemental Focus" }, { TALENT_REVERBERATION, "Reverberation" }, { TALENT_ANCESTRAL_HEALING, "Ancestral Healing" }, { TALENT_TOTEMIC_MASTERY, "Totemic Mastery" }, { TALENT_NATURES_GUIDANCE, "Natures Guidance" }, { TALENT_IMPROVED_HEALING_WAVE, "Improved Healing Wave" }, { TALENT_SHAMAN_HEALING_FOCUS, "Shaman Healing Focus" }, { TALENT_RESTORATIVE_TOTEMS, "Restorative Totems" }, { TALENT_IMPROVED_REINCARNATION, "Improved Reincarnation" }, { TALENT_MANA_TIDE_TOTEM, "Mana Tide Totem" }, { TALENT_SHAMAN_NATURES_SWIFTNESS, "Shaman Natures Swiftness" }, { TALENT_PURIFICATION, "Purification" }, { TALENT_TIDAL_FOCUS, "Tidal Focus" }, { TALENT_TIDAL_MASTERY, "Tidal Mastery" }, { TALENT_TOTEMIC_FOCUS, "Totemic Focus" }, { TALENT_SHAMAN_ANTICIPATION, "Shaman Anticipation" }, { TALENT_SHAMAN_FLURRY, "Shaman Flurry" }, { TALENT_IMPROVED_GHOST_WOLF, "Improved Ghost Wolf" }, { TALENT_IMPROVED_LIGHTNING_SHIELD, "Improved Lightning Shield" }, { TALENT_GUARDIAN_TOTEMS, "Guardian Totems" }, { TALENT_ENHANCING_TOTEMS, "Enhancing Totems" }, { TALENT_ELEMENTAL_WEAPONS, "Elemental Weapons" }, { TALENT_SHAMAN_SHIELD_SPECIALIZATION, "Shaman Shield Specialization" }, { TALENT_THUNDERING_STRIKES, "Thundering Strikes" }, { TALENT_ANCESTRAL_KNOWLEDGE, "Ancestral Knowledge" }, { TALENT_SHAMAN_TOUGHNESS, "Shaman Toughness" }, { TALENT_PARRY, "Parry" }, { TALENT_TWO_HANDED_AXES_AND_MACES, "Two Handed Axes And Maces" }, { TALENT_TACTICAL_MASTERY, "Tactical Mastery" }, { TALENT_BLOOD_CRAZE, "Blood Craze" }, { TALENT_IMPALE, "Impale" }, { TALENT_HEMORRHAGE, "Hemorrhage" }, { TALENT_VILE_POISONS, "Vile Poisons" }, { TALENT_WARRIOR_ONE_HANDED_WEAPON_SPECIALIZATION, "Warrior One Handed Weapon Specialization" }, { TALENT_LIGHTNING_MASTERY, "Lightning Mastery" }, { TALENT_ARCTIC_REACH, "Arctic Reach" }, { TALENT_NATURES_GRASP, "Natures Grasp" }, { TALENT_IMPROVED_WRATH, "Improved Wrath" }, { TALENT_IMPROVED_MOONFIRE, "Improved Moonfire" }, { TALENT_NATURES_REACH, "Natures Reach" }, { TALENT_NATURAL_SHAPESHIFTER, "Natural Shapeshifter" }, { TALENT_IMPROVED_THORNS, "Improved Thorns" }, { TALENT_MOONGLOW, "Moonglow" }, { TALENT_IMPROVED_STARFIRE, "Improved Starfire" }, { TALENT_IMPROVED_ENTANGLING_ROOTS, "Improved Entangling Roots" }, { TALENT_OMEN_OF_CLARITY, "Omen Of Clarity" }, { TALENT_NATURES_GRACE, "Natures Grace" }, { TALENT_MOONFURY, "Moonfury" }, { TALENT_NATURAL_WEAPONS, "Natural Weapons" }, { TALENT_DRUID_VENGEANCE, "Druid Vengeance" }, { TALENT_MOONKIN_FORM, "Moonkin Form" }, { TALENT_DRUID_THICK_HIDE, "Druid Thick Hide" }, { TALENT_FERAL_AGGRESSION, "Feral Aggression" }, { TALENT_DRUID_FEROCITY, "Druid Ferocity" }, { TALENT_BRUTAL_IMPACT, "Brutal Impact" }, { TALENT_SHARPENED_CLAWS, "Sharpened Claws" }, { TALENT_FERAL_INSTINCT, "Feral Instinct" }, { TALENT_BLOOD_FRENZY, "Blood Frenzy" }, { TALENT_PRIMAL_FURY, "Primal Fury" }, { TALENT_IMPROVED_SHRED, "Improved Shred" }, { TALENT_PREDATORY_STRIKES, "Predatory Strikes" }, { TALENT_FERAL_CHARGE, "Feral Charge" }, { TALENT_SAVAGE_FURY, "Savage Fury" }, { TALENT_FELINE_SWIFTNESS, "Feline Swiftness" }, { TALENT_HEART_OF_THE_WILD, "Heart Of The Wild" }, { TALENT_LEADER_OF_THE_PACK, "Leader Of The Pack" }, { TALENT_IMPROVED_MARK_OF_THE_WILD, "Improved Mark Of The Wild" }, { TALENT_FUROR, "Furor" }, { TALENT_NATURES_FOCUS, "Natures Focus" }, { TALENT_IMPROVED_HEALING_TOUCH, "Improved Healing Touch" }, { TALENT_IMPROVED_REGROWTH, "Improved Regrowth" }, { TALENT_IMPROVED_ENRAGE, "Improved Enrage" }, { TALENT_INSECT_SWARM, "Insect Swarm" }, { TALENT_GIFT_OF_NATURE, "Gift Of Nature" }, { TALENT_REFLECTION, "Reflection" }, { TALENT_IMPROVED_REJUVENATION, "Improved Rejuvenation" }, { TALENT_DRUID_NATURES_SWIFTNESS, "Druid Natures Swiftness" }, { TALENT_SUBTLETY, "Subtlety" }, { TALENT_IMPROVED_TRANQUILITY, "Improved Tranquility" }, { TALENT_TRANQUIL_SPIRIT, "Tranquil Spirit" }, { TALENT_SWIFTMEND, "Swiftmend" }, { TALENT_SHADOW_REACH, "Shadow Reach" }, { TALENT_STORMSTRIKE, "Stormstrike" }, { TALENT_IMPROVED_NATURES_GRASP, "Improved Natures Grasp" }, { TALENT_CATACLYSM, "Cataclysm" }, { TALENT_BANE, "Bane" }, { TALENT_IMPROVED_SHADOW_BOLT, "Improved Shadow Bolt" }, { TALENT_IMPROVED_IMMOLATE, "Improved Immolate" }, { TALENT_SHADOWBURN, "Shadowburn" }, { TALENT_DESTRUCTIVE_REACH, "Destructive Reach" }, { TALENT_IMPROVED_SEARING_PAIN, "Improved Searing Pain" }, { TALENT_EMBERSTORM, "Emberstorm" }, { TALENT_RUIN, "Ruin" }, { TALENT_CONFLAGRATE, "Conflagrate" }, { TALENT_DEVASTATION, "Devastation" }, { TALENT_AFTERMATH, "Aftermath" }, { TALENT_IMPROVED_FIREBOLT, "Improved Firebolt" }, { TALENT_IMPROVED_LASH_OF_PAIN, "Improved Lash Of Pain" }, { TALENT_INTENSITY, "Intensity" }, { TALENT_PYROCLASM, "Pyroclasm" }, { TALENT_FEL_CONCENTRATION, "Fel Concentration" }, { TALENT_NIGHTFALL, "Nightfall" }, { TALENT_IMPROVED_CORRUPTION, "Improved Corruption" }, { TALENT_IMPROVED_DRAIN_LIFE, "Improved Drain Life" }, { TALENT_SUPPRESSION, "Suppression" }, { TALENT_IMPROVED_CURSE_OF_WEAKNESS, "Improved Curse Of Weakness" }, { TALENT_IMPROVED_LIFE_TAP, "Improved Life Tap" }, { TALENT_GRIM_REACH, "Grim Reach" }, { TALENT_DARK_PACT, "Dark Pact" }, { TALENT_SIPHON_LIFE, "Siphon Life" }, { TALENT_SHADOW_MASTERY, "Shadow Mastery" }, { TALENT_AMPLIFY_CURSE, "Amplify Curse" }, { TALENT_CURSE_OF_EXHAUSTION, "Curse Of Exhaustion" }, { TALENT_IMPROVED_CURSE_OF_EXHAUSTION, "Improved Curse Of Exhaustion" }, { TALENT_IMPROVED_DRAIN_SOUL, "Improved Drain Soul" }, { TALENT_IMPROVED_DRAIN_MANA, "Improved Drain Mana" }, { TALENT_AGGRESSION, "Aggression" }, { TALENT_SERRATED_BLADES, "Serrated Blades" }, { TALENT_INCINERATE, "Incinerate" }, { TALENT_ARCANE_MEDITATION, "Arcane Meditation" }, { TALENT_FAERIE_FIRE_FERAL, "Faerie Fire Feral" }, { TALENT_DIVINE_FURY, "Divine Fury" }, { TALENT_MENTAL_STRENGTH, "Mental Strength" }, { TALENT_FORCE_OF_WILL, "Force Of Will" }, { TALENT_IMPROVED_HEALTHSTONE, "Improved Healthstone" }, { TALENT_IMPROVED_IMP, "Improved Imp" }, { TALENT_DEMONIC_EMBRACE, "Demonic Embrace" }, { TALENT_IMPROVED_HEALTH_FUNNEL, "Improved Health Funnel" }, { TALENT_IMPROVED_VOIDWALKER, "Improved Voidwalker" }, { TALENT_FEL_DOMINATION, "Fel Domination" }, { TALENT_MASTER_SUMMONER, "Master Summoner" }, { TALENT_FEL_STAMINA, "Fel Stamina" }, { TALENT_FEL_INTELLECT, "Fel Intellect" }, { TALENT_IMPROVED_SUCCUBUS, "Improved Succubus" }, { TALENT_MASTER_DEMONOLOGIST, "Master Demonologist" }, { TALENT_IMPROVED_FIRESTONE, "Improved Firestone" }, { TALENT_UNHOLY_POWER, "Unholy Power" }, { TALENT_IMPROVED_SPELLSTONE, "Improved Spellstone" }, { TALENT_DEMONIC_SACRIFICE, "Demonic Sacrifice" }, { TALENT_SOUL_LINK, "Soul Link" }, { TALENT_IMPROVED_ENSLAVE_DEMON, "Improved Enslave Demon" }, { TALENT_IMPROVED_CURSE_OF_AGONY, "Improved Curse Of Agony" }, { TALENT_HUMANOID_SLAYING, "Humanoid Slaying" }, { TALENT_HUNTER_LIGHTNING_REFLEXES, "Hunter Lightning Reflexes" }, { TALENT_ENTRAPMENT, "Entrapment" }, { TALENT_IMPROVED_WING_CLIP, "Improved Wing Clip" }, { TALENT_CLEVER_TRAPS, "Clever Traps" }, { TALENT_DETERRENCE, "Deterrence" }, { TALENT_IMPROVED_FEIGN_DEATH, "Improved Feign Death" }, { TALENT_SUREFOOTED, "Surefooted" }, { TALENT_HUNTER_DEFLECTION, "Hunter Deflection" }, { TALENT_COUNTERATTACK, "Counterattack" }, { TALENT_KILLER_INSTINCT, "Killer Instinct" }, { TALENT_TRAP_MASTERY, "Trap Mastery" }, { TALENT_WYVERN_STING, "Wyvern Sting" }, { TALENT_IMPROVED_CONCUSSIVE_SHOT, "Improved Concussive Shot" }, { TALENT_EFFICIENCY, "Efficiency" }, { TALENT_IMPROVED_HUNTERS_MARK, "Improved Hunters Mark" }, { TALENT_LETHAL_SHOTS, "Lethal Shots" }, { TALENT_AIMED_SHOT, "Aimed Shot" }, { TALENT_IMPROVED_ARCANE_SHOT, "Improved Arcane Shot" }, { TALENT_BARRAGE, "Barrage" }, { TALENT_IMPROVED_SERPENT_STING, "Improved Serpent Sting" }, { TALENT_MORTAL_SHOTS, "Mortal Shots" }, { TALENT_IMPROVED_SCORPID_STING, "Improved Scorpid Sting" }, { TALENT_HAWK_EYE, "Hawk Eye" }, { TALENT_SCATTER_SHOT, "Scatter Shot" }, { TALENT_TRUESHOT_AURA, "Trueshot Aura" }, { TALENT_RANGED_WEAPON_SPECIALIZATION, "Ranged Weapon Specialization" }, { TALENT_IMPROVED_ASPECT_OF_THE_MONKEY, "Improved Aspect Of The Monkey" }, { TALENT_IMPROVED_ASPECT_OF_THE_HAWK, "Improved Aspect Of The Hawk" }, { TALENT_PATHFINDING, "Pathfinding" }, { TALENT_IMPROVED_MEND_PET, "Improved Mend Pet" }, { TALENT_BESTIAL_WRATH, "Bestial Wrath" }, { TALENT_INTIMIDATION, "Intimidation" }, { TALENT_SPIRIT_BOND, "Spirit Bond" }, { TALENT_ENDURANCE_TRAINING, "Endurance Training" }, { TALENT_BESTIAL_DISCIPLINE, "Bestial Discipline" }, { TALENT_BESTIAL_SWIFTNESS, "Bestial Swiftness" }, { TALENT_HUNTER_FEROCITY, "Hunter Ferocity" }, { TALENT_HUNTER_THICK_HIDE, "Hunter Thick Hide" }, { TALENT_UNLEASHED_FURY, "Unleashed Fury" }, { TALENT_FRENZY, "Frenzy" }, { TALENT_IMPROVED_BLESSING_OF_MIGHT, "Improved Blessing Of Might" }, { TALENT_PALADIN_VENGEANCE, "Paladin Vengeance" }, { TALENT_PALADIN_DEFLECTION, "Paladin Deflection" }, { TALENT_IMPROVED_RETRIBUTION_AURA, "Improved Retribution Aura" }, { TALENT_BENEDICTION, "Benediction" }, { TALENT_SANCTITY_AURA, "Sanctity Aura" }, { TALENT_PALADIN_TWO_HANDED_WEAPON_SPECIALIZATION, "Paladin Two Handed Weapon Specialization" }, { TALENT_CONVICTION, "Conviction" }, { TALENT_REDOUBT, "Redoubt" }, { TALENT_IMPROVED_DEVOTION_AURA, "Improved Devotion Aura" }, { TALENT_PALADIN_TOUGHNESS, "Paladin Toughness" }, { TALENT_PALADIN_SHIELD_SPECIALIZATION, "Paladin Shield Specialization" }, { TALENT_GUARDIANS_FAVOR, "Guardians Favor" }, { TALENT_RECKONING, "Reckoning" }, { TALENT_PALADIN_ONE_HANDED_WEAPON_SPECIALIZATION, "Paladin One Handed Weapon Specialization" }, { TALENT_HOLY_SHIELD, "Holy Shield" }, { TALENT_BLESSING_OF_SANCTUARY, "Blessing Of Sanctuary" }, { TALENT_SPIRITUAL_FOCUS, "Spiritual Focus" }, { TALENT_DIVINE_FAVOR, "Divine Favor" }, { TALENT_CONSECRATION, "Consecration" }, { TALENT_REPENTANCE, "Repentance" }, { TALENT_BLESSING_OF_KINGS, "Blessing Of Kings" }, { TALENT_IMPROVED_LAY_ON_HANDS, "Improved Lay On Hands" }, { TALENT_HEALING_LIGHT, "Healing Light" }, { TALENT_IMPROVED_BLESSING_OF_WISDOM, "Improved Blessing Of Wisdom" }, { TALENT_DIVINE_INTELLECT, "Divine Intellect" }, { TALENT_DIVINE_STRENGTH, "Divine Strength" }, { TALENT_ILLUMINATION, "Illumination" }, { TALENT_IMPROVED_SEAL_OF_RIGHTEOUSNESS, "Improved Seal Of Righteousness" }, { TALENT_IMPROVED_SEAL_OF_THE_CRUSADER, "Improved Seal Of The Crusader" }, { TALENT_LASTING_JUDGEMENT, "Lasting Judgement" }, { TALENT_SEAL_OF_COMMAND, "Seal Of Command" }, { TALENT_IMPROVED_RIGHTEOUS_FURY, "Improved Righteous Fury" }, { TALENT_HOLY_SHOCK, "Holy Shock" }, { TALENT_IMPROVED_HAMMER_OF_JUSTICE, "Improved Hammer Of Justice" }, { TALENT_IMPROVED_BERSERKER_RAGE, "Improved Berserker Rage" }, { TALENT_IMPROVED_EXECUTE, "Improved Execute" }, { TALENT_IMPROVED_INTERCEPT, "Improved Intercept" }, { TALENT_SPIRIT_OF_REDEMPTION, "Spirit Of Redemption" }, { TALENT_WARRIOR_DUAL_WIELD_SPECIALIZATION, "Warrior Dual Wield Specialization" }, { TALENT_WARRIOR_SHIELD_SPECIALIZATION, "Warrior Shield Specialization" }, { TALENT_SAVAGE_STRIKES, "Savage Strikes" }, { TALENT_SURVIVALIST, "Survivalist" }, { TALENT_MONSTER_SLAYING, "Monster Slaying" }, { TALENT_IMPROVED_EYES_OF_THE_BEAST, "Improved Eyes Of The Beast" }, { TALENT_IMPROVED_REVIVE_PET, "Improved Revive Pet" }, { TALENT_IMPROVED_CONCENTRATION_AURA, "Improved Concentration Aura" }, { TALENT_HOLY_POWER, "Holy Power" }, { TALENT_UNYIELDING_FAITH, "Unyielding Faith" }, { TALENT_PALADIN_ANTICIPATION, "Paladin Anticipation" }, { TALENT_PALADIN_PRECISION, "Paladin Precision" }, { TALENT_IMPROVED_JUDGEMENT, "Improved Judgement" }, { TALENT_EYE_FOR_AN_EYE, "Eye For An Eye" }, { TALENT_VINDICATION, "Vindication" }, { TALENT_PURSUIT_OF_JUSTICE, "Pursuit Of Justice" }, { TALENT_HOLY_REACH, "Holy Reach" }, { TALENT_BLESSED_RECOVERY, "Blessed Recovery" }, { TALENT_LIGHTWELL, "Lightwell" }, { TALENT_IMPROVED_VAMPIRIC_EMBRACE, "Improved Vampiric Embrace" }, { TALENT_MASTER_OF_ELEMENTS, "Master Of Elements" }, { TALENT_ELEMENTAL_WARDING, "Elemental Warding" }, { TALENT_STORM_REACH, "Storm Reach" }, { TALENT_EYE_OF_THE_STORM, "Eye Of The Storm" }, { TALENT_WEAPON_MASTERY, "Weapon Mastery" }, { TALENT_ELEMENTAL_DEVASTATION, "Elemental Devastation" }, { TALENT_HEALING_GRACE, "Healing Grace" }, { TALENT_IMPROVED_WEAPON_TOTEMS, "Improved Weapon Totems" }, { TALENT_HEALING_WAY, "Healing Way" }, { TALENT_ELEMENTAL_PRECISION, "Elemental Precision" }, { TALENT_MAGIC_ABSORPTION, "Magic Absorption" }, { TALENT_SLEIGHT_OF_HAND, "Sleight Of Hand" }, { TALENT_HEIGHTENED_SENSES, "Heightened Senses" }, { TALENT_DEADLINESS, "Deadliness" }, { TALENT_WEAPON_EXPERTISE, "Weapon Expertise" }, { 0, NULL } }; typedef enum { GROUP_LOOT_SETTING_FREE_FOR_ALL = 0x0, GROUP_LOOT_SETTING_ROUND_ROBIN = 0x1, GROUP_LOOT_SETTING_MASTER_LOOT = 0x2, GROUP_LOOT_SETTING_GROUP_LOOT = 0x3, GROUP_LOOT_SETTING_NEED_BEFORE_GREED = 0x4, } e_group_loot_setting; static const value_string e_group_loot_setting_strings[] = { { GROUP_LOOT_SETTING_FREE_FOR_ALL, "Free For All" }, { GROUP_LOOT_SETTING_ROUND_ROBIN, "Round Robin" }, { GROUP_LOOT_SETTING_MASTER_LOOT, "Master Loot" }, { GROUP_LOOT_SETTING_GROUP_LOOT, "Group Loot" }, { GROUP_LOOT_SETTING_NEED_BEFORE_GREED, "Need Before Greed" }, { 0, NULL } }; typedef enum { ROLL_VOTE_PASS = 0x0, ROLL_VOTE_NEED = 0x1, ROLL_VOTE_GREED = 0x2, } e_roll_vote; static const value_string e_roll_vote_strings[] = { { ROLL_VOTE_PASS, "Pass" }, { ROLL_VOTE_NEED, "Need" }, { ROLL_VOTE_GREED, "Greed" }, { 0, NULL } }; typedef enum { CHAT_TYPE_SAY = 0x00, CHAT_TYPE_PARTY = 0x01, CHAT_TYPE_RAID = 0x02, CHAT_TYPE_GUILD = 0x03, CHAT_TYPE_OFFICER = 0x04, CHAT_TYPE_YELL = 0x05, CHAT_TYPE_WHISPER = 0x06, CHAT_TYPE_WHISPER_INFORM = 0x07, CHAT_TYPE_EMOTE = 0x08, CHAT_TYPE_TEXT_EMOTE = 0x09, CHAT_TYPE_SYSTEM = 0x0A, CHAT_TYPE_MONSTER_SAY = 0x0B, CHAT_TYPE_MONSTER_YELL = 0x0C, CHAT_TYPE_MONSTER_EMOTE = 0x0D, CHAT_TYPE_CHANNEL = 0x0E, CHAT_TYPE_CHANNEL_JOIN = 0x0F, CHAT_TYPE_CHANNEL_LEAVE = 0x10, CHAT_TYPE_CHANNEL_LIST = 0x11, CHAT_TYPE_CHANNEL_NOTICE = 0x12, CHAT_TYPE_CHANNEL_NOTICE_USER = 0x13, CHAT_TYPE_AFK = 0x14, CHAT_TYPE_DND = 0x15, CHAT_TYPE_IGNORED = 0x16, CHAT_TYPE_SKILL = 0x17, CHAT_TYPE_LOOT = 0x18, CHAT_TYPE_MONSTER_WHISPER = 0x1A, CHAT_TYPE_BG_SYSTEM_NEUTRAL = 0x52, CHAT_TYPE_BG_SYSTEM_ALLIANCE = 0x53, CHAT_TYPE_BG_SYSTEM_HORDE = 0x54, CHAT_TYPE_RAID_LEADER = 0x57, CHAT_TYPE_RAID_WARNING = 0x58, CHAT_TYPE_RAID_BOSS_WHISPER = 0x59, CHAT_TYPE_RAID_BOSS_EMOTE = 0x5A, CHAT_TYPE_BATTLEGROUND = 0x5C, CHAT_TYPE_BATTLEGROUND_LEADER = 0x5D, } e_chat_type; static const value_string e_chat_type_strings[] = { { CHAT_TYPE_SAY, "Say" }, { CHAT_TYPE_PARTY, "Party" }, { CHAT_TYPE_RAID, "Raid" }, { CHAT_TYPE_GUILD, "Guild" }, { CHAT_TYPE_OFFICER, "Officer" }, { CHAT_TYPE_YELL, "Yell" }, { CHAT_TYPE_WHISPER, "Whisper" }, { CHAT_TYPE_WHISPER_INFORM, "Whisper Inform" }, { CHAT_TYPE_EMOTE, "Emote" }, { CHAT_TYPE_TEXT_EMOTE, "Text Emote" }, { CHAT_TYPE_SYSTEM, "System" }, { CHAT_TYPE_MONSTER_SAY, "Monster Say" }, { CHAT_TYPE_MONSTER_YELL, "Monster Yell" }, { CHAT_TYPE_MONSTER_EMOTE, "Monster Emote" }, { CHAT_TYPE_CHANNEL, "Channel" }, { CHAT_TYPE_CHANNEL_JOIN, "Channel Join" }, { CHAT_TYPE_CHANNEL_LEAVE, "Channel Leave" }, { CHAT_TYPE_CHANNEL_LIST, "Channel List" }, { CHAT_TYPE_CHANNEL_NOTICE, "Channel Notice" }, { CHAT_TYPE_CHANNEL_NOTICE_USER, "Channel Notice User" }, { CHAT_TYPE_AFK, "Afk" }, { CHAT_TYPE_DND, "Dnd" }, { CHAT_TYPE_IGNORED, "Ignored" }, { CHAT_TYPE_SKILL, "Skill" }, { CHAT_TYPE_LOOT, "Loot" }, { CHAT_TYPE_MONSTER_WHISPER, "Monster Whisper" }, { CHAT_TYPE_BG_SYSTEM_NEUTRAL, "Bg System Neutral" }, { CHAT_TYPE_BG_SYSTEM_ALLIANCE, "Bg System Alliance" }, { CHAT_TYPE_BG_SYSTEM_HORDE, "Bg System Horde" }, { CHAT_TYPE_RAID_LEADER, "Raid Leader" }, { CHAT_TYPE_RAID_WARNING, "Raid Warning" }, { CHAT_TYPE_RAID_BOSS_WHISPER, "Raid Boss Whisper" }, { CHAT_TYPE_RAID_BOSS_EMOTE, "Raid Boss Emote" }, { CHAT_TYPE_BATTLEGROUND, "Battleground" }, { CHAT_TYPE_BATTLEGROUND_LEADER, "Battleground Leader" }, { 0, NULL } }; typedef enum { SHEATH_STATE_UNARMED = 0x0, SHEATH_STATE_MELEE = 0x1, SHEATH_STATE_RANGED = 0x2, } e_sheath_state; static const value_string e_sheath_state_strings[] = { { SHEATH_STATE_UNARMED, "Unarmed" }, { SHEATH_STATE_MELEE, "Melee" }, { SHEATH_STATE_RANGED, "Ranged" }, { 0, NULL } }; typedef enum { UNIT_STAND_STATE_STAND = 0x0, UNIT_STAND_STATE_SIT = 0x1, UNIT_STAND_STATE_SIT_CHAIR = 0x2, UNIT_STAND_STATE_SLEEP = 0x3, UNIT_STAND_STATE_SIT_LOW_CHAIR = 0x4, UNIT_STAND_STATE_SIT_MEDIUM_CHAIR = 0x5, UNIT_STAND_STATE_SIT_HIGH_CHAIR = 0x6, UNIT_STAND_STATE_DEAD = 0x7, UNIT_STAND_STATE_KNEEL = 0x8, UNIT_STAND_STATE_CUSTOM = 0x9, } e_unit_stand_state; static const value_string e_unit_stand_state_strings[] = { { UNIT_STAND_STATE_STAND, "Stand" }, { UNIT_STAND_STATE_SIT, "Sit" }, { UNIT_STAND_STATE_SIT_CHAIR, "Sit Chair" }, { UNIT_STAND_STATE_SLEEP, "Sleep" }, { UNIT_STAND_STATE_SIT_LOW_CHAIR, "Sit Low Chair" }, { UNIT_STAND_STATE_SIT_MEDIUM_CHAIR, "Sit Medium Chair" }, { UNIT_STAND_STATE_SIT_HIGH_CHAIR, "Sit High Chair" }, { UNIT_STAND_STATE_DEAD, "Dead" }, { UNIT_STAND_STATE_KNEEL, "Kneel" }, { UNIT_STAND_STATE_CUSTOM, "Custom" }, { 0, NULL } }; typedef enum { ITEM_SLOT_HEAD = 0x00, ITEM_SLOT_NECK = 0x01, ITEM_SLOT_SHOULDERS = 0x02, ITEM_SLOT_SHIRT = 0x03, ITEM_SLOT_CHEST = 0x04, ITEM_SLOT_WAIST = 0x05, ITEM_SLOT_LEGS = 0x06, ITEM_SLOT_BOOTS = 0x07, ITEM_SLOT_WRIST = 0x08, ITEM_SLOT_HANDS = 0x09, ITEM_SLOT_RING1 = 0x0A, ITEM_SLOT_RING2 = 0x0B, ITEM_SLOT_TRINKET1 = 0x0C, ITEM_SLOT_TRINKET2 = 0x0D, ITEM_SLOT_BACK = 0x0E, ITEM_SLOT_MAIN_HAND = 0x0F, ITEM_SLOT_OFF_HAND = 0x10, ITEM_SLOT_RANGED_OR_RELIC = 0x11, ITEM_SLOT_TABARD = 0x12, ITEM_SLOT_BAG1 = 0x13, ITEM_SLOT_BAG2 = 0x14, ITEM_SLOT_BAG3 = 0x15, ITEM_SLOT_BAG4 = 0x16, ITEM_SLOT_INVENTORY_0 = 0x17, ITEM_SLOT_INVENTORY_1 = 0x18, ITEM_SLOT_INVENTORY_2 = 0x19, ITEM_SLOT_INVENTORY_3 = 0x1A, ITEM_SLOT_INVENTORY_4 = 0x1B, ITEM_SLOT_INVENTORY_5 = 0x1C, ITEM_SLOT_INVENTORY_6 = 0x1D, ITEM_SLOT_INVENTORY_7 = 0x1E, ITEM_SLOT_INVENTORY_8 = 0x1F, ITEM_SLOT_INVENTORY_9 = 0x20, ITEM_SLOT_INVENTORY_10 = 0x21, ITEM_SLOT_INVENTORY_11 = 0x22, ITEM_SLOT_INVENTORY_12 = 0x23, ITEM_SLOT_INVENTORY_13 = 0x24, ITEM_SLOT_INVENTORY_14 = 0x25, ITEM_SLOT_INVENTORY_15 = 0x26, ITEM_SLOT_BANK_1 = 0x27, ITEM_SLOT_BANK_2 = 0x28, ITEM_SLOT_BANK_3 = 0x29, ITEM_SLOT_BANK_4 = 0x2A, ITEM_SLOT_BANK_5 = 0x2B, ITEM_SLOT_BANK_6 = 0x2C, ITEM_SLOT_BANK_7 = 0x2D, ITEM_SLOT_BANK_8 = 0x2E, ITEM_SLOT_BANK_9 = 0x2F, ITEM_SLOT_BANK_10 = 0x30, ITEM_SLOT_BANK_11 = 0x31, ITEM_SLOT_BANK_12 = 0x32, ITEM_SLOT_BANK_13 = 0x33, ITEM_SLOT_BANK_14 = 0x34, ITEM_SLOT_BANK_15 = 0x35, ITEM_SLOT_BANK_16 = 0x36, ITEM_SLOT_BANK_17 = 0x37, ITEM_SLOT_BANK_18 = 0x38, ITEM_SLOT_BANK_19 = 0x39, ITEM_SLOT_BANK_20 = 0x3A, ITEM_SLOT_BANK_21 = 0x3B, ITEM_SLOT_BANK_22 = 0x3C, ITEM_SLOT_BANK_23 = 0x3D, ITEM_SLOT_BANK_24 = 0x3E, ITEM_SLOT_BANK_BAG_SLOT_1 = 0x3F, ITEM_SLOT_BANK_BAG_SLOT_2 = 0x40, ITEM_SLOT_BANK_BAG_SLOT_3 = 0x41, ITEM_SLOT_BANK_BAG_SLOT_4 = 0x42, ITEM_SLOT_BANK_BAG_SLOT_5 = 0x43, ITEM_SLOT_BANK_BAG_SLOT_6 = 0x44, ITEM_SLOT_VENDOR_BUYBACK_1 = 0x45, ITEM_SLOT_VENDOR_BUYBACK_2 = 0x46, ITEM_SLOT_VENDOR_BUYBACK_3 = 0x47, ITEM_SLOT_VENDOR_BUYBACK_4 = 0x48, ITEM_SLOT_VENDOR_BUYBACK_5 = 0x49, ITEM_SLOT_VENDOR_BUYBACK_6 = 0x4A, ITEM_SLOT_VENDOR_BUYBACK_7 = 0x4B, ITEM_SLOT_VENDOR_BUYBACK_8 = 0x4C, ITEM_SLOT_VENDOR_BUYBACK_9 = 0x4D, ITEM_SLOT_VENDOR_BUYBACK_10 = 0x4E, ITEM_SLOT_VENDOR_BUYBACK_11 = 0x4F, ITEM_SLOT_VENDOR_BUYBACK_12 = 0x50, ITEM_SLOT_KEYRING_1 = 0x51, ITEM_SLOT_KEYRING_2 = 0x52, ITEM_SLOT_KEYRING_3 = 0x53, ITEM_SLOT_KEYRING_4 = 0x54, ITEM_SLOT_KEYRING_5 = 0x55, ITEM_SLOT_KEYRING_6 = 0x56, ITEM_SLOT_KEYRING_7 = 0x57, ITEM_SLOT_KEYRING_8 = 0x58, ITEM_SLOT_KEYRING_9 = 0x59, ITEM_SLOT_KEYRING_10 = 0x5A, ITEM_SLOT_KEYRING_11 = 0x5B, ITEM_SLOT_KEYRING_12 = 0x5C, ITEM_SLOT_KEYRING_13 = 0x5D, ITEM_SLOT_KEYRING_14 = 0x5E, ITEM_SLOT_KEYRING_15 = 0x5F, ITEM_SLOT_KEYRING_16 = 0x60, ITEM_SLOT_KEYRING_17 = 0x61, ITEM_SLOT_KEYRING_18 = 0x62, ITEM_SLOT_KEYRING_19 = 0x63, ITEM_SLOT_KEYRING_20 = 0x64, ITEM_SLOT_KEYRING_21 = 0x65, ITEM_SLOT_KEYRING_22 = 0x66, ITEM_SLOT_KEYRING_23 = 0x67, ITEM_SLOT_KEYRING_24 = 0x68, ITEM_SLOT_KEYRING_25 = 0x69, ITEM_SLOT_KEYRING_26 = 0x6A, ITEM_SLOT_KEYRING_27 = 0x6B, ITEM_SLOT_KEYRING_28 = 0x6C, ITEM_SLOT_KEYRING_29 = 0x6D, ITEM_SLOT_KEYRING_30 = 0x6E, ITEM_SLOT_KEYRING_31 = 0x6F, ITEM_SLOT_KEYRING_32 = 0x70, } e_item_slot; static const value_string e_item_slot_strings[] = { { ITEM_SLOT_HEAD, "Head" }, { ITEM_SLOT_NECK, "Neck" }, { ITEM_SLOT_SHOULDERS, "Shoulders" }, { ITEM_SLOT_SHIRT, "Shirt" }, { ITEM_SLOT_CHEST, "Chest" }, { ITEM_SLOT_WAIST, "Waist" }, { ITEM_SLOT_LEGS, "Legs" }, { ITEM_SLOT_BOOTS, "Boots" }, { ITEM_SLOT_WRIST, "Wrist" }, { ITEM_SLOT_HANDS, "Hands" }, { ITEM_SLOT_RING1, "Ring1" }, { ITEM_SLOT_RING2, "Ring2" }, { ITEM_SLOT_TRINKET1, "Trinket1" }, { ITEM_SLOT_TRINKET2, "Trinket2" }, { ITEM_SLOT_BACK, "Back" }, { ITEM_SLOT_MAIN_HAND, "Main Hand" }, { ITEM_SLOT_OFF_HAND, "Off Hand" }, { ITEM_SLOT_RANGED_OR_RELIC, "Ranged Or Relic" }, { ITEM_SLOT_TABARD, "Tabard" }, { ITEM_SLOT_BAG1, "Bag1" }, { ITEM_SLOT_BAG2, "Bag2" }, { ITEM_SLOT_BAG3, "Bag3" }, { ITEM_SLOT_BAG4, "Bag4" }, { ITEM_SLOT_INVENTORY_0, "Inventory 0" }, { ITEM_SLOT_INVENTORY_1, "Inventory 1" }, { ITEM_SLOT_INVENTORY_2, "Inventory 2" }, { ITEM_SLOT_INVENTORY_3, "Inventory 3" }, { ITEM_SLOT_INVENTORY_4, "Inventory 4" }, { ITEM_SLOT_INVENTORY_5, "Inventory 5" }, { ITEM_SLOT_INVENTORY_6, "Inventory 6" }, { ITEM_SLOT_INVENTORY_7, "Inventory 7" }, { ITEM_SLOT_INVENTORY_8, "Inventory 8" }, { ITEM_SLOT_INVENTORY_9, "Inventory 9" }, { ITEM_SLOT_INVENTORY_10, "Inventory 10" }, { ITEM_SLOT_INVENTORY_11, "Inventory 11" }, { ITEM_SLOT_INVENTORY_12, "Inventory 12" }, { ITEM_SLOT_INVENTORY_13, "Inventory 13" }, { ITEM_SLOT_INVENTORY_14, "Inventory 14" }, { ITEM_SLOT_INVENTORY_15, "Inventory 15" }, { ITEM_SLOT_BANK_1, "Bank 1" }, { ITEM_SLOT_BANK_2, "Bank 2" }, { ITEM_SLOT_BANK_3, "Bank 3" }, { ITEM_SLOT_BANK_4, "Bank 4" }, { ITEM_SLOT_BANK_5, "Bank 5" }, { ITEM_SLOT_BANK_6, "Bank 6" }, { ITEM_SLOT_BANK_7, "Bank 7" }, { ITEM_SLOT_BANK_8, "Bank 8" }, { ITEM_SLOT_BANK_9, "Bank 9" }, { ITEM_SLOT_BANK_10, "Bank 10" }, { ITEM_SLOT_BANK_11, "Bank 11" }, { ITEM_SLOT_BANK_12, "Bank 12" }, { ITEM_SLOT_BANK_13, "Bank 13" }, { ITEM_SLOT_BANK_14, "Bank 14" }, { ITEM_SLOT_BANK_15, "Bank 15" }, { ITEM_SLOT_BANK_16, "Bank 16" }, { ITEM_SLOT_BANK_17, "Bank 17" }, { ITEM_SLOT_BANK_18, "Bank 18" }, { ITEM_SLOT_BANK_19, "Bank 19" }, { ITEM_SLOT_BANK_20, "Bank 20" }, { ITEM_SLOT_BANK_21, "Bank 21" }, { ITEM_SLOT_BANK_22, "Bank 22" }, { ITEM_SLOT_BANK_23, "Bank 23" }, { ITEM_SLOT_BANK_24, "Bank 24" }, { ITEM_SLOT_BANK_BAG_SLOT_1, "Bank Bag Slot 1" }, { ITEM_SLOT_BANK_BAG_SLOT_2, "Bank Bag Slot 2" }, { ITEM_SLOT_BANK_BAG_SLOT_3, "Bank Bag Slot 3" }, { ITEM_SLOT_BANK_BAG_SLOT_4, "Bank Bag Slot 4" }, { ITEM_SLOT_BANK_BAG_SLOT_5, "Bank Bag Slot 5" }, { ITEM_SLOT_BANK_BAG_SLOT_6, "Bank Bag Slot 6" }, { ITEM_SLOT_VENDOR_BUYBACK_1, "Vendor Buyback 1" }, { ITEM_SLOT_VENDOR_BUYBACK_2, "Vendor Buyback 2" }, { ITEM_SLOT_VENDOR_BUYBACK_3, "Vendor Buyback 3" }, { ITEM_SLOT_VENDOR_BUYBACK_4, "Vendor Buyback 4" }, { ITEM_SLOT_VENDOR_BUYBACK_5, "Vendor Buyback 5" }, { ITEM_SLOT_VENDOR_BUYBACK_6, "Vendor Buyback 6" }, { ITEM_SLOT_VENDOR_BUYBACK_7, "Vendor Buyback 7" }, { ITEM_SLOT_VENDOR_BUYBACK_8, "Vendor Buyback 8" }, { ITEM_SLOT_VENDOR_BUYBACK_9, "Vendor Buyback 9" }, { ITEM_SLOT_VENDOR_BUYBACK_10, "Vendor Buyback 10" }, { ITEM_SLOT_VENDOR_BUYBACK_11, "Vendor Buyback 11" }, { ITEM_SLOT_VENDOR_BUYBACK_12, "Vendor Buyback 12" }, { ITEM_SLOT_KEYRING_1, "Keyring 1" }, { ITEM_SLOT_KEYRING_2, "Keyring 2" }, { ITEM_SLOT_KEYRING_3, "Keyring 3" }, { ITEM_SLOT_KEYRING_4, "Keyring 4" }, { ITEM_SLOT_KEYRING_5, "Keyring 5" }, { ITEM_SLOT_KEYRING_6, "Keyring 6" }, { ITEM_SLOT_KEYRING_7, "Keyring 7" }, { ITEM_SLOT_KEYRING_8, "Keyring 8" }, { ITEM_SLOT_KEYRING_9, "Keyring 9" }, { ITEM_SLOT_KEYRING_10, "Keyring 10" }, { ITEM_SLOT_KEYRING_11, "Keyring 11" }, { ITEM_SLOT_KEYRING_12, "Keyring 12" }, { ITEM_SLOT_KEYRING_13, "Keyring 13" }, { ITEM_SLOT_KEYRING_14, "Keyring 14" }, { ITEM_SLOT_KEYRING_15, "Keyring 15" }, { ITEM_SLOT_KEYRING_16, "Keyring 16" }, { ITEM_SLOT_KEYRING_17, "Keyring 17" }, { ITEM_SLOT_KEYRING_18, "Keyring 18" }, { ITEM_SLOT_KEYRING_19, "Keyring 19" }, { ITEM_SLOT_KEYRING_20, "Keyring 20" }, { ITEM_SLOT_KEYRING_21, "Keyring 21" }, { ITEM_SLOT_KEYRING_22, "Keyring 22" }, { ITEM_SLOT_KEYRING_23, "Keyring 23" }, { ITEM_SLOT_KEYRING_24, "Keyring 24" }, { ITEM_SLOT_KEYRING_25, "Keyring 25" }, { ITEM_SLOT_KEYRING_26, "Keyring 26" }, { ITEM_SLOT_KEYRING_27, "Keyring 27" }, { ITEM_SLOT_KEYRING_28, "Keyring 28" }, { ITEM_SLOT_KEYRING_29, "Keyring 29" }, { ITEM_SLOT_KEYRING_30, "Keyring 30" }, { ITEM_SLOT_KEYRING_31, "Keyring 31" }, { ITEM_SLOT_KEYRING_32, "Keyring 32" }, { 0, NULL } }; typedef enum { TEXT_EMOTE_AGREE = 0x001, TEXT_EMOTE_AMAZE = 0x002, TEXT_EMOTE_ANGRY = 0x003, TEXT_EMOTE_APOLOGIZE = 0x004, TEXT_EMOTE_APPLAUD = 0x005, TEXT_EMOTE_BASHFUL = 0x006, TEXT_EMOTE_BECKON = 0x007, TEXT_EMOTE_BEG = 0x008, TEXT_EMOTE_BITE = 0x009, TEXT_EMOTE_BLEED = 0x00A, TEXT_EMOTE_BLINK = 0x00B, TEXT_EMOTE_BLUSH = 0x00C, TEXT_EMOTE_BONK = 0x00D, TEXT_EMOTE_BORED = 0x00E, TEXT_EMOTE_BOUNCE = 0x00F, TEXT_EMOTE_BRB = 0x010, TEXT_EMOTE_BOW = 0x011, TEXT_EMOTE_BURP = 0x012, TEXT_EMOTE_BYE = 0x013, TEXT_EMOTE_CACKLE = 0x014, TEXT_EMOTE_CHEER = 0x015, TEXT_EMOTE_CHICKEN = 0x016, TEXT_EMOTE_CHUCKLE = 0x017, TEXT_EMOTE_CLAP = 0x018, TEXT_EMOTE_CONFUSED = 0x019, TEXT_EMOTE_CONGRATULATE = 0x01A, TEXT_EMOTE_COUGH = 0x01B, TEXT_EMOTE_COWER = 0x01C, TEXT_EMOTE_CRACK = 0x01D, TEXT_EMOTE_CRINGE = 0x01E, TEXT_EMOTE_CRY = 0x01F, TEXT_EMOTE_CURIOUS = 0x020, TEXT_EMOTE_CURTSEY = 0x021, TEXT_EMOTE_DANCE = 0x022, TEXT_EMOTE_DRINK = 0x023, TEXT_EMOTE_DROOL = 0x024, TEXT_EMOTE_EAT = 0x025, TEXT_EMOTE_EYE = 0x026, TEXT_EMOTE_FART = 0x027, TEXT_EMOTE_FIDGET = 0x028, TEXT_EMOTE_FLEX = 0x029, TEXT_EMOTE_FROWN = 0x02A, TEXT_EMOTE_GASP = 0x02B, TEXT_EMOTE_GAZE = 0x02C, TEXT_EMOTE_GIGGLE = 0x02D, TEXT_EMOTE_GLARE = 0x02E, TEXT_EMOTE_GLOAT = 0x02F, TEXT_EMOTE_GREET = 0x030, TEXT_EMOTE_GRIN = 0x031, TEXT_EMOTE_GROAN = 0x032, TEXT_EMOTE_GROVEL = 0x033, TEXT_EMOTE_GUFFAW = 0x034, TEXT_EMOTE_HAIL = 0x035, TEXT_EMOTE_HAPPY = 0x036, TEXT_EMOTE_HELLO = 0x037, TEXT_EMOTE_HUG = 0x038, TEXT_EMOTE_HUNGRY = 0x039, TEXT_EMOTE_KISS = 0x03A, TEXT_EMOTE_KNEEL = 0x03B, TEXT_EMOTE_LAUGH = 0x03C, TEXT_EMOTE_LAYDOWN = 0x03D, TEXT_EMOTE_MASSAGE = 0x03E, TEXT_EMOTE_MOAN = 0x03F, TEXT_EMOTE_MOON = 0x040, TEXT_EMOTE_MOURN = 0x041, TEXT_EMOTE_NO = 0x042, TEXT_EMOTE_NOD = 0x043, TEXT_EMOTE_NOSE_PICK = 0x044, TEXT_EMOTE_PANIC = 0x045, TEXT_EMOTE_PEER = 0x046, TEXT_EMOTE_PLEAD = 0x047, TEXT_EMOTE_POINT = 0x048, TEXT_EMOTE_POKE = 0x049, TEXT_EMOTE_PRAY = 0x04A, TEXT_EMOTE_ROAR = 0x04B, TEXT_EMOTE_ROFL = 0x04C, TEXT_EMOTE_RUDE = 0x04D, TEXT_EMOTE_SALUTE = 0x04E, TEXT_EMOTE_SCRATCH = 0x04F, TEXT_EMOTE_SEXY = 0x050, TEXT_EMOTE_SHAKE = 0x051, TEXT_EMOTE_SHOUT = 0x052, TEXT_EMOTE_SHRUG = 0x053, TEXT_EMOTE_SHY = 0x054, TEXT_EMOTE_SIGH = 0x055, TEXT_EMOTE_SIT = 0x056, TEXT_EMOTE_SLEEP = 0x057, TEXT_EMOTE_SNARL = 0x058, TEXT_EMOTE_SPIT = 0x059, TEXT_EMOTE_STARE = 0x05A, TEXT_EMOTE_SURPRISED = 0x05B, TEXT_EMOTE_SURRENDER = 0x05C, TEXT_EMOTE_TALK = 0x05D, TEXT_EMOTE_TALK_EX = 0x05E, TEXT_EMOTE_TALK_Q = 0x05F, TEXT_EMOTE_TAP = 0x060, TEXT_EMOTE_THANK = 0x061, TEXT_EMOTE_THREATEN = 0x062, TEXT_EMOTE_TIRED = 0x063, TEXT_EMOTE_VICTORY = 0x064, TEXT_EMOTE_WAVE = 0x065, TEXT_EMOTE_WELCOME = 0x066, TEXT_EMOTE_WHINE = 0x067, TEXT_EMOTE_WHISTLE = 0x068, TEXT_EMOTE_WORK = 0x069, TEXT_EMOTE_YAWN = 0x06A, TEXT_EMOTE_BOGGLE = 0x06B, TEXT_EMOTE_CALM = 0x06C, TEXT_EMOTE_COLD = 0x06D, TEXT_EMOTE_COMFORT = 0x06E, TEXT_EMOTE_CUDDLE = 0x06F, TEXT_EMOTE_DUCK = 0x070, TEXT_EMOTE_INSULT = 0x071, TEXT_EMOTE_INTRODUCE = 0x072, TEXT_EMOTE_JK = 0x073, TEXT_EMOTE_LICK = 0x074, TEXT_EMOTE_LISTEN = 0x075, TEXT_EMOTE_LOST = 0x076, TEXT_EMOTE_MOCK = 0x077, TEXT_EMOTE_PONDER = 0x078, TEXT_EMOTE_POUNCE = 0x079, TEXT_EMOTE_PRAISE = 0x07A, TEXT_EMOTE_PURR = 0x07B, TEXT_EMOTE_PUZZLE = 0x07C, TEXT_EMOTE_RAISE = 0x07D, TEXT_EMOTE_READY = 0x07E, TEXT_EMOTE_SHIMMY = 0x07F, TEXT_EMOTE_SHIVER = 0x080, TEXT_EMOTE_SHOO = 0x081, TEXT_EMOTE_SLAP = 0x082, TEXT_EMOTE_SMIRK = 0x083, TEXT_EMOTE_SNIFF = 0x084, TEXT_EMOTE_SNUB = 0x085, TEXT_EMOTE_SOOTHE = 0x086, TEXT_EMOTE_STINK = 0x087, TEXT_EMOTE_TAUNT = 0x088, TEXT_EMOTE_TEASE = 0x089, TEXT_EMOTE_THIRSTY = 0x08A, TEXT_EMOTE_VETO = 0x08B, TEXT_EMOTE_SNICKER = 0x08C, TEXT_EMOTE_STAND = 0x08D, TEXT_EMOTE_TICKLE = 0x08E, TEXT_EMOTE_VIOLIN = 0x08F, TEXT_EMOTE_SMILE = 0x0A3, TEXT_EMOTE_RASP = 0x0B7, TEXT_EMOTE_PITY = 0x0CB, TEXT_EMOTE_GROWL = 0x0CC, TEXT_EMOTE_BARK = 0x0CD, TEXT_EMOTE_SCARED = 0x0DF, TEXT_EMOTE_FLOP = 0x0E0, TEXT_EMOTE_LOVE = 0x0E1, TEXT_EMOTE_MOO = 0x0E2, TEXT_EMOTE_COMMEND = 0x0F3, TEXT_EMOTE_TRAIN = 0x108, TEXT_EMOTE_HELPME = 0x12F, TEXT_EMOTE_INCOMING = 0x130, TEXT_EMOTE_CHARGE = 0x131, TEXT_EMOTE_FLEE = 0x132, TEXT_EMOTE_ATTACK_MY_TARGET = 0x133, TEXT_EMOTE_OOM = 0x143, TEXT_EMOTE_FOLLOW = 0x144, TEXT_EMOTE_WAIT = 0x145, TEXT_EMOTE_HEAL_ME = 0x146, TEXT_EMOTE_OPEN_FIRE = 0x147, TEXT_EMOTE_FLIRT = 0x148, TEXT_EMOTE_JOKE = 0x149, TEXT_EMOTE_GOLF_CLAP = 0x157, TEXT_EMOTE_WINK = 0x16B, TEXT_EMOTE_PAT = 0x16C, } e_text_emote; static const value_string e_text_emote_strings[] = { { TEXT_EMOTE_AGREE, "Agree" }, { TEXT_EMOTE_AMAZE, "Amaze" }, { TEXT_EMOTE_ANGRY, "Angry" }, { TEXT_EMOTE_APOLOGIZE, "Apologize" }, { TEXT_EMOTE_APPLAUD, "Applaud" }, { TEXT_EMOTE_BASHFUL, "Bashful" }, { TEXT_EMOTE_BECKON, "Beckon" }, { TEXT_EMOTE_BEG, "Beg" }, { TEXT_EMOTE_BITE, "Bite" }, { TEXT_EMOTE_BLEED, "Bleed" }, { TEXT_EMOTE_BLINK, "Blink" }, { TEXT_EMOTE_BLUSH, "Blush" }, { TEXT_EMOTE_BONK, "Bonk" }, { TEXT_EMOTE_BORED, "Bored" }, { TEXT_EMOTE_BOUNCE, "Bounce" }, { TEXT_EMOTE_BRB, "Brb" }, { TEXT_EMOTE_BOW, "Bow" }, { TEXT_EMOTE_BURP, "Burp" }, { TEXT_EMOTE_BYE, "Bye" }, { TEXT_EMOTE_CACKLE, "Cackle" }, { TEXT_EMOTE_CHEER, "Cheer" }, { TEXT_EMOTE_CHICKEN, "Chicken" }, { TEXT_EMOTE_CHUCKLE, "Chuckle" }, { TEXT_EMOTE_CLAP, "Clap" }, { TEXT_EMOTE_CONFUSED, "Confused" }, { TEXT_EMOTE_CONGRATULATE, "Congratulate" }, { TEXT_EMOTE_COUGH, "Cough" }, { TEXT_EMOTE_COWER, "Cower" }, { TEXT_EMOTE_CRACK, "Crack" }, { TEXT_EMOTE_CRINGE, "Cringe" }, { TEXT_EMOTE_CRY, "Cry" }, { TEXT_EMOTE_CURIOUS, "Curious" }, { TEXT_EMOTE_CURTSEY, "Curtsey" }, { TEXT_EMOTE_DANCE, "Dance" }, { TEXT_EMOTE_DRINK, "Drink" }, { TEXT_EMOTE_DROOL, "Drool" }, { TEXT_EMOTE_EAT, "Eat" }, { TEXT_EMOTE_EYE, "Eye" }, { TEXT_EMOTE_FART, "Fart" }, { TEXT_EMOTE_FIDGET, "Fidget" }, { TEXT_EMOTE_FLEX, "Flex" }, { TEXT_EMOTE_FROWN, "Frown" }, { TEXT_EMOTE_GASP, "Gasp" }, { TEXT_EMOTE_GAZE, "Gaze" }, { TEXT_EMOTE_GIGGLE, "Giggle" }, { TEXT_EMOTE_GLARE, "Glare" }, { TEXT_EMOTE_GLOAT, "Gloat" }, { TEXT_EMOTE_GREET, "Greet" }, { TEXT_EMOTE_GRIN, "Grin" }, { TEXT_EMOTE_GROAN, "Groan" }, { TEXT_EMOTE_GROVEL, "Grovel" }, { TEXT_EMOTE_GUFFAW, "Guffaw" }, { TEXT_EMOTE_HAIL, "Hail" }, { TEXT_EMOTE_HAPPY, "Happy" }, { TEXT_EMOTE_HELLO, "Hello" }, { TEXT_EMOTE_HUG, "Hug" }, { TEXT_EMOTE_HUNGRY, "Hungry" }, { TEXT_EMOTE_KISS, "Kiss" }, { TEXT_EMOTE_KNEEL, "Kneel" }, { TEXT_EMOTE_LAUGH, "Laugh" }, { TEXT_EMOTE_LAYDOWN, "Laydown" }, { TEXT_EMOTE_MASSAGE, "Massage" }, { TEXT_EMOTE_MOAN, "Moan" }, { TEXT_EMOTE_MOON, "Moon" }, { TEXT_EMOTE_MOURN, "Mourn" }, { TEXT_EMOTE_NO, "No" }, { TEXT_EMOTE_NOD, "Nod" }, { TEXT_EMOTE_NOSE_PICK, "Nose Pick" }, { TEXT_EMOTE_PANIC, "Panic" }, { TEXT_EMOTE_PEER, "Peer" }, { TEXT_EMOTE_PLEAD, "Plead" }, { TEXT_EMOTE_POINT, "Point" }, { TEXT_EMOTE_POKE, "Poke" }, { TEXT_EMOTE_PRAY, "Pray" }, { TEXT_EMOTE_ROAR, "Roar" }, { TEXT_EMOTE_ROFL, "Rofl" }, { TEXT_EMOTE_RUDE, "Rude" }, { TEXT_EMOTE_SALUTE, "Salute" }, { TEXT_EMOTE_SCRATCH, "Scratch" }, { TEXT_EMOTE_SEXY, "Sexy" }, { TEXT_EMOTE_SHAKE, "Shake" }, { TEXT_EMOTE_SHOUT, "Shout" }, { TEXT_EMOTE_SHRUG, "Shrug" }, { TEXT_EMOTE_SHY, "Shy" }, { TEXT_EMOTE_SIGH, "Sigh" }, { TEXT_EMOTE_SIT, "Sit" }, { TEXT_EMOTE_SLEEP, "Sleep" }, { TEXT_EMOTE_SNARL, "Snarl" }, { TEXT_EMOTE_SPIT, "Spit" }, { TEXT_EMOTE_STARE, "Stare" }, { TEXT_EMOTE_SURPRISED, "Surprised" }, { TEXT_EMOTE_SURRENDER, "Surrender" }, { TEXT_EMOTE_TALK, "Talk" }, { TEXT_EMOTE_TALK_EX, "Talk Ex" }, { TEXT_EMOTE_TALK_Q, "Talk Q" }, { TEXT_EMOTE_TAP, "Tap" }, { TEXT_EMOTE_THANK, "Thank" }, { TEXT_EMOTE_THREATEN, "Threaten" }, { TEXT_EMOTE_TIRED, "Tired" }, { TEXT_EMOTE_VICTORY, "Victory" }, { TEXT_EMOTE_WAVE, "Wave" }, { TEXT_EMOTE_WELCOME, "Welcome" }, { TEXT_EMOTE_WHINE, "Whine" }, { TEXT_EMOTE_WHISTLE, "Whistle" }, { TEXT_EMOTE_WORK, "Work" }, { TEXT_EMOTE_YAWN, "Yawn" }, { TEXT_EMOTE_BOGGLE, "Boggle" }, { TEXT_EMOTE_CALM, "Calm" }, { TEXT_EMOTE_COLD, "Cold" }, { TEXT_EMOTE_COMFORT, "Comfort" }, { TEXT_EMOTE_CUDDLE, "Cuddle" }, { TEXT_EMOTE_DUCK, "Duck" }, { TEXT_EMOTE_INSULT, "Insult" }, { TEXT_EMOTE_INTRODUCE, "Introduce" }, { TEXT_EMOTE_JK, "Jk" }, { TEXT_EMOTE_LICK, "Lick" }, { TEXT_EMOTE_LISTEN, "Listen" }, { TEXT_EMOTE_LOST, "Lost" }, { TEXT_EMOTE_MOCK, "Mock" }, { TEXT_EMOTE_PONDER, "Ponder" }, { TEXT_EMOTE_POUNCE, "Pounce" }, { TEXT_EMOTE_PRAISE, "Praise" }, { TEXT_EMOTE_PURR, "Purr" }, { TEXT_EMOTE_PUZZLE, "Puzzle" }, { TEXT_EMOTE_RAISE, "Raise" }, { TEXT_EMOTE_READY, "Ready" }, { TEXT_EMOTE_SHIMMY, "Shimmy" }, { TEXT_EMOTE_SHIVER, "Shiver" }, { TEXT_EMOTE_SHOO, "Shoo" }, { TEXT_EMOTE_SLAP, "Slap" }, { TEXT_EMOTE_SMIRK, "Smirk" }, { TEXT_EMOTE_SNIFF, "Sniff" }, { TEXT_EMOTE_SNUB, "Snub" }, { TEXT_EMOTE_SOOTHE, "Soothe" }, { TEXT_EMOTE_STINK, "Stink" }, { TEXT_EMOTE_TAUNT, "Taunt" }, { TEXT_EMOTE_TEASE, "Tease" }, { TEXT_EMOTE_THIRSTY, "Thirsty" }, { TEXT_EMOTE_VETO, "Veto" }, { TEXT_EMOTE_SNICKER, "Snicker" }, { TEXT_EMOTE_STAND, "Stand" }, { TEXT_EMOTE_TICKLE, "Tickle" }, { TEXT_EMOTE_VIOLIN, "Violin" }, { TEXT_EMOTE_SMILE, "Smile" }, { TEXT_EMOTE_RASP, "Rasp" }, { TEXT_EMOTE_PITY, "Pity" }, { TEXT_EMOTE_GROWL, "Growl" }, { TEXT_EMOTE_BARK, "Bark" }, { TEXT_EMOTE_SCARED, "Scared" }, { TEXT_EMOTE_FLOP, "Flop" }, { TEXT_EMOTE_LOVE, "Love" }, { TEXT_EMOTE_MOO, "Moo" }, { TEXT_EMOTE_COMMEND, "Commend" }, { TEXT_EMOTE_TRAIN, "Train" }, { TEXT_EMOTE_HELPME, "Helpme" }, { TEXT_EMOTE_INCOMING, "Incoming" }, { TEXT_EMOTE_CHARGE, "Charge" }, { TEXT_EMOTE_FLEE, "Flee" }, { TEXT_EMOTE_ATTACK_MY_TARGET, "Attack My Target" }, { TEXT_EMOTE_OOM, "Oom" }, { TEXT_EMOTE_FOLLOW, "Follow" }, { TEXT_EMOTE_WAIT, "Wait" }, { TEXT_EMOTE_HEAL_ME, "Heal Me" }, { TEXT_EMOTE_OPEN_FIRE, "Open Fire" }, { TEXT_EMOTE_FLIRT, "Flirt" }, { TEXT_EMOTE_JOKE, "Joke" }, { TEXT_EMOTE_GOLF_CLAP, "Golf Clap" }, { TEXT_EMOTE_WINK, "Wink" }, { TEXT_EMOTE_PAT, "Pat" }, { 0, NULL } }; typedef enum { ACCOUNT_DATA_TYPE_GLOBAL_CONFIG_CACHE = 0x0, ACCOUNT_DATA_TYPE_PER_CHARACTER_CONFIG_CACHE = 0x1, ACCOUNT_DATA_TYPE_GLOBAL_BINDINGS_CACHE = 0x2, ACCOUNT_DATA_TYPE_PER_CHARACTER_BINDINGS_CACHE = 0x3, ACCOUNT_DATA_TYPE_GLOBAL_MACROS_CACHE = 0x4, ACCOUNT_DATA_TYPE_PER_CHARACTER_MACROS_CACHE = 0x5, ACCOUNT_DATA_TYPE_PER_CHARACTER_LAYOUT_CACHE = 0x6, ACCOUNT_DATA_TYPE_PER_CHARACTER_CHAT_CACHE = 0x7, ACCOUNT_DATA_TYPE_NUM_ACCOUNT_DATA_TYPES = 0x8, } e_account_data_type; static const value_string e_account_data_type_strings[] = { { ACCOUNT_DATA_TYPE_GLOBAL_CONFIG_CACHE, "Global Config Cache" }, { ACCOUNT_DATA_TYPE_PER_CHARACTER_CONFIG_CACHE, "Per Character Config Cache" }, { ACCOUNT_DATA_TYPE_GLOBAL_BINDINGS_CACHE, "Global Bindings Cache" }, { ACCOUNT_DATA_TYPE_PER_CHARACTER_BINDINGS_CACHE, "Per Character Bindings Cache" }, { ACCOUNT_DATA_TYPE_GLOBAL_MACROS_CACHE, "Global Macros Cache" }, { ACCOUNT_DATA_TYPE_PER_CHARACTER_MACROS_CACHE, "Per Character Macros Cache" }, { ACCOUNT_DATA_TYPE_PER_CHARACTER_LAYOUT_CACHE, "Per Character Layout Cache" }, { ACCOUNT_DATA_TYPE_PER_CHARACTER_CHAT_CACHE, "Per Character Chat Cache" }, { ACCOUNT_DATA_TYPE_NUM_ACCOUNT_DATA_TYPES, "Num Account Data Types" }, { 0, NULL } }; typedef enum { AUCTION_HOUSE_STORMWIND = 0x1, AUCTION_HOUSE_ALLIANCE = 0x2, AUCTION_HOUSE_DARNASSUS = 0x3, AUCTION_HOUSE_UNDERCITY = 0x4, AUCTION_HOUSE_THUNDER_BLUFF = 0x5, AUCTION_HOUSE_HORDE = 0x6, AUCTION_HOUSE_GOBLIN = 0x7, } e_auction_house; static const value_string e_auction_house_strings[] = { { AUCTION_HOUSE_STORMWIND, "Stormwind" }, { AUCTION_HOUSE_ALLIANCE, "Alliance" }, { AUCTION_HOUSE_DARNASSUS, "Darnassus" }, { AUCTION_HOUSE_UNDERCITY, "Undercity" }, { AUCTION_HOUSE_THUNDER_BLUFF, "Thunder Bluff" }, { AUCTION_HOUSE_HORDE, "Horde" }, { AUCTION_HOUSE_GOBLIN, "Goblin" }, { 0, NULL } }; typedef enum { CORPSE_QUERY_RESULT_NOT_FOUND = 0x0, CORPSE_QUERY_RESULT_FOUND = 0x1, } e_corpse_query_result; static const value_string e_corpse_query_result_strings[] = { { CORPSE_QUERY_RESULT_NOT_FOUND, "Not Found" }, { CORPSE_QUERY_RESULT_FOUND, "Found" }, { 0, NULL } }; typedef enum { BATTLEGROUND_END_STATUS_NOT_ENDED = 0x0, BATTLEGROUND_END_STATUS_ENDED = 0x1, } e_battleground_end_status; static const value_string e_battleground_end_status_strings[] = { { BATTLEGROUND_END_STATUS_NOT_ENDED, "Not Ended" }, { BATTLEGROUND_END_STATUS_ENDED, "Ended" }, { 0, NULL } }; typedef enum { BATTLEGROUND_WINNER_HORDE = 0x0, BATTLEGROUND_WINNER_ALLIANCE = 0x1, BATTLEGROUND_WINNER_NONE = 0x2, } e_battleground_winner; static const value_string e_battleground_winner_strings[] = { { BATTLEGROUND_WINNER_HORDE, "Horde" }, { BATTLEGROUND_WINNER_ALLIANCE, "Alliance" }, { BATTLEGROUND_WINNER_NONE, "None" }, { 0, NULL } }; typedef enum { QUEST_PARTY_MESSAGE_SHARING_QUEST = 0x0, QUEST_PARTY_MESSAGE_CANT_TAKE_QUEST = 0x1, QUEST_PARTY_MESSAGE_ACCEPT_QUEST = 0x2, QUEST_PARTY_MESSAGE_DECLINE_QUEST = 0x3, QUEST_PARTY_MESSAGE_TOO_FAR = 0x4, QUEST_PARTY_MESSAGE_BUSY = 0x5, QUEST_PARTY_MESSAGE_LOG_FULL = 0x6, QUEST_PARTY_MESSAGE_HAVE_QUEST = 0x7, QUEST_PARTY_MESSAGE_FINISH_QUEST = 0x8, } e_quest_party_message; static const value_string e_quest_party_message_strings[] = { { QUEST_PARTY_MESSAGE_SHARING_QUEST, "Sharing Quest" }, { QUEST_PARTY_MESSAGE_CANT_TAKE_QUEST, "Cant Take Quest" }, { QUEST_PARTY_MESSAGE_ACCEPT_QUEST, "Accept Quest" }, { QUEST_PARTY_MESSAGE_DECLINE_QUEST, "Decline Quest" }, { QUEST_PARTY_MESSAGE_TOO_FAR, "Too Far" }, { QUEST_PARTY_MESSAGE_BUSY, "Busy" }, { QUEST_PARTY_MESSAGE_LOG_FULL, "Log Full" }, { QUEST_PARTY_MESSAGE_HAVE_QUEST, "Have Quest" }, { QUEST_PARTY_MESSAGE_FINISH_QUEST, "Finish Quest" }, { 0, NULL } }; typedef enum { RAID_TARGET_UPDATE_TYPE_PARTIAL = 0x0, RAID_TARGET_UPDATE_TYPE_FULL = 0x1, } e_raid_target_update_type; static const value_string e_raid_target_update_type_strings[] = { { RAID_TARGET_UPDATE_TYPE_PARTIAL, "Partial" }, { RAID_TARGET_UPDATE_TYPE_FULL, "Full" }, { 0, NULL } }; typedef enum { GUILD_EMBLEM_RESULT_SUCCESS = 0x0, GUILD_EMBLEM_RESULT_INVALID_TABARD_COLORS = 0x1, GUILD_EMBLEM_RESULT_NO_GUILD = 0x2, GUILD_EMBLEM_RESULT_NOT_GUILD_MASTER = 0x3, GUILD_EMBLEM_RESULT_NOT_ENOUGH_MONEY = 0x4, GUILD_EMBLEM_RESULT_NO_MESSAGE = 0x5, } e_guild_emblem_result; static const value_string e_guild_emblem_result_strings[] = { { GUILD_EMBLEM_RESULT_SUCCESS, "Success" }, { GUILD_EMBLEM_RESULT_INVALID_TABARD_COLORS, "Invalid Tabard Colors" }, { GUILD_EMBLEM_RESULT_NO_GUILD, "No Guild" }, { GUILD_EMBLEM_RESULT_NOT_GUILD_MASTER, "Not Guild Master" }, { GUILD_EMBLEM_RESULT_NOT_ENOUGH_MONEY, "Not Enough Money" }, { GUILD_EMBLEM_RESULT_NO_MESSAGE, "No Message" }, { 0, NULL } }; typedef enum { ACTIVATE_TAXI_REPLY_OK = 0x0, ACTIVATE_TAXI_REPLY_UNSPECIFIED_SERVER_ERROR = 0x1, ACTIVATE_TAXI_REPLY_NO_SUCH_PATH = 0x2, ACTIVATE_TAXI_REPLY_NOT_ENOUGH_MONEY = 0x3, ACTIVATE_TAXI_REPLY_TOO_FAR_AWAY = 0x4, ACTIVATE_TAXI_REPLY_NO_VENDOR_NEARBY = 0x5, ACTIVATE_TAXI_REPLY_NOT_VISITED = 0x6, ACTIVATE_TAXI_REPLY_PLAYER_BUSY = 0x7, ACTIVATE_TAXI_REPLY_PLAYER_ALREADY_MOUNTED = 0x8, ACTIVATE_TAXI_REPLY_PLAYER_SHAPE_SHIFTED = 0x9, ACTIVATE_TAXI_REPLY_PLAYER_MOVING = 0xA, ACTIVATE_TAXI_REPLY_SAME_NODE = 0xB, ACTIVATE_TAXI_REPLY_NOT_STANDING = 0xC, } e_activate_taxi_reply; static const value_string e_activate_taxi_reply_strings[] = { { ACTIVATE_TAXI_REPLY_OK, "Ok" }, { ACTIVATE_TAXI_REPLY_UNSPECIFIED_SERVER_ERROR, "Unspecified Server Error" }, { ACTIVATE_TAXI_REPLY_NO_SUCH_PATH, "No Such Path" }, { ACTIVATE_TAXI_REPLY_NOT_ENOUGH_MONEY, "Not Enough Money" }, { ACTIVATE_TAXI_REPLY_TOO_FAR_AWAY, "Too Far Away" }, { ACTIVATE_TAXI_REPLY_NO_VENDOR_NEARBY, "No Vendor Nearby" }, { ACTIVATE_TAXI_REPLY_NOT_VISITED, "Not Visited" }, { ACTIVATE_TAXI_REPLY_PLAYER_BUSY, "Player Busy" }, { ACTIVATE_TAXI_REPLY_PLAYER_ALREADY_MOUNTED, "Player Already Mounted" }, { ACTIVATE_TAXI_REPLY_PLAYER_SHAPE_SHIFTED, "Player Shape Shifted" }, { ACTIVATE_TAXI_REPLY_PLAYER_MOVING, "Player Moving" }, { ACTIVATE_TAXI_REPLY_SAME_NODE, "Same Node" }, { ACTIVATE_TAXI_REPLY_NOT_STANDING, "Not Standing" }, { 0, NULL } }; typedef enum { AI_REACTION_ALERT = 0x0, AI_REACTION_FRIENDLY = 0x1, AI_REACTION_HOSTILE = 0x2, AI_REACTION_AFRAID = 0x3, AI_REACTION_DESTROY = 0x4, } e_ai_reaction; static const value_string e_ai_reaction_strings[] = { { AI_REACTION_ALERT, "Alert" }, { AI_REACTION_FRIENDLY, "Friendly" }, { AI_REACTION_HOSTILE, "Hostile" }, { AI_REACTION_AFRAID, "Afraid" }, { AI_REACTION_DESTROY, "Destroy" }, { 0, NULL } }; typedef enum { HIT_INFO_NORMAL_SWING = 0x00000, HIT_INFO_UNK1 = 0x00001, HIT_INFO_AFFECTS_VICTIM = 0x00002, HIT_INFO_LEFT_SWING = 0x00004, HIT_INFO_EARLY_CRITICAL_HIT = 0x00008, HIT_INFO_MISS = 0x00010, HIT_INFO_ABSORB = 0x00020, HIT_INFO_RESIST = 0x00040, HIT_INFO_CRITICAL_HIT = 0x00080, HIT_INFO_UNK9 = 0x00100, HIT_INFO_UNK10 = 0x02000, HIT_INFO_GLANCING = 0x04000, HIT_INFO_CRUSHING = 0x08000, HIT_INFO_NO_ACTION = 0x10000, HIT_INFO_SWING_NO_HIT_SOUND = 0x80000, } e_hit_info; static const value_string e_hit_info_strings[] = { { HIT_INFO_NORMAL_SWING, "Normal Swing" }, { HIT_INFO_UNK1, "Unk1" }, { HIT_INFO_AFFECTS_VICTIM, "Affects Victim" }, { HIT_INFO_LEFT_SWING, "Left Swing" }, { HIT_INFO_EARLY_CRITICAL_HIT, "Early Critical Hit" }, { HIT_INFO_MISS, "Miss" }, { HIT_INFO_ABSORB, "Absorb" }, { HIT_INFO_RESIST, "Resist" }, { HIT_INFO_CRITICAL_HIT, "Critical Hit" }, { HIT_INFO_UNK9, "Unk9" }, { HIT_INFO_UNK10, "Unk10" }, { HIT_INFO_GLANCING, "Glancing" }, { HIT_INFO_CRUSHING, "Crushing" }, { HIT_INFO_NO_ACTION, "No Action" }, { HIT_INFO_SWING_NO_HIT_SOUND, "Swing No Hit Sound" }, { 0, NULL } }; typedef enum { AUCTION_COMMAND_ACTION_STARTED = 0x0, AUCTION_COMMAND_ACTION_REMOVED = 0x1, AUCTION_COMMAND_ACTION_BID_PLACED = 0x2, } e_auction_command_action; static const value_string e_auction_command_action_strings[] = { { AUCTION_COMMAND_ACTION_STARTED, "Started" }, { AUCTION_COMMAND_ACTION_REMOVED, "Removed" }, { AUCTION_COMMAND_ACTION_BID_PLACED, "Bid Placed" }, { 0, NULL } }; typedef enum { AUCTION_COMMAND_RESULT_OK = 0x0, AUCTION_COMMAND_RESULT_ERR_INVENTORY = 0x1, AUCTION_COMMAND_RESULT_ERR_DATABASE = 0x2, AUCTION_COMMAND_RESULT_ERR_NOT_ENOUGH_MONEY = 0x3, AUCTION_COMMAND_RESULT_ERR_ITEM_NOT_FOUND = 0x4, AUCTION_COMMAND_RESULT_ERR_HIGHER_BID = 0x5, AUCTION_COMMAND_RESULT_ERR_BID_INCREMENT = 0x7, AUCTION_COMMAND_RESULT_ERR_BID_OWN = 0xA, AUCTION_COMMAND_RESULT_ERR_RESTRICTED_ACCOUNT = 0xD, } e_auction_command_result; static const value_string e_auction_command_result_strings[] = { { AUCTION_COMMAND_RESULT_OK, "Ok" }, { AUCTION_COMMAND_RESULT_ERR_INVENTORY, "Err Inventory" }, { AUCTION_COMMAND_RESULT_ERR_DATABASE, "Err Database" }, { AUCTION_COMMAND_RESULT_ERR_NOT_ENOUGH_MONEY, "Err Not Enough Money" }, { AUCTION_COMMAND_RESULT_ERR_ITEM_NOT_FOUND, "Err Item Not Found" }, { AUCTION_COMMAND_RESULT_ERR_HIGHER_BID, "Err Higher Bid" }, { AUCTION_COMMAND_RESULT_ERR_BID_INCREMENT, "Err Bid Increment" }, { AUCTION_COMMAND_RESULT_ERR_BID_OWN, "Err Bid Own" }, { AUCTION_COMMAND_RESULT_ERR_RESTRICTED_ACCOUNT, "Err Restricted Account" }, { 0, NULL } }; typedef enum { INVENTORY_RESULT_OK = 0x00, INVENTORY_RESULT_CANT_EQUIP_LEVEL_I = 0x01, INVENTORY_RESULT_CANT_EQUIP_SKILL = 0x02, INVENTORY_RESULT_ITEM_DOESNT_GO_TO_SLOT = 0x03, INVENTORY_RESULT_BAG_FULL = 0x04, INVENTORY_RESULT_NONEMPTY_BAG_OVER_OTHER_BAG = 0x05, INVENTORY_RESULT_CANT_TRADE_EQUIP_BAGS = 0x06, INVENTORY_RESULT_ONLY_AMMO_CAN_GO_HERE = 0x07, INVENTORY_RESULT_NO_REQUIRED_PROFICIENCY = 0x08, INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE = 0x09, INVENTORY_RESULT_YOU_CAN_NEVER_USE_THAT_ITEM = 0x0A, INVENTORY_RESULT_YOU_CAN_NEVER_USE_THAT_ITEM2 = 0x0B, INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE2 = 0x0C, INVENTORY_RESULT_CANT_EQUIP_WITH_TWOHANDED = 0x0D, INVENTORY_RESULT_CANT_DUAL_WIELD = 0x0E, INVENTORY_RESULT_ITEM_DOESNT_GO_INTO_BAG = 0x0F, INVENTORY_RESULT_ITEM_DOESNT_GO_INTO_BAG2 = 0x10, INVENTORY_RESULT_CANT_CARRY_MORE_OF_THIS = 0x11, INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE3 = 0x12, INVENTORY_RESULT_ITEM_CANT_STACK = 0x13, INVENTORY_RESULT_ITEM_CANT_BE_EQUIPPED = 0x14, INVENTORY_RESULT_ITEMS_CANT_BE_SWAPPED = 0x15, INVENTORY_RESULT_SLOT_IS_EMPTY = 0x16, INVENTORY_RESULT_ITEM_NOT_FOUND = 0x17, INVENTORY_RESULT_CANT_DROP_SOULBOUND = 0x18, INVENTORY_RESULT_OUT_OF_RANGE = 0x19, INVENTORY_RESULT_TRIED_TO_SPLIT_MORE_THAN_COUNT = 0x1A, INVENTORY_RESULT_COULDNT_SPLIT_ITEMS = 0x1B, INVENTORY_RESULT_MISSING_REAGENT = 0x1C, INVENTORY_RESULT_NOT_ENOUGH_MONEY = 0x1D, INVENTORY_RESULT_NOT_A_BAG = 0x1E, INVENTORY_RESULT_CAN_ONLY_DO_WITH_EMPTY_BAGS = 0x1F, INVENTORY_RESULT_DONT_OWN_THAT_ITEM = 0x20, INVENTORY_RESULT_CAN_EQUIP_ONLY1_QUIVER = 0x21, INVENTORY_RESULT_MUST_PURCHASE_THAT_BAG_SLOT = 0x22, INVENTORY_RESULT_TOO_FAR_AWAY_FROM_BANK = 0x23, INVENTORY_RESULT_ITEM_LOCKED = 0x24, INVENTORY_RESULT_YOU_ARE_STUNNED = 0x25, INVENTORY_RESULT_YOU_ARE_DEAD = 0x26, INVENTORY_RESULT_CANT_DO_RIGHT_NOW = 0x27, INVENTORY_RESULT_INT_BAG_ERROR = 0x28, INVENTORY_RESULT_CAN_EQUIP_ONLY1_BOLT = 0x29, INVENTORY_RESULT_CAN_EQUIP_ONLY1_AMMOPOUCH = 0x2A, INVENTORY_RESULT_STACKABLE_CANT_BE_WRAPPED = 0x2B, INVENTORY_RESULT_EQUIPPED_CANT_BE_WRAPPED = 0x2C, INVENTORY_RESULT_WRAPPED_CANT_BE_WRAPPED = 0x2D, INVENTORY_RESULT_BOUND_CANT_BE_WRAPPED = 0x2E, INVENTORY_RESULT_UNIQUE_CANT_BE_WRAPPED = 0x2F, INVENTORY_RESULT_BAGS_CANT_BE_WRAPPED = 0x30, INVENTORY_RESULT_ALREADY_LOOTED = 0x31, INVENTORY_RESULT_INVENTORY_FULL = 0x32, INVENTORY_RESULT_BANK_FULL = 0x33, INVENTORY_RESULT_ITEM_IS_CURRENTLY_SOLD_OUT = 0x34, INVENTORY_RESULT_BAG_FULL3 = 0x35, INVENTORY_RESULT_ITEM_NOT_FOUND2 = 0x36, INVENTORY_RESULT_ITEM_CANT_STACK2 = 0x37, INVENTORY_RESULT_BAG_FULL4 = 0x38, INVENTORY_RESULT_ITEM_SOLD_OUT = 0x39, INVENTORY_RESULT_OBJECT_IS_BUSY = 0x3A, INVENTORY_RESULT_NONE = 0x3B, INVENTORY_RESULT_NOT_IN_COMBAT = 0x3C, INVENTORY_RESULT_NOT_WHILE_DISARMED = 0x3D, INVENTORY_RESULT_BAG_FULL6 = 0x3E, INVENTORY_RESULT_CANT_EQUIP_RANK = 0x3F, INVENTORY_RESULT_CANT_EQUIP_REPUTATION = 0x40, INVENTORY_RESULT_TOO_MANY_SPECIAL_BAGS = 0x41, INVENTORY_RESULT_LOOT_CANT_LOOT_THAT_NOW = 0x42, } e_inventory_result; static const value_string e_inventory_result_strings[] = { { INVENTORY_RESULT_OK, "Ok" }, { INVENTORY_RESULT_CANT_EQUIP_LEVEL_I, "Cant Equip Level I" }, { INVENTORY_RESULT_CANT_EQUIP_SKILL, "Cant Equip Skill" }, { INVENTORY_RESULT_ITEM_DOESNT_GO_TO_SLOT, "Item Doesnt Go To Slot" }, { INVENTORY_RESULT_BAG_FULL, "Bag Full" }, { INVENTORY_RESULT_NONEMPTY_BAG_OVER_OTHER_BAG, "Nonempty Bag Over Other Bag" }, { INVENTORY_RESULT_CANT_TRADE_EQUIP_BAGS, "Cant Trade Equip Bags" }, { INVENTORY_RESULT_ONLY_AMMO_CAN_GO_HERE, "Only Ammo Can Go Here" }, { INVENTORY_RESULT_NO_REQUIRED_PROFICIENCY, "No Required Proficiency" }, { INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE, "No Equipment Slot Available" }, { INVENTORY_RESULT_YOU_CAN_NEVER_USE_THAT_ITEM, "You Can Never Use That Item" }, { INVENTORY_RESULT_YOU_CAN_NEVER_USE_THAT_ITEM2, "You Can Never Use That Item2" }, { INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE2, "No Equipment Slot Available2" }, { INVENTORY_RESULT_CANT_EQUIP_WITH_TWOHANDED, "Cant Equip With Twohanded" }, { INVENTORY_RESULT_CANT_DUAL_WIELD, "Cant Dual Wield" }, { INVENTORY_RESULT_ITEM_DOESNT_GO_INTO_BAG, "Item Doesnt Go Into Bag" }, { INVENTORY_RESULT_ITEM_DOESNT_GO_INTO_BAG2, "Item Doesnt Go Into Bag2" }, { INVENTORY_RESULT_CANT_CARRY_MORE_OF_THIS, "Cant Carry More Of This" }, { INVENTORY_RESULT_NO_EQUIPMENT_SLOT_AVAILABLE3, "No Equipment Slot Available3" }, { INVENTORY_RESULT_ITEM_CANT_STACK, "Item Cant Stack" }, { INVENTORY_RESULT_ITEM_CANT_BE_EQUIPPED, "Item Cant Be Equipped" }, { INVENTORY_RESULT_ITEMS_CANT_BE_SWAPPED, "Items Cant Be Swapped" }, { INVENTORY_RESULT_SLOT_IS_EMPTY, "Slot Is Empty" }, { INVENTORY_RESULT_ITEM_NOT_FOUND, "Item Not Found" }, { INVENTORY_RESULT_CANT_DROP_SOULBOUND, "Cant Drop Soulbound" }, { INVENTORY_RESULT_OUT_OF_RANGE, "Out Of Range" }, { INVENTORY_RESULT_TRIED_TO_SPLIT_MORE_THAN_COUNT, "Tried To Split More Than Count" }, { INVENTORY_RESULT_COULDNT_SPLIT_ITEMS, "Couldnt Split Items" }, { INVENTORY_RESULT_MISSING_REAGENT, "Missing Reagent" }, { INVENTORY_RESULT_NOT_ENOUGH_MONEY, "Not Enough Money" }, { INVENTORY_RESULT_NOT_A_BAG, "Not A Bag" }, { INVENTORY_RESULT_CAN_ONLY_DO_WITH_EMPTY_BAGS, "Can Only Do With Empty Bags" }, { INVENTORY_RESULT_DONT_OWN_THAT_ITEM, "Dont Own That Item" }, { INVENTORY_RESULT_CAN_EQUIP_ONLY1_QUIVER, "Can Equip Only1 Quiver" }, { INVENTORY_RESULT_MUST_PURCHASE_THAT_BAG_SLOT, "Must Purchase That Bag Slot" }, { INVENTORY_RESULT_TOO_FAR_AWAY_FROM_BANK, "Too Far Away From Bank" }, { INVENTORY_RESULT_ITEM_LOCKED, "Item Locked" }, { INVENTORY_RESULT_YOU_ARE_STUNNED, "You Are Stunned" }, { INVENTORY_RESULT_YOU_ARE_DEAD, "You Are Dead" }, { INVENTORY_RESULT_CANT_DO_RIGHT_NOW, "Cant Do Right Now" }, { INVENTORY_RESULT_INT_BAG_ERROR, "Int Bag Error" }, { INVENTORY_RESULT_CAN_EQUIP_ONLY1_BOLT, "Can Equip Only1 Bolt" }, { INVENTORY_RESULT_CAN_EQUIP_ONLY1_AMMOPOUCH, "Can Equip Only1 Ammopouch" }, { INVENTORY_RESULT_STACKABLE_CANT_BE_WRAPPED, "Stackable Cant Be Wrapped" }, { INVENTORY_RESULT_EQUIPPED_CANT_BE_WRAPPED, "Equipped Cant Be Wrapped" }, { INVENTORY_RESULT_WRAPPED_CANT_BE_WRAPPED, "Wrapped Cant Be Wrapped" }, { INVENTORY_RESULT_BOUND_CANT_BE_WRAPPED, "Bound Cant Be Wrapped" }, { INVENTORY_RESULT_UNIQUE_CANT_BE_WRAPPED, "Unique Cant Be Wrapped" }, { INVENTORY_RESULT_BAGS_CANT_BE_WRAPPED, "Bags Cant Be Wrapped" }, { INVENTORY_RESULT_ALREADY_LOOTED, "Already Looted" }, { INVENTORY_RESULT_INVENTORY_FULL, "Inventory Full" }, { INVENTORY_RESULT_BANK_FULL, "Bank Full" }, { INVENTORY_RESULT_ITEM_IS_CURRENTLY_SOLD_OUT, "Item Is Currently Sold Out" }, { INVENTORY_RESULT_BAG_FULL3, "Bag Full3" }, { INVENTORY_RESULT_ITEM_NOT_FOUND2, "Item Not Found2" }, { INVENTORY_RESULT_ITEM_CANT_STACK2, "Item Cant Stack2" }, { INVENTORY_RESULT_BAG_FULL4, "Bag Full4" }, { INVENTORY_RESULT_ITEM_SOLD_OUT, "Item Sold Out" }, { INVENTORY_RESULT_OBJECT_IS_BUSY, "Object Is Busy" }, { INVENTORY_RESULT_NONE, "None" }, { INVENTORY_RESULT_NOT_IN_COMBAT, "Not In Combat" }, { INVENTORY_RESULT_NOT_WHILE_DISARMED, "Not While Disarmed" }, { INVENTORY_RESULT_BAG_FULL6, "Bag Full6" }, { INVENTORY_RESULT_CANT_EQUIP_RANK, "Cant Equip Rank" }, { INVENTORY_RESULT_CANT_EQUIP_REPUTATION, "Cant Equip Reputation" }, { INVENTORY_RESULT_TOO_MANY_SPECIAL_BAGS, "Too Many Special Bags" }, { INVENTORY_RESULT_LOOT_CANT_LOOT_THAT_NOW, "Loot Cant Loot That Now" }, { 0, NULL } }; typedef enum { AUCTION_COMMAND_RESULT_TWO_OK = 0x0, AUCTION_COMMAND_RESULT_TWO_ERR_INVENTORY = 0x1, AUCTION_COMMAND_RESULT_TWO_ERR_DATABASE = 0x2, AUCTION_COMMAND_RESULT_TWO_ERR_NOT_ENOUGH_MONEY = 0x3, AUCTION_COMMAND_RESULT_TWO_ERR_ITEM_NOT_FOUND = 0x4, AUCTION_COMMAND_RESULT_TWO_ERR_HIGHER_BID = 0x5, AUCTION_COMMAND_RESULT_TWO_ERR_BID_INCREMENT = 0x7, AUCTION_COMMAND_RESULT_TWO_ERR_BID_OWN = 0xA, AUCTION_COMMAND_RESULT_TWO_ERR_RESTRICTED_ACCOUNT = 0xD, } e_auction_command_result_two; static const value_string e_auction_command_result_two_strings[] = { { AUCTION_COMMAND_RESULT_TWO_OK, "Ok" }, { AUCTION_COMMAND_RESULT_TWO_ERR_INVENTORY, "Err Inventory" }, { AUCTION_COMMAND_RESULT_TWO_ERR_DATABASE, "Err Database" }, { AUCTION_COMMAND_RESULT_TWO_ERR_NOT_ENOUGH_MONEY, "Err Not Enough Money" }, { AUCTION_COMMAND_RESULT_TWO_ERR_ITEM_NOT_FOUND, "Err Item Not Found" }, { AUCTION_COMMAND_RESULT_TWO_ERR_HIGHER_BID, "Err Higher Bid" }, { AUCTION_COMMAND_RESULT_TWO_ERR_BID_INCREMENT, "Err Bid Increment" }, { AUCTION_COMMAND_RESULT_TWO_ERR_BID_OWN, "Err Bid Own" }, { AUCTION_COMMAND_RESULT_TWO_ERR_RESTRICTED_ACCOUNT, "Err Restricted Account" }, { 0, NULL } }; typedef enum { WORLD_RESULT_RESPONSE_SUCCESS = 0x00, WORLD_RESULT_RESPONSE_FAILURE = 0x01, WORLD_RESULT_RESPONSE_CANCELLED = 0x02, WORLD_RESULT_RESPONSE_DISCONNECTED = 0x03, WORLD_RESULT_RESPONSE_FAILED_TO_CONNECT = 0x04, WORLD_RESULT_RESPONSE_CONNECTED = 0x05, WORLD_RESULT_RESPONSE_VERSION_MISMATCH = 0x06, WORLD_RESULT_CSTATUS_CONNECTING = 0x07, WORLD_RESULT_CSTATUS_NEGOTIATING_SECURITY = 0x08, WORLD_RESULT_CSTATUS_NEGOTIATION_COMPLETE = 0x09, WORLD_RESULT_CSTATUS_NEGOTIATION_FAILED = 0x0A, WORLD_RESULT_CSTATUS_AUTHENTICATING = 0x0B, WORLD_RESULT_AUTH_OK = 0x0C, WORLD_RESULT_AUTH_FAILED = 0x0D, WORLD_RESULT_AUTH_REJECT = 0x0E, WORLD_RESULT_AUTH_BAD_SERVER_PROOF = 0x0F, WORLD_RESULT_AUTH_UNAVAILABLE = 0x10, WORLD_RESULT_AUTH_SYSTEM_ERROR = 0x11, WORLD_RESULT_AUTH_BILLING_ERROR = 0x12, WORLD_RESULT_AUTH_BILLING_EXPIRED = 0x13, WORLD_RESULT_AUTH_VERSION_MISMATCH = 0x14, WORLD_RESULT_AUTH_UNKNOWN_ACCOUNT = 0x15, WORLD_RESULT_AUTH_INCORRECT_PASSWORD = 0x16, WORLD_RESULT_AUTH_SESSION_EXPIRED = 0x17, WORLD_RESULT_AUTH_SERVER_SHUTTING_DOWN = 0x18, WORLD_RESULT_AUTH_ALREADY_LOGGING_IN = 0x19, WORLD_RESULT_AUTH_LOGIN_SERVER_NOT_FOUND = 0x1A, WORLD_RESULT_AUTH_WAIT_QUEUE = 0x1B, WORLD_RESULT_AUTH_BANNED = 0x1C, WORLD_RESULT_AUTH_ALREADY_ONLINE = 0x1D, WORLD_RESULT_AUTH_NO_TIME = 0x1E, WORLD_RESULT_AUTH_DB_BUSY = 0x1F, WORLD_RESULT_AUTH_SUSPENDED = 0x20, WORLD_RESULT_AUTH_PARENTAL_CONTROL = 0x21, WORLD_RESULT_REALM_LIST_IN_PROGRESS = 0x22, WORLD_RESULT_REALM_LIST_SUCCESS = 0x23, WORLD_RESULT_REALM_LIST_FAILED = 0x24, WORLD_RESULT_REALM_LIST_INVALID = 0x25, WORLD_RESULT_REALM_LIST_REALM_NOT_FOUND = 0x26, WORLD_RESULT_ACCOUNT_CREATE_IN_PROGRESS = 0x27, WORLD_RESULT_ACCOUNT_CREATE_SUCCESS = 0x28, WORLD_RESULT_ACCOUNT_CREATE_FAILED = 0x29, WORLD_RESULT_CHAR_LIST_RETRIEVING = 0x2A, WORLD_RESULT_CHAR_LIST_RETRIEVED = 0x2B, WORLD_RESULT_CHAR_LIST_FAILED = 0x2C, WORLD_RESULT_CHAR_CREATE_IN_PROGRESS = 0x2D, WORLD_RESULT_CHAR_CREATE_SUCCESS = 0x2E, WORLD_RESULT_CHAR_CREATE_ERROR = 0x2F, WORLD_RESULT_CHAR_CREATE_FAILED = 0x30, WORLD_RESULT_CHAR_CREATE_NAME_IN_USE = 0x31, WORLD_RESULT_CHAR_CREATE_DISABLED = 0x32, WORLD_RESULT_CHAR_CREATE_PVP_TEAMS_VIOLATION = 0x33, WORLD_RESULT_CHAR_CREATE_SERVER_LIMIT = 0x34, WORLD_RESULT_CHAR_CREATE_ACCOUNT_LIMIT = 0x35, WORLD_RESULT_CHAR_CREATE_SERVER_QUEUE = 0x36, WORLD_RESULT_CHAR_CREATE_ONLY_EXISTING = 0x37, WORLD_RESULT_CHAR_DELETE_IN_PROGRESS = 0x38, WORLD_RESULT_CHAR_DELETE_SUCCESS = 0x39, WORLD_RESULT_CHAR_DELETE_FAILED = 0x3A, WORLD_RESULT_CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x3B, WORLD_RESULT_CHAR_LOGIN_IN_PROGRESS = 0x3C, WORLD_RESULT_CHAR_LOGIN_SUCCESS = 0x3D, WORLD_RESULT_CHAR_LOGIN_NO_WORLD = 0x3E, WORLD_RESULT_CHAR_LOGIN_DUPLICATE_CHARACTER = 0x3F, WORLD_RESULT_CHAR_LOGIN_NO_INSTANCES = 0x40, WORLD_RESULT_CHAR_LOGIN_FAILED = 0x41, WORLD_RESULT_CHAR_LOGIN_DISABLED = 0x42, WORLD_RESULT_CHAR_LOGIN_NO_CHARACTER = 0x43, WORLD_RESULT_CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x44, WORLD_RESULT_CHAR_NAME_NO_NAME = 0x45, WORLD_RESULT_CHAR_NAME_TOO_SHORT = 0x46, WORLD_RESULT_CHAR_NAME_TOO_LONG = 0x47, WORLD_RESULT_CHAR_NAME_ONLY_LETTERS = 0x48, WORLD_RESULT_CHAR_NAME_MIXED_LANGUAGES = 0x49, WORLD_RESULT_CHAR_NAME_PROFANE = 0x4A, WORLD_RESULT_CHAR_NAME_RESERVED = 0x4B, WORLD_RESULT_CHAR_NAME_INVALID_APOSTROPHE = 0x4C, WORLD_RESULT_CHAR_NAME_MULTIPLE_APOSTROPHES = 0x4D, WORLD_RESULT_CHAR_NAME_THREE_CONSECUTIVE = 0x4E, WORLD_RESULT_CHAR_NAME_INVALID_SPACE = 0x4F, WORLD_RESULT_CHAR_NAME_SUCCESS = 0x50, WORLD_RESULT_CHAR_NAME_FAILURE = 0x51, } e_world_result; static const value_string e_world_result_strings[] = { { WORLD_RESULT_RESPONSE_SUCCESS, "Response Success" }, { WORLD_RESULT_RESPONSE_FAILURE, "Response Failure" }, { WORLD_RESULT_RESPONSE_CANCELLED, "Response Cancelled" }, { WORLD_RESULT_RESPONSE_DISCONNECTED, "Response Disconnected" }, { WORLD_RESULT_RESPONSE_FAILED_TO_CONNECT, "Response Failed To Connect" }, { WORLD_RESULT_RESPONSE_CONNECTED, "Response Connected" }, { WORLD_RESULT_RESPONSE_VERSION_MISMATCH, "Response Version Mismatch" }, { WORLD_RESULT_CSTATUS_CONNECTING, "Cstatus Connecting" }, { WORLD_RESULT_CSTATUS_NEGOTIATING_SECURITY, "Cstatus Negotiating Security" }, { WORLD_RESULT_CSTATUS_NEGOTIATION_COMPLETE, "Cstatus Negotiation Complete" }, { WORLD_RESULT_CSTATUS_NEGOTIATION_FAILED, "Cstatus Negotiation Failed" }, { WORLD_RESULT_CSTATUS_AUTHENTICATING, "Cstatus Authenticating" }, { WORLD_RESULT_AUTH_OK, "Auth Ok" }, { WORLD_RESULT_AUTH_FAILED, "Auth Failed" }, { WORLD_RESULT_AUTH_REJECT, "Auth Reject" }, { WORLD_RESULT_AUTH_BAD_SERVER_PROOF, "Auth Bad Server Proof" }, { WORLD_RESULT_AUTH_UNAVAILABLE, "Auth Unavailable" }, { WORLD_RESULT_AUTH_SYSTEM_ERROR, "Auth System Error" }, { WORLD_RESULT_AUTH_BILLING_ERROR, "Auth Billing Error" }, { WORLD_RESULT_AUTH_BILLING_EXPIRED, "Auth Billing Expired" }, { WORLD_RESULT_AUTH_VERSION_MISMATCH, "Auth Version Mismatch" }, { WORLD_RESULT_AUTH_UNKNOWN_ACCOUNT, "Auth Unknown Account" }, { WORLD_RESULT_AUTH_INCORRECT_PASSWORD, "Auth Incorrect Password" }, { WORLD_RESULT_AUTH_SESSION_EXPIRED, "Auth Session Expired" }, { WORLD_RESULT_AUTH_SERVER_SHUTTING_DOWN, "Auth Server Shutting Down" }, { WORLD_RESULT_AUTH_ALREADY_LOGGING_IN, "Auth Already Logging In" }, { WORLD_RESULT_AUTH_LOGIN_SERVER_NOT_FOUND, "Auth Login Server Not Found" }, { WORLD_RESULT_AUTH_WAIT_QUEUE, "Auth Wait Queue" }, { WORLD_RESULT_AUTH_BANNED, "Auth Banned" }, { WORLD_RESULT_AUTH_ALREADY_ONLINE, "Auth Already Online" }, { WORLD_RESULT_AUTH_NO_TIME, "Auth No Time" }, { WORLD_RESULT_AUTH_DB_BUSY, "Auth Db Busy" }, { WORLD_RESULT_AUTH_SUSPENDED, "Auth Suspended" }, { WORLD_RESULT_AUTH_PARENTAL_CONTROL, "Auth Parental Control" }, { WORLD_RESULT_REALM_LIST_IN_PROGRESS, "Realm List In Progress" }, { WORLD_RESULT_REALM_LIST_SUCCESS, "Realm List Success" }, { WORLD_RESULT_REALM_LIST_FAILED, "Realm List Failed" }, { WORLD_RESULT_REALM_LIST_INVALID, "Realm List Invalid" }, { WORLD_RESULT_REALM_LIST_REALM_NOT_FOUND, "Realm List Realm Not Found" }, { WORLD_RESULT_ACCOUNT_CREATE_IN_PROGRESS, "Account Create In Progress" }, { WORLD_RESULT_ACCOUNT_CREATE_SUCCESS, "Account Create Success" }, { WORLD_RESULT_ACCOUNT_CREATE_FAILED, "Account Create Failed" }, { WORLD_RESULT_CHAR_LIST_RETRIEVING, "Char List Retrieving" }, { WORLD_RESULT_CHAR_LIST_RETRIEVED, "Char List Retrieved" }, { WORLD_RESULT_CHAR_LIST_FAILED, "Char List Failed" }, { WORLD_RESULT_CHAR_CREATE_IN_PROGRESS, "Char Create In Progress" }, { WORLD_RESULT_CHAR_CREATE_SUCCESS, "Char Create Success" }, { WORLD_RESULT_CHAR_CREATE_ERROR, "Char Create Error" }, { WORLD_RESULT_CHAR_CREATE_FAILED, "Char Create Failed" }, { WORLD_RESULT_CHAR_CREATE_NAME_IN_USE, "Char Create Name In Use" }, { WORLD_RESULT_CHAR_CREATE_DISABLED, "Char Create Disabled" }, { WORLD_RESULT_CHAR_CREATE_PVP_TEAMS_VIOLATION, "Char Create Pvp Teams Violation" }, { WORLD_RESULT_CHAR_CREATE_SERVER_LIMIT, "Char Create Server Limit" }, { WORLD_RESULT_CHAR_CREATE_ACCOUNT_LIMIT, "Char Create Account Limit" }, { WORLD_RESULT_CHAR_CREATE_SERVER_QUEUE, "Char Create Server Queue" }, { WORLD_RESULT_CHAR_CREATE_ONLY_EXISTING, "Char Create Only Existing" }, { WORLD_RESULT_CHAR_DELETE_IN_PROGRESS, "Char Delete In Progress" }, { WORLD_RESULT_CHAR_DELETE_SUCCESS, "Char Delete Success" }, { WORLD_RESULT_CHAR_DELETE_FAILED, "Char Delete Failed" }, { WORLD_RESULT_CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER, "Char Delete Failed Locked For Transfer" }, { WORLD_RESULT_CHAR_LOGIN_IN_PROGRESS, "Char Login In Progress" }, { WORLD_RESULT_CHAR_LOGIN_SUCCESS, "Char Login Success" }, { WORLD_RESULT_CHAR_LOGIN_NO_WORLD, "Char Login No World" }, { WORLD_RESULT_CHAR_LOGIN_DUPLICATE_CHARACTER, "Char Login Duplicate Character" }, { WORLD_RESULT_CHAR_LOGIN_NO_INSTANCES, "Char Login No Instances" }, { WORLD_RESULT_CHAR_LOGIN_FAILED, "Char Login Failed" }, { WORLD_RESULT_CHAR_LOGIN_DISABLED, "Char Login Disabled" }, { WORLD_RESULT_CHAR_LOGIN_NO_CHARACTER, "Char Login No Character" }, { WORLD_RESULT_CHAR_LOGIN_LOCKED_FOR_TRANSFER, "Char Login Locked For Transfer" }, { WORLD_RESULT_CHAR_NAME_NO_NAME, "Char Name No Name" }, { WORLD_RESULT_CHAR_NAME_TOO_SHORT, "Char Name Too Short" }, { WORLD_RESULT_CHAR_NAME_TOO_LONG, "Char Name Too Long" }, { WORLD_RESULT_CHAR_NAME_ONLY_LETTERS, "Char Name Only Letters" }, { WORLD_RESULT_CHAR_NAME_MIXED_LANGUAGES, "Char Name Mixed Languages" }, { WORLD_RESULT_CHAR_NAME_PROFANE, "Char Name Profane" }, { WORLD_RESULT_CHAR_NAME_RESERVED, "Char Name Reserved" }, { WORLD_RESULT_CHAR_NAME_INVALID_APOSTROPHE, "Char Name Invalid Apostrophe" }, { WORLD_RESULT_CHAR_NAME_MULTIPLE_APOSTROPHES, "Char Name Multiple Apostrophes" }, { WORLD_RESULT_CHAR_NAME_THREE_CONSECUTIVE, "Char Name Three Consecutive" }, { WORLD_RESULT_CHAR_NAME_INVALID_SPACE, "Char Name Invalid Space" }, { WORLD_RESULT_CHAR_NAME_SUCCESS, "Char Name Success" }, { WORLD_RESULT_CHAR_NAME_FAILURE, "Char Name Failure" }, { 0, NULL } }; typedef enum { BATTLEGROUND_BRACKET_TENS = 0x0, BATTLEGROUND_BRACKET_TWENTIES = 0x1, BATTLEGROUND_BRACKET_THIRTIES = 0x2, BATTLEGROUND_BRACKET_FOURTIES = 0x3, BATTLEGROUND_BRACKET_FIFTIES = 0x4, BATTLEGROUND_BRACKET_SIXTY = 0x5, } e_battleground_bracket; static const value_string e_battleground_bracket_strings[] = { { BATTLEGROUND_BRACKET_TENS, "Tens" }, { BATTLEGROUND_BRACKET_TWENTIES, "Twenties" }, { BATTLEGROUND_BRACKET_THIRTIES, "Thirties" }, { BATTLEGROUND_BRACKET_FOURTIES, "Fourties" }, { BATTLEGROUND_BRACKET_FIFTIES, "Fifties" }, { BATTLEGROUND_BRACKET_SIXTY, "Sixty" }, { 0, NULL } }; typedef enum { STATUS_ID_NONE = 0x0, STATUS_ID_WAIT_QUEUE = 0x1, STATUS_ID_WAIT_JOIN = 0x2, STATUS_ID_IN_PROGRESS = 0x3, STATUS_ID_WAIT_LEAVE = 0x4, } e_status_id; static const value_string e_status_id_strings[] = { { STATUS_ID_NONE, "None" }, { STATUS_ID_WAIT_QUEUE, "Wait Queue" }, { STATUS_ID_WAIT_JOIN, "Wait Join" }, { STATUS_ID_IN_PROGRESS, "In Progress" }, { STATUS_ID_WAIT_LEAVE, "Wait Leave" }, { 0, NULL } }; typedef enum { BUY_BANK_SLOT_RESULT_FAILED_TOO_MANY = 0x0, BUY_BANK_SLOT_RESULT_INSUFFICIENT_FUNDS = 0x1, BUY_BANK_SLOT_RESULT_NOT_BANKER = 0x2, BUY_BANK_SLOT_RESULT_OK = 0x3, } e_buy_bank_slot_result; static const value_string e_buy_bank_slot_result_strings[] = { { BUY_BANK_SLOT_RESULT_FAILED_TOO_MANY, "Failed Too Many" }, { BUY_BANK_SLOT_RESULT_INSUFFICIENT_FUNDS, "Insufficient Funds" }, { BUY_BANK_SLOT_RESULT_NOT_BANKER, "Not Banker" }, { BUY_BANK_SLOT_RESULT_OK, "Ok" }, { 0, NULL } }; typedef enum { BUY_RESULT_CANT_FIND_ITEM = 0x0, BUY_RESULT_ITEM_ALREADY_SOLD = 0x1, BUY_RESULT_NOT_ENOUGHT_MONEY = 0x2, BUY_RESULT_SELLER_DONT_LIKE_YOU = 0x4, BUY_RESULT_DISTANCE_TOO_FAR = 0x5, BUY_RESULT_ITEM_SOLD_OUT = 0x7, BUY_RESULT_CANT_CARRY_MORE = 0x8, BUY_RESULT_RANK_REQUIRE = 0xB, BUY_RESULT_REPUTATION_REQUIRE = 0xC, } e_buy_result; static const value_string e_buy_result_strings[] = { { BUY_RESULT_CANT_FIND_ITEM, "Cant Find Item" }, { BUY_RESULT_ITEM_ALREADY_SOLD, "Item Already Sold" }, { BUY_RESULT_NOT_ENOUGHT_MONEY, "Not Enought Money" }, { BUY_RESULT_SELLER_DONT_LIKE_YOU, "Seller Dont Like You" }, { BUY_RESULT_DISTANCE_TOO_FAR, "Distance Too Far" }, { BUY_RESULT_ITEM_SOLD_OUT, "Item Sold Out" }, { BUY_RESULT_CANT_CARRY_MORE, "Cant Carry More" }, { BUY_RESULT_RANK_REQUIRE, "Rank Require" }, { BUY_RESULT_REPUTATION_REQUIRE, "Reputation Require" }, { 0, NULL } }; typedef enum { SIMPLE_SPELL_CAST_RESULT_SUCCESS = 0x0, SIMPLE_SPELL_CAST_RESULT_FAILURE = 0x2, } e_simple_spell_cast_result; static const value_string e_simple_spell_cast_result_strings[] = { { SIMPLE_SPELL_CAST_RESULT_SUCCESS, "Success" }, { SIMPLE_SPELL_CAST_RESULT_FAILURE, "Failure" }, { 0, NULL } }; typedef enum { CAST_FAILURE_REASON_AFFECTING_COMBAT = 0x00, CAST_FAILURE_REASON_ALREADY_AT_FULL_HEALTH = 0x01, CAST_FAILURE_REASON_ALREADY_AT_FULL_POWER = 0x02, CAST_FAILURE_REASON_ALREADY_BEING_TAMED = 0x03, CAST_FAILURE_REASON_ALREADY_HAVE_CHARM = 0x04, CAST_FAILURE_REASON_ALREADY_HAVE_SUMMON = 0x05, CAST_FAILURE_REASON_ALREADY_OPEN = 0x06, CAST_FAILURE_REASON_AURA_BOUNCED = 0x07, CAST_FAILURE_REASON_AUTOTRACK_INTERRUPTED = 0x08, CAST_FAILURE_REASON_BAD_IMPLICIT_TARGETS = 0x09, CAST_FAILURE_REASON_BAD_TARGETS = 0x0A, CAST_FAILURE_REASON_CANT_BE_CHARMED = 0x0B, CAST_FAILURE_REASON_CANT_BE_DISENCHANTED = 0x0C, CAST_FAILURE_REASON_CANT_BE_PROSPECTED = 0x0D, CAST_FAILURE_REASON_CANT_CAST_ON_TAPPED = 0x0E, CAST_FAILURE_REASON_CANT_DUEL_WHILE_INVISIBLE = 0x0F, CAST_FAILURE_REASON_CANT_DUEL_WHILE_STEALTHED = 0x10, CAST_FAILURE_REASON_CANT_STEALTH = 0x11, CAST_FAILURE_REASON_CASTER_AURASTATE = 0x12, CAST_FAILURE_REASON_CASTER_DEAD = 0x13, CAST_FAILURE_REASON_CHARMED = 0x14, CAST_FAILURE_REASON_CHEST_IN_USE = 0x15, CAST_FAILURE_REASON_CONFUSED = 0x16, CAST_FAILURE_REASON_DONT_REPORT = 0x17, CAST_FAILURE_REASON_EQUIPPED_ITEM = 0x18, CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS = 0x19, CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS_MAINHAND = 0x1A, CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS_OFFHAND = 0x1B, CAST_FAILURE_REASON_ERROR = 0x1C, CAST_FAILURE_REASON_FIZZLE = 0x1D, CAST_FAILURE_REASON_FLEEING = 0x1E, CAST_FAILURE_REASON_FOOD_LOWLEVEL = 0x1F, CAST_FAILURE_REASON_HIGHLEVEL = 0x20, CAST_FAILURE_REASON_HUNGER_SATIATED = 0x21, CAST_FAILURE_REASON_IMMUNE = 0x22, CAST_FAILURE_REASON_INTERRUPTED = 0x23, CAST_FAILURE_REASON_INTERRUPTED_COMBAT = 0x24, CAST_FAILURE_REASON_ITEM_ALREADY_ENCHANTED = 0x25, CAST_FAILURE_REASON_ITEM_GONE = 0x26, CAST_FAILURE_REASON_ITEM_NOT_FOUND = 0x27, CAST_FAILURE_REASON_ITEM_NOT_READY = 0x28, CAST_FAILURE_REASON_LEVEL_REQUIREMENT = 0x29, CAST_FAILURE_REASON_LINE_OF_SIGHT = 0x2A, CAST_FAILURE_REASON_LOWLEVEL = 0x2B, CAST_FAILURE_REASON_LOW_CASTLEVEL = 0x2C, CAST_FAILURE_REASON_MAINHAND_EMPTY = 0x2D, CAST_FAILURE_REASON_MOVING = 0x2E, CAST_FAILURE_REASON_NEED_AMMO = 0x2F, CAST_FAILURE_REASON_NEED_AMMO_POUCH = 0x30, CAST_FAILURE_REASON_NEED_EXOTIC_AMMO = 0x31, CAST_FAILURE_REASON_NOPATH = 0x32, CAST_FAILURE_REASON_NOT_BEHIND = 0x33, CAST_FAILURE_REASON_NOT_FISHABLE = 0x34, CAST_FAILURE_REASON_NOT_HERE = 0x35, CAST_FAILURE_REASON_NOT_INFRONT = 0x36, CAST_FAILURE_REASON_NOT_IN_CONTROL = 0x37, CAST_FAILURE_REASON_NOT_KNOWN = 0x38, CAST_FAILURE_REASON_NOT_MOUNTED = 0x39, CAST_FAILURE_REASON_NOT_ON_TAXI = 0x3A, CAST_FAILURE_REASON_NOT_ON_TRANSPORT = 0x3B, CAST_FAILURE_REASON_NOT_READY = 0x3C, CAST_FAILURE_REASON_NOT_SHAPESHIFT = 0x3D, CAST_FAILURE_REASON_NOT_STANDING = 0x3E, CAST_FAILURE_REASON_NOT_TRADEABLE = 0x3F, CAST_FAILURE_REASON_NOT_TRADING = 0x40, CAST_FAILURE_REASON_NOT_UNSHEATHED = 0x41, CAST_FAILURE_REASON_NOT_WHILE_GHOST = 0x42, CAST_FAILURE_REASON_NO_AMMO = 0x43, CAST_FAILURE_REASON_NO_CHARGES_REMAIN = 0x44, CAST_FAILURE_REASON_NO_CHAMPION = 0x45, CAST_FAILURE_REASON_NO_COMBO_POINTS = 0x46, CAST_FAILURE_REASON_NO_DUELING = 0x47, CAST_FAILURE_REASON_NO_ENDURANCE = 0x48, CAST_FAILURE_REASON_NO_FISH = 0x49, CAST_FAILURE_REASON_NO_ITEMS_WHILE_SHAPESHIFTED = 0x4A, CAST_FAILURE_REASON_NO_MOUNTS_ALLOWED = 0x4B, CAST_FAILURE_REASON_NO_PET = 0x4C, CAST_FAILURE_REASON_NO_POWER = 0x4D, CAST_FAILURE_REASON_NOTHING_TO_DISPEL = 0x4E, CAST_FAILURE_REASON_NOTHING_TO_STEAL = 0x4F, CAST_FAILURE_REASON_ONLY_ABOVEWATER = 0x50, CAST_FAILURE_REASON_ONLY_DAYTIME = 0x51, CAST_FAILURE_REASON_ONLY_INDOORS = 0x52, CAST_FAILURE_REASON_ONLY_MOUNTED = 0x53, CAST_FAILURE_REASON_ONLY_NIGHTTIME = 0x54, CAST_FAILURE_REASON_ONLY_OUTDOORS = 0x55, CAST_FAILURE_REASON_ONLY_SHAPESHIFT = 0x56, CAST_FAILURE_REASON_ONLY_STEALTHED = 0x57, CAST_FAILURE_REASON_ONLY_UNDERWATER = 0x58, CAST_FAILURE_REASON_OUT_OF_RANGE = 0x59, CAST_FAILURE_REASON_PACIFIED = 0x5A, CAST_FAILURE_REASON_POSSESSED = 0x5B, CAST_FAILURE_REASON_REAGENTS = 0x5C, CAST_FAILURE_REASON_REQUIRES_AREA = 0x5D, CAST_FAILURE_REASON_REQUIRES_SPELL_FOCUS = 0x5E, CAST_FAILURE_REASON_ROOTED = 0x5F, CAST_FAILURE_REASON_SILENCED = 0x60, CAST_FAILURE_REASON_SPELL_IN_PROGRESS = 0x61, CAST_FAILURE_REASON_SPELL_LEARNED = 0x62, CAST_FAILURE_REASON_SPELL_UNAVAILABLE = 0x63, CAST_FAILURE_REASON_STUNNED = 0x64, CAST_FAILURE_REASON_TARGETS_DEAD = 0x65, CAST_FAILURE_REASON_TARGET_AFFECTING_COMBAT = 0x66, CAST_FAILURE_REASON_TARGET_AURASTATE = 0x67, CAST_FAILURE_REASON_TARGET_DUELING = 0x68, CAST_FAILURE_REASON_TARGET_ENEMY = 0x69, CAST_FAILURE_REASON_TARGET_ENRAGED = 0x6A, CAST_FAILURE_REASON_TARGET_FRIENDLY = 0x6B, CAST_FAILURE_REASON_TARGET_IN_COMBAT = 0x6C, CAST_FAILURE_REASON_TARGET_IS_PLAYER = 0x6D, CAST_FAILURE_REASON_TARGET_NOT_DEAD = 0x6E, CAST_FAILURE_REASON_TARGET_NOT_IN_PARTY = 0x6F, CAST_FAILURE_REASON_TARGET_NOT_LOOTED = 0x70, CAST_FAILURE_REASON_TARGET_NOT_PLAYER = 0x71, CAST_FAILURE_REASON_TARGET_NO_POCKETS = 0x72, CAST_FAILURE_REASON_TARGET_NO_WEAPONS = 0x73, CAST_FAILURE_REASON_TARGET_UNSKINNABLE = 0x74, CAST_FAILURE_REASON_THIRST_SATIATED = 0x75, CAST_FAILURE_REASON_TOO_CLOSE = 0x76, CAST_FAILURE_REASON_TOO_MANY_OF_ITEM = 0x77, CAST_FAILURE_REASON_TOTEMS = 0x78, CAST_FAILURE_REASON_TRAINING_POINTS = 0x79, CAST_FAILURE_REASON_TRY_AGAIN = 0x7A, CAST_FAILURE_REASON_UNIT_NOT_BEHIND = 0x7B, CAST_FAILURE_REASON_UNIT_NOT_INFRONT = 0x7C, CAST_FAILURE_REASON_WRONG_PET_FOOD = 0x7D, CAST_FAILURE_REASON_NOT_WHILE_FATIGUED = 0x7E, CAST_FAILURE_REASON_TARGET_NOT_IN_INSTANCE = 0x7F, CAST_FAILURE_REASON_NOT_WHILE_TRADING = 0x80, CAST_FAILURE_REASON_TARGET_NOT_IN_RAID = 0x81, CAST_FAILURE_REASON_DISENCHANT_WHILE_LOOTING = 0x82, CAST_FAILURE_REASON_PROSPECT_WHILE_LOOTING = 0x83, CAST_FAILURE_REASON_PROSPECT_NEED_MORE = 0x84, CAST_FAILURE_REASON_TARGET_FREEFORALL = 0x85, CAST_FAILURE_REASON_NO_EDIBLE_CORPSES = 0x86, CAST_FAILURE_REASON_ONLY_BATTLEGROUNDS = 0x87, CAST_FAILURE_REASON_TARGET_NOT_GHOST = 0x88, CAST_FAILURE_REASON_TOO_MANY_SKILLS = 0x89, CAST_FAILURE_REASON_TRANSFORM_UNUSABLE = 0x8A, CAST_FAILURE_REASON_WRONG_WEATHER = 0x8B, CAST_FAILURE_REASON_DAMAGE_IMMUNE = 0x8C, CAST_FAILURE_REASON_PREVENTED_BY_MECHANIC = 0x8D, CAST_FAILURE_REASON_PLAY_TIME = 0x8E, CAST_FAILURE_REASON_REPUTATION = 0x8F, CAST_FAILURE_REASON_MIN_SKILL = 0x90, CAST_FAILURE_REASON_UNKNOWN = 0x91, } e_cast_failure_reason; static const value_string e_cast_failure_reason_strings[] = { { CAST_FAILURE_REASON_AFFECTING_COMBAT, "Affecting Combat" }, { CAST_FAILURE_REASON_ALREADY_AT_FULL_HEALTH, "Already At Full Health" }, { CAST_FAILURE_REASON_ALREADY_AT_FULL_POWER, "Already At Full Power" }, { CAST_FAILURE_REASON_ALREADY_BEING_TAMED, "Already Being Tamed" }, { CAST_FAILURE_REASON_ALREADY_HAVE_CHARM, "Already Have Charm" }, { CAST_FAILURE_REASON_ALREADY_HAVE_SUMMON, "Already Have Summon" }, { CAST_FAILURE_REASON_ALREADY_OPEN, "Already Open" }, { CAST_FAILURE_REASON_AURA_BOUNCED, "Aura Bounced" }, { CAST_FAILURE_REASON_AUTOTRACK_INTERRUPTED, "Autotrack Interrupted" }, { CAST_FAILURE_REASON_BAD_IMPLICIT_TARGETS, "Bad Implicit Targets" }, { CAST_FAILURE_REASON_BAD_TARGETS, "Bad Targets" }, { CAST_FAILURE_REASON_CANT_BE_CHARMED, "Cant Be Charmed" }, { CAST_FAILURE_REASON_CANT_BE_DISENCHANTED, "Cant Be Disenchanted" }, { CAST_FAILURE_REASON_CANT_BE_PROSPECTED, "Cant Be Prospected" }, { CAST_FAILURE_REASON_CANT_CAST_ON_TAPPED, "Cant Cast On Tapped" }, { CAST_FAILURE_REASON_CANT_DUEL_WHILE_INVISIBLE, "Cant Duel While Invisible" }, { CAST_FAILURE_REASON_CANT_DUEL_WHILE_STEALTHED, "Cant Duel While Stealthed" }, { CAST_FAILURE_REASON_CANT_STEALTH, "Cant Stealth" }, { CAST_FAILURE_REASON_CASTER_AURASTATE, "Caster Aurastate" }, { CAST_FAILURE_REASON_CASTER_DEAD, "Caster Dead" }, { CAST_FAILURE_REASON_CHARMED, "Charmed" }, { CAST_FAILURE_REASON_CHEST_IN_USE, "Chest In Use" }, { CAST_FAILURE_REASON_CONFUSED, "Confused" }, { CAST_FAILURE_REASON_DONT_REPORT, "Dont Report" }, { CAST_FAILURE_REASON_EQUIPPED_ITEM, "Equipped Item" }, { CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS, "Equipped Item Class" }, { CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS_MAINHAND, "Equipped Item Class Mainhand" }, { CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS_OFFHAND, "Equipped Item Class Offhand" }, { CAST_FAILURE_REASON_ERROR, "Error" }, { CAST_FAILURE_REASON_FIZZLE, "Fizzle" }, { CAST_FAILURE_REASON_FLEEING, "Fleeing" }, { CAST_FAILURE_REASON_FOOD_LOWLEVEL, "Food Lowlevel" }, { CAST_FAILURE_REASON_HIGHLEVEL, "Highlevel" }, { CAST_FAILURE_REASON_HUNGER_SATIATED, "Hunger Satiated" }, { CAST_FAILURE_REASON_IMMUNE, "Immune" }, { CAST_FAILURE_REASON_INTERRUPTED, "Interrupted" }, { CAST_FAILURE_REASON_INTERRUPTED_COMBAT, "Interrupted Combat" }, { CAST_FAILURE_REASON_ITEM_ALREADY_ENCHANTED, "Item Already Enchanted" }, { CAST_FAILURE_REASON_ITEM_GONE, "Item Gone" }, { CAST_FAILURE_REASON_ITEM_NOT_FOUND, "Item Not Found" }, { CAST_FAILURE_REASON_ITEM_NOT_READY, "Item Not Ready" }, { CAST_FAILURE_REASON_LEVEL_REQUIREMENT, "Level Requirement" }, { CAST_FAILURE_REASON_LINE_OF_SIGHT, "Line Of Sight" }, { CAST_FAILURE_REASON_LOWLEVEL, "Lowlevel" }, { CAST_FAILURE_REASON_LOW_CASTLEVEL, "Low Castlevel" }, { CAST_FAILURE_REASON_MAINHAND_EMPTY, "Mainhand Empty" }, { CAST_FAILURE_REASON_MOVING, "Moving" }, { CAST_FAILURE_REASON_NEED_AMMO, "Need Ammo" }, { CAST_FAILURE_REASON_NEED_AMMO_POUCH, "Need Ammo Pouch" }, { CAST_FAILURE_REASON_NEED_EXOTIC_AMMO, "Need Exotic Ammo" }, { CAST_FAILURE_REASON_NOPATH, "Nopath" }, { CAST_FAILURE_REASON_NOT_BEHIND, "Not Behind" }, { CAST_FAILURE_REASON_NOT_FISHABLE, "Not Fishable" }, { CAST_FAILURE_REASON_NOT_HERE, "Not Here" }, { CAST_FAILURE_REASON_NOT_INFRONT, "Not Infront" }, { CAST_FAILURE_REASON_NOT_IN_CONTROL, "Not In Control" }, { CAST_FAILURE_REASON_NOT_KNOWN, "Not Known" }, { CAST_FAILURE_REASON_NOT_MOUNTED, "Not Mounted" }, { CAST_FAILURE_REASON_NOT_ON_TAXI, "Not On Taxi" }, { CAST_FAILURE_REASON_NOT_ON_TRANSPORT, "Not On Transport" }, { CAST_FAILURE_REASON_NOT_READY, "Not Ready" }, { CAST_FAILURE_REASON_NOT_SHAPESHIFT, "Not Shapeshift" }, { CAST_FAILURE_REASON_NOT_STANDING, "Not Standing" }, { CAST_FAILURE_REASON_NOT_TRADEABLE, "Not Tradeable" }, { CAST_FAILURE_REASON_NOT_TRADING, "Not Trading" }, { CAST_FAILURE_REASON_NOT_UNSHEATHED, "Not Unsheathed" }, { CAST_FAILURE_REASON_NOT_WHILE_GHOST, "Not While Ghost" }, { CAST_FAILURE_REASON_NO_AMMO, "No Ammo" }, { CAST_FAILURE_REASON_NO_CHARGES_REMAIN, "No Charges Remain" }, { CAST_FAILURE_REASON_NO_CHAMPION, "No Champion" }, { CAST_FAILURE_REASON_NO_COMBO_POINTS, "No Combo Points" }, { CAST_FAILURE_REASON_NO_DUELING, "No Dueling" }, { CAST_FAILURE_REASON_NO_ENDURANCE, "No Endurance" }, { CAST_FAILURE_REASON_NO_FISH, "No Fish" }, { CAST_FAILURE_REASON_NO_ITEMS_WHILE_SHAPESHIFTED, "No Items While Shapeshifted" }, { CAST_FAILURE_REASON_NO_MOUNTS_ALLOWED, "No Mounts Allowed" }, { CAST_FAILURE_REASON_NO_PET, "No Pet" }, { CAST_FAILURE_REASON_NO_POWER, "No Power" }, { CAST_FAILURE_REASON_NOTHING_TO_DISPEL, "Nothing To Dispel" }, { CAST_FAILURE_REASON_NOTHING_TO_STEAL, "Nothing To Steal" }, { CAST_FAILURE_REASON_ONLY_ABOVEWATER, "Only Abovewater" }, { CAST_FAILURE_REASON_ONLY_DAYTIME, "Only Daytime" }, { CAST_FAILURE_REASON_ONLY_INDOORS, "Only Indoors" }, { CAST_FAILURE_REASON_ONLY_MOUNTED, "Only Mounted" }, { CAST_FAILURE_REASON_ONLY_NIGHTTIME, "Only Nighttime" }, { CAST_FAILURE_REASON_ONLY_OUTDOORS, "Only Outdoors" }, { CAST_FAILURE_REASON_ONLY_SHAPESHIFT, "Only Shapeshift" }, { CAST_FAILURE_REASON_ONLY_STEALTHED, "Only Stealthed" }, { CAST_FAILURE_REASON_ONLY_UNDERWATER, "Only Underwater" }, { CAST_FAILURE_REASON_OUT_OF_RANGE, "Out Of Range" }, { CAST_FAILURE_REASON_PACIFIED, "Pacified" }, { CAST_FAILURE_REASON_POSSESSED, "Possessed" }, { CAST_FAILURE_REASON_REAGENTS, "Reagents" }, { CAST_FAILURE_REASON_REQUIRES_AREA, "Requires Area" }, { CAST_FAILURE_REASON_REQUIRES_SPELL_FOCUS, "Requires Spell Focus" }, { CAST_FAILURE_REASON_ROOTED, "Rooted" }, { CAST_FAILURE_REASON_SILENCED, "Silenced" }, { CAST_FAILURE_REASON_SPELL_IN_PROGRESS, "Spell In Progress" }, { CAST_FAILURE_REASON_SPELL_LEARNED, "Spell Learned" }, { CAST_FAILURE_REASON_SPELL_UNAVAILABLE, "Spell Unavailable" }, { CAST_FAILURE_REASON_STUNNED, "Stunned" }, { CAST_FAILURE_REASON_TARGETS_DEAD, "Targets Dead" }, { CAST_FAILURE_REASON_TARGET_AFFECTING_COMBAT, "Target Affecting Combat" }, { CAST_FAILURE_REASON_TARGET_AURASTATE, "Target Aurastate" }, { CAST_FAILURE_REASON_TARGET_DUELING, "Target Dueling" }, { CAST_FAILURE_REASON_TARGET_ENEMY, "Target Enemy" }, { CAST_FAILURE_REASON_TARGET_ENRAGED, "Target Enraged" }, { CAST_FAILURE_REASON_TARGET_FRIENDLY, "Target Friendly" }, { CAST_FAILURE_REASON_TARGET_IN_COMBAT, "Target In Combat" }, { CAST_FAILURE_REASON_TARGET_IS_PLAYER, "Target Is Player" }, { CAST_FAILURE_REASON_TARGET_NOT_DEAD, "Target Not Dead" }, { CAST_FAILURE_REASON_TARGET_NOT_IN_PARTY, "Target Not In Party" }, { CAST_FAILURE_REASON_TARGET_NOT_LOOTED, "Target Not Looted" }, { CAST_FAILURE_REASON_TARGET_NOT_PLAYER, "Target Not Player" }, { CAST_FAILURE_REASON_TARGET_NO_POCKETS, "Target No Pockets" }, { CAST_FAILURE_REASON_TARGET_NO_WEAPONS, "Target No Weapons" }, { CAST_FAILURE_REASON_TARGET_UNSKINNABLE, "Target Unskinnable" }, { CAST_FAILURE_REASON_THIRST_SATIATED, "Thirst Satiated" }, { CAST_FAILURE_REASON_TOO_CLOSE, "Too Close" }, { CAST_FAILURE_REASON_TOO_MANY_OF_ITEM, "Too Many Of Item" }, { CAST_FAILURE_REASON_TOTEMS, "Totems" }, { CAST_FAILURE_REASON_TRAINING_POINTS, "Training Points" }, { CAST_FAILURE_REASON_TRY_AGAIN, "Try Again" }, { CAST_FAILURE_REASON_UNIT_NOT_BEHIND, "Unit Not Behind" }, { CAST_FAILURE_REASON_UNIT_NOT_INFRONT, "Unit Not Infront" }, { CAST_FAILURE_REASON_WRONG_PET_FOOD, "Wrong Pet Food" }, { CAST_FAILURE_REASON_NOT_WHILE_FATIGUED, "Not While Fatigued" }, { CAST_FAILURE_REASON_TARGET_NOT_IN_INSTANCE, "Target Not In Instance" }, { CAST_FAILURE_REASON_NOT_WHILE_TRADING, "Not While Trading" }, { CAST_FAILURE_REASON_TARGET_NOT_IN_RAID, "Target Not In Raid" }, { CAST_FAILURE_REASON_DISENCHANT_WHILE_LOOTING, "Disenchant While Looting" }, { CAST_FAILURE_REASON_PROSPECT_WHILE_LOOTING, "Prospect While Looting" }, { CAST_FAILURE_REASON_PROSPECT_NEED_MORE, "Prospect Need More" }, { CAST_FAILURE_REASON_TARGET_FREEFORALL, "Target Freeforall" }, { CAST_FAILURE_REASON_NO_EDIBLE_CORPSES, "No Edible Corpses" }, { CAST_FAILURE_REASON_ONLY_BATTLEGROUNDS, "Only Battlegrounds" }, { CAST_FAILURE_REASON_TARGET_NOT_GHOST, "Target Not Ghost" }, { CAST_FAILURE_REASON_TOO_MANY_SKILLS, "Too Many Skills" }, { CAST_FAILURE_REASON_TRANSFORM_UNUSABLE, "Transform Unusable" }, { CAST_FAILURE_REASON_WRONG_WEATHER, "Wrong Weather" }, { CAST_FAILURE_REASON_DAMAGE_IMMUNE, "Damage Immune" }, { CAST_FAILURE_REASON_PREVENTED_BY_MECHANIC, "Prevented By Mechanic" }, { CAST_FAILURE_REASON_PLAY_TIME, "Play Time" }, { CAST_FAILURE_REASON_REPUTATION, "Reputation" }, { CAST_FAILURE_REASON_MIN_SKILL, "Min Skill" }, { CAST_FAILURE_REASON_UNKNOWN, "Unknown" }, { 0, NULL } }; typedef enum { CHAT_NOTIFY_JOINED_NOTICE = 0x00, CHAT_NOTIFY_LEFT_NOTICE = 0x01, CHAT_NOTIFY_YOU_JOINED_NOTICE = 0x02, CHAT_NOTIFY_YOU_LEFT_NOTICE = 0x03, CHAT_NOTIFY_WRONG_PASSWORD_NOTICE = 0x04, CHAT_NOTIFY_NOT_MEMBER_NOTICE = 0x05, CHAT_NOTIFY_NOT_MODERATOR_NOTICE = 0x06, CHAT_NOTIFY_PASSWORD_CHANGED_NOTICE = 0x07, CHAT_NOTIFY_OWNER_CHANGED_NOTICE = 0x08, CHAT_NOTIFY_PLAYER_NOT_FOUND_NOTICE = 0x09, CHAT_NOTIFY_NOT_OWNER_NOTICE = 0x0A, CHAT_NOTIFY_CHANNEL_OWNER_NOTICE = 0x0B, CHAT_NOTIFY_MODE_CHANGE_NOTICE = 0x0C, CHAT_NOTIFY_ANNOUNCEMENTS_ON_NOTICE = 0x0D, CHAT_NOTIFY_ANNOUNCEMENTS_OFF_NOTICE = 0x0E, CHAT_NOTIFY_MODERATION_ON_NOTICE = 0x0F, CHAT_NOTIFY_MODERATION_OFF_NOTICE = 0x10, CHAT_NOTIFY_MUTED_NOTICE = 0x11, CHAT_NOTIFY_PLAYER_KICKED_NOTICE = 0x12, CHAT_NOTIFY_BANNED_NOTICE = 0x13, CHAT_NOTIFY_PLAYER_BANNED_NOTICE = 0x14, CHAT_NOTIFY_PLAYER_UNBANNED_NOTICE = 0x15, CHAT_NOTIFY_PLAYER_NOT_BANNED_NOTICE = 0x16, CHAT_NOTIFY_PLAYER_ALREADY_MEMBER_NOTICE = 0x17, CHAT_NOTIFY_INVITE_NOTICE = 0x18, CHAT_NOTIFY_INVITE_WRONG_FACTION_NOTICE = 0x19, CHAT_NOTIFY_WRONG_FACTION_NOTICE = 0x1A, CHAT_NOTIFY_INVALID_NAME_NOTICE = 0x1B, CHAT_NOTIFY_NOT_MODERATED_NOTICE = 0x1C, CHAT_NOTIFY_PLAYER_INVITED_NOTICE = 0x1D, CHAT_NOTIFY_PLAYER_INVITE_BANNED_NOTICE = 0x1E, CHAT_NOTIFY_THROTTLED_NOTICE = 0x1F, } e_chat_notify; static const value_string e_chat_notify_strings[] = { { CHAT_NOTIFY_JOINED_NOTICE, "Joined Notice" }, { CHAT_NOTIFY_LEFT_NOTICE, "Left Notice" }, { CHAT_NOTIFY_YOU_JOINED_NOTICE, "You Joined Notice" }, { CHAT_NOTIFY_YOU_LEFT_NOTICE, "You Left Notice" }, { CHAT_NOTIFY_WRONG_PASSWORD_NOTICE, "Wrong Password Notice" }, { CHAT_NOTIFY_NOT_MEMBER_NOTICE, "Not Member Notice" }, { CHAT_NOTIFY_NOT_MODERATOR_NOTICE, "Not Moderator Notice" }, { CHAT_NOTIFY_PASSWORD_CHANGED_NOTICE, "Password Changed Notice" }, { CHAT_NOTIFY_OWNER_CHANGED_NOTICE, "Owner Changed Notice" }, { CHAT_NOTIFY_PLAYER_NOT_FOUND_NOTICE, "Player Not Found Notice" }, { CHAT_NOTIFY_NOT_OWNER_NOTICE, "Not Owner Notice" }, { CHAT_NOTIFY_CHANNEL_OWNER_NOTICE, "Channel Owner Notice" }, { CHAT_NOTIFY_MODE_CHANGE_NOTICE, "Mode Change Notice" }, { CHAT_NOTIFY_ANNOUNCEMENTS_ON_NOTICE, "Announcements On Notice" }, { CHAT_NOTIFY_ANNOUNCEMENTS_OFF_NOTICE, "Announcements Off Notice" }, { CHAT_NOTIFY_MODERATION_ON_NOTICE, "Moderation On Notice" }, { CHAT_NOTIFY_MODERATION_OFF_NOTICE, "Moderation Off Notice" }, { CHAT_NOTIFY_MUTED_NOTICE, "Muted Notice" }, { CHAT_NOTIFY_PLAYER_KICKED_NOTICE, "Player Kicked Notice" }, { CHAT_NOTIFY_BANNED_NOTICE, "Banned Notice" }, { CHAT_NOTIFY_PLAYER_BANNED_NOTICE, "Player Banned Notice" }, { CHAT_NOTIFY_PLAYER_UNBANNED_NOTICE, "Player Unbanned Notice" }, { CHAT_NOTIFY_PLAYER_NOT_BANNED_NOTICE, "Player Not Banned Notice" }, { CHAT_NOTIFY_PLAYER_ALREADY_MEMBER_NOTICE, "Player Already Member Notice" }, { CHAT_NOTIFY_INVITE_NOTICE, "Invite Notice" }, { CHAT_NOTIFY_INVITE_WRONG_FACTION_NOTICE, "Invite Wrong Faction Notice" }, { CHAT_NOTIFY_WRONG_FACTION_NOTICE, "Wrong Faction Notice" }, { CHAT_NOTIFY_INVALID_NAME_NOTICE, "Invalid Name Notice" }, { CHAT_NOTIFY_NOT_MODERATED_NOTICE, "Not Moderated Notice" }, { CHAT_NOTIFY_PLAYER_INVITED_NOTICE, "Player Invited Notice" }, { CHAT_NOTIFY_PLAYER_INVITE_BANNED_NOTICE, "Player Invite Banned Notice" }, { CHAT_NOTIFY_THROTTLED_NOTICE, "Throttled Notice" }, { 0, NULL } }; typedef enum { DISMOUNT_RESULT_NOT_MOUNTED = 0x1, DISMOUNT_RESULT_OK = 0x3, } e_dismount_result; static const value_string e_dismount_result_strings[] = { { DISMOUNT_RESULT_NOT_MOUNTED, "Not Mounted" }, { DISMOUNT_RESULT_OK, "Ok" }, { 0, NULL } }; typedef enum { DUEL_WINNER_REASON_WON = 0x0, DUEL_WINNER_REASON_FLED = 0x1, } e_duel_winner_reason; static const value_string e_duel_winner_reason_strings[] = { { DUEL_WINNER_REASON_WON, "Won" }, { DUEL_WINNER_REASON_FLED, "Fled" }, { 0, NULL } }; typedef enum { ENVIRONMENTAL_DAMAGE_TYPE_EXHAUSTED = 0x0, ENVIRONMENTAL_DAMAGE_TYPE_DROWNING = 0x1, ENVIRONMENTAL_DAMAGE_TYPE_FALL = 0x2, ENVIRONMENTAL_DAMAGE_TYPE_LAVA = 0x3, ENVIRONMENTAL_DAMAGE_TYPE_SLIME = 0x4, ENVIRONMENTAL_DAMAGE_TYPE_FIRE = 0x5, } e_environmental_damage_type; static const value_string e_environmental_damage_type_strings[] = { { ENVIRONMENTAL_DAMAGE_TYPE_EXHAUSTED, "Exhausted" }, { ENVIRONMENTAL_DAMAGE_TYPE_DROWNING, "Drowning" }, { ENVIRONMENTAL_DAMAGE_TYPE_FALL, "Fall" }, { ENVIRONMENTAL_DAMAGE_TYPE_LAVA, "Lava" }, { ENVIRONMENTAL_DAMAGE_TYPE_SLIME, "Slime" }, { ENVIRONMENTAL_DAMAGE_TYPE_FIRE, "Fire" }, { 0, NULL } }; typedef enum { FRIEND_RESULT_DB_ERROR = 0x00, FRIEND_RESULT_LIST_FULL = 0x01, FRIEND_RESULT_ONLINE = 0x02, FRIEND_RESULT_OFFLINE = 0x03, FRIEND_RESULT_NOT_FOUND = 0x04, FRIEND_RESULT_REMOVED = 0x05, FRIEND_RESULT_ADDED_ONLINE = 0x06, FRIEND_RESULT_ADDED_OFFLINE = 0x07, FRIEND_RESULT_ALREADY = 0x08, FRIEND_RESULT_SELF = 0x09, FRIEND_RESULT_ENEMY = 0x0A, FRIEND_RESULT_IGNORE_FULL = 0x0B, FRIEND_RESULT_IGNORE_SELF = 0x0C, FRIEND_RESULT_IGNORE_NOT_FOUND = 0x0D, FRIEND_RESULT_IGNORE_ALREADY = 0x0E, FRIEND_RESULT_IGNORE_ADDED = 0x0F, FRIEND_RESULT_IGNORE_REMOVED = 0x10, FRIEND_RESULT_IGNORE_AMBIGUOUS = 0x11, FRIEND_RESULT_MUTE_FULL = 0x12, FRIEND_RESULT_MUTE_SELF = 0x13, FRIEND_RESULT_MUTE_NOT_FOUND = 0x14, FRIEND_RESULT_MUTE_ALREADY = 0x15, FRIEND_RESULT_MUTE_ADDED = 0x16, FRIEND_RESULT_MUTE_REMOVED = 0x17, FRIEND_RESULT_MUTE_AMBIGUOUS = 0x18, FRIEND_RESULT_UNKNOWN19 = 0x19, FRIEND_RESULT_UNKNOWN20 = 0x1A, } e_friend_result; static const value_string e_friend_result_strings[] = { { FRIEND_RESULT_DB_ERROR, "Db Error" }, { FRIEND_RESULT_LIST_FULL, "List Full" }, { FRIEND_RESULT_ONLINE, "Online" }, { FRIEND_RESULT_OFFLINE, "Offline" }, { FRIEND_RESULT_NOT_FOUND, "Not Found" }, { FRIEND_RESULT_REMOVED, "Removed" }, { FRIEND_RESULT_ADDED_ONLINE, "Added Online" }, { FRIEND_RESULT_ADDED_OFFLINE, "Added Offline" }, { FRIEND_RESULT_ALREADY, "Already" }, { FRIEND_RESULT_SELF, "Self" }, { FRIEND_RESULT_ENEMY, "Enemy" }, { FRIEND_RESULT_IGNORE_FULL, "Ignore Full" }, { FRIEND_RESULT_IGNORE_SELF, "Ignore Self" }, { FRIEND_RESULT_IGNORE_NOT_FOUND, "Ignore Not Found" }, { FRIEND_RESULT_IGNORE_ALREADY, "Ignore Already" }, { FRIEND_RESULT_IGNORE_ADDED, "Ignore Added" }, { FRIEND_RESULT_IGNORE_REMOVED, "Ignore Removed" }, { FRIEND_RESULT_IGNORE_AMBIGUOUS, "Ignore Ambiguous" }, { FRIEND_RESULT_MUTE_FULL, "Mute Full" }, { FRIEND_RESULT_MUTE_SELF, "Mute Self" }, { FRIEND_RESULT_MUTE_NOT_FOUND, "Mute Not Found" }, { FRIEND_RESULT_MUTE_ALREADY, "Mute Already" }, { FRIEND_RESULT_MUTE_ADDED, "Mute Added" }, { FRIEND_RESULT_MUTE_REMOVED, "Mute Removed" }, { FRIEND_RESULT_MUTE_AMBIGUOUS, "Mute Ambiguous" }, { FRIEND_RESULT_UNKNOWN19, "Unknown19" }, { FRIEND_RESULT_UNKNOWN20, "Unknown20" }, { 0, NULL } }; typedef enum { GM_TICKET_RESPONSE_NOT_EXIST = 0x0, GM_TICKET_RESPONSE_ALREADY_EXIST = 0x1, GM_TICKET_RESPONSE_CREATE_SUCCESS = 0x2, GM_TICKET_RESPONSE_CREATE_ERROR = 0x3, GM_TICKET_RESPONSE_UPDATE_SUCCESS = 0x4, GM_TICKET_RESPONSE_UPDATE_ERROR = 0x5, GM_TICKET_RESPONSE_TICKET_DELETED = 0x9, } e_gm_ticket_response; static const value_string e_gm_ticket_response_strings[] = { { GM_TICKET_RESPONSE_NOT_EXIST, "Not Exist" }, { GM_TICKET_RESPONSE_ALREADY_EXIST, "Already Exist" }, { GM_TICKET_RESPONSE_CREATE_SUCCESS, "Create Success" }, { GM_TICKET_RESPONSE_CREATE_ERROR, "Create Error" }, { GM_TICKET_RESPONSE_UPDATE_SUCCESS, "Update Success" }, { GM_TICKET_RESPONSE_UPDATE_ERROR, "Update Error" }, { GM_TICKET_RESPONSE_TICKET_DELETED, "Ticket Deleted" }, { 0, NULL } }; typedef enum { GM_TICKET_STATUS_DB_ERROR = 0x0, GM_TICKET_STATUS_HAS_TEXT = 0x6, GM_TICKET_STATUS_DEFAULT = 0xA, } e_gm_ticket_status; static const value_string e_gm_ticket_status_strings[] = { { GM_TICKET_STATUS_DB_ERROR, "Db Error" }, { GM_TICKET_STATUS_HAS_TEXT, "Has Text" }, { GM_TICKET_STATUS_DEFAULT, "Default" }, { 0, NULL } }; typedef enum { GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_NOT_ASSIGNED = 0x0, GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_ASSIGNED = 0x1, GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_ESCALATED = 0x2, } e_gm_ticket_escalation_status; static const value_string e_gm_ticket_escalation_status_strings[] = { { GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_NOT_ASSIGNED, "Gmticket Assignedtogm Status Not Assigned" }, { GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_ASSIGNED, "Gmticket Assignedtogm Status Assigned" }, { GM_TICKET_ESCALATION_STATUS_GMTICKET_ASSIGNEDTOGM_STATUS_ESCALATED, "Gmticket Assignedtogm Status Escalated" }, { 0, NULL } }; typedef enum { GM_TICKET_QUEUE_STATUS_ENABLED = 0x1, GM_TICKET_QUEUE_STATUS_DISABLED = 0x0, } e_gm_ticket_queue_status; static const value_string e_gm_ticket_queue_status_strings[] = { { GM_TICKET_QUEUE_STATUS_ENABLED, "Enabled" }, { GM_TICKET_QUEUE_STATUS_DISABLED, "Disabled" }, { 0, NULL } }; typedef enum { GM_TICKET_STATUS_RESPONSE_UPDATED = 0x1, GM_TICKET_STATUS_RESPONSE_CLOSED = 0x2, GM_TICKET_STATUS_RESPONSE_SURVEY = 0x3, } e_gm_ticket_status_response; static const value_string e_gm_ticket_status_response_strings[] = { { GM_TICKET_STATUS_RESPONSE_UPDATED, "Updated" }, { GM_TICKET_STATUS_RESPONSE_CLOSED, "Closed" }, { GM_TICKET_STATUS_RESPONSE_SURVEY, "Survey" }, { 0, NULL } }; typedef enum { BG_TYPE_ID_NOT_ELIGIBLE = 0x00000000, BG_TYPE_ID_QUEUED_FOR_AV = 0x00000001, BG_TYPE_ID_QUEUED_FOR_WSG = 0x00000002, BG_TYPE_ID_QUEUED_FOR_AB = 0x00000003, BG_TYPE_ID_REMOVE_FROM_QUEUE = -0x0000002, } e_bg_type_id; static const value_string e_bg_type_id_strings[] = { { BG_TYPE_ID_NOT_ELIGIBLE, "Not Eligible" }, { BG_TYPE_ID_QUEUED_FOR_AV, "Queued For Av" }, { BG_TYPE_ID_QUEUED_FOR_WSG, "Queued For Wsg" }, { BG_TYPE_ID_QUEUED_FOR_AB, "Queued For Ab" }, { BG_TYPE_ID_REMOVE_FROM_QUEUE, "Remove From Queue" }, { 0, NULL } }; typedef enum { GROUP_TYPE_NORMAL = 0x0, GROUP_TYPE_RAID = 0x1, } e_group_type; static const value_string e_group_type_strings[] = { { GROUP_TYPE_NORMAL, "Normal" }, { GROUP_TYPE_RAID, "Raid" }, { 0, NULL } }; typedef enum { GUILD_COMMAND_CREATE = 0x00, GUILD_COMMAND_INVITE = 0x01, GUILD_COMMAND_QUIT = 0x03, GUILD_COMMAND_FOUNDER = 0x0E, GUILD_COMMAND_UNKNOWN19 = 0x13, GUILD_COMMAND_UNKNOWN20 = 0x14, } e_guild_command; static const value_string e_guild_command_strings[] = { { GUILD_COMMAND_CREATE, "Create" }, { GUILD_COMMAND_INVITE, "Invite" }, { GUILD_COMMAND_QUIT, "Quit" }, { GUILD_COMMAND_FOUNDER, "Founder" }, { GUILD_COMMAND_UNKNOWN19, "Unknown19" }, { GUILD_COMMAND_UNKNOWN20, "Unknown20" }, { 0, NULL } }; typedef enum { GUILD_COMMAND_RESULT_PLAYER_NO_MORE_IN_GUILD = 0x0, GUILD_COMMAND_RESULT_GUILD_INTERNAL = 0x1, GUILD_COMMAND_RESULT_ALREADY_IN_GUILD = 0x2, GUILD_COMMAND_RESULT_ALREADY_IN_GUILD_S = 0x3, GUILD_COMMAND_RESULT_INVITED_TO_GUILD = 0x4, GUILD_COMMAND_RESULT_ALREADY_INVITED_TO_GUILD_S = 0x5, GUILD_COMMAND_RESULT_GUILD_NAME_INVALID = 0x6, GUILD_COMMAND_RESULT_GUILD_NAME_EXISTS_S = 0x7, GUILD_COMMAND_RESULT_GUILD_PERMISSIONS_OR_LEADER = 0x8, GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_IN_GUILD = 0x9, GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_IN_GUILD_S = 0xA, GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_FOUND_S = 0xB, GUILD_COMMAND_RESULT_GUILD_NOT_ALLIED = 0xC, GUILD_COMMAND_RESULT_GUILD_RANK_TOO_HIGH_S = 0xD, GUILD_COMMAND_RESULT_GUILD_RANK_TOO_LOW_S = 0xE, } e_guild_command_result; static const value_string e_guild_command_result_strings[] = { { GUILD_COMMAND_RESULT_PLAYER_NO_MORE_IN_GUILD, "Player No More In Guild" }, { GUILD_COMMAND_RESULT_GUILD_INTERNAL, "Guild Internal" }, { GUILD_COMMAND_RESULT_ALREADY_IN_GUILD, "Already In Guild" }, { GUILD_COMMAND_RESULT_ALREADY_IN_GUILD_S, "Already In Guild S" }, { GUILD_COMMAND_RESULT_INVITED_TO_GUILD, "Invited To Guild" }, { GUILD_COMMAND_RESULT_ALREADY_INVITED_TO_GUILD_S, "Already Invited To Guild S" }, { GUILD_COMMAND_RESULT_GUILD_NAME_INVALID, "Guild Name Invalid" }, { GUILD_COMMAND_RESULT_GUILD_NAME_EXISTS_S, "Guild Name Exists S" }, { GUILD_COMMAND_RESULT_GUILD_PERMISSIONS_OR_LEADER, "Guild Permissions Or Leader" }, { GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_IN_GUILD, "Guild Player Not In Guild" }, { GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_IN_GUILD_S, "Guild Player Not In Guild S" }, { GUILD_COMMAND_RESULT_GUILD_PLAYER_NOT_FOUND_S, "Guild Player Not Found S" }, { GUILD_COMMAND_RESULT_GUILD_NOT_ALLIED, "Guild Not Allied" }, { GUILD_COMMAND_RESULT_GUILD_RANK_TOO_HIGH_S, "Guild Rank Too High S" }, { GUILD_COMMAND_RESULT_GUILD_RANK_TOO_LOW_S, "Guild Rank Too Low S" }, { 0, NULL } }; typedef enum { GUILD_EVENT_PROMOTION = 0x0, GUILD_EVENT_DEMOTION = 0x1, GUILD_EVENT_MOTD = 0x2, GUILD_EVENT_JOINED = 0x3, GUILD_EVENT_LEFT = 0x4, GUILD_EVENT_REMOVED = 0x5, GUILD_EVENT_LEADER_IS = 0x6, GUILD_EVENT_LEADER_CHANGED = 0x7, GUILD_EVENT_DISBANDED = 0x8, GUILD_EVENT_TABARD_CHANGED = 0x9, GUILD_EVENT_UNKNOWN10 = 0xA, GUILD_EVENT_ROSTER_UPDATE = 0xB, GUILD_EVENT_SIGNED_ON = 0xC, GUILD_EVENT_SIGNED_OFF = 0xD, } e_guild_event; static const value_string e_guild_event_strings[] = { { GUILD_EVENT_PROMOTION, "Promotion" }, { GUILD_EVENT_DEMOTION, "Demotion" }, { GUILD_EVENT_MOTD, "Motd" }, { GUILD_EVENT_JOINED, "Joined" }, { GUILD_EVENT_LEFT, "Left" }, { GUILD_EVENT_REMOVED, "Removed" }, { GUILD_EVENT_LEADER_IS, "Leader Is" }, { GUILD_EVENT_LEADER_CHANGED, "Leader Changed" }, { GUILD_EVENT_DISBANDED, "Disbanded" }, { GUILD_EVENT_TABARD_CHANGED, "Tabard Changed" }, { GUILD_EVENT_UNKNOWN10, "Unknown10" }, { GUILD_EVENT_ROSTER_UPDATE, "Roster Update" }, { GUILD_EVENT_SIGNED_ON, "Signed On" }, { GUILD_EVENT_SIGNED_OFF, "Signed Off" }, { 0, NULL } }; typedef enum { INSTANCE_RESET_FAILED_REASON_GENERAL = 0x0, INSTANCE_RESET_FAILED_REASON_OFFLINE = 0x1, INSTANCE_RESET_FAILED_REASON_ZONING = 0x2, INSTANCE_RESET_FAILED_REASON_SILENTLY = 0x3, } e_instance_reset_failed_reason; static const value_string e_instance_reset_failed_reason_strings[] = { { INSTANCE_RESET_FAILED_REASON_GENERAL, "General" }, { INSTANCE_RESET_FAILED_REASON_OFFLINE, "Offline" }, { INSTANCE_RESET_FAILED_REASON_ZONING, "Zoning" }, { INSTANCE_RESET_FAILED_REASON_SILENTLY, "Silently" }, { 0, NULL } }; typedef enum { NEW_ITEM_SOURCE_LOOTED = 0x0, NEW_ITEM_SOURCE_FROM_NPC = 0x1, } e_new_item_source; static const value_string e_new_item_source_strings[] = { { NEW_ITEM_SOURCE_LOOTED, "Looted" }, { NEW_ITEM_SOURCE_FROM_NPC, "From Npc" }, { 0, NULL } }; typedef enum { NEW_ITEM_CREATION_TYPE_RECEIVED = 0x0, NEW_ITEM_CREATION_TYPE_CREATED = 0x1, } e_new_item_creation_type; static const value_string e_new_item_creation_type_strings[] = { { NEW_ITEM_CREATION_TYPE_RECEIVED, "Received" }, { NEW_ITEM_CREATION_TYPE_CREATED, "Created" }, { 0, NULL } }; typedef enum { NEW_ITEM_CHAT_ALERT_DO_NOT_SHOW = 0x0, NEW_ITEM_CHAT_ALERT_SHOW = 0x1, } e_new_item_chat_alert; static const value_string e_new_item_chat_alert_strings[] = { { NEW_ITEM_CHAT_ALERT_DO_NOT_SHOW, "Do Not Show" }, { NEW_ITEM_CHAT_ALERT_SHOW, "Show" }, { 0, NULL } }; typedef enum { ITEM_CLASS_AND_SUB_CLASS_CONSUMABLE = 0x0000000000, ITEM_CLASS_AND_SUB_CLASS_CHEESE_OR_BREAD_OBSOLETE = 0x0000000000, ITEM_CLASS_AND_SUB_CLASS_LIQUID_OBSOLETE = 0x0000000000, ITEM_CLASS_AND_SUB_CLASS_BAG = 0x0000000001, ITEM_CLASS_AND_SUB_CLASS_SOUL_BAG = 0x0000000001, ITEM_CLASS_AND_SUB_CLASS_HERB_BAG = 0x0000000001, ITEM_CLASS_AND_SUB_CLASS_ENCHANTING_BAG = 0x0000000001, ITEM_CLASS_AND_SUB_CLASS_ENGINEERING_BAG = 0x0000000001, ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_AXE = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_AXE = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_BOW = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_GUN = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_MACE = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_MACE = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_POLEARM = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_SWORD = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_SWORD = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_OBSOLETE_WEAPON = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_STAFF = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_EXOTIC = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_EXOTIC = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_FIST_WEAPON = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_MISCELLANEOUS_WEAPON = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_DAGGER = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_THROWN = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_SPEAR = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_CROSSBOW = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_WAND = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_FISHING_POLE = 0x0000000002, ITEM_CLASS_AND_SUB_CLASS_JEWELRY_OBSOLETE = 0x0000000003, ITEM_CLASS_AND_SUB_CLASS_MISCELLANEOUS_ARMOR = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_CLOTH_ARMOR = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_LEATHER_ARMOR = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_MAIL_ARMOR = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_PLATE_ARMOR = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_BUCKLER_OBSOLETE = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_SHIELD = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_LIBRAM = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_IDOL = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_TOTEM = 0x0000000004, ITEM_CLASS_AND_SUB_CLASS_REAGENT = 0x0000000005, ITEM_CLASS_AND_SUB_CLASS_WAND_OBSOLETE = 0x0000000006, ITEM_CLASS_AND_SUB_CLASS_BOLT_OBSOLETE = 0x0000000006, ITEM_CLASS_AND_SUB_CLASS_ARROW = 0x0000000006, ITEM_CLASS_AND_SUB_CLASS_BULLET = 0x0000000006, ITEM_CLASS_AND_SUB_CLASS_THROWN_OBSOLETE = 0x0000000006, ITEM_CLASS_AND_SUB_CLASS_TRADE_GOOD = 0x0000000007, ITEM_CLASS_AND_SUB_CLASS_PART_TRADE_GOOD = 0x0000000007, ITEM_CLASS_AND_SUB_CLASS_EXPLOSIVE_TRADE_GOOD = 0x0000000007, ITEM_CLASS_AND_SUB_CLASS_DEVICE_TRADE_GOOD = 0x0000000007, ITEM_CLASS_AND_SUB_CLASS_GENERIC_OBSOLETE = 0x0000000008, ITEM_CLASS_AND_SUB_CLASS_BOOK = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_LEATHERWORKING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_TAILORING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_ENGINEERING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_BLACKSMITHING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_COOKING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_ALCHEMY_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_FIRST_AID_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_ENCHANTING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_FISHING_RECIPE = 0x0000000009, ITEM_CLASS_AND_SUB_CLASS_MONEY_OBSOLETE = 0x000000000A, ITEM_CLASS_AND_SUB_CLASS_QUIVER_OBSOLETE = 0x000000000B, ITEM_CLASS_AND_SUB_CLASS_QUIVER_OBSOLETE1 = 0x000000000B, ITEM_CLASS_AND_SUB_CLASS_QUIVER = 0x000000000B, ITEM_CLASS_AND_SUB_CLASS_AMMO_POUCH = 0x000000000B, ITEM_CLASS_AND_SUB_CLASS_QUEST = 0x000000000C, ITEM_CLASS_AND_SUB_CLASS_KEY = 0x000000000D, ITEM_CLASS_AND_SUB_CLASS_LOCKPICK = 0x000000000D, ITEM_CLASS_AND_SUB_CLASS_PERMANENT = 0x000000000E, ITEM_CLASS_AND_SUB_CLASS_JUNK = 0x000000000F, } e_item_class_and_sub_class; static const val64_string e_item_class_and_sub_class_strings[] = { { ITEM_CLASS_AND_SUB_CLASS_CONSUMABLE, "Consumable" }, { ITEM_CLASS_AND_SUB_CLASS_CHEESE_OR_BREAD_OBSOLETE, "Cheese Or Bread Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_LIQUID_OBSOLETE, "Liquid Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_BAG, "Bag" }, { ITEM_CLASS_AND_SUB_CLASS_SOUL_BAG, "Soul Bag" }, { ITEM_CLASS_AND_SUB_CLASS_HERB_BAG, "Herb Bag" }, { ITEM_CLASS_AND_SUB_CLASS_ENCHANTING_BAG, "Enchanting Bag" }, { ITEM_CLASS_AND_SUB_CLASS_ENGINEERING_BAG, "Engineering Bag" }, { ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_AXE, "One Handed Axe" }, { ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_AXE, "Two Handed Axe" }, { ITEM_CLASS_AND_SUB_CLASS_BOW, "Bow" }, { ITEM_CLASS_AND_SUB_CLASS_GUN, "Gun" }, { ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_MACE, "One Handed Mace" }, { ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_MACE, "Two Handed Mace" }, { ITEM_CLASS_AND_SUB_CLASS_POLEARM, "Polearm" }, { ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_SWORD, "One Handed Sword" }, { ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_SWORD, "Two Handed Sword" }, { ITEM_CLASS_AND_SUB_CLASS_OBSOLETE_WEAPON, "Obsolete Weapon" }, { ITEM_CLASS_AND_SUB_CLASS_STAFF, "Staff" }, { ITEM_CLASS_AND_SUB_CLASS_ONE_HANDED_EXOTIC, "One Handed Exotic" }, { ITEM_CLASS_AND_SUB_CLASS_TWO_HANDED_EXOTIC, "Two Handed Exotic" }, { ITEM_CLASS_AND_SUB_CLASS_FIST_WEAPON, "Fist Weapon" }, { ITEM_CLASS_AND_SUB_CLASS_MISCELLANEOUS_WEAPON, "Miscellaneous Weapon" }, { ITEM_CLASS_AND_SUB_CLASS_DAGGER, "Dagger" }, { ITEM_CLASS_AND_SUB_CLASS_THROWN, "Thrown" }, { ITEM_CLASS_AND_SUB_CLASS_SPEAR, "Spear" }, { ITEM_CLASS_AND_SUB_CLASS_CROSSBOW, "Crossbow" }, { ITEM_CLASS_AND_SUB_CLASS_WAND, "Wand" }, { ITEM_CLASS_AND_SUB_CLASS_FISHING_POLE, "Fishing Pole" }, { ITEM_CLASS_AND_SUB_CLASS_JEWELRY_OBSOLETE, "Jewelry Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_MISCELLANEOUS_ARMOR, "Miscellaneous Armor" }, { ITEM_CLASS_AND_SUB_CLASS_CLOTH_ARMOR, "Cloth Armor" }, { ITEM_CLASS_AND_SUB_CLASS_LEATHER_ARMOR, "Leather Armor" }, { ITEM_CLASS_AND_SUB_CLASS_MAIL_ARMOR, "Mail Armor" }, { ITEM_CLASS_AND_SUB_CLASS_PLATE_ARMOR, "Plate Armor" }, { ITEM_CLASS_AND_SUB_CLASS_BUCKLER_OBSOLETE, "Buckler Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_SHIELD, "Shield" }, { ITEM_CLASS_AND_SUB_CLASS_LIBRAM, "Libram" }, { ITEM_CLASS_AND_SUB_CLASS_IDOL, "Idol" }, { ITEM_CLASS_AND_SUB_CLASS_TOTEM, "Totem" }, { ITEM_CLASS_AND_SUB_CLASS_REAGENT, "Reagent" }, { ITEM_CLASS_AND_SUB_CLASS_WAND_OBSOLETE, "Wand Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_BOLT_OBSOLETE, "Bolt Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_ARROW, "Arrow" }, { ITEM_CLASS_AND_SUB_CLASS_BULLET, "Bullet" }, { ITEM_CLASS_AND_SUB_CLASS_THROWN_OBSOLETE, "Thrown Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_TRADE_GOOD, "Trade Good" }, { ITEM_CLASS_AND_SUB_CLASS_PART_TRADE_GOOD, "Part Trade Good" }, { ITEM_CLASS_AND_SUB_CLASS_EXPLOSIVE_TRADE_GOOD, "Explosive Trade Good" }, { ITEM_CLASS_AND_SUB_CLASS_DEVICE_TRADE_GOOD, "Device Trade Good" }, { ITEM_CLASS_AND_SUB_CLASS_GENERIC_OBSOLETE, "Generic Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_BOOK, "Book" }, { ITEM_CLASS_AND_SUB_CLASS_LEATHERWORKING_RECIPE, "Leatherworking Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_TAILORING_RECIPE, "Tailoring Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_ENGINEERING_RECIPE, "Engineering Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_BLACKSMITHING_RECIPE, "Blacksmithing Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_COOKING_RECIPE, "Cooking Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_ALCHEMY_RECIPE, "Alchemy Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_FIRST_AID_RECIPE, "First Aid Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_ENCHANTING_RECIPE, "Enchanting Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_FISHING_RECIPE, "Fishing Recipe" }, { ITEM_CLASS_AND_SUB_CLASS_MONEY_OBSOLETE, "Money Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_QUIVER_OBSOLETE, "Quiver Obsolete" }, { ITEM_CLASS_AND_SUB_CLASS_QUIVER_OBSOLETE1, "Quiver Obsolete1" }, { ITEM_CLASS_AND_SUB_CLASS_QUIVER, "Quiver" }, { ITEM_CLASS_AND_SUB_CLASS_AMMO_POUCH, "Ammo Pouch" }, { ITEM_CLASS_AND_SUB_CLASS_QUEST, "Quest" }, { ITEM_CLASS_AND_SUB_CLASS_KEY, "Key" }, { ITEM_CLASS_AND_SUB_CLASS_LOCKPICK, "Lockpick" }, { ITEM_CLASS_AND_SUB_CLASS_PERMANENT, "Permanent" }, { ITEM_CLASS_AND_SUB_CLASS_JUNK, "Junk" }, { 0, NULL } }; typedef enum { BONDING_NO_BIND = 0x0, BONDING_PICK_UP = 0x1, BONDING_EQUIP = 0x2, BONDING_USE = 0x3, BONDING_QUEST_ITEM = 0x4, BONDING_QUEST_ITEM1 = 0x5, } e_bonding; static const value_string e_bonding_strings[] = { { BONDING_NO_BIND, "No Bind" }, { BONDING_PICK_UP, "Pick Up" }, { BONDING_EQUIP, "Equip" }, { BONDING_USE, "Use" }, { BONDING_QUEST_ITEM, "Quest Item" }, { BONDING_QUEST_ITEM1, "Quest Item1" }, { 0, NULL } }; typedef enum { PAGE_TEXT_MATERIAL_NONE = 0x0, PAGE_TEXT_MATERIAL_PARCHMENT = 0x1, PAGE_TEXT_MATERIAL_STONE = 0x2, PAGE_TEXT_MATERIAL_MARBLE = 0x3, PAGE_TEXT_MATERIAL_SILVER = 0x4, PAGE_TEXT_MATERIAL_BRONZE = 0x5, PAGE_TEXT_MATERIAL_VALENTINE = 0x6, } e_page_text_material; static const value_string e_page_text_material_strings[] = { { PAGE_TEXT_MATERIAL_NONE, "None" }, { PAGE_TEXT_MATERIAL_PARCHMENT, "Parchment" }, { PAGE_TEXT_MATERIAL_STONE, "Stone" }, { PAGE_TEXT_MATERIAL_MARBLE, "Marble" }, { PAGE_TEXT_MATERIAL_SILVER, "Silver" }, { PAGE_TEXT_MATERIAL_BRONZE, "Bronze" }, { PAGE_TEXT_MATERIAL_VALENTINE, "Valentine" }, { 0, NULL } }; typedef enum { SHEATHE_TYPE_NONE = 0x0, SHEATHE_TYPE_MAIN_HAND = 0x1, SHEATHE_TYPE_OFF_HAND = 0x2, SHEATHE_TYPE_LARGE_WEAPON_LEFT = 0x3, SHEATHE_TYPE_LARGE_WEAPON_RIGHT = 0x4, SHEATHE_TYPE_HIP_WEAPON_LEFT = 0x5, SHEATHE_TYPE_HIP_WEAPON_RIGHT = 0x6, SHEATHE_TYPE_SHIELD = 0x7, } e_sheathe_type; static const value_string e_sheathe_type_strings[] = { { SHEATHE_TYPE_NONE, "None" }, { SHEATHE_TYPE_MAIN_HAND, "Main Hand" }, { SHEATHE_TYPE_OFF_HAND, "Off Hand" }, { SHEATHE_TYPE_LARGE_WEAPON_LEFT, "Large Weapon Left" }, { SHEATHE_TYPE_LARGE_WEAPON_RIGHT, "Large Weapon Right" }, { SHEATHE_TYPE_HIP_WEAPON_LEFT, "Hip Weapon Left" }, { SHEATHE_TYPE_HIP_WEAPON_RIGHT, "Hip Weapon Right" }, { SHEATHE_TYPE_SHIELD, "Shield" }, { 0, NULL } }; typedef enum { ITEM_SET_NONE = 0x000, ITEM_SET_THE_GLADIATOR = 0x001, ITEM_SET_DAL_RENDS_ARMS = 0x029, ITEM_SET_SPIDERS_KISS = 0x041, ITEM_SET_THE_POSTMASTER = 0x051, ITEM_SET_CADAVEROUS_GARB = 0x079, ITEM_SET_NECROPILE_RAIMENT = 0x07A, ITEM_SET_BLOODMAIL_REGALIA = 0x07B, ITEM_SET_DEATHBONE_GUARDIAN = 0x07C, ITEM_SET_VOLCANIC_ARMOR = 0x08D, ITEM_SET_STORMSHROUD_ARMOR = 0x08E, ITEM_SET_DEVILSAUR_ARMOR = 0x08F, ITEM_SET_IRONFEATHER_ARMOR = 0x090, ITEM_SET_DEFIAS_LEATHER = 0x0A1, ITEM_SET_EMBRACE_OF_THE_VIPER = 0x0A2, ITEM_SET_CHAIN_OF_THE_SCARLET_CRUSADE = 0x0A3, ITEM_SET_MAGISTERS_REGALIA = 0x0B5, ITEM_SET_VESTMENTS_OF_THE_DEVOUT = 0x0B6, ITEM_SET_DREADMIST_RAIMENT = 0x0B7, ITEM_SET_SHADOWCRAFT_ARMOR = 0x0B8, ITEM_SET_WILDHEART_RAIMENT = 0x0B9, ITEM_SET_BEASTSTALKER_ARMOR = 0x0BA, ITEM_SET_THE_ELEMENTS = 0x0BB, ITEM_SET_LIGHTFORGE_ARMOR = 0x0BC, ITEM_SET_BATTLEGEAR_OF_VALOR = 0x0BD, ITEM_SET_ARCANIST_REGALIA = 0x0C9, ITEM_SET_VESTMENTS_OF_PROPHECY = 0x0CA, ITEM_SET_FELHEART_RAIMENT = 0x0CB, ITEM_SET_NIGHTSLAYER_ARMOR = 0x0CC, ITEM_SET_CENARION_RAIMENT = 0x0CD, ITEM_SET_GIANTSTALKER_ARMOR = 0x0CE, ITEM_SET_THE_EARTHFURY = 0x0CF, ITEM_SET_LAWBRINGER_ARMOR = 0x0D0, ITEM_SET_BATTLEGEAR_OF_MIGHT = 0x0D1, ITEM_SET_NETHERWIND_REGALIA = 0x0D2, ITEM_SET_VESTMENTS_OF_TRANSCENDENCE = 0x0D3, ITEM_SET_NEMESIS_RAIMENT = 0x0D4, ITEM_SET_BLOODFANG_ARMOR = 0x0D5, ITEM_SET_STORMRAGE_RAIMENT = 0x0D6, ITEM_SET_DRAGONSTALKER_ARMOR = 0x0D7, ITEM_SET_THE_TEN_STORMS = 0x0D8, ITEM_SET_JUDGEMENT_ARMOR = 0x0D9, ITEM_SET_BATTLEGEAR_OF_WRATH = 0x0DA, ITEM_SET_GARB_OF_THERO_SHAN = 0x0DD, ITEM_SET_SHARD_OF_THE_GODS = 0x0F1, ITEM_SET_SPIRIT_OF_ESKHANDAR = 0x105, ITEM_SET_CHAMPIONS_BATTLEGEAR = 0x119, ITEM_SET_LIEUTENANT_COMMANDERS_BATTLEGEAR = 0x11A, ITEM_SET_CHAMPIONS_EARTHSHAKER = 0x12D, ITEM_SET_IMPERIAL_PLATE = 0x141, ITEM_SET_CHAMPIONS_REGALIA = 0x155, ITEM_SET_CHAMPIONS_RAIMENT = 0x156, ITEM_SET_LIEUTENANT_COMMANDERS_REGALIA = 0x157, ITEM_SET_LIEUTENANT_COMMANDERS_RAIMENT = 0x158, ITEM_SET_CHAMPIONS_THREADS = 0x159, ITEM_SET_LIEUTENANT_COMMANDERS_THREADS = 0x15A, ITEM_SET_CHAMPIONS_VESTMENTS = 0x15B, ITEM_SET_LIEUTENANT_COMMANDERS_VESTMENTS = 0x15C, ITEM_SET_CHAMPIONS_PURSUIT = 0x169, ITEM_SET_LIEUTENANT_COMMANDERS_PURSUIT = 0x16A, ITEM_SET_LIEUTENANT_COMMANDERS_SANCTUARY = 0x17D, ITEM_SET_CHAMPIONS_SANCTUARY = 0x17E, ITEM_SET_WARLORDS_BATTLEGEAR = 0x17F, ITEM_SET_FIELD_MARSHALS_BATTLEGEAR = 0x180, ITEM_SET_WARLORDS_EARTHSHAKER = 0x182, ITEM_SET_WARLORDS_REGALIA = 0x183, ITEM_SET_FIELD_MARSHALS_REGALIA = 0x184, ITEM_SET_FIELD_MARSHALS_RAIMENT = 0x185, ITEM_SET_WARLORDS_RAIMENT = 0x186, ITEM_SET_WARLORDS_THREADS = 0x187, ITEM_SET_FIELD_MARSHALS_THREADS = 0x188, ITEM_SET_WARLORDS_VESTMENTS = 0x189, ITEM_SET_FIELD_MARSHALS_VESTMENTS = 0x18A, ITEM_SET_FIELD_MARSHALS_PURSUIT = 0x18B, ITEM_SET_WARLORDS_PURSUIT = 0x18C, ITEM_SET_FIELD_MARSHALS_SANCTUARY = 0x18D, ITEM_SET_WARLORDS_SANCTUARY = 0x18E, ITEM_SET_LIEUTENANT_COMMANDERS_AEGIS = 0x191, ITEM_SET_FIELD_MARSHALS_AEGIS = 0x192, ITEM_SET_BLOODVINE_GARB = 0x1A5, ITEM_SET_PRIMAL_BATSKIN = 0x1B9, ITEM_SET_BLOOD_TIGER_HARNESS = 0x1BA, ITEM_SET_BLOODSOUL_EMBRACE = 0x1BB, ITEM_SET_THE_DARKSOUL = 0x1BC, ITEM_SET_THE_TWIN_BLADES_OF_HAKKARI = 0x1CD, ITEM_SET_ZANZILS_CONCENTRATION = 0x1CE, ITEM_SET_PRIMAL_BLESSING = 0x1CF, ITEM_SET_OVERLORDS_RESOLUTION = 0x1D0, ITEM_SET_PRAYER_OF_THE_PRIMAL = 0x1D1, ITEM_SET_MAJOR_MOJO_INFUSION = 0x1D2, ITEM_SET_THE_HIGHLANDERS_RESOLUTION = 0x1D3, ITEM_SET_THE_HIGHLANDERS_RESOLVE = 0x1D4, ITEM_SET_THE_HIGHLANDERS_DETERMINATION = 0x1D5, ITEM_SET_THE_HIGHLANDERS_FORTITUDE = 0x1D6, ITEM_SET_THE_HIGHLANDERS_PURPOSE = 0x1D7, ITEM_SET_THE_HIGHLANDERS_WILL = 0x1D8, ITEM_SET_THE_HIGHLANDERS_INTENT = 0x1D9, ITEM_SET_VINDICATORS_BATTLEGEAR = 0x1DA, ITEM_SET_FREETHINKERS_ARMOR = 0x1DB, ITEM_SET_AUGURS_REGALIA = 0x1DC, ITEM_SET_PREDATORS_ARMOR = 0x1DD, ITEM_SET_MADCAPS_OUTFIT = 0x1DE, ITEM_SET_HARUSPEXS_GARB = 0x1DF, ITEM_SET_CONFESSORS_RAIMENT = 0x1E0, ITEM_SET_DEMONIACS_THREADS = 0x1E1, ITEM_SET_ILLUSIONISTS_ATTIRE = 0x1E2, ITEM_SET_THE_DEFILERS_DETERMINATION = 0x1E3, ITEM_SET_THE_DEFILERS_FORTITUDE = 0x1E4, ITEM_SET_THE_DEFILERS_INTENT = 0x1E5, ITEM_SET_THE_DEFILERS_PURPOSE = 0x1E6, ITEM_SET_THE_DEFILERS_RESOLUTION = 0x1E7, ITEM_SET_THE_DEFILERS_WILL = 0x1E8, ITEM_SET_BLACK_DRAGON_MAIL = 0x1E9, ITEM_SET_GREEN_DRAGON_MAIL = 0x1EA, ITEM_SET_BLUE_DRAGON_MAIL = 0x1EB, ITEM_SET_TWILIGHT_TRAPPINGS = 0x1EC, ITEM_SET_GENESIS_RAIMENT = 0x1ED, ITEM_SET_SYMBOLS_OF_UNENDING_LIFE = 0x1EE, ITEM_SET_BATTLEGEAR_OF_UNYIELDING_STRENGTH = 0x1EF, ITEM_SET_CONQUERORS_BATTLEGEAR = 0x1F0, ITEM_SET_DEATHDEALERS_EMBRACE = 0x1F1, ITEM_SET_EMBLEMS_OF_VEILED_SHADOWS = 0x1F2, ITEM_SET_DOOMCALLERS_ATTIRE = 0x1F3, ITEM_SET_IMPLEMENTS_OF_UNSPOKEN_NAMES = 0x1F4, ITEM_SET_STORMCALLERS_GARB = 0x1F5, ITEM_SET_GIFT_OF_THE_GATHERING_STORM = 0x1F6, ITEM_SET_ENIGMA_VESTMENTS = 0x1F7, ITEM_SET_TRAPPINGS_OF_VAULTED_SECRETS = 0x1F8, ITEM_SET_AVENGERS_BATTLEGEAR = 0x1F9, ITEM_SET_BATTLEGEAR_OF_ETERNAL_JUSTICE = 0x1FA, ITEM_SET_GARMENTS_OF_THE_ORACLE = 0x1FB, ITEM_SET_FINERY_OF_INFINITE_WISDOM = 0x1FC, ITEM_SET_STRIKERS_GARB = 0x1FD, ITEM_SET_TRAPPINGS_OF_THE_UNSEEN_PATH = 0x1FE, ITEM_SET_BATTLEGEAR_OF_HEROISM = 0x1FF, ITEM_SET_DARKMANTLE_ARMOR = 0x200, ITEM_SET_FERALHEART_RAIMENT = 0x201, ITEM_SET_VESTMENTS_OF_THE_VIRTUOUS = 0x202, ITEM_SET_BEASTMASTER_ARMOR = 0x203, ITEM_SET_SOULFORGE_ARMOR = 0x204, ITEM_SET_SORCERERS_REGALIA = 0x205, ITEM_SET_DEATHMIST_RAIMENT = 0x206, ITEM_SET_THE_FIVE_THUNDERS = 0x207, ITEM_SET_IRONWEAVE_BATTLESUIT = 0x208, ITEM_SET_DREAMWALKER_RAIMENT = 0x209, ITEM_SET_CHAMPIONS_GUARD = 0x20A, ITEM_SET_DREADNAUGHTS_BATTLEGEAR = 0x20B, ITEM_SET_BONESCYTHE_ARMOR = 0x20C, ITEM_SET_VESTMENTS_OF_FAITH = 0x20D, ITEM_SET_FROSTFIRE_REGALIA = 0x20E, ITEM_SET_THE_EARTHSHATTERER = 0x20F, ITEM_SET_REDEMPTION_ARMOR = 0x210, ITEM_SET_PLAGUEHEART_RAIMENT = 0x211, ITEM_SET_CRYPTSTALKER_ARMOR = 0x212, ITEM_SET_BATTLEGEAR_OF_UNDEAD_SLAYING = 0x215, ITEM_SET_UNDEAD_SLAYERS_ARMOR = 0x216, ITEM_SET_GARB_OF_THE_UNDEAD_SLAYER = 0x217, ITEM_SET_REGALIA_OF_UNDEAD_CLEANSING = 0x218, ITEM_SET_CHAMPIONS_BATTLEARMOR = 0x219, ITEM_SET_CHAMPIONS_STORMCALLER = 0x21A, ITEM_SET_CHAMPIONS_REFUGE = 0x21B, ITEM_SET_CHAMPIONS_INVESTITURE = 0x21C, ITEM_SET_CHAMPIONS_DREADGEAR = 0x21D, ITEM_SET_CHAMPIONS_ARCANUM = 0x21E, ITEM_SET_CHAMPIONS_PURSUANCE = 0x21F, ITEM_SET_LIEUTENANT_COMMANDERS_REDOUBT = 0x220, ITEM_SET_LIEUTENANT_COMMANDERS_BATTLEARMOR = 0x221, ITEM_SET_LIEUTENANT_COMMANDERS_ARCANUM = 0x222, ITEM_SET_LIEUTENANT_COMMANDERS_DREADGEAR = 0x223, ITEM_SET_LIEUTENANT_COMMANDERS_GUARD = 0x224, ITEM_SET_LIEUTENANT_COMMANDERS_INVESTITURE = 0x225, ITEM_SET_LIEUTENANT_COMMANDERS_PURSUANCE = 0x226, ITEM_SET_LIEUTENANT_COMMANDERS_REFUGE = 0x227, } e_item_set; static const value_string e_item_set_strings[] = { { ITEM_SET_NONE, "None" }, { ITEM_SET_THE_GLADIATOR, "The Gladiator" }, { ITEM_SET_DAL_RENDS_ARMS, "Dal Rends Arms" }, { ITEM_SET_SPIDERS_KISS, "Spiders Kiss" }, { ITEM_SET_THE_POSTMASTER, "The Postmaster" }, { ITEM_SET_CADAVEROUS_GARB, "Cadaverous Garb" }, { ITEM_SET_NECROPILE_RAIMENT, "Necropile Raiment" }, { ITEM_SET_BLOODMAIL_REGALIA, "Bloodmail Regalia" }, { ITEM_SET_DEATHBONE_GUARDIAN, "Deathbone Guardian" }, { ITEM_SET_VOLCANIC_ARMOR, "Volcanic Armor" }, { ITEM_SET_STORMSHROUD_ARMOR, "Stormshroud Armor" }, { ITEM_SET_DEVILSAUR_ARMOR, "Devilsaur Armor" }, { ITEM_SET_IRONFEATHER_ARMOR, "Ironfeather Armor" }, { ITEM_SET_DEFIAS_LEATHER, "Defias Leather" }, { ITEM_SET_EMBRACE_OF_THE_VIPER, "Embrace Of The Viper" }, { ITEM_SET_CHAIN_OF_THE_SCARLET_CRUSADE, "Chain Of The Scarlet Crusade" }, { ITEM_SET_MAGISTERS_REGALIA, "Magisters Regalia" }, { ITEM_SET_VESTMENTS_OF_THE_DEVOUT, "Vestments Of The Devout" }, { ITEM_SET_DREADMIST_RAIMENT, "Dreadmist Raiment" }, { ITEM_SET_SHADOWCRAFT_ARMOR, "Shadowcraft Armor" }, { ITEM_SET_WILDHEART_RAIMENT, "Wildheart Raiment" }, { ITEM_SET_BEASTSTALKER_ARMOR, "Beaststalker Armor" }, { ITEM_SET_THE_ELEMENTS, "The Elements" }, { ITEM_SET_LIGHTFORGE_ARMOR, "Lightforge Armor" }, { ITEM_SET_BATTLEGEAR_OF_VALOR, "Battlegear Of Valor" }, { ITEM_SET_ARCANIST_REGALIA, "Arcanist Regalia" }, { ITEM_SET_VESTMENTS_OF_PROPHECY, "Vestments Of Prophecy" }, { ITEM_SET_FELHEART_RAIMENT, "Felheart Raiment" }, { ITEM_SET_NIGHTSLAYER_ARMOR, "Nightslayer Armor" }, { ITEM_SET_CENARION_RAIMENT, "Cenarion Raiment" }, { ITEM_SET_GIANTSTALKER_ARMOR, "Giantstalker Armor" }, { ITEM_SET_THE_EARTHFURY, "The Earthfury" }, { ITEM_SET_LAWBRINGER_ARMOR, "Lawbringer Armor" }, { ITEM_SET_BATTLEGEAR_OF_MIGHT, "Battlegear Of Might" }, { ITEM_SET_NETHERWIND_REGALIA, "Netherwind Regalia" }, { ITEM_SET_VESTMENTS_OF_TRANSCENDENCE, "Vestments Of Transcendence" }, { ITEM_SET_NEMESIS_RAIMENT, "Nemesis Raiment" }, { ITEM_SET_BLOODFANG_ARMOR, "Bloodfang Armor" }, { ITEM_SET_STORMRAGE_RAIMENT, "Stormrage Raiment" }, { ITEM_SET_DRAGONSTALKER_ARMOR, "Dragonstalker Armor" }, { ITEM_SET_THE_TEN_STORMS, "The Ten Storms" }, { ITEM_SET_JUDGEMENT_ARMOR, "Judgement Armor" }, { ITEM_SET_BATTLEGEAR_OF_WRATH, "Battlegear Of Wrath" }, { ITEM_SET_GARB_OF_THERO_SHAN, "Garb Of Thero Shan" }, { ITEM_SET_SHARD_OF_THE_GODS, "Shard Of The Gods" }, { ITEM_SET_SPIRIT_OF_ESKHANDAR, "Spirit Of Eskhandar" }, { ITEM_SET_CHAMPIONS_BATTLEGEAR, "Champions Battlegear" }, { ITEM_SET_LIEUTENANT_COMMANDERS_BATTLEGEAR, "Lieutenant Commanders Battlegear" }, { ITEM_SET_CHAMPIONS_EARTHSHAKER, "Champions Earthshaker" }, { ITEM_SET_IMPERIAL_PLATE, "Imperial Plate" }, { ITEM_SET_CHAMPIONS_REGALIA, "Champions Regalia" }, { ITEM_SET_CHAMPIONS_RAIMENT, "Champions Raiment" }, { ITEM_SET_LIEUTENANT_COMMANDERS_REGALIA, "Lieutenant Commanders Regalia" }, { ITEM_SET_LIEUTENANT_COMMANDERS_RAIMENT, "Lieutenant Commanders Raiment" }, { ITEM_SET_CHAMPIONS_THREADS, "Champions Threads" }, { ITEM_SET_LIEUTENANT_COMMANDERS_THREADS, "Lieutenant Commanders Threads" }, { ITEM_SET_CHAMPIONS_VESTMENTS, "Champions Vestments" }, { ITEM_SET_LIEUTENANT_COMMANDERS_VESTMENTS, "Lieutenant Commanders Vestments" }, { ITEM_SET_CHAMPIONS_PURSUIT, "Champions Pursuit" }, { ITEM_SET_LIEUTENANT_COMMANDERS_PURSUIT, "Lieutenant Commanders Pursuit" }, { ITEM_SET_LIEUTENANT_COMMANDERS_SANCTUARY, "Lieutenant Commanders Sanctuary" }, { ITEM_SET_CHAMPIONS_SANCTUARY, "Champions Sanctuary" }, { ITEM_SET_WARLORDS_BATTLEGEAR, "Warlords Battlegear" }, { ITEM_SET_FIELD_MARSHALS_BATTLEGEAR, "Field Marshals Battlegear" }, { ITEM_SET_WARLORDS_EARTHSHAKER, "Warlords Earthshaker" }, { ITEM_SET_WARLORDS_REGALIA, "Warlords Regalia" }, { ITEM_SET_FIELD_MARSHALS_REGALIA, "Field Marshals Regalia" }, { ITEM_SET_FIELD_MARSHALS_RAIMENT, "Field Marshals Raiment" }, { ITEM_SET_WARLORDS_RAIMENT, "Warlords Raiment" }, { ITEM_SET_WARLORDS_THREADS, "Warlords Threads" }, { ITEM_SET_FIELD_MARSHALS_THREADS, "Field Marshals Threads" }, { ITEM_SET_WARLORDS_VESTMENTS, "Warlords Vestments" }, { ITEM_SET_FIELD_MARSHALS_VESTMENTS, "Field Marshals Vestments" }, { ITEM_SET_FIELD_MARSHALS_PURSUIT, "Field Marshals Pursuit" }, { ITEM_SET_WARLORDS_PURSUIT, "Warlords Pursuit" }, { ITEM_SET_FIELD_MARSHALS_SANCTUARY, "Field Marshals Sanctuary" }, { ITEM_SET_WARLORDS_SANCTUARY, "Warlords Sanctuary" }, { ITEM_SET_LIEUTENANT_COMMANDERS_AEGIS, "Lieutenant Commanders Aegis" }, { ITEM_SET_FIELD_MARSHALS_AEGIS, "Field Marshals Aegis" }, { ITEM_SET_BLOODVINE_GARB, "Bloodvine Garb" }, { ITEM_SET_PRIMAL_BATSKIN, "Primal Batskin" }, { ITEM_SET_BLOOD_TIGER_HARNESS, "Blood Tiger Harness" }, { ITEM_SET_BLOODSOUL_EMBRACE, "Bloodsoul Embrace" }, { ITEM_SET_THE_DARKSOUL, "The Darksoul" }, { ITEM_SET_THE_TWIN_BLADES_OF_HAKKARI, "The Twin Blades Of Hakkari" }, { ITEM_SET_ZANZILS_CONCENTRATION, "Zanzils Concentration" }, { ITEM_SET_PRIMAL_BLESSING, "Primal Blessing" }, { ITEM_SET_OVERLORDS_RESOLUTION, "Overlords Resolution" }, { ITEM_SET_PRAYER_OF_THE_PRIMAL, "Prayer Of The Primal" }, { ITEM_SET_MAJOR_MOJO_INFUSION, "Major Mojo Infusion" }, { ITEM_SET_THE_HIGHLANDERS_RESOLUTION, "The Highlanders Resolution" }, { ITEM_SET_THE_HIGHLANDERS_RESOLVE, "The Highlanders Resolve" }, { ITEM_SET_THE_HIGHLANDERS_DETERMINATION, "The Highlanders Determination" }, { ITEM_SET_THE_HIGHLANDERS_FORTITUDE, "The Highlanders Fortitude" }, { ITEM_SET_THE_HIGHLANDERS_PURPOSE, "The Highlanders Purpose" }, { ITEM_SET_THE_HIGHLANDERS_WILL, "The Highlanders Will" }, { ITEM_SET_THE_HIGHLANDERS_INTENT, "The Highlanders Intent" }, { ITEM_SET_VINDICATORS_BATTLEGEAR, "Vindicators Battlegear" }, { ITEM_SET_FREETHINKERS_ARMOR, "Freethinkers Armor" }, { ITEM_SET_AUGURS_REGALIA, "Augurs Regalia" }, { ITEM_SET_PREDATORS_ARMOR, "Predators Armor" }, { ITEM_SET_MADCAPS_OUTFIT, "Madcaps Outfit" }, { ITEM_SET_HARUSPEXS_GARB, "Haruspexs Garb" }, { ITEM_SET_CONFESSORS_RAIMENT, "Confessors Raiment" }, { ITEM_SET_DEMONIACS_THREADS, "Demoniacs Threads" }, { ITEM_SET_ILLUSIONISTS_ATTIRE, "Illusionists Attire" }, { ITEM_SET_THE_DEFILERS_DETERMINATION, "The Defilers Determination" }, { ITEM_SET_THE_DEFILERS_FORTITUDE, "The Defilers Fortitude" }, { ITEM_SET_THE_DEFILERS_INTENT, "The Defilers Intent" }, { ITEM_SET_THE_DEFILERS_PURPOSE, "The Defilers Purpose" }, { ITEM_SET_THE_DEFILERS_RESOLUTION, "The Defilers Resolution" }, { ITEM_SET_THE_DEFILERS_WILL, "The Defilers Will" }, { ITEM_SET_BLACK_DRAGON_MAIL, "Black Dragon Mail" }, { ITEM_SET_GREEN_DRAGON_MAIL, "Green Dragon Mail" }, { ITEM_SET_BLUE_DRAGON_MAIL, "Blue Dragon Mail" }, { ITEM_SET_TWILIGHT_TRAPPINGS, "Twilight Trappings" }, { ITEM_SET_GENESIS_RAIMENT, "Genesis Raiment" }, { ITEM_SET_SYMBOLS_OF_UNENDING_LIFE, "Symbols Of Unending Life" }, { ITEM_SET_BATTLEGEAR_OF_UNYIELDING_STRENGTH, "Battlegear Of Unyielding Strength" }, { ITEM_SET_CONQUERORS_BATTLEGEAR, "Conquerors Battlegear" }, { ITEM_SET_DEATHDEALERS_EMBRACE, "Deathdealers Embrace" }, { ITEM_SET_EMBLEMS_OF_VEILED_SHADOWS, "Emblems Of Veiled Shadows" }, { ITEM_SET_DOOMCALLERS_ATTIRE, "Doomcallers Attire" }, { ITEM_SET_IMPLEMENTS_OF_UNSPOKEN_NAMES, "Implements Of Unspoken Names" }, { ITEM_SET_STORMCALLERS_GARB, "Stormcallers Garb" }, { ITEM_SET_GIFT_OF_THE_GATHERING_STORM, "Gift Of The Gathering Storm" }, { ITEM_SET_ENIGMA_VESTMENTS, "Enigma Vestments" }, { ITEM_SET_TRAPPINGS_OF_VAULTED_SECRETS, "Trappings Of Vaulted Secrets" }, { ITEM_SET_AVENGERS_BATTLEGEAR, "Avengers Battlegear" }, { ITEM_SET_BATTLEGEAR_OF_ETERNAL_JUSTICE, "Battlegear Of Eternal Justice" }, { ITEM_SET_GARMENTS_OF_THE_ORACLE, "Garments Of The Oracle" }, { ITEM_SET_FINERY_OF_INFINITE_WISDOM, "Finery Of Infinite Wisdom" }, { ITEM_SET_STRIKERS_GARB, "Strikers Garb" }, { ITEM_SET_TRAPPINGS_OF_THE_UNSEEN_PATH, "Trappings Of The Unseen Path" }, { ITEM_SET_BATTLEGEAR_OF_HEROISM, "Battlegear Of Heroism" }, { ITEM_SET_DARKMANTLE_ARMOR, "Darkmantle Armor" }, { ITEM_SET_FERALHEART_RAIMENT, "Feralheart Raiment" }, { ITEM_SET_VESTMENTS_OF_THE_VIRTUOUS, "Vestments Of The Virtuous" }, { ITEM_SET_BEASTMASTER_ARMOR, "Beastmaster Armor" }, { ITEM_SET_SOULFORGE_ARMOR, "Soulforge Armor" }, { ITEM_SET_SORCERERS_REGALIA, "Sorcerers Regalia" }, { ITEM_SET_DEATHMIST_RAIMENT, "Deathmist Raiment" }, { ITEM_SET_THE_FIVE_THUNDERS, "The Five Thunders" }, { ITEM_SET_IRONWEAVE_BATTLESUIT, "Ironweave Battlesuit" }, { ITEM_SET_DREAMWALKER_RAIMENT, "Dreamwalker Raiment" }, { ITEM_SET_CHAMPIONS_GUARD, "Champions Guard" }, { ITEM_SET_DREADNAUGHTS_BATTLEGEAR, "Dreadnaughts Battlegear" }, { ITEM_SET_BONESCYTHE_ARMOR, "Bonescythe Armor" }, { ITEM_SET_VESTMENTS_OF_FAITH, "Vestments Of Faith" }, { ITEM_SET_FROSTFIRE_REGALIA, "Frostfire Regalia" }, { ITEM_SET_THE_EARTHSHATTERER, "The Earthshatterer" }, { ITEM_SET_REDEMPTION_ARMOR, "Redemption Armor" }, { ITEM_SET_PLAGUEHEART_RAIMENT, "Plagueheart Raiment" }, { ITEM_SET_CRYPTSTALKER_ARMOR, "Cryptstalker Armor" }, { ITEM_SET_BATTLEGEAR_OF_UNDEAD_SLAYING, "Battlegear Of Undead Slaying" }, { ITEM_SET_UNDEAD_SLAYERS_ARMOR, "Undead Slayers Armor" }, { ITEM_SET_GARB_OF_THE_UNDEAD_SLAYER, "Garb Of The Undead Slayer" }, { ITEM_SET_REGALIA_OF_UNDEAD_CLEANSING, "Regalia Of Undead Cleansing" }, { ITEM_SET_CHAMPIONS_BATTLEARMOR, "Champions Battlearmor" }, { ITEM_SET_CHAMPIONS_STORMCALLER, "Champions Stormcaller" }, { ITEM_SET_CHAMPIONS_REFUGE, "Champions Refuge" }, { ITEM_SET_CHAMPIONS_INVESTITURE, "Champions Investiture" }, { ITEM_SET_CHAMPIONS_DREADGEAR, "Champions Dreadgear" }, { ITEM_SET_CHAMPIONS_ARCANUM, "Champions Arcanum" }, { ITEM_SET_CHAMPIONS_PURSUANCE, "Champions Pursuance" }, { ITEM_SET_LIEUTENANT_COMMANDERS_REDOUBT, "Lieutenant Commanders Redoubt" }, { ITEM_SET_LIEUTENANT_COMMANDERS_BATTLEARMOR, "Lieutenant Commanders Battlearmor" }, { ITEM_SET_LIEUTENANT_COMMANDERS_ARCANUM, "Lieutenant Commanders Arcanum" }, { ITEM_SET_LIEUTENANT_COMMANDERS_DREADGEAR, "Lieutenant Commanders Dreadgear" }, { ITEM_SET_LIEUTENANT_COMMANDERS_GUARD, "Lieutenant Commanders Guard" }, { ITEM_SET_LIEUTENANT_COMMANDERS_INVESTITURE, "Lieutenant Commanders Investiture" }, { ITEM_SET_LIEUTENANT_COMMANDERS_PURSUANCE, "Lieutenant Commanders Pursuance" }, { ITEM_SET_LIEUTENANT_COMMANDERS_REFUGE, "Lieutenant Commanders Refuge" }, { 0, NULL } }; typedef enum { BAG_FAMILY_NONE = 0x0, BAG_FAMILY_ARROWS = 0x1, BAG_FAMILY_BULLETS = 0x2, BAG_FAMILY_SOUL_SHARDS = 0x3, BAG_FAMILY_UNKNOWN4 = 0x4, BAG_FAMILY_UNKNOWN5 = 0x5, BAG_FAMILY_HERBS = 0x6, BAG_FAMILY_ENCHANTING_SUPPLIES = 0x7, BAG_FAMILY_ENGINEERING_SUPPLIES = 0x8, BAG_FAMILY_KEYS = 0x9, } e_bag_family; static const value_string e_bag_family_strings[] = { { BAG_FAMILY_NONE, "None" }, { BAG_FAMILY_ARROWS, "Arrows" }, { BAG_FAMILY_BULLETS, "Bullets" }, { BAG_FAMILY_SOUL_SHARDS, "Soul Shards" }, { BAG_FAMILY_UNKNOWN4, "Unknown4" }, { BAG_FAMILY_UNKNOWN5, "Unknown5" }, { BAG_FAMILY_HERBS, "Herbs" }, { BAG_FAMILY_ENCHANTING_SUPPLIES, "Enchanting Supplies" }, { BAG_FAMILY_ENGINEERING_SUPPLIES, "Engineering Supplies" }, { BAG_FAMILY_KEYS, "Keys" }, { 0, NULL } }; typedef enum { LOGOUT_RESULT_SUCCESS = 0x0, LOGOUT_RESULT_FAILURE_IN_COMBAT = 0x1, LOGOUT_RESULT_FAILURE_FROZEN_BY_GM = 0x2, LOGOUT_RESULT_FAILURE_JUMPING_OR_FALLING = 0x3, } e_logout_result; static const value_string e_logout_result_strings[] = { { LOGOUT_RESULT_SUCCESS, "Success" }, { LOGOUT_RESULT_FAILURE_IN_COMBAT, "Failure In Combat" }, { LOGOUT_RESULT_FAILURE_FROZEN_BY_GM, "Failure Frozen By Gm" }, { LOGOUT_RESULT_FAILURE_JUMPING_OR_FALLING, "Failure Jumping Or Falling" }, { 0, NULL } }; typedef enum { LOGOUT_SPEED_DELAYED = 0x0, LOGOUT_SPEED_INSTANT = 0x1, } e_logout_speed; static const value_string e_logout_speed_strings[] = { { LOGOUT_SPEED_DELAYED, "Delayed" }, { LOGOUT_SPEED_INSTANT, "Instant" }, { 0, NULL } }; typedef enum { EXPERIENCE_AWARD_TYPE_KILL = 0x0, EXPERIENCE_AWARD_TYPE_NON_KILL = 0x1, } e_experience_award_type; static const value_string e_experience_award_type_strings[] = { { EXPERIENCE_AWARD_TYPE_KILL, "Kill" }, { EXPERIENCE_AWARD_TYPE_NON_KILL, "Non Kill" }, { 0, NULL } }; typedef enum { LOOT_METHOD_ERROR = 0x00, LOOT_METHOD_CORPSE = 0x01, LOOT_METHOD_PICKPOCKETING = 0x02, LOOT_METHOD_FISHING = 0x03, LOOT_METHOD_DISENCHANTING = 0x04, LOOT_METHOD_SKINNING = 0x06, LOOT_METHOD_FISHINGHOLE = 0x14, LOOT_METHOD_FISHING_FAIL = 0x15, LOOT_METHOD_INSIGNIA = 0x16, } e_loot_method; static const value_string e_loot_method_strings[] = { { LOOT_METHOD_ERROR, "Error" }, { LOOT_METHOD_CORPSE, "Corpse" }, { LOOT_METHOD_PICKPOCKETING, "Pickpocketing" }, { LOOT_METHOD_FISHING, "Fishing" }, { LOOT_METHOD_DISENCHANTING, "Disenchanting" }, { LOOT_METHOD_SKINNING, "Skinning" }, { LOOT_METHOD_FISHINGHOLE, "Fishinghole" }, { LOOT_METHOD_FISHING_FAIL, "Fishing Fail" }, { LOOT_METHOD_INSIGNIA, "Insignia" }, { 0, NULL } }; typedef enum { LOOT_METHOD_ERROR_DIDNT_KILL = 0x00, LOOT_METHOD_ERROR_TOO_FAR = 0x04, LOOT_METHOD_ERROR_BAD_FACING = 0x05, LOOT_METHOD_ERROR_LOCKED = 0x06, LOOT_METHOD_ERROR_NOTSTANDING = 0x08, LOOT_METHOD_ERROR_STUNNED = 0x09, LOOT_METHOD_ERROR_PLAYER_NOT_FOUND = 0x0A, LOOT_METHOD_ERROR_PLAY_TIME_EXCEEDED = 0x0B, LOOT_METHOD_ERROR_MASTER_INV_FULL = 0x0C, LOOT_METHOD_ERROR_MASTER_UNIQUE_ITEM = 0x0D, LOOT_METHOD_ERROR_MASTER_OTHER = 0x0E, LOOT_METHOD_ERROR_ALREADY_PICKPOCKETED = 0x0F, LOOT_METHOD_ERROR_NOT_WHILE_SHAPESHIFTED = 0x10, } e_loot_method_error; static const value_string e_loot_method_error_strings[] = { { LOOT_METHOD_ERROR_DIDNT_KILL, "Didnt Kill" }, { LOOT_METHOD_ERROR_TOO_FAR, "Too Far" }, { LOOT_METHOD_ERROR_BAD_FACING, "Bad Facing" }, { LOOT_METHOD_ERROR_LOCKED, "Locked" }, { LOOT_METHOD_ERROR_NOTSTANDING, "Notstanding" }, { LOOT_METHOD_ERROR_STUNNED, "Stunned" }, { LOOT_METHOD_ERROR_PLAYER_NOT_FOUND, "Player Not Found" }, { LOOT_METHOD_ERROR_PLAY_TIME_EXCEEDED, "Play Time Exceeded" }, { LOOT_METHOD_ERROR_MASTER_INV_FULL, "Master Inv Full" }, { LOOT_METHOD_ERROR_MASTER_UNIQUE_ITEM, "Master Unique Item" }, { LOOT_METHOD_ERROR_MASTER_OTHER, "Master Other" }, { LOOT_METHOD_ERROR_ALREADY_PICKPOCKETED, "Already Pickpocketed" }, { LOOT_METHOD_ERROR_NOT_WHILE_SHAPESHIFTED, "Not While Shapeshifted" }, { 0, NULL } }; typedef enum { MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_PARTYLEADER = 0x1, MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_FULL_GROUP = 0x2, MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_RAID_GROUP = 0x3, } e_meeting_stone_failure; static const value_string e_meeting_stone_failure_strings[] = { { MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_PARTYLEADER, "Meetingstone Fail Partyleader" }, { MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_FULL_GROUP, "Meetingstone Fail Full Group" }, { MEETING_STONE_FAILURE_MEETINGSTONE_FAIL_RAID_GROUP, "Meetingstone Fail Raid Group" }, { 0, NULL } }; typedef enum { MEETING_STONE_STATUS_LEAVE_QUEUE = 0x0, MEETING_STONE_STATUS_JOINED_QUEUE = 0x1, MEETING_STONE_STATUS_PARTY_MEMBER_LEFT_LFG = 0x2, MEETING_STONE_STATUS_PARTY_MEMBER_REMOVED_PARTY_REMOVED = 0x3, MEETING_STONE_STATUS_LOOKING_FOR_NEW_PARTY_IN_QUEUE = 0x4, MEETING_STONE_STATUS_NONE = 0x5, } e_meeting_stone_status; static const value_string e_meeting_stone_status_strings[] = { { MEETING_STONE_STATUS_LEAVE_QUEUE, "Leave Queue" }, { MEETING_STONE_STATUS_JOINED_QUEUE, "Joined Queue" }, { MEETING_STONE_STATUS_PARTY_MEMBER_LEFT_LFG, "Party Member Left Lfg" }, { MEETING_STONE_STATUS_PARTY_MEMBER_REMOVED_PARTY_REMOVED, "Party Member Removed Party Removed" }, { MEETING_STONE_STATUS_LOOKING_FOR_NEW_PARTY_IN_QUEUE, "Looking For New Party In Queue" }, { MEETING_STONE_STATUS_NONE, "None" }, { 0, NULL } }; typedef enum { PLAYER_CHAT_TAG_NONE = 0x0, PLAYER_CHAT_TAG_AFK = 0x1, PLAYER_CHAT_TAG_DND = 0x2, PLAYER_CHAT_TAG_GM = 0x3, } e_player_chat_tag; static const value_string e_player_chat_tag_strings[] = { { PLAYER_CHAT_TAG_NONE, "None" }, { PLAYER_CHAT_TAG_AFK, "Afk" }, { PLAYER_CHAT_TAG_DND, "Dnd" }, { PLAYER_CHAT_TAG_GM, "Gm" }, { 0, NULL } }; typedef enum { MOUNT_RESULT_INVALID_MOUNTEE = 0x0, MOUNT_RESULT_TOO_FAR_AWAY = 0x1, MOUNT_RESULT_ALREADY_MOUNTED = 0x2, MOUNT_RESULT_NOT_MOUNTABLE = 0x3, MOUNT_RESULT_NOT_YOUR_PET = 0x4, MOUNT_RESULT_OTHER = 0x5, MOUNT_RESULT_LOOTING = 0x6, MOUNT_RESULT_RACE_CANT_MOUNT = 0x7, MOUNT_RESULT_SHAPESHIFTED = 0x8, MOUNT_RESULT_FORCED_DISMOUNT = 0x9, MOUNT_RESULT_OK = 0xA, } e_mount_result; static const value_string e_mount_result_strings[] = { { MOUNT_RESULT_INVALID_MOUNTEE, "Invalid Mountee" }, { MOUNT_RESULT_TOO_FAR_AWAY, "Too Far Away" }, { MOUNT_RESULT_ALREADY_MOUNTED, "Already Mounted" }, { MOUNT_RESULT_NOT_MOUNTABLE, "Not Mountable" }, { MOUNT_RESULT_NOT_YOUR_PET, "Not Your Pet" }, { MOUNT_RESULT_OTHER, "Other" }, { MOUNT_RESULT_LOOTING, "Looting" }, { MOUNT_RESULT_RACE_CANT_MOUNT, "Race Cant Mount" }, { MOUNT_RESULT_SHAPESHIFTED, "Shapeshifted" }, { MOUNT_RESULT_FORCED_DISMOUNT, "Forced Dismount" }, { MOUNT_RESULT_OK, "Ok" }, { 0, NULL } }; typedef enum { PARTY_OPERATION_INVITE = 0x0, PARTY_OPERATION_LEAVE = 0x2, } e_party_operation; static const value_string e_party_operation_strings[] = { { PARTY_OPERATION_INVITE, "Invite" }, { PARTY_OPERATION_LEAVE, "Leave" }, { 0, NULL } }; typedef enum { PARTY_RESULT_SUCCESS = 0x0, PARTY_RESULT_BAD_PLAYER_NAME = 0x1, PARTY_RESULT_TARGET_NOT_IN_GROUP = 0x2, PARTY_RESULT_GROUP_FULL = 0x3, PARTY_RESULT_ALREADY_IN_GROUP = 0x4, PARTY_RESULT_NOT_IN_GROUP = 0x5, PARTY_RESULT_NOT_LEADER = 0x6, PARTY_RESULT_PLAYER_WRONG_FACTION = 0x7, PARTY_RESULT_IGNORING_YOU = 0x8, } e_party_result; static const value_string e_party_result_strings[] = { { PARTY_RESULT_SUCCESS, "Success" }, { PARTY_RESULT_BAD_PLAYER_NAME, "Bad Player Name" }, { PARTY_RESULT_TARGET_NOT_IN_GROUP, "Target Not In Group" }, { PARTY_RESULT_GROUP_FULL, "Group Full" }, { PARTY_RESULT_ALREADY_IN_GROUP, "Already In Group" }, { PARTY_RESULT_NOT_IN_GROUP, "Not In Group" }, { PARTY_RESULT_NOT_LEADER, "Not Leader" }, { PARTY_RESULT_PLAYER_WRONG_FACTION, "Player Wrong Faction" }, { PARTY_RESULT_IGNORING_YOU, "Ignoring You" }, { 0, NULL } }; typedef enum { TIMER_TYPE_FATIGUE = 0x0, TIMER_TYPE_BREATH = 0x1, TIMER_TYPE_FEIGN_DEATH = 0x2, TIMER_TYPE_ENVIRONMENTAL = 0x3, } e_timer_type; static const value_string e_timer_type_strings[] = { { TIMER_TYPE_FATIGUE, "Fatigue" }, { TIMER_TYPE_BREATH, "Breath" }, { TIMER_TYPE_FEIGN_DEATH, "Feign Death" }, { TIMER_TYPE_ENVIRONMENTAL, "Environmental" }, { 0, NULL } }; typedef enum { PETITION_RESULT_OK = 0x0, PETITION_RESULT_ALREADY_SIGNED = 0x1, PETITION_RESULT_ALREADY_IN_GUILD = 0x2, PETITION_RESULT_CANT_SIGN_OWN = 0x3, PETITION_RESULT_NEED_MORE = 0x4, PETITION_RESULT_NOT_SERVER = 0x5, } e_petition_result; static const value_string e_petition_result_strings[] = { { PETITION_RESULT_OK, "Ok" }, { PETITION_RESULT_ALREADY_SIGNED, "Already Signed" }, { PETITION_RESULT_ALREADY_IN_GUILD, "Already In Guild" }, { PETITION_RESULT_CANT_SIGN_OWN, "Cant Sign Own" }, { PETITION_RESULT_NEED_MORE, "Need More" }, { PETITION_RESULT_NOT_SERVER, "Not Server" }, { 0, NULL } }; typedef enum { PET_FEEDBACK_PET_DEAD = 0x1, PET_FEEDBACK_NOTHING_TO_ATTACK = 0x2, PET_FEEDBACK_CANT_ATTACK_TARGET = 0x3, PET_FEEDBACK_NO_PATH_TO = 0x4, } e_pet_feedback; static const value_string e_pet_feedback_strings[] = { { PET_FEEDBACK_PET_DEAD, "Pet Dead" }, { PET_FEEDBACK_NOTHING_TO_ATTACK, "Nothing To Attack" }, { PET_FEEDBACK_CANT_ATTACK_TARGET, "Cant Attack Target" }, { PET_FEEDBACK_NO_PATH_TO, "No Path To" }, { 0, NULL } }; typedef enum { PET_TALK_REASON_SPECIAL_SPELL = 0x0, PET_TALK_REASON_ATTACK = 0x1, } e_pet_talk_reason; static const value_string e_pet_talk_reason_strings[] = { { PET_TALK_REASON_SPECIAL_SPELL, "Special Spell" }, { PET_TALK_REASON_ATTACK, "Attack" }, { 0, NULL } }; typedef enum { SPELL_CAST_RESULT_AFFECTING_COMBAT = 0x00, SPELL_CAST_RESULT_ALREADY_AT_FULL_HEALTH = 0x01, SPELL_CAST_RESULT_ALREADY_AT_FULL_MANA = 0x02, SPELL_CAST_RESULT_ALREADY_BEING_TAMED = 0x03, SPELL_CAST_RESULT_ALREADY_HAVE_CHARM = 0x04, SPELL_CAST_RESULT_ALREADY_HAVE_SUMMON = 0x05, SPELL_CAST_RESULT_ALREADY_OPEN = 0x06, SPELL_CAST_RESULT_MORE_POWERFUL_SPELL_ACTIVE = 0x07, SPELL_CAST_RESULT_BAD_IMPLICIT_TARGETS = 0x09, SPELL_CAST_RESULT_BAD_TARGETS = 0x0A, SPELL_CAST_RESULT_CANT_BE_CHARMED = 0x0B, SPELL_CAST_RESULT_CANT_BE_DISENCHANTED = 0x0C, SPELL_CAST_RESULT_CANT_BE_PROSPECTED = 0x0D, SPELL_CAST_RESULT_CANT_CAST_ON_TAPPED = 0x0E, SPELL_CAST_RESULT_CANT_DUEL_WHILE_INVISIBLE = 0x0F, SPELL_CAST_RESULT_CANT_DUEL_WHILE_STEALTHED = 0x10, SPELL_CAST_RESULT_CANT_TOO_CLOSE_TO_ENEMY = 0x11, SPELL_CAST_RESULT_CANT_DO_THAT_YET = 0x12, SPELL_CAST_RESULT_CASTER_DEAD = 0x13, SPELL_CAST_RESULT_CHARMED = 0x14, SPELL_CAST_RESULT_CHEST_IN_USE = 0x15, SPELL_CAST_RESULT_CONFUSED = 0x16, SPELL_CAST_RESULT_DONT_REPORT = 0x17, SPELL_CAST_RESULT_EQUIPPED_ITEM = 0x18, SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS = 0x19, SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS_MAINHAND = 0x1A, SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS_OFFHAND = 0x1B, SPELL_CAST_RESULT_ERROR = 0x1C, SPELL_CAST_RESULT_FIZZLE = 0x1D, SPELL_CAST_RESULT_FLEEING = 0x1E, SPELL_CAST_RESULT_FOOD_LOWLEVEL = 0x1F, SPELL_CAST_RESULT_HIGHLEVEL = 0x20, SPELL_CAST_RESULT_IMMUNE = 0x22, SPELL_CAST_RESULT_INTERRUPTED = 0x23, SPELL_CAST_RESULT_INTERRUPTED_COMBAT = 0x24, SPELL_CAST_RESULT_ITEM_ALREADY_ENCHANTED = 0x25, SPELL_CAST_RESULT_ITEM_GONE = 0x26, SPELL_CAST_RESULT_ENCHANT_NOT_EXISTING_ITEM = 0x27, SPELL_CAST_RESULT_ITEM_NOT_READY = 0x28, SPELL_CAST_RESULT_LEVEL_REQUIREMENT = 0x29, SPELL_CAST_RESULT_LINE_OF_SIGHT = 0x2A, SPELL_CAST_RESULT_LOWLEVEL = 0x2B, SPELL_CAST_RESULT_SKILL_NOT_HIGH_ENOUGH = 0x2C, SPELL_CAST_RESULT_MAINHAND_EMPTY = 0x2D, SPELL_CAST_RESULT_MOVING = 0x2E, SPELL_CAST_RESULT_NEED_AMMO = 0x2F, SPELL_CAST_RESULT_NEED_REQUIRES_SOMETHING = 0x30, SPELL_CAST_RESULT_NEED_EXOTIC_AMMO = 0x31, SPELL_CAST_RESULT_NOPATH = 0x32, SPELL_CAST_RESULT_NOT_BEHIND = 0x33, SPELL_CAST_RESULT_NOT_FISHABLE = 0x34, SPELL_CAST_RESULT_NOT_HERE = 0x35, SPELL_CAST_RESULT_NOT_INFRONT = 0x36, SPELL_CAST_RESULT_NOT_IN_CONTROL = 0x37, SPELL_CAST_RESULT_NOT_KNOWN = 0x38, SPELL_CAST_RESULT_NOT_MOUNTED = 0x39, SPELL_CAST_RESULT_NOT_ON_TAXI = 0x3A, SPELL_CAST_RESULT_NOT_ON_TRANSPORT = 0x3B, SPELL_CAST_RESULT_NOT_READY = 0x3C, SPELL_CAST_RESULT_NOT_SHAPESHIFT = 0x3D, SPELL_CAST_RESULT_NOT_STANDING = 0x3E, SPELL_CAST_RESULT_NOT_TRADEABLE = 0x3F, SPELL_CAST_RESULT_NOT_TRADING = 0x40, SPELL_CAST_RESULT_NOT_UNSHEATHED = 0x41, SPELL_CAST_RESULT_NOT_WHILE_GHOST = 0x42, SPELL_CAST_RESULT_NO_AMMO = 0x43, SPELL_CAST_RESULT_NO_CHARGES_REMAIN = 0x44, SPELL_CAST_RESULT_NO_CHAMPION = 0x45, SPELL_CAST_RESULT_NO_COMBO_POINTS = 0x46, SPELL_CAST_RESULT_NO_DUELING = 0x47, SPELL_CAST_RESULT_NO_ENDURANCE = 0x48, SPELL_CAST_RESULT_NO_FISH = 0x49, SPELL_CAST_RESULT_NO_ITEMS_WHILE_SHAPESHIFTED = 0x4A, SPELL_CAST_RESULT_NO_MOUNTS_ALLOWED = 0x4B, SPELL_CAST_RESULT_NO_PET = 0x4C, SPELL_CAST_RESULT_NO_POWER = 0x4D, SPELL_CAST_RESULT_NOTHING_TO_DISPEL = 0x4E, SPELL_CAST_RESULT_NOTHING_TO_STEAL = 0x4F, SPELL_CAST_RESULT_ONLY_ABOVEWATER = 0x50, SPELL_CAST_RESULT_ONLY_DAYTIME = 0x51, SPELL_CAST_RESULT_ONLY_INDOORS = 0x52, SPELL_CAST_RESULT_ONLY_MOUNTED = 0x53, SPELL_CAST_RESULT_ONLY_NIGHTTIME = 0x54, SPELL_CAST_RESULT_ONLY_OUTDOORS = 0x55, SPELL_CAST_RESULT_ONLY_SHAPESHIFT = 0x56, SPELL_CAST_RESULT_ONLY_STEALTHED = 0x57, SPELL_CAST_RESULT_ONLY_UNDERWATER = 0x58, SPELL_CAST_RESULT_OUT_OF_RANGE = 0x59, SPELL_CAST_RESULT_PACIFIED = 0x5A, SPELL_CAST_RESULT_POSSESSED = 0x5B, SPELL_CAST_RESULT_REQUIRES_AREA = 0x5D, SPELL_CAST_RESULT_REQUIRES_SPELL_FOCUS = 0x5E, SPELL_CAST_RESULT_ROOTED = 0x5F, SPELL_CAST_RESULT_SILENCED = 0x60, SPELL_CAST_RESULT_SPELL_IN_PROGRESS = 0x61, SPELL_CAST_RESULT_SPELL_LEARNED = 0x62, SPELL_CAST_RESULT_SPELL_UNAVAILABLE = 0x63, SPELL_CAST_RESULT_STUNNED = 0x64, SPELL_CAST_RESULT_TARGETS_DEAD = 0x65, SPELL_CAST_RESULT_TARGET_AFFECTING_COMBAT = 0x66, SPELL_CAST_RESULT_TARGET_AURASTATE = 0x67, SPELL_CAST_RESULT_TARGET_DUELING = 0x68, SPELL_CAST_RESULT_TARGET_ENEMY = 0x69, SPELL_CAST_RESULT_TARGET_ENRAGED = 0x6A, SPELL_CAST_RESULT_TARGET_FRIENDLY = 0x6B, SPELL_CAST_RESULT_TARGET_IN_COMBAT = 0x6C, SPELL_CAST_RESULT_TARGET_IS_PLAYER = 0x6D, SPELL_CAST_RESULT_TARGET_NOT_DEAD = 0x6E, SPELL_CAST_RESULT_TARGET_NOT_IN_PARTY = 0x6F, SPELL_CAST_RESULT_TARGET_NOT_LOOTED = 0x70, SPELL_CAST_RESULT_TARGET_NOT_PLAYER = 0x71, SPELL_CAST_RESULT_TARGET_NO_POCKETS = 0x72, SPELL_CAST_RESULT_TARGET_NO_WEAPONS = 0x73, SPELL_CAST_RESULT_TARGET_UNSKINNABLE = 0x74, SPELL_CAST_RESULT_THIRST_SATIATED = 0x75, SPELL_CAST_RESULT_TOO_CLOSE = 0x76, SPELL_CAST_RESULT_TOO_MANY_OF_ITEM = 0x77, SPELL_CAST_RESULT_TRAINING_POINTS = 0x79, SPELL_CAST_RESULT_TRY_AGAIN = 0x7A, SPELL_CAST_RESULT_UNIT_NOT_BEHIND = 0x7B, SPELL_CAST_RESULT_UNIT_NOT_INFRONT = 0x7C, SPELL_CAST_RESULT_WRONG_PET_FOOD = 0x7D, SPELL_CAST_RESULT_NOT_WHILE_FATIGUED = 0x7E, SPELL_CAST_RESULT_TARGET_NOT_IN_INSTANCE = 0x7F, SPELL_CAST_RESULT_NOT_WHILE_TRADING = 0x80, SPELL_CAST_RESULT_TARGET_NOT_IN_RAID = 0x81, SPELL_CAST_RESULT_DISENCHANT_WHILE_LOOTING = 0x82, SPELL_CAST_RESULT_PROSPECT_WHILE_LOOTING = 0x83, SPELL_CAST_RESULT_TARGET_FREEFORALL = 0x85, SPELL_CAST_RESULT_NO_EDIBLE_CORPSES = 0x86, SPELL_CAST_RESULT_ONLY_BATTLEGROUNDS = 0x87, SPELL_CAST_RESULT_TARGET_NOT_GHOST = 0x88, SPELL_CAST_RESULT_TOO_MANY_SKILLS = 0x89, SPELL_CAST_RESULT_CANT_USE_NEW_ITEM = 0x8A, SPELL_CAST_RESULT_WRONG_WEATHER = 0x8B, SPELL_CAST_RESULT_DAMAGE_IMMUNE = 0x8C, SPELL_CAST_RESULT_PREVENTED_BY_MECHANIC = 0x8D, SPELL_CAST_RESULT_PLAY_TIME = 0x8E, SPELL_CAST_RESULT_REPUTATION = 0x8F, SPELL_CAST_RESULT_MIN_SKILL = 0x90, SPELL_CAST_RESULT_UNKNOWN = 0x91, } e_spell_cast_result; static const value_string e_spell_cast_result_strings[] = { { SPELL_CAST_RESULT_AFFECTING_COMBAT, "Affecting Combat" }, { SPELL_CAST_RESULT_ALREADY_AT_FULL_HEALTH, "Already At Full Health" }, { SPELL_CAST_RESULT_ALREADY_AT_FULL_MANA, "Already At Full Mana" }, { SPELL_CAST_RESULT_ALREADY_BEING_TAMED, "Already Being Tamed" }, { SPELL_CAST_RESULT_ALREADY_HAVE_CHARM, "Already Have Charm" }, { SPELL_CAST_RESULT_ALREADY_HAVE_SUMMON, "Already Have Summon" }, { SPELL_CAST_RESULT_ALREADY_OPEN, "Already Open" }, { SPELL_CAST_RESULT_MORE_POWERFUL_SPELL_ACTIVE, "More Powerful Spell Active" }, { SPELL_CAST_RESULT_BAD_IMPLICIT_TARGETS, "Bad Implicit Targets" }, { SPELL_CAST_RESULT_BAD_TARGETS, "Bad Targets" }, { SPELL_CAST_RESULT_CANT_BE_CHARMED, "Cant Be Charmed" }, { SPELL_CAST_RESULT_CANT_BE_DISENCHANTED, "Cant Be Disenchanted" }, { SPELL_CAST_RESULT_CANT_BE_PROSPECTED, "Cant Be Prospected" }, { SPELL_CAST_RESULT_CANT_CAST_ON_TAPPED, "Cant Cast On Tapped" }, { SPELL_CAST_RESULT_CANT_DUEL_WHILE_INVISIBLE, "Cant Duel While Invisible" }, { SPELL_CAST_RESULT_CANT_DUEL_WHILE_STEALTHED, "Cant Duel While Stealthed" }, { SPELL_CAST_RESULT_CANT_TOO_CLOSE_TO_ENEMY, "Cant Too Close To Enemy" }, { SPELL_CAST_RESULT_CANT_DO_THAT_YET, "Cant Do That Yet" }, { SPELL_CAST_RESULT_CASTER_DEAD, "Caster Dead" }, { SPELL_CAST_RESULT_CHARMED, "Charmed" }, { SPELL_CAST_RESULT_CHEST_IN_USE, "Chest In Use" }, { SPELL_CAST_RESULT_CONFUSED, "Confused" }, { SPELL_CAST_RESULT_DONT_REPORT, "Dont Report" }, { SPELL_CAST_RESULT_EQUIPPED_ITEM, "Equipped Item" }, { SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS, "Equipped Item Class" }, { SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS_MAINHAND, "Equipped Item Class Mainhand" }, { SPELL_CAST_RESULT_EQUIPPED_ITEM_CLASS_OFFHAND, "Equipped Item Class Offhand" }, { SPELL_CAST_RESULT_ERROR, "Error" }, { SPELL_CAST_RESULT_FIZZLE, "Fizzle" }, { SPELL_CAST_RESULT_FLEEING, "Fleeing" }, { SPELL_CAST_RESULT_FOOD_LOWLEVEL, "Food Lowlevel" }, { SPELL_CAST_RESULT_HIGHLEVEL, "Highlevel" }, { SPELL_CAST_RESULT_IMMUNE, "Immune" }, { SPELL_CAST_RESULT_INTERRUPTED, "Interrupted" }, { SPELL_CAST_RESULT_INTERRUPTED_COMBAT, "Interrupted Combat" }, { SPELL_CAST_RESULT_ITEM_ALREADY_ENCHANTED, "Item Already Enchanted" }, { SPELL_CAST_RESULT_ITEM_GONE, "Item Gone" }, { SPELL_CAST_RESULT_ENCHANT_NOT_EXISTING_ITEM, "Enchant Not Existing Item" }, { SPELL_CAST_RESULT_ITEM_NOT_READY, "Item Not Ready" }, { SPELL_CAST_RESULT_LEVEL_REQUIREMENT, "Level Requirement" }, { SPELL_CAST_RESULT_LINE_OF_SIGHT, "Line Of Sight" }, { SPELL_CAST_RESULT_LOWLEVEL, "Lowlevel" }, { SPELL_CAST_RESULT_SKILL_NOT_HIGH_ENOUGH, "Skill Not High Enough" }, { SPELL_CAST_RESULT_MAINHAND_EMPTY, "Mainhand Empty" }, { SPELL_CAST_RESULT_MOVING, "Moving" }, { SPELL_CAST_RESULT_NEED_AMMO, "Need Ammo" }, { SPELL_CAST_RESULT_NEED_REQUIRES_SOMETHING, "Need Requires Something" }, { SPELL_CAST_RESULT_NEED_EXOTIC_AMMO, "Need Exotic Ammo" }, { SPELL_CAST_RESULT_NOPATH, "Nopath" }, { SPELL_CAST_RESULT_NOT_BEHIND, "Not Behind" }, { SPELL_CAST_RESULT_NOT_FISHABLE, "Not Fishable" }, { SPELL_CAST_RESULT_NOT_HERE, "Not Here" }, { SPELL_CAST_RESULT_NOT_INFRONT, "Not Infront" }, { SPELL_CAST_RESULT_NOT_IN_CONTROL, "Not In Control" }, { SPELL_CAST_RESULT_NOT_KNOWN, "Not Known" }, { SPELL_CAST_RESULT_NOT_MOUNTED, "Not Mounted" }, { SPELL_CAST_RESULT_NOT_ON_TAXI, "Not On Taxi" }, { SPELL_CAST_RESULT_NOT_ON_TRANSPORT, "Not On Transport" }, { SPELL_CAST_RESULT_NOT_READY, "Not Ready" }, { SPELL_CAST_RESULT_NOT_SHAPESHIFT, "Not Shapeshift" }, { SPELL_CAST_RESULT_NOT_STANDING, "Not Standing" }, { SPELL_CAST_RESULT_NOT_TRADEABLE, "Not Tradeable" }, { SPELL_CAST_RESULT_NOT_TRADING, "Not Trading" }, { SPELL_CAST_RESULT_NOT_UNSHEATHED, "Not Unsheathed" }, { SPELL_CAST_RESULT_NOT_WHILE_GHOST, "Not While Ghost" }, { SPELL_CAST_RESULT_NO_AMMO, "No Ammo" }, { SPELL_CAST_RESULT_NO_CHARGES_REMAIN, "No Charges Remain" }, { SPELL_CAST_RESULT_NO_CHAMPION, "No Champion" }, { SPELL_CAST_RESULT_NO_COMBO_POINTS, "No Combo Points" }, { SPELL_CAST_RESULT_NO_DUELING, "No Dueling" }, { SPELL_CAST_RESULT_NO_ENDURANCE, "No Endurance" }, { SPELL_CAST_RESULT_NO_FISH, "No Fish" }, { SPELL_CAST_RESULT_NO_ITEMS_WHILE_SHAPESHIFTED, "No Items While Shapeshifted" }, { SPELL_CAST_RESULT_NO_MOUNTS_ALLOWED, "No Mounts Allowed" }, { SPELL_CAST_RESULT_NO_PET, "No Pet" }, { SPELL_CAST_RESULT_NO_POWER, "No Power" }, { SPELL_CAST_RESULT_NOTHING_TO_DISPEL, "Nothing To Dispel" }, { SPELL_CAST_RESULT_NOTHING_TO_STEAL, "Nothing To Steal" }, { SPELL_CAST_RESULT_ONLY_ABOVEWATER, "Only Abovewater" }, { SPELL_CAST_RESULT_ONLY_DAYTIME, "Only Daytime" }, { SPELL_CAST_RESULT_ONLY_INDOORS, "Only Indoors" }, { SPELL_CAST_RESULT_ONLY_MOUNTED, "Only Mounted" }, { SPELL_CAST_RESULT_ONLY_NIGHTTIME, "Only Nighttime" }, { SPELL_CAST_RESULT_ONLY_OUTDOORS, "Only Outdoors" }, { SPELL_CAST_RESULT_ONLY_SHAPESHIFT, "Only Shapeshift" }, { SPELL_CAST_RESULT_ONLY_STEALTHED, "Only Stealthed" }, { SPELL_CAST_RESULT_ONLY_UNDERWATER, "Only Underwater" }, { SPELL_CAST_RESULT_OUT_OF_RANGE, "Out Of Range" }, { SPELL_CAST_RESULT_PACIFIED, "Pacified" }, { SPELL_CAST_RESULT_POSSESSED, "Possessed" }, { SPELL_CAST_RESULT_REQUIRES_AREA, "Requires Area" }, { SPELL_CAST_RESULT_REQUIRES_SPELL_FOCUS, "Requires Spell Focus" }, { SPELL_CAST_RESULT_ROOTED, "Rooted" }, { SPELL_CAST_RESULT_SILENCED, "Silenced" }, { SPELL_CAST_RESULT_SPELL_IN_PROGRESS, "Spell In Progress" }, { SPELL_CAST_RESULT_SPELL_LEARNED, "Spell Learned" }, { SPELL_CAST_RESULT_SPELL_UNAVAILABLE, "Spell Unavailable" }, { SPELL_CAST_RESULT_STUNNED, "Stunned" }, { SPELL_CAST_RESULT_TARGETS_DEAD, "Targets Dead" }, { SPELL_CAST_RESULT_TARGET_AFFECTING_COMBAT, "Target Affecting Combat" }, { SPELL_CAST_RESULT_TARGET_AURASTATE, "Target Aurastate" }, { SPELL_CAST_RESULT_TARGET_DUELING, "Target Dueling" }, { SPELL_CAST_RESULT_TARGET_ENEMY, "Target Enemy" }, { SPELL_CAST_RESULT_TARGET_ENRAGED, "Target Enraged" }, { SPELL_CAST_RESULT_TARGET_FRIENDLY, "Target Friendly" }, { SPELL_CAST_RESULT_TARGET_IN_COMBAT, "Target In Combat" }, { SPELL_CAST_RESULT_TARGET_IS_PLAYER, "Target Is Player" }, { SPELL_CAST_RESULT_TARGET_NOT_DEAD, "Target Not Dead" }, { SPELL_CAST_RESULT_TARGET_NOT_IN_PARTY, "Target Not In Party" }, { SPELL_CAST_RESULT_TARGET_NOT_LOOTED, "Target Not Looted" }, { SPELL_CAST_RESULT_TARGET_NOT_PLAYER, "Target Not Player" }, { SPELL_CAST_RESULT_TARGET_NO_POCKETS, "Target No Pockets" }, { SPELL_CAST_RESULT_TARGET_NO_WEAPONS, "Target No Weapons" }, { SPELL_CAST_RESULT_TARGET_UNSKINNABLE, "Target Unskinnable" }, { SPELL_CAST_RESULT_THIRST_SATIATED, "Thirst Satiated" }, { SPELL_CAST_RESULT_TOO_CLOSE, "Too Close" }, { SPELL_CAST_RESULT_TOO_MANY_OF_ITEM, "Too Many Of Item" }, { SPELL_CAST_RESULT_TRAINING_POINTS, "Training Points" }, { SPELL_CAST_RESULT_TRY_AGAIN, "Try Again" }, { SPELL_CAST_RESULT_UNIT_NOT_BEHIND, "Unit Not Behind" }, { SPELL_CAST_RESULT_UNIT_NOT_INFRONT, "Unit Not Infront" }, { SPELL_CAST_RESULT_WRONG_PET_FOOD, "Wrong Pet Food" }, { SPELL_CAST_RESULT_NOT_WHILE_FATIGUED, "Not While Fatigued" }, { SPELL_CAST_RESULT_TARGET_NOT_IN_INSTANCE, "Target Not In Instance" }, { SPELL_CAST_RESULT_NOT_WHILE_TRADING, "Not While Trading" }, { SPELL_CAST_RESULT_TARGET_NOT_IN_RAID, "Target Not In Raid" }, { SPELL_CAST_RESULT_DISENCHANT_WHILE_LOOTING, "Disenchant While Looting" }, { SPELL_CAST_RESULT_PROSPECT_WHILE_LOOTING, "Prospect While Looting" }, { SPELL_CAST_RESULT_TARGET_FREEFORALL, "Target Freeforall" }, { SPELL_CAST_RESULT_NO_EDIBLE_CORPSES, "No Edible Corpses" }, { SPELL_CAST_RESULT_ONLY_BATTLEGROUNDS, "Only Battlegrounds" }, { SPELL_CAST_RESULT_TARGET_NOT_GHOST, "Target Not Ghost" }, { SPELL_CAST_RESULT_TOO_MANY_SKILLS, "Too Many Skills" }, { SPELL_CAST_RESULT_CANT_USE_NEW_ITEM, "Cant Use New Item" }, { SPELL_CAST_RESULT_WRONG_WEATHER, "Wrong Weather" }, { SPELL_CAST_RESULT_DAMAGE_IMMUNE, "Damage Immune" }, { SPELL_CAST_RESULT_PREVENTED_BY_MECHANIC, "Prevented By Mechanic" }, { SPELL_CAST_RESULT_PLAY_TIME, "Play Time" }, { SPELL_CAST_RESULT_REPUTATION, "Reputation" }, { SPELL_CAST_RESULT_MIN_SKILL, "Min Skill" }, { SPELL_CAST_RESULT_UNKNOWN, "Unknown" }, { 0, NULL } }; typedef enum { PET_REACT_STATE_PASSIVE = 0x0, PET_REACT_STATE_DEFENSIVE = 0x1, PET_REACT_STATE_AGGRESSIVE = 0x2, } e_pet_react_state; static const value_string e_pet_react_state_strings[] = { { PET_REACT_STATE_PASSIVE, "Passive" }, { PET_REACT_STATE_DEFENSIVE, "Defensive" }, { PET_REACT_STATE_AGGRESSIVE, "Aggressive" }, { 0, NULL } }; typedef enum { PET_COMMAND_STATE_STAY = 0x0, PET_COMMAND_STATE_FOLLOW = 0x1, PET_COMMAND_STATE_ATTACK = 0x2, PET_COMMAND_STATE_DISMISS = 0x3, } e_pet_command_state; static const value_string e_pet_command_state_strings[] = { { PET_COMMAND_STATE_STAY, "Stay" }, { PET_COMMAND_STATE_FOLLOW, "Follow" }, { PET_COMMAND_STATE_ATTACK, "Attack" }, { PET_COMMAND_STATE_DISMISS, "Dismiss" }, { 0, NULL } }; typedef enum { PET_ENABLED_ENABLED = 0x8, PET_ENABLED_DISABLED = 0x0, } e_pet_enabled; static const value_string e_pet_enabled_strings[] = { { PET_ENABLED_ENABLED, "Enabled" }, { PET_ENABLED_DISABLED, "Disabled" }, { 0, NULL } }; typedef enum { PET_TAME_FAILURE_REASON_INVALID_CREATURE = 0x1, PET_TAME_FAILURE_REASON_TOO_MANY = 0x2, PET_TAME_FAILURE_REASON_CREATURE_ALREADY_OWNED = 0x3, PET_TAME_FAILURE_REASON_NOT_TAMEABLE = 0x4, PET_TAME_FAILURE_REASON_ANOTHER_SUMMON_ACTIVE = 0x5, PET_TAME_FAILURE_REASON_UNITS_CANT_TAME = 0x6, PET_TAME_FAILURE_REASON_NO_PET_AVAILABLE = 0x7, PET_TAME_FAILURE_REASON_INTERNAL_ERROR = 0x8, PET_TAME_FAILURE_REASON_TOO_HIGH_LEVEL = 0x9, PET_TAME_FAILURE_REASON_DEAD = 0xA, PET_TAME_FAILURE_REASON_NOT_DEAD = 0xB, PET_TAME_FAILURE_REASON_UNKNOWN_ERROR = 0xC, } e_pet_tame_failure_reason; static const value_string e_pet_tame_failure_reason_strings[] = { { PET_TAME_FAILURE_REASON_INVALID_CREATURE, "Invalid Creature" }, { PET_TAME_FAILURE_REASON_TOO_MANY, "Too Many" }, { PET_TAME_FAILURE_REASON_CREATURE_ALREADY_OWNED, "Creature Already Owned" }, { PET_TAME_FAILURE_REASON_NOT_TAMEABLE, "Not Tameable" }, { PET_TAME_FAILURE_REASON_ANOTHER_SUMMON_ACTIVE, "Another Summon Active" }, { PET_TAME_FAILURE_REASON_UNITS_CANT_TAME, "Units Cant Tame" }, { PET_TAME_FAILURE_REASON_NO_PET_AVAILABLE, "No Pet Available" }, { PET_TAME_FAILURE_REASON_INTERNAL_ERROR, "Internal Error" }, { PET_TAME_FAILURE_REASON_TOO_HIGH_LEVEL, "Too High Level" }, { PET_TAME_FAILURE_REASON_DEAD, "Dead" }, { PET_TAME_FAILURE_REASON_NOT_DEAD, "Not Dead" }, { PET_TAME_FAILURE_REASON_UNKNOWN_ERROR, "Unknown Error" }, { 0, NULL } }; typedef enum { LOG_FORMAT_DEFAULT = 0x0, LOG_FORMAT_DEBUG = 0x1, } e_log_format; static const value_string e_log_format_strings[] = { { LOG_FORMAT_DEFAULT, "Default" }, { LOG_FORMAT_DEBUG, "Debug" }, { 0, NULL } }; typedef enum { QUEST_FAILED_REASON_DONT_HAVE_REQ = 0x00, QUEST_FAILED_REASON_QUEST_FAILED_LOW_LEVEL = 0x01, QUEST_FAILED_REASON_QUEST_FAILED_REQS = 0x02, QUEST_FAILED_REASON_QUEST_FAILED_INVENTORY_FULL = 0x04, QUEST_FAILED_REASON_QUEST_FAILED_WRONG_RACE = 0x06, QUEST_FAILED_REASON_QUEST_ONLY_ONE_TIMED = 0x0C, QUEST_FAILED_REASON_QUEST_ALREADY_ON = 0x0D, QUEST_FAILED_REASON_QUEST_FAILED_DUPLICATE_ITEM = 0x11, QUEST_FAILED_REASON_QUEST_FAILED_MISSING_ITEMS = 0x14, QUEST_FAILED_REASON_QUEST_FAILED_NOT_ENOUGH_MONEY = 0x16, } e_quest_failed_reason; static const value_string e_quest_failed_reason_strings[] = { { QUEST_FAILED_REASON_DONT_HAVE_REQ, "Dont Have Req" }, { QUEST_FAILED_REASON_QUEST_FAILED_LOW_LEVEL, "Quest Failed Low Level" }, { QUEST_FAILED_REASON_QUEST_FAILED_REQS, "Quest Failed Reqs" }, { QUEST_FAILED_REASON_QUEST_FAILED_INVENTORY_FULL, "Quest Failed Inventory Full" }, { QUEST_FAILED_REASON_QUEST_FAILED_WRONG_RACE, "Quest Failed Wrong Race" }, { QUEST_FAILED_REASON_QUEST_ONLY_ONE_TIMED, "Quest Only One Timed" }, { QUEST_FAILED_REASON_QUEST_ALREADY_ON, "Quest Already On" }, { QUEST_FAILED_REASON_QUEST_FAILED_DUPLICATE_ITEM, "Quest Failed Duplicate Item" }, { QUEST_FAILED_REASON_QUEST_FAILED_MISSING_ITEMS, "Quest Failed Missing Items" }, { QUEST_FAILED_REASON_QUEST_FAILED_NOT_ENOUGH_MONEY, "Quest Failed Not Enough Money" }, { 0, NULL } }; typedef enum { QUEST_COMPLETABLE_NOT_COMPLETABLE = 0x0, QUEST_COMPLETABLE_COMPLETEABLE = 0x3, } e_quest_completable; static const value_string e_quest_completable_strings[] = { { QUEST_COMPLETABLE_NOT_COMPLETABLE, "Not Completable" }, { QUEST_COMPLETABLE_COMPLETEABLE, "Completeable" }, { 0, NULL } }; typedef enum { QUEST_GIVER_STATUS_NONE = 0x0, QUEST_GIVER_STATUS_UNAVAILABLE = 0x1, QUEST_GIVER_STATUS_CHAT = 0x2, QUEST_GIVER_STATUS_INCOMPLETE = 0x3, QUEST_GIVER_STATUS_REWARD_REP = 0x4, QUEST_GIVER_STATUS_AVAILABLE = 0x5, QUEST_GIVER_STATUS_REWARD_OLD = 0x6, QUEST_GIVER_STATUS_REWARD2 = 0x7, } e_quest_giver_status; static const value_string e_quest_giver_status_strings[] = { { QUEST_GIVER_STATUS_NONE, "None" }, { QUEST_GIVER_STATUS_UNAVAILABLE, "Unavailable" }, { QUEST_GIVER_STATUS_CHAT, "Chat" }, { QUEST_GIVER_STATUS_INCOMPLETE, "Incomplete" }, { QUEST_GIVER_STATUS_REWARD_REP, "Reward Rep" }, { QUEST_GIVER_STATUS_AVAILABLE, "Available" }, { QUEST_GIVER_STATUS_REWARD_OLD, "Reward Old" }, { QUEST_GIVER_STATUS_REWARD2, "Reward2" }, { 0, NULL } }; typedef enum { RAID_GROUP_ERROR_REQUIRED = 0x1, RAID_GROUP_ERROR_FULL = 0x2, } e_raid_group_error; static const value_string e_raid_group_error_strings[] = { { RAID_GROUP_ERROR_REQUIRED, "Required" }, { RAID_GROUP_ERROR_FULL, "Full" }, { 0, NULL } }; typedef enum { RAID_INSTANCE_MESSAGE_WARNING_HOURS = 0x1, RAID_INSTANCE_MESSAGE_WARNING_MIN = 0x2, RAID_INSTANCE_MESSAGE_WARNING_MIN_SOON = 0x3, RAID_INSTANCE_MESSAGE_WELCOME = 0x4, } e_raid_instance_message; static const value_string e_raid_instance_message_strings[] = { { RAID_INSTANCE_MESSAGE_WARNING_HOURS, "Warning Hours" }, { RAID_INSTANCE_MESSAGE_WARNING_MIN, "Warning Min" }, { RAID_INSTANCE_MESSAGE_WARNING_MIN_SOON, "Warning Min Soon" }, { RAID_INSTANCE_MESSAGE_WELCOME, "Welcome" }, { 0, NULL } }; typedef enum { SELL_ITEM_RESULT_CANT_FIND_ITEM = 0x1, SELL_ITEM_RESULT_CANT_SELL_ITEM = 0x2, SELL_ITEM_RESULT_CANT_FIND_VENDOR = 0x3, SELL_ITEM_RESULT_YOU_DONT_OWN_THAT_ITEM = 0x4, SELL_ITEM_RESULT_UNK = 0x5, SELL_ITEM_RESULT_ONLY_EMPTY_BAG = 0x6, } e_sell_item_result; static const value_string e_sell_item_result_strings[] = { { SELL_ITEM_RESULT_CANT_FIND_ITEM, "Cant Find Item" }, { SELL_ITEM_RESULT_CANT_SELL_ITEM, "Cant Sell Item" }, { SELL_ITEM_RESULT_CANT_FIND_VENDOR, "Cant Find Vendor" }, { SELL_ITEM_RESULT_YOU_DONT_OWN_THAT_ITEM, "You Dont Own That Item" }, { SELL_ITEM_RESULT_UNK, "Unk" }, { SELL_ITEM_RESULT_ONLY_EMPTY_BAG, "Only Empty Bag" }, { 0, NULL } }; typedef enum { MAIL_ACTION_SEND = 0x0, MAIL_ACTION_MONEY_TAKEN = 0x1, MAIL_ACTION_ITEM_TAKEN = 0x2, MAIL_ACTION_RETURNED_TO_SENDER = 0x3, MAIL_ACTION_DELETED = 0x4, MAIL_ACTION_MADE_PERMANENT = 0x5, } e_mail_action; static const value_string e_mail_action_strings[] = { { MAIL_ACTION_SEND, "Send" }, { MAIL_ACTION_MONEY_TAKEN, "Money Taken" }, { MAIL_ACTION_ITEM_TAKEN, "Item Taken" }, { MAIL_ACTION_RETURNED_TO_SENDER, "Returned To Sender" }, { MAIL_ACTION_DELETED, "Deleted" }, { MAIL_ACTION_MADE_PERMANENT, "Made Permanent" }, { 0, NULL } }; typedef enum { MAIL_RESULT_OK = 0x00, MAIL_RESULT_ERR_EQUIP_ERROR = 0x01, MAIL_RESULT_ERR_CANNOT_SEND_TO_SELF = 0x02, MAIL_RESULT_ERR_NOT_ENOUGH_MONEY = 0x03, MAIL_RESULT_ERR_RECIPIENT_NOT_FOUND = 0x04, MAIL_RESULT_ERR_NOT_YOUR_TEAM = 0x05, MAIL_RESULT_ERR_INTERNAL_ERROR = 0x06, MAIL_RESULT_ERR_DISABLED_FOR_TRIAL_ACC = 0x0E, MAIL_RESULT_ERR_RECIPIENT_CAP_REACHED = 0x0F, MAIL_RESULT_ERR_CANT_SEND_WRAPPED_COD = 0x10, MAIL_RESULT_ERR_MAIL_AND_CHAT_SUSPENDED = 0x11, MAIL_RESULT_ERR_TOO_MANY_ATTACHMENTS = 0x12, MAIL_RESULT_ERR_MAIL_ATTACHMENT_INVALID = 0x13, } e_mail_result; static const value_string e_mail_result_strings[] = { { MAIL_RESULT_OK, "Ok" }, { MAIL_RESULT_ERR_EQUIP_ERROR, "Err Equip Error" }, { MAIL_RESULT_ERR_CANNOT_SEND_TO_SELF, "Err Cannot Send To Self" }, { MAIL_RESULT_ERR_NOT_ENOUGH_MONEY, "Err Not Enough Money" }, { MAIL_RESULT_ERR_RECIPIENT_NOT_FOUND, "Err Recipient Not Found" }, { MAIL_RESULT_ERR_NOT_YOUR_TEAM, "Err Not Your Team" }, { MAIL_RESULT_ERR_INTERNAL_ERROR, "Err Internal Error" }, { MAIL_RESULT_ERR_DISABLED_FOR_TRIAL_ACC, "Err Disabled For Trial Acc" }, { MAIL_RESULT_ERR_RECIPIENT_CAP_REACHED, "Err Recipient Cap Reached" }, { MAIL_RESULT_ERR_CANT_SEND_WRAPPED_COD, "Err Cant Send Wrapped Cod" }, { MAIL_RESULT_ERR_MAIL_AND_CHAT_SUSPENDED, "Err Mail And Chat Suspended" }, { MAIL_RESULT_ERR_TOO_MANY_ATTACHMENTS, "Err Too Many Attachments" }, { MAIL_RESULT_ERR_MAIL_ATTACHMENT_INVALID, "Err Mail Attachment Invalid" }, { 0, NULL } }; typedef enum { MAIL_RESULT_TWO_OK = 0x00, MAIL_RESULT_TWO_ERR_EQUIP_ERROR = 0x01, MAIL_RESULT_TWO_ERR_CANNOT_SEND_TO_SELF = 0x02, MAIL_RESULT_TWO_ERR_NOT_ENOUGH_MONEY = 0x03, MAIL_RESULT_TWO_ERR_RECIPIENT_NOT_FOUND = 0x04, MAIL_RESULT_TWO_ERR_NOT_YOUR_TEAM = 0x05, MAIL_RESULT_TWO_ERR_INTERNAL_ERROR = 0x06, MAIL_RESULT_TWO_ERR_DISABLED_FOR_TRIAL_ACC = 0x0E, MAIL_RESULT_TWO_ERR_RECIPIENT_CAP_REACHED = 0x0F, MAIL_RESULT_TWO_ERR_CANT_SEND_WRAPPED_COD = 0x10, MAIL_RESULT_TWO_ERR_MAIL_AND_CHAT_SUSPENDED = 0x11, MAIL_RESULT_TWO_ERR_TOO_MANY_ATTACHMENTS = 0x12, MAIL_RESULT_TWO_ERR_MAIL_ATTACHMENT_INVALID = 0x13, } e_mail_result_two; static const value_string e_mail_result_two_strings[] = { { MAIL_RESULT_TWO_OK, "Ok" }, { MAIL_RESULT_TWO_ERR_EQUIP_ERROR, "Err Equip Error" }, { MAIL_RESULT_TWO_ERR_CANNOT_SEND_TO_SELF, "Err Cannot Send To Self" }, { MAIL_RESULT_TWO_ERR_NOT_ENOUGH_MONEY, "Err Not Enough Money" }, { MAIL_RESULT_TWO_ERR_RECIPIENT_NOT_FOUND, "Err Recipient Not Found" }, { MAIL_RESULT_TWO_ERR_NOT_YOUR_TEAM, "Err Not Your Team" }, { MAIL_RESULT_TWO_ERR_INTERNAL_ERROR, "Err Internal Error" }, { MAIL_RESULT_TWO_ERR_DISABLED_FOR_TRIAL_ACC, "Err Disabled For Trial Acc" }, { MAIL_RESULT_TWO_ERR_RECIPIENT_CAP_REACHED, "Err Recipient Cap Reached" }, { MAIL_RESULT_TWO_ERR_CANT_SEND_WRAPPED_COD, "Err Cant Send Wrapped Cod" }, { MAIL_RESULT_TWO_ERR_MAIL_AND_CHAT_SUSPENDED, "Err Mail And Chat Suspended" }, { MAIL_RESULT_TWO_ERR_TOO_MANY_ATTACHMENTS, "Err Too Many Attachments" }, { MAIL_RESULT_TWO_ERR_MAIL_ATTACHMENT_INVALID, "Err Mail Attachment Invalid" }, { 0, NULL } }; typedef enum { SERVER_MESSAGE_TYPE_SHUTDOWN_TIME = 0x1, SERVER_MESSAGE_TYPE_RESTART_TIME = 0x2, SERVER_MESSAGE_TYPE_CUSTOM = 0x3, SERVER_MESSAGE_TYPE_SHUTDOWN_CANCELLED = 0x4, SERVER_MESSAGE_TYPE_RESTART_CANCELLED = 0x5, } e_server_message_type; static const value_string e_server_message_type_strings[] = { { SERVER_MESSAGE_TYPE_SHUTDOWN_TIME, "Shutdown Time" }, { SERVER_MESSAGE_TYPE_RESTART_TIME, "Restart Time" }, { SERVER_MESSAGE_TYPE_CUSTOM, "Custom" }, { SERVER_MESSAGE_TYPE_SHUTDOWN_CANCELLED, "Shutdown Cancelled" }, { SERVER_MESSAGE_TYPE_RESTART_CANCELLED, "Restart Cancelled" }, { 0, NULL } }; typedef enum { ITEM_CLASS_CONSUMABLE = 0x0, ITEM_CLASS_CONTAINER = 0x1, ITEM_CLASS_WEAPON = 0x2, ITEM_CLASS_GEM = 0x3, ITEM_CLASS_ARMOR = 0x4, ITEM_CLASS_REAGENT = 0x5, ITEM_CLASS_PROJECTILE = 0x6, ITEM_CLASS_TRADE_GOODS = 0x7, ITEM_CLASS_GENERIC = 0x8, ITEM_CLASS_RECIPE = 0x9, ITEM_CLASS_MONEY = 0xA, ITEM_CLASS_QUIVER = 0xB, ITEM_CLASS_QUEST = 0xC, ITEM_CLASS_KEY = 0xD, ITEM_CLASS_PERMANENT = 0xE, ITEM_CLASS_MISC = 0xF, } e_item_class; static const value_string e_item_class_strings[] = { { ITEM_CLASS_CONSUMABLE, "Consumable" }, { ITEM_CLASS_CONTAINER, "Container" }, { ITEM_CLASS_WEAPON, "Weapon" }, { ITEM_CLASS_GEM, "Gem" }, { ITEM_CLASS_ARMOR, "Armor" }, { ITEM_CLASS_REAGENT, "Reagent" }, { ITEM_CLASS_PROJECTILE, "Projectile" }, { ITEM_CLASS_TRADE_GOODS, "Trade Goods" }, { ITEM_CLASS_GENERIC, "Generic" }, { ITEM_CLASS_RECIPE, "Recipe" }, { ITEM_CLASS_MONEY, "Money" }, { ITEM_CLASS_QUIVER, "Quiver" }, { ITEM_CLASS_QUEST, "Quest" }, { ITEM_CLASS_KEY, "Key" }, { ITEM_CLASS_PERMANENT, "Permanent" }, { ITEM_CLASS_MISC, "Misc" }, { 0, NULL } }; typedef enum { STABLE_RESULT_ERR_MONEY = 0x1, STABLE_RESULT_ERR_STABLE = 0x6, STABLE_RESULT_SUCCESS_STABLE = 0x8, STABLE_RESULT_SUCCESS_UNSTABLE = 0x9, STABLE_RESULT_SUCCESS_BUY_SLOT = 0xA, } e_stable_result; static const value_string e_stable_result_strings[] = { { STABLE_RESULT_ERR_MONEY, "Err Money" }, { STABLE_RESULT_ERR_STABLE, "Err Stable" }, { STABLE_RESULT_SUCCESS_STABLE, "Success Stable" }, { STABLE_RESULT_SUCCESS_UNSTABLE, "Success Unstable" }, { STABLE_RESULT_SUCCESS_BUY_SLOT, "Success Buy Slot" }, { 0, NULL } }; typedef enum { TRADE_STATUS_BUSY = 0x00, TRADE_STATUS_BEGIN_TRADE = 0x01, TRADE_STATUS_OPEN_WINDOW = 0x02, TRADE_STATUS_TRADE_CANCELED = 0x03, TRADE_STATUS_TRADE_ACCEPT = 0x04, TRADE_STATUS_BUSY_2 = 0x05, TRADE_STATUS_NO_TARGET = 0x06, TRADE_STATUS_BACK_TO_TRADE = 0x07, TRADE_STATUS_TRADE_COMPLETE = 0x08, TRADE_STATUS_TRADE_REJECTED = 0x09, TRADE_STATUS_TARGET_TO_FAR = 0x0A, TRADE_STATUS_WRONG_FACTION = 0x0B, TRADE_STATUS_CLOSE_WINDOW = 0x0C, TRADE_STATUS_UNKNOWN_13 = 0x0D, TRADE_STATUS_IGNORE_YOU = 0x0E, TRADE_STATUS_YOU_STUNNED = 0x0F, TRADE_STATUS_TARGET_STUNNED = 0x10, TRADE_STATUS_YOU_DEAD = 0x11, TRADE_STATUS_TARGET_DEAD = 0x12, TRADE_STATUS_YOU_LOGOUT = 0x13, TRADE_STATUS_TARGET_LOGOUT = 0x14, TRADE_STATUS_TRIAL_ACCOUNT = 0x15, TRADE_STATUS_ONLY_CONJURED = 0x16, TRADE_STATUS_NOT_ON_TAPLIST = 0x17, } e_trade_status; static const value_string e_trade_status_strings[] = { { TRADE_STATUS_BUSY, "Busy" }, { TRADE_STATUS_BEGIN_TRADE, "Begin Trade" }, { TRADE_STATUS_OPEN_WINDOW, "Open Window" }, { TRADE_STATUS_TRADE_CANCELED, "Trade Canceled" }, { TRADE_STATUS_TRADE_ACCEPT, "Trade Accept" }, { TRADE_STATUS_BUSY_2, "Busy 2" }, { TRADE_STATUS_NO_TARGET, "No Target" }, { TRADE_STATUS_BACK_TO_TRADE, "Back To Trade" }, { TRADE_STATUS_TRADE_COMPLETE, "Trade Complete" }, { TRADE_STATUS_TRADE_REJECTED, "Trade Rejected" }, { TRADE_STATUS_TARGET_TO_FAR, "Target To Far" }, { TRADE_STATUS_WRONG_FACTION, "Wrong Faction" }, { TRADE_STATUS_CLOSE_WINDOW, "Close Window" }, { TRADE_STATUS_UNKNOWN_13, "Unknown 13" }, { TRADE_STATUS_IGNORE_YOU, "Ignore You" }, { TRADE_STATUS_YOU_STUNNED, "You Stunned" }, { TRADE_STATUS_TARGET_STUNNED, "Target Stunned" }, { TRADE_STATUS_YOU_DEAD, "You Dead" }, { TRADE_STATUS_TARGET_DEAD, "Target Dead" }, { TRADE_STATUS_YOU_LOGOUT, "You Logout" }, { TRADE_STATUS_TARGET_LOGOUT, "Target Logout" }, { TRADE_STATUS_TRIAL_ACCOUNT, "Trial Account" }, { TRADE_STATUS_ONLY_CONJURED, "Only Conjured" }, { TRADE_STATUS_NOT_ON_TAPLIST, "Not On Taplist" }, { 0, NULL } }; typedef enum { TRAINING_FAILURE_REASON_UNAVAILABLE = 0x0, TRAINING_FAILURE_REASON_NOT_ENOUGH_MONEY = 0x1, TRAINING_FAILURE_REASON_NOT_ENOUGH_SKILL = 0x2, } e_training_failure_reason; static const value_string e_training_failure_reason_strings[] = { { TRAINING_FAILURE_REASON_UNAVAILABLE, "Unavailable" }, { TRAINING_FAILURE_REASON_NOT_ENOUGH_MONEY, "Not Enough Money" }, { TRAINING_FAILURE_REASON_NOT_ENOUGH_SKILL, "Not Enough Skill" }, { 0, NULL } }; typedef enum { TRANSFER_ABORT_REASON_NONE = 0x0, TRANSFER_ABORT_REASON_IS_FULL = 0x1, TRANSFER_ABORT_REASON_NOT_FOUND = 0x2, TRANSFER_ABORT_REASON_TOO_MANY_INSTANCES = 0x3, TRANSFER_ABORT_REASON_ZONE_IS_IN_COMBAT = 0x5, } e_transfer_abort_reason; static const value_string e_transfer_abort_reason_strings[] = { { TRANSFER_ABORT_REASON_NONE, "None" }, { TRANSFER_ABORT_REASON_IS_FULL, "Is Full" }, { TRANSFER_ABORT_REASON_NOT_FOUND, "Not Found" }, { TRANSFER_ABORT_REASON_TOO_MANY_INSTANCES, "Too Many Instances" }, { TRANSFER_ABORT_REASON_ZONE_IS_IN_COMBAT, "Zone Is In Combat" }, { 0, NULL } }; typedef enum { CINEMATIC_SEQUENCE_ID_GOBLIN = 0x00, CINEMATIC_SEQUENCE_ID_UNDEAD = 0x02, CINEMATIC_SEQUENCE_ID_ORC = 0x15, CINEMATIC_SEQUENCE_ID_DWARF = 0x29, CINEMATIC_SEQUENCE_ID_NIGHT_ELF = 0x3D, CINEMATIC_SEQUENCE_ID_HUMAN = 0x51, CINEMATIC_SEQUENCE_ID_GNOME = 0x65, CINEMATIC_SEQUENCE_ID_TROLL = 0x79, CINEMATIC_SEQUENCE_ID_TAUREN = 0x8D, } e_cinematic_sequence_id; static const value_string e_cinematic_sequence_id_strings[] = { { CINEMATIC_SEQUENCE_ID_GOBLIN, "Goblin" }, { CINEMATIC_SEQUENCE_ID_UNDEAD, "Undead" }, { CINEMATIC_SEQUENCE_ID_ORC, "Orc" }, { CINEMATIC_SEQUENCE_ID_DWARF, "Dwarf" }, { CINEMATIC_SEQUENCE_ID_NIGHT_ELF, "Night Elf" }, { CINEMATIC_SEQUENCE_ID_HUMAN, "Human" }, { CINEMATIC_SEQUENCE_ID_GNOME, "Gnome" }, { CINEMATIC_SEQUENCE_ID_TROLL, "Troll" }, { CINEMATIC_SEQUENCE_ID_TAUREN, "Tauren" }, { 0, NULL } }; typedef enum { WEATHER_TYPE_FINE = 0x0, WEATHER_TYPE_RAIN = 0x1, WEATHER_TYPE_SNOW = 0x2, WEATHER_TYPE_STORM = 0x3, } e_weather_type; static const value_string e_weather_type_strings[] = { { WEATHER_TYPE_FINE, "Fine" }, { WEATHER_TYPE_RAIN, "Rain" }, { WEATHER_TYPE_SNOW, "Snow" }, { WEATHER_TYPE_STORM, "Storm" }, { 0, NULL } }; typedef enum { WEATHER_CHANGE_TYPE_SMOOTH = 0x0, WEATHER_CHANGE_TYPE_INSTANT = 0x1, } e_weather_change_type; static const value_string e_weather_change_type_strings[] = { { WEATHER_CHANGE_TYPE_SMOOTH, "Smooth" }, { WEATHER_CHANGE_TYPE_INSTANT, "Instant" }, { 0, NULL } }; typedef enum { CHANNEL_MEMBER_FLAGS_NONE = 0x00, CHANNEL_MEMBER_FLAGS_OWNER = 0x01, CHANNEL_MEMBER_FLAGS_MODERATOR = 0x04, CHANNEL_MEMBER_FLAGS_VOICED = 0x08, CHANNEL_MEMBER_FLAGS_MUTED = 0x10, CHANNEL_MEMBER_FLAGS_CUSTOM = 0x20, CHANNEL_MEMBER_FLAGS_MICROPHONE_MUTE = 0x40, } e_channel_member_flags; typedef enum { CHARACTER_FLAGS_NONE = 0x0000, CHARACTER_FLAGS_LOCKED_FOR_TRANSFER = 0x0004, CHARACTER_FLAGS_HIDE_HELM = 0x0400, CHARACTER_FLAGS_HIDE_CLOAK = 0x0800, CHARACTER_FLAGS_GHOST = 0x2000, CHARACTER_FLAGS_RENAME = 0x4000, } e_character_flags; typedef enum { FACTION_FLAG_VISIBLE = 0x01, FACTION_FLAG_AT_WAR = 0x02, FACTION_FLAG_HIDDEN = 0x04, FACTION_FLAG_INVISIBLE_FORCED = 0x08, FACTION_FLAG_PEACE_FORCED = 0x10, FACTION_FLAG_INACTIVE = 0x20, FACTION_FLAG_RIVAL = 0x40, } e_faction_flag; typedef enum { SPLINE_FLAG_NONE = 0x00000000, SPLINE_FLAG_DONE = 0x00000001, SPLINE_FLAG_FALLING = 0x00000002, SPLINE_FLAG_UNKNOWN3 = 0x00000004, SPLINE_FLAG_UNKNOWN4 = 0x00000008, SPLINE_FLAG_UNKNOWN5 = 0x00000010, SPLINE_FLAG_UNKNOWN6 = 0x00000020, SPLINE_FLAG_UNKNOWN7 = 0x00000040, SPLINE_FLAG_UNKNOWN8 = 0x00000080, SPLINE_FLAG_RUN_MODE = 0x00000100, SPLINE_FLAG_FLYING = 0x00000200, SPLINE_FLAG_NO_SPLINE = 0x00000400, SPLINE_FLAG_UNKNOWN12 = 0x00000800, SPLINE_FLAG_UNKNOWN13 = 0x00001000, SPLINE_FLAG_UNKNOWN14 = 0x00002000, SPLINE_FLAG_UNKNOWN15 = 0x00004000, SPLINE_FLAG_UNKNOWN16 = 0x00008000, SPLINE_FLAG_FINAL_POINT = 0x00010000, SPLINE_FLAG_FINAL_TARGET = 0x00020000, SPLINE_FLAG_FINAL_ANGLE = 0x00040000, SPLINE_FLAG_UNKNOWN19 = 0x00080000, SPLINE_FLAG_CYCLIC = 0x00100000, SPLINE_FLAG_ENTER_CYCLE = 0x00200000, SPLINE_FLAG_FROZEN = 0x00400000, SPLINE_FLAG_UNKNOWN23 = 0x00800000, SPLINE_FLAG_UNKNOWN24 = 0x01000000, SPLINE_FLAG_UNKNOWN25 = 0x02000000, SPLINE_FLAG_UNKNOWN26 = 0x04000000, SPLINE_FLAG_UNKNOWN27 = 0x08000000, SPLINE_FLAG_UNKNOWN28 = 0x10000000, SPLINE_FLAG_UNKNOWN29 = 0x20000000, SPLINE_FLAG_UNKNOWN30 = 0x40000000, SPLINE_FLAG_UNKNOWN31 = -0x7FFFFFFF, } e_spline_flag; typedef enum { UPDATE_FLAG_NONE = 0x00, UPDATE_FLAG_SELF = 0x01, UPDATE_FLAG_TRANSPORT = 0x02, UPDATE_FLAG_MELEE_ATTACKING = 0x04, UPDATE_FLAG_HIGH_GUID = 0x08, UPDATE_FLAG_ALL = 0x10, UPDATE_FLAG_LIVING = 0x20, UPDATE_FLAG_HAS_POSITION = 0x40, } e_update_flag; typedef enum { MOVEMENT_FLAGS_NONE = 0x00000000, MOVEMENT_FLAGS_FORWARD = 0x00000001, MOVEMENT_FLAGS_BACKWARD = 0x00000002, MOVEMENT_FLAGS_STRAFE_LEFT = 0x00000004, MOVEMENT_FLAGS_STRAFE_RIGHT = 0x00000008, MOVEMENT_FLAGS_TURN_LEFT = 0x00000010, MOVEMENT_FLAGS_TURN_RIGHT = 0x00000020, MOVEMENT_FLAGS_PITCH_UP = 0x00000040, MOVEMENT_FLAGS_PITCH_DOWN = 0x00000080, MOVEMENT_FLAGS_WALK_MODE = 0x00000100, MOVEMENT_FLAGS_ON_TRANSPORT = 0x00000200, MOVEMENT_FLAGS_LEVITATING = 0x00000400, MOVEMENT_FLAGS_FIXED_Z = 0x00000800, MOVEMENT_FLAGS_ROOT = 0x00001000, MOVEMENT_FLAGS_JUMPING = 0x00002000, MOVEMENT_FLAGS_FALLINGFAR = 0x00004000, MOVEMENT_FLAGS_SWIMMING = 0x00200000, MOVEMENT_FLAGS_SPLINE_ENABLED = 0x00400000, MOVEMENT_FLAGS_CAN_FLY = 0x00800000, MOVEMENT_FLAGS_FLYING = 0x01000000, MOVEMENT_FLAGS_ONTRANSPORT = 0x02000000, MOVEMENT_FLAGS_SPLINE_ELEVATION = 0x04000000, MOVEMENT_FLAGS_WATERWALKING = 0x10000000, MOVEMENT_FLAGS_SAFE_FALL = 0x20000000, MOVEMENT_FLAGS_HOVER = 0x40000000, } e_movement_flags; typedef enum { SPELL_CAST_TARGET_FLAGS_SELF = 0x0000, SPELL_CAST_TARGET_FLAGS_UNUSED1 = 0x0001, SPELL_CAST_TARGET_FLAGS_UNIT = 0x0002, SPELL_CAST_TARGET_FLAGS_UNUSED2 = 0x0004, SPELL_CAST_TARGET_FLAGS_UNUSED3 = 0x0008, SPELL_CAST_TARGET_FLAGS_ITEM = 0x0010, SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION = 0x0020, SPELL_CAST_TARGET_FLAGS_DEST_LOCATION = 0x0040, SPELL_CAST_TARGET_FLAGS_OBJECT_UNK = 0x0080, SPELL_CAST_TARGET_FLAGS_UNIT_UNK = 0x0100, SPELL_CAST_TARGET_FLAGS_PVP_CORPSE = 0x0200, SPELL_CAST_TARGET_FLAGS_UNIT_CORPSE = 0x0400, SPELL_CAST_TARGET_FLAGS_GAMEOBJECT = 0x0800, SPELL_CAST_TARGET_FLAGS_TRADE_ITEM = 0x1000, SPELL_CAST_TARGET_FLAGS_STRING = 0x2000, SPELL_CAST_TARGET_FLAGS_UNK1 = 0x4000, SPELL_CAST_TARGET_FLAGS_CORPSE = 0x8000, } e_spell_cast_target_flags; typedef enum { CHANNEL_FLAGS_NONE = 0x00, CHANNEL_FLAGS_CUSTOM = 0x01, CHANNEL_FLAGS_TRADE = 0x04, CHANNEL_FLAGS_NOT_LFG = 0x08, CHANNEL_FLAGS_GENERAL = 0x10, CHANNEL_FLAGS_CITY = 0x20, CHANNEL_FLAGS_LFG = 0x40, CHANNEL_FLAGS_VOICE = 0x80, } e_channel_flags; typedef enum { ITEM_FLAG_NONE = 0x00000, ITEM_FLAG_NO_PICKUP = 0x00001, ITEM_FLAG_CONJURED = 0x00002, ITEM_FLAG_LOOTABLE = 0x00004, ITEM_FLAG_DEPRECATED = 0x00010, ITEM_FLAG_INDESTRUCTIBLE = 0x00020, ITEM_FLAG_PLAYER_CAST = 0x00040, ITEM_FLAG_NO_EQUIP_COOLDOWN = 0x00080, ITEM_FLAG_INT_BONUS_INSTEAD = 0x00100, ITEM_FLAG_WRAPPER = 0x00200, ITEM_FLAG_IGNORE_BAG_SPACE = 0x00400, ITEM_FLAG_PARTY_LOOT = 0x00800, ITEM_FLAG_CHARTER = 0x02000, ITEM_FLAG_HAS_TEXT = 0x04000, ITEM_FLAG_NO_DISENCHANT = 0x08000, ITEM_FLAG_REAL_DURATION = 0x10000, ITEM_FLAG_NO_CREATOR = 0x20000, } e_item_flag; typedef enum { ALLOWED_CLASS_ALL = 0x000, ALLOWED_CLASS_WARRIOR = 0x001, ALLOWED_CLASS_PALADIN = 0x002, ALLOWED_CLASS_HUNTER = 0x004, ALLOWED_CLASS_ROGUE = 0x008, ALLOWED_CLASS_PRIEST = 0x010, ALLOWED_CLASS_SHAMAN = 0x040, ALLOWED_CLASS_MAGE = 0x080, ALLOWED_CLASS_WARLOCK = 0x100, ALLOWED_CLASS_DRUID = 0x400, } e_allowed_class; typedef enum { ALLOWED_RACE_ALL = 0x000, ALLOWED_RACE_HUMAN = 0x001, ALLOWED_RACE_ORC = 0x002, ALLOWED_RACE_DWARF = 0x004, ALLOWED_RACE_NIGHT_ELF = 0x008, ALLOWED_RACE_UNDEAD = 0x010, ALLOWED_RACE_TAUREN = 0x020, ALLOWED_RACE_GNOME = 0x040, ALLOWED_RACE_TROLL = 0x080, ALLOWED_RACE_GOBLIN = 0x100, } e_allowed_race; typedef enum { GROUP_UPDATE_FLAGS_NONE = 0x00000000, GROUP_UPDATE_FLAGS_STATUS = 0x00000001, GROUP_UPDATE_FLAGS_CUR_HP = 0x00000002, GROUP_UPDATE_FLAGS_MAX_HP = 0x00000004, GROUP_UPDATE_FLAGS_POWER_TYPE = 0x00000008, GROUP_UPDATE_FLAGS_CUR_POWER = 0x00000010, GROUP_UPDATE_FLAGS_MAX_POWER = 0x00000020, GROUP_UPDATE_FLAGS_LEVEL = 0x00000040, GROUP_UPDATE_FLAGS_ZONE = 0x00000080, GROUP_UPDATE_FLAGS_POSITION = 0x00000100, GROUP_UPDATE_FLAGS_AURAS = 0x00000200, GROUP_UPDATE_FLAGS_AURAS_2 = 0x00000400, GROUP_UPDATE_FLAGS_PET_GUID = 0x00000800, GROUP_UPDATE_FLAGS_PET_NAME = 0x00001000, GROUP_UPDATE_FLAGS_PET_MODEL_ID = 0x00002000, GROUP_UPDATE_FLAGS_PET_CUR_HP = 0x00004000, GROUP_UPDATE_FLAGS_PET_MAX_HP = 0x00008000, GROUP_UPDATE_FLAGS_PET_POWER_TYPE = 0x00010000, GROUP_UPDATE_FLAGS_PET_CUR_POWER = 0x00020000, GROUP_UPDATE_FLAGS_PET_MAX_POWER = 0x00040000, GROUP_UPDATE_FLAGS_PET_AURAS = 0x00080000, GROUP_UPDATE_FLAGS_PET_AURAS_2 = 0x00100000, GROUP_UPDATE_FLAGS_MODE_OFFLINE = 0x10000000, } e_group_update_flags; typedef enum { GROUP_MEMBER_ONLINE_STATUS_OFFLINE = 0x00, GROUP_MEMBER_ONLINE_STATUS_ONLINE = 0x01, GROUP_MEMBER_ONLINE_STATUS_PVP = 0x02, GROUP_MEMBER_ONLINE_STATUS_DEAD = 0x04, GROUP_MEMBER_ONLINE_STATUS_GHOST = 0x08, GROUP_MEMBER_ONLINE_STATUS_PVP_FFA = 0x10, GROUP_MEMBER_ONLINE_STATUS_ZONE_OUT = 0x20, GROUP_MEMBER_ONLINE_STATUS_AFK = 0x40, GROUP_MEMBER_ONLINE_STATUS_DND = 0x80, } e_group_member_online_status; typedef enum { CAST_FLAGS_NONE = 0x000, CAST_FLAGS_HIDDEN_COMBATLOG = 0x001, CAST_FLAGS_UNKNOWN2 = 0x002, CAST_FLAGS_UNKNOWN3 = 0x004, CAST_FLAGS_UNKNOWN4 = 0x008, CAST_FLAGS_UNKNOWN5 = 0x010, CAST_FLAGS_AMMO = 0x020, CAST_FLAGS_UNKNOWN7 = 0x040, CAST_FLAGS_UNKNOWN8 = 0x080, CAST_FLAGS_UNKNOWN9 = 0x100, } e_cast_flags; /* AUTOGENERATED_END_ENUM */ // All existing opcodes for 1.12.x typedef enum { MSG_NULL_ACTION = 0x000, CMSG_BOOTME = 0x001, CMSG_DBLOOKUP = 0x002, SMSG_DBLOOKUP = 0x003, CMSG_QUERY_OBJECT_POSITION = 0x004, SMSG_QUERY_OBJECT_POSITION = 0x005, CMSG_QUERY_OBJECT_ROTATION = 0x006, SMSG_QUERY_OBJECT_ROTATION = 0x007, CMSG_WORLD_TELEPORT = 0x008, CMSG_TELEPORT_TO_UNIT = 0x009, CMSG_ZONE_MAP = 0x00A, SMSG_ZONE_MAP = 0x00B, CMSG_DEBUG_CHANGECELLZONE = 0x00C, CMSG_EMBLAZON_TABARD_OBSOLETE = 0x00D, CMSG_UNEMBLAZON_TABARD_OBSOLETE = 0x00E, CMSG_RECHARGE = 0x00F, CMSG_LEARN_SPELL = 0x010, CMSG_CREATEMONSTER = 0x011, CMSG_DESTROYMONSTER = 0x012, CMSG_CREATEITEM = 0x013, CMSG_CREATEGAMEOBJECT = 0x014, SMSG_CHECK_FOR_BOTS = 0x015, CMSG_MAKEMONSTERATTACKGUID = 0x016, CMSG_BOT_DETECTED2 = 0x017, CMSG_FORCEACTION = 0x018, CMSG_FORCEACTIONONOTHER = 0x019, CMSG_FORCEACTIONSHOW = 0x01A, SMSG_FORCEACTIONSHOW = 0x01B, CMSG_PETGODMODE = 0x01C, SMSG_PETGODMODE = 0x01D, SMSG_DEBUGINFOSPELLMISS_OBSOLETE = 0x01E, CMSG_WEATHER_SPEED_CHEAT = 0x01F, CMSG_UNDRESSPLAYER = 0x020, CMSG_BEASTMASTER = 0x021, CMSG_GODMODE = 0x022, SMSG_GODMODE = 0x023, CMSG_CHEAT_SETMONEY = 0x024, CMSG_LEVEL_CHEAT = 0x025, CMSG_PET_LEVEL_CHEAT = 0x026, CMSG_SET_WORLDSTATE = 0x027, CMSG_COOLDOWN_CHEAT = 0x028, CMSG_USE_SKILL_CHEAT = 0x029, CMSG_FLAG_QUEST = 0x02A, CMSG_FLAG_QUEST_FINISH = 0x02B, CMSG_CLEAR_QUEST = 0x02C, CMSG_SEND_EVENT = 0x02D, CMSG_DEBUG_AISTATE = 0x02E, SMSG_DEBUG_AISTATE = 0x02F, CMSG_DISABLE_PVP_CHEAT = 0x030, CMSG_ADVANCE_SPAWN_TIME = 0x031, CMSG_PVP_PORT_OBSOLETE = 0x032, CMSG_AUTH_SRP6_BEGIN = 0x033, CMSG_AUTH_SRP6_PROOF = 0x034, CMSG_AUTH_SRP6_RECODE = 0x035, CMSG_CHAR_CREATE = 0x036, CMSG_CHAR_ENUM = 0x037, CMSG_CHAR_DELETE = 0x038, SMSG_AUTH_SRP6_RESPONSE = 0x039, SMSG_CHAR_CREATE = 0x03A, SMSG_CHAR_ENUM = 0x03B, SMSG_CHAR_DELETE = 0x03C, CMSG_PLAYER_LOGIN = 0x03D, SMSG_NEW_WORLD = 0x03E, SMSG_TRANSFER_PENDING = 0x03F, SMSG_TRANSFER_ABORTED = 0x040, SMSG_CHARACTER_LOGIN_FAILED = 0x041, SMSG_LOGIN_SETTIMESPEED = 0x042, SMSG_GAMETIME_UPDATE = 0x043, CMSG_GAMETIME_SET = 0x044, SMSG_GAMETIME_SET = 0x045, CMSG_GAMESPEED_SET = 0x046, SMSG_GAMESPEED_SET = 0x047, CMSG_SERVERTIME = 0x048, SMSG_SERVERTIME = 0x049, CMSG_PLAYER_LOGOUT = 0x04A, CMSG_LOGOUT_REQUEST = 0x04B, SMSG_LOGOUT_RESPONSE = 0x04C, SMSG_LOGOUT_COMPLETE = 0x04D, CMSG_LOGOUT_CANCEL = 0x04E, SMSG_LOGOUT_CANCEL_ACK = 0x04F, CMSG_NAME_QUERY = 0x050, SMSG_NAME_QUERY_RESPONSE = 0x051, CMSG_PET_NAME_QUERY = 0x052, SMSG_PET_NAME_QUERY_RESPONSE = 0x053, CMSG_GUILD_QUERY = 0x054, SMSG_GUILD_QUERY_RESPONSE = 0x055, CMSG_ITEM_QUERY_SINGLE = 0x056, CMSG_ITEM_QUERY_MULTIPLE = 0x057, SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x058, SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x059, CMSG_PAGE_TEXT_QUERY = 0x05A, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x05B, CMSG_QUEST_QUERY = 0x05C, SMSG_QUEST_QUERY_RESPONSE = 0x05D, CMSG_GAMEOBJECT_QUERY = 0x05E, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x05F, CMSG_CREATURE_QUERY = 0x060, SMSG_CREATURE_QUERY_RESPONSE = 0x061, CMSG_WHO = 0x062, SMSG_WHO = 0x063, CMSG_WHOIS = 0x064, SMSG_WHOIS = 0x065, CMSG_FRIEND_LIST = 0x066, SMSG_FRIEND_LIST = 0x067, SMSG_FRIEND_STATUS = 0x068, CMSG_ADD_FRIEND = 0x069, CMSG_DEL_FRIEND = 0x06A, SMSG_IGNORE_LIST = 0x06B, CMSG_ADD_IGNORE = 0x06C, CMSG_DEL_IGNORE = 0x06D, CMSG_GROUP_INVITE = 0x06E, SMSG_GROUP_INVITE = 0x06F, CMSG_GROUP_CANCEL = 0x070, SMSG_GROUP_CANCEL = 0x071, CMSG_GROUP_ACCEPT = 0x072, CMSG_GROUP_DECLINE = 0x073, SMSG_GROUP_DECLINE = 0x074, CMSG_GROUP_UNINVITE = 0x075, CMSG_GROUP_UNINVITE_GUID = 0x076, SMSG_GROUP_UNINVITE = 0x077, CMSG_GROUP_SET_LEADER = 0x078, SMSG_GROUP_SET_LEADER = 0x079, CMSG_LOOT_METHOD = 0x07A, CMSG_GROUP_DISBAND = 0x07B, SMSG_GROUP_DESTROYED = 0x07C, SMSG_GROUP_LIST = 0x07D, SMSG_PARTY_MEMBER_STATS = 0x07E, SMSG_PARTY_COMMAND_RESULT = 0x07F, UMSG_UPDATE_GROUP_MEMBERS = 0x080, CMSG_GUILD_CREATE = 0x081, CMSG_GUILD_INVITE = 0x082, SMSG_GUILD_INVITE = 0x083, CMSG_GUILD_ACCEPT = 0x084, CMSG_GUILD_DECLINE = 0x085, SMSG_GUILD_DECLINE = 0x086, CMSG_GUILD_INFO = 0x087, SMSG_GUILD_INFO = 0x088, CMSG_GUILD_ROSTER = 0x089, SMSG_GUILD_ROSTER = 0x08A, CMSG_GUILD_PROMOTE = 0x08B, CMSG_GUILD_DEMOTE = 0x08C, CMSG_GUILD_LEAVE = 0x08D, CMSG_GUILD_REMOVE = 0x08E, CMSG_GUILD_DISBAND = 0x08F, CMSG_GUILD_LEADER = 0x090, CMSG_GUILD_MOTD = 0x091, SMSG_GUILD_EVENT = 0x092, SMSG_GUILD_COMMAND_RESULT = 0x093, UMSG_UPDATE_GUILD = 0x094, CMSG_MESSAGECHAT = 0x095, SMSG_MESSAGECHAT = 0x096, CMSG_JOIN_CHANNEL = 0x097, CMSG_LEAVE_CHANNEL = 0x098, SMSG_CHANNEL_NOTIFY = 0x099, CMSG_CHANNEL_LIST = 0x09A, SMSG_CHANNEL_LIST = 0x09B, CMSG_CHANNEL_PASSWORD = 0x09C, CMSG_CHANNEL_SET_OWNER = 0x09D, CMSG_CHANNEL_OWNER = 0x09E, CMSG_CHANNEL_MODERATOR = 0x09F, CMSG_CHANNEL_UNMODERATOR = 0x0A0, CMSG_CHANNEL_MUTE = 0x0A1, CMSG_CHANNEL_UNMUTE = 0x0A2, CMSG_CHANNEL_INVITE = 0x0A3, CMSG_CHANNEL_KICK = 0x0A4, CMSG_CHANNEL_BAN = 0x0A5, CMSG_CHANNEL_UNBAN = 0x0A6, CMSG_CHANNEL_ANNOUNCEMENTS = 0x0A7, CMSG_CHANNEL_MODERATE = 0x0A8, SMSG_UPDATE_OBJECT = 0x0A9, SMSG_DESTROY_OBJECT = 0x0AA, CMSG_USE_ITEM = 0x0AB, CMSG_OPEN_ITEM = 0x0AC, CMSG_READ_ITEM = 0x0AD, SMSG_READ_ITEM_OK = 0x0AE, SMSG_READ_ITEM_FAILED = 0x0AF, SMSG_ITEM_COOLDOWN = 0x0B0, CMSG_GAMEOBJ_USE = 0x0B1, CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE = 0x0B2, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0B3, CMSG_AREATRIGGER = 0x0B4, MSG_MOVE_START_FORWARD = 0x0B5, MSG_MOVE_START_BACKWARD = 0x0B6, MSG_MOVE_STOP = 0x0B7, MSG_MOVE_START_STRAFE_LEFT = 0x0B8, MSG_MOVE_START_STRAFE_RIGHT = 0x0B9, MSG_MOVE_STOP_STRAFE = 0x0BA, MSG_MOVE_JUMP = 0x0BB, MSG_MOVE_START_TURN_LEFT = 0x0BC, MSG_MOVE_START_TURN_RIGHT = 0x0BD, MSG_MOVE_STOP_TURN = 0x0BE, MSG_MOVE_START_PITCH_UP = 0x0BF, MSG_MOVE_START_PITCH_DOWN = 0x0C0, MSG_MOVE_STOP_PITCH = 0x0C1, MSG_MOVE_SET_RUN_MODE = 0x0C2, MSG_MOVE_SET_WALK_MODE = 0x0C3, MSG_MOVE_TOGGLE_LOGGING = 0x0C4, MSG_MOVE_TELEPORT = 0x0C5, MSG_MOVE_TELEPORT_CHEAT = 0x0C6, MSG_MOVE_TELEPORT_ACK = 0x0C7, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0C8, MSG_MOVE_FALL_LAND = 0x0C9, MSG_MOVE_START_SWIM = 0x0CA, MSG_MOVE_STOP_SWIM = 0x0CB, MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x0CC, MSG_MOVE_SET_RUN_SPEED = 0x0CD, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x0CE, MSG_MOVE_SET_RUN_BACK_SPEED = 0x0CF, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x0D0, MSG_MOVE_SET_WALK_SPEED = 0x0D1, MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x0D2, MSG_MOVE_SET_SWIM_SPEED = 0x0D3, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x0D4, MSG_MOVE_SET_SWIM_BACK_SPEED = 0x0D5, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0D6, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x0D7, MSG_MOVE_SET_TURN_RATE = 0x0D8, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x0D9, MSG_MOVE_SET_FACING = 0x0DA, MSG_MOVE_SET_PITCH = 0x0DB, MSG_MOVE_WORLDPORT_ACK = 0x0DC, SMSG_MONSTER_MOVE = 0x0DD, SMSG_MOVE_WATER_WALK = 0x0DE, SMSG_MOVE_LAND_WALK = 0x0DF, MSG_MOVE_SET_RAW_POSITION_ACK = 0x0E0, CMSG_MOVE_SET_RAW_POSITION = 0x0E1, SMSG_FORCE_RUN_SPEED_CHANGE = 0x0E2, CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x0E3, SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x0E4, CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x0E5, SMSG_FORCE_SWIM_SPEED_CHANGE = 0x0E6, CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x0E7, SMSG_FORCE_MOVE_ROOT = 0x0E8, CMSG_FORCE_MOVE_ROOT_ACK = 0x0E9, SMSG_FORCE_MOVE_UNROOT = 0x0EA, CMSG_FORCE_MOVE_UNROOT_ACK = 0x0EB, MSG_MOVE_ROOT = 0x0EC, MSG_MOVE_UNROOT = 0x0ED, MSG_MOVE_HEARTBEAT = 0x0EE, SMSG_MOVE_KNOCK_BACK = 0x0EF, CMSG_MOVE_KNOCK_BACK_ACK = 0x0F0, MSG_MOVE_KNOCK_BACK = 0x0F1, SMSG_MOVE_FEATHER_FALL = 0x0F2, SMSG_MOVE_NORMAL_FALL = 0x0F3, SMSG_MOVE_SET_HOVER = 0x0F4, SMSG_MOVE_UNSET_HOVER = 0x0F5, CMSG_MOVE_HOVER_ACK = 0x0F6, MSG_MOVE_HOVER = 0x0F7, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x0F8, CMSG_OPENING_CINEMATIC = 0x0F9, SMSG_TRIGGER_CINEMATIC = 0x0FA, CMSG_NEXT_CINEMATIC_CAMERA = 0x0FB, CMSG_COMPLETE_CINEMATIC = 0x0FC, SMSG_TUTORIAL_FLAGS = 0x0FD, CMSG_TUTORIAL_FLAG = 0x0FE, CMSG_TUTORIAL_CLEAR = 0x0FF, CMSG_TUTORIAL_RESET = 0x100, CMSG_STANDSTATECHANGE = 0x101, CMSG_EMOTE = 0x102, SMSG_EMOTE = 0x103, CMSG_TEXT_EMOTE = 0x104, SMSG_TEXT_EMOTE = 0x105, CMSG_AUTOEQUIP_GROUND_ITEM = 0x106, CMSG_AUTOSTORE_GROUND_ITEM = 0x107, CMSG_AUTOSTORE_LOOT_ITEM = 0x108, CMSG_STORE_LOOT_IN_SLOT = 0x109, CMSG_AUTOEQUIP_ITEM = 0x10A, CMSG_AUTOSTORE_BAG_ITEM = 0x10B, CMSG_SWAP_ITEM = 0x10C, CMSG_SWAP_INV_ITEM = 0x10D, CMSG_SPLIT_ITEM = 0x10E, CMSG_AUTOEQUIP_ITEM_SLOT = 0x10F, OBSOLETE_DROP_ITEM = 0x110, CMSG_DESTROYITEM = 0x111, SMSG_INVENTORY_CHANGE_FAILURE = 0x112, SMSG_OPEN_CONTAINER = 0x113, CMSG_INSPECT = 0x114, SMSG_INSPECT = 0x115, CMSG_INITIATE_TRADE = 0x116, CMSG_BEGIN_TRADE = 0x117, CMSG_BUSY_TRADE = 0x118, CMSG_IGNORE_TRADE = 0x119, CMSG_ACCEPT_TRADE = 0x11A, CMSG_UNACCEPT_TRADE = 0x11B, CMSG_CANCEL_TRADE = 0x11C, CMSG_SET_TRADE_ITEM = 0x11D, CMSG_CLEAR_TRADE_ITEM = 0x11E, CMSG_SET_TRADE_GOLD = 0x11F, SMSG_TRADE_STATUS = 0x120, SMSG_TRADE_STATUS_EXTENDED = 0x121, SMSG_INITIALIZE_FACTIONS = 0x122, SMSG_SET_FACTION_VISIBLE = 0x123, SMSG_SET_FACTION_STANDING = 0x124, CMSG_SET_FACTION_ATWAR = 0x125, CMSG_SET_FACTION_CHEAT = 0x126, SMSG_SET_PROFICIENCY = 0x127, CMSG_SET_ACTION_BUTTON = 0x128, SMSG_ACTION_BUTTONS = 0x129, SMSG_INITIAL_SPELLS = 0x12A, SMSG_LEARNED_SPELL = 0x12B, SMSG_SUPERCEDED_SPELL = 0x12C, CMSG_NEW_SPELL_SLOT = 0x12D, CMSG_CAST_SPELL = 0x12E, CMSG_CANCEL_CAST = 0x12F, SMSG_CAST_RESULT = 0x130, SMSG_SPELL_START = 0x131, SMSG_SPELL_GO = 0x132, SMSG_SPELL_FAILURE = 0x133, SMSG_SPELL_COOLDOWN = 0x134, SMSG_COOLDOWN_EVENT = 0x135, CMSG_CANCEL_AURA = 0x136, SMSG_UPDATE_AURA_DURATION = 0x137, SMSG_PET_CAST_FAILED = 0x138, MSG_CHANNEL_START = 0x139, MSG_CHANNEL_UPDATE = 0x13A, CMSG_CANCEL_CHANNELLING = 0x13B, SMSG_AI_REACTION = 0x13C, CMSG_SET_SELECTION = 0x13D, CMSG_SET_TARGET_OBSOLETE = 0x13E, CMSG_UNUSED = 0x13F, CMSG_UNUSED2 = 0x140, CMSG_ATTACKSWING = 0x141, CMSG_ATTACKSTOP = 0x142, SMSG_ATTACKSTART = 0x143, SMSG_ATTACKSTOP = 0x144, SMSG_ATTACKSWING_NOTINRANGE = 0x145, SMSG_ATTACKSWING_BADFACING = 0x146, SMSG_ATTACKSWING_NOTSTANDING = 0x147, SMSG_ATTACKSWING_DEADTARGET = 0x148, SMSG_ATTACKSWING_CANT_ATTACK = 0x149, SMSG_ATTACKERSTATEUPDATE = 0x14A, SMSG_VICTIMSTATEUPDATE_OBSOLETE = 0x14B, SMSG_DAMAGE_DONE_OBSOLETE = 0x14C, SMSG_DAMAGE_TAKEN_OBSOLETE = 0x14D, SMSG_CANCEL_COMBAT = 0x14E, SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE = 0x14F, SMSG_SPELLHEALLOG = 0x150, SMSG_SPELLENERGIZELOG = 0x151, CMSG_SHEATHE_OBSOLETE = 0x152, CMSG_SAVE_PLAYER = 0x153, CMSG_SETDEATHBINDPOINT = 0x154, SMSG_BINDPOINTUPDATE = 0x155, CMSG_GETDEATHBINDZONE = 0x156, SMSG_BINDZONEREPLY = 0x157, SMSG_PLAYERBOUND = 0x158, SMSG_CLIENT_CONTROL_UPDATE = 0x159, CMSG_REPOP_REQUEST = 0x15A, SMSG_RESURRECT_REQUEST = 0x15B, CMSG_RESURRECT_RESPONSE = 0x15C, CMSG_LOOT = 0x15D, CMSG_LOOT_MONEY = 0x15E, CMSG_LOOT_RELEASE = 0x15F, SMSG_LOOT_RESPONSE = 0x160, SMSG_LOOT_RELEASE_RESPONSE = 0x161, SMSG_LOOT_REMOVED = 0x162, SMSG_LOOT_MONEY_NOTIFY = 0x163, SMSG_LOOT_ITEM_NOTIFY = 0x164, SMSG_LOOT_CLEAR_MONEY = 0x165, SMSG_ITEM_PUSH_RESULT = 0x166, SMSG_DUEL_REQUESTED = 0x167, SMSG_DUEL_OUTOFBOUNDS = 0x168, SMSG_DUEL_INBOUNDS = 0x169, SMSG_DUEL_COMPLETE = 0x16A, SMSG_DUEL_WINNER = 0x16B, CMSG_DUEL_ACCEPTED = 0x16C, CMSG_DUEL_CANCELLED = 0x16D, SMSG_MOUNTRESULT = 0x16E, SMSG_DISMOUNTRESULT = 0x16F, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x170, CMSG_MOUNTSPECIAL_ANIM = 0x171, SMSG_MOUNTSPECIAL_ANIM = 0x172, SMSG_PET_TAME_FAILURE = 0x173, CMSG_PET_SET_ACTION = 0x174, CMSG_PET_ACTION = 0x175, CMSG_PET_ABANDON = 0x176, CMSG_PET_RENAME = 0x177, SMSG_PET_NAME_INVALID = 0x178, SMSG_PET_SPELLS = 0x179, SMSG_PET_MODE = 0x17A, CMSG_GOSSIP_HELLO = 0x17B, CMSG_GOSSIP_SELECT_OPTION = 0x17C, SMSG_GOSSIP_MESSAGE = 0x17D, SMSG_GOSSIP_COMPLETE = 0x17E, CMSG_NPC_TEXT_QUERY = 0x17F, SMSG_NPC_TEXT_UPDATE = 0x180, SMSG_NPC_WONT_TALK = 0x181, CMSG_QUESTGIVER_STATUS_QUERY = 0x182, SMSG_QUESTGIVER_STATUS = 0x183, CMSG_QUESTGIVER_HELLO = 0x184, SMSG_QUESTGIVER_QUEST_LIST = 0x185, CMSG_QUESTGIVER_QUERY_QUEST = 0x186, CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x187, SMSG_QUESTGIVER_QUEST_DETAILS = 0x188, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x189, CMSG_QUESTGIVER_COMPLETE_QUEST = 0x18A, SMSG_QUESTGIVER_REQUEST_ITEMS = 0x18B, CMSG_QUESTGIVER_REQUEST_REWARD = 0x18C, SMSG_QUESTGIVER_OFFER_REWARD = 0x18D, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18E, SMSG_QUESTGIVER_QUEST_INVALID = 0x18F, CMSG_QUESTGIVER_CANCEL = 0x190, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x191, SMSG_QUESTGIVER_QUEST_FAILED = 0x192, CMSG_QUESTLOG_SWAP_QUEST = 0x193, CMSG_QUESTLOG_REMOVE_QUEST = 0x194, SMSG_QUESTLOG_FULL = 0x195, SMSG_QUESTUPDATE_FAILED = 0x196, SMSG_QUESTUPDATE_FAILEDTIMER = 0x197, SMSG_QUESTUPDATE_COMPLETE = 0x198, SMSG_QUESTUPDATE_ADD_KILL = 0x199, SMSG_QUESTUPDATE_ADD_ITEM = 0x19A, CMSG_QUEST_CONFIRM_ACCEPT = 0x19B, SMSG_QUEST_CONFIRM_ACCEPT = 0x19C, CMSG_PUSHQUESTTOPARTY = 0x19D, CMSG_LIST_INVENTORY = 0x19E, SMSG_LIST_INVENTORY = 0x19F, CMSG_SELL_ITEM = 0x1A0, SMSG_SELL_ITEM = 0x1A1, CMSG_BUY_ITEM = 0x1A2, CMSG_BUY_ITEM_IN_SLOT = 0x1A3, SMSG_BUY_ITEM = 0x1A4, SMSG_BUY_FAILED = 0x1A5, CMSG_TAXICLEARALLNODES = 0x1A6, CMSG_TAXIENABLEALLNODES = 0x1A7, CMSG_TAXISHOWNODES = 0x1A8, SMSG_SHOWTAXINODES = 0x1A9, CMSG_TAXINODE_STATUS_QUERY = 0x1AA, SMSG_TAXINODE_STATUS = 0x1AB, CMSG_TAXIQUERYAVAILABLENODES = 0x1AC, CMSG_ACTIVATETAXI = 0x1AD, SMSG_ACTIVATETAXIREPLY = 0x1AE, SMSG_NEW_TAXI_PATH = 0x1AF, CMSG_TRAINER_LIST = 0x1B0, SMSG_TRAINER_LIST = 0x1B1, CMSG_TRAINER_BUY_SPELL = 0x1B2, SMSG_TRAINER_BUY_SUCCEEDED = 0x1B3, SMSG_TRAINER_BUY_FAILED = 0x1B4, CMSG_BINDER_ACTIVATE = 0x1B5, SMSG_PLAYERBINDERROR = 0x1B6, CMSG_BANKER_ACTIVATE = 0x1B7, SMSG_SHOW_BANK = 0x1B8, CMSG_BUY_BANK_SLOT = 0x1B9, SMSG_BUY_BANK_SLOT_RESULT = 0x1BA, CMSG_PETITION_SHOWLIST = 0x1BB, SMSG_PETITION_SHOWLIST = 0x1BC, CMSG_PETITION_BUY = 0x1BD, CMSG_PETITION_SHOW_SIGNATURES = 0x1BE, SMSG_PETITION_SHOW_SIGNATURES = 0x1BF, CMSG_PETITION_SIGN = 0x1C0, SMSG_PETITION_SIGN_RESULTS = 0x1C1, MSG_PETITION_DECLINE = 0x1C2, CMSG_OFFER_PETITION = 0x1C3, CMSG_TURN_IN_PETITION = 0x1C4, SMSG_TURN_IN_PETITION_RESULTS = 0x1C5, CMSG_PETITION_QUERY = 0x1C6, SMSG_PETITION_QUERY_RESPONSE = 0x1C7, SMSG_FISH_NOT_HOOKED = 0x1C8, SMSG_FISH_ESCAPED = 0x1C9, CMSG_BUG = 0x1CA, SMSG_NOTIFICATION = 0x1CB, CMSG_PLAYED_TIME = 0x1CC, SMSG_PLAYED_TIME = 0x1CD, CMSG_QUERY_TIME = 0x1CE, SMSG_QUERY_TIME_RESPONSE = 0x1CF, SMSG_LOG_XPGAIN = 0x1D0, SMSG_AURACASTLOG = 0x1D1, CMSG_RECLAIM_CORPSE = 0x1D2, CMSG_WRAP_ITEM = 0x1D3, SMSG_LEVELUP_INFO = 0x1D4, MSG_MINIMAP_PING = 0x1D5, SMSG_RESISTLOG = 0x1D6, SMSG_ENCHANTMENTLOG = 0x1D7, CMSG_SET_SKILL_CHEAT = 0x1D8, SMSG_START_MIRROR_TIMER = 0x1D9, SMSG_PAUSE_MIRROR_TIMER = 0x1DA, SMSG_STOP_MIRROR_TIMER = 0x1DB, CMSG_PING = 0x1DC, SMSG_PONG = 0x1DD, SMSG_CLEAR_COOLDOWN = 0x1DE, SMSG_GAMEOBJECT_PAGETEXT = 0x1DF, CMSG_SETSHEATHED = 0x1E0, SMSG_COOLDOWN_CHEAT = 0x1E1, SMSG_SPELL_DELAYED = 0x1E2, CMSG_PLAYER_MACRO_OBSOLETE = 0x1E3, SMSG_PLAYER_MACRO_OBSOLETE = 0x1E4, CMSG_GHOST = 0x1E5, CMSG_GM_INVIS = 0x1E6, SMSG_INVALID_PROMOTION_CODE = 0x1E7, MSG_GM_BIND_OTHER = 0x1E8, MSG_GM_SUMMON = 0x1E9, SMSG_ITEM_TIME_UPDATE = 0x1EA, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x1EB, SMSG_AUTH_CHALLENGE = 0x1EC, CMSG_AUTH_SESSION = 0x1ED, SMSG_AUTH_RESPONSE = 0x1EE, MSG_GM_SHOWLABEL = 0x1EF, CMSG_PET_CAST_SPELL = 0x1F0, MSG_SAVE_GUILD_EMBLEM = 0x1F1, MSG_TABARDVENDOR_ACTIVATE = 0x1F2, SMSG_PLAY_SPELL_VISUAL = 0x1F3, CMSG_ZONEUPDATE = 0x1F4, SMSG_PARTYKILLLOG = 0x1F5, SMSG_COMPRESSED_UPDATE_OBJECT = 0x1F6, SMSG_PLAY_SPELL_IMPACT = 0x1F7, SMSG_EXPLORATION_EXPERIENCE = 0x1F8, CMSG_GM_SET_SECURITY_GROUP = 0x1F9, CMSG_GM_NUKE = 0x1FA, MSG_RANDOM_ROLL = 0x1FB, SMSG_ENVIRONMENTAL_DAMAGE_LOG = 0x1FC, CMSG_RWHOIS_OBSOLETE = 0x1FD, SMSG_RWHOIS = 0x1FE, MSG_LOOKING_FOR_GROUP = 0x1FF, CMSG_SET_LOOKING_FOR_GROUP = 0x200, CMSG_UNLEARN_SPELL = 0x201, CMSG_UNLEARN_SKILL = 0x202, SMSG_REMOVED_SPELL = 0x203, CMSG_DECHARGE = 0x204, CMSG_GMTICKET_CREATE = 0x205, SMSG_GMTICKET_CREATE = 0x206, CMSG_GMTICKET_UPDATETEXT = 0x207, SMSG_GMTICKET_UPDATETEXT = 0x208, SMSG_ACCOUNT_DATA_TIMES = 0x209, CMSG_REQUEST_ACCOUNT_DATA = 0x20A, CMSG_UPDATE_ACCOUNT_DATA = 0x20B, SMSG_UPDATE_ACCOUNT_DATA = 0x20C, SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x20D, SMSG_POWERGAINLOG_OBSOLETE = 0x20E, CMSG_GM_TEACH = 0x20F, CMSG_GM_CREATE_ITEM_TARGET = 0x210, CMSG_GMTICKET_GETTICKET = 0x211, SMSG_GMTICKET_GETTICKET = 0x212, CMSG_UNLEARN_TALENTS = 0x213, SMSG_GAMEOBJECT_SPAWN_ANIM = 0x214, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x215, MSG_CORPSE_QUERY = 0x216, CMSG_GMTICKET_DELETETICKET = 0x217, SMSG_GMTICKET_DELETETICKET = 0x218, SMSG_CHAT_WRONG_FACTION = 0x219, CMSG_GMTICKET_SYSTEMSTATUS = 0x21A, SMSG_GMTICKET_SYSTEMSTATUS = 0x21B, CMSG_SPIRIT_HEALER_ACTIVATE = 0x21C, CMSG_SET_STAT_CHEAT = 0x21D, SMSG_SET_REST_START = 0x21E, CMSG_SKILL_BUY_STEP = 0x21F, CMSG_SKILL_BUY_RANK = 0x220, CMSG_XP_CHEAT = 0x221, SMSG_SPIRIT_HEALER_CONFIRM = 0x222, CMSG_CHARACTER_POINT_CHEAT = 0x223, SMSG_GOSSIP_POI = 0x224, CMSG_CHAT_IGNORED = 0x225, CMSG_GM_VISION = 0x226, CMSG_SERVER_COMMAND = 0x227, CMSG_GM_SILENCE = 0x228, CMSG_GM_REVEALTO = 0x229, CMSG_GM_RESURRECT = 0x22A, CMSG_GM_SUMMONMOB = 0x22B, CMSG_GM_MOVECORPSE = 0x22C, CMSG_GM_FREEZE = 0x22D, CMSG_GM_UBERINVIS = 0x22E, CMSG_GM_REQUEST_PLAYER_INFO = 0x22F, SMSG_GM_PLAYER_INFO = 0x230, CMSG_GUILD_RANK = 0x231, CMSG_GUILD_ADD_RANK = 0x232, CMSG_GUILD_DEL_RANK = 0x233, CMSG_GUILD_SET_PUBLIC_NOTE = 0x234, CMSG_GUILD_SET_OFFICER_NOTE = 0x235, SMSG_LOGIN_VERIFY_WORLD = 0x236, CMSG_CLEAR_EXPLORATION = 0x237, CMSG_SEND_MAIL = 0x238, SMSG_SEND_MAIL_RESULT = 0x239, CMSG_GET_MAIL_LIST = 0x23A, SMSG_MAIL_LIST_RESULT = 0x23B, CMSG_BATTLEFIELD_LIST = 0x23C, SMSG_BATTLEFIELD_LIST = 0x23D, CMSG_BATTLEFIELD_JOIN = 0x23E, SMSG_BATTLEFIELD_WIN_OBSOLETE = 0x23F, SMSG_BATTLEFIELD_LOSE_OBSOLETE = 0x240, CMSG_TAXICLEARNODE = 0x241, CMSG_TAXIENABLENODE = 0x242, CMSG_ITEM_TEXT_QUERY = 0x243, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x244, CMSG_MAIL_TAKE_MONEY = 0x245, CMSG_MAIL_TAKE_ITEM = 0x246, CMSG_MAIL_MARK_AS_READ = 0x247, CMSG_MAIL_RETURN_TO_SENDER = 0x248, CMSG_MAIL_DELETE = 0x249, CMSG_MAIL_CREATE_TEXT_ITEM = 0x24A, SMSG_SPELLLOGMISS = 0x24B, SMSG_SPELLLOGEXECUTE = 0x24C, SMSG_DEBUGAURAPROC = 0x24D, SMSG_PERIODICAURALOG = 0x24E, SMSG_SPELLDAMAGESHIELD = 0x24F, SMSG_SPELLNONMELEEDAMAGELOG = 0x250, CMSG_LEARN_TALENT = 0x251, SMSG_RESURRECT_FAILED = 0x252, CMSG_TOGGLE_PVP = 0x253, SMSG_ZONE_UNDER_ATTACK = 0x254, MSG_AUCTION_HELLO = 0x255, CMSG_AUCTION_SELL_ITEM = 0x256, CMSG_AUCTION_REMOVE_ITEM = 0x257, CMSG_AUCTION_LIST_ITEMS = 0x258, CMSG_AUCTION_LIST_OWNER_ITEMS = 0x259, CMSG_AUCTION_PLACE_BID = 0x25A, SMSG_AUCTION_COMMAND_RESULT = 0x25B, SMSG_AUCTION_LIST_RESULT = 0x25C, SMSG_AUCTION_OWNER_LIST_RESULT = 0x25D, SMSG_AUCTION_BIDDER_NOTIFICATION = 0x25E, SMSG_AUCTION_OWNER_NOTIFICATION = 0x25F, SMSG_PROCRESIST = 0x260, SMSG_STANDSTATE_CHANGE_FAILURE_OBSOLETE = 0x261, SMSG_DISPEL_FAILED = 0x262, SMSG_SPELLORDAMAGE_IMMUNE = 0x263, CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x264, SMSG_AUCTION_BIDDER_LIST_RESULT = 0x265, SMSG_SET_FLAT_SPELL_MODIFIER = 0x266, SMSG_SET_PCT_SPELL_MODIFIER = 0x267, CMSG_SET_AMMO = 0x268, SMSG_CORPSE_RECLAIM_DELAY = 0x269, CMSG_SET_ACTIVE_MOVER = 0x26A, CMSG_PET_CANCEL_AURA = 0x26B, CMSG_PLAYER_AI_CHEAT = 0x26C, CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x26D, MSG_GM_ACCOUNT_ONLINE = 0x26E, MSG_LIST_STABLED_PETS = 0x26F, CMSG_STABLE_PET = 0x270, CMSG_UNSTABLE_PET = 0x271, CMSG_BUY_STABLE_SLOT = 0x272, SMSG_STABLE_RESULT = 0x273, CMSG_STABLE_REVIVE_PET = 0x274, CMSG_STABLE_SWAP_PET = 0x275, MSG_QUEST_PUSH_RESULT = 0x276, SMSG_PLAY_MUSIC = 0x277, SMSG_PLAY_OBJECT_SOUND = 0x278, CMSG_REQUEST_PET_INFO = 0x279, CMSG_FAR_SIGHT = 0x27A, SMSG_SPELLDISPELLOG = 0x27B, SMSG_DAMAGE_CALC_LOG = 0x27C, CMSG_ENABLE_DAMAGE_LOG = 0x27D, CMSG_GROUP_CHANGE_SUB_GROUP = 0x27E, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x27F, CMSG_GROUP_SWAP_SUB_GROUP = 0x280, CMSG_RESET_FACTION_CHEAT = 0x281, CMSG_AUTOSTORE_BANK_ITEM = 0x282, CMSG_AUTOBANK_ITEM = 0x283, MSG_QUERY_NEXT_MAIL_TIME = 0x284, SMSG_RECEIVED_MAIL = 0x285, SMSG_RAID_GROUP_ONLY = 0x286, CMSG_SET_DURABILITY_CHEAT = 0x287, CMSG_SET_PVP_RANK_CHEAT = 0x288, CMSG_ADD_PVP_MEDAL_CHEAT = 0x289, CMSG_DEL_PVP_MEDAL_CHEAT = 0x28A, CMSG_SET_PVP_TITLE = 0x28B, SMSG_PVP_CREDIT = 0x28C, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x28D, CMSG_GROUP_RAID_CONVERT = 0x28E, CMSG_GROUP_ASSISTANT_LEADER = 0x28F, CMSG_BUYBACK_ITEM = 0x290, SMSG_SERVER_MESSAGE = 0x291, CMSG_MEETINGSTONE_JOIN = 0x292, CMSG_MEETINGSTONE_LEAVE = 0x293, CMSG_MEETINGSTONE_CHEAT = 0x294, SMSG_MEETINGSTONE_SETQUEUE = 0x295, CMSG_MEETINGSTONE_INFO = 0x296, SMSG_MEETINGSTONE_COMPLETE = 0x297, SMSG_MEETINGSTONE_IN_PROGRESS = 0x298, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x299, CMSG_GMTICKETSYSTEM_TOGGLE = 0x29A, CMSG_CANCEL_GROWTH_AURA = 0x29B, SMSG_CANCEL_AUTO_REPEAT = 0x29C, SMSG_STANDSTATE_UPDATE = 0x29D, SMSG_LOOT_ALL_PASSED = 0x29E, SMSG_LOOT_ROLL_WON = 0x29F, CMSG_LOOT_ROLL = 0x2A0, SMSG_LOOT_START_ROLL = 0x2A1, SMSG_LOOT_ROLL = 0x2A2, CMSG_LOOT_MASTER_GIVE = 0x2A3, SMSG_LOOT_MASTER_LIST = 0x2A4, SMSG_SET_FORCED_REACTIONS = 0x2A5, SMSG_SPELL_FAILED_OTHER = 0x2A6, SMSG_GAMEOBJECT_RESET_STATE = 0x2A7, CMSG_REPAIR_ITEM = 0x2A8, SMSG_CHAT_PLAYER_NOT_FOUND = 0x2A9, MSG_TALENT_WIPE_CONFIRM = 0x2AA, SMSG_SUMMON_REQUEST = 0x2AB, CMSG_SUMMON_RESPONSE = 0x2AC, MSG_MOVE_TOGGLE_GRAVITY_CHEAT = 0x2AD, SMSG_MONSTER_MOVE_TRANSPORT = 0x2AE, SMSG_PET_BROKEN = 0x2AF, MSG_MOVE_FEATHER_FALL = 0x2B0, MSG_MOVE_WATER_WALK = 0x2B1, CMSG_SERVER_BROADCAST = 0x2B2, CMSG_SELF_RES = 0x2B3, SMSG_FEIGN_DEATH_RESISTED = 0x2B4, CMSG_RUN_SCRIPT = 0x2B5, SMSG_SCRIPT_MESSAGE = 0x2B6, SMSG_DUEL_COUNTDOWN = 0x2B7, SMSG_AREA_TRIGGER_MESSAGE = 0x2B8, CMSG_TOGGLE_HELM = 0x2B9, CMSG_TOGGLE_CLOAK = 0x2BA, SMSG_MEETINGSTONE_JOINFAILED = 0x2BB, SMSG_PLAYER_SKINNED = 0x2BC, SMSG_DURABILITY_DAMAGE_DEATH = 0x2BD, CMSG_SET_EXPLORATION = 0x2BE, CMSG_SET_ACTIONBAR_TOGGLES = 0x2BF, UMSG_DELETE_GUILD_CHARTER = 0x2C0, MSG_PETITION_RENAME = 0x2C1, SMSG_INIT_WORLD_STATES = 0x2C2, SMSG_UPDATE_WORLD_STATE = 0x2C3, CMSG_ITEM_NAME_QUERY = 0x2C4, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x2C5, SMSG_PET_ACTION_FEEDBACK = 0x2C6, CMSG_CHAR_RENAME = 0x2C7, SMSG_CHAR_RENAME = 0x2C8, CMSG_MOVE_SPLINE_DONE = 0x2C9, CMSG_MOVE_FALL_RESET = 0x2CA, SMSG_INSTANCE_SAVE_CREATED = 0x2CB, SMSG_RAID_INSTANCE_INFO = 0x2CC, CMSG_REQUEST_RAID_INFO = 0x2CD, CMSG_MOVE_TIME_SKIPPED = 0x2CE, CMSG_MOVE_FEATHER_FALL_ACK = 0x2CF, CMSG_MOVE_WATER_WALK_ACK = 0x2D0, CMSG_MOVE_NOT_ACTIVE_MOVER = 0x2D1, SMSG_PLAY_SOUND = 0x2D2, CMSG_BATTLEFIELD_STATUS = 0x2D3, SMSG_BATTLEFIELD_STATUS = 0x2D4, CMSG_BATTLEFIELD_PORT = 0x2D5, MSG_INSPECT_HONOR_STATS = 0x2D6, CMSG_BATTLEMASTER_HELLO = 0x2D7, CMSG_MOVE_START_SWIM_CHEAT = 0x2D8, CMSG_MOVE_STOP_SWIM_CHEAT = 0x2D9, SMSG_FORCE_WALK_SPEED_CHANGE = 0x2DA, CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x2DB, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x2DC, CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x2DD, SMSG_FORCE_TURN_RATE_CHANGE = 0x2DE, CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x2DF, MSG_PVP_LOG_DATA = 0x2E0, CMSG_LEAVE_BATTLEFIELD = 0x2E1, CMSG_AREA_SPIRIT_HEALER_QUERY = 0x2E2, CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x2E3, SMSG_AREA_SPIRIT_HEALER_TIME = 0x2E4, CMSG_GM_UNTEACH = 0x2E5, SMSG_WARDEN_DATA = 0x2E6, CMSG_WARDEN_DATA = 0x2E7, SMSG_GROUP_JOINED_BATTLEGROUND = 0x2E8, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x2E9, CMSG_PET_STOP_ATTACK = 0x2EA, SMSG_BINDER_CONFIRM = 0x2EB, SMSG_BATTLEGROUND_PLAYER_JOINED = 0x2EC, SMSG_BATTLEGROUND_PLAYER_LEFT = 0x2ED, CMSG_BATTLEMASTER_JOIN = 0x2EE, SMSG_ADDON_INFO = 0x2EF, CMSG_PET_UNLEARN = 0x2F0, SMSG_PET_UNLEARN_CONFIRM = 0x2F1, SMSG_PARTY_MEMBER_STATS_FULL = 0x2F2, CMSG_PET_SPELL_AUTOCAST = 0x2F3, SMSG_WEATHER = 0x2F4, SMSG_PLAY_TIME_WARNING = 0x2F5, SMSG_MINIGAME_SETUP = 0x2F6, SMSG_MINIGAME_STATE = 0x2F7, CMSG_MINIGAME_MOVE = 0x2F8, SMSG_MINIGAME_MOVE_FAILED = 0x2F9, SMSG_RAID_INSTANCE_MESSAGE = 0x2FA, SMSG_COMPRESSED_MOVES = 0x2FB, CMSG_GUILD_INFO_TEXT = 0x2FC, SMSG_CHAT_RESTRICTED = 0x2FD, SMSG_SPLINE_SET_RUN_SPEED = 0x2FE, SMSG_SPLINE_SET_RUN_BACK_SPEED = 0x2FF, SMSG_SPLINE_SET_SWIM_SPEED = 0x300, SMSG_SPLINE_SET_WALK_SPEED = 0x301, SMSG_SPLINE_SET_SWIM_BACK_SPEED = 0x302, SMSG_SPLINE_SET_TURN_RATE = 0x303, SMSG_SPLINE_MOVE_UNROOT = 0x304, SMSG_SPLINE_MOVE_FEATHER_FALL = 0x305, SMSG_SPLINE_MOVE_NORMAL_FALL = 0x306, SMSG_SPLINE_MOVE_SET_HOVER = 0x307, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x308, SMSG_SPLINE_MOVE_WATER_WALK = 0x309, SMSG_SPLINE_MOVE_LAND_WALK = 0x30A, SMSG_SPLINE_MOVE_START_SWIM = 0x30B, SMSG_SPLINE_MOVE_STOP_SWIM = 0x30C, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x30D, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x30E, CMSG_GM_NUKE_ACCOUNT = 0x30F, MSG_GM_DESTROY_CORPSE = 0x310, CMSG_GM_DESTROY_ONLINE_CORPSE = 0x311, CMSG_ACTIVATETAXIEXPRESS = 0x312, SMSG_SET_FACTION_ATWAR = 0x313, SMSG_GAMETIMEBIAS_SET = 0x314, CMSG_DEBUG_ACTIONS_START = 0x315, CMSG_DEBUG_ACTIONS_STOP = 0x316, CMSG_SET_FACTION_INACTIVE = 0x317, CMSG_SET_WATCHED_FACTION = 0x318, MSG_MOVE_TIME_SKIPPED = 0x319, SMSG_SPLINE_MOVE_ROOT = 0x31A, CMSG_SET_EXPLORATION_ALL = 0x31B, SMSG_INVALIDATE_PLAYER = 0x31C, CMSG_RESET_INSTANCES = 0x31D, SMSG_INSTANCE_RESET = 0x31E, SMSG_INSTANCE_RESET_FAILED = 0x31F, SMSG_UPDATE_LAST_INSTANCE = 0x320, MSG_RAID_TARGET_UPDATE = 0x321, MSG_RAID_READY_CHECK = 0x322, CMSG_LUA_USAGE = 0x323, SMSG_PET_ACTION_SOUND = 0x324, SMSG_PET_DISMISS_SOUND = 0x325, SMSG_GHOSTEE_GONE = 0x326, CMSG_GM_UPDATE_TICKET_STATUS = 0x327, SMSG_GM_TICKET_STATUS_UPDATE = 0x328, CMSG_GMSURVEY_SUBMIT = 0x32A, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x32B, CMSG_IGNORE_KNOCKBACK_CHEAT = 0x32C, SMSG_CHAT_PLAYER_AMBIGUOUS = 0x32D, MSG_DELAY_GHOST_TELEPORT = 0x32E, SMSG_SPELLINSTAKILLLOG = 0x32F, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x330, CMSG_CHAT_FILTERED = 0x331, SMSG_EXPECTED_SPAM_RECORDS = 0x332, SMSG_SPELLSTEALLOG = 0x333, CMSG_LOTTERY_QUERY_OBSOLETE = 0x334, SMSG_LOTTERY_QUERY_RESULT_OBSOLETE = 0x335, CMSG_BUY_LOTTERY_TICKET_OBSOLETE = 0x336, SMSG_LOTTERY_RESULT_OBSOLETE = 0x337, SMSG_CHARACTER_PROFILE = 0x338, SMSG_CHARACTER_PROFILE_REALM_CONNECTED = 0x339, SMSG_DEFENSE_MESSAGE = 0x33A, MSG_GM_RESETINSTANCELIMIT = 0x33C, SMSG_MOTD = 0x33D, SMSG_MOVE_SET_FLIGHT = 0x33E, SMSG_MOVE_UNSET_FLIGHT = 0x33F, CMSG_MOVE_FLIGHT_ACK = 0x340, MSG_MOVE_START_SWIM_CHEAT = 0x341, MSG_MOVE_STOP_SWIM_CHEAT = 0x342, CMSG_CANCEL_MOUNT_AURA = 0x375, CMSG_CANCEL_TEMP_ENCHANTMENT = 0x379, CMSG_MAELSTROM_INVALIDATE_CACHE = 0x387, CMSG_SET_TAXI_BENCHMARK_MODE = 0x389, CMSG_MOVE_CHNG_TRANSPORT = 0x38D, MSG_PARTY_ASSIGNMENT = 0x38E, SMSG_OFFER_PETITION_ERROR = 0x38F, SMSG_RESET_FAILED_NOTIFY = 0x396, SMSG_REAL_GROUP_UPDATE = 0x397, SMSG_INIT_EXTRA_AURA_INFO = 0x3A3, SMSG_SET_EXTRA_AURA_INFO = 0x3A4, SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE = 0x3A5, SMSG_SPELL_CHANCE_PROC_LOG = 0x3AA, CMSG_MOVE_SET_RUN_SPEED = 0x3AB, SMSG_DISMOUNT = 0x3AC, MSG_RAID_READY_CHECK_CONFIRM = 0x3AE, SMSG_CLEAR_TARGET = 0x3BE, CMSG_BOT_DETECTED = 0x3BF, SMSG_KICK_REASON = 0x3C4, MSG_RAID_READY_CHECK_FINISHED = 0x3C5, CMSG_TARGET_CAST = 0x3CF, CMSG_TARGET_SCRIPT_CAST = 0x3D0, CMSG_CHANNEL_DISPLAY_LIST = 0x3D1, CMSG_GET_CHANNEL_MEMBER_COUNT = 0x3D3, SMSG_CHANNEL_MEMBER_COUNT = 0x3D4, CMSG_DEBUG_LIST_TARGETS = 0x3D7, SMSG_DEBUG_LIST_TARGETS = 0x3D8, CMSG_PARTY_SILENCE = 0x3DC, CMSG_PARTY_UNSILENCE = 0x3DD, MSG_NOTIFY_PARTY_SQUELCH = 0x3DE, SMSG_COMSAT_RECONNECT_TRY = 0x3DF, SMSG_COMSAT_DISCONNECT = 0x3E0, SMSG_COMSAT_CONNECT_FAIL = 0x3E1, CMSG_SET_CHANNEL_WATCH = 0x3EE, SMSG_USERLIST_ADD = 0x3EF, SMSG_USERLIST_REMOVE = 0x3F0, SMSG_USERLIST_UPDATE = 0x3F1, CMSG_CLEAR_CHANNEL_WATCH = 0x3F2, SMSG_GOGOGO_OBSOLETE = 0x3F4, SMSG_ECHO_PARTY_SQUELCH = 0x3F5, CMSG_SPELLCLICK = 0x3F7, SMSG_LOOT_LIST = 0x3F8, MSG_GUILD_PERMISSIONS = 0x3FC, MSG_GUILD_EVENT_LOG_QUERY = 0x3FE, CMSG_MAELSTROM_RENAME_GUILD = 0x3FF, CMSG_GET_MIRRORIMAGE_DATA = 0x400, SMSG_MIRRORIMAGE_DATA = 0x401, SMSG_FORCE_DISPLAY_UPDATE = 0x402, SMSG_SPELL_CHANCE_RESIST_PUSHBACK = 0x403, CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x404, SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x405, CMSG_KEEP_ALIVE = 0x406, SMSG_RAID_READY_CHECK_ERROR = 0x407, CMSG_OPT_OUT_OF_LOOT = 0x408, CMSG_SET_GRANTABLE_LEVELS = 0x40B, CMSG_GRANT_LEVEL = 0x40C, CMSG_DECLINE_CHANNEL_INVITE = 0x40F, CMSG_GROUPACTION_THROTTLED = 0x410, SMSG_OVERRIDE_LIGHT = 0x411, SMSG_TOTEM_CREATED = 0x412, CMSG_TOTEM_DESTROYED = 0x413, CMSG_EXPIRE_RAID_INSTANCE = 0x414, CMSG_NO_SPELL_VARIANCE = 0x415, CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x416, SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x417, CMSG_QUERY_SERVER_BUCK_DATA = 0x41A, CMSG_CLEAR_SERVER_BUCK_DATA = 0x41B, SMSG_SERVER_BUCK_DATA = 0x41C, SMSG_SEND_UNLEARN_SPELLS = 0x41D, SMSG_PROPOSE_LEVEL_GRANT = 0x41E, CMSG_ACCEPT_LEVEL_GRANT = 0x41F, SMSG_REFER_A_FRIEND_FAILURE = 0x420, SMSG_SUMMON_CANCEL = 0x423 } world_packets; static const value_string world_packet_strings[] = { { MSG_NULL_ACTION, "MSG_NULL_ACTION" }, { CMSG_BOOTME, "CMSG_BOOTME" }, { CMSG_DBLOOKUP, "CMSG_DBLOOKUP" }, { SMSG_DBLOOKUP, "SMSG_DBLOOKUP" }, { CMSG_QUERY_OBJECT_POSITION, "CMSG_QUERY_OBJECT_POSITION" }, { SMSG_QUERY_OBJECT_POSITION, "SMSG_QUERY_OBJECT_POSITION" }, { CMSG_QUERY_OBJECT_ROTATION, "CMSG_QUERY_OBJECT_ROTATION" }, { SMSG_QUERY_OBJECT_ROTATION, "SMSG_QUERY_OBJECT_ROTATION" }, { CMSG_WORLD_TELEPORT, "CMSG_WORLD_TELEPORT" }, { CMSG_TELEPORT_TO_UNIT, "CMSG_TELEPORT_TO_UNIT" }, { CMSG_ZONE_MAP, "CMSG_ZONE_MAP" }, { SMSG_ZONE_MAP, "SMSG_ZONE_MAP" }, { CMSG_DEBUG_CHANGECELLZONE, "CMSG_DEBUG_CHANGECELLZONE" }, { CMSG_EMBLAZON_TABARD_OBSOLETE, "CMSG_EMBLAZON_TABARD_OBSOLETE" }, { CMSG_UNEMBLAZON_TABARD_OBSOLETE, "CMSG_UNEMBLAZON_TABARD_OBSOLETE" }, { CMSG_RECHARGE, "CMSG_RECHARGE" }, { CMSG_LEARN_SPELL, "CMSG_LEARN_SPELL" }, { CMSG_CREATEMONSTER, "CMSG_CREATEMONSTER" }, { CMSG_DESTROYMONSTER, "CMSG_DESTROYMONSTER" }, { CMSG_CREATEITEM, "CMSG_CREATEITEM" }, { CMSG_CREATEGAMEOBJECT, "CMSG_CREATEGAMEOBJECT" }, { SMSG_CHECK_FOR_BOTS, "SMSG_CHECK_FOR_BOTS" }, { CMSG_MAKEMONSTERATTACKGUID, "CMSG_MAKEMONSTERATTACKGUID" }, { CMSG_BOT_DETECTED2, "CMSG_BOT_DETECTED2" }, { CMSG_FORCEACTION, "CMSG_FORCEACTION" }, { CMSG_FORCEACTIONONOTHER, "CMSG_FORCEACTIONONOTHER" }, { CMSG_FORCEACTIONSHOW, "CMSG_FORCEACTIONSHOW" }, { SMSG_FORCEACTIONSHOW, "SMSG_FORCEACTIONSHOW" }, { CMSG_PETGODMODE, "CMSG_PETGODMODE" }, { SMSG_PETGODMODE, "SMSG_PETGODMODE" }, { SMSG_DEBUGINFOSPELLMISS_OBSOLETE, "SMSG_DEBUGINFOSPELLMISS_OBSOLETE" }, { CMSG_WEATHER_SPEED_CHEAT, "CMSG_WEATHER_SPEED_CHEAT" }, { CMSG_UNDRESSPLAYER, "CMSG_UNDRESSPLAYER" }, { CMSG_BEASTMASTER, "CMSG_BEASTMASTER" }, { CMSG_GODMODE, "CMSG_GODMODE" }, { SMSG_GODMODE, "SMSG_GODMODE" }, { CMSG_CHEAT_SETMONEY, "CMSG_CHEAT_SETMONEY" }, { CMSG_LEVEL_CHEAT, "CMSG_LEVEL_CHEAT" }, { CMSG_PET_LEVEL_CHEAT, "CMSG_PET_LEVEL_CHEAT" }, { CMSG_SET_WORLDSTATE, "CMSG_SET_WORLDSTATE" }, { CMSG_COOLDOWN_CHEAT, "CMSG_COOLDOWN_CHEAT" }, { CMSG_USE_SKILL_CHEAT, "CMSG_USE_SKILL_CHEAT" }, { CMSG_FLAG_QUEST, "CMSG_FLAG_QUEST" }, { CMSG_FLAG_QUEST_FINISH, "CMSG_FLAG_QUEST_FINISH" }, { CMSG_CLEAR_QUEST, "CMSG_CLEAR_QUEST" }, { CMSG_SEND_EVENT, "CMSG_SEND_EVENT" }, { CMSG_DEBUG_AISTATE, "CMSG_DEBUG_AISTATE" }, { SMSG_DEBUG_AISTATE, "SMSG_DEBUG_AISTATE" }, { CMSG_DISABLE_PVP_CHEAT, "CMSG_DISABLE_PVP_CHEAT" }, { CMSG_ADVANCE_SPAWN_TIME, "CMSG_ADVANCE_SPAWN_TIME" }, { CMSG_PVP_PORT_OBSOLETE, "CMSG_PVP_PORT_OBSOLETE" }, { CMSG_AUTH_SRP6_BEGIN, "CMSG_AUTH_SRP6_BEGIN" }, { CMSG_AUTH_SRP6_PROOF, "CMSG_AUTH_SRP6_PROOF" }, { CMSG_AUTH_SRP6_RECODE, "CMSG_AUTH_SRP6_RECODE" }, { CMSG_CHAR_CREATE, "CMSG_CHAR_CREATE" }, { CMSG_CHAR_ENUM, "CMSG_CHAR_ENUM" }, { CMSG_CHAR_DELETE, "CMSG_CHAR_DELETE" }, { SMSG_AUTH_SRP6_RESPONSE, "SMSG_AUTH_SRP6_RESPONSE" }, { SMSG_CHAR_CREATE, "SMSG_CHAR_CREATE" }, { SMSG_CHAR_ENUM, "SMSG_CHAR_ENUM" }, { SMSG_CHAR_DELETE, "SMSG_CHAR_DELETE" }, { CMSG_PLAYER_LOGIN, "CMSG_PLAYER_LOGIN" }, { SMSG_NEW_WORLD, "SMSG_NEW_WORLD" }, { SMSG_TRANSFER_PENDING, "SMSG_TRANSFER_PENDING" }, { SMSG_TRANSFER_ABORTED, "SMSG_TRANSFER_ABORTED" }, { SMSG_CHARACTER_LOGIN_FAILED, "SMSG_CHARACTER_LOGIN_FAILED" }, { SMSG_LOGIN_SETTIMESPEED, "SMSG_LOGIN_SETTIMESPEED" }, { SMSG_GAMETIME_UPDATE, "SMSG_GAMETIME_UPDATE" }, { CMSG_GAMETIME_SET, "CMSG_GAMETIME_SET" }, { SMSG_GAMETIME_SET, "SMSG_GAMETIME_SET" }, { CMSG_GAMESPEED_SET, "CMSG_GAMESPEED_SET" }, { SMSG_GAMESPEED_SET, "SMSG_GAMESPEED_SET" }, { CMSG_SERVERTIME, "CMSG_SERVERTIME" }, { SMSG_SERVERTIME, "SMSG_SERVERTIME" }, { CMSG_PLAYER_LOGOUT, "CMSG_PLAYER_LOGOUT" }, { CMSG_LOGOUT_REQUEST, "CMSG_LOGOUT_REQUEST" }, { SMSG_LOGOUT_RESPONSE, "SMSG_LOGOUT_RESPONSE" }, { SMSG_LOGOUT_COMPLETE, "SMSG_LOGOUT_COMPLETE" }, { CMSG_LOGOUT_CANCEL, "CMSG_LOGOUT_CANCEL" }, { SMSG_LOGOUT_CANCEL_ACK, "SMSG_LOGOUT_CANCEL_ACK" }, { CMSG_NAME_QUERY, "CMSG_NAME_QUERY" }, { SMSG_NAME_QUERY_RESPONSE, "SMSG_NAME_QUERY_RESPONSE" }, { CMSG_PET_NAME_QUERY, "CMSG_PET_NAME_QUERY" }, { SMSG_PET_NAME_QUERY_RESPONSE, "SMSG_PET_NAME_QUERY_RESPONSE" }, { CMSG_GUILD_QUERY, "CMSG_GUILD_QUERY" }, { SMSG_GUILD_QUERY_RESPONSE, "SMSG_GUILD_QUERY_RESPONSE" }, { CMSG_ITEM_QUERY_SINGLE, "CMSG_ITEM_QUERY_SINGLE" }, { CMSG_ITEM_QUERY_MULTIPLE, "CMSG_ITEM_QUERY_MULTIPLE" }, { SMSG_ITEM_QUERY_SINGLE_RESPONSE, "SMSG_ITEM_QUERY_SINGLE_RESPONSE" }, { SMSG_ITEM_QUERY_MULTIPLE_RESPONSE, "SMSG_ITEM_QUERY_MULTIPLE_RESPONSE" }, { CMSG_PAGE_TEXT_QUERY, "CMSG_PAGE_TEXT_QUERY" }, { SMSG_PAGE_TEXT_QUERY_RESPONSE, "SMSG_PAGE_TEXT_QUERY_RESPONSE" }, { CMSG_QUEST_QUERY, "CMSG_QUEST_QUERY" }, { SMSG_QUEST_QUERY_RESPONSE, "SMSG_QUEST_QUERY_RESPONSE" }, { CMSG_GAMEOBJECT_QUERY, "CMSG_GAMEOBJECT_QUERY" }, { SMSG_GAMEOBJECT_QUERY_RESPONSE, "SMSG_GAMEOBJECT_QUERY_RESPONSE" }, { CMSG_CREATURE_QUERY, "CMSG_CREATURE_QUERY" }, { SMSG_CREATURE_QUERY_RESPONSE, "SMSG_CREATURE_QUERY_RESPONSE" }, { CMSG_WHO, "CMSG_WHO" }, { SMSG_WHO, "SMSG_WHO" }, { CMSG_WHOIS, "CMSG_WHOIS" }, { SMSG_WHOIS, "SMSG_WHOIS" }, { CMSG_FRIEND_LIST, "CMSG_FRIEND_LIST" }, { SMSG_FRIEND_LIST, "SMSG_FRIEND_LIST" }, { SMSG_FRIEND_STATUS, "SMSG_FRIEND_STATUS" }, { CMSG_ADD_FRIEND, "CMSG_ADD_FRIEND" }, { CMSG_DEL_FRIEND, "CMSG_DEL_FRIEND" }, { SMSG_IGNORE_LIST, "SMSG_IGNORE_LIST" }, { CMSG_ADD_IGNORE, "CMSG_ADD_IGNORE" }, { CMSG_DEL_IGNORE, "CMSG_DEL_IGNORE" }, { CMSG_GROUP_INVITE, "CMSG_GROUP_INVITE" }, { SMSG_GROUP_INVITE, "SMSG_GROUP_INVITE" }, { CMSG_GROUP_CANCEL, "CMSG_GROUP_CANCEL" }, { SMSG_GROUP_CANCEL, "SMSG_GROUP_CANCEL" }, { CMSG_GROUP_ACCEPT, "CMSG_GROUP_ACCEPT" }, { CMSG_GROUP_DECLINE, "CMSG_GROUP_DECLINE" }, { SMSG_GROUP_DECLINE, "SMSG_GROUP_DECLINE" }, { CMSG_GROUP_UNINVITE, "CMSG_GROUP_UNINVITE" }, { CMSG_GROUP_UNINVITE_GUID, "CMSG_GROUP_UNINVITE_GUID" }, { SMSG_GROUP_UNINVITE, "SMSG_GROUP_UNINVITE" }, { CMSG_GROUP_SET_LEADER, "CMSG_GROUP_SET_LEADER" }, { SMSG_GROUP_SET_LEADER, "SMSG_GROUP_SET_LEADER" }, { CMSG_LOOT_METHOD, "CMSG_LOOT_METHOD" }, { CMSG_GROUP_DISBAND, "CMSG_GROUP_DISBAND" }, { SMSG_GROUP_DESTROYED, "SMSG_GROUP_DESTROYED" }, { SMSG_GROUP_LIST, "SMSG_GROUP_LIST" }, { SMSG_PARTY_MEMBER_STATS, "SMSG_PARTY_MEMBER_STATS" }, { SMSG_PARTY_COMMAND_RESULT, "SMSG_PARTY_COMMAND_RESULT" }, { UMSG_UPDATE_GROUP_MEMBERS, "UMSG_UPDATE_GROUP_MEMBERS" }, { CMSG_GUILD_CREATE, "CMSG_GUILD_CREATE" }, { CMSG_GUILD_INVITE, "CMSG_GUILD_INVITE" }, { SMSG_GUILD_INVITE, "SMSG_GUILD_INVITE" }, { CMSG_GUILD_ACCEPT, "CMSG_GUILD_ACCEPT" }, { CMSG_GUILD_DECLINE, "CMSG_GUILD_DECLINE" }, { SMSG_GUILD_DECLINE, "SMSG_GUILD_DECLINE" }, { CMSG_GUILD_INFO, "CMSG_GUILD_INFO" }, { SMSG_GUILD_INFO, "SMSG_GUILD_INFO" }, { CMSG_GUILD_ROSTER, "CMSG_GUILD_ROSTER" }, { SMSG_GUILD_ROSTER, "SMSG_GUILD_ROSTER" }, { CMSG_GUILD_PROMOTE, "CMSG_GUILD_PROMOTE" }, { CMSG_GUILD_DEMOTE, "CMSG_GUILD_DEMOTE" }, { CMSG_GUILD_LEAVE, "CMSG_GUILD_LEAVE" }, { CMSG_GUILD_REMOVE, "CMSG_GUILD_REMOVE" }, { CMSG_GUILD_DISBAND, "CMSG_GUILD_DISBAND" }, { CMSG_GUILD_LEADER, "CMSG_GUILD_LEADER" }, { CMSG_GUILD_MOTD, "CMSG_GUILD_MOTD" }, { SMSG_GUILD_EVENT, "SMSG_GUILD_EVENT" }, { SMSG_GUILD_COMMAND_RESULT, "SMSG_GUILD_COMMAND_RESULT" }, { UMSG_UPDATE_GUILD, "UMSG_UPDATE_GUILD" }, { CMSG_MESSAGECHAT, "CMSG_MESSAGECHAT" }, { SMSG_MESSAGECHAT, "SMSG_MESSAGECHAT" }, { CMSG_JOIN_CHANNEL, "CMSG_JOIN_CHANNEL" }, { CMSG_LEAVE_CHANNEL, "CMSG_LEAVE_CHANNEL" }, { SMSG_CHANNEL_NOTIFY, "SMSG_CHANNEL_NOTIFY" }, { CMSG_CHANNEL_LIST, "CMSG_CHANNEL_LIST" }, { SMSG_CHANNEL_LIST, "SMSG_CHANNEL_LIST" }, { CMSG_CHANNEL_PASSWORD, "CMSG_CHANNEL_PASSWORD" }, { CMSG_CHANNEL_SET_OWNER, "CMSG_CHANNEL_SET_OWNER" }, { CMSG_CHANNEL_OWNER, "CMSG_CHANNEL_OWNER" }, { CMSG_CHANNEL_MODERATOR, "CMSG_CHANNEL_MODERATOR" }, { CMSG_CHANNEL_UNMODERATOR, "CMSG_CHANNEL_UNMODERATOR" }, { CMSG_CHANNEL_MUTE, "CMSG_CHANNEL_MUTE" }, { CMSG_CHANNEL_UNMUTE, "CMSG_CHANNEL_UNMUTE" }, { CMSG_CHANNEL_INVITE, "CMSG_CHANNEL_INVITE" }, { CMSG_CHANNEL_KICK, "CMSG_CHANNEL_KICK" }, { CMSG_CHANNEL_BAN, "CMSG_CHANNEL_BAN" }, { CMSG_CHANNEL_UNBAN, "CMSG_CHANNEL_UNBAN" }, { CMSG_CHANNEL_ANNOUNCEMENTS, "CMSG_CHANNEL_ANNOUNCEMENTS" }, { CMSG_CHANNEL_MODERATE, "CMSG_CHANNEL_MODERATE" }, { SMSG_UPDATE_OBJECT, "SMSG_UPDATE_OBJECT" }, { SMSG_DESTROY_OBJECT, "SMSG_DESTROY_OBJECT" }, { CMSG_USE_ITEM, "CMSG_USE_ITEM" }, { CMSG_OPEN_ITEM, "CMSG_OPEN_ITEM" }, { CMSG_READ_ITEM, "CMSG_READ_ITEM" }, { SMSG_READ_ITEM_OK, "SMSG_READ_ITEM_OK" }, { SMSG_READ_ITEM_FAILED, "SMSG_READ_ITEM_FAILED" }, { SMSG_ITEM_COOLDOWN, "SMSG_ITEM_COOLDOWN" }, { CMSG_GAMEOBJ_USE, "CMSG_GAMEOBJ_USE" }, { CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE, "CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE" }, { SMSG_GAMEOBJECT_CUSTOM_ANIM, "SMSG_GAMEOBJECT_CUSTOM_ANIM" }, { CMSG_AREATRIGGER, "CMSG_AREATRIGGER" }, { MSG_MOVE_START_FORWARD, "MSG_MOVE_START_FORWARD" }, { MSG_MOVE_START_BACKWARD, "MSG_MOVE_START_BACKWARD" }, { MSG_MOVE_STOP, "MSG_MOVE_STOP" }, { MSG_MOVE_START_STRAFE_LEFT, "MSG_MOVE_START_STRAFE_LEFT" }, { MSG_MOVE_START_STRAFE_RIGHT, "MSG_MOVE_START_STRAFE_RIGHT" }, { MSG_MOVE_STOP_STRAFE, "MSG_MOVE_STOP_STRAFE" }, { MSG_MOVE_JUMP, "MSG_MOVE_JUMP" }, { MSG_MOVE_START_TURN_LEFT, "MSG_MOVE_START_TURN_LEFT" }, { MSG_MOVE_START_TURN_RIGHT, "MSG_MOVE_START_TURN_RIGHT" }, { MSG_MOVE_STOP_TURN, "MSG_MOVE_STOP_TURN" }, { MSG_MOVE_START_PITCH_UP, "MSG_MOVE_START_PITCH_UP" }, { MSG_MOVE_START_PITCH_DOWN, "MSG_MOVE_START_PITCH_DOWN" }, { MSG_MOVE_STOP_PITCH, "MSG_MOVE_STOP_PITCH" }, { MSG_MOVE_SET_RUN_MODE, "MSG_MOVE_SET_RUN_MODE" }, { MSG_MOVE_SET_WALK_MODE, "MSG_MOVE_SET_WALK_MODE" }, { MSG_MOVE_TOGGLE_LOGGING, "MSG_MOVE_TOGGLE_LOGGING" }, { MSG_MOVE_TELEPORT, "MSG_MOVE_TELEPORT" }, { MSG_MOVE_TELEPORT_CHEAT, "MSG_MOVE_TELEPORT_CHEAT" }, { MSG_MOVE_TELEPORT_ACK, "MSG_MOVE_TELEPORT_ACK" }, { MSG_MOVE_TOGGLE_FALL_LOGGING, "MSG_MOVE_TOGGLE_FALL_LOGGING" }, { MSG_MOVE_FALL_LAND, "MSG_MOVE_FALL_LAND" }, { MSG_MOVE_START_SWIM, "MSG_MOVE_START_SWIM" }, { MSG_MOVE_STOP_SWIM, "MSG_MOVE_STOP_SWIM" }, { MSG_MOVE_SET_RUN_SPEED_CHEAT, "MSG_MOVE_SET_RUN_SPEED_CHEAT" }, { MSG_MOVE_SET_RUN_SPEED, "MSG_MOVE_SET_RUN_SPEED" }, { MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, "MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT" }, { MSG_MOVE_SET_RUN_BACK_SPEED, "MSG_MOVE_SET_RUN_BACK_SPEED" }, { MSG_MOVE_SET_WALK_SPEED_CHEAT, "MSG_MOVE_SET_WALK_SPEED_CHEAT" }, { MSG_MOVE_SET_WALK_SPEED, "MSG_MOVE_SET_WALK_SPEED" }, { MSG_MOVE_SET_SWIM_SPEED_CHEAT, "MSG_MOVE_SET_SWIM_SPEED_CHEAT" }, { MSG_MOVE_SET_SWIM_SPEED, "MSG_MOVE_SET_SWIM_SPEED" }, { MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, "MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT" }, { MSG_MOVE_SET_SWIM_BACK_SPEED, "MSG_MOVE_SET_SWIM_BACK_SPEED" }, { MSG_MOVE_SET_ALL_SPEED_CHEAT, "MSG_MOVE_SET_ALL_SPEED_CHEAT" }, { MSG_MOVE_SET_TURN_RATE_CHEAT, "MSG_MOVE_SET_TURN_RATE_CHEAT" }, { MSG_MOVE_SET_TURN_RATE, "MSG_MOVE_SET_TURN_RATE" }, { MSG_MOVE_TOGGLE_COLLISION_CHEAT, "MSG_MOVE_TOGGLE_COLLISION_CHEAT" }, { MSG_MOVE_SET_FACING, "MSG_MOVE_SET_FACING" }, { MSG_MOVE_SET_PITCH, "MSG_MOVE_SET_PITCH" }, { MSG_MOVE_WORLDPORT_ACK, "MSG_MOVE_WORLDPORT_ACK" }, { SMSG_MONSTER_MOVE, "SMSG_MONSTER_MOVE" }, { SMSG_MOVE_WATER_WALK, "SMSG_MOVE_WATER_WALK" }, { SMSG_MOVE_LAND_WALK, "SMSG_MOVE_LAND_WALK" }, { MSG_MOVE_SET_RAW_POSITION_ACK, "MSG_MOVE_SET_RAW_POSITION_ACK" }, { CMSG_MOVE_SET_RAW_POSITION, "CMSG_MOVE_SET_RAW_POSITION" }, { SMSG_FORCE_RUN_SPEED_CHANGE, "SMSG_FORCE_RUN_SPEED_CHANGE" }, { CMSG_FORCE_RUN_SPEED_CHANGE_ACK, "CMSG_FORCE_RUN_SPEED_CHANGE_ACK" }, { SMSG_FORCE_RUN_BACK_SPEED_CHANGE, "SMSG_FORCE_RUN_BACK_SPEED_CHANGE" }, { CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK, "CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK" }, { SMSG_FORCE_SWIM_SPEED_CHANGE, "SMSG_FORCE_SWIM_SPEED_CHANGE" }, { CMSG_FORCE_SWIM_SPEED_CHANGE_ACK, "CMSG_FORCE_SWIM_SPEED_CHANGE_ACK" }, { SMSG_FORCE_MOVE_ROOT, "SMSG_FORCE_MOVE_ROOT" }, { CMSG_FORCE_MOVE_ROOT_ACK, "CMSG_FORCE_MOVE_ROOT_ACK" }, { SMSG_FORCE_MOVE_UNROOT, "SMSG_FORCE_MOVE_UNROOT" }, { CMSG_FORCE_MOVE_UNROOT_ACK, "CMSG_FORCE_MOVE_UNROOT_ACK" }, { MSG_MOVE_ROOT, "MSG_MOVE_ROOT" }, { MSG_MOVE_UNROOT, "MSG_MOVE_UNROOT" }, { MSG_MOVE_HEARTBEAT, "MSG_MOVE_HEARTBEAT" }, { SMSG_MOVE_KNOCK_BACK, "SMSG_MOVE_KNOCK_BACK" }, { CMSG_MOVE_KNOCK_BACK_ACK, "CMSG_MOVE_KNOCK_BACK_ACK" }, { MSG_MOVE_KNOCK_BACK, "MSG_MOVE_KNOCK_BACK" }, { SMSG_MOVE_FEATHER_FALL, "SMSG_MOVE_FEATHER_FALL" }, { SMSG_MOVE_NORMAL_FALL, "SMSG_MOVE_NORMAL_FALL" }, { SMSG_MOVE_SET_HOVER, "SMSG_MOVE_SET_HOVER" }, { SMSG_MOVE_UNSET_HOVER, "SMSG_MOVE_UNSET_HOVER" }, { CMSG_MOVE_HOVER_ACK, "CMSG_MOVE_HOVER_ACK" }, { MSG_MOVE_HOVER, "MSG_MOVE_HOVER" }, { CMSG_TRIGGER_CINEMATIC_CHEAT, "CMSG_TRIGGER_CINEMATIC_CHEAT" }, { CMSG_OPENING_CINEMATIC, "CMSG_OPENING_CINEMATIC" }, { SMSG_TRIGGER_CINEMATIC, "SMSG_TRIGGER_CINEMATIC" }, { CMSG_NEXT_CINEMATIC_CAMERA, "CMSG_NEXT_CINEMATIC_CAMERA" }, { CMSG_COMPLETE_CINEMATIC, "CMSG_COMPLETE_CINEMATIC" }, { SMSG_TUTORIAL_FLAGS, "SMSG_TUTORIAL_FLAGS" }, { CMSG_TUTORIAL_FLAG, "CMSG_TUTORIAL_FLAG" }, { CMSG_TUTORIAL_CLEAR, "CMSG_TUTORIAL_CLEAR" }, { CMSG_TUTORIAL_RESET, "CMSG_TUTORIAL_RESET" }, { CMSG_STANDSTATECHANGE, "CMSG_STANDSTATECHANGE" }, { CMSG_EMOTE, "CMSG_EMOTE" }, { SMSG_EMOTE, "SMSG_EMOTE" }, { CMSG_TEXT_EMOTE, "CMSG_TEXT_EMOTE" }, { SMSG_TEXT_EMOTE, "SMSG_TEXT_EMOTE" }, { CMSG_AUTOEQUIP_GROUND_ITEM, "CMSG_AUTOEQUIP_GROUND_ITEM" }, { CMSG_AUTOSTORE_GROUND_ITEM, "CMSG_AUTOSTORE_GROUND_ITEM" }, { CMSG_AUTOSTORE_LOOT_ITEM, "CMSG_AUTOSTORE_LOOT_ITEM" }, { CMSG_STORE_LOOT_IN_SLOT, "CMSG_STORE_LOOT_IN_SLOT" }, { CMSG_AUTOEQUIP_ITEM, "CMSG_AUTOEQUIP_ITEM" }, { CMSG_AUTOSTORE_BAG_ITEM, "CMSG_AUTOSTORE_BAG_ITEM" }, { CMSG_SWAP_ITEM, "CMSG_SWAP_ITEM" }, { CMSG_SWAP_INV_ITEM, "CMSG_SWAP_INV_ITEM" }, { CMSG_SPLIT_ITEM, "CMSG_SPLIT_ITEM" }, { CMSG_AUTOEQUIP_ITEM_SLOT, "CMSG_AUTOEQUIP_ITEM_SLOT" }, { OBSOLETE_DROP_ITEM, "OBSOLETE_DROP_ITEM" }, { CMSG_DESTROYITEM, "CMSG_DESTROYITEM" }, { SMSG_INVENTORY_CHANGE_FAILURE, "SMSG_INVENTORY_CHANGE_FAILURE" }, { SMSG_OPEN_CONTAINER, "SMSG_OPEN_CONTAINER" }, { CMSG_INSPECT, "CMSG_INSPECT" }, { SMSG_INSPECT, "SMSG_INSPECT" }, { CMSG_INITIATE_TRADE, "CMSG_INITIATE_TRADE" }, { CMSG_BEGIN_TRADE, "CMSG_BEGIN_TRADE" }, { CMSG_BUSY_TRADE, "CMSG_BUSY_TRADE" }, { CMSG_IGNORE_TRADE, "CMSG_IGNORE_TRADE" }, { CMSG_ACCEPT_TRADE, "CMSG_ACCEPT_TRADE" }, { CMSG_UNACCEPT_TRADE, "CMSG_UNACCEPT_TRADE" }, { CMSG_CANCEL_TRADE, "CMSG_CANCEL_TRADE" }, { CMSG_SET_TRADE_ITEM, "CMSG_SET_TRADE_ITEM" }, { CMSG_CLEAR_TRADE_ITEM, "CMSG_CLEAR_TRADE_ITEM" }, { CMSG_SET_TRADE_GOLD, "CMSG_SET_TRADE_GOLD" }, { SMSG_TRADE_STATUS, "SMSG_TRADE_STATUS" }, { SMSG_TRADE_STATUS_EXTENDED, "SMSG_TRADE_STATUS_EXTENDED" }, { SMSG_INITIALIZE_FACTIONS, "SMSG_INITIALIZE_FACTIONS" }, { SMSG_SET_FACTION_VISIBLE, "SMSG_SET_FACTION_VISIBLE" }, { SMSG_SET_FACTION_STANDING, "SMSG_SET_FACTION_STANDING" }, { CMSG_SET_FACTION_ATWAR, "CMSG_SET_FACTION_ATWAR" }, { CMSG_SET_FACTION_CHEAT, "CMSG_SET_FACTION_CHEAT" }, { SMSG_SET_PROFICIENCY, "SMSG_SET_PROFICIENCY" }, { CMSG_SET_ACTION_BUTTON, "CMSG_SET_ACTION_BUTTON" }, { SMSG_ACTION_BUTTONS, "SMSG_ACTION_BUTTONS" }, { SMSG_INITIAL_SPELLS, "SMSG_INITIAL_SPELLS" }, { SMSG_LEARNED_SPELL, "SMSG_LEARNED_SPELL" }, { SMSG_SUPERCEDED_SPELL, "SMSG_SUPERCEDED_SPELL" }, { CMSG_NEW_SPELL_SLOT, "CMSG_NEW_SPELL_SLOT" }, { CMSG_CAST_SPELL, "CMSG_CAST_SPELL" }, { CMSG_CANCEL_CAST, "CMSG_CANCEL_CAST" }, { SMSG_CAST_RESULT, "SMSG_CAST_RESULT" }, { SMSG_SPELL_START, "SMSG_SPELL_START" }, { SMSG_SPELL_GO, "SMSG_SPELL_GO" }, { SMSG_SPELL_FAILURE, "SMSG_SPELL_FAILURE" }, { SMSG_SPELL_COOLDOWN, "SMSG_SPELL_COOLDOWN" }, { SMSG_COOLDOWN_EVENT, "SMSG_COOLDOWN_EVENT" }, { CMSG_CANCEL_AURA, "CMSG_CANCEL_AURA" }, { SMSG_UPDATE_AURA_DURATION, "SMSG_UPDATE_AURA_DURATION" }, { SMSG_PET_CAST_FAILED, "SMSG_PET_CAST_FAILED" }, { MSG_CHANNEL_START, "MSG_CHANNEL_START" }, { MSG_CHANNEL_UPDATE, "MSG_CHANNEL_UPDATE" }, { CMSG_CANCEL_CHANNELLING, "CMSG_CANCEL_CHANNELLING" }, { SMSG_AI_REACTION, "SMSG_AI_REACTION" }, { CMSG_SET_SELECTION, "CMSG_SET_SELECTION" }, { CMSG_SET_TARGET_OBSOLETE, "CMSG_SET_TARGET_OBSOLETE" }, { CMSG_UNUSED, "CMSG_UNUSED" }, { CMSG_UNUSED2, "CMSG_UNUSED2" }, { CMSG_ATTACKSWING, "CMSG_ATTACKSWING" }, { CMSG_ATTACKSTOP, "CMSG_ATTACKSTOP" }, { SMSG_ATTACKSTART, "SMSG_ATTACKSTART" }, { SMSG_ATTACKSTOP, "SMSG_ATTACKSTOP" }, { SMSG_ATTACKSWING_NOTINRANGE, "SMSG_ATTACKSWING_NOTINRANGE" }, { SMSG_ATTACKSWING_BADFACING, "SMSG_ATTACKSWING_BADFACING" }, { SMSG_ATTACKSWING_NOTSTANDING, "SMSG_ATTACKSWING_NOTSTANDING" }, { SMSG_ATTACKSWING_DEADTARGET, "SMSG_ATTACKSWING_DEADTARGET" }, { SMSG_ATTACKSWING_CANT_ATTACK, "SMSG_ATTACKSWING_CANT_ATTACK" }, { SMSG_ATTACKERSTATEUPDATE, "SMSG_ATTACKERSTATEUPDATE" }, { SMSG_VICTIMSTATEUPDATE_OBSOLETE, "SMSG_VICTIMSTATEUPDATE_OBSOLETE" }, { SMSG_DAMAGE_DONE_OBSOLETE, "SMSG_DAMAGE_DONE_OBSOLETE" }, { SMSG_DAMAGE_TAKEN_OBSOLETE, "SMSG_DAMAGE_TAKEN_OBSOLETE" }, { SMSG_CANCEL_COMBAT, "SMSG_CANCEL_COMBAT" }, { SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE, "SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE" }, { SMSG_SPELLHEALLOG, "SMSG_SPELLHEALLOG" }, { SMSG_SPELLENERGIZELOG, "SMSG_SPELLENERGIZELOG" }, { CMSG_SHEATHE_OBSOLETE, "CMSG_SHEATHE_OBSOLETE" }, { CMSG_SAVE_PLAYER, "CMSG_SAVE_PLAYER" }, { CMSG_SETDEATHBINDPOINT, "CMSG_SETDEATHBINDPOINT" }, { SMSG_BINDPOINTUPDATE, "SMSG_BINDPOINTUPDATE" }, { CMSG_GETDEATHBINDZONE, "CMSG_GETDEATHBINDZONE" }, { SMSG_BINDZONEREPLY, "SMSG_BINDZONEREPLY" }, { SMSG_PLAYERBOUND, "SMSG_PLAYERBOUND" }, { SMSG_CLIENT_CONTROL_UPDATE, "SMSG_CLIENT_CONTROL_UPDATE" }, { CMSG_REPOP_REQUEST, "CMSG_REPOP_REQUEST" }, { SMSG_RESURRECT_REQUEST, "SMSG_RESURRECT_REQUEST" }, { CMSG_RESURRECT_RESPONSE, "CMSG_RESURRECT_RESPONSE" }, { CMSG_LOOT, "CMSG_LOOT" }, { CMSG_LOOT_MONEY, "CMSG_LOOT_MONEY" }, { CMSG_LOOT_RELEASE, "CMSG_LOOT_RELEASE" }, { SMSG_LOOT_RESPONSE, "SMSG_LOOT_RESPONSE" }, { SMSG_LOOT_RELEASE_RESPONSE, "SMSG_LOOT_RELEASE_RESPONSE" }, { SMSG_LOOT_REMOVED, "SMSG_LOOT_REMOVED" }, { SMSG_LOOT_MONEY_NOTIFY, "SMSG_LOOT_MONEY_NOTIFY" }, { SMSG_LOOT_ITEM_NOTIFY, "SMSG_LOOT_ITEM_NOTIFY" }, { SMSG_LOOT_CLEAR_MONEY, "SMSG_LOOT_CLEAR_MONEY" }, { SMSG_ITEM_PUSH_RESULT, "SMSG_ITEM_PUSH_RESULT" }, { SMSG_DUEL_REQUESTED, "SMSG_DUEL_REQUESTED" }, { SMSG_DUEL_OUTOFBOUNDS, "SMSG_DUEL_OUTOFBOUNDS" }, { SMSG_DUEL_INBOUNDS, "SMSG_DUEL_INBOUNDS" }, { SMSG_DUEL_COMPLETE, "SMSG_DUEL_COMPLETE" }, { SMSG_DUEL_WINNER, "SMSG_DUEL_WINNER" }, { CMSG_DUEL_ACCEPTED, "CMSG_DUEL_ACCEPTED" }, { CMSG_DUEL_CANCELLED, "CMSG_DUEL_CANCELLED" }, { SMSG_MOUNTRESULT, "SMSG_MOUNTRESULT" }, { SMSG_DISMOUNTRESULT, "SMSG_DISMOUNTRESULT" }, { SMSG_PUREMOUNT_CANCELLED_OBSOLETE, "SMSG_PUREMOUNT_CANCELLED_OBSOLETE" }, { CMSG_MOUNTSPECIAL_ANIM, "CMSG_MOUNTSPECIAL_ANIM" }, { SMSG_MOUNTSPECIAL_ANIM, "SMSG_MOUNTSPECIAL_ANIM" }, { SMSG_PET_TAME_FAILURE, "SMSG_PET_TAME_FAILURE" }, { CMSG_PET_SET_ACTION, "CMSG_PET_SET_ACTION" }, { CMSG_PET_ACTION, "CMSG_PET_ACTION" }, { CMSG_PET_ABANDON, "CMSG_PET_ABANDON" }, { CMSG_PET_RENAME, "CMSG_PET_RENAME" }, { SMSG_PET_NAME_INVALID, "SMSG_PET_NAME_INVALID" }, { SMSG_PET_SPELLS, "SMSG_PET_SPELLS" }, { SMSG_PET_MODE, "SMSG_PET_MODE" }, { CMSG_GOSSIP_HELLO, "CMSG_GOSSIP_HELLO" }, { CMSG_GOSSIP_SELECT_OPTION, "CMSG_GOSSIP_SELECT_OPTION" }, { SMSG_GOSSIP_MESSAGE, "SMSG_GOSSIP_MESSAGE" }, { SMSG_GOSSIP_COMPLETE, "SMSG_GOSSIP_COMPLETE" }, { CMSG_NPC_TEXT_QUERY, "CMSG_NPC_TEXT_QUERY" }, { SMSG_NPC_TEXT_UPDATE, "SMSG_NPC_TEXT_UPDATE" }, { SMSG_NPC_WONT_TALK, "SMSG_NPC_WONT_TALK" }, { CMSG_QUESTGIVER_STATUS_QUERY, "CMSG_QUESTGIVER_STATUS_QUERY" }, { SMSG_QUESTGIVER_STATUS, "SMSG_QUESTGIVER_STATUS" }, { CMSG_QUESTGIVER_HELLO, "CMSG_QUESTGIVER_HELLO" }, { SMSG_QUESTGIVER_QUEST_LIST, "SMSG_QUESTGIVER_QUEST_LIST" }, { CMSG_QUESTGIVER_QUERY_QUEST, "CMSG_QUESTGIVER_QUERY_QUEST" }, { CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, "CMSG_QUESTGIVER_QUEST_AUTOLAUNCH" }, { SMSG_QUESTGIVER_QUEST_DETAILS, "SMSG_QUESTGIVER_QUEST_DETAILS" }, { CMSG_QUESTGIVER_ACCEPT_QUEST, "CMSG_QUESTGIVER_ACCEPT_QUEST" }, { CMSG_QUESTGIVER_COMPLETE_QUEST, "CMSG_QUESTGIVER_COMPLETE_QUEST" }, { SMSG_QUESTGIVER_REQUEST_ITEMS, "SMSG_QUESTGIVER_REQUEST_ITEMS" }, { CMSG_QUESTGIVER_REQUEST_REWARD, "CMSG_QUESTGIVER_REQUEST_REWARD" }, { SMSG_QUESTGIVER_OFFER_REWARD, "SMSG_QUESTGIVER_OFFER_REWARD" }, { CMSG_QUESTGIVER_CHOOSE_REWARD, "CMSG_QUESTGIVER_CHOOSE_REWARD" }, { SMSG_QUESTGIVER_QUEST_INVALID, "SMSG_QUESTGIVER_QUEST_INVALID" }, { CMSG_QUESTGIVER_CANCEL, "CMSG_QUESTGIVER_CANCEL" }, { SMSG_QUESTGIVER_QUEST_COMPLETE, "SMSG_QUESTGIVER_QUEST_COMPLETE" }, { SMSG_QUESTGIVER_QUEST_FAILED, "SMSG_QUESTGIVER_QUEST_FAILED" }, { CMSG_QUESTLOG_SWAP_QUEST, "CMSG_QUESTLOG_SWAP_QUEST" }, { CMSG_QUESTLOG_REMOVE_QUEST, "CMSG_QUESTLOG_REMOVE_QUEST" }, { SMSG_QUESTLOG_FULL, "SMSG_QUESTLOG_FULL" }, { SMSG_QUESTUPDATE_FAILED, "SMSG_QUESTUPDATE_FAILED" }, { SMSG_QUESTUPDATE_FAILEDTIMER, "SMSG_QUESTUPDATE_FAILEDTIMER" }, { SMSG_QUESTUPDATE_COMPLETE, "SMSG_QUESTUPDATE_COMPLETE" }, { SMSG_QUESTUPDATE_ADD_KILL, "SMSG_QUESTUPDATE_ADD_KILL" }, { SMSG_QUESTUPDATE_ADD_ITEM, "SMSG_QUESTUPDATE_ADD_ITEM" }, { CMSG_QUEST_CONFIRM_ACCEPT, "CMSG_QUEST_CONFIRM_ACCEPT" }, { SMSG_QUEST_CONFIRM_ACCEPT, "SMSG_QUEST_CONFIRM_ACCEPT" }, { CMSG_PUSHQUESTTOPARTY, "CMSG_PUSHQUESTTOPARTY" }, { CMSG_LIST_INVENTORY, "CMSG_LIST_INVENTORY" }, { SMSG_LIST_INVENTORY, "SMSG_LIST_INVENTORY" }, { CMSG_SELL_ITEM, "CMSG_SELL_ITEM" }, { SMSG_SELL_ITEM, "SMSG_SELL_ITEM" }, { CMSG_BUY_ITEM, "CMSG_BUY_ITEM" }, { CMSG_BUY_ITEM_IN_SLOT, "CMSG_BUY_ITEM_IN_SLOT" }, { SMSG_BUY_ITEM, "SMSG_BUY_ITEM" }, { SMSG_BUY_FAILED, "SMSG_BUY_FAILED" }, { CMSG_TAXICLEARALLNODES, "CMSG_TAXICLEARALLNODES" }, { CMSG_TAXIENABLEALLNODES, "CMSG_TAXIENABLEALLNODES" }, { CMSG_TAXISHOWNODES, "CMSG_TAXISHOWNODES" }, { SMSG_SHOWTAXINODES, "SMSG_SHOWTAXINODES" }, { CMSG_TAXINODE_STATUS_QUERY, "CMSG_TAXINODE_STATUS_QUERY" }, { SMSG_TAXINODE_STATUS, "SMSG_TAXINODE_STATUS" }, { CMSG_TAXIQUERYAVAILABLENODES, "CMSG_TAXIQUERYAVAILABLENODES" }, { CMSG_ACTIVATETAXI, "CMSG_ACTIVATETAXI" }, { SMSG_ACTIVATETAXIREPLY, "SMSG_ACTIVATETAXIREPLY" }, { SMSG_NEW_TAXI_PATH, "SMSG_NEW_TAXI_PATH" }, { CMSG_TRAINER_LIST, "CMSG_TRAINER_LIST" }, { SMSG_TRAINER_LIST, "SMSG_TRAINER_LIST" }, { CMSG_TRAINER_BUY_SPELL, "CMSG_TRAINER_BUY_SPELL" }, { SMSG_TRAINER_BUY_SUCCEEDED, "SMSG_TRAINER_BUY_SUCCEEDED" }, { SMSG_TRAINER_BUY_FAILED, "SMSG_TRAINER_BUY_FAILED" }, { CMSG_BINDER_ACTIVATE, "CMSG_BINDER_ACTIVATE" }, { SMSG_PLAYERBINDERROR, "SMSG_PLAYERBINDERROR" }, { CMSG_BANKER_ACTIVATE, "CMSG_BANKER_ACTIVATE" }, { SMSG_SHOW_BANK, "SMSG_SHOW_BANK" }, { CMSG_BUY_BANK_SLOT, "CMSG_BUY_BANK_SLOT" }, { SMSG_BUY_BANK_SLOT_RESULT, "SMSG_BUY_BANK_SLOT_RESULT" }, { CMSG_PETITION_SHOWLIST, "CMSG_PETITION_SHOWLIST" }, { SMSG_PETITION_SHOWLIST, "SMSG_PETITION_SHOWLIST" }, { CMSG_PETITION_BUY, "CMSG_PETITION_BUY" }, { CMSG_PETITION_SHOW_SIGNATURES, "CMSG_PETITION_SHOW_SIGNATURES" }, { SMSG_PETITION_SHOW_SIGNATURES, "SMSG_PETITION_SHOW_SIGNATURES" }, { CMSG_PETITION_SIGN, "CMSG_PETITION_SIGN" }, { SMSG_PETITION_SIGN_RESULTS, "SMSG_PETITION_SIGN_RESULTS" }, { MSG_PETITION_DECLINE, "MSG_PETITION_DECLINE" }, { CMSG_OFFER_PETITION, "CMSG_OFFER_PETITION" }, { CMSG_TURN_IN_PETITION, "CMSG_TURN_IN_PETITION" }, { SMSG_TURN_IN_PETITION_RESULTS, "SMSG_TURN_IN_PETITION_RESULTS" }, { CMSG_PETITION_QUERY, "CMSG_PETITION_QUERY" }, { SMSG_PETITION_QUERY_RESPONSE, "SMSG_PETITION_QUERY_RESPONSE" }, { SMSG_FISH_NOT_HOOKED, "SMSG_FISH_NOT_HOOKED" }, { SMSG_FISH_ESCAPED, "SMSG_FISH_ESCAPED" }, { CMSG_BUG, "CMSG_BUG" }, { SMSG_NOTIFICATION, "SMSG_NOTIFICATION" }, { CMSG_PLAYED_TIME, "CMSG_PLAYED_TIME" }, { SMSG_PLAYED_TIME, "SMSG_PLAYED_TIME" }, { CMSG_QUERY_TIME, "CMSG_QUERY_TIME" }, { SMSG_QUERY_TIME_RESPONSE, "SMSG_QUERY_TIME_RESPONSE" }, { SMSG_LOG_XPGAIN, "SMSG_LOG_XPGAIN" }, { SMSG_AURACASTLOG, "SMSG_AURACASTLOG" }, { CMSG_RECLAIM_CORPSE, "CMSG_RECLAIM_CORPSE" }, { CMSG_WRAP_ITEM, "CMSG_WRAP_ITEM" }, { SMSG_LEVELUP_INFO, "SMSG_LEVELUP_INFO" }, { MSG_MINIMAP_PING, "MSG_MINIMAP_PING" }, { SMSG_RESISTLOG, "SMSG_RESISTLOG" }, { SMSG_ENCHANTMENTLOG, "SMSG_ENCHANTMENTLOG" }, { CMSG_SET_SKILL_CHEAT, "CMSG_SET_SKILL_CHEAT" }, { SMSG_START_MIRROR_TIMER, "SMSG_START_MIRROR_TIMER" }, { SMSG_PAUSE_MIRROR_TIMER, "SMSG_PAUSE_MIRROR_TIMER" }, { SMSG_STOP_MIRROR_TIMER, "SMSG_STOP_MIRROR_TIMER" }, { CMSG_PING, "CMSG_PING" }, { SMSG_PONG, "SMSG_PONG" }, { SMSG_CLEAR_COOLDOWN, "SMSG_CLEAR_COOLDOWN" }, { SMSG_GAMEOBJECT_PAGETEXT, "SMSG_GAMEOBJECT_PAGETEXT" }, { CMSG_SETSHEATHED, "CMSG_SETSHEATHED" }, { SMSG_COOLDOWN_CHEAT, "SMSG_COOLDOWN_CHEAT" }, { SMSG_SPELL_DELAYED, "SMSG_SPELL_DELAYED" }, { CMSG_PLAYER_MACRO_OBSOLETE, "CMSG_PLAYER_MACRO_OBSOLETE" }, { SMSG_PLAYER_MACRO_OBSOLETE, "SMSG_PLAYER_MACRO_OBSOLETE" }, { CMSG_GHOST, "CMSG_GHOST" }, { CMSG_GM_INVIS, "CMSG_GM_INVIS" }, { SMSG_INVALID_PROMOTION_CODE, "SMSG_INVALID_PROMOTION_CODE" }, { MSG_GM_BIND_OTHER, "MSG_GM_BIND_OTHER" }, { MSG_GM_SUMMON, "MSG_GM_SUMMON" }, { SMSG_ITEM_TIME_UPDATE, "SMSG_ITEM_TIME_UPDATE" }, { SMSG_ITEM_ENCHANT_TIME_UPDATE, "SMSG_ITEM_ENCHANT_TIME_UPDATE" }, { SMSG_AUTH_CHALLENGE, "SMSG_AUTH_CHALLENGE" }, { CMSG_AUTH_SESSION, "CMSG_AUTH_SESSION" }, { SMSG_AUTH_RESPONSE, "SMSG_AUTH_RESPONSE" }, { MSG_GM_SHOWLABEL, "MSG_GM_SHOWLABEL" }, { CMSG_PET_CAST_SPELL, "CMSG_PET_CAST_SPELL" }, { MSG_SAVE_GUILD_EMBLEM, "MSG_SAVE_GUILD_EMBLEM" }, { MSG_TABARDVENDOR_ACTIVATE, "MSG_TABARDVENDOR_ACTIVATE" }, { SMSG_PLAY_SPELL_VISUAL, "SMSG_PLAY_SPELL_VISUAL" }, { CMSG_ZONEUPDATE, "CMSG_ZONEUPDATE" }, { SMSG_PARTYKILLLOG, "SMSG_PARTYKILLLOG" }, { SMSG_COMPRESSED_UPDATE_OBJECT, "SMSG_COMPRESSED_UPDATE_OBJECT" }, { SMSG_PLAY_SPELL_IMPACT, "SMSG_PLAY_SPELL_IMPACT" }, { SMSG_EXPLORATION_EXPERIENCE, "SMSG_EXPLORATION_EXPERIENCE" }, { CMSG_GM_SET_SECURITY_GROUP, "CMSG_GM_SET_SECURITY_GROUP" }, { CMSG_GM_NUKE, "CMSG_GM_NUKE" }, { MSG_RANDOM_ROLL, "MSG_RANDOM_ROLL" }, { SMSG_ENVIRONMENTAL_DAMAGE_LOG, "SMSG_ENVIRONMENTAL_DAMAGE_LOG" }, { CMSG_RWHOIS_OBSOLETE, "CMSG_RWHOIS_OBSOLETE" }, { SMSG_RWHOIS, "SMSG_RWHOIS" }, { MSG_LOOKING_FOR_GROUP, "MSG_LOOKING_FOR_GROUP" }, { CMSG_SET_LOOKING_FOR_GROUP, "CMSG_SET_LOOKING_FOR_GROUP" }, { CMSG_UNLEARN_SPELL, "CMSG_UNLEARN_SPELL" }, { CMSG_UNLEARN_SKILL, "CMSG_UNLEARN_SKILL" }, { SMSG_REMOVED_SPELL, "SMSG_REMOVED_SPELL" }, { CMSG_DECHARGE, "CMSG_DECHARGE" }, { CMSG_GMTICKET_CREATE, "CMSG_GMTICKET_CREATE" }, { SMSG_GMTICKET_CREATE, "SMSG_GMTICKET_CREATE" }, { CMSG_GMTICKET_UPDATETEXT, "CMSG_GMTICKET_UPDATETEXT" }, { SMSG_GMTICKET_UPDATETEXT, "SMSG_GMTICKET_UPDATETEXT" }, { SMSG_ACCOUNT_DATA_TIMES, "SMSG_ACCOUNT_DATA_TIMES" }, { CMSG_REQUEST_ACCOUNT_DATA, "CMSG_REQUEST_ACCOUNT_DATA" }, { CMSG_UPDATE_ACCOUNT_DATA, "CMSG_UPDATE_ACCOUNT_DATA" }, { SMSG_UPDATE_ACCOUNT_DATA, "SMSG_UPDATE_ACCOUNT_DATA" }, { SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE" }, { SMSG_POWERGAINLOG_OBSOLETE, "SMSG_POWERGAINLOG_OBSOLETE" }, { CMSG_GM_TEACH, "CMSG_GM_TEACH" }, { CMSG_GM_CREATE_ITEM_TARGET, "CMSG_GM_CREATE_ITEM_TARGET" }, { CMSG_GMTICKET_GETTICKET, "CMSG_GMTICKET_GETTICKET" }, { SMSG_GMTICKET_GETTICKET, "SMSG_GMTICKET_GETTICKET" }, { CMSG_UNLEARN_TALENTS, "CMSG_UNLEARN_TALENTS" }, { SMSG_GAMEOBJECT_SPAWN_ANIM, "SMSG_GAMEOBJECT_SPAWN_ANIM" }, { SMSG_GAMEOBJECT_DESPAWN_ANIM, "SMSG_GAMEOBJECT_DESPAWN_ANIM" }, { MSG_CORPSE_QUERY, "MSG_CORPSE_QUERY" }, { CMSG_GMTICKET_DELETETICKET, "CMSG_GMTICKET_DELETETICKET" }, { SMSG_GMTICKET_DELETETICKET, "SMSG_GMTICKET_DELETETICKET" }, { SMSG_CHAT_WRONG_FACTION, "SMSG_CHAT_WRONG_FACTION" }, { CMSG_GMTICKET_SYSTEMSTATUS, "CMSG_GMTICKET_SYSTEMSTATUS" }, { SMSG_GMTICKET_SYSTEMSTATUS, "SMSG_GMTICKET_SYSTEMSTATUS" }, { CMSG_SPIRIT_HEALER_ACTIVATE, "CMSG_SPIRIT_HEALER_ACTIVATE" }, { CMSG_SET_STAT_CHEAT, "CMSG_SET_STAT_CHEAT" }, { SMSG_SET_REST_START, "SMSG_SET_REST_START" }, { CMSG_SKILL_BUY_STEP, "CMSG_SKILL_BUY_STEP" }, { CMSG_SKILL_BUY_RANK, "CMSG_SKILL_BUY_RANK" }, { CMSG_XP_CHEAT, "CMSG_XP_CHEAT" }, { SMSG_SPIRIT_HEALER_CONFIRM, "SMSG_SPIRIT_HEALER_CONFIRM" }, { CMSG_CHARACTER_POINT_CHEAT, "CMSG_CHARACTER_POINT_CHEAT" }, { SMSG_GOSSIP_POI, "SMSG_GOSSIP_POI" }, { CMSG_CHAT_IGNORED, "CMSG_CHAT_IGNORED" }, { CMSG_GM_VISION, "CMSG_GM_VISION" }, { CMSG_SERVER_COMMAND, "CMSG_SERVER_COMMAND" }, { CMSG_GM_SILENCE, "CMSG_GM_SILENCE" }, { CMSG_GM_REVEALTO, "CMSG_GM_REVEALTO" }, { CMSG_GM_RESURRECT, "CMSG_GM_RESURRECT" }, { CMSG_GM_SUMMONMOB, "CMSG_GM_SUMMONMOB" }, { CMSG_GM_MOVECORPSE, "CMSG_GM_MOVECORPSE" }, { CMSG_GM_FREEZE, "CMSG_GM_FREEZE" }, { CMSG_GM_UBERINVIS, "CMSG_GM_UBERINVIS" }, { CMSG_GM_REQUEST_PLAYER_INFO, "CMSG_GM_REQUEST_PLAYER_INFO" }, { SMSG_GM_PLAYER_INFO, "SMSG_GM_PLAYER_INFO" }, { CMSG_GUILD_RANK, "CMSG_GUILD_RANK" }, { CMSG_GUILD_ADD_RANK, "CMSG_GUILD_ADD_RANK" }, { CMSG_GUILD_DEL_RANK, "CMSG_GUILD_DEL_RANK" }, { CMSG_GUILD_SET_PUBLIC_NOTE, "CMSG_GUILD_SET_PUBLIC_NOTE" }, { CMSG_GUILD_SET_OFFICER_NOTE, "CMSG_GUILD_SET_OFFICER_NOTE" }, { SMSG_LOGIN_VERIFY_WORLD, "SMSG_LOGIN_VERIFY_WORLD" }, { CMSG_CLEAR_EXPLORATION, "CMSG_CLEAR_EXPLORATION" }, { CMSG_SEND_MAIL, "CMSG_SEND_MAIL" }, { SMSG_SEND_MAIL_RESULT, "SMSG_SEND_MAIL_RESULT" }, { CMSG_GET_MAIL_LIST, "CMSG_GET_MAIL_LIST" }, { SMSG_MAIL_LIST_RESULT, "SMSG_MAIL_LIST_RESULT" }, { CMSG_BATTLEFIELD_LIST, "CMSG_BATTLEFIELD_LIST" }, { SMSG_BATTLEFIELD_LIST, "SMSG_BATTLEFIELD_LIST" }, { CMSG_BATTLEFIELD_JOIN, "CMSG_BATTLEFIELD_JOIN" }, { SMSG_BATTLEFIELD_WIN_OBSOLETE, "SMSG_BATTLEFIELD_WIN_OBSOLETE" }, { SMSG_BATTLEFIELD_LOSE_OBSOLETE, "SMSG_BATTLEFIELD_LOSE_OBSOLETE" }, { CMSG_TAXICLEARNODE, "CMSG_TAXICLEARNODE" }, { CMSG_TAXIENABLENODE, "CMSG_TAXIENABLENODE" }, { CMSG_ITEM_TEXT_QUERY, "CMSG_ITEM_TEXT_QUERY" }, { SMSG_ITEM_TEXT_QUERY_RESPONSE, "SMSG_ITEM_TEXT_QUERY_RESPONSE" }, { CMSG_MAIL_TAKE_MONEY, "CMSG_MAIL_TAKE_MONEY" }, { CMSG_MAIL_TAKE_ITEM, "CMSG_MAIL_TAKE_ITEM" }, { CMSG_MAIL_MARK_AS_READ, "CMSG_MAIL_MARK_AS_READ" }, { CMSG_MAIL_RETURN_TO_SENDER, "CMSG_MAIL_RETURN_TO_SENDER" }, { CMSG_MAIL_DELETE, "CMSG_MAIL_DELETE" }, { CMSG_MAIL_CREATE_TEXT_ITEM, "CMSG_MAIL_CREATE_TEXT_ITEM" }, { SMSG_SPELLLOGMISS, "SMSG_SPELLLOGMISS" }, { SMSG_SPELLLOGEXECUTE, "SMSG_SPELLLOGEXECUTE" }, { SMSG_DEBUGAURAPROC, "SMSG_DEBUGAURAPROC" }, { SMSG_PERIODICAURALOG, "SMSG_PERIODICAURALOG" }, { SMSG_SPELLDAMAGESHIELD, "SMSG_SPELLDAMAGESHIELD" }, { SMSG_SPELLNONMELEEDAMAGELOG, "SMSG_SPELLNONMELEEDAMAGELOG" }, { CMSG_LEARN_TALENT, "CMSG_LEARN_TALENT" }, { SMSG_RESURRECT_FAILED, "SMSG_RESURRECT_FAILED" }, { CMSG_TOGGLE_PVP, "CMSG_TOGGLE_PVP" }, { SMSG_ZONE_UNDER_ATTACK, "SMSG_ZONE_UNDER_ATTACK" }, { MSG_AUCTION_HELLO, "MSG_AUCTION_HELLO" }, { CMSG_AUCTION_SELL_ITEM, "CMSG_AUCTION_SELL_ITEM" }, { CMSG_AUCTION_REMOVE_ITEM, "CMSG_AUCTION_REMOVE_ITEM" }, { CMSG_AUCTION_LIST_ITEMS, "CMSG_AUCTION_LIST_ITEMS" }, { CMSG_AUCTION_LIST_OWNER_ITEMS, "CMSG_AUCTION_LIST_OWNER_ITEMS" }, { CMSG_AUCTION_PLACE_BID, "CMSG_AUCTION_PLACE_BID" }, { SMSG_AUCTION_COMMAND_RESULT, "SMSG_AUCTION_COMMAND_RESULT" }, { SMSG_AUCTION_LIST_RESULT, "SMSG_AUCTION_LIST_RESULT" }, { SMSG_AUCTION_OWNER_LIST_RESULT, "SMSG_AUCTION_OWNER_LIST_RESULT" }, { SMSG_AUCTION_BIDDER_NOTIFICATION, "SMSG_AUCTION_BIDDER_NOTIFICATION" }, { SMSG_AUCTION_OWNER_NOTIFICATION, "SMSG_AUCTION_OWNER_NOTIFICATION" }, { SMSG_PROCRESIST, "SMSG_PROCRESIST" }, { SMSG_STANDSTATE_CHANGE_FAILURE_OBSOLETE, "SMSG_STANDSTATE_CHANGE_FAILURE_OBSOLETE" }, { SMSG_DISPEL_FAILED, "SMSG_DISPEL_FAILED" }, { SMSG_SPELLORDAMAGE_IMMUNE, "SMSG_SPELLORDAMAGE_IMMUNE" }, { CMSG_AUCTION_LIST_BIDDER_ITEMS, "CMSG_AUCTION_LIST_BIDDER_ITEMS" }, { SMSG_AUCTION_BIDDER_LIST_RESULT, "SMSG_AUCTION_BIDDER_LIST_RESULT" }, { SMSG_SET_FLAT_SPELL_MODIFIER, "SMSG_SET_FLAT_SPELL_MODIFIER" }, { SMSG_SET_PCT_SPELL_MODIFIER, "SMSG_SET_PCT_SPELL_MODIFIER" }, { CMSG_SET_AMMO, "CMSG_SET_AMMO" }, { SMSG_CORPSE_RECLAIM_DELAY, "SMSG_CORPSE_RECLAIM_DELAY" }, { CMSG_SET_ACTIVE_MOVER, "CMSG_SET_ACTIVE_MOVER" }, { CMSG_PET_CANCEL_AURA, "CMSG_PET_CANCEL_AURA" }, { CMSG_PLAYER_AI_CHEAT, "CMSG_PLAYER_AI_CHEAT" }, { CMSG_CANCEL_AUTO_REPEAT_SPELL, "CMSG_CANCEL_AUTO_REPEAT_SPELL" }, { MSG_GM_ACCOUNT_ONLINE, "MSG_GM_ACCOUNT_ONLINE" }, { MSG_LIST_STABLED_PETS, "MSG_LIST_STABLED_PETS" }, { CMSG_STABLE_PET, "CMSG_STABLE_PET" }, { CMSG_UNSTABLE_PET, "CMSG_UNSTABLE_PET" }, { CMSG_BUY_STABLE_SLOT, "CMSG_BUY_STABLE_SLOT" }, { SMSG_STABLE_RESULT, "SMSG_STABLE_RESULT" }, { CMSG_STABLE_REVIVE_PET, "CMSG_STABLE_REVIVE_PET" }, { CMSG_STABLE_SWAP_PET, "CMSG_STABLE_SWAP_PET" }, { MSG_QUEST_PUSH_RESULT, "MSG_QUEST_PUSH_RESULT" }, { SMSG_PLAY_MUSIC, "SMSG_PLAY_MUSIC" }, { SMSG_PLAY_OBJECT_SOUND, "SMSG_PLAY_OBJECT_SOUND" }, { CMSG_REQUEST_PET_INFO, "CMSG_REQUEST_PET_INFO" }, { CMSG_FAR_SIGHT, "CMSG_FAR_SIGHT" }, { SMSG_SPELLDISPELLOG, "SMSG_SPELLDISPELLOG" }, { SMSG_DAMAGE_CALC_LOG, "SMSG_DAMAGE_CALC_LOG" }, { CMSG_ENABLE_DAMAGE_LOG, "CMSG_ENABLE_DAMAGE_LOG" }, { CMSG_GROUP_CHANGE_SUB_GROUP, "CMSG_GROUP_CHANGE_SUB_GROUP" }, { CMSG_REQUEST_PARTY_MEMBER_STATS, "CMSG_REQUEST_PARTY_MEMBER_STATS" }, { CMSG_GROUP_SWAP_SUB_GROUP, "CMSG_GROUP_SWAP_SUB_GROUP" }, { CMSG_RESET_FACTION_CHEAT, "CMSG_RESET_FACTION_CHEAT" }, { CMSG_AUTOSTORE_BANK_ITEM, "CMSG_AUTOSTORE_BANK_ITEM" }, { CMSG_AUTOBANK_ITEM, "CMSG_AUTOBANK_ITEM" }, { MSG_QUERY_NEXT_MAIL_TIME, "MSG_QUERY_NEXT_MAIL_TIME" }, { SMSG_RECEIVED_MAIL, "SMSG_RECEIVED_MAIL" }, { SMSG_RAID_GROUP_ONLY, "SMSG_RAID_GROUP_ONLY" }, { CMSG_SET_DURABILITY_CHEAT, "CMSG_SET_DURABILITY_CHEAT" }, { CMSG_SET_PVP_RANK_CHEAT, "CMSG_SET_PVP_RANK_CHEAT" }, { CMSG_ADD_PVP_MEDAL_CHEAT, "CMSG_ADD_PVP_MEDAL_CHEAT" }, { CMSG_DEL_PVP_MEDAL_CHEAT, "CMSG_DEL_PVP_MEDAL_CHEAT" }, { CMSG_SET_PVP_TITLE, "CMSG_SET_PVP_TITLE" }, { SMSG_PVP_CREDIT, "SMSG_PVP_CREDIT" }, { SMSG_AUCTION_REMOVED_NOTIFICATION, "SMSG_AUCTION_REMOVED_NOTIFICATION" }, { CMSG_GROUP_RAID_CONVERT, "CMSG_GROUP_RAID_CONVERT" }, { CMSG_GROUP_ASSISTANT_LEADER, "CMSG_GROUP_ASSISTANT_LEADER" }, { CMSG_BUYBACK_ITEM, "CMSG_BUYBACK_ITEM" }, { SMSG_SERVER_MESSAGE, "SMSG_SERVER_MESSAGE" }, { CMSG_MEETINGSTONE_JOIN, "CMSG_MEETINGSTONE_JOIN" }, { CMSG_MEETINGSTONE_LEAVE, "CMSG_MEETINGSTONE_LEAVE" }, { CMSG_MEETINGSTONE_CHEAT, "CMSG_MEETINGSTONE_CHEAT" }, { SMSG_MEETINGSTONE_SETQUEUE, "SMSG_MEETINGSTONE_SETQUEUE" }, { CMSG_MEETINGSTONE_INFO, "CMSG_MEETINGSTONE_INFO" }, { SMSG_MEETINGSTONE_COMPLETE, "SMSG_MEETINGSTONE_COMPLETE" }, { SMSG_MEETINGSTONE_IN_PROGRESS, "SMSG_MEETINGSTONE_IN_PROGRESS" }, { SMSG_MEETINGSTONE_MEMBER_ADDED, "SMSG_MEETINGSTONE_MEMBER_ADDED" }, { CMSG_GMTICKETSYSTEM_TOGGLE, "CMSG_GMTICKETSYSTEM_TOGGLE" }, { CMSG_CANCEL_GROWTH_AURA, "CMSG_CANCEL_GROWTH_AURA" }, { SMSG_CANCEL_AUTO_REPEAT, "SMSG_CANCEL_AUTO_REPEAT" }, { SMSG_STANDSTATE_UPDATE, "SMSG_STANDSTATE_UPDATE" }, { SMSG_LOOT_ALL_PASSED, "SMSG_LOOT_ALL_PASSED" }, { SMSG_LOOT_ROLL_WON, "SMSG_LOOT_ROLL_WON" }, { CMSG_LOOT_ROLL, "CMSG_LOOT_ROLL" }, { SMSG_LOOT_START_ROLL, "SMSG_LOOT_START_ROLL" }, { SMSG_LOOT_ROLL, "SMSG_LOOT_ROLL" }, { CMSG_LOOT_MASTER_GIVE, "CMSG_LOOT_MASTER_GIVE" }, { SMSG_LOOT_MASTER_LIST, "SMSG_LOOT_MASTER_LIST" }, { SMSG_SET_FORCED_REACTIONS, "SMSG_SET_FORCED_REACTIONS" }, { SMSG_SPELL_FAILED_OTHER, "SMSG_SPELL_FAILED_OTHER" }, { SMSG_GAMEOBJECT_RESET_STATE, "SMSG_GAMEOBJECT_RESET_STATE" }, { CMSG_REPAIR_ITEM, "CMSG_REPAIR_ITEM" }, { SMSG_CHAT_PLAYER_NOT_FOUND, "SMSG_CHAT_PLAYER_NOT_FOUND" }, { MSG_TALENT_WIPE_CONFIRM, "MSG_TALENT_WIPE_CONFIRM" }, { SMSG_SUMMON_REQUEST, "SMSG_SUMMON_REQUEST" }, { CMSG_SUMMON_RESPONSE, "CMSG_SUMMON_RESPONSE" }, { MSG_MOVE_TOGGLE_GRAVITY_CHEAT, "MSG_MOVE_TOGGLE_GRAVITY_CHEAT" }, { SMSG_MONSTER_MOVE_TRANSPORT, "SMSG_MONSTER_MOVE_TRANSPORT" }, { SMSG_PET_BROKEN, "SMSG_PET_BROKEN" }, { MSG_MOVE_FEATHER_FALL, "MSG_MOVE_FEATHER_FALL" }, { MSG_MOVE_WATER_WALK, "MSG_MOVE_WATER_WALK" }, { CMSG_SERVER_BROADCAST, "CMSG_SERVER_BROADCAST" }, { CMSG_SELF_RES, "CMSG_SELF_RES" }, { SMSG_FEIGN_DEATH_RESISTED, "SMSG_FEIGN_DEATH_RESISTED" }, { CMSG_RUN_SCRIPT, "CMSG_RUN_SCRIPT" }, { SMSG_SCRIPT_MESSAGE, "SMSG_SCRIPT_MESSAGE" }, { SMSG_DUEL_COUNTDOWN, "SMSG_DUEL_COUNTDOWN" }, { SMSG_AREA_TRIGGER_MESSAGE, "SMSG_AREA_TRIGGER_MESSAGE" }, { CMSG_TOGGLE_HELM, "CMSG_TOGGLE_HELM" }, { CMSG_TOGGLE_CLOAK, "CMSG_TOGGLE_CLOAK" }, { SMSG_MEETINGSTONE_JOINFAILED, "SMSG_MEETINGSTONE_JOINFAILED" }, { SMSG_PLAYER_SKINNED, "SMSG_PLAYER_SKINNED" }, { SMSG_DURABILITY_DAMAGE_DEATH, "SMSG_DURABILITY_DAMAGE_DEATH" }, { CMSG_SET_EXPLORATION, "CMSG_SET_EXPLORATION" }, { CMSG_SET_ACTIONBAR_TOGGLES, "CMSG_SET_ACTIONBAR_TOGGLES" }, { UMSG_DELETE_GUILD_CHARTER, "UMSG_DELETE_GUILD_CHARTER" }, { MSG_PETITION_RENAME, "MSG_PETITION_RENAME" }, { SMSG_INIT_WORLD_STATES, "SMSG_INIT_WORLD_STATES" }, { SMSG_UPDATE_WORLD_STATE, "SMSG_UPDATE_WORLD_STATE" }, { CMSG_ITEM_NAME_QUERY, "CMSG_ITEM_NAME_QUERY" }, { SMSG_ITEM_NAME_QUERY_RESPONSE, "SMSG_ITEM_NAME_QUERY_RESPONSE" }, { SMSG_PET_ACTION_FEEDBACK, "SMSG_PET_ACTION_FEEDBACK" }, { CMSG_CHAR_RENAME, "CMSG_CHAR_RENAME" }, { SMSG_CHAR_RENAME, "SMSG_CHAR_RENAME" }, { CMSG_MOVE_SPLINE_DONE, "CMSG_MOVE_SPLINE_DONE" }, { CMSG_MOVE_FALL_RESET, "CMSG_MOVE_FALL_RESET" }, { SMSG_INSTANCE_SAVE_CREATED, "SMSG_INSTANCE_SAVE_CREATED" }, { SMSG_RAID_INSTANCE_INFO, "SMSG_RAID_INSTANCE_INFO" }, { CMSG_REQUEST_RAID_INFO, "CMSG_REQUEST_RAID_INFO" }, { CMSG_MOVE_TIME_SKIPPED, "CMSG_MOVE_TIME_SKIPPED" }, { CMSG_MOVE_FEATHER_FALL_ACK, "CMSG_MOVE_FEATHER_FALL_ACK" }, { CMSG_MOVE_WATER_WALK_ACK, "CMSG_MOVE_WATER_WALK_ACK" }, { CMSG_MOVE_NOT_ACTIVE_MOVER, "CMSG_MOVE_NOT_ACTIVE_MOVER" }, { SMSG_PLAY_SOUND, "SMSG_PLAY_SOUND" }, { CMSG_BATTLEFIELD_STATUS, "CMSG_BATTLEFIELD_STATUS" }, { SMSG_BATTLEFIELD_STATUS, "SMSG_BATTLEFIELD_STATUS" }, { CMSG_BATTLEFIELD_PORT, "CMSG_BATTLEFIELD_PORT" }, { MSG_INSPECT_HONOR_STATS, "MSG_INSPECT_HONOR_STATS" }, { CMSG_BATTLEMASTER_HELLO, "CMSG_BATTLEMASTER_HELLO" }, { CMSG_MOVE_START_SWIM_CHEAT, "CMSG_MOVE_START_SWIM_CHEAT" }, { CMSG_MOVE_STOP_SWIM_CHEAT, "CMSG_MOVE_STOP_SWIM_CHEAT" }, { SMSG_FORCE_WALK_SPEED_CHANGE, "SMSG_FORCE_WALK_SPEED_CHANGE" }, { CMSG_FORCE_WALK_SPEED_CHANGE_ACK, "CMSG_FORCE_WALK_SPEED_CHANGE_ACK" }, { SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, "SMSG_FORCE_SWIM_BACK_SPEED_CHANGE" }, { CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, "CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK" }, { SMSG_FORCE_TURN_RATE_CHANGE, "SMSG_FORCE_TURN_RATE_CHANGE" }, { CMSG_FORCE_TURN_RATE_CHANGE_ACK, "CMSG_FORCE_TURN_RATE_CHANGE_ACK" }, { MSG_PVP_LOG_DATA, "MSG_PVP_LOG_DATA" }, { CMSG_LEAVE_BATTLEFIELD, "CMSG_LEAVE_BATTLEFIELD" }, { CMSG_AREA_SPIRIT_HEALER_QUERY, "CMSG_AREA_SPIRIT_HEALER_QUERY" }, { CMSG_AREA_SPIRIT_HEALER_QUEUE, "CMSG_AREA_SPIRIT_HEALER_QUEUE" }, { SMSG_AREA_SPIRIT_HEALER_TIME, "SMSG_AREA_SPIRIT_HEALER_TIME" }, { CMSG_GM_UNTEACH, "CMSG_GM_UNTEACH" }, { SMSG_WARDEN_DATA, "SMSG_WARDEN_DATA" }, { CMSG_WARDEN_DATA, "CMSG_WARDEN_DATA" }, { SMSG_GROUP_JOINED_BATTLEGROUND, "SMSG_GROUP_JOINED_BATTLEGROUND" }, { MSG_BATTLEGROUND_PLAYER_POSITIONS, "MSG_BATTLEGROUND_PLAYER_POSITIONS" }, { CMSG_PET_STOP_ATTACK, "CMSG_PET_STOP_ATTACK" }, { SMSG_BINDER_CONFIRM, "SMSG_BINDER_CONFIRM" }, { SMSG_BATTLEGROUND_PLAYER_JOINED, "SMSG_BATTLEGROUND_PLAYER_JOINED" }, { SMSG_BATTLEGROUND_PLAYER_LEFT, "SMSG_BATTLEGROUND_PLAYER_LEFT" }, { CMSG_BATTLEMASTER_JOIN, "CMSG_BATTLEMASTER_JOIN" }, { SMSG_ADDON_INFO, "SMSG_ADDON_INFO" }, { CMSG_PET_UNLEARN, "CMSG_PET_UNLEARN" }, { SMSG_PET_UNLEARN_CONFIRM, "SMSG_PET_UNLEARN_CONFIRM" }, { SMSG_PARTY_MEMBER_STATS_FULL, "SMSG_PARTY_MEMBER_STATS_FULL" }, { CMSG_PET_SPELL_AUTOCAST, "CMSG_PET_SPELL_AUTOCAST" }, { SMSG_WEATHER, "SMSG_WEATHER" }, { SMSG_PLAY_TIME_WARNING, "SMSG_PLAY_TIME_WARNING" }, { SMSG_MINIGAME_SETUP, "SMSG_MINIGAME_SETUP" }, { SMSG_MINIGAME_STATE, "SMSG_MINIGAME_STATE" }, { CMSG_MINIGAME_MOVE, "CMSG_MINIGAME_MOVE" }, { SMSG_MINIGAME_MOVE_FAILED, "SMSG_MINIGAME_MOVE_FAILED" }, { SMSG_RAID_INSTANCE_MESSAGE, "SMSG_RAID_INSTANCE_MESSAGE" }, { SMSG_COMPRESSED_MOVES, "SMSG_COMPRESSED_MOVES" }, { CMSG_GUILD_INFO_TEXT, "CMSG_GUILD_INFO_TEXT" }, { SMSG_CHAT_RESTRICTED, "SMSG_CHAT_RESTRICTED" }, { SMSG_SPLINE_SET_RUN_SPEED, "SMSG_SPLINE_SET_RUN_SPEED" }, { SMSG_SPLINE_SET_RUN_BACK_SPEED, "SMSG_SPLINE_SET_RUN_BACK_SPEED" }, { SMSG_SPLINE_SET_SWIM_SPEED, "SMSG_SPLINE_SET_SWIM_SPEED" }, { SMSG_SPLINE_SET_WALK_SPEED, "SMSG_SPLINE_SET_WALK_SPEED" }, { SMSG_SPLINE_SET_SWIM_BACK_SPEED, "SMSG_SPLINE_SET_SWIM_BACK_SPEED" }, { SMSG_SPLINE_SET_TURN_RATE, "SMSG_SPLINE_SET_TURN_RATE" }, { SMSG_SPLINE_MOVE_UNROOT, "SMSG_SPLINE_MOVE_UNROOT" }, { SMSG_SPLINE_MOVE_FEATHER_FALL, "SMSG_SPLINE_MOVE_FEATHER_FALL" }, { SMSG_SPLINE_MOVE_NORMAL_FALL, "SMSG_SPLINE_MOVE_NORMAL_FALL" }, { SMSG_SPLINE_MOVE_SET_HOVER, "SMSG_SPLINE_MOVE_SET_HOVER" }, { SMSG_SPLINE_MOVE_UNSET_HOVER, "SMSG_SPLINE_MOVE_UNSET_HOVER" }, { SMSG_SPLINE_MOVE_WATER_WALK, "SMSG_SPLINE_MOVE_WATER_WALK" }, { SMSG_SPLINE_MOVE_LAND_WALK, "SMSG_SPLINE_MOVE_LAND_WALK" }, { SMSG_SPLINE_MOVE_START_SWIM, "SMSG_SPLINE_MOVE_START_SWIM" }, { SMSG_SPLINE_MOVE_STOP_SWIM, "SMSG_SPLINE_MOVE_STOP_SWIM" }, { SMSG_SPLINE_MOVE_SET_RUN_MODE, "SMSG_SPLINE_MOVE_SET_RUN_MODE" }, { SMSG_SPLINE_MOVE_SET_WALK_MODE, "SMSG_SPLINE_MOVE_SET_WALK_MODE" }, { CMSG_GM_NUKE_ACCOUNT, "CMSG_GM_NUKE_ACCOUNT" }, { MSG_GM_DESTROY_CORPSE, "MSG_GM_DESTROY_CORPSE" }, { CMSG_GM_DESTROY_ONLINE_CORPSE, "CMSG_GM_DESTROY_ONLINE_CORPSE" }, { CMSG_ACTIVATETAXIEXPRESS, "CMSG_ACTIVATETAXIEXPRESS" }, { SMSG_SET_FACTION_ATWAR, "SMSG_SET_FACTION_ATWAR" }, { SMSG_GAMETIMEBIAS_SET, "SMSG_GAMETIMEBIAS_SET" }, { CMSG_DEBUG_ACTIONS_START, "CMSG_DEBUG_ACTIONS_START" }, { CMSG_DEBUG_ACTIONS_STOP, "CMSG_DEBUG_ACTIONS_STOP" }, { CMSG_SET_FACTION_INACTIVE, "CMSG_SET_FACTION_INACTIVE" }, { CMSG_SET_WATCHED_FACTION, "CMSG_SET_WATCHED_FACTION" }, { MSG_MOVE_TIME_SKIPPED, "MSG_MOVE_TIME_SKIPPED" }, { SMSG_SPLINE_MOVE_ROOT, "SMSG_SPLINE_MOVE_ROOT" }, { CMSG_SET_EXPLORATION_ALL, "CMSG_SET_EXPLORATION_ALL" }, { SMSG_INVALIDATE_PLAYER, "SMSG_INVALIDATE_PLAYER" }, { CMSG_RESET_INSTANCES, "CMSG_RESET_INSTANCES" }, { SMSG_INSTANCE_RESET, "SMSG_INSTANCE_RESET" }, { SMSG_INSTANCE_RESET_FAILED, "SMSG_INSTANCE_RESET_FAILED" }, { SMSG_UPDATE_LAST_INSTANCE, "SMSG_UPDATE_LAST_INSTANCE" }, { MSG_RAID_TARGET_UPDATE, "MSG_RAID_TARGET_UPDATE" }, { MSG_RAID_READY_CHECK, "MSG_RAID_READY_CHECK" }, { CMSG_LUA_USAGE, "CMSG_LUA_USAGE" }, { SMSG_PET_ACTION_SOUND, "SMSG_PET_ACTION_SOUND" }, { SMSG_PET_DISMISS_SOUND, "SMSG_PET_DISMISS_SOUND" }, { SMSG_GHOSTEE_GONE, "SMSG_GHOSTEE_GONE" }, { CMSG_GM_UPDATE_TICKET_STATUS, "CMSG_GM_UPDATE_TICKET_STATUS" }, { SMSG_GM_TICKET_STATUS_UPDATE, "SMSG_GM_TICKET_STATUS_UPDATE" }, { CMSG_GMSURVEY_SUBMIT, "CMSG_GMSURVEY_SUBMIT" }, { SMSG_UPDATE_INSTANCE_OWNERSHIP, "SMSG_UPDATE_INSTANCE_OWNERSHIP" }, { CMSG_IGNORE_KNOCKBACK_CHEAT, "CMSG_IGNORE_KNOCKBACK_CHEAT" }, { SMSG_CHAT_PLAYER_AMBIGUOUS, "SMSG_CHAT_PLAYER_AMBIGUOUS" }, { MSG_DELAY_GHOST_TELEPORT, "MSG_DELAY_GHOST_TELEPORT" }, { SMSG_SPELLINSTAKILLLOG, "SMSG_SPELLINSTAKILLLOG" }, { SMSG_SPELL_UPDATE_CHAIN_TARGETS, "SMSG_SPELL_UPDATE_CHAIN_TARGETS" }, { CMSG_CHAT_FILTERED, "CMSG_CHAT_FILTERED" }, { SMSG_EXPECTED_SPAM_RECORDS, "SMSG_EXPECTED_SPAM_RECORDS" }, { SMSG_SPELLSTEALLOG, "SMSG_SPELLSTEALLOG" }, { CMSG_LOTTERY_QUERY_OBSOLETE, "CMSG_LOTTERY_QUERY_OBSOLETE" }, { SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, "SMSG_LOTTERY_QUERY_RESULT_OBSOLETE" }, { CMSG_BUY_LOTTERY_TICKET_OBSOLETE, "CMSG_BUY_LOTTERY_TICKET_OBSOLETE" }, { SMSG_LOTTERY_RESULT_OBSOLETE, "SMSG_LOTTERY_RESULT_OBSOLETE" }, { SMSG_CHARACTER_PROFILE, "SMSG_CHARACTER_PROFILE" }, { SMSG_CHARACTER_PROFILE_REALM_CONNECTED, "SMSG_CHARACTER_PROFILE_REALM_CONNECTED" }, { SMSG_DEFENSE_MESSAGE, "SMSG_DEFENSE_MESSAGE" }, { MSG_GM_RESETINSTANCELIMIT, "MSG_GM_RESETINSTANCELIMIT" }, { SMSG_MOTD, "SMSG_MOTD" }, { SMSG_MOVE_SET_FLIGHT, "SMSG_MOVE_SET_FLIGHT" }, { SMSG_MOVE_UNSET_FLIGHT, "SMSG_MOVE_UNSET_FLIGHT" }, { CMSG_MOVE_FLIGHT_ACK, "CMSG_MOVE_FLIGHT_ACK" }, { MSG_MOVE_START_SWIM_CHEAT, "MSG_MOVE_START_SWIM_CHEAT" }, { MSG_MOVE_STOP_SWIM_CHEAT, "MSG_MOVE_STOP_SWIM_CHEAT" }, { CMSG_CANCEL_MOUNT_AURA, "CMSG_CANCEL_MOUNT_AURA" }, { CMSG_CANCEL_TEMP_ENCHANTMENT, "CMSG_CANCEL_TEMP_ENCHANTMENT" }, { CMSG_MAELSTROM_INVALIDATE_CACHE, "CMSG_MAELSTROM_INVALIDATE_CACHE" }, { CMSG_SET_TAXI_BENCHMARK_MODE, "CMSG_SET_TAXI_BENCHMARK_MODE" }, { CMSG_MOVE_CHNG_TRANSPORT, "CMSG_MOVE_CHNG_TRANSPORT" }, { MSG_PARTY_ASSIGNMENT, "MSG_PARTY_ASSIGNMENT" }, { SMSG_OFFER_PETITION_ERROR, "SMSG_OFFER_PETITION_ERROR" }, { SMSG_RESET_FAILED_NOTIFY, "SMSG_RESET_FAILED_NOTIFY" }, { SMSG_REAL_GROUP_UPDATE, "SMSG_REAL_GROUP_UPDATE" }, { SMSG_INIT_EXTRA_AURA_INFO, "SMSG_INIT_EXTRA_AURA_INFO" }, { SMSG_SET_EXTRA_AURA_INFO, "SMSG_SET_EXTRA_AURA_INFO" }, { SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE, "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE" }, { SMSG_SPELL_CHANCE_PROC_LOG, "SMSG_SPELL_CHANCE_PROC_LOG" }, { CMSG_MOVE_SET_RUN_SPEED, "CMSG_MOVE_SET_RUN_SPEED" }, { SMSG_DISMOUNT, "SMSG_DISMOUNT" }, { MSG_RAID_READY_CHECK_CONFIRM, "MSG_RAID_READY_CHECK_CONFIRM" }, { SMSG_CLEAR_TARGET, "SMSG_CLEAR_TARGET" }, { CMSG_BOT_DETECTED, "CMSG_BOT_DETECTED" }, { SMSG_KICK_REASON, "SMSG_KICK_REASON" }, { MSG_RAID_READY_CHECK_FINISHED, "MSG_RAID_READY_CHECK_FINISHED" }, { CMSG_TARGET_CAST, "CMSG_TARGET_CAST" }, { CMSG_TARGET_SCRIPT_CAST, "CMSG_TARGET_SCRIPT_CAST" }, { CMSG_CHANNEL_DISPLAY_LIST, "CMSG_CHANNEL_DISPLAY_LIST" }, { CMSG_GET_CHANNEL_MEMBER_COUNT, "CMSG_GET_CHANNEL_MEMBER_COUNT" }, { SMSG_CHANNEL_MEMBER_COUNT, "SMSG_CHANNEL_MEMBER_COUNT" }, { CMSG_DEBUG_LIST_TARGETS, "CMSG_DEBUG_LIST_TARGETS" }, { SMSG_DEBUG_LIST_TARGETS, "SMSG_DEBUG_LIST_TARGETS" }, { CMSG_PARTY_SILENCE, "CMSG_PARTY_SILENCE" }, { CMSG_PARTY_UNSILENCE, "CMSG_PARTY_UNSILENCE" }, { MSG_NOTIFY_PARTY_SQUELCH, "MSG_NOTIFY_PARTY_SQUELCH" }, { SMSG_COMSAT_RECONNECT_TRY, "SMSG_COMSAT_RECONNECT_TRY" }, { SMSG_COMSAT_DISCONNECT, "SMSG_COMSAT_DISCONNECT" }, { SMSG_COMSAT_CONNECT_FAIL, "SMSG_COMSAT_CONNECT_FAIL" }, { CMSG_SET_CHANNEL_WATCH, "CMSG_SET_CHANNEL_WATCH" }, { SMSG_USERLIST_ADD, "SMSG_USERLIST_ADD" }, { SMSG_USERLIST_REMOVE, "SMSG_USERLIST_REMOVE" }, { SMSG_USERLIST_UPDATE, "SMSG_USERLIST_UPDATE" }, { CMSG_CLEAR_CHANNEL_WATCH, "CMSG_CLEAR_CHANNEL_WATCH" }, { SMSG_GOGOGO_OBSOLETE, "SMSG_GOGOGO_OBSOLETE" }, { SMSG_ECHO_PARTY_SQUELCH, "SMSG_ECHO_PARTY_SQUELCH" }, { CMSG_SPELLCLICK, "CMSG_SPELLCLICK" }, { SMSG_LOOT_LIST, "SMSG_LOOT_LIST" }, { MSG_GUILD_PERMISSIONS, "MSG_GUILD_PERMISSIONS" }, { MSG_GUILD_EVENT_LOG_QUERY, "MSG_GUILD_EVENT_LOG_QUERY" }, { CMSG_MAELSTROM_RENAME_GUILD, "CMSG_MAELSTROM_RENAME_GUILD" }, { CMSG_GET_MIRRORIMAGE_DATA, "CMSG_GET_MIRRORIMAGE_DATA" }, { SMSG_MIRRORIMAGE_DATA, "SMSG_MIRRORIMAGE_DATA" }, { SMSG_FORCE_DISPLAY_UPDATE, "SMSG_FORCE_DISPLAY_UPDATE" }, { SMSG_SPELL_CHANCE_RESIST_PUSHBACK, "SMSG_SPELL_CHANCE_RESIST_PUSHBACK" }, { CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, "CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT" }, { SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, "SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT" }, { CMSG_KEEP_ALIVE, "CMSG_KEEP_ALIVE" }, { SMSG_RAID_READY_CHECK_ERROR, "SMSG_RAID_READY_CHECK_ERROR" }, { CMSG_OPT_OUT_OF_LOOT, "CMSG_OPT_OUT_OF_LOOT" }, { CMSG_SET_GRANTABLE_LEVELS, "CMSG_SET_GRANTABLE_LEVELS" }, { CMSG_GRANT_LEVEL, "CMSG_GRANT_LEVEL" }, { CMSG_DECLINE_CHANNEL_INVITE, "CMSG_DECLINE_CHANNEL_INVITE" }, { CMSG_GROUPACTION_THROTTLED, "CMSG_GROUPACTION_THROTTLED" }, { SMSG_OVERRIDE_LIGHT, "SMSG_OVERRIDE_LIGHT" }, { SMSG_TOTEM_CREATED, "SMSG_TOTEM_CREATED" }, { CMSG_TOTEM_DESTROYED, "CMSG_TOTEM_DESTROYED" }, { CMSG_EXPIRE_RAID_INSTANCE, "CMSG_EXPIRE_RAID_INSTANCE" }, { CMSG_NO_SPELL_VARIANCE, "CMSG_NO_SPELL_VARIANCE" }, { CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, "CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY" }, { SMSG_QUESTGIVER_STATUS_MULTIPLE, "SMSG_QUESTGIVER_STATUS_MULTIPLE" }, { CMSG_QUERY_SERVER_BUCK_DATA, "CMSG_QUERY_SERVER_BUCK_DATA" }, { CMSG_CLEAR_SERVER_BUCK_DATA, "CMSG_CLEAR_SERVER_BUCK_DATA" }, { SMSG_SERVER_BUCK_DATA, "SMSG_SERVER_BUCK_DATA" }, { SMSG_SEND_UNLEARN_SPELLS, "SMSG_SEND_UNLEARN_SPELLS" }, { SMSG_PROPOSE_LEVEL_GRANT, "SMSG_PROPOSE_LEVEL_GRANT" }, { CMSG_ACCEPT_LEVEL_GRANT, "CMSG_ACCEPT_LEVEL_GRANT" }, { SMSG_REFER_A_FRIEND_FAILURE, "SMSG_REFER_A_FRIEND_FAILURE" }, { SMSG_SUMMON_CANCEL, "SMSG_SUMMON_CANCEL" }, { 0, NULL } }; /*! Decrypts the header after the session key has been deducted as described in the top level comment. */ static guint8* get_decrypted_header(const guint8 session_key[WOWW_SESSION_KEY_LENGTH], guint8* idx, guint8* last_encrypted_value, const guint8* header, guint8 header_size) { guint8* decrypted_header = wmem_alloc0(wmem_file_scope(), WOWW_HEADER_ARRAY_ALLOC_SIZE); for (guint8 i = 0; i < header_size; i++) { // x = (E - L) ^ S as described in top level comment decrypted_header[i] = (header[i] - *last_encrypted_value) ^ session_key[*idx]; *last_encrypted_value = header[i]; *idx = (*idx + 1) % WOWW_SESSION_KEY_LENGTH; } return decrypted_header; } /*! Deduces the session key values as described in the top level comment. */ static void deduce_header(guint8 session_key[WOWW_SESSION_KEY_LENGTH], bool known_indices[WOWW_SESSION_KEY_LENGTH], const guint8* header, WowwParticipant_t* participant) { // Skip size field (2 bytes) and 2 least significant bytes of opcode field participant->idx = (participant->idx + 2 + 2) % WOWW_SESSION_KEY_LENGTH; // Set last encrypted value to what it's supposed to be participant->last_encrypted_value = header[3]; // 0 ^ (E - L) as described in top level comment session_key[participant->idx] = 0 ^ (header[4] - participant->last_encrypted_value); known_indices[participant->idx] = true; participant->idx = (participant->idx + 1) % WOWW_SESSION_KEY_LENGTH; participant->last_encrypted_value = header[4]; session_key[participant->idx] = 0 ^ (header[5] - participant->last_encrypted_value); known_indices[participant->idx] = true; participant->idx = (participant->idx + 1) % WOWW_SESSION_KEY_LENGTH; participant->last_encrypted_value = header[5]; } /*! Returns true if all necessary values of the session key are fully known. */ static gboolean session_key_is_fully_deduced(const bool known_indices[WOWW_SESSION_KEY_LENGTH], guint8 header_length, guint8 start_index) { gboolean fully_deduced = true; for (guint8 i = 0; i < header_length; i++) { if (!known_indices[(start_index + i) % WOWW_SESSION_KEY_LENGTH]) { fully_deduced = false; } } return fully_deduced; } /*! Returns either a pointer to a valid decrypted header, or NULL if no such header exists yet. */ static WowwDecryptedHeader_t* handle_packet_header(packet_info* pinfo, tvbuff_t* tvb, WowwParticipant_t* participant, WowwConversation_t* wowwConversation, guint8 headerSize, guint8 index_in_pdu, gint tvb_offset) { guint64 key = ((guint64)index_in_pdu << 32) | pinfo->num; guint8* decrypted_header = wmem_map_lookup(wowwConversation->decrypted_headers, &key); if (decrypted_header) { // Header has already been decrypted return (WowwDecryptedHeader_t*)decrypted_header; } if (participant->stopped_at != 0 && participant->stopped_at != key) { // We can't continue decrypt further server messages since we // don't know the status of the session key index for any message // except the last one we couldn't decrypt. return NULL; } // First time we see this header, we need to decrypt it guint8* header = wmem_alloc0(wmem_packet_scope(), WOWW_HEADER_ARRAY_ALLOC_SIZE); for (int i = 0; i < headerSize; i++) { header[i] = tvb_get_guint8(tvb, tvb_offset + i); } // If we're seeing the first header if (!participant->unencrypted_packet_encountered) { // Packet is unencrypted, no need to do anything // There is only one unencrypted header each for server and client participant->unencrypted_packet_encountered = true; decrypted_header = wmem_alloc0(wmem_file_scope(), WOWW_HEADER_ARRAY_ALLOC_SIZE); memcpy(decrypted_header, header, headerSize); guint64* allocated_key = wmem_alloc0(wmem_file_scope(), sizeof(guint64)); *allocated_key = key; wmem_map_insert(wowwConversation->decrypted_headers, allocated_key, decrypted_header); return (WowwDecryptedHeader_t*)decrypted_header; } WowwPreviousValues_t * original_header_values = wmem_map_lookup(wowwConversation->headers_need_decryption, &key); if (original_header_values && !session_key_is_fully_deduced(wowwConversation->known_indices, headerSize, original_header_values->idx)) { // If we have seen the header before AND // we still can't decrypt it // there's nothing to do but wait until we get more information return NULL; } if (!original_header_values && !session_key_is_fully_deduced(wowwConversation->known_indices, headerSize, participant->idx)) { // If we haven't seen the header before AND // we can't decrypt it now // we make sure it gets decrypted later WowwPreviousValues_t* array_index = wmem_alloc0(wmem_file_scope(), sizeof(WowwPreviousValues_t)); array_index->idx = participant->idx; array_index->last_encrypted_value = participant->last_encrypted_value; guint64* allocated_key = wmem_alloc0(wmem_file_scope(), sizeof(guint64)); *allocated_key = key; wmem_map_insert(wowwConversation->headers_need_decryption, allocated_key, array_index); // If it's a server header we can use it to deduce the session key if (WOWW_CLIENT_TO_SERVER) { deduce_header(wowwConversation->session_key, wowwConversation->known_indices, header, participant); } else { // We don't know if this PDU contains several messages or just one, so we need // to stop parsing server messages until we have fully decrypted this one. participant->stopped_at = key; // Skip the packet, but remember to acknowledge that values changed participant->idx = (participant->idx + headerSize) % WOWW_SESSION_KEY_LENGTH; participant->last_encrypted_value = header[headerSize - 1]; } return NULL; } guint8* idx = &participant->idx; guint8* last_encrypted_value = &participant->last_encrypted_value; // If this is an out of order packet we must use the original state if (original_header_values) { // We can now (as best as possible) assume that decryption // is in the right place. participant->stopped_at = 0; // We do not care about how these values are mutated since // they are never going to be used again. idx = &original_header_values->idx; last_encrypted_value = &original_header_values->last_encrypted_value; // No need to decrypt it again wmem_map_remove(wowwConversation->headers_need_decryption, &key); } decrypted_header = get_decrypted_header(wowwConversation->session_key, idx, last_encrypted_value, header, headerSize); guint64* allocated_key = wmem_alloc0(wmem_file_scope(), sizeof(guint64)); *allocated_key = key; // The header has been fully decrypted, cache it for future use wmem_map_insert(wowwConversation->decrypted_headers, allocated_key, decrypted_header); return (WowwDecryptedHeader_t*)decrypted_header; } static gint32 get_null_terminated_string_length( tvbuff_t* tvb, gint32 offset) { const gint32 maximum_length = 0x7FFF; for (gint32 length = 0; length < maximum_length; length++) { guint8 character = tvb_get_guint8(tvb, offset + length); if (character == 0) { // Include the null character in the length return length + 1; } } return 0; } static void add_cstring(ptvcursor_t* ptv, const int* hf) { gint32 len = get_null_terminated_string_length(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv)); ptvcursor_add(ptv, *hf, len, ENC_UTF_8); } static void add_sized_cstring(ptvcursor_t* ptv, const int* hf) { ptvcursor_add(ptv, hf_woww_string_length, 4, ENC_LITTLE_ENDIAN); gint32 len = get_null_terminated_string_length(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv)); ptvcursor_add(ptv, *hf, len, ENC_UTF_8); } static void add_aura_mask(ptvcursor_t* ptv) { guint32 mask = 0; ptvcursor_add_ret_uint(ptv, hf_woww_aura_mask, 4, ENC_LITTLE_ENDIAN, &mask); for (gint i = 0; i < 32; ++i) { if (mask & (1u << i)) { ptvcursor_add(ptv, hf_woww_aura, 4, ENC_LITTLE_ENDIAN); } } } static void add_monster_move_spline(ptvcursor_t* ptv) { guint32 amount_of_splines = 0; ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_splines, 4, ENC_LITTLE_ENDIAN, &amount_of_splines); if (amount_of_splines >= 1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Unpacked Spline"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } for (guint32 i = 1; i < amount_of_splines; ++i) { ptvcursor_add(ptv, hf_woww_packed_spline, 4, ENC_LITTLE_ENDIAN); } } static void add_update_mask(ptvcursor_t* ptv, packet_info* pinfo) { guint32 amount_of_masks = 0; ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_masks, 1, ENC_NA, &amount_of_masks); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Update Mask"); guint32* masks = (guint32*)wmem_alloc0(wmem_packet_scope(), amount_of_masks * 4); for (guint32 i = 0; i < amount_of_masks; ++i) { ptvcursor_add_ret_uint(ptv, hf_woww_update_mask, 4, ENC_LITTLE_ENDIAN, masks + i); } ptvcursor_pop_subtree(ptv); guint32 amount_of_indices = 0; for (guint32 mask = 0; mask < amount_of_masks; ++mask) { for (guint bit = 0; bit < 32; ++bit) { if (masks[mask] & (1u << bit)) { amount_of_indices += 1; } } } guint32 indices_length = amount_of_indices * 4; guint32* indices = (guint32*)wmem_alloc0(wmem_packet_scope(), indices_length); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Update Mask Values"); tvbuff_t* tvb = ptvcursor_tvbuff(ptv); tvbuff_t* next_tvb = tvb_new_child_real_data(tvb, (guint8*)indices, indices_length, indices_length); add_new_data_source(pinfo, next_tvb, "Update Mask Indices"); guint32 indices_index = 0; for (guint32 mask = 0; mask < amount_of_masks; ++mask) { for (guint32 i = 0; i < 32; ++i) { if (masks[mask] & (1u << i)) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Update Mask Pair"); indices[indices_index] = (32 * mask) + i; proto_tree* tree = ptvcursor_tree(ptv); proto_tree_add_item(tree, hf_woww_update_mask_index, next_tvb, 4 * indices_index, 4, ENC_LITTLE_ENDIAN); indices_index += 1; ptvcursor_add(ptv, hf_woww_update_mask_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } } ptvcursor_pop_subtree(ptv); } static void add_packed_guid(ptvcursor_t* ptv, packet_info* pinfo) { tvbuff_t* tvb = ptvcursor_tvbuff(ptv); proto_tree* tree = ptvcursor_tree(ptv); guint8 byte_mask = tvb_get_guint8(tvb, ptvcursor_current_offset(ptv)); ptvcursor_advance(ptv, 1); guint8* guid = (guint8*)wmem_alloc(wmem_packet_scope(), 8); for (gint i = 0; i < 8; ++i) { if (byte_mask & (1 << i)) { guid[i] = tvb_get_guint8(tvb, ptvcursor_current_offset(ptv)); ptvcursor_advance(ptv, 1); } } tvbuff_t* next_tvb = tvb_new_child_real_data(tvb, (guint8*)guid, 8, 8); add_new_data_source(pinfo, next_tvb, "Packed Guid"); proto_tree_add_item(tree, hf_woww_guid, next_tvb, 0, 8, ENC_LITTLE_ENDIAN); } static void add_body_fields(guint32 header_opcode, proto_tree* tree, tvbuff_t* tvb, gint32 offset, gint32 offset_packet_end, packet_info* pinfo) { guint32 len = 0; tvbuff_t* compressed_tvb = NULL; /* AUTOGENERATED_START_VARIABLES */ guint32 action = 0; guint32 amount_of_auras = 0; guint32 amount_of_carriers = 0; guint32 amount_of_characters = 0; guint32 amount_of_choice_item_rewards = 0; guint32 amount_of_cooldowns = 0; guint32 amount_of_damages = 0; guint32 amount_of_effects = 0; guint32 amount_of_emotes = 0; guint32 amount_of_entries = 0; guint32 amount_of_events = 0; guint32 amount_of_extra_fields = 0; guint32 amount_of_faction_standings = 0; guint32 amount_of_factions = 0; guint32 amount_of_friends = 0; guint32 amount_of_gossip_items = 0; guint32 amount_of_hits = 0; guint32 amount_of_ignored = 0; guint32 amount_of_item_rewards = 0; guint32 amount_of_items = 0; guint32 amount_of_mails = 0; guint32 amount_of_members = 0; guint32 amount_of_misses = 0; guint32 amount_of_nodes = 0; guint32 amount_of_objects = 0; guint32 amount_of_outbid_items = 0; guint32 amount_of_petitions = 0; guint32 amount_of_pets = 0; guint32 amount_of_players = 0; guint32 amount_of_quests = 0; guint32 amount_of_raid_infos = 0; guint32 amount_of_reactions = 0; guint32 amount_of_records = 0; guint32 amount_of_required_items = 0; guint32 amount_of_rights = 0; guint32 amount_of_signatures = 0; guint32 amount_of_spells = 0; guint32 amount_of_states = 0; guint32 amount_of_strings = 0; guint32 amount_of_targets = 0; guint32 amount_of_teammates = 0; guint32 amount_of_zones = 0; guint32 aura_type = 0; guint32 category = 0; guint32 chat_type = 0; guint32 cooldown_count = 0; guint32 count = 0; guint32 effect = 0; guint32 exp_type = 0; guint32 flags = 0; guint32 info_block = 0; guint32 key_version = 0; guint32 listed_players = 0; guint32 loot_method = 0; guint32 map = 0; guint32 mask = 0; guint32 message_type = 0; guint32 miss_info = 0; guint32 move_type = 0; guint32 node_count = 0; guint32 number_of_battlegrounds = 0; guint32 opcode = 0; guint32 reason = 0; guint32 result = 0; guint32 result2 = 0; guint32 spell_count = 0; guint32 spline_flags = 0; guint32 status = 0; guint32 status_id = 0; guint32 target_flags = 0; guint32 target_index = 0; guint32 update_flag = 0; guint32 update_type = 0; guint32 url_info = 0; /* AUTOGENERATED_END_VARIABLES */ ptvcursor_t* ptv = ptvcursor_new(wmem_packet_scope(), tree, tvb, offset); /* AUTOGENERATED_START_PARSER */ switch (header_opcode) { case CMSG_ACCEPT_TRADE: ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case CMSG_ACTIVATETAXI: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_node, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destination_node, 4, ENC_LITTLE_ENDIAN); break; case CMSG_ACTIVATETAXIEXPRESS: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_total_cost, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_node_count, 4, ENC_LITTLE_ENDIAN, &node_count); for (guint32 i1 = 0; i1 < node_count; ++i1) { ptvcursor_add(ptv, hf_woww_nodes, 4, ENC_LITTLE_ENDIAN); } break; case CMSG_ADD_FRIEND: add_cstring(ptv, &hf_woww_name); break; case CMSG_ADD_IGNORE: add_cstring(ptv, &hf_woww_name); break; case CMSG_AREATRIGGER: ptvcursor_add(ptv, hf_woww_trigger_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_AREA_SPIRIT_HEALER_QUERY: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_AREA_SPIRIT_HEALER_QUEUE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_ATTACKSWING: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_AUCTION_LIST_BIDDER_ITEMS: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_start_from_page, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_outbid_items, 4, ENC_LITTLE_ENDIAN, &amount_of_outbid_items); for (guint32 i1 = 0; i1 < amount_of_outbid_items; ++i1) { ptvcursor_add(ptv, hf_woww_outbid_item_ids, 4, ENC_LITTLE_ENDIAN); } break; case CMSG_AUCTION_LIST_ITEMS: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_list_start_item, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_searched_name); ptvcursor_add(ptv, hf_woww_minimum_level, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_maximum_level, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_slot_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_main_category, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_sub_category, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_quality, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_usable, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUCTION_LIST_OWNER_ITEMS: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_list_from, 4, ENC_LITTLE_ENDIAN); break; case CMSG_AUCTION_PLACE_BID: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_price, 4, ENC_LITTLE_ENDIAN); break; case CMSG_AUCTION_REMOVE_ITEM: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_AUCTION_SELL_ITEM: ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_starting_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buyout, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_duration_in_minutes, 4, ENC_LITTLE_ENDIAN); break; case CMSG_AUTH_SESSION: ptvcursor_add(ptv, hf_woww_build, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_server_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_username); ptvcursor_add(ptv, hf_woww_client_seed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_client_proof, 20, ENC_NA); ptvcursor_add(ptv, hf_woww_decompressed_addon_info_size, 4, ENC_LITTLE_ENDIAN); compressed_tvb = tvb_uncompress(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv), offset_packet_end - ptvcursor_current_offset(ptv)); if (compressed_tvb != NULL) { ptvcursor_t* old_ptv = ptv; ptv = ptvcursor_new(wmem_packet_scope(), tree, compressed_tvb, 0); gint compression_end = tvb_reported_length(compressed_tvb); while (ptvcursor_current_offset(ptv) < compression_end) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "AddonInfo"); add_cstring(ptv, &hf_woww_addon_name); ptvcursor_add(ptv, hf_woww_addon_has_signature, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_addon_crc, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_addon_extra_crc, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_free(ptv); ptv = old_ptv; compressed_tvb = NULL; } break; case CMSG_AUTOBANK_ITEM: ptvcursor_add(ptv, hf_woww_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot_index, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUTOEQUIP_ITEM: ptvcursor_add(ptv, hf_woww_source_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUTOEQUIP_ITEM_SLOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destination_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUTOSTORE_BAG_ITEM: ptvcursor_add(ptv, hf_woww_source_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destination_bag, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUTOSTORE_BANK_ITEM: ptvcursor_add(ptv, hf_woww_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot_index, 1, ENC_LITTLE_ENDIAN); break; case CMSG_AUTOSTORE_LOOT_ITEM: ptvcursor_add(ptv, hf_woww_item_slot_int, 1, ENC_LITTLE_ENDIAN); break; case CMSG_BANKER_ACTIVATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_BATTLEFIELD_JOIN: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case CMSG_BATTLEFIELD_LIST: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case CMSG_BATTLEFIELD_PORT: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_battlefield_port_action, 1, ENC_LITTLE_ENDIAN); break; case CMSG_BATTLEMASTER_HELLO: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_BATTLEMASTER_JOIN: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_instance_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_join_as_group, 1, ENC_NA); break; case CMSG_BINDER_ACTIVATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_BUG: ptvcursor_add(ptv, hf_woww_suggestion, 4, ENC_LITTLE_ENDIAN); add_sized_cstring(ptv, &hf_woww_content); add_sized_cstring(ptv, &hf_woww_bug_type); break; case CMSG_BUYBACK_ITEM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buyback_slot, 4, ENC_LITTLE_ENDIAN); break; case CMSG_BUY_BANK_SLOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_BUY_ITEM: ptvcursor_add(ptv, hf_woww_vendor, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); break; case CMSG_BUY_ITEM_IN_SLOT: ptvcursor_add(ptv, hf_woww_vendor, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 1, ENC_LITTLE_ENDIAN); break; case CMSG_BUY_STABLE_SLOT: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); break; case CMSG_CANCEL_AURA: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_CANCEL_CAST: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_CANCEL_CHANNELLING: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_CAST_SPELL: ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCastTargets"); ptvcursor_add_ret_uint(ptv, hf_woww_spell_cast_target_flags, 2, ENC_LITTLE_ENDIAN, &target_flags); if (target_flags & SPELL_CAST_TARGET_FLAGS_UNIT) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_GAMEOBJECT) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_OBJECT_UNK) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_ITEM) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_TRADE_ITEM) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_DEST_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_STRING) { add_cstring(ptv, &hf_woww_target_string); } if (target_flags & SPELL_CAST_TARGET_FLAGS_CORPSE) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_PVP_CORPSE) { add_packed_guid(ptv, pinfo); } ptvcursor_pop_subtree(ptv); break; case CMSG_CHANNEL_ANNOUNCEMENTS: add_cstring(ptv, &hf_woww_channel_name); break; case CMSG_CHANNEL_BAN: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_INVITE: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_KICK: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_LIST: add_cstring(ptv, &hf_woww_channel_name); break; case CMSG_CHANNEL_MODERATE: add_cstring(ptv, &hf_woww_channel_name); break; case CMSG_CHANNEL_MODERATOR: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_MUTE: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_OWNER: add_cstring(ptv, &hf_woww_channel_name); break; case CMSG_CHANNEL_PASSWORD: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_channel_password); break; case CMSG_CHANNEL_SET_OWNER: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_new_owner); break; case CMSG_CHANNEL_UNBAN: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_UNMODERATOR: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHANNEL_UNMUTE: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_player_name); break; case CMSG_CHAR_CREATE: add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_race, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gender, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_skin_color, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_face, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_hair_style, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_hair_color, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_facial_hair, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_outfit_id, 1, ENC_LITTLE_ENDIAN); break; case CMSG_CHAR_DELETE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_CHAR_RENAME: ptvcursor_add(ptv, hf_woww_character_guid, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_new_name); break; case CMSG_CHAT_IGNORED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_CLEAR_TRADE_ITEM: ptvcursor_add(ptv, hf_woww_trade_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_CREATURE_QUERY: ptvcursor_add(ptv, hf_woww_creature, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_DBLOOKUP: add_cstring(ptv, &hf_woww_query); break; case CMSG_DEL_FRIEND: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_DEL_IGNORE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_DESTROYITEM: ptvcursor_add(ptv, hf_woww_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); break; case CMSG_DUEL_ACCEPTED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_DUEL_CANCELLED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_EMOTE: ptvcursor_add(ptv, hf_woww_emote_enum, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FAR_SIGHT: ptvcursor_add(ptv, hf_woww_far_sight_operation, 1, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_MOVE_ROOT_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case CMSG_FORCE_MOVE_UNROOT_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_TURN_RATE_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_new_speed, 4, ENC_LITTLE_ENDIAN); break; case CMSG_GAMEOBJECT_QUERY: ptvcursor_add(ptv, hf_woww_entry_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GAMEOBJ_USE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GET_MAIL_LIST: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GMSURVEY_SUBMIT: ptvcursor_add(ptv, hf_woww_survey_id, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 10; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "GmSurveyQuestion %i", i1); ptvcursor_add(ptv, hf_woww_question_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_answer, 1, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_comment); ptvcursor_pop_subtree(ptv); } add_cstring(ptv, &hf_woww_answer_comment); break; case CMSG_GMTICKET_CREATE: ptvcursor_add_ret_uint(ptv, hf_woww_gm_ticket_type, 1, ENC_LITTLE_ENDIAN, &category); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); add_cstring(ptv, &hf_woww_message); add_cstring(ptv, &hf_woww_reserved_for_future_use); if (category == GM_TICKET_TYPE_BEHAVIOR_HARASSMENT) { ptvcursor_add(ptv, hf_woww_chat_data_line_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_chat_data_size_uncompressed, 4, ENC_LITTLE_ENDIAN); compressed_tvb = tvb_uncompress(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv), offset_packet_end - ptvcursor_current_offset(ptv)); if (compressed_tvb != NULL) { ptvcursor_t* old_ptv = ptv; ptv = ptvcursor_new(wmem_packet_scope(), tree, compressed_tvb, 0); len = offset_packet_end - ptvcursor_current_offset(ptv); ptvcursor_add(ptv, hf_woww_compressed_chat_data, len, ENC_NA); ptvcursor_free(ptv); ptv = old_ptv; compressed_tvb = NULL; } } break; case CMSG_GMTICKET_UPDATETEXT: ptvcursor_add(ptv, hf_woww_gm_ticket_type, 1, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_message); break; case CMSG_GOSSIP_HELLO: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GOSSIP_SELECT_OPTION: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gossip_list_id, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { add_cstring(ptv, &hf_woww_code); } break; case CMSG_GROUP_ASSISTANT_LEADER: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_set_assistant, 1, ENC_NA); break; case CMSG_GROUP_CHANGE_SUB_GROUP: add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_group_number, 1, ENC_LITTLE_ENDIAN); break; case CMSG_GROUP_INVITE: add_cstring(ptv, &hf_woww_name); break; case CMSG_GROUP_SET_LEADER: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GROUP_SWAP_SUB_GROUP: add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_swap_with_name); break; case CMSG_GROUP_UNINVITE: add_cstring(ptv, &hf_woww_name); break; case CMSG_GROUP_UNINVITE_GUID: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_GUILD_ADD_RANK: add_cstring(ptv, &hf_woww_rank_name); break; case CMSG_GUILD_CREATE: add_cstring(ptv, &hf_woww_guild_name); break; case CMSG_GUILD_DEMOTE: add_cstring(ptv, &hf_woww_player_name); break; case CMSG_GUILD_INFO_TEXT: add_cstring(ptv, &hf_woww_guild_info); break; case CMSG_GUILD_INVITE: add_cstring(ptv, &hf_woww_invited_player); break; case CMSG_GUILD_LEADER: add_cstring(ptv, &hf_woww_new_guild_leader_name); break; case CMSG_GUILD_MOTD: add_cstring(ptv, &hf_woww_message_of_the_day); break; case CMSG_GUILD_PROMOTE: add_cstring(ptv, &hf_woww_player_name); break; case CMSG_GUILD_QUERY: ptvcursor_add(ptv, hf_woww_guild_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_GUILD_RANK: ptvcursor_add(ptv, hf_woww_rank_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_rights, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_rank_name); break; case CMSG_GUILD_REMOVE: add_cstring(ptv, &hf_woww_player_name); break; case CMSG_GUILD_SET_OFFICER_NOTE: add_cstring(ptv, &hf_woww_player_name); add_cstring(ptv, &hf_woww_note); break; case CMSG_GUILD_SET_PUBLIC_NOTE: add_cstring(ptv, &hf_woww_player_name); add_cstring(ptv, &hf_woww_note); break; case CMSG_INITIATE_TRADE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_INSPECT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_ITEM_NAME_QUERY: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_ITEM_QUERY_SINGLE: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_ITEM_TEXT_QUERY: ptvcursor_add(ptv, hf_woww_item_text_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case CMSG_JOIN_CHANNEL: add_cstring(ptv, &hf_woww_channel_name); add_cstring(ptv, &hf_woww_channel_password); break; case CMSG_LEARN_TALENT: ptvcursor_add(ptv, hf_woww_talent, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_requested_rank, 4, ENC_LITTLE_ENDIAN); break; case CMSG_LEAVE_BATTLEFIELD: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case CMSG_LEAVE_CHANNEL: add_cstring(ptv, &hf_woww_channel_name); break; case CMSG_LIST_INVENTORY: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_LOOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_LOOT_MASTER_GIVE: ptvcursor_add(ptv, hf_woww_loot, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot_id, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); break; case CMSG_LOOT_METHOD: ptvcursor_add(ptv, hf_woww_group_loot_setting, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_master, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_quality, 4, ENC_LITTLE_ENDIAN); break; case CMSG_LOOT_RELEASE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_LOOT_ROLL: ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_slot_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_roll_vote, 1, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_CREATE_TEXT_ITEM: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_template_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_DELETE: ptvcursor_add(ptv, hf_woww_mailbox_id, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_MARK_AS_READ: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_RETURN_TO_SENDER: ptvcursor_add(ptv, hf_woww_mailbox_id, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_TAKE_ITEM: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MAIL_TAKE_MONEY: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MEETINGSTONE_JOIN: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_MESSAGECHAT: ptvcursor_add_ret_uint(ptv, hf_woww_chat_type, 4, ENC_LITTLE_ENDIAN, &chat_type); ptvcursor_add(ptv, hf_woww_language, 4, ENC_LITTLE_ENDIAN); if (chat_type == CHAT_TYPE_WHISPER) { add_cstring(ptv, &hf_woww_target_player); } else if (chat_type == CHAT_TYPE_CHANNEL) { add_cstring(ptv, &hf_woww_channel); } add_cstring(ptv, &hf_woww_message); break; case CMSG_MOVE_FALL_RESET: ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case CMSG_MOVE_FEATHER_FALL_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_apply, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MOVE_HOVER_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_is_applied, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MOVE_KNOCK_BACK_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case CMSG_MOVE_NOT_ACTIVE_MOVER: ptvcursor_add(ptv, hf_woww_old_mover, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case CMSG_MOVE_SET_RAW_POSITION: ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MOVE_SPLINE_DONE: ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MOVE_TIME_SKIPPED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_lag, 4, ENC_LITTLE_ENDIAN); break; case CMSG_MOVE_WATER_WALK_ACK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_apply, 4, ENC_LITTLE_ENDIAN); break; case CMSG_NAME_QUERY: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_NPC_TEXT_QUERY: ptvcursor_add(ptv, hf_woww_text_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_OFFER_PETITION: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case CMSG_OPEN_ITEM: ptvcursor_add(ptv, hf_woww_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_PAGE_TEXT_QUERY: ptvcursor_add(ptv, hf_woww_page_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_PETITION_BUY: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_guid, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_index, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case CMSG_PETITION_QUERY: ptvcursor_add(ptv, hf_woww_guild_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PETITION_SHOWLIST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PETITION_SHOW_SIGNATURES: ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PETITION_SIGN: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); break; case CMSG_PET_ABANDON: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PET_ACTION: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PET_CANCEL_AURA: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_PET_CAST_SPELL: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCastTargets"); ptvcursor_add_ret_uint(ptv, hf_woww_spell_cast_target_flags, 2, ENC_LITTLE_ENDIAN, &target_flags); if (target_flags & SPELL_CAST_TARGET_FLAGS_UNIT) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_GAMEOBJECT) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_OBJECT_UNK) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_ITEM) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_TRADE_ITEM) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_DEST_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_STRING) { add_cstring(ptv, &hf_woww_target_string); } if (target_flags & SPELL_CAST_TARGET_FLAGS_CORPSE) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_PVP_CORPSE) { add_packed_guid(ptv, pinfo); } ptvcursor_pop_subtree(ptv); break; case CMSG_PET_NAME_QUERY: ptvcursor_add(ptv, hf_woww_pet_number, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PET_RENAME: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); break; case CMSG_PET_SET_ACTION: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_position, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); } break; case CMSG_PET_SPELL_AUTOCAST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_autocast_enabled, 1, ENC_NA); break; case CMSG_PET_STOP_ATTACK: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PET_UNLEARN: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PING: ptvcursor_add(ptv, hf_woww_sequence_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_round_time_in_ms, 4, ENC_LITTLE_ENDIAN); break; case CMSG_PLAYER_LOGIN: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_PUSHQUESTTOPARTY: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_ACCEPT_QUEST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_CHOOSE_REWARD: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reward, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_COMPLETE_QUEST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_HELLO: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_QUERY_QUEST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_REQUEST_REWARD: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTGIVER_STATUS_QUERY: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTLOG_REMOVE_QUEST: ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_QUESTLOG_SWAP_QUEST: ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_QUEST_CONFIRM_ACCEPT: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_QUEST_QUERY: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_READ_ITEM: ptvcursor_add(ptv, hf_woww_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_RECLAIM_CORPSE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_REPAIR_ITEM: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); break; case CMSG_REQUEST_ACCOUNT_DATA: ptvcursor_add(ptv, hf_woww_data_type, 4, ENC_LITTLE_ENDIAN); break; case CMSG_REQUEST_PARTY_MEMBER_STATS: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_RESURRECT_RESPONSE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_status, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SELL_ITEM: ptvcursor_add(ptv, hf_woww_vendor, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SEND_MAIL: ptvcursor_add(ptv, hf_woww_mailbox, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_receiver); add_cstring(ptv, &hf_woww_subject); add_cstring(ptv, &hf_woww_body); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_money, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cash_on_delivery_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case CMSG_SETSHEATHED: ptvcursor_add(ptv, hf_woww_sheath_state, 4, ENC_LITTLE_ENDIAN); break; case CMSG_SET_ACTIONBAR_TOGGLES: ptvcursor_add(ptv, hf_woww_action_bar, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SET_ACTION_BUTTON: ptvcursor_add(ptv, hf_woww_button, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_action, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_misc, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_action_type, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SET_ACTIVE_MOVER: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_SET_AMMO: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); break; case CMSG_SET_FACTION_ATWAR: ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_faction_flag, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SET_FACTION_INACTIVE: ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_inactive, 1, ENC_NA); break; case CMSG_SET_SELECTION: ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case CMSG_SET_TARGET_OBSOLETE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_SET_TRADE_GOLD: ptvcursor_add(ptv, hf_woww_gold, 4, ENC_LITTLE_ENDIAN); break; case CMSG_SET_TRADE_ITEM: ptvcursor_add(ptv, hf_woww_trade_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SET_WATCHED_FACTION: ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); break; case CMSG_SPIRIT_HEALER_ACTIVATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_SPLIT_ITEM: ptvcursor_add(ptv, hf_woww_source_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destination_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destination_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 1, ENC_LITTLE_ENDIAN); break; case CMSG_STABLE_PET: ptvcursor_add(ptv, hf_woww_stable_master, 8, ENC_LITTLE_ENDIAN); break; case CMSG_STABLE_SWAP_PET: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_slot, 4, ENC_LITTLE_ENDIAN); break; case CMSG_STANDSTATECHANGE: ptvcursor_add(ptv, hf_woww_unit_stand_state, 4, ENC_LITTLE_ENDIAN); break; case CMSG_SUMMON_RESPONSE: ptvcursor_add(ptv, hf_woww_summoner, 8, ENC_LITTLE_ENDIAN); break; case CMSG_SWAP_INV_ITEM: ptvcursor_add(ptv, hf_woww_item_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_SWAP_ITEM: ptvcursor_add(ptv, hf_woww_destination_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_destionation_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_bag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_slot, 1, ENC_LITTLE_ENDIAN); break; case CMSG_TAXINODE_STATUS_QUERY: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_TAXIQUERYAVAILABLENODES: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_TELEPORT_TO_UNIT: add_cstring(ptv, &hf_woww_name); break; case CMSG_TEXT_EMOTE: ptvcursor_add(ptv, hf_woww_text_emote, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case CMSG_TOGGLE_PVP: len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_enable_pvp, 1, ENC_NA); } break; case CMSG_TRAINER_BUY_SPELL: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case CMSG_TRAINER_LIST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case CMSG_TURN_IN_PETITION: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); break; case CMSG_TUTORIAL_FLAG: ptvcursor_add(ptv, hf_woww_tutorial_flag, 4, ENC_LITTLE_ENDIAN); break; case CMSG_UNLEARN_SKILL: ptvcursor_add(ptv, hf_woww_skill, 4, ENC_LITTLE_ENDIAN); break; case CMSG_UNSTABLE_PET: ptvcursor_add(ptv, hf_woww_stable_master, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_number, 4, ENC_LITTLE_ENDIAN); break; case CMSG_UPDATE_ACCOUNT_DATA: ptvcursor_add(ptv, hf_woww_account_data_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_decompressed_size, 4, ENC_LITTLE_ENDIAN); compressed_tvb = tvb_uncompress(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv), offset_packet_end - ptvcursor_current_offset(ptv)); if (compressed_tvb != NULL) { ptvcursor_t* old_ptv = ptv; ptv = ptvcursor_new(wmem_packet_scope(), tree, compressed_tvb, 0); len = offset_packet_end - ptvcursor_current_offset(ptv); ptvcursor_add(ptv, hf_woww_compressed_data, len, ENC_NA); ptvcursor_free(ptv); ptv = old_ptv; compressed_tvb = NULL; } break; case CMSG_USE_ITEM: ptvcursor_add(ptv, hf_woww_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCastTargets"); ptvcursor_add_ret_uint(ptv, hf_woww_spell_cast_target_flags, 2, ENC_LITTLE_ENDIAN, &target_flags); if (target_flags & SPELL_CAST_TARGET_FLAGS_UNIT) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_GAMEOBJECT) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_OBJECT_UNK) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_ITEM) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_TRADE_ITEM) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_DEST_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_STRING) { add_cstring(ptv, &hf_woww_target_string); } if (target_flags & SPELL_CAST_TARGET_FLAGS_CORPSE) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_PVP_CORPSE) { add_packed_guid(ptv, pinfo); } ptvcursor_pop_subtree(ptv); break; case CMSG_WARDEN_DATA: len = offset_packet_end - ptvcursor_current_offset(ptv); ptvcursor_add(ptv, hf_woww_encrypted_data, len, ENC_NA); break; case CMSG_WHO: ptvcursor_add(ptv, hf_woww_minimum_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_maximum_level, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_player_name); add_cstring(ptv, &hf_woww_guild_name); ptvcursor_add(ptv, hf_woww_race_mask, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class_mask, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_zones, 4, ENC_LITTLE_ENDIAN, &amount_of_zones); for (guint32 i1 = 0; i1 < amount_of_zones; ++i1) { ptvcursor_add(ptv, hf_woww_zones, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_strings, 4, ENC_LITTLE_ENDIAN, &amount_of_strings); for (guint32 i1 = 0; i1 < amount_of_strings; ++i1) { add_cstring(ptv, &hf_woww_search_strings); } break; case CMSG_WHOIS: add_cstring(ptv, &hf_woww_character_name); break; case CMSG_WORLD_TELEPORT: ptvcursor_add(ptv, hf_woww_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); break; case CMSG_WRAP_ITEM: ptvcursor_add(ptv, hf_woww_gift_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gift_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_bag_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_slot_int, 1, ENC_LITTLE_ENDIAN); break; case CMSG_ZONEUPDATE: ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); break; case MSG_AUCTION_HELLO: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_house, 4, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_auctioneer, 8, ENC_LITTLE_ENDIAN); } break; case MSG_BATTLEGROUND_PLAYER_POSITIONS: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_teammates, 4, ENC_LITTLE_ENDIAN, &amount_of_teammates); for (guint32 i1 = 0; i1 < amount_of_teammates; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "BattlegroundPlayerPosition %i", i1); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_carriers, 1, ENC_LITTLE_ENDIAN, &amount_of_carriers); for (guint32 i1 = 0; i1 < amount_of_carriers; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "BattlegroundPlayerPosition %i", i1); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else { } break; case MSG_CHANNEL_START: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); } break; case MSG_CHANNEL_UPDATE: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_time, 4, ENC_LITTLE_ENDIAN); } break; case MSG_CORPSE_QUERY: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add_ret_uint(ptv, hf_woww_corpse_query_result, 1, ENC_LITTLE_ENDIAN, &result); if (result == CORPSE_QUERY_RESULT_FOUND) { ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); } } else { } break; case MSG_INSPECT_HONOR_STATS: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pvp_rank, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_today_honorable_and_dishonorable, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_yesterday_honorable, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_last_week_honorable, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_this_week_honorable, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_lifetime_honorable, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_lifetime_dishonorable, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_yesterday_honor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_last_week_honor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_this_week_honor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pvp_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_rank_progress_bar, 1, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); } break; case MSG_LIST_STABLED_PETS: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_pets, 1, ENC_LITTLE_ENDIAN, &amount_of_pets); ptvcursor_add(ptv, hf_woww_stable_slots, 1, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < amount_of_pets; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "StabledPet %i", i1); ptvcursor_add(ptv, hf_woww_pet_number, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_entry, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_loyalty, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else { ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); } break; case MSG_LOOKING_FOR_GROUP: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } else { } break; case MSG_MINIMAP_PING: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y, 4, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y, 4, ENC_LITTLE_ENDIAN); } break; case MSG_MOVE_FALL_LAND: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_FEATHER_FALL: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_HEARTBEAT: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_JUMP: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_SET_FACING: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_SET_PITCH: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_SET_RUN_MODE: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_SET_WALK_MODE: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_BACKWARD: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_FORWARD: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_PITCH_DOWN: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_PITCH_UP: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_STRAFE_LEFT: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_STRAFE_RIGHT: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_SWIM: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_TURN_LEFT: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_START_TURN_RIGHT: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_STOP_PITCH: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_STOP_STRAFE: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_STOP_SWIM: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_STOP: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_STOP_TURN: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case MSG_MOVE_TELEPORT_ACK: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else { add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time, 4, ENC_LITTLE_ENDIAN); } break; case MSG_MOVE_TIME_SKIPPED: if (WOWW_SERVER_TO_CLIENT) { add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_time_skipped, 4, ENC_LITTLE_ENDIAN); } break; case MSG_MOVE_WATER_WALK: add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementInfo"); ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TransportInfo"); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); break; case MSG_PETITION_DECLINE: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); break; case MSG_PETITION_RENAME: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_new_name); break; case MSG_PVP_LOG_DATA: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add_ret_uint(ptv, hf_woww_battleground_end_status, 1, ENC_LITTLE_ENDIAN, &status); if (status == BATTLEGROUND_END_STATUS_ENDED) { ptvcursor_add(ptv, hf_woww_battleground_winner, 1, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_players, 4, ENC_LITTLE_ENDIAN, &amount_of_players); for (guint32 i1 = 0; i1 < amount_of_players; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "BattlegroundPlayer %i", i1); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pvp_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_killing_blows, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_honorable_kills, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_deaths, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bonus_honor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_extra_fields, 4, ENC_LITTLE_ENDIAN, &amount_of_extra_fields); for (guint32 i2 = 0; i2 < amount_of_extra_fields; ++i2) { ptvcursor_add(ptv, hf_woww_fields, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } } else { } break; case MSG_QUERY_NEXT_MAIL_TIME: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_unread_mails, 4, ENC_LITTLE_ENDIAN); } else { } break; case MSG_QUEST_PUSH_RESULT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_party_message, 1, ENC_LITTLE_ENDIAN); break; case MSG_RAID_READY_CHECK: if (WOWW_SERVER_TO_CLIENT) { len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_state, 1, ENC_LITTLE_ENDIAN); } } else { len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_state, 1, ENC_LITTLE_ENDIAN); } } break; case MSG_RAID_TARGET_UPDATE: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add_ret_uint(ptv, hf_woww_raid_target_update_type, 1, ENC_LITTLE_ENDIAN, &update_type); if (update_type == RAID_TARGET_UPDATE_TYPE_FULL) { for (guint32 i1 = 0; i1 < 8; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "RaidTargetUpdate %i", i1); ptvcursor_add(ptv, hf_woww_raid_target_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else if (update_type == RAID_TARGET_UPDATE_TYPE_PARTIAL) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "RaidTargetUpdate"); ptvcursor_add(ptv, hf_woww_raid_target_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else { ptvcursor_add_ret_uint(ptv, hf_woww_raid_target_index, 1, ENC_LITTLE_ENDIAN, &target_index); if (target_index != RAID_TARGET_INDEX_REQUEST_ICONS) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } } break; case MSG_RANDOM_ROLL: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_minimum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_maximum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_actual_roll, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_minimum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_maximum, 4, ENC_LITTLE_ENDIAN); } break; case MSG_SAVE_GUILD_EMBLEM: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_guild_emblem_result, 4, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_vendor, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emblem_style, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emblem_color, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_border_style, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_border_color, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_background_color, 4, ENC_LITTLE_ENDIAN); } break; case MSG_TABARDVENDOR_ACTIVATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case MSG_TALENT_WIPE_CONFIRM: if (WOWW_SERVER_TO_CLIENT) { ptvcursor_add(ptv, hf_woww_wiping_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cost_in_copper, 4, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_wiping_npc, 8, ENC_LITTLE_ENDIAN); } break; case SMSG_ACCOUNT_DATA_TIMES: for (guint32 i1 = 0; i1 < 32; ++i1) { ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_ACTION_BUTTONS: for (guint32 i1 = 0; i1 < 120; ++i1) { ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_ACTIVATETAXIREPLY: ptvcursor_add(ptv, hf_woww_activate_taxi_reply, 4, ENC_LITTLE_ENDIAN); break; case SMSG_ADDON_INFO: while (ptvcursor_current_offset(ptv) < offset_packet_end) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Addon"); ptvcursor_add(ptv, hf_woww_addon_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_info_block, 1, ENC_LITTLE_ENDIAN, &info_block); if (info_block == INFO_BLOCK_AVAILABLE) { ptvcursor_add_ret_uint(ptv, hf_woww_key_version, 1, ENC_LITTLE_ENDIAN, &key_version); if (key_version != KEY_VERSION_ZERO) { ptvcursor_add(ptv, hf_woww_public_key, 256, ENC_NA); } ptvcursor_add(ptv, hf_woww_update_available_flag, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_url_info, 1, ENC_LITTLE_ENDIAN, &url_info); if (url_info == URL_INFO_AVAILABLE) { add_cstring(ptv, &hf_woww_url); } ptvcursor_pop_subtree(ptv); } break; case SMSG_AI_REACTION: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_ai_reaction, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AREA_SPIRIT_HEALER_TIME: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_next_resurrect_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AREA_TRIGGER_MESSAGE: add_sized_cstring(ptv, &hf_woww_message); break; case SMSG_ATTACKERSTATEUPDATE: ptvcursor_add(ptv, hf_woww_hit_info, 4, ENC_LITTLE_ENDIAN); add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_total_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_damages, 1, ENC_LITTLE_ENDIAN, &amount_of_damages); for (guint32 i1 = 0; i1 < amount_of_damages; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "DamageInfo %i", i1); ptvcursor_add(ptv, hf_woww_spell_school_mask, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage_float, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage_uint, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_absorb, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_resist, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_damage_state, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_blocked_amount, 4, ENC_LITTLE_ENDIAN); break; case SMSG_ATTACKSTART: ptvcursor_add(ptv, hf_woww_attacker, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_victim, 8, ENC_LITTLE_ENDIAN); break; case SMSG_ATTACKSTOP: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_BIDDER_LIST_RESULT: ptvcursor_add_ret_uint(ptv, hf_woww_count, 4, ENC_LITTLE_ENDIAN, &count); for (guint32 i1 = 0; i1 < count; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "AuctionListItem %i", i1); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_enchantment, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_owner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_start_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_minimum_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buyout_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_left, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_total_amount_of_auctions, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_BIDDER_NOTIFICATION: ptvcursor_add(ptv, hf_woww_auction_house, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_won, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_out_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_template, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_COMMAND_RESULT: ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_auction_command_action, 4, ENC_LITTLE_ENDIAN, &action); if (action == AUCTION_COMMAND_ACTION_BID_PLACED) { ptvcursor_add_ret_uint(ptv, hf_woww_auction_command_result, 4, ENC_LITTLE_ENDIAN, &result); if (result == AUCTION_COMMAND_RESULT_OK) { ptvcursor_add(ptv, hf_woww_auction_outbid, 4, ENC_LITTLE_ENDIAN); } else if (result == AUCTION_COMMAND_RESULT_ERR_INVENTORY) { ptvcursor_add(ptv, hf_woww_inventory_result, 1, ENC_LITTLE_ENDIAN); } else if (result == AUCTION_COMMAND_RESULT_ERR_HIGHER_BID) { ptvcursor_add(ptv, hf_woww_higher_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_new_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_outbid, 4, ENC_LITTLE_ENDIAN); } } else { ptvcursor_add_ret_uint(ptv, hf_woww_auction_command_result_two, 4, ENC_LITTLE_ENDIAN, &result2); if (result2 == AUCTION_COMMAND_RESULT_TWO_ERR_INVENTORY) { ptvcursor_add(ptv, hf_woww_inventory_result, 1, ENC_LITTLE_ENDIAN); } else if (result2 == AUCTION_COMMAND_RESULT_TWO_ERR_HIGHER_BID) { ptvcursor_add(ptv, hf_woww_higher_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_new_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_outbid, 4, ENC_LITTLE_ENDIAN); } } break; case SMSG_AUCTION_LIST_RESULT: ptvcursor_add_ret_uint(ptv, hf_woww_count, 4, ENC_LITTLE_ENDIAN, &count); for (guint32 i1 = 0; i1 < count; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "AuctionListItem %i", i1); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_enchantment, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_owner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_start_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_minimum_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buyout_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_left, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_total_amount_of_auctions, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_OWNER_LIST_RESULT: ptvcursor_add_ret_uint(ptv, hf_woww_count, 4, ENC_LITTLE_ENDIAN, &count); for (guint32 i1 = 0; i1 < count; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "AuctionListItem %i", i1); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_enchantment, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_owner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_start_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_minimum_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buyout_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_left, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_highest_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_total_amount_of_auctions, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_OWNER_NOTIFICATION: ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auction_out_bid, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bidder, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUCTION_REMOVED_NOTIFICATION: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_template, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_random_property_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUTH_CHALLENGE: ptvcursor_add(ptv, hf_woww_server_seed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_AUTH_RESPONSE: ptvcursor_add_ret_uint(ptv, hf_woww_world_result, 1, ENC_LITTLE_ENDIAN, &result); if (result == WORLD_RESULT_AUTH_OK) { ptvcursor_add(ptv, hf_woww_billing_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_billing_flags, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_billing_rested, 4, ENC_LITTLE_ENDIAN); } else if (result == WORLD_RESULT_AUTH_WAIT_QUEUE) { ptvcursor_add(ptv, hf_woww_queue_position, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_BATTLEFIELD_LIST: ptvcursor_add(ptv, hf_woww_battlemaster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_battleground_bracket, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_number_of_battlegrounds, 4, ENC_LITTLE_ENDIAN, &number_of_battlegrounds); for (guint32 i1 = 0; i1 < number_of_battlegrounds; ++i1) { ptvcursor_add(ptv, hf_woww_battlegrounds, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_BATTLEFIELD_STATUS: ptvcursor_add(ptv, hf_woww_queue_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN, &map); if (map != MAP_EASTERN_KINGDOMS) { ptvcursor_add(ptv, hf_woww_battleground_bracket, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_client_instance_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_status_id, 1, ENC_LITTLE_ENDIAN, &status_id); if (status_id == STATUS_ID_WAIT_QUEUE) { ptvcursor_add(ptv, hf_woww_average_wait_time_in_ms, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_in_queue_in_ms, 4, ENC_LITTLE_ENDIAN); } else if (status_id == STATUS_ID_WAIT_JOIN) { ptvcursor_add(ptv, hf_woww_time_to_remove_in_queue_in_ms, 4, ENC_LITTLE_ENDIAN); } else if (status_id == STATUS_ID_IN_PROGRESS) { ptvcursor_add(ptv, hf_woww_time_to_bg_autoleave_in_ms, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_to_bg_start_in_ms, 4, ENC_LITTLE_ENDIAN); } } break; case SMSG_BATTLEGROUND_PLAYER_JOINED: ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); break; case SMSG_BATTLEGROUND_PLAYER_LEFT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_BINDER_CONFIRM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_BINDPOINTUPDATE: ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); break; case SMSG_BUY_BANK_SLOT_RESULT: ptvcursor_add(ptv, hf_woww_buy_bank_slot_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_BUY_FAILED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buy_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_BUY_ITEM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_vendor_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount_for_sale, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount_bought, 4, ENC_LITTLE_ENDIAN); break; case SMSG_CAST_RESULT: ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_simple_spell_cast_result, 1, ENC_LITTLE_ENDIAN, &result); if (result != SIMPLE_SPELL_CAST_RESULT_FAILURE) { ptvcursor_add_ret_uint(ptv, hf_woww_cast_failure_reason, 1, ENC_LITTLE_ENDIAN, &reason); if (reason == CAST_FAILURE_REASON_REQUIRES_SPELL_FOCUS) { ptvcursor_add(ptv, hf_woww_required_spell_focus, 4, ENC_LITTLE_ENDIAN); } else if (reason == CAST_FAILURE_REASON_REQUIRES_AREA) { ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); } else if (reason == CAST_FAILURE_REASON_EQUIPPED_ITEM_CLASS) { ptvcursor_add(ptv, hf_woww_equipped_item_class, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_equipped_item_subclass_mask, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_equipped_item_inventory_type_mask, 4, ENC_LITTLE_ENDIAN); } } break; case SMSG_CHANNEL_LIST: add_cstring(ptv, &hf_woww_channel_name); ptvcursor_add(ptv, hf_woww_channel_flags, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_members, 4, ENC_LITTLE_ENDIAN, &amount_of_members); for (guint32 i1 = 0; i1 < amount_of_members; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ChannelMember %i", i1); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_channel_member_flags, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_CHANNEL_NOTIFY: ptvcursor_add(ptv, hf_woww_chat_notify, 1, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_channel_name); break; case SMSG_CHARACTER_LOGIN_FAILED: ptvcursor_add(ptv, hf_woww_world_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_CHAR_CREATE: ptvcursor_add(ptv, hf_woww_world_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_CHAR_DELETE: ptvcursor_add(ptv, hf_woww_world_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_CHAR_ENUM: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_characters, 1, ENC_LITTLE_ENDIAN, &amount_of_characters); for (guint32 i1 = 0; i1 < amount_of_characters; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Character %i", i1); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_race, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gender, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_skin, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_face, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_hair_style, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_hair_color, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_facial_hair, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_guild_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_character_flags, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_first_login, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_pet_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_creature_family, 4, ENC_LITTLE_ENDIAN); for (guint32 i2 = 0; i2 < 19; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "CharacterGear %i", i2); ptvcursor_add(ptv, hf_woww_equipment_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_inventory_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_first_bag_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_first_bag_inventory_id, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_CHAR_RENAME: ptvcursor_add_ret_uint(ptv, hf_woww_world_result, 1, ENC_LITTLE_ENDIAN, &result); if (result == WORLD_RESULT_RESPONSE_SUCCESS) { ptvcursor_add(ptv, hf_woww_character_guid, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_new_name); } break; case SMSG_CHAT_PLAYER_NOT_FOUND: add_cstring(ptv, &hf_woww_name); break; case SMSG_CLEAR_COOLDOWN: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case SMSG_CLIENT_CONTROL_UPDATE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_allow_movement, 1, ENC_NA); break; case SMSG_COMPRESSED_MOVES: ptvcursor_add(ptv, hf_woww_decompressed_size, 4, ENC_LITTLE_ENDIAN); compressed_tvb = tvb_uncompress(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv), offset_packet_end - ptvcursor_current_offset(ptv)); if (compressed_tvb != NULL) { ptvcursor_t* old_ptv = ptv; ptv = ptvcursor_new(wmem_packet_scope(), tree, compressed_tvb, 0); gint compression_end = tvb_reported_length(compressed_tvb); while (ptvcursor_current_offset(ptv) < compression_end) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "CompressedMove"); ptvcursor_add(ptv, hf_woww_size_struct, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_compressed_move_opcode, 2, ENC_LITTLE_ENDIAN, &opcode); add_packed_guid(ptv, pinfo); if (opcode == COMPRESSED_MOVE_OPCODE_SMSG_SPLINE_SET_RUN_SPEED) { ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); } else if (opcode == COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MonsterMove"); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_spline_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_monster_move_type, 1, ENC_LITTLE_ENDIAN, &move_type); if (move_type == MONSTER_MOVE_TYPE_FACING_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_SPOT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (move_type != MONSTER_MOVE_TYPE_STOP) { ptvcursor_add(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); add_monster_move_spline(ptv); } ptvcursor_pop_subtree(ptv); } else if (opcode == COMPRESSED_MOVE_OPCODE_SMSG_MONSTER_MOVE_TRANSPORT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MonsterMove"); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_spline_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_monster_move_type, 1, ENC_LITTLE_ENDIAN, &move_type); if (move_type == MONSTER_MOVE_TYPE_FACING_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_SPOT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (move_type != MONSTER_MOVE_TYPE_STOP) { ptvcursor_add(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); add_monster_move_spline(ptv); } ptvcursor_pop_subtree(ptv); } ptvcursor_pop_subtree(ptv); } ptvcursor_free(ptv); ptv = old_ptv; compressed_tvb = NULL; } break; case SMSG_COMPRESSED_UPDATE_OBJECT: ptvcursor_add(ptv, hf_woww_decompressed_size, 4, ENC_LITTLE_ENDIAN); compressed_tvb = tvb_uncompress(ptvcursor_tvbuff(ptv), ptvcursor_current_offset(ptv), offset_packet_end - ptvcursor_current_offset(ptv)); if (compressed_tvb != NULL) { ptvcursor_t* old_ptv = ptv; ptv = ptvcursor_new(wmem_packet_scope(), tree, compressed_tvb, 0); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_objects, 4, ENC_LITTLE_ENDIAN, &amount_of_objects); ptvcursor_add(ptv, hf_woww_has_transport, 1, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < amount_of_objects; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Object %i", i1); ptvcursor_add_ret_uint(ptv, hf_woww_update_type, 1, ENC_LITTLE_ENDIAN, &update_type); if (update_type == UPDATE_TYPE_VALUES) { add_packed_guid(ptv, pinfo); add_update_mask(ptv, pinfo); } else if (update_type == UPDATE_TYPE_MOVEMENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementBlock"); ptvcursor_add_ret_uint(ptv, hf_woww_update_flag, 1, ENC_LITTLE_ENDIAN, &update_flag); if (update_flag & UPDATE_FLAG_LIVING) { ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_living_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_transport_orientation, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_walking_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_turn_rate, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_SPLINE_ENABLED) { ptvcursor_add_ret_uint(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN, &spline_flags); if (spline_flags & SPLINE_FLAG_FINAL_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_POINT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_time_passed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_nodes, 4, ENC_LITTLE_ENDIAN, &amount_of_nodes); for (guint32 i2 = 0; i2 < amount_of_nodes; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d %i", i2); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else if (update_flag & UPDATE_FLAG_HAS_POSITION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_HIGH_GUID) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_ALL) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_MELEE_ATTACKING) { add_packed_guid(ptv, pinfo); } if (update_flag & UPDATE_FLAG_TRANSPORT) { ptvcursor_add(ptv, hf_woww_transport_progress_in_ms, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else if (update_type == UPDATE_TYPE_CREATE_OBJECT || update_type == UPDATE_TYPE_CREATE_OBJECT2) { add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_object_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementBlock"); ptvcursor_add_ret_uint(ptv, hf_woww_update_flag, 1, ENC_LITTLE_ENDIAN, &update_flag); if (update_flag & UPDATE_FLAG_LIVING) { ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_living_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_transport_orientation, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_walking_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_turn_rate, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_SPLINE_ENABLED) { ptvcursor_add_ret_uint(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN, &spline_flags); if (spline_flags & SPLINE_FLAG_FINAL_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_POINT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_time_passed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_nodes, 4, ENC_LITTLE_ENDIAN, &amount_of_nodes); for (guint32 i2 = 0; i2 < amount_of_nodes; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d %i", i2); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else if (update_flag & UPDATE_FLAG_HAS_POSITION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_HIGH_GUID) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_ALL) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_MELEE_ATTACKING) { add_packed_guid(ptv, pinfo); } if (update_flag & UPDATE_FLAG_TRANSPORT) { ptvcursor_add(ptv, hf_woww_transport_progress_in_ms, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); add_update_mask(ptv, pinfo); } else if (update_type == UPDATE_TYPE_OUT_OF_RANGE_OBJECTS || update_type == UPDATE_TYPE_NEAR_OBJECTS) { ptvcursor_add_ret_uint(ptv, hf_woww_count, 4, ENC_LITTLE_ENDIAN, &count); for (guint32 i2 = 0; i2 < count; ++i2) { add_packed_guid(ptv, pinfo); } } ptvcursor_pop_subtree(ptv); } ptvcursor_free(ptv); ptv = old_ptv; compressed_tvb = NULL; } break; case SMSG_COOLDOWN_EVENT: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_CORPSE_RECLAIM_DELAY: ptvcursor_add(ptv, hf_woww_delay, 4, ENC_LITTLE_ENDIAN); break; case SMSG_CREATURE_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_creature_entry, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_sub_name); ptvcursor_add(ptv, hf_woww_type_flags, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_creature_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_creature_family, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_creature_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_data_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_civilian, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_racial_leader, 1, ENC_LITTLE_ENDIAN); } break; case SMSG_DEFENSE_MESSAGE: ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); add_sized_cstring(ptv, &hf_woww_message); break; case SMSG_DESTROY_OBJECT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_DISMOUNTRESULT: ptvcursor_add(ptv, hf_woww_dismount_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_DISPEL_FAILED: ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); while (ptvcursor_current_offset(ptv) < offset_packet_end) { ptvcursor_add(ptv, hf_woww_spells, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_DUEL_COMPLETE: ptvcursor_add(ptv, hf_woww_ended_without_interruption, 1, ENC_NA); break; case SMSG_DUEL_COUNTDOWN: ptvcursor_add(ptv, hf_woww_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_DUEL_REQUESTED: ptvcursor_add(ptv, hf_woww_initiator, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); break; case SMSG_DUEL_WINNER: ptvcursor_add(ptv, hf_woww_duel_winner_reason, 1, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_opponent_name); add_cstring(ptv, &hf_woww_initiator_name); break; case SMSG_EMOTE: ptvcursor_add(ptv, hf_woww_emote_enum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_ENCHANTMENTLOG: ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_show_affiliation, 1, ENC_NA); break; case SMSG_ENVIRONMENTAL_DAMAGE_LOG: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_environmental_damage_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_absorb, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_resist, 4, ENC_LITTLE_ENDIAN); break; case SMSG_EXPECTED_SPAM_RECORDS: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_records, 4, ENC_LITTLE_ENDIAN, &amount_of_records); for (guint32 i1 = 0; i1 < amount_of_records; ++i1) { add_cstring(ptv, &hf_woww_records); } break; case SMSG_EXPLORATION_EXPERIENCE: ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_experience, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_MOVE_ROOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_MOVE_UNROOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_RUN_BACK_SPEED_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_RUN_SPEED_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_SWIM_BACK_SPEED_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_SWIM_SPEED_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_TURN_RATE_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FORCE_WALK_SPEED_CHANGE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_move_event, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_FRIEND_LIST: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_friends, 1, ENC_LITTLE_ENDIAN, &amount_of_friends); for (guint32 i1 = 0; i1 < amount_of_friends; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Friend %i", i1); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_friend_status, 1, ENC_LITTLE_ENDIAN, &status); if (status != FRIEND_STATUS_OFFLINE) { ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case SMSG_FRIEND_STATUS: ptvcursor_add(ptv, hf_woww_friend_result, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_GAMEOBJECT_CUSTOM_ANIM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_animation_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GAMEOBJECT_DESPAWN_ANIM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_GAMEOBJECT_PAGETEXT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_GAMEOBJECT_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_entry_id, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_info_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_display_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); for (guint32 i1 = 0; i1 < 6; ++i1) { ptvcursor_add(ptv, hf_woww_raw_data, 4, ENC_LITTLE_ENDIAN); } } break; case SMSG_GAMEOBJECT_RESET_STATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_GAMEOBJECT_SPAWN_ANIM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_GMTICKET_CREATE: ptvcursor_add(ptv, hf_woww_gm_ticket_response, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GMTICKET_DELETETICKET: ptvcursor_add(ptv, hf_woww_gm_ticket_response, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GMTICKET_GETTICKET: ptvcursor_add_ret_uint(ptv, hf_woww_gm_ticket_status, 4, ENC_LITTLE_ENDIAN, &status); if (status == GM_TICKET_STATUS_HAS_TEXT) { add_cstring(ptv, &hf_woww_text); ptvcursor_add(ptv, hf_woww_gm_ticket_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_days_since_ticket_creation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_days_since_oldest_ticket_creation, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_days_since_last_updated, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gm_ticket_escalation_status, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_read_by_gm, 1, ENC_NA); } break; case SMSG_GMTICKET_SYSTEMSTATUS: ptvcursor_add(ptv, hf_woww_gm_ticket_queue_status, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GMTICKET_UPDATETEXT: ptvcursor_add(ptv, hf_woww_gm_ticket_response, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GM_TICKET_STATUS_UPDATE: ptvcursor_add(ptv, hf_woww_gm_ticket_status_response, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GOSSIP_MESSAGE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_title_text_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_gossip_items, 4, ENC_LITTLE_ENDIAN, &amount_of_gossip_items); for (guint32 i1 = 0; i1 < amount_of_gossip_items; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "GossipItem %i", i1); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_icon, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_coded, 1, ENC_NA); add_cstring(ptv, &hf_woww_message); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_quests, 4, ENC_LITTLE_ENDIAN, &amount_of_quests); for (guint32 i1 = 0; i1 < amount_of_quests; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItem %i", i1); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_icon, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); ptvcursor_pop_subtree(ptv); } break; case SMSG_GOSSIP_POI: ptvcursor_add(ptv, hf_woww_flags, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector2d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_icon, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_data, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_location_name); break; case SMSG_GROUP_DECLINE: add_cstring(ptv, &hf_woww_name); break; case SMSG_GROUP_INVITE: add_cstring(ptv, &hf_woww_name); break; case SMSG_GROUP_JOINED_BATTLEGROUND: ptvcursor_add(ptv, hf_woww_bg_type_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GROUP_LIST: ptvcursor_add(ptv, hf_woww_group_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_flags, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_members, 4, ENC_LITTLE_ENDIAN, &amount_of_members); for (guint32 i1 = 0; i1 < amount_of_members; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "GroupListMember %i", i1); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_is_online, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_flags, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_leader, 8, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_group_loot_setting, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_master_loot, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_quality, 1, ENC_LITTLE_ENDIAN); } break; case SMSG_GROUP_SET_LEADER: add_cstring(ptv, &hf_woww_name); break; case SMSG_GUILD_COMMAND_RESULT: ptvcursor_add(ptv, hf_woww_guild_command, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_string); ptvcursor_add(ptv, hf_woww_guild_command_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GUILD_EVENT: ptvcursor_add(ptv, hf_woww_guild_event, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_events, 1, ENC_LITTLE_ENDIAN, &amount_of_events); for (guint32 i1 = 0; i1 < amount_of_events; ++i1) { add_cstring(ptv, &hf_woww_event_descriptions); } break; case SMSG_GUILD_INFO: add_cstring(ptv, &hf_woww_guild_name); ptvcursor_add(ptv, hf_woww_created_day, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_created_month, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_created_year, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount_of_characters_in_guild, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount_of_accounts_in_guild, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GUILD_INVITE: add_cstring(ptv, &hf_woww_player_name); add_cstring(ptv, &hf_woww_guild_name); break; case SMSG_GUILD_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); for (guint32 i1 = 0; i1 < 10; ++i1) { add_cstring(ptv, &hf_woww_rank_names); } ptvcursor_add(ptv, hf_woww_emblem_style, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emblem_color, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_border_style, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_border_color, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_background_color, 4, ENC_LITTLE_ENDIAN); break; case SMSG_GUILD_ROSTER: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_members, 4, ENC_LITTLE_ENDIAN, &amount_of_members); add_cstring(ptv, &hf_woww_motd); add_cstring(ptv, &hf_woww_guild_info); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_rights, 4, ENC_LITTLE_ENDIAN, &amount_of_rights); for (guint32 i1 = 0; i1 < amount_of_rights; ++i1) { ptvcursor_add(ptv, hf_woww_rights, 4, ENC_LITTLE_ENDIAN); } for (guint32 i1 = 0; i1 < amount_of_members; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "GuildMember %i", i1); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_guild_member_status, 1, ENC_LITTLE_ENDIAN, &status); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); if (status == GUILD_MEMBER_STATUS_OFFLINE) { ptvcursor_add(ptv, hf_woww_time_offline, 4, ENC_LITTLE_ENDIAN); } add_cstring(ptv, &hf_woww_public_note); add_cstring(ptv, &hf_woww_officer_note); ptvcursor_pop_subtree(ptv); } break; case SMSG_IGNORE_LIST: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_ignored, 1, ENC_LITTLE_ENDIAN, &amount_of_ignored); for (guint32 i1 = 0; i1 < amount_of_ignored; ++i1) { ptvcursor_add(ptv, hf_woww_ignored, 8, ENC_LITTLE_ENDIAN); } break; case SMSG_INITIALIZE_FACTIONS: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_factions, 4, ENC_LITTLE_ENDIAN, &amount_of_factions); for (guint32 i1 = 0; i1 < amount_of_factions; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "FactionInitializer %i", i1); ptvcursor_add(ptv, hf_woww_faction_flag, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_standing, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_INITIAL_SPELLS: ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_spell_count, 2, ENC_LITTLE_ENDIAN, &spell_count); for (guint32 i1 = 0; i1 < spell_count; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "InitialSpell %i", i1); ptvcursor_add(ptv, hf_woww_spell_id, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_cooldown_count, 2, ENC_LITTLE_ENDIAN, &cooldown_count); for (guint32 i1 = 0; i1 < cooldown_count; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "CooldownSpell %i", i1); ptvcursor_add(ptv, hf_woww_spell_id, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_id, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_category, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_category_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_INIT_WORLD_STATES: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_states, 2, ENC_LITTLE_ENDIAN, &amount_of_states); for (guint32 i1 = 0; i1 < amount_of_states; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "WorldState %i", i1); ptvcursor_add(ptv, hf_woww_state, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_INSPECT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_INSTANCE_RESET: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case SMSG_INSTANCE_RESET_FAILED: ptvcursor_add(ptv, hf_woww_instance_reset_failed_reason, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case SMSG_INSTANCE_SAVE_CREATED: ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case SMSG_INVALIDATE_PLAYER: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_INVENTORY_CHANGE_FAILURE: ptvcursor_add_ret_uint(ptv, hf_woww_inventory_result, 1, ENC_LITTLE_ENDIAN, &result); if (result == INVENTORY_RESULT_CANT_EQUIP_LEVEL_I) { ptvcursor_add(ptv, hf_woww_required_level, 4, ENC_LITTLE_ENDIAN); } if (result != INVENTORY_RESULT_OK) { ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag_type_subclass, 1, ENC_LITTLE_ENDIAN); } break; case SMSG_ITEM_COOLDOWN: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_ITEM_ENCHANT_TIME_UPDATE: ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); break; case SMSG_ITEM_NAME_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_item_name); break; case SMSG_ITEM_PUSH_RESULT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_new_item_source, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_new_item_creation_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_new_item_chat_alert, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_slot_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); break; case SMSG_ITEM_QUERY_SINGLE_RESPONSE: ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_item_class_and_sub_class, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_quality, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_flag, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_buy_price, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sell_price, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_inventory_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_class, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_race, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_skill, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_skill_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_honor_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_city_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_faction, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_faction_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_stackable, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_container_slots, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 10; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ItemStat %i", i1); ptvcursor_add(ptv, hf_woww_item_stat_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } for (guint32 i1 = 0; i1 < 5; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ItemDamageType %i", i1); ptvcursor_add(ptv, hf_woww_damage_minimum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage_maximum, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_school, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_armor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_holy_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_fire_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_nature_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_frost_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_shadow_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_arcane_resistance, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_ammo_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_ranged_range_modification, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 5; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ItemSpells %i", i1); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_trigger_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_category, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_category_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_bonding, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_description); ptvcursor_add(ptv, hf_woww_page_text, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_language, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_page_text_material, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_start_quest, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_lock_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_material, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sheathe_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_random_property, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_block, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_set, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_bag_family, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_ITEM_TEXT_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_item_text_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_text); break; case SMSG_ITEM_TIME_UPDATE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LEARNED_SPELL: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LEVELUP_INFO: ptvcursor_add(ptv, hf_woww_new_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_health, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mana, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_rage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_focus, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_energy, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_happiness, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_strength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_agility, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_stamina, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_intellect, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spirit, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LIST_INVENTORY: ptvcursor_add(ptv, hf_woww_vendor, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_items, 1, ENC_LITTLE_ENDIAN, &amount_of_items); for (guint32 i1 = 0; i1 < amount_of_items; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ListInventoryItem %i", i1); ptvcursor_add(ptv, hf_woww_item_stack_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_items, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_price, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_LOGIN_SETTIMESPEED: ptvcursor_add(ptv, hf_woww_datetime, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_timescale, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LOGIN_VERIFY_WORLD: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LOGOUT_RESPONSE: ptvcursor_add(ptv, hf_woww_logout_result, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_logout_speed, 1, ENC_LITTLE_ENDIAN); break; case SMSG_LOG_XPGAIN: ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_total_exp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_experience_award_type, 1, ENC_LITTLE_ENDIAN, &exp_type); if (exp_type == EXPERIENCE_AWARD_TYPE_NON_KILL) { ptvcursor_add(ptv, hf_woww_experience_without_rested, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_exp_group_bonus, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_LOOT_ALL_PASSED: ptvcursor_add(ptv, hf_woww_looted_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_suffix_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_MASTER_LIST: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_players, 1, ENC_LITTLE_ENDIAN, &amount_of_players); for (guint32 i1 = 0; i1 < amount_of_players; ++i1) { ptvcursor_add(ptv, hf_woww_guids, 8, ENC_LITTLE_ENDIAN); } break; case SMSG_LOOT_MONEY_NOTIFY: ptvcursor_add(ptv, hf_woww_amount, 4, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_RELEASE_RESPONSE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_REMOVED: ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_RESPONSE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_loot_method, 1, ENC_LITTLE_ENDIAN, &loot_method); if (loot_method == LOOT_METHOD_ERROR) { ptvcursor_add(ptv, hf_woww_loot_method_error, 1, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_gold, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_items, 1, ENC_LITTLE_ENDIAN, &amount_of_items); for (guint32 i1 = 0; i1 < amount_of_items; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "LootItem %i", i1); ptvcursor_add(ptv, hf_woww_index, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_slot_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_LOOT_ROLL: ptvcursor_add(ptv, hf_woww_creature, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_suffix, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_roll_number, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_roll_vote, 1, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_ROLL_WON: ptvcursor_add(ptv, hf_woww_looted_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_suffix, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_winning_player, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_winning_roll, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_roll_vote, 1, ENC_LITTLE_ENDIAN); break; case SMSG_LOOT_START_ROLL: ptvcursor_add(ptv, hf_woww_creature, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_loot_slot, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_suffix, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_countdown_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MAIL_LIST_RESULT: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_mails, 1, ENC_LITTLE_ENDIAN, &amount_of_mails); for (guint32 i1 = 0; i1 < amount_of_mails; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Mail %i", i1); ptvcursor_add(ptv, hf_woww_message_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_mail_type, 1, ENC_LITTLE_ENDIAN, &message_type); if (message_type == MAIL_TYPE_NORMAL) { ptvcursor_add(ptv, hf_woww_sender, 8, ENC_LITTLE_ENDIAN); } else if (message_type == MAIL_TYPE_CREATURE || message_type == MAIL_TYPE_GAMEOBJECT) { ptvcursor_add(ptv, hf_woww_sender_id, 4, ENC_LITTLE_ENDIAN); } else if (message_type == MAIL_TYPE_AUCTION) { ptvcursor_add(ptv, hf_woww_auction_id, 4, ENC_LITTLE_ENDIAN); } add_cstring(ptv, &hf_woww_subject); ptvcursor_add(ptv, hf_woww_item_text_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_stationery, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_enchant_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_property_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_stack_size, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_spell_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_money, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cash_on_delivery_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_checked_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_expiration_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_mail_template_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_MEETINGSTONE_JOINFAILED: ptvcursor_add(ptv, hf_woww_meeting_stone_failure, 1, ENC_LITTLE_ENDIAN); break; case SMSG_MEETINGSTONE_MEMBER_ADDED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_MEETINGSTONE_SETQUEUE: ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_meeting_stone_status, 1, ENC_LITTLE_ENDIAN); break; case SMSG_MESSAGECHAT: ptvcursor_add_ret_uint(ptv, hf_woww_chat_type, 1, ENC_LITTLE_ENDIAN, &chat_type); ptvcursor_add(ptv, hf_woww_language, 4, ENC_LITTLE_ENDIAN); if (chat_type == CHAT_TYPE_MONSTER_WHISPER || chat_type == CHAT_TYPE_RAID_BOSS_EMOTE || chat_type == CHAT_TYPE_MONSTER_EMOTE) { add_sized_cstring(ptv, &hf_woww_monster_name); ptvcursor_add(ptv, hf_woww_monster, 8, ENC_LITTLE_ENDIAN); } else if (chat_type == CHAT_TYPE_SAY || chat_type == CHAT_TYPE_PARTY || chat_type == CHAT_TYPE_YELL) { ptvcursor_add(ptv, hf_woww_speech_bubble_credit, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_chat_credit, 8, ENC_LITTLE_ENDIAN); } else if (chat_type == CHAT_TYPE_MONSTER_SAY || chat_type == CHAT_TYPE_MONSTER_YELL) { ptvcursor_add(ptv, hf_woww_sender, 8, ENC_LITTLE_ENDIAN); add_sized_cstring(ptv, &hf_woww_sender_name); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (chat_type == CHAT_TYPE_CHANNEL) { add_cstring(ptv, &hf_woww_channel_name); ptvcursor_add(ptv, hf_woww_player_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_sender, 8, ENC_LITTLE_ENDIAN); } add_sized_cstring(ptv, &hf_woww_message); ptvcursor_add(ptv, hf_woww_player_chat_tag, 1, ENC_LITTLE_ENDIAN); break; case SMSG_MONSTER_MOVE: add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_spline_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_monster_move_type, 1, ENC_LITTLE_ENDIAN, &move_type); if (move_type == MONSTER_MOVE_TYPE_FACING_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_SPOT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); add_monster_move_spline(ptv); break; case SMSG_MONSTER_MOVE_TRANSPORT: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_spline_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_monster_move_type, 1, ENC_LITTLE_ENDIAN, &move_type); if (move_type == MONSTER_MOVE_TYPE_FACING_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (move_type == MONSTER_MOVE_TYPE_FACING_SPOT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); add_monster_move_spline(ptv); break; case SMSG_MOUNTRESULT: ptvcursor_add(ptv, hf_woww_mount_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOUNTSPECIAL_ANIM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_FEATHER_FALL: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_KNOCK_BACK: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_movement_counter, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_v_cos, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_v_sin, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_horizontal_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_vertical_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_LAND_WALK: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_NORMAL_FALL: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_SET_HOVER: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_UNSET_HOVER: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_MOVE_WATER_WALK: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_counter, 4, ENC_LITTLE_ENDIAN); break; case SMSG_NAME_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_character_name); add_cstring(ptv, &hf_woww_realm_name); ptvcursor_add(ptv, hf_woww_race, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gender, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 4, ENC_LITTLE_ENDIAN); break; case SMSG_NEW_WORLD: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); break; case SMSG_NOTIFICATION: add_cstring(ptv, &hf_woww_notification); break; case SMSG_NPC_TEXT_UPDATE: ptvcursor_add(ptv, hf_woww_text_id, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 8; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "NpcTextUpdate %i", i1); ptvcursor_add(ptv, hf_woww_probability, 4, ENC_LITTLE_ENDIAN); for (guint32 i2 = 0; i2 < 2; ++i2) { add_cstring(ptv, &hf_woww_texts); } ptvcursor_add(ptv, hf_woww_language, 4, ENC_LITTLE_ENDIAN); for (guint32 i2 = 0; i2 < 3; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "NpcTextUpdateEmote %i", i2); ptvcursor_add(ptv, hf_woww_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_pop_subtree(ptv); } break; case SMSG_OPEN_CONTAINER: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_PAGE_TEXT_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_page_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_text); ptvcursor_add(ptv, hf_woww_next_page_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PARTYKILLLOG: ptvcursor_add(ptv, hf_woww_player_with_killing_blow, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_victim, 8, ENC_LITTLE_ENDIAN); break; case SMSG_PARTY_COMMAND_RESULT: ptvcursor_add(ptv, hf_woww_party_operation, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_member); ptvcursor_add(ptv, hf_woww_party_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PARTY_MEMBER_STATS: add_packed_guid(ptv, pinfo); ptvcursor_add_ret_uint(ptv, hf_woww_group_update_flags, 4, ENC_LITTLE_ENDIAN, &mask); if (mask & GROUP_UPDATE_FLAGS_STATUS) { ptvcursor_add(ptv, hf_woww_group_member_online_status, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_CUR_HP) { ptvcursor_add(ptv, hf_woww_current_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_MAX_HP) { ptvcursor_add(ptv, hf_woww_max_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_POWER_TYPE) { ptvcursor_add(ptv, hf_woww_power, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_CUR_POWER) { ptvcursor_add(ptv, hf_woww_current_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_MAX_POWER) { ptvcursor_add(ptv, hf_woww_max_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_LEVEL) { ptvcursor_add(ptv, hf_woww_level, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_ZONE) { ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_POSITION) { ptvcursor_add(ptv, hf_woww_position_x_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y_int, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_AURAS) { add_aura_mask(ptv); } if (mask & GROUP_UPDATE_FLAGS_AURAS_2) { add_aura_mask(ptv); } if (mask & GROUP_UPDATE_FLAGS_PET_GUID) { ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_NAME) { add_cstring(ptv, &hf_woww_pet_name); } if (mask & GROUP_UPDATE_FLAGS_PET_MODEL_ID) { ptvcursor_add(ptv, hf_woww_pet_display_id, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_CUR_HP) { ptvcursor_add(ptv, hf_woww_pet_current_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_MAX_HP) { ptvcursor_add(ptv, hf_woww_pet_max_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_POWER_TYPE) { ptvcursor_add(ptv, hf_woww_power, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_CUR_POWER) { ptvcursor_add(ptv, hf_woww_pet_current_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_MAX_POWER) { ptvcursor_add(ptv, hf_woww_pet_max_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_AURAS) { add_aura_mask(ptv); } break; case SMSG_PARTY_MEMBER_STATS_FULL: add_packed_guid(ptv, pinfo); ptvcursor_add_ret_uint(ptv, hf_woww_group_update_flags, 4, ENC_LITTLE_ENDIAN, &mask); if (mask & GROUP_UPDATE_FLAGS_STATUS) { ptvcursor_add(ptv, hf_woww_group_member_online_status, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_CUR_HP) { ptvcursor_add(ptv, hf_woww_current_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_MAX_HP) { ptvcursor_add(ptv, hf_woww_max_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_POWER_TYPE) { ptvcursor_add(ptv, hf_woww_power, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_CUR_POWER) { ptvcursor_add(ptv, hf_woww_current_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_MAX_POWER) { ptvcursor_add(ptv, hf_woww_max_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_LEVEL) { ptvcursor_add(ptv, hf_woww_level, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_ZONE) { ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_POSITION) { ptvcursor_add(ptv, hf_woww_position_x_int, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_position_y_int, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_AURAS) { add_aura_mask(ptv); } if (mask & GROUP_UPDATE_FLAGS_PET_GUID) { ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_NAME) { add_cstring(ptv, &hf_woww_pet_name); } if (mask & GROUP_UPDATE_FLAGS_PET_MODEL_ID) { ptvcursor_add(ptv, hf_woww_pet_display_id, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_CUR_HP) { ptvcursor_add(ptv, hf_woww_pet_current_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_MAX_HP) { ptvcursor_add(ptv, hf_woww_pet_max_health, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_POWER_TYPE) { ptvcursor_add(ptv, hf_woww_power, 1, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_CUR_POWER) { ptvcursor_add(ptv, hf_woww_pet_current_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_MAX_POWER) { ptvcursor_add(ptv, hf_woww_pet_max_power, 2, ENC_LITTLE_ENDIAN); } if (mask & GROUP_UPDATE_FLAGS_PET_AURAS) { add_aura_mask(ptv); } break; case SMSG_PAUSE_MIRROR_TIMER: ptvcursor_add(ptv, hf_woww_timer_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_is_frozen, 1, ENC_NA); break; case SMSG_PERIODICAURALOG: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_auras, 4, ENC_LITTLE_ENDIAN, &amount_of_auras); for (guint32 i1 = 0; i1 < amount_of_auras; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "AuraLog %i", i1); ptvcursor_add_ret_uint(ptv, hf_woww_aura_type, 4, ENC_LITTLE_ENDIAN, &aura_type); if (aura_type == AURA_TYPE_PERIODIC_DAMAGE || aura_type == AURA_TYPE_PERIODIC_DAMAGE_PERCENT) { ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_school, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_absorbed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_resisted, 4, ENC_LITTLE_ENDIAN); } else if (aura_type == AURA_TYPE_PERIODIC_HEAL || aura_type == AURA_TYPE_OBS_MOD_HEALTH) { ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); } else if (aura_type == AURA_TYPE_OBS_MOD_MANA || aura_type == AURA_TYPE_PERIODIC_ENERGIZE) { ptvcursor_add(ptv, hf_woww_misc_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); } else if (aura_type == AURA_TYPE_PERIODIC_MANA_LEECH) { ptvcursor_add(ptv, hf_woww_misc_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gain_multiplier, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case SMSG_PETITION_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_petition_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_charter_owner, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_guild_name); add_cstring(ptv, &hf_woww_body_text); ptvcursor_add(ptv, hf_woww_unknown_flags, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_minimum_signatures, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_maximum_signatures, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_deadline, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_issue_date, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_guild_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_class, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_race, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_genders, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_minimum_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_allowed_maximum_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_todo_amount_of_signers, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_number_of_choices, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PETITION_SHOWLIST: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_petitions, 1, ENC_LITTLE_ENDIAN, &amount_of_petitions); for (guint32 i1 = 0; i1 < amount_of_petitions; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "PetitionShowlist %i", i1); ptvcursor_add(ptv, hf_woww_index, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_charter_entry, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_charter_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guild_charter_cost, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_PETITION_SHOW_SIGNATURES: ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_owner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_petition, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_signatures, 1, ENC_LITTLE_ENDIAN, &amount_of_signatures); for (guint32 i1 = 0; i1 < amount_of_signatures; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "PetitionSignature %i", i1); ptvcursor_add(ptv, hf_woww_signer, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_PETITION_SIGN_RESULTS: ptvcursor_add(ptv, hf_woww_petition, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_owner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_petition_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PET_ACTION_FEEDBACK: ptvcursor_add(ptv, hf_woww_pet_feedback, 1, ENC_LITTLE_ENDIAN); break; case SMSG_PET_ACTION_SOUND: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_talk_reason, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PET_CAST_FAILED: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_cast_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_PET_DISMISS_SOUND: ptvcursor_add(ptv, hf_woww_sound_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); break; case SMSG_PET_MODE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_react_state, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_command_state, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_enabled, 1, ENC_LITTLE_ENDIAN); break; case SMSG_PET_NAME_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_pet_number, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_pet_name_timestamp, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PET_SPELLS: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_react_state, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_command_state, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pet_enabled, 1, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 10; ++i1) { ptvcursor_add(ptv, hf_woww_action_bars, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_spells, 1, ENC_LITTLE_ENDIAN, &amount_of_spells); for (guint32 i1 = 0; i1 < amount_of_spells; ++i1) { ptvcursor_add(ptv, hf_woww_spells, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_cooldowns, 1, ENC_LITTLE_ENDIAN, &amount_of_cooldowns); for (guint32 i1 = 0; i1 < amount_of_cooldowns; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "PetSpellCooldown %i", i1); ptvcursor_add(ptv, hf_woww_spell, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_category, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_category_cooldown, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } break; case SMSG_PET_TAME_FAILURE: ptvcursor_add(ptv, hf_woww_pet_tame_failure_reason, 1, ENC_LITTLE_ENDIAN); break; case SMSG_PET_UNLEARN_CONFIRM: ptvcursor_add(ptv, hf_woww_pet, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_talent_reset_cost, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAYED_TIME: ptvcursor_add(ptv, hf_woww_total_played_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level_played_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAYERBOUND: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAYER_SKINNED: ptvcursor_add(ptv, hf_woww_spirit_released, 1, ENC_NA); break; case SMSG_PLAY_MUSIC: ptvcursor_add(ptv, hf_woww_sound_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAY_OBJECT_SOUND: ptvcursor_add(ptv, hf_woww_sound_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_PLAY_SOUND: ptvcursor_add(ptv, hf_woww_sound_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAY_SPELL_IMPACT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_visual_kit, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PLAY_SPELL_VISUAL: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_art_kit, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PONG: ptvcursor_add(ptv, hf_woww_sequence_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_PROCRESIST: ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_log_format, 1, ENC_LITTLE_ENDIAN); break; case SMSG_PVP_CREDIT: ptvcursor_add(ptv, hf_woww_honor_points, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_victim, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_pvp_rank, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUERY_TIME_RESPONSE: ptvcursor_add(ptv, hf_woww_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTGIVER_OFFER_REWARD: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); add_cstring(ptv, &hf_woww_offer_reward_text); ptvcursor_add(ptv, hf_woww_auto_finish, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_emotes, 4, ENC_LITTLE_ENDIAN, &amount_of_emotes); for (guint32 i1 = 0; i1 < amount_of_emotes; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "NpcTextUpdateEmote %i", i1); ptvcursor_add(ptv, hf_woww_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_choice_item_rewards, 4, ENC_LITTLE_ENDIAN, &amount_of_choice_item_rewards); for (guint32 i1 = 0; i1 < amount_of_choice_item_rewards; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemRequirement %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_item_rewards, 4, ENC_LITTLE_ENDIAN, &amount_of_item_rewards); for (guint32 i1 = 0; i1 < amount_of_item_rewards; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemRequirement %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_money_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reward_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reward_spell_cast, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTGIVER_QUEST_COMPLETE: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_experience_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_money_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_item_rewards, 4, ENC_LITTLE_ENDIAN, &amount_of_item_rewards); for (guint32 i1 = 0; i1 < amount_of_item_rewards; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemReward %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_QUESTGIVER_QUEST_DETAILS: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); add_cstring(ptv, &hf_woww_details); add_cstring(ptv, &hf_woww_objectives); ptvcursor_add(ptv, hf_woww_auto_finish, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_choice_item_rewards, 4, ENC_LITTLE_ENDIAN, &amount_of_choice_item_rewards); for (guint32 i1 = 0; i1 < amount_of_choice_item_rewards; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemReward %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_item_rewards, 4, ENC_LITTLE_ENDIAN, &amount_of_item_rewards); for (guint32 i1 = 0; i1 < amount_of_item_rewards; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemReward %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_money_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reward_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_emotes, 4, ENC_LITTLE_ENDIAN, &amount_of_emotes); for (guint32 i1 = 0; i1 < amount_of_emotes; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestDetailsEmote %i", i1); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_QUESTGIVER_QUEST_FAILED: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_failed_reason, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTGIVER_QUEST_INVALID: ptvcursor_add(ptv, hf_woww_quest_failed_reason, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTGIVER_QUEST_LIST: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); ptvcursor_add(ptv, hf_woww_emote_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_entries, 1, ENC_LITTLE_ENDIAN, &amount_of_entries); for (guint32 i1 = 0; i1 < amount_of_entries; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItem %i", i1); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_icon, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); ptvcursor_pop_subtree(ptv); } break; case SMSG_QUESTGIVER_REQUEST_ITEMS: ptvcursor_add(ptv, hf_woww_npc, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); add_cstring(ptv, &hf_woww_request_items_text); ptvcursor_add(ptv, hf_woww_emote_delay, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auto_finish, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_money, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_required_items, 4, ENC_LITTLE_ENDIAN, &amount_of_required_items); for (guint32 i1 = 0; i1 < amount_of_required_items; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemRequirement %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_completable, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_flags, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_flags, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTGIVER_STATUS: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_giver_status, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTUPDATE_ADD_ITEM: ptvcursor_add(ptv, hf_woww_required_item_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_items_required, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTUPDATE_ADD_KILL: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_creature_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_kill_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_kill_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTUPDATE_COMPLETE: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTUPDATE_FAILED: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUESTUPDATE_FAILEDTIMER: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_QUEST_CONFIRM_ACCEPT: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_quest_title); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_QUEST_QUERY_RESPONSE: ptvcursor_add(ptv, hf_woww_quest_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_method, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_zone_or_sort, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reputation_objective_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_opposite_reputation_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_next_quest_in_chain, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_money_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_level_money_reward, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reward_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_source_item_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_quest_flags, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 4; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemReward %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } for (guint32 i1 = 0; i1 < 6; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestItemReward %i", i1); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_point_map_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector2d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_point_opt, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_title); add_cstring(ptv, &hf_woww_objective_text); add_cstring(ptv, &hf_woww_details); add_cstring(ptv, &hf_woww_end_text); for (guint32 i1 = 0; i1 < 4; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "QuestObjective %i", i1); ptvcursor_add(ptv, hf_woww_creature_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_kill_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_item_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_item_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } for (guint32 i1 = 0; i1 < 4; ++i1) { add_cstring(ptv, &hf_woww_objective_texts); } break; case SMSG_RAID_GROUP_ONLY: ptvcursor_add(ptv, hf_woww_homebind_timer, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_raid_group_error, 4, ENC_LITTLE_ENDIAN); break; case SMSG_RAID_INSTANCE_INFO: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_raid_infos, 4, ENC_LITTLE_ENDIAN, &amount_of_raid_infos); for (guint32 i1 = 0; i1 < amount_of_raid_infos; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "RaidInfo %i", i1); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reset_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_instance_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_RAID_INSTANCE_MESSAGE: ptvcursor_add(ptv, hf_woww_raid_instance_message, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_left, 4, ENC_LITTLE_ENDIAN); break; case SMSG_READ_ITEM_FAILED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_READ_ITEM_OK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_RECEIVED_MAIL: ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case SMSG_REMOVED_SPELL: ptvcursor_add(ptv, hf_woww_spell, 2, ENC_LITTLE_ENDIAN); break; case SMSG_RESISTLOG: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_float, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_float, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case SMSG_RESURRECT_REQUEST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); add_sized_cstring(ptv, &hf_woww_name); ptvcursor_add(ptv, hf_woww_player, 1, ENC_NA); break; case SMSG_SELL_ITEM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sell_item_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_SEND_MAIL_RESULT: ptvcursor_add(ptv, hf_woww_mail_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_mail_action, 4, ENC_LITTLE_ENDIAN, &action); if (action == MAIL_ACTION_ITEM_TAKEN) { ptvcursor_add_ret_uint(ptv, hf_woww_mail_result, 4, ENC_LITTLE_ENDIAN, &result); if (result == MAIL_RESULT_ERR_EQUIP_ERROR) { ptvcursor_add(ptv, hf_woww_equip_error, 4, ENC_LITTLE_ENDIAN); } else { ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_count, 4, ENC_LITTLE_ENDIAN); } } else { ptvcursor_add_ret_uint(ptv, hf_woww_mail_result_two, 4, ENC_LITTLE_ENDIAN, &result2); if (result2 == MAIL_RESULT_TWO_ERR_EQUIP_ERROR) { ptvcursor_add(ptv, hf_woww_equip_error, 4, ENC_LITTLE_ENDIAN); } } break; case SMSG_SERVER_MESSAGE: ptvcursor_add(ptv, hf_woww_server_message_type, 4, ENC_LITTLE_ENDIAN); add_cstring(ptv, &hf_woww_message); break; case SMSG_SET_FACTION_STANDING: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_faction_standings, 4, ENC_LITTLE_ENDIAN, &amount_of_faction_standings); for (guint32 i1 = 0; i1 < amount_of_faction_standings; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "FactionStanding %i", i1); ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_standing, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_SET_FACTION_VISIBLE: ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); break; case SMSG_SET_FLAT_SPELL_MODIFIER: ptvcursor_add(ptv, hf_woww_eff, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_op, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_value, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SET_FORCED_REACTIONS: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_reactions, 4, ENC_LITTLE_ENDIAN, &amount_of_reactions); for (guint32 i1 = 0; i1 < amount_of_reactions; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "ForcedReaction %i", i1); ptvcursor_add(ptv, hf_woww_faction, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_reputation_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_SET_PCT_SPELL_MODIFIER: ptvcursor_add(ptv, hf_woww_eff, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_op, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_value, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SET_PROFICIENCY: ptvcursor_add(ptv, hf_woww_item_class, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_sub_class_mask, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SET_REST_START: ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SHOWTAXINODES: ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_nearest_node, 4, ENC_LITTLE_ENDIAN); while (ptvcursor_current_offset(ptv) < offset_packet_end) { ptvcursor_add(ptv, hf_woww_nodes, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_SHOW_BANK: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_SPELLDAMAGESHIELD: ptvcursor_add(ptv, hf_woww_victim, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_school, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPELLDISPELLOG: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_spells, 4, ENC_LITTLE_ENDIAN, &amount_of_spells); for (guint32 i1 = 0; i1 < amount_of_spells; ++i1) { ptvcursor_add(ptv, hf_woww_spells, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_SPELLENERGIZELOG: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_power, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPELLHEALLOG: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_critical, 1, ENC_NA); break; case SMSG_SPELLINSTAKILLLOG: ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPELLLOGEXECUTE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_effects, 4, ENC_LITTLE_ENDIAN, &amount_of_effects); for (guint32 i1 = 0; i1 < amount_of_effects; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellLog %i", i1); ptvcursor_add_ret_uint(ptv, hf_woww_spell_effect, 4, ENC_LITTLE_ENDIAN, &effect); ptvcursor_add(ptv, hf_woww_amount_of_logs, 4, ENC_LITTLE_ENDIAN); if (effect == SPELL_EFFECT_POWER_DRAIN) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_power, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_multiplier, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_HEAL || effect == SPELL_EFFECT_HEAL_MAX_HEALTH) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_heal_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_heal_critical, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_ENERGIZE) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_energize_amount, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_energize_power, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_ADD_EXTRA_ATTACKS) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_extra_attacks, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_CREATE_ITEM) { ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_INTERRUPT_CAST) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_interrupted_spell, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_DURABILITY_DAMAGE) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_to_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_FEED_PET) { ptvcursor_add(ptv, hf_woww_feed_pet_item, 4, ENC_LITTLE_ENDIAN); } else if (effect == SPELL_EFFECT_INSTAKILL || effect == SPELL_EFFECT_RESURRECT || effect == SPELL_EFFECT_DISPEL || effect == SPELL_EFFECT_THREAT || effect == SPELL_EFFECT_DISTRACT || effect == SPELL_EFFECT_SANCTUARY || effect == SPELL_EFFECT_THREAT_ALL || effect == SPELL_EFFECT_DISPEL_MECHANIC || effect == SPELL_EFFECT_RESURRECT_NEW || effect == SPELL_EFFECT_ATTACK_ME || effect == SPELL_EFFECT_SKIN_PLAYER_CORPSE || effect == SPELL_EFFECT_MODIFY_THREAT_PERCENT || effect == SPELL_EFFECT_UNKNOWN126 || effect == SPELL_EFFECT_OPEN_LOCK || effect == SPELL_EFFECT_OPEN_LOCK_ITEM || effect == SPELL_EFFECT_DISMISS_PET || effect == SPELL_EFFECT_TRANS_DOOR || effect == SPELL_EFFECT_SUMMON || effect == SPELL_EFFECT_SUMMON_PET || effect == SPELL_EFFECT_SUMMON_WILD || effect == SPELL_EFFECT_SUMMON_GUARDIAN || effect == SPELL_EFFECT_SUMMON_TOTEM_SLOT1 || effect == SPELL_EFFECT_SUMMON_TOTEM_SLOT2 || effect == SPELL_EFFECT_SUMMON_TOTEM_SLOT3 || effect == SPELL_EFFECT_SUMMON_TOTEM_SLOT4 || effect == SPELL_EFFECT_SUMMON_POSSESSED || effect == SPELL_EFFECT_SUMMON_TOTEM || effect == SPELL_EFFECT_SUMMON_CRITTER || effect == SPELL_EFFECT_SUMMON_OBJECT_WILD || effect == SPELL_EFFECT_SUMMON_OBJECT_SLOT1 || effect == SPELL_EFFECT_SUMMON_OBJECT_SLOT2 || effect == SPELL_EFFECT_SUMMON_OBJECT_SLOT3 || effect == SPELL_EFFECT_SUMMON_OBJECT_SLOT4 || effect == SPELL_EFFECT_SUMMON_DEMON) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } break; case SMSG_SPELLLOGMISS: ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_targets, 4, ENC_LITTLE_ENDIAN, &amount_of_targets); for (guint32 i1 = 0; i1 < amount_of_targets; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellLogMiss %i", i1); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_miss_info, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_SPELLNONMELEEDAMAGELOG: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_school, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_absorbed_damage, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_resisted, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_periodic_log, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_unused, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_blocked, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_hit_info, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_extend_flag, 1, ENC_LITTLE_ENDIAN); break; case SMSG_SPELLORDAMAGE_IMMUNE: ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_debug_log_format, 1, ENC_NA); break; case SMSG_SPELL_COOLDOWN: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); while (ptvcursor_current_offset(ptv) < offset_packet_end) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCooldownStatus"); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cooldown_time, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_SPELL_DELAYED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_delay_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPELL_FAILED_OTHER: ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPELL_FAILURE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_cast_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_SPELL_GO: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_cast_flags, 2, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_hits, 1, ENC_LITTLE_ENDIAN, &amount_of_hits); for (guint32 i1 = 0; i1 < amount_of_hits; ++i1) { ptvcursor_add(ptv, hf_woww_hits, 8, ENC_LITTLE_ENDIAN); } ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_misses, 1, ENC_LITTLE_ENDIAN, &amount_of_misses); for (guint32 i1 = 0; i1 < amount_of_misses; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellMiss %i", i1); ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_spell_miss_info, 4, ENC_LITTLE_ENDIAN, &miss_info); ptvcursor_pop_subtree(ptv); } ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCastTargets"); ptvcursor_add_ret_uint(ptv, hf_woww_spell_cast_target_flags, 2, ENC_LITTLE_ENDIAN, &target_flags); if (target_flags & SPELL_CAST_TARGET_FLAGS_UNIT) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_GAMEOBJECT) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_OBJECT_UNK) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_ITEM) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_TRADE_ITEM) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_DEST_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_STRING) { add_cstring(ptv, &hf_woww_target_string); } if (target_flags & SPELL_CAST_TARGET_FLAGS_CORPSE) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_PVP_CORPSE) { add_packed_guid(ptv, pinfo); } ptvcursor_pop_subtree(ptv); if (flags & CAST_FLAGS_AMMO) { ptvcursor_add(ptv, hf_woww_ammo_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_ammo_inventory_type, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_SPELL_START: add_packed_guid(ptv, pinfo); add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_cast_flags, 2, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timer, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "SpellCastTargets"); ptvcursor_add_ret_uint(ptv, hf_woww_spell_cast_target_flags, 2, ENC_LITTLE_ENDIAN, &target_flags); if (target_flags & SPELL_CAST_TARGET_FLAGS_UNIT) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_GAMEOBJECT) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_OBJECT_UNK) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_ITEM) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_TRADE_ITEM) { add_packed_guid(ptv, pinfo); } if (target_flags & SPELL_CAST_TARGET_FLAGS_SOURCE_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_DEST_LOCATION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } if (target_flags & SPELL_CAST_TARGET_FLAGS_STRING) { add_cstring(ptv, &hf_woww_target_string); } if (target_flags & SPELL_CAST_TARGET_FLAGS_CORPSE) { add_packed_guid(ptv, pinfo); } else if (target_flags & SPELL_CAST_TARGET_FLAGS_PVP_CORPSE) { add_packed_guid(ptv, pinfo); } ptvcursor_pop_subtree(ptv); if (flags & CAST_FLAGS_AMMO) { ptvcursor_add(ptv, hf_woww_ammo_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_ammo_inventory_type, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_SPELL_UPDATE_CHAIN_TARGETS: ptvcursor_add(ptv, hf_woww_caster, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_targets, 4, ENC_LITTLE_ENDIAN, &amount_of_targets); for (guint32 i1 = 0; i1 < amount_of_targets; ++i1) { ptvcursor_add(ptv, hf_woww_targets, 8, ENC_LITTLE_ENDIAN); } break; case SMSG_SPIRIT_HEALER_CONFIRM: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_MOVE_FEATHER_FALL: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_LAND_WALK: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_NORMAL_FALL: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_ROOT: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_MOVE_SET_HOVER: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_SET_RUN_MODE: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_SET_WALK_MODE: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_START_SWIM: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_STOP_SWIM: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_UNROOT: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_UNSET_HOVER: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_MOVE_WATER_WALK: add_packed_guid(ptv, pinfo); break; case SMSG_SPLINE_SET_RUN_BACK_SPEED: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_SET_RUN_SPEED: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_SET_SWIM_BACK_SPEED: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_SET_SWIM_SPEED: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_SET_TURN_RATE: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SPLINE_SET_WALK_SPEED: add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_speed, 4, ENC_LITTLE_ENDIAN); break; case SMSG_STABLE_RESULT: ptvcursor_add(ptv, hf_woww_stable_result, 1, ENC_LITTLE_ENDIAN); break; case SMSG_STANDSTATE_UPDATE: ptvcursor_add(ptv, hf_woww_unit_stand_state, 1, ENC_LITTLE_ENDIAN); break; case SMSG_START_MIRROR_TIMER: ptvcursor_add(ptv, hf_woww_timer_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_time_remaining, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_scale, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_is_frozen, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_STOP_MIRROR_TIMER: ptvcursor_add(ptv, hf_woww_timer_type, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SUMMON_REQUEST: ptvcursor_add(ptv, hf_woww_summoner, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_auto_decline_time, 4, ENC_LITTLE_ENDIAN); break; case SMSG_SUPERCEDED_SPELL: ptvcursor_add(ptv, hf_woww_new_spell_id, 2, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_old_spell_id, 2, ENC_LITTLE_ENDIAN); break; case SMSG_TAXINODE_STATUS: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_taxi_mask_node_known, 1, ENC_NA); break; case SMSG_TEXT_EMOTE: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_text_emote, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_emote_int, 4, ENC_LITTLE_ENDIAN); add_sized_cstring(ptv, &hf_woww_name); break; case SMSG_TRADE_STATUS: ptvcursor_add_ret_uint(ptv, hf_woww_trade_status, 4, ENC_LITTLE_ENDIAN, &status); if (status == TRADE_STATUS_BEGIN_TRADE) { ptvcursor_add(ptv, hf_woww_unknown_guid, 8, ENC_LITTLE_ENDIAN); } else if (status == TRADE_STATUS_CLOSE_WINDOW) { ptvcursor_add(ptv, hf_woww_inventory_result, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_target_error, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_item_limit_category_id, 4, ENC_LITTLE_ENDIAN); } else if (status == TRADE_STATUS_ONLY_CONJURED || status == TRADE_STATUS_NOT_ON_TAPLIST) { ptvcursor_add(ptv, hf_woww_slot, 1, ENC_LITTLE_ENDIAN); } break; case SMSG_TRADE_STATUS_EXTENDED: ptvcursor_add(ptv, hf_woww_self_player, 1, ENC_NA); ptvcursor_add(ptv, hf_woww_trade_slot_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_trade_slot_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_money_in_trade, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_on_lowest_slot, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < 7; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TradeSlot %i", i1); ptvcursor_add(ptv, hf_woww_trade_slot_number, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_display_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_stack_count, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_wrapped, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_gift_wrapper, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_enchantment, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_creator, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_charges, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_suffix_factor, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_item_random_properties_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_lock_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_max_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_durability, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_TRAINER_BUY_FAILED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_training_failure_reason, 4, ENC_LITTLE_ENDIAN); break; case SMSG_TRAINER_BUY_SUCCEEDED: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_TRAINER_LIST: ptvcursor_add(ptv, hf_woww_guid, 8, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_trainer_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_spells, 4, ENC_LITTLE_ENDIAN, &amount_of_spells); for (guint32 i1 = 0; i1 < amount_of_spells; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "TrainerSpell %i", i1); ptvcursor_add(ptv, hf_woww_spell, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_trainer_spell_state, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_spell_cost, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_talent_point_cost, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_first_rank, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_level, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_skill, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_required_skill_value, 4, ENC_LITTLE_ENDIAN); for (guint32 i2 = 0; i2 < 3; ++i2) { ptvcursor_add(ptv, hf_woww_required_spells, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } add_cstring(ptv, &hf_woww_greeting); break; case SMSG_TRANSFER_ABORTED: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_transfer_abort_reason, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_argument, 1, ENC_LITTLE_ENDIAN); break; case SMSG_TRANSFER_PENDING: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); len = offset_packet_end - ptvcursor_current_offset(ptv); if (len > 0) { ptvcursor_add(ptv, hf_woww_transport, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_TRIGGER_CINEMATIC: ptvcursor_add(ptv, hf_woww_cinematic_sequence_id, 4, ENC_LITTLE_ENDIAN); break; case SMSG_TURN_IN_PETITION_RESULTS: ptvcursor_add(ptv, hf_woww_petition_result, 4, ENC_LITTLE_ENDIAN); break; case SMSG_TUTORIAL_FLAGS: for (guint32 i1 = 0; i1 < 8; ++i1) { ptvcursor_add(ptv, hf_woww_tutorial_data, 4, ENC_LITTLE_ENDIAN); } break; case SMSG_UPDATE_AURA_DURATION: ptvcursor_add(ptv, hf_woww_aura_slot, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_aura_duration, 4, ENC_LITTLE_ENDIAN); break; case SMSG_UPDATE_INSTANCE_OWNERSHIP: ptvcursor_add(ptv, hf_woww_player_is_saved_to_a_raid, 4, ENC_LITTLE_ENDIAN); break; case SMSG_UPDATE_LAST_INSTANCE: ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN); break; case SMSG_UPDATE_OBJECT: ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_objects, 4, ENC_LITTLE_ENDIAN, &amount_of_objects); ptvcursor_add(ptv, hf_woww_has_transport, 1, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < amount_of_objects; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Object %i", i1); ptvcursor_add_ret_uint(ptv, hf_woww_update_type, 1, ENC_LITTLE_ENDIAN, &update_type); if (update_type == UPDATE_TYPE_VALUES) { add_packed_guid(ptv, pinfo); add_update_mask(ptv, pinfo); } else if (update_type == UPDATE_TYPE_MOVEMENT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementBlock"); ptvcursor_add_ret_uint(ptv, hf_woww_update_flag, 1, ENC_LITTLE_ENDIAN, &update_flag); if (update_flag & UPDATE_FLAG_LIVING) { ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_living_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_transport_orientation, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_walking_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_turn_rate, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_SPLINE_ENABLED) { ptvcursor_add_ret_uint(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN, &spline_flags); if (spline_flags & SPLINE_FLAG_FINAL_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_POINT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_time_passed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_nodes, 4, ENC_LITTLE_ENDIAN, &amount_of_nodes); for (guint32 i2 = 0; i2 < amount_of_nodes; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d %i", i2); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else if (update_flag & UPDATE_FLAG_HAS_POSITION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_HIGH_GUID) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_ALL) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_MELEE_ATTACKING) { add_packed_guid(ptv, pinfo); } if (update_flag & UPDATE_FLAG_TRANSPORT) { ptvcursor_add(ptv, hf_woww_transport_progress_in_ms, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); } else if (update_type == UPDATE_TYPE_CREATE_OBJECT || update_type == UPDATE_TYPE_CREATE_OBJECT2) { add_packed_guid(ptv, pinfo); ptvcursor_add(ptv, hf_woww_object_type, 1, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "MovementBlock"); ptvcursor_add_ret_uint(ptv, hf_woww_update_flag, 1, ENC_LITTLE_ENDIAN, &update_flag); if (update_flag & UPDATE_FLAG_LIVING) { ptvcursor_add_ret_uint(ptv, hf_woww_movement_flags, 4, ENC_LITTLE_ENDIAN, &flags); ptvcursor_add(ptv, hf_woww_timestamp, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_living_orientation, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_ON_TRANSPORT) { add_packed_guid(ptv, pinfo); ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_transport_orientation, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SWIMMING) { ptvcursor_add(ptv, hf_woww_pitch, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_fall_time, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_JUMPING) { ptvcursor_add(ptv, hf_woww_z_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_cos_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sin_angle, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_xy_speed, 4, ENC_LITTLE_ENDIAN); } if (flags & MOVEMENT_FLAGS_SPLINE_ELEVATION) { ptvcursor_add(ptv, hf_woww_spline_elevation, 4, ENC_LITTLE_ENDIAN); } ptvcursor_add(ptv, hf_woww_walking_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_running_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_backwards_swimming_speed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_turn_rate, 4, ENC_LITTLE_ENDIAN); if (flags & MOVEMENT_FLAGS_SPLINE_ENABLED) { ptvcursor_add_ret_uint(ptv, hf_woww_spline_flag, 4, ENC_LITTLE_ENDIAN, &spline_flags); if (spline_flags & SPLINE_FLAG_FINAL_ANGLE) { ptvcursor_add(ptv, hf_woww_angle, 4, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_TARGET) { ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN); } else if (spline_flags & SPLINE_FLAG_FINAL_POINT) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add(ptv, hf_woww_time_passed, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_duration, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_nodes, 4, ENC_LITTLE_ENDIAN, &amount_of_nodes); for (guint32 i2 = 0; i2 < amount_of_nodes; ++i2) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d %i", i2); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } } else if (update_flag & UPDATE_FLAG_HAS_POSITION) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "Vector3d"); ptvcursor_add(ptv, hf_woww_x, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_y, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_z, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); ptvcursor_add(ptv, hf_woww_orientation, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_HIGH_GUID) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_ALL) { ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN); } if (update_flag & UPDATE_FLAG_MELEE_ATTACKING) { add_packed_guid(ptv, pinfo); } if (update_flag & UPDATE_FLAG_TRANSPORT) { ptvcursor_add(ptv, hf_woww_transport_progress_in_ms, 4, ENC_LITTLE_ENDIAN); } ptvcursor_pop_subtree(ptv); add_update_mask(ptv, pinfo); } else if (update_type == UPDATE_TYPE_OUT_OF_RANGE_OBJECTS || update_type == UPDATE_TYPE_NEAR_OBJECTS) { ptvcursor_add_ret_uint(ptv, hf_woww_count, 4, ENC_LITTLE_ENDIAN, &count); for (guint32 i2 = 0; i2 < count; ++i2) { add_packed_guid(ptv, pinfo); } } ptvcursor_pop_subtree(ptv); } break; case SMSG_UPDATE_WORLD_STATE: ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "WorldState"); ptvcursor_add(ptv, hf_woww_state, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_value, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); break; case SMSG_WARDEN_DATA: len = offset_packet_end - ptvcursor_current_offset(ptv); ptvcursor_add(ptv, hf_woww_encrypted_data, len, ENC_NA); break; case SMSG_WEATHER: ptvcursor_add(ptv, hf_woww_weather_type, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_grade, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_sound_id, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_weather_change_type, 1, ENC_LITTLE_ENDIAN); break; case SMSG_WHO: ptvcursor_add_ret_uint(ptv, hf_woww_listed_players, 4, ENC_LITTLE_ENDIAN, &listed_players); ptvcursor_add(ptv, hf_woww_online_players, 4, ENC_LITTLE_ENDIAN); for (guint32 i1 = 0; i1 < listed_players; ++i1) { ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "WhoPlayer %i", i1); add_cstring(ptv, &hf_woww_name); add_cstring(ptv, &hf_woww_guild); ptvcursor_add(ptv, hf_woww_level, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_class, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_race, 1, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(ptv, hf_woww_party_status, 4, ENC_LITTLE_ENDIAN); ptvcursor_pop_subtree(ptv); } break; case SMSG_WHOIS: add_cstring(ptv, &hf_woww_message); break; case SMSG_ZONE_UNDER_ATTACK: ptvcursor_add(ptv, hf_woww_area, 4, ENC_LITTLE_ENDIAN); break; default: break; } /* AUTOGENERATED_END_PARSER */ ptvcursor_free(ptv); } static gint add_header_to_tree(WowwDecryptedHeader_t* decrypted_header, proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, guint8 headerSize, gint start_offset) { // Size field does not count in the reported size, so we need to add it. const guint16 packet_size = (decrypted_header->size[0] << 8 | decrypted_header->size[1]) + WOWW_HEADER_SIZE_FIELD_WIDTH; proto_tree* ti = proto_tree_add_item(tree, proto_woww, tvb, start_offset, packet_size, ENC_NA); proto_tree* woww_tree = proto_item_add_subtree(ti, ett_message); // Add to tree tvbuff_t *next_tvb = tvb_new_child_real_data(tvb, (guint8*)decrypted_header, headerSize, headerSize); add_new_data_source(pinfo, next_tvb, "Decrypted Header"); // We're indexing into another tvb gint offset = 0; gint len = WOWW_HEADER_SIZE_FIELD_WIDTH; proto_tree_add_item(woww_tree, hf_woww_size, next_tvb, offset, len, ENC_BIG_ENDIAN); offset += len; guint32 opcode = 0; if (WOWW_SERVER_TO_CLIENT) { len = 2; opcode = tvb_get_guint16(next_tvb, offset, ENC_LITTLE_ENDIAN); } else if (WOWW_CLIENT_TO_SERVER) { len = 4; opcode = tvb_get_guint32(next_tvb, offset, ENC_LITTLE_ENDIAN); } proto_tree_add_item(woww_tree, hf_woww_opcode, next_tvb, offset, len, ENC_LITTLE_ENDIAN); if (start_offset == 0) { // First message col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, world_packet_strings, "Encrypted Header")); } else { col_append_str(pinfo->cinfo, COL_INFO, " | "); col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, world_packet_strings, "Encrypted Header")); } proto_item_set_text(woww_tree, "%s", val_to_str_const(opcode, world_packet_strings, "Encrypted Header")); gint offset_packet_end = start_offset + (gint)packet_size; // Remember to go back to original tvb add_body_fields(opcode, woww_tree, tvb, start_offset + headerSize, offset_packet_end, pinfo); return offset_packet_end; } static int dissect_woww(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (tvb_reported_length(tvb) < WOWW_MIN_LENGTH) return 0; if (tvb_captured_length(tvb) < 1) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "WOWW"); col_set_str(pinfo->cinfo, COL_INFO, "Session Key Not Known Yet"); // Get conversation data conversation_t* conv = find_or_create_conversation(pinfo); WowwConversation_t* wowwConversation = (WowwConversation_t *)conversation_get_proto_data(conv, proto_woww); if (wowwConversation == NULL) { // Assume that file scope means for the lifetime of the dissection wowwConversation = (WowwConversation_t*) wmem_new0(wmem_file_scope(), WowwConversation_t); conversation_add_proto_data(conv, proto_woww, wowwConversation); wowwConversation->decrypted_headers = wmem_map_new(wmem_file_scope(), g_int64_hash, g_int64_equal); wowwConversation->headers_need_decryption = wmem_map_new(wmem_file_scope(), g_int64_hash, g_int64_equal); } // Isolate session key for packet WowwParticipant_t* participant; guint8 headerSize = 4; if (WOWW_SERVER_TO_CLIENT) { participant = &wowwConversation->server; headerSize = 4; } else { participant = &wowwConversation->client; headerSize = 6; } proto_tree* ti = proto_tree_add_item(tree, proto_woww, tvb, 0, -1, ENC_NA); proto_tree* woww_tree = proto_item_add_subtree(ti, ett_woww); gint pdu_offset = 0; gint reported_length = (gint)tvb_reported_length(tvb); guint8 header_index = 0; do { WowwDecryptedHeader_t* decrypted_header = handle_packet_header(pinfo, tvb, participant, wowwConversation, headerSize, header_index, pdu_offset); if (!decrypted_header) { return tvb_captured_length(tvb); } const gint message_size = (decrypted_header->size[0] << 8 | decrypted_header->size[1]) + WOWW_HEADER_SIZE_FIELD_WIDTH; if ((pdu_offset + message_size) > reported_length) { return pdu_offset; } pdu_offset = add_header_to_tree(decrypted_header, woww_tree, tvb, pinfo, headerSize, pdu_offset); header_index++; } while (pdu_offset < reported_length); return tvb_captured_length(tvb); } void proto_register_woww(void) { static hf_register_info hf[] = { { &hf_woww_size, { "Size", "woww.size", FT_UINT16, BASE_HEX_DEC, NULL, 0, "Size of the packet including opcode field but not including size field", HFILL } }, { &hf_woww_opcode, { "Opcode", "woww.opcode", FT_UINT32, BASE_HEX, VALS(world_packet_strings), 0, "Opcode of the packet", HFILL } }, { &hf_woww_string_length, { "String Length", "woww.string_length", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_aura_mask, { "Aura Mask", "woww.aura_mask", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_aura, { "Aura", "woww.aura", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_masks, { "Amount of Masks", "woww.amount_of_masks", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_update_mask, { "Update Mask", "woww.update_mask", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_update_mask_index, { "Update Mask Index", "woww.update_mask_index", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_update_mask_value, { "Update Mask Value", "woww.update_mask_value", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_splines, { "Amount Of Splines", "woww.amount.of.splines", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_packed_spline, { "Packed Spline", "woww.packed_spline", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, /* AUTOGENERATED_START_REGISTER */ { &hf_woww_absorb, { "Absorb", "woww.absorb", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_absorbed, { "Absorbed", "woww.absorbed", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_absorbed_damage, { "Absorbed Damage", "woww.absorbed.damage", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_account_data_type, { "Account Data Type", "woww.account.data.type", FT_UINT32, BASE_HEX_DEC, VALS(e_account_data_type_strings), 0, NULL, HFILL } }, { &hf_woww_action, { "Action", "woww.action", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_action_bar, { "Action Bar", "woww.action.bar", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_action_bars, { "Action Bars", "woww.action.bars", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_action_type, { "Action Type", "woww.action.type", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_activate_taxi_reply, { "Activate Taxi Reply", "woww.activate.taxi.reply", FT_UINT32, BASE_HEX_DEC, VALS(e_activate_taxi_reply_strings), 0, NULL, HFILL } }, { &hf_woww_actual_roll, { "Actual Roll", "woww.actual.roll", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_addon_crc, { "Addon Crc", "woww.addon.crc", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_addon_extra_crc, { "Addon Extra Crc", "woww.addon.extra.crc", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_addon_has_signature, { "Addon Has Signature", "woww.addon.has.signature", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_addon_name, { "Addon Name", "woww.addon.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_addon_type, { "Addon Type", "woww.addon.type", FT_UINT8, BASE_HEX_DEC, VALS(e_addon_type_strings), 0, NULL, HFILL } }, { &hf_woww_agility, { "Agility", "woww.agility", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ai_reaction, { "Ai Reaction", "woww.ai.reaction", FT_UINT32, BASE_HEX_DEC, VALS(e_ai_reaction_strings), 0, NULL, HFILL } }, { &hf_woww_allow_movement, { "Allow Movement", "woww.allow.movement", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_class, { "Allowed Class", "woww.allowed.class", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_genders, { "Allowed Genders", "woww.allowed.genders", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_guild_id, { "Allowed Guild Id", "woww.allowed.guild.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_maximum_level, { "Allowed Maximum Level", "woww.allowed.maximum.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_minimum_level, { "Allowed Minimum Level", "woww.allowed.minimum.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_allowed_race, { "Allowed Race", "woww.allowed.race", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ammo_display_id, { "Ammo Display Id", "woww.ammo.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ammo_inventory_type, { "Ammo Inventory Type", "woww.ammo.inventory.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ammo_type, { "Ammo Type", "woww.ammo.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount, { "Amount", "woww.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_bought, { "Amount Bought", "woww.amount.bought", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_for_sale, { "Amount For Sale", "woww.amount.for.sale", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_accounts_in_guild, { "Amount Of Accounts In Guild", "woww.amount.of.accounts.in.guild", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_auras, { "Amount Of Auras", "woww.amount.of.auras", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_carriers, { "Amount Of Carriers", "woww.amount.of.carriers", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_characters, { "Amount Of Characters", "woww.amount.of.characters", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_characters_in_guild, { "Amount Of Characters In Guild", "woww.amount.of.characters.in.guild", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_choice_item_rewards, { "Amount Of Choice Item Rewards", "woww.amount.of.choice.item.rewards", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_cooldowns, { "Amount Of Cooldowns", "woww.amount.of.cooldowns", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_damages, { "Amount Of Damages", "woww.amount.of.damages", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_effects, { "Amount Of Effects", "woww.amount.of.effects", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_emotes, { "Amount Of Emotes", "woww.amount.of.emotes", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_entries, { "Amount Of Entries", "woww.amount.of.entries", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_events, { "Amount Of Events", "woww.amount.of.events", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_extra_fields, { "Amount Of Extra Fields", "woww.amount.of.extra.fields", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_faction_standings, { "Amount Of Faction Standings", "woww.amount.of.faction.standings", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_factions, { "Amount Of Factions", "woww.amount.of.factions", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_friends, { "Amount Of Friends", "woww.amount.of.friends", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_gossip_items, { "Amount Of Gossip Items", "woww.amount.of.gossip.items", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_hits, { "Amount Of Hits", "woww.amount.of.hits", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_ignored, { "Amount Of Ignored", "woww.amount.of.ignored", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_item_rewards, { "Amount Of Item Rewards", "woww.amount.of.item.rewards", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_items, { "Amount Of Items", "woww.amount.of.items", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_logs, { "Amount Of Logs", "woww.amount.of.logs", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_mails, { "Amount Of Mails", "woww.amount.of.mails", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_members, { "Amount Of Members", "woww.amount.of.members", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_misses, { "Amount Of Misses", "woww.amount.of.misses", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_nodes, { "Amount Of Nodes", "woww.amount.of.nodes", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_objects, { "Amount Of Objects", "woww.amount.of.objects", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_outbid_items, { "Amount Of Outbid Items", "woww.amount.of.outbid.items", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_petitions, { "Amount Of Petitions", "woww.amount.of.petitions", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_pets, { "Amount Of Pets", "woww.amount.of.pets", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_players, { "Amount Of Players", "woww.amount.of.players", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_quests, { "Amount Of Quests", "woww.amount.of.quests", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_raid_infos, { "Amount Of Raid Infos", "woww.amount.of.raid.infos", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_reactions, { "Amount Of Reactions", "woww.amount.of.reactions", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_records, { "Amount Of Records", "woww.amount.of.records", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_required_items, { "Amount Of Required Items", "woww.amount.of.required.items", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_rights, { "Amount Of Rights", "woww.amount.of.rights", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_signatures, { "Amount Of Signatures", "woww.amount.of.signatures", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_spells, { "Amount Of Spells", "woww.amount.of.spells", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_states, { "Amount Of States", "woww.amount.of.states", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_strings, { "Amount Of Strings", "woww.amount.of.strings", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_targets, { "Amount Of Targets", "woww.amount.of.targets", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_teammates, { "Amount Of Teammates", "woww.amount.of.teammates", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_amount_of_zones, { "Amount Of Zones", "woww.amount.of.zones", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_angle, { "Angle", "woww.angle", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_animation_id, { "Animation Id", "woww.animation.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_answer, { "Answer", "woww.answer", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_answer_comment, { "Answer Comment", "woww.answer.comment", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_apply, { "Apply", "woww.apply", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_arcane_resistance, { "Arcane Resistance", "woww.arcane.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_area, { "Area", "woww.area", FT_UINT32, BASE_HEX_DEC, VALS(e_area_strings), 0, NULL, HFILL } }, { &hf_woww_argument, { "Argument", "woww.argument", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_armor, { "Armor", "woww.armor", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_attacker, { "Attacker", "woww.attacker", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_command_action, { "Auction Command Action", "woww.auction.command.action", FT_UINT32, BASE_HEX_DEC, VALS(e_auction_command_action_strings), 0, NULL, HFILL } }, { &hf_woww_auction_command_result, { "Auction Command Result", "woww.auction.command.result", FT_UINT32, BASE_HEX_DEC, VALS(e_auction_command_result_strings), 0, NULL, HFILL } }, { &hf_woww_auction_command_result_two, { "Auction Command Result Two", "woww.auction.command.result.two", FT_UINT32, BASE_HEX_DEC, VALS(e_auction_command_result_two_strings), 0, NULL, HFILL } }, { &hf_woww_auction_duration_in_minutes, { "Auction Duration In Minutes", "woww.auction.duration.in.minutes", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_house, { "Auction House", "woww.auction.house", FT_UINT32, BASE_HEX_DEC, VALS(e_auction_house_strings), 0, NULL, HFILL } }, { &hf_woww_auction_id, { "Auction Id", "woww.auction.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_main_category, { "Auction Main Category", "woww.auction.main.category", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_out_bid, { "Auction Out Bid", "woww.auction.out.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_outbid, { "Auction Outbid", "woww.auction.outbid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_slot_id, { "Auction Slot Id", "woww.auction.slot.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auction_sub_category, { "Auction Sub Category", "woww.auction.sub.category", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auctioneer, { "Auctioneer", "woww.auctioneer", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_aura_duration, { "Aura Duration", "woww.aura.duration", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_aura_slot, { "Aura Slot", "woww.aura.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_aura_type, { "Aura Type", "woww.aura.type", FT_UINT32, BASE_HEX_DEC, VALS(e_aura_type_strings), 0, NULL, HFILL } }, { &hf_woww_auto_decline_time, { "Auto Decline Time", "woww.auto.decline.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_auto_finish, { "Auto Finish", "woww.auto.finish", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_autocast_enabled, { "Autocast Enabled", "woww.autocast.enabled", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_average_wait_time_in_ms, { "Average Wait Time In Ms", "woww.average.wait.time.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_background_color, { "Background Color", "woww.background.color", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_backwards_running_speed, { "Backwards Running Speed", "woww.backwards.running.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_backwards_swimming_speed, { "Backwards Swimming Speed", "woww.backwards.swimming.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_bag, { "Bag", "woww.bag", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bag_family, { "Bag Family", "woww.bag.family", FT_UINT32, BASE_HEX_DEC, VALS(e_bag_family_strings), 0, NULL, HFILL } }, { &hf_woww_bag_index, { "Bag Index", "woww.bag.index", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bag_slot, { "Bag Slot", "woww.bag.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bag_type_subclass, { "Bag Type Subclass", "woww.bag.type.subclass", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_battlefield_port_action, { "Battlefield Port Action", "woww.battlefield.port.action", FT_UINT8, BASE_HEX_DEC, VALS(e_battlefield_port_action_strings), 0, NULL, HFILL } }, { &hf_woww_battleground_bracket, { "Battleground Bracket", "woww.battleground.bracket", FT_UINT8, BASE_HEX_DEC, VALS(e_battleground_bracket_strings), 0, NULL, HFILL } }, { &hf_woww_battleground_end_status, { "Battleground End Status", "woww.battleground.end.status", FT_UINT8, BASE_HEX_DEC, VALS(e_battleground_end_status_strings), 0, NULL, HFILL } }, { &hf_woww_battleground_winner, { "Battleground Winner", "woww.battleground.winner", FT_UINT8, BASE_HEX_DEC, VALS(e_battleground_winner_strings), 0, NULL, HFILL } }, { &hf_woww_battlegrounds, { "Battlegrounds", "woww.battlegrounds", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_battlemaster, { "Battlemaster", "woww.battlemaster", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bg_type_id, { "Bg Type Id", "woww.bg.type.id", FT_UINT32, BASE_HEX_DEC, VALS(e_bg_type_id_strings), 0, NULL, HFILL } }, { &hf_woww_bid, { "Bid", "woww.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bidder, { "Bidder", "woww.bidder", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_billing_flags, { "Billing Flags", "woww.billing.flags", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_billing_rested, { "Billing Rested", "woww.billing.rested", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_billing_time, { "Billing Time", "woww.billing.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_block, { "Block", "woww.block", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_blocked, { "Blocked", "woww.blocked", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_blocked_amount, { "Blocked Amount", "woww.blocked.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_body, { "Body", "woww.body", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_body_text, { "Body Text", "woww.body.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_bonding, { "Bonding", "woww.bonding", FT_UINT32, BASE_HEX_DEC, VALS(e_bonding_strings), 0, NULL, HFILL } }, { &hf_woww_bonus_honor, { "Bonus Honor", "woww.bonus.honor", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_border_color, { "Border Color", "woww.border.color", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_border_style, { "Border Style", "woww.border.style", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_bug_type, { "Bug Type", "woww.bug.type", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_build, { "Build", "woww.build", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_button, { "Button", "woww.button", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_buy_bank_slot_result, { "Buy Bank Slot Result", "woww.buy.bank.slot.result", FT_UINT32, BASE_HEX_DEC, VALS(e_buy_bank_slot_result_strings), 0, NULL, HFILL } }, { &hf_woww_buy_price, { "Buy Price", "woww.buy.price", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_buy_result, { "Buy Result", "woww.buy.result", FT_UINT8, BASE_HEX_DEC, VALS(e_buy_result_strings), 0, NULL, HFILL } }, { &hf_woww_buyback_slot, { "Buyback Slot", "woww.buyback.slot", FT_UINT32, BASE_HEX_DEC, VALS(e_buyback_slot_strings), 0, NULL, HFILL } }, { &hf_woww_buyout, { "Buyout", "woww.buyout", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_buyout_amount, { "Buyout Amount", "woww.buyout.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cash_on_delivery_amount, { "Cash On Delivery Amount", "woww.cash.on.delivery.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cast_failure_reason, { "Cast Failure Reason", "woww.cast.failure.reason", FT_UINT8, BASE_HEX_DEC, VALS(e_cast_failure_reason_strings), 0, NULL, HFILL } }, { &hf_woww_cast_flags, { "Cast Flags", "woww.cast.flags", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cast_item, { "Cast Item", "woww.cast.item", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_caster, { "Caster", "woww.caster", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_category_cooldown, { "Category Cooldown", "woww.category.cooldown", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_channel, { "Channel", "woww.channel", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_channel_flags, { "Channel Flags", "woww.channel.flags", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_channel_member_flags, { "Channel Member Flags", "woww.channel.member.flags", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_channel_name, { "Channel Name", "woww.channel.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_channel_password, { "Channel Password", "woww.channel.password", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_character_flags, { "Character Flags", "woww.character.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_character_guid, { "Character Guid", "woww.character.guid", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_character_name, { "Character Name", "woww.character.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_charter_display_id, { "Charter Display Id", "woww.charter.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_charter_entry, { "Charter Entry", "woww.charter.entry", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_charter_owner, { "Charter Owner", "woww.charter.owner", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_chat_credit, { "Chat Credit", "woww.chat.credit", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_chat_data_line_count, { "Chat Data Line Count", "woww.chat.data.line.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_chat_data_size_uncompressed, { "Chat Data Size Uncompressed", "woww.chat.data.size.uncompressed", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_chat_notify, { "Chat Notify", "woww.chat.notify", FT_UINT8, BASE_HEX_DEC, VALS(e_chat_notify_strings), 0, NULL, HFILL } }, { &hf_woww_chat_type, { "Chat Type", "woww.chat.type", FT_UINT32, BASE_HEX_DEC, VALS(e_chat_type_strings), 0, NULL, HFILL } }, { &hf_woww_checked_timestamp, { "Checked Timestamp", "woww.checked.timestamp", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cinematic_sequence_id, { "Cinematic Sequence Id", "woww.cinematic.sequence.id", FT_UINT32, BASE_HEX_DEC, VALS(e_cinematic_sequence_id_strings), 0, NULL, HFILL } }, { &hf_woww_civilian, { "Civilian", "woww.civilian", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_class, { "Class", "woww.class", FT_UINT32, BASE_HEX_DEC, VALS(e_class_strings), 0, NULL, HFILL } }, { &hf_woww_class_mask, { "Class Mask", "woww.class.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_client_instance_id, { "Client Instance Id", "woww.client.instance.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_client_proof, { "Client Proof", "woww.client.proof", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_client_seed, { "Client Seed", "woww.client.seed", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_code, { "Code", "woww.code", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_coded, { "Coded", "woww.coded", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_comment, { "Comment", "woww.comment", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_compressed_chat_data, { "Compressed Chat Data", "woww.compressed.chat.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_compressed_data, { "Compressed Data", "woww.compressed.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_compressed_move_opcode, { "Compressed Move Opcode", "woww.compressed.move.opcode", FT_UINT16, BASE_HEX_DEC, VALS(e_compressed_move_opcode_strings), 0, NULL, HFILL } }, { &hf_woww_container_slots, { "Container Slots", "woww.container.slots", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_content, { "Content", "woww.content", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_cooldown, { "Cooldown", "woww.cooldown", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cooldown_count, { "Cooldown Count", "woww.cooldown.count", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_cooldown_time, { "Cooldown Time", "woww.cooldown.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_corpse, { "Corpse", "woww.corpse", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_corpse_query_result, { "Corpse Query Result", "woww.corpse.query.result", FT_UINT8, BASE_HEX_DEC, VALS(e_corpse_query_result_strings), 0, NULL, HFILL } }, { &hf_woww_cos_angle, { "Cos Angle", "woww.cos.angle", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_cost_in_copper, { "Cost In Copper", "woww.cost.in.copper", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_count, { "Count", "woww.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_countdown_time, { "Countdown Time", "woww.countdown.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_counter, { "Counter", "woww.counter", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_created_day, { "Created Day", "woww.created.day", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_created_month, { "Created Month", "woww.created.month", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_created_year, { "Created Year", "woww.created.year", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_creature, { "Creature", "woww.creature", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_creature_entry, { "Creature Entry", "woww.creature.entry", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_creature_family, { "Creature Family", "woww.creature.family", FT_UINT32, BASE_HEX_DEC, VALS(e_creature_family_strings), 0, NULL, HFILL } }, { &hf_woww_creature_id, { "Creature Id", "woww.creature.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_creature_rank, { "Creature Rank", "woww.creature.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_creature_type, { "Creature Type", "woww.creature.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_critical, { "Critical", "woww.critical", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_current_health, { "Current Health", "woww.current.health", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_current_power, { "Current Power", "woww.current.power", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_damage, { "Damage", "woww.damage", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_damage_float, { "Damage Float", "woww.damage.float", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_damage_maximum, { "Damage Maximum", "woww.damage.maximum", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_damage_minimum, { "Damage Minimum", "woww.damage.minimum", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_damage_state, { "Damage State", "woww.damage.state", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_damage_uint, { "Damage Uint", "woww.damage.uint", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_data, { "Data", "woww.data", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_data_type, { "Data Type", "woww.data.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_datetime, { "Datetime", "woww.datetime", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_days_since_last_updated, { "Days Since Last Updated", "woww.days.since.last.updated", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_days_since_oldest_ticket_creation, { "Days Since Oldest Ticket Creation", "woww.days.since.oldest.ticket.creation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_days_since_ticket_creation, { "Days Since Ticket Creation", "woww.days.since.ticket.creation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_deadline, { "Deadline", "woww.deadline", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_deaths, { "Deaths", "woww.deaths", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_debug_log_format, { "Debug Log Format", "woww.debug.log.format", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_decompressed_addon_info_size, { "Decompressed Addon Info Size", "woww.decompressed.addon.info.size", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_decompressed_size, { "Decompressed Size", "woww.decompressed.size", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_delay, { "Delay", "woww.delay", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_delay_time, { "Delay Time", "woww.delay.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_description, { "Description", "woww.description", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_destination_bag, { "Destination Bag", "woww.destination.bag", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_destination_node, { "Destination Node", "woww.destination.node", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_destination_slot, { "Destination Slot", "woww.destination.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_destionation_slot, { "Destionation Slot", "woww.destionation.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_details, { "Details", "woww.details", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_dismount_result, { "Dismount Result", "woww.dismount.result", FT_UINT32, BASE_HEX_DEC, VALS(e_dismount_result_strings), 0, NULL, HFILL } }, { &hf_woww_display_id, { "Display Id", "woww.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_duel_winner_reason, { "Duel Winner Reason", "woww.duel.winner.reason", FT_UINT8, BASE_HEX_DEC, VALS(e_duel_winner_reason_strings), 0, NULL, HFILL } }, { &hf_woww_durability, { "Durability", "woww.durability", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_duration, { "Duration", "woww.duration", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_eff, { "Eff", "woww.eff", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_emblem_color, { "Emblem Color", "woww.emblem.color", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_emblem_style, { "Emblem Style", "woww.emblem.style", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_emote_delay, { "Emote Delay", "woww.emote.delay", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_emote_enum, { "Emote Enum", "woww.emote.enum", FT_UINT32, BASE_HEX_DEC, VALS(e_emote_strings), 0, NULL, HFILL } }, { &hf_woww_emote_int, { "Emote Int", "woww.emote.int", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_enable_pvp, { "Enable Pvp", "woww.enable.pvp", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_enchantment, { "Enchantment", "woww.enchantment", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_encrypted_data, { "Encrypted Data", "woww.encrypted.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_end_text, { "End Text", "woww.end.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_ended_without_interruption, { "Ended Without Interruption", "woww.ended.without.interruption", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_enemy, { "Enemy", "woww.enemy", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_energize_amount, { "Energize Amount", "woww.energize.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_energize_power, { "Energize Power", "woww.energize.power", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_energy, { "Energy", "woww.energy", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_entry, { "Entry", "woww.entry", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_entry_id, { "Entry Id", "woww.entry.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_environmental_damage_type, { "Environmental Damage Type", "woww.environmental.damage.type", FT_UINT8, BASE_HEX_DEC, VALS(e_environmental_damage_type_strings), 0, NULL, HFILL } }, { &hf_woww_equip_error, { "Equip Error", "woww.equip.error", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_equipment_display_id, { "Equipment Display Id", "woww.equipment.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_equipped_item_class, { "Equipped Item Class", "woww.equipped.item.class", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_equipped_item_inventory_type_mask, { "Equipped Item Inventory Type Mask", "woww.equipped.item.inventory.type.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_equipped_item_subclass_mask, { "Equipped Item Subclass Mask", "woww.equipped.item.subclass.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_event_descriptions, { "Event Descriptions", "woww.event.descriptions", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_exp_group_bonus, { "Exp Group Bonus", "woww.exp.group.bonus", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_experience, { "Experience", "woww.experience", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_experience_award_type, { "Experience Award Type", "woww.experience.award.type", FT_UINT8, BASE_HEX_DEC, VALS(e_experience_award_type_strings), 0, NULL, HFILL } }, { &hf_woww_experience_reward, { "Experience Reward", "woww.experience.reward", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_experience_without_rested, { "Experience Without Rested", "woww.experience.without.rested", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_expiration_time, { "Expiration Time", "woww.expiration.time", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_extend_flag, { "Extend Flag", "woww.extend.flag", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_extra_attacks, { "Extra Attacks", "woww.extra.attacks", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_face, { "Face", "woww.face", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_facial_hair, { "Facial Hair", "woww.facial.hair", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_faction, { "Faction", "woww.faction", FT_UINT32, BASE_HEX_DEC, VALS(e_faction_strings), 0, NULL, HFILL } }, { &hf_woww_faction_flag, { "Faction Flag", "woww.faction.flag", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_fall_time, { "Fall Time", "woww.fall.time", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_far_sight_operation, { "Far Sight Operation", "woww.far.sight.operation", FT_UINT8, BASE_HEX_DEC, VALS(e_far_sight_operation_strings), 0, NULL, HFILL } }, { &hf_woww_feed_pet_item, { "Feed Pet Item", "woww.feed.pet.item", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_fields, { "Fields", "woww.fields", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_fire_resistance, { "Fire Resistance", "woww.fire.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_first_bag_display_id, { "First Bag Display Id", "woww.first.bag.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_first_bag_inventory_id, { "First Bag Inventory Id", "woww.first.bag.inventory.id", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_first_login, { "First Login", "woww.first.login", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_first_rank, { "First Rank", "woww.first.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_flags, { "Flags", "woww.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_focus, { "Focus", "woww.focus", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_friend_result, { "Friend Result", "woww.friend.result", FT_UINT8, BASE_HEX_DEC, VALS(e_friend_result_strings), 0, NULL, HFILL } }, { &hf_woww_friend_status, { "Friend Status", "woww.friend.status", FT_UINT8, BASE_HEX_DEC, VALS(e_friend_status_strings), 0, NULL, HFILL } }, { &hf_woww_frost_resistance, { "Frost Resistance", "woww.frost.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gain_multiplier, { "Gain Multiplier", "woww.gain.multiplier", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_gameobject, { "Gameobject", "woww.gameobject", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gender, { "Gender", "woww.gender", FT_UINT32, BASE_HEX_DEC, VALS(e_gender_strings), 0, NULL, HFILL } }, { &hf_woww_gift_bag_index, { "Gift Bag Index", "woww.gift.bag.index", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gift_slot, { "Gift Slot", "woww.gift.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gift_wrapper, { "Gift Wrapper", "woww.gift.wrapper", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gm_ticket_escalation_status, { "Gm Ticket Escalation Status", "woww.gm.ticket.escalation.status", FT_UINT8, BASE_HEX_DEC, VALS(e_gm_ticket_escalation_status_strings), 0, NULL, HFILL } }, { &hf_woww_gm_ticket_queue_status, { "Gm Ticket Queue Status", "woww.gm.ticket.queue.status", FT_UINT32, BASE_HEX_DEC, VALS(e_gm_ticket_queue_status_strings), 0, NULL, HFILL } }, { &hf_woww_gm_ticket_response, { "Gm Ticket Response", "woww.gm.ticket.response", FT_UINT32, BASE_HEX_DEC, VALS(e_gm_ticket_response_strings), 0, NULL, HFILL } }, { &hf_woww_gm_ticket_status, { "Gm Ticket Status", "woww.gm.ticket.status", FT_UINT32, BASE_HEX_DEC, VALS(e_gm_ticket_status_strings), 0, NULL, HFILL } }, { &hf_woww_gm_ticket_status_response, { "Gm Ticket Status Response", "woww.gm.ticket.status.response", FT_UINT32, BASE_HEX_DEC, VALS(e_gm_ticket_status_response_strings), 0, NULL, HFILL } }, { &hf_woww_gm_ticket_type, { "Gm Ticket Type", "woww.gm.ticket.type", FT_UINT8, BASE_HEX_DEC, VALS(e_gm_ticket_type_strings), 0, NULL, HFILL } }, { &hf_woww_gold, { "Gold", "woww.gold", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_gossip_list_id, { "Gossip List Id", "woww.gossip.list.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_grade, { "Grade", "woww.grade", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_greeting, { "Greeting", "woww.greeting", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_group_loot_setting, { "Group Loot Setting", "woww.group.loot.setting", FT_UINT32, BASE_HEX_DEC, VALS(e_group_loot_setting_strings), 0, NULL, HFILL } }, { &hf_woww_group_member_online_status, { "Group Member Online Status", "woww.group.member.online.status", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_group_number, { "Group Number", "woww.group.number", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_group_type, { "Group Type", "woww.group.type", FT_UINT8, BASE_HEX_DEC, VALS(e_group_type_strings), 0, NULL, HFILL } }, { &hf_woww_group_update_flags, { "Group Update Flags", "woww.group.update.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_guid, { "Guid", "woww.guid", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_guids, { "Guids", "woww.guids", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_guild, { "Guild", "woww.guild", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_guild_charter_cost, { "Guild Charter Cost", "woww.guild.charter.cost", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_guild_command, { "Guild Command", "woww.guild.command", FT_UINT32, BASE_HEX_DEC, VALS(e_guild_command_strings), 0, NULL, HFILL } }, { &hf_woww_guild_command_result, { "Guild Command Result", "woww.guild.command.result", FT_UINT32, BASE_HEX_DEC, VALS(e_guild_command_result_strings), 0, NULL, HFILL } }, { &hf_woww_guild_emblem_result, { "Guild Emblem Result", "woww.guild.emblem.result", FT_UINT32, BASE_HEX_DEC, VALS(e_guild_emblem_result_strings), 0, NULL, HFILL } }, { &hf_woww_guild_event, { "Guild Event", "woww.guild.event", FT_UINT8, BASE_HEX_DEC, VALS(e_guild_event_strings), 0, NULL, HFILL } }, { &hf_woww_guild_id, { "Guild Id", "woww.guild.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_guild_info, { "Guild Info", "woww.guild.info", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_guild_member_status, { "Guild Member Status", "woww.guild.member.status", FT_UINT8, BASE_HEX_DEC, VALS(e_guild_member_status_strings), 0, NULL, HFILL } }, { &hf_woww_guild_name, { "Guild Name", "woww.guild.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_hair_color, { "Hair Color", "woww.hair.color", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_hair_style, { "Hair Style", "woww.hair.style", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_happiness, { "Happiness", "woww.happiness", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_has_transport, { "Has Transport", "woww.has.transport", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_heal_amount, { "Heal Amount", "woww.heal.amount", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_heal_critical, { "Heal Critical", "woww.heal.critical", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_health, { "Health", "woww.health", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_higher_bidder, { "Higher Bidder", "woww.higher.bidder", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_highest_bid, { "Highest Bid", "woww.highest.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_highest_bidder, { "Highest Bidder", "woww.highest.bidder", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_hit_info, { "Hit Info", "woww.hit.info", FT_UINT32, BASE_HEX_DEC, VALS(e_hit_info_strings), 0, NULL, HFILL } }, { &hf_woww_hits, { "Hits", "woww.hits", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_holy_resistance, { "Holy Resistance", "woww.holy.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_homebind_timer, { "Homebind Timer", "woww.homebind.timer", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_honor_points, { "Honor Points", "woww.honor.points", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_honorable_kills, { "Honorable Kills", "woww.honorable.kills", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_horizontal_speed, { "Horizontal Speed", "woww.horizontal.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_icon, { "Icon", "woww.icon", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_id, { "Id", "woww.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ignored, { "Ignored", "woww.ignored", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_inactive, { "Inactive", "woww.inactive", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_index, { "Index", "woww.index", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_info_block, { "Info Block", "woww.info.block", FT_UINT8, BASE_HEX_DEC, VALS(e_info_block_strings), 0, NULL, HFILL } }, { &hf_woww_info_type, { "Info Type", "woww.info.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_initiator, { "Initiator", "woww.initiator", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_initiator_name, { "Initiator Name", "woww.initiator.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_instance_id, { "Instance Id", "woww.instance.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_instance_reset_failed_reason, { "Instance Reset Failed Reason", "woww.instance.reset.failed.reason", FT_UINT32, BASE_HEX_DEC, VALS(e_instance_reset_failed_reason_strings), 0, NULL, HFILL } }, { &hf_woww_intellect, { "Intellect", "woww.intellect", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_interrupted_spell, { "Interrupted Spell", "woww.interrupted.spell", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_inventory_result, { "Inventory Result", "woww.inventory.result", FT_UINT32, BASE_HEX_DEC, VALS(e_inventory_result_strings), 0, NULL, HFILL } }, { &hf_woww_inventory_type, { "Inventory Type", "woww.inventory.type", FT_UINT32, BASE_HEX_DEC, VALS(e_inventory_type_strings), 0, NULL, HFILL } }, { &hf_woww_invited_player, { "Invited Player", "woww.invited.player", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_is_applied, { "Is Applied", "woww.is.applied", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_is_frozen, { "Is Frozen", "woww.is.frozen", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_is_online, { "Is Online", "woww.is.online", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_issue_date, { "Issue Date", "woww.issue.date", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item, { "Item", "woww.item", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_bag_index, { "Item Bag Index", "woww.item.bag.index", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_charges, { "Item Charges", "woww.item.charges", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_class, { "Item Class", "woww.item.class", FT_UINT8, BASE_HEX_DEC, VALS(e_item_class_strings), 0, NULL, HFILL } }, { &hf_woww_item_class_and_sub_class, { "Item Class And Sub Class", "woww.item.class.and.sub.class", FT_UINT64, BASE_HEX_DEC | BASE_VAL64_STRING, VALS64(e_item_class_and_sub_class_strings), 0, NULL, HFILL } }, { &hf_woww_item_count, { "Item Count", "woww.item.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_creator, { "Item Creator", "woww.item.creator", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_display_id, { "Item Display Id", "woww.item.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_enchant_id, { "Item Enchant Id", "woww.item.enchant.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_enchantment, { "Item Enchantment", "woww.item.enchantment", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_flag, { "Item Flag", "woww.item.flag", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_icon, { "Item Icon", "woww.item.icon", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_id, { "Item Id", "woww.item.id", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_level, { "Item Level", "woww.item.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_limit_category_id, { "Item Limit Category Id", "woww.item.limit.category.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_name, { "Item Name", "woww.item.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_item_owner, { "Item Owner", "woww.item.owner", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_quality, { "Item Quality", "woww.item.quality", FT_UINT32, BASE_HEX_DEC, VALS(e_item_quality_strings), 0, NULL, HFILL } }, { &hf_woww_item_random_properties_id, { "Item Random Properties Id", "woww.item.random.properties.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_random_property_id, { "Item Random Property Id", "woww.item.random.property.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_random_suffix, { "Item Random Suffix", "woww.item.random.suffix", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_random_suffix_id, { "Item Random Suffix Id", "woww.item.random.suffix.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_set, { "Item Set", "woww.item.set", FT_UINT32, BASE_HEX_DEC, VALS(e_item_set_strings), 0, NULL, HFILL } }, { &hf_woww_item_slot, { "Item Slot", "woww.item.slot", FT_UINT8, BASE_HEX_DEC, VALS(e_item_slot_strings), 0, NULL, HFILL } }, { &hf_woww_item_slot_int, { "Item Slot Int", "woww.item.slot.int", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_spell_charges, { "Item Spell Charges", "woww.item.spell.charges", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_stack_count, { "Item Stack Count", "woww.item.stack.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_stack_size, { "Item Stack Size", "woww.item.stack.size", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_stat_type, { "Item Stat Type", "woww.item.stat.type", FT_UINT32, BASE_HEX_DEC, VALS(e_item_stat_type_strings), 0, NULL, HFILL } }, { &hf_woww_item_sub_class_mask, { "Item Sub Class Mask", "woww.item.sub.class.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_suffix_factor, { "Item Suffix Factor", "woww.item.suffix.factor", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_template, { "Item Template", "woww.item.template", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_text_id, { "Item Text Id", "woww.item.text.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_item_to_damage, { "Item To Damage", "woww.item.to.damage", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_items_required, { "Items Required", "woww.items.required", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_join_as_group, { "Join As Group", "woww.join.as.group", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_key_version, { "Key Version", "woww.key.version", FT_UINT8, BASE_HEX_DEC, VALS(e_key_version_strings), 0, NULL, HFILL } }, { &hf_woww_kill_count, { "Kill Count", "woww.kill.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_killing_blows, { "Killing Blows", "woww.killing.blows", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_lag, { "Lag", "woww.lag", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_language, { "Language", "woww.language", FT_UINT32, BASE_HEX_DEC, VALS(e_language_strings), 0, NULL, HFILL } }, { &hf_woww_last_week_honor, { "Last Week Honor", "woww.last.week.honor", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_last_week_honorable, { "Last Week Honorable", "woww.last.week.honorable", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_leader, { "Leader", "woww.leader", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_level, { "Level", "woww.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_level_played_time, { "Level Played Time", "woww.level.played.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_lifetime_dishonorable, { "Lifetime Dishonorable", "woww.lifetime.dishonorable", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_lifetime_honorable, { "Lifetime Honorable", "woww.lifetime.honorable", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_list_from, { "List From", "woww.list.from", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_list_start_item, { "List Start Item", "woww.list.start.item", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_listed_players, { "Listed Players", "woww.listed.players", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_living_orientation, { "Living Orientation", "woww.living.orientation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_location_name, { "Location Name", "woww.location.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_lock_id, { "Lock Id", "woww.lock.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_log_format, { "Log Format", "woww.log.format", FT_UINT8, BASE_HEX_DEC, VALS(e_log_format_strings), 0, NULL, HFILL } }, { &hf_woww_logout_result, { "Logout Result", "woww.logout.result", FT_UINT32, BASE_HEX_DEC, VALS(e_logout_result_strings), 0, NULL, HFILL } }, { &hf_woww_logout_speed, { "Logout Speed", "woww.logout.speed", FT_UINT8, BASE_HEX_DEC, VALS(e_logout_speed_strings), 0, NULL, HFILL } }, { &hf_woww_loot, { "Loot", "woww.loot", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_loot_master, { "Loot Master", "woww.loot.master", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_loot_method, { "Loot Method", "woww.loot.method", FT_UINT8, BASE_HEX_DEC, VALS(e_loot_method_strings), 0, NULL, HFILL } }, { &hf_woww_loot_method_error, { "Loot Method Error", "woww.loot.method.error", FT_UINT8, BASE_HEX_DEC, VALS(e_loot_method_error_strings), 0, NULL, HFILL } }, { &hf_woww_loot_slot, { "Loot Slot", "woww.loot.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_loot_slot_type, { "Loot Slot Type", "woww.loot.slot.type", FT_UINT8, BASE_HEX_DEC, VALS(e_loot_slot_type_strings), 0, NULL, HFILL } }, { &hf_woww_looted_target, { "Looted Target", "woww.looted.target", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_loyalty, { "Loyalty", "woww.loyalty", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_mail_action, { "Mail Action", "woww.mail.action", FT_UINT32, BASE_HEX_DEC, VALS(e_mail_action_strings), 0, NULL, HFILL } }, { &hf_woww_mail_id, { "Mail Id", "woww.mail.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_mail_result, { "Mail Result", "woww.mail.result", FT_UINT32, BASE_HEX_DEC, VALS(e_mail_result_strings), 0, NULL, HFILL } }, { &hf_woww_mail_result_two, { "Mail Result Two", "woww.mail.result.two", FT_UINT32, BASE_HEX_DEC, VALS(e_mail_result_two_strings), 0, NULL, HFILL } }, { &hf_woww_mail_template_id, { "Mail Template Id", "woww.mail.template.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_mail_type, { "Mail Type", "woww.mail.type", FT_UINT8, BASE_HEX_DEC, VALS(e_mail_type_strings), 0, NULL, HFILL } }, { &hf_woww_mailbox, { "Mailbox", "woww.mailbox", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_mailbox_id, { "Mailbox Id", "woww.mailbox.id", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_mana, { "Mana", "woww.mana", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_map, { "Map", "woww.map", FT_UINT32, BASE_HEX_DEC, VALS(e_map_strings), 0, NULL, HFILL } }, { &hf_woww_master_loot, { "Master Loot", "woww.master.loot", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_material, { "Material", "woww.material", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_count, { "Max Count", "woww.max.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_durability, { "Max Durability", "woww.max.durability", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_health, { "Max Health", "woww.max.health", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_items, { "Max Items", "woww.max.items", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_level_money_reward, { "Max Level Money Reward", "woww.max.level.money.reward", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_max_power, { "Max Power", "woww.max.power", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_maximum, { "Maximum", "woww.maximum", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_maximum_level, { "Maximum Level", "woww.maximum.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_maximum_signatures, { "Maximum Signatures", "woww.maximum.signatures", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_meeting_stone_failure, { "Meeting Stone Failure", "woww.meeting.stone.failure", FT_UINT8, BASE_HEX_DEC, VALS(e_meeting_stone_failure_strings), 0, NULL, HFILL } }, { &hf_woww_meeting_stone_status, { "Meeting Stone Status", "woww.meeting.stone.status", FT_UINT8, BASE_HEX_DEC, VALS(e_meeting_stone_status_strings), 0, NULL, HFILL } }, { &hf_woww_member, { "Member", "woww.member", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_message, { "Message", "woww.message", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_message_id, { "Message Id", "woww.message.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_message_of_the_day, { "Message Of The Day", "woww.message.of.the.day", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_minimum, { "Minimum", "woww.minimum", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_minimum_bid, { "Minimum Bid", "woww.minimum.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_minimum_level, { "Minimum Level", "woww.minimum.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_minimum_signatures, { "Minimum Signatures", "woww.minimum.signatures", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_misc, { "Misc", "woww.misc", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_misc_value, { "Misc Value", "woww.misc.value", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_money, { "Money", "woww.money", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_money_in_trade, { "Money In Trade", "woww.money.in.trade", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_money_reward, { "Money Reward", "woww.money.reward", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_monster, { "Monster", "woww.monster", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_monster_move_type, { "Monster Move Type", "woww.monster.move.type", FT_UINT8, BASE_HEX_DEC, VALS(e_monster_move_type_strings), 0, NULL, HFILL } }, { &hf_woww_monster_name, { "Monster Name", "woww.monster.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_motd, { "Motd", "woww.motd", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_mount_result, { "Mount Result", "woww.mount.result", FT_UINT32, BASE_HEX_DEC, VALS(e_mount_result_strings), 0, NULL, HFILL } }, { &hf_woww_move_event, { "Move Event", "woww.move.event", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_movement_counter, { "Movement Counter", "woww.movement.counter", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_movement_flags, { "Movement Flags", "woww.movement.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_multiplier, { "Multiplier", "woww.multiplier", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_name, { "Name", "woww.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_nature_resistance, { "Nature Resistance", "woww.nature.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_nearest_node, { "Nearest Node", "woww.nearest.node", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_new_bid, { "New Bid", "woww.new.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_new_guild_leader_name, { "New Guild Leader Name", "woww.new.guild.leader.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_new_item_chat_alert, { "New Item Chat Alert", "woww.new.item.chat.alert", FT_UINT32, BASE_HEX_DEC, VALS(e_new_item_chat_alert_strings), 0, NULL, HFILL } }, { &hf_woww_new_item_creation_type, { "New Item Creation Type", "woww.new.item.creation.type", FT_UINT32, BASE_HEX_DEC, VALS(e_new_item_creation_type_strings), 0, NULL, HFILL } }, { &hf_woww_new_item_source, { "New Item Source", "woww.new.item.source", FT_UINT32, BASE_HEX_DEC, VALS(e_new_item_source_strings), 0, NULL, HFILL } }, { &hf_woww_new_level, { "New Level", "woww.new.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_new_name, { "New Name", "woww.new.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_new_owner, { "New Owner", "woww.new.owner", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_new_speed, { "New Speed", "woww.new.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_new_spell_id, { "New Spell Id", "woww.new.spell.id", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_next_page_id, { "Next Page Id", "woww.next.page.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_next_quest_in_chain, { "Next Quest In Chain", "woww.next.quest.in.chain", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_next_resurrect_time, { "Next Resurrect Time", "woww.next.resurrect.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_node_count, { "Node Count", "woww.node.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_nodes, { "Nodes", "woww.nodes", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_note, { "Note", "woww.note", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_notification, { "Notification", "woww.notification", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_npc, { "Npc", "woww.npc", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_number_of_battlegrounds, { "Number Of Battlegrounds", "woww.number.of.battlegrounds", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_number_of_choices, { "Number Of Choices", "woww.number.of.choices", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_object_type, { "Object Type", "woww.object.type", FT_UINT8, BASE_HEX_DEC, VALS(e_object_type_strings), 0, NULL, HFILL } }, { &hf_woww_object_unk, { "Object Unk", "woww.object.unk", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_objective_text, { "Objective Text", "woww.objective.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_objective_texts, { "Objective Texts", "woww.objective.texts", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_objectives, { "Objectives", "woww.objectives", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_offer_reward_text, { "Offer Reward Text", "woww.offer.reward.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_officer_note, { "Officer Note", "woww.officer.note", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_old_mover, { "Old Mover", "woww.old.mover", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_old_spell_id, { "Old Spell Id", "woww.old.spell.id", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_online_players, { "Online Players", "woww.online.players", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_op, { "Op", "woww.op", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_opponent_name, { "Opponent Name", "woww.opponent.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_orientation, { "Orientation", "woww.orientation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_out_bid, { "Out Bid", "woww.out.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_outbid_item_ids, { "Outbid Item Ids", "woww.outbid.item.ids", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_outfit_id, { "Outfit Id", "woww.outfit.id", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_owner, { "Owner", "woww.owner", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_page_id, { "Page Id", "woww.page.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_page_text, { "Page Text", "woww.page.text", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_page_text_material, { "Page Text Material", "woww.page.text.material", FT_UINT32, BASE_HEX_DEC, VALS(e_page_text_material_strings), 0, NULL, HFILL } }, { &hf_woww_party_operation, { "Party Operation", "woww.party.operation", FT_UINT32, BASE_HEX_DEC, VALS(e_party_operation_strings), 0, NULL, HFILL } }, { &hf_woww_party_result, { "Party Result", "woww.party.result", FT_UINT32, BASE_HEX_DEC, VALS(e_party_result_strings), 0, NULL, HFILL } }, { &hf_woww_party_status, { "Party Status", "woww.party.status", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_periodic_log, { "Periodic Log", "woww.periodic.log", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet, { "Pet", "woww.pet", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_command_state, { "Pet Command State", "woww.pet.command.state", FT_UINT8, BASE_HEX_DEC, VALS(e_pet_command_state_strings), 0, NULL, HFILL } }, { &hf_woww_pet_current_health, { "Pet Current Health", "woww.pet.current.health", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_current_power, { "Pet Current Power", "woww.pet.current.power", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_display_id, { "Pet Display Id", "woww.pet.display.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_enabled, { "Pet Enabled", "woww.pet.enabled", FT_UINT8, BASE_HEX_DEC, VALS(e_pet_enabled_strings), 0, NULL, HFILL } }, { &hf_woww_pet_feedback, { "Pet Feedback", "woww.pet.feedback", FT_UINT8, BASE_HEX_DEC, VALS(e_pet_feedback_strings), 0, NULL, HFILL } }, { &hf_woww_pet_level, { "Pet Level", "woww.pet.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_max_health, { "Pet Max Health", "woww.pet.max.health", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_max_power, { "Pet Max Power", "woww.pet.max.power", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_name, { "Pet Name", "woww.pet.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_name_timestamp, { "Pet Name Timestamp", "woww.pet.name.timestamp", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_number, { "Pet Number", "woww.pet.number", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_react_state, { "Pet React State", "woww.pet.react.state", FT_UINT8, BASE_HEX_DEC, VALS(e_pet_react_state_strings), 0, NULL, HFILL } }, { &hf_woww_pet_slot, { "Pet Slot", "woww.pet.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pet_talk_reason, { "Pet Talk Reason", "woww.pet.talk.reason", FT_UINT32, BASE_HEX_DEC, VALS(e_pet_talk_reason_strings), 0, NULL, HFILL } }, { &hf_woww_pet_tame_failure_reason, { "Pet Tame Failure Reason", "woww.pet.tame.failure.reason", FT_UINT8, BASE_HEX_DEC, VALS(e_pet_tame_failure_reason_strings), 0, NULL, HFILL } }, { &hf_woww_petition, { "Petition", "woww.petition", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_petition_id, { "Petition Id", "woww.petition.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_petition_result, { "Petition Result", "woww.petition.result", FT_UINT32, BASE_HEX_DEC, VALS(e_petition_result_strings), 0, NULL, HFILL } }, { &hf_woww_pitch, { "Pitch", "woww.pitch", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_player, { "Player", "woww.player", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_player_chat_tag, { "Player Chat Tag", "woww.player.chat.tag", FT_UINT8, BASE_HEX_DEC, VALS(e_player_chat_tag_strings), 0, NULL, HFILL } }, { &hf_woww_player_is_saved_to_a_raid, { "Player Is Saved To A Raid", "woww.player.is.saved.to.a.raid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_player_name, { "Player Name", "woww.player.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_player_rank, { "Player Rank", "woww.player.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_player_with_killing_blow, { "Player With Killing Blow", "woww.player.with.killing.blow", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_point_map_id, { "Point Map Id", "woww.point.map.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_point_opt, { "Point Opt", "woww.point.opt", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_position, { "Position", "woww.position", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_position_x, { "Position X", "woww.position.x", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_position_x_int, { "Position X Int", "woww.position.x.int", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_position_y, { "Position Y", "woww.position.y", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_position_y_int, { "Position Y Int", "woww.position.y.int", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_power, { "Power", "woww.power", FT_UINT32, BASE_HEX_DEC, VALS(e_power_strings), 0, NULL, HFILL } }, { &hf_woww_price, { "Price", "woww.price", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_probability, { "Probability", "woww.probability", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_public_key, { "Public Key", "woww.public.key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_public_note, { "Public Note", "woww.public.note", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_pvp_corpse, { "Pvp Corpse", "woww.pvp.corpse", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_pvp_rank, { "Pvp Rank", "woww.pvp.rank", FT_UINT32, BASE_HEX_DEC, VALS(e_pvp_rank_strings), 0, NULL, HFILL } }, { &hf_woww_query, { "Query", "woww.query", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_completable, { "Quest Completable", "woww.quest.completable", FT_UINT32, BASE_HEX_DEC, VALS(e_quest_completable_strings), 0, NULL, HFILL } }, { &hf_woww_quest_failed_reason, { "Quest Failed Reason", "woww.quest.failed.reason", FT_UINT32, BASE_HEX_DEC, VALS(e_quest_failed_reason_strings), 0, NULL, HFILL } }, { &hf_woww_quest_flags, { "Quest Flags", "woww.quest.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_giver_status, { "Quest Giver Status", "woww.quest.giver.status", FT_UINT32, BASE_HEX_DEC, VALS(e_quest_giver_status_strings), 0, NULL, HFILL } }, { &hf_woww_quest_icon, { "Quest Icon", "woww.quest.icon", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_id, { "Quest Id", "woww.quest.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_level, { "Quest Level", "woww.quest.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_method, { "Quest Method", "woww.quest.method", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_party_message, { "Quest Party Message", "woww.quest.party.message", FT_UINT8, BASE_HEX_DEC, VALS(e_quest_party_message_strings), 0, NULL, HFILL } }, { &hf_woww_quest_title, { "Quest Title", "woww.quest.title", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_quest_type, { "Quest Type", "woww.quest.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_question_id, { "Question Id", "woww.question.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_queue_position, { "Queue Position", "woww.queue.position", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_queue_slot, { "Queue Slot", "woww.queue.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_race, { "Race", "woww.race", FT_UINT32, BASE_HEX_DEC, VALS(e_race_strings), 0, NULL, HFILL } }, { &hf_woww_race_mask, { "Race Mask", "woww.race.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_racial_leader, { "Racial Leader", "woww.racial.leader", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_rage, { "Rage", "woww.rage", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_raid_group_error, { "Raid Group Error", "woww.raid.group.error", FT_UINT32, BASE_HEX_DEC, VALS(e_raid_group_error_strings), 0, NULL, HFILL } }, { &hf_woww_raid_instance_message, { "Raid Instance Message", "woww.raid.instance.message", FT_UINT32, BASE_HEX_DEC, VALS(e_raid_instance_message_strings), 0, NULL, HFILL } }, { &hf_woww_raid_target_index, { "Raid Target Index", "woww.raid.target.index", FT_UINT8, BASE_HEX_DEC, VALS(e_raid_target_index_strings), 0, NULL, HFILL } }, { &hf_woww_raid_target_update_type, { "Raid Target Update Type", "woww.raid.target.update.type", FT_UINT8, BASE_HEX_DEC, VALS(e_raid_target_update_type_strings), 0, NULL, HFILL } }, { &hf_woww_random_property, { "Random Property", "woww.random.property", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_random_property_id, { "Random Property Id", "woww.random.property.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_ranged_range_modification, { "Ranged Range Modification", "woww.ranged.range.modification", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_rank, { "Rank", "woww.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_rank_id, { "Rank Id", "woww.rank.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_rank_name, { "Rank Name", "woww.rank.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_rank_names, { "Rank Names", "woww.rank.names", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_rank_progress_bar, { "Rank Progress Bar", "woww.rank.progress.bar", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_raw_data, { "Raw Data", "woww.raw.data", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_read_by_gm, { "Read By Gm", "woww.read.by.gm", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_realm_name, { "Realm Name", "woww.realm.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_receiver, { "Receiver", "woww.receiver", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_records, { "Records", "woww.records", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_reputation_objective_value, { "Reputation Objective Value", "woww.reputation.objective.value", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_reputation_rank, { "Reputation Rank", "woww.reputation.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_request_items_text, { "Request Items Text", "woww.request.items.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_requested_rank, { "Requested Rank", "woww.requested.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_city_rank, { "Required City Rank", "woww.required.city.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_faction_rank, { "Required Faction Rank", "woww.required.faction.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_honor_rank, { "Required Honor Rank", "woww.required.honor.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_item_count, { "Required Item Count", "woww.required.item.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_item_id, { "Required Item Id", "woww.required.item.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_kill_count, { "Required Kill Count", "woww.required.kill.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_level, { "Required Level", "woww.required.level", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_money, { "Required Money", "woww.required.money", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_opposite_reputation_value, { "Required Opposite Reputation Value", "woww.required.opposite.reputation.value", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_skill_rank, { "Required Skill Rank", "woww.required.skill.rank", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_skill_value, { "Required Skill Value", "woww.required.skill.value", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_spell, { "Required Spell", "woww.required.spell", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_spell_focus, { "Required Spell Focus", "woww.required.spell.focus", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_required_spells, { "Required Spells", "woww.required.spells", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_reserved_for_future_use, { "Reserved For Future Use", "woww.reserved.for.future.use", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_reset_time, { "Reset Time", "woww.reset.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_resist, { "Resist", "woww.resist", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_resisted, { "Resisted", "woww.resisted", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_reward, { "Reward", "woww.reward", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_reward_spell, { "Reward Spell", "woww.reward.spell", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_reward_spell_cast, { "Reward Spell Cast", "woww.reward.spell.cast", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_rights, { "Rights", "woww.rights", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_roll_number, { "Roll Number", "woww.roll.number", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_roll_vote, { "Roll Vote", "woww.roll.vote", FT_UINT8, BASE_HEX_DEC, VALS(e_roll_vote_strings), 0, NULL, HFILL } }, { &hf_woww_round_time_in_ms, { "Round Time In Ms", "woww.round.time.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_running_speed, { "Running Speed", "woww.running.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_scale, { "Scale", "woww.scale", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_search_strings, { "Search Strings", "woww.search.strings", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_searched_name, { "Searched Name", "woww.searched.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_self_player, { "Self Player", "woww.self.player", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sell_item_result, { "Sell Item Result", "woww.sell.item.result", FT_UINT8, BASE_HEX_DEC, VALS(e_sell_item_result_strings), 0, NULL, HFILL } }, { &hf_woww_sell_price, { "Sell Price", "woww.sell.price", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sender, { "Sender", "woww.sender", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sender_id, { "Sender Id", "woww.sender.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sender_name, { "Sender Name", "woww.sender.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_sequence_id, { "Sequence Id", "woww.sequence.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_server_id, { "Server Id", "woww.server.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_server_message_type, { "Server Message Type", "woww.server.message.type", FT_UINT32, BASE_HEX_DEC, VALS(e_server_message_type_strings), 0, NULL, HFILL } }, { &hf_woww_server_seed, { "Server Seed", "woww.server.seed", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_set_assistant, { "Set Assistant", "woww.set.assistant", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_shadow_resistance, { "Shadow Resistance", "woww.shadow.resistance", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sheath_state, { "Sheath State", "woww.sheath.state", FT_UINT32, BASE_HEX_DEC, VALS(e_sheath_state_strings), 0, NULL, HFILL } }, { &hf_woww_sheathe_type, { "Sheathe Type", "woww.sheathe.type", FT_UINT32, BASE_HEX_DEC, VALS(e_sheathe_type_strings), 0, NULL, HFILL } }, { &hf_woww_show_affiliation, { "Show Affiliation", "woww.show.affiliation", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_signer, { "Signer", "woww.signer", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_simple_spell_cast_result, { "Simple Spell Cast Result", "woww.simple.spell.cast.result", FT_UINT8, BASE_HEX_DEC, VALS(e_simple_spell_cast_result_strings), 0, NULL, HFILL } }, { &hf_woww_sin_angle, { "Sin Angle", "woww.sin.angle", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_size_struct, { "Size Struct", "woww.size.struct", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_skill, { "Skill", "woww.skill", FT_UINT32, BASE_HEX_DEC, VALS(e_skill_strings), 0, NULL, HFILL } }, { &hf_woww_skin, { "Skin", "woww.skin", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_skin_color, { "Skin Color", "woww.skin.color", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_slot, { "Slot", "woww.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_slot_id, { "Slot Id", "woww.slot.id", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_slot_index, { "Slot Index", "woww.slot.index", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_sound_id, { "Sound Id", "woww.sound.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_source_bag, { "Source Bag", "woww.source.bag", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_source_item_id, { "Source Item Id", "woww.source.item.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_source_node, { "Source Node", "woww.source.node", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_source_slot, { "Source Slot", "woww.source.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_speech_bubble_credit, { "Speech Bubble Credit", "woww.speech.bubble.credit", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_speed, { "Speed", "woww.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_spell, { "Spell", "woww.spell", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_art_kit, { "Spell Art Kit", "woww.spell.art.kit", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_cast_result, { "Spell Cast Result", "woww.spell.cast.result", FT_UINT8, BASE_HEX_DEC, VALS(e_spell_cast_result_strings), 0, NULL, HFILL } }, { &hf_woww_spell_cast_target_flags, { "Spell Cast Target Flags", "woww.spell.cast.target.flags", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_category, { "Spell Category", "woww.spell.category", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_category_cooldown, { "Spell Category Cooldown", "woww.spell.category.cooldown", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_charges, { "Spell Charges", "woww.spell.charges", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_cooldown, { "Spell Cooldown", "woww.spell.cooldown", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_cost, { "Spell Cost", "woww.spell.cost", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_count, { "Spell Count", "woww.spell.count", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_data_id, { "Spell Data Id", "woww.spell.data.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_effect, { "Spell Effect", "woww.spell.effect", FT_UINT32, BASE_HEX_DEC, VALS(e_spell_effect_strings), 0, NULL, HFILL } }, { &hf_woww_spell_id, { "Spell Id", "woww.spell.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_index, { "Spell Index", "woww.spell.index", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_miss_info, { "Spell Miss Info", "woww.spell.miss.info", FT_UINT32, BASE_HEX_DEC, VALS(e_spell_miss_info_strings), 0, NULL, HFILL } }, { &hf_woww_spell_on_lowest_slot, { "Spell On Lowest Slot", "woww.spell.on.lowest.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_school, { "Spell School", "woww.spell.school", FT_UINT32, BASE_HEX_DEC, VALS(e_spell_school_strings), 0, NULL, HFILL } }, { &hf_woww_spell_school_mask, { "Spell School Mask", "woww.spell.school.mask", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spell_trigger_type, { "Spell Trigger Type", "woww.spell.trigger.type", FT_UINT32, BASE_HEX_DEC, VALS(e_spell_trigger_type_strings), 0, NULL, HFILL } }, { &hf_woww_spell_visual_kit, { "Spell Visual Kit", "woww.spell.visual.kit", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spells, { "Spells", "woww.spells", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spirit, { "Spirit", "woww.spirit", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spirit_released, { "Spirit Released", "woww.spirit.released", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spline_elevation, { "Spline Elevation", "woww.spline.elevation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_spline_flag, { "Spline Flag", "woww.spline.flag", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_spline_id, { "Spline Id", "woww.spline.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stable_master, { "Stable Master", "woww.stable.master", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stable_result, { "Stable Result", "woww.stable.result", FT_UINT8, BASE_HEX_DEC, VALS(e_stable_result_strings), 0, NULL, HFILL } }, { &hf_woww_stable_slots, { "Stable Slots", "woww.stable.slots", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stack_count, { "Stack Count", "woww.stack.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stackable, { "Stackable", "woww.stackable", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stamina, { "Stamina", "woww.stamina", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_standing, { "Standing", "woww.standing", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_start_bid, { "Start Bid", "woww.start.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_start_from_page, { "Start From Page", "woww.start.from.page", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_start_quest, { "Start Quest", "woww.start.quest", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_starting_bid, { "Starting Bid", "woww.starting.bid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_state, { "State", "woww.state", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_stationery, { "Stationery", "woww.stationery", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_status, { "Status", "woww.status", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_status_id, { "Status Id", "woww.status.id", FT_UINT8, BASE_HEX_DEC, VALS(e_status_id_strings), 0, NULL, HFILL } }, { &hf_woww_strength, { "Strength", "woww.strength", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_string, { "String", "woww.string", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_sub_name, { "Sub Name", "woww.sub.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_subject, { "Subject", "woww.subject", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_suggestion, { "Suggestion", "woww.suggestion", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_summoner, { "Summoner", "woww.summoner", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_survey_id, { "Survey Id", "woww.survey.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_swap_with_name, { "Swap With Name", "woww.swap.with.name", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_swimming_speed, { "Swimming Speed", "woww.swimming.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_talent, { "Talent", "woww.talent", FT_UINT32, BASE_HEX_DEC, VALS(e_talent_strings), 0, NULL, HFILL } }, { &hf_woww_talent_point_cost, { "Talent Point Cost", "woww.talent.point.cost", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_talent_reset_cost, { "Talent Reset Cost", "woww.talent.reset.cost", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_target, { "Target", "woww.target", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_target_error, { "Target Error", "woww.target.error", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_target_player, { "Target Player", "woww.target.player", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_target_string, { "Target String", "woww.target.string", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_targets, { "Targets", "woww.targets", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_taxi_mask_node_known, { "Taxi Mask Node Known", "woww.taxi.mask.node.known", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_text, { "Text", "woww.text", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_text_emote, { "Text Emote", "woww.text.emote", FT_UINT32, BASE_HEX_DEC, VALS(e_text_emote_strings), 0, NULL, HFILL } }, { &hf_woww_text_id, { "Text Id", "woww.text.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_texts, { "Texts", "woww.texts", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_this_week_honor, { "This Week Honor", "woww.this.week.honor", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_this_week_honorable, { "This Week Honorable", "woww.this.week.honorable", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time, { "Time", "woww.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_in_queue_in_ms, { "Time In Queue In Ms", "woww.time.in.queue.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_left, { "Time Left", "woww.time.left", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_offline, { "Time Offline", "woww.time.offline", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_time_passed, { "Time Passed", "woww.time.passed", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_remaining, { "Time Remaining", "woww.time.remaining", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_skipped, { "Time Skipped", "woww.time.skipped", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_to_bg_autoleave_in_ms, { "Time To Bg Autoleave In Ms", "woww.time.to.bg.autoleave.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_to_bg_start_in_ms, { "Time To Bg Start In Ms", "woww.time.to.bg.start.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_time_to_remove_in_queue_in_ms, { "Time To Remove In Queue In Ms", "woww.time.to.remove.in.queue.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_timer, { "Timer", "woww.timer", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_timer_type, { "Timer Type", "woww.timer.type", FT_UINT32, BASE_HEX_DEC, VALS(e_timer_type_strings), 0, NULL, HFILL } }, { &hf_woww_timescale, { "Timescale", "woww.timescale", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_timestamp, { "Timestamp", "woww.timestamp", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_title, { "Title", "woww.title", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_title_text_id, { "Title Text Id", "woww.title.text.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_today_honorable_and_dishonorable, { "Today Honorable And Dishonorable", "woww.today.honorable.and.dishonorable", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_todo_amount_of_signers, { "Todo Amount Of Signers", "woww.todo.amount.of.signers", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_total_amount_of_auctions, { "Total Amount Of Auctions", "woww.total.amount.of.auctions", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_total_cost, { "Total Cost", "woww.total.cost", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_total_damage, { "Total Damage", "woww.total.damage", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_total_exp, { "Total Exp", "woww.total.exp", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_total_played_time, { "Total Played Time", "woww.total.played.time", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trade_item, { "Trade Item", "woww.trade.item", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trade_slot, { "Trade Slot", "woww.trade.slot", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trade_slot_count, { "Trade Slot Count", "woww.trade.slot.count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trade_slot_number, { "Trade Slot Number", "woww.trade.slot.number", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trade_status, { "Trade Status", "woww.trade.status", FT_UINT32, BASE_HEX_DEC, VALS(e_trade_status_strings), 0, NULL, HFILL } }, { &hf_woww_trainer_spell_state, { "Trainer Spell State", "woww.trainer.spell.state", FT_UINT8, BASE_HEX_DEC, VALS(e_trainer_spell_state_strings), 0, NULL, HFILL } }, { &hf_woww_trainer_type, { "Trainer Type", "woww.trainer.type", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_training_failure_reason, { "Training Failure Reason", "woww.training.failure.reason", FT_UINT32, BASE_HEX_DEC, VALS(e_training_failure_reason_strings), 0, NULL, HFILL } }, { &hf_woww_transfer_abort_reason, { "Transfer Abort Reason", "woww.transfer.abort.reason", FT_UINT8, BASE_HEX_DEC, VALS(e_transfer_abort_reason_strings), 0, NULL, HFILL } }, { &hf_woww_transport, { "Transport", "woww.transport", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_transport_guid, { "Transport Guid", "woww.transport.guid", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_transport_orientation, { "Transport Orientation", "woww.transport.orientation", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_transport_progress_in_ms, { "Transport Progress In Ms", "woww.transport.progress.in.ms", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_trigger_id, { "Trigger Id", "woww.trigger.id", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_turn_rate, { "Turn Rate", "woww.turn.rate", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_tutorial_data, { "Tutorial Data", "woww.tutorial.data", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_tutorial_flag, { "Tutorial Flag", "woww.tutorial.flag", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_type_flags, { "Type Flags", "woww.type.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_unit_stand_state, { "Unit Stand State", "woww.unit.stand.state", FT_UINT32, BASE_HEX_DEC, VALS(e_unit_stand_state_strings), 0, NULL, HFILL } }, { &hf_woww_unit_target, { "Unit Target", "woww.unit.target", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_unknown_flags, { "Unknown Flags", "woww.unknown.flags", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_unknown_float, { "Unknown Float", "woww.unknown.float", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_unknown_guid, { "Unknown Guid", "woww.unknown.guid", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_unknown_int, { "Unknown Int", "woww.unknown.int", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_unread_mails, { "Unread Mails", "woww.unread.mails", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_unused, { "Unused", "woww.unused", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_update_available_flag, { "Update Available Flag", "woww.update.available.flag", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_update_flag, { "Update Flag", "woww.update.flag", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_update_type, { "Update Type", "woww.update.type", FT_UINT8, BASE_HEX_DEC, VALS(e_update_type_strings), 0, NULL, HFILL } }, { &hf_woww_url, { "Url", "woww.url", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_url_info, { "Url Info", "woww.url.info", FT_UINT8, BASE_HEX_DEC, VALS(e_url_info_strings), 0, NULL, HFILL } }, { &hf_woww_usable, { "Usable", "woww.usable", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_username, { "Username", "woww.username", FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_v_cos, { "V Cos", "woww.v.cos", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_v_sin, { "V Sin", "woww.v.sin", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_value, { "Value", "woww.value", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_vendor, { "Vendor", "woww.vendor", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_vendor_slot, { "Vendor Slot", "woww.vendor.slot", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_vertical_speed, { "Vertical Speed", "woww.vertical.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_victim, { "Victim", "woww.victim", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_walking_speed, { "Walking Speed", "woww.walking.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_weather_change_type, { "Weather Change Type", "woww.weather.change.type", FT_UINT8, BASE_HEX_DEC, VALS(e_weather_change_type_strings), 0, NULL, HFILL } }, { &hf_woww_weather_type, { "Weather Type", "woww.weather.type", FT_UINT32, BASE_HEX_DEC, VALS(e_weather_type_strings), 0, NULL, HFILL } }, { &hf_woww_winning_player, { "Winning Player", "woww.winning.player", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_winning_roll, { "Winning Roll", "woww.winning.roll", FT_UINT8, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_wiping_npc, { "Wiping Npc", "woww.wiping.npc", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_won, { "Won", "woww.won", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_world_result, { "World Result", "woww.world.result", FT_UINT8, BASE_HEX_DEC, VALS(e_world_result_strings), 0, NULL, HFILL } }, { &hf_woww_wrapped, { "Wrapped", "woww.wrapped", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_x, { "X", "woww.x", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_xy_speed, { "Xy Speed", "woww.xy.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_y, { "Y", "woww.y", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_yesterday_honor, { "Yesterday Honor", "woww.yesterday.honor", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_yesterday_honorable, { "Yesterday Honorable", "woww.yesterday.honorable", FT_UINT16, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_z, { "Z", "woww.z", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_z_speed, { "Z Speed", "woww.z.speed", FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL } }, { &hf_woww_zone_or_sort, { "Zone Or Sort", "woww.zone.or.sort", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, { &hf_woww_zones, { "Zones", "woww.zones", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL } }, /* AUTOGENERATED_END_REGISTER */ }; static gint *ett[] = { &ett_woww, &ett_message, &ett_character }; proto_woww = proto_register_protocol("World of Warcraft World", "WOWW", "woww"); woww_handle = register_dissector("woww", dissect_woww, proto_woww); proto_register_field_array(proto_woww, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); prefs_register_protocol(proto_woww, NULL); } void proto_reg_handoff_woww(void) { dissector_add_for_decode_as("tcp.port", woww_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wps.c
/* packet-wps.c * * Wifi Simple Config aka Wifi Protected Setup * * Written by Jens Braeuer using WiFi-Alliance Spec 1.0h and * parts of a patch by JP Jiang and Philippe Teuwen. November 2007 * * Spec: * https://www.wi-fi.org/knowledge_center_overview.php?type=4 * Patch: * http://wireshark.digimirror.nl/lists/wireshark-dev/200703/msg00121.html * * Copyright 2007 Jens Braeuer <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * */ #include "config.h" #include <epan/packet.h> #include <epan/expert.h> #include <epan/sminmpec.h> #include "packet-wps.h" #include "packet-ieee80211.h" void proto_register_wps(void); void proto_reg_handoff_wps(void); static int hf_eapwps_opcode = -1; static int hf_eapwps_flags = -1; static int hf_eapwps_flag_mf = -1; static int hf_eapwps_flag_lf = -1; static int hf_eapwps_msglen = -1; static gint ett_eap_wps_attr = -1; static gint ett_eap_wps_flags = -1; static expert_field ei_eapwps_packet_too_short = EI_INIT; static expert_field ei_eapwps_fmt_warn_too_long = EI_INIT; static expert_field ei_eapwps_fmt_length_warn = EI_INIT; static dissector_handle_t wps_handle; /* OPCodes */ #define OPC_WSC_START 0x01 /* WPS OPCODE WSC_Start */ #define OPC_WSC_ACK 0x02 /* WPS OPCODE WSC_ACK */ #define OPC_WSC_NACK 0x03 /* WPS OPCODE WSC_NACK */ #define OPC_WSC_MSG 0x04 /* WPS OPCODE WSC_MSG */ #define OPC_WSC_DONE 0x05 /* WPS OPCODE WSC_Done */ #define OPC_WSC_FRAG_ACK 0x06 /* WPS OPCODE WSC_FRAG_ACK */ static const value_string eapwps_opcode_vals[] = { { OPC_WSC_START, "WSC Start"}, { OPC_WSC_ACK, "WSC Ack"}, { OPC_WSC_NACK, "WSC Nack" }, { OPC_WSC_MSG, "WSC Msg" }, { OPC_WSC_DONE, "WSC Done" }, { OPC_WSC_FRAG_ACK, "WSC Frag Ack" }, { 0, NULL } }; /* Flag-Field masks */ #define MASK_WSC_FLAG_MF 0x01 /* WPS Flag more frag */ #define MASK_WSC_FLAG_LF 0x02 /* WPS flag length field */ #define WPS_TLV_TYPE_AP_CHANNEL 0x1001 #define WPS_TLV_TYPE_ASSOCIATION_STATE 0x1002 #define WPS_TLV_TYPE_AUTHENTICATION_TYPE 0x1003 #define WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS 0x1004 #define WPS_TLV_TYPE_AUTHENTICATOR 0x1005 #define WPS_TLV_TYPE_CONFIG_METHODS 0x1008 #define WPS_TLV_TYPE_CONFIGURATION_ERROR 0x1009 #define WPS_TLV_TYPE_CONFIRMATION_URL4 0x100a #define WPS_TLV_TYPE_CONFIRMATION_URL6 0x100b #define WPS_TLV_TYPE_CONNECTION_TYPE 0x100c #define WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS 0x100d #define WPS_TLV_TYPE_CREDENTIAL 0x100e #define WPS_TLV_TYPE_DEVICE_NAME 0x1011 #define WPS_TLV_TYPE_DEVICE_PASSWORD_ID 0x1012 #define WPS_TLV_TYPE_E_HASH1 0X1014 #define WPS_TLV_TYPE_E_HASH2 0x1015 #define WPS_TLV_TYPE_E_SNONCE1 0x1016 #define WPS_TLV_TYPE_E_SNONCE2 0x1017 #define WPS_TLV_TYPE_ENCRYPTED_SETTINGS 0x1018 #define WPS_TLV_TYPE_ENCRYPTION_TYPE 0x100f #define WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS 0x1010 #define WPS_TLV_TYPE_ENROLLEE_NONCE 0x101a #define WPS_TLV_TYPE_FEATURE_ID 0x101b #define WPS_TLV_TYPE_IDENTITY 0x101c #define WPS_TLV_TYPE_IDENTITY_PROOF 0x101d #define WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR 0x101e #define WPS_TLV_TYPE_KEY_IDENTIFIER 0x101f #define WPS_TLV_TYPE_MAC_ADDRESS 0x1020 #define WPS_TLV_TYPE_MANUFACTURER 0x1021 #define WPS_TLV_TYPE_MESSAGE_TYPE 0x1022 #define WPS_TLV_TYPE_MODEL_NAME 0x1023 #define WPS_TLV_TYPE_MODEL_NUMBER 0x1024 #define WPS_TLV_TYPE_NETWORK_INDEX 0x1026 #define WPS_TLV_TYPE_NETWORK_KEY 0x1027 #define WPS_TLV_TYPE_NETWORK_KEY_INDEX 0x1028 #define WPS_TLV_TYPE_NEW_DEVICE_NAME 0x1029 #define WPS_TLV_TYPE_NEW_PASSWORD 0x102a #define WPS_TLV_TYPE_OOB_DEVICE_PASSWORD 0x102c #define WPS_TLV_TYPE_OS_VERSION 0x102d #define WPS_TLV_TYPE_POWER_LEVEL 0x102f #define WPS_TLV_TYPE_PSK_CURRENT 0x1030 #define WPS_TLV_TYPE_PSK_MAX 0x1031 #define WPS_TLV_TYPE_PUBLIC_KEY 0x1032 #define WPS_TLV_TYPE_RADIO_ENABLED 0x1033 #define WPS_TLV_TYPE_REBOOT 0x1034 #define WPS_TLV_TYPE_REGISTRAR_CURRENT 0x1035 #define WPS_TLV_TYPE_REGISTRAR_ESTABLISHED 0x1036 #define WPS_TLV_TYPE_REGISTRAR_LIST 0x1037 #define WPS_TLV_TYPE_REGISTRAR_MAX 0x1038 #define WPS_TLV_TYPE_REGISTRAR_NONCE 0x1039 #define WPS_TLV_TYPE_REQUEST_TYPE 0x103a #define WPS_TLV_TYPE_RESPONSE_TYPE 0x103b #define WPS_TLV_TYPE_RF_BANDS 0x103c #define WPS_TLV_TYPE_R_HASH1 0x103d #define WPS_TLV_TYPE_R_HASH2 0x103e #define WPS_TLV_TYPE_R_SNONCE1 0x103f #define WPS_TLV_TYPE_R_SNONCE2 0x1040 #define WPS_TLV_TYPE_SELECTED_REGISTRAR 0x1041 #define WPS_TLV_TYPE_SERIAL_NUMBER 0x1042 #define WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE 0x1044 #define WPS_TLV_TYPE_SSID 0x1045 #define WPS_TLV_TYPE_TOTAL_NETWORKS 0x1046 #define WPS_TLV_TYPE_UUID_E 0x1047 #define WPS_TLV_TYPE_UUID_R 0x1048 #define WPS_TLV_TYPE_VENDOR_EXTENSION 0x1049 #define WPS_TLV_TYPE_VERSION 0x104a #define WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST 0x104b #define WPS_TLV_TYPE_X509_CERTIFICATE 0x104c #define WPS_TLV_TYPE_EAP_IDENTITY 0x104d #define WPS_TLV_TYPE_MESSAGE_COUNTER 0x104e #define WPS_TLV_TYPE_PUBLIC_KEY_HASH 0x104f #define WPS_TLV_TYPE_REKEY_KEY 0x1050 #define WPS_TLV_TYPE_KEY_LIFETIME 0x1051 #define WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS 0x1052 #define WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS 0x1053 #define WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE 0x1054 #define WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST 0x1055 #define WPS_TLV_TYPE_PORTABLE_DEVICE 0x1056 #define WPS_TLV_TYPE_AP_SETUP_LOCKED 0x1057 #define WPS_TLV_TYPE_APPLICATION_EXTENSION 0x1058 #define WPS_TLV_TYPE_EAP_TYPE 0x1059 #define WPS_TLV_TYPE_INITIALIZATION_VECTOR 0x1060 #define WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY 0x1061 #define WPS_TLV_TYPE_8021X_ENABLED 0x1062 #define WPS_TLV_TYPE_APPSESSIONKEY 0x1063 #define WPS_TLV_TYPE_WEPTRANSMITKEY 0x1064 #define WPS_TLV_TYPE_REQUESTED_DEV_TYPE 0x106a static const value_string eapwps_tlv_types[] = { { WPS_TLV_TYPE_AP_CHANNEL, "AP Channel" }, { WPS_TLV_TYPE_ASSOCIATION_STATE, "Association State" }, { WPS_TLV_TYPE_AUTHENTICATION_TYPE, "Authentication Type" }, { WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS, "Authentication Type Flags" }, { WPS_TLV_TYPE_AUTHENTICATOR, "Authenticator" }, { WPS_TLV_TYPE_CONFIG_METHODS, "Config Methods" }, { WPS_TLV_TYPE_CONFIGURATION_ERROR, "Configuration Error" }, { WPS_TLV_TYPE_CONFIRMATION_URL4, "Confirmation URL4" }, { WPS_TLV_TYPE_CONFIRMATION_URL6, "Confirmation URL6" }, { WPS_TLV_TYPE_CONNECTION_TYPE, "Connection Type" }, { WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS, "Connection Type Flags" }, { WPS_TLV_TYPE_CREDENTIAL, "Credential" }, { WPS_TLV_TYPE_DEVICE_NAME, "Device Name" }, { WPS_TLV_TYPE_DEVICE_PASSWORD_ID, "Device Password ID" }, { WPS_TLV_TYPE_E_HASH1, "E Hash1" }, { WPS_TLV_TYPE_E_HASH2, "E Hash2" }, { WPS_TLV_TYPE_E_SNONCE1, "E SNonce1" }, { WPS_TLV_TYPE_E_SNONCE2, "E SNonce2" }, { WPS_TLV_TYPE_ENCRYPTED_SETTINGS, "Encrypted Settings" }, { WPS_TLV_TYPE_ENCRYPTION_TYPE, "Encryption Type" }, { WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS, "Encryption Type Flags" }, { WPS_TLV_TYPE_ENROLLEE_NONCE, "Enrollee Nonce" }, { WPS_TLV_TYPE_FEATURE_ID, "Feature Id" }, { WPS_TLV_TYPE_IDENTITY, "Identity" }, { WPS_TLV_TYPE_IDENTITY_PROOF, "Identity Proof" }, { WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR, "Key Wrap Authenticator" }, { WPS_TLV_TYPE_KEY_IDENTIFIER, "Key Identifier" }, { WPS_TLV_TYPE_MAC_ADDRESS, "MAC Address" }, { WPS_TLV_TYPE_MANUFACTURER, "Manufacturer" }, { WPS_TLV_TYPE_MESSAGE_TYPE, "Message Type" }, { WPS_TLV_TYPE_MODEL_NAME, "Model Name" }, { WPS_TLV_TYPE_MODEL_NUMBER, "Model Number" }, { WPS_TLV_TYPE_NETWORK_INDEX, "Network Index" }, { WPS_TLV_TYPE_NETWORK_KEY, "Network Key" }, { WPS_TLV_TYPE_NETWORK_KEY_INDEX, "Network Key Index" }, { WPS_TLV_TYPE_NEW_DEVICE_NAME, "New Device Name" }, { WPS_TLV_TYPE_NEW_PASSWORD, "New Password" }, { WPS_TLV_TYPE_OOB_DEVICE_PASSWORD, "OOB Device Password" }, { WPS_TLV_TYPE_OS_VERSION, "OS Version" }, { WPS_TLV_TYPE_POWER_LEVEL, "Power Level" }, { WPS_TLV_TYPE_PSK_CURRENT, "PSK Current" }, { WPS_TLV_TYPE_PSK_MAX, "PSK Max" }, { WPS_TLV_TYPE_PUBLIC_KEY, "Public Key" }, { WPS_TLV_TYPE_RADIO_ENABLED, "Radio Enabled" }, { WPS_TLV_TYPE_REBOOT, "Reboot" }, { WPS_TLV_TYPE_REGISTRAR_CURRENT, "Registrar Current" }, { WPS_TLV_TYPE_REGISTRAR_ESTABLISHED, "Registrar Established" }, { WPS_TLV_TYPE_REGISTRAR_LIST, "Registrar List" }, { WPS_TLV_TYPE_REGISTRAR_MAX, "registrar_max" }, { WPS_TLV_TYPE_REGISTRAR_NONCE, "Registrar Nonce" }, { WPS_TLV_TYPE_REQUEST_TYPE, "Request Type" }, { WPS_TLV_TYPE_RESPONSE_TYPE, "Response Type" }, { WPS_TLV_TYPE_RF_BANDS, "RF Bands" }, { WPS_TLV_TYPE_R_HASH1, "R Hash1" }, { WPS_TLV_TYPE_R_HASH2, "R Hash2" }, { WPS_TLV_TYPE_R_SNONCE1, "R Snonce1" }, { WPS_TLV_TYPE_R_SNONCE2, "R Snonce2" }, { WPS_TLV_TYPE_SELECTED_REGISTRAR, "Selected Registrar" }, { WPS_TLV_TYPE_SERIAL_NUMBER, "Serial Number" }, { WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE, "Wifi Protected Setup State" }, { WPS_TLV_TYPE_SSID, "SSID" }, { WPS_TLV_TYPE_TOTAL_NETWORKS, "Total Networks" }, { WPS_TLV_TYPE_UUID_E, "UUID E" }, { WPS_TLV_TYPE_UUID_R, "UUID R" }, { WPS_TLV_TYPE_VENDOR_EXTENSION, "Vendor Extension" }, { WPS_TLV_TYPE_VERSION, "Version" }, { WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST, "X509 Certificate Request" }, { WPS_TLV_TYPE_X509_CERTIFICATE, "X509 Certificate" }, { WPS_TLV_TYPE_EAP_IDENTITY, "EAP Identity" }, { WPS_TLV_TYPE_MESSAGE_COUNTER, "Message Counter" }, { WPS_TLV_TYPE_PUBLIC_KEY_HASH, "Public Key Hash" }, { WPS_TLV_TYPE_REKEY_KEY, "Rekey Key" }, { WPS_TLV_TYPE_KEY_LIFETIME, "Key Lifetime" }, { WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS, "Permitted Config Methods" }, { WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS, "Selected Registrar Config Methods" }, { WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE, "Primary Device Type" }, { WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST, "Secondary Device Type List" }, { WPS_TLV_TYPE_PORTABLE_DEVICE, "Portable Device" }, { WPS_TLV_TYPE_AP_SETUP_LOCKED, "Ap Setup Locked" }, { WPS_TLV_TYPE_APPLICATION_EXTENSION, "Application Extension" }, { WPS_TLV_TYPE_EAP_TYPE, "EAP Type" }, { WPS_TLV_TYPE_INITIALIZATION_VECTOR, "Initialization Vector" }, { WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY, "Key Provided Automatically" }, { WPS_TLV_TYPE_8021X_ENABLED, "8021x Enabled" }, { WPS_TLV_TYPE_APPSESSIONKEY, "AppSessionKey" }, { WPS_TLV_TYPE_WEPTRANSMITKEY, "WEPTransmitKey" }, { WPS_TLV_TYPE_REQUESTED_DEV_TYPE, "Requested Device Type" }, { 0, NULL } }; /* WFA Vendor Extension */ #define WPS_WFA_EXT_VERSION2 0x00 #define WPS_WFA_EXT_AUTHORIZEDMACS 0x01 #define WPS_WFA_EXT_NETWORK_KEY_SHAREABLE 0x02 #define WPS_WFA_EXT_REQUEST_TO_ENROLL 0x03 #define WPS_WFA_EXT_SETTINGS_DELAY_TIME 0x04 #define WPS_WFA_EXT_MULTI_AP 0x06 #define WPS_WFA_EXT_MULTI_AP_PROFILE 0x07 #define WPS_WFA_EXT_MULTI_AP_8021Q 0x08 static const value_string eapwps_wfa_ext_types[] = { { WPS_WFA_EXT_VERSION2, "Version2" }, { WPS_WFA_EXT_AUTHORIZEDMACS, "AuthorizedMACs" }, { WPS_WFA_EXT_NETWORK_KEY_SHAREABLE, "Network Key Shareable" }, { WPS_WFA_EXT_REQUEST_TO_ENROLL, "Request to Enroll" }, { WPS_WFA_EXT_SETTINGS_DELAY_TIME, "Settings Delay Time" }, { WPS_WFA_EXT_MULTI_AP, "Multi-AP Extension" }, { WPS_WFA_EXT_MULTI_AP_PROFILE, "Multi-AP Profile" }, { WPS_WFA_EXT_MULTI_AP_8021Q, "Multi-AP Profile 8021Q Settings" }, { 0, NULL } }; static const value_string wps_wfa_ext_multi_ap_profiles_vals[] = { { 0x01, "Multi-AP Profile-1" }, { 0x02, "Multi-AP Profile-2" }, { 0x03, "Multi-AP Profile-3" }, { 0, NULL } }; #define WFA_OUI 0x0050F204 static int proto_wps = -1; static int hf_eapwps_tlv_type = -1; static int hf_eapwps_tlv_len = -1; static int hf_eapwps_tlv_ap_channel = -1; static int hf_eapwps_tlv_association_state = -1; static int hf_eapwps_tlv_authentication_type = -1; static int hf_eapwps_tlv_authentication_type_flags = -1; static int hf_eapwps_tlv_authentication_type_flags_open = -1; static int hf_eapwps_tlv_authentication_type_flags_wpapsk = -1; static int hf_eapwps_tlv_authentication_type_flags_shared = -1; static int hf_eapwps_tlv_authentication_type_flags_wpa = -1; static int hf_eapwps_tlv_authentication_type_flags_wpa2 = -1; static int hf_eapwps_tlv_authentication_type_flags_wpa2psk = -1; static int hf_eapwps_tlv_authenticator = -1; static int hf_eapwps_tlv_config_methods = -1; static int hf_eapwps_tlv_config_methods_usba = -1; static int hf_eapwps_tlv_config_methods_ethernet = -1; static int hf_eapwps_tlv_config_methods_label = -1; static int hf_eapwps_tlv_config_methods_display = -1; static int hf_eapwps_tlv_config_methods_phy_display = -1; static int hf_eapwps_tlv_config_methods_virt_display = -1; static int hf_eapwps_tlv_config_methods_nfcext = -1; static int hf_eapwps_tlv_config_methods_nfcint = -1; static int hf_eapwps_tlv_config_methods_nfcinf = -1; static int hf_eapwps_tlv_config_methods_pushbutton = -1; static int hf_eapwps_tlv_config_methods_phy_pushbutton = -1; static int hf_eapwps_tlv_config_methods_virt_pushbutton = -1; static int hf_eapwps_tlv_config_methods_keypad = -1; static int hf_eapwps_tlv_configuration_error = -1; static int hf_eapwps_tlv_confirmation_url4 = -1; static int hf_eapwps_tlv_confirmation_url6 = -1; static int hf_eapwps_tlv_connection_type = -1; static int hf_eapwps_tlv_connection_type_flags = -1; static int hf_eapwps_tlv_connection_type_flags_ess = -1; static int hf_eapwps_tlv_connection_type_flags_ibss = -1; static int hf_eapwps_tlv_credential = -1; static int hf_eapwps_tlv_device_name = -1; static int hf_eapwps_tlv_device_password_id = -1; static int hf_eapwps_tlv_e_hash1 = -1; static int hf_eapwps_tlv_e_hash2 = -1; static int hf_eapwps_tlv_e_snonce1 = -1; static int hf_eapwps_tlv_e_snonce2 = -1; static int hf_eapwps_tlv_encrypted_settings = -1; static int hf_eapwps_tlv_encryption_type = -1; static int hf_eapwps_tlv_encryption_type_flags = -1; static int hf_eapwps_tlv_encryption_type_flags_none = -1; static int hf_eapwps_tlv_encryption_type_flags_wep = -1; static int hf_eapwps_tlv_encryption_type_flags_tkip = -1; static int hf_eapwps_tlv_encryption_type_flags_aes = -1; static int hf_eapwps_tlv_enrollee_nonce = -1; static int hf_eapwps_tlv_feature_id = -1; static int hf_eapwps_tlv_identity = -1; static int hf_eapwps_tlv_identity_proof = -1; static int hf_eapwps_tlv_key_wrap_authenticator = -1; static int hf_eapwps_tlv_key_identifier = -1; static int hf_eapwps_tlv_mac_address = -1; static int hf_eapwps_tlv_manufacturer = -1; static int hf_eapwps_tlv_message_type = -1; static int hf_eapwps_tlv_model_name = -1; static int hf_eapwps_tlv_model_number = -1; static int hf_eapwps_tlv_network_index = -1; static int hf_eapwps_tlv_network_key = -1; static int hf_eapwps_tlv_network_key_index = -1; static int hf_eapwps_tlv_new_device_name = -1; static int hf_eapwps_tlv_new_password = -1; static int hf_eapwps_tlv_oob_device_password = -1; static int hf_eapwps_tlv_os_version = -1; static int hf_eapwps_tlv_power_level = -1; static int hf_eapwps_tlv_psk_current = -1; static int hf_eapwps_tlv_psk_max = -1; static int hf_eapwps_tlv_public_key = -1; static int hf_eapwps_tlv_radio_enabled = -1; static int hf_eapwps_tlv_reboot = -1; static int hf_eapwps_tlv_registrar_current = -1; static int hf_eapwps_tlv_registrar_established = -1; static int hf_eapwps_tlv_registrar_list = -1; static int hf_eapwps_tlv_registrar_max = -1; static int hf_eapwps_tlv_registrar_nonce = -1; static int hf_eapwps_tlv_request_type = -1; static int hf_eapwps_tlv_response_type = -1; static int hf_eapwps_tlv_rf_bands = -1; static int hf_eapwps_tlv_r_hash1 = -1; static int hf_eapwps_tlv_r_hash2 = -1; static int hf_eapwps_tlv_r_snonce1 = -1; static int hf_eapwps_tlv_r_snonce2 = -1; static int hf_eapwps_tlv_selected_registrar = -1; static int hf_eapwps_tlv_serial_number = -1; static int hf_eapwps_tlv_wifi_protected_setup_state = -1; static int hf_eapwps_tlv_ssid = -1; static int hf_eapwps_tlv_total_networks = -1; static int hf_eapwps_tlv_uuid_e = -1; static int hf_eapwps_tlv_uuid_r = -1; static int hf_eapwps_tlv_vendor_extension = -1; static int hf_eapwps_tlv_version = -1; static int hf_eapwps_tlv_x509_certificate_request = -1; static int hf_eapwps_tlv_x509_certificate = -1; static int hf_eapwps_tlv_eap_identity = -1; static int hf_eapwps_tlv_message_counter = -1; static int hf_eapwps_tlv_public_key_hash = -1; static int hf_eapwps_tlv_rekey_key = -1; static int hf_eapwps_tlv_key_lifetime = -1; static int hf_eapwps_tlv_permitted_config_methods = -1; static int hf_eapwps_tlv_permitted_config_methods_usba = -1; static int hf_eapwps_tlv_permitted_config_methods_ethernet = -1; static int hf_eapwps_tlv_permitted_config_methods_label = -1; static int hf_eapwps_tlv_permitted_config_methods_display = -1; static int hf_eapwps_tlv_permitted_config_methods_phy_display = -1; static int hf_eapwps_tlv_permitted_config_methods_virt_display = -1; static int hf_eapwps_tlv_permitted_config_methods_nfcext = -1; static int hf_eapwps_tlv_permitted_config_methods_nfcint = -1; static int hf_eapwps_tlv_permitted_config_methods_nfcinf = -1; static int hf_eapwps_tlv_permitted_config_methods_pushbutton = -1; static int hf_eapwps_tlv_permitted_config_methods_phy_pushbutton = -1; static int hf_eapwps_tlv_permitted_config_methods_virt_pushbutton = -1; static int hf_eapwps_tlv_permitted_config_methods_keypad = -1; static int hf_eapwps_tlv_selected_registrar_config_methods = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_usba = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_ethernet = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_label = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_display = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_phy_display = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_virt_display = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_nfcext = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_nfcint = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_nfcinf = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_pushbutton = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton = -1; static int hf_eapwps_tlv_selected_registrar_config_methods_keypad = -1; static int hf_eapwps_tlv_primary_device_type = -1; static int hf_eapwps_tlv_primary_device_type_category = -1; #define WPS_DEVICE_TYPE_CATEGORY_MAX 11 static int hf_eapwps_tlv_primary_device_type_subcategory[WPS_DEVICE_TYPE_CATEGORY_MAX] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; static int hf_eapwps_tlv_secondary_device_type_list = -1; static int hf_eapwps_tlv_portable_device = -1; static int hf_eapwps_tlv_ap_setup_locked = -1; static int hf_eapwps_tlv_application_extension = -1; static int hf_eapwps_tlv_eap_type = -1; static int hf_eapwps_tlv_initialization_vector = -1; static int hf_eapwps_tlv_key_provided_automatically = -1; static int hf_eapwps_tlv_8021x_enabled = -1; static int hf_eapwps_tlv_appsessionkey = -1; static int hf_eapwps_tlv_weptransmitkey = -1; static int hf_eapwps_tlv_requested_dev_type = -1; static int hf_eapwps_vendor_id = -1; static int hf_eapwps_wfa_ext_id = -1; static int hf_eapwps_wfa_ext_len = -1; static int hf_eapwps_wfa_ext_version2 = -1; static int hf_eapwps_wfa_ext_authorizedmacs = -1; static int hf_eapwps_wfa_ext_network_key_shareable = -1; static int hf_eapwps_wfa_ext_request_to_enroll = -1; static int hf_eapwps_wfa_ext_settings_delay_time = -1; static int hf_multi_ap_backhaul_sta = -1; static int hf_multi_ap_backhaul_bss = -1; static int hf_multi_ap_fronthaul_bss = -1; static int hf_multi_ap_teardown_bsses = -1; static int hf_multi_ap_profile1_backhaul_sta_assoc_disallowed = -1; static int hf_multi_ap_profile2_backhaul_sta_assoc_disallowed = -1; static int hf_multi_ap_reserved = -1; static int hf_multi_ap_flags = -1; static int hf_multi_ap_profiles = -1; static int hf_multi_ap_8021q = -1; static gint ett_wps_tlv = -1; static gint ett_eap_wps_ap_channel = -1; static gint ett_eap_wps_association_state = -1; static gint ett_eap_wps_authentication_type = -1; static gint ett_eap_wps_authentication_type_flags = -1; static gint ett_eap_wps_authenticator = -1; static gint ett_eap_wps_config_methods = -1; static gint ett_eap_wps_configuration_error = -1; static gint ett_eap_wps_confirmation_url4 = -1; static gint ett_eap_wps_confirmation_url6 = -1; static gint ett_eap_wps_connection_type = -1; static gint ett_eap_wps_connection_type_flags = -1; static gint ett_eap_wps_credential = -1; static gint ett_eap_wps_device_name = -1; static gint ett_eap_wps_device_password_id = -1; static gint ett_eap_wps_e_hash1 = -1; static gint ett_eap_wps_e_hash2 = -1; static gint ett_eap_wps_e_snonce1 = -1; static gint ett_eap_wps_e_snonce2 = -1; static gint ett_eap_wps_encrypted_settings = -1; static gint ett_eap_wps_encryption_type = -1; static gint ett_eap_wps_encryption_type_flags = -1; static gint ett_eap_wps_enrollee_nonce = -1; static gint ett_eap_wps_feature_id = -1; static gint ett_eap_wps_identity = -1; static gint ett_eap_wps_identity_proof = -1; static gint ett_eap_wps_key_wrap_authenticator = -1; static gint ett_eap_wps_key_identifier = -1; static gint ett_eap_wps_mac_address = -1; static gint ett_eap_wps_manufacturer = -1; static gint ett_eap_wps_message_type = -1; static gint ett_eap_wps_model_name = -1; static gint ett_eap_wps_model_number = -1; static gint ett_eap_wps_network_index = -1; static gint ett_eap_wps_network_key = -1; static gint ett_eap_wps_network_key_index = -1; static gint ett_eap_wps_new_device_name = -1; static gint ett_eap_wps_new_password = -1; static gint ett_eap_wps_oob_device_password = -1; static gint ett_eap_wps_os_version = -1; static gint ett_eap_wps_power_level = -1; static gint ett_eap_wps_psk_current = -1; static gint ett_eap_wps_psk_max = -1; static gint ett_eap_wps_public_key = -1; static gint ett_eap_wps_radio_enabled = -1; static gint ett_eap_wps_reboot = -1; static gint ett_eap_wps_registrar_current = -1; static gint ett_eap_wps_registrar_established = -1; static gint ett_eap_wps_registrar_list = -1; static gint ett_eap_wps_registrar_max = -1; static gint ett_eap_wps_registrar_nonce = -1; static gint ett_eap_wps_request_type = -1; static gint ett_eap_wps_response_type = -1; static gint ett_eap_wps_rf_bands = -1; static gint ett_eap_wps_r_hash1 = -1; static gint ett_eap_wps_r_hash2 = -1; static gint ett_eap_wps_r_snonce1 = -1; static gint ett_eap_wps_r_snonce2 = -1; static gint ett_eap_wps_selected_registrar = -1; static gint ett_eap_wps_serial_number = -1; static gint ett_eap_wps_wifi_protected_setup_state = -1; static gint ett_eap_wps_ssid = -1; static gint ett_eap_wps_total_networks = -1; static gint ett_eap_wps_uuid_e = -1; static gint ett_eap_wps_uuid_r = -1; static gint ett_eap_wps_vendor_extension = -1; static gint ett_eap_wps_version = -1; static gint ett_eap_wps_x509_certificate_request = -1; static gint ett_eap_wps_x509_certificate = -1; static gint ett_eap_wps_eap_identity = -1; static gint ett_eap_wps_message_counter = -1; static gint ett_eap_wps_public_key_hash = -1; static gint ett_eap_wps_rekey_key = -1; static gint ett_eap_wps_key_lifetime = -1; static gint ett_eap_wps_permitted_config_methods = -1; static gint ett_eap_wps_selected_registrar_config_methods = -1; static gint ett_eap_wps_primary_device_type = -1; static gint ett_eap_wps_secondary_device_type_list = -1; static gint ett_eap_wps_portable_device = -1; static gint ett_eap_wps_ap_setup_locked = -1; static gint ett_eap_wps_application_extension = -1; static gint ett_eap_wps_eap_type = -1; static gint ett_eap_wps_initialization_vector = -1; static gint ett_eap_wps_key_provided_automatically = -1; static gint ett_eap_wps_8021x_enabled = -1; static gint ett_eap_wps_appsessionkey = -1; static gint ett_eap_wps_weptransmitkey = -1; static gint ett_wps_wfa_ext = -1; static gint ett_multi_ap_flags = -1; static const value_string eapwps_tlv_association_state_vals[] = { { 0, "Not associated" }, { 1, "Connection success" }, { 2, "Configuration Failure" }, { 3, "Association Failure" }, { 4, "IP Failure" }, { 0, NULL } }; #define EAPWPS_AUTHTYPE_OPEN 0x01 #define EAPWPS_AUTHTYPE_WPAPSK 0x02 #define EAPWPS_AUTHTYPE_SHARED 0x04 #define EAPWPS_AUTHTYPE_WPA 0x08 #define EAPWPS_AUTHTYPE_WPA2 0x10 #define EAPWPS_AUTHTYPE_WPA2PSK 0x20 static const value_string eapwps_tlv_authentication_type_vals[] = { { EAPWPS_AUTHTYPE_OPEN, "Open" }, { EAPWPS_AUTHTYPE_WPAPSK, "WPA PSK" }, { EAPWPS_AUTHTYPE_SHARED, "Shared" }, { EAPWPS_AUTHTYPE_WPA, "WPA" }, { EAPWPS_AUTHTYPE_WPA2, "WPA2" }, { EAPWPS_AUTHTYPE_WPA2PSK, "WPA2 PSK" }, { 0, NULL } }; #define EAPWPS_CONFMETH_USBA 0x0001 #define EAPWPS_CONFMETH_ETHERNET 0x0002 #define EAPWPS_CONFMETH_LABEL 0x0004 #define EAPWPS_CONFMETH_DISPLAY 0x0008 #define EAPWPS_CONFMETH_VIRT_DISPLAY 0x2000 #define EAPWPS_CONFMETH_PHY_DISPLAY 0x4000 #define EAPWPS_CONFMETH_NFCEXT 0x0010 #define EAPWPS_CONFMETH_NFCINT 0x0020 #define EAPWPS_CONFMETH_NFCINF 0x0040 #define EAPWPS_CONFMETH_PUSHBUTTON 0x0080 #define EAPWPS_CONFMETH_VIRT_PUSHBUTTON 0x0200 #define EAPWPS_CONFMETH_PHY_PUSHBUTTON 0x0400 #define EAPWPS_CONFMETH_KEYPAD 0x0100 static const value_string eapwps_tlv_configuration_error_vals[] = { { 0, "No Error" }, { 1, "OOB Interface Read Error" }, { 2, "Decryption CRC Failure" }, { 3, "2.4 channel not supported" }, { 4, "5.0 channel not supported" }, { 5, "Signal too weak" }, { 6, "Network auth failure" }, { 7, "Network association failure" }, { 8, "No DHCP response" }, { 9, "failed DHCP config" }, { 10, "IP address conflict" }, { 11, "Couldn't connect to Registrar" }, { 12, "Multiple PBC sessions detected" }, { 13, "Rogue activity suspected" }, { 14, "Device busy" }, { 15, "Setup locked" }, { 16, "Message Timeout" }, { 17, "Registration Session Timeout" }, { 18, "Device Password Auth Failure" }, { 0, NULL } }; #define EAPWPS_CONNTYPE_ESS 0x1 #define EAPWPS_CONNTYPE_IBSS 0x2 static const value_string eapwps_tlv_connection_type_vals[] = { { EAPWPS_CONNTYPE_ESS, "ESS" }, { EAPWPS_CONNTYPE_IBSS, "IBSS" }, { 0, NULL} }; #define EAPWPS_DEVPW_PIN 0x0 #define EAPWPS_DEVPW_USER 0x1 #define EAPWPS_DEVPW_MACHINE 0x2 #define EAPWPS_DEVPW_REKEY 0x3 #define EAPWPS_DEVPW_PUSHBUTTON 0x4 #define EAPWPS_DEVPW_REGISTRAR 0x5 static const value_string eapwps_tlv_device_password_id_vals[] = { { EAPWPS_DEVPW_PIN, "PIN (default)" }, { EAPWPS_DEVPW_USER, "User specified" }, { EAPWPS_DEVPW_MACHINE, "Machine specified" }, { EAPWPS_DEVPW_REKEY, "Rekey" }, { EAPWPS_DEVPW_PUSHBUTTON, "PushButton" }, { EAPWPS_DEVPW_REGISTRAR, "Registrar specified" }, { 0, NULL } }; #define EAPWPS_ENCTYPE_NONE 0x1 #define EAPWPS_ENCTYPE_WEP 0x2 #define EAPWPS_ENCTYPE_TKIP 0x4 #define EAPWPS_ENCTYPE_AES 0x8 static const value_string eapwps_tlv_encryption_type_vals[] = { { EAPWPS_ENCTYPE_NONE, "none" }, { EAPWPS_ENCTYPE_WEP, "WEP" }, { EAPWPS_ENCTYPE_TKIP, "TKIP" }, { EAPWPS_ENCTYPE_AES, "AES" }, { 0, NULL } }; static const value_string eapwps_tlv_message_type_vals[] = { { 0x01, "Beacon" }, { 0x02, "Probe Request" }, { 0x03, "Probe Response" }, { 0x04, "M1" }, { 0x05, "M2" }, { 0x06, "M2D" }, { 0x07, "M3" }, { 0x08, "M4" }, { 0x09, "M5" }, { 0x0A, "M6" }, { 0x0B, "M7" }, { 0x0C, "M8" }, { 0x0D, "WSC_ACK" }, { 0x0E, "WSC_NACK" }, { 0x0F, "WSC_DONE" }, { 0, NULL } }; static const value_string eapwps_tlv_request_type_vals[] = { { 0x00, "Enrollee, Info only" }, { 0x01, "Enrollee, open 802.1X" }, { 0x02, "Registrar" }, { 0x03, "WLAN Manager Registrar" }, { 0, NULL } }; static const value_string eapwps_tlv_response_type_vals[] = { { 0x00, "Enrollee, Info only" }, { 0x01, "Enrollee, open 802.1X" }, { 0x02, "Registrar" }, { 0x03, "AP" }, { 0, NULL } }; static const value_string eapwps_tlv_rf_bands_vals[] = { { 0x01, "2.4 GHz" }, { 0x02, "5 GHz" }, { 0x03, "2.4 and 5 GHz" }, { 0, NULL } }; static const value_string eapwps_tlv_wifi_protected_setup_state[] = { { 0x00, "Reserved" }, { 0x01, "Not configured" }, { 0x02, "Configured" }, { 0, NULL } }; static const value_string eapwps_tlv_primary_device_type_category[] = { { 0x01, "Computer" }, { 0x02, "Input Device" }, { 0x03, "Printers, Scanners, Faxes and Copiers" }, { 0x04, "Camera" }, { 0x05, "Storage" }, { 0x06, "Network Infrastructure" }, { 0x07, "Displays" }, { 0x08, "Multimedia Devices" }, { 0x09, "Gaming Devices" }, { 0x0A, "Telephone" }, { 0x0B, "Audio Devices" }, { 0, NULL } }; static const value_string eapwps_tlv_computer_subcategory[] = { { 0x01, "PC" }, { 0x02, "Server" }, { 0x03, "Media Center" }, { 0x04, "Ultra-mobile PC" }, { 0x05, "Notebook" }, { 0x06, "Desktop" }, { 0x07, "MID (Mobile Internet Device)" }, { 0x08, "Netbook" }, { 0, NULL } }; static const value_string eapwps_tlv_input_device_subcategory[] = { { 0x01, "Keyboard" }, { 0x02, "Mouse" }, { 0x03, "Joystick" }, { 0x04, "Trackball" }, { 0x05, "Gaming controller" }, { 0x06, "Remote" }, { 0x07, "Touchscreen" }, { 0x08, "Biometric reader" }, { 0x09, "Barcode reader" }, { 0, NULL } }; static const value_string eapwps_tlv_printers_scanners_faxes_copiers_subcategory[] = { { 0x01, "Printer or Print Server" }, { 0x02, "Scanner" }, { 0x03, "Fax" }, { 0x04, "Copier" }, { 0x05, "All-in-one (Printer, Scanner, Fax, Copier)" }, { 0, NULL } }; static const value_string eapwps_tlv_camera_subcategory[] = { { 0x01, "Digital Still Camera" }, { 0x02, "Video Camera" }, { 0x03, "Web Camera" }, { 0x04, "Security Camera" }, { 0, NULL } }; static const value_string eapwps_tlv_storage_subcategory[] = { { 0x01, "NAS" }, { 0, NULL } }; static const value_string eapwps_tlv_network_infrastructure_subcategory[] = { { 0x01, "AP" }, { 0x02, "Router" }, { 0x03, "Switch" }, { 0x04, "Gateway" }, { 0x05, "Bridge" }, { 0, NULL } }; static const value_string eapwps_tlv_displays_subcategory[] = { { 0x01, "Television" }, { 0x02, "Electronic Picture Frame" }, { 0x03, "Projector" }, { 0x04, "Monitor" }, { 0, NULL } }; static const value_string eapwps_tlv_multimedia_devices_subcategory[] = { { 0x01, "DAR" }, { 0x02, "PVR" }, { 0x03, "MCX" }, { 0x04, "Set-top box" }, { 0x05, "Media Server/Media Adapter/Media Extender" }, { 0x06, "Portable Video Player" }, { 0, NULL } }; static const value_string eapwps_tlv_gaming_devices_subcategory[] = { { 0x01, "Xbox" }, { 0x02, "Xbox360" }, { 0x03, "Playstation" }, { 0x04, "Game Console/Game Console Adapter" }, { 0x05, "Portable Gaming Device" }, { 0, NULL } }; static const value_string eapwps_tlv_telephone_subcategory[] = { { 0x01, "Windows Mobile" }, { 0x02, "Phone - single mode" }, { 0x03, "Phone - dual mode" }, { 0x04, "Smartphone - single mode" }, { 0x05, "Smartphone - dual mode" }, { 0, NULL } }; static const value_string eapwps_tlv_audio_devices_subcategory[] = { { 0x01, "Audio tuner/receiver" }, { 0x02, "Speakers" }, { 0x03, "Portable Music Player (PMP)" }, { 0x04, "Headset (headphones + microphone)" }, { 0x05, "Headphones" }, { 0x06, "Microphone" }, { 0x07, "Home Theater Systems" }, { 0, NULL } }; static void add_wps_wfa_ext(guint8 id, proto_tree *tree, tvbuff_t *tvb, int offset, gint size) { proto_item *item; proto_tree *elem; guint8 val8; static int * const flags[] = { &hf_multi_ap_backhaul_sta, &hf_multi_ap_backhaul_bss, &hf_multi_ap_fronthaul_bss, &hf_multi_ap_teardown_bsses, &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed, &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed, &hf_multi_ap_reserved, NULL }; elem = proto_tree_add_subtree(tree, tvb, offset - 2, 2 + size, ett_wps_wfa_ext, &item, val_to_str(id, eapwps_wfa_ext_types, "Unknown (%u)")); proto_tree_add_item(elem, hf_eapwps_wfa_ext_id, tvb, offset - 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(elem, hf_eapwps_wfa_ext_len, tvb, offset - 1, 1, ENC_BIG_ENDIAN); switch (id) { case WPS_WFA_EXT_VERSION2: val8 = tvb_get_guint8(tvb, offset); proto_item_append_text(item, ": %d.%d", val8 >> 4, val8 & 0x0f); proto_tree_add_item(elem, hf_eapwps_wfa_ext_version2, tvb, offset, 1, ENC_BIG_ENDIAN); break; case WPS_WFA_EXT_AUTHORIZEDMACS: proto_tree_add_item(elem, hf_eapwps_wfa_ext_authorizedmacs, tvb, offset, size, ENC_NA); break; case WPS_WFA_EXT_NETWORK_KEY_SHAREABLE: val8 = tvb_get_guint8(tvb, offset); proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE"); proto_tree_add_item(elem, hf_eapwps_wfa_ext_network_key_shareable, tvb, offset, 1, ENC_BIG_ENDIAN); break; case WPS_WFA_EXT_REQUEST_TO_ENROLL: val8 = tvb_get_guint8(tvb, offset); proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE"); proto_tree_add_item(elem, hf_eapwps_wfa_ext_request_to_enroll, tvb, offset, 1, ENC_BIG_ENDIAN); break; case WPS_WFA_EXT_SETTINGS_DELAY_TIME: val8 = tvb_get_guint8(tvb, offset); proto_item_append_text(item, ": %d second(s)", val8); proto_tree_add_item(elem, hf_eapwps_wfa_ext_settings_delay_time, tvb, offset, 1, ENC_BIG_ENDIAN); break; case WPS_WFA_EXT_MULTI_AP: proto_tree_add_bitmask(elem, tvb, offset, hf_multi_ap_flags, ett_multi_ap_flags, flags, ENC_NA); offset++; break; case WPS_WFA_EXT_MULTI_AP_PROFILE: proto_tree_add_item(elem, hf_multi_ap_profiles, tvb, offset, 1, ENC_BIG_ENDIAN); break; case WPS_WFA_EXT_MULTI_AP_8021Q: proto_tree_add_item(elem, hf_multi_ap_8021q, tvb, offset, 2, ENC_LITTLE_ENDIAN); break; default: break; } } static void dissect_wps_wfa_ext(proto_tree *tree, tvbuff_t *tvb, int offset, gint size) { int pos = offset; int end = offset + size; guint8 id, len; while (pos + 2 < end) { id = tvb_get_guint8(tvb, pos); len = tvb_get_guint8(tvb, pos + 1); if ((pos + 2 + len) > end) break; pos += 2; add_wps_wfa_ext(id, tree, tvb, pos, len); pos += len; } } static int dissect_wps_wfa_ext_via_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { gint size = tvb_reported_length(tvb); dissect_wps_wfa_ext(tree, tvb, 0, size); return size; } static void dissect_wps_vendor_ext(proto_tree *tree, tvbuff_t *tvb, int offset, gint size) { guint32 vendor_id; if (size < 3) return; vendor_id = tvb_get_ntoh24(tvb, offset); proto_tree_add_item(tree, hf_eapwps_vendor_id, tvb, offset, 3, ENC_BIG_ENDIAN); if (vendor_id == VENDOR_WIFI_ALLIANCE) dissect_wps_wfa_ext(tree, tvb, offset + 3, size - 3); } /* ********************************************************************** */ /* pinfo may be NULL ! */ /* ********************************************************************** */ void dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset, gint size, packet_info *pinfo) { static const char *fmt_warn_too_long = "Value too long (max. %d)"; static const char *fmt_length_warn = "Value length not %d"; guint tlv_len; guint16 tlv_type; proto_item *tlv_item = NULL; /* the root item */ proto_tree *tlv_root = NULL; proto_item *tmp_item = NULL; int hfindex = -1; while(size > 0) { /* incomplete tlv-entry case */ if (size < 4) { if ((tmp_item != NULL) && pinfo) expert_add_info(pinfo, tmp_item, &ei_eapwps_packet_too_short); break; } tmp_item = NULL; tlv_type = tvb_get_ntohs(tvb, offset); tlv_len = tvb_get_ntohs(tvb, offset+2); /* TOP Node for each TLV-item */ tlv_root = proto_tree_add_subtree_format(eap_tree, tvb, offset, tlv_len+4, ett_wps_tlv, &tlv_item, "Unknown Type (0x%04x)", tlv_type); /* analog to Tagged parameters in 802.11 */ proto_tree_add_item(tlv_root, hf_eapwps_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_len, tvb, offset+2, 2, ENC_BIG_ENDIAN); switch(tlv_type) { case WPS_TLV_TYPE_AP_CHANNEL: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_channel, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_ap_channel; break; case WPS_TLV_TYPE_ASSOCIATION_STATE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_association_state, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_association_state; break; case WPS_TLV_TYPE_AUTHENTICATION_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_authentication_type; break; case WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_authentication_type_flags; proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_open, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpapsk, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_shared, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2psk, tvb, offset+4, 2, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_AUTHENTICATOR: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authenticator, tvb, offset+4, 8, ENC_NA); hfindex = hf_eapwps_tlv_authenticator; proto_item_append_text(tmp_item, " (1st 64 bits of HMAC)"); break; case WPS_TLV_TYPE_CONFIG_METHODS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_config_methods; proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_CONFIGURATION_ERROR: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_configuration_error, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_configuration_error; break; case WPS_TLV_TYPE_CONFIRMATION_URL4: /* max len is 64 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url4, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_confirmation_url4; if (tlv_len > 64) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_CONFIRMATION_URL6: /* max len is 76 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url6, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_confirmation_url6; if (tlv_len > 76) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_CONNECTION_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_connection_type; break; case WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_connection_type_flags; proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ess, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ibss, tvb, offset+4, 1, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_CREDENTIAL: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_credential, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_credential; break; case WPS_TLV_TYPE_DEVICE_NAME: /* len <= 32, check ! */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_name, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_device_name; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_DEVICE_PASSWORD_ID: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_password_id, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_device_password_id; break; case WPS_TLV_TYPE_E_HASH1: /* assert tlv_len == 32 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash1, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_e_hash1; if ((tlv_len != 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32); break; case WPS_TLV_TYPE_E_HASH2: /* assert tlv_len == 32 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash2, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_e_hash2; if ((tlv_len != 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32); break; case WPS_TLV_TYPE_E_SNONCE1: /* assert tlv_len == 16 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce1, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_e_snonce1; if ((tlv_len != 16) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16); break; case WPS_TLV_TYPE_E_SNONCE2: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce2, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_e_snonce2; if ((tlv_len != 16) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16); break; case WPS_TLV_TYPE_ENCRYPTED_SETTINGS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encrypted_settings, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_encrypted_settings; break; case WPS_TLV_TYPE_ENCRYPTION_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_encryption_type; break; case WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_encryption_type_flags; proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_none, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_wep, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_tkip, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_aes, tvb, offset+4, 2, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_ENROLLEE_NONCE: /* assert tlv_len == 16 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_enrollee_nonce, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_enrollee_nonce; if ((tlv_len != 16) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16); break; case WPS_TLV_TYPE_FEATURE_ID: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_feature_id, tvb, offset+4, 4, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_feature_id; break; case WPS_TLV_TYPE_IDENTITY: /* check that tlv_len <= 80 */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_identity; if ((tlv_len > 80) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_IDENTITY_PROOF: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity_proof, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_identity_proof; break; case WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_wrap_authenticator, tvb, offset+4, 8, ENC_NA); hfindex = hf_eapwps_tlv_key_wrap_authenticator; break; case WPS_TLV_TYPE_KEY_IDENTIFIER: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_identifier, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_key_identifier; break; case WPS_TLV_TYPE_MAC_ADDRESS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_mac_address, tvb, offset+4, 6, ENC_NA); hfindex = hf_eapwps_tlv_mac_address; break; case WPS_TLV_TYPE_MANUFACTURER: /* check tlv_len <= 64 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_manufacturer, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_manufacturer; if ((tlv_len > 64) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_MESSAGE_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_message_type; if ((pinfo != NULL)) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(tvb_get_guint8(tvb, offset+4), eapwps_tlv_message_type_vals, "Unknown (0x%02x)")); break; case WPS_TLV_TYPE_MODEL_NAME: /* check tlv_len <= 32 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_name, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_model_name; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_MODEL_NUMBER: /* check tlv_len <= 32 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_number, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_model_number; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_NETWORK_INDEX: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_index, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_network_index; break; case WPS_TLV_TYPE_NETWORK_KEY: /* check tlv_len <= 64 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_network_key; if ((tlv_len > 64) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_NETWORK_KEY_INDEX: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key_index, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_network_key_index; break; case WPS_TLV_TYPE_NEW_DEVICE_NAME: /* check tlv_len <= 32 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_device_name, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_new_device_name; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_NEW_PASSWORD: /* check tlv_len <= 64 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_password, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_new_password; if ((tlv_len > 64) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_OOB_DEVICE_PASSWORD: /* check tlv_len <= 56 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_oob_device_password, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_oob_device_password; if ((tlv_len > 56) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_OS_VERSION: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_os_version, tvb, offset+4, 4, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_os_version; break; case WPS_TLV_TYPE_POWER_LEVEL: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_power_level, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_power_level; break; case WPS_TLV_TYPE_PSK_CURRENT: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_current, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_psk_current; break; case WPS_TLV_TYPE_PSK_MAX: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_max, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_psk_max; break; case WPS_TLV_TYPE_PUBLIC_KEY: /* check tlv_len == 192 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key, tvb, offset+4, 192, ENC_NA); hfindex = hf_eapwps_tlv_public_key; if ((tlv_len != 192) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 192); break; case WPS_TLV_TYPE_RADIO_ENABLED: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_radio_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_radio_enabled; break; case WPS_TLV_TYPE_REBOOT: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_reboot, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_reboot; break; case WPS_TLV_TYPE_REGISTRAR_CURRENT: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_current, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_registrar_current; break; case WPS_TLV_TYPE_REGISTRAR_ESTABLISHED: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_established, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_registrar_established; break; case WPS_TLV_TYPE_REGISTRAR_LIST: /* NYI: list is */ /* - 16 bytes uuid */ /* - NULL-Terminated device name string */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_list, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_registrar_list; break; case WPS_TLV_TYPE_REGISTRAR_MAX: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_max, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_registrar_max; break; case WPS_TLV_TYPE_REGISTRAR_NONCE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_nonce, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_registrar_nonce; break; case WPS_TLV_TYPE_REQUEST_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_request_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_request_type; break; case WPS_TLV_TYPE_RESPONSE_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_response_type, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_response_type; break; case WPS_TLV_TYPE_RF_BANDS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rf_bands, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_rf_bands; break; case WPS_TLV_TYPE_R_HASH1: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash1, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_r_hash1; break; case WPS_TLV_TYPE_R_HASH2: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash2, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_r_hash2; break; case WPS_TLV_TYPE_R_SNONCE1: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce1, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_r_snonce1; break; case WPS_TLV_TYPE_R_SNONCE2: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce2, tvb, offset+4, 16, ENC_NA); hfindex = hf_eapwps_tlv_r_snonce2; break; case WPS_TLV_TYPE_SELECTED_REGISTRAR: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_selected_registrar; break; case WPS_TLV_TYPE_SERIAL_NUMBER: /* check tlv_len <= 32 bytes */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_serial_number, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_serial_number; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_wifi_protected_setup_state, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_wifi_protected_setup_state; break; case WPS_TLV_TYPE_SSID: /* check tlv_len <= 32 bytes */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ssid, tvb, offset+4, tlv_len, ENC_ASCII); hfindex = hf_eapwps_tlv_ssid; if ((tlv_len > 32) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_TOTAL_NETWORKS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_total_networks, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_total_networks; break; case WPS_TLV_TYPE_UUID_E: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_e, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_uuid_e; if ((tlv_len > 16) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_UUID_R: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_r, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_uuid_r; if ((tlv_len > 16) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_VENDOR_EXTENSION: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_vendor_extension, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_vendor_extension; break; case WPS_TLV_TYPE_VERSION: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_version, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_version; break; case WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate_request, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_x509_certificate_request; break; case WPS_TLV_TYPE_X509_CERTIFICATE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_x509_certificate; break; case WPS_TLV_TYPE_EAP_IDENTITY: /* check tlv_len <= 64 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_identity, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_eap_identity; if ((tlv_len > 64) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_MESSAGE_COUNTER: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_counter, tvb, offset+4, 8, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_message_counter; break; case WPS_TLV_TYPE_PUBLIC_KEY_HASH: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key_hash, tvb, offset+4, 20, ENC_NA); hfindex = hf_eapwps_tlv_public_key_hash; break; case WPS_TLV_TYPE_REKEY_KEY: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rekey_key, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_rekey_key; break; case WPS_TLV_TYPE_KEY_LIFETIME: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_lifetime, tvb, offset+4, 4, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_key_lifetime; break; case WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_permitted_config_methods; proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_selected_registrar_config_methods; proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN); break; case WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type, tvb, offset+4, 8, ENC_NA); hfindex = hf_eapwps_tlv_primary_device_type; if (tvb_get_ntohl(tvb, offset+6) == WFA_OUI) { guint16 dev_cat = tvb_get_ntohs(tvb, offset+4); if ((dev_cat > 0) && (dev_cat <= WPS_DEVICE_TYPE_CATEGORY_MAX)) { proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_category, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_subcategory[dev_cat-1], tvb, offset+10, 2, ENC_BIG_ENDIAN); } } break; case WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST: /* check tlv_len <= 128 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_secondary_device_type_list, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_secondary_device_type_list; if ((tlv_len > 128) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_PORTABLE_DEVICE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_portable_device, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_portable_device; break; case WPS_TLV_TYPE_AP_SETUP_LOCKED: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_setup_locked, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_ap_setup_locked; break; case WPS_TLV_TYPE_APPLICATION_EXTENSION: /* check tlv_len <= 512 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_application_extension, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_application_extension; if ((tlv_len > 512) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_EAP_TYPE: /* check tlv_len <= 8 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_type, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_eap_type; if ((tlv_len > 8) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_INITIALIZATION_VECTOR: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_initialization_vector, tvb, offset+4, 32, ENC_NA); hfindex = hf_eapwps_tlv_initialization_vector; break; case WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_provided_automatically, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_key_provided_automatically; break; case WPS_TLV_TYPE_8021X_ENABLED: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_8021x_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_8021x_enabled; break; case WPS_TLV_TYPE_APPSESSIONKEY: /* check tlv_len <= 128 byte */ tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_appsessionkey, tvb, offset+4, tlv_len, ENC_NA); hfindex = hf_eapwps_tlv_appsessionkey; if ((tlv_len > 128) && pinfo) expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len); break; case WPS_TLV_TYPE_WEPTRANSMITKEY: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_weptransmitkey, tvb, offset+4, 1, ENC_BIG_ENDIAN); hfindex = hf_eapwps_tlv_weptransmitkey; break; case WPS_TLV_TYPE_REQUESTED_DEV_TYPE: tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_requested_dev_type, tvb, offset + 4, 8, ENC_NA); hfindex = hf_eapwps_tlv_requested_dev_type; break; default: /* do something useful ? */ tmp_item = NULL; hfindex = -1; } if ((tmp_item != NULL) && (tlv_item != NULL)) { /* make the tree look nicer :-) tmp_item -> a proto_item specific to the _value_ tlv_item -> root-item grouping - "Data Element Type" - "Date Element Length" - tmp_item */ guint32 value = -1; void *valuep = NULL; header_field_info *hf_info = NULL; const char *fmt = NULL; proto_item_set_text(tlv_item, "%s", val_to_str(tlv_type, eapwps_tlv_types, "Unknown (0x%04x)")); /* Rendered strings for value. Thanks to Stig Bjorlykke */ hf_info = proto_registrar_get_nth(hfindex); if (hf_info != NULL) { switch(hf_info->type) { case FT_UINT8: fmt = hf_info->strings ? ": %s (0x%02x)": ": 0x%02x"; value = tvb_get_guint8 (tvb, offset+4); break; case FT_UINT16: fmt = hf_info->strings ? ": %s (0x%04x)": ": 0x%04x"; value = tvb_get_ntohs (tvb, offset+4); break; case FT_UINT32: fmt = hf_info->strings ? ": %s (0x%08x)": ": 0x%08x"; value = tvb_get_ntohl (tvb, offset+4); break; case FT_STRING: fmt = ": %s"; valuep = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, tlv_len, ENC_ASCII); break; default: /* make compiler happy */ break; } } if ((hf_info != NULL) && hf_info->strings) { /* item has value_string */ proto_item_append_text(tlv_item, fmt, val_to_str(value, (const value_string *)hf_info->strings, "Unknown: %d"), value); } else if (valuep != NULL) { /* the string-case */ proto_item_append_text(tlv_item, fmt, valuep); } else if (fmt != NULL) { /* field is FT_UINT(8|16|32) but has no value_string */ proto_item_append_text(tlv_item, fmt, value); } else { /* field is either FT_ETHER or FT_BYTES, don't do anything */ } } if (tlv_type == WPS_TLV_TYPE_VENDOR_EXTENSION) dissect_wps_vendor_ext(tlv_root, tvb, offset + 4, tlv_len); offset += tlv_len + 2 + 2; size -= tlv_len + 2 + 2; } } /********************************************************************** */ /********************************************************************** */ static int dissect_wps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *pi; proto_tree *pt; guint8 flags; int offset; gint size; offset = 0; size = tvb_captured_length(tvb); pi = proto_tree_add_item(tree, hf_eapwps_opcode, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; size -= 1; pi = proto_item_get_parent(pi); if (pi != NULL) proto_item_append_text(pi, " (Wifi Alliance, WifiProtectedSetup)"); if (pinfo != NULL) col_append_str(pinfo->cinfo, COL_INFO, ", WPS"); /* Flag field, if msg-len flag set, add appropriate field */ flags = tvb_get_guint8(tvb,offset); pi = proto_tree_add_item(tree, hf_eapwps_flags, tvb, offset, 1, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_eap_wps_flags); proto_tree_add_item(pt, hf_eapwps_flag_mf, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(pt, hf_eapwps_flag_lf, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; size -= 1; if (flags & MASK_WSC_FLAG_LF) { /* length field is present in first eap-packet when msg is fragmented */ proto_tree_add_item(tree, hf_eapwps_msglen, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; size -= 2; } dissect_wps_tlvs(tree, tvb, offset, size, pinfo); return size; } /********************************************************************** */ /********************************************************************** */ void proto_register_wps(void) { static hf_register_info hf[] = { /* These data-elements are sent in EAP-Pakets using expanded types */ /* (see RFC3748 Section 5.7) */ /* Paket dissections is done here and not in (packet-eap) as */ /* both (tlvs and fields named eap.wps.*) are defined by */ /* WifiAlliance */ { &hf_eapwps_opcode, { "Opcode", "eap.wps.code", FT_UINT8, BASE_DEC, VALS(eapwps_opcode_vals), 0x0, "WSC Message Type", HFILL }}, { &hf_eapwps_flags, { "Flags", "eap.wps.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_flag_mf, { "More flag", "eap.wps.flags.more", FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_MF, NULL, HFILL }}, { &hf_eapwps_flag_lf, { "Length field present", "eap.wps.flags.length", FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_LF, NULL, HFILL }}, { &hf_eapwps_msglen, { "Length field", "eap.wps.msglen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, /* TLV encoded data which may be contained in */ /* 802.11 Management frames and EAP-extended type */ { &hf_eapwps_tlv_type, { "Data Element Type", "wps.type", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_types), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_len, { "Data Element Length", "wps.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_ap_channel, { "AP Channel", "wps.ap_channel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_association_state, { "Association State", "wps.association_state", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_association_state_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type, { "Authentication Type", "wps.authentication_type", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_authentication_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags, { "Authentication Type Flags", "wps.authentication_type_flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_open, { "Open", "wps.authentication_type.open", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_OPEN, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_wpapsk, { "WPA PSK", "wps.authentication_type.wpapsk", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPAPSK, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_shared, { "Shared", "wps.authentication_type.shared", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_SHARED, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_wpa, { "WPA", "wps.authentication_type.wpa", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_wpa2, { "WPA2", "wps.authentication_type.wpa2", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2, NULL, HFILL }}, { &hf_eapwps_tlv_authentication_type_flags_wpa2psk, { "WPA2PSK", "wps.authentication_type.wpa2psk", FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2PSK, NULL, HFILL }}, { &hf_eapwps_tlv_authenticator, { "Authenticator", "wps.authenticator", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods, { "Configuration Methods", "wps.config_methods", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_usba, { "USB", "wps.config_methods.usba", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_ethernet, { "Ethernet", "wps.config_methods.ethernet", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_label, { "Label", "wps.config_methods.label", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_display, { "Display", "wps.config_methods.display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_virt_display, { "Virtual Display", "wps.config_methods.virt_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_phy_display, { "Physical Display", "wps.config_methods.phy_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_nfcext, { "External NFC", "wps.config_methods.nfcext", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_nfcint, { "Internal NFC", "wps.config_methods.nfcint", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_nfcinf, { "NFC Interface", "wps.config_methods.nfcinf", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_pushbutton, { "Push Button", "wps.config_methods.pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_virt_pushbutton, { "Virtual Push Button", "wps.config_methods.virt_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_phy_pushbutton, { "Physical Push Button", "wps.config_methods.phy_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_config_methods_keypad, { "Keypad", "wps.config_methods.keypad", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }}, { &hf_eapwps_tlv_configuration_error, { "Configuration Error", "wps.configuration_error", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_configuration_error_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_confirmation_url4, { "Confirmation URL4", "wps.confirmation_url4", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_confirmation_url6, { "Confirmation URL6", "wps.confirmation_url6", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_connection_type, { "Connection Type", "wps.connection_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_connection_type_flags, { "Connection Types", "wps.connection_type_flags", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_connection_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_connection_type_flags_ess, { "ESS", "wps.connection_type_flags.ess", FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_ESS, NULL, HFILL }}, { &hf_eapwps_tlv_connection_type_flags_ibss, { "IBSS", "wps.connection_type_flags.ibss", FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_IBSS, NULL, HFILL }}, { &hf_eapwps_tlv_credential, /* Encrypted */ { "Credential", "wps.credential", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_device_name, { "Device Name", "wps.device_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_device_password_id, { "Device Password ID", "wps.device_password_id", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_device_password_id_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_e_hash1, { "Enrollee Hash 1", "wps.e_hash1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_e_hash2, { "Enrollee Hash 2", "wps.e_hash2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_e_snonce1, { "Enrollee SNounce 1", "wps.e_snonce1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_e_snonce2, { "Enrollee SNounce 2", "wps.e_snonce2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_encrypted_settings, /* Encrypted ! */ { "Encrypted Settings", "wps.encrypted_settings", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type, { "Encryption Type", "wps.encryption_type", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_encryption_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type_flags, { "Encryption Type Flags", "wps.encryption_type_flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type_flags_none, { "None", "wps.encryption_type_flags.none", FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_NONE, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type_flags_wep, { "WEP", "wps.encryption_type_flags.wep", FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_WEP, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type_flags_tkip, { "TKIP", "wps.encryption_type_flags.tkip", FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_TKIP, NULL, HFILL }}, { &hf_eapwps_tlv_encryption_type_flags_aes, { "AES", "wps.encryption_type_flags.aes", FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_AES, NULL, HFILL }}, { &hf_eapwps_tlv_enrollee_nonce, { "Enrollee Nonce", "wps.enrollee_nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_feature_id, { "Feature ID", "wps.feature_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_identity, { "Identity", "wps.identity", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_identity_proof, /* Encrypted ! */ { "Identity Proof", "wps.identity_proof", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_key_wrap_authenticator, { "Key Wrap Authenticator", "wps.key_wrap_authenticator", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_key_identifier, { "Key Identifier", "wps.key_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_mac_address, { "MAC", "wps.mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_manufacturer, { "Manufacturer", "wps.manufacturer", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_message_type, { "Message Type", "wps.message_type", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_message_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_model_name, { "Model Name", "wps.model_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_model_number, { "Model Number", "wps.model_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_network_index, { "Network Index", "wps.network_index", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_network_key, { "Network Key", "wps.network_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_network_key_index, { "Network Key Index", "wps.network_key_index", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_new_device_name, { "New Device Name", "wps.new_device_name", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_new_password, { "New Password", "wps.new_password", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_oob_device_password, { "OOB Device Password", "wps.oob_device_password", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_os_version, { "OS Version", "wps.os_version", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_power_level, { "Power Level", "wps.power_level", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_psk_current, { "PSK Current", "wps.psk_current", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_psk_max, { "PSK Max", "wps.psk_max", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_public_key, { "Public Key", "wps.public_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_radio_enabled, /* Add info */ { "Radio Enabled", "wps.radio_enabled", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_reboot, /* Add info */ { "Reboot", "wps.reboot", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_registrar_current, { "Registrar current", "wps.registrar_current", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_registrar_established, /* Add info */ { "Registrar established", "wps.registrar_established", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_registrar_list, { "Registrar list", "wps.registrar_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_registrar_max, { "Registrar max", "wps.registrar_max", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_registrar_nonce, { "Registrar Nonce", "wps.registrar_nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_request_type, { "Request Type", "wps.request_type", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_request_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_response_type, { "Response Type", "wps.response_type", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_response_type_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_rf_bands, { "RF Bands", "wps.rf_bands", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_rf_bands_vals), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_r_hash1, { "Registrar Hash 1", "wps.r_hash1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_r_hash2, { "Registrar Hash 2", "wps.r_hash2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_r_snonce1, { "Registrar Snonce1", "wps.r_snonce1", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_r_snonce2, { "Registrar Snonce 2", "wps.r_snonce2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar, { "Selected Registrar", "wps.selected_registrar", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_serial_number, { "Serial Number", "wps.serial_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_wifi_protected_setup_state, { "Wifi Protected Setup State", "wps.wifi_protected_setup_state", FT_UINT8, BASE_HEX, VALS(eapwps_tlv_wifi_protected_setup_state), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_ssid, { "SSID", "wps.ssid", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_total_networks, { "Total Networks", "wps.total_networks", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_uuid_e, { "UUID Enrollee", "wps.uuid_e", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_uuid_r, { "UUID Registrar", "wps.uuid_r", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_vendor_extension, { "Vendor Extension", "wps.vendor_extension", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_version, { "Version", "wps.version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_x509_certificate_request, { "X509 Certificate Request", "wps.x509_certificate_request", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_x509_certificate, { "X509 Certificate", "wps.x509_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_eap_identity, { "EAP Identity", "wps.eap_identity", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_message_counter, { "Message Counter", "wps.message_counter", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_public_key_hash, { "Public Key Hash", "wps.public_key_hash", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_rekey_key, { "Rekey Key", "wps.rekey_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_key_lifetime, { "Key Lifetime", "wps.key_lifetime", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods, { "Permitted COnfig Methods", "wps.permitted_config_methods", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_usba, { "USB", "wps.permitted_config_methods.usba", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_ethernet, { "Ethernet", "wps.permitted_config_methods.ethernet", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_label, { "Label", "wps.permitted_config_methods.label", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_display, { "Display", "wps.permitted_config_methods.display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_virt_display, { "Virtual Display", "wps.permitted_config_methods.virt_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_phy_display, { "Physical Display", "wps.permitted_config_methods.phy_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_nfcext, { "External NFC", "wps.permitted_config_methods.nfcext", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_nfcint, { "Internal NFC", "wps.permitted_config_methods.nfcint", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_nfcinf, { "NFC Interface", "wps.permitted_config_methods.nfcinf", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_pushbutton, { "Push Button", "wps.permitted_config_methods.pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_virt_pushbutton, { "Virtual Push Button", "wps.permitted_config_methods.virt_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_phy_pushbutton, { "Physical Push Button", "wps.permitted_config_methods.phy_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_permitted_config_methods_keypad, { "Keypad", "wps.permitted_config_methods.keypad", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods, { "Selected Registrar Config Methods", "wps.selected_registrar_config_methods", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_usba, { "USB", "wps.selected_registrar_config_methods.usba", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_ethernet, { "Ethernet", "wps.selected_registrar_config_methods.ethernet", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_label, { "Label", "wps.selected_registrar_config_methods.label", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_display, { "Display", "wps.selected_registrar_config_methods.display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_virt_display, { "Virtual Display", "wps.selected_registrar_config_methods.virt_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_phy_display, { "Physical Display", "wps.selected_registrar_config_methods.phy_display", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_nfcext, { "External NFC", "wps.selected_registrar_config_methods.nfcext", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_nfcint, { "Internal NFC", "wps.selected_registrar_config_methods.nfcint", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_nfcinf, { "NFC Interface", "wps.selected_registrar_config_methods.nfcinf", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_pushbutton, { "Push Button", "wps.selected_registrar_config_methods.pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton, { "Virtual Push Button", "wps.selected_registrar_config_methods.virt_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton, { "Physical Push Button", "wps.selected_registrar_config_methods.phy_pushbutton", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }}, { &hf_eapwps_tlv_selected_registrar_config_methods_keypad, { "Keypad", "wps.selected_registrar_config_methods.keypad", FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type, { "Primary Device Type", "wps.primary_device_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_category, { "Category", "wps.primary_device_type.category", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_primary_device_type_category), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[0], { "Subcategory", "wps.primary_device_type.subcategory_computer", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_computer_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[1], { "Subcategory", "wps.primary_device_type.subcategory_input_device", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_input_device_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[2], { "Subcategory", "wps.primary_device_type.subcategory_printers_scanners_faxes_copiers", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_printers_scanners_faxes_copiers_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[3], { "Subcategory", "wps.primary_device_type.subcategory_camera", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_camera_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[4], { "Subcategory", "wps.primary_device_type.subcategory_storage", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_storage_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[5], { "Subcategory", "wps.primary_device_type.subcategory_network_infrastructure", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_network_infrastructure_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[6], { "Subcategory", "wps.primary_device_type.subcategory_displays", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_displays_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[7], { "Subcategory", "wps.primary_device_type.subcategory_multimedia_devices", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_multimedia_devices_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[8], { "Subcategory", "wps.primary_device_type.subcategory_gaming_devices", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_gaming_devices_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[9], { "Subcategory", "wps.primary_device_type.subcategory_telephone", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_telephone_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_primary_device_type_subcategory[10], { "Subcategory", "wps.primary_device_type.subcategory_audio_devices", FT_UINT16, BASE_HEX, VALS(eapwps_tlv_audio_devices_subcategory), 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_secondary_device_type_list, { "Secondary Device Type List", "wps.secondary_device_type_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_portable_device, /* Add info */ { "Portable Device", "wps.portable_device", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_ap_setup_locked, /* Add info */ { "AP Setup Locked", "wps.ap_setup_locked", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_application_extension, { "Application Extension", "wps.application_extension", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_eap_type, { "EAP Type", "wps.eap_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_initialization_vector, { "Initialization Vector", "wps.initialization_vector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_key_provided_automatically, /* Add info */ { "Key Provided Automatically", "wps.key_provided_automatically", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_8021x_enabled, /* Add info */ { "8021x Enabled", "wps.8021x_enabled", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_appsessionkey, { "AppSessionKey", "wps.appsessionkey", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_weptransmitkey, { "WEP Transmit Key", "wps.weptransmitkey", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_tlv_requested_dev_type, { "Requested Device Type", "wps.requested_dev_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_vendor_id, { "Vendor ID", "wps.vendor_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_id, { "WFA Extension Subelement ID", "wps.ext.id", FT_UINT8, BASE_DEC, VALS(eapwps_wfa_ext_types), 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_len, { "WFA Extension Subelement Length", "wps.ext.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_version2, { "Version2", "wps.ext.version2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_authorizedmacs, { "AuthorizedMACs", "wps.ext.authorizedmacs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_network_key_shareable, { "Network Key Shareable", "wps.ext.network_key_shareable", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_request_to_enroll, { "Request to Enroll", "wps.ext.request_to_enroll", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_eapwps_wfa_ext_settings_delay_time, { "Settings Delay Time", "wps.ext.settings_delay_time", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_multi_ap_backhaul_sta, { "Backhaul STA", "wps.ext.multi_ap.backhaul_sta", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80, NULL, HFILL }}, { &hf_multi_ap_backhaul_bss, { "Backhaul BSS", "wps.ext.multi_ap.backhaul_bss", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40, NULL, HFILL }}, { &hf_multi_ap_fronthaul_bss, { "Fronthaul BSS", "wps.ext.multi_ap.fronthaul_bss", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20, NULL, HFILL }}, { &hf_multi_ap_teardown_bsses, { "Teardown", "wps.ext.multi_ap.teardown", FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x10, NULL, HFILL }}, { &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed, { "Profile-1 Backhaul STA association disallowed", "wps.ext.multi_ap.profile1_backhaul_sta_disallowed", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL }}, { &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed, { "Profile-2 Backhaul STA association disallowed", "wps.ext.multi_ap.profile2_backhaul_sta_disallowed", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL }}, { &hf_multi_ap_reserved, { "Reserved", "wps.ext.multi_ap.reserved", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }}, { &hf_multi_ap_flags, { "Multi-AP Flags", "wps.ext.multi_ap_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_multi_ap_profiles, { "Multi-AP Profile", "wps.ext.multi_ap_profile", FT_UINT8, BASE_HEX, VALS(wps_wfa_ext_multi_ap_profiles_vals), 0x0, NULL, HFILL }}, { &hf_multi_ap_8021q, { "Primary VLAN ID", "wps.ext.primary_vlan_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_eap_wps_attr, &ett_eap_wps_flags, /* EAP WPS */ &ett_wps_tlv, &ett_eap_wps_ap_channel, &ett_eap_wps_association_state, &ett_eap_wps_authentication_type, &ett_eap_wps_authentication_type_flags, &ett_eap_wps_authenticator, &ett_eap_wps_config_methods, &ett_eap_wps_configuration_error, &ett_eap_wps_confirmation_url4, &ett_eap_wps_confirmation_url6, &ett_eap_wps_connection_type, &ett_eap_wps_connection_type_flags, &ett_eap_wps_credential, &ett_eap_wps_device_name, &ett_eap_wps_device_password_id, &ett_eap_wps_e_hash1, &ett_eap_wps_e_hash2, &ett_eap_wps_e_snonce1, &ett_eap_wps_e_snonce2, &ett_eap_wps_encrypted_settings, &ett_eap_wps_encryption_type, &ett_eap_wps_encryption_type_flags, &ett_eap_wps_enrollee_nonce, &ett_eap_wps_feature_id, &ett_eap_wps_identity, &ett_eap_wps_identity_proof, &ett_eap_wps_key_wrap_authenticator, &ett_eap_wps_key_identifier, &ett_eap_wps_mac_address, &ett_eap_wps_manufacturer, &ett_eap_wps_message_type, &ett_eap_wps_model_name, &ett_eap_wps_model_number, &ett_eap_wps_network_index, &ett_eap_wps_network_key, &ett_eap_wps_network_key_index, &ett_eap_wps_new_device_name, &ett_eap_wps_new_password, &ett_eap_wps_oob_device_password, &ett_eap_wps_os_version, &ett_eap_wps_power_level, &ett_eap_wps_psk_current, &ett_eap_wps_psk_max, &ett_eap_wps_public_key, &ett_eap_wps_radio_enabled, &ett_eap_wps_reboot, &ett_eap_wps_registrar_current, &ett_eap_wps_registrar_established, &ett_eap_wps_registrar_list, &ett_eap_wps_registrar_max, &ett_eap_wps_registrar_nonce, &ett_eap_wps_request_type, &ett_eap_wps_response_type, &ett_eap_wps_rf_bands, &ett_eap_wps_r_hash1, &ett_eap_wps_r_hash2, &ett_eap_wps_r_snonce1, &ett_eap_wps_r_snonce2, &ett_eap_wps_selected_registrar, &ett_eap_wps_serial_number, &ett_eap_wps_wifi_protected_setup_state, &ett_eap_wps_ssid, &ett_eap_wps_total_networks, &ett_eap_wps_uuid_e, &ett_eap_wps_uuid_r, &ett_eap_wps_vendor_extension, &ett_eap_wps_version, &ett_eap_wps_x509_certificate_request, &ett_eap_wps_x509_certificate, &ett_eap_wps_eap_identity, &ett_eap_wps_message_counter, &ett_eap_wps_public_key_hash, &ett_eap_wps_rekey_key, &ett_eap_wps_key_lifetime, &ett_eap_wps_permitted_config_methods, &ett_eap_wps_selected_registrar_config_methods, &ett_eap_wps_primary_device_type, &ett_eap_wps_secondary_device_type_list, &ett_eap_wps_portable_device, &ett_eap_wps_ap_setup_locked, &ett_eap_wps_application_extension, &ett_eap_wps_eap_type, &ett_eap_wps_initialization_vector, &ett_eap_wps_key_provided_automatically, &ett_eap_wps_8021x_enabled, &ett_eap_wps_appsessionkey, &ett_eap_wps_weptransmitkey, &ett_wps_wfa_ext, &ett_multi_ap_flags, }; static ei_register_info ei[] = { { &ei_eapwps_packet_too_short, { "wps.packet_too_short", PI_MALFORMED, PI_ERROR, "Packet too short", EXPFILL }}, { &ei_eapwps_fmt_warn_too_long, { "wps.length.value_too_long", PI_MALFORMED, PI_ERROR, "Value too long", EXPFILL }}, { &ei_eapwps_fmt_length_warn, { "wps.length.too_long", PI_MALFORMED, PI_ERROR, "Value length not X", EXPFILL }}, }; expert_module_t* expert_wps; proto_wps = proto_register_protocol("Wifi Protected Setup", "WPS", "wps"); proto_register_field_array(proto_wps, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wps = expert_register_protocol(proto_wps); expert_register_field_array(expert_wps, ei, array_length(ei)); wps_handle = register_dissector("wps", dissect_wps, proto_wps); } void proto_reg_handoff_wps(void) { dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_IEEE1905_MULTI_AP, create_dissector_handle(dissect_wps_wfa_ext_via_dt, -1)); dissector_add_uint("eap.ext.vendor_id", WFA_VENDOR_ID, wps_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wps.h
/* packet-wps.h * * Wifi Simple Config aka Wifi Protected Setup * * Written by Jens Braeuer using WiFi-Alliance Spec 1.0h and * parts of a patch by JP Jiang and Philippe Teuwen. November 2007 * * Spec: * https://www.wi-fi.org/knowledge_center_overview.php?type=4 * Patch: * http://wireshark.digimirror.nl/lists/wireshark-dev/200703/msg00121.html * * Copyright 2007 Jens Braeuer <[email protected]> * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * */ #ifndef _packet_wps_h_ #define _packet_wps_h_ /* Vendor-Type and Vendor-id */ #define WFA_VENDOR_ID 0x00372A #define WFA_SIMPLECONFIG_TYPE 0x1 void dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset, gint size, packet_info* pinfo); #endif
C
wireshark/epan/dissectors/packet-wreth.c
/* packet-wreth.c * Functions for the WSE Remote Ethernet Dissector * * Dissector - WSE RemoteEthernet * By Clement Marrast <[email protected]> * Copyright 2012 Clement Marrast * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #define WRETH_PORT 0xAAAA void proto_register_wreth(void); void proto_reg_handoff_wreth(void); static gint WrethIdentPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethConnectPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethDisconnectPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethBlinkyPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethGetValuePacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethSetValuePacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethBoostPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethAckPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethNackPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethMailPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree); static gint WrethMailDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree, guint8 fragmented); static gint WrethCodefMasterInfoDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethMailboxTree); static gint WrethCodefEquipmentInfoDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethMailboxTree); /* Remote ethernet sub packet type */ #define WSE_RETH_SUBTYPE 0x0200 /* Remote ethernet function code */ #define WRETH_IDENT 1 #define WRETH_CONNECT 2 #define WRETH_ACK 3 #define WRETH_NACK 4 #define WRETH_DISCONNECT 5 #define WRETH_MAIL 6 #define WRETH_BLINKY 7 #define WRETH_GET_VALUE 8 #define WRETH_SET_VALUE 9 #define WRETH_BOOST 10 /* Remote ethernet error code */ #define WRETH_BAD_FUNCTION_CODE 1 #define WRETH_ALREADY_CONNECTED 2 #define WRETH_INVALID_PROTOCOL_VERSION 3 #define WRETH_NOT_CONNECTED 4 #define WRETH_INVALID_MAC_ADDRESS 5 #define WRETH_INVALID_FRAME_SIZE 6 #define WRETH_NO_MEMORY_AVAILABLE 7 #define WRETH_BAD_PARAMETER 8 #define WRETH_TASK_REGISTERED 9 /* Initialize the protocol and registered fields */ static gint wreth_proto = -1; /* static gint wreth_mail_proto = -1; */ static int hf_Wreth_Subtype = -1; static int hf_Wreth_Size = -1; static int hf_Wreth_FunctionCode = -1; static int hf_Wreth_FrameId = -1; static int hf_Wreth_ErrorCode = -1; static int hf_Wreth_Fragmented = -1; static int hf_Wreth_Retry = -1; static int hf_Wreth_IdentificationBiosVersion = -1; static int hf_Wreth_IdentificationBoardNumber = -1; static int hf_Wreth_IdentificationProtocolVersion = -1; static int hf_Wreth_IdentificationBoardId = -1; static int hf_Wreth_IdentificationState = -1; static int hf_Wreth_IdentificationMacAddr = -1; static int hf_Wreth_ConnectProtocolVersion = -1; static int hf_Wreth_ConnectTimeout = -1; static int hf_Wreth_BlinkyPeriod = -1; static int hf_Wreth_GetValueVal = -1; static int hf_Wreth_SetValueVal = -1; static int hf_Wreth_BoostValue = -1; static int hf_Wreth_MailDestTic = -1; static int hf_Wreth_MailReserved = -1; static int hf_Wreth_Mail_Codef = -1; static int hf_Wreth_Mail_Status = -1; static int hf_Wreth_Mail_TicUser_Root = -1; static int hf_Wreth_Mail_PidUser = -1; static int hf_Wreth_Mail_Mode = -1; static int hf_Wreth_Mail_Time = -1; static int hf_Wreth_Mail_Stop = -1; static int hf_Wreth_Mail_Nfonc = -1; static int hf_Wreth_Mail_Ncard = -1; static int hf_Wreth_Mail_Nchan = -1; static int hf_Wreth_Mail_Nes = -1; static int hf_Wreth_Mail_Nb = -1; static int hf_Wreth_Mail_TypVar = -1; static int hf_Wreth_Mail_Adr = -1; static int hf_Wreth_Mail_TicUser_DispCyc = -1; static int hf_Wreth_Mail_Nb_Max_Size_Mail = -1; static int hf_Wreth_Mail_User_ThreadID = -1; static int hf_Wreth_Mail_DispCyc_Version = -1; static int hf_Wreth_Mail_DifUserParam = -1; static int hf_Wreth_Mail_Filler = -1; /* static int hf_Wreth_Mail_Data = -1; */ static int hf_Wreth_Mail_Mastinf_Version = -1; static int hf_Wreth_Mail_Mastinf_Release = -1; static int hf_Wreth_Mail_Mastinf_Protocol = -1; static int hf_Wreth_Mail_Mastinf_CyclicFlux = -1; static int hf_Wreth_Mail_Mastinf_szProtocolName = -1; static int hf_Wreth_Mail_Mastinf_MaxTypeEquipment = -1; static int hf_Wreth_Mail_Mastinf_MinEquipmentNumber = -1; static int hf_Wreth_Mail_Mastinf_MaxEquipmentNumber = -1; static int hf_Wreth_Mail_Equinf_Version = -1; static int hf_Wreth_Mail_Equinf_Release = -1; static int hf_Wreth_Mail_Equinf_Network = -1; static int hf_Wreth_Mail_Equinf_Protocol = -1; static int hf_Wreth_Mail_Equinf_Messaging = -1; static int hf_Wreth_Mail_Equinf_Equipment = -1; static int hf_Wreth_Mail_Equinf_Flux = -1; static int hf_Wreth_Mail_Equinf_IncWord = -1; static int hf_Wreth_Mail_Equinf_IncDWord = -1; static int hf_Wreth_Mail_Equinf_IncFWord = -1; static int hf_Wreth_Mail_Mastinf_DllItemName = -1; static int hf_Wreth_Mail_Mastinf_szEquipmentName = -1; static int hf_Wreth_Mail_Equinf_MaxWriteBit = -1; static int hf_Wreth_Mail_Equinf_MaxReadBit = -1; static int hf_Wreth_Mail_Equinf_BreakBit = -1; static int hf_Wreth_Mail_Equinf_MaxWriteIBit = -1; static int hf_Wreth_Mail_Equinf_MaxReadIBit = -1; static int hf_Wreth_Mail_Equinf_MaxWriteQBit = -1; static int hf_Wreth_Mail_Equinf_MaxReadQBit = -1; static int hf_Wreth_Mail_Equinf_BreakQBit = -1; static int hf_Wreth_Mail_Equinf_MaxWriteByte = -1; static int hf_Wreth_Mail_Equinf_MaxReadByte = -1; static int hf_Wreth_Mail_Equinf_BreakByte = -1; static int hf_Wreth_Mail_Equinf_MaxWriteIByte = -1; static int hf_Wreth_Mail_Equinf_MaxReadIByte = -1; static int hf_Wreth_Mail_Equinf_BreakIByte = -1; static int hf_Wreth_Mail_Equinf_MaxWriteQByte = -1; static int hf_Wreth_Mail_Equinf_MaxReadQByte = -1; static int hf_Wreth_Mail_Equinf_BreakQByte = -1; static int hf_Wreth_Mail_Equinf_MaxWriteWord = -1; static int hf_Wreth_Mail_Equinf_MaxReadWord = -1; static int hf_Wreth_Mail_Equinf_BreakWord = -1; static int hf_Wreth_Mail_Equinf_MaxWriteIWord = -1; static int hf_Wreth_Mail_Equinf_MaxReadIWord = -1; static int hf_Wreth_Mail_Equinf_BreakIWord = -1; static int hf_Wreth_Mail_Equinf_MaxWriteQWord = -1; static int hf_Wreth_Mail_Equinf_MaxReadQWord = -1; static int hf_Wreth_Mail_Equinf_BreakQWord = -1; static int hf_Wreth_Mail_Equinf_MaxWriteDWord = -1; static int hf_Wreth_Mail_Equinf_MaxReadDWord = -1; static int hf_Wreth_Mail_Equinf_BreakDWord = -1; static int hf_Wreth_Mail_Equinf_MaxWriteFWord = -1; static int hf_Wreth_Mail_Equinf_MaxReadFWord = -1; static int hf_Wreth_Mail_Equinf_BreakFWord = -1; static int hf_Wreth_Mail_Equinf_ReadFactorWord = -1; static int hf_Wreth_Mail_Equinf_ReadFactorIWord = -1; static int hf_Wreth_Mail_Equinf_ReadFactorQWord = -1; static int hf_Wreth_Mail_Equinf_ReadFactorDWord = -1; static int hf_Wreth_Mail_Equinf_ReadFactorFWord = -1; static int hf_Wreth_Mail_Equinf_WriteFactorWord = -1; static int hf_Wreth_Mail_Equinf_WriteFactorIWord = -1; static int hf_Wreth_Mail_Equinf_WriteFactorQWord = -1; static int hf_Wreth_Mail_Equinf_WriteFactorDWord = -1; static int hf_Wreth_Mail_Equinf_WriteFactorFWord = -1; static int hf_Wreth_Mail_Equinf_DataFormat = -1; static int hf_Wreth_Mail_Equinf_BreakIBit = -1; /* Initialize the subtree pointers */ static gint ett_wreth = -1; /* Note: vals are stored as unsigned 32 bit quantities */ static const value_string tabStatus[] = { { 0, "stat_ok" }, { 1, "stat_err_fonc" }, { 2, "stat_err_addr" }, { 3, "stat_bad_frame" }, { 4, "stat_lock_data" }, { 10, "STAT_QUEUE_OVERFLOW" }, { 32, "stat_par" }, { 33, "statjb_timeout" }, { 34, "statjb_crc" }, { 35, "stat_cyc_inc" }, { 36, "stat_escl_inconnu" }, { 40, "STAT_DIF_MAX_THREAD" }, { 41, "stat_dif_full" }, { 42, "stat_dif_empty" }, { 43, "STAT_NES_UNKNOWN" }, { 45, "stat_no_soft" }, { 46, "stat_conf" }, { 47, "stat_no_board" }, { 48, "stat_timeout_cts" }, { 49, "stat_timeout_wait" }, { 50, "stat_fill" }, { 51, "stat_sys" }, { 52, "stat_bug" }, { 53, "stat_sync" }, { 54, "stat_nopolling" }, { 55, "stat_badintpol" }, { 56, "stat_answer" }, { 57, "stat_no_statment" }, { 58, "stat_net_no_ready" }, { 59, "stat_key" }, { 60, "stat_no_retmail" }, { 61, "stat_no_dsr_gt4000" }, { 62, "stat_no_cts_gt4000" }, { 63, "stat_timeout_gt4000" }, { 64, "stat_bcc_gt4000" }, { 65, "STAT_NOT_CONNECT" }, { 66, "STAT_RESSOURCE" }, { 67, "STAT_ERR_PDU" }, { 68, "STAT_OBJECT_NON_EXISTENT" }, { 69, "STAT_TYPE_CONFLICT" }, { 70, "STAT_ABORT_USER" }, { 71, "STAT_ABORT_FMS" }, { 72, "STAT_ABORT_LLI" }, { 73, "STAT_ABORT_LAYER2" }, { 74, "STAT_MAX_PDU_SIZE" }, { 75, "STAT_FEATURE_NOT_SUPPORTED" }, { 76, "STAT_VERSION_INCOMPATIBLE" }, { 77, "STAT_USER_INITIATE_DENIED" }, { 78, "STAT_PASSWORD_ERROR" }, { 79, "STAT_PROFILE_INCOMPATIBLE" }, { 80, "STAT_ABORT_LLI_CONTEXT" }, { 81, "STAT_ABORT_LLI_ABT_RC2" }, { 82, "STAT_ABORT_LLI_ABT_RC3" }, { 83, "STAT_ERR_CLASS_VFD_STATE" }, { 84, "STAT_ERR_CLASS_APPLICATION_REF" }, { 85, "STAT_ERR_CLASS_DEFINITION" }, { 86, "STAT_ERR_CLASS_RESSOURCE" }, { 87, "STAT_ERR_CLASS_SERVICE" }, { 88, "STAT_ERR_CLASS_ACCESS" }, { 89, "STAT_ERR_CLASS_OD" }, { 90, "STAT_ERR_CLASS_OTHER" }, { 91, "STAT_REJECT_PDU" }, { 92, "STAT_ERR_HARDWARE" }, { 93, "STAT_DRIVER_ACCESS" }, { 94, "STAT_DRIVER_BAD_VERSION" }, { 95, "STAT_FILL_BIG_MAIL" }, { 96, "STAT_NO_TASK_VERSION" }, { 97, "STAT_DLL_LOCKED" }, { 98, "STAT_BOARD_LOCKED" }, { 99, "STAT_MODEIO_LOCKED" }, /*---- RESERVED STATUS FOR USER KIT4000 ----*/ { 100, "STAT_KIT_START" }, /* ..... */ { 127, "STAT_KIT_END" }, /*------------------------------------------*/ { 128, "STAT_ERR_NO_REMOTE_CONNECTION" }, { 129, "STAT_CONFIG_OK" }, { 130, "STAT_CONFIG_NOK" }, { 131, "STAT_DNS_PENDING" }, { 132, "STAT_DNS_ERROR" }, { 133, "STAT_OVERTIME" }, { 134, "STAT_FRAG_WRITE" }, { 135, "STAT_FRAG_READ" }, { 136, "STAT_API_ACCESS" }, { 137, "STAT_QUEUE_EMPTY" }, { 138, "STAT_QUEUE_FULL" }, { 254, "STAT_DEV_INIT" }, { 255, "STAT_NA" }, { -11, "index not updated" }, { -10, "stat_handshake" }, { -9, "stat_event_data" }, { -8, "stat_timeout_ic_read" }, { -7, "stat_timeout_read" }, { -6, "stat_cyc_stopped" }, { -5, "stat_dif_not_ready" }, { -4, "stat_unchanged" }, { -3, "stat_nes_broadcast" }, { -2, "Unknown Status" }, { -1, "stat_writedif_ok" }, { 0, NULL } }; static value_string_ext tabStatus_ext = VALUE_STRING_EXT_INIT(tabStatus); static const value_string tabCodef[] = { /* Code for monitor */ { 0x0000, "TIC_INVALID_ROOT" }, { 0x0002, "tic_monitor" }, /*Loader*/ { 0x0003, "COD_LOAD_TASK" }, { 0x0004, "COD_LOAD_TASK" }, { 0x00ff, "TIC_TASK_NON_INIT" }, /* 255 */ /* Code for monitor */ { 0x0106, "COD_MON_INFO" }, { 0x0109, "COD_GETTIC" }, { 0x0119, "COD_MON_SETTIME" }, { 0x0126, "COD_MON_SIZEMAIL" }, { 0x0127, "COD_MON_SETSYNCHRO" }, { 0x0128, "COD_MON_GETSYNCHRO" }, { 0x012A, "COD_MON_FLAG_DEBUG" }, { 0x012B, "COD_MON_SETSCADA_PT" }, { 0x012C, "COD_MON_GETSCADA_PT" }, { 0x0134, "COD_MON_SETGENVAR" }, { 0x0135, "COD_MON_GETGENVAR" }, { 0x0200, "COD_MON_READFLASHGT" }, { 0x0206, "COD_MON_SETCOMSPEED" }, { 0x020c, "COD_MON_TESTCARDTYPE" }, /*Loader*/ { 0x0400, "COD_LOAD_TASK" }, { 0x0600, "COD_RELOAD_TASK" }, /* Code for master function */ { 0x1000, "cod_initmasterline" }, { 0x1001, "cod_loadmasterconf" }, { 0x1002, "cod_masterinfo" }, { 0x1003, "cod_readpackbit" }, { 0x1004, "cod_readpackibit" }, { 0x1005, "cod_readword" }, { 0x1006, "cod_readiword" }, { 0x1007, "cod_readdword" }, { 0x1008, "cod_readfword" }, { 0x1009, "cod_writepackbit" }, { 0x100A, "cod_writeword" }, { 0x100B, "cod_writedword" }, { 0x100C, "cod_writefword" }, { 0x100D, "cod_readquickbit" }, { 0x100E, "cod_readdiag" }, { 0x100F, "cod_readeven" }, { 0x1010, "cod_readtrace" }, { 0x1011, "cod_statjbus" }, { 0x1012, "cod_creatjnet" }, { 0x1013, "cod_rijnet" }, { 0x1014, "cod_rcjnet" }, { 0x1015, "cod_writemes" }, { 0x1016, "cod_readmes" }, { 0x1017, "cod_manual" }, { 0x1018, "cod_automatic" }, { 0x1019, "cod_connect" }, { 0x101A, "cod_unconnect" }, { 0x101B, "cod_iocounter" }, { 0x101C, "cod_resetiocounter" }, { 0x101D, "codute_identequipment" }, { 0x101E, "codute_readbit_SY" }, { 0x101F, "codute_readbit_IO" }, { 0x1020, "codute_readword_CW" }, { 0x1021, "codute_readword_SW" }, { 0x1022, "codute_readword_COM" }, { 0x1023, "codute_readtempo" }, { 0x1024, "codute_readmonost_Mi" }, { 0x1025, "codute_readcounter_Ci" }, { 0x1026, "codute_readreg_Ri" }, { 0x1027, "codute_readsteps_Xi" }, { 0x1028, "codute_readdword_DW" }, { 0x1029, "codute_readdword_CDW" }, { 0x102A, "codute_readone_step" }, { 0x102B, "codute_writebit_SY" }, { 0x102C, "codute_writebit_IO" }, { 0x102D, "codute_writeword_SW" }, { 0x102E, "codute_writeword_COM" }, { 0x102F, "codute_writetimer_Ti" }, { 0x1030, "codute_writemonost_Mi" }, { 0x1031, "codute_writecounter_Ci" }, { 0x1032, "codute_writereg_Ri" }, { 0x1033, "codute_writedword_DW" }, { 0x1034, "codute_readbit_B" }, { 0x1035, "codute_readword_W" }, { 0x1036, "codute_readobjets" }, { 0x1037, "codute_readstruc_obj" }, { 0x1038, "codute_writebit_B" }, { 0x1039, "codute_writeword_W" }, { 0x103A, "codute_writestruc_obj" }, { 0x103B, "codute_no_requestdata" }, { 0x103C, "codute_prot_ver" }, { 0x103D, "codute_status" }, { 0x103E, "codute_mirror" }, { 0x103F, "codute_readerror_count" }, { 0x1040, "codute_readstation_status" }, { 0x1041, "codute_razerror_counter" }, { 0x1042, "codute_write_xgs" }, { 0x1043, "codute_stop" }, { 0x1044, "codute_run" }, { 0x1045, "codute_selftest" }, { 0x1046, "codute_init" }, { 0x1047, "codute_reserv" }, { 0x1048, "codute_unreserv" }, { 0x1049, "codute_entreserv" }, { 0x104A, "codute_initloader" }, { 0x104B, "codute_upload_seg" }, { 0x104C, "codute_end_upload_seg" }, { 0x104D, "codute_init_download" }, { 0x104E, "codute_download_seg" }, { 0x104F, "codute_end_download" }, { 0x1050, "codute_writereq_file" }, { 0x1051, "codute_readanswer_file" }, { 0x1052, "codute_exereq_file" }, { 0x1053, "codute_razreq_file" }, { 0x1054, "codute_stopdrum_DiS" }, { 0x1055, "codute_incdrum_DiS" }, { 0x1056, "codute_godrum_DiS" }, { 0x1057, "codute_readeven_DiS" }, { 0x1058, "codute_readone_DiS" }, { 0x1059, "codute_write_objet" }, { 0x105A, "cod_readpackqbit" }, { 0x105B, "cod_writepackqbit" }, { 0x105C, "cod_send_rec_txt" }, { 0x105D, "cod_iowhite" }, { 0x105E, "cod_readpackbyte" }, { 0x105F, "cod_readbyte" }, { 0x1060, "cod_writepackbyte" }, { 0x1061, "cod_writebyte" }, { 0x1062, "cod_readwordbcd" }, { 0x1063, "cod_writewordbcd" }, { 0x1064, "cod_writereadmes" }, { 0x1065, "cod_readqword" }, { 0x1066, "cod_writeqword" }, { 0x1067, "cod_writereaddifmes" }, { 0x1068, "cod_readpackibyte" }, { 0x1069, "cod_readibyte" }, { 0x106A, "cod_readpackqbyte" }, { 0x106B, "cod_readqbyte" }, { 0x106C, "cod_writepackqbyte" }, { 0x106D, "cod_writeqbyte" }, { 0x106E, "cod_readident" }, { 0x106F, "cod_readpackiqbit" }, { 0x1070, "cod_writepackiqbit" }, { 0x1071, "cod_layer2profibus" }, { 0x1072, "cod_readtimer" }, { 0x1073, "cod_writetimer" }, { 0x1074, "cod_readcounter" }, { 0x1075, "cod_writecounter" }, { 0x1076, "0x1076COD_FMSGETOD" }, { 0x1077, "cod_endloadmasterconf" }, { 0x1078, "COD_FMSSTATUS" }, { 0x1079, "COD_EQUIPMENTINFO" }, { 0x107A, "COD_WRITEREADPACKBIT" }, { 0x107B, "COD_WRITEREADPACKQBIT" }, { 0x107C, "COD_WRITEREADPACKBYTE" }, { 0x107D, "COD_WRITEREADBYTE" }, { 0x107E, "COD_WRITEREADPACKQBYTE" }, { 0x107F, "COD_WRITEREADQBYTE" }, { 0x1080, "COD_WRITEREADWORD" }, { 0x1081, "COD_WRITEREADQWORD" }, { 0x1082, "COD_WRITEREADDWORD" }, { 0x1083, "COD_WRITEREADFWORD" }, { 0x1084, "COD_WRITEREADWORDBCD" }, { 0x1085, "COD_CLOSECONNECTION" }, { 0x1086, "COD_GET_SUPPORTED_FUNCTION" }, { 0x1087, "COD_READOBJECT" }, { 0x1088, "COD_WRITEFIELDOBJECT" }, { 0x1089, "COD_EQUINFO_OBJ" }, { 0x1090, "COD_WRITEREADMSG" }, { 0x1091, "COD_START_SCANNER" }, /* Code slave function */ { 0x2000, "cod_initslave" }, { 0x2001, "cod_loadslaveconf" }, { 0x2002, "cod_endloadslaveconf" }, /* Codes Database*/ { 0x3000, "cod_getpackbit" }, { 0x3001, "cod_getbit" }, { 0x3002, "cod_getword" }, { 0x3003, "cod_getdword" }, { 0x3004, "cod_getfword" }, { 0x3005, "cod_setpackbit" }, { 0x3006, "cod_setbit" }, { 0x3007, "cod_setword" }, { 0x3008, "cod_setdword" }, { 0x3009, "cod_setfword" }, { 0x300A, "cod_getdispbit" }, { 0x300B, "cod_getdispword" }, { 0x300C, "cod_getdispdword" }, { 0x300D, "cod_getdispfword" }, { 0x300E, "cod_setdispbit" }, { 0x300F, "cod_setdispword" }, { 0x3010, "cod_setdispdword" }, { 0x3011, "cod_setdispfword" }, { 0x3012, "cod_incdispword" }, { 0x3013, "cod_incdispdword" }, { 0x3014, "cod_decdispword" }, { 0x3015, "cod_decdispdword" }, { 0x3016, "cod_getevent" }, { 0x3017, "cod_confdb" }, { 0x3018, "cod_puteventvar" }, { 0x3019, "cod_getpackbyte" }, { 0x301A, "cod_setpackbyte" }, { 0x301B, "cod_fillbit" }, { 0x301C, "cod_fillbyte" }, { 0x301D, "cod_fillword" }, { 0x301E, "cod_filldword" }, { 0x301F, "cod_fillfword" }, { 0x3020, "COD_APPGETBIT" }, { 0x3021, "COD_DBEXECUTED" }, { 0x3022, "COD_GETRIGHTS" }, { 0x3023, "COD_WFCYC_COS" }, { 0x3024, "COD_END_FCYC" }, { 0x3025, "COD_FCYC_END" }, { 0x3026, "COD_TAB_FCYC" }, { 0x3027, "COD_GETFCYCCOS" }, { 0x3028, "COD_SETIOAREAADDR" }, { 0x3029, "COD_GETIOAREAADDR" }, { 0x3030, "COD_SETACTFNTADDR" }, { 0x3031, "COD_GETACTFNTADDR" }, { 0x3032, "COD_GETACTFNTBITWORD" }, /* Code disp_cyc functions */ { 0x4000, "cod_cycinfo" }, { 0x4001, "cod_createcyc" }, { 0x4002, "cod_startcyc" }, { 0x4003, "cod_stopcyc" }, { 0x4004, "cod_transcyc" }, { 0x4005, "cod_actcyc" }, { 0x4006, "cod_initcyc" }, { 0x4007, "cod_cycparam" }, { 0x4008, "cod_stopallcyc" }, { 0x4009, "cod_stopallcycread" }, { 0x400A, "cod_stopallcycwrite" }, { 0x400B, "cod_cyctimebase" }, { 0x400C, "COD_CYCEXECUTED" }, { 0x400E, "COD_NEWCREATECYC" }, { 0x400F, "COD_DISPCYC_DEBUG" }, { 0x4010, "COD_NEWCREATECYC_ID" }, { 0x4011, "COD_DESTROYCYC_ID" }, { 0x4012, "COD_CREATECYC_OBJ" }, { 0x4013, "COD_TRANSCYC_VERIF" }, { 0x4014, "COD_CREATECYC_WRMSG" }, { 0x4015, "COD_NEWCREATECYC_WRMSG" }, { 0x4016, "COD_NEWCREATECYC_WRMSG_ID" }, { 0x4017, "COD_CYCEXECUTED_AND_COS" }, { 0x4018, "COD_STARTCYCONE" }, { 0x4019, "COD_GETCRESCENDO_USB" }, { 0x4020, "COD_GETCYCPARAM2" }, { 0x4021, "COD_FCYCWRITENONCOS" }, { 0x4022, "COD_RESETCPTACTIVATION" }, /* Code Root function */ { 0x5000, "cod_rootinfo" }, { 0x5001, "cod_initjbus" }, { 0x5002, "cod_exitjbus" }, { 0x5003, "cod_transdif" }, { 0x5004, "cod_testtransdif" }, { 0x5005, "cod_watchdog" }, { 0x5006, "cod_accesskey" }, { 0x5007, "cod_getmodem" }, { 0x5008, "cod_setmodem" }, { 0x5009, "COD_GETSTATIONNAME" }, { 0x500A, "COD_GETSTATIONINFO" }, { 0x500B, "COD_GETWATCHDOG" }, { 0x500C, "COD_DIAG_ROOT" }, /* Code bt100 function */ { 0x6000, "COD_CREATEBT" }, { 0x6001, "COD_TIMEBASEBT" }, { 0x6002, "COD_CREATEBASETIME" }, /* Code ADMINFL-0 : files */ { 0x7000, "COD_OPENFILE" }, { 0x7001, "COD_CLOSEFILE" }, { 0x7002, "COD_READFILE" }, { 0x7003, "COD_WRITEFILE" }, { 0x7004, "COD_DELETEFILE" }, { 0x7005, "COD_SEEKFILE" }, { 0x7006, "COD_TEELFILE" }, { 0x7007, "COD_EOFFILE" }, { 0x7008, "COD_GETPTRFILE" }, { 0x7009, "COD_DIRFILE" }, /* Code MSG USER */ { 0x7500, "COD_USER_FIRST" }, { 0x7501, "COD_USER_EXCHANGE" }, { 0x7502, "COD_USER_STATUSEXCHANGE" }, { 0x7503, "COD_USER_SENDFRAME" }, { 0x7504, "COD_USER_STATUSSENDFRAME" }, { 0x7600, "COD_USER_EQUIPPARAMSREAD" }, { 0x7601, "COD_USER_EQUIPINFOUPDATE" }, { 0x7602, "COD_USER_ANALYZESTDREQUEST" }, { 0x7603, "COD_USER_ANALYZEOBJREQUEST" }, { 0x7604, "COD_USER_PREPROCESSREQUEST" }, { 0x7605, "COD_USER_PREPROCESSANSWER" }, { 0x7606, "COD_USER_EXEFUNCREQUEST" }, { 0x7607, "COD_USER_EXEFUNCANSWER" }, { 0x7608, "COD_USER_ABORTFRAME" }, { 0x7700, "COD_USER_GETFUNCTION" }, { 0x7701, "COD_USER_EXEFUNCREQ" }, { 0x7702, "COD_USER_EXEFUNCACK" }, { 0x7999, "COD_USER_LAST" }, /* ??? */ { 0x8000, "COD_INDWRITEMASK" }, /* Code ADMINMSG-0 : message */ { 0x9000, "COD_READMSG" }, { 0x9001, "COD_CLEARMSG" }, { 0x9002, "COD_DIRMSG" }, { 0x9003, "COD_ENABLEMSG" }, { 0x9004, "COD_DISABLEMSG" }, { 0x9005, "COD_CREATEMSG" }, { 0x9006, "COD_GETDESCRMSG" }, { 0x9007, "COD_DIRALLMSG" }, { 0x9008, "COD_INFOMSG" }, { 0x9009, "COD_GETFLAGSMSG" }, { 0x900A, "COD_SETFLAGSMSG" }, { 0x9100, "COD_MSG_ENABLED" }, /* First LLI MAIL Codef */ { 0x9500, "COD_LLI_WHITE" }, /* system commands */ { 0x9510, "COD_MANAGE_INIT" }, { 0x9511, "COD_MANAGE_SAP" }, { 0x9512, "COD_LLI_DIAG" }, { 0x9513, "COD_LLI_MANAGE" }, { 0x9514, "COD_ADD_INSTANCE" }, { 0x9515, "COD_REM_INSTANCE" }, { 0x9516, "COD_GET_MESSAGING" }, { 0x9517, "COD_LLI_CMD" }, /* protocol commands */ { 0x9600, "COD_LLI_EXCHANGE" }, { 0x9602, "COD_LLI_INIT" }, { 0x9603, "COD_LLI_START" }, { 0x9604, "COD_LLI_STOP" }, { 0x9605, "COD_LLI_READ_INPUT" }, { 0x9606, "COD_LLI_READ_OUTPUT" }, { 0x9607, "COD_LLI_ABORT" }, { 0x9608, "COD_LLI_TRACE_ON" }, { 0x9609, "COD_LLI_TRACE_OFF" }, { 0x960A, "COD_LLI_WRITE_OUTPUT" }, { 0x960B, "COD_LLI_READ_ASYNC" }, { 0x960C, "COD_LLI_WRITE_ASYNC" }, { 0x960D, "COD_LLI_DP_SERVICE" }, { 0x960E, "COD_LLI_FDL_SERVICE" }, { 0x960F, "COD_LLI_SCAN_L2" }, { 0x9610, "COD_LLI_SCAN_MESSAGING" }, { 0x9611, "COD_LLI_MPISLAVE_SERVICE" }, { 0x9612, "COD_LLI_FDL_MESSAGING" }, /* Last LLI MAIL Codef */ { 0x96FF, "COD_LLI_LAST" }, { 0xA001, "COD_REFRESH_INPUT" }, { 0xA002, "COD_REFRESH_OUTPUT" }, /* Codef SOCKET */ { 0xB001, "COD_SOCKET_CREATE" }, { 0xB002, "COD_SOCKET_BIND" }, { 0xB003, "COD_SOCKET_CONNECT" }, { 0xB004, "COD_SOCKET_LISTEN" }, { 0xB005, "COD_SOCKET_ACCEPT" }, { 0xB006, "COD_SOCKET_SENDTO" }, { 0xB007, "COD_SOCKET_RECVFROM" }, { 0xB008, "COD_SOCKET_SEND" }, { 0xB009, "COD_SOCKET_RECV" }, { 0xB010, "COD_SOCKET_CLOSE" }, { 0xB011, "COD_SOCKET_HOST_INFO" }, { 0xB012, "COD_SOCKET_PEER_INFO" }, { 0xB013, "COD_SOCKET_RECV_GET_DATA" }, { 0xB014, "COD_SOCKET_GET_STAT" }, { 0xB015, "COD_SOCKET_RESET_STAT" }, /*New type for the version 2*/ { 0xB016, "COD_SOCKET_SETSOCKOPT" }, { 0xB017, "COD_SOCKET_SELECT" }, { 0xB018, "COD_SOCKET_SHUTDOWN_ALL" }, { 0xB019, "COD_SOCKET_DIAG_SUMMARY" }, { 0xB01A, "COD_SOCKET_DIAG_DETAILS" }, { 0xB01B, "COD_SOCKET_DIAG_SO" }, { 0xB01C, "COD_SOCKET_EVENT" }, /* Codef ARP */ { 0xC000, "COD_ARP_QUERY" }, { 0xC001, "COD_ARP_FLUSH" }, { 0xFFEF, "index not updated" }, /* -11 */ { 0xFFFE, "Unknown Status" }, { 0, NULL } }; static value_string_ext tabCodef_ext = VALUE_STRING_EXT_INIT(tabCodef); static const value_string FunctionCodes[] = { { WRETH_IDENT, "Identification" }, { WRETH_CONNECT, "Connection" }, { WRETH_ACK, "Acknowledge" }, { WRETH_NACK, "Non acknowledge" }, { WRETH_DISCONNECT, "Disconnection" }, { WRETH_MAIL, "Mail" }, { WRETH_BLINKY, "Blinky" }, { WRETH_GET_VALUE, "Get value" }, { WRETH_SET_VALUE, "Set value" }, { WRETH_BOOST, "Boost" }, { 0, NULL } }; static value_string_ext FunctionCodes_ext = VALUE_STRING_EXT_INIT(FunctionCodes); static const value_string ErrorCode_vals[] = { { 0, "No error" }, { WRETH_BAD_FUNCTION_CODE, "Bad function code" }, { WRETH_ALREADY_CONNECTED, "Already connected" }, { WRETH_INVALID_PROTOCOL_VERSION, "Invalid protocol version" }, { WRETH_NOT_CONNECTED, "Not connected" }, { WRETH_INVALID_MAC_ADDRESS, "Invalid MAC address" }, { WRETH_INVALID_FRAME_SIZE, "Invalid frame size" }, { WRETH_NO_MEMORY_AVAILABLE, "No memory available" }, { WRETH_BAD_PARAMETER, "Bad parameter" }, { WRETH_TASK_REGISTERED, "Task registered" }, { 0, NULL } }; static value_string_ext ErrorCode_vals_ext = VALUE_STRING_EXT_INIT(ErrorCode_vals); static int dissect_wreth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint16 packet_type,functionCode; guint8 fragmented; proto_item *mi, *ti; proto_tree *pWrethTree ; guint8 Offset = 0 ; /*Read the packet type, if not good, exit*/ packet_type = tvb_get_ntohs(tvb,0); if(packet_type != WSE_RETH_SUBTYPE) return 1; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Wreth"); /* Clear out stuff in the info column */ col_clear(pinfo->cinfo,COL_INFO); mi = proto_tree_add_protocol_format(tree, wreth_proto, tvb, Offset, -1, "WSE remote ethernet"); pWrethTree = proto_item_add_subtree(mi, ett_wreth); functionCode = tvb_get_letohs(tvb,4); fragmented = tvb_get_guint8(tvb,10); if(fragmented > 2) { col_set_str(pinfo->cinfo, COL_INFO, "Invalid fragmented byte"); return tvb_captured_length(tvb); } if (tree) { /*Subtype*/ proto_tree_add_item(pWrethTree, hf_Wreth_Subtype, tvb, Offset, 2, ENC_LITTLE_ENDIAN); /*Size*/ proto_tree_add_item(pWrethTree, hf_Wreth_Size, tvb, Offset + 2, 2, ENC_LITTLE_ENDIAN); /*Function code*/ proto_tree_add_item(pWrethTree, hf_Wreth_FunctionCode, tvb, Offset + 4, 2, ENC_LITTLE_ENDIAN); /*FrameID*/ proto_tree_add_item(pWrethTree, hf_Wreth_FrameId, tvb, Offset + 6, 2, ENC_LITTLE_ENDIAN); /*Error Code*/ proto_tree_add_item(pWrethTree, hf_Wreth_ErrorCode, tvb, Offset + 8, 2, ENC_LITTLE_ENDIAN); } /*Fragmented*/ if(fragmented == 2) { ti = proto_tree_add_item(pWrethTree, hf_Wreth_Fragmented, tvb, Offset + 10, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ": second fragment"); /*Retry*/ proto_tree_add_item(pWrethTree, hf_Wreth_Retry, tvb, Offset + 11, 1, ENC_LITTLE_ENDIAN); WrethMailDissection(tvb, Offset + 12, pinfo, pWrethTree, fragmented); return tvb_captured_length(tvb); } ti = proto_tree_add_item(pWrethTree, hf_Wreth_Fragmented, tvb, Offset + 10, 1, ENC_LITTLE_ENDIAN); if(fragmented == 1) { proto_item_append_text(ti, ": first fragment"); }else proto_item_append_text(ti, ": no"); /*Retry*/ proto_tree_add_item(pWrethTree, hf_Wreth_Retry, tvb, Offset + 11, 1, ENC_LITTLE_ENDIAN); /* Add items to protocol tree specific to Wreth */ switch(functionCode) { case WRETH_IDENT: WrethIdentPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_CONNECT: WrethConnectPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_ACK: WrethAckPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_NACK: WrethNackPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_DISCONNECT: WrethDisconnectPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_MAIL: WrethMailPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_BLINKY: WrethBlinkyPacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_GET_VALUE: WrethGetValuePacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_SET_VALUE: WrethSetValuePacket(tvb, Offset + 12, pinfo, pWrethTree); break; case WRETH_BOOST: WrethBoostPacket(tvb, Offset + 12, pinfo, pWrethTree); break; default: break; } return tvb_captured_length(tvb); } /*****************************************************************************/ static const value_string IdentState[] = { { 0, "Ready" }, { 1, "Busy"}, { 0, NULL } }; gint WrethIdentPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; Size = tvb_get_letohs(tvb, 2); if((Size != 0)&&(Size != 19)) { /* Invalid identification frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid identification frame"); return 0; } if(Size == 0) { col_set_str(pInfo->cinfo, COL_INFO, "Identification question"); return 0; } /*BiosVersion*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationBiosVersion, tvb, Offset, 6, ENC_ASCII); /*Board Number*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationBoardNumber, tvb, Offset + 6, 2, ENC_LITTLE_ENDIAN); /*Protocol*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationProtocolVersion, tvb, Offset + 8, 2, ENC_LITTLE_ENDIAN); /*Board Id*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationBoardId, tvb, Offset + 10, 2, ENC_LITTLE_ENDIAN); /*State*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationState, tvb, Offset + 12, 1, ENC_LITTLE_ENDIAN); /*Client MAC address*/ proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationMacAddr, tvb, Offset + 13, 6, ENC_NA); col_set_str(pInfo->cinfo, COL_INFO, "Identification response"); return Offset; } /*****************************************************************************/ gint WrethConnectPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree _U_) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 4) { /* Invalid connection frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid connection frame"); return 0; } col_set_str(pInfo->cinfo, COL_INFO, "Connection"); proto_tree_add_item(pWrethTree, hf_Wreth_ConnectProtocolVersion, tvb, Offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(pWrethTree, hf_Wreth_ConnectTimeout, tvb, Offset + 2, 2, ENC_LITTLE_ENDIAN); return Offset; } /*****************************************************************************/ gint WrethDisconnectPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree _U_) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 0) { /* Invalid disconnection frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid disconnection frame"); return 0; } col_set_str(pInfo->cinfo, COL_INFO, "Disconnection"); return Offset; } /*****************************************************************************/ gint WrethBlinkyPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 2) { /* Invalid blinky frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid blinky frame"); return 0; } col_set_str(pInfo->cinfo, COL_INFO, "Blinky"); proto_tree_add_item(pWrethTree, hf_Wreth_BlinkyPeriod, tvb, Offset, 2, ENC_LITTLE_ENDIAN); return Offset; } /*****************************************************************************/ gint WrethGetValuePacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; Size = tvb_get_letohs(tvb,2); switch(Size) { case 0: col_set_str(pInfo->cinfo, COL_INFO, "Get value question"); break; case 1: proto_tree_add_item(pWrethTree, hf_Wreth_GetValueVal, tvb, Offset, 1, ENC_LITTLE_ENDIAN); col_set_str(pInfo->cinfo, COL_INFO, "Get value response"); break; default: col_set_str(pInfo->cinfo, COL_INFO, "Invalid get value frame"); break; } return Offset; } /*****************************************************************************/ gint WrethSetValuePacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 0) { col_set_str(pInfo->cinfo, COL_INFO, "Invalid set value frame"); } proto_tree_add_item(pWrethTree, hf_Wreth_SetValueVal, tvb, Offset, 1, ENC_LITTLE_ENDIAN); col_set_str(pInfo->cinfo, COL_INFO, "Set value question"); return Offset; } /*****************************************************************************/ static const value_string BoostValue[] = { { 0, "disabled" }, { 1, "enabled"}, { 0, NULL } }; gint WrethBoostPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 2) { /* Invalid boost frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid boost frame"); return 0; } col_set_str(pInfo->cinfo, COL_INFO, "Boost"); proto_tree_add_item(pWrethTree, hf_Wreth_BoostValue, tvb, Offset, 2, ENC_LITTLE_ENDIAN); return Offset; } /*****************************************************************************/ gint WrethAckPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree _U_) { guint16 Size; Size = tvb_get_letohs(tvb,2); if(Size != 0) { /* Invalid ack frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid acknowledge frame"); return 0; } col_set_str(pInfo->cinfo, COL_INFO, "Acknowledge"); return Offset; } /*****************************************************************************/ gint WrethNackPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { guint16 Size; guint16 ErrorCode; Size = tvb_get_letohs(tvb,2); ErrorCode = tvb_get_letohs(tvb,8); if((Size != 0)&&(Size != 6)) { /* Invalid ack frame */ col_set_str(pInfo->cinfo, COL_INFO, "Invalid non acknowledge frame"); return 0; } col_add_str(pInfo->cinfo, COL_INFO, val_to_str_ext(ErrorCode, &ErrorCode_vals_ext, "Unknown 0x%04x")); if(Size == 6) { proto_tree_add_item(pWrethTree, hf_Wreth_IdentificationMacAddr, tvb, Offset, 6, ENC_NA); } return Offset; } /*****************************************************************************/ gint WrethMailPacket(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree) { proto_tree_add_item(pWrethTree, hf_Wreth_MailDestTic, tvb, Offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(pWrethTree, hf_Wreth_MailReserved, tvb, Offset + 2, 4, ENC_LITTLE_ENDIAN); col_set_str(pInfo->cinfo, COL_INFO, "Mail"); /*Frame not fragmented => last argument = 0*/ WrethMailDissection(tvb, Offset+6, pInfo, pWrethTree,0); return Offset; } /*****************************************************************************/ gint WrethMailDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo, proto_tree * pWrethTree, guint8 fragmented) { proto_item *mi; proto_tree *pWrethMailboxTree; guint32 Nb = 0; guint16 Codef = 0; mi = proto_tree_add_protocol_format(pWrethTree, wreth_proto, tvb, Offset, -1, "MailBox"); pWrethMailboxTree = proto_item_add_subtree(mi, ett_wreth); /*If it's not the last fragment, display the header of the MailBox*/ if (2 != fragmented) { guint16 Card, Chan; gint Status; /*Codef*/ Codef = tvb_get_letohs(tvb,Offset); proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Codef, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Status*/ Status = (gint16)tvb_get_letohs(tvb,Offset); /* cast fetched value to signed so sign is extended */ /* so that lookup of 32-bit unsigned in tabCodef */ /* value_string array will work properly. */ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Status, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*TicUser Root*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_TicUser_Root, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail PidUser*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_PidUser, tvb, Offset, 4, ENC_LITTLE_ENDIAN); Offset += 4; /*Mail Mode*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Mode, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Time*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Time, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Stop*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Stop, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Nfonc*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Nfonc, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Ncard*/ Card = tvb_get_letohs(tvb,Offset); proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Ncard, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Nchan*/ Chan = tvb_get_letohs(tvb,Offset); proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Nchan, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Nes*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Nes, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Nb*/ proto_tree_add_item_ret_uint(pWrethMailboxTree, hf_Wreth_Mail_Nb, tvb, Offset, 2, ENC_LITTLE_ENDIAN, &Nb); Offset += 2; /*Mail TypVar*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_TypVar, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Adr*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Adr, tvb, Offset, 4, ENC_LITTLE_ENDIAN); Offset += 4; /*Mail TicUser*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_TicUser_DispCyc, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail Nb Max Size Mail*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Nb_Max_Size_Mail, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail User ThreadID*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_User_ThreadID, tvb, Offset, 4, ENC_LITTLE_ENDIAN); Offset += 4; /*Mail DispCyc Version*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_DispCyc_Version, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Mail DifUserParam*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_DifUserParam, tvb, Offset, 4, ENC_LITTLE_ENDIAN); Offset += 4; /*Mail Filler*/ proto_tree_add_item(pWrethMailboxTree, hf_Wreth_Mail_Filler, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; col_add_fstr(pInfo->cinfo, COL_INFO, "Mail : Codef = Ox%X (%s), Status = %02d (%s), Card = %d, Chan = %d" , Codef, val_to_str_ext(Codef, &tabCodef_ext, "Unknown 0x%04x"), Status, val_to_str_ext(Status, &tabStatus_ext, "Unknown %d"), Card, Chan); } else { col_set_str(pInfo->cinfo, COL_INFO, "Mail : Data Second Fragment "); } if (0 != Nb) { /*Specific Decode for some Codef*/ switch(Codef) { case 0x1002: /*Master Info*/ WrethCodefMasterInfoDissection(tvb, Offset, pInfo, pWrethMailboxTree); break; case 0x1079: /*Equipment Info*/ WrethCodefEquipmentInfoDissection(tvb, Offset, pInfo, pWrethMailboxTree); break; default: proto_tree_add_protocol_format(pWrethMailboxTree, wreth_proto, tvb, Offset, -1, "Data"); break; } } return Offset; } /*****************************************************************************/ gint WrethCodefMasterInfoDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo _U_, proto_tree * pWrethMailboxTree) { proto_item *mi; proto_tree *pWrethMailboxDataTree; mi = proto_tree_add_protocol_format(pWrethMailboxTree, wreth_proto, tvb, Offset, -1, "Data"); pWrethMailboxDataTree = proto_item_add_subtree(mi, ett_wreth); /*bVersion*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_Version, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bRelease*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_Release, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bProtocol*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_Protocol, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bCyclicFlux*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_CyclicFlux, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*szProtocolName*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_szProtocolName, tvb, Offset, 16, ENC_ASCII); Offset += 16; /*bMaxTypeEquipment*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_MaxTypeEquipment, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*wMinEquipmentNumber*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_MinEquipmentNumber, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxEquipmentNumber*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_MaxEquipmentNumber, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; return Offset; } /*****************************************************************************/ gint WrethCodefEquipmentInfoDissection(tvbuff_t *tvb, guint8 Offset, packet_info * pInfo _U_, proto_tree * pWrethMailboxTree) { proto_item *mi; proto_tree *pWrethMailboxDataTree; mi = proto_tree_add_protocol_format(pWrethMailboxTree, wreth_proto, tvb, Offset, -1, "Data"); pWrethMailboxDataTree = proto_item_add_subtree(mi, ett_wreth); /*bVersion*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Version, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*Free*/ Offset += 1; /*bRelease*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Release, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bNetwork*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Network, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bProtocol*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Protocol, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*bMessaging*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Messaging, tvb, Offset, 1, ENC_LITTLE_ENDIAN); Offset += 1; /*wEquipment*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Equipment, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wFlux*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_Flux, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Free*/ Offset += 10; /*IncWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_IncWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*IncDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_IncDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*IncFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_IncFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*Free*/ Offset += 4; /*DllItemName*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_DllItemName, tvb, Offset, 14, ENC_ASCII); Offset += 14; /*szEquipmentName*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Mastinf_szEquipmentName, tvb, Offset, 16, ENC_ASCII); Offset += 16; /*Free*/ Offset += 2; /*wMaxWriteBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteIBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteIBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadIBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadIBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakIBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakIBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteQBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteQBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadQBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadQBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakQBit*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakQBit, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteIByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteIByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadIByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadIByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakIByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakIByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteQByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteQByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadQByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadQByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakQByte*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakQByte, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteIWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteIWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadIWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadIWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakIWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakIWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteQWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteQWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadQWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadQWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakQWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakQWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxWriteFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxWriteFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wMaxReadFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_MaxReadFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wBreakFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_BreakFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wReadFactorWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_ReadFactorWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wReadFactorIWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_ReadFactorIWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wReadFactorQWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_ReadFactorQWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wReadFactorDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_ReadFactorDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wReadFactorFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_ReadFactorFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wWriteFactorWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_WriteFactorWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wWriteFactorIWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_WriteFactorIWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wWriteFactorQWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_WriteFactorQWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wWriteFactorDWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_WriteFactorDWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wWriteFactorFWord*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_WriteFactorFWord, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; /*wDataFormat*/ proto_tree_add_item(pWrethMailboxDataTree, hf_Wreth_Mail_Equinf_DataFormat, tvb, Offset, 2, ENC_LITTLE_ENDIAN); Offset += 2; return Offset; } void proto_register_wreth(void) { static hf_register_info hf[] = { /* Wreth header fields */ { &hf_Wreth_Subtype, { "Subtype", "wreth.Subtype", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Size, { "Size", "wreth.Size", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL } }, { &hf_Wreth_FunctionCode, { "Function code","wreth.FunctionCode", FT_UINT16, BASE_DEC | BASE_EXT_STRING, &FunctionCodes_ext, 0x0, NULL, HFILL } }, { &hf_Wreth_FrameId, { "FrameId", "wreth.FrameId", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_ErrorCode, { "Error code", "wreth.ErrorCode", FT_UINT16, BASE_DEC | BASE_EXT_STRING, &ErrorCode_vals_ext, 0x0, NULL, HFILL } }, { &hf_Wreth_Fragmented, { "Fragmented", "wreth.Fragmented", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Retry, { "Retry", "wreth.Retry", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationBiosVersion, { "Bios version", "wreth.IdentBiosVersion", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationBoardNumber, { "Board number", "wreth.IdentBoardNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationProtocolVersion, { "Protocol version", "wreth.IdentProtocolVersion", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationBoardId, { "Board Id", "wreth.IdentBoardId", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationState, { "State", "wreth.IdentState", FT_UINT8, BASE_DEC, VALS(IdentState), 0x0, NULL, HFILL } }, { &hf_Wreth_IdentificationMacAddr, { "Client MAC address", "wreth.IdentClientMacAddr", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_ConnectProtocolVersion, { "Protocol version", "wreth.ConnectProtocolVersion", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_ConnectTimeout, { "Connect timeout", "wreth.ConnectTimeout", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_BlinkyPeriod, { "Period", "wreth.BlinkyPeriod", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_GetValueVal, { "Value", "wreth.GetValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_SetValueVal, { "Value", "wreth.SetValue", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_BoostValue, { "Boost", "wreth.BoostStatus", FT_UINT16, BASE_DEC, VALS(BoostValue), 0x0, NULL, HFILL } }, { &hf_Wreth_MailDestTic, { "Dest tic", "wreth.MailDestTic", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_MailReserved, { "Reserved", "wreth.MailReserved", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Codef, { "Codef", "wreth.Mail.Codef", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &tabCodef_ext, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Status, { "Status", "wreth.Mail.Status", FT_INT16, BASE_DEC | BASE_EXT_STRING, &tabStatus_ext, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_TicUser_Root, { "TicUser Root", "wreth.Mail.TicUserRoot", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_PidUser, { "PidUser", "wreth.Mail.PidUser", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mode, { "Mode", "wreth.Mail.Mode", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Time, { "Time", "wreth.Mail.Time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Stop, { "Stop", "wreth.Mail.Stop", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Nfonc, { "Nfonc", "wreth.Mail.Nfonc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Ncard, { "Ncard", "wreth.Mail.Ncard", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Nchan, { "Nchan", "wreth.Mail.Nchan", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Nes, { "Nes", "wreth.Mail.Nes", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Nb, { "Nb", "wreth.Mail.Nb", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_TypVar, { "TypVar", "wreth.Mail.TypVar", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Adr, { "Adr", "wreth.Mail.Adr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_TicUser_DispCyc, { "TicUser DispCyc", "wreth.Mail.TicUser.DispCyc", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Nb_Max_Size_Mail, { "Nb Max Size Mail", "wreth.Mail.TicUser.Nb.Max.Size.Mail", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_User_ThreadID, { "User ThreadID", "wreth.Mail.User.ThreadID", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_DispCyc_Version, { "DispCyc Version", "wreth.Mail.DispCyc.Version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_DifUserParam, { "DifUserParam", "wreth.Mail.DifUserParam", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Filler, { "Filler", "wreth.Mail.Filler", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #if 0 { &hf_Wreth_Mail_Data, { "Data", "wreth.Mail.Data", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif { &hf_Wreth_Mail_Mastinf_Version, { "Version", "wreth.Mail.Mastinf.Version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_Release, { "Release", "wreth.Mail.Mastinf.Release", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_Protocol, { "Protocol", "wreth.Mail.Mastinf.Protocol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_CyclicFlux, { "CyclicFlux", "wreth.Mail.Mastinf.CyclicFlux", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_szProtocolName, { "ProtocolName", "wreth.Mail.Mastinf.ProtocolName", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_MaxTypeEquipment, { "MaxTypeEquipment", "wreth.Mail.Mastinf.MaxTypeEquipment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_MinEquipmentNumber, { "MinEquipmentNumber", "wreth.Mail.Mastinf.MinEquipmentNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_MaxEquipmentNumber, { "MaxEquipmentNumber", "wreth.Mail.Mastinf.MaxEquipmentNumber", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Version, { "Version", "wreth.Mail.Equinf.Version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Release, { "Release", "wreth.Mail.Equinf.Release", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Network, { "Network", "wreth.Mail.Equinf.Network", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Protocol, { "Protocol", "wreth.Mail.Equinf.Protocol", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Messaging, { "Messaging", "wreth.Mail.Equinf.Messaging", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Equipment, { "Equipment", "wreth.Mail.Equinf.Equipment", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_Flux, { "Flux", "wreth.Mail.Equinf.Flux", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_IncWord, { "IncWord", "wreth.Mail.Equinf.IncWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_IncDWord, { "IncDWord", "wreth.Mail.Equinf.IncDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_IncFWord, { "IncFWord", "wreth.Mail.Equinf.IncFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_DllItemName, { "DllItemName", "wreth.Mail.Equinf.DllItemName", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Mastinf_szEquipmentName, { "EquipmentName", "wreth.Mail.Equinf.EquipmentName", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteBit, { "MaxWriteBit", "wreth.Mail.Equinf.MaxWriteBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadBit, { "MaxReadBit", "wreth.Mail.Equinf.MaxReadBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakBit, { "BreakBit", "wreth.Mail.Equinf.BreakBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteIBit, { "MaxWriteIBit", "wreth.Mail.Equinf.MaxWriteIBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadIBit, { "MaxReadIBit", "wreth.Mail.Equinf.MaxReadIBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteQBit, { "MaxWriteQBit", "wreth.Mail.Equinf.MaxWriteQBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadQBit, { "MaxReadQBit", "wreth.Mail.Equinf.MaxReadQBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakQBit, { "BreakQBit", "wreth.Mail.Equinf.BreakQBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteByte, { "MaxWriteByte", "wreth.Mail.Equinf.MaxWriteByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadByte, { "MaxReadByte", "wreth.Mail.Equinf.MaxReadByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakByte, { "BreakByte", "wreth.Mail.Equinf.BreakByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteIByte, { "MaxWriteIByte", "wreth.Mail.Equinf.MaxWriteIByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadIByte, { "MaxReadIByte", "wreth.Mail.Equinf.MaxReadIByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakIByte, { "BreakIByte", "wreth.Mail.Equinf.BreakIByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteQByte, { "MaxWriteQByte", "wreth.Mail.Equinf.MaxWriteQByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadQByte, { "MaxReadQByte", "wreth.Mail.Equinf.MaxReadQByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } } , { &hf_Wreth_Mail_Equinf_BreakQByte , { "BreakQByte", "wreth.Mail.Equinf.BreakQByte", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteWord , { "MaxWriteWord", "wreth.Mail.Equinf.MaxWriteWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadWord , { "MaxReadWord", "wreth.Mail.Equinf.MaxReadWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakWord , { "BreakWord", "wreth.Mail.Equinf.BreakWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteIWord , { "MaxWriteIWord", "wreth.Mail.Equinf.MaxWriteIWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadIWord , { "MaxReadIWord", "wreth.Mail.Equinf.MaxReadIWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakIWord , { "BreakIWord", "wreth.Mail.Equinf.BreakIWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadQWord , { "MaxReadQWord", "wreth.Mail.Equinf.MaxReadQWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteQWord , { "MaxWriteQWord", "wreth.Mail.Equinf.MaxWriteQWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakQWord , { "BreakQWord", "wreth.Mail.Equinf.BreakQWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteDWord , { "MaxWriteDWord", "wreth.Mail.Equinf.MaxWriteDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadDWord , { "MaxReadDWord", "wreth.Mail.Equinf.MaxReadDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakDWord , { "BreakDWord", "wreth.Mail.Equinf.BreakDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxWriteFWord , { "MaxWriteFWord", "wreth.Mail.Equinf.MaxWriteFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_MaxReadFWord , { "MaxReadFWord", "wreth.Mail.Equinf.MaxReadFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakFWord , { "BreakFWord", "wreth.Mail.Equinf.BreakFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_ReadFactorWord , { "ReadFactorWord", "wreth.Mail.Equinf.ReadFactorWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_ReadFactorIWord , { "ReadFactorIWord", "wreth.Mail.Equinf.ReadFactorIWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_ReadFactorQWord , { "ReadFactorQWord", "wreth.Mail.Equinf.ReadFactorQWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_ReadFactorDWord , { "ReadFactorDWord", "wreth.Mail.Equinf.ReadFactorDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_ReadFactorFWord , { "ReadFactorFWord", "wreth.Mail.Equinf.ReadFactorFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_WriteFactorWord , { "WriteFactorWord", "wreth.Mail.Equinf.WriteFactorWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_WriteFactorIWord , { "WriteFactorIWord", "wreth.Mail.Equinf.WriteFactorIWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_WriteFactorQWord , { "WriteFactorQWord", "wreth.Mail.Equinf.WriteFactorQWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_WriteFactorDWord , { "WriteFactorDWord", "wreth.Mail.Equinf.WriteFactorDWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_WriteFactorFWord , { "WriteFactorFWord", "wreth.Mail.Equinf.WriteFactorFWord", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_DataFormat , { "DataFormat", "wreth.Mail.Equinf.DataFormat", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_Wreth_Mail_Equinf_BreakIBit , { "BreakIBit", "wreth.Mail.Equinf.BreakIBit", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } } }; static gint *ett[] = { &ett_wreth }; wreth_proto = proto_register_protocol ( "WSE remote ethernet", /* name */ "WRETH", /* short name */ "wreth" /* abbrev */ ); proto_register_field_array(wreth_proto, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_wreth(void) { dissector_handle_t wreth_handle; wreth_handle = create_dissector_handle(dissect_wreth, wreth_proto); dissector_add_uint("ethertype", WRETH_PORT, wreth_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wsmp.c
/* packet-wsmp.c * Routines for WAVE Short Message dissection (WSMP) * Copyright 2013, Savari Networks (http://www.savarinetworks.com) (email: [email protected]) * Based on packet-wsmp.c implemented by * Arada Systems (http://www.aradasystems.com) (email: [email protected]) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later * Ref IEEE 1609.3 */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include <epan/expert.h> #include "packet-ieee1609dot2.h" /* elemenID Types */ #define TRANSMITPW 0x04 #define CHANNUM 0x0F #define DATARATE 0x10 #define WSMP 0x80 #define WSMP_S 0x81 #define WSMP_I 0x82 void proto_register_wsmp(void); void proto_reg_handoff_wsmp(void); static const value_string wsmp_elemenid_names[] = { { 0x80, "WSMP" }, { 0x81, "WSMP-S" }, { 0x82, "WSMP-I" }, { 0, NULL } }; /* Initialize the protocol and registered fields */ static int proto_wsmp = -1; static int hf_wsmp_version = -1; static int hf_wsmp_var_len_det = -1; static int hf_wsmp_psid = -1; static int hf_wsmp_rate = -1; static int hf_wsmp_channel = -1; static int hf_wsmp_txpower = -1; static int hf_wsmp_WAVEid = -1; static int hf_wsmp_wsmlength = -1; static int hf_wsmp_WSMP_S_data = -1; static int hf_wsmp_subtype = -1; static int hf_wsmp_N_header_opt_ind = -1; static int hf_wsmp_version_v3 = -1; static int hf_wsmp_no_elements = -1; static int hf_wsmp_wave_ie = -1; static int hf_wsmp_wave_ie_len = -1; static int hf_wsmp_wave_ie_data = -1; static int hf_wsmp_tpid = -1; /* Initialize the subtree pointers */ static int ett_wsmp = -1; static int ett_wsmdata = -1; static int ett_wsmp_n_hdr = -1; static int ett_wsmp_t_hdr = -1; static int ett_wsmp_ie_ext = -1; static int ett_wsmp_ie = -1; static expert_field ei_wsmp_length_field_err = EI_INIT; static expert_field ei_wsmp_psid_invalid = EI_INIT; dissector_handle_t IEEE1609dot2_handle; static const value_string wsmp_subtype_vals[] = { { 0x0, "Null-networking protocol" }, { 0x1, "ITS station-internal forwarding" }, { 0x2, "N-hop forwarding" }, { 0x3, "Enables the features of GeoNetworking" }, { 0, NULL } }; static const value_string wsmp_wave_information_elements_vals[] = { { 0, "Reserved" }, { 1, "Reserved" }, { 2, "Reserved" }, { 3, "Reserved" }, { 4, "Transmit Power Used" }, /* WSMP - N - Header 8.3.4.4 */ { 5, "2D Location" }, /* WSA header 8.2.2.6 */ { 6, "3D Location" }, /* WSA header 8.2.2.6 */ { 7, "Advertiser Identifier" }, /* WSA header 8.2.2.6 */ { 8, "Provider Service Context" }, /* WSA Service Info 8.2.3.5 */ { 9, "IPv6 Address" }, /* WSA Service Info 8.2.3.5 */ { 10, "Service Por" }, /* WSA Service Info 8.2.3.5 */ { 11, "Provider MAC Address" }, /* WSA Service Info 8.2.3.5 */ { 12, "EDCA Parameter Set" }, /* WSA Channel Info 8.2.4.8 */ { 13, "Secondary DNS" }, /* WSA WRA 8.2.5.7 */ { 14, "Gateway MAC Address" }, /* WSA WRA 8.2.5.7 */ { 15, "Channel Number" }, /* WSMP - N - Header 8.3.4.2 */ { 16, "Data Rate" }, /* WSMP - N - Header 8.3.4.3 */ { 17, "Repeat Rate" }, /* WSA header 8.2.2.6 */ { 18, "Reserved" }, { 19, "RCPI Threshold" }, /* WSA Service Info 8.2.3.5 */ { 20, "WSA Count Threshold" }, /* WSA Service Info 8.2.3.5 */ { 21, "Channel Access" }, /* WSA Channel Info 8.2.4.8 */ { 22, "WSA Count Threshold Interval" }, /* WSA Service Info 8.2.3.5 */ { 23, "Channel Load" }, /* WSMP-N-Header 8.3.4.5 */ { 0, NULL } }; static const value_string wsmp_tpid_vals[] = { { 0, "The Address Info field contains a PSID and a WAVE Information Element Extension field is not present" }, { 1, "The Address Info field contains a PSID and a WAVE Information Element Extension field is present" }, { 2, "The Address Info field contains source and destination ITS port numbers and a WAVE Information Element Extension field is not present" }, { 3, "The Address Info field contains source and destination ITS port numbers and a WAVE Information Element Extension field is present" }, { 4, "LPP mode and a WAVE Information Element Extension field is not present" }, { 5, "LPP mode and a WAVE Information Element Extension field is present" }, { 0, NULL } }; /* 4.1.2 P-encoding of PSIDs This standard defines a compact encoding for PSID referred to as p-encoding. Octets are numbered from the left starting at zero (Octet 0). The length of the PSID is indicated by Octet 0, where the position of the first zero-value bit in descending order of bit significance in the octet indicates the length in octets of the p?encoded PSID. Using p-encoding, a binary "0" in the most-significant bit indicates a one-octet PSID; a binary "10" in the two most-significant bits indicates a two-octet PSID; a binary "110" in the three most-significant bits indicates a three-octet PSID; and a binary "1110" in the four most-significant bits indicates a four-octet PSID. */ static int dissect_wsmp_psid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint32 *psid) { guint8 oct; guint32 psidLen = 0; oct = tvb_get_guint8(tvb, offset); *psid = 0; if ((oct & 0xF0) == 0xF0) { proto_tree_add_expert(tree, pinfo, &ei_wsmp_psid_invalid, tvb, offset, 1); return offset + 1; } else if ((oct & 0xF0) == 0xE0) { psidLen = 4; } else if ((oct & 0xE0) == 0xC0) { psidLen = 3; } else if ((oct & 0xC0) == 0x80) { psidLen = 2; } else if ((oct & 0x80) == 0x00) { psidLen = 1; } if (psidLen == 1) *psid = oct; else if (psidLen == 2) *psid = (tvb_get_ntohs(tvb, offset) & ~0x8000) + 0x80; else if (psidLen == 3) *psid = (tvb_get_ntoh24(tvb, offset) & ~0xc00000) + 0x4080; else if (psidLen == 4) *psid = (tvb_get_ntohl(tvb, offset) & ~0xe0000000) + 0x204080; proto_tree_add_bits_item(tree, hf_wsmp_var_len_det, tvb, offset << 3, psidLen, ENC_NA); proto_tree_add_uint_bits_format_value(tree, hf_wsmp_psid, tvb, (offset << 3) + psidLen, (psidLen << 3) - psidLen,*psid,ENC_BIG_ENDIAN,"%s(%u)", val64_to_str_const(*psid, ieee1609dot2_Psid_vals, "Unknown"), *psid); offset += psidLen; return offset; } /* 8.1.3 Length and Count field encoding*/ static int dissect_wsmp_length_and_count(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_id, guint16* value) { guint8 oct, len; guint16 val; /* For values in the range of 0 through 127, Length and Count values * are represented in a single-octet encoded as an unsigned integer. For values in the range 128 through 16 * 383, values are represented as two octets encoded as follows. If the most significant bit of the field is 0b0, * then this indicates a one-octet Length or Count field. If the two most significant bits of the field are 0b10, * the Length or Count field is a two-octet field, with the remaining 14 bits representing the value encoded as * an unsigned integer.*/ oct = tvb_get_guint8(tvb, offset); if ((oct & 0x80) == 0x80) { if ((oct & 0xc0) == 0x80) { /* Two bytes */ val = tvb_get_ntohs(tvb, offset) & 0x3fff; len = 2; } else { /* Error */ proto_tree_add_expert(tree, pinfo, &ei_wsmp_length_field_err, tvb, offset, 1); val = tvb_get_ntohs(tvb, offset) & 0x3fff; len = 2; } }else{ /* One byte */ val = oct; len = 1; } proto_tree_add_uint(tree, hf_id, tvb, offset, len, val); offset += len; if (value){ *value = val; } return offset; } static int dissect_wsmp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 oct) { proto_tree *sub_tree, *n_tree, *t_tree, *data_tree; proto_item *item; int offset = 0, ie_start, len_to_set; guint8 header_opt_ind = (oct & 0x08) >> 3; guint8 ie; guint16 count, ie_len, wsm_len; guint32 tpid, psid = 0; static int * const flags[] = { &hf_wsmp_subtype, &hf_wsmp_N_header_opt_ind, &hf_wsmp_version_v3, NULL }; /* 8.3.2 WSMP Network Header (WSMP-N-Header) */ n_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_wsmp_n_hdr, &item, "WSMP-N-Header"); /* In Version 3 * B7 B4 B3 B2 B0 | Variable | 1 octet * Subtype |WSMP-NHeader | WSMP Version | WAVE Information Element Extension | TPID * | Option Indicator | | | */ proto_tree_add_bitmask_list(n_tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN); offset++; /* WAVE Information Element Extension */ if (header_opt_ind) { sub_tree = proto_tree_add_subtree(n_tree, tvb, offset, -1, ett_wsmp_ie_ext, &item, "WAVE Information Element Extension"); /* Figure 14 WAVE Information Element Extension */ /* 8.1.3 Length and Count field encoding*/ /* Count( Number of WAVE Information Elements )*/ offset = dissect_wsmp_length_and_count(tvb, pinfo, sub_tree, offset, hf_wsmp_no_elements, &count); while (count) { proto_tree* ie_tree; ie_start = offset; /* WAVE Element ID 1 octet*/ ie = tvb_get_guint8(tvb, offset); ie_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, -1, ett_wsmp_ie, &item, "%s", val_to_str_const(ie, wsmp_wave_information_elements_vals, "Unknown")); proto_tree_add_item(ie_tree, hf_wsmp_wave_ie, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; /* Length */ offset = dissect_wsmp_length_and_count(tvb, pinfo, ie_tree, offset, hf_wsmp_wave_ie_len, &ie_len); proto_tree_add_item(ie_tree, hf_wsmp_wave_ie_data, tvb, offset, ie_len, ENC_NA); offset += ie_len; len_to_set = offset - ie_start; proto_item_set_len(item, len_to_set); count--; } } /* TPID */ proto_tree_add_item_ret_uint(n_tree, hf_wsmp_tpid, tvb, offset, 1, ENC_BIG_ENDIAN, &tpid); offset++; /* WSMP-T-Header */ t_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_wsmp_t_hdr, &item, "WSMP-T-Header"); switch (tpid) { case 0: /* The Address Info field contains a PSID and a WAVE Information Element Extension field is not present.*/ offset = dissect_wsmp_psid(tvb, pinfo, t_tree, offset, &psid); break; default: break; } /* WSM Length */ offset = dissect_wsmp_length_and_count(tvb, pinfo, t_tree, offset, hf_wsmp_wave_ie_len, &wsm_len); /* WSM Data */ data_tree = proto_tree_add_subtree(tree, tvb, offset, wsm_len, ett_wsmdata, NULL, "Wave Short Message"); if((psid == (guint32)psid_vehicle_to_vehicle_safety_and_awarenesss) && (IEEE1609dot2_handle)){ ieee1609dot2_set_next_default_psid(pinfo, psid); tvbuff_t * tvb_new = tvb_new_subset_remaining(tvb, offset); call_dissector(IEEE1609dot2_handle, tvb_new, pinfo, data_tree); } else if ((psid == (guint32)psid_intersection_safety_and_awareness) && (IEEE1609dot2_handle)) { ieee1609dot2_set_next_default_psid(pinfo, psid); tvbuff_t * tvb_new = tvb_new_subset_remaining(tvb, offset); call_dissector(IEEE1609dot2_handle, tvb_new, pinfo, data_tree); } return tvb_captured_length(tvb); } static int dissect_wsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; proto_tree *wsmp_tree, *wsmdata_tree; tvbuff_t *wsmdata_tvb; guint16 wsmlength, offset = 0; guint32 psid, supLen; guint8 elemenId, elemenLen, msb, oct, version; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "WSMP"); col_set_str(pinfo->cinfo, COL_INFO, "WAVE Short Message Protocol IEEE P1609.3"); /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_wsmp, tvb, 0, -1, ENC_NA); wsmp_tree = proto_item_add_subtree(ti, ett_wsmp); /* In Version 3 * B7 B4 B3 B2 B0 * Subtype |WSMP-NHeader | WSMP Version * | Option Indicator */ oct = tvb_get_guint8(tvb, offset); version = oct & 0x07; if (version == 3) { /* Version 3 */ return dissect_wsmp_v3(tvb, pinfo, wsmp_tree, oct); } proto_tree_add_item(wsmp_tree, hf_wsmp_version, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; offset = dissect_wsmp_psid(tvb, pinfo, wsmp_tree, offset, &psid); /* TLV decoder that does not display the T and L elements */ elemenId = tvb_get_guint8(tvb, offset); while ((elemenId != WSMP) && (elemenId != WSMP_S) && (elemenId != WSMP_I)) { offset++; if (elemenId == CHANNUM) { elemenLen = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(wsmp_tree, hf_wsmp_channel, tvb, offset, elemenLen, ENC_BIG_ENDIAN); offset += elemenLen; } else if (elemenId == DATARATE) { elemenLen = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(wsmp_tree, hf_wsmp_rate, tvb, offset, elemenLen, ENC_BIG_ENDIAN); offset += elemenLen; } else if (elemenId == TRANSMITPW) { elemenLen = tvb_get_guint8(tvb, offset); offset++; proto_tree_add_item(wsmp_tree, hf_wsmp_txpower, tvb, offset, elemenLen, ENC_BIG_ENDIAN); offset += elemenLen; } elemenId = tvb_get_guint8(tvb, offset); } proto_tree_add_item(wsmp_tree, hf_wsmp_WAVEid, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; wsmlength = tvb_get_ntohs( tvb, offset); proto_tree_add_item(wsmp_tree, hf_wsmp_wsmlength, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if (elemenId == WSMP_S) { msb = 1; supLen = 0; while (msb) { msb = tvb_get_guint8(tvb, offset + supLen); msb = msb & 0x80; supLen++; } proto_tree_add_item(wsmp_tree, hf_wsmp_WSMP_S_data, tvb, offset, supLen, ENC_BIG_ENDIAN); wsmlength -= supLen; offset += supLen; } wsmdata_tree = proto_tree_add_subtree(wsmp_tree, tvb, offset, wsmlength, ett_wsmdata, NULL, "Wave Short Message"); wsmdata_tvb = tvb_new_subset_length_caplen(tvb, offset, -1, wsmlength); /* TODO: Branch on the application context and display accordingly * Default: call the data dissector */ if (psid == 0x4070) { call_data_dissector(wsmdata_tvb, pinfo, wsmdata_tree); } return tvb_captured_length(tvb); } void proto_register_wsmp(void) { static hf_register_info hf[] = { { &hf_wsmp_version, { "Version", "wsmp.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_var_len_det, { "Length", "wsmp.len.det", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_psid, { "PSID", "wsmp.psid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_channel, { "Channel", "wsmp.channel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_rate, { "Data Rate", "wsmp.rate", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_txpower, { "Transmit Power", "wsmp.txpower", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_WAVEid, { "WAVE element id", "wsmp.WAVEid", FT_UINT8, BASE_DEC, VALS(wsmp_elemenid_names), 0x0, NULL, HFILL }}, { &hf_wsmp_wsmlength, { "WSM Length", "wsmp.wsmlength", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_WSMP_S_data, { "WAVE Supplement Data", "wsmp.supplement", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_subtype, { "Subtype", "wsmp.subtype", FT_UINT8, BASE_DEC, VALS(wsmp_subtype_vals), 0xF0, NULL, HFILL }}, { &hf_wsmp_N_header_opt_ind, { "WSMP-NHeader Option Indicator(WAVE Information Element Extension)", "wsmp.N_header_opt_ind", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL }}, { &hf_wsmp_version_v3, { "Version", "wsmp.version_v3", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }}, { &hf_wsmp_no_elements, { "Count", "wsmp.no_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_wave_ie, { "WAVE IE", "wsmp.wave_ie", FT_UINT8, BASE_DEC, VALS(wsmp_wave_information_elements_vals), 0x0, NULL, HFILL }}, { &hf_wsmp_wave_ie_len, { "Length", "wsmp.wave_ie_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_wave_ie_data, { "Data", "wsmp.wave_ie_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_wsmp_tpid, { "TPID", "wsmp.wave_ie", FT_UINT8, BASE_DEC, VALS(wsmp_tpid_vals), 0x0, NULL, HFILL }}, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wsmp, &ett_wsmdata, &ett_wsmp_n_hdr, &ett_wsmp_t_hdr, &ett_wsmp_ie_ext, &ett_wsmp_ie, }; static ei_register_info ei[] = { { &ei_wsmp_length_field_err, { "wsmp.length_field_err", PI_PROTOCOL, PI_ERROR, "Length field wrongly encoded, b6 not 0. The rest of the dissection is suspect", EXPFILL }}, { &ei_wsmp_psid_invalid, { "wsmp.psid.invalid", PI_PROTOCOL, PI_ERROR, "Invalid PSID", EXPFILL }}, }; expert_module_t* expert_wsmp; /* Register the protocol name and description */ proto_wsmp = proto_register_protocol("Wave Short Message Protocol(IEEE P1609.3)", "WSMP", "wsmp"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_wsmp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wsmp = expert_register_protocol(proto_wsmp); expert_register_field_array(expert_wsmp, ei, array_length(ei)); } void proto_reg_handoff_wsmp(void) { dissector_handle_t wsmp_handle; wsmp_handle = create_dissector_handle(dissect_wsmp, proto_wsmp); dissector_add_uint("ethertype", ETHERTYPE_WSMP, wsmp_handle); IEEE1609dot2_handle = find_dissector_add_dependency("ieee1609dot2.data", proto_wsmp); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C
wireshark/epan/dissectors/packet-wsp.c
/* packet-wsp.c * * Routines to dissect WSP component of WAP traffic. * * 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 <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter. * * WTLS support by Alexandre P. Ferreira (Splice IP). * * Openwave header support by Dermot Bradley (Openwave). * * Code optimizations, header value dissection simplification with parse error * notification and macros, extra missing headers, WBXML registration, * summary line of WSP PDUs, * Session Initiation Request dissection * by Olivier Biot. * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <epan/packet.h> #include <epan/to_str.h> #include <epan/expert.h> #include <epan/conversation.h> #include <epan/iana_charsets.h> #include <wsutil/str_util.h> #include "packet-wap.h" #include "packet-wsp.h" /* Statistics (see doc/README.tapping) */ #include <epan/stat_tap_ui.h> #include <epan/tap.h> void proto_register_wsp(void); void proto_reg_handoff_wsp(void); void proto_register_sir(void); void proto_reg_handoff_sir(void); static int wsp_tap = -1; /* File scoped variables for the protocol and registered fields */ static int proto_wsp = -1; static int proto_sir = -1; /* * Initialize the header field pointers */ /* WSP header fields and their subfields if available */ static int hf_hdr_name_value = -1; static int hf_hdr_name_string = -1; static int hf_hdr_accept = -1; static int hf_hdr_accept_charset = -1; static int hf_hdr_accept_encoding = -1; static int hf_hdr_accept_language = -1; static int hf_hdr_accept_ranges = -1; static int hf_hdr_age = -1; static int hf_hdr_allow = -1; static int hf_hdr_authorization = -1; static int hf_hdr_authorization_scheme = -1; /* Subfield */ static int hf_hdr_authorization_user_id = -1; /* Subfield */ static int hf_hdr_authorization_password = -1; /* Subfield */ static int hf_hdr_cache_control = -1; static int hf_hdr_connection = -1; static int hf_hdr_content_base = -1; static int hf_hdr_content_encoding = -1; static int hf_hdr_content_language = -1; static int hf_hdr_content_length = -1; static int hf_hdr_content_location = -1; static int hf_hdr_content_md5 = -1; static int hf_hdr_content_range = -1; static int hf_hdr_content_range_first_byte_pos = -1; /* Subfield */ static int hf_hdr_content_range_entity_length = -1; /* Subfield */ static int hf_hdr_content_type = -1; static int hf_hdr_date = -1; static int hf_hdr_etag = -1; static int hf_hdr_expires = -1; static int hf_hdr_from = -1; static int hf_hdr_host = -1; static int hf_hdr_if_modified_since = -1; static int hf_hdr_if_match = -1; static int hf_hdr_if_none_match = -1; static int hf_hdr_if_range = -1; static int hf_hdr_if_unmodified_since = -1; static int hf_hdr_last_modified = -1; static int hf_hdr_location = -1; static int hf_hdr_max_forwards = -1; static int hf_hdr_pragma = -1; static int hf_hdr_proxy_authenticate = -1; static int hf_hdr_proxy_authenticate_scheme = -1; /* Subfield */ static int hf_hdr_proxy_authenticate_realm = -1; /* Subfield */ static int hf_hdr_proxy_authorization = -1; static int hf_hdr_proxy_authorization_scheme = -1; /* Subfield */ static int hf_hdr_proxy_authorization_user_id = -1; /* Subfield */ static int hf_hdr_proxy_authorization_password = -1; /* Subfield */ static int hf_hdr_public = -1; static int hf_hdr_range = -1; static int hf_hdr_range_first_byte_pos = -1; /* Subfield */ static int hf_hdr_range_last_byte_pos = -1; /* Subfield */ static int hf_hdr_range_suffix_length = -1; /* Subfield */ static int hf_hdr_referer = -1; static int hf_hdr_retry_after = -1; static int hf_hdr_server = -1; static int hf_hdr_transfer_encoding = -1; static int hf_hdr_upgrade = -1; static int hf_hdr_user_agent = -1; static int hf_hdr_vary = -1; static int hf_hdr_via = -1; static int hf_hdr_warning = -1; static int hf_hdr_warning_code = -1; /* Subfield */ static int hf_hdr_warning_agent = -1; /* Subfield */ static int hf_hdr_warning_text = -1; /* Subfield */ static int hf_hdr_www_authenticate = -1; static int hf_hdr_www_authenticate_scheme = -1; /* Subfield */ static int hf_hdr_www_authenticate_realm = -1; /* Subfield */ static int hf_hdr_content_disposition = -1; static int hf_hdr_application_id = -1; static int hf_hdr_content_uri = -1; static int hf_hdr_initiator_uri = -1; static int hf_hdr_bearer_indication = -1; static int hf_hdr_push_flag = -1; static int hf_hdr_push_flag_auth = -1; /* Subfield */ static int hf_hdr_push_flag_trust = -1; /* Subfield */ static int hf_hdr_push_flag_last = -1; /* Subfield */ static int hf_hdr_profile = -1; static int hf_hdr_profile_diff = -1; static int hf_hdr_profile_warning = -1; static int hf_hdr_expect = -1; static int hf_hdr_te = -1; static int hf_hdr_trailer = -1; static int hf_hdr_x_wap_tod = -1; static int hf_hdr_content_id = -1; static int hf_hdr_set_cookie = -1; static int hf_hdr_cookie = -1; static int hf_hdr_encoding_version = -1; static int hf_hdr_x_wap_security = -1; static int hf_hdr_x_wap_application_id = -1; static int hf_hdr_accept_application = -1; /* Openwave headers */ static int hf_hdr_openwave_default_int = -1; static int hf_hdr_openwave_default_string = -1; static int hf_hdr_openwave_default_val_len = -1; static int hf_hdr_openwave_name_value = -1; static int hf_hdr_openwave_x_up_proxy_operator_domain = -1; static int hf_hdr_openwave_x_up_proxy_home_page = -1; static int hf_hdr_openwave_x_up_proxy_uplink_version = -1; static int hf_hdr_openwave_x_up_proxy_ba_realm = -1; static int hf_hdr_openwave_x_up_proxy_request_uri = -1; #if 0 static int hf_hdr_openwave_x_up_proxy_client_id = -1; #endif static int hf_hdr_openwave_x_up_proxy_bookmark = -1; static int hf_hdr_openwave_x_up_proxy_push_seq = -1; static int hf_hdr_openwave_x_up_proxy_notify = -1; static int hf_hdr_openwave_x_up_proxy_net_ask = -1; static int hf_hdr_openwave_x_up_proxy_tod = -1; static int hf_hdr_openwave_x_up_proxy_ba_enable = -1; static int hf_hdr_openwave_x_up_proxy_redirect_enable = -1; static int hf_hdr_openwave_x_up_proxy_redirect_status = -1; static int hf_hdr_openwave_x_up_proxy_linger = -1; static int hf_hdr_openwave_x_up_proxy_enable_trust = -1; static int hf_hdr_openwave_x_up_proxy_trust = -1; static int hf_hdr_openwave_x_up_devcap_has_color = -1; static int hf_hdr_openwave_x_up_devcap_num_softkeys = -1; static int hf_hdr_openwave_x_up_devcap_softkey_size = -1; static int hf_hdr_openwave_x_up_devcap_screen_chars = -1; static int hf_hdr_openwave_x_up_devcap_screen_pixels = -1; static int hf_hdr_openwave_x_up_devcap_em_size = -1; static int hf_hdr_openwave_x_up_devcap_screen_depth = -1; static int hf_hdr_openwave_x_up_devcap_immed_alert = -1; static int hf_hdr_openwave_x_up_devcap_gui = -1; static int hf_hdr_openwave_x_up_proxy_trans_charset = -1; static int hf_hdr_openwave_x_up_proxy_push_accept = -1; /* WSP parameter fields */ static int hf_parameter_q = -1; static int hf_parameter_charset = -1; /* Old header fields */ static int hf_wsp_header_tid = -1; static int hf_wsp_header_pdu_type = -1; static int hf_wsp_version_major = -1; static int hf_wsp_version_minor = -1; /* Session capabilities (CO-WSP) */ static int hf_capabilities_length = -1; static int hf_capabilities_section = -1; static int hf_capa_client_sdu_size = -1; static int hf_capa_server_sdu_size = -1; static int hf_capa_protocol_options = -1; static int hf_capa_protocol_option_confirmed_push = -1; /* Subfield */ static int hf_capa_protocol_option_push = -1; /* Subfield */ static int hf_capa_protocol_option_session_resume = -1; /* Subfield */ static int hf_capa_protocol_option_ack_headers = -1; /* Subfield */ static int hf_capa_protocol_option_large_data_transfer = -1; /* Subfield */ static int hf_capa_method_mor = -1; static int hf_capa_push_mor = -1; static int hf_capa_extended_method = -1; static int hf_capa_header_code_page = -1; static int hf_capa_aliases = -1; static int hf_capa_client_message_size = -1; static int hf_capa_server_message_size = -1; static int hf_wsp_header_uri_len = -1; static int hf_wsp_header_uri = -1; static int hf_wsp_server_session_id = -1; static int hf_wsp_header_status = -1; static int hf_wsp_header_length = -1; static int hf_wsp_headers_section = -1; static int hf_wsp_parameter_untype_quote_text = -1; static int hf_wsp_parameter_untype_text = -1; static int hf_wsp_parameter_untype_int = -1; static int hf_wsp_parameter_type = -1; static int hf_wsp_parameter_int_type = -1; static int hf_wsp_parameter_name = -1; static int hf_wsp_parameter_filename = -1; static int hf_wsp_parameter_start = -1; static int hf_wsp_parameter_start_info = -1; static int hf_wsp_parameter_comment = -1; static int hf_wsp_parameter_domain = -1; static int hf_wsp_parameter_path = -1; static int hf_wsp_parameter_sec = -1; static int hf_wsp_parameter_mac = -1; static int hf_wsp_parameter_upart_type = -1; static int hf_wsp_parameter_level = -1; static int hf_wsp_parameter_size = -1; #if 0 static int hf_wsp_reply_data = -1; #endif static int hf_wsp_post_data = -1; #if 0 static int hf_wsp_push_data = -1; static int hf_wsp_multipart_data = -1; #endif static int hf_wsp_mpart = -1; static int hf_wsp_header_text_value = -1; static int hf_wsp_variable_value = -1; static int hf_wsp_default_int = -1; static int hf_wsp_default_string = -1; static int hf_wsp_default_val_len = -1; /* Header code page shift sequence */ static int hf_wsp_header_shift_code = -1; /* WSP Redirect fields */ static int hf_wsp_redirect_flags = -1; static int hf_wsp_redirect_permanent = -1; static int hf_wsp_redirect_reuse_security_session = -1; static int hf_redirect_addresses = -1; /* Address fields */ static int hf_address_entry = -1; static int hf_address_flags_length = -1; static int hf_address_flags_length_bearer_type_included = -1; /* Subfield */ static int hf_address_flags_length_port_number_included = -1; /* Subfield */ static int hf_address_flags_length_address_len = -1; /* Subfield */ static int hf_address_bearer_type = -1; static int hf_address_port_num = -1; static int hf_address_ipv4_addr = -1; static int hf_address_ipv6_addr = -1; static int hf_address_addr = -1; /* Session Initiation Request fields */ static int hf_sir_section = -1; static int hf_sir_version = -1; static int hf_sir_app_id_list_len = -1; static int hf_sir_app_id_list = -1; static int hf_sir_wsp_contact_points_len = -1; static int hf_sir_wsp_contact_points = -1; static int hf_sir_contact_points_len = -1; static int hf_sir_contact_points = -1; static int hf_sir_protocol_options_len = -1; static int hf_sir_protocol_options = -1; static int hf_sir_prov_url_len = -1; static int hf_sir_prov_url = -1; static int hf_sir_cpi_tag_len = -1; static int hf_sir_cpi_tag = -1; /* * Initialize the subtree pointers */ /* WSP tree */ static int ett_wsp = -1; /* WSP headers tree */ static int ett_header = -1; /* WSP header subtree */ static int ett_headers = -1; static int ett_wsp_parameter_type = -1; static int ett_content_type_header = -1; /* CO-WSP session capabilities */ static int ett_capabilities = -1; static int ett_capabilities_entry = -1; static int ett_proto_option_capability = -1; static int ett_capabilities_header_code_pages = -1; static int ett_capabilities_extended_methods = -1; static int ett_post = -1; static int ett_redirect_flags = -1; static int ett_address_flags = -1; static int ett_multiparts = -1; static int ett_mpartlist = -1; /* Session Initiation Request tree */ static int ett_sir = -1; static int ett_addresses = -1; static int ett_address = -1; static int ett_default = -1; static int ett_add_content_type = -1; static int ett_accept_x_q_header = -1; static int ett_push_flag = -1; static int ett_profile_diff_wbxml = -1; static int ett_allow = -1; static int ett_public = -1; static int ett_vary = -1; static int ett_x_wap_security = -1; static int ett_connection = -1; static int ett_transfer_encoding = -1; static int ett_accept_ranges = -1; static int ett_content_encoding = -1; static int ett_accept_encoding = -1; static int ett_content_disposition = -1; static int ett_text_header = -1; static int ett_content_id = -1; static int ett_text_or_date_value = -1; static int ett_date_value = -1; static int ett_tod_value = -1; static int ett_age = -1; static int ett_integer_lookup = -1; static int ett_challenge = -1; static int ett_credentials_value = -1; static int ett_content_md5 = -1; static int ett_pragma = -1; static int ett_integer_value = -1; static int ett_integer_lookup_value = -1; static int ett_cache_control = -1; static int ett_warning = -1; static int ett_profile_warning = -1; static int ett_encoding_version = -1; static int ett_content_range = -1; static int ett_range = -1; static int ett_te_value = -1; static int ett_openwave_default = -1; static expert_field ei_wsp_capability_invalid = EI_INIT; static expert_field ei_wsp_capability_length_invalid = EI_INIT; static expert_field ei_wsp_capability_encoding_invalid = EI_INIT; static expert_field ei_wsp_text_field_invalid = EI_INIT; static expert_field ei_wsp_header_invalid_value = EI_INIT; static expert_field ei_wsp_invalid_parameter_value = EI_INIT; static expert_field ei_wsp_undecoded_parameter = EI_INIT; static expert_field ei_hdr_x_wap_tod = EI_INIT; static expert_field ei_wsp_trailing_quote = EI_INIT; static expert_field ei_wsp_header_invalid = EI_INIT; static expert_field ei_wsp_oversized_uintvar = EI_INIT; /* Handle for WSP-over-UDP dissector */ static dissector_handle_t wsp_fromudp_handle; /* Handle for WTP-over-UDP dissector */ static dissector_handle_t wtp_fromudp_handle; /* Handle for coap dissector */ static dissector_handle_t coap_handle; /* Handle for generic media dissector */ static dissector_handle_t media_handle; /* Handle for WBXML-encoded UAPROF dissector */ static dissector_handle_t wbxml_uaprof_handle; static const value_string wsp_vals_pdu_type[] = { { 0x00, "Reserved" }, { 0x01, "Connect" }, { 0x02, "ConnectReply" }, { 0x03, "Redirect" }, { 0x04, "Reply" }, { 0x05, "Disconnect" }, { 0x06, "Push" }, { 0x07, "ConfirmedPush" }, { 0x08, "Suspend" }, { 0x09, "Resume" }, /* 0x10 - 0x3F Unassigned */ { 0x40, "Get" }, { 0x41, "Options" }, { 0x42, "Head" }, { 0x43, "Delete" }, { 0x44, "Trace" }, /* 0x45 - 0x4F Unassigned (Get PDU) */ /* 0x50 - 0x5F Extended method (Get PDU) */ { 0x50, "Extended Get Method 0"}, { 0x51, "Extended Get Method 1"}, { 0x52, "Extended Get Method 2"}, { 0x53, "Extended Get Method 3"}, { 0x54, "Extended Get Method 4"}, { 0x55, "Extended Get Method 5"}, { 0x56, "Extended Get Method 6"}, { 0x57, "Extended Get Method 7"}, { 0x58, "Extended Get Method 8"}, { 0x59, "Extended Get Method 9"}, { 0x5A, "Extended Get Method 10"}, { 0x5B, "Extended Get Method 11"}, { 0x5C, "Extended Get Method 12"}, { 0x5D, "Extended Get Method 13"}, { 0x5E, "Extended Get Method 14"}, { 0x5F, "Extended Get Method 15"}, { 0x60, "Post" }, { 0x61, "Put" }, /* 0x62 - 0x6F Unassigned (Post PDU) */ /* 0x70 - 0x7F Extended method (Post PDU) */ { 0x70, "Extended Post Method 0"}, { 0x71, "Extended Post Method 1"}, { 0x72, "Extended Post Method 2"}, { 0x73, "Extended Post Method 3"}, { 0x74, "Extended Post Method 4"}, { 0x75, "Extended Post Method 5"}, { 0x76, "Extended Post Method 6"}, { 0x77, "Extended Post Method 7"}, { 0x78, "Extended Post Method 8"}, { 0x79, "Extended Post Method 9"}, { 0x7A, "Extended Post Method 10"}, { 0x7B, "Extended Post Method 11"}, { 0x7C, "Extended Post Method 12"}, { 0x7D, "Extended Post Method 13"}, { 0x7E, "Extended Post Method 14"}, { 0x7F, "Extended Post Method 15"}, /* 0x80 - 0xFF Reserved */ { 0x00, NULL } }; value_string_ext wsp_vals_pdu_type_ext = VALUE_STRING_EXT_INIT(wsp_vals_pdu_type); /* The WSP status codes are inherited from the HTTP status codes */ static const value_string wsp_vals_status[] = { /* 0x00 - 0x0F Reserved */ { 0x10, "100 Continue" }, { 0x11, "101 Switching Protocols" }, { 0x20, "200 OK" }, { 0x21, "201 Created" }, { 0x22, "202 Accepted" }, { 0x23, "203 Non-Authoritative Information" }, { 0x24, "204 No Content" }, { 0x25, "205 Reset Content" }, { 0x26, "206 Partial Content" }, { 0x30, "300 Multiple Choices" }, { 0x31, "301 Moved Permanently" }, { 0x32, "302 Moved Temporarily" }, { 0x33, "303 See Other" }, { 0x34, "304 Not Modified" }, { 0x35, "305 Use Proxy" }, { 0x37, "307 Temporary Redirect" }, { 0x40, "400 Bad Request" }, { 0x41, "401 Unauthorised" }, { 0x42, "402 Payment Required" }, { 0x43, "403 Forbidden" }, { 0x44, "404 Not Found" }, { 0x45, "405 Method Not Allowed" }, { 0x46, "406 Not Acceptable" }, { 0x47, "407 Proxy Authentication Required" }, { 0x48, "408 Request Timeout" }, { 0x49, "409 Conflict" }, { 0x4A, "410 Gone" }, { 0x4B, "411 Length Required" }, { 0x4C, "412 Precondition Failed" }, { 0x4D, "413 Request Entity Too Large" }, { 0x4E, "414 Request-URI Too Large" }, { 0x4F, "415 Unsupported Media Type" }, { 0x50, "416 Requested Range Not Satisfiable" }, { 0x51, "417 Expectation Failed" }, { 0x60, "500 Internal Server Error" }, { 0x61, "501 Not Implemented" }, { 0x62, "502 Bad Gateway" }, { 0x63, "503 Service Unavailable" }, { 0x64, "504 Gateway Timeout" }, { 0x65, "505 WSP/HTTP Version Not Supported" }, { 0x00, NULL } }; value_string_ext wsp_vals_status_ext = VALUE_STRING_EXT_INIT(wsp_vals_status); static const value_string vals_wsp_reason_codes[] = { { 0xE0, "Protocol Error (Illegal PDU)" }, { 0xE1, "Session disconnected" }, { 0xE2, "Session suspended" }, { 0xE3, "Session resumed" }, { 0xE4, "Peer congested" }, { 0xE5, "Session connect failed" }, { 0xE6, "Maximum receive unit size exceeded" }, { 0xE7, "Maximum outstanding requests exceeded" }, { 0xE8, "Peer request" }, { 0xE9, "Network error" }, { 0xEA, "User request" }, { 0xEB, "No specific cause, no retries" }, { 0xEC, "Push message cannot be delivered" }, { 0xED, "Push message discarded" }, { 0xEE, "Content type cannot be processed" }, { 0x00, NULL } }; value_string_ext vals_wsp_reason_codes_ext = VALUE_STRING_EXT_INIT(vals_wsp_reason_codes); /* * Field names. */ #define FN_ACCEPT 0x00 #define FN_ACCEPT_CHARSET_DEP 0x01 /* encoding version 1.1, deprecated */ #define FN_ACCEPT_ENCODING_DEP 0x02 /* encoding version 1.1, deprecated */ #define FN_ACCEPT_LANGUAGE 0x03 #define FN_ACCEPT_RANGES 0x04 #define FN_AGE 0x05 #define FN_ALLOW 0x06 #define FN_AUTHORIZATION 0x07 #define FN_CACHE_CONTROL_DEP 0x08 /* encoding version 1.1, deprecated */ #define FN_CONNECTION 0x09 #define FN_CONTENT_BASE 0x0A #define FN_CONTENT_ENCODING 0x0B #define FN_CONTENT_LANGUAGE 0x0C #define FN_CONTENT_LENGTH 0x0D #define FN_CONTENT_LOCATION 0x0E #define FN_CONTENT_MD5 0x0F #define FN_CONTENT_RANGE_DEP 0x10 /* encoding version 1.1, deprecated */ #define FN_CONTENT_TYPE 0x11 #define FN_DATE 0x12 #define FN_ETAG 0x13 #define FN_EXPIRES 0x14 #define FN_FROM 0x15 #define FN_HOST 0x16 #define FN_IF_MODIFIED_SINCE 0x17 #define FN_IF_MATCH 0x18 #define FN_IF_NONE_MATCH 0x19 #define FN_IF_RANGE 0x1A #define FN_IF_UNMODIFIED_SINCE 0x1B #define FN_LOCATION 0x1C #define FN_LAST_MODIFIED 0x1D #define FN_MAX_FORWARDS 0x1E #define FN_PRAGMA 0x1F #define FN_PROXY_AUTHENTICATE 0x20 #define FN_PROXY_AUTHORIZATION 0x21 #define FN_PUBLIC 0x22 #define FN_RANGE 0x23 #define FN_REFERER 0x24 #define FN_RETRY_AFTER 0x25 #define FN_SERVER 0x26 #define FN_TRANSFER_ENCODING 0x27 #define FN_UPGRADE 0x28 #define FN_USER_AGENT 0x29 #define FN_VARY 0x2A #define FN_VIA 0x2B #define FN_WARNING 0x2C #define FN_WWW_AUTHENTICATE 0x2D #define FN_CONTENT_DISPOSITION 0x2E #define FN_X_WAP_APPLICATION_ID 0x2F #define FN_X_WAP_CONTENT_URI 0x30 #define FN_X_WAP_INITIATOR_URI 0x31 #define FN_ACCEPT_APPLICATION 0x32 #define FN_BEARER_INDICATION 0x33 #define FN_PUSH_FLAG 0x34 #define FN_PROFILE 0x35 #define FN_PROFILE_DIFF 0x36 #define FN_PROFILE_WARNING 0x37 #define FN_EXPECT 0x38 #define FN_TE 0x39 #define FN_TRAILER 0x3A #define FN_ACCEPT_CHARSET 0x3B /* encoding version 1.3 */ #define FN_ACCEPT_ENCODING 0x3C /* encoding version 1.3 */ #define FN_CACHE_CONTROL 0x3D /* encoding version 1.3 */ #define FN_CONTENT_RANGE 0x3E /* encoding version 1.3 */ #define FN_X_WAP_TOD 0x3F #define FN_CONTENT_ID 0x40 #define FN_SET_COOKIE 0x41 #define FN_COOKIE 0x42 #define FN_ENCODING_VERSION 0x43 #define FN_PROFILE_WARNING14 0x44 /* encoding version 1.4 */ #define FN_CONTENT_DISPOSITION14 0x45 /* encoding version 1.4 */ #define FN_X_WAP_SECURITY 0x46 #define FN_CACHE_CONTROL14 0x47 /* encoding version 1.4 */ #define FN_EXPECT15 0x48 /* encoding version 1.5 */ #define FN_X_WAP_LOC_INVOCATION 0x49 #define FN_X_WAP_LOC_DELIVERY 0x4A /* * Openwave field names. */ #define FN_OPENWAVE_PROXY_PUSH_ADDR 0x00 #define FN_OPENWAVE_PROXY_PUSH_ACCEPT 0x01 #define FN_OPENWAVE_PROXY_PUSH_SEQ 0x02 #define FN_OPENWAVE_PROXY_NOTIFY 0x03 #define FN_OPENWAVE_PROXY_OPERATOR_DOMAIN 0x04 #define FN_OPENWAVE_PROXY_HOME_PAGE 0x05 #define FN_OPENWAVE_DEVCAP_HAS_COLOR 0x06 #define FN_OPENWAVE_DEVCAP_NUM_SOFTKEYS 0x07 #define FN_OPENWAVE_DEVCAP_SOFTKEY_SIZE 0x08 #define FN_OPENWAVE_DEVCAP_SCREEN_CHARS 0x09 #define FN_OPENWAVE_DEVCAP_SCREEN_PIXELS 0x0A #define FN_OPENWAVE_DEVCAP_EM_SIZE 0x0B #define FN_OPENWAVE_DEVCAP_SCREEN_DEPTH 0x0C #define FN_OPENWAVE_DEVCAP_IMMED_ALERT 0x0D #define FN_OPENWAVE_PROXY_NET_ASK 0x0E #define FN_OPENWAVE_PROXY_UPLINK_VERSION 0x0F #define FN_OPENWAVE_PROXY_TOD 0x10 #define FN_OPENWAVE_PROXY_BA_ENABLE 0x11 #define FN_OPENWAVE_PROXY_BA_REALM 0x12 #define FN_OPENWAVE_PROXY_REDIRECT_ENABLE 0x13 #define FN_OPENWAVE_PROXY_REQUEST_URI 0x14 #define FN_OPENWAVE_PROXY_REDIRECT_STATUS 0x15 #define FN_OPENWAVE_PROXY_TRANS_CHARSET 0x16 #define FN_OPENWAVE_PROXY_LINGER 0x17 #define FN_OPENWAVE_PROXY_CLIENT_ID 0x18 #define FN_OPENWAVE_PROXY_ENABLE_TRUST 0x19 #define FN_OPENWAVE_PROXY_TRUST_OLD 0x1A #define FN_OPENWAVE_PROXY_TRUST 0x20 #define FN_OPENWAVE_PROXY_BOOKMARK 0x21 #define FN_OPENWAVE_DEVCAP_GUI 0x22 static const value_string vals_openwave_field_names[] = { { FN_OPENWAVE_PROXY_PUSH_ADDR, "x-up-proxy-push-addr" }, { FN_OPENWAVE_PROXY_PUSH_ACCEPT, "x-up-proxy-push-accept" }, { FN_OPENWAVE_PROXY_PUSH_SEQ, "x-up-proxy-seq" }, { FN_OPENWAVE_PROXY_NOTIFY, "x-up-proxy-notify" }, { FN_OPENWAVE_PROXY_OPERATOR_DOMAIN, "x-up-proxy-operator-domain" }, { FN_OPENWAVE_PROXY_HOME_PAGE, "x-up-proxy-home-page" }, { FN_OPENWAVE_DEVCAP_HAS_COLOR, "x-up-devcap-has-color" }, { FN_OPENWAVE_DEVCAP_NUM_SOFTKEYS, "x-up-devcap-num-softkeys" }, { FN_OPENWAVE_DEVCAP_SOFTKEY_SIZE, "x-up-devcap-softkey-size" }, { FN_OPENWAVE_DEVCAP_SCREEN_CHARS, "x-up-devcap-screen-chars" }, { FN_OPENWAVE_DEVCAP_SCREEN_PIXELS, "x-up-devcap-screen-pixels" }, { FN_OPENWAVE_DEVCAP_EM_SIZE, "x-up-devcap-em-size" }, { FN_OPENWAVE_DEVCAP_SCREEN_DEPTH, "x-up-devcap-screen-depth" }, { FN_OPENWAVE_DEVCAP_IMMED_ALERT, "x-up-devcap-immed-alert" }, { FN_OPENWAVE_PROXY_NET_ASK, "x-up-proxy-net-ask" }, { FN_OPENWAVE_PROXY_UPLINK_VERSION, "x-up-proxy-uplink-version" }, { FN_OPENWAVE_PROXY_TOD, "x-up-proxy-tod" }, { FN_OPENWAVE_PROXY_BA_ENABLE, "x-up-proxy-ba-enable" }, { FN_OPENWAVE_PROXY_BA_REALM, "x-up-proxy-ba-realm" }, { FN_OPENWAVE_PROXY_REDIRECT_ENABLE, "x-up-proxy-redirect-enable" }, { FN_OPENWAVE_PROXY_REQUEST_URI, "x-up-proxy-request-uri" }, { FN_OPENWAVE_PROXY_REDIRECT_STATUS, "x-up-proxy-redirect-status" }, { FN_OPENWAVE_PROXY_TRANS_CHARSET, "x-up-proxy-trans-charset" }, { FN_OPENWAVE_PROXY_LINGER, "x-up-proxy-linger" }, { FN_OPENWAVE_PROXY_CLIENT_ID, "x-up-proxy-client-id" }, { FN_OPENWAVE_PROXY_ENABLE_TRUST, "x-up-proxy-enable-trust" }, { FN_OPENWAVE_PROXY_TRUST_OLD, "x-up-proxy-trust-old" }, { FN_OPENWAVE_PROXY_TRUST, "x-up-proxy-trust" }, { FN_OPENWAVE_PROXY_BOOKMARK, "x-up-proxy-bookmark" }, { FN_OPENWAVE_DEVCAP_GUI, "x-up-devcap-gui" }, { 0, NULL } }; static value_string_ext vals_openwave_field_names_ext = VALUE_STRING_EXT_INIT(vals_openwave_field_names); static const value_string vals_field_names[] = { { FN_ACCEPT, "Accept" }, { FN_ACCEPT_CHARSET_DEP, "Accept-Charset (encoding 1.1)" }, { FN_ACCEPT_ENCODING_DEP, "Accept-Encoding (encoding 1.1)" }, { FN_ACCEPT_LANGUAGE, "Accept-Language" }, { FN_ACCEPT_RANGES, "Accept-Ranges" }, { FN_AGE, "Age" }, { FN_ALLOW, "Allow" }, { FN_AUTHORIZATION, "Authorization" }, { FN_CACHE_CONTROL_DEP, "Cache-Control (encoding 1.1)" }, { FN_CONNECTION, "Connection" }, { FN_CONTENT_BASE, "Content-Base" }, { FN_CONTENT_ENCODING, "Content-Encoding" }, { FN_CONTENT_LANGUAGE, "Content-Language" }, { FN_CONTENT_LENGTH, "Content-Length" }, { FN_CONTENT_LOCATION, "Content-Location" }, { FN_CONTENT_MD5, "Content-MD5" }, { FN_CONTENT_RANGE_DEP, "Content-Range (encoding 1.1)" }, { FN_CONTENT_TYPE, "Content-Type" }, { FN_DATE, "Date" }, { FN_ETAG, "ETag" }, { FN_EXPIRES, "Expires" }, { FN_FROM, "From" }, { FN_HOST, "Host" }, { FN_IF_MODIFIED_SINCE, "If-Modified-Since" }, { FN_IF_MATCH, "If-Match" }, { FN_IF_NONE_MATCH, "If-None-Match" }, { FN_IF_RANGE, "If-Range" }, { FN_IF_UNMODIFIED_SINCE, "If-Unmodified-Since" }, { FN_LOCATION, "Location" }, { FN_LAST_MODIFIED, "Last-Modified" }, { FN_MAX_FORWARDS, "Max-Forwards" }, { FN_PRAGMA, "Pragma" }, { FN_PROXY_AUTHENTICATE, "Proxy-Authenticate" }, { FN_PROXY_AUTHORIZATION, "Proxy-Authorization" }, { FN_PUBLIC, "Public" }, { FN_RANGE, "Range" }, { FN_REFERER, "Referer" }, { FN_RETRY_AFTER, "Retry-After" }, { FN_SERVER, "Server" }, { FN_TRANSFER_ENCODING, "Transfer-Encoding" }, { FN_UPGRADE, "Upgrade" }, { FN_USER_AGENT, "User-Agent" }, { FN_VARY, "Vary" }, { FN_VIA, "Via" }, { FN_WARNING, "Warning" }, { FN_WWW_AUTHENTICATE, "WWW-Authenticate" }, { FN_CONTENT_DISPOSITION, "Content-Disposition" }, { FN_X_WAP_APPLICATION_ID, "X-Wap-Application-ID" }, { FN_X_WAP_CONTENT_URI, "X-Wap-Content-URI" }, { FN_X_WAP_INITIATOR_URI, "X-Wap-Initiator-URI" }, { FN_ACCEPT_APPLICATION, "Accept-Application" }, { FN_BEARER_INDICATION, "Bearer-Indication" }, { FN_PUSH_FLAG, "Push-Flag" }, { FN_PROFILE, "Profile" }, { FN_PROFILE_DIFF, "Profile-Diff" }, { FN_PROFILE_WARNING, "Profile-Warning" }, { FN_EXPECT, "Expect" }, { FN_TE, "TE" }, { FN_TRAILER, "Trailer" }, { FN_ACCEPT_CHARSET, "Accept-Charset" }, { FN_ACCEPT_ENCODING, "Accept-Encoding" }, { FN_CACHE_CONTROL, "Cache-Control" }, { FN_CONTENT_RANGE, "Content-Range" }, { FN_X_WAP_TOD, "X-Wap-Tod" }, { FN_CONTENT_ID, "Content-ID" }, { FN_SET_COOKIE, "Set-Cookie" }, { FN_COOKIE, "Cookie" }, { FN_ENCODING_VERSION, "Encoding-Version" }, { FN_PROFILE_WARNING14, "Profile-Warning (encoding 1.4)" }, { FN_CONTENT_DISPOSITION14,"Content-Disposition (encoding 1.4)" }, { FN_X_WAP_SECURITY, "X-WAP-Security" }, { FN_CACHE_CONTROL14, "Cache-Control (encoding 1.4)" }, /* encoding-version 1.5 */ { FN_EXPECT15, "Expect (encoding 1.5)" }, { FN_X_WAP_LOC_INVOCATION, "X-Wap-Loc-Invocation" }, { FN_X_WAP_LOC_DELIVERY, "X-Wap-Loc-Delivery" }, { 0, NULL } }; static value_string_ext vals_field_names_ext = VALUE_STRING_EXT_INIT(vals_field_names); /* * Bearer types (from the WDP specification). */ #define BT_IPv4 0x00 #define BT_IPv6 0x01 #define BT_GSM_USSD 0x02 #define BT_GSM_SMS 0x03 #define BT_ANSI_136_GUTS 0x04 #define BT_IS_95_SMS 0x05 #define BT_IS_95_CSD 0x06 #define BT_IS_95_PACKET_DATA 0x07 #define BT_ANSI_136_CSD 0x08 #define BT_ANSI_136_PACKET_DATA 0x09 #define BT_GSM_CSD 0x0A #define BT_GSM_GPRS 0x0B #define BT_GSM_USSD_IPv4 0x0C #define BT_AMPS_CDPD 0x0D #define BT_PDC_CSD 0x0E #define BT_PDC_PACKET_DATA 0x0F #define BT_IDEN_SMS 0x10 #define BT_IDEN_CSD 0x11 #define BT_IDEN_PACKET_DATA 0x12 #define BT_PAGING_FLEX 0x13 #define BT_PHS_SMS 0x14 #define BT_PHS_CSD 0x15 #define BT_GSM_USSD_GSM_SC 0x16 #define BT_TETRA_SDS_ITSI 0x17 #define BT_TETRA_SDS_MSISDN 0x18 #define BT_TETRA_PACKET_DATA 0x19 #define BT_PAGING_REFLEX 0x1A #define BT_GSM_USSD_MSISDN 0x1B #define BT_MOBITEX_MPAK 0x1C #define BT_ANSI_136_GHOST 0x1D static const value_string vals_bearer_types[] = { { BT_IPv4, "IPv4" }, { BT_IPv6, "IPv6" }, { BT_GSM_USSD, "GSM USSD" }, { BT_GSM_SMS, "GSM SMS" }, { BT_ANSI_136_GUTS, "ANSI-136 GUTS/R-Data" }, { BT_IS_95_SMS, "IS-95 CDMA SMS" }, { BT_IS_95_CSD, "IS-95 CDMA CSD" }, { BT_IS_95_PACKET_DATA, "IS-95 CDMA Packet data" }, { BT_ANSI_136_CSD, "ANSI-136 CSD" }, { BT_ANSI_136_PACKET_DATA, "ANSI-136 Packet data" }, { BT_GSM_CSD, "GSM CSD" }, { BT_GSM_GPRS, "GSM GPRS" }, { BT_GSM_USSD_IPv4, "GSM USSD (IPv4 addresses)" }, { BT_AMPS_CDPD, "AMPS CDPD" }, { BT_PDC_CSD, "PDC CSD" }, { BT_PDC_PACKET_DATA, "PDC Packet data" }, { BT_IDEN_SMS, "IDEN SMS" }, { BT_IDEN_CSD, "IDEN CSD" }, { BT_IDEN_PACKET_DATA, "IDEN Packet data" }, { BT_PAGING_FLEX, "Paging network FLEX(TM)" }, { BT_PHS_SMS, "PHS SMS" }, { BT_PHS_CSD, "PHS CSD" }, { BT_GSM_USSD_GSM_SC, "GSM USSD (GSM Service Code addresses)" }, { BT_TETRA_SDS_ITSI, "TETRA SDS (ITSI addresses)" }, { BT_TETRA_SDS_MSISDN, "TETRA SDS (MSISDN addresses)" }, { BT_TETRA_PACKET_DATA, "TETRA Packet data" }, { BT_PAGING_REFLEX, "Paging network ReFLEX(TM)" }, { BT_GSM_USSD_MSISDN, "GSM USSD (MSISDN addresses)" }, { BT_MOBITEX_MPAK, "Mobitex MPAK" }, { BT_ANSI_136_GHOST, "ANSI-136 GHOST/R-Data" }, { 0, NULL } }; static value_string_ext vals_bearer_types_ext = VALUE_STRING_EXT_INIT(vals_bearer_types); static const value_string vals_content_types[] = { /* Well-known media types */ /* XXX: hack: "..." "..." used to define several strings so that checkAPIs & etc won't see a 'start of comment' */ { 0x00, "*" "/" "*" }, { 0x01, "text/" "*" }, { 0x02, "text/html" }, { 0x03, "text/plain" }, { 0x04, "text/x-hdml" }, { 0x05, "text/x-ttml" }, { 0x06, "text/x-vCalendar" }, { 0x07, "text/x-vCard" }, { 0x08, "text/vnd.wap.wml" }, { 0x09, "text/vnd.wap.wmlscript" }, { 0x0A, "text/vnd.wap.channel" }, { 0x0B, "multipart/" "*" }, { 0x0C, "multipart/mixed" }, { 0x0D, "multipart/form-data" }, { 0x0E, "multipart/byteranges" }, { 0x0F, "multipart/alternative" }, { 0x10, "application/" "*" }, { 0x11, "application/java-vm" }, { 0x12, "application/x-www-form-urlencoded" }, { 0x13, "application/x-hdmlc" }, { 0x14, "application/vnd.wap.wmlc" }, { 0x15, "application/vnd.wap.wmlscriptc" }, { 0x16, "application/vnd.wap.channelc" }, { 0x17, "application/vnd.wap.uaprof" }, { 0x18, "application/vnd.wap.wtls-ca-certificate" }, { 0x19, "application/vnd.wap.wtls-user-certificate" }, { 0x1A, "application/x-x509-ca-cert" }, { 0x1B, "application/x-x509-user-cert" }, { 0x1C, "image/" "*" }, { 0x1D, "image/gif" }, { 0x1E, "image/jpeg" }, { 0x1F, "image/tiff" }, { 0x20, "image/png" }, { 0x21, "image/vnd.wap.wbmp" }, { 0x22, "application/vnd.wap.multipart.*" }, { 0x23, "application/vnd.wap.multipart.mixed" }, { 0x24, "application/vnd.wap.multipart.form-data" }, { 0x25, "application/vnd.wap.multipart.byteranges" }, { 0x26, "application/vnd.wap.multipart.alternative" }, { 0x27, "application/xml" }, { 0x28, "text/xml" }, { 0x29, "application/vnd.wap.wbxml" }, { 0x2A, "application/x-x968-cross-cert" }, { 0x2B, "application/x-x968-ca-cert" }, { 0x2C, "application/x-x968-user-cert" }, { 0x2D, "text/vnd.wap.si" }, { 0x2E, "application/vnd.wap.sic" }, { 0x2F, "text/vnd.wap.sl" }, { 0x30, "application/vnd.wap.slc" }, { 0x31, "text/vnd.wap.co" }, { 0x32, "application/vnd.wap.coc" }, { 0x33, "application/vnd.wap.multipart.related" }, { 0x34, "application/vnd.wap.sia" }, { 0x35, "text/vnd.wap.connectivity-xml" }, { 0x36, "application/vnd.wap.connectivity-wbxml" }, { 0x37, "application/pkcs7-mime" }, { 0x38, "application/vnd.wap.hashed-certificate" }, { 0x39, "application/vnd.wap.signed-certificate" }, { 0x3A, "application/vnd.wap.cert-response" }, { 0x3B, "application/xhtml+xml" }, { 0x3C, "application/wml+xml" }, { 0x3D, "text/css" }, { 0x3E, "application/vnd.wap.mms-message" }, { 0x3F, "application/vnd.wap.rollover-certificate" }, { 0x40, "application/vnd.wap.locc+wbxml"}, { 0x41, "application/vnd.wap.loc+xml"}, { 0x42, "application/vnd.syncml.dm+wbxml"}, { 0x43, "application/vnd.syncml.dm+xml"}, { 0x44, "application/vnd.syncml.notification"}, { 0x45, "application/vnd.wap.xhtml+xml"}, { 0x46, "application/vnd.wv.csp.cir"}, { 0x47, "application/vnd.oma.dd+xml"}, { 0x48, "application/vnd.oma.drm.message"}, { 0x49, "application/vnd.oma.drm.content"}, { 0x4A, "application/vnd.oma.drm.rights+xml"}, { 0x4B, "application/vnd.oma.drm.rights+wbxml"}, { 0x4C, "application/vnd.wv.csp+xml"}, { 0x4D, "application/vnd.wv.csp+wbxml"}, { 0x5A, "application/octet-stream"}, /* The following media types are registered by 3rd parties */ { 0x0201, "application/vnd.uplanet.cachop-wbxml" }, { 0x0202, "application/vnd.uplanet.signal" }, { 0x0203, "application/vnd.uplanet.alert-wbxml" }, { 0x0204, "application/vnd.uplanet.list-wbxml" }, { 0x0205, "application/vnd.uplanet.listcmd-wbxml" }, { 0x0206, "application/vnd.uplanet.channel-wbxml" }, { 0x0207, "application/vnd.uplanet.provisioning-status-uri" }, { 0x0208, "x-wap.multipart/vnd.uplanet.header-set" }, { 0x0209, "application/vnd.uplanet.bearer-choice-wbxml" }, { 0x020A, "application/vnd.phonecom.mmc-wbxml" }, { 0x020B, "application/vnd.nokia.syncset+wbxml" }, { 0x020C, "image/x-up-wpng"}, { 0x0300, "application/iota.mmc-wbxml"}, { 0x0301, "application/iota.mmc-xml"}, { 0x00, NULL } }; static value_string_ext vals_content_types_ext = VALUE_STRING_EXT_INIT(vals_content_types); static const value_string vals_languages[] = { { 0x00, "*" }, { 0x01, "Afar (aa)" }, { 0x02, "Abkhazian (ab)" }, { 0x03, "Afrikaans (af)" }, { 0x04, "Amharic (am)" }, { 0x05, "Arabic (ar)" }, { 0x06, "Assamese (as)" }, { 0x07, "Aymara (ay)" }, { 0x08, "Azerbaijani (az)" }, { 0x09, "Bashkir (ba)" }, { 0x0A, "Byelorussian (be)" }, { 0x0B, "Bulgarian (bg)" }, { 0x0C, "Bihari (bh)" }, { 0x0D, "Bislama (bi)" }, { 0x0E, "Bengali; Bangla (bn)" }, { 0x0F, "Tibetan (bo)" }, { 0x10, "Breton (br)" }, { 0x11, "Catalan (ca)" }, { 0x12, "Corsican (co)" }, { 0x13, "Czech (cs)" }, { 0x14, "Welsh (cy)" }, { 0x15, "Danish (da)" }, { 0x16, "German (de)" }, { 0x17, "Bhutani (dz)" }, { 0x18, "Greek (el)" }, { 0x19, "English (en)" }, { 0x1A, "Esperanto (eo)" }, { 0x1B, "Spanish (es)" }, { 0x1C, "Estonian (et)" }, { 0x1D, "Basque (eu)" }, { 0x1E, "Persian (fa)" }, { 0x1F, "Finnish (fi)" }, { 0x20, "Fiji (fj)" }, { 0x21, "Urdu (ur)" }, { 0x22, "French (fr)" }, { 0x23, "Uzbek (uz)" }, { 0x24, "Irish (ga)" }, { 0x25, "Scots Gaelic (gd)" }, { 0x26, "Galician (gl)" }, { 0x27, "Guarani (gn)" }, { 0x28, "Gujarati (gu)" }, { 0x29, "Hausa (ha)" }, { 0x2A, "Hebrew (formerly iw) (he)" }, { 0x2B, "Hindi (hi)" }, { 0x2C, "Croatian (hr)" }, { 0x2D, "Hungarian (hu)" }, { 0x2E, "Armenian (hy)" }, { 0x2F, "Vietnamese (vi)" }, { 0x30, "Indonesian (formerly in) (id)" }, { 0x31, "Wolof (wo)" }, { 0x32, "Xhosa (xh)" }, { 0x33, "Icelandic (is)" }, { 0x34, "Italian (it)" }, { 0x35, "Yoruba (yo)" }, { 0x36, "Japanese (ja)" }, { 0x37, "Javanese (jw)" }, { 0x38, "Georgian (ka)" }, { 0x39, "Kazakh (kk)" }, { 0x3A, "Zhuang (za)" }, { 0x3B, "Cambodian (km)" }, { 0x3C, "Kannada (kn)" }, { 0x3D, "Korean (ko)" }, { 0x3E, "Kashmiri (ks)" }, { 0x3F, "Kurdish (ku)" }, { 0x40, "Kirghiz (ky)" }, { 0x41, "Chinese (zh)" }, { 0x42, "Lingala (ln)" }, { 0x43, "Laothian (lo)" }, { 0x44, "Lithuanian (lt)" }, { 0x45, "Latvian, Lettish (lv)" }, { 0x46, "Malagasy (mg)" }, { 0x47, "Maori (mi)" }, { 0x48, "Macedonian (mk)" }, { 0x49, "Malayalam (ml)" }, { 0x4A, "Mongolian (mn)" }, { 0x4B, "Moldavian (mo)" }, { 0x4C, "Marathi (mr)" }, { 0x4D, "Malay (ms)" }, { 0x4E, "Maltese (mt)" }, { 0x4F, "Burmese (my)" }, { 0x50, "Ukrainian (uk)" }, { 0x51, "Nepali (ne)" }, { 0x52, "Dutch (nl)" }, { 0x53, "Norwegian (no)" }, { 0x54, "Occitan (oc)" }, { 0x55, "(Afan) Oromo (om)" }, { 0x56, "Oriya (or)" }, { 0x57, "Punjabi (pa)" }, { 0x58, "Polish (po)" }, { 0x59, "Pashto, Pushto (ps)" }, { 0x5A, "Portuguese (pt)" }, { 0x5B, "Quechua (qu)" }, { 0x5C, "Zulu (zu)" }, { 0x5D, "Kirundi (rn)" }, { 0x5E, "Romanian (ro)" }, { 0x5F, "Russian (ru)" }, { 0x60, "Kinyarwanda (rw)" }, { 0x61, "Sanskrit (sa)" }, { 0x62, "Sindhi (sd)" }, { 0x63, "Sangho (sg)" }, { 0x64, "Serbo-Croatian (sh)" }, { 0x65, "Sinhalese (si)" }, { 0x66, "Slovak (sk)" }, { 0x67, "Slovenian (sl)" }, { 0x68, "Samoan (sm)" }, { 0x69, "Shona (sn)" }, { 0x6A, "Somali (so)" }, { 0x6B, "Albanian (sq)" }, { 0x6C, "Serbian (sr)" }, { 0x6D, "Siswati (ss)" }, { 0x6E, "Sesotho (st)" }, { 0x6F, "Sundanese (su)" }, { 0x70, "Swedish (sv)" }, { 0x71, "Swahili (sw)" }, { 0x72, "Tamil (ta)" }, { 0x73, "Telugu (te)" }, { 0x74, "Tajik (tg)" }, { 0x75, "Thai (th)" }, { 0x76, "Tigrinya (ti)" }, { 0x77, "Turkmen (tk)" }, { 0x78, "Tagalog (tl)" }, { 0x79, "Setswana (tn)" }, { 0x7A, "Tonga (to)" }, { 0x7B, "Turkish (tr)" }, { 0x7C, "Tsonga (ts)" }, { 0x7D, "Tatar (tt)" }, { 0x7E, "Twi (tw)" }, { 0x7F, "Uighur (ug)" }, { 0x81, "Nauru (na)" }, { 0x82, "Faeroese (fo)" }, { 0x83, "Frisian (fy)" }, { 0x84, "Interlingua (ia)" }, { 0x85, "Volapuk (vo)" }, { 0x86, "Interlingue (ie)" }, { 0x87, "Inupiak (ik)" }, { 0x88, "Yiddish (formerly ji) (yi)" }, { 0x89, "Inuktitut (iu)" }, { 0x8A, "Greenlandic (kl)" }, { 0x8B, "Latin (la)" }, { 0x8C, "Rhaeto-Romance (rm)" }, { 0x00, NULL } }; static value_string_ext vals_languages_ext = VALUE_STRING_EXT_INIT(vals_languages); #define CACHE_CONTROL_NO_CACHE 0x00 #define CACHE_CONTROL_NO_STORE 0x01 #define CACHE_CONTROL_MAX_AGE 0x02 #define CACHE_CONTROL_MAX_STALE 0x03 #define CACHE_CONTROL_MIN_FRESH 0x04 #define CACHE_CONTROL_ONLY_IF_CACHED 0x05 #define CACHE_CONTROL_PUBLIC 0x06 #define CACHE_CONTROL_PRIVATE 0x07 #define CACHE_CONTROL_NO_TRANSFORM 0x08 #define CACHE_CONTROL_MUST_REVALIDATE 0x09 #define CACHE_CONTROL_PROXY_REVALIDATE 0x0A #define CACHE_CONTROL_S_MAXAGE 0x0B static const value_string vals_cache_control[] = { { CACHE_CONTROL_NO_CACHE, "no-cache" }, { CACHE_CONTROL_NO_STORE, "no-store" }, { CACHE_CONTROL_MAX_AGE, "max-age" }, { CACHE_CONTROL_MAX_STALE, "max-stale" }, { CACHE_CONTROL_MIN_FRESH, "min-fresh" }, { CACHE_CONTROL_ONLY_IF_CACHED, "only-if-cached" }, { CACHE_CONTROL_PUBLIC, "public" }, { CACHE_CONTROL_PRIVATE, "private" }, { CACHE_CONTROL_NO_TRANSFORM, "no-transform" }, { CACHE_CONTROL_MUST_REVALIDATE, "must-revalidate" }, { CACHE_CONTROL_PROXY_REVALIDATE, "proxy-revalidate" }, { CACHE_CONTROL_S_MAXAGE, "s-max-age" }, { 0x00, NULL } }; static value_string_ext vals_cache_control_ext = VALUE_STRING_EXT_INIT(vals_cache_control); static const value_string vals_wap_application_ids[] = { /* Well-known WAP applications */ { 0x0000, "x-wap-application:*"}, { 0x0001, "x-wap-application:push.sia"}, { 0x0002, "x-wap-application:wml.ua"}, { 0x0003, "x-wap-application:wta.ua"}, { 0x0004, "x-wap-application:mms.ua"}, { 0x0005, "x-wap-application:push.syncml"}, { 0x0006, "x-wap-application:loc.ua"}, { 0x0007, "x-wap-application:syncml.dm"}, { 0x0008, "x-wap-application:drm.ua"}, { 0x0009, "x-wap-application:emn.ua"}, { 0x000A, "x-wap-application:wv.ua"}, { 0x001A, "x-wap-application:lwm2m.dm"}, /* Registered by 3rd parties */ { 0x8000, "x-wap-microsoft:localcontent.ua"}, { 0x8001, "x-wap-microsoft:IMclient.ua"}, { 0x8002, "x-wap-docomo:imode.mail.ua"}, { 0x8003, "x-wap-docomo:imode.mr.ua"}, { 0x8004, "x-wap-docomo:imode.mf.ua"}, { 0x8005, "x-motorola:location.ua"}, { 0x8006, "x-motorola:now.ua"}, { 0x8007, "x-motorola:otaprov.ua"}, { 0x8008, "x-motorola:browser.ua"}, { 0x8009, "x-motorola:splash.ua"}, /* 0x800A: unassigned */ { 0x800B, "x-wap-nai:mvsw.command"}, /* 0x800C -- 0x800F: unassigned */ { 0x8010, "x-wap-openwave:iota.ua"}, /* 0x8011 -- 0x8FFF: unassigned */ { 0x9000, "x-wap-docomo:imode.mail2.ua"}, { 0x9001, "x-oma-nec:otaprov.ua"}, { 0x9002, "x-oma-nokia:call.ua"}, { 0x9003, "x-oma-coremobility:sqa.ua"}, { 0x00, NULL } }; static value_string_ext vals_wap_application_ids_ext = VALUE_STRING_EXT_INIT(vals_wap_application_ids); /* Parameters and well-known encodings */ static const value_string vals_wsp_parameter_sec[] = { { 0x00, "NETWPIN" }, { 0x01, "USERPIN" }, { 0x02, "USERNETWPIN" }, { 0x03, "USERPINMAC" }, { 0x00, NULL } }; static value_string_ext vals_wsp_parameter_sec_ext = VALUE_STRING_EXT_INIT(vals_wsp_parameter_sec); /* Warning codes and mappings */ static const value_string vals_wsp_warning_code[] = { { 10, "110 Response is stale" }, { 11, "111 Revalidation failed" }, { 12, "112 Disconnected operation" }, { 13, "113 Heuristic expiration" }, { 14, "214 Transformation applied" }, { 99, "199/299 Miscellaneous warning" }, { 0, NULL } }; static value_string_ext vals_wsp_warning_code_ext = VALUE_STRING_EXT_INIT(vals_wsp_warning_code); static const value_string vals_wsp_warning_code_short[] = { { 10, "110" }, { 11, "111" }, { 12, "112" }, { 13, "113" }, { 14, "214" }, { 99, "199/299" }, { 0, NULL } }; static value_string_ext vals_wsp_warning_code_short_ext = VALUE_STRING_EXT_INIT(vals_wsp_warning_code_short); /* Profile-Warning codes - see http://www.w3.org/TR/NOTE-CCPPexchange */ static const value_string vals_wsp_profile_warning_code[] = { { 0x10, "100 OK" }, { 0x11, "101 Used stale profile" }, { 0x12, "102 Not used profile" }, { 0x20, "200 Not applied" }, { 0x21, "101 Content selection applied" }, { 0x22, "202 Content generation applied" }, { 0x23, "203 Transformation applied" }, { 0x00, NULL } }; static value_string_ext vals_wsp_profile_warning_code_ext = VALUE_STRING_EXT_INIT(vals_wsp_profile_warning_code); /* Well-known TE values */ static const value_string vals_well_known_te[] = { { 0x82, "chunked" }, { 0x83, "identity" }, { 0x84, "gzip" }, { 0x85, "compress" }, { 0x86, "deflate" }, { 0x00, NULL } }; static value_string_ext vals_well_known_te_ext = VALUE_STRING_EXT_INIT(vals_well_known_te); /* * Redirect flags. */ #define PERMANENT_REDIRECT 0x80 #define REUSE_SECURITY_SESSION 0x40 /* * Redirect address flags and length. */ #define BEARER_TYPE_INCLUDED 0x80 #define PORT_NUMBER_INCLUDED 0x40 #define ADDRESS_LEN 0x3f static const value_string vals_false_true[] = { { 0, "False" }, { 1, "True" }, { 0, NULL } }; enum { WSP_PDU_RESERVED = 0x00, WSP_PDU_CONNECT = 0x01, WSP_PDU_CONNECTREPLY = 0x02, WSP_PDU_REDIRECT = 0x03, /* No sample data */ WSP_PDU_REPLY = 0x04, WSP_PDU_DISCONNECT = 0x05, WSP_PDU_PUSH = 0x06, /* No sample data */ WSP_PDU_CONFIRMEDPUSH = 0x07, /* No sample data */ WSP_PDU_SUSPEND = 0x08, /* No sample data */ WSP_PDU_RESUME = 0x09, /* No sample data */ WSP_PDU_GET = 0x40, WSP_PDU_OPTIONS = 0x41, /* No sample data */ WSP_PDU_HEAD = 0x42, /* No sample data */ WSP_PDU_DELETE = 0x43, /* No sample data */ WSP_PDU_TRACE = 0x44, /* No sample data */ WSP_PDU_POST = 0x60, WSP_PDU_PUT = 0x61 /* No sample data */ }; /* Dissector tables for handoff */ static dissector_table_t media_type_table; static heur_dissector_list_t heur_subdissector_list; static void add_uri (proto_tree *, packet_info *, tvbuff_t *, guint, guint, proto_item *); static void add_post_variable (proto_tree *, tvbuff_t *, guint, guint, guint, guint); static void add_multipart_data (proto_tree *, tvbuff_t *, packet_info *pinfo); static void add_capabilities (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint8 pdu_type); /* * Dissect the WSP header part. * This function calls wkh_XXX functions that dissect well-known headers. */ static void add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo); /* The following macros define WSP basic data structures as found * in the ABNF notation of WSP headers. * Currently all text data types are mapped to text_string. */ #define is_short_integer(x) ( (x) & 0x80 ) #define is_long_integer(x) ( (x) <= 30 ) #define is_date_value(x) is_long_integer(x) #define is_integer_value(x) (is_short_integer(x) || is_long_integer(x)) #define is_delta_seconds_value(x) is_integer_value(x) /* Text string == *TEXT 0x00, thus also an empty string matches the rule! */ #define is_text_string(x) ( ((x) == 0) || ( ((x) >= 32) && ((x) <= 127)) ) #define is_quoted_string(x) ( (x) == 0x22 ) /* " */ #define is_token_text(x) is_text_string(x) #define is_text_value(x) is_text_string(x) #define is_uri_value(x) is_text_string(x) #define get_uintvar_integer(val,tvb,start,len,ok) \ val = tvb_get_guintvar(tvb,start,&len, pinfo, &ei_wsp_oversized_uintvar); \ if (len>5 || len==0) ok = FALSE; else ok = TRUE; #define get_short_integer(val,tvb,start,len,ok) \ val = tvb_get_guint8(tvb,start); \ if (val & 0x80) ok = TRUE; else ok=FALSE; \ val &= 0x7F; len = 1; #define get_long_integer(val,tvb,start,len,ok) \ len = tvb_get_guint8(tvb,start); \ ok = TRUE; /* Valid lengths for us are 1-4 */ \ if (len==1) { val = tvb_get_guint8(tvb,start+1); } \ else if (len==2) { val = tvb_get_ntohs(tvb,start+1); } \ else if (len==3) { val = tvb_get_ntoh24(tvb,start+1); } \ else if (len==4) { val = tvb_get_ntohl(tvb,start+1); } \ else ok = FALSE; \ len++; /* Add the 1st octet to the length */ #define get_integer_value(val,tvb,start,len,ok) \ len = tvb_get_guint8(tvb,start); \ ok = TRUE; \ if (len & 0x80) { val = len & 0x7F; len = 0; } \ else if (len==1) { val = tvb_get_guint8(tvb,start+1); } \ else if (len==2) { val = tvb_get_ntohs(tvb,start+1); } \ else if (len==3) { val = tvb_get_ntoh24(tvb,start+1); } \ else if (len==4) { val = tvb_get_ntohl(tvb,start+1); } \ else ok = FALSE; \ len++; /* Add the 1st octet to the length */ #define get_date_value(val,tvb,start,len,ok) \ get_long_integer(val,tvb,start,len,ok) #define get_delta_seconds_value(val,tvb,start,len,ok) \ get_integer_value(val,tvb,start,len,ok) /* NOTE - Do NOT call g_free() for the str returned after using it because the * get_text_string() macro now returns wmem_alloc'd memory. */ #define get_text_string(str,tvb,start,len,ok) \ if (is_text_string(tvb_get_guint8(tvb,start))) { \ str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb,start,(gint *)&len,ENC_ASCII); \ ok = TRUE; \ } else { len = 0; str = NULL; ok = FALSE; } #define get_token_text(str,tvb,start,len,ok) \ get_text_string(str,tvb,start,len,ok) #define get_extension_media(str,tvb,start,len,ok) \ get_text_string(str,tvb,start,len,ok) #define get_text_value(str,tvb,start,len,ok) \ get_text_string(str,tvb,start,len,ok) #define get_quoted_string(str,tvb,start,len,ok) \ get_text_string(str,tvb,start,len,ok) #define get_uri_value(str,tvb,start,len,ok) \ get_text_string(str,tvb,start,len,ok) #define get_version_value(val,str,tvb,start,len,ok) \ val = tvb_get_guint8(tvb,start); \ ok = TRUE; \ if (val & 0x80) { /* High nibble "." Low nibble */ \ len = 1; \ val &= 0x7F; \ str = wmem_strdup_printf(wmem_packet_scope(), "%u.%u", val >> 4, val & 0x0F); \ } else { get_text_string(str,tvb,start,len,ok); } /* Parameter parser */ static int parameter (proto_tree *tree, packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, int start, int len); static int parameter_value_q (proto_tree *tree, packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, int start); /* The following macros hide common processing for all well-known headers * and shortens the code to be written in a wkh_XXX() function. * Even declarations are hidden by a macro. * * Define a wkh_XXX() function as follows: * * static guint32 * wkh_XXX (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) * { * wkh_0_Declarations; * << add other required declarations here >> * * wkh_1_WellKnownValue; * << add well-known value proto item here; don't forget to set the * ok variable to TRUE if parsing was correct >> * wkh_2_TextualValue; * << add textual value proto item here; don't forget to set the * ok variable to TRUE if parsing was correct >> * wkh_3_ValueWithLength; * << add custom code for value processing and value proto item here >> * * wkh_4_End(); * << This macro takes care of parse errors within the header value; * it requires the header field index if the header has not yet been * written to the protocol tree (ti == NULL). >> * } * * NOTE: You only need to write parsing code for the successful case, * Errors are automatically reported through the wkh_4_End() macro * when ok <> TRUE. */ /* The following code is the generic template with which the value of a * well-known header can be processed. Not all sections yield a semantically * correct result, so appropriate error information must be provided. */ #define wkh_0a_Declarations /* Declarations for Parsing */ \ gboolean ok = FALSE; /* Triggers error notification code at end */ \ proto_tree *header_tree; /* base tree for all fields */ \ proto_item *header_item; /* base item for all fields */ \ guint32 val_start = hdr_start + 1; \ guint8 val_id = tvb_get_guint8 (tvb, val_start); \ guint32 offset = val_start; /* Offset to one past this header */ \ guint32 val_len; /* length for value with length field */ \ guint32 val_len_len /* length of length field */ #define wkh_0_Declarations \ wkh_0a_Declarations; \ const gchar *val_str = NULL #define wkh_1_WellKnownValue(hf_hdr, ett, header) /* Parse Well Known Value */ \ header_tree = proto_tree_add_subtree(tree, tvb, hdr_start, offset - hdr_start, ett, \ &header_item, header); \ proto_tree_add_item(header_tree, hf_hdr, tvb, hdr_start, 1, ENC_NA); \ if (val_id & 0x80) { /* Well-known value */ \ offset++; \ /* Well-known value processing starts HERE \ * \ * BEGIN */ #define wkh_2_TextualValue /* Parse Textual Value */ \ /* END */ \ } else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \ val_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); \ offset = val_start + val_len; \ /* Textual value processing starts HERE \ * \ * BEGIN */ #define wkh_2_TextualValueInv /* Parse Textual Value */ \ /* END */ \ } else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \ /*val_str = (gchar *)*/tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); \ offset = val_start + val_len; \ /* Textual value processing starts HERE \ * \ * BEGIN */ #define wkh_3_ValueWithLength /* Parse Value With Length */ \ /* END */ \ } else { /* val_start points to 1st byte of length field */ \ if (val_id == 0x1F) { /* Value Length = guintvar */ \ val_len = tvb_get_guintvar(tvb, val_start + 1, &val_len_len, pinfo, &ei_wsp_oversized_uintvar); \ val_len_len++; /* 0x1F length indicator byte */ \ } else { /* Short length followed by Len data octets */ \ val_len = tvb_get_guint8(tvb, offset); \ val_len_len = 1; \ } \ offset += val_len_len + val_len; \ /* Value with length processing starts HERE \ * The value lies between val_start and offset: \ * - Value Length: Start = val_start \ * Length = val_len_len \ * - Value Data : Start = val_start + val_len_len \ * Length = val_len \ * End = offset - 1 \ * BEGIN */ #define wkh_4_End() /* End of value parsing */ \ /* END */ \ } \ /* Check for errors */ \ if (! ok) { \ expert_add_info(pinfo, header_item, &ei_wsp_header_invalid_value); \ } \ return offset; /* * This yields the following default header value parser function body */ static guint32 wkh_default(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint8 hdr_id = tvb_get_guint8 (tvb, hdr_start) & 0x7F; ok = TRUE; /* Bypass error checking as we don't parse the values! */ wkh_1_WellKnownValue(hf_hdr_name_value, ett_default, "default"); proto_tree_add_uint_format(tree, hf_wsp_default_int, tvb, hdr_start, offset - hdr_start, val_id & 0x7F, "%s: (Undecoded well-known value 0x%02x)", val_to_str_ext (hdr_id, &vals_field_names_ext, "<Unknown WSP header field 0x%02X>"), val_id & 0x7F); wkh_2_TextualValue; proto_tree_add_string_format(tree, hf_wsp_default_string, tvb, hdr_start, offset - hdr_start, "%s: %s", val_to_str_ext (hdr_id, &vals_field_names_ext, "<Unknown WSP header field 0x%02X>"), val_str); wkh_3_ValueWithLength; proto_tree_add_uint_format(tree, hf_wsp_default_val_len, tvb, hdr_start, offset - hdr_start, val_len, "%s: (Undecoded value in general form with length indicator)", val_to_str_ext (hdr_id, &vals_field_names_ext, "<Unknown WSP header field 0x%02X>")); wkh_4_End(); /* The default parser has no associated hf_index; additionally the error code is always bypassed */ } /* Content-type processing uses the following common core: */ static guint32 wkh_content_type_header(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0_Declarations; guint32 off, val = 0, len; guint8 peek; proto_item *ti = NULL; proto_tree *parameter_tree = NULL; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Content type: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_type_header, header_name); proto_tree_add_string(header_tree, hf, tvb, val_start, 1, val_to_str_ext(val_id & 0x7F, &vals_content_types_ext, "(Unknown content type identifier 0x%X)")); proto_item_set_len(header_item, 2); ok = TRUE; wkh_2_TextualValue; /* Sometimes with a No-Content response, a NULL content type * is reported. Process this correctly! */ if (*val_str) { proto_tree_add_string(header_tree, hf, tvb, val_start, val_len, val_str); proto_item_set_len(header_item, val_len+1); } else { proto_tree_add_string(header_tree, hf, tvb, val_start, 0, "<no content type has been specified>"); proto_item_set_len(header_item, 2); } ok = TRUE; wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (is_text_string(peek)) { val_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, off, (gint*)&len, ENC_ASCII); off += len; /* off now points to 1st byte after string */ ti = proto_tree_add_string (header_tree, hf, tvb, hdr_start, offset - hdr_start, val_str); } else if (is_integer_value(peek)) { get_integer_value(val, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(header_tree, hf, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val, &vals_content_types_ext, "(Unknown content type identifier 0x%X)")); } off += len; } else { ok = FALSE; } /* Remember: offset == val_start + val_len + val_len_len */ if (ok && (off < offset)) { /* Add parameters if any */ parameter_tree = proto_item_add_subtree (ti, ett_header); while (off < offset) { off = parameter (parameter_tree, pinfo, ti, tvb, off, offset - off); } } wkh_4_End(); } /* * Accept-value = * Short-integer * | Extension-media * | ( Value-length ( Extension-media | Integer-value ) *( Parameter ) ) */ static guint32 wkh_accept(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { return wkh_content_type_header(tree, tvb, hdr_start, pinfo, hf_hdr_accept, "Accept"); } /* * Content-type-value = * Short-integer * | Extension-media * | ( Value-length ( Extension-media | Integer-value ) *( Parameter ) ) * * Beware: this header should not appear as such; it is dissected elsewhere * and at the same time the content type is used for subdissectors. * It is here for the sake of completeness. */ static guint32 wkh_content_type(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { return wkh_content_type_header(tree, tvb, hdr_start, pinfo, hf_hdr_content_type, "Content-Type"); } /* * Content-type-value = * Short-integer * | Extension-media * | ( Value-length ( Extension-media | Integer-value ) *( Parameter ) ) * * This function adds the content type value to the protocol tree, * and computes either the numeric or textual media type in return, * which will be used for further subdissection (e.g., MMS, WBXML). */ guint32 add_content_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint32 val_start, guint32 *well_known_content, const char **textual_content) { /* Replace wkh_0_Declarations with slightly modified declarations * so we can still make use of the wkh_[1-4]_XXX macros! */ guint32 hdr_start = val_start; /* No header name, only value! */ guint8 val_id = tvb_get_guint8 (tvb, val_start); guint32 offset = val_start; /* Offset to one past this header */ guint32 val_len; /* length for value with length field */ guint32 val_len_len; /* length of length field */ gchar *val_str = NULL; guint32 off, val = 0, len; guint8 peek; gboolean ok = FALSE; proto_item *ti = NULL; proto_tree *parameter_tree = NULL; proto_tree *header_tree; proto_item *header_item; *textual_content = NULL; *well_known_content = 0; wkh_1_WellKnownValue(hf_hdr_name_value, ett_add_content_type, "Content-Type"); *textual_content = val_to_str_ext(val_id & 0x7F, &vals_content_types_ext, "<Unknown media type identifier 0x%X>"); proto_tree_add_string(tree, hf_hdr_content_type, tvb, hdr_start, offset - hdr_start, *textual_content); *well_known_content = val_id & 0x7F; ok = TRUE; wkh_2_TextualValue; /* Sometimes with a No-Content response, a NULL content type * is reported. Process this correctly! */ if (*val_str) { proto_tree_add_string(tree, hf_hdr_content_type, tvb, hdr_start, offset - hdr_start, val_str); *textual_content = wmem_strdup(pinfo->pool, val_str); *well_known_content = 0; } else { proto_tree_add_string(tree, hf_hdr_content_type, tvb, hdr_start, offset - hdr_start, "<no media type has been specified>"); *textual_content = NULL; *well_known_content = 0; } ok = TRUE; wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (is_text_string(peek)) { get_extension_media(val_str, tvb, off, len, ok); if (ok) { off += len; /* off now points to 1st byte after string */ ti = proto_tree_add_string (tree, hf_hdr_content_type, tvb, hdr_start, offset - hdr_start, val_str); } /* Following statement: required? */ *textual_content = wmem_strdup(pinfo->pool, val_str); *well_known_content = 0; } else if (is_integer_value(peek)) { get_integer_value(val, tvb, off, len, ok); if (ok) { *textual_content = val_to_str_ext(val, &vals_content_types_ext, "<Unknown media type identifier 0x%X>"); ti = proto_tree_add_string(tree, hf_hdr_content_type, tvb, hdr_start, offset - hdr_start, *textual_content); *well_known_content = val; } off += len; } /* else ok = FALSE */ /* Remember: offset == val_start + val_len_len + val_len */ if (ok && (off < offset)) { /* Add parameters if any */ parameter_tree = proto_item_add_subtree (ti, ett_header); while (off < offset) { off = parameter (parameter_tree, pinfo, ti, tvb, off, offset - off); } } wkh_4_End(); } /* * Template for accept_X headers with optional Q parameter value */ #define wkh_accept_x_q_header(underscored,Text,valueStringExtAddr,valueName) \ static guint32 \ wkh_ ## underscored (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_accept_x_q_header_func(tree, tvb, hdr_start, pinfo, \ hf_hdr_ ## underscored, Text, valueStringExtAddr, \ "<Unknown " valueName " identifier 0x%X>"); \ } static guint32 wkh_accept_x_q_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name, value_string_ext *valueStringExtAddr, const char* value_format) G_GNUC_PRINTF(8, 0); static guint32 wkh_accept_x_q_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name, value_string_ext *valueStringExtAddr, const char* value_format) { wkh_0_Declarations; guint32 off, val = 0, len; guint8 peek; proto_item *ti = NULL; proto_tree *parameter_tree = NULL; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Accept X: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_accept_x_q_header, header_name); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, valueStringExtAddr, value_format)); ok = TRUE; wkh_2_TextualValue; proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (is_text_string(peek)) { get_token_text(val_str, tvb, off, len, ok); if (ok) { off += len; /* off now points to 1st byte after string */ ti = proto_tree_add_string (tree, hf, tvb, hdr_start, offset - hdr_start, val_str); } } else if (is_integer_value(peek)) { get_integer_value(val, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val, valueStringExtAddr, value_format)); } off += len; } /* else ok = FALSE */ /* Remember: offset == val_start + val_len */ if (ok && (off < offset)) { /* Add Q-value if available */ parameter_tree = proto_item_add_subtree (ti, ett_header); /*off =*/ parameter_value_q (parameter_tree, pinfo, ti, tvb, off); } wkh_4_End(); } /* * Accept-charset-value = * Short-integer * | Extension-media * | ( Value-length ( Token-text | Integer-value ) [ Q-value ] ) */ wkh_accept_x_q_header(accept_charset, "Accept-Charset", &mibenum_vals_character_sets_ext, "character set") /* * Accept-language-value = * Short-integer * | Extension-media * | ( Value-length ( Text-string | Integer-value ) [ Q-value ] ) */ wkh_accept_x_q_header(accept_language, "Accept-Language", &vals_languages_ext, "language") /* * Push-flag-value = Short-integer */ static guint32 wkh_push_flag(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0a_Declarations; proto_item *ti = NULL; proto_tree *subtree = NULL; wmem_strbuf_t *push_flag_str = wmem_strbuf_new(wmem_packet_scope(), ""); wkh_1_WellKnownValue(hf_hdr_name_value, ett_push_flag, "Push Flag"); if (val_id & 0x01) wmem_strbuf_append(push_flag_str, " (Initiator URI authenticated)"); if (val_id & 0x02) wmem_strbuf_append(push_flag_str, " (Content trusted)"); if (val_id & 0x04) wmem_strbuf_append(push_flag_str, " (Last push message)"); if (val_id & 0x78) wmem_strbuf_append(push_flag_str, " <Warning: Reserved flags set>"); else ok = TRUE; ti = proto_tree_add_string(tree, hf_hdr_push_flag, tvb, hdr_start, offset - hdr_start, wmem_strbuf_get_str(push_flag_str)); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_uint(subtree, hf_hdr_push_flag_auth, tvb, val_start, 1, val_id); proto_tree_add_uint(subtree, hf_hdr_push_flag_trust, tvb, val_start, 1, val_id); proto_tree_add_uint(subtree, hf_hdr_push_flag_last, tvb, val_start, 1, val_id); wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Profile-Diff (with WBXML): Profile-diff-value = * Value-length <WBXML-Content> */ static guint32 wkh_profile_diff_wbxml (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0a_Declarations; tvbuff_t *tmp_tvb; proto_item *ti = NULL; proto_tree *subtree; ok = TRUE; /* Bypass error checking as we don't parse the values! */ wkh_1_WellKnownValue(hf_hdr_name_value, ett_profile_diff_wbxml, "Profile-Diff (with WBXML)"); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; ti = proto_tree_add_string(tree, hf_hdr_profile_diff, tvb, hdr_start, offset - hdr_start, "(Profile-Diff value as WBXML)"); subtree = proto_item_add_subtree(ti, ett_header); tmp_tvb = tvb_new_subset_length(tvb, val_start + val_len_len, val_len); /* TODO: fix 2nd length */ call_dissector(wbxml_uaprof_handle, tmp_tvb, pinfo, subtree); ok = TRUE; wkh_4_End(); } /* * Allow-value = * Short-integer 1 */ static guint32 wkh_allow(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0a_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_allow, "Allow"); val_id &= 0x7F; if (val_id >= 0x40) { /* Valid WSP method */ proto_tree_add_string(tree, hf_hdr_allow, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, &wsp_vals_pdu_type_ext, "<Unknown WSP method 0x%02X>")); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Public-value = * Token-text | Short-integer 2 */ static guint32 wkh_public(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_public, "Public"); val_id &= 0x7F; if (val_id >= 0x40) { /* Valid WSP method */ proto_tree_add_string(tree, hf_hdr_public, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, &wsp_vals_pdu_type_ext, "<Unknown WSP method 0x%02X>")); ok = TRUE; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_public, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Vary-value = * Token-text | Short-integer */ static guint32 wkh_vary(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_vary, "Vary"); proto_tree_add_string(tree, hf_hdr_vary, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, &vals_field_names_ext, "<Unknown WSP header field 0x%02X>")); ok = TRUE; wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_vary, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * X-wap-security-value = 0x80 */ static guint32 wkh_x_wap_security(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0a_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_x_wap_security, "X-wap-security-value"); if (val_id == 0x80) { proto_tree_add_string(tree, hf_hdr_x_wap_security, tvb, hdr_start, offset - hdr_start, "close-subordinate"); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Connection-value = 0x80 | Token-text 5 */ static guint32 wkh_connection(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_connection, "Connection"); if (val_id == 0x80) { proto_tree_add_string(tree, hf_hdr_connection, tvb, hdr_start, offset - hdr_start, "close"); ok = TRUE; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_connection, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Transfer-encoding-value = 0x80 | Token-text */ static guint32 wkh_transfer_encoding(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_transfer_encoding, "Transfer encoding"); if (val_id == 0x80) { proto_tree_add_string(tree, hf_hdr_transfer_encoding, tvb, hdr_start, offset - hdr_start, "chunked"); ok = TRUE; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_transfer_encoding, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Accept-range-value = 0x80 | 0x81 | Token-text */ static guint32 wkh_accept_ranges(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_accept_ranges, "Accept Ranges"); switch (val_id) { case 0x80: /* none */ proto_tree_add_string(tree, hf_hdr_accept_ranges, tvb, hdr_start, offset - hdr_start, "none"); ok = TRUE; break; case 0x81: /* bytes */ proto_tree_add_string(tree, hf_hdr_accept_ranges, tvb, hdr_start, offset - hdr_start, "bytes"); ok = TRUE; break; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_accept_ranges, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Content-encoding-value = 0x80 | 0x81 | 0x82 | Token-text */ static guint32 wkh_content_encoding(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_encoding, "Content Encoding"); switch (val_id) { case 0x80: /* gzip */ proto_tree_add_string(tree, hf_hdr_content_encoding, tvb, hdr_start, offset - hdr_start, "gzip"); ok = TRUE; break; case 0x81: /* compress */ proto_tree_add_string(tree, hf_hdr_content_encoding, tvb, hdr_start, offset - hdr_start, "compress"); ok = TRUE; break; case 0x82: /* deflate */ proto_tree_add_string(tree, hf_hdr_content_encoding, tvb, hdr_start, offset - hdr_start, "deflate"); ok = TRUE; break; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_content_encoding, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Accept-encoding-value = * Short-integer * | Token-text * | ( Value-length ( Short-integer | Text-string ) [ Q-value ] ) */ static guint32 wkh_accept_encoding(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0_Declarations; guint32 len, off; guint8 peek; gchar *str; proto_item *ti = NULL; proto_tree *parameter_tree = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_accept_encoding, "Accept Encoding"); switch (val_id) { case 0x80: /* gzip */ proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "gzip"); ok = TRUE; break; case 0x81: /* compress */ proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "compress"); ok = TRUE; break; case 0x82: /* deflate */ proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "deflate"); ok = TRUE; break; case 0x83: /* * */ proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "*"); ok = TRUE; break; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (is_short_integer(peek)) { switch (peek) { case 0x80: /* gzip */ ti = proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "gzip"); ok = TRUE; break; case 0x81: /* compress */ ti = proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "compress"); ok = TRUE; break; case 0x82: /* deflate */ ti = proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "deflate"); ok = TRUE; break; case 0x83: /* any */ ti = proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, "*"); ok = TRUE; break; } off++; } else { get_token_text(str, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf_hdr_accept_encoding, tvb, hdr_start, offset - hdr_start, str); } off += len; } if (ok) { /* Remember: offset == val_start + val_len_len + val_len */ if (off < offset) { /* Add Q-value if available */ parameter_tree = proto_item_add_subtree(ti, ett_header); parameter_value_q(parameter_tree, pinfo, ti, tvb, off); } } wkh_4_End(); } /* * Content-disposition-value = Value-length ( Disposition ) *( Parameter ) * Disposition = Form-data | Attachment | Inline | Token-text * Form-data = 0x80 * Attachment = 0x81 * Inline = 0x82 * We handle this as: * Value-length ( Short-integer | Text-string ) *( Parameter ) */ static guint32 wkh_content_disposition(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0a_Declarations; guint32 len, off; guint8 peek; gchar *str; proto_item *ti = NULL; proto_tree *parameter_tree = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_disposition, "Content Disposition"); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (is_short_integer(peek)) { switch (peek) { case 0x80: /* form-data */ ti = proto_tree_add_string(tree, hf_hdr_content_disposition, tvb, hdr_start, offset - hdr_start, "form-data"); ok = TRUE; break; case 0x81: /* attachment */ ti = proto_tree_add_string(tree, hf_hdr_content_disposition, tvb, hdr_start, offset - hdr_start, "attachment"); ok = TRUE; break; case 0x82: /* inline */ ti = proto_tree_add_string(tree, hf_hdr_content_disposition, tvb, hdr_start, offset - hdr_start, "inline"); ok = TRUE; break; } off++; } else { get_token_text(str, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf_hdr_content_disposition, tvb, hdr_start, offset - hdr_start, str); } off += len; } if ((ok) && (off < offset)) { /* Remember: offset == val_start + val_len_len + val_len */ parameter_tree = proto_item_add_subtree(ti, ett_header); while (off < offset) { /* Add parameters if available */ off = parameter(parameter_tree, pinfo, ti, tvb, off, offset - off); } } wkh_4_End(); } /* * Common code for headers with only a textual value * is written in the macro below: */ #define wkh_text_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) \ { \ return wkh_text_header_func(tree, tvb, hdr_start, pinfo, hf_hdr_ ## underscored, Text); \ } static guint32 wkh_text_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0_Declarations; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Header: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_text_header, header_name); /* Invalid */ wkh_2_TextualValue; proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* Text-only headers: */ wkh_text_header(content_base, "Content-Base") wkh_text_header(content_location, "Content-Location") wkh_text_header(etag, "ETag") wkh_text_header(from, "From") wkh_text_header(host, "Host") wkh_text_header(if_match, "If-Match") wkh_text_header(if_none_match, "If-None-Match") wkh_text_header(location, "Location") wkh_text_header(referer, "Referer") wkh_text_header(server, "Server") wkh_text_header(user_agent, "User-Agent") wkh_text_header(upgrade, "Upgrade") wkh_text_header(via, "Via") wkh_text_header(content_uri, "Content-Uri") wkh_text_header(initiator_uri, "Initiator-Uri") wkh_text_header(profile, "Profile") /* * Same for quoted-string value */ static guint32 wkh_content_id(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0_Declarations; gchar *str; proto_item *ti = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_id, "Content ID"); /* Invalid */ wkh_2_TextualValue; if (is_quoted_string(val_str[0])) { if (is_quoted_string(val_str[val_len-2])) { /* Trailing quote - issue a warning */ ti = proto_tree_add_string(tree, hf_hdr_content_id, tvb, hdr_start, offset - hdr_start, val_str); expert_add_info(pinfo, ti, &ei_wsp_trailing_quote); } else { /* OK (no trailing quote) */ str = wmem_strdup_printf(wmem_packet_scope(), "%s\"", val_str); proto_tree_add_string(tree, hf_hdr_content_id, tvb, hdr_start, offset - hdr_start, str); } } else { ti = proto_tree_add_string(tree, hf_hdr_content_id, tvb, hdr_start, offset - hdr_start, val_str); expert_add_info(pinfo, ti, &ei_wsp_trailing_quote); } ok = TRUE; wkh_3_ValueWithLength; /* Invalid */ wkh_4_End(); } /* * Common code for headers with only a textual or a date value * is written in the macro below: */ #define wkh_text_or_date_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_text_or_date_value_header_func(tree, tvb, hdr_start, pinfo, hf_hdr_ ## underscored, Text); \ } static guint32 wkh_text_or_date_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0_Declarations; guint32 val = 0, off = val_start, len; gchar *str; /* may not be freed! */ gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Text or Date: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_text_or_date_value, header_name); /* Invalid */ wkh_2_TextualValue; proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ get_date_value(val, tvb, off, len, ok); if (ok) { str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, str); } } wkh_4_End(); } /* If-Range */ wkh_text_or_date_value_header(if_range,"If-Range") /* * Common code for headers with only a date value * is written in the macro below: */ #define wkh_date_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_date_value_header_func(tree, tvb, hdr_start, pinfo, hf_hdr_ ## underscored, Text); \ } static guint32 wkh_date_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0a_Declarations; guint32 val = 0, off = val_start, len; gchar *str; /* may not be freed! */ gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Date: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_date_value, header_name); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ get_date_value(val, tvb, off, len, ok); if (ok) { str = abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, str); /* BEHOLD: do NOT try to free str, as * abs_time_secs_to_str(wmem_packet_scope(), ) returns wmem_allocated data */ } } wkh_4_End(); } /* Date-value only headers: */ wkh_date_value_header(date, "Date") wkh_date_value_header(expires, "Expires") wkh_date_value_header(if_modified_since, "If-Modified-Since") wkh_date_value_header(if_unmodified_since, "If-Unmodified-Since") wkh_date_value_header(last_modified, "Last-Modified") /* Date-value with special interpretation of zero value */ #define wkh_tod_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_tod_value_header_func(tree, tvb, hdr_start, pinfo, hf_hdr_ ## underscored, Text); \ } static guint32 wkh_tod_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0a_Declarations; guint32 val = 0, off = val_start, len; proto_item *ti = NULL; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Time of Day: %s", name); nstime_t t; wkh_1_WellKnownValue(hf_hdr_name_value, ett_tod_value, header_name); if (val_id == 0x80) { /* Openwave TOD header uses this format */ t.secs = 0; t.nsecs = 0; ti = proto_tree_add_time_format_value(tree, hf, tvb, hdr_start, offset - hdr_start, &t, "Requesting Time Of Day"); proto_item_append_text(ti, " <Warning: should be encoded as long-integer>"); ok = TRUE; } /* It seems VERY unlikely that we'll see date values within the first * 127 seconds of the UNIX 1-1-1970 00:00:00 start of the date clocks * so I assume such a value is a genuine error */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ get_date_value(val, tvb, off, len, ok); if (ok) { t.secs = (time_t)val; t.nsecs = 0; if (val == 0) { proto_tree_add_time_format_value(tree, hf, tvb, hdr_start, offset - hdr_start, &t, "Requesting Time Of Day"); } else { proto_tree_add_time(tree, hf, tvb, hdr_start, offset - hdr_start, &t); } } } wkh_4_End(); } wkh_tod_value_header(x_wap_tod, "X-Wap-Tod") /* * Age-value: Delta-seconds-value */ static guint32 wkh_age(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 val = 0, off = val_start, len; wkh_1_WellKnownValue(hf_hdr_name_value, ett_age, "Age"); val = val_id & 0x7F; val_str = wmem_strdup_printf(wmem_packet_scope(), "%u second%s", val, plurality(val, "", "s")); proto_tree_add_string(tree, hf_hdr_age, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ get_long_integer(val, tvb, off, len, ok); if (ok) { val_str = wmem_strdup_printf(wmem_packet_scope(), "%u second%s", val, plurality(val, "", "s")); proto_tree_add_string(tree, hf_hdr_age, tvb, hdr_start, offset - hdr_start, val_str); } } wkh_4_End(); } /* * Template for Integer lookup or text value headers: */ #define wkh_integer_lookup_or_text_value(underscored,Text,valueStringExtAddr,valueName) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_integer_lookup_or_text_value_func(tree, tvb, hdr_start, pinfo, \ hf_hdr_ ## underscored, Text,valueStringExtAddr, \ "<Unknown " valueName " identifier 0x%X>"); \ } static guint32 wkh_integer_lookup_or_text_value_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name, value_string_ext *valueStringExtAddr, const char* value_format) G_GNUC_PRINTF(8, 0); static guint32 wkh_integer_lookup_or_text_value_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name, value_string_ext *valueStringExtAddr, const char* value_format) { wkh_0_Declarations; guint32 off = val_start, len; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Integer lookup: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_integer_lookup, header_name); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, valueStringExtAddr, value_format)); ok = TRUE; wkh_2_TextualValue; proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ len = tvb_get_guint8(tvb,off); ok = (len >= 1 && len <= 4); /* Valid lengths for us are 1-4 */ if (ok) { proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_to_str_ext(val_id & 0x7F, valueStringExtAddr, value_format)); } } wkh_4_End(); } /* * Wap-application-value: Uri-value | Integer-value */ wkh_integer_lookup_or_text_value(x_wap_application_id, "X-Wap-Application-Id", &vals_wap_application_ids_ext, "WAP application") wkh_integer_lookup_or_text_value(accept_application, "Accept-Application", &vals_wap_application_ids_ext, "WAP application") wkh_integer_lookup_or_text_value(content_language, "Content-Language", &vals_languages_ext, "language") /* NOTE - Although the WSP spec says this is an integer-value, the WSP headers * are encoded as a 7-bit entity! */ wkh_integer_lookup_or_text_value(trailer, "Trailer", &vals_field_names_ext, "well-known-header") /* * Challenge */ /* * Common code for headers with only a challenge value * is written in the macro below: */ #define wkh_challenge_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_challenge_value_header_func(tree, tvb, hdr_start, pinfo, \ hf_hdr_ ## underscored, hf_hdr_ ## underscored ## _scheme, \ hf_hdr_ ## underscored ## _realm, Text); \ } static guint32 wkh_challenge_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, int hf_scheme, int hf_realm, const char* name) { wkh_0a_Declarations; guint8 peek; guint32 off, len; proto_tree *subtree; gchar *str; proto_item *ti = NULL; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Challenge: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_challenge, header_name); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (peek == 0x80) { /* Basic */ ti = proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, "basic"); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_string(subtree, hf_scheme, tvb, off, 1, "basic"); off++; /* Realm: text-string */ get_text_string(str,tvb,off,len,ok); if (ok) { proto_tree_add_string(subtree, hf_realm, tvb, off, len, str); proto_item_append_text(ti, "; realm=%s", str); /*off += len;*/ } } else { /* Authentication-scheme: token-text */ get_token_text(str, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf, tvb, hdr_start, off - hdr_start, str); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_string(subtree, hf_scheme, tvb, hdr_start, off - hdr_start, str); off += len; /* Realm: text-string */ get_text_string(str,tvb,off,len,ok); if (ok) { proto_tree_add_string(subtree, hf_realm, tvb, off, len, str); proto_item_append_text(ti, "; realm=%s", str); off += len; /* Auth-params: parameter - TODO */ while (off < offset) /* Parse parameters */ off = parameter(subtree, pinfo, ti, tvb, off, offset - off); } } } wkh_4_End(); } /* Challenge-value only headers: */ wkh_challenge_value_header(www_authenticate, "WWW-Authenticate") wkh_challenge_value_header(proxy_authenticate, "Proxy-Authenticate") /* * Credentials */ /* * Common code for headers with only a credentials value * is written in the macro below: */ #define wkh_credentials_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_credentials_value_header_func(tree, tvb, hdr_start, pinfo, \ hf_hdr_ ## underscored, hf_hdr_ ## underscored ## _scheme, \ hf_hdr_ ## underscored ## _user_id, hf_hdr_ ## underscored ## _password, Text); \ } static guint32 wkh_credentials_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, int hf_scheme, int hf_userid, int hf_password, const char* name) { wkh_0a_Declarations; guint8 peek; guint32 off, len; proto_tree *subtree; gchar *str; proto_item *ti = NULL; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Credentials: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_credentials_value, header_name); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; peek = tvb_get_guint8(tvb, off); if (peek == 0x80) { /* Basic */ ti = proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, "basic"); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_string(subtree, hf_scheme, tvb, off, 1, "basic"); off++; /* User-id: text-string */ get_text_string(str,tvb,off,len,ok); if (ok) { proto_tree_add_string(subtree, hf_userid, tvb, off, len, str); proto_item_append_text(ti, "; user-id=%s", str); off += len; /* Password: text-string */ get_text_string(str,tvb,off,len,ok); if (ok) { proto_tree_add_string(subtree, hf_password, tvb, off, len, str); proto_item_append_text(ti, "; password=%s", str); /*off += len;*/ } } } else { /* Authentication-scheme: token-text */ get_token_text(str, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf, tvb, hdr_start, off - hdr_start, str); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_string(subtree, hf_scheme, tvb, hdr_start, off - hdr_start, str); off += len; /* Auth-params: parameter - TODO */ while (off < offset) /* Parse parameters */ off = parameter(subtree, pinfo, ti, tvb, off, offset - off); } } wkh_4_End(); } /* Credentials-value only headers: */ wkh_credentials_value_header(authorization, "Authorization") wkh_credentials_value_header(proxy_authorization, "Proxy-Authorization") /* * Content-md5-value = 16*16 OCTET */ static guint32 wkh_content_md5 (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0a_Declarations; guint32 off; wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_md5, "Content-md5"); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; if (val_len == 16) { proto_tree_add_item(tree, hf_hdr_content_md5, tvb, off, val_len, ENC_NA); ok = TRUE; } wkh_4_End(); } /* * Pragma-value = 0x80 | Length Parameter */ static guint32 wkh_pragma(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { wkh_0a_Declarations; guint32 off; proto_item *ti = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_pragma, "Pragma"); if (val_id == 0x80) { proto_tree_add_string(tree, hf_hdr_pragma, tvb, hdr_start, offset - hdr_start, "no-cache"); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; ti = proto_tree_add_string(tree, hf_hdr_pragma, tvb, hdr_start, off - hdr_start, ""); /* NULL subtree for parameter() results in no subtree * TODO - provide a single parameter dissector that appends data * to the header field data. */ parameter(NULL, pinfo, ti, tvb, off, offset - off); ok = TRUE; wkh_4_End(); } /* * Integer-value */ #define wkh_integer_value_header(underscored,Text) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_integer_value_header_func(tree, tvb, hdr_start, pinfo, hf_hdr_ ## underscored, Text); \ } static guint32 wkh_integer_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name) { wkh_0a_Declarations; guint32 val = 0, off = val_start, len; gchar *str; /* may not be freed! */ gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Integer-value: %s", name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_integer_value, header_name); str = wmem_strdup_printf(wmem_packet_scope(), "%u", val_id & 0x7F); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, str); ok = TRUE; wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ get_long_integer(val, tvb, off, len, ok); if (ok) { str = wmem_strdup_printf(wmem_packet_scope(), "%u", val); proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, str); } } wkh_4_End(); } wkh_integer_value_header(content_length, "Content-Length") wkh_integer_value_header(max_forwards, "Max-Forwards") #define wkh_integer_lookup_value_header(underscored,Text,valueStringExtAddr,valueName) \ static guint32 \ wkh_ ## underscored(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) \ { \ return wkh_integer_lookup_value_header_func(tree, tvb, hdr_start, pinfo, \ hf_hdr_ ## underscored, Text,valueStringExtAddr, valueName); \ } static guint32 wkh_integer_lookup_value_header_func(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo, int hf, const char* name, value_string_ext *valueStringExtAddr, const char* value_name) { wkh_0_Declarations; guint32 off = val_start, len; gchar* header_name = wmem_strdup_printf(wmem_packet_scope(), "Integer lookup: %s", name); gchar* value_name_str = wmem_strdup_printf(wmem_packet_scope(), "<Unknown %s>", value_name); wkh_1_WellKnownValue(hf_hdr_name_value, ett_integer_lookup_value, header_name); val_str = try_val_to_str_ext(val_id & 0x7F, valueStringExtAddr); if (val_str) { proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; } else { proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, value_name_str); } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; if (val_id <= 4) { /* Length field already parsed by macro! */ len = tvb_get_guint8(tvb,off); ok = (len >= 1 && len <= 4); /* Valid lengths for us are 1-4 */ if (ok) { val_str = try_val_to_str_ext(val_id & 0x7F, valueStringExtAddr); if (val_str) { proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; } else { proto_tree_add_string(tree, hf, tvb, hdr_start, offset - hdr_start, value_name_str); } } } wkh_4_End(); } wkh_integer_lookup_value_header(bearer_indication, "Bearer-Indication", &vals_bearer_types_ext, "bearer type") /* * Cache-control-value */ static guint32 wkh_cache_control(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 off, len, val = 0; guint8 peek, cache_control_directive; proto_item *ti = NULL; wmem_strbuf_t *cache_str; wkh_1_WellKnownValue(hf_hdr_name_value, ett_cache_control, "Cache-control"); val = val_id & 0x7F; val_str = try_val_to_str_ext(val, &vals_cache_control_ext); if (val_str) { proto_tree_add_string(tree, hf_hdr_cache_control, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; } wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_cache_control, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; /* General form: * ( no-cache | private ) 1*( Field-name ) * | ( max-age | max-stale | min-fresh | s-maxage) Delta-seconds-value * | Token-text ( Integer-value | Text-value ) * Where: * Field-name = Short-integer | Token-text */ off = val_start + val_len_len; cache_control_directive = tvb_get_guint8(tvb, off++); if (cache_control_directive & 0x80) { /* Well known cache directive */ switch (cache_control_directive & 0x7F) { case CACHE_CONTROL_NO_CACHE: case CACHE_CONTROL_PRIVATE: cache_str = wmem_strbuf_new(wmem_packet_scope(), val_to_str_ext (cache_control_directive & 0x7F, &vals_cache_control_ext, "<Unknown cache control directive 0x%02X>")); /* TODO: split multiple entries */ ok = TRUE; while (ok && (off < offset)) { /* 1*( Field-name ) */ peek = tvb_get_guint8(tvb, off); if (peek & 0x80) { /* Well-known-field-name */ wmem_strbuf_append(cache_str, val_to_str (peek, vals_field_names, "<Unknown WSP header field 0x%02X>")); off++; } else { /* Token-text */ get_token_text(val_str, tvb, off, len, ok); if (ok) { wmem_strbuf_append(cache_str, val_str); off += len; } } } proto_tree_add_string(tree, hf_hdr_cache_control, tvb, hdr_start, offset - hdr_start, wmem_strbuf_get_str(cache_str)); break; case CACHE_CONTROL_MAX_AGE: case CACHE_CONTROL_MAX_STALE: case CACHE_CONTROL_MIN_FRESH: case CACHE_CONTROL_S_MAXAGE: ti = proto_tree_add_string(tree, hf_hdr_cache_control, tvb, hdr_start, offset - hdr_start, val_to_str_ext (cache_control_directive & 0x7F, &vals_cache_control_ext, "<Unknown cache control directive 0x%02X>")); get_delta_seconds_value(val, tvb, off, len, ok); if (ok) { proto_item_append_text(ti, "=%u second%s", val, plurality(val, "", "s")); } break; default: /* ok = FALSE */ break; } } else if (is_token_text(cache_control_directive)) { get_token_text(val_str, tvb, off, len, ok); if (ok) { ti = proto_tree_add_string(tree, hf_hdr_cache_control, tvb, hdr_start, offset - hdr_start, val_str); get_integer_value(val, tvb, off, len, ok); if (ok) { /* Integer-value */ proto_item_append_text(ti, "=%u", val); } else { /* Text-value */ get_text_string(val_str, tvb, off, len, ok); if (ok) { if (is_quoted_string(val_str[0])) { if (is_quoted_string(val_str[len-2])) { /* Trailing quote - issue a warning */ expert_add_info(pinfo, ti, &ei_wsp_trailing_quote); } else { /* OK (no trailing quote) */ proto_item_append_text(ti, "%s\"", val_str); } } else { /* Token-text | 0x00 */ /* TODO - check that we have Token-text or 0x00 */ proto_item_append_text(ti, "%s", val_str); } } } } } wkh_4_End(); } /* * Warning-value = * Short-integer * | ( Value-length Short-integer Text-string Text-string ) */ static guint32 wkh_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 off, len, val; guint8 warn_code; gchar *str; proto_item *ti = NULL; proto_tree *subtree; /* TODO - subtree with values */ wkh_1_WellKnownValue(hf_hdr_name_value, ett_warning, "Warning"); val = val_id & 0x7F; val_str = try_val_to_str_ext(val, &vals_wsp_warning_code_ext); if (val_str) { ti = proto_tree_add_string(tree, hf_hdr_warning, tvb, hdr_start, offset - hdr_start, val_str); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_uint(subtree, hf_hdr_warning_code, tvb, val_start, 1, val); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; /* TODO - subtree with individual values */ off = val_start + val_len_len; warn_code = tvb_get_guint8(tvb, off); if (warn_code & 0x80) { /* Well known warn code */ val = warn_code & 0x7f; val_str = try_val_to_str_ext(val, &vals_wsp_warning_code_short_ext); if (val_str) { /* OK */ str = wmem_strdup_printf(wmem_packet_scope(), "code=%s", val_str); ti = proto_tree_add_string(tree, hf_hdr_warning, tvb, hdr_start, offset - hdr_start, str); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_uint(subtree, hf_hdr_warning_code, tvb, off, 1, val); off++; /* Now skip to the warn-agent subfield */ get_text_string(str, tvb, off, len, ok); if (ok) { /* Valid warn-agent string */ proto_tree_add_string(subtree, hf_hdr_warning_agent, tvb, off, len, str); proto_item_append_text(ti, "; agent=%s", str); off += len; get_text_string(str, tvb, off, len, ok); if (ok) { /* Valid warn-text string */ proto_tree_add_string(subtree, hf_hdr_warning_text, tvb, off, len, str); proto_item_append_text(ti, "; text=%s", str); /*off += len;*/ } } } } wkh_4_End(); } /* * Profile-warning-value = * Short-integer * | ( Value-length Short-integer Text-string *( Date-value ) ) */ static guint32 wkh_profile_warning(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 off, len, val = 0; guint8 warn_code; proto_item *ti = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_profile_warning, "Profile-warning"); val = val_id & 0x7F; val_str = try_val_to_str_ext(val, &vals_wsp_profile_warning_code_ext); if (val_str) { proto_tree_add_string(tree, hf_hdr_profile_warning, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; warn_code = tvb_get_guint8(tvb, off++); if (warn_code & 0x80) { /* Well known warn code */ val_str = try_val_to_str_ext(val, &vals_wsp_profile_warning_code_ext); if (val_str) { /* OK */ ti = proto_tree_add_string(tree, hf_hdr_profile_warning, tvb, hdr_start, offset - hdr_start, val_str); get_uri_value(val_str, tvb, off, len, ok); if (ok) { /* Valid warn-target string */ /* TODO: Why did we just call get_uri_value() and not use * the str, since the pointer to it is immediately * forgotten with the call to ws_strdup_printf()? */ off += len; proto_item_append_text(ti, "; target=%s", val_str); /* Add zero or more dates */ while (ok && (off < offset)) { get_date_value(val, tvb, off, len, ok); if (ok) { /* Valid warn-text string */ off += len; proto_item_append_text(ti, "; date=%s", abs_time_secs_to_str(wmem_packet_scope(), val, ABSOLUTE_TIME_LOCAL, TRUE)); } } } } } wkh_4_End(); } /* Encoding-version-value = * Short-integer * | Text-string * | Length Short-integer [ Short-integer | text-string ] */ static guint32 wkh_encoding_version (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; proto_item *ti = NULL; guint32 off, val, len; wkh_1_WellKnownValue(hf_hdr_name_value, ett_encoding_version, "Encoding-version"); val = val_id & 0x7F; val_str = wmem_strdup_printf(wmem_packet_scope(), "%u.%u", val >> 4, val & 0x0F); proto_tree_add_string(tree, hf_hdr_encoding_version, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_2_TextualValue; proto_tree_add_string(tree, hf_hdr_encoding_version, tvb, hdr_start, offset - hdr_start, val_str); ok = TRUE; wkh_3_ValueWithLength; off = val_start + val_len_len; val = tvb_get_guint8(tvb, off); if (val & 0x80) { /* Header Code Page */ val_str = wmem_strdup_printf(wmem_packet_scope(), "code-page=%u", val & 0x7F); ti = proto_tree_add_string(tree, hf_hdr_encoding_version, tvb, hdr_start, offset - hdr_start, val_str); off++; ok = TRUE; if (off < offset) { /* Extra version-value */ get_version_value(val,val_str,tvb,off,len,ok); if (ok) { /* Always creates a string if OK */ proto_item_append_text(ti, ": %s", val_str); } } } wkh_4_End(); } /* Content-range-value = * Length Uintvar-integer ( 0x80 | Uintvar-integer ) */ static guint32 wkh_content_range(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 off, val, len; proto_item *ti = NULL; proto_tree *subtree = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_content_range, "Content range"); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; get_uintvar_integer (val, tvb, off, len, ok); /* Uintvar start */ if (ok) { val_str = wmem_strdup_printf(wmem_packet_scope(), "first-byte-pos=%u", val); ti = proto_tree_add_string(tree, hf_hdr_content_range, tvb, hdr_start, offset - hdr_start, val_str); subtree = proto_item_add_subtree(ti, ett_header); proto_tree_add_uint(subtree, hf_hdr_content_range_first_byte_pos, tvb, off, len, val); off += len; /* Now check next value */ val = tvb_get_guint8(tvb, off); if (val == 0x80) { /* Unknown length */ proto_item_append_text(ti, "%s", "; entity-length=unknown"); } else { /* Uintvar entity length */ get_uintvar_integer (val, tvb, off, len, ok); if (ok) { proto_item_append_text(ti, "; entity-length=%u", val); proto_tree_add_uint(subtree, hf_hdr_content_range_entity_length, tvb, off, len, val); } } } wkh_4_End(); } /* Range-value = * Length * 0x80 Uintvar-integer [ Uintvar-integer ] * | 0x81 Uintvar-integer */ static guint32 wkh_range(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0a_Declarations; guint32 off, val, len; proto_item *ti = NULL; proto_tree *subtree = NULL; wkh_1_WellKnownValue(hf_hdr_name_value, ett_range, "Range"); /* Invalid */ wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; val = tvb_get_guint8(tvb, off); if (val == 0x80) { /* Byte-range */ ti = proto_tree_add_string(tree, hf_hdr_range, tvb, hdr_start, offset - hdr_start, "byte-range"); subtree = proto_item_add_subtree(ti, ett_header); /* Get the First-byte-pos (Uintvar-integer) */ get_uintvar_integer (val, tvb, off, len, ok); if (ok) { proto_item_append_text(ti, "; first-byte-pos=%u", val); proto_tree_add_uint(subtree, hf_hdr_range_first_byte_pos, tvb, off, len, val); off += len; /* Get the optional Last-byte-pos (Uintvar-integer) */ if (off < offset) { get_uintvar_integer (val, tvb, off, len, ok); if (ok) { proto_item_append_text(ti, "; last-byte-pos=%u", val); proto_tree_add_uint(subtree, hf_hdr_range_last_byte_pos, tvb, off, len, val); } } } } else if (val == 0x81) { /* Suffix-byte-range */ ti = proto_tree_add_string(tree, hf_hdr_range, tvb, hdr_start, offset - hdr_start, "suffix-byte-range"); subtree = proto_item_add_subtree(ti, ett_header); /* Get the Suffix-length (Uintvar-integer) */ get_uintvar_integer (val, tvb, off, len, ok); if (ok) { proto_item_append_text(ti, "; suffix-length=%u", val); proto_tree_add_uint(subtree, hf_hdr_range_suffix_length, tvb, off, len, val); } } wkh_4_End(); } /* TE-value = * 0x81 * | Value-length (0x82--0x86 | Token-text) [ Q-token Q-value ] */ static guint32 wkh_te (proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint32 off, val, len; wkh_1_WellKnownValue(hf_hdr_name_value, ett_te_value, "TE-value"); if (val_id == 0x81) { proto_tree_add_string(tree, hf_hdr_encoding_version, tvb, hdr_start, offset - hdr_start, "trailers"); ok = TRUE; } wkh_2_TextualValueInv; /* Invalid */ wkh_3_ValueWithLength; off = val_start + val_len_len; val = tvb_get_guint8(tvb, off); if (val & 0x80) { /* Well-known-TE */ val_str = try_val_to_str_ext((val & 0x7F), &vals_well_known_te_ext); if (val_str) { proto_tree_add_string(tree, hf_hdr_te, tvb, hdr_start, off - hdr_start, val_str); off++; ok = TRUE; } } else { /* TE in Token-text format */ get_token_text(val_str, tvb, off, len, ok); if (ok) { proto_tree_add_string(tree, hf_hdr_te, tvb, hdr_start, off - hdr_start, val_str); off += len; } } if ((ok) && (off < offset)) { /* Q-token Q-value */ /* TODO */ } wkh_4_End(); } /**************************************************************************** * O p e n w a v e h e a d e r s ****************************************************************************/ /* Dissect the Openwave header value (generic) */ static guint32 wkh_openwave_default(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo _U_) { wkh_0_Declarations; guint8 hdr_id = tvb_get_guint8 (tvb, hdr_start) & 0x7F; ok = TRUE; /* Bypass error checking as we don't parse the values! */ wkh_1_WellKnownValue(hf_hdr_openwave_name_value, ett_openwave_default, "Default"); proto_tree_add_uint_format(tree, hf_hdr_openwave_default_int, tvb, hdr_start, offset - hdr_start, val_id & 0x7F, "%s: (Undecoded well-known value 0x%02x)", val_to_str_ext (hdr_id, &vals_openwave_field_names_ext, "<Unknown WSP header field 0x%02X>"), val_id & 0x7F); wkh_2_TextualValue; proto_tree_add_string_format(tree, hf_hdr_openwave_default_string, tvb, hdr_start, offset - hdr_start, "%s: %s", val_to_str_ext (hdr_id, &vals_openwave_field_names_ext, "<Unknown WSP header field 0x%02X>"), val_str); wkh_3_ValueWithLength; proto_tree_add_uint_format(tree, hf_hdr_openwave_default_val_len, tvb, hdr_start, offset - hdr_start, val_len, "%s: (Undecoded value in general form with length indicator)", val_to_str_ext (hdr_id, &vals_openwave_field_names_ext, "<Unknown WSP header field 0x%02X>")); wkh_4_End(); /* See wkh_default for explanation */ } /* Textual Openwave headers */ wkh_text_header(openwave_x_up_proxy_operator_domain, "x-up-proxy-operator-domain") wkh_text_header(openwave_x_up_proxy_home_page, "x-up-proxy-home-page") wkh_text_header(openwave_x_up_proxy_uplink_version, "x-up-proxy-uplink-version") wkh_text_header(openwave_x_up_proxy_ba_realm, "x-up-proxy-ba-realm") wkh_text_header(openwave_x_up_proxy_request_uri, "x-up-proxy-request-uri") wkh_text_header(openwave_x_up_proxy_bookmark, "x-up-proxy-bookmark") /* Integer Openwave headers */ wkh_integer_value_header(openwave_x_up_proxy_push_seq, "x-up-proxy-push-seq") wkh_integer_value_header(openwave_x_up_proxy_notify, "x-up-proxy-notify") wkh_integer_value_header(openwave_x_up_proxy_net_ask, "x-up-proxy-net-ask") wkh_integer_value_header(openwave_x_up_proxy_ba_enable, "x-up-proxy-ba-enable") wkh_integer_value_header(openwave_x_up_proxy_redirect_enable, "x-up-proxy-redirect-enable") wkh_integer_value_header(openwave_x_up_proxy_redirect_status, "x-up-proxy-redirect-status") wkh_integer_value_header(openwave_x_up_proxy_linger, "x-up-proxy-linger") wkh_integer_value_header(openwave_x_up_proxy_enable_trust, "x-up-proxy-enable-trust") wkh_integer_value_header(openwave_x_up_proxy_trust, "x-up-proxy-trust") wkh_integer_value_header(openwave_x_up_devcap_has_color, "x-up-devcap-has-color") wkh_integer_value_header(openwave_x_up_devcap_num_softkeys, "x-up-devcap-num-softkeys") wkh_integer_value_header(openwave_x_up_devcap_softkey_size, "x-up-devcap-softkey-size") wkh_integer_value_header(openwave_x_up_devcap_screen_chars, "x-up-devcap-screen-chars") wkh_integer_value_header(openwave_x_up_devcap_screen_pixels, "x-up-devcap-screen-pixels") wkh_integer_value_header(openwave_x_up_devcap_em_size, "x-up-devcap-em-size") wkh_integer_value_header(openwave_x_up_devcap_screen_depth, "x-up-devcap-screen-depth") wkh_integer_value_header(openwave_x_up_devcap_immed_alert, "x-up-devcap-immed_alert") wkh_integer_value_header(openwave_x_up_devcap_gui, "x-up-devcap-gui") /* Openwave Time-Of-Day value header */ wkh_tod_value_header(openwave_x_up_proxy_tod, "x-up-proxy-tod") /* Openwave accept_x_q header */ wkh_accept_x_q_header(openwave_x_up_proxy_trans_charset, "x-up-proxy-trans-charset", &mibenum_vals_character_sets_ext, "character set") /* Openwave content type header */ static guint32 wkh_openwave_x_up_proxy_push_accept(proto_tree *tree, tvbuff_t *tvb, guint32 hdr_start, packet_info *pinfo) { return wkh_content_type_header(tree, tvb, hdr_start, pinfo, hf_hdr_openwave_x_up_proxy_push_accept, "x-up-proxy-push-accept"); } static gboolean parameter_text(proto_tree *tree, tvbuff_t *tvb, int *offset, proto_item *ti, int hf) { gchar *val_str; gboolean ok; guint32 val_len; get_text_string(val_str, tvb, (*offset), val_len, ok); if (ok) { proto_tree_add_string(tree, hf, tvb, *offset, val_len, val_str); proto_item_append_text(ti, "; %s=%s", proto_registrar_get_name(hf), val_str); (*offset) += val_len; } return ok; } static gboolean parameter_text_value(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int *offset, proto_item *ti, int hf) { gchar *val_str, *str; gboolean ok; guint32 val_len; proto_item* ti2; get_text_string(val_str, tvb, (*offset), val_len, ok); if (ok) { if (is_quoted_string(val_str[0])) { if (is_quoted_string(val_str[val_len-2])) { /* Trailing quote - issue a warning */ ti2 = proto_tree_add_string(tree, hf, tvb, *offset, val_len, val_str); expert_add_info(pinfo, ti2, &ei_wsp_trailing_quote); } else { /* OK (no trailing quote) */ str = wmem_strdup_printf(wmem_packet_scope(), "%s\"", val_str); proto_tree_add_string(tree, hf, tvb, *offset, val_len, str); } } else { /* Token-text | 0x00 */ /* TODO - verify that we have either Token-text or 0x00 */ proto_tree_add_string(tree, hf, tvb, *offset, val_len, val_str); } proto_item_append_text(ti, "; %s=%s", proto_registrar_get_name(hf), val_str); (*offset) += val_len; } return ok; } static const value_string parameter_type_vals[] = { { 0x00, "Q: Q-value" }, { 0x01, "Well-known-charset" }, { 0x02, "Level: Version-value" }, { 0x03, "Integer-value" }, { 0x05, "Name (Text-string)" }, { 0x06, "Filename (Text-string)" }, { 0x07, "Differences" }, { 0x08, "Padding" }, { 0x09, "Special Constrained-encoding" }, { 0x0A, "Start (Text-string)" }, { 0x0B, "Start-info (Text-string)" }, { 0x0C, "Comment (Text-string)" }, { 0x0D, "Domain (Text-string)" }, { 0x0E, "Max-Age" }, { 0x0F, "Path (Text-string)" }, { 0x10, "Secure" }, { 0x11, "SEC: Short-integer" }, { 0x12, "MAC: Text-value" }, { 0x13, "Creation-date" }, { 0x14, "Modification-date" }, { 0x15, "Read-date" }, { 0x16, "Size: Integer-value" }, { 0x17, "Name (Text-value)" }, { 0x18, "Filename (Text-value)" }, { 0x19, "Start (with multipart/related) (Text-value)" }, { 0x1A, "Start-info (with multipart/related) (Text-value)" }, { 0x1B, "Comment (Text-value)" }, { 0x1C, "Domain (Text-value)" }, { 0x1D, "Path (Text-value)" }, { 0x00, NULL } }; static value_string_ext parameter_type_vals_ext = VALUE_STRING_EXT_INIT(parameter_type_vals); /* Parameter = Untyped-parameter | Typed-parameter * Untyped-parameter = Token-text ( Integer-value | Text-value ) * Typed-parameter = * Integer-value ( * ( Integer-value | Date-value | Delta-seconds-value * | Q-value | Version-value | Uri-value ) * | Text-value ) * * * Returns: next offset * * TODO - Verify byte highlighting in case of invalid parameter values */ static int parameter (proto_tree *tree, packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, int start, int len) { int offset = start; guint8 peek = tvb_get_guint8 (tvb,start); guint32 val = 0, type = 0, type_len, val_len; const gchar *str = NULL; const gchar *val_str = NULL; gboolean ok; proto_item* ti2; if (is_token_text (peek)) { /* * Untyped parameter */ get_token_text (str,tvb,start,val_len,ok); /* Should always succeed */ if (ok) { /* Found a textual parameter name: str */ offset += val_len; get_text_value(val_str, tvb, offset, val_len, ok); if (ok) { /* Also found a textual parameter value: val_str */ offset += val_len; if (is_quoted_string(val_str[0])) { /* Add trailing quote! */ if (is_quoted_string(val_str[val_len-2])) { /* Trailing quote - issue a warning */ ti2 = proto_tree_add_string_format(tree, hf_wsp_parameter_untype_quote_text, tvb, start, offset - start, val_str, "%s: %s", str, val_str); expert_add_info(pinfo, ti2, &ei_wsp_trailing_quote); proto_item_append_text(ti, "; %s=%s", str, val_str); } else { /* OK (no trailing quote) */ proto_tree_add_string_format(tree, hf_wsp_parameter_untype_quote_text, tvb, start, offset - start, val_str, "%s: %s\"", str, val_str); proto_item_append_text(ti, "; %s=%s\"", str, val_str); } } else { /* Token-text | 0x00 */ /* TODO - verify that it is either Token-text or 0x00 * and flag with warning if invalid */ proto_tree_add_string_format(tree, hf_wsp_parameter_untype_text, tvb, start, offset - start, val_str, "%s: %s", str, val_str); proto_item_append_text(ti, "; %s=%s", str, val_str); } } else { /* Try integer value */ get_integer_value (val,tvb,offset,val_len,ok); if (ok) { /* Also found a valid integer parameter value: val */ offset += val_len; proto_tree_add_uint_format(tree, hf_wsp_parameter_untype_int, tvb, start, offset - start, val, "%s: %u", str, val); proto_item_append_text(ti, "; %s=%u", str, val); } else { /* Error: neither token-text not Integer-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, offset - start, "Invalid untyped parameter definition"); offset = start + len; /* Skip to end of buffer */ } } } return offset; } /* * Else: Typed parameter */ get_integer_value (type,tvb,start,type_len,ok); if (!ok) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, offset - start, "Invalid typed parameter definition"); return (start + len); /* Skip to end of buffer */ } offset += type_len; /* Now offset points to the parameter value */ proto_tree_add_uint(tree, hf_wsp_parameter_type, tvb, start, type_len, type); switch (type) { case 0x01: /* WSP 1.1 encoding - Charset: Well-known-charset */ get_integer_value(val, tvb, offset, val_len, ok); if (ok) { val_str = val_to_str_ext(val, &mibenum_vals_character_sets_ext, "<Unknown character set Identifier %u>"); proto_tree_add_string(tree, hf_parameter_charset, tvb, offset, val_len, val_str); proto_item_append_text(ti, "; charset=%s", val_str); offset += val_len; } else { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Charset parameter value: invalid Integer-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x03: /* WSP 1.1 encoding - Type: Integer-value */ get_integer_value (val,tvb,offset,val_len,ok); if (ok) { proto_tree_add_uint (tree, hf_wsp_parameter_int_type, tvb, offset, val_len, val); proto_item_append_text(ti, "; Type=%u", val); offset += val_len; } else { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Type parameter value: invalid Integer-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x05: /* WSP 1.1 encoding - Name: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_name)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Name (WSP 1.1 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x17: /* WSP 1.4 encoding - Name: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_name)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Name (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x06: /* WSP 1.1 encoding - Filename: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_filename)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Filename (WSP 1.1 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x18: /* WSP 1.4 encoding - Filename: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_filename)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Filename (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x09: /* WSP 1.2 encoding - Type (special): Constrained-encoding */ /* This is similar to the Content-Type header decoding, * but it is much simpler: * Constrained-encoding = Short-integer | Extension-media * Extension-media = *TEXT <Octet 0> */ get_extension_media(val_str,tvb,offset,val_len,ok); if (ok) { /* Extension-media */ proto_tree_add_string (tree, hf_wsp_parameter_upart_type, tvb, offset, val_len, val_str); proto_item_append_text(ti, "; type=%s", val_str); offset += val_len; } else { get_short_integer(val,tvb,offset,val_len,ok); if (ok) { proto_tree_add_string (tree, hf_wsp_parameter_upart_type, tvb, offset, val_len, val_to_str_ext(val, &vals_content_types_ext, "(Unknown content type identifier 0x%X)")); offset += val_len; } /* Else: invalid parameter value */ } if (!ok) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Type parameter value: invalid Constrained-encoding"); offset = start + len; /* Skip the parameters */ } break; case 0x0A: /* WSP 1.2 encoding - Start: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_start)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Start (WSP 1.2 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x19: /* WSP 1.4 encoding - Start (with multipart/related): Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_start)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Start (with multipart/related) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x0B: /* WSP 1.2 encoding - Start-info: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_start_info)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Start-info (WSP 1.2 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x1A: /* WSP 1.4 encoding - Start-info (with multipart/related): Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_start_info)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Start-info (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x0C: /* WSP 1.3 encoding - Comment: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_comment)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Comment (WSP 1.3 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x1B: /* WSP 1.4 encoding - Comment: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_comment)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Comment (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x0D: /* WSP 1.3 encoding - Domain: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_domain)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Domain (WSP 1.3 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x1C: /* WSP 1.4 encoding - Domain: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_domain)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Domain (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x0F: /* WSP 1.3 encoding - Path: Text-string */ if (!parameter_text(tree, tvb, &offset, ti, hf_wsp_parameter_path)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Path (WSP 1.3 encoding) parameter value: invalid Text-string"); offset = start + len; /* Skip to end of buffer */ } break; case 0x1D: /* WSP 1.4 encoding - Path: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_path)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Path (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x11: /* WSP 1.4 encoding - SEC: Short-integer (OCTET) */ peek = tvb_get_guint8 (tvb, start+1); if (peek & 0x80) { /* Valid Short-integer */ peek &= 0x7F; proto_tree_add_uint (tree, hf_wsp_parameter_sec, tvb, offset, 1, peek); proto_item_append_text(ti, "; SEC=%s", val_to_str_ext_const(peek, &vals_wsp_parameter_sec_ext, "Undefined")); offset++; } else { /* Error */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid SEC parameter value: invalid Short-integer-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x12: /* WSP 1.4 encoding - MAC: Text-value */ if (!parameter_text_value(tree, pinfo, tvb, &offset, ti, hf_wsp_parameter_mac)) { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid MAC (WSP 1.4 encoding) parameter value: invalid Text-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x02: /* WSP 1.1 encoding - Level: Version-value */ get_version_value(val,str,tvb,offset,val_len,ok); if (ok) { proto_tree_add_string (tree, hf_wsp_parameter_level, tvb, offset, val_len, str); proto_item_append_text(ti, "; level=%s", str); offset += val_len; } else { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Level parameter value: invalid Version-value"); offset = start + len; /* Skip to end of buffer */ } break; case 0x00: /* WSP 1.1 encoding - Q: Q-value */ offset = parameter_value_q(tree, pinfo, ti, tvb, offset); break; case 0x16: /* WSP 1.4 encoding - Size: Integer-value */ get_integer_value (val,tvb,offset,val_len,ok); if (ok) { proto_tree_add_uint (tree, hf_wsp_parameter_size, tvb, offset, val_len, val); proto_item_append_text(ti, "; Size=%u", val); offset += val_len; } else { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, len, "Invalid Size parameter value: invalid Integer-value"); offset = start + len; /* Skip to end of buffer */ } break; /* * TODO */ case 0x07: /* WSP 1.1 encoding - Differences: Field-name */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Differences"); offset = start + len; /* Skip the parameters */ break; case 0x08: /* WSP 1.1 encoding - Padding: Short-integer */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Padding"); offset = start + len; /* Skip the parameters */ break; case 0x0E: /* WSP 1.3 encoding - Max-Age: Delta-seconds-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Max-Age"); offset = start + len; /* Skip the parameters */ break; case 0x10: /* WSP 1.3 encoding - Secure: No-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Secure"); offset = start + len; /* Skip the parameters */ break; case 0x13: /* WSP 1.4 encoding - Creation-date: Date-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Creation-Date"); offset = start + len; /* Skip the parameters */ break; case 0x14: /* WSP 1.4 encoding - Modification-date: Date-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Modification-Date"); offset = start + len; /* Skip the parameters */ break; case 0x15: /* WSP 1.4 encoding - Read-date: Date-value */ proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter Read-Date"); offset = start + len; /* Skip the parameters */ break; default: proto_tree_add_expert_format(tree, pinfo, &ei_wsp_undecoded_parameter, tvb, start, offset - start, "Undecoded parameter type 0x%02x", type); offset = start + len; /* Skip the parameters */ break; } return offset; } /* * Dissects the Q-value parameter value. * * Returns: next offset */ static int parameter_value_q (proto_tree *tree, packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, int start) { int offset = start; guint32 val = 0, val_len; gchar *str = NULL; guint8 ok; get_uintvar_integer (val, tvb, offset, val_len, ok); if (ok && (val < 1100)) { if (val <= 100) { /* Q-value in 0.01 steps */ str = wmem_strdup_printf(wmem_packet_scope(), "0.%02u", val - 1); } else { /* Q-value in 0.001 steps */ str = wmem_strdup_printf(wmem_packet_scope(), "0.%03u", val - 100); } proto_item_append_text(ti, "; q=%s", str); proto_tree_add_string (tree, hf_parameter_q, tvb, start, val_len, str); offset += val_len; } else { proto_tree_add_expert_format(tree, pinfo, &ei_wsp_invalid_parameter_value, tvb, start, offset, "Invalid Q parameter value: invalid Q-value"); offset += val_len; } return offset; } static int * const address_length_flags[] = { &hf_address_flags_length_bearer_type_included, &hf_address_flags_length_port_number_included, &hf_address_flags_length_address_len, NULL }; /* Code to actually dissect the packets */ /* * WSP redirect */ /* Dissect a WSP redirect PDU. * Looks up or builds conversations, so parts of the code must always run, * even if tree is NULL. */ static void dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dissector_handle_t dissector_handle) { proto_item *ti; proto_tree *addresses_tree; proto_tree *addr_tree = NULL; guint8 bearer_type; guint8 address_flags_len; int address_len; guint16 port_num; guint32 address_ipv4; ws_in6_addr address_ipv6; address redir_address; conversation_t *conv; guint32 idx = 0; /* Address index */ guint32 address_record_len; /* Length of the entire address record */ static int * const flags[] = { &hf_wsp_redirect_permanent, &hf_wsp_redirect_reuse_security_session, NULL }; /* * Redirect flags. */ proto_tree_add_bitmask(tree, tvb, offset, hf_wsp_redirect_flags, ett_redirect_flags, flags, ENC_NA); offset++; /* * Redirect addresses. */ ti = proto_tree_add_item(tree, hf_redirect_addresses, tvb, 0, -1, ENC_NA); addresses_tree = proto_item_add_subtree(ti, ett_addresses); while (tvb_reported_length_remaining (tvb, offset) > 0) { idx++; /* * Read a single address at a time. */ address_flags_len = tvb_get_guint8 (tvb, offset); address_len = address_flags_len & ADDRESS_LEN; address_record_len = address_len + ((address_flags_len & BEARER_TYPE_INCLUDED) ? 1 : 0) + ((address_flags_len & PORT_NUMBER_INCLUDED) ? 2 : 0) ; ti = proto_tree_add_uint(addresses_tree, hf_address_entry, tvb, offset, 1 + address_record_len, idx); addr_tree = proto_item_add_subtree(ti, ett_address); proto_tree_add_bitmask(addr_tree, tvb, offset, hf_address_flags_length, ett_address_flags, address_length_flags, ENC_NA); offset++; if (address_flags_len & BEARER_TYPE_INCLUDED) { bearer_type = tvb_get_guint8 (tvb, offset); proto_tree_add_uint (addr_tree, hf_address_bearer_type, tvb, offset, 1, bearer_type); offset++; } else { bearer_type = 0x00; /* XXX */ } if (address_flags_len & PORT_NUMBER_INCLUDED) { port_num = tvb_get_ntohs (tvb, offset); proto_tree_add_uint (addr_tree, hf_address_port_num, tvb, offset, 2, port_num); offset += 2; } else { /* * Redirecting to the same server port number as was * being used, i.e. the source port number of this * redirect. */ port_num = pinfo->srcport; } if (!(address_flags_len & BEARER_TYPE_INCLUDED)) { /* * We don't have the bearer type in the message, * so we don't know the address type. * (It's the same bearer type as the original * connection.) */ goto unknown_address_type; } /* * We know the bearer type, so we know the address type. */ switch (bearer_type) { case BT_IPv4: case BT_IS_95_CSD: case BT_IS_95_PACKET_DATA: case BT_ANSI_136_CSD: case BT_ANSI_136_PACKET_DATA: case BT_GSM_CSD: case BT_GSM_GPRS: case BT_GSM_USSD_IPv4: case BT_AMPS_CDPD: case BT_PDC_CSD: case BT_PDC_PACKET_DATA: case BT_IDEN_CSD: case BT_IDEN_PACKET_DATA: case BT_PHS_CSD: case BT_TETRA_PACKET_DATA: /* * IPv4. */ if (address_len != 4) { /* * Say what? */ goto unknown_address_type; } address_ipv4 = tvb_get_ipv4(tvb, offset); proto_tree_add_ipv4 (addr_tree, hf_address_ipv4_addr, tvb, offset, 4, address_ipv4); /* * Create a conversation so that the * redirected session will be dissected * as WAP. */ redir_address.type = AT_IPv4; redir_address.len = 4; redir_address.data = (const guint8 *)&address_ipv4; /* Find a conversation based on redir_address and pinfo->dst */ conv = find_conversation(pinfo->num, &redir_address, &pinfo->dst, CONVERSATION_UDP, port_num, 0, NO_PORT_B); if (conv == NULL) { /* This conversation does not exist yet */ conv = conversation_new(pinfo->num, &redir_address, &pinfo->dst, CONVERSATION_UDP, port_num, 0, NO_PORT2); } /* Apply WSP dissection to the conversation */ conversation_set_dissector(conv, dissector_handle); break; case BT_IPv6: /* * IPv6. */ if (address_len != 16) { /* * Say what? */ goto unknown_address_type; } tvb_get_ipv6(tvb, offset, &address_ipv6); proto_tree_add_ipv6 (addr_tree, hf_address_ipv6_addr, tvb, offset, 16, &address_ipv6); /* * Create a conversation so that the * redirected session will be dissected * as WAP. */ redir_address.type = AT_IPv6; redir_address.len = 16; redir_address.data = (const guint8 *)&address_ipv6; /* Find a conversation based on redir_address and pinfo->dst */ conv = find_conversation(pinfo->num, &redir_address, &pinfo->dst, CONVERSATION_UDP, port_num, 0, NO_PORT_B); if (conv == NULL) { /* This conversation does not exist yet */ conv = conversation_new(pinfo->num, &redir_address, &pinfo->dst, CONVERSATION_UDP, port_num, 0, NO_PORT2); } /* Apply WSP dissection to the conversation */ conversation_set_dissector(conv, dissector_handle); break; unknown_address_type: default: if (address_len != 0) { proto_tree_add_item (addr_tree, hf_address_addr, tvb, offset, address_len, ENC_NA); } break; } offset += address_len; } /* while */ } /* Add addresses to the protocol tree. * This is a display-only function, so return if tree is NULL */ static void add_addresses(proto_tree *tree, tvbuff_t *tvb, int hf) { proto_item *ti; proto_tree *addresses_tree; proto_tree *addr_tree; guint8 bearer_type; guint8 address_flags_len; int address_len; guint32 tvb_len = tvb_reported_length(tvb); guint32 offset = 0; guint32 idx = 0; /* Address index */ guint32 address_record_len; /* Length of the entire address record */ /* Skip needless processing */ if (! tree) return; if (offset >= tvb_len) return; /* * Addresses. */ /* XXX: the field pointed to by hf has a type of FT_NONE */ ti = proto_tree_add_item(tree, hf, tvb, 0, -1, ENC_NA); addresses_tree = proto_item_add_subtree(ti, ett_addresses); while (offset < tvb_len) { idx++; /* * Read a single address at a time. */ address_flags_len = tvb_get_guint8 (tvb, offset); address_len = address_flags_len & ADDRESS_LEN; address_record_len = address_len + ((address_flags_len & BEARER_TYPE_INCLUDED) ? 1 : 0) + ((address_flags_len & PORT_NUMBER_INCLUDED) ? 2 : 0) ; ti = proto_tree_add_uint(addresses_tree, hf_address_entry, tvb, offset, 1 + address_record_len, idx); addr_tree = proto_item_add_subtree(ti, ett_address); proto_tree_add_bitmask(addr_tree, tvb, offset, hf_address_flags_length, ett_address_flags, address_length_flags, ENC_NA); offset++; if (address_flags_len & BEARER_TYPE_INCLUDED) { bearer_type = tvb_get_guint8 (tvb, offset); proto_tree_add_uint (addr_tree, hf_address_bearer_type, tvb, offset, 1, bearer_type); offset++; } else { bearer_type = 0x00; /* XXX */ } if (address_flags_len & PORT_NUMBER_INCLUDED) { proto_tree_add_uint (addr_tree, hf_address_port_num, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } if (!(address_flags_len & BEARER_TYPE_INCLUDED)) { /* * We don't have the bearer type in the message, * so we don't know the address type. * (It's the same bearer type as the original * connection.) */ goto unknown_address_type; } /* * We know the bearer type, so we know the address type. */ switch (bearer_type) { case BT_IPv4: case BT_IS_95_CSD: case BT_IS_95_PACKET_DATA: case BT_ANSI_136_CSD: case BT_ANSI_136_PACKET_DATA: case BT_GSM_CSD: case BT_GSM_GPRS: case BT_GSM_USSD_IPv4: case BT_AMPS_CDPD: case BT_PDC_CSD: case BT_PDC_PACKET_DATA: case BT_IDEN_CSD: case BT_IDEN_PACKET_DATA: case BT_PHS_CSD: case BT_TETRA_PACKET_DATA: /* * IPv4. */ if (address_len != 4) { /* * Say what? */ goto unknown_address_type; } proto_tree_add_item (addr_tree, hf_address_ipv4_addr, tvb, offset, 4, ENC_NA); break; case BT_IPv6: /* * IPv6. */ if (address_len != 16) { /* * Say what? */ goto unknown_address_type; } proto_tree_add_item (addr_tree, hf_address_ipv6_addr, tvb, offset, 16, ENC_NA); break; unknown_address_type: default: if (address_len != 0) { proto_tree_add_item (addr_tree, hf_address_addr, tvb, offset, address_len, ENC_NA); } break; } offset += address_len; } /* while */ } /* Define a pointer to function data type for the well-known header * lookup table below */ typedef guint32 (*hdr_parse_func_ptr) (proto_tree *, tvbuff_t *, guint32, packet_info *); /* Lookup table for well-known header parsing functions */ static const hdr_parse_func_ptr WellKnownHeader[128] = { /* 0x00 */ wkh_accept, /* 0x01 */ wkh_accept_charset, /* 0x02 */ wkh_accept_encoding, /* 0x03 */ wkh_accept_language, /* 0x04 */ wkh_accept_ranges, /* 0x05 */ wkh_age, /* 0x06 */ wkh_allow, /* 0x07 */ wkh_authorization, /* 0x08 */ wkh_cache_control, /* 0x09 */ wkh_connection, /* 0x0A */ wkh_content_base, /* 0x0B */ wkh_content_encoding, /* 0x0C */ wkh_content_language, /* 0x0D */ wkh_content_length, /* 0x0E */ wkh_content_location, /* 0x0F */ wkh_content_md5, /* 0x10 */ wkh_content_range, /* 0x11 */ wkh_content_type, /* 0x12 */ wkh_date, /* 0x13 */ wkh_etag, /* 0x14 */ wkh_expires, /* 0x15 */ wkh_from, /* 0x16 */ wkh_host, /* 0x17 */ wkh_if_modified_since, /* 0x18 */ wkh_if_match, /* 0x19 */ wkh_if_none_match, /* 0x1A */ wkh_if_range, /* 0x1B */ wkh_if_unmodified_since, /* 0x1C */ wkh_location, /* 0x1D */ wkh_last_modified, /* 0x1E */ wkh_max_forwards, /* 0x1F */ wkh_pragma, /* 0x20 */ wkh_proxy_authenticate, /* 0x21 */ wkh_proxy_authorization, /* 0x22 */ wkh_public, /* 0x23 */ wkh_range, /* 0x24 */ wkh_referer, /* 0x25 */ wkh_default, /* 0x26 */ wkh_server, /* 0x27 */ wkh_transfer_encoding, /* 0x28 */ wkh_upgrade, /* 0x29 */ wkh_user_agent, /* 0x2A */ wkh_vary, /* 0x2B */ wkh_via, /* 0x2C */ wkh_warning, /* 0x2D */ wkh_www_authenticate, /* 0x2E */ wkh_content_disposition,/* 0x2F */ wkh_x_wap_application_id, /* 0x30 */ wkh_content_uri, /* 0x31 */ wkh_initiator_uri, /* 0x32 */ wkh_accept_application, /* 0x33 */ wkh_bearer_indication, /* 0x34 */ wkh_push_flag, /* 0x35 */ wkh_profile, /* 0x36 */ wkh_profile_diff_wbxml, /* 0x37 */ wkh_profile_warning, /* 0x38 */ wkh_default, /* 0x39 */ wkh_te, /* 0x3A */ wkh_trailer, /* 0x3B */ wkh_accept_charset, /* 0x3C */ wkh_accept_encoding, /* 0x3D */ wkh_cache_control, /* 0x3E */ wkh_content_range, /* 0x3F */ wkh_x_wap_tod, /* 0x40 */ wkh_content_id, /* 0x41 */ wkh_default, /* 0x42 */ wkh_default, /* 0x43 */ wkh_encoding_version, /* 0x44 */ wkh_profile_warning, /* 0x45 */ wkh_content_disposition, /* 0x46 */ wkh_x_wap_security, /* 0x47 */ wkh_cache_control, /******************************************************* *** The following headers are not (yet) registered. *** *******************************************************/ /* 0x48 */ wkh_default, /* 0x49 */ wkh_default, /* 0x4A */ wkh_default, /* 0x4B */ wkh_default, /* 0x4C */ wkh_default, /* 0x4D */ wkh_default, /* 0x4E */ wkh_default, /* 0x4F */ wkh_default, /* 0x50 */ wkh_default, /* 0x51 */ wkh_default, /* 0x52 */ wkh_default, /* 0x53 */ wkh_default, /* 0x54 */ wkh_default, /* 0x55 */ wkh_default, /* 0x56 */ wkh_default, /* 0x57 */ wkh_default, /* 0x58 */ wkh_default, /* 0x59 */ wkh_default, /* 0x5A */ wkh_default, /* 0x5B */ wkh_default, /* 0x5C */ wkh_default, /* 0x5D */ wkh_default, /* 0x5E */ wkh_default, /* 0x5F */ wkh_default, /* 0x60 */ wkh_default, /* 0x61 */ wkh_default, /* 0x62 */ wkh_default, /* 0x63 */ wkh_default, /* 0x64 */ wkh_default, /* 0x65 */ wkh_default, /* 0x66 */ wkh_default, /* 0x67 */ wkh_default, /* 0x68 */ wkh_default, /* 0x69 */ wkh_default, /* 0x6A */ wkh_default, /* 0x6B */ wkh_default, /* 0x6C */ wkh_default, /* 0x6D */ wkh_default, /* 0x6E */ wkh_default, /* 0x6F */ wkh_default, /* 0x70 */ wkh_default, /* 0x71 */ wkh_default, /* 0x72 */ wkh_default, /* 0x73 */ wkh_default, /* 0x74 */ wkh_default, /* 0x75 */ wkh_default, /* 0x76 */ wkh_default, /* 0x77 */ wkh_default, /* 0x78 */ wkh_default, /* 0x79 */ wkh_default, /* 0x7A */ wkh_default, /* 0x7B */ wkh_default, /* 0x7C */ wkh_default, /* 0x7D */ wkh_default, /* 0x7E */ wkh_default, /* 0x7F */ wkh_default, }; /* Lookup table for well-known header parsing functions */ static const hdr_parse_func_ptr WellKnownOpenwaveHeader[128] = { /* 0x00 */ wkh_openwave_default, /* 0x01 */ wkh_openwave_x_up_proxy_push_accept, /* 0x02 */ wkh_openwave_x_up_proxy_push_seq, /* 0x03 */ wkh_openwave_x_up_proxy_notify, /* 0x04 */ wkh_openwave_x_up_proxy_operator_domain, /* 0x05 */ wkh_openwave_x_up_proxy_home_page, /* 0x06 */ wkh_openwave_x_up_devcap_has_color, /* 0x07 */ wkh_openwave_x_up_devcap_num_softkeys, /* 0x08 */ wkh_openwave_x_up_devcap_softkey_size, /* 0x09 */ wkh_openwave_x_up_devcap_screen_chars, /* 0x0A */ wkh_openwave_x_up_devcap_screen_pixels, /* 0x0B */ wkh_openwave_x_up_devcap_em_size, /* 0x0C */ wkh_openwave_x_up_devcap_screen_depth, /* 0x0D */ wkh_openwave_x_up_devcap_immed_alert, /* 0x0E */ wkh_openwave_x_up_proxy_net_ask, /* 0x0F */ wkh_openwave_x_up_proxy_uplink_version, /* 0x10 */ wkh_openwave_x_up_proxy_tod, /* 0x11 */ wkh_openwave_x_up_proxy_ba_enable, /* 0x12 */ wkh_openwave_x_up_proxy_ba_realm, /* 0x13 */ wkh_openwave_x_up_proxy_redirect_enable, /* 0x14 */ wkh_openwave_x_up_proxy_request_uri, /* 0x15 */ wkh_openwave_x_up_proxy_redirect_status, /* 0x16 */ wkh_openwave_x_up_proxy_trans_charset, /* 0x17 */ wkh_openwave_x_up_proxy_linger, /* 0x18 */ wkh_openwave_default, /* 0x19 */ wkh_openwave_x_up_proxy_enable_trust, /* 0x1A */ wkh_openwave_x_up_proxy_trust, /* 0x1B */ wkh_openwave_default, /* 0x1C */ wkh_openwave_default, /* 0x1D */ wkh_openwave_default, /* 0x1E */ wkh_openwave_default, /* 0x1F */ wkh_openwave_default, /* 0x20 */ wkh_openwave_x_up_proxy_trust, /* 0x21 */ wkh_openwave_x_up_proxy_bookmark, /* 0x22 */ wkh_openwave_x_up_devcap_gui, /******************************************************* *** The following headers are not (yet) registered. *** *******************************************************/ /* 0x23 */ wkh_openwave_default, /* 0x24 */ wkh_openwave_default, /* 0x25 */ wkh_openwave_default, /* 0x26 */ wkh_openwave_default, /* 0x27 */ wkh_openwave_default, /* 0x28 */ wkh_openwave_default, /* 0x29 */ wkh_openwave_default, /* 0x2A */ wkh_openwave_default, /* 0x2B */ wkh_openwave_default, /* 0x2C */ wkh_openwave_default, /* 0x2D */ wkh_openwave_default, /* 0x2E */ wkh_openwave_default, /* 0x2F */ wkh_openwave_default, /* 0x30 */ wkh_openwave_default, /* 0x31 */ wkh_openwave_default, /* 0x32 */ wkh_openwave_default, /* 0x33 */ wkh_openwave_default, /* 0x34 */ wkh_openwave_default, /* 0x35 */ wkh_openwave_default, /* 0x36 */ wkh_openwave_default, /* 0x37 */ wkh_openwave_default, /* 0x38 */ wkh_openwave_default, /* 0x39 */ wkh_openwave_default, /* 0x3A */ wkh_openwave_default, /* 0x3B */ wkh_openwave_default, /* 0x3C */ wkh_openwave_default, /* 0x3D */ wkh_openwave_default, /* 0x3E */ wkh_openwave_default, /* 0x3F */ wkh_openwave_default, /* 0x40 */ wkh_openwave_default, /* 0x41 */ wkh_openwave_default, /* 0x42 */ wkh_openwave_default, /* 0x43 */ wkh_openwave_default, /* 0x44 */ wkh_openwave_default, /* 0x45 */ wkh_openwave_default, /* 0x46 */ wkh_openwave_default, /* 0x47 */ wkh_openwave_default, /* 0x48 */ wkh_openwave_default, /* 0x49 */ wkh_openwave_default, /* 0x4A */ wkh_openwave_default, /* 0x4B */ wkh_openwave_default, /* 0x4C */ wkh_openwave_default, /* 0x4D */ wkh_openwave_default, /* 0x4E */ wkh_openwave_default, /* 0x4F */ wkh_openwave_default, /* 0x50 */ wkh_openwave_default, /* 0x51 */ wkh_openwave_default, /* 0x52 */ wkh_openwave_default, /* 0x53 */ wkh_openwave_default, /* 0x54 */ wkh_openwave_default, /* 0x55 */ wkh_openwave_default, /* 0x56 */ wkh_openwave_default, /* 0x57 */ wkh_openwave_default, /* 0x58 */ wkh_openwave_default, /* 0x59 */ wkh_openwave_default, /* 0x5A */ wkh_openwave_default, /* 0x5B */ wkh_openwave_default, /* 0x5C */ wkh_openwave_default, /* 0x5D */ wkh_openwave_default, /* 0x5E */ wkh_openwave_default, /* 0x5F */ wkh_openwave_default, /* 0x60 */ wkh_openwave_default, /* 0x61 */ wkh_openwave_default, /* 0x62 */ wkh_openwave_default, /* 0x63 */ wkh_openwave_default, /* 0x64 */ wkh_openwave_default, /* 0x65 */ wkh_openwave_default, /* 0x66 */ wkh_openwave_default, /* 0x67 */ wkh_openwave_default, /* 0x68 */ wkh_openwave_default, /* 0x69 */ wkh_openwave_default, /* 0x6A */ wkh_openwave_default, /* 0x6B */ wkh_openwave_default, /* 0x6C */ wkh_openwave_default, /* 0x6D */ wkh_openwave_default, /* 0x6E */ wkh_openwave_default, /* 0x6F */ wkh_openwave_default, /* 0x70 */ wkh_openwave_default, /* 0x71 */ wkh_openwave_default, /* 0x72 */ wkh_openwave_default, /* 0x73 */ wkh_openwave_default, /* 0x74 */ wkh_openwave_default, /* 0x75 */ wkh_openwave_default, /* 0x76 */ wkh_openwave_default, /* 0x77 */ wkh_openwave_default, /* 0x78 */ wkh_openwave_default, /* 0x79 */ wkh_openwave_default, /* 0x7A */ wkh_openwave_default, /* 0x7B */ wkh_openwave_default, /* 0x7C */ wkh_openwave_default, /* 0x7D */ wkh_openwave_default, /* 0x7E */ wkh_openwave_default, /* 0x7F */ wkh_openwave_default }; /* WSP header format * 1st byte: 0x00 : <Not allowed> * 1st byte: 0x01 -- 0x1F: <Shorthand Header Code Page switch> * 1st byte: 0x20 -- 0x7E: <Textual header (C string)> * Followed with: <Textual header value (C string)> * 1st byte: 0x7F : <Header Code Page switch> * Followed with: 2nd byte: <Header Code Page> * 1st byte: 0x80 -- 0xFF: <Binary header (7-bit encoded ID)> * Followed with: * 2nd byte: 0x00 -- 0x1E: <Value Length (bytes)> * Followed with: <Len> bytes of data * 2nd byte: 0x1F : <Value Length is a guintvar> * Followed with: <guintvar Len> * Followed with: <Len> bytes of data * 2nd byte: 0x20 -- 0x7F: <Textual header value (C string)> * 2nd byte: 0x80 -- 0xFF: <Binary value (7-bit encoded ID)> */ static void add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo) { guint8 hdr_id, val_id, codepage = 1; gint32 tvb_len = tvb_reported_length(tvb); gint32 offset = 0; gint32 save_offset; gint32 hdr_len, hdr_start; gint32 val_len, val_start; gchar *hdr_str, *val_str; proto_tree *wsp_headers; proto_item *ti, *hidden_item; guint8 ok; guint32 val = 0; if (offset >= tvb_len) return; /* No headers! */ /* XXX: the field pointed to by hf has a type of FT_NONE */ ti = proto_tree_add_item(tree, hf, tvb, offset, tvb_len, ENC_NA); wsp_headers = proto_item_add_subtree(ti, ett_headers); while (offset < tvb_len) { hdr_start = offset; hdr_id = tvb_get_guint8(tvb, offset); if (hdr_id & 0x80) { /* Well-known header */ hdr_len = 1; /* Call header value dissector for given header */ if (codepage == 1) { /* Default header code page */ save_offset = offset; offset = WellKnownHeader[hdr_id & 0x7F](wsp_headers, tvb, hdr_start, pinfo); /* Make sure we're progressing forward */ if (save_offset >= offset) { expert_add_info(pinfo, ti, &ei_wsp_header_invalid); break; } } else { /* Openwave header code page */ /* Here I'm delibarately assuming that Openwave is the only * company that defines a WSP header code page. */ save_offset = offset; offset = WellKnownOpenwaveHeader[hdr_id & 0x7F](wsp_headers, tvb, hdr_start, pinfo); /* Make sure we're progressing forward */ if (save_offset >= offset) { expert_add_info(pinfo, ti, &ei_wsp_header_invalid); break; } } } else if (hdr_id == 0x7F) { /* HCP shift sequence */ codepage = tvb_get_guint8(tvb, offset+1); proto_tree_add_uint(wsp_headers, hf_wsp_header_shift_code, tvb, offset, 2, codepage); offset += 2; } else if (hdr_id >= 0x20) { /* Textual header */ /* Header name MUST be NUL-ended string ==> tvb_get_stringz_enc() */ hdr_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, hdr_start, (gint *)&hdr_len, ENC_ASCII); val_start = hdr_start + hdr_len; val_id = tvb_get_guint8(tvb, val_start); /* Call header value dissector for given header */ if (val_id >= 0x20 && val_id <=0x7E) { /* OK! */ val_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); offset = val_start + val_len; proto_tree_add_string_format(wsp_headers, hf_wsp_header_text_value, tvb, hdr_start, offset-hdr_start, val_str, "%s: %s", hdr_str, val_str); } else { /* Old-style X-WAP-TOD uses a non-textual value * after a textual header. */ if (g_ascii_strcasecmp(hdr_str, "x-wap.tod") == 0) { get_delta_seconds_value(val, tvb, val_start, val_len, ok); if (ok) { nstime_t t; t.secs = (time_t)val; t.nsecs = 0; if (val == 0) { ti = proto_tree_add_time_format_value(wsp_headers, hf_hdr_x_wap_tod, tvb, hdr_start, hdr_len + val_len, &t, "Requesting Time Of Day"); } else { ti = proto_tree_add_time(wsp_headers, hf_hdr_x_wap_tod, tvb, hdr_start, hdr_len + val_len, &t); } expert_add_info(pinfo, ti, &ei_hdr_x_wap_tod); } else { /* I prefer using X-Wap-Tod to the real hdr_str */ proto_tree_add_expert_format(wsp_headers, pinfo, &ei_wsp_text_field_invalid, tvb, hdr_start, hdr_len + val_len, "Invalid value for the 'X-Wap-Tod' header"); } } else { /* Otherwise, non-textual values are invalid; parse them * enough to get the value length. */ guint32 val_len_len; /* length of length field */ val_len = 1; /* for the first octet */ if (val_id <= 0x1E) { /* value is val_id octets long */ val_len += val_id; } else if (val_id == 0x1F) { /* value is a uintvar following the val_id */ val_len += tvb_get_guintvar(tvb, val_start + 1, &val_len_len, pinfo, &ei_wsp_oversized_uintvar); val_len += val_len_len; /* count the length itself */ } proto_tree_add_expert_format(wsp_headers, pinfo, &ei_wsp_text_field_invalid, tvb, hdr_start, hdr_len, "Invalid value for the textual '%s' header (should be a textual value)", hdr_str); } offset = val_start + val_len; } hidden_item = proto_tree_add_string(wsp_headers, hf_hdr_name_string, tvb, hdr_start, offset - hdr_start, hdr_str); proto_item_set_hidden(hidden_item); } else if (hdr_id > 0) { /* Shorthand HCP switch */ codepage = hdr_id; proto_tree_add_uint (wsp_headers, hf_wsp_header_shift_code, tvb, offset, 1, codepage); offset++; } else { proto_tree_add_expert_format (wsp_headers, pinfo, &ei_wsp_text_field_invalid, tvb, hdr_start, 1, "Invalid zero-length textual header"); offset = tvb_len; } } } static const value_string vals_sir_protocol_options[] = { { 0, "OTA-HTTP, no CPITag present" }, { 1, "OTA-HTTP, CPITag present" }, /* 2--255 are reserved */ /* 256--16383 are available for private WINA registration */ { 0x00, NULL } }; /* Dissect a Session Initiation Request. * * Arguably this should be a separate dissector, but SIR does not make sense * outside of WSP anyway. */ static int dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint8 version; guint32 val_len; guint32 val_len_save; guint32 len; guint32 offset = 0; guint32 i; tvbuff_t *tmp_tvb; proto_tree *subtree; proto_item *ti; /* Append status code to INFO column */ col_append_str(pinfo->cinfo, COL_INFO, ": WAP Session Initiation Request"); ti = proto_tree_add_item(tree, hf_sir_section, tvb, 0, -1, ENC_NA); subtree = proto_item_add_subtree(ti, ett_sir); /* Version */ version = tvb_get_guint8(tvb, 0); proto_tree_add_uint(subtree, hf_sir_version, tvb, 0, 1, version); /* Length of Application-Id headers list */ val_len = tvb_get_guintvar(tvb, 1, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_app_id_list_len, tvb, 1, len, val_len); offset = 1 + len; /* Application-Id headers */ tmp_tvb = tvb_new_subset_length(tvb, offset, val_len); add_headers (subtree, tmp_tvb, hf_sir_app_id_list, pinfo); offset += val_len; /* Length of WSP contact points list */ val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_wsp_contact_points_len, tvb, offset, len, val_len); offset += len; /* WSP contact point list */ tmp_tvb = tvb_new_subset_length (tvb, offset, val_len); add_addresses(subtree, tmp_tvb, hf_sir_wsp_contact_points); /* End of version 0 SIR content */ if (version == 0) return offset; offset += val_len; /* Length of non-WSP contact points list */ val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_contact_points_len, tvb, offset, len, val_len); offset += len; /* Non-WSP contact point list */ tmp_tvb = tvb_new_subset_length(tvb, offset, val_len); add_addresses(subtree, tmp_tvb, hf_sir_contact_points); offset += val_len; /* Number of entries in the Protocol Options list */ val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_protocol_options_len, tvb, offset, len, val_len); offset += len; /* Protocol Options list. * Each protocol option is encoded as a guintvar */ val_len_save = val_len; for (i = 0; i < val_len_save; i++) { val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_protocol_options, tvb, offset, len, val_len); offset += len; } /* Length of ProvURL */ val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_prov_url_len, tvb, offset, len, val_len); offset += len; /* ProvURL */ proto_tree_add_item (tree, hf_sir_prov_url, tvb, offset, val_len, ENC_ASCII); offset += val_len; /* Number of entries in the CPITag list */ val_len = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(subtree, hf_sir_cpi_tag_len, tvb, offset, len, val_len); offset += len; /* CPITag list. * Each CPITag is encoded as 4 octets of opaque data. * In OTA-HTTP, it is conveyed in the X-Wap-CPITag header * but with a Base64 encoding of the 4 bytes. */ for (i = 0; i < val_len; i++) { proto_tree_add_item(subtree, hf_sir_cpi_tag, tvb, offset, 4, ENC_NA); offset += 4; } return tvb_captured_length(tvb); } static void dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissector_handle_t dissector_handle, gboolean is_connectionless) { int offset = 0; guint8 pdut; guint count = 0; guint value = 0; guint uriLength = 0; guint uriStart = 0; guint capabilityLength = 0; guint headersLength = 0; guint headerLength = 0; guint headerStart = 0; guint nextOffset = 0; guint contentTypeStart = 0; guint contentType = 0; const char *contentTypeStr; tvbuff_t *tmp_tvb; int found_match; heur_dtbl_entry_t *hdtbl_entry; proto_item* ti; /* Set up structures we will need to add the protocol subtree and manage it */ proto_item *proto_ti = NULL; /* for the proto entry */ proto_tree *wsp_tree = NULL; wsp_info_value_t *stat_info; stat_info = wmem_new(wmem_packet_scope(), wsp_info_value_t); stat_info->status_code = 0; /* This field shows up as the "Info" column in the display; you should make it, if possible, summarize what's in the packet, so that a user looking at the list of packets can tell what type of packet it is. */ /* Connection-less mode has a TID first */ if (is_connectionless) { offset++; /* Skip the 1-byte Transaction ID */ }; /* Find the PDU type */ pdut = tvb_get_guint8 (tvb, offset); /* Develop the string to put in the Info column */ col_append_fstr(pinfo->cinfo, COL_INFO, "WSP %s (0x%02x)", val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown PDU type (0x%02x)"), pdut); proto_ti = proto_tree_add_item(tree, proto_wsp, tvb, 0, -1, ENC_NA); wsp_tree = proto_item_add_subtree(proto_ti, ett_wsp); proto_item_append_text(proto_ti, ", Method: %s (0x%02x)", val_to_str_ext (pdut, &wsp_vals_pdu_type_ext, "Unknown (0x%02x)"), pdut); /* Add common items: only TID and PDU Type */ /* If this is connectionless, then the TID Field is always first */ if (is_connectionless) { proto_tree_add_item (wsp_tree, hf_wsp_header_tid, tvb, 0, 1, ENC_LITTLE_ENDIAN); } proto_tree_add_item( wsp_tree, hf_wsp_header_pdu_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; /* Map extended methods to the main method now the Column info has been * written; this way we can dissect the extended method PDUs. */ if ((pdut >= 0x50) && (pdut <= 0x5F)) /* Extended GET --> GET */ pdut = WSP_PDU_GET; else if ((pdut >= 0x70) && (pdut <= 0x7F)) /* Extended POST --> POST */ pdut = WSP_PDU_POST; switch (pdut) { case WSP_PDU_CONNECT: case WSP_PDU_CONNECTREPLY: case WSP_PDU_RESUME: if (pdut == WSP_PDU_CONNECT) { proto_tree_add_item (wsp_tree, hf_wsp_version_major, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item (wsp_tree, hf_wsp_version_minor, tvb, offset, 1, ENC_LITTLE_ENDIAN); { guint8 ver = tvb_get_guint8(tvb, offset); proto_item_append_text(proto_ti, ", Version: %u.%u", ver >> 4, ver & 0x0F); } offset++; } else { count = 0; /* Initialise count */ value = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint (wsp_tree, hf_wsp_server_session_id, tvb, offset, count, value); proto_item_append_text(proto_ti, ", Session ID: %u", value); offset += count; } count = 0; /* Initialise count */ capabilityLength = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); ti = proto_tree_add_uint (wsp_tree, hf_capabilities_length, tvb, offset, count, capabilityLength); offset += count; if (capabilityLength > tvb_reported_length(tvb)) { expert_add_info(pinfo, ti, &ei_wsp_capability_length_invalid); break; } if (pdut != WSP_PDU_RESUME) { count = 0; /* Initialise count */ headerLength = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint (wsp_tree, hf_wsp_header_length, tvb, offset, count, headerLength); offset += count; } else { /* Resume computes the headerlength * by remaining bytes */ headerStart = offset + capabilityLength; headerLength = tvb_reported_length_remaining (tvb, headerStart); } if (capabilityLength > 0) { tmp_tvb = tvb_new_subset_length (tvb, offset, capabilityLength); add_capabilities (wsp_tree, pinfo, tmp_tvb, pdut); offset += capabilityLength; } if (headerLength > 0) { tmp_tvb = tvb_new_subset_length (tvb, offset, headerLength); add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo); } break; case WSP_PDU_REDIRECT: dissect_redirect(tvb, offset, pinfo, wsp_tree, dissector_handle); break; case WSP_PDU_DISCONNECT: case WSP_PDU_SUSPEND: count = 0; /* Initialise count */ value = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint (wsp_tree, hf_wsp_server_session_id, tvb, offset, count, value); proto_item_append_text(proto_ti, ", Session ID: %u", value); break; case WSP_PDU_GET: case WSP_PDU_OPTIONS: case WSP_PDU_HEAD: case WSP_PDU_DELETE: case WSP_PDU_TRACE: count = 0; /* Initialise count */ /* Length of URI and size of URILen field */ value = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); nextOffset = offset + count; add_uri (wsp_tree, pinfo, tvb, offset, nextOffset, proto_ti); offset += value + count; /* VERIFY */ tmp_tvb = tvb_new_subset_remaining (tvb, offset); add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo); break; case WSP_PDU_POST: case WSP_PDU_PUT: uriStart = offset; count = 0; /* Initialise count */ uriLength = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); headerStart = uriStart+count; count = 0; /* Initialise count */ headersLength = tvb_get_guintvar (tvb, headerStart, &count, pinfo, &ei_wsp_oversized_uintvar); offset = headerStart + count; add_uri (wsp_tree, pinfo, tvb, uriStart, offset, proto_ti); offset += uriLength; proto_tree_add_uint (wsp_tree, hf_wsp_header_length, tvb, headerStart, count, headersLength); /* Stop processing POST PDU if length of headers is zero; * this should not happen as we expect at least Content-Type. */ if (headersLength == 0) break; contentTypeStart = offset; nextOffset = add_content_type (wsp_tree, pinfo, tvb, offset, &contentType, &contentTypeStr); /* Add content type to protocol summary line */ if (contentTypeStr) { proto_item_append_text(proto_ti, ", Content-Type: %s", contentTypeStr); } else { proto_item_append_text(proto_ti, ", Content-Type: 0x%X", contentType); } /* Add headers subtree that will hold the headers fields */ /* Runs from nextOffset for * headersLength - (length of content-type field) */ headerLength = headersLength - (nextOffset - contentTypeStart); if (headerLength > 0) { tmp_tvb = tvb_new_subset_length (tvb, nextOffset, headerLength); add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo); } /* XXX - offset is no longer used after this point */ /* offset = nextOffset+headerLength; */ /* WSP_PDU_POST data - First check whether a subdissector exists * for the content type */ if (tvb_reported_length_remaining(tvb, headerStart + count + uriLength + headersLength) > 0) { tmp_tvb = tvb_new_subset_remaining (tvb, headerStart + count + uriLength + headersLength); /* * Try finding a dissector for the content * first, then fallback. */ found_match = 0; if (contentTypeStr) { /* * Content type is a string. */ found_match = dissector_try_string(media_type_table, contentTypeStr, tmp_tvb, pinfo, tree, NULL); } if (! found_match) { if (! dissector_try_heuristic(heur_subdissector_list, tmp_tvb, pinfo, tree, &hdtbl_entry, NULL)) { pinfo->match_string = contentTypeStr; call_dissector_with_data(media_handle, tmp_tvb, pinfo, tree, NULL /* TODO: parameters */); #if 0 add_post_data (wsp_tree, tmp_tvb, contentType, contentTypeStr, pinfo); #endif } } } break; case WSP_PDU_REPLY: count = 0; /* Initialise count */ headersLength = tvb_get_guintvar (tvb, offset+1, &count, pinfo, &ei_wsp_oversized_uintvar); headerStart = offset + count + 1; { guint8 reply_status = tvb_get_guint8(tvb, offset); const char *reply_status_str; reply_status_str = val_to_str_ext_const (reply_status, &wsp_vals_status_ext, "(Unknown response status)"); proto_tree_add_item (wsp_tree, hf_wsp_header_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(proto_ti, ", Status: %s (0x%02x)", reply_status_str, reply_status); stat_info->status_code = (gint) reply_status; /* Append status code to INFO column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s (0x%02x)", reply_status_str, reply_status); } nextOffset = offset + 1 + count; proto_tree_add_uint (wsp_tree, hf_wsp_header_length, tvb, offset + 1, count, headersLength); if (headersLength == 0) break; contentTypeStart = nextOffset; nextOffset = add_content_type (wsp_tree, pinfo, tvb, nextOffset, &contentType, &contentTypeStr); /* Add content type to protocol summary line */ if (contentTypeStr) { proto_item_append_text(proto_ti, ", Content-Type: %s", contentTypeStr); } else { proto_item_append_text(proto_ti, ", Content-Type: 0x%X", contentType); } /* Add headers subtree that will hold the headers fields */ /* Runs from nextOffset for * headersLength - (length of Content-Type field) */ headerLength = headersLength - (nextOffset - contentTypeStart); if (headerLength > 0) { tmp_tvb = tvb_new_subset_length (tvb, nextOffset, headerLength); add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo); } /* XXX - offset is no longer used after this point */ /* offset += count+headersLength+1;*/ /* WSP_PDU_REPLY data - First check whether a subdissector exists * for the content type */ if (tvb_reported_length_remaining(tvb, headerStart + headersLength) > 0) { tmp_tvb = tvb_new_subset_remaining (tvb, headerStart + headersLength); /* * Try finding a dissector for the content * first, then fallback. */ found_match = 0; if (contentTypeStr) { /* * Content type is a string. */ found_match = dissector_try_string(media_type_table, contentTypeStr, tmp_tvb, pinfo, tree, NULL); } if (! found_match) { if (! dissector_try_heuristic(heur_subdissector_list, tmp_tvb, pinfo, tree, &hdtbl_entry, NULL)) { pinfo->match_string = contentTypeStr; call_dissector_with_data(media_handle, tmp_tvb, pinfo, tree, NULL /* TODO: parameters */); #if 0 proto_tree_add_item (wsp_tree, hf_wsp_reply_data, tmp_tvb, 0, -1, ENC_NA); #endif } } } break; case WSP_PDU_PUSH: case WSP_PDU_CONFIRMEDPUSH: count = 0; /* Initialise count */ headersLength = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); headerStart = offset + count; proto_tree_add_uint (wsp_tree, hf_wsp_header_length, tvb, offset, count, headersLength); if (headersLength == 0) break; offset += count; contentTypeStart = offset; nextOffset = add_content_type (wsp_tree, pinfo, tvb, offset, &contentType, &contentTypeStr); /* Add content type to protocol summary line */ if (contentTypeStr) { proto_item_append_text(proto_ti, ", Content-Type: %s", contentTypeStr); } else { proto_item_append_text(proto_ti, ", Content-Type: 0x%X", contentType); } /* Add headers subtree that will hold the headers fields */ /* Runs from nextOffset for * headersLength-(length of Content-Type field) */ headerLength = headersLength-(nextOffset-contentTypeStart); if (headerLength > 0) { tmp_tvb = tvb_new_subset_length (tvb, nextOffset, headerLength); add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo); } /* XXX - offset is no longer used after this point */ /*offset += headersLength;*/ /* WSP_PDU_PUSH data - First check whether a subdissector exists * for the content type */ if (tvb_reported_length_remaining(tvb, headerStart + headersLength) > 0) { tmp_tvb = tvb_new_subset_remaining (tvb, headerStart + headersLength); /* * Try finding a dissector for the content * first, then fallback. */ found_match = 0; if (contentTypeStr) { /* * Content type is a string. */ /* if (g_ascii_strcasecmp(contentTypeStr, "application/vnd.wap.sia") == 0) { dissect_sir(tree, tmp_tvb); } else */ found_match = dissector_try_string(media_type_table, contentTypeStr, tmp_tvb, pinfo, tree, NULL); } if (! found_match){ /* * Try to dissect x-wap-application lwm2m.dm data as CoAP * see docs: (page 141) * http://www.openmobilealliance.org/release/LightweightM2M/V1_0_2-20180209-A/OMA-TS-LightweightM2M-V1_0_2-20180209-A.pdf * header bytes should be: 0xAF, 0x9A */ if (tvb_get_guint8(tvb, headerStart + headerLength - 1) == 0xAF && /* x-wap app id */ tvb_get_guint8(tvb, headerStart + headerLength) == 0x9A) { /* x-wap app lwm2m.dm */ call_dissector(coap_handle, tmp_tvb, pinfo, tree); } else if (! dissector_try_heuristic(heur_subdissector_list, tmp_tvb, pinfo, tree, &hdtbl_entry, NULL)) { pinfo->match_string = contentTypeStr; call_dissector_with_data(media_handle, tmp_tvb, pinfo, tree, NULL /* TODO: parameters */); #if 0 proto_tree_add_item (wsp_tree, hf_wsp_push_data, tmp_tvb, 0, -1, ENC_NA); #endif } } } break; } stat_info->pdut = pdut; tap_queue_packet (wsp_tap, pinfo, stat_info); } /* * Called directly from UDP. * Put "WSP" into the "Protocol" column. */ static int dissect_wsp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "WSP"); col_clear(pinfo->cinfo, COL_INFO); dissect_wsp_common(tvb, pinfo, tree, wsp_fromudp_handle, TRUE); return tvb_captured_length(tvb); } /* * Called from a higher-level WAP dissector, in connection-oriented mode. * Leave the "Protocol" column alone - the dissector calling us should * have set it. */ static int dissect_wsp_fromwap_co(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* * XXX - what about WTLS->WTP->WSP? */ dissect_wsp_common(tvb, pinfo, tree, wtp_fromudp_handle, FALSE); return tvb_captured_length(tvb); } /* * Called from a higher-level WAP dissector, in connectionless mode. * Leave the "Protocol" column alone - the dissector calling us should * have set it. */ static int dissect_wsp_fromwap_cl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* * XXX - what about WTLS->WSP? */ col_clear(pinfo->cinfo, COL_INFO); dissect_wsp_common(tvb, pinfo, tree, wtp_fromudp_handle, TRUE); return tvb_captured_length(tvb); } static void add_uri (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint URILenOffset, guint URIOffset, proto_item *proto_ti) { guint count = 0; guint uriLen = tvb_get_guintvar (tvb, URILenOffset, &count, pinfo, &ei_wsp_oversized_uintvar); gchar *str; proto_tree_add_uint (tree, hf_wsp_header_uri_len, tvb, URILenOffset, count, uriLen); proto_tree_add_item (tree, hf_wsp_header_uri, tvb, URIOffset, uriLen, ENC_ASCII); str = tvb_format_text (pinfo->pool, tvb, URIOffset, uriLen); /* XXX - tvb_format_text(pinfo->pool, ) returns a pointer to a static text string * so please DO NOT attempt at g_free()ing it! */ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", str); if (proto_ti) proto_item_append_text(proto_ti, ", URI: %s", str); } /* * CO-WSP capability negotiation */ enum { WSP_CAPA_CLIENT_SDU_SIZE = 0x00, WSP_CAPA_SERVER_SDU_SIZE, WSP_CAPA_PROTOCOL_OPTIONS, WSP_CAPA_METHOD_MOR, WSP_CAPA_PUSH_MOR, WSP_CAPA_EXTENDED_METHODS, WSP_CAPA_HEADER_CODE_PAGES, WSP_CAPA_ALIASES, WSP_CAPA_CLIENT_MESSAGE_SIZE, WSP_CAPA_SERVER_MESSAGE_SIZE }; static const value_string wsp_capability_vals [] = { { WSP_CAPA_CLIENT_SDU_SIZE, "Client SDU Size" }, { WSP_CAPA_SERVER_SDU_SIZE, "Server SDU Size" }, { WSP_CAPA_PROTOCOL_OPTIONS, "Protocol Options" }, { WSP_CAPA_METHOD_MOR, "Method MOR" }, { WSP_CAPA_PUSH_MOR, "Push MOR" }, { WSP_CAPA_EXTENDED_METHODS, "Extended Methods" }, { WSP_CAPA_HEADER_CODE_PAGES, "Header Code Pages" }, { WSP_CAPA_ALIASES, "Aliases" }, { WSP_CAPA_CLIENT_MESSAGE_SIZE, "Client Message Size" }, { WSP_CAPA_SERVER_MESSAGE_SIZE, "Server Message Size" }, { 0, NULL } }; static void add_capabilities (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint8 pdu_type) { proto_tree *wsp_capabilities, *cap_subtree, *cap_subtree2; proto_item *ti, *cap_item, *cap_item2; char *capaName, *str; guint32 offset = 0; guint32 len = 0; guint32 capaStart = 0; /* Start offset of the capability */ guint32 capaLen = 0; /* Length of the entire capability */ guint32 capaValueLen = 0; /* Length of the capability value & type */ guint32 tvb_len = tvb_reported_length(tvb); gboolean ok = FALSE; guint8 peek; guint32 value; if (tvb_len == 0) { return; } ti = proto_tree_add_item(tree, hf_capabilities_section, tvb, 0, tvb_len, ENC_NA); wsp_capabilities = proto_item_add_subtree(ti, ett_capabilities); while (offset < tvb_len) { /* * WSP capabilities consist of: * - a guint32 length field, * - a capability identifier as Token-text or Short-integer, * - a capability-specific sequence of <length> octets. */ capaStart = offset; /* * Now Offset points to the 1st byte of a capability field. * Get the length of the capability field */ capaValueLen = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); if (len == 0) return; capaLen = capaValueLen + len; cap_subtree = proto_tree_add_subtree(wsp_capabilities, tvb, offset, capaLen, ett_capabilities_entry, &cap_item, "Capability"); if (capaValueLen > tvb_len) return; offset += len; /* * Now offset points to the 1st byte of the capability type. * Get the capability identifier. */ peek = tvb_get_guint8(tvb, offset); if (is_token_text(peek)) { /* Literal capability name */ /* 1. Get the string from the tvb */ capaName = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, capaStart, (gint *)&len, ENC_ASCII); /* 2. Look up the string capability name */ if (g_ascii_strcasecmp(capaName, "client-sdu-size") == 0) { peek = WSP_CAPA_CLIENT_SDU_SIZE; } else if (g_ascii_strcasecmp(capaName, "server-sdu-size") == 0) { peek = WSP_CAPA_SERVER_SDU_SIZE; } else if (g_ascii_strcasecmp(capaName, "protocol options") == 0) { peek = WSP_CAPA_PROTOCOL_OPTIONS; } else if (g_ascii_strcasecmp(capaName, "method-mor") == 0) { peek = WSP_CAPA_METHOD_MOR; } else if (g_ascii_strcasecmp(capaName, "push-mor") == 0) { peek = WSP_CAPA_PUSH_MOR; } else if (g_ascii_strcasecmp(capaName, "extended methods") == 0) { peek = WSP_CAPA_EXTENDED_METHODS; } else if (g_ascii_strcasecmp(capaName, "header code pages") == 0) { peek = WSP_CAPA_HEADER_CODE_PAGES; } else if (g_ascii_strcasecmp(capaName, "aliases") == 0) { peek = WSP_CAPA_ALIASES; } else if (g_ascii_strcasecmp(capaName, "client-message-size") == 0) { peek = WSP_CAPA_CLIENT_MESSAGE_SIZE; } else if (g_ascii_strcasecmp(capaName, "server-message-size") == 0) { peek = WSP_CAPA_SERVER_MESSAGE_SIZE; } else { expert_add_info_format(pinfo, cap_item, &ei_wsp_capability_invalid, "Unknown or invalid textual capability: %s", capaName); /* Skip this capability */ offset = capaStart + capaLen; continue; } offset += len; /* Now offset points to the 1st value byte of the capability. */ } else if (peek < 0x80) { expert_add_info_format(pinfo, cap_item, &ei_wsp_capability_invalid, "Invalid well-known capability: 0x%02X", peek); /* Skip further capability parsing */ return; } if (peek & 0x80) { /* Well-known capability */ peek &= 0x7F; len = 1; offset++; /* Now offset points to the 1st value byte of the capability. */ } proto_item_append_text(cap_item, ": %s", val_to_str_const(peek, wsp_capability_vals, "Invalid capability")); /* Now the capability type is known */ switch (peek) { case WSP_CAPA_CLIENT_SDU_SIZE: value = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(cap_subtree, hf_capa_client_sdu_size, tvb, offset, len, value); break; case WSP_CAPA_SERVER_SDU_SIZE: value = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(cap_subtree, hf_capa_server_sdu_size, tvb, offset, len, value); break; case WSP_CAPA_PROTOCOL_OPTIONS: /* * The bits are stored in one or more octets, not an * uintvar-integer! Note that capability name and value * have length capaValueLength, and that the capability * name has length = len. Hence the remaining length is * given by capaValueLen - len. */ if (capaValueLen - len == 1) { static int * const capabilities[] = { &hf_capa_protocol_option_confirmed_push, &hf_capa_protocol_option_push, &hf_capa_protocol_option_session_resume, &hf_capa_protocol_option_ack_headers, &hf_capa_protocol_option_large_data_transfer, NULL }; proto_tree_add_bitmask_with_flags(cap_subtree, tvb, offset, hf_capa_protocol_options, ett_proto_option_capability, capabilities, ENC_NA, BMT_NO_FALSE); } else { /* * The WSP spec foresees that this bit field can be * extended in the future. This does not make sense yet. */ proto_item_append_text(cap_item, " <warning: bit field too large>"); offset = capaStart + capaLen; continue; } break; case WSP_CAPA_METHOD_MOR: proto_tree_add_item(cap_subtree, hf_capa_method_mor, tvb, offset, len, ENC_NA); break; case WSP_CAPA_PUSH_MOR: proto_tree_add_item(cap_subtree, hf_capa_push_mor, tvb, offset, len, ENC_NA); break; case WSP_CAPA_EXTENDED_METHODS: /* Extended Methods capability format: * Connect PDU: collection of { Method (octet), Method-name (Token-text) } * ConnectReply PDU: collection of accepted { Method (octet) } */ cap_subtree2 = proto_tree_add_subtree(cap_subtree, tvb, capaStart, capaLen, ett_capabilities_extended_methods, &cap_item2, "Extended Methods"); if (pdu_type == WSP_PDU_CONNECT) { while (offset < capaStart + capaLen) { ti = proto_tree_add_item(cap_subtree2, hf_capa_extended_method, tvb, offset, 1, ENC_NA); offset++; get_text_string(str, tvb, offset, len, ok); if (! ok) { expert_add_info(pinfo, ti, &ei_wsp_capability_encoding_invalid); return; } proto_item_append_text(ti, " = %s", str); proto_item_set_len(ti, len+1); offset += len; } } else { while (offset < capaStart + capaLen) { proto_tree_add_item(cap_subtree2, hf_capa_extended_method, tvb, offset, 1, ENC_NA); offset++; } } break; case WSP_CAPA_HEADER_CODE_PAGES: /* Header Code Pages capability format: * Connect PDU: collection of { Page-id (octet), Page-name (Token-text) } * ConnectReply PDU: collection of accepted { Page-id (octet) } */ cap_subtree2 = proto_tree_add_subtree(cap_subtree, tvb, capaStart, capaLen, ett_capabilities_header_code_pages, &cap_item2, "Header Code Pages"); if (pdu_type == WSP_PDU_CONNECT) { while (offset < capaStart + capaLen) { ti = proto_tree_add_item(cap_subtree2, hf_capa_header_code_page, tvb, offset, 1, ENC_NA); offset++; get_text_string(str, tvb, offset, len, ok); if (! ok) { expert_add_info(pinfo, ti, &ei_wsp_capability_encoding_invalid); return; } proto_item_append_text(ti, " = %s", str); proto_item_set_len(ti, len+1); offset += len; } } else { while (offset < capaStart + capaLen) { proto_tree_add_item(cap_subtree2, hf_capa_header_code_page, tvb, offset, 1, ENC_NA); offset++; } } break; case WSP_CAPA_ALIASES: /* TODO - same format as redirect addresses */ proto_tree_add_item(cap_subtree, hf_capa_aliases, tvb, capaStart, capaLen, ENC_NA); break; case WSP_CAPA_CLIENT_MESSAGE_SIZE: value = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(cap_subtree, hf_capa_client_message_size, tvb, offset, len, value); break; case WSP_CAPA_SERVER_MESSAGE_SIZE: value = tvb_get_guintvar(tvb, offset, &len, pinfo, &ei_wsp_oversized_uintvar); proto_tree_add_uint(cap_subtree, hf_capa_server_message_size, tvb, offset, len, value); break; default: expert_add_info_format(pinfo, cap_item, &ei_wsp_capability_invalid, "Unknown well-known capability: 0x%02X", peek); break; } offset = capaStart + capaLen; } } void add_post_data (proto_tree *tree, tvbuff_t *tvb, guint contentType, const char *contentTypeStr, packet_info *pinfo) { guint offset = 0; guint variableStart = 0; guint variableEnd = 0; guint valueStart = 0; guint8 peek = 0; proto_item *ti; proto_tree *sub_tree; /* VERIFY ti = proto_tree_add_item (tree, hf_wsp_post_data,tvb,offset,-1,ENC_NA); */ ti = proto_tree_add_item (tree, hf_wsp_post_data, tvb, offset, -1, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_post); if ( (contentTypeStr == NULL && contentType == 0x12) || (contentTypeStr && (g_ascii_strcasecmp(contentTypeStr, "application/x-www-form-urlencoded") == 0)) ) { /* * URL Encoded data. * Iterate through post data. */ for (offset = 0; offset < tvb_reported_length (tvb); offset++) { peek = tvb_get_guint8 (tvb, offset); if (peek == '=') { variableEnd = offset; valueStart = offset+1; } else if (peek == '&') { if (variableEnd > 0) { add_post_variable (sub_tree, tvb, variableStart, variableEnd, valueStart, offset); } variableStart = offset+1; variableEnd = 0; valueStart = 0; } } /* See if there's outstanding data */ if (variableEnd > 0) { add_post_variable (sub_tree, tvb, variableStart, variableEnd, valueStart, offset); } } else if ((contentType == 0x22) || (contentType == 0x23) || (contentType == 0x24) || (contentType == 0x25) || (contentType == 0x26) || (contentType == 0x33)) { /* add_multipart_data takes also care of subdissection */ add_multipart_data(sub_tree, tvb, pinfo); } } static void add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint variableEnd, guint valueStart, guint valueEnd) { int variableLength = variableEnd-variableStart; int valueLength = 0; char *variableBuffer; char *valueBuffer; variableBuffer = tvb_get_string_enc(wmem_packet_scope(), tvb, variableStart, variableLength, ENC_ASCII); if (valueEnd < valueStart) { valueBuffer = (char *)wmem_alloc(wmem_packet_scope(), 1); valueBuffer[0] = 0; valueEnd = valueStart; } else { valueLength = valueEnd-valueStart; valueBuffer = tvb_get_string_enc(wmem_packet_scope(), tvb, valueStart, valueLength, ENC_ASCII); } /* Check for variables with no value */ if (valueStart >= tvb_reported_length (tvb)) { valueStart = tvb_reported_length (tvb); valueEnd = valueStart; } valueLength = valueEnd-valueStart; proto_tree_add_string_format(tree, hf_wsp_variable_value, tvb, variableStart, valueLength, valueBuffer, "%s: %s", variableBuffer, valueBuffer); } static void add_multipart_data (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo) { int offset = 0; guint nextOffset; guint nEntries = 0; guint count; guint HeadersLen; guint DataLen; guint contentType = 0; const char *contentTypeStr; tvbuff_t *tmp_tvb; int partnr = 1; int part_start; int found_match = 0; proto_item *sub_tree = NULL; proto_item *ti = NULL; proto_tree *mpart_tree = NULL; heur_dtbl_entry_t *hdtbl_entry; nEntries = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); offset += count; if (nEntries) { sub_tree = proto_tree_add_subtree(tree, tvb, offset - count, 0, ett_mpartlist, NULL, "Multipart body"); } while (nEntries--) { part_start = offset; HeadersLen = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); offset += count; DataLen = tvb_get_guintvar (tvb, offset, &count, pinfo, &ei_wsp_oversized_uintvar); offset += count; ti = proto_tree_add_uint(sub_tree, hf_wsp_mpart, tvb, part_start, HeadersLen + DataLen + (offset - part_start), partnr); mpart_tree = proto_item_add_subtree(ti, ett_multiparts); nextOffset = add_content_type (mpart_tree, pinfo, tvb, offset, &contentType, &contentTypeStr); /* Add content type to protocol summary line */ if (contentTypeStr) { proto_item_append_text(ti, ", content-type: %s", contentTypeStr); } else { proto_item_append_text(ti, ", content-type: 0x%X", contentType); } HeadersLen -= (nextOffset - offset); if (HeadersLen > 0) { tmp_tvb = tvb_new_subset_length (tvb, nextOffset, HeadersLen); add_headers (mpart_tree, tmp_tvb, hf_wsp_headers_section, pinfo); } offset = nextOffset + HeadersLen; /* * Try the dissectors of the multipart content. * * TODO - handle nested multipart documents. */ tmp_tvb = tvb_new_subset_length(tvb, offset, DataLen); /* * Try finding a dissector for the content * first, then fallback. */ found_match = 0; if (contentTypeStr) { /* * Content type is a string. */ found_match = dissector_try_string(media_type_table, contentTypeStr, tmp_tvb, pinfo, mpart_tree, NULL); } if (! found_match) { if (! dissector_try_heuristic(heur_subdissector_list, tmp_tvb, pinfo, mpart_tree, &hdtbl_entry, NULL)) { pinfo->match_string = contentTypeStr; call_dissector_with_data(media_handle, tmp_tvb, pinfo, mpart_tree, NULL /* TODO: parameters */); #if 0 proto_tree_add_item (mpart_tree, hf_wsp_multipart_data, tvb, offset, DataLen, ENC_NA); #endif } } offset += DataLen; partnr++; } } /* TAP STAT INFO */ typedef enum { MESSAGE_TYPE_COLUMN = 0, PACKET_COLUMN } wsp_stat_columns; static stat_tap_table_item wsp_stat_fields[] = { {TABLE_ITEM_STRING, TAP_ALIGN_LEFT, "Type / Code", "%-25s"}, {TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "Packets", "%d"} }; static int unknown_pt_idx; static int unknown_sc_idx; static void wsp_stat_init(stat_tap_table_ui* new_stat) { const char *pt_table_name = "PDU Types"; const char *sc_table_name = "Status Codes"; int num_fields = sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item); stat_tap_table *pt_table; stat_tap_table_item_type pt_items[sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item)]; stat_tap_table *sc_table; stat_tap_table_item_type sc_items[sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item)]; int table_idx; pt_table = stat_tap_find_table(new_stat, pt_table_name); if (pt_table) { if (new_stat->stat_tap_reset_table_cb) { new_stat->stat_tap_reset_table_cb(pt_table); } } else { pt_table = stat_tap_init_table(pt_table_name, num_fields, 0, NULL); stat_tap_add_table(new_stat, pt_table); /* Add a row for each PDU type */ table_idx = 0; memset(pt_items, 0, sizeof(pt_items)); pt_items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING; pt_items[PACKET_COLUMN].type = TABLE_ITEM_UINT; while (wsp_vals_pdu_type[table_idx].strptr) { pt_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup(wsp_vals_pdu_type[table_idx].strptr); pt_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = wsp_vals_pdu_type[table_idx].value; stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items); table_idx++; } pt_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup("Unknown PDU type"); pt_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = 0; stat_tap_init_table_row(pt_table, table_idx, num_fields, pt_items); unknown_pt_idx = table_idx; } sc_table = stat_tap_find_table(new_stat, sc_table_name); if (sc_table) { if (new_stat->stat_tap_reset_table_cb) { new_stat->stat_tap_reset_table_cb(sc_table); } } else { sc_table = stat_tap_init_table(sc_table_name, num_fields, 0, NULL); stat_tap_add_table(new_stat, sc_table); /* Add a row for each status code */ table_idx = 0; memset(sc_items, 0, sizeof(sc_items)); sc_items[MESSAGE_TYPE_COLUMN].type = TABLE_ITEM_STRING; sc_items[PACKET_COLUMN].type = TABLE_ITEM_UINT; while (wsp_vals_status[table_idx].strptr) { sc_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup(wsp_vals_status[table_idx].strptr); sc_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = wsp_vals_status[table_idx].value; stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items); table_idx++; } sc_items[MESSAGE_TYPE_COLUMN].value.string_value = g_strdup("Unknown status code"); sc_items[MESSAGE_TYPE_COLUMN].user_data.uint_value = 0; stat_tap_init_table_row(sc_table, table_idx, num_fields, sc_items); unknown_sc_idx = table_idx; } } static tap_packet_status wsp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *wiv_ptr, tap_flags_t flags _U_) { stat_data_t* stat_data = (stat_data_t*)tapdata; const wsp_info_value_t *value = (const wsp_info_value_t *)wiv_ptr; stat_tap_table *pt_table, *sc_table; guint element; stat_tap_table_item_type* item_data; gboolean found; pt_table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 0); sc_table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, 1); found = FALSE; for (element = 0; element < pt_table->num_elements; element++) { item_data = stat_tap_get_field_data(pt_table, element, MESSAGE_TYPE_COLUMN); if (value->pdut == item_data->user_data.uint_value) { found = TRUE; break; } } if (!found) { element = unknown_pt_idx; } item_data = stat_tap_get_field_data(pt_table, element, PACKET_COLUMN); item_data->value.uint_value++; stat_tap_set_field_data(pt_table, element, PACKET_COLUMN, item_data); if (value->status_code != 0) { found = FALSE; for (element = 0; element < sc_table->num_elements; element++) { item_data = stat_tap_get_field_data(sc_table, element, MESSAGE_TYPE_COLUMN); if (value->status_code == (int) item_data->user_data.uint_value) { found = TRUE; break; } } if (!found) { element = unknown_sc_idx; } item_data = stat_tap_get_field_data(sc_table, element, PACKET_COLUMN); item_data->value.uint_value++; stat_tap_set_field_data(sc_table, element, PACKET_COLUMN, item_data); } return found? TAP_PACKET_REDRAW : TAP_PACKET_DONT_REDRAW; } static void wsp_stat_reset(stat_tap_table* table) { guint element; stat_tap_table_item_type* item_data; for (element = 0; element < table->num_elements; element++) { item_data = stat_tap_get_field_data(table, element, PACKET_COLUMN); item_data->value.uint_value = 0; stat_tap_set_field_data(table, element, PACKET_COLUMN, item_data); } } static void wsp_stat_free_table_item(stat_tap_table* table _U_, guint row _U_, guint column, stat_tap_table_item_type* field_data) { if (column != MESSAGE_TYPE_COLUMN) return; g_free((char*)field_data->value.string_value); field_data->value.string_value = NULL; } /* Register the protocol with Wireshark */ void proto_register_wsp(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_wsp_header_tid, { "Transaction ID", "wsp.TID", FT_UINT8, BASE_HEX, NULL, 0x0, "WSP Transaction ID (for connectionless WSP)", HFILL } }, { &hf_wsp_header_pdu_type, { "PDU Type", "wsp.pdu_type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &wsp_vals_pdu_type_ext, 0x00, NULL, HFILL } }, { &hf_wsp_version_major, { "Version (Major)", "wsp.version.major", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, { &hf_wsp_version_minor, { "Version (Minor)", "wsp.version.minor", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, { &hf_capabilities_length, { "Capabilities Length", "wsp.capabilities.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of Capabilities field (bytes)", HFILL } }, { &hf_wsp_header_length, { "Headers Length", "wsp.headers_length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of Headers field (bytes)", HFILL } }, { &hf_capabilities_section, { "Capabilities", "wsp.capabilities", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_headers_section, { "Headers", "wsp.headers", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_header_uri_len, { "URI Length", "wsp.uri_length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of URI field", HFILL } }, { &hf_wsp_header_uri, { "URI", "wsp.uri", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_server_session_id, { "Server Session ID", "wsp.server.session_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_header_status, { "Status", "wsp.reply.status", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &wsp_vals_status_ext, 0x00, "Reply Status", HFILL } }, { &hf_wsp_parameter_untype_quote_text, { "Untyped quoted text", "wsp.untype.quote_text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_parameter_untype_text, { "Untyped text", "wsp.untype.text", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_parameter_untype_int, { "Untyped integer", "wsp.untype.int", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_parameter_type, { "Parameter Type", "wsp.parameter.type", FT_UINT32, BASE_DEC|BASE_EXT_STRING, &parameter_type_vals_ext, 0x00, NULL, HFILL } }, { &hf_wsp_parameter_int_type, { "Integer Type", "wsp.parameter.int_type", FT_UINT32, BASE_DEC, NULL, 0x0, "Type parameter", HFILL } }, { &hf_wsp_parameter_name, { "Name", "wsp.parameter.name", FT_STRING, BASE_NONE, NULL, 0x0, "Name parameter", HFILL } }, { &hf_wsp_parameter_filename, { "Filename", "wsp.parameter.filename", FT_STRING, BASE_NONE, NULL, 0x0, "Filename parameter", HFILL } }, { &hf_wsp_parameter_start, { "Start", "wsp.parameter.start", FT_STRING, BASE_NONE, NULL, 0x0, "Start parameter", HFILL } }, { &hf_wsp_parameter_start_info, { "Start-info", "wsp.parameter.start_info", FT_STRING, BASE_NONE, NULL, 0x0, "Start-info parameter", HFILL } }, { &hf_wsp_parameter_comment, { "Comment", "wsp.parameter.comment", FT_STRING, BASE_NONE, NULL, 0x0, "Comment parameter", HFILL } }, { &hf_wsp_parameter_domain, { "Domain", "wsp.parameter.domain", FT_STRING, BASE_NONE, NULL, 0x0, "Domain parameter", HFILL } }, { &hf_wsp_parameter_path, { "Path", "wsp.parameter.path", FT_STRING, BASE_NONE, NULL, 0x0, "Path parameter", HFILL } }, { &hf_wsp_parameter_sec, { "SEC", "wsp.parameter.sec", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_parameter_sec_ext, 0x00, "SEC parameter (Content-Type: application/vnd.wap.connectivity-wbxml)", HFILL } }, { &hf_wsp_parameter_mac, { "MAC", "wsp.parameter.mac", FT_STRING, BASE_NONE, NULL, 0x0, "MAC parameter (Content-Type: application/vnd.wap.connectivity-wbxml)", HFILL } }, { &hf_wsp_parameter_upart_type, { "Type", "wsp.parameter.upart.type", FT_STRING, BASE_NONE, NULL, 0x0, "Multipart type parameter", HFILL } }, { &hf_wsp_parameter_level, { "Level", "wsp.parameter.level", FT_STRING, BASE_NONE, NULL, 0x0, "Level parameter", HFILL } }, { &hf_wsp_parameter_size, { "Size", "wsp.parameter.size", FT_UINT32, BASE_DEC, NULL, 0x0, "Size parameter", HFILL } }, #if 0 { &hf_wsp_reply_data, { "Data", "wsp.reply.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif { &hf_wsp_header_shift_code, { "Switching to WSP header code-page", "wsp.code_page", FT_UINT16, BASE_DEC, NULL, 0x0, "Header code-page shift code", HFILL } }, /* * CO-WSP capability negotiation */ { &hf_capa_client_sdu_size, { "Client SDU Size", "wsp.capability.client_sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, "Client Service Data Unit size (bytes)", HFILL } }, { &hf_capa_server_sdu_size, { "Server SDU Size", "wsp.capability.server_sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, "Server Service Data Unit size (bytes)", HFILL } }, { &hf_capa_protocol_options, { "Protocol Options", "wsp.capability.protocol_opt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_capa_protocol_option_confirmed_push, { "Confirmed Push facility", "wsp.capability.protocol_option.confirmed_push", FT_BOOLEAN, 8, NULL, 0x80, "If set, this CO-WSP session supports the Confirmed Push facility", HFILL } }, { &hf_capa_protocol_option_push, { "Push facility", "wsp.capability.protocol_option.push", FT_BOOLEAN, 8, NULL, 0x40, "If set, this CO-WSP session supports the Push facility", HFILL } }, { &hf_capa_protocol_option_session_resume, { "Session Resume facility", "wsp.capability.protocol_option.session_resume", FT_BOOLEAN, 8, NULL, 0x20, "If set, this CO-WSP session supports the Session Resume facility", HFILL } }, { &hf_capa_protocol_option_ack_headers, { "Acknowledgement headers", "wsp.capability.protocol_option.ack_headers", FT_BOOLEAN, 8, NULL, 0x10, "If set, this CO-WSP session supports Acknowledgement headers", HFILL } }, { &hf_capa_protocol_option_large_data_transfer, { "Large data transfer", "wsp.capability.protocol_option.large_data_transfer", FT_BOOLEAN, 8, NULL, 0x08, "If set, this CO-WSP session supports Large data transfer", HFILL } }, { &hf_capa_method_mor, { "Method MOR", "wsp.capability.method_mor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capa_push_mor, { "Push MOR", "wsp.capability.push_mor", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_capa_extended_method, { "Extended Method", "wsp.capability.extended_method", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_capa_header_code_page, { "Header Code Page", "wsp.capability.code_page", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_capa_aliases, { "Aliases", "wsp.capability.aliases", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_capa_client_message_size, { "Client Message Size", "wsp.capability.client_message_size", FT_UINT8, BASE_DEC, NULL, 0x0, "Client Message size (bytes)", HFILL } }, { &hf_capa_server_message_size, { "Server Message Size", "wsp.capability.server_message_size", FT_UINT8, BASE_DEC, NULL, 0x0, "Server Message size (bytes)", HFILL } }, { &hf_wsp_post_data, { "Data (Post)", "wsp.post.data", FT_NONE, BASE_NONE, NULL, 0x0, "Post Data", HFILL } }, #if 0 { &hf_wsp_push_data, { "Push Data", "wsp.push.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_multipart_data, { "Data in this part", "wsp.multipart.data", FT_NONE, BASE_NONE, NULL, 0x0, "The data of 1 MIME-multipart part.", HFILL } }, #endif { &hf_wsp_mpart, { "Part", "wsp.multipart", FT_UINT32, BASE_DEC, NULL, 0x0, "MIME part of multipart data.", HFILL } }, { &hf_wsp_header_text_value, { "Header textual value", "wsp.header_text_value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_variable_value, { "Variable value", "wsp.variable_value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_default_int, { "Default integer", "wsp.default_int", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_default_string, { "Default string value", "wsp.default_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_default_val_len, { "Default value len", "wsp.default_val_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wsp_redirect_flags, { "Flags", "wsp.redirect.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "Redirect Flags", HFILL } }, { &hf_wsp_redirect_permanent, { "Permanent Redirect", "wsp.redirect.flags.permanent", FT_BOOLEAN, 8, TFS(&tfs_yes_no), PERMANENT_REDIRECT, NULL, HFILL } }, { &hf_wsp_redirect_reuse_security_session, { "Reuse Security Session", "wsp.redirect.flags.reuse_security_session", FT_BOOLEAN, 8, TFS(&tfs_yes_no), REUSE_SECURITY_SESSION, "If set, the existing Security Session may be reused", HFILL } }, { &hf_redirect_addresses, { "Redirect Addresses", "wsp.redirect.addresses", FT_NONE, BASE_NONE, NULL, 0x0, "List of Redirect Addresses", HFILL } }, /* * Addresses */ { &hf_address_entry, { "Address Record", "wsp.address", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_address_flags_length, { "Flags/Length", "wsp.address.flags", FT_UINT8, BASE_HEX, NULL, 0x0, "Address Flags/Length", HFILL } }, { &hf_address_flags_length_bearer_type_included, { "Bearer Type Included", "wsp.address.flags.bearer_type_included", FT_BOOLEAN, 8, TFS(&tfs_yes_no), BEARER_TYPE_INCLUDED, "Address bearer type included", HFILL } }, { &hf_address_flags_length_port_number_included, { "Port Number Included", "wsp.address.flags.port_number_included", FT_BOOLEAN, 8, TFS(&tfs_yes_no), PORT_NUMBER_INCLUDED, "Address port number included", HFILL } }, { &hf_address_flags_length_address_len, { "Address Length", "wsp.address.flags.length", FT_UINT8, BASE_DEC, NULL, ADDRESS_LEN, NULL, HFILL } }, { &hf_address_bearer_type, { "Bearer Type", "wsp.address.bearer_type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_bearer_types_ext, 0x0, NULL, HFILL } }, { &hf_address_port_num, { "Port Number", "wsp.address.port", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_address_ipv4_addr, { "IPv4 Address", "wsp.address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "Address (IPv4)", HFILL } }, { &hf_address_ipv6_addr, { "IPv6 Address", "wsp.address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "Address (IPv6)", HFILL } }, { &hf_address_addr, { "Address", "wsp.address.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, "Address (unknown)", HFILL } }, /* * New WSP header fields */ /* WSP header name */ { &hf_hdr_name_value, { "Header name", "wsp.header.name_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &vals_field_names_ext, 0x7F, "Name of the WSP header as numeric value", HFILL } }, { &hf_hdr_name_string, { "Header name", "wsp.header.name_string", FT_STRING, BASE_NONE, NULL, 0x0, "Name of the WSP header as string", HFILL } }, /* WSP headers start here */ { &hf_hdr_accept, { "Accept", "wsp.header.accept", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept", HFILL } }, { &hf_hdr_accept_charset, { "Accept-Charset", "wsp.header.accept_charset", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept-Charset", HFILL } }, { &hf_hdr_accept_encoding, { "Accept-Encoding", "wsp.header.accept_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept-Encoding", HFILL } }, { &hf_hdr_accept_language, { "Accept-Language", "wsp.header.accept_language", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept-Language", HFILL } }, { &hf_hdr_accept_ranges, { "Accept-Ranges", "wsp.header.accept_ranges", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept-Ranges", HFILL } }, { &hf_hdr_age, { "Age", "wsp.header.age", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Age", HFILL } }, { &hf_hdr_allow, { "Allow", "wsp.header.allow", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Allow", HFILL } }, { &hf_hdr_authorization, { "Authorization", "wsp.header.authorization", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Authorization", HFILL } }, { &hf_hdr_authorization_scheme, { "Authorization Scheme", "wsp.header.authorization.scheme", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Authorization: used scheme", HFILL } }, { &hf_hdr_authorization_user_id, { "User-id", "wsp.header.authorization.user_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Authorization: user ID for basic authorization", HFILL } }, { &hf_hdr_authorization_password, { "Password", "wsp.header.authorization.password", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Authorization: password for basic authorization", HFILL } }, { &hf_hdr_cache_control, { "Cache-Control", "wsp.header.cache_control", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Cache-Control", HFILL } }, { &hf_hdr_connection, { "Connection", "wsp.header.connection", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Connection", HFILL } }, { &hf_hdr_content_base, { "Content-Base", "wsp.header.content_base", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Base", HFILL } }, { &hf_hdr_content_encoding, { "Content-Encoding", "wsp.header.content_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Encoding", HFILL } }, { &hf_hdr_content_language, { "Content-Language", "wsp.header.content_language", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Language", HFILL } }, { &hf_hdr_content_length, { "Content-Length", "wsp.header.content_length", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Length", HFILL } }, { &hf_hdr_content_location, { "Content-Location", "wsp.header.content_location", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Location", HFILL } }, { &hf_hdr_content_md5, { "Content-Md5", "wsp.header.content_md5", FT_BYTES, BASE_NONE, NULL, 0x0, "WSP header Content-Md5", HFILL } }, { &hf_hdr_content_range, { "Content-Range", "wsp.header.content_range", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Range", HFILL } }, { &hf_hdr_content_range_first_byte_pos, { "First-byte-position", "wsp.header.content_range.first_byte_pos", FT_UINT32, BASE_DEC, NULL, 0x0, "WSP header Content-Range: position of first byte", HFILL } }, { &hf_hdr_content_range_entity_length, { "Entity-length", "wsp.header.content_range.entity_length", FT_UINT32, BASE_DEC, NULL, 0x0, "WSP header Content-Range: length of the entity", HFILL } }, { &hf_hdr_content_type, { "Content-Type", "wsp.header.content_type", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Type", HFILL } }, { &hf_hdr_date, { "Date", "wsp.header.date", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Date", HFILL } }, { &hf_hdr_etag, { "ETag", "wsp.header.etag", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header ETag", HFILL } }, { &hf_hdr_expires, { "Expires", "wsp.header.expires", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Expires", HFILL } }, { &hf_hdr_from, { "From", "wsp.header.from", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header From", HFILL } }, { &hf_hdr_host, { "Host", "wsp.header.host", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Host", HFILL } }, { &hf_hdr_if_modified_since, { "If-Modified-Since", "wsp.header.if_modified_since", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header If-Modified-Since", HFILL } }, { &hf_hdr_if_match, { "If-Match", "wsp.header.if_match", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header If-Match", HFILL } }, { &hf_hdr_if_none_match, { "If-None-Match", "wsp.header.if_none_match", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header If-None-Match", HFILL } }, { &hf_hdr_if_range, { "If-Range", "wsp.header.if_range", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header If-Range", HFILL } }, { &hf_hdr_if_unmodified_since, { "If-Unmodified-Since", "wsp.header.if_unmodified_since", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header If-Unmodified-Since", HFILL } }, { &hf_hdr_last_modified, { "Last-Modified", "wsp.header.last_modified", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Last-Modified", HFILL } }, { &hf_hdr_location, { "Location", "wsp.header.location", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Location", HFILL } }, { &hf_hdr_max_forwards, { "Max-Forwards", "wsp.header.max_forwards", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Max-Forwards", HFILL } }, { &hf_hdr_pragma, { "Pragma", "wsp.header.pragma", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Pragma", HFILL } }, { &hf_hdr_proxy_authenticate, { "Proxy-Authenticate", "wsp.header.proxy_authenticate", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authenticate", HFILL } }, { &hf_hdr_proxy_authenticate_scheme, { "Authentication Scheme", "wsp.header.proxy_authenticate.scheme", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authenticate: used scheme", HFILL } }, { &hf_hdr_proxy_authenticate_realm, { "Authentication Realm", "wsp.header.proxy_authenticate.realm", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authenticate: used realm", HFILL } }, { &hf_hdr_proxy_authorization, { "Proxy-Authorization", "wsp.header.proxy_authorization", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authorization", HFILL } }, { &hf_hdr_proxy_authorization_scheme, { "Authorization Scheme", "wsp.header.proxy_authorization.scheme", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authorization: used scheme", HFILL } }, { &hf_hdr_proxy_authorization_user_id, { "User-id", "wsp.header.proxy_authorization.user_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authorization: user ID for basic authorization", HFILL } }, { &hf_hdr_proxy_authorization_password, { "Password", "wsp.header.proxy_authorization.password", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Proxy-Authorization: password for basic authorization", HFILL } }, { &hf_hdr_public, { "Public", "wsp.header.public", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Public", HFILL } }, { &hf_hdr_range, { "Range", "wsp.header.range", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Range", HFILL } }, { &hf_hdr_range_first_byte_pos, { "First-byte-position", "wsp.header.range.first_byte_pos", FT_UINT32, BASE_DEC, NULL, 0x0, "WSP header Range: position of first byte", HFILL } }, { &hf_hdr_range_last_byte_pos, { "Last-byte-position", "wsp.header.range.last_byte_pos", FT_UINT32, BASE_DEC, NULL, 0x0, "WSP header Range: position of last byte", HFILL } }, { &hf_hdr_range_suffix_length, { "Suffix-length", "wsp.header.range.suffix_length", FT_UINT32, BASE_DEC, NULL, 0x0, "WSP header Range: length of the suffix", HFILL } }, { &hf_hdr_referer, { "Referer", "wsp.header.referer", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Referer", HFILL } }, { &hf_hdr_retry_after, { "Retry-After", "wsp.header.retry_after", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Retry-After", HFILL } }, { &hf_hdr_server, { "Server", "wsp.header.server", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Server", HFILL } }, { &hf_hdr_transfer_encoding, { "Transfer-Encoding", "wsp.header.transfer_encoding", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Transfer-Encoding", HFILL } }, { &hf_hdr_upgrade, { "Upgrade", "wsp.header.upgrade", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Upgrade", HFILL } }, { &hf_hdr_user_agent, { "User-Agent", "wsp.header.user_agent", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header User-Agent", HFILL } }, { &hf_hdr_vary, { "Vary", "wsp.header.vary", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Vary", HFILL } }, { &hf_hdr_via, { "Via", "wsp.header.via", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Via", HFILL } }, { &hf_hdr_warning, { "Warning", "wsp.header.warning", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Warning", HFILL } }, { &hf_hdr_warning_code, { "Warning code", "wsp.header.warning.code", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_warning_code_ext, 0x00, "WSP header Warning code", HFILL } }, { &hf_hdr_warning_agent, { "Warning agent", "wsp.header.warning.agent", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Warning agent", HFILL } }, { &hf_hdr_warning_text, { "Warning text", "wsp.header.warning.text", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Warning text", HFILL } }, { &hf_hdr_www_authenticate, { "Www-Authenticate", "wsp.header.www_authenticate", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Www-Authenticate", HFILL } }, { &hf_hdr_www_authenticate_scheme, { "Authentication Scheme", "wsp.header.www_authenticate.scheme", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header WWW-Authenticate: used scheme", HFILL } }, { &hf_hdr_www_authenticate_realm, { "Authentication Realm", "wsp.header.www_authenticate.realm", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header WWW-Authenticate: used realm", HFILL } }, { &hf_hdr_content_disposition, { "Content-Disposition", "wsp.header.content_disposition", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Disposition", HFILL } }, { &hf_hdr_application_id, { "Application-Id", "wsp.header.application_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Application-Id", HFILL } }, { &hf_hdr_content_uri, { "Content-Uri", "wsp.header.content_uri", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Uri", HFILL } }, { &hf_hdr_initiator_uri, { "Initiator-Uri", "wsp.header.initiator_uri", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Initiator-Uri", HFILL } }, { &hf_hdr_bearer_indication, { "Bearer-Indication", "wsp.header.bearer_indication", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Bearer-Indication", HFILL } }, { &hf_hdr_push_flag, { "Push-Flag", "wsp.header.push_flag", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Push-Flag", HFILL } }, { &hf_hdr_push_flag_auth, { "Initiator URI is authenticated", "wsp.header.push_flag.authenticated", FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x01, "The X-Wap-Initiator-URI has been authenticated.", HFILL } }, { &hf_hdr_push_flag_trust, { "Content is trusted", "wsp.header.push_flag.trusted", FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x02, "The push content is trusted.", HFILL } }, { &hf_hdr_push_flag_last, { "Last push message", "wsp.header.push_flag.last", FT_UINT8, BASE_DEC, VALS(vals_false_true), 0x04, "Indicates whether this is the last push message.", HFILL } }, { &hf_hdr_profile, { "Profile", "wsp.header.profile", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Profile", HFILL } }, { &hf_hdr_profile_diff, { "Profile-Diff", "wsp.header.profile_diff", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Profile-Diff", HFILL } }, { &hf_hdr_profile_warning, { "Profile-Warning", "wsp.header.profile_warning", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Profile-Warning", HFILL } }, { &hf_hdr_expect, { "Expect", "wsp.header.expect", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Expect", HFILL } }, { &hf_hdr_te, { "Te", "wsp.header.te", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Te", HFILL } }, { &hf_hdr_trailer, { "Trailer", "wsp.header.trailer", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Trailer", HFILL } }, { &hf_hdr_x_wap_tod, { "X-Wap-Tod", "wsp.header.x_wap_tod", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "WSP header X-Wap-Tod", HFILL } }, { &hf_hdr_content_id, { "Content-Id", "wsp.header.content_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Content-Id", HFILL } }, { &hf_hdr_set_cookie, { "Set-Cookie", "wsp.header.set_cookie", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Set-Cookie", HFILL } }, { &hf_hdr_cookie, { "Cookie", "wsp.header.cookie", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Cookie", HFILL } }, { &hf_hdr_encoding_version, { "Encoding-Version", "wsp.header.encoding_version", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Encoding-Version", HFILL } }, { &hf_hdr_x_wap_security, { "X-Wap-Security", "wsp.header.x_wap_security", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header X-Wap-Security", HFILL } }, { &hf_hdr_x_wap_application_id, { "X-Wap-Application-Id", "wsp.header.x_wap_application_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header X-Wap-Application-Id", HFILL } }, { &hf_hdr_accept_application, { "Accept-Application", "wsp.header.accept_application", FT_STRING, BASE_NONE, NULL, 0x0, "WSP header Accept-Application", HFILL } }, /* * Openwave headers * Header Code Page: x-up-1 */ { &hf_hdr_openwave_default_int, { "Default integer", "wsp.default_int", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_hdr_openwave_default_string, { "Default string value", "wsp.default_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_hdr_openwave_default_val_len, { "Default value len", "wsp.default_val_len", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_hdr_openwave_name_value, { "Header name", "wsp.header.name_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &vals_openwave_field_names_ext, 0x7F, "WSP Openwave header as numeric value", HFILL } }, /* Textual headers */ { &hf_hdr_openwave_x_up_proxy_operator_domain, { "x-up-proxy-operator-domain", "wsp.header.x_up_1.x_up_proxy_operator_domain", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-operator-domain", HFILL } }, { &hf_hdr_openwave_x_up_proxy_home_page, { "x-up-proxy-home-page", "wsp.header.x_up_1.x_up_proxy_home_page", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-home-page", HFILL } }, { &hf_hdr_openwave_x_up_proxy_uplink_version, { "x-up-proxy-uplink-version", "wsp.header.x_up_1.x_up_proxy_uplink_version", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-uplink-version", HFILL } }, { &hf_hdr_openwave_x_up_proxy_ba_realm, { "x-up-proxy-ba-realm", "wsp.header.x_up_1.x_up_proxy_ba_realm", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-ba-realm", HFILL } }, { &hf_hdr_openwave_x_up_proxy_request_uri, { "x-up-proxy-request-uri", "wsp.header.x_up_1.x_up_proxy_request_uri", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-request-uri", HFILL } }, { &hf_hdr_openwave_x_up_proxy_bookmark, { "x-up-proxy-bookmark", "wsp.header.x_up_1.x_up_proxy_bookmark", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-bookmark", HFILL } }, /* Integer-value headers */ { &hf_hdr_openwave_x_up_proxy_push_seq, { "x-up-proxy-push-seq", "wsp.header.x_up_1.x_up_proxy_push_seq", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-push-seq", HFILL } }, { &hf_hdr_openwave_x_up_proxy_notify, { "x-up-proxy-notify", "wsp.header.x_up_1.x_up_proxy_notify", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-notify", HFILL } }, { &hf_hdr_openwave_x_up_proxy_net_ask, { "x-up-proxy-net-ask", "wsp.header.x_up_1.x_up_proxy_net_ask", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-net-ask", HFILL } }, { &hf_hdr_openwave_x_up_proxy_tod, { "x-up-proxy-tod", "wsp.header.x_up_1.x_up_proxy_tod", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, "WSP Openwave header x-up-proxy-tod", HFILL } }, { &hf_hdr_openwave_x_up_proxy_ba_enable, { "x-up-proxy-ba-enable", "wsp.header.x_up_1.x_up_proxy_ba_enable", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-ba-enable", HFILL } }, { &hf_hdr_openwave_x_up_proxy_redirect_enable, { "x-up-proxy-redirect-enable", "wsp.header.x_up_1.x_up_proxy_redirect_enable", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-redirect-enable", HFILL } }, { &hf_hdr_openwave_x_up_proxy_redirect_status, { "x-up-proxy-redirect-status", "wsp.header.x_up_1.x_up_proxy_redirect_status", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-redirect-status", HFILL } }, { &hf_hdr_openwave_x_up_proxy_linger, { "x-up-proxy-linger", "wsp.header.x_up_1.x_up_proxy_linger", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-linger", HFILL } }, { &hf_hdr_openwave_x_up_proxy_enable_trust, { "x-up-proxy-enable-trust", "wsp.header.x_up_1.x_up_proxy_enable_trust", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-enable-trust", HFILL } }, { &hf_hdr_openwave_x_up_proxy_trust, { "x-up-proxy-trust", "wsp.header.x_up_1.x_up_proxy_trust", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-trust", HFILL } }, { &hf_hdr_openwave_x_up_devcap_has_color, { "x-up-devcap-has-color", "wsp.header.x_up_1.x_up_devcap_has_color", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-has-color", HFILL } }, { &hf_hdr_openwave_x_up_devcap_num_softkeys, { "x-up-devcap-num-softkeys", "wsp.header.x_up_1.x_up_devcap_num_softkeys", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-num-softkeys", HFILL } }, { &hf_hdr_openwave_x_up_devcap_softkey_size, { "x-up-devcap-softkey-size", "wsp.header.x_up_1.x_up_devcap_softkey_size", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-softkey-size", HFILL } }, { &hf_hdr_openwave_x_up_devcap_screen_chars, { "x-up-devcap-screen-chars", "wsp.header.x_up_1.x_up_devcap_screen_chars", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-screen-chars", HFILL } }, { &hf_hdr_openwave_x_up_devcap_screen_pixels, { "x-up-devcap-screen-pixels", "wsp.header.x_up_1.x_up_devcap_screen_pixels", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-screen-pixels", HFILL } }, { &hf_hdr_openwave_x_up_devcap_em_size, { "x-up-devcap-em-size", "wsp.header.x_up_1.x_up_devcap_em_size", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-em-size", HFILL } }, { &hf_hdr_openwave_x_up_devcap_screen_depth, { "x-up-devcap-screen-depth", "wsp.header.x_up_1.x_up_devcap_screen_depth", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-screen-depth", HFILL } }, { &hf_hdr_openwave_x_up_devcap_immed_alert, { "x-up-devcap-immed-alert", "wsp.header.x_up_1.x_up_devcap_immed_alert", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-immed-alert", HFILL } }, { &hf_hdr_openwave_x_up_devcap_gui, { "x-up-devcap-gui", "wsp.header.x_up_1.x_up_devcap_gui", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-devcap-gui", HFILL } }, { &hf_hdr_openwave_x_up_proxy_trans_charset, { "x-up-proxy-trans-charset", "wsp.header.x_up_1.x_up_proxy_trans_charset", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-trans-charset", HFILL } }, { &hf_hdr_openwave_x_up_proxy_push_accept, { "x-up-proxy-push-accept", "wsp.header.x_up_1.x_up_proxy_push_accept", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-push-accept", HFILL } }, #if 0 /* Not used for now */ { &hf_hdr_openwave_x_up_proxy_client_id, { "x-up-proxy-client-id", "wsp.header.x_up_1.x_up_proxy_client_id", FT_STRING, BASE_NONE, NULL, 0x0, "WSP Openwave header x-up-proxy-client-id", HFILL } }, #endif /* * Header value parameters */ { &hf_parameter_q, { "Q", "wsp.parameter.q", FT_STRING, BASE_NONE, NULL, 0x0, "Q parameter", HFILL } }, { &hf_parameter_charset, { "Charset", "wsp.parameter.charset", FT_STRING, BASE_NONE, NULL, 0x0, "Charset parameter", HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wsp, &ett_header, /* Header field subtree */ &ett_headers, /* Subtree for WSP headers */ &ett_content_type_header, &ett_wsp_parameter_type, &ett_capabilities, /* CO-WSP Session Capabilities */ &ett_capabilities_entry, &ett_proto_option_capability, /* CO-WSP Session single Capability */ &ett_capabilities_extended_methods, &ett_capabilities_header_code_pages, &ett_post, &ett_redirect_flags, &ett_address_flags, &ett_multiparts, &ett_mpartlist, &ett_addresses, /* Addresses */ &ett_address, /* Single address */ &ett_default, &ett_add_content_type, &ett_accept_x_q_header, &ett_push_flag, &ett_profile_diff_wbxml, &ett_allow, &ett_public, &ett_vary, &ett_x_wap_security, &ett_connection, &ett_transfer_encoding, &ett_accept_ranges, &ett_content_encoding, &ett_accept_encoding, &ett_content_disposition, &ett_text_header, &ett_content_id, &ett_text_or_date_value, &ett_date_value, &ett_tod_value, &ett_age, &ett_integer_lookup, &ett_challenge, &ett_credentials_value, &ett_content_md5, &ett_pragma, &ett_integer_value, &ett_integer_lookup_value, &ett_cache_control, &ett_warning, &ett_profile_warning, &ett_encoding_version, &ett_content_range, &ett_range, &ett_te_value, &ett_openwave_default, }; static ei_register_info ei[] = { { &ei_wsp_capability_invalid, { "wsp.capability.invalid", PI_PROTOCOL, PI_WARN, "Invalid capability", EXPFILL }}, { &ei_wsp_capability_length_invalid, { "wsp.capabilities.length.invalid", PI_PROTOCOL, PI_WARN, "Invalid capability length", EXPFILL }}, { &ei_wsp_capability_encoding_invalid, { "wsp.capability_encoding.invalid", PI_PROTOCOL, PI_WARN, "Invalid capability encoding", EXPFILL }}, { &ei_wsp_text_field_invalid, { "wsp.text_field_invalid", PI_PROTOCOL, PI_WARN, "Text field invalid", EXPFILL }}, { &ei_wsp_invalid_parameter_value, { "wsp.invalid_parameter_value", PI_PROTOCOL, PI_WARN, "Invalid parameter value", EXPFILL }}, { &ei_wsp_header_invalid_value, { "wsp.header_invalid_value", PI_PROTOCOL, PI_WARN, "Invalid header value", EXPFILL }}, { &ei_hdr_x_wap_tod, { "wsp.header.x_wap_tod.not_text", PI_PROTOCOL, PI_WARN, "Should be encoded as a textual value", EXPFILL }}, { &ei_wsp_undecoded_parameter, { "wsp.undecoded_parameter", PI_UNDECODED, PI_WARN, "Invalid parameter value", EXPFILL }}, { &ei_wsp_trailing_quote, { "wsp.trailing_quote", PI_PROTOCOL, PI_WARN, "Quoted-string value has been encoded with a trailing quote", EXPFILL }}, { &ei_wsp_header_invalid, { "wsp.header_invalid", PI_MALFORMED, PI_ERROR, "Malformed header", EXPFILL }}, { &ei_wsp_oversized_uintvar, { "wsp.oversized_uintvar", PI_MALFORMED, PI_ERROR, "Uintvar is oversized", EXPFILL }} }; expert_module_t* expert_wsp; /* Register the protocol name and description */ proto_wsp = proto_register_protocol( "Wireless Session Protocol", "WSP", "wsp"); wsp_tap = register_tap("wsp"); /* Init the hash table */ /* wsp_sessions = g_hash_table_new( (GHashFunc) wsp_session_hash, (GEqualFunc)wsp_session_equal);*/ /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_wsp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_wsp = expert_register_protocol(proto_wsp); expert_register_field_array(expert_wsp, ei, array_length(ei)); register_dissector("wsp-co", dissect_wsp_fromwap_co, proto_wsp); register_dissector("wsp-cl", dissect_wsp_fromwap_cl, proto_wsp); heur_subdissector_list = register_heur_dissector_list("wsp", proto_wsp); wsp_fromudp_handle = create_dissector_handle(dissect_wsp_fromudp, proto_wsp); } void proto_reg_handoff_wsp(void) { /* * Get a handle for the WTP-over-UDP and the generic media dissectors. */ wtp_fromudp_handle = find_dissector_add_dependency("wtp-udp", proto_wsp); media_handle = find_dissector_add_dependency("media", proto_wsp); coap_handle = find_dissector_add_dependency("coap", proto_wsp); wbxml_uaprof_handle = find_dissector_add_dependency("wbxml-uaprof", proto_wsp); /* Only connection-less WSP has no previous handler */ dissector_add_uint_range_with_preference("udp.port", UDP_PORT_WSP_RANGE, wsp_fromudp_handle); /* GSM SMS UD dissector can also carry WSP */ dissector_add_uint("gsm_sms_ud.udh.port", UDP_PORT_WSP, wsp_fromudp_handle); dissector_add_uint("gsm_sms_ud.udh.port", UDP_PORT_WSP_PUSH, wsp_fromudp_handle); /* GSM SMS dissector can also carry WSP */ dissector_add_uint("gsm_sms.udh.port", UDP_PORT_WSP, wsp_fromudp_handle); dissector_add_uint("gsm_sms.udh.port", UDP_PORT_WSP_PUSH, wsp_fromudp_handle); /* As the media types for WSP and HTTP are the same, the WSP dissector * uses the same string dissector table as the HTTP protocol. */ media_type_table = find_dissector_table("media_type"); /* This dissector is also called from the WTP and WTLS dissectors */ } /* * Session Initiation Request */ /* Register the protocol with Wireshark */ void proto_register_sir(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_sir_section, { "Session Initiation Request", "wap.sir", FT_NONE, BASE_NONE, NULL, 0x0, "Session Initiation Request content", HFILL } }, { &hf_sir_version, { "Version", "wap.sir.version", FT_UINT8, BASE_DEC, NULL, 0x0, "Version of the Session Initiation Request document", HFILL } }, { &hf_sir_app_id_list_len, { "Application-ID List Length", "wap.sir.app_id_list.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of the Application-ID list (bytes)", HFILL } }, { &hf_sir_app_id_list, { "Application-ID List", "wap.sir.app_id_list", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_sir_wsp_contact_points_len, { "WSP Contact Points Length", "wap.sir.wsp_contact_points.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of the WSP Contact Points list (bytes)", HFILL } }, { &hf_sir_wsp_contact_points, { "WSP Contact Points", "wap.sir.wsp_contact_points", FT_NONE, BASE_NONE, NULL, 0x0, "WSP Contact Points list", HFILL } }, { &hf_sir_contact_points_len, { "Non-WSP Contact Points Length", "wap.sir.contact_points.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of the Non-WSP Contact Points list (bytes)", HFILL } }, { &hf_sir_contact_points, { "Non-WSP Contact Points", "wap.sir.contact_points", FT_NONE, BASE_NONE, NULL, 0x0, "Non-WSP Contact Points list", HFILL } }, { &hf_sir_protocol_options_len, { "Protocol Options List Entries", "wap.sir.protocol_options.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of entries in the Protocol Options list", HFILL } }, { &hf_sir_protocol_options, { "Protocol Options", "wap.sir.protocol_options", FT_UINT16, BASE_DEC, VALS(vals_sir_protocol_options), 0x00, "Protocol Options list", HFILL } }, { &hf_sir_prov_url_len, { "X-Wap-ProvURL Length", "wap.sir.prov_url.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Length of the X-Wap-ProvURL (Identifies the WAP Client Provisioning Context)", HFILL } }, { &hf_sir_prov_url, { "X-Wap-ProvURL", "wap.sir.prov_url", FT_STRING, BASE_NONE, NULL, 0x0, "X-Wap-ProvURL (Identifies the WAP Client Provisioning Context)", HFILL } }, { &hf_sir_cpi_tag_len, { "CPITag List Entries", "wap.sir.cpi_tag.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Number of entries in the CPITag list", HFILL } }, { &hf_sir_cpi_tag, { "CPITag", "wap.sir.cpi_tag", FT_BYTES, BASE_NONE, NULL, 0x0, "CPITag (OTA-HTTP)", HFILL } } }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_sir /* Session Initiation Request */ }; static tap_param wsp_stat_params[] = { { PARAM_FILTER, "filter", "Filter", NULL, TRUE } }; static stat_tap_table_ui wsp_stat_table = { REGISTER_STAT_GROUP_TELEPHONY, "WAP-WSP Packet Counter", "wsp", "wsp,stat", wsp_stat_init, wsp_stat_packet, wsp_stat_reset, wsp_stat_free_table_item, NULL, sizeof(wsp_stat_fields)/sizeof(stat_tap_table_item), wsp_stat_fields, sizeof(wsp_stat_params)/sizeof(tap_param), wsp_stat_params, NULL, 0 }; /* Register the dissector */ proto_sir = proto_register_protocol( "WAP Session Initiation Request", /* protocol name for use by wireshark */ "WAP SIR", /* short version of name */ "wap-sir" /* Abbreviated protocol name, should Match IANA: < URL:http://www.iana.org/assignments/port-numbers/ > */ ); /* Register header fields and protocol subtrees */ proto_register_field_array(proto_sir, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_stat_tap_table_ui(&wsp_stat_table); } void proto_reg_handoff_sir(void) { dissector_handle_t sir_handle; sir_handle = create_dissector_handle(dissect_sir, proto_sir); /* Add dissector bindings for SIR dissection */ dissector_add_string("media_type", "application/vnd.wap.sia", sir_handle); } /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wsp.h
/* packet-wsp.h * * Declarations for disassembly of WSP component of WAP traffic. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_WSP_H__ #define __PACKET_WSP_H__ #include <epan/proto.h> #include "ws_symbol_export.h" /* These reason codes are used in the WTP dissector as the WTP user is * assumed to be WSP */ extern value_string_ext vals_wsp_reason_codes_ext; /* * the following allows TAP code access to the messages * without having to duplicate it. With MSVC and a * libwireshark.dll, we need a special declaration. */ WS_DLL_PUBLIC value_string_ext wsp_vals_pdu_type_ext; WS_DLL_PUBLIC value_string_ext wsp_vals_status_ext; /* * exported functionality */ void add_post_data (proto_tree *, tvbuff_t *, guint, const char *, packet_info *); guint32 add_content_type (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint32 val_start, guint32 *well_known_content, const char **textual_content); /* statistics */ typedef struct _wsp_info_value_t /* see README.tapping and tap-wspstat.c */ { gint status_code; guint8 pdut; } wsp_info_value_t; #endif /* packet-wsp.h */
C
wireshark/epan/dissectors/packet-wtls.c
/* packet-wtls.c * * Routines to dissect WTLS component of WAP traffic. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #ifdef DEBUG #include <stdio.h> #endif #include <epan/packet.h> #include <epan/iana_charsets.h> #include "packet-wap.h" #include "packet-wtls.h" void proto_register_wtls(void); void proto_reg_handoff_wtls(void); /* File scoped variables for the protocol and registered fields */ static int proto_wtls = -1; /* These fields used by fixed part of header */ static int hf_wtls_record = -1; static int hf_wtls_record_type = -1; static int hf_wtls_record_length = -1; static int hf_wtls_record_sequence = -1; static int hf_wtls_record_ciphered = -1; static int hf_wtls_hands = -1; static int hf_wtls_hands_type = -1; static int hf_wtls_hands_length = -1; static int hf_wtls_hands_cli_hello = -1; static int hf_wtls_hands_cli_hello_version = -1; static int hf_wtls_hands_cli_hello_gmt = -1; static int hf_wtls_hands_cli_hello_random = -1; static int hf_wtls_hands_cli_hello_session = -1; static int hf_wtls_hands_cli_hello_session_str = -1; static int hf_wtls_hands_cli_hello_cli_key_id = -1; static int hf_wtls_hands_cli_hello_cli_key_len = -1; static int hf_wtls_hands_cli_hello_trust_key_id = -1; static int hf_wtls_hands_cli_hello_key_exchange = -1; static int hf_wtls_hands_cli_hello_key_exchange_suite = -1; static int hf_wtls_hands_cli_hello_key_parameter_index = -1; static int hf_wtls_hands_cli_hello_key_parameter_set = -1; static int hf_wtls_hands_cli_hello_key_identifier_type = -1; static int hf_wtls_hands_cli_hello_key_identifier_charset = -1; static int hf_wtls_hands_cli_hello_key_identifier_size = -1; static int hf_wtls_hands_cli_hello_key_identifier = -1; static int hf_wtls_hands_cli_hello_key_identifier_str = -1; static int hf_wtls_hands_cli_hello_cipher_suite = -1; static int hf_wtls_hands_cli_hello_cipher_suite_item = -1; static int hf_wtls_hands_cli_hello_compression_methods = -1; static int hf_wtls_hands_cli_hello_compression = -1; static int hf_wtls_hands_cli_hello_sequence_mode = -1; static int hf_wtls_hands_cli_hello_key_refresh = -1; static int hf_wtls_hands_serv_hello = -1; static int hf_wtls_hands_serv_hello_version = -1; static int hf_wtls_hands_serv_hello_gmt = -1; static int hf_wtls_hands_serv_hello_random = -1; static int hf_wtls_hands_serv_hello_session = -1; static int hf_wtls_hands_serv_hello_session_str = -1; static int hf_wtls_hands_serv_hello_cli_key_id = -1; static int hf_wtls_hands_serv_hello_cipher_suite_item = -1; static int hf_wtls_hands_serv_hello_cipher_bulk = -1; static int hf_wtls_hands_serv_hello_cipher_mac = -1; static int hf_wtls_hands_serv_hello_compression = -1; static int hf_wtls_hands_serv_hello_sequence_mode = -1; static int hf_wtls_hands_serv_hello_key_refresh = -1; static int hf_wtls_hands_certificates = -1; static int hf_wtls_hands_certificate = -1; static int hf_wtls_hands_certificate_type = -1; static int hf_wtls_hands_certificate_wtls_version = -1; static int hf_wtls_hands_certificate_wtls_signature_type = -1; static int hf_wtls_hands_certificate_wtls_issuer_type = -1; static int hf_wtls_hands_certificate_wtls_issuer_charset = -1; static int hf_wtls_hands_certificate_wtls_issuer_size = -1; static int hf_wtls_hands_certificate_wtls_issuer_name = -1; static int hf_wtls_hands_certificate_wtls_valid_not_before = -1; static int hf_wtls_hands_certificate_wtls_valid_not_after = -1; static int hf_wtls_hands_certificate_wtls_subject_type = -1; static int hf_wtls_hands_certificate_wtls_subject_charset = -1; static int hf_wtls_hands_certificate_wtls_subject_size = -1; static int hf_wtls_hands_certificate_wtls_subject_name = -1; static int hf_wtls_hands_certificate_wtls_public_key_type = -1; static int hf_wtls_hands_certificate_wtls_key_parameter_index = -1; static int hf_wtls_hands_certificate_wtls_key_parameter_set = -1; static int hf_wtls_hands_certificate_wtls_rsa_exponent = -1; static int hf_wtls_hands_certificate_wtls_rsa_modules = -1; static int hf_wtls_hands_certificate_wtls_signature = -1; static int hf_wtls_alert = -1; static int hf_wtls_alert_level = -1; static int hf_wtls_alert_description = -1; /* Initialize the subtree pointers */ static gint ett_wtls = -1; static gint ett_wtls_rec = -1; static gint ett_wtls_msg_type = -1; static gint ett_wtls_msg_type_item = -1; static gint ett_wtls_msg_type_item_sub = -1; static gint ett_wtls_msg_type_item_sub_sub = -1; static const value_string wtls_vals_record_type[] = { { 1, "change_cipher_data" }, { 2, "alert" }, { 3, "handshake" }, { 4, "application_data" }, { 0, NULL } }; static value_string_ext wtls_vals_record_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_record_type); static const value_string wtls_vals_cipher_bulk[] = { { 0, "Null" }, { 1, "RC5 CBC 40" }, { 2, "RC5 CBC 56" }, { 3, "RC5 CBC" }, { 4, "DES CBC 40" }, { 5, "DES CBC" }, { 6, "3DES CBC cwEDE40" }, { 7, "IDEA CBC 40" }, { 8, "IDEA CBC 56" }, { 9, "IDEA CBC" }, { 0, NULL } }; static value_string_ext wtls_vals_cipher_bulk_ext = VALUE_STRING_EXT_INIT(wtls_vals_cipher_bulk); static const value_string wtls_vals_cipher_mac[] = { { 0, "SHA 0" }, { 1, "SHA 40 " }, { 2, "SHA 80" }, { 3, "SHA" }, { 4, "SHA XOR 40" }, { 5, "MD5 40" }, { 6, "MD5 80" }, { 7, "MD5" }, { 0, NULL } }; static value_string_ext wtls_vals_cipher_mac_ext = VALUE_STRING_EXT_INIT(wtls_vals_cipher_mac); static const value_string wtls_vals_handshake_type[] = { { 0, "Hello Request" }, { 1, "Client Hello" }, { 2, "Server Hello" }, { 11, "Certificate" }, { 12, "Server Key Exchange" }, { 13, "Certificate Request" }, { 14, "Server Hello Done" }, { 15, "Certificate Verify" }, { 16, "Client Key Exchange" }, { 20, "Finished" }, { 0, NULL } }; static value_string_ext wtls_vals_handshake_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_handshake_type); static const value_string wtls_vals_key_exchange_suite[] = { { 0, "NULL" }, { 1, "Shared Secret" }, { 2, "Diffie Hellman Anonymous" }, { 3, "Diffie Hellman Anonymous 512" }, { 4, "Diffie Hellman Anonymous 768" }, { 5, "RSA Anonymous" }, { 6, "RSA Anonymous 512" }, { 7, "RSA Anonymous 768" }, { 8, "RSA" }, { 9, "RSA 512" }, { 10, "RSA 768" }, { 11, "EC Diffie Hellman Anonymous" }, { 12, "EC Diffie Hellman Anonymous 113" }, { 13, "EC Diffie Hellman Anonymous 131" }, { 14, "EC Diffie Hellman ECDSA" }, { 15, "EC Diffie Hellman Anonymous Uncomp" }, { 16, "EC Diffie Hellman Anonymous Uncomp 113" }, { 17, "EC Diffie Hellman Anonymous Uncomp 131" }, { 18, "EC Diffie Hellman ECDSA Uncomp" }, { 0x00, NULL } }; static value_string_ext wtls_vals_key_exchange_suite_ext = VALUE_STRING_EXT_INIT(wtls_vals_key_exchange_suite); static const value_string wtls_vals_identifier_type[] = { { 0, "No identifier" }, { 1, "Textual Name" }, { 2, "Binary Name" }, { 254, "SHA-1 Hash of Public Key" }, { 255, "x509 Distinguished Name" }, { 0, NULL } }; static value_string_ext wtls_vals_identifier_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_identifier_type); static const value_string wtls_vals_certificate_type[] = { { 1, "WTLS" }, { 2, "X.509" }, { 3, "X.968" }, { 4, "URL" }, { 0, NULL } }; static value_string_ext wtls_vals_certificate_type_ext = VALUE_STRING_EXT_INIT(wtls_vals_certificate_type); static const value_string wtls_vals_compression[] = { { 0, "Null" }, { 0, NULL } }; static const value_string wtls_vals_sequence_mode[] = { { 0, "Off" }, { 1, "Implicit" }, { 2, "Explicit" }, { 0, NULL } }; static const value_string wtls_vals_certificate_signature[] = { { 0, "Anonymous" }, { 1, "ECDSA_SHA" }, { 2, "RSA_SHA" }, { 0, NULL } }; static const value_string wtls_vals_public_key_type[] = { { 2, "RSA" }, { 3, "ECDH" }, { 4, "ECSA" }, { 0, NULL } }; static const value_string wtls_vals_alert_level[] = { { 1, "Warning" }, { 2, "Critical" }, { 3, "Fatal" }, { 0, NULL } }; static const value_string wtls_vals_alert_description[] = { { 0, "connection_close_notify"}, { 1, "session_close_notify"}, { 5, "no_connection"}, { 10, "unexpected_message"}, { 11, "time_required"}, { 20, "bad_record_mac"}, { 21, "decryption_failed"}, { 22, "record_overflow"}, { 30, "decompression_failure"}, { 40, "handshake_failure"}, { 42, "bad_certificate"}, { 43, "unsupported_certificate"}, { 44, "certificate_revoked"}, { 45, "certificate_expired"}, { 46, "certificate_unknown"}, { 47, "illegal_parameter"}, { 48, "unknown_ca"}, { 49, "access_denied"}, { 50, "decode_error"}, { 51, "decrypt_error"}, { 52, "unknown_key_id"}, { 53, "disabled_key_id"}, { 54, "key_exchange_disabled"}, { 55, "session_not_ready"}, { 56, "unknown_parameter_index"}, { 57, "duplicate_finished_received"}, { 60, "export_restriction"}, { 70, "protocol_version"}, { 71, "insufficient_security"}, { 80, "internal_error"}, { 90, "user_canceled"}, { 100, "no_renegotiation"}, { 0, NULL } }; static value_string_ext wtls_vals_alert_description_ext = VALUE_STRING_EXT_INIT(wtls_vals_alert_description); #define WTLS_RECORD_TYPE_LENGTH 0x80 #define WTLS_RECORD_TYPE_SEQUENCE 0x40 #define WTLS_RECORD_TYPE_CIPHER_CUR 0x20 #define WTLS_RECORD_CONTENT_TYPE 0x0f #define WTLS_ALERT 0x02 #define WTLS_PLAIN_HANDSHAKE 0x03 #define WTLS_HANDSHAKE_CLIENT_HELLO 1 #define WTLS_HANDSHAKE_SERVER_HELLO 2 #define WTLS_HANDSHAKE_CERTIFICATE 11 #define CERTIFICATE_WTLS 1 #define CERTIFICATE_X509 2 #define CERTIFICATE_X968 3 #define CERTIFICATE_URL 4 #define IDENTIFIER_NULL 0 #define IDENTIFIER_TEXT 1 #define IDENTIFIER_BIN 2 #define IDENTIFIER_SHA_1 254 #define IDENTIFIER_X509 255 #define PUBLIC_KEY_RSA 2 #define PUBLIC_KEY_ECDH 3 #define PUBLIC_KEY_ECDSA 4 static void dissect_wtls_handshake (proto_tree *, tvbuff_t *, guint, guint); /* Code to actually dissect the packets */ static int dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; char pdut; guint count = 0; guint offset_wtls = 0; /* Set up structures we will need to add the protocol subtree and manage it */ proto_item *ti; proto_tree *wtls_tree; proto_tree *wtls_rec_tree; proto_tree *wtls_msg_type_tree; switch ( pinfo->match_uint ) { case UDP_PORT_WTLS_WSP: col_set_str(pinfo->cinfo, COL_PROTOCOL, "WTLS+WSP" ); break; case UDP_PORT_WTLS_WTP_WSP: col_set_str(pinfo->cinfo, COL_PROTOCOL, "WTLS+WTP+WSP" ); break; } /* Develop the string to put in the Info column */ col_set_str(pinfo->cinfo, COL_INFO, "WTLS"); /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ if (tree) { ti = proto_tree_add_item(tree, proto_wtls, tvb, offset_wtls, -1, ENC_NA); wtls_tree = proto_item_add_subtree(ti, ett_wtls); for (offset_wtls=0; offset_wtls < (tvb_reported_length(tvb)-1);) { pdut = tvb_get_guint8 (tvb, offset_wtls); offset = offset_wtls+1; if (pdut & WTLS_RECORD_TYPE_SEQUENCE) { offset+=2; } if (pdut & WTLS_RECORD_TYPE_LENGTH) { count = tvb_get_ntohs(tvb, offset); offset+=2; count += offset-offset_wtls; } else { count = tvb_reported_length_remaining (tvb, offset_wtls); } ti = proto_tree_add_uint(wtls_tree, hf_wtls_record, tvb, offset_wtls, count, pdut); wtls_rec_tree = proto_item_add_subtree(ti, ett_wtls_rec); offset = offset_wtls; proto_tree_add_item (wtls_rec_tree, hf_wtls_record_type, tvb,offset,1,ENC_BIG_ENDIAN); offset++; offset_wtls += count; if (pdut & WTLS_RECORD_TYPE_SEQUENCE) { proto_tree_add_item (wtls_rec_tree, hf_wtls_record_sequence, tvb,offset,2,ENC_BIG_ENDIAN); offset+=2; } if (pdut & WTLS_RECORD_TYPE_LENGTH) { count = tvb_get_ntohs(tvb, offset); proto_tree_add_item (wtls_rec_tree, hf_wtls_record_length, tvb,offset,2,ENC_BIG_ENDIAN); offset+=2; } else { count = tvb_reported_length_remaining (tvb, offset); } if (pdut & WTLS_RECORD_TYPE_CIPHER_CUR) { proto_tree_add_item (wtls_rec_tree, hf_wtls_record_ciphered, tvb,offset,count,ENC_NA); continue; } switch (pdut & WTLS_RECORD_CONTENT_TYPE) { case WTLS_PLAIN_HANDSHAKE : dissect_wtls_handshake(wtls_rec_tree,tvb,offset,count); break; case WTLS_ALERT : ti = proto_tree_add_item(wtls_rec_tree, hf_wtls_alert, tvb, offset, count, ENC_NA); wtls_msg_type_tree = proto_item_add_subtree(ti, ett_wtls_msg_type); proto_tree_add_item (wtls_msg_type_tree, hf_wtls_alert_level, tvb,offset,1,ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item (wtls_msg_type_tree, hf_wtls_alert_description, tvb,offset,1,ENC_BIG_ENDIAN); /*offset+=1;*/ break; default: /*offset+=count;*/ break; } } } return tvb_captured_length(tvb); } static int add_text_identifier(tvbuff_t *tvb, int offset, int hf_charset, int hf_size, int hf_str, proto_tree *tree) { guint8 size; int client_size = 0; proto_tree_add_item(tree, hf_charset, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; size = tvb_get_guint8 (tvb, offset); proto_tree_add_item(tree, hf_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item(tree, hf_str, tvb, offset, size, ENC_BIG_ENDIAN); /*offset+=size;*/ client_size+=size+3; #ifdef DEBUG fprintf(stderr, "text id size = %d, client_size = %d\n", size, client_size); #endif /* DEBUG */ return client_size; } static int add_session_id(proto_tree *tree, int hf, int hf_str, tvbuff_t *tvb, int offset) { guint count; guint i; guint64 session_id; count = tvb_get_guint8(tvb, offset); if (count == 0) proto_tree_add_string (tree, hf_str, tvb, offset, count+1, "NULL"); else if (count <= 8) { session_id = 0; for (i = 0; i < count; i++) session_id = (session_id << 8) | tvb_get_guint8(tvb, offset + i); proto_tree_add_uint64 (tree, hf, tvb, offset, count+1, session_id); } else { proto_tree_add_item(tree, hf, tvb, offset, count+1, ENC_NA); } return offset+1+count; } static void dissect_wtls_handshake(proto_tree *tree, tvbuff_t *tvb, guint offset, guint count) { char pdu_msg_type; int client_size = 0; guint value = 0; int size = 0; guint public_key = 0; char valStr[1024]; const char *valBulk = NULL; const char *valMac = NULL; proto_item *ti; proto_item *cli_key_item; proto_tree *wtls_msg_type_tree; proto_tree *wtls_msg_type_item_tree; proto_tree *wtls_msg_type_item_sub_tree; proto_tree *wtls_msg_type_item_sub_sub_tree; pdu_msg_type = tvb_get_guint8 (tvb, offset); ti = proto_tree_add_uint(tree, hf_wtls_hands, tvb, offset,count, pdu_msg_type); wtls_msg_type_tree = proto_item_add_subtree(ti, ett_wtls_msg_type); proto_tree_add_item (wtls_msg_type_tree, hf_wtls_hands_type, tvb,offset,1,ENC_BIG_ENDIAN); offset+=1; count = tvb_get_ntohs (tvb, offset); proto_tree_add_item (wtls_msg_type_tree, hf_wtls_hands_length, tvb,offset,2,ENC_BIG_ENDIAN); offset+=2; switch(pdu_msg_type) { case WTLS_HANDSHAKE_CLIENT_HELLO : ti = proto_tree_add_item(wtls_msg_type_tree, hf_wtls_hands_cli_hello, tvb, offset, count, ENC_NA); wtls_msg_type_item_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item); proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_version, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_gmt, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_random, tvb,offset,12,ENC_NA); offset+=12; offset = add_session_id (wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_session, hf_wtls_hands_cli_hello_session_str, tvb, offset); /* process client_key_ids structure */ count = tvb_get_ntohs (tvb, offset); ti = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_cli_key_id, tvb, offset, count+2, ENC_NA); wtls_msg_type_item_sub_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item_sub); /* display length of client_key_ids structure */ proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_cli_key_len, tvb,offset,2,ENC_BIG_ENDIAN); offset+=2; /* cycle through client_key_ids entries */ for (;count > 0;count-=client_size) { /* get encryption suite id (one byte) */ value = tvb_get_guint8 (tvb, offset); cli_key_item = proto_tree_add_uint(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_key_exchange, tvb, offset,1, value); client_size=1; wtls_msg_type_item_sub_sub_tree = proto_item_add_subtree(cli_key_item, ett_wtls_msg_type_item_sub_sub); proto_tree_add_uint(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_exchange_suite, tvb,offset,1,value); offset++; #ifdef DEBUG fprintf(stderr, "encryption suite = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* get parameter index (one byte) */ value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_parameter_index, tvb,offset,1,ENC_BIG_ENDIAN); offset++; client_size++; #ifdef DEBUG fprintf(stderr, "parameter index = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* explicit parameters present in next field */ if (value == 0xff) { size = tvb_get_ntohs (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_parameter_set, tvb,offset,size+2,ENC_ASCII); offset+=size+2; client_size+=size+2; } /* get identifier type */ value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_type, tvb,offset,1,ENC_BIG_ENDIAN); offset++; client_size++; #ifdef DEBUG fprintf(stderr, "identifier type = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* identifier present in next field */ /* note: value 0x0 means no identifier */ switch(value) { case IDENTIFIER_TEXT : /* text identifier */ /* not tested */ size = add_text_identifier( tvb, offset, hf_wtls_hands_cli_hello_key_identifier_charset, hf_wtls_hands_cli_hello_key_identifier_size, hf_wtls_hands_cli_hello_key_identifier_str, wtls_msg_type_item_sub_sub_tree); offset += size; client_size += size; break; case IDENTIFIER_BIN : /* binary identifier */ size = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_size, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,size,ENC_NA); offset+=size; client_size+=size+1; #ifdef DEBUG fprintf(stderr, "binary id size = %d, client_size = %d\n", size, client_size); #endif /* DEBUG */ break; case IDENTIFIER_SHA_1 : /* SHA-1 hash of the public key */ proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,20,ENC_NA); offset+=20; client_size+=20; #ifdef DEBUG fprintf(stderr, "SHA-1 hash size = 20, client_size = %d\n", client_size); #endif /* DEBUG */ break; case IDENTIFIER_X509 : /* X.509 distinguished name */ /* not tested */ size = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_size, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,size,ENC_NA); offset+=size; client_size+=size+1; #ifdef DEBUG fprintf(stderr, "X.509 name size = %d, client_size = %d\n", size, client_size); #endif /* DEBUG */ break; } proto_item_set_len(cli_key_item, client_size); } /* process trusted_keys structure */ count = tvb_get_ntohs (tvb, offset); ti = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_trust_key_id, tvb, offset, count+2, ENC_NA); wtls_msg_type_item_sub_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item_sub); /* display length of trusted_keys structure */ proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_cli_key_len, tvb,offset,2,ENC_BIG_ENDIAN); offset+=2; for (;count > 0;count-=client_size) { /* get encryption suite id (one byte) */ value = tvb_get_guint8 (tvb, offset); cli_key_item = proto_tree_add_uint(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_key_exchange, tvb, offset,1, value); client_size=1; wtls_msg_type_item_sub_sub_tree = proto_item_add_subtree(cli_key_item, ett_wtls_msg_type_item_sub_sub); proto_tree_add_uint(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_exchange_suite, tvb,offset,1,value); offset++; #ifdef DEBUG fprintf(stderr, "encryption suite = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* get parameter index (one byte) */ value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_parameter_index, tvb,offset,1,ENC_BIG_ENDIAN); offset++; client_size++; #ifdef DEBUG fprintf(stderr, "parameter index = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* explicit parameters present in next field */ if (value == 0xff) { size = tvb_get_ntohs (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_parameter_set, tvb,offset,size+2,ENC_ASCII); offset+=size+2; client_size+=size+2; } /* get identifier type */ value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_type, tvb,offset,1,ENC_BIG_ENDIAN); offset++; client_size++; #ifdef DEBUG fprintf(stderr, "identifier type = %d, client_size = %d\n", value, client_size); #endif /* DEBUG */ /* identifier present in next field */ /* note: value 0x0 means no identifier */ switch (value) { case IDENTIFIER_TEXT : /* text identifier */ /* not tested */ size = add_text_identifier( tvb, offset, hf_wtls_hands_cli_hello_key_identifier_charset, hf_wtls_hands_cli_hello_key_identifier_size, hf_wtls_hands_cli_hello_key_identifier_str, wtls_msg_type_item_sub_sub_tree); offset += size; client_size += size; break; case IDENTIFIER_BIN : /* binary identifier */ size = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_size, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,size,ENC_NA); offset+=size; client_size+=size+1; #ifdef DEBUG fprintf(stderr, "binary id size = %d, client_size = %d\n", size, client_size); #endif /* DEBUG */ break; case IDENTIFIER_SHA_1 : /* SHA-1 hash of the public key */ proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,20,ENC_NA); offset+=20; client_size+=20; #ifdef DEBUG fprintf(stderr, "SHA-1 hash size = 20, client_size = %d\n", client_size); #endif /* DEBUG */ break; case IDENTIFIER_X509 : /* X.509 distinguished name */ /* not tested */ size = tvb_get_guint8 (tvb, offset); /* need to fetch identifier and display it */ proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier_size, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_sub_sub_tree, hf_wtls_hands_cli_hello_key_identifier, tvb,offset,size,ENC_NA); offset+=size; client_size+=size+1; #ifdef DEBUG fprintf(stderr, "X.509 name size = %d, client_size = %d\n", size, client_size); #endif /* DEBUG */ break; } proto_item_set_len(cli_key_item, client_size); } /* process cipher_suites structure */ count = tvb_get_guint8 (tvb, offset); ti = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_cipher_suite, tvb, offset, count+1, ENC_NA); wtls_msg_type_item_sub_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item_sub); offset+=1; for (;count > 0;count-=client_size) { value = tvb_get_guint8 (tvb, offset); valBulk = try_val_to_str_ext(value, &wtls_vals_cipher_bulk_ext); offset++; client_size=1; valMac = try_val_to_str_ext(tvb_get_guint8 (tvb, offset), &wtls_vals_cipher_mac_ext); if (valBulk != NULL) { if (valMac != NULL) { snprintf(valStr,1024,"%s, %s",valBulk,valMac); } else { snprintf(valStr,1024,"%s, Unknown MAC (0x%02x)",valBulk,tvb_get_guint8 (tvb, offset)); } } else { if (valMac != NULL) { snprintf(valStr,1024,"Unknown Bulk (0x%02x), %s",value,valMac); } else { snprintf(valStr,1024,"Unknown Bulk (0x%02x), Unknown MAC (0x%02x)",value, tvb_get_guint8 (tvb, offset)); } } offset++; client_size++; proto_tree_add_string(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_cipher_suite_item, tvb, offset-2,2, valStr); } count = tvb_get_guint8 (tvb, offset); ti = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_compression_methods, tvb, offset, count+1, ENC_NA); wtls_msg_type_item_sub_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item_sub); offset+=1; for (;count > 0;count-=client_size) { client_size=0; proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_cli_hello_compression, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; } proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_sequence_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_cli_hello_key_refresh, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case WTLS_HANDSHAKE_SERVER_HELLO : ti = proto_tree_add_item(wtls_msg_type_tree, hf_wtls_hands_serv_hello, tvb, offset, count, ENC_NA); wtls_msg_type_item_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item); proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_version, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_gmt, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset+=4; proto_tree_add_item (wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_random, tvb,offset,12,ENC_NA); offset+=12; offset = add_session_id (wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_session, hf_wtls_hands_serv_hello_session_str, tvb, offset); proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_cli_key_id, tvb,offset,1,ENC_BIG_ENDIAN); offset++; cli_key_item = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_cipher_suite_item, tvb, offset,2, ENC_NA); wtls_msg_type_item_sub_tree = proto_item_add_subtree(cli_key_item, ett_wtls_msg_type_item_sub); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_serv_hello_cipher_bulk, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_serv_hello_cipher_mac, tvb,offset,1,ENC_BIG_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_compression, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_sequence_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_serv_hello_key_refresh, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset++; break; case WTLS_HANDSHAKE_CERTIFICATE : ti = proto_tree_add_item(wtls_msg_type_tree, hf_wtls_hands_certificates, tvb, offset,count, ENC_NA); wtls_msg_type_item_tree = proto_item_add_subtree(ti, ett_wtls_msg_type_item); count = tvb_get_ntohs (tvb, offset); offset+=2; for (;count > 0;count-=client_size) { cli_key_item = proto_tree_add_item(wtls_msg_type_item_tree, hf_wtls_hands_certificate, tvb, offset,1, ENC_NA); client_size=0; wtls_msg_type_item_sub_tree = proto_item_add_subtree(cli_key_item, ett_wtls_msg_type_item_sub); proto_item_set_len(cli_key_item, client_size); value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_type, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; switch(value) { case CERTIFICATE_WTLS: proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_version, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_signature_type, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_issuer_type, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; switch (value) { case IDENTIFIER_NULL : break; case IDENTIFIER_TEXT : value = add_text_identifier(tvb, offset, hf_wtls_hands_certificate_wtls_issuer_charset, hf_wtls_hands_certificate_wtls_issuer_size, hf_wtls_hands_certificate_wtls_issuer_name, wtls_msg_type_item_sub_tree); offset += value; client_size += value; break; case IDENTIFIER_BIN : break; case IDENTIFIER_SHA_1 : break; case IDENTIFIER_X509 : break; } proto_tree_add_item (wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_valid_not_before, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset+=4; client_size+=4; proto_tree_add_item (wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_valid_not_after, tvb, offset, 4, ENC_TIME_SECS|ENC_BIG_ENDIAN); offset+=4; client_size+=4; value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_subject_type, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; switch (value) { case IDENTIFIER_NULL : break; case IDENTIFIER_TEXT : value = add_text_identifier(tvb, offset, hf_wtls_hands_certificate_wtls_subject_charset, hf_wtls_hands_certificate_wtls_subject_size, hf_wtls_hands_certificate_wtls_subject_name, wtls_msg_type_item_sub_tree); offset += value; client_size += value; break; case IDENTIFIER_BIN : break; case IDENTIFIER_SHA_1 : break; case IDENTIFIER_X509 : break; } public_key = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_public_key_type, tvb, offset,1, ENC_LITTLE_ENDIAN); offset++; client_size++; value = tvb_get_guint8 (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_key_parameter_index, tvb,offset,1,ENC_BIG_ENDIAN); offset++; client_size++; if (value == 0xff) { size = tvb_get_ntohs (tvb, offset); proto_tree_add_item(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_key_parameter_set, tvb,offset,size+2,ENC_ASCII); offset+=size+2; client_size+=size+2; } switch (public_key) { case PUBLIC_KEY_RSA : value = tvb_get_ntohs (tvb, offset); proto_tree_add_uint(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_rsa_exponent, tvb,offset,value+2,value*8); offset+=2+value; client_size+=2+value; value = tvb_get_ntohs (tvb, offset); proto_tree_add_uint(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_rsa_modules, tvb,offset,value+2,value*8); offset+=2+value; client_size+=2+value; break; case PUBLIC_KEY_ECDH : break; case PUBLIC_KEY_ECDSA : break; } value = tvb_get_ntohs (tvb, offset); proto_tree_add_uint(wtls_msg_type_item_sub_tree, hf_wtls_hands_certificate_wtls_signature, tvb,offset,2+value,value*8); offset+=2+value; client_size+=2+value; break; case CERTIFICATE_X509: case CERTIFICATE_X968: value = tvb_get_ntohs (tvb, offset); offset+=2; client_size+=2; client_size += value; offset += value; break; case CERTIFICATE_URL: value = tvb_get_guint8 (tvb, offset); offset++; client_size++; client_size += value; offset += value; break; } proto_item_set_len(cli_key_item, client_size); } break; default: /*offset+=count;*/ break; } } /* Register the protocol with Wireshark */ void proto_register_wtls(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_wtls_record, { "Record", "wtls.record", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_record_type_ext, 0x0f, NULL, HFILL } }, { &hf_wtls_record_type, { "Record Type", "wtls.rec_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_record_type_ext, 0x0f, NULL, HFILL } }, { &hf_wtls_record_length, { "Record Length", "wtls.rec_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_record_sequence, { "Record Sequence", "wtls.rec_seq", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_record_ciphered, { "Record Ciphered", "wtls.rec_cipher", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands, { "Handshake", "wtls.handshake", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_handshake_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_type, { "Type", "wtls.handshake.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_handshake_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_length, { "Length", "wtls.handshake.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello, { "Client Hello", "wtls.handshake.client_hello", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_version, { "Version", "wtls.handshake.client_hello.version", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_gmt, { "Time GMT", "wtls.handshake.client_hello.gmt", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_random, { "Random", "wtls.handshake.client_hello.random", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_session, { "Session ID", "wtls.handshake.client_hello.sessionid", FT_UINT64, BASE_HEX_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_session_str, { "Session ID", "wtls.handshake.client_hello.session.str", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_cli_key_id, { "Client Keys", "wtls.handshake.client_hello.client_keys_id", FT_NONE, BASE_NONE, NULL, 0x00, NULL , HFILL } }, { &hf_wtls_hands_cli_hello_cli_key_len, { "Length", "wtls.handshake.client_hello.client_keys_len", FT_UINT16, BASE_DEC, NULL, 0x00, NULL , HFILL } }, { &hf_wtls_hands_cli_hello_trust_key_id, { "Trusted Keys", "wtls.handshake.client_hello.trusted_keys_id", FT_NONE, BASE_NONE, NULL, 0x00, NULL , HFILL } }, { &hf_wtls_hands_cli_hello_key_exchange, { "Key Exchange", "wtls.handshake.client_hello.key.key_exchange", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_key_exchange_suite_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_exchange_suite, { "Suite", "wtls.handshake.client_hello.key.key_exchange.suite", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_key_exchange_suite_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_parameter_index, { "Parameter Index", "wtls.handshake.client_hello.parameter_index", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_parameter_set, { "Parameter Set", "wtls.handshake.client_hello.parameter", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_identifier_type, { "Identifier Type", "wtls.handshake.client_hello.ident_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_identifier_charset, { "Identifier CharSet", "wtls.handshake.client_hello.ident_charset", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mibenum_vals_character_sets_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_identifier_size, { "Identifier Size", "wtls.handshake.client_hello.ident_size", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_identifier, { "Identifier", "wtls.handshake.client_hello.identifier", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_identifier_str, { "Identifier Name", "wtls.handshake.client_hello.ident_name", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_cipher_suite, { "Cipher Suites", "wtls.handshake.client_hello.ciphers", FT_NONE, BASE_NONE, NULL, 0x00, "Cipher Suite", HFILL } }, { &hf_wtls_hands_cli_hello_cipher_suite_item, { "Cipher", "wtls.handshake.client_hello.cipher", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_compression_methods, { "Compression Methods", "wtls.handshake.client_hello.comp_methods", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_compression, { "Compression", "wtls.handshake.client_hello.compression", FT_UINT8, BASE_HEX, VALS ( wtls_vals_compression ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_sequence_mode, { "Sequence Mode", "wtls.handshake.client_hello.sequence_mode", FT_UINT8, BASE_DEC, VALS ( wtls_vals_sequence_mode ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_cli_hello_key_refresh, { "Refresh", "wtls.handshake.client_hello.refresh", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello, { "Server Hello", "wtls.handshake.server_hello", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_version, { "Version", "wtls.handshake.server_hello.version", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_gmt, { "Time GMT", "wtls.handshake.server_hello.gmt", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_random, { "Random", "wtls.handshake.server_hello.random", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_session, { "Session ID", "wtls.handshake.server_hello.sessionid", FT_UINT64, BASE_HEX_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_session_str, { "Session ID", "wtls.handshake.server_hello.session.str", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_cli_key_id, { "Client Key ID", "wtls.handshake.server_hello.key", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_cipher_suite_item, { "Cipher", "wtls.handshake.server_hello.cipher", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_cipher_bulk, { "Cipher Bulk", "wtls.handshake.server_hello.cipher.bulk", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_cipher_bulk_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_cipher_mac, { "Cipher MAC", "wtls.handshake.server_hello.cipher.mac", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_cipher_mac_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_compression, { "Compression", "wtls.handshake.server_hello.compression", FT_UINT8, BASE_HEX, VALS ( wtls_vals_compression ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_sequence_mode, { "Sequence Mode", "wtls.handshake.server_hello.sequence_mode", FT_UINT8, BASE_DEC, VALS ( wtls_vals_sequence_mode ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_serv_hello_key_refresh, { "Refresh", "wtls.handshake.server_hello.refresh", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificates, { "Certificates", "wtls.handshake.certificates", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate, { "Certificate", "wtls.handshake.certificate", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_type, { "Type", "wtls.handshake.certificate.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_certificate_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_version, { "Version", "wtls.handshake.certificate.version", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_signature_type, { "Signature Type", "wtls.handshake.certificate.signature.type", FT_UINT8, BASE_DEC, VALS ( wtls_vals_certificate_signature ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_signature, { "Signature Size", "wtls.handshake.certificate.signature.signature", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_issuer_type, { "Issuer", "wtls.handshake.certificate.issuer.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_issuer_charset, { "Charset", "wtls.handshake.certificate.issuer.charset", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mibenum_vals_character_sets_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_issuer_size, { "Size", "wtls.handshake.certificate.issuer.size", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_issuer_name, { "Name", "wtls.handshake.certificate.issuer.name", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_valid_not_before, { "Valid not before", "wtls.handshake.certificate.before", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_valid_not_after, { "Valid not after", "wtls.handshake.certificate.after", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_subject_type, { "Subject", "wtls.handshake.certificate.subject.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_identifier_type_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_subject_charset, { "Charset", "wtls.handshake.certificate.subject.charset", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mibenum_vals_character_sets_ext, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_subject_size, { "Size", "wtls.handshake.certificate.subject.size", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_subject_name, { "Name", "wtls.handshake.certificate.subject.name", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_public_key_type, { "Public Key Type", "wtls.handshake.certificate.public.type", FT_UINT8, BASE_DEC, VALS ( wtls_vals_public_key_type ), 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_key_parameter_index, { "Parameter Index", "wtls.handshake.certificate.parameter_index", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_key_parameter_set, { "Parameter Set", "wtls.handshake.certificate.parameter", FT_STRING, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_rsa_exponent, { "RSA Exponent Size", "wtls.handshake.certificate.rsa.exponent", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_hands_certificate_wtls_rsa_modules, { "RSA Modulus Size", "wtls.handshake.certificate.rsa.modules", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_alert, { "Alert", "wtls.alert", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_wtls_alert_level, { "Level", "wtls.alert.level", FT_UINT8, BASE_DEC, VALS ( wtls_vals_alert_level ), 0x00, NULL, HFILL } }, { &hf_wtls_alert_description, { "Description", "wtls.alert.description", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wtls_vals_alert_description_ext, 0x00, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wtls, &ett_wtls_rec, &ett_wtls_msg_type, &ett_wtls_msg_type_item, &ett_wtls_msg_type_item_sub, &ett_wtls_msg_type_item_sub_sub, }; /* Register the protocol name and description */ proto_wtls = proto_register_protocol("Wireless Transport Layer Security", "WTLS", "wtls" ); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_wtls, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_wtls(void) { dissector_handle_t wtls_handle; wtls_handle = create_dissector_handle(dissect_wtls, proto_wtls); dissector_add_uint_range_with_preference("udp.port", UDP_PORT_WTLS_RANGE, wtls_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
C/C++
wireshark/epan/dissectors/packet-wtls.h
/* packet-wtls.h * * Declarations for disassembly of WTLS component of WAP traffic. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_WTLS_H__ #define __PACKET_WTLS_H__ /* Implementation Status: * * * * TODO: */ #endif /* packet-wtls.h */
C
wireshark/epan/dissectors/packet-wtp.c
/* packet-wtp.c * * Routines to dissect WTP component of WAP traffic. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #ifdef DEBUG #include <stdio.h> #endif #include <epan/packet.h> #include <epan/reassemble.h> #include "packet-wap.h" #include "packet-wtp.h" #include "packet-wsp.h" void proto_register_wtp(void); void proto_reg_handoff_wtp(void); static const true_false_string continue_truth = { "TPI Present" , "No TPI" }; static const true_false_string RID_truth = { "Re-Transmission", "First transmission" }; static const true_false_string TIDNew_truth = { "TID is new" , "TID is valid" }; static const true_false_string tid_response_truth = { "Response" , "Original" }; static const true_false_string UP_truth = { "User Acknowledgement required" , "User Acknowledgement optional" }; static const value_string vals_wtp_pdu_type[] = { { 0, "Not Allowed" }, { 1, "Invoke" }, { 2, "Result" }, { 3, "Ack" }, { 4, "Abort" }, { 5, "Segmented Invoke" }, { 6, "Segmented Result" }, { 7, "Negative Ack" }, { 0, NULL } }; static const value_string vals_transaction_trailer[] = { { 0, "Not last packet" }, { 1, "Last packet of message" }, { 2, "Last packet of group" }, { 3, "Re-assembly not supported" }, { 0, NULL } }; static const value_string vals_version[] = { { 0, "Current" }, { 1, "Undefined" }, { 2, "Undefined" }, { 3, "Undefined" }, { 0, NULL } }; static const value_string vals_abort_type[] = { { 0, "Provider" }, { 1, "User (WSP)" }, { 0, NULL } }; static const value_string vals_abort_reason_provider[] = { { 0x00, "Unknown" }, { 0x01, "Protocol Error" }, { 0x02, "Invalid TID" }, { 0x03, "Not Implemented Class 2" }, { 0x04, "Not Implemented SAR" }, { 0x05, "Not Implemented User Acknowledgement" }, { 0x06, "WTP Version Zero" }, { 0x07, "Capacity Temporarily Exceeded" }, { 0x08, "No Response" }, { 0x09, "Message Too Large" }, { 0x00, NULL } }; static const value_string vals_transaction_classes[] = { { 0x00, "Unreliable Invoke without Result" }, { 0x01, "Reliable Invoke without Result" }, { 0x02, "Reliable Invoke with Reliable Result" }, { 0x00, NULL } }; static const value_string vals_tpi_type[] = { { 0x00, "Error" }, { 0x01, "Info" }, { 0x02, "Option" }, { 0x03, "Packet sequence number" }, { 0x04, "SDU boundary" }, { 0x05, "Frame boundary" }, { 0x00, NULL } }; static const value_string vals_tpi_opt[] = { { 0x01, "Maximum receive unit" }, { 0x02, "Total message size" }, { 0x03, "Delay transmission timer" }, { 0x04, "Maximum group" }, { 0x05, "Current TID" }, { 0x06, "No cached TID" }, { 0x00, NULL } }; /* File scoped variables for the protocol and registered fields */ static int proto_wtp = -1; /* These fields used by fixed part of header */ static int hf_wtp_header_sub_pdu_size = -1; static int hf_wtp_header_flag_continue = -1; static int hf_wtp_header_pdu_type = -1; static int hf_wtp_header_flag_Trailer = -1; static int hf_wtp_header_flag_RID = -1; static int hf_wtp_header_flag_TID = -1; static int hf_wtp_header_flag_TID_response = -1; /* These fields used by Invoke packets */ static int hf_wtp_header_Inv_version = -1; static int hf_wtp_header_Inv_flag_TIDNew = -1; static int hf_wtp_header_Inv_flag_UP = -1; static int hf_wtp_header_Inv_Reserved = -1; static int hf_wtp_header_Inv_TransactionClass = -1; /* static int hf_wtp_header_variable_part = -1; */ /* static int hf_wtp_data = -1; */ static int hf_wtp_tpi_type = -1; static int hf_wtp_tpi_psn = -1; static int hf_wtp_tpi_opt = -1; static int hf_wtp_tpi_optval = -1; static int hf_wtp_tpi_info = -1; static int hf_wtp_header_Ack_flag_TVETOK = -1; static int hf_wtp_header_Abort_type = -1; static int hf_wtp_header_Abort_reason_provider = -1; static int hf_wtp_header_Abort_reason_user = -1; static int hf_wtp_header_sequence_number = -1; static int hf_wtp_header_missing_packets = -1; static int hf_wtp_payload = -1; /* These fields used when reassembling WTP fragments */ static int hf_wtp_fragments = -1; static int hf_wtp_fragment = -1; static int hf_wtp_fragment_overlap = -1; static int hf_wtp_fragment_overlap_conflict = -1; static int hf_wtp_fragment_multiple_tails = -1; static int hf_wtp_fragment_too_long_fragment = -1; static int hf_wtp_fragment_error = -1; static int hf_wtp_fragment_count = -1; static int hf_wtp_reassembled_in = -1; static int hf_wtp_reassembled_length = -1; /* Initialize the subtree pointers */ static gint ett_wtp = -1; static gint ett_wtp_sub_pdu_tree = -1; static gint ett_header = -1; static gint ett_tpilist = -1; static gint ett_wsp_fragments = -1; static gint ett_wtp_fragment = -1; static const fragment_items wtp_frag_items = { &ett_wtp_fragment, &ett_wsp_fragments, &hf_wtp_fragments, &hf_wtp_fragment, &hf_wtp_fragment_overlap, &hf_wtp_fragment_overlap_conflict, &hf_wtp_fragment_multiple_tails, &hf_wtp_fragment_too_long_fragment, &hf_wtp_fragment_error, &hf_wtp_fragment_count, &hf_wtp_reassembled_in, &hf_wtp_reassembled_length, /* Reassembled data field */ NULL, "fragments" }; /* Handle for WSP dissector */ static dissector_handle_t wsp_handle; static dissector_handle_t wtp_fromudp_handle; /* * reassembly of WSP */ static reassembly_table wtp_reassembly_table; /* * Extract some bitfields */ #define pdu_type(octet) (((octet) >> 3) & 0x0F) /* Note pdu type must not be 0x00 */ #define transaction_class(octet) ((octet) & 0x03) /* ......XX */ #define transmission_trailer(octet) (((octet) >> 1) & 0x01) /* ......X. */ static char retransmission_indicator(unsigned char octet) { switch (pdu_type(octet)) { case INVOKE: case RESULT: case ACK: case SEGMENTED_INVOKE: case SEGMENTED_RESULT: case NEGATIVE_ACK: return octet & 0x01; /* .......X */ default: return 0; } } /* * dissect a TPI */ static void wtp_handle_tpi(proto_tree *tree, tvbuff_t *tvb) { int offset = 0; unsigned char tByte; unsigned char tType; unsigned char tLen; proto_tree *subTree = NULL; proto_item *pi; tByte = tvb_get_guint8(tvb, offset++); tType = (tByte & 0x78) >> 3; if (tByte & 0x04) /* Long TPI */ tLen = tvb_get_guint8(tvb, offset++); else tLen = tByte & 0x03; pi = proto_tree_add_uint(tree, hf_wtp_tpi_type, tvb, 0, tvb_captured_length(tvb), tType); subTree = proto_item_add_subtree(pi, ett_tpilist); switch (tType) { case 0x00: /* Error*/ /* \todo */ break; case 0x01: /* Info */ /* Beware, untested case here */ proto_tree_add_item(subTree, hf_wtp_tpi_info, tvb, offset, tLen, ENC_NA); break; case 0x02: /* Option */ proto_tree_add_item(subTree, hf_wtp_tpi_opt, tvb, offset++, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(subTree, hf_wtp_tpi_optval, tvb, offset, tLen - 1, ENC_NA); break; case 0x03: /* PSN */ proto_tree_add_item(subTree, hf_wtp_tpi_psn, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case 0x04: /* SDU boundary */ /* \todo */ break; case 0x05: /* Frame boundary */ /* \todo */ break; default: break; } } /* Code to actually dissect the packets */ static void dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { char *szInfo; int offCur = 0; /* current offset from start of WTP data */ gint returned_length, str_index = 0; unsigned char b0; /* continuation flag */ unsigned char fCon; /* Continue flag */ unsigned char fRID; /* Re-transmission indicator*/ unsigned char fTTR = '\0'; /* Transmission trailer */ guint cbHeader = 0; /* Fixed header length */ guint vHeader = 0; /* Variable header length*/ int abortType = 0; /* Set up structures we'll need to add the protocol subtree and manage it */ proto_item *ti = NULL; proto_tree *wtp_tree = NULL; char pdut; char clsTransaction = 3; int numMissing = 0; /* Number of missing packets in a negative ack */ int i; tvbuff_t *wsp_tvb = NULL; guint8 psn = 0; /* Packet sequence number*/ guint16 TID = 0; /* Transaction-Id */ int dataOffset; gint dataLen; #define SZINFO_SIZE 256 szInfo=(char *)wmem_alloc(pinfo->pool, SZINFO_SIZE); b0 = tvb_get_guint8 (tvb, offCur + 0); /* Discover Concatenated PDUs */ if (b0 == 0) { guint c_fieldlen = 0; /* Length of length-field */ guint c_pdulen = 0; /* Length of conc. PDU */ if (tree) { ti = proto_tree_add_item(tree, proto_wtp, tvb, offCur, 1, ENC_NA); wtp_tree = proto_item_add_subtree(ti, ett_wtp_sub_pdu_tree); proto_item_append_text(ti, ", PDU concatenation"); } offCur = 1; i = 1; while (offCur < (int) tvb_reported_length(tvb)) { tvbuff_t *wtp_tvb; /* The length of an embedded WTP PDU is coded as either: * - a 7-bit value contained in one octet with highest bit == 0. * - a 15-bit value contained in two octets (little endian) * if the 1st octet has its highest bit == 1. * This means that this is NOT encoded as an uintvar-integer!!! */ b0 = tvb_get_guint8(tvb, offCur + 0); if (b0 & 0x80) { c_fieldlen = 2; c_pdulen = ((b0 & 0x7f) << 8) | tvb_get_guint8(tvb, offCur + 1); } else { c_fieldlen = 1; c_pdulen = b0; } if (tree) { proto_tree_add_uint(wtp_tree, hf_wtp_header_sub_pdu_size, tvb, offCur, c_fieldlen, c_pdulen); } if (i > 1) { col_append_str(pinfo->cinfo, COL_INFO, ", "); } /* Skip the length field for the WTP sub-tvb */ wtp_tvb = tvb_new_subset_length(tvb, offCur + c_fieldlen, c_pdulen); dissect_wtp_common(wtp_tvb, pinfo, wtp_tree); offCur += c_fieldlen + c_pdulen; i++; } if (tree) { proto_item_append_text(ti, ", PDU count: %u", i); } return; } /* No concatenation */ fCon = b0 & 0x80; fRID = retransmission_indicator(b0); pdut = pdu_type(b0); #ifdef DEBUG proto_tree_add_debug_text(tree, "WTP packet %u: tree = %p, pdu = %s (%u) length: %u\n", pinfo->num, tree, val_to_str(pdut, vals_wtp_pdu_type, "Unknown PDU type 0x%x"), pdut, tvb_captured_length(tvb)); #endif /* Develop the string to put in the Info column */ returned_length = snprintf(szInfo, SZINFO_SIZE, "WTP %s", val_to_str(pdut, vals_wtp_pdu_type, "Unknown PDU type 0x%x")); str_index += MIN(returned_length, SZINFO_SIZE-str_index); switch (pdut) { case INVOKE: fTTR = transmission_trailer(b0); TID = tvb_get_ntohs(tvb, offCur + 1); psn = 0; clsTransaction = transaction_class(tvb_get_guint8(tvb, offCur + 3)); returned_length = snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " Class %d", clsTransaction); str_index += MIN(returned_length, SZINFO_SIZE-str_index); cbHeader = 4; break; case SEGMENTED_INVOKE: case SEGMENTED_RESULT: fTTR = transmission_trailer(b0); TID = tvb_get_ntohs(tvb, offCur + 1); psn = tvb_get_guint8(tvb, offCur + 3); if (psn != 0) { returned_length = snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " (%u)", psn); str_index += MIN(returned_length, SZINFO_SIZE-str_index); } cbHeader = 4; break; case ABORT: cbHeader = 4; break; case RESULT: fTTR = transmission_trailer(b0); TID = tvb_get_ntohs(tvb, offCur + 1); psn = 0; cbHeader = 3; break; case ACK: cbHeader = 3; break; case NEGATIVE_ACK: /* Variable number of missing packets */ numMissing = tvb_get_guint8(tvb, offCur + 3); cbHeader = numMissing + 4; break; default: break; }; if (fRID) { /*returned_length =*/ snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " R" ); /*str_index += MIN(returned_length, SZINFO_SIZE-str_index);*/ }; /* In the interest of speed, if "tree" is NULL, don't do any work not necessary to generate protocol tree items. */ if (tree) { #ifdef DEBUG fprintf(stderr, "dissect_wtp: cbHeader = %d\n", cbHeader); #endif /* NOTE - Length will be set when we process the TPI */ ti = proto_tree_add_item(tree, proto_wtp, tvb, offCur, -1, ENC_NA); #ifdef DEBUG fprintf(stderr, "dissect_wtp: (7) Returned from proto_tree_add_item\n"); #endif wtp_tree = proto_item_add_subtree(ti, ett_wtp); /* Code to process the packet goes here */ #ifdef DEBUG fprintf(stderr, "dissect_wtp: cbHeader = %d\n", cbHeader); fprintf(stderr, "dissect_wtp: offCur = %d\n", offCur); #endif /* Add common items: only CON and PDU Type */ proto_tree_add_item( wtp_tree, /* tree */ hf_wtp_header_flag_continue, /* id */ tvb, offCur, /* start of highlight */ 1, /* length of highlight*/ b0 /* value */ ); proto_tree_add_item(wtp_tree, hf_wtp_header_pdu_type, tvb, offCur, 1, ENC_LITTLE_ENDIAN); switch(pdut) { case INVOKE: proto_tree_add_item(wtp_tree, hf_wtp_header_flag_Trailer, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_Inv_version , tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_Inv_flag_TIDNew, tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_Inv_flag_UP, tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_Inv_Reserved, tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_Inv_TransactionClass, tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ", PDU: Invoke (%u)" ", Transaction Class: %s (%u)", INVOKE, val_to_str_const(clsTransaction, vals_transaction_classes, "Undefined"), clsTransaction); break; case RESULT: proto_tree_add_item(wtp_tree, hf_wtp_header_flag_Trailer, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", PDU: Result (%u)", RESULT); break; case ACK: proto_tree_add_item(wtp_tree, hf_wtp_header_Ack_flag_TVETOK, tvb, offCur, 1, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", PDU: ACK (%u)", ACK); break; case ABORT: abortType = tvb_get_guint8 (tvb, offCur) & 0x07; proto_tree_add_item(wtp_tree, hf_wtp_header_Abort_type , tvb, offCur , 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); if (abortType == PROVIDER) { guint8 reason = tvb_get_guint8(tvb, offCur + 3); proto_tree_add_item( wtp_tree, hf_wtp_header_Abort_reason_provider , tvb, offCur + 3 , 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ", PDU: Abort (%u)" ", Type: Provider (%u)" ", Reason: %s (%u)", ABORT, PROVIDER, val_to_str_const(reason, vals_abort_reason_provider, "Undefined"), reason); } else if (abortType == USER) { guint8 reason = tvb_get_guint8(tvb, offCur + 3); proto_tree_add_item(wtp_tree, hf_wtp_header_Abort_reason_user , tvb, offCur + 3 , 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ", PDU: Abort (%u)" ", Type: User (%u)" ", Reason: %s (%u)", ABORT, PROVIDER, val_to_str_ext_const(reason, &vals_wsp_reason_codes_ext, "Undefined"), reason); } break; case SEGMENTED_INVOKE: proto_tree_add_item(wtp_tree, hf_wtp_header_flag_Trailer, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_sequence_number , tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ", PDU: Segmented Invoke (%u)" ", Packet Sequence Number: %u", SEGMENTED_INVOKE, psn); break; case SEGMENTED_RESULT: proto_tree_add_item(wtp_tree, hf_wtp_header_flag_Trailer, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_sequence_number , tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); proto_item_append_text(ti, ", PDU: Segmented Result (%u)" ", Packet Sequence Number: %u", SEGMENTED_RESULT, psn); break; case NEGATIVE_ACK: proto_tree_add_item(wtp_tree, hf_wtp_header_flag_RID, tvb, offCur, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID_response, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_flag_TID, tvb, offCur + 1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(wtp_tree, hf_wtp_header_missing_packets , tvb, offCur + 3, 1, ENC_LITTLE_ENDIAN); /* Iterate through missing packets */ for (i = 0; i < numMissing; i++) { proto_tree_add_item(wtp_tree, hf_wtp_header_sequence_number, tvb, offCur + 4 + i, 1, ENC_LITTLE_ENDIAN); } proto_item_append_text(ti, ", PDU: Negative Ack (%u)" ", Missing Packets: %u", NEGATIVE_ACK, numMissing); break; default: break; }; if (fRID) { proto_item_append_text(ti, ", Retransmission"); } } else { /* tree is NULL */ #ifdef DEBUG fprintf(stderr, "dissect_wtp: (4) tree was %p\n", tree); #endif } /* Process the variable part */ if (fCon) { /* Now, analyze variable part */ guint8 tCon; guint8 tByte; guint tpiLen; tvbuff_t *tmp_tvb; vHeader = 0; /* Start scan all over */ do { tByte = tvb_get_guint8(tvb, offCur + cbHeader + vHeader); tCon = tByte & 0x80; if (tByte & 0x04) /* Long TPI */ tpiLen = 2 + tvb_get_guint8(tvb, offCur + cbHeader + vHeader + 1); else tpiLen = 1 + (tByte & 0x03); if (tree) { tmp_tvb = tvb_new_subset_length(tvb, offCur + cbHeader + vHeader, tpiLen); wtp_handle_tpi(wtp_tree, tmp_tvb); } vHeader += tpiLen; } while (tCon); } else { /* There is no variable part */ } /* End of variable part of header */ /* Set the length of the WTP protocol part now we know the length of the * fixed and variable WTP headers */ if (tree) proto_item_set_len(ti, cbHeader + vHeader); #ifdef DEBUG fprintf( stderr, "dissect_wtp: cbHeader = %d\n", cbHeader ); #endif /* * Any remaining data ought to be WSP data (if not WTP ACK, NACK * or ABORT pdu), so, if we have any remaining data, and it's * not an ACK, NACK, or ABORT PDU, hand it off (defragmented) to the * WSP dissector. * Note that the last packet of a fragmented WTP message needn't * contain any data, so we allow payloadless packets to be * reassembled. (XXX - does the reassembly code handle this * for packets other than the last packet?) * * Try calling a subdissector only if: * - The WTP payload is ressembled in this very packet, * - The WTP payload is not fragmented across packets. */ dataOffset = offCur + cbHeader + vHeader; dataLen = tvb_reported_length_remaining(tvb, dataOffset); if ((dataLen >= 0) && ! ((pdut==ACK) || (pdut==NEGATIVE_ACK) || (pdut==ABORT))) { /* Try to reassemble if needed, and hand over to WSP * A fragmented WTP packet is either: * - An INVOKE with fTTR (transmission trailer) not set, * - a SEGMENTED_INVOKE, * - A RESULT with fTTR (transmission trailer) not set, * - a SEGMENTED_RESULT. */ if ( ( (pdut == SEGMENTED_INVOKE) || (pdut == SEGMENTED_RESULT) || ( ((pdut == INVOKE) || (pdut == RESULT)) && (!fTTR) ) ) && tvb_bytes_exist(tvb, dataOffset, dataLen) ) { /* Try reassembling fragments */ fragment_head *fd_wtp = NULL; guint32 reassembled_in = 0; gboolean save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; fd_wtp = fragment_add_seq(&wtp_reassembly_table, tvb, dataOffset, pinfo, TID, NULL, psn, dataLen, !fTTR, 0); /* XXX - fragment_add_seq() yields NULL unless Wireshark knows * that the packet is part of a reassembled whole. This means * that fd_wtp will be NULL as long as Wireshark did not encounter * (and process) the packet containing the last fragment. * This implies that Wireshark needs two passes over the data for * correct reassembly. At the first pass, a capture containing * three fragments plus a retransmssion of the last fragment * will progressively show: * * Packet 1: (Unreassembled fragment 1) * Packet 2: (Unreassembled fragment 2) * Packet 3: (Reassembled WTP) * Packet 4: (WTP payload reassembled in packet 3) * * However at subsequent evaluation (e.g., by applying a display * filter) the packet summary will show: * * Packet 1: (WTP payload reassembled in packet 3) * Packet 2: (WTP payload reassembled in packet 3) * Packet 3: (Reassembled WTP) * Packet 4: (WTP payload reassembled in packet 3) * * This is important to know, and also affects read filters! */ wsp_tvb = process_reassembled_data(tvb, dataOffset, pinfo, "Reassembled WTP", fd_wtp, &wtp_frag_items, NULL, wtp_tree); #ifdef DEBUG proto_tree_add_debug_text(tree, "WTP: Packet %u %s -> %d: wsp_tvb = %p, fd_wtp = %p, frame = %u\n", pinfo->num, fd_wtp ? "Reassembled" : "Not reassembled", fd_wtp ? fd_wtp->reassembled_in : -1, wsp_tvb, fd_wtp ); #endif if (fd_wtp) { /* Reassembled */ reassembled_in = fd_wtp->reassembled_in; if (pinfo->num == reassembled_in) { /* Reassembled in this very packet: * We can safely hand the tvb to the WSP dissector */ call_dissector(wsp_handle, wsp_tvb, pinfo, tree); } else { /* Not reassembled in this packet */ col_append_fstr(pinfo->cinfo, COL_INFO, "%s (WTP payload reassembled in packet %u)", szInfo, fd_wtp->reassembled_in); proto_tree_add_item(wtp_tree, hf_wtp_payload, tvb, dataOffset, -1, ENC_NA); } } else { /* Not reassembled yet, or not reassembled at all */ col_append_fstr(pinfo->cinfo, COL_INFO, "%s (Unreassembled fragment %u)", szInfo, psn); proto_tree_add_item(wtp_tree, hf_wtp_payload, tvb, dataOffset, -1, ENC_NA); } /* Now reset fragmentation information in pinfo */ pinfo->fragmented = save_fragmented; } else if ( ((pdut == INVOKE) || (pdut == RESULT)) && (fTTR) ) { /* Non-fragmented payload */ wsp_tvb = tvb_new_subset_remaining(tvb, dataOffset); /* We can safely hand the tvb to the WSP dissector */ call_dissector(wsp_handle, wsp_tvb, pinfo, tree); } else { /* Nothing to hand to subdissector */ col_append_str(pinfo->cinfo, COL_INFO, szInfo); } } else { /* Nothing to hand to subdissector */ col_append_str(pinfo->cinfo, COL_INFO, szInfo); } } /* * Called directly from UDP. * Put "WTP+WSP" into the "Protocol" column. */ static int dissect_wtp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "WTP+WSP"); col_clear(pinfo->cinfo, COL_INFO); dissect_wtp_common(tvb, pinfo, tree); return tvb_captured_length(tvb); } /* * Called from a higher-level WAP dissector, presumably WTLS. * Put "WTLS+WSP+WTP" to the "Protocol" column. * * XXX - is this supposed to be called from WTLS? If so, we're not * calling it.... * * XXX - can this be called from any other dissector? */ static int dissect_wtp_fromwtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "WTLS+WTP+WSP"); col_clear(pinfo->cinfo, COL_INFO); dissect_wtp_common(tvb, pinfo, tree); return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ void proto_register_wtp(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_wtp_header_sub_pdu_size, { "Sub PDU size", "wtp.sub_pdu_size", FT_UINT16, BASE_DEC, NULL, 0x0, "Size of Sub-PDU (bytes)", HFILL } }, { &hf_wtp_header_flag_continue, { "Continue Flag", "wtp.continue_flag", FT_BOOLEAN, 8, TFS( &continue_truth ), 0x80, NULL, HFILL } }, { &hf_wtp_header_pdu_type, { "PDU Type", "wtp.pdu_type", FT_UINT8, BASE_HEX, VALS( vals_wtp_pdu_type ), 0x78, NULL, HFILL } }, { &hf_wtp_header_flag_Trailer, { "Trailer Flags", "wtp.trailer_flags", FT_UINT8, BASE_HEX, VALS( vals_transaction_trailer ), 0x06, NULL, HFILL } }, { &hf_wtp_header_flag_RID, { "Re-transmission Indicator", "wtp.RID", FT_BOOLEAN, 8, TFS( &RID_truth ), 0x01, NULL, HFILL } }, { &hf_wtp_header_flag_TID_response, { "TID Response", "wtp.TID.response", FT_BOOLEAN, 16, TFS( &tid_response_truth ), 0x8000, NULL, HFILL } }, { &hf_wtp_header_flag_TID, { "Transaction ID", "wtp.TID", FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL } }, { &hf_wtp_header_Inv_version, { "Version", "wtp.header.version", FT_UINT8, BASE_HEX, VALS( vals_version ), 0xC0, NULL, HFILL } }, { &hf_wtp_header_Inv_flag_TIDNew, { "TIDNew", "wtp.header.TIDNew", FT_BOOLEAN, 8, TFS( &TIDNew_truth ), 0x20, NULL, HFILL } }, { &hf_wtp_header_Inv_flag_UP, { "U/P flag", "wtp.header.UP", FT_BOOLEAN, 8, TFS( &UP_truth ), 0x10, NULL, HFILL } }, { &hf_wtp_header_Inv_Reserved, { "Reserved", "wtp.inv.reserved", FT_UINT8, BASE_HEX, NULL, 0x0C, NULL, HFILL } }, { &hf_wtp_header_Inv_TransactionClass, { "Transaction Class", "wtp.inv.transaction_class", FT_UINT8, BASE_HEX, VALS( vals_transaction_classes ), 0x03, NULL, HFILL } }, { &hf_wtp_header_Ack_flag_TVETOK, { "Tve/Tok flag", "wtp.ack.tvetok", FT_BOOLEAN, 8, TFS( &tfs_true_false ), 0x04, NULL, HFILL } }, { &hf_wtp_header_Abort_type, { "Abort Type", "wtp.abort.type", FT_UINT8, BASE_HEX, VALS ( vals_abort_type ), 0x07, NULL, HFILL } }, { &hf_wtp_header_Abort_reason_provider, { "Abort Reason", "wtp.abort.reason.provider", FT_UINT8, BASE_HEX, VALS ( vals_abort_reason_provider ), 0x00, NULL, HFILL } }, /* Assume WSP is the user and use its reason codes */ { &hf_wtp_header_Abort_reason_user, { "Abort Reason", "wtp.abort.reason.user", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &vals_wsp_reason_codes_ext, 0x00, NULL, HFILL } }, { &hf_wtp_header_sequence_number, { "Packet Sequence Number", "wtp.header.sequence", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtp_header_missing_packets, { "Missing Packets", "wtp.header.missing_packets", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_wtp_payload, { "Payload", "wtp.payload", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } }, #if 0 { &hf_wtp_header_variable_part, { "Header: Variable part", "wtp.header_variable_part", FT_BYTES, BASE_NONE, NULL, 0x0, "Variable part of the header", HFILL } }, { &hf_wtp_data, { "Data", "wtp.header_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, #endif { &hf_wtp_tpi_type, { "TPI", "wtp.tpi", FT_UINT8, BASE_HEX, VALS(vals_tpi_type), 0x00, "Identification of the Transport Information Item", HFILL } }, { &hf_wtp_tpi_psn, { "Packet sequence number", "wtp.tpi.psn", FT_UINT8, BASE_DEC, NULL, 0x00, "Sequence number of this packet", HFILL } }, { &hf_wtp_tpi_opt, { "Option", "wtp.tpi.opt", FT_UINT8, BASE_HEX, VALS(vals_tpi_opt), 0x00, "The given option for this TPI", HFILL } }, { &hf_wtp_tpi_optval, { "Option Value", "wtp.tpi.opt.val", FT_NONE, BASE_NONE, NULL, 0x00, "The value that is supplied with this option", HFILL } }, { &hf_wtp_tpi_info, { "Information", "wtp.tpi.info", FT_NONE, BASE_NONE, NULL, 0x00, "The information being send by this TPI", HFILL } }, /* Fragment fields */ { &hf_wtp_fragment_overlap, { "Fragment overlap", "wtp.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL } }, { &hf_wtp_fragment_overlap_conflict, { "Conflicting data in fragment overlap", "wtp.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL } }, { &hf_wtp_fragment_multiple_tails, { "Multiple tail fragments found", "wtp.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL } }, { &hf_wtp_fragment_too_long_fragment, { "Fragment too long", "wtp.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL } }, { &hf_wtp_fragment_error, { "Defragmentation error", "wtp.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL } }, { &hf_wtp_fragment_count, { "Fragment count", "wtp.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_wtp_reassembled_in, { "Reassembled in", "wtp.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "WTP fragments are reassembled in the given packet", HFILL } }, { &hf_wtp_reassembled_length, { "Reassembled WTP length", "wtp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL } }, { &hf_wtp_fragment, { "WTP Fragment", "wtp.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_wtp_fragments, { "WTP Fragments", "wtp.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_wtp, &ett_wtp_sub_pdu_tree, &ett_header, &ett_tpilist, &ett_wsp_fragments, &ett_wtp_fragment, }; /* Register the protocol name and description */ proto_wtp = proto_register_protocol( "Wireless Transaction Protocol", /* protocol name for use by wireshark */ "WTP", /* short version of name */ "wtp" /* Abbreviated protocol name, should Match IANA < URL:http://www.iana.org/assignments/port-numbers/ > */ ); /* Required calls to register the header fields and subtrees used */ proto_register_field_array(proto_wtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("wtp-wtls", dissect_wtp_fromwtls, proto_wtp); wtp_fromudp_handle = register_dissector("wtp-udp", dissect_wtp_fromudp, proto_wtp); reassembly_table_register(&wtp_reassembly_table, &addresses_reassembly_table_functions); } void proto_reg_handoff_wtp(void) { /* * Get a handle for the connection-oriented WSP dissector - if WTP * PDUs have data, it is WSP. */ wsp_handle = find_dissector_add_dependency("wsp-co", proto_wtp); dissector_add_uint_with_preference("udp.port", UDP_PORT_WTP_WSP, wtp_fromudp_handle); dissector_add_uint("gsm_sms_ud.udh.port", UDP_PORT_WTP_WSP, wtp_fromudp_handle); dissector_add_uint("gsm_sms.udh.port", UDP_PORT_WTP_WSP, wtp_fromudp_handle); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
C/C++
wireshark/epan/dissectors/packet-wtp.h
/* packet-wtp.h * * Declarations for disassembly of WTP component of WAP traffic. * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * WAP dissector based on original work by Ben Fowler * Updated by Neil Hunter <[email protected]> * WTLS support by Alexandre P. Ferreira (Splice IP) * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PACKET_WTP_H__ #define __PACKET_WTP_H__ /* Implementation Status: * * All fixed headers decoded for non-concatenated PDUs. * * TODO: * Support for concatenated PDUs * Support for decoding TPIs in variable header */ /* WTP PDU Types See section 9.1 (p. 40) of spec-wtp-19990611.pdf */ enum { ERRONEOUS = -0x01, NOT_ALLOWED = 0x00, INVOKE = 0x01, RESULT = 0x02, ACK = 0x03, ABORT = 0x04, SEGMENTED_INVOKE = 0x05, SEGMENTED_RESULT = 0x06, NEGATIVE_ACK = 0x07 }; enum { PROVIDER = 0x00, USER = 0x01 }; #endif /* packet-wtp.h */
C/C++
wireshark/epan/dissectors/packet-x11-keysymdef.h
/* packet-x11-keysymdef.h * Key symbol definitions for X11 (XFree86 distribution: keysymdef.h) * Copyright holders: Digital, The Open Group * (see below for their copyright statement) * * Wireshark - Network traffic analyzer * By Gerald Combs <[email protected]> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* $TOG: keysymdef.h /main/28 1998/05/22 16:18:01 kaleb $ */ /*********************************************************** Copyright 1987, 1994, 1998 The Open Group All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* $XFree86: xc/include/keysymdef.h,v 1.10 2000/10/27 18:30:46 dawes Exp $ */ #define XK_VoidSymbol 0xFFFFFF /* void symbol */ #define XK_MISCELLANY #ifdef XK_MISCELLANY /* * TTY Functions, cleverly chosen to map to ascii, for convenience of * programming, but could have been arbitrary (at the cost of lookup * tables in client code. */ #define XK_BackSpace 0xFF08 /* back space, back char */ #define XK_Tab 0xFF09 #define XK_Linefeed 0xFF0A /* Linefeed, LF */ #define XK_Clear 0xFF0B #define XK_Return 0xFF0D /* Return, enter */ #define XK_Pause 0xFF13 /* Pause, hold */ #define XK_Scroll_Lock 0xFF14 #define XK_Sys_Req 0xFF15 #define XK_Escape 0xFF1B #define XK_Delete 0xFFFF /* Delete, rubout */ /* International & multi-key character composition */ #define XK_Multi_key 0xFF20 /* Multi-key character compose */ #define XK_Codeinput 0xFF37 #define XK_SingleCandidate 0xFF3C #define XK_MultipleCandidate 0xFF3D #define XK_PreviousCandidate 0xFF3E /* Japanese keyboard support */ #define XK_Kanji 0xFF21 /* Kanji, Kanji convert */ #define XK_Muhenkan 0xFF22 /* Cancel Conversion */ #define XK_Henkan_Mode 0xFF23 /* Start/Stop Conversion */ #define XK_Henkan 0xFF23 /* Alias for Henkan_Mode */ #define XK_Romaji 0xFF24 /* to Romaji */ #define XK_Hiragana 0xFF25 /* to Hiragana */ #define XK_Katakana 0xFF26 /* to Katakana */ #define XK_Hiragana_Katakana 0xFF27 /* Hiragana/Katakana toggle */ #define XK_Zenkaku 0xFF28 /* to Zenkaku */ #define XK_Hankaku 0xFF29 /* to Hankaku */ #define XK_Zenkaku_Hankaku 0xFF2A /* Zenkaku/Hankaku toggle */ #define XK_Touroku 0xFF2B /* Add to Dictionary */ #define XK_Massyo 0xFF2C /* Delete from Dictionary */ #define XK_Kana_Lock 0xFF2D /* Kana Lock */ #define XK_Kana_Shift 0xFF2E /* Kana Shift */ #define XK_Eisu_Shift 0xFF2F /* Alphanumeric Shift */ #define XK_Eisu_toggle 0xFF30 /* Alphanumeric toggle */ #define XK_Kanji_Bangou 0xFF37 /* Codeinput */ #define XK_Zen_Koho 0xFF3D /* Multiple/All Candidate(s) */ #define XK_Mae_Koho 0xFF3E /* Previous Candidate */ /* 0xFF31 thru 0xFF3F are under XK_KOREAN */ /* Cursor control & motion */ #define XK_Home 0xFF50 #define XK_Left 0xFF51 /* Move left, left arrow */ #define XK_Up 0xFF52 /* Move up, up arrow */ #define XK_Right 0xFF53 /* Move right, right arrow */ #define XK_Down 0xFF54 /* Move down, down arrow */ #define XK_Prior 0xFF55 /* Prior, previous */ #define XK_Page_Up 0xFF55 #define XK_Next 0xFF56 /* Next */ #define XK_Page_Down 0xFF56 #define XK_End 0xFF57 /* EOL */ #define XK_Begin 0xFF58 /* BOL */ /* Misc Functions */ #define XK_Select 0xFF60 /* Select, mark */ #define XK_Print 0xFF61 #define XK_Execute 0xFF62 /* Execute, run, do */ #define XK_Insert 0xFF63 /* Insert, insert here */ #define XK_Undo 0xFF65 /* Undo, oops */ #define XK_Redo 0xFF66 /* redo, again */ #define XK_Menu 0xFF67 #define XK_Find 0xFF68 /* Find, search */ #define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */ #define XK_Help 0xFF6A /* Help */ #define XK_Break 0xFF6B #define XK_Mode_switch 0xFF7E /* Character set switch */ #define XK_script_switch 0xFF7E /* Alias for mode_switch */ #define XK_Num_Lock 0xFF7F /* Keypad Functions, keypad numbers cleverly chosen to map to ascii */ #define XK_KP_Space 0xFF80 /* space */ #define XK_KP_Tab 0xFF89 #define XK_KP_Enter 0xFF8D /* enter */ #define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */ #define XK_KP_F2 0xFF92 #define XK_KP_F3 0xFF93 #define XK_KP_F4 0xFF94 #define XK_KP_Home 0xFF95 #define XK_KP_Left 0xFF96 #define XK_KP_Up 0xFF97 #define XK_KP_Right 0xFF98 #define XK_KP_Down 0xFF99 #define XK_KP_Prior 0xFF9A #define XK_KP_Page_Up 0xFF9A #define XK_KP_Next 0xFF9B #define XK_KP_Page_Down 0xFF9B #define XK_KP_End 0xFF9C #define XK_KP_Begin 0xFF9D #define XK_KP_Insert 0xFF9E #define XK_KP_Delete 0xFF9F #define XK_KP_Equal 0xFFBD /* equals */ #define XK_KP_Multiply 0xFFAA #define XK_KP_Add 0xFFAB #define XK_KP_Separator 0xFFAC /* separator, often comma */ #define XK_KP_Subtract 0xFFAD #define XK_KP_Decimal 0xFFAE #define XK_KP_Divide 0xFFAF #define XK_KP_0 0xFFB0 #define XK_KP_1 0xFFB1 #define XK_KP_2 0xFFB2 #define XK_KP_3 0xFFB3 #define XK_KP_4 0xFFB4 #define XK_KP_5 0xFFB5 #define XK_KP_6 0xFFB6 #define XK_KP_7 0xFFB7 #define XK_KP_8 0xFFB8 #define XK_KP_9 0xFFB9 /* * Auxilliary Functions; note the duplicate definitions for left and right * function keys; Sun keyboards and a few other manufactures have such * function key groups on the left and/or right sides of the keyboard. * We've not found a keyboard with more than 35 function keys total. */ #define XK_F1 0xFFBE #define XK_F2 0xFFBF #define XK_F3 0xFFC0 #define XK_F4 0xFFC1 #define XK_F5 0xFFC2 #define XK_F6 0xFFC3 #define XK_F7 0xFFC4 #define XK_F8 0xFFC5 #define XK_F9 0xFFC6 #define XK_F10 0xFFC7 #define XK_F11 0xFFC8 #define XK_L1 0xFFC8 #define XK_F12 0xFFC9 #define XK_L2 0xFFC9 #define XK_F13 0xFFCA #define XK_L3 0xFFCA #define XK_F14 0xFFCB #define XK_L4 0xFFCB #define XK_F15 0xFFCC #define XK_L5 0xFFCC #define XK_F16 0xFFCD #define XK_L6 0xFFCD #define XK_F17 0xFFCE #define XK_L7 0xFFCE #define XK_F18 0xFFCF #define XK_L8 0xFFCF #define XK_F19 0xFFD0 #define XK_L9 0xFFD0 #define XK_F20 0xFFD1 #define XK_L10 0xFFD1 #define XK_F21 0xFFD2 #define XK_R1 0xFFD2 #define XK_F22 0xFFD3 #define XK_R2 0xFFD3 #define XK_F23 0xFFD4 #define XK_R3 0xFFD4 #define XK_F24 0xFFD5 #define XK_R4 0xFFD5 #define XK_F25 0xFFD6 #define XK_R5 0xFFD6 #define XK_F26 0xFFD7 #define XK_R6 0xFFD7 #define XK_F27 0xFFD8 #define XK_R7 0xFFD8 #define XK_F28 0xFFD9 #define XK_R8 0xFFD9 #define XK_F29 0xFFDA #define XK_R9 0xFFDA #define XK_F30 0xFFDB #define XK_R10 0xFFDB #define XK_F31 0xFFDC #define XK_R11 0xFFDC #define XK_F32 0xFFDD #define XK_R12 0xFFDD #define XK_F33 0xFFDE #define XK_R13 0xFFDE #define XK_F34 0xFFDF #define XK_R14 0xFFDF #define XK_F35 0xFFE0 #define XK_R15 0xFFE0 /* Modifiers */ #define XK_Shift_L 0xFFE1 /* Left shift */ #define XK_Shift_R 0xFFE2 /* Right shift */ #define XK_Control_L 0xFFE3 /* Left control */ #define XK_Control_R 0xFFE4 /* Right control */ #define XK_Caps_Lock 0xFFE5 /* Caps lock */ #define XK_Shift_Lock 0xFFE6 /* Shift lock */ #define XK_Meta_L 0xFFE7 /* Left meta */ #define XK_Meta_R 0xFFE8 /* Right meta */ #define XK_Alt_L 0xFFE9 /* Left alt */ #define XK_Alt_R 0xFFEA /* Right alt */ #define XK_Super_L 0xFFEB /* Left super */ #define XK_Super_R 0xFFEC /* Right super */ #define XK_Hyper_L 0xFFED /* Left hyper */ #define XK_Hyper_R 0xFFEE /* Right hyper */ #endif /* XK_MISCELLANY */ /* * ISO 9995 Function and Modifier Keys * Byte 3 = 0xFE */ #define XK_XKB_KEYS #ifdef XK_XKB_KEYS #define XK_ISO_Lock 0xFE01 #define XK_ISO_Level2_Latch 0xFE02 #define XK_ISO_Level3_Shift 0xFE03 #define XK_ISO_Level3_Latch 0xFE04 #define XK_ISO_Level3_Lock 0xFE05 #define XK_ISO_Group_Shift 0xFF7E /* Alias for mode_switch */ #define XK_ISO_Group_Latch 0xFE06 #define XK_ISO_Group_Lock 0xFE07 #define XK_ISO_Next_Group 0xFE08 #define XK_ISO_Next_Group_Lock 0xFE09 #define XK_ISO_Prev_Group 0xFE0A #define XK_ISO_Prev_Group_Lock 0xFE0B #define XK_ISO_First_Group 0xFE0C #define XK_ISO_First_Group_Lock 0xFE0D #define XK_ISO_Last_Group 0xFE0E #define XK_ISO_Last_Group_Lock 0xFE0F #define XK_ISO_Left_Tab 0xFE20 #define XK_ISO_Move_Line_Up 0xFE21 #define XK_ISO_Move_Line_Down 0xFE22 #define XK_ISO_Partial_Line_Up 0xFE23 #define XK_ISO_Partial_Line_Down 0xFE24 #define XK_ISO_Partial_Space_Left 0xFE25 #define XK_ISO_Partial_Space_Right 0xFE26 #define XK_ISO_Set_Margin_Left 0xFE27 #define XK_ISO_Set_Margin_Right 0xFE28 #define XK_ISO_Release_Margin_Left 0xFE29 #define XK_ISO_Release_Margin_Right 0xFE2A #define XK_ISO_Release_Both_Margins 0xFE2B #define XK_ISO_Fast_Cursor_Left 0xFE2C #define XK_ISO_Fast_Cursor_Right 0xFE2D #define XK_ISO_Fast_Cursor_Up 0xFE2E #define XK_ISO_Fast_Cursor_Down 0xFE2F #define XK_ISO_Continuous_Underline 0xFE30 #define XK_ISO_Discontinuous_Underline 0xFE31 #define XK_ISO_Emphasize 0xFE32 #define XK_ISO_Center_Object 0xFE33 #define XK_ISO_Enter 0xFE34 #define XK_dead_grave 0xFE50 #define XK_dead_acute 0xFE51 #define XK_dead_circumflex 0xFE52 #define XK_dead_tilde 0xFE53 #define XK_dead_macron 0xFE54 #define XK_dead_breve 0xFE55 #define XK_dead_abovedot 0xFE56 #define XK_dead_diaeresis 0xFE57 #define XK_dead_abovering 0xFE58 #define XK_dead_doubleacute 0xFE59 #define XK_dead_caron 0xFE5A #define XK_dead_cedilla 0xFE5B #define XK_dead_ogonek 0xFE5C #define XK_dead_iota 0xFE5D #define XK_dead_voiced_sound 0xFE5E #define XK_dead_semivoiced_sound 0xFE5F #define XK_dead_belowdot 0xFE60 #define XK_dead_hook 0xFE61 #define XK_dead_horn 0xFE62 #define XK_First_Virtual_Screen 0xFED0 #define XK_Prev_Virtual_Screen 0xFED1 #define XK_Next_Virtual_Screen 0xFED2 #define XK_Last_Virtual_Screen 0xFED4 #define XK_Terminate_Server 0xFED5 #define XK_AccessX_Enable 0xFE70 #define XK_AccessX_Feedback_Enable 0xFE71 #define XK_RepeatKeys_Enable 0xFE72 #define XK_SlowKeys_Enable 0xFE73 #define XK_BounceKeys_Enable 0xFE74 #define XK_StickyKeys_Enable 0xFE75 #define XK_MouseKeys_Enable 0xFE76 #define XK_MouseKeys_Accel_Enable 0xFE77 #define XK_Overlay1_Enable 0xFE78 #define XK_Overlay2_Enable 0xFE79 #define XK_AudibleBell_Enable 0xFE7A #define XK_Pointer_Left 0xFEE0 #define XK_Pointer_Right 0xFEE1 #define XK_Pointer_Up 0xFEE2 #define XK_Pointer_Down 0xFEE3 #define XK_Pointer_UpLeft 0xFEE4 #define XK_Pointer_UpRight 0xFEE5 #define XK_Pointer_DownLeft 0xFEE6 #define XK_Pointer_DownRight 0xFEE7 #define XK_Pointer_Button_Dflt 0xFEE8 #define XK_Pointer_Button1 0xFEE9 #define XK_Pointer_Button2 0xFEEA #define XK_Pointer_Button3 0xFEEB #define XK_Pointer_Button4 0xFEEC #define XK_Pointer_Button5 0xFEED #define XK_Pointer_DblClick_Dflt 0xFEEE #define XK_Pointer_DblClick1 0xFEEF #define XK_Pointer_DblClick2 0xFEF0 #define XK_Pointer_DblClick3 0xFEF1 #define XK_Pointer_DblClick4 0xFEF2 #define XK_Pointer_DblClick5 0xFEF3 #define XK_Pointer_Drag_Dflt 0xFEF4 #define XK_Pointer_Drag1 0xFEF5 #define XK_Pointer_Drag2 0xFEF6 #define XK_Pointer_Drag3 0xFEF7 #define XK_Pointer_Drag4 0xFEF8 #define XK_Pointer_Drag5 0xFEFD #define XK_Pointer_EnableKeys 0xFEF9 #define XK_Pointer_Accelerate 0xFEFA #define XK_Pointer_DfltBtnNext 0xFEFB #define XK_Pointer_DfltBtnPrev 0xFEFC #endif /* * 3270 Terminal Keys * Byte 3 = 0xFD */ #define XK_3270 #ifdef XK_3270 #define XK_3270_Duplicate 0xFD01 #define XK_3270_FieldMark 0xFD02 #define XK_3270_Right2 0xFD03 #define XK_3270_Left2 0xFD04 #define XK_3270_BackTab 0xFD05 #define XK_3270_EraseEOF 0xFD06 #define XK_3270_EraseInput 0xFD07 #define XK_3270_Reset 0xFD08 #define XK_3270_Quit 0xFD09 #define XK_3270_PA1 0xFD0A #define XK_3270_PA2 0xFD0B #define XK_3270_PA3 0xFD0C #define XK_3270_Test 0xFD0D #define XK_3270_Attn 0xFD0E #define XK_3270_CursorBlink 0xFD0F #define XK_3270_AltCursor 0xFD10 #define XK_3270_KeyClick 0xFD11 #define XK_3270_Jump 0xFD12 #define XK_3270_Ident 0xFD13 #define XK_3270_Rule 0xFD14 #define XK_3270_Copy 0xFD15 #define XK_3270_Play 0xFD16 #define XK_3270_Setup 0xFD17 #define XK_3270_Record 0xFD18 #define XK_3270_ChangeScreen 0xFD19 #define XK_3270_DeleteWord 0xFD1A #define XK_3270_ExSelect 0xFD1B #define XK_3270_CursorSelect 0xFD1C #define XK_3270_PrintScreen 0xFD1D #define XK_3270_Enter 0xFD1E #endif /* * Latin 1 * Byte 3 = 0 */ #define XK_LATIN1 #ifdef XK_LATIN1 #define XK_space 0x020 #define XK_exclam 0x021 #define XK_quotedbl 0x022 #define XK_numbersign 0x023 #define XK_dollar 0x024 #define XK_percent 0x025 #define XK_ampersand 0x026 #define XK_apostrophe 0x027 #define XK_quoteright 0x027 /* deprecated */ #define XK_parenleft 0x028 #define XK_parenright 0x029 #define XK_asterisk 0x02a #define XK_plus 0x02b #define XK_comma 0x02c #define XK_minus 0x02d #define XK_period 0x02e #define XK_slash 0x02f #define XK_0 0x030 #define XK_1 0x031 #define XK_2 0x032 #define XK_3 0x033 #define XK_4 0x034 #define XK_5 0x035 #define XK_6 0x036 #define XK_7 0x037 #define XK_8 0x038 #define XK_9 0x039 #define XK_colon 0x03a #define XK_semicolon 0x03b #define XK_less 0x03c #define XK_equal 0x03d #define XK_greater 0x03e #define XK_question 0x03f #define XK_at 0x040 #define XK_A 0x041 #define XK_B 0x042 #define XK_C 0x043 #define XK_D 0x044 #define XK_E 0x045 #define XK_F 0x046 #define XK_G 0x047 #define XK_H 0x048 #define XK_I 0x049 #define XK_J 0x04a #define XK_K 0x04b #define XK_L 0x04c #define XK_M 0x04d #define XK_N 0x04e #define XK_O 0x04f #define XK_P 0x050 #define XK_Q 0x051 #define XK_R 0x052 #define XK_S 0x053 #define XK_T 0x054 #define XK_U 0x055 #define XK_V 0x056 #define XK_W 0x057 #define XK_X 0x058 #define XK_Y 0x059 #define XK_Z 0x05a #define XK_bracketleft 0x05b #define XK_backslash 0x05c #define XK_bracketright 0x05d #define XK_asciicircum 0x05e #define XK_underscore 0x05f #define XK_grave 0x060 #define XK_quoteleft 0x060 /* deprecated */ #define XK_a 0x061 #define XK_b 0x062 #define XK_c 0x063 #define XK_d 0x064 #define XK_e 0x065 #define XK_f 0x066 #define XK_g 0x067 #define XK_h 0x068 #define XK_i 0x069 #define XK_j 0x06a #define XK_k 0x06b #define XK_l 0x06c #define XK_m 0x06d #define XK_n 0x06e #define XK_o 0x06f #define XK_p 0x070 #define XK_q 0x071 #define XK_r 0x072 #define XK_s 0x073 #define XK_t 0x074 #define XK_u 0x075 #define XK_v 0x076 #define XK_w 0x077 #define XK_x 0x078 #define XK_y 0x079 #define XK_z 0x07a #define XK_braceleft 0x07b #define XK_bar 0x07c #define XK_braceright 0x07d #define XK_asciitilde 0x07e #define XK_nobreakspace 0x0a0 #define XK_exclamdown 0x0a1 #define XK_cent 0x0a2 #define XK_sterling 0x0a3 #define XK_currency 0x0a4 #define XK_yen 0x0a5 #define XK_brokenbar 0x0a6 #define XK_section 0x0a7 #define XK_diaeresis 0x0a8 #define XK_copyright 0x0a9 #define XK_ordfeminine 0x0aa #define XK_guillemotleft 0x0ab /* left angle quotation mark */ #define XK_notsign 0x0ac #define XK_hyphen 0x0ad #define XK_registered 0x0ae #define XK_macron 0x0af #define XK_degree 0x0b0 #define XK_plusminus 0x0b1 #define XK_twosuperior 0x0b2 #define XK_threesuperior 0x0b3 #define XK_acute 0x0b4 #define XK_mu 0x0b5 #define XK_paragraph 0x0b6 #define XK_periodcentered 0x0b7 #define XK_cedilla 0x0b8 #define XK_onesuperior 0x0b9 #define XK_masculine 0x0ba #define XK_guillemotright 0x0bb /* right angle quotation mark */ #define XK_onequarter 0x0bc #define XK_onehalf 0x0bd #define XK_threequarters 0x0be #define XK_questiondown 0x0bf #define XK_Agrave 0x0c0 #define XK_Aacute 0x0c1 #define XK_Acircumflex 0x0c2 #define XK_Atilde 0x0c3 #define XK_Adiaeresis 0x0c4 #define XK_Aring 0x0c5 #define XK_AE 0x0c6 #define XK_Ccedilla 0x0c7 #define XK_Egrave 0x0c8 #define XK_Eacute 0x0c9 #define XK_Ecircumflex 0x0ca #define XK_Ediaeresis 0x0cb #define XK_Igrave 0x0cc #define XK_Iacute 0x0cd #define XK_Icircumflex 0x0ce #define XK_Idiaeresis 0x0cf #define XK_ETH 0x0d0 #define XK_Eth 0x0d0 /* deprecated */ #define XK_Ntilde 0x0d1 #define XK_Ograve 0x0d2 #define XK_Oacute 0x0d3 #define XK_Ocircumflex 0x0d4 #define XK_Otilde 0x0d5 #define XK_Odiaeresis 0x0d6 #define XK_multiply 0x0d7 #define XK_Ooblique 0x0d8 #define XK_Oslash XK_Ooblique #define XK_Ugrave 0x0d9 #define XK_Uacute 0x0da #define XK_Ucircumflex 0x0db #define XK_Udiaeresis 0x0dc #define XK_Yacute 0x0dd #define XK_THORN 0x0de #define XK_Thorn 0x0de /* deprecated */ #define XK_ssharp 0x0df #define XK_agrave 0x0e0 #define XK_aacute 0x0e1 #define XK_acircumflex 0x0e2 #define XK_atilde 0x0e3 #define XK_adiaeresis 0x0e4 #define XK_aring 0x0e5 #define XK_ae 0x0e6 #define XK_ccedilla 0x0e7 #define XK_egrave 0x0e8 #define XK_eacute 0x0e9 #define XK_ecircumflex 0x0ea #define XK_ediaeresis 0x0eb #define XK_igrave 0x0ec #define XK_iacute 0x0ed #define XK_icircumflex 0x0ee #define XK_idiaeresis 0x0ef #define XK_eth 0x0f0 #define XK_ntilde 0x0f1 #define XK_ograve 0x0f2 #define XK_oacute 0x0f3 #define XK_ocircumflex 0x0f4 #define XK_otilde 0x0f5 #define XK_odiaeresis 0x0f6 #define XK_division 0x0f7 #define XK_oslash 0x0f8 #define XK_ooblique XK_oslash #define XK_ugrave 0x0f9 #define XK_uacute 0x0fa #define XK_ucircumflex 0x0fb #define XK_udiaeresis 0x0fc #define XK_yacute 0x0fd #define XK_thorn 0x0fe #define XK_ydiaeresis 0x0ff #endif /* XK_LATIN1 */ /* * Latin 2 * Byte 3 = 1 */ #define XK_LATIN2 #ifdef XK_LATIN2 #define XK_Aogonek 0x1a1 #define XK_breve 0x1a2 #define XK_Lstroke 0x1a3 #define XK_Lcaron 0x1a5 #define XK_Sacute 0x1a6 #define XK_Scaron 0x1a9 #define XK_Scedilla 0x1aa #define XK_Tcaron 0x1ab #define XK_Zacute 0x1ac #define XK_Zcaron 0x1ae #define XK_Zabovedot 0x1af #define XK_aogonek 0x1b1 #define XK_ogonek 0x1b2 #define XK_lstroke 0x1b3 #define XK_lcaron 0x1b5 #define XK_sacute 0x1b6 #define XK_caron 0x1b7 #define XK_scaron 0x1b9 #define XK_scedilla 0x1ba #define XK_tcaron 0x1bb #define XK_zacute 0x1bc #define XK_doubleacute 0x1bd #define XK_zcaron 0x1be #define XK_zabovedot 0x1bf #define XK_Racute 0x1c0 #define XK_Abreve 0x1c3 #define XK_Lacute 0x1c5 #define XK_Cacute 0x1c6 #define XK_Ccaron 0x1c8 #define XK_Eogonek 0x1ca #define XK_Ecaron 0x1cc #define XK_Dcaron 0x1cf #define XK_Dstroke 0x1d0 #define XK_Nacute 0x1d1 #define XK_Ncaron 0x1d2 #define XK_Odoubleacute 0x1d5 #define XK_Rcaron 0x1d8 #define XK_Uring 0x1d9 #define XK_Udoubleacute 0x1db #define XK_Tcedilla 0x1de #define XK_racute 0x1e0 #define XK_abreve 0x1e3 #define XK_lacute 0x1e5 #define XK_cacute 0x1e6 #define XK_ccaron 0x1e8 #define XK_eogonek 0x1ea #define XK_ecaron 0x1ec #define XK_dcaron 0x1ef #define XK_dstroke 0x1f0 #define XK_nacute 0x1f1 #define XK_ncaron 0x1f2 #define XK_odoubleacute 0x1f5 #define XK_udoubleacute 0x1fb #define XK_rcaron 0x1f8 #define XK_uring 0x1f9 #define XK_tcedilla 0x1fe #define XK_abovedot 0x1ff #endif /* XK_LATIN2 */ /* * Latin 3 * Byte 3 = 2 */ #define XK_LATIN3 #ifdef XK_LATIN3 #define XK_Hstroke 0x2a1 #define XK_Hcircumflex 0x2a6 #define XK_Iabovedot 0x2a9 #define XK_Gbreve 0x2ab #define XK_Jcircumflex 0x2ac #define XK_hstroke 0x2b1 #define XK_hcircumflex 0x2b6 #define XK_idotless 0x2b9 #define XK_gbreve 0x2bb #define XK_jcircumflex 0x2bc #define XK_Cabovedot 0x2c5 #define XK_Ccircumflex 0x2c6 #define XK_Gabovedot 0x2d5 #define XK_Gcircumflex 0x2d8 #define XK_Ubreve 0x2dd #define XK_Scircumflex 0x2de #define XK_cabovedot 0x2e5 #define XK_ccircumflex 0x2e6 #define XK_gabovedot 0x2f5 #define XK_gcircumflex 0x2f8 #define XK_ubreve 0x2fd #define XK_scircumflex 0x2fe #endif /* XK_LATIN3 */ /* * Latin 4 * Byte 3 = 3 */ #define XK_LATIN4 #ifdef XK_LATIN4 #define XK_kra 0x3a2 #define XK_kappa 0x3a2 /* deprecated */ #define XK_Rcedilla 0x3a3 #define XK_Itilde 0x3a5 #define XK_Lcedilla 0x3a6 #define XK_Emacron 0x3aa #define XK_Gcedilla 0x3ab #define XK_Tslash 0x3ac #define XK_rcedilla 0x3b3 #define XK_itilde 0x3b5 #define XK_lcedilla 0x3b6 #define XK_emacron 0x3ba #define XK_gcedilla 0x3bb #define XK_tslash 0x3bc #define XK_ENG 0x3bd #define XK_eng 0x3bf #define XK_Amacron 0x3c0 #define XK_Iogonek 0x3c7 #define XK_Eabovedot 0x3cc #define XK_Imacron 0x3cf #define XK_Ncedilla 0x3d1 #define XK_Omacron 0x3d2 #define XK_Kcedilla 0x3d3 #define XK_Uogonek 0x3d9 #define XK_Utilde 0x3dd #define XK_Umacron 0x3de #define XK_amacron 0x3e0 #define XK_iogonek 0x3e7 #define XK_eabovedot 0x3ec #define XK_imacron 0x3ef #define XK_ncedilla 0x3f1 #define XK_omacron 0x3f2 #define XK_kcedilla 0x3f3 #define XK_uogonek 0x3f9 #define XK_utilde 0x3fd #define XK_umacron 0x3fe #endif /* XK_LATIN4 */ /* * Latin-8 * Byte 3 = 18 */ #define XK_LATIN8 #ifdef XK_LATIN8 #define XK_Babovedot 0x12a1 #define XK_babovedot 0x12a2 #define XK_Dabovedot 0x12a6 #define XK_Wgrave 0x12a8 #define XK_Wacute 0x12aa #define XK_dabovedot 0x12ab #define XK_Ygrave 0x12ac #define XK_Fabovedot 0x12b0 #define XK_fabovedot 0x12b1 #define XK_Mabovedot 0x12b4 #define XK_mabovedot 0x12b5 #define XK_Pabovedot 0x12b7 #define XK_wgrave 0x12b8 #define XK_pabovedot 0x12b9 #define XK_wacute 0x12ba #define XK_Sabovedot 0x12bb #define XK_ygrave 0x12bc #define XK_Wdiaeresis 0x12bd #define XK_wdiaeresis 0x12be #define XK_sabovedot 0x12bf #define XK_Wcircumflex 0x12d0 #define XK_Tabovedot 0x12d7 #define XK_Ycircumflex 0x12de #define XK_wcircumflex 0x12f0 #define XK_tabovedot 0x12f7 #define XK_ycircumflex 0x12fe #endif /* XK_LATIN8 */ /* * Latin-9 (a.k.a. Latin-0) * Byte 3 = 19 */ #define XK_LATIN9 #ifdef XK_LATIN9 #define XK_OE 0x13bc #define XK_oe 0x13bd #define XK_Ydiaeresis 0x13be #endif /* XK_LATIN9 */ /* * Katakana * Byte 3 = 4 */ #define XK_KATAKANA #ifdef XK_KATAKANA #define XK_overline 0x47e #define XK_kana_fullstop 0x4a1 #define XK_kana_openingbracket 0x4a2 #define XK_kana_closingbracket 0x4a3 #define XK_kana_comma 0x4a4 #define XK_kana_conjunctive 0x4a5 #define XK_kana_middledot 0x4a5 /* deprecated */ #define XK_kana_WO 0x4a6 #define XK_kana_a 0x4a7 #define XK_kana_i 0x4a8 #define XK_kana_u 0x4a9 #define XK_kana_e 0x4aa #define XK_kana_o 0x4ab #define XK_kana_ya 0x4ac #define XK_kana_yu 0x4ad #define XK_kana_yo 0x4ae #define XK_kana_tsu 0x4af #define XK_kana_tu 0x4af /* deprecated */ #define XK_prolongedsound 0x4b0 #define XK_kana_A 0x4b1 #define XK_kana_I 0x4b2 #define XK_kana_U 0x4b3 #define XK_kana_E 0x4b4 #define XK_kana_O 0x4b5 #define XK_kana_KA 0x4b6 #define XK_kana_KI 0x4b7 #define XK_kana_KU 0x4b8 #define XK_kana_KE 0x4b9 #define XK_kana_KO 0x4ba #define XK_kana_SA 0x4bb #define XK_kana_SHI 0x4bc #define XK_kana_SU 0x4bd #define XK_kana_SE 0x4be #define XK_kana_SO 0x4bf #define XK_kana_TA 0x4c0 #define XK_kana_CHI 0x4c1 #define XK_kana_TI 0x4c1 /* deprecated */ #define XK_kana_TSU 0x4c2 #define XK_kana_TU 0x4c2 /* deprecated */ #define XK_kana_TE 0x4c3 #define XK_kana_TO 0x4c4 #define XK_kana_NA 0x4c5 #define XK_kana_NI 0x4c6 #define XK_kana_NU 0x4c7 #define XK_kana_NE 0x4c8 #define XK_kana_NO 0x4c9 #define XK_kana_HA 0x4ca #define XK_kana_HI 0x4cb #define XK_kana_FU 0x4cc #define XK_kana_HU 0x4cc /* deprecated */ #define XK_kana_HE 0x4cd #define XK_kana_HO 0x4ce #define XK_kana_MA 0x4cf #define XK_kana_MI 0x4d0 #define XK_kana_MU 0x4d1 #define XK_kana_ME 0x4d2 #define XK_kana_MO 0x4d3 #define XK_kana_YA 0x4d4 #define XK_kana_YU 0x4d5 #define XK_kana_YO 0x4d6 #define XK_kana_RA 0x4d7 #define XK_kana_RI 0x4d8 #define XK_kana_RU 0x4d9 #define XK_kana_RE 0x4da #define XK_kana_RO 0x4db #define XK_kana_WA 0x4dc #define XK_kana_N 0x4dd #define XK_voicedsound 0x4de #define XK_semivoicedsound 0x4df #define XK_kana_switch 0xFF7E /* Alias for mode_switch */ #endif /* XK_KATAKANA */ /* * Arabic * Byte 3 = 5 */ #define XK_ARABIC #ifdef XK_ARABIC #define XK_Farsi_0 0x590 #define XK_Farsi_1 0x591 #define XK_Farsi_2 0x592 #define XK_Farsi_3 0x593 #define XK_Farsi_4 0x594 #define XK_Farsi_5 0x595 #define XK_Farsi_6 0x596 #define XK_Farsi_7 0x597 #define XK_Farsi_8 0x598 #define XK_Farsi_9 0x599 #define XK_Arabic_percent 0x5a5 #define XK_Arabic_superscript_alef 0x5a6 #define XK_Arabic_tteh 0x5a7 #define XK_Arabic_peh 0x5a8 #define XK_Arabic_tcheh 0x5a9 #define XK_Arabic_ddal 0x5aa #define XK_Arabic_rreh 0x5ab #define XK_Arabic_comma 0x5ac #define XK_Arabic_fullstop 0x5ae #define XK_Arabic_0 0x5b0 #define XK_Arabic_1 0x5b1 #define XK_Arabic_2 0x5b2 #define XK_Arabic_3 0x5b3 #define XK_Arabic_4 0x5b4 #define XK_Arabic_5 0x5b5 #define XK_Arabic_6 0x5b6 #define XK_Arabic_7 0x5b7 #define XK_Arabic_8 0x5b8 #define XK_Arabic_9 0x5b9 #define XK_Arabic_semicolon 0x5bb #define XK_Arabic_question_mark 0x5bf #define XK_Arabic_hamza 0x5c1 #define XK_Arabic_maddaonalef 0x5c2 #define XK_Arabic_hamzaonalef 0x5c3 #define XK_Arabic_hamzaonwaw 0x5c4 #define XK_Arabic_hamzaunderalef 0x5c5 #define XK_Arabic_hamzaonyeh 0x5c6 #define XK_Arabic_alef 0x5c7 #define XK_Arabic_beh 0x5c8 #define XK_Arabic_tehmarbuta 0x5c9 #define XK_Arabic_teh 0x5ca #define XK_Arabic_theh 0x5cb #define XK_Arabic_jeem 0x5cc #define XK_Arabic_hah 0x5cd #define XK_Arabic_khah 0x5ce #define XK_Arabic_dal 0x5cf #define XK_Arabic_thal 0x5d0 #define XK_Arabic_ra 0x5d1 #define XK_Arabic_zain 0x5d2 #define XK_Arabic_seen 0x5d3 #define XK_Arabic_sheen 0x5d4 #define XK_Arabic_sad 0x5d5 #define XK_Arabic_dad 0x5d6 #define XK_Arabic_tah 0x5d7 #define XK_Arabic_zah 0x5d8 #define XK_Arabic_ain 0x5d9 #define XK_Arabic_ghain 0x5da #define XK_Arabic_tatweel 0x5e0 #define XK_Arabic_feh 0x5e1 #define XK_Arabic_qaf 0x5e2 #define XK_Arabic_kaf 0x5e3 #define XK_Arabic_lam 0x5e4 #define XK_Arabic_meem 0x5e5 #define XK_Arabic_noon 0x5e6 #define XK_Arabic_ha 0x5e7 #define XK_Arabic_heh 0x5e7 /* deprecated */ #define XK_Arabic_waw 0x5e8 #define XK_Arabic_alefmaksura 0x5e9 #define XK_Arabic_yeh 0x5ea #define XK_Arabic_fathatan 0x5eb #define XK_Arabic_dammatan 0x5ec #define XK_Arabic_kasratan 0x5ed #define XK_Arabic_fatha 0x5ee #define XK_Arabic_damma 0x5ef #define XK_Arabic_kasra 0x5f0 #define XK_Arabic_shadda 0x5f1 #define XK_Arabic_sukun 0x5f2 #define XK_Arabic_madda_above 0x5f3 #define XK_Arabic_hamza_above 0x5f4 #define XK_Arabic_hamza_below 0x5f5 #define XK_Arabic_jeh 0x5f6 #define XK_Arabic_veh 0x5f7 #define XK_Arabic_keheh 0x5f8 #define XK_Arabic_gaf 0x5f9 #define XK_Arabic_noon_ghunna 0x5fa #define XK_Arabic_heh_doachashmee 0x5fb #define XK_Farsi_yeh 0x5fc #define XK_Arabic_farsi_yeh XK_Farsi_yeh #define XK_Arabic_yeh_baree 0x5fd #define XK_Arabic_heh_goal 0x5fe #define XK_Arabic_switch 0xFF7E /* Alias for mode_switch */ #endif /* XK_ARABIC */ /* * Cyrillic * Byte 3 = 6 */ #define XK_CYRILLIC #ifdef XK_CYRILLIC #define XK_Cyrillic_GHE_bar 0x680 #define XK_Cyrillic_ghe_bar 0x690 #define XK_Cyrillic_ZHE_descender 0x681 #define XK_Cyrillic_zhe_descender 0x691 #define XK_Cyrillic_KA_descender 0x682 #define XK_Cyrillic_ka_descender 0x692 #define XK_Cyrillic_KA_vertstroke 0x683 #define XK_Cyrillic_ka_vertstroke 0x693 #define XK_Cyrillic_EN_descender 0x684 #define XK_Cyrillic_en_descender 0x694 #define XK_Cyrillic_U_straight 0x685 #define XK_Cyrillic_u_straight 0x695 #define XK_Cyrillic_U_straight_bar 0x686 #define XK_Cyrillic_u_straight_bar 0x696 #define XK_Cyrillic_HA_descender 0x687 #define XK_Cyrillic_ha_descender 0x697 #define XK_Cyrillic_CHE_descender 0x688 #define XK_Cyrillic_che_descender 0x698 #define XK_Cyrillic_CHE_vertstroke 0x689 #define XK_Cyrillic_che_vertstroke 0x699 #define XK_Cyrillic_SHHA 0x68a #define XK_Cyrillic_shha 0x69a #define XK_Cyrillic_SCHWA 0x68c #define XK_Cyrillic_schwa 0x69c #define XK_Cyrillic_I_macron 0x68d #define XK_Cyrillic_i_macron 0x69d #define XK_Cyrillic_O_bar 0x68e #define XK_Cyrillic_o_bar 0x69e #define XK_Cyrillic_U_macron 0x68f #define XK_Cyrillic_u_macron 0x69f #define XK_Serbian_dje 0x6a1 #define XK_Macedonia_gje 0x6a2 #define XK_Cyrillic_io 0x6a3 #define XK_Ukrainian_ie 0x6a4 #define XK_Ukranian_je 0x6a4 /* deprecated */ #define XK_Macedonia_dse 0x6a5 #define XK_Ukrainian_i 0x6a6 #define XK_Ukranian_i 0x6a6 /* deprecated */ #define XK_Ukrainian_yi 0x6a7 #define XK_Ukranian_yi 0x6a7 /* deprecated */ #define XK_Cyrillic_je 0x6a8 #define XK_Serbian_je 0x6a8 /* deprecated */ #define XK_Cyrillic_lje 0x6a9 #define XK_Serbian_lje 0x6a9 /* deprecated */ #define XK_Cyrillic_nje 0x6aa #define XK_Serbian_nje 0x6aa /* deprecated */ #define XK_Serbian_tshe 0x6ab #define XK_Macedonia_kje 0x6ac #define XK_Ukrainian_ghe_with_upturn 0x6ad #define XK_Byelorussian_shortu 0x6ae #define XK_Cyrillic_dzhe 0x6af #define XK_Serbian_dze 0x6af /* deprecated */ #define XK_numerosign 0x6b0 #define XK_Serbian_DJE 0x6b1 #define XK_Macedonia_GJE 0x6b2 #define XK_Cyrillic_IO 0x6b3 #define XK_Ukrainian_IE 0x6b4 #define XK_Ukranian_JE 0x6b4 /* deprecated */ #define XK_Macedonia_DSE 0x6b5 #define XK_Ukrainian_I 0x6b6 #define XK_Ukranian_I 0x6b6 /* deprecated */ #define XK_Ukrainian_YI 0x6b7 #define XK_Ukranian_YI 0x6b7 /* deprecated */ #define XK_Cyrillic_JE 0x6b8 #define XK_Serbian_JE 0x6b8 /* deprecated */ #define XK_Cyrillic_LJE 0x6b9 #define XK_Serbian_LJE 0x6b9 /* deprecated */ #define XK_Cyrillic_NJE 0x6ba #define XK_Serbian_NJE 0x6ba /* deprecated */ #define XK_Serbian_TSHE 0x6bb #define XK_Macedonia_KJE 0x6bc #define XK_Ukrainian_GHE_WITH_UPTURN 0x6bd #define XK_Byelorussian_SHORTU 0x6be #define XK_Cyrillic_DZHE 0x6bf #define XK_Serbian_DZE 0x6bf /* deprecated */ #define XK_Cyrillic_yu 0x6c0 #define XK_Cyrillic_a 0x6c1 #define XK_Cyrillic_be 0x6c2 #define XK_Cyrillic_tse 0x6c3 #define XK_Cyrillic_de 0x6c4 #define XK_Cyrillic_ie 0x6c5 #define XK_Cyrillic_ef 0x6c6 #define XK_Cyrillic_ghe 0x6c7 #define XK_Cyrillic_ha 0x6c8 #define XK_Cyrillic_i 0x6c9 #define XK_Cyrillic_shorti 0x6ca #define XK_Cyrillic_ka 0x6cb #define XK_Cyrillic_el 0x6cc #define XK_Cyrillic_em 0x6cd #define XK_Cyrillic_en 0x6ce #define XK_Cyrillic_o 0x6cf #define XK_Cyrillic_pe 0x6d0 #define XK_Cyrillic_ya 0x6d1 #define XK_Cyrillic_er 0x6d2 #define XK_Cyrillic_es 0x6d3 #define XK_Cyrillic_te 0x6d4 #define XK_Cyrillic_u 0x6d5 #define XK_Cyrillic_zhe 0x6d6 #define XK_Cyrillic_ve 0x6d7 #define XK_Cyrillic_softsign 0x6d8 #define XK_Cyrillic_yeru 0x6d9 #define XK_Cyrillic_ze 0x6da #define XK_Cyrillic_sha 0x6db #define XK_Cyrillic_e 0x6dc #define XK_Cyrillic_shcha 0x6dd #define XK_Cyrillic_che 0x6de #define XK_Cyrillic_hardsign 0x6df #define XK_Cyrillic_YU 0x6e0 #define XK_Cyrillic_A 0x6e1 #define XK_Cyrillic_BE 0x6e2 #define XK_Cyrillic_TSE 0x6e3 #define XK_Cyrillic_DE 0x6e4 #define XK_Cyrillic_IE 0x6e5 #define XK_Cyrillic_EF 0x6e6 #define XK_Cyrillic_GHE 0x6e7 #define XK_Cyrillic_HA 0x6e8 #define XK_Cyrillic_I 0x6e9 #define XK_Cyrillic_SHORTI 0x6ea #define XK_Cyrillic_KA 0x6eb #define XK_Cyrillic_EL 0x6ec #define XK_Cyrillic_EM 0x6ed #define XK_Cyrillic_EN 0x6ee #define XK_Cyrillic_O 0x6ef #define XK_Cyrillic_PE 0x6f0 #define XK_Cyrillic_YA 0x6f1 #define XK_Cyrillic_ER 0x6f2 #define XK_Cyrillic_ES 0x6f3 #define XK_Cyrillic_TE 0x6f4 #define XK_Cyrillic_U 0x6f5 #define XK_Cyrillic_ZHE 0x6f6 #define XK_Cyrillic_VE 0x6f7 #define XK_Cyrillic_SOFTSIGN 0x6f8 #define XK_Cyrillic_YERU 0x6f9 #define XK_Cyrillic_ZE 0x6fa #define XK_Cyrillic_SHA 0x6fb #define XK_Cyrillic_E 0x6fc #define XK_Cyrillic_SHCHA 0x6fd #define XK_Cyrillic_CHE 0x6fe #define XK_Cyrillic_HARDSIGN 0x6ff #endif /* XK_CYRILLIC */ /* * Greek * Byte 3 = 7 */ #define XK_GREEK #ifdef XK_GREEK #define XK_Greek_ALPHAaccent 0x7a1 #define XK_Greek_EPSILONaccent 0x7a2 #define XK_Greek_ETAaccent 0x7a3 #define XK_Greek_IOTAaccent 0x7a4 #define XK_Greek_IOTAdieresis 0x7a5 #define XK_Greek_IOTAdiaeresis XK_Greek_IOTAdieresis /* old typo */ #define XK_Greek_OMICRONaccent 0x7a7 #define XK_Greek_UPSILONaccent 0x7a8 #define XK_Greek_UPSILONdieresis 0x7a9 #define XK_Greek_OMEGAaccent 0x7ab #define XK_Greek_accentdieresis 0x7ae #define XK_Greek_horizbar 0x7af #define XK_Greek_alphaaccent 0x7b1 #define XK_Greek_epsilonaccent 0x7b2 #define XK_Greek_etaaccent 0x7b3 #define XK_Greek_iotaaccent 0x7b4 #define XK_Greek_iotadieresis 0x7b5 #define XK_Greek_iotaaccentdieresis 0x7b6 #define XK_Greek_omicronaccent 0x7b7 #define XK_Greek_upsilonaccent 0x7b8 #define XK_Greek_upsilondieresis 0x7b9 #define XK_Greek_upsilonaccentdieresis 0x7ba #define XK_Greek_omegaaccent 0x7bb #define XK_Greek_ALPHA 0x7c1 #define XK_Greek_BETA 0x7c2 #define XK_Greek_GAMMA 0x7c3 #define XK_Greek_DELTA 0x7c4 #define XK_Greek_EPSILON 0x7c5 #define XK_Greek_ZETA 0x7c6 #define XK_Greek_ETA 0x7c7 #define XK_Greek_THETA 0x7c8 #define XK_Greek_IOTA 0x7c9 #define XK_Greek_KAPPA 0x7ca #define XK_Greek_LAMDA 0x7cb #define XK_Greek_LAMBDA 0x7cb #define XK_Greek_MU 0x7cc #define XK_Greek_NU 0x7cd #define XK_Greek_XI 0x7ce #define XK_Greek_OMICRON 0x7cf #define XK_Greek_PI 0x7d0 #define XK_Greek_RHO 0x7d1 #define XK_Greek_SIGMA 0x7d2 #define XK_Greek_TAU 0x7d4 #define XK_Greek_UPSILON 0x7d5 #define XK_Greek_PHI 0x7d6 #define XK_Greek_CHI 0x7d7 #define XK_Greek_PSI 0x7d8 #define XK_Greek_OMEGA 0x7d9 #define XK_Greek_alpha 0x7e1 #define XK_Greek_beta 0x7e2 #define XK_Greek_gamma 0x7e3 #define XK_Greek_delta 0x7e4 #define XK_Greek_epsilon 0x7e5 #define XK_Greek_zeta 0x7e6 #define XK_Greek_eta 0x7e7 #define XK_Greek_theta 0x7e8 #define XK_Greek_iota 0x7e9 #define XK_Greek_kappa 0x7ea #define XK_Greek_lamda 0x7eb #define XK_Greek_lambda 0x7eb #define XK_Greek_mu 0x7ec #define XK_Greek_nu 0x7ed #define XK_Greek_xi 0x7ee #define XK_Greek_omicron 0x7ef #define XK_Greek_pi 0x7f0 #define XK_Greek_rho 0x7f1 #define XK_Greek_sigma 0x7f2 #define XK_Greek_finalsmallsigma 0x7f3 #define XK_Greek_tau 0x7f4 #define XK_Greek_upsilon 0x7f5 #define XK_Greek_phi 0x7f6 #define XK_Greek_chi 0x7f7 #define XK_Greek_psi 0x7f8 #define XK_Greek_omega 0x7f9 #define XK_Greek_switch 0xFF7E /* Alias for mode_switch */ #endif /* XK_GREEK */ /* * Technical * Byte 3 = 8 */ #define XK_TECHNICAL #ifdef XK_TECHNICAL #define XK_leftradical 0x8a1 #define XK_topleftradical 0x8a2 #define XK_horizconnector 0x8a3 #define XK_topintegral 0x8a4 #define XK_botintegral 0x8a5 #define XK_vertconnector 0x8a6 #define XK_topleftsqbracket 0x8a7 #define XK_botleftsqbracket 0x8a8 #define XK_toprightsqbracket 0x8a9 #define XK_botrightsqbracket 0x8aa #define XK_topleftparens 0x8ab #define XK_botleftparens 0x8ac #define XK_toprightparens 0x8ad #define XK_botrightparens 0x8ae #define XK_leftmiddlecurlybrace 0x8af #define XK_rightmiddlecurlybrace 0x8b0 #define XK_topleftsummation 0x8b1 #define XK_botleftsummation 0x8b2 #define XK_topvertsummationconnector 0x8b3 #define XK_botvertsummationconnector 0x8b4 #define XK_toprightsummation 0x8b5 #define XK_botrightsummation 0x8b6 #define XK_rightmiddlesummation 0x8b7 #define XK_lessthanequal 0x8bc #define XK_notequal 0x8bd #define XK_greaterthanequal 0x8be #define XK_integral 0x8bf #define XK_therefore 0x8c0 #define XK_variation 0x8c1 #define XK_infinity 0x8c2 #define XK_nabla 0x8c5 #define XK_approximate 0x8c8 #define XK_similarequal 0x8c9 #define XK_ifonlyif 0x8cd #define XK_implies 0x8ce #define XK_identical 0x8cf #define XK_radical 0x8d6 #define XK_includedin 0x8da #define XK_includes 0x8db #define XK_intersection 0x8dc #define XK_union 0x8dd #define XK_logicaland 0x8de #define XK_logicalor 0x8df #define XK_partialderivative 0x8ef #define XK_function 0x8f6 #define XK_leftarrow 0x8fb #define XK_uparrow 0x8fc #define XK_rightarrow 0x8fd #define XK_downarrow 0x8fe #endif /* XK_TECHNICAL */ /* * Special * Byte 3 = 9 */ #define XK_SPECIAL #ifdef XK_SPECIAL #define XK_blank 0x9df #define XK_soliddiamond 0x9e0 #define XK_checkerboard 0x9e1 #define XK_ht 0x9e2 #define XK_ff 0x9e3 #define XK_cr 0x9e4 #define XK_lf 0x9e5 #define XK_nl 0x9e8 #define XK_vt 0x9e9 #define XK_lowrightcorner 0x9ea #define XK_uprightcorner 0x9eb #define XK_upleftcorner 0x9ec #define XK_lowleftcorner 0x9ed #define XK_crossinglines 0x9ee #define XK_horizlinescan1 0x9ef #define XK_horizlinescan3 0x9f0 #define XK_horizlinescan5 0x9f1 #define XK_horizlinescan7 0x9f2 #define XK_horizlinescan9 0x9f3 #define XK_leftt 0x9f4 #define XK_rightt 0x9f5 #define XK_bott 0x9f6 #define XK_topt 0x9f7 #define XK_vertbar 0x9f8 #endif /* XK_SPECIAL */ /* * Publishing * Byte 3 = a */ #define XK_PUBLISHING #ifdef XK_PUBLISHING #define XK_emspace 0xaa1 #define XK_enspace 0xaa2 #define XK_em3space 0xaa3 #define XK_em4space 0xaa4 #define XK_digitspace 0xaa5 #define XK_punctspace 0xaa6 #define XK_thinspace 0xaa7 #define XK_hairspace 0xaa8 #define XK_emdash 0xaa9 #define XK_endash 0xaaa #define XK_signifblank 0xaac #define XK_ellipsis 0xaae #define XK_doubbaselinedot 0xaaf #define XK_onethird 0xab0 #define XK_twothirds 0xab1 #define XK_onefifth 0xab2 #define XK_twofifths 0xab3 #define XK_threefifths 0xab4 #define XK_fourfifths 0xab5 #define XK_onesixth 0xab6 #define XK_fivesixths 0xab7 #define XK_careof 0xab8 #define XK_figdash 0xabb #define XK_leftanglebracket 0xabc #define XK_decimalpoint 0xabd #define XK_rightanglebracket 0xabe #define XK_marker 0xabf #define XK_oneeighth 0xac3 #define XK_threeeighths 0xac4 #define XK_fiveeighths 0xac5 #define XK_seveneighths 0xac6 #define XK_trademark 0xac9 #define XK_signaturemark 0xaca #define XK_trademarkincircle 0xacb #define XK_leftopentriangle 0xacc #define XK_rightopentriangle 0xacd #define XK_emopencircle 0xace #define XK_emopenrectangle 0xacf #define XK_leftsinglequotemark 0xad0 #define XK_rightsinglequotemark 0xad1 #define XK_leftdoublequotemark 0xad2 #define XK_rightdoublequotemark 0xad3 #define XK_prescription 0xad4 #define XK_minutes 0xad6 #define XK_seconds 0xad7 #define XK_latincross 0xad9 #define XK_hexagram 0xada #define XK_filledrectbullet 0xadb #define XK_filledlefttribullet 0xadc #define XK_filledrighttribullet 0xadd #define XK_emfilledcircle 0xade #define XK_emfilledrect 0xadf #define XK_enopencircbullet 0xae0 #define XK_enopensquarebullet 0xae1 #define XK_openrectbullet 0xae2 #define XK_opentribulletup 0xae3 #define XK_opentribulletdown 0xae4 #define XK_openstar 0xae5 #define XK_enfilledcircbullet 0xae6 #define XK_enfilledsqbullet 0xae7 #define XK_filledtribulletup 0xae8 #define XK_filledtribulletdown 0xae9 #define XK_leftpointer 0xaea #define XK_rightpointer 0xaeb #define XK_club 0xaec #define XK_diamond 0xaed #define XK_heart 0xaee #define XK_maltesecross 0xaf0 #define XK_dagger 0xaf1 #define XK_doubledagger 0xaf2 #define XK_checkmark 0xaf3 #define XK_ballotcross 0xaf4 #define XK_musicalsharp 0xaf5 #define XK_musicalflat 0xaf6 #define XK_malesymbol 0xaf7 #define XK_femalesymbol 0xaf8 #define XK_telephone 0xaf9 #define XK_telephonerecorder 0xafa #define XK_phonographcopyright 0xafb #define XK_caret 0xafc #define XK_singlelowquotemark 0xafd #define XK_doublelowquotemark 0xafe #define XK_cursor 0xaff #endif /* XK_PUBLISHING */ /* * APL * Byte 3 = b */ #define XK_APL #ifdef XK_APL #define XK_leftcaret 0xba3 #define XK_rightcaret 0xba6 #define XK_downcaret 0xba8 #define XK_upcaret 0xba9 #define XK_overbar 0xbc0 #define XK_downtack 0xbc2 #define XK_upshoe 0xbc3 #define XK_downstile 0xbc4 #define XK_underbar 0xbc6 #define XK_jot 0xbca #define XK_quad 0xbcc #define XK_uptack 0xbce #define XK_circle 0xbcf #define XK_upstile 0xbd3 #define XK_downshoe 0xbd6 #define XK_rightshoe 0xbd8 #define XK_leftshoe 0xbda #define XK_lefttack 0xbdc #define XK_righttack 0xbfc #endif /* XK_APL */ /* * Hebrew * Byte 3 = c */ #define XK_HEBREW #ifdef XK_HEBREW #define XK_hebrew_doublelowline 0xcdf #define XK_hebrew_aleph 0xce0 #define XK_hebrew_bet 0xce1 #define XK_hebrew_beth 0xce1 /* deprecated */ #define XK_hebrew_gimel 0xce2 #define XK_hebrew_gimmel 0xce2 /* deprecated */ #define XK_hebrew_dalet 0xce3 #define XK_hebrew_daleth 0xce3 /* deprecated */ #define XK_hebrew_he 0xce4 #define XK_hebrew_waw 0xce5 #define XK_hebrew_zain 0xce6 #define XK_hebrew_zayin 0xce6 /* deprecated */ #define XK_hebrew_chet 0xce7 #define XK_hebrew_het 0xce7 /* deprecated */ #define XK_hebrew_tet 0xce8 #define XK_hebrew_teth 0xce8 /* deprecated */ #define XK_hebrew_yod 0xce9 #define XK_hebrew_finalkaph 0xcea #define XK_hebrew_kaph 0xceb #define XK_hebrew_lamed 0xcec #define XK_hebrew_finalmem 0xced #define XK_hebrew_mem 0xcee #define XK_hebrew_finalnun 0xcef #define XK_hebrew_nun 0xcf0 #define XK_hebrew_samech 0xcf1 #define XK_hebrew_samekh 0xcf1 /* deprecated */ #define XK_hebrew_ayin 0xcf2 #define XK_hebrew_finalpe 0xcf3 #define XK_hebrew_pe 0xcf4 #define XK_hebrew_finalzade 0xcf5 #define XK_hebrew_finalzadi 0xcf5 /* deprecated */ #define XK_hebrew_zade 0xcf6 #define XK_hebrew_zadi 0xcf6 /* deprecated */ #define XK_hebrew_qoph 0xcf7 #define XK_hebrew_kuf 0xcf7 /* deprecated */ #define XK_hebrew_resh 0xcf8 #define XK_hebrew_shin 0xcf9 #define XK_hebrew_taw 0xcfa #define XK_hebrew_taf 0xcfa /* deprecated */ #define XK_Hebrew_switch 0xFF7E /* Alias for mode_switch */ #endif /* XK_HEBREW */ /* * Thai * Byte 3 = d */ #define XK_THAI #ifdef XK_THAI #define XK_Thai_kokai 0xda1 #define XK_Thai_khokhai 0xda2 #define XK_Thai_khokhuat 0xda3 #define XK_Thai_khokhwai 0xda4 #define XK_Thai_khokhon 0xda5 #define XK_Thai_khorakhang 0xda6 #define XK_Thai_ngongu 0xda7 #define XK_Thai_chochan 0xda8 #define XK_Thai_choching 0xda9 #define XK_Thai_chochang 0xdaa #define XK_Thai_soso 0xdab #define XK_Thai_chochoe 0xdac #define XK_Thai_yoying 0xdad #define XK_Thai_dochada 0xdae #define XK_Thai_topatak 0xdaf #define XK_Thai_thothan 0xdb0 #define XK_Thai_thonangmontho 0xdb1 #define XK_Thai_thophuthao 0xdb2 #define XK_Thai_nonen 0xdb3 #define XK_Thai_dodek 0xdb4 #define XK_Thai_totao 0xdb5 #define XK_Thai_thothung 0xdb6 #define XK_Thai_thothahan 0xdb7 #define XK_Thai_thothong 0xdb8 #define XK_Thai_nonu 0xdb9 #define XK_Thai_bobaimai 0xdba #define XK_Thai_popla 0xdbb #define XK_Thai_phophung 0xdbc #define XK_Thai_fofa 0xdbd #define XK_Thai_phophan 0xdbe #define XK_Thai_fofan 0xdbf #define XK_Thai_phosamphao 0xdc0 #define XK_Thai_moma 0xdc1 #define XK_Thai_yoyak 0xdc2 #define XK_Thai_rorua 0xdc3 #define XK_Thai_ru 0xdc4 #define XK_Thai_loling 0xdc5 #define XK_Thai_lu 0xdc6 #define XK_Thai_wowaen 0xdc7 #define XK_Thai_sosala 0xdc8 #define XK_Thai_sorusi 0xdc9 #define XK_Thai_sosua 0xdca #define XK_Thai_hohip 0xdcb #define XK_Thai_lochula 0xdcc #define XK_Thai_oang 0xdcd #define XK_Thai_honokhuk 0xdce #define XK_Thai_paiyannoi 0xdcf #define XK_Thai_saraa 0xdd0 #define XK_Thai_maihanakat 0xdd1 #define XK_Thai_saraaa 0xdd2 #define XK_Thai_saraam 0xdd3 #define XK_Thai_sarai 0xdd4 #define XK_Thai_saraii 0xdd5 #define XK_Thai_saraue 0xdd6 #define XK_Thai_sarauee 0xdd7 #define XK_Thai_sarau 0xdd8 #define XK_Thai_sarauu 0xdd9 #define XK_Thai_phinthu 0xdda #define XK_Thai_maihanakat_maitho 0xdde #define XK_Thai_baht 0xddf #define XK_Thai_sarae 0xde0 #define XK_Thai_saraae 0xde1 #define XK_Thai_sarao 0xde2 #define XK_Thai_saraaimaimuan 0xde3 #define XK_Thai_saraaimaimalai 0xde4 #define XK_Thai_lakkhangyao 0xde5 #define XK_Thai_maiyamok 0xde6 #define XK_Thai_maitaikhu 0xde7 #define XK_Thai_maiek 0xde8 #define XK_Thai_maitho 0xde9 #define XK_Thai_maitri 0xdea #define XK_Thai_maichattawa 0xdeb #define XK_Thai_thanthakhat 0xdec #define XK_Thai_nikhahit 0xded #define XK_Thai_leksun 0xdf0 #define XK_Thai_leknung 0xdf1 #define XK_Thai_leksong 0xdf2 #define XK_Thai_leksam 0xdf3 #define XK_Thai_leksi 0xdf4 #define XK_Thai_lekha 0xdf5 #define XK_Thai_lekhok 0xdf6 #define XK_Thai_lekchet 0xdf7 #define XK_Thai_lekpaet 0xdf8 #define XK_Thai_lekkao 0xdf9 #endif /* XK_THAI */ /* * Korean * Byte 3 = e */ #define XK_KOREAN #ifdef XK_KOREAN #define XK_Hangul 0xff31 /* Hangul start/stop(toggle) */ #define XK_Hangul_Start 0xff32 /* Hangul start */ #define XK_Hangul_End 0xff33 /* Hangul end, English start */ #define XK_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */ #define XK_Hangul_Jamo 0xff35 /* Hangul Jamo mode */ #define XK_Hangul_Romaja 0xff36 /* Hangul Romaja mode */ #define XK_Hangul_Codeinput 0xff37 /* Hangul code input mode */ #define XK_Hangul_Jeonja 0xff38 /* Jeonja mode */ #define XK_Hangul_Banja 0xff39 /* Banja mode */ #define XK_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */ #define XK_Hangul_PostHanja 0xff3b /* Post Hanja conversion */ #define XK_Hangul_SingleCandidate 0xff3c /* Single candidate */ #define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */ #define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */ #define XK_Hangul_Special 0xff3f /* Special symbols */ #define XK_Hangul_switch 0xFF7E /* Alias for mode_switch */ /* Hangul Consonant Characters */ #define XK_Hangul_Kiyeog 0xea1 #define XK_Hangul_SsangKiyeog 0xea2 #define XK_Hangul_KiyeogSios 0xea3 #define XK_Hangul_Nieun 0xea4 #define XK_Hangul_NieunJieuj 0xea5 #define XK_Hangul_NieunHieuh 0xea6 #define XK_Hangul_Dikeud 0xea7 #define XK_Hangul_SsangDikeud 0xea8 #define XK_Hangul_Rieul 0xea9 #define XK_Hangul_RieulKiyeog 0xeaa #define XK_Hangul_RieulMieum 0xeab #define XK_Hangul_RieulPieub 0xeac #define XK_Hangul_RieulSios 0xead #define XK_Hangul_RieulTieut 0xeae #define XK_Hangul_RieulPhieuf 0xeaf #define XK_Hangul_RieulHieuh 0xeb0 #define XK_Hangul_Mieum 0xeb1 #define XK_Hangul_Pieub 0xeb2 #define XK_Hangul_SsangPieub 0xeb3 #define XK_Hangul_PieubSios 0xeb4 #define XK_Hangul_Sios 0xeb5 #define XK_Hangul_SsangSios 0xeb6 #define XK_Hangul_Ieung 0xeb7 #define XK_Hangul_Jieuj 0xeb8 #define XK_Hangul_SsangJieuj 0xeb9 #define XK_Hangul_Cieuc 0xeba #define XK_Hangul_Khieuq 0xebb #define XK_Hangul_Tieut 0xebc #define XK_Hangul_Phieuf 0xebd #define XK_Hangul_Hieuh 0xebe /* Hangul Vowel Characters */ #define XK_Hangul_A 0xebf #define XK_Hangul_AE 0xec0 #define XK_Hangul_YA 0xec1 #define XK_Hangul_YAE 0xec2 #define XK_Hangul_EO 0xec3 #define XK_Hangul_E 0xec4 #define XK_Hangul_YEO 0xec5 #define XK_Hangul_YE 0xec6 #define XK_Hangul_O 0xec7 #define XK_Hangul_WA 0xec8 #define XK_Hangul_WAE 0xec9 #define XK_Hangul_OE 0xeca #define XK_Hangul_YO 0xecb #define XK_Hangul_U 0xecc #define XK_Hangul_WEO 0xecd #define XK_Hangul_WE 0xece #define XK_Hangul_WI 0xecf #define XK_Hangul_YU 0xed0 #define XK_Hangul_EU 0xed1 #define XK_Hangul_YI 0xed2 #define XK_Hangul_I 0xed3 /* Hangul syllable-final (JongSeong) Characters */ #define XK_Hangul_J_Kiyeog 0xed4 #define XK_Hangul_J_SsangKiyeog 0xed5 #define XK_Hangul_J_KiyeogSios 0xed6 #define XK_Hangul_J_Nieun 0xed7 #define XK_Hangul_J_NieunJieuj 0xed8 #define XK_Hangul_J_NieunHieuh 0xed9 #define XK_Hangul_J_Dikeud 0xeda #define XK_Hangul_J_Rieul 0xedb #define XK_Hangul_J_RieulKiyeog 0xedc #define XK_Hangul_J_RieulMieum 0xedd #define XK_Hangul_J_RieulPieub 0xede #define XK_Hangul_J_RieulSios 0xedf #define XK_Hangul_J_RieulTieut 0xee0 #define XK_Hangul_J_RieulPhieuf 0xee1 #define XK_Hangul_J_RieulHieuh 0xee2 #define XK_Hangul_J_Mieum 0xee3 #define XK_Hangul_J_Pieub 0xee4 #define XK_Hangul_J_PieubSios 0xee5 #define XK_Hangul_J_Sios 0xee6 #define XK_Hangul_J_SsangSios 0xee7 #define XK_Hangul_J_Ieung 0xee8 #define XK_Hangul_J_Jieuj 0xee9 #define XK_Hangul_J_Cieuc 0xeea #define XK_Hangul_J_Khieuq 0xeeb #define XK_Hangul_J_Tieut 0xeec #define XK_Hangul_J_Phieuf 0xeed #define XK_Hangul_J_Hieuh 0xeee /* Ancient Hangul Consonant Characters */ #define XK_Hangul_RieulYeorinHieuh 0xeef #define XK_Hangul_SunkyeongeumMieum 0xef0 #define XK_Hangul_SunkyeongeumPieub 0xef1 #define XK_Hangul_PanSios 0xef2 #define XK_Hangul_KkogjiDalrinIeung 0xef3 #define XK_Hangul_SunkyeongeumPhieuf 0xef4 #define XK_Hangul_YeorinHieuh 0xef5 /* Ancient Hangul Vowel Characters */ #define XK_Hangul_AraeA 0xef6 #define XK_Hangul_AraeAE 0xef7 /* Ancient Hangul syllable-final (JongSeong) Characters */ #define XK_Hangul_J_PanSios 0xef8 #define XK_Hangul_J_KkogjiDalrinIeung 0xef9 #define XK_Hangul_J_YeorinHieuh 0xefa /* Korean currency symbol */ #define XK_Korean_Won 0xeff #endif /* XK_KOREAN */ /* * Armenian * Byte 3 = 0x14 */ #define XK_ARMENIAN #ifdef XK_ARMENIAN #define XK_Armenian_eternity 0x14a1 #define XK_Armenian_ligature_ew 0x14a2 #define XK_Armenian_full_stop 0x14a3 #define XK_Armenian_verjaket 0x14a3 #define XK_Armenian_parenright 0x14a4 #define XK_Armenian_parenleft 0x14a5 #define XK_Armenian_guillemotright 0x14a6 #define XK_Armenian_guillemotleft 0x14a7 #define XK_Armenian_em_dash 0x14a8 #define XK_Armenian_dot 0x14a9 #define XK_Armenian_mijaket 0x14a9 #define XK_Armenian_separation_mark 0x14aa #define XK_Armenian_but 0x14aa #define XK_Armenian_comma 0x14ab #define XK_Armenian_en_dash 0x14ac #define XK_Armenian_hyphen 0x14ad #define XK_Armenian_yentamna 0x14ad #define XK_Armenian_ellipsis 0x14ae #define XK_Armenian_exclam 0x14af #define XK_Armenian_amanak 0x14af #define XK_Armenian_accent 0x14b0 #define XK_Armenian_shesht 0x14b0 #define XK_Armenian_question 0x14b1 #define XK_Armenian_paruyk 0x14b1 #define XK_Armenian_AYB 0x14b2 #define XK_Armenian_ayb 0x14b3 #define XK_Armenian_BEN 0x14b4 #define XK_Armenian_ben 0x14b5 #define XK_Armenian_GIM 0x14b6 #define XK_Armenian_gim 0x14b7 #define XK_Armenian_DA 0x14b8 #define XK_Armenian_da 0x14b9 #define XK_Armenian_YECH 0x14ba #define XK_Armenian_yech 0x14bb #define XK_Armenian_ZA 0x14bc #define XK_Armenian_za 0x14bd #define XK_Armenian_E 0x14be #define XK_Armenian_e 0x14bf #define XK_Armenian_AT 0x14c0 #define XK_Armenian_at 0x14c1 #define XK_Armenian_TO 0x14c2 #define XK_Armenian_to 0x14c3 #define XK_Armenian_ZHE 0x14c4 #define XK_Armenian_zhe 0x14c5 #define XK_Armenian_INI 0x14c6 #define XK_Armenian_ini 0x14c7 #define XK_Armenian_LYUN 0x14c8 #define XK_Armenian_lyun 0x14c9 #define XK_Armenian_KHE 0x14ca #define XK_Armenian_khe 0x14cb #define XK_Armenian_TSA 0x14cc #define XK_Armenian_tsa 0x14cd #define XK_Armenian_KEN 0x14ce #define XK_Armenian_ken 0x14cf #define XK_Armenian_HO 0x14d0 #define XK_Armenian_ho 0x14d1 #define XK_Armenian_DZA 0x14d2 #define XK_Armenian_dza 0x14d3 #define XK_Armenian_GHAT 0x14d4 #define XK_Armenian_ghat 0x14d5 #define XK_Armenian_TCHE 0x14d6 #define XK_Armenian_tche 0x14d7 #define XK_Armenian_MEN 0x14d8 #define XK_Armenian_men 0x14d9 #define XK_Armenian_HI 0x14da #define XK_Armenian_hi 0x14db #define XK_Armenian_NU 0x14dc #define XK_Armenian_nu 0x14dd #define XK_Armenian_SHA 0x14de #define XK_Armenian_sha 0x14df #define XK_Armenian_VO 0x14e0 #define XK_Armenian_vo 0x14e1 #define XK_Armenian_CHA 0x14e2 #define XK_Armenian_cha 0x14e3 #define XK_Armenian_PE 0x14e4 #define XK_Armenian_pe 0x14e5 #define XK_Armenian_JE 0x14e6 #define XK_Armenian_je 0x14e7 #define XK_Armenian_RA 0x14e8 #define XK_Armenian_ra 0x14e9 #define XK_Armenian_SE 0x14ea #define XK_Armenian_se 0x14eb #define XK_Armenian_VEV 0x14ec #define XK_Armenian_vev 0x14ed #define XK_Armenian_TYUN 0x14ee #define XK_Armenian_tyun 0x14ef #define XK_Armenian_RE 0x14f0 #define XK_Armenian_re 0x14f1 #define XK_Armenian_TSO 0x14f2 #define XK_Armenian_tso 0x14f3 #define XK_Armenian_VYUN 0x14f4 #define XK_Armenian_vyun 0x14f5 #define XK_Armenian_PYUR 0x14f6 #define XK_Armenian_pyur 0x14f7 #define XK_Armenian_KE 0x14f8 #define XK_Armenian_ke 0x14f9 #define XK_Armenian_O 0x14fa #define XK_Armenian_o 0x14fb #define XK_Armenian_FE 0x14fc #define XK_Armenian_fe 0x14fd #define XK_Armenian_apostrophe 0x14fe #define XK_Armenian_section_sign 0x14ff #endif /* XK_ARMENIAN */ /* * Georgian * Byte 3 = 0x15 */ #define XK_GEORGIAN #ifdef XK_GEORGIAN #define XK_Georgian_an 0x15d0 #define XK_Georgian_ban 0x15d1 #define XK_Georgian_gan 0x15d2 #define XK_Georgian_don 0x15d3 #define XK_Georgian_en 0x15d4 #define XK_Georgian_vin 0x15d5 #define XK_Georgian_zen 0x15d6 #define XK_Georgian_tan 0x15d7 #define XK_Georgian_in 0x15d8 #define XK_Georgian_kan 0x15d9 #define XK_Georgian_las 0x15da #define XK_Georgian_man 0x15db #define XK_Georgian_nar 0x15dc #define XK_Georgian_on 0x15dd #define XK_Georgian_par 0x15de #define XK_Georgian_zhar 0x15df #define XK_Georgian_rae 0x15e0 #define XK_Georgian_san 0x15e1 #define XK_Georgian_tar 0x15e2 #define XK_Georgian_un 0x15e3 #define XK_Georgian_phar 0x15e4 #define XK_Georgian_khar 0x15e5 #define XK_Georgian_ghan 0x15e6 #define XK_Georgian_qar 0x15e7 #define XK_Georgian_shin 0x15e8 #define XK_Georgian_chin 0x15e9 #define XK_Georgian_can 0x15ea #define XK_Georgian_jil 0x15eb #define XK_Georgian_cil 0x15ec #define XK_Georgian_char 0x15ed #define XK_Georgian_xan 0x15ee #define XK_Georgian_jhan 0x15ef #define XK_Georgian_hae 0x15f0 #define XK_Georgian_he 0x15f1 #define XK_Georgian_hie 0x15f2 #define XK_Georgian_we 0x15f3 #define XK_Georgian_har 0x15f4 #define XK_Georgian_hoe 0x15f5 #define XK_Georgian_fi 0x15f6 #endif /* XK_GEORGIAN */ /* * Azeri (and other Turkic or Caucasian languages of ex-USSR) * Byte 3 = 0x16 */ #define XK_CAUCASUS #ifdef XK_CAUCASUS /* latin */ #define XK_Ccedillaabovedot 0x16a2 #define XK_Xabovedot 0x16a3 #define XK_Qabovedot 0x16a5 #define XK_Ibreve 0x16a6 #define XK_IE 0x16a7 #define XK_UO 0x16a8 #define XK_Zstroke 0x16a9 #define XK_Gcaron 0x16aa #define XK_Obarred 0x16af #define XK_ccedillaabovedot 0x16b2 #define XK_xabovedot 0x16b3 #define XK_Ocaron 0x16b4 #define XK_qabovedot 0x16b5 #define XK_ibreve 0x16b6 #define XK_ie 0x16b7 #define XK_uo 0x16b8 #define XK_zstroke 0x16b9 #define XK_gcaron 0x16ba #define XK_ocaron 0x16bd #define XK_obarred 0x16bf #define XK_SCHWA 0x16c6 #define XK_schwa 0x16f6 /* those are not really Caucasus, but I put them here for now */ /* For Inupiak */ #define XK_Lbelowdot 0x16d1 #define XK_Lstrokebelowdot 0x16d2 #define XK_lbelowdot 0x16e1 #define XK_lstrokebelowdot 0x16e2 /* For Guarani */ #define XK_Gtilde 0x16d3 #define XK_gtilde 0x16e3 #endif /* XK_CAUCASUS */ /* * Vietnamese * Byte 3 = 0x1e */ #define XK_VIETNAMESE #ifdef XK_VIETNAMESE #define XK_Abelowdot 0x1ea0 #define XK_abelowdot 0x1ea1 #define XK_Ahook 0x1ea2 #define XK_ahook 0x1ea3 #define XK_Acircumflexacute 0x1ea4 #define XK_acircumflexacute 0x1ea5 #define XK_Acircumflexgrave 0x1ea6 #define XK_acircumflexgrave 0x1ea7 #define XK_Acircumflexhook 0x1ea8 #define XK_acircumflexhook 0x1ea9 #define XK_Acircumflextilde 0x1eaa #define XK_acircumflextilde 0x1eab #define XK_Acircumflexbelowdot 0x1eac #define XK_acircumflexbelowdot 0x1ead #define XK_Abreveacute 0x1eae #define XK_abreveacute 0x1eaf #define XK_Abrevegrave 0x1eb0 #define XK_abrevegrave 0x1eb1 #define XK_Abrevehook 0x1eb2 #define XK_abrevehook 0x1eb3 #define XK_Abrevetilde 0x1eb4 #define XK_abrevetilde 0x1eb5 #define XK_Abrevebelowdot 0x1eb6 #define XK_abrevebelowdot 0x1eb7 #define XK_Ebelowdot 0x1eb8 #define XK_ebelowdot 0x1eb9 #define XK_Ehook 0x1eba #define XK_ehook 0x1ebb #define XK_Etilde 0x1ebc #define XK_etilde 0x1ebd #define XK_Ecircumflexacute 0x1ebe #define XK_ecircumflexacute 0x1ebf #define XK_Ecircumflexgrave 0x1ec0 #define XK_ecircumflexgrave 0x1ec1 #define XK_Ecircumflexhook 0x1ec2 #define XK_ecircumflexhook 0x1ec3 #define XK_Ecircumflextilde 0x1ec4 #define XK_ecircumflextilde 0x1ec5 #define XK_Ecircumflexbelowdot 0x1ec6 #define XK_ecircumflexbelowdot 0x1ec7 #define XK_Ihook 0x1ec8 #define XK_ihook 0x1ec9 #define XK_Ibelowdot 0x1eca #define XK_ibelowdot 0x1ecb #define XK_Obelowdot 0x1ecc #define XK_obelowdot 0x1ecd #define XK_Ohook 0x1ece #define XK_ohook 0x1ecf #define XK_Ocircumflexacute 0x1ed0 #define XK_ocircumflexacute 0x1ed1 #define XK_Ocircumflexgrave 0x1ed2 #define XK_ocircumflexgrave 0x1ed3 #define XK_Ocircumflexhook 0x1ed4 #define XK_ocircumflexhook 0x1ed5 #define XK_Ocircumflextilde 0x1ed6 #define XK_ocircumflextilde 0x1ed7 #define XK_Ocircumflexbelowdot 0x1ed8 #define XK_ocircumflexbelowdot 0x1ed9 #define XK_Ohornacute 0x1eda #define XK_ohornacute 0x1edb #define XK_Ohorngrave 0x1edc #define XK_ohorngrave 0x1edd #define XK_Ohornhook 0x1ede #define XK_ohornhook 0x1edf #define XK_Ohorntilde 0x1ee0 #define XK_ohorntilde 0x1ee1 #define XK_Ohornbelowdot 0x1ee2 #define XK_ohornbelowdot 0x1ee3 #define XK_Ubelowdot 0x1ee4 #define XK_ubelowdot 0x1ee5 #define XK_Uhook 0x1ee6 #define XK_uhook 0x1ee7 #define XK_Uhornacute 0x1ee8 #define XK_uhornacute 0x1ee9 #define XK_Uhorngrave 0x1eea #define XK_uhorngrave 0x1eeb #define XK_Uhornhook 0x1eec #define XK_uhornhook 0x1eed #define XK_Uhorntilde 0x1eee #define XK_uhorntilde 0x1eef #define XK_Uhornbelowdot 0x1ef0 #define XK_uhornbelowdot 0x1ef1 #define XK_Ybelowdot 0x1ef4 #define XK_ybelowdot 0x1ef5 #define XK_Yhook 0x1ef6 #define XK_yhook 0x1ef7 #define XK_Ytilde 0x1ef8 #define XK_ytilde 0x1ef9 #define XK_Ohorn 0x1efa /* U+01a0 */ #define XK_ohorn 0x1efb /* U+01a1 */ #define XK_Uhorn 0x1efc /* U+01af */ #define XK_uhorn 0x1efd /* U+01b0 */ #define XK_combining_tilde 0x1e9f /* U+0303 */ #define XK_combining_grave 0x1ef2 /* U+0300 */ #define XK_combining_acute 0x1ef3 /* U+0301 */ #define XK_combining_hook 0x1efe /* U+0309 */ #define XK_combining_belowdot 0x1eff /* U+0323 */ #endif /* XK_VIETNAMESE */ #define XK_CURRENCY #ifdef XK_CURRENCY #define XK_EcuSign 0x20a0 #define XK_ColonSign 0x20a1 #define XK_CruzeiroSign 0x20a2 #define XK_FFrancSign 0x20a3 #define XK_LiraSign 0x20a4 #define XK_MillSign 0x20a5 #define XK_NairaSign 0x20a6 #define XK_PesetaSign 0x20a7 #define XK_RupeeSign 0x20a8 #define XK_WonSign 0x20a9 #define XK_NewSheqelSign 0x20aa #define XK_DongSign 0x20ab #define XK_EuroSign 0x20ac #endif