File: smb2.go

package info (click to toggle)
golang-github-cloudsoda-go-smb2 0.0~git20231124.f3ec8ae-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 972 kB
  • sloc: makefile: 2
file content (35 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Package smb2 implements the SMB2/3 client in [MS-SMB2].
//
// https://msdn.microsoft.com/en-us/library/cc246482.aspx
//
// This package doesn't support CAP_UNIX extension.
// Symlink is supported by FSCTL_SET_REPARSE_POINT and FSCTL_GET_REPARSE_POINT.
// The symlink-following algorithm is explained in 2.2.2.2.1 and 2.2.2.2.1.1.
//
// https://msdn.microsoft.com/en-us/library/cc246542.aspx
//
// Supported features and protocol versions are declared in feature.go.
package smb2

import (
	"encoding/binary"
	"io"
	"log"
	"os"
)

var debug = os.Getenv("DEBUG") != ""

var zero [16]byte

var be = binary.BigEndian

var logger *log.Logger

func init() {
	if debug {
		logger = log.New(os.Stderr, "smb2: ", log.LstdFlags)
	} else {
		logger = log.New(io.Discard, "smb2: ", log.LstdFlags)
	}
}