diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-11-27 16:30:20 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-11-27 16:30:20 +0000 |
commit | 04cdccdb83db2646843bb98a69775b8b37fa50fc (patch) | |
tree | a2abac419e94c4e478b3a868c422c55a8a2568a0 /epan/dissectors | |
parent | d1daa67cabddadee5e30a6e4d12245fb1dbaffbf (diff) |
- Create/use several extended value_strings
(sort associated value_string arrays as needed);
- Use new VALUE_STRING_LIST mechanism/macros to
create enums and value_string arrays for:
WERR_errors, DOS_errors, SRV_errors, and HRD_errors;
- Declare certain global value_string arrays as static (local)
and use global extended value_strings to reference same;
(e.g., ms_coiuntry_codes value_string_array)
- Rename SMBE_... defs used in several different value_string arrays
to prevent potential name collisions:
( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...)
Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors;
- WERR_errors value_string array:
Note that WERR associated defs no longer exist in the latest samba doserr.h.
(The WERR_errors defs were originally generated from the samba doserr.h).
For now: WERR_errors kept as is.
- ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext
and WERR_errors_ext extended value_strings.
- Add editor modelines to a few files.
- Make whitespace changes.
svn path=/trunk/; revision=53614
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-dcerpc-browser.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-messenger.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-netlogon.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-spoolss.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-svcctl.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-tapi.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-trksvr.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-smb-pipe.c | 31 | ||||
-rw-r--r-- | epan/dissectors/packet-smb.c | 603 | ||||
-rw-r--r-- | epan/dissectors/packet-smb.h | 222 | ||||
-rw-r--r-- | epan/dissectors/packet-smb2.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-windows-common.c | 208 | ||||
-rw-r--r-- | epan/dissectors/packet-windows-common.h | 352 |
15 files changed, 676 insertions, 798 deletions
diff --git a/epan/dissectors/packet-dcerpc-browser.c b/epan/dissectors/packet-dcerpc-browser.c index 39113d23e6..84c2b63496 100644 --- a/epan/dissectors/packet-dcerpc-browser.c +++ b/epan/dissectors/packet-dcerpc-browser.c @@ -1140,8 +1140,8 @@ static hf_register_info hf[] = { NULL, 0x0, NULL, HFILL }}, { &hf_browser_rc, { - "Return code", "rpc_browser.rc", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0x0, "Browser return code", HFILL }}, + "Return code", "rpc_browser.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0x0, "Browser return code", HFILL }}, { &hf_browser_unknown_long, { "Unknown long", "rpc_browser.unknown.long", FT_UINT32, BASE_HEX, diff --git a/epan/dissectors/packet-dcerpc-messenger.c b/epan/dissectors/packet-dcerpc-messenger.c index 27d7339a35..dc70ec55a1 100644 --- a/epan/dissectors/packet-dcerpc-messenger.c +++ b/epan/dissectors/packet-dcerpc-messenger.c @@ -106,7 +106,7 @@ proto_register_dcerpc_messenger(void) NULL, 0x0, NULL, HFILL }}, { &hf_messenger_rc, - { "Return code", "messenger.rc", FT_UINT32, BASE_HEX, VALS (NT_errors), 0x0, NULL, HFILL }}, + { "Return code", "messenger.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &NT_errors_ext, 0x0, NULL, HFILL }}, { &hf_messenger_server, { "Server", "messenger.server", diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index 4b35195d04..de0ba211d4 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -4921,7 +4921,7 @@ netlogon_dissect_netrlogoncontrol2_reply(tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_netlogon_werr_rc, &status); if (status != 0) - col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str(status, WERR_errors, "Unknown WERR error 0x%08x")); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: %s", val_to_str_ext(status, &WERR_errors_ext, "Unknown WERR error 0x%08x")); return offset; @@ -8067,16 +8067,16 @@ proto_register_dcerpc_netlogon(void) NULL, 0x0, NULL, HFILL }}, { &hf_netlogon_rc, { - "Return code", "netlogon.rc", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0x0, "Netlogon return code", HFILL }}, + "Return code", "netlogon.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0x0, "Netlogon return code", HFILL }}, { &hf_netlogon_dos_rc, { "DOS error code", "netlogon.dos.rc", FT_UINT32, - BASE_HEX, VALS(DOS_errors), 0x0, NULL, HFILL}}, + BASE_HEX | BASE_EXT_STRING, &DOS_errors_ext, 0x0, NULL, HFILL}}, { &hf_netlogon_werr_rc, { "WERR error code", "netlogon.werr.rc", FT_UINT32, - BASE_HEX, VALS(WERR_errors), 0x0, NULL, HFILL}}, + BASE_HEX | BASE_EXT_STRING, &WERR_errors_ext, 0x0, NULL, HFILL}}, { &hf_netlogon_param_ctrl, { "Param Ctrl", "netlogon.param_ctrl", FT_UINT32, BASE_HEX, @@ -8575,8 +8575,8 @@ proto_register_dcerpc_netlogon(void) NULL, 0x0, "Number of failed logins", HFILL }}, { &hf_netlogon_country, - { "Country", "netlogon.country", FT_UINT16, BASE_DEC, - VALS(ms_country_codes), 0x0, "Country setting for this account", HFILL }}, + { "Country", "netlogon.country", FT_UINT16, BASE_DEC | BASE_EXT_STRING, + &ms_country_codes_ext, 0x0, "Country setting for this account", HFILL }}, { &hf_netlogon_codepage, { "Codepage", "netlogon.codepage", FT_UINT16, BASE_DEC, diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 4074685812..1d1277b601 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -936,7 +936,7 @@ dissect_ntstatus(tvbuff_t *tvb, gint offset, packet_info *pinfo, if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", - val_to_str(status, NT_errors, + val_to_str_ext(status, &NT_errors_ext, "Unknown error 0x%08x")); if (pdata) *pdata = status; @@ -958,7 +958,7 @@ dissect_doserror(tvbuff_t *tvb, gint offset, packet_info *pinfo, if (status != 0) col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", - val_to_str(status, DOS_errors, + val_to_str_ext(status, &DOS_errors_ext, "Unknown error 0x%08x")); if (pdata) *pdata = status; diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index 0da4fc3fec..f6ecc377c8 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -7216,8 +7216,8 @@ proto_register_dcerpc_spoolss(void) NULL, 0x0, "SPOOLSS policy handle", HFILL }}, { &hf_rc, - { "Return code", "spoolss.rc", FT_UINT32, BASE_HEX, - VALS(DOS_errors), 0x0, "SPOOLSS return code", HFILL }}, + { "Return code", "spoolss.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &DOS_errors_ext, 0x0, "SPOOLSS return code", HFILL }}, { &hf_offered, { "Offered", "spoolss.offered", FT_UINT32, BASE_DEC, diff --git a/epan/dissectors/packet-dcerpc-svcctl.c b/epan/dissectors/packet-dcerpc-svcctl.c index 128caa7c3a..c94541450a 100644 --- a/epan/dissectors/packet-dcerpc-svcctl.c +++ b/epan/dissectors/packet-dcerpc-svcctl.c @@ -910,8 +910,8 @@ proto_register_dcerpc_svcctl(void) { "Lock", "svcctl.lock", FT_BYTES, BASE_NONE, NULL, 0x0, "SVCCTL Database Lock", HFILL }}, { &hf_svcctl_rc, - { "Return code", "svcctl.rc", FT_UINT32, BASE_HEX, - VALS(DOS_errors), 0x0, "SVCCTL return code", HFILL }}, + { "Return code", "svcctl.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &DOS_errors_ext, 0x0, "SVCCTL return code", HFILL }}, { &hf_svcctl_size, { "Size", "svcctl.size", FT_UINT32, BASE_DEC, NULL, 0x0, "SVCCTL size of buffer", HFILL }}, diff --git a/epan/dissectors/packet-dcerpc-tapi.c b/epan/dissectors/packet-dcerpc-tapi.c index a3840c55f0..9f48709bcf 100644 --- a/epan/dissectors/packet-dcerpc-tapi.c +++ b/epan/dissectors/packet-dcerpc-tapi.c @@ -203,8 +203,8 @@ static hf_register_info hf[] = { "Operation", "tapi.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_tapi_rc, { - "Return code", "tapi.rc", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0x0, "TAPI return code", HFILL }}, + "Return code", "tapi.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0x0, "TAPI return code", HFILL }}, { &hf_tapi_hnd, { "Context Handle", "tapi.hnd", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-dcerpc-trksvr.c b/epan/dissectors/packet-dcerpc-trksvr.c index 97aaad6a56..4bea0845db 100644 --- a/epan/dissectors/packet-dcerpc-trksvr.c +++ b/epan/dissectors/packet-dcerpc-trksvr.c @@ -70,8 +70,8 @@ static hf_register_info hf[] = { NULL, 0x0, NULL, HFILL }}, #if 0 { &hf_trksvr_rc, { - "Return code", "trksvr.rc", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0x0, "TRKSVR return code", HFILL }}, + "Return code", "trksvr.rc", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0x0, "TRKSVR return code", HFILL }}, #endif }; diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index 92ba26c0c4..f12179220a 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -2299,7 +2299,7 @@ dissect_krb5_PW_SALT(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *ac if(nt_status) { col_append_fstr(actx->pinfo->cinfo, COL_INFO, " NT Status: %s", - val_to_str(nt_status, NT_errors, + val_to_str_ext(nt_status, &NT_errors_ext, "Unknown error code %#x")); } offset += 4; @@ -5317,8 +5317,8 @@ proto_register_kerberos(void) "DlgLen", "kerberos.gssapi.dlglen", FT_UINT16, BASE_DEC, NULL, 0, "GSSAPI DlgLen", HFILL }}, { &hf_krb_smb_nt_status, { - "NT Status", "kerberos.smb.nt_status", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0, "NT Status code", HFILL }}, + "NT Status", "kerberos.smb.nt_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0, "NT Status code", HFILL }}, { &hf_krb_smb_unknown, { "Unknown", "kerberos.smb.unknown", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c index 2f6c8841c9..ca044071b0 100644 --- a/epan/dissectors/packet-smb-pipe.c +++ b/epan/dissectors/packet-smb-pipe.c @@ -210,11 +210,11 @@ static dissector_handle_t data_handle; */ static const value_string status_vals[] = { - {0, "Success"}, - {5, "User has insufficient privilege"}, - {65, "Network access is denied"}, - {86, "The specified password is invalid"}, - {SMBE_moredata, "Additional data is available"}, + { 0, "Success"}, + { 5, "User has insufficient privilege"}, + { 65, "Network access is denied"}, + { 86, "The specified password is invalid"}, + {SMBE_DOS_moredata, "Additional data is available"}, {2114, "Service is not running on the remote computer"}, {2123, "Supplied buffer is too small"}, {2141, "Server is not configured for transactions (IPC$ not shared)"}, @@ -3154,10 +3154,9 @@ proto_register_pipe_lanman(void) { "Logon Server", "lanman.logon_server", FT_STRING, BASE_NONE, NULL, 0, "LANMAN Logon Server", HFILL }}, - /* XXX - we should have a value_string table for this */ { &hf_country_code, - { "Country Code", "lanman.country_code", FT_UINT16, BASE_DEC, - VALS(ms_country_codes), 0, "LANMAN Country Code", HFILL }}, + { "Country Code", "lanman.country_code", FT_UINT16, BASE_DEC | BASE_EXT_STRING, + &ms_country_codes_ext, 0, "LANMAN Country Code", HFILL }}, { &hf_workstations, { "Workstations", "lanman.workstations", FT_STRING, BASE_NONE, @@ -3608,7 +3607,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb, if(tri == NULL) return FALSE; trans_subcmd = tri->trans_subcmd; - } + } if (tri == NULL) { /* @@ -3903,3 +3902,17 @@ proto_reg_handoff_smb_pipe(void) { data_handle = find_dissector("data"); } + + +/* + * Editor modelines - http://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: + */ diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index 77559d7334..55bce911ed 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -985,21 +985,21 @@ gboolean eosmb_take_name_as_fid = FALSE ; const gchar *tree_ip_str(packet_info *pinfo, guint16 cmd) { const gchar *buf; - if (pinfo->src.type==AT_IPv4) { - if ( cmd==SMB_COM_READ_ANDX || - cmd==SMB_COM_READ || - cmd==SMB2_COM_READ) { - buf=(gchar *)ip_to_str((const guint8 *)pinfo->src.data); + if (pinfo->src.type == AT_IPv4) { + if ( cmd == SMB_COM_READ_ANDX || + cmd == SMB_COM_READ || + cmd == SMB2_COM_READ) { + buf = (gchar *)ip_to_str((const guint8 *)pinfo->src.data); } else { - buf=(gchar *)ip_to_str((const guint8 *)pinfo->dst.data); + buf = (gchar *)ip_to_str((const guint8 *)pinfo->dst.data); } } else { - if ( cmd==SMB_COM_READ_ANDX || - cmd==SMB_COM_READ || - cmd==SMB2_COM_READ) { - buf=(gchar *)ip6_to_str((const struct e_in6_addr *)pinfo->src.data); + if ( cmd == SMB_COM_READ_ANDX || + cmd == SMB_COM_READ || + cmd == SMB2_COM_READ) { + buf = (gchar *)ip6_to_str((const struct e_in6_addr *)pinfo->src.data); } else { - buf=(gchar *)ip6_to_str((const struct e_in6_addr *)pinfo->dst.data); + buf = (gchar *)ip6_to_str((const struct e_in6_addr *)pinfo->dst.data); } } @@ -1009,8 +1009,9 @@ const gchar *tree_ip_str(packet_info *pinfo, guint16 cmd) { /* ExportObject feed function*/ static void -feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb,packet_info *pinfo,guint16 dataoffset,guint32 datalen, guint32 chunk_len, +feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb, packet_info *pinfo, guint16 dataoffset, guint32 datalen, guint32 chunk_len, guint64 file_offset, smb_info_t *si) { + smb_eo_t *eo_info; /* eo_info variable to pass info. to export object and aux */ smb_tid_info_t *tid_info = NULL; @@ -1040,26 +1041,26 @@ feed_eo_smb(guint16 cmd, guint16 fid, tvbuff_t * tvb,packet_info *pinfo,guint16 tid_info = (smb_tid_info_t *)wmem_tree_lookup32(si->ct->tid_tree, si->tid); /* Construct the eo_info structure */ - eo_info->smbversion=1; + eo_info->smbversion = 1; if (tid_info) { if (tid_info->filename) { eo_info->hostname = tid_info->filename; } else { - eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_UNKNOWN",tree_ip_str(pinfo,cmd)); + eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_UNKNOWN", tree_ip_str(pinfo, cmd)); } } - else eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_%i",tree_ip_str(pinfo,cmd),si->tid); + else eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_%i", tree_ip_str(pinfo, cmd), si->tid); if (fid_info) { eo_info->filename = NULL; if (fid_info->fsi) if (fid_info->fsi->filename) eo_info->filename = (gchar *) fid_info->fsi->filename; - if (!eo_info->filename) eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\FILEID_%i",fid); + if (!eo_info->filename) eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\FILEID_%i", fid); eo_info->fid_type = fid_info->type; eo_info->end_of_file = fid_info->end_of_file; } else { eo_info->fid_type = SMB_FID_TYPE_UNKNOWN; - eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\FILEID_%i",fid); + eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\FILEID_%i", fid); eo_info->end_of_file = 0; } if (eosmb_take_name_as_fid) { @@ -1382,7 +1383,7 @@ TimeZone(time_t t) tm = localtime(&t); if (tm == NULL) return 0; - return tm_diff(&tm_utc,tm); + return tm_diff(&tm_utc, tm); } /* @@ -1408,7 +1409,7 @@ TimeZone(time_t t) static int TimeZoneFaster(time_t t) { - static struct dst_table {time_t start,end; int zone;} *tdt; + static struct dst_table {time_t start, end; int zone;} *tdt; static struct dst_table *dst_table = NULL; static int table_size = 0; int i; @@ -1429,7 +1430,7 @@ TimeZoneFaster(time_t t) if (i < table_size) { zone = dst_table[i].zone; } else { - time_t low,high; + time_t low, high; zone = TimeZone(t); if (dst_table == NULL) @@ -1836,7 +1837,7 @@ dissect_file_ext_attr_bits(tvbuff_t *tvb, proto_tree *parent_tree, int offset, if (parent_tree) { item = proto_tree_add_uint(parent_tree, hf_smb_file_eattr, tvb, offset, len, mask); tree = proto_item_add_subtree(item, ett_smb_file_attributes); - if (len==0) + if (len == 0) PROTO_ITEM_SET_GENERATED(item); /* * XXX - Network Monitor disagrees on some of the @@ -2319,7 +2320,7 @@ dissect_negprot_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int si->sip->extra_info = dialects; } - while(bc) { + while (bc) { int len; const guint8 *str; proto_item *dit = NULL; @@ -2549,7 +2550,7 @@ dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in if (dn == NULL) goto endofcommand; proto_tree_add_string(tree, hf_smb_primary_domain, tvb, - offset, dn_len,dn); + offset, dn_len, dn); COUNT_BYTES(dn_len); break; @@ -2615,7 +2616,7 @@ dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in */ sbloblen = bc; if (sbloblen > tvb_length_remaining(tvb, offset)) { - sbloblen = tvb_length_remaining(tvb,offset); + sbloblen = tvb_length_remaining(tvb, offset); } blob_item = proto_tree_add_item( tree, hf_smb_security_blob, @@ -3366,7 +3367,7 @@ dissect_nt_create_bits(tvbuff_t *tvb, proto_tree *parent_tree, int offset, item = proto_tree_add_uint(parent_tree, hf_smb_create_flags, tvb, offset, len, mask); tree = proto_item_add_subtree(item, ett_smb_nt_create_bits); - if (len==0) + if (len == 0) PROTO_ITEM_SET_GENERATED(item); } @@ -3406,7 +3407,7 @@ dissect_smb_access_mask_bits(tvbuff_t *tvb, proto_tree *parent_tree, if (parent_tree) { item = proto_tree_add_uint(parent_tree, hf_smb_access_mask, tvb, offset, len, mask); tree = proto_item_add_subtree(item, ett_smb_nt_access_mask); - if (len==0) + if (len == 0) PROTO_ITEM_SET_GENERATED(item); /* * Some of these bits come from @@ -3488,7 +3489,7 @@ dissect_nt_share_access_bits(tvbuff_t *tvb, proto_tree *parent_tree, if (parent_tree) { item = proto_tree_add_uint(parent_tree, hf_smb_share_access, tvb, offset, len, mask); tree = proto_item_add_subtree(item, ett_smb_nt_share_access); - if (len==0) + if (len == 0) PROTO_ITEM_SET_GENERATED(item); proto_tree_add_boolean(tree, hf_smb_nt_share_access_read, @@ -3536,7 +3537,7 @@ dissect_nt_create_options_bits(tvbuff_t *tvb, proto_tree *parent_tree, if (parent_tree) { item = proto_tree_add_uint(parent_tree, hf_smb_create_options, tvb, offset, len, mask); tree = proto_item_add_subtree(item, ett_smb_nt_create_options); - if (len==0) + if (len == 0) PROTO_ITEM_SET_GENERATED(item); /* * From @@ -3732,7 +3733,7 @@ dissect_open_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, fid_info->end_of_file = 0; if (fid_info->fsi) { /* File Type */ - fattr=fid_info->fsi->file_attributes; + fattr = fid_info->fsi->file_attributes; /* XXX Volumes considered as directories */ isdir = (fattr & SMB_FILE_ATTRIBUTE_DIRECTORY) || (fattr & SMB_FILE_ATTRIBUTE_VOLUME); if (isdir == 0) { @@ -3891,7 +3892,7 @@ dissect_create_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree fid_info->end_of_file = 0; if (fid_info->fsi) { /* File Type */ - fattr=fid_info->fsi->file_attributes; + fattr = fid_info->fsi->file_attributes; /* XXX Volumes considered as directories */ isdir = (fattr & SMB_FILE_ATTRIBUTE_DIRECTORY) || (fattr & SMB_FILE_ATTRIBUTE_VOLUME); if (isdir == 0) { @@ -4420,12 +4421,12 @@ dissect_file_data_maybe_dcerpc(tvbuff_t *tvb, packet_info *pinfo, static int dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - guint16 cnt = 0, bc; - guint8 wc; - int fid = 0; - guint32 datalen=0,dataoffset=0; - guint32 tvblen; - rw_info_t *rwi = NULL; + guint16 cnt = 0, bc; + guint8 wc; + int fid = 0; + guint32 datalen = 0, dataoffset = 0; + guint32 tvblen; + rw_info_t *rwi = NULL; DISSECTOR_ASSERT(si); @@ -4451,7 +4452,7 @@ dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(tree, hf_smb_data_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); datalen = tvb_get_letohs(tvb, offset); COUNT_BYTES(2); - dataoffset=offset; + dataoffset = offset; /* file data, might be DCERPC on a pipe */ if (bc) { @@ -4484,7 +4485,7 @@ dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_READ,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); + feed_eo_smb(SMB_COM_READ, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si); } END_OF_SMB @@ -4531,12 +4532,12 @@ dissect_lock_and_read_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree static int dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree _U_, smb_info_t *si) { - guint32 ofs = 0; - guint16 cnt = 0, bc, fid = 0; - guint8 wc; - rw_info_t *rwi = NULL; - guint32 datalen=0,dataoffset=0; - guint32 tvblen; + guint32 ofs = 0; + guint16 cnt = 0, bc, fid = 0; + guint8 wc; + rw_info_t *rwi = NULL; + guint32 datalen = 0, dataoffset = 0; + guint32 tvblen; DISSECTOR_ASSERT(si); @@ -4600,7 +4601,7 @@ dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, CHECK_BYTE_COUNT(2); proto_tree_add_item(tree, hf_smb_data_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); COUNT_BYTES(2); - dataoffset=offset; + dataoffset = offset; /* file data, might be DCERPC on a pipe */ if (bc != 0) { @@ -4612,7 +4613,7 @@ dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_WRITE,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); + feed_eo_smb(SMB_COM_WRITE, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si); } END_OF_SMB @@ -5637,7 +5638,7 @@ dissect_search_find_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(tree, hf_smb_data_len, tvb, offset, 2, ENC_LITTLE_ENDIAN); COUNT_BYTES(2); - while(count--) { + while (count--) { offset = dissect_search_dir_info(tvb, pinfo, tree, offset, &bc, &trunc, has_find_id, si); if (trunc) @@ -5815,14 +5816,14 @@ dissect_locking_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree /* store the locking data for the response */ if ((!pinfo->fd->flags.visited) && si->sip) { ld = (smb_locking_saved_info_t *)wmem_alloc(wmem_file_scope(), sizeof(smb_locking_saved_info_t)); - ld->type = lt; - ld->oplock_level= ol; - ld->num_lock = num_lock; - ld->num_unlock = num_unlock; - ld->locks = NULL; - ld->unlocks = NULL; + ld->type = lt; + ld->oplock_level = ol; + ld->num_lock = num_lock; + ld->num_unlock = num_unlock; + ld->locks = NULL; + ld->unlocks = NULL; si->sip->extra_info_type = SMB_EI_LOCKDATA; - si->sip->extra_info = ld; + si->sip->extra_info = ld; } /* unlocks */ @@ -5831,7 +5832,7 @@ dissect_locking_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree it = proto_tree_add_text(tree, tvb, offset, -1, "Unlocks"); tr = proto_item_add_subtree(it, ett_smb_unlocks); - while(un--) { + while (un--) { proto_item *litem_2 = NULL; proto_tree *ltree_2 = NULL; if (lt&0x10) { @@ -5912,7 +5913,7 @@ dissect_locking_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree it = proto_tree_add_text(tree, tvb, offset, -1, "Locks"); tr = proto_item_add_subtree(it, ett_smb_locks); - while(ln--) { + while (ln--) { proto_item *litem_2 = NULL; proto_tree *ltree_2 = NULL; if (lt&0x10) { @@ -6045,7 +6046,7 @@ dissect_locking_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre lit = proto_tree_add_text(ltree, tvb, 0, 0, "Locks"); ltr = proto_item_add_subtree(lit, ett_smb_lock); li = ld->locks; - while(li) { + while (li) { proto_tree_add_uint(ltr, hf_smb_pid, tvb, 0, 0, li->pid); proto_tree_add_uint64(ltr, hf_smb_lock_long_offset, tvb, 0, 0, li->offset); proto_tree_add_uint64(ltr, hf_smb_lock_long_length, tvb, 0, 0, li->length); @@ -6054,7 +6055,7 @@ dissect_locking_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre lit = proto_tree_add_text(ltree, tvb, 0, 0, "Unlocks"); ltr = proto_item_add_subtree(lit, ett_smb_unlock); li = ld->unlocks; - while(li) { + while (li) { proto_tree_add_uint(ltr, hf_smb_pid, tvb, 0, 0, li->pid); proto_tree_add_uint64(ltr, hf_smb_lock_long_offset, tvb, 0, 0, li->offset); proto_tree_add_uint64(ltr, hf_smb_lock_long_length, tvb, 0, 0, li->length); @@ -6746,7 +6747,7 @@ dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_READ_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); + feed_eo_smb(SMB_COM_READ_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si); } END_OF_SMB @@ -6908,7 +6909,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_IPC); } if (si->sip) { - si->sip->flags|=SMB_SIF_TID_IS_IPC; + si->sip->flags |= SMB_SIF_TID_IS_IPC; } } @@ -6922,7 +6923,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* feed the export object tap listener */ tvblen = tvb_length_remaining(tvb, dataoffset); if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) { - feed_eo_smb(SMB_COM_WRITE_ANDX,fid,tvb,pinfo,dataoffset,datalen,rwi->len,rwi->offset, si); + feed_eo_smb(SMB_COM_WRITE_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si); } END_OF_SMB @@ -7187,8 +7188,8 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree * of the security blob. */ sbloblen_short = sbloblen; - if (sbloblen_short > tvb_length_remaining(tvb,offset)) { - sbloblen_short = tvb_length_remaining(tvb,offset); + if (sbloblen_short > tvb_length_remaining(tvb, offset)) { + sbloblen_short = tvb_length_remaining(tvb, offset); } blob_item = proto_tree_add_item(tree, hf_smb_security_blob, tvb, offset, sbloblen_short, @@ -7238,9 +7239,9 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree smb_uid_t *smb_uid; smb_uid = (smb_uid_t *)wmem_alloc(wmem_file_scope(), sizeof(smb_uid_t)); - smb_uid->logged_in=-1; - smb_uid->logged_out=-1; - smb_uid->domain = wmem_strdup(wmem_file_scope(), ntlmssph->domain_name); + smb_uid->logged_in = -1; + smb_uid->logged_out = -1; + smb_uid->domain = wmem_strdup(wmem_file_scope(), ntlmssph->domain_name); smb_uid->account = wmem_strdup(wmem_file_scope(), ntlmssph->acct_name); si->sip->extra_info = smb_uid; @@ -7482,8 +7483,8 @@ dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tre * short frames and then we will not see anything at all * of the security blob. */ - if (sbloblen > tvb_length_remaining(tvb,offset)) { - sbloblen = tvb_length_remaining(tvb,offset); + if (sbloblen > tvb_length_remaining(tvb, offset)) { + sbloblen = tvb_length_remaining(tvb, offset); } blob_item = proto_tree_add_item(tree, hf_smb_security_blob, tvb, offset, sbloblen, ENC_NA); @@ -7907,7 +7908,7 @@ dissect_tree_connect_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (g_hash_table_lookup(si->ct->tid_service, GUINT_TO_POINTER(si->tid))) { g_hash_table_remove(si->ct->tid_service, GUINT_TO_POINTER(si->tid)); } - if (strcmp(an,"IPC") == 0) { + if (strcmp(an, "IPC") == 0) { g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_IPC); } else { g_hash_table_insert(si->ct->tid_service, GUINT_TO_POINTER(si->tid), (void *)TID_NORMAL); @@ -7969,7 +7970,6 @@ static const value_string nt_cmd_vals[] = { {NT_TRANS_SET_USER_QUOTA, "NT SET USER QUOTA"}, {0, NULL} }; - value_string_ext nt_cmd_vals_ext = VALUE_STRING_EXT_INIT(nt_cmd_vals); static const value_string nt_ioctl_isfsctl_vals[] = { @@ -8264,6 +8264,7 @@ static const value_string device_type_vals[] = { {0x0000002c, "VDM"}, {0, NULL} }; +static value_string_ext device_type_vals_ext = VALUE_STRING_EXT_INIT(device_type_vals); static const value_string is_directory_vals[] = { {0, "This is NOT a directory"}, @@ -8570,7 +8571,7 @@ dissect_nt_user_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 *bcp) if (qsize) { offset = old_offset+qsize; } - }while(qsize); + }while (qsize); return offset; @@ -8629,10 +8630,10 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro if (nti) { switch(nti->fid_type) { case SMB_FID_TYPE_FILE: - ami= &smb_file_access_mask_info; + ami = &smb_file_access_mask_info; break; case SMB_FID_TYPE_DIR: - ami= &smb_dir_access_mask_info; + ami = &smb_dir_access_mask_info; break; } } @@ -9227,10 +9228,10 @@ dissect_nt_trans_data_response(tvbuff_t *tvb, packet_info *pinfo, if (nti) { switch(nti->fid_type) { case SMB_FID_TYPE_FILE: - ami= &smb_file_access_mask_info; + ami = &smb_file_access_mask_info; break; case SMB_FID_TYPE_DIR: - ami= &smb_dir_access_mask_info; + ami = &smb_dir_access_mask_info; break; } } @@ -9383,7 +9384,7 @@ dissect_nt_trans_param_response(tvbuff_t *tvb, packet_info *pinfo, case NT_TRANS_SSD: break; case NT_TRANS_NOTIFY: - while(len) { + while (len) { old_offset = offset; /* next entry offset */ @@ -9918,7 +9919,7 @@ dissect_get_print_queue_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree * COUNT_BYTES(2); /* queue elements */ - while(cnt--) { + while (cnt--) { offset = dissect_print_queue_element(tvb, pinfo, tree, offset, &bc, &trunc, si); if (trunc) @@ -10475,7 +10476,6 @@ static const value_string trans2_cmd_vals[] = { { 0x11, "REPORT_DFS_INCONSISTENCY" }, { 0, NULL } }; - value_string_ext trans2_cmd_vals_ext = VALUE_STRING_EXT_INIT(trans2_cmd_vals); static const true_false_string tfs_tf_dtid = { @@ -10588,6 +10588,7 @@ static const value_string qpi_loi_vals[] = { { 1037, "Query File Maximum Info"}, {0, NULL} }; +static value_string_ext qpi_loi_vals_ext = VALUE_STRING_EXT_INIT(qpi_loi_vals); /* values used by : TRANS2_SET_PATH_INFORMATION @@ -10630,6 +10631,7 @@ static const value_string spi_loi_vals[] = { { 1040, "Set OLE Information (?)"}, {0, NULL} }; +static value_string_ext spi_loi_vals_ext = VALUE_STRING_EXT_INIT(spi_loi_vals); static const value_string qfsi_vals[] = { { 1, "Info Allocation"}, @@ -10652,6 +10654,7 @@ static const value_string qfsi_vals[] = { { 1008, "Object ID Information"}, {0, NULL} }; +static value_string_ext qfsi_vals_ext = VALUE_STRING_EXT_INIT(qfsi_vals); static const value_string sfsi_vals[] = { { 0x203, "Request Transport Encryption"}, @@ -10660,8 +10663,8 @@ static const value_string sfsi_vals[] = { }; static const value_string nt_rename_vals[] = { - { 0x0103, "Create Hard Link"}, - {0, NULL} + { 0x0103, "Create Hard Link"}, + {0, NULL} }; @@ -11078,7 +11081,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo, COUNT_BYTES_TRANS(2); col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", - val_to_str(si->info_level, qfsi_vals, + val_to_str_ext(si->info_level, &qfsi_vals_ext, "Unknown (0x%02x)")); break; @@ -11107,7 +11110,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo, col_append_fstr( pinfo->cinfo, COL_INFO, ", %s", - val_to_str(si->info_level, qpi_loi_vals, + val_to_str_ext(si->info_level, &qpi_loi_vals_ext, "Unknown (%u)")); /* 4 reserved bytes */ @@ -11177,7 +11180,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo, col_append_fstr( pinfo->cinfo, COL_INFO, ", %s", - val_to_str(si->info_level, qpi_loi_vals, + val_to_str_ext(si->info_level, &qpi_loi_vals_ext, "Unknown (%u)")); break; @@ -11719,7 +11722,7 @@ dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo _U_, } ucstring_end = -1; - while(numref--) { + while (numref--) { proto_item *ri = NULL; proto_tree *rt = NULL; int old_offset_2 = offset; @@ -12480,7 +12483,7 @@ dissect_qfi_SMB_FILE_COMPRESSION_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, pro /* compression unit shift */ CHECK_BYTE_COUNT_SUBR(1); - proto_tree_add_item(tree, hf_smb_t2_compressed_unit_shift,tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tree, hf_smb_t2_compressed_unit_shift, tvb, offset, 1, ENC_LITTLE_ENDIAN); COUNT_BYTES_SUBR(1); /* compression chunk shift */ @@ -12647,7 +12650,7 @@ dissect_qspi_unix_acl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item(tree, hf_smb_posix_num_def_aces, tvb, offset, 2, ENC_LITTLE_ENDIAN); COUNT_BYTES_SUBR(2); - while(num_file_aces--) { + while (num_file_aces--) { proto_item *it; proto_tree *tr; int old_offset = offset; @@ -13498,7 +13501,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, /* security blob */ blob_item = proto_tree_add_item(tree, hf_smb_security_blob, tvb, offset, - tvb_length_remaining(tvb,offset), + tvb_length_remaining(tvb, offset), ENC_NA); /* As an optimization, because Windows is perverse, @@ -13520,7 +13523,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree); } - offset += tvb_length_remaining(tvb,offset); + offset += tvb_length_remaining(tvb, offset); *bcp = 0; break; } @@ -13551,7 +13554,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, /* security blob */ blob_item = proto_tree_add_item(tree, hf_smb_security_blob, tvb, offset, - tvb_length_remaining(tvb,offset), + tvb_length_remaining(tvb, offset), ENC_NA); /* As an optimization, because Windows is perverse, @@ -13573,7 +13576,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree); } - offset += tvb_length_remaining(tvb,offset); + offset += tvb_length_remaining(tvb, offset); *bcp = 0; break; } @@ -14492,7 +14495,7 @@ dissect_4_3_4_3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, COUNT_BYTES_SUBR(4); /* The EAs ... they are formatted as in MS-CIFS 2.2.1.2.2 */ - proto_tree_add_bytes_format(tree, hf_smb_file_data, tvb, offset, ea_size, NULL,"EAs"); + proto_tree_add_bytes_format(tree, hf_smb_file_data, tvb, offset, ea_size, NULL, "EAs"); COUNT_BYTES_SUBR(ea_size); *bcp -= ea_size; @@ -16088,7 +16091,7 @@ dissect_transaction2_response_data(tvbuff_t *tvb, packet_info *pinfo, ", Files:"); } - while(count--) { + while (count--) { offset = dissect_ff2_response_data(tvb, pinfo, tree, offset, &dc, &trunc, si); if (trunc) @@ -16107,7 +16110,7 @@ dissect_transaction2_response_data(tvbuff_t *tvb, packet_info *pinfo, ", Files:"); } - while(count--) { + while (count--) { offset = dissect_ff2_response_data(tvb, pinfo, tree, offset, &dc, &trunc, si); if (trunc) @@ -16661,7 +16664,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree */ save_fragmented = pinfo->fragmented; /* do we need reassembly? */ - if ( (td!=dc) || (tp!=pc) ) { + if ( (td != dc) || (tp != pc) ) { /* oh yeah, either data or parameter section needs reassembly */ @@ -16709,13 +16712,13 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree if ( (pd == 0) && (dd == 0) ) { int min; int reported_min; - min = MIN(pc,tvb_length_remaining(tvb,po)); - reported_min = MIN(pc,tvb_reported_length_remaining(tvb,po)); + min = MIN(pc, tvb_length_remaining(tvb, po)); + reported_min = MIN(pc, tvb_reported_length_remaining(tvb, po)); if (min && reported_min) { p_tvb = tvb_new_subset(tvb, po, min, reported_min); } - min = MIN(dc,tvb_length_remaining(tvb,od)); - reported_min = MIN(dc,tvb_reported_length_remaining(tvb,od)); + min = MIN(dc, tvb_length_remaining(tvb, od)); + reported_min = MIN(dc, tvb_reported_length_remaining(tvb, od)); if (min && reported_min) { d_tvb = tvb_new_subset(tvb, od, min, reported_min); } @@ -17176,7 +17179,7 @@ dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *s DISSECTOR_ASSERT(si); - if (cmd!=0xff) { + if (cmd != 0xff) { proto_item *cmd_item; proto_tree *cmd_tree; int (*dissector)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, proto_tree *smb_tree, smb_info_t *si); @@ -17212,8 +17215,8 @@ dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *s } } - dissector = (si->request)? - smb_dissector[cmd].request:smb_dissector[cmd].response; + dissector = (si->request) ? + smb_dissector[cmd].request : smb_dissector[cmd].response; offset = (*dissector)(tvb, pinfo, cmd_tree, offset, smb_tree, si); @@ -17226,125 +17229,124 @@ dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *s } static const value_string smb_cmd_vals[] = { - { 0x00, "Create Directory" }, - { 0x01, "Delete Directory" }, - { 0x02, "Open" }, - { 0x03, "Create" }, - { 0x04, "Close" }, - { 0x05, "Flush" }, - { 0x06, "Delete" }, - { 0x07, "Rename" }, - { 0x08, "Query Information" }, - { 0x09, "Set Information" }, - { 0x0A, "Read" }, - { 0x0B, "Write" }, - { 0x0C, "Lock Byte Range" }, - { 0x0D, "Unlock Byte Range" }, - { 0x0E, "Create Temp" }, - { 0x0F, "Create New" }, - { 0x10, "Check Directory" }, - { 0x11, "Process Exit" }, - { 0x12, "Seek" }, - { 0x13, "Lock And Read" }, - { 0x14, "Write And Unlock" }, - { 0x15, "unknown-0x15" }, - { 0x16, "unknown-0x16" }, - { 0x17, "unknown-0x17" }, - { 0x18, "unknown-0x18" }, - { 0x19, "unknown-0x19" }, - { 0x1A, "Read Raw" }, - { 0x1B, "Read MPX" }, - { 0x1C, "Read MPX Secondary" }, - { 0x1D, "Write Raw" }, - { 0x1E, "Write MPX" }, - { 0x1F, "Write MPX Secondary" }, - { 0x20, "Write Complete" }, - - /* - * To quote - * - * http://msdn.microsoft.com/en-us/library/ee442098.aspx - * - * "This command was introduced in the NT LAN Manager dialect, and - * was reserved but not implemented. - * - * Clients SHOULD NOT send requests using this command code, and - * servers receiving requests with this command code SHOULD return - * STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc)." - */ - { 0x21, "Query Server (reserved)" }, - - { 0x22, "Set Information2" }, - { 0x23, "Query Information2" }, - { 0x24, "Locking AndX" }, - { 0x25, "Trans" }, - { 0x26, "Trans Secondary" }, - { 0x27, "IOCTL" }, - { 0x28, "IOCTL Secondary" }, - { 0x29, "Copy" }, - { 0x2A, "Move" }, - { 0x2B, "Echo" }, - { 0x2C, "Write And Close" }, - { 0x2D, "Open AndX" }, - { 0x2E, "Read AndX" }, - { 0x2F, "Write AndX" }, - - /* - * To quote - * - * http://msdn.microsoft.com/en-us/library/ee442127.aspx - * - * "This command was reserved but not implemented. It was also never - * defined. It is listed in [SNIA], but it is not defined in that - * document and does not appear in any other references. - * - * Clients SHOULD NOT send requests using this command code, and - * servers receiving requests with this command code SHOULD return - * STATUS_NOT_IMPLEMENTED (ERRDOC/ERRbadfunc)." - */ - { 0x30, "New File Size (reserved)" }, - - { 0x31, "Close And Tree Disconnect" }, - { 0x32, "Trans2" }, - { 0x33, "Trans2 Secondary" }, - { 0x34, "Find Close2" }, - { 0x35, "Find Notify Close" }, - { 0x70, "Tree Connect" }, - { 0x71, "Tree Disconnect" }, - { 0x72, "Negotiate Protocol" }, - { 0x73, "Session Setup AndX" }, - { 0x74, "Logoff AndX" }, - { 0x75, "Tree Connect AndX" }, - { 0x80, "Query Information Disk" }, - { 0x81, "Search" }, - { 0x82, "Find" }, - { 0x83, "Find Unique" }, - { 0x84, "Find Close" }, - { 0xA0, "NT Trans" }, - { 0xA1, "NT Trans Secondary" }, - { 0xA2, "NT Create AndX" }, - { 0xA3, "unknown-0xA3" }, - { 0xA4, "NT Cancel" }, - { 0xA5, "NT Rename" }, - { 0xC0, "Open Print File" }, - { 0xC1, "Write Print File" }, - { 0xC2, "Close Print File" }, - { 0xC3, "Get Print Queue" }, - { 0xD0, "Send Single Block Message" }, - { 0xD1, "Send Broadcast Message" }, - { 0xD2, "Forward User Name" }, - { 0xD3, "Cancel Forward" }, - { 0xD4, "Get Machine Name" }, - { 0xD5, "Send Start of Multi-block Message" }, - { 0xD6, "Send End of Multi-block Message" }, - { 0xD7, "Send Text of Multi-block Message" }, - { 0xD8, "SMBreadbulk" }, - { 0xD9, "SMBwritebulk" }, - { 0xDA, "SMBwritebulkdata" }, - { 0xFE, "SMBinvalid" }, - { 0x00, NULL }, -}; + { 0x00, "Create Directory" }, + { 0x01, "Delete Directory" }, + { 0x02, "Open" }, + { 0x03, "Create" }, + { 0x04, "Close" }, + { 0x05, "Flush" }, + { 0x06, "Delete" }, + { 0x07, "Rename" }, + { 0x08, "Query Information" }, + { 0x09, "Set Information" }, + { 0x0A, "Read" }, + { 0x0B, "Write" }, + { 0x0C, "Lock Byte Range" }, + { 0x0D, "Unlock Byte Range" }, + { 0x0E, "Create Temp" }, + { 0x0F, "Create New" }, + { 0x10, "Check Directory" }, + { 0x11, "Process Exit" }, + { 0x12, "Seek" }, + { 0x13, "Lock And Read" }, + { 0x14, "Write And Unlock" }, + { 0x15, "unknown-0x15" }, + { 0x16, "unknown-0x16" }, + { 0x17, "unknown-0x17" }, + { 0x18, "unknown-0x18" }, + { 0x19, "unknown-0x19" }, + { 0x1A, "Read Raw" }, + { 0x1B, "Read MPX" }, + { 0x1C, "Read MPX Secondary" }, + { 0x1D, "Write Raw" }, + { 0x1E, "Write MPX" }, + { 0x1F, "Write MPX Secondary" }, + { 0x20, "Write Complete" }, + /* + * To quote + * + * http://msdn.microsoft.com/en-us/library/ee442098.aspx + * + * "This command was introduced in the NT LAN Manager dialect, and + * was reserved but not implemented. + * + * Clients SHOULD NOT send requests using this command code, and + * servers receiving requests with this command code SHOULD return + * STATUS_NOT_IMPLEMENTED (ERRDOS/ERRbadfunc)." + */ + { 0x21, "Query Server (reserved)" }, + + { 0x22, "Set Information2" }, + { 0x23, "Query Information2" }, + { 0x24, "Locking AndX" }, + { 0x25, "Trans" }, + { 0x26, "Trans Secondary" }, + { 0x27, "IOCTL" }, + { 0x28, "IOCTL Secondary" }, + { 0x29, "Copy" }, + { 0x2A, "Move" }, + { 0x2B, "Echo" }, + { 0x2C, "Write And Close" }, + { 0x2D, "Open AndX" }, + { 0x2E, "Read AndX" }, + { 0x2F, "Write AndX" }, + + /* + * To quote + * + * http://msdn.microsoft.com/en-us/library/ee442127.aspx + * + * "This command was reserved but not implemented. It was also never + * defined. It is listed in [SNIA], but it is not defined in that + * document and does not appear in any other references. + * + * Clients SHOULD NOT send requests using this command code, and + * servers receiving requests with this command code SHOULD return + * STATUS_NOT_IMPLEMENTED (ERRDOC/ERRbadfunc)." + */ + { 0x30, "New File Size (reserved)" }, + + { 0x31, "Close And Tree Disconnect" }, + { 0x32, "Trans2" }, + { 0x33, "Trans2 Secondary" }, + { 0x34, "Find Close2" }, + { 0x35, "Find Notify Close" }, + { 0x70, "Tree Connect" }, + { 0x71, "Tree Disconnect" }, + { 0x72, "Negotiate Protocol" }, + { 0x73, "Session Setup AndX" }, + { 0x74, "Logoff AndX" }, + { 0x75, "Tree Connect AndX" }, + { 0x80, "Query Information Disk" }, + { 0x81, "Search" }, + { 0x82, "Find" }, + { 0x83, "Find Unique" }, + { 0x84, "Find Close" }, + { 0xA0, "NT Trans" }, + { 0xA1, "NT Trans Secondary" }, + { 0xA2, "NT Create AndX" }, + { 0xA3, "unknown-0xA3" }, + { 0xA4, "NT Cancel" }, + { 0xA5, "NT Rename" }, + { 0xC0, "Open Print File" }, + { 0xC1, "Write Print File" }, + { 0xC2, "Close Print File" }, + { 0xC3, "Get Print Queue" }, + { 0xD0, "Send Single Block Message" }, + { 0xD1, "Send Broadcast Message" }, + { 0xD2, "Forward User Name" }, + { 0xD3, "Cancel Forward" }, + { 0xD4, "Get Machine Name" }, + { 0xD5, "Send Start of Multi-block Message" }, + { 0xD6, "Send End of Multi-block Message" }, + { 0xD7, "Send Text of Multi-block Message" }, + { 0xD8, "SMBreadbulk" }, + { 0xD9, "SMBwritebulk" }, + { 0xDA, "SMBwritebulkdata" }, + { 0xFE, "SMBinvalid" }, + { 0x00, NULL }, +}; value_string_ext smb_cmd_vals_ext = VALUE_STRING_EXT_INIT(smb_cmd_vals); @@ -17392,66 +17394,77 @@ static const value_string errcls_types[] = { /* Error codes for the ERRSRV class */ -static const value_string SRV_errors[] = { - {SMBE_error, "Non specific error code"}, - {SMBE_badpw, "Bad password"}, - {SMBE_badtype, "Reserved"}, - {SMBE_access, "No permissions to perform the requested operation"}, - {SMBE_invnid, "TID invalid"}, - {SMBE_invnetname, "Invalid network name. Service not found"}, - {SMBE_invdevice, "Invalid device"}, - {SMBE_unknownsmb, "Unknown SMB, from NT 3.5 response"}, - {SMBE_qfull, "Print queue full"}, - {SMBE_qtoobig, "Queued item too big"}, - {SMBE_qeof, "EOF on print queue dump"}, - {SMBE_invpfid, "Invalid print file in smb_fid"}, - {SMBE_smbcmd, "Unrecognised command"}, - {SMBE_srverror, "SMB server internal error"}, - {SMBE_filespecs, "Fid and pathname invalid combination"}, - {SMBE_badlink, "Bad link in request ???"}, - {SMBE_badpermits, "Access specified for a file is not valid"}, - {SMBE_badpid, "Bad process id in request"}, - {SMBE_setattrmode, "Attribute mode invalid"}, - {SMBE_paused, "Message server paused"}, - {SMBE_msgoff, "Not receiving messages"}, - {SMBE_noroom, "No room for message"}, - {SMBE_rmuns, "Too many remote usernames"}, - {SMBE_timeout, "Operation timed out"}, - {SMBE_noresource, "No resources currently available for request."}, - {SMBE_toomanyuids, "Too many userids"}, - {SMBE_baduid, "Bad userid"}, - {SMBE_useMPX, "Temporarily unable to use raw mode, use MPX mode"}, - {SMBE_useSTD, "Temporarily unable to use raw mode, use standard mode"}, - {SMBE_contMPX, "Resume MPX mode"}, - {SMBE_badPW, "Bad Password???"}, - {SMBE_nosupport, "Operation not supported"}, - { 0, NULL} -}; +#define SRV_errors_VALUE_STRING_LIST(XXX) \ + XXX( SMBE_SRV_error, 1, "Non specific error code") \ + XXX( SMBE_SRV_badpw, 2, "Bad password") \ + XXX( SMBE_SRV_badtype, 3, "Reserved") \ + XXX( SMBE_SRV_access, 4, "No permissions to perform the requested operation") \ + XXX( SMBE_SRV_invnid, 5, "TID invalid") \ + XXX( SMBE_SRV_invnetname, 6, "Invalid network name. Service not found") \ + XXX( SMBE_SRV_invdevice, 7, "Invalid device") \ + XXX( SMBE_SRV_unknownsmb, 22, "Unknown SMB, from NT 3.5 response") \ + XXX( SMBE_SRV_qfull, 49, "Print queue full") \ + XXX( SMBE_SRV_qtoobig, 50, "Queued item too big") \ + XXX( SMBE_SRV_qeof, 51, "EOF in print queue dump") \ + XXX( SMBE_SRV_invpfid, 52, "Invalid print file in smb_fid") \ + XXX( SMBE_SRV_smbcmd, 64, "Unrecognised command") \ + XXX( SMBE_SRV_srverror, 65, "SMB server internal error") \ + XXX( SMBE_SRV_filespecs, 67, "Fid and pathname invalid combination") \ + XXX( SMBE_SRV_badlink, 68, "Bad link in request ???") \ + XXX( SMBE_SRV_badpermits, 69, "Access specified for a file is not valid") \ + XXX( SMBE_SRV_badpid, 70, "Bad process id in request") \ + XXX( SMBE_SRV_setattrmode, 71, "Attribute mode invalid") \ + XXX( SMBE_SRV_paused, 81, "Message server paused") \ + XXX( SMBE_SRV_msgoff, 82, "Not receiving messages") \ + XXX( SMBE_SRV_noroom, 83, "No room for message") \ + XXX( SMBE_SRV_rmuns, 87, "Too many remote usernames") \ + XXX( SMBE_SRV_timeout, 88, "Operation timed out") \ + XXX( SMBE_SRV_noresource, 89, "No resources currently available for request.") \ + XXX( SMBE_SRV_toomanyuids, 90, "Too many userids") \ + XXX( SMBE_SRV_baduid, 91, "Bad userid") \ + XXX( SMBE_SRV_useMPX, 250, "Temporarily unable to use raw mode, use MPX mode") \ + XXX( SMBE_SRV_useSTD, 251, "Temporarily unable to use raw mode, use standard mode") \ + XXX( SMBE_SRV_contMPX, 252, "Resume MPX mode") \ + XXX( SMBE_SRV_badPW, 253, "Bad Password???") \ + XXX( SMBE_SRV_nosupport, 0xFFFF, "Operation not supported") + +#if 0 /* Values not needed */ +VALUE_STRING_ENUM(SRV_errors); +#endif +VALUE_STRING_ARRAY(SRV_errors); +static value_string_ext SRV_errors_ext = VALUE_STRING_EXT_INIT(SRV_errors); + /* Error codes for the ERRHRD class */ -static const value_string HRD_errors[] = { - {SMBE_nowrite, "Read only media"}, - {SMBE_badunit, "Unknown device"}, - {SMBE_notready, "Drive not ready"}, - {SMBE_badcmd, "Unknown command"}, - {SMBE_data, "Data (CRC) error"}, - {SMBE_badreq, "Bad request structure length"}, - {SMBE_seek, "Seek error"}, - {SMBE_badmedia, "Unknown media type"}, - {SMBE_badsector, "Sector not found"}, - {SMBE_nopaper, "Printer out of paper"}, - {SMBE_write, "Write fault"}, - {SMBE_read, "Read fault"}, - {SMBE_general, "General failure"}, - {SMBE_badshare, "A open conflicts with an existing open"}, - {SMBE_lock, "Lock conflict/invalid mode, or unlock of another process's lock"}, - {SMBE_wrongdisk, "The wrong disk was found in a drive"}, - {SMBE_FCBunavail, "No FCBs are available to process request"}, - {SMBE_sharebufexc, "A sharing buffer has been exceeded"}, - {SMBE_diskfull, "Disk full???"}, - {0, NULL} -}; +#define HRD_errors_VALUE_STRING_LIST(XXX) \ + XXX( SMBE_HRD_nowrite, 19, "Read only media") \ + XXX( SMBE_HRD_badunit, 20, "Unknown device") \ + XXX( SMBE_HRD_notready, 21, "Drive not ready") \ + XXX( SMBE_HRD_badcmd, 22, "Unknown command") \ + XXX( SMBE_HRD_data, 23, "Data (CRC) error") \ + XXX( SMBE_HRD_badreq, 24, "Bad request structure length") \ + XXX( SMBE_HRD_seek, 25, "Seek error") \ + XXX( SMBE_HRD_badmedia, 26, "Unknown media type") \ + XXX( SMBE_HRD_badsector, 27, "Sector not found") \ + XXX( SMBE_HRD_nopaper, 28, "Printer out of paper") \ + XXX( SMBE_HRD_write, 29, "Write fault") \ + XXX( SMBE_HRD_read, 30, "Read fault") \ + XXX( SMBE_HRD_general, 31, "General failure") \ +/* -- (really part of ERRDOS class ??) -- */ \ + XXX( SMBE_HRD_badshare, 32, "An open conflicts with an existing open") \ + XXX( SMBE_HRD_lock, 33, "Lock conflict/invalid mode, or unlock of another process's lock") \ +/* -- --*/ \ + XXX( SMBE_HRD_wrongdisk, 34, "The wrong disk was found in a drive") \ + XXX( SMBE_HRD_FCBunavail, 35, "No FCBs are available to process request") \ + XXX( SMBE_HRD_sharebufexc, 36, "A sharing buffer has been exceeded") \ + XXX( SMBE_HRD_diskfull, 39, "Disk full???") + +#if 0 /* Values not needed */ +VALUE_STRING_ENUM(HRD_errors); +#endif +VALUE_STRING_ARRAY(HRD_errors); +static value_string_ext HRD_errors_ext = VALUE_STRING_EXT_INIT(HRD_errors); static const char *decode_smb_error(guint8 errcls, guint16 errcode) { @@ -17464,15 +17477,15 @@ static const char *decode_smb_error(guint8 errcls, guint16 errcode) case SMB_ERRDOS: - return(val_to_str(errcode, DOS_errors, "Unknown DOS error (%x)")); + return(val_to_str_ext(errcode, &DOS_errors_ext, "Unknown DOS error (%x)")); case SMB_ERRSRV: - return(val_to_str(errcode, SRV_errors, "Unknown SRV error (%x)")); + return(val_to_str_ext(errcode, &SRV_errors_ext, "Unknown SRV error (%x)")); case SMB_ERRHRD: - return(val_to_str(errcode, HRD_errors, "Unknown HRD error (%x)")); + return(val_to_str_ext(errcode, &HRD_errors_ext, "Unknown HRD error (%x)")); default: @@ -17514,7 +17527,7 @@ static const true_false_string tfs_smb_flags_response = { static int dissect_smb_flags(tvbuff_t *tvb, proto_tree *parent_tree, int offset) { - guint8 mask; + guint8 mask; proto_item *item; proto_tree *tree; @@ -17717,9 +17730,9 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) si->ct = (conv_tables_t *)g_malloc(sizeof(conv_tables_t)); conv_tables = g_slist_prepend(conv_tables, si->ct); - si->ct->matched= g_hash_table_new(smb_saved_info_hash_matched, + si->ct->matched = g_hash_table_new(smb_saved_info_hash_matched, smb_saved_info_equal_matched); - si->ct->unmatched= g_hash_table_new(smb_saved_info_hash_unmatched, + si->ct->unmatched = g_hash_table_new(smb_saved_info_hash_unmatched, smb_saved_info_equal_unmatched); /* We used the same key format as the unmatched entries */ si->ct->primaries = g_hash_table_new( @@ -17784,7 +17797,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) This can fail but is better than nothing */ sip = (smb_saved_info_t *)g_hash_table_lookup(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); - if (sip!=NULL) { + if (sip != NULL) { new_key = (smb_saved_info_key_t *)wmem_alloc(wmem_file_scope(), sizeof(smb_saved_info_key_t)); new_key->frame = pinfo->fd->num; new_key->pid_mid = pid_mid; @@ -17852,7 +17865,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) the current one */ sip = (smb_saved_info_t *)g_hash_table_lookup(si->ct->unmatched, GUINT_TO_POINTER(pid_mid)); - if (sip!=NULL) { + if (sip != NULL) { gboolean cmd_match = FALSE; /* @@ -18178,7 +18191,7 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) */ col_append_fstr( pinfo->cinfo, COL_INFO, ", Error: %s", - val_to_str(si->nt_status, NT_errors, + val_to_str_ext(si->nt_status, &NT_errors_ext, "Unknown (0x%08X)")); } } else { @@ -18261,8 +18274,8 @@ proto_register_smb(void) NULL, 0, "This packet is a continuation to the packet in this frame", HFILL }}, { &hf_smb_nt_status, - { "NT Status", "smb.nt_status", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0, "NT Status code", HFILL }}, + { "NT Status", "smb.nt_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0, "NT Status code", HFILL }}, { &hf_smb_error_class, { "Error Class", "smb.error_class", FT_UINT8, BASE_HEX, @@ -19876,8 +19889,8 @@ proto_register_smb(void) NULL, 0, "Target file name", HFILL }}, { &hf_smb_device_type, - { "Device Type", "smb.device.type", FT_UINT32, BASE_HEX, - VALS(device_type_vals), 0, "Type of device", HFILL }}, + { "Device Type", "smb.device.type", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &device_type_vals_ext, 0, "Type of device", HFILL }}, { &hf_smb_is_directory, { "Is Directory", "smb.is_directory", FT_UINT8, BASE_DEC, @@ -20028,8 +20041,8 @@ proto_register_smb(void) VALS(qpi_loi_vals), 0, "Level of interest for TRANSACTION[2] QUERY_{FILE,PATH}_INFO commands", HFILL }}, { &hf_smb_spi_loi, - { "Level of Interest", "smb.spi_loi", FT_UINT16, BASE_DEC, - VALS(spi_loi_vals), 0, "Level of interest for TRANSACTION[2] SET_{FILE,PATH}_INFO commands", HFILL }}, + { "Level of Interest", "smb.spi_loi", FT_UINT16, BASE_DEC | BASE_EXT_STRING, + &spi_loi_vals_ext, 0, "Level of interest for TRANSACTION[2] SET_{FILE,PATH}_INFO commands", HFILL }}, #if 0 { &hf_smb_sfi_writetru, @@ -20054,18 +20067,18 @@ proto_register_smb(void) NULL, 0, "Latest referral version number understood", HFILL }}, { &hf_smb_qfsi_information_level, - { "Level of Interest", "smb.qfsi_loi", FT_UINT16, BASE_HEX, - VALS(qfsi_vals), 0, "Level of interest for QUERY_FS_INFORMATION2 command", HFILL }}, + { "Level of Interest", "smb.qfsi_loi", FT_UINT16, BASE_HEX | BASE_EXT_STRING, + &qfsi_vals_ext, 0, "Level of interest for QUERY_FS_INFORMATION2 command", HFILL }}, { &hf_smb_sfsi_information_level, { "Level of Interest", "smb.sfsi_loi", FT_UINT16, BASE_HEX, VALS(sfsi_vals), 0, "Level of interest for SET_FS_INFORMATION2 command", HFILL }}, - { &hf_smb_nt_rename_level, + { &hf_smb_nt_rename_level, { "Level of Interest", "smb.ntr_loi", FT_UINT16, BASE_DEC, VALS(nt_rename_vals), 0, "NT Rename level", HFILL }}, - { &hf_smb_cluster_count, + { &hf_smb_cluster_count, { "Cluster count", "smb.ntr_clu", FT_UINT32, BASE_DEC, NULL, 0, "Number of clusters", HFILL }}, diff --git a/epan/dissectors/packet-smb.h b/epan/dissectors/packet-smb.h index 59876d590e..73bcfe02a1 100644 --- a/epan/dissectors/packet-smb.h +++ b/epan/dissectors/packet-smb.h @@ -121,94 +121,36 @@ WS_DLL_PUBLIC value_string_ext nt_cmd_vals_ext; #define SMB_ERRHRD 0x03 /* Hardware style error */ #define SMB_ERRCMD 0x04 /* Not an SMB format command */ -/* Error codes for the ERRSRV class */ - -#define SMBE_error 1 /* Non specific error code */ -#define SMBE_badpw 2 /* Bad password */ -#define SMBE_badtype 3 /* reserved */ -#define SMBE_access 4 /* No permissions to do the requested operation */ -#define SMBE_invnid 5 /* tid invalid */ -#define SMBE_invnetname 6 /* Invalid servername */ -#define SMBE_invdevice 7 /* Invalid device */ -#define SMBE_qfull 49 /* Print queue full */ -#define SMBE_qtoobig 50 /* Queued item too big */ -#define SMBE_qeof 51 /* EOF in print queue dump */ -#define SMBE_invpfid 52 /* Invalid print file in smb_fid */ -#define SMBE_smbcmd 64 /* Unrecognised command */ -#define SMBE_srverror 65 /* smb server internal error */ -#define SMBE_filespecs 67 /* fid and pathname invalid combination */ -#define SMBE_badlink 68 -#define SMBE_badpermits 69 /* Access specified for a file is not valid */ -#define SMBE_badpid 70 -#define SMBE_setattrmode 71 /* attribute mode invalid */ -#define SMBE_paused 81 /* Message server paused */ -#define SMBE_msgoff 82 /* Not receiving messages */ -#define SMBE_noroom 83 /* No room for message */ -#define SMBE_rmuns 87 /* too many remote usernames */ -#define SMBE_timeout 88 /* operation timed out */ -#define SMBE_noresource 89 /* No resources currently available for request. */ -#define SMBE_toomanyuids 90 /* too many userids */ -#define SMBE_baduid 91 /* bad userid */ -#define SMBE_useMPX 250 /* temporarily unable to use raw mode, use MPX mode */ -#define SMBE_useSTD 251 /* temporarily unable to use raw mode, use standard mode */ -#define SMBE_contMPX 252 /* resume MPX mode */ -#define SMBE_badPW 253 /* Check this out ... */ -#define SMBE_nosupport 0xFFFF -#define SMBE_unknownsmb 22 /* from NT 3.5 response */ - -/* Error codes for the ERRHRD class */ - -#define SMBE_nowrite 19 /* read only media */ -#define SMBE_badunit 20 /* Unknown device */ -#define SMBE_notready 21 /* Drive not ready */ -#define SMBE_badcmd 22 /* Unknown command */ -#define SMBE_data 23 /* Data (CRC) error */ -#define SMBE_badreq 24 /* Bad request structure length */ -#define SMBE_seek 25 /* Seek error */ -#define SMBE_badmedia 26 /* Unknown media type */ -#define SMBE_badsector 27 /* Sector not found */ -#define SMBE_nopaper 28 /* Printer out of paper */ -#define SMBE_write 29 /* Write fault */ -#define SMBE_read 30 /* Read fault */ -#define SMBE_general 31 /* General failure */ -#define SMBE_badshare 32 /* An open conflicts with an existing open */ -#define SMBE_lock 33 /* Lock conflict or invalid mode, or unlock of - lock held by another process */ -#define SMBE_wrongdisk 34 /* The wrong disk was found in a drive */ -#define SMBE_FCBunavail 35 /* No FCBs are available to process request */ -#define SMBE_sharebufexc 36 /* A sharing buffer has been exceeded */ -#define SMBE_diskfull 39 - /* used for SMB export object functionality */ typedef struct _smb_eo_t { - guint smbversion; - guint16 cmd; - int tid,uid; - guint fid; - guint32 pkt_num; - gchar *hostname; - gchar *filename; - int fid_type; - gint64 end_of_file; - gchar *content_type; - guint32 payload_len; + guint smbversion; + guint16 cmd; + int tid,uid; + guint fid; + guint32 pkt_num; + gchar *hostname; + gchar *filename; + int fid_type; + gint64 end_of_file; + gchar *content_type; + guint32 payload_len; const guint8 *payload_data; - guint64 smb_file_offset; - guint32 smb_chunk_len; + guint64 smb_file_offset; + guint32 smb_chunk_len; } smb_eo_t; -/* the information we need to keep around for NT transatcion commands */ +/* the information we need to keep around for NT transaction commands */ typedef struct { - int subcmd; - int fid_type; + int subcmd; + int fid_type; guint32 ioctl_function; } smb_nt_transact_info_t; /* the information we need to keep around for transaction2 commands */ typedef struct { - int subcmd; - int info_level; - gboolean resume_keys; /* if "return resume" keys set in T2 FIND_FIRST request */ + int subcmd; + int info_level; + gboolean resume_keys; /* if "return resume" keys set in T2 FIND_FIRST request */ const char *name; } smb_transact2_info_t; @@ -224,7 +166,7 @@ typedef enum { SMB_EI_NTI, /* smb_nt_transact_info_t * */ SMB_EI_TRI, /* smb_transact_info_t * */ SMB_EI_T2I, /* smb_transact2_info_t * */ - SMB_EI_TIDNAME, /* tid tracking char * */ + SMB_EI_TIDNAME, /* tid tracking char * */ SMB_EI_FILEDATA, /* fid tracking */ SMB_EI_FILENAME, /* filename tracking */ SMB_EI_UID, /* smb_uid_t */ @@ -233,18 +175,20 @@ typedef enum { SMB_EI_RENAMEDATA, /* rename data */ SMB_EI_DIALECTS /* negprot dialects */ } smb_extra_info_t; + typedef struct _smb_fid_into_t smb_fid_info_t; + typedef struct { - guint32 frame_req, frame_res; - nstime_t req_time; - guint16 flags; - guint8 cmd; - void *extra_info; - smb_extra_info_t extra_info_type; + guint32 frame_req, frame_res; + nstime_t req_time; + guint16 flags; + guint8 cmd; + void *extra_info; + smb_extra_info_t extra_info_type; /* we save the fid in each transaction so that we can get fid filters to match both request and response */ - gboolean fid_seen_in_request; - guint16 fid; + gboolean fid_seen_in_request; + guint16 fid; } smb_saved_info_t; /* @@ -255,16 +199,16 @@ typedef struct { * subdissectors? */ typedef struct { - int subcmd; - int trans_subcmd; - int function; - /* Unification of fid variable type (was int) */ - guint16 fid; - guint16 lanman_cmd; - guchar *param_descrip; /* Keep these descriptors around */ - guchar *data_descrip; - guchar *aux_data_descrip; - int info_level; + int subcmd; + int trans_subcmd; + int function; + /* Unification of fid variable type (was int) */ + guint16 fid; + guint16 lanman_cmd; + guchar *param_descrip; /* Keep these descriptors around */ + guchar *data_descrip; + guchar *aux_data_descrip; + int info_level; } smb_transact_info_t; /* @@ -281,20 +225,20 @@ typedef struct { /* this is the structure which is associated with each conversation */ typedef struct conv_tables { /* these two tables are used to match requests with responses */ - GHashTable *unmatched; - GHashTable *matched; + GHashTable *unmatched; + GHashTable *matched; /* This table keeps primary transact requests so secondaries can find them */ - GHashTable *primaries; + GHashTable *primaries; /* This table is used to track TID->services for a conversation */ - GHashTable *tid_service; - gboolean raw_ntlmssp; /* Do extended security exc use raw ntlmssp */ + GHashTable *tid_service; + gboolean raw_ntlmssp; /* Do extended security exc use raw ntlmssp */ /* track fid to fidstruct (filename/openframe/closeframe */ wmem_tree_t *fid_tree; /* We'll use a GSL list instead */ - GSList *GSL_fid_info; + GSList *GSL_fid_info; /* track tid to fidstruct (sharename/shareframe/unshareframe */ wmem_tree_t *tid_tree; @@ -304,16 +248,16 @@ typedef struct conv_tables { } conv_tables_t; typedef struct smb_info { - guint8 cmd; - int tid, pid, uid, mid; - guint32 nt_status; + guint8 cmd; + int tid, pid, uid, mid; + guint32 nt_status; gboolean unicode; /* Are strings in this SMB Unicode? */ gboolean request; /* Is this a request? */ gboolean unidir; - int info_level; - int info_count; + int info_level; + int info_count; smb_saved_info_t *sip; /* smb_saved_info_t, if any, for this */ - conv_tables_t *ct; + conv_tables_t *ct; } smb_info_t; /* @@ -336,47 +280,50 @@ typedef struct _smb_rename_saved_info_t { /* used for tracking lock data between lock request/response */ typedef struct _smb_lock_info_t { - struct _smb_lock_info_t *next; - guint16 pid; - guint64 offset; - guint64 length; + struct _smb_lock_info_t *next; + guint16 pid; + guint64 offset; + guint64 length; } smb_lock_info_t; + typedef struct _smb_locking_saved_info_t { - guint8 type; - guint8 oplock_level; - guint16 num_lock; - guint16 num_unlock; + guint8 type; + guint8 oplock_level; + guint16 num_lock; + guint16 num_unlock; smb_lock_info_t *locks; smb_lock_info_t *unlocks; } smb_locking_saved_info_t; + /* used for tracking fid/tid to filename/sharename openedframe closedframe */ typedef struct _smb_fid_saved_info_t { - char *filename; - guint32 create_flags; - guint32 access_mask; - guint32 file_attributes; - guint32 share_access; - guint32 create_options; - guint32 create_disposition; + char *filename; + guint32 create_flags; + guint32 access_mask; + guint32 file_attributes; + guint32 share_access; + guint32 create_options; + guint32 create_disposition; } smb_fid_saved_info_t; + struct _smb_fid_into_t { - guint16 tid,fid; + guint16 tid,fid; /* The end_of_file will store the last registered offset or the reported end_of_file from the SMB protocol */ - gint64 end_of_file; + gint64 end_of_file; /* These two were int */ - guint opened_in; - guint closed_in; - int type; + guint opened_in; + guint closed_in; + int type; smb_fid_saved_info_t *fsi; }; /* used for tracking tid to sharename openedframe closedframe */ typedef struct _smb_tid_into_t { - int opened_in; - int closed_in; + int opened_in; + int closed_in; char *filename; - int type; + int type; } smb_tid_info_t; @@ -440,3 +387,16 @@ extern int dissect_get_dfs_referral_data(tvbuff_t *tvb, packet_info *pinfo, prot extern const gchar *tree_ip_str(packet_info *pinfo, guint16 cmd); #endif + +/* + * Editor modelines - http://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: + */ diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 6f6cfac4dc..c15d388851 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -6932,8 +6932,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea if (si->status) { col_append_fstr( pinfo->cinfo, COL_INFO, ", Error: %s", - val_to_str(si->status, NT_errors, - "Unknown (0x%08X)")); + val_to_str_ext(si->status, &NT_errors_ext, + "Unknown (0x%08X)")); } @@ -7113,8 +7113,8 @@ proto_register_smb2(void) { "Header Length", "smb2.header_len", FT_UINT16, BASE_DEC, NULL, 0, "SMB2 Size of Header", HFILL }}, { &hf_smb2_nt_status, - { "NT Status", "smb2.nt_status", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0, "NT Status code", HFILL }}, + { "NT Status", "smb2.nt_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0, "NT Status code", HFILL }}, { &hf_smb2_msg_id, { "Message ID", "smb2.msg_id", FT_INT64, BASE_DEC, NULL, 0, "SMB2 Messsage ID", HFILL }}, @@ -7815,8 +7815,8 @@ proto_register_smb2(void) NULL, 0, "MxAc timestamp", HFILL }}, { &hf_smb2_mxac_status, - { "Query Status", "smb2.mxac_status", FT_UINT32, BASE_HEX, - VALS(NT_errors), 0, "NT Status code", HFILL }}, + { "Query Status", "smb2.mxac_status", FT_UINT32, BASE_HEX | BASE_EXT_STRING, + &NT_errors_ext, 0, "NT Status code", HFILL }}, { &hf_smb2_qfid_fid, { "Opaque File ID", "smb2.qfid_fid", FT_BYTES, BASE_NONE, diff --git a/epan/dissectors/packet-windows-common.c b/epan/dissectors/packet-windows-common.c index 5fd63084fa..4a605d7916 100644 --- a/epan/dissectors/packet-windows-common.c +++ b/epan/dissectors/packet-windows-common.c @@ -93,167 +93,18 @@ static gint ett_nt_ace_object = -1; static gint ett_nt_ace_object_flags = -1; static gint ett_nt_security_information = -1; -/* WERR error codes - * This list is based on the samba doserr.h file and was generated by running -cat doserr.h | grep "^#define WERR" | grep -v "FOOBAR"| sed -e "s/^#define[ \t]//" | while read WERR junk;do echo " {"${WERR}, \"${WERR}\""}," ; done - */ -const value_string WERR_errors[] = { - {WERR_OK, "WERR_OK"}, - {WERR_BADFUNC, "WERR_BADFUNC"}, - {WERR_BADFILE, "WERR_BADFILE"}, - {WERR_ACCESS_DENIED, "WERR_ACCESS_DENIED"}, - {WERR_BADFID, "WERR_BADFID"}, - {WERR_NOMEM, "WERR_NOMEM"}, - {WERR_GENERAL_FAILURE, "WERR_GENERAL_FAILURE"}, - {WERR_NOT_SUPPORTED, "WERR_NOT_SUPPORTED"}, - {WERR_BAD_NETPATH, "WERR_BAD_NETPATH"}, - {WERR_UNEXP_NET_ERR, "WERR_UNEXP_NET_ERR"}, - {WERR_PRINTQ_FULL, "WERR_PRINTQ_FULL"}, - {WERR_NO_SPOOL_SPACE, "WERR_NO_SPOOL_SPACE"}, - {WERR_NO_SUCH_SHARE, "WERR_NO_SUCH_SHARE"}, - {WERR_FILE_EXISTS, "WERR_FILE_EXISTS"}, - {WERR_BAD_PASSWORD, "WERR_BAD_PASSWORD"}, - {WERR_INVALID_PARAM, "WERR_INVALID_PARAM"}, - {WERR_INSUFFICIENT_BUFFER, "WERR_INSUFFICIENT_BUFFER"}, - {WERR_INVALID_NAME, "WERR_INVALID_NAME"}, - {WERR_UNKNOWN_LEVEL, "WERR_UNKNOWN_LEVEL"}, - {WERR_OBJECT_PATH_INVALID, "WERR_OBJECT_PATH_INVALID"}, - {WERR_ALREADY_EXISTS, "WERR_ALREADY_EXISTS"}, - {WERR_NO_MORE_ITEMS, "WERR_NO_MORE_ITEMS"}, - {WERR_MORE_DATA, "WERR_MORE_DATA"}, - {WERR_CAN_NOT_COMPLETE, "WERR_CAN_NOT_COMPLETE"}, - {WERR_NOT_FOUND, "WERR_NOT_FOUND"}, - {WERR_INVALID_COMPUTERNAME, "WERR_INVALID_COMPUTERNAME"}, - {WERR_INVALID_DOMAINNAME, "WERR_INVALID_DOMAINNAME"}, - {WERR_UNKNOWN_REVISION, "WERR_UNKNOWN_REVISION"}, - {WERR_REVISION_MISMATCH, "WERR_REVISION_MISMATCH"}, - {WERR_INVALID_OWNER, "WERR_INVALID_OWNER"}, - {WERR_NO_SUCH_PRIVILEGE, "WERR_NO_SUCH_PRIVILEGE"}, - {WERR_PRIVILEGE_NOT_HELD, "WERR_PRIVILEGE_NOT_HELD"}, - {WERR_NO_SUCH_USER, "WERR_NO_SUCH_USER"}, - {WERR_INVALID_SECURITY_DESCRIPTOR, "WERR_INVALID_SECURITY_DESCRIPTOR"}, - {WERR_NO_SUCH_DOMAIN, "WERR_NO_SUCH_DOMAIN"}, - {WERR_NO_SYSTEM_RESOURCES, "WERR_NO_SYSTEM_RESOURCES"}, - {WERR_SERVER_UNAVAILABLE, "WERR_SERVER_UNAVAILABLE"}, - {WERR_INVALID_FORM_NAME, "WERR_INVALID_FORM_NAME"}, - {WERR_INVALID_FORM_SIZE, "WERR_INVALID_FORM_SIZE"}, - {WERR_ALREADY_SHARED, "WERR_ALREADY_SHARED"}, - {WERR_BUF_TOO_SMALL, "WERR_BUF_TOO_SMALL"}, - {WERR_JOB_NOT_FOUND, "WERR_JOB_NOT_FOUND"}, - {WERR_DEST_NOT_FOUND, "WERR_DEST_NOT_FOUND"}, - {WERR_NOT_LOCAL_DOMAIN, "WERR_NOT_LOCAL_DOMAIN"}, - {WERR_DEVICE_NOT_AVAILABLE, "WERR_DEVICE_NOT_AVAILABLE"}, - {WERR_STATUS_MORE_ENTRIES, "WERR_STATUS_MORE_ENTRIES"}, - {WERR_PRINTER_DRIVER_ALREADY_INSTALLED, "WERR_PRINTER_DRIVER_ALREADY_INSTALLED"}, - {WERR_UNKNOWN_PORT, "WERR_UNKNOWN_PORT"}, - {WERR_UNKNOWN_PRINTER_DRIVER, "WERR_UNKNOWN_PRINTER_DRIVER"}, - {WERR_UNKNOWN_PRINTPROCESSOR, "WERR_UNKNOWN_PRINTPROCESSOR"}, - {WERR_INVALID_SEPARATOR_FILE, "WERR_INVALID_SEPARATOR_FILE"}, - {WERR_INVALID_PRIORITY, "WERR_INVALID_PRIORITY"}, - {WERR_INVALID_PRINTER_NAME, "WERR_INVALID_PRINTER_NAME"}, - {WERR_PRINTER_ALREADY_EXISTS, "WERR_PRINTER_ALREADY_EXISTS"}, - {WERR_INVALID_PRINTER_COMMAND, "WERR_INVALID_PRINTER_COMMAND"}, - {WERR_INVALID_DATATYPE, "WERR_INVALID_DATATYPE"}, - {WERR_INVALID_ENVIRONMENT, "WERR_INVALID_ENVIRONMENT"}, - {WERR_SESSION_NOT_FOUND, "WERR_SESSION_NOT_FOUND"}, - {WERR_FID_NOT_FOUND, "WERR_FID_NOT_FOUND"}, - {WERR_UNKNOWN_PRINT_MONITOR, "WERR_UNKNOWN_PRINT_MONITOR"}, - {WERR_PRINTER_DRIVER_IN_USE, "WERR_PRINTER_DRIVER_IN_USE"}, - {WERR_SPOOL_FILE_NOT_FOUND, "WERR_SPOOL_FILE_NOT_FOUND"}, - {WERR_SPL_NO_STARTDOC, "WERR_SPL_NO_STARTDOC"}, - {WERR_SPL_NO_ADDJOB, "WERR_SPL_NO_ADDJOB"}, - {WERR_PRINT_PROCESSOR_ALREADY_INSTALLED, "WERR_PRINT_PROCESSOR_ALREADY_INSTALLED"}, - {WERR_PRINT_MONITOR_ALREADY_INSTALLED, "WERR_PRINT_MONITOR_ALREADY_INSTALLED"}, - {WERR_INVALID_PRINT_MONITOR, "WERR_INVALID_PRINT_MONITOR"}, - {WERR_PRINT_MONITOR_IN_USE, "WERR_PRINT_MONITOR_IN_USE"}, - {WERR_PRINTER_HAS_JOBS_QUEUED, "WERR_PRINTER_HAS_JOBS_QUEUED"}, - {WERR_CLASS_NOT_REGISTERED, "WERR_CLASS_NOT_REGISTERED"}, - {WERR_NO_SHUTDOWN_IN_PROGRESS, "WERR_NO_SHUTDOWN_IN_PROGRESS"}, - {WERR_SHUTDOWN_ALREADY_IN_PROGRESS, "WERR_SHUTDOWN_ALREADY_IN_PROGRESS"}, - {WERR_NET_NAME_NOT_FOUND, "WERR_NET_NAME_NOT_FOUND"}, - {WERR_DEVICE_NOT_SHARED, "WERR_DEVICE_NOT_SHARED"}, - {WERR_DFS_NO_SUCH_VOL, "WERR_DFS_NO_SUCH_VOL"}, - {WERR_DFS_NO_SUCH_SHARE, "WERR_DFS_NO_SUCH_SHARE"}, - {WERR_DFS_NO_SUCH_SERVER, "WERR_DFS_NO_SUCH_SERVER"}, - {WERR_DFS_INTERNAL_ERROR, "WERR_DFS_INTERNAL_ERROR"}, - {WERR_DFS_CANT_CREATE_JUNCT, "WERR_DFS_CANT_CREATE_JUNCT"}, - {WERR_DS_SERVICE_BUSY, "WERR_DS_SERVICE_BUSY"}, - {WERR_DS_SERVICE_UNAVAILABLE, "WERR_DS_SERVICE_UNAVAILABLE"}, - {WERR_DS_NO_SUCH_OBJECT, "WERR_DS_NO_SUCH_OBJECT"}, - {WERR_DS_OBJ_NOT_FOUND, "WERR_DS_OBJ_NOT_FOUND"}, - {WERR_DS_DRA_INVALID_PARAMETER, "WERR_DS_DRA_INVALID_PARAMETER"}, - {WERR_DS_DRA_BAD_DN, "WERR_DS_DRA_BAD_DN"}, - {WERR_DS_DRA_BAD_NC, "WERR_DS_DRA_BAD_NC"}, - {WERR_DS_DRA_INTERNAL_ERROR, "WERR_DS_DRA_INTERNAL_ERROR"}, - {WERR_DS_DRA_OUT_OF_MEM, "WERR_DS_DRA_OUT_OF_MEM"}, - {WERR_DS_SINGLE_VALUE_CONSTRAINT, "WERR_DS_SINGLE_VALUE_CONSTRAINT"}, - {WERR_DS_DRA_DB_ERROR, "WERR_DS_DRA_DB_ERROR"}, - {WERR_DS_DRA_NO_REPLICA, "WERR_DS_DRA_NO_REPLICA"}, - {WERR_DS_DRA_ACCESS_DENIED, "WERR_DS_DRA_ACCESS_DENIED"}, - {WERR_DS_DNS_LOOKUP_FAILURE, "WERR_DS_DNS_LOOKUP_FAILURE"}, - {WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX, "WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX"}, - {WERR_SEC_E_ALGORITHM_MISMATCH, "WERR_SEC_E_ALGORITHM_MISMATCH"}, - {0, NULL} -}; - +/* 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); /* * DOS error codes. */ -const value_string DOS_errors[] = { - {0, "Success"}, - {SMBE_insufficientbuffer, "Insufficient buffer"}, - {SMBE_badfunc, "Invalid function (or system call)"}, - {SMBE_badfile, "File not found (pathname error)"}, - {SMBE_badpath, "Directory not found"}, - {SMBE_nofids, "Too many open files"}, - {SMBE_noaccess, "Access denied"}, - {SMBE_badfid, "Invalid fid"}, - {SMBE_nomem, "Out of memory"}, - {SMBE_badmem, "Invalid memory block address"}, - {SMBE_badenv, "Invalid environment"}, - {SMBE_badaccess, "Invalid open mode"}, - {SMBE_baddata, "Invalid data (only from ioctl call)"}, - {SMBE_res, "Reserved error code?"}, - {SMBE_baddrive, "Invalid drive"}, - {SMBE_remcd, "Attempt to delete current directory"}, - {SMBE_diffdevice, "Rename/move across different filesystems"}, - {SMBE_nofiles, "No more files found in file search"}, - {SMBE_badshare, "Share mode on file conflict with open mode"}, - {SMBE_lock, "Lock request conflicts with existing lock"}, - {SMBE_unsup, "Request unsupported, returned by Win 95"}, - {SMBE_nosuchshare, "Requested share does not exist"}, - {SMBE_filexists, "File in operation already exists"}, - {SMBE_cannotopen, "Cannot open the file specified"}, - {SMBE_unknownlevel, "Unknown info level"}, - {SMBE_invalidname, "Invalid name"}, - {SMBE_badpipe, "Named pipe invalid"}, - {SMBE_pipebusy, "All instances of pipe are busy"}, - {SMBE_pipeclosing, "Named pipe close in progress"}, - {SMBE_notconnected, "No process on other end of named pipe"}, - {SMBE_moredata, "More data to be returned"}, - {SMBE_baddirectory, "Invalid directory name in a path."}, - {SMBE_eas_didnt_fit, "Extended attributes didn't fit"}, - {SMBE_eas_nsup, "Extended attributes not supported"}, - {SMBE_notify_buf_small, "Buffer too small to return change notify."}, - {SMBE_unknownipc, "Unknown IPC Operation"}, - {SMBE_noipc, "Don't support ipc"}, - {SMBE_alreadyexists, "File already exists"}, - {SMBE_unknownprinterdriver, "Unknown printer driver"}, - {SMBE_invalidprintername, "Invalid printer name"}, - {SMBE_printeralreadyexists, "Printer already exists"}, - {SMBE_invaliddatatype, "Invalid data type"}, - {SMBE_invalidenvironment, "Invalid environment"}, - {SMBE_printerdriverinuse, "Printer driver in use"}, - {SMBE_invalidparam, "Invalid parameter"}, - {SMBE_invalidformsize, "Invalid form size"}, - {SMBE_invalidsecuritydescriptor, "Invalid security descriptor"}, - {SMBE_invalidowner, "Invalid owner"}, - {SMBE_nomoreitems, "No more items"}, - {SMBE_serverunavailable, "Server unavailable"}, - {0, NULL} -}; + +VALUE_STRING_ARRAY(DOS_errors); +value_string_ext DOS_errors_ext = VALUE_STRING_EXT_INIT(DOS_errors); /* * NT error codes. @@ -336,6 +187,9 @@ const value_string NT_errors[] = { { 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" }, @@ -371,6 +225,8 @@ const value_string NT_errors[] = { { 0x80000024, "STATUS_SERVER_HAS_OPEN_HANDLES" }, { 0x80000025, "STATUS_ALREADY_DISCONNECTED" }, { 0x80000026, "STATUS_LONGJUMP" }, + { 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" }, @@ -908,8 +764,6 @@ const value_string NT_errors[] = { { 0xC0000285, "STATUS_ILLEGAL_ELEMENT_ADDRESS" }, { 0xC0000286, "STATUS_MAGAZINE_NOT_PRESENT" }, { 0xC0000287, "STATUS_REINITIALIZATION_NEEDED" }, - { 0x80000288, "STATUS_DEVICE_REQUIRES_CLEANING" }, - { 0x80000289, "STATUS_DEVICE_DOOR_OPEN" }, { 0xC000028A, "STATUS_ENCRYPTION_FAILED" }, { 0xC000028B, "STATUS_DECRYPTION_FAILED" }, { 0xC000028C, "STATUS_RANGE_NOT_FOUND" }, @@ -920,7 +774,6 @@ const value_string NT_errors[] = { { 0xC0000291, "STATUS_FILE_NOT_ENCRYPTED" }, { 0xC0000292, "STATUS_NOT_EXPORT_FORMAT" }, { 0xC0000293, "STATUS_FILE_ENCRYPTED" }, - { 0x40000294, "STATUS_WAKE_SYSTEM" }, { 0xC0000295, "STATUS_WMI_GUID_NOT_FOUND" }, { 0xC0000296, "STATUS_WMI_INSTANCE_NOT_FOUND" }, { 0xC0000297, "STATUS_WMI_ITEMID_NOT_FOUND" }, @@ -1070,6 +923,20 @@ const value_string NT_errors[] = { { 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" }, @@ -1091,30 +958,15 @@ const value_string NT_errors[] = { { 0xC003000A, "RPC_NT_ENUM_VALUE_OUT_OF_RANGE" }, { 0xC003000B, "RPC_NT_BYTE_COUNT_TOO_SMALL" }, { 0xC003000C, "RPC_NT_BAD_STUB_DATA" }, - { 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" }, - { 0x40020056, "RPC_NT_UUID_LOCAL_ONLY" }, - { 0xC0020057, "RPC_NT_SEC_PKG_ERROR" }, - { 0xC0020058, "RPC_NT_NOT_CANCELLED" }, { 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" }, - { 0x400200AF, "RPC_NT_SEND_INCOMPLETE" }, { 0, NULL } }; +value_string_ext NT_errors_ext = VALUE_STRING_EXT_INIT(NT_errors); /* These are the MS country codes from @@ -1133,7 +985,7 @@ const value_string NT_errors[] = { additional codes; the current version matches the Unicode Consortium's table. */ -const value_string ms_country_codes[] = { +static const value_string ms_country_codes[] = { { 0, "Default"}, { 1, "USA"}, { 2, "Canada"}, @@ -1239,6 +1091,7 @@ const value_string ms_country_codes[] = { {0, NULL} }; +value_string_ext ms_country_codes_ext = VALUE_STRING_EXT_INIT(ms_country_codes); /*module_t* module;*/ /*pref_t* sid_display_hex;*/ @@ -1476,6 +1329,7 @@ static const value_string wkwn_S_1_5_21_rids[] = { {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 @@ -1647,7 +1501,7 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, } else if (i==5) { rid = sa_field; rid_offset = offset; - mapped_rid = val_to_str_const(rid, wkwn_S_1_5_21_rids, "Domain RID"); + 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 { diff --git a/epan/dissectors/packet-windows-common.h b/epan/dissectors/packet-windows-common.h index 74b02e0dbb..dacb50ebe9 100644 --- a/epan/dissectors/packet-windows-common.h +++ b/epan/dissectors/packet-windows-common.h @@ -33,106 +33,115 @@ * 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/;$//" + (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_OK 0 -#define WERR_BADFUNC 1 -#define WERR_BADFILE 2 -#define WERR_ACCESS_DENIED 5 -#define WERR_BADFID 6 -#define WERR_NOMEM 8 -#define WERR_GENERAL_FAILURE 31 -#define WERR_NOT_SUPPORTED 50 -#define WERR_BAD_NETPATH 53 -#define WERR_UNEXP_NET_ERR 59 -#define WERR_PRINTQ_FULL 61 -#define WERR_NO_SPOOL_SPACE 62 -#define WERR_NO_SUCH_SHARE 67 -#define WERR_FILE_EXISTS 80 -#define WERR_BAD_PASSWORD 86 -#define WERR_INVALID_PARAM 87 -#define WERR_INSUFFICIENT_BUFFER 122 -#define WERR_INVALID_NAME 123 -#define WERR_UNKNOWN_LEVEL 124 -#define WERR_OBJECT_PATH_INVALID 161 -#define WERR_ALREADY_EXISTS 183 -#define WERR_NO_MORE_ITEMS 259 -#define WERR_MORE_DATA 234 -#define WERR_CAN_NOT_COMPLETE 1003 -#define WERR_NOT_FOUND 1168 -#define WERR_INVALID_COMPUTERNAME 1210 -#define WERR_INVALID_DOMAINNAME 1212 -#define WERR_UNKNOWN_REVISION 1305 -#define WERR_REVISION_MISMATCH 1306 -#define WERR_INVALID_OWNER 1307 -#define WERR_NO_SUCH_PRIVILEGE 1313 -#define WERR_PRIVILEGE_NOT_HELD 1314 -#define WERR_NO_SUCH_USER 1317 -#define WERR_INVALID_SECURITY_DESCRIPTOR 1338 -#define WERR_NO_SUCH_DOMAIN 1355 -#define WERR_NO_SYSTEM_RESOURCES 1450 -#define WERR_SERVER_UNAVAILABLE 1722 -#define WERR_INVALID_FORM_NAME 1902 -#define WERR_INVALID_FORM_SIZE 1903 -#define WERR_ALREADY_SHARED 2118 -#define WERR_BUF_TOO_SMALL 2123 -#define WERR_JOB_NOT_FOUND 2151 -#define WERR_DEST_NOT_FOUND 2152 -#define WERR_NOT_LOCAL_DOMAIN 2320 -#define WERR_DEVICE_NOT_AVAILABLE 4319 -#define WERR_STATUS_MORE_ENTRIES 0x0105 -#define WERR_PRINTER_DRIVER_ALREADY_INSTALLED 1795 -#define WERR_UNKNOWN_PORT 1796 -#define WERR_UNKNOWN_PRINTER_DRIVER 1797 -#define WERR_UNKNOWN_PRINTPROCESSOR 1798 -#define WERR_INVALID_SEPARATOR_FILE 1799 -#define WERR_INVALID_PRIORITY 1800 -#define WERR_INVALID_PRINTER_NAME 1801 -#define WERR_PRINTER_ALREADY_EXISTS 1802 -#define WERR_INVALID_PRINTER_COMMAND 1803 -#define WERR_INVALID_DATATYPE 1804 -#define WERR_INVALID_ENVIRONMENT 1805 -#define WERR_SESSION_NOT_FOUND 2312 -#define WERR_FID_NOT_FOUND 2314 -#define WERR_UNKNOWN_PRINT_MONITOR 3000 -#define WERR_PRINTER_DRIVER_IN_USE 3001 -#define WERR_SPOOL_FILE_NOT_FOUND 3002 -#define WERR_SPL_NO_STARTDOC 3003 -#define WERR_SPL_NO_ADDJOB 3004 -#define WERR_PRINT_PROCESSOR_ALREADY_INSTALLED 3005 -#define WERR_PRINT_MONITOR_ALREADY_INSTALLED 3006 -#define WERR_INVALID_PRINT_MONITOR 3007 -#define WERR_PRINT_MONITOR_IN_USE 3008 -#define WERR_PRINTER_HAS_JOBS_QUEUED 3009 -#define WERR_CLASS_NOT_REGISTERED 0x40154 -#define WERR_NO_SHUTDOWN_IN_PROGRESS 0x45c -#define WERR_SHUTDOWN_ALREADY_IN_PROGRESS 0x45b -#define WERR_NET_NAME_NOT_FOUND (2100)+210 -#define WERR_DEVICE_NOT_SHARED (2100)+211 -#define WERR_DFS_NO_SUCH_VOL (2100)+562 -#define WERR_DFS_NO_SUCH_SHARE (2100)+565 -#define WERR_DFS_NO_SUCH_SERVER (2100)+573 -#define WERR_DFS_INTERNAL_ERROR (2100)+590 -#define WERR_DFS_CANT_CREATE_JUNCT (2100)+569 -#define WERR_DS_SERVICE_BUSY 0x0000200e -#define WERR_DS_SERVICE_UNAVAILABLE 0x0000200f -#define WERR_DS_NO_SUCH_OBJECT 0x00002030 -#define WERR_DS_OBJ_NOT_FOUND 0x0000208d -#define WERR_DS_DRA_INVALID_PARAMETER 0x000020f5 -#define WERR_DS_DRA_BAD_DN 0x000020f7 -#define WERR_DS_DRA_BAD_NC 0x000020f8 -#define WERR_DS_DRA_INTERNAL_ERROR 0x000020fa -#define WERR_DS_DRA_OUT_OF_MEM 0x000020fe -#define WERR_DS_SINGLE_VALUE_CONSTRAINT 0x00002081 -#define WERR_DS_DRA_DB_ERROR 0x00002103 -#define WERR_DS_DRA_NO_REPLICA 0x00002104 -#define WERR_DS_DRA_ACCESS_DENIED 0x00002105 -#define WERR_DS_DNS_LOOKUP_FAILURE 0x0000214c -#define WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX 0x00002150 -#define WERR_SEC_E_ALGORITHM_MISMATCH 0x80090331 - -extern const value_string WERR_errors[]; - +#define WERR_errors_VALUE_STRING_LIST(XXX) \ + XXX( WERR_OK, 0) \ + XXX( WERR_BADFUNC, 1) \ + XXX( WERR_BADFILE, 2) \ + XXX( WERR_ACCESS_DENIED, 5) \ + XXX( WERR_BADFID, 6) \ + XXX( WERR_NOMEM, 8) \ + XXX( WERR_GENERAL_FAILURE, 31) \ + XXX( WERR_NOT_SUPPORTED, 50) \ + XXX( WERR_BAD_NETPATH, 53) \ + XXX( WERR_UNEXP_NET_ERR, 59) \ + XXX( WERR_PRINTQ_FULL, 61) \ + XXX( WERR_NO_SPOOL_SPACE, 62) \ + XXX( WERR_NO_SUCH_SHARE, 67) \ + XXX( WERR_FILE_EXISTS, 80) \ + XXX( WERR_BAD_PASSWORD, 86) \ + XXX( WERR_INVALID_PARAM, 87) \ + XXX( WERR_INSUFFICIENT_BUFFER, 122) \ + XXX( WERR_INVALID_NAME, 123) \ + XXX( WERR_UNKNOWN_LEVEL, 124) \ + XXX( WERR_OBJECT_PATH_INVALID, 161) \ + XXX( WERR_ALREADY_EXISTS, 183) \ + XXX( WERR_MORE_DATA, 234) \ + XXX( WERR_NO_MORE_ITEMS, 259) \ + XXX( WERR_STATUS_MORE_ENTRIES, 261) /* 0x0105 */ \ + XXX( WERR_CAN_NOT_COMPLETE, 1003) \ + XXX( WERR_SHUTDOWN_ALREADY_IN_PROGRESS, 1115) /* 0x45b */ \ + XXX( WERR_NO_SHUTDOWN_IN_PROGRESS, 1116) /* 0x45c */ \ + XXX( WERR_NOT_FOUND, 1168) \ + XXX( WERR_INVALID_COMPUTERNAME, 1210) \ + XXX( WERR_INVALID_DOMAINNAME, 1212) \ + XXX( WERR_UNKNOWN_REVISION, 1305) \ + XXX( WERR_REVISION_MISMATCH, 1306) \ + XXX( WERR_INVALID_OWNER, 1307) \ + XXX( WERR_NO_SUCH_PRIVILEGE, 1313) \ + XXX( WERR_PRIVILEGE_NOT_HELD, 1314) \ + XXX( WERR_NO_SUCH_USER, 1317) \ + XXX( WERR_INVALID_SECURITY_DESCRIPTOR, 1338) \ + XXX( WERR_NO_SUCH_DOMAIN, 1355) \ + XXX( WERR_NO_SYSTEM_RESOURCES, 1450) \ + XXX( WERR_SERVER_UNAVAILABLE, 1722) \ + XXX( WERR_PRINTER_DRIVER_ALREADY_INSTALLED, 1795) \ + XXX( WERR_UNKNOWN_PORT, 1796) \ + XXX( WERR_UNKNOWN_PRINTER_DRIVER, 1797) \ + XXX( WERR_UNKNOWN_PRINTPROCESSOR, 1798) \ + XXX( WERR_INVALID_SEPARATOR_FILE, 1799) \ + XXX( WERR_INVALID_PRIORITY, 1800) \ + XXX( WERR_INVALID_PRINTER_NAME, 1801) \ + XXX( WERR_PRINTER_ALREADY_EXISTS, 1802) \ + XXX( WERR_INVALID_PRINTER_COMMAND, 1803) \ + XXX( WERR_INVALID_DATATYPE, 1804) \ + XXX( WERR_INVALID_ENVIRONMENT, 1805) \ + XXX( WERR_INVALID_FORM_NAME, 1902) \ + XXX( WERR_INVALID_FORM_SIZE, 1903) \ + XXX( WERR_ALREADY_SHARED, 2118) \ + XXX( WERR_BUF_TOO_SMALL, 2123) \ + XXX( WERR_JOB_NOT_FOUND, 2151) \ + XXX( WERR_DEST_NOT_FOUND, 2152) \ + XXX( WERR_NET_NAME_NOT_FOUND, 2310) /* (2100)+210 */ \ + XXX( WERR_DEVICE_NOT_SHARED, 2311) /* (2100)+211 */ \ + XXX( WERR_SESSION_NOT_FOUND, 2312) \ + XXX( WERR_FID_NOT_FOUND, 2314) \ + XXX( WERR_NOT_LOCAL_DOMAIN, 2320) \ + XXX( WERR_DFS_NO_SUCH_VOL, 2662) /* (2100)+562 */ \ + XXX( WERR_DFS_NO_SUCH_SHARE, 2665) /* (2100)+565 */ \ + XXX( WERR_DFS_CANT_CREATE_JUNCT, 2669) /* (2100)+569 */ \ + XXX( WERR_DFS_NO_SUCH_SERVER, 2673) /* (2100)+573 */ \ + XXX( WERR_DFS_INTERNAL_ERROR, 2690) /* (2100)+590 */ \ + XXX( WERR_UNKNOWN_PRINT_MONITOR, 3000) \ + XXX( WERR_PRINTER_DRIVER_IN_USE, 3001) \ + XXX( WERR_SPOOL_FILE_NOT_FOUND, 3002) \ + XXX( WERR_SPL_NO_STARTDOC, 3003) \ + XXX( WERR_SPL_NO_ADDJOB, 3004) \ + XXX( WERR_PRINT_PROCESSOR_ALREADY_INSTALLED, 3005) \ + XXX( WERR_PRINT_MONITOR_ALREADY_INSTALLED, 3006) \ + XXX( WERR_INVALID_PRINT_MONITOR, 3007) \ + XXX( WERR_PRINT_MONITOR_IN_USE, 3008) \ + XXX( WERR_PRINTER_HAS_JOBS_QUEUED, 3009) \ + XXX( WERR_DEVICE_NOT_AVAILABLE, 4319) \ + XXX( WERR_DS_SERVICE_BUSY, 8206) /* 0x0000200e */ \ + XXX( WERR_DS_SERVICE_UNAVAILABLE, 8207) /* 0x0000200f */ \ + XXX( WERR_DS_NO_SUCH_OBJECT, 8240) /* 0x00002030 */ \ + XXX( WERR_DS_SINGLE_VALUE_CONSTRAINT, 8321) /* 0x00002081 */ \ + XXX( WERR_DS_OBJ_NOT_FOUND, 8333) /* 0x0000208d */ \ + XXX( WERR_DS_DRA_INVALID_PARAMETER, 8437) /* 0x000020f5 */ \ + XXX( WERR_DS_DRA_BAD_DN, 8439) /* 0x000020f7 */ \ + XXX( WERR_DS_DRA_BAD_NC, 8440) /* 0x000020f8 */ \ + XXX( WERR_DS_DRA_INTERNAL_ERROR, 8442) /* 0x000020fa */ \ + XXX( WERR_DS_DRA_OUT_OF_MEM, 8446) /* 0x000020fe */ \ + 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_DNS_LOOKUP_FAILURE, 8524) /* 0x0000214c */ \ + XXX( WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX, 8528) /* 0x00002150 */ \ + XXX( WERR_CLASS_NOT_REGISTERED, 262484) /* 0x00040154 */ \ + XXX( WERR_SEC_E_ALGORITHM_MISMATCH, 2148074289) /* 0x80090331 */ + +#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; /* * DOS error codes used by other dissectors. @@ -140,69 +149,98 @@ extern const value_string WERR_errors[]; * the ERRDOS error class, but they might be error codes returned from * DOS. */ -#define SMBE_badfunc 1 /* Invalid function (or system call) */ -#define SMBE_badfile 2 /* File not found (pathname error) */ -#define SMBE_badpath 3 /* Directory not found */ -#define SMBE_nofids 4 /* Too many open files */ -#define SMBE_noaccess 5 /* Access denied */ -#define SMBE_badfid 6 /* Invalid fid */ -#define SMBE_badmcb 7 /* Memory control blocks destroyed */ -#define SMBE_nomem 8 /* Out of memory */ -#define SMBE_badmem 9 /* Invalid memory block address */ -#define SMBE_badenv 10 /* Invalid environment */ -#define SMBE_badformat 11 /* Invalid format */ -#define SMBE_badaccess 12 /* Invalid open mode */ -#define SMBE_baddata 13 /* Invalid data (only from ioctl call) */ -#define SMBE_res 14 -#define SMBE_baddrive 15 /* Invalid drive */ -#define SMBE_remcd 16 /* Attempt to delete current directory */ -#define SMBE_diffdevice 17 /* rename/move across different filesystems */ -#define SMBE_nofiles 18 /* no more files found in file search */ -#define SMBE_badshare 32 /* Share mode on file conflict with open mode */ -#define SMBE_lock 33 /* Lock request conflicts with existing lock */ -#define SMBE_unsup 50 /* Request unsupported, returned by Win 95, RJS 20Jun98 */ -#define SMBE_nosuchshare 67 /* Share does not exist */ -#define SMBE_filexists 80 /* File in operation already exists */ -#define SMBE_invalidparam 87 /* Invalid parameter */ -#define SMBE_cannotopen 110 /* Cannot open the file specified */ -#define SMBE_insufficientbuffer 122/* Insufficient buffer size */ -#define SMBE_invalidname 123 /* Invalid name */ -#define SMBE_unknownlevel 124 /* Unknown info level */ -#define SMBE_alreadyexists 183 /* File already exists */ -#define SMBE_badpipe 230 /* Named pipe invalid */ -#define SMBE_pipebusy 231 /* All instances of pipe are busy */ -#define SMBE_pipeclosing 232 /* named pipe close in progress */ -#define SMBE_notconnected 233 /* No process on other end of named pipe */ -#define SMBE_moredata 234 /* More data to be returned */ -#define SMBE_nomoreitems 259 /* No more items */ -#define SMBE_baddirectory 267 /* Invalid directory name in a path. */ -#define SMBE_eas_didnt_fit 275 /* Extended attributes didn't fit */ -#define SMBE_eas_nsup 282 /* Extended attributes not supported */ -#define SMBE_notify_buf_small 1022 /* Buffer too small to return change notify. */ -#define SMBE_serverunavailable 1722/* Server unavailable */ -#define SMBE_unknownipc 2142 -#define SMBE_noipc 66 /* don't support ipc */ - -/* These errors seem to be only returned by the NT printer driver system */ - -#define SMBE_invalidowner 1307 /* Invalid security descriptor owner */ -#define SMBE_invalidsecuritydescriptor 1338 /* Invalid security descriptor */ -#define SMBE_unknownprinterdriver 1797 /* Unknown printer driver */ -#define SMBE_invalidprintername 1801 /* Invalid printer name */ -#define SMBE_printeralreadyexists 1802 /* Printer already exists */ -#define SMBE_invaliddatatype 1804 /* Invalid datatype */ -#define SMBE_invalidenvironment 1805 /* Invalid environment */ -#define SMBE_invalidformsize 1903 /* Invalid form size */ -#define SMBE_printerdriverinuse 3001 /* Printer driver in use */ - -extern const value_string DOS_errors[]; + +#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[]; +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 const value_string ms_country_codes[]; +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); |