]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/smb: add smb_protocol_types_string()
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Jun 2017 19:52:54 +0000 (21:52 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jun 2017 11:07:40 +0000 (13:07 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smb_util.h
libcli/smb/test_smb1cli_session.c
libcli/smb/util.c

index 2884786339de1f63e96c98c3c68f28c173379bd3..501b8dd1d3d8ccaa2d3ce54d8f7b193fb3093daa 100644 (file)
@@ -19,6 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+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);
index e924b32e22e3c3579bf649b3153067a10a7c5815..d1e21d5431e99a7b96f502cc1814329c4bc84ffc 100644 (file)
@@ -6,6 +6,7 @@
 #include "replace.h"
 #include <talloc.h>
 #include "libcli/util/ntstatus.h"
+#include "smb_constants.h"
 #include "smb_util.h"
 
 static const uint8_t smb1_session_setup_bytes[] = {
index 7ef909c60773a2fc2bfabdd4db61a388d9087403..6fdf35fbbf3ec80a90a32c772a13d0c74488a4bc 100644 (file)
 #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.
 **/