diff --git a/libcli/smb/smb_util.h b/libcli/smb/smb_util.h index 2884786339d..501b8dd1d3d 100644 --- a/libcli/smb/smb_util.h +++ b/libcli/smb/smb_util.h @@ -19,6 +19,7 @@ along with this program. If not, see . */ +const char *smb_protocol_types_string(enum protocol_types protocol); char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib); uint32_t unix_perms_to_wire(mode_t perms); mode_t wire_perms_to_unix(uint32_t perms); diff --git a/libcli/smb/test_smb1cli_session.c b/libcli/smb/test_smb1cli_session.c index e924b32e22e..d1e21d5431e 100644 --- a/libcli/smb/test_smb1cli_session.c +++ b/libcli/smb/test_smb1cli_session.c @@ -6,6 +6,7 @@ #include "replace.h" #include #include "libcli/util/ntstatus.h" +#include "smb_constants.h" #include "smb_util.h" static const uint8_t smb1_session_setup_bytes[] = { diff --git a/libcli/smb/util.c b/libcli/smb/util.c index 7ef909c6077..6fdf35fbbf3 100644 --- a/libcli/smb/util.c +++ b/libcli/smb/util.c @@ -23,6 +23,44 @@ #include "libcli/smb/smb_common.h" #include "system/filesys.h" +const char *smb_protocol_types_string(enum protocol_types protocol) +{ + switch (protocol) { + case PROTOCOL_DEFAULT: + return "DEFAULT"; + case PROTOCOL_NONE: + return "NONE"; + case PROTOCOL_CORE: + return "CORE"; + case PROTOCOL_COREPLUS: + return "COREPLUS"; + case PROTOCOL_LANMAN1: + return "LANMAN1"; + case PROTOCOL_LANMAN2: + return "LANMAN2"; + case PROTOCOL_NT1: + return "NT1"; + case PROTOCOL_SMB2_02: + return "SMB2_02"; + case PROTOCOL_SMB2_10: + return "SMB2_10"; + case PROTOCOL_SMB2_22: + return "SMB2_22"; + case PROTOCOL_SMB2_24: + return "SMB2_24"; + case PROTOCOL_SMB3_00: + return "SMB3_00"; + case PROTOCOL_SMB3_02: + return "SMB3_02"; + case PROTOCOL_SMB3_10: + return "SMB3_10"; + case PROTOCOL_SMB3_11: + return "SMB3_11"; + } + + return "Invalid protocol_types value"; +} + /** Return a string representing a CIFS attribute for a file. **/