Initial AFP support implementation

This commit is contained in:
AlexSSD7 2023-09-01 15:15:40 +01:00
commit 7ba79ff803
7 changed files with 100 additions and 15 deletions

View file

@ -7,16 +7,12 @@ import (
"runtime"
"strings"
"log/slog"
"github.com/AlexSSD7/linsk/vm"
"github.com/pkg/errors"
)
const smbPort = 445
// TODO: Test SMB backend on macOS.
type SMBBackend struct {
listenIP net.IP
sharePort *uint16
@ -63,8 +59,6 @@ func (b *SMBBackend) Apply(ctx context.Context, sharePWD string, vc *VMShareCont
return "", errors.Wrap(err, "start smb server")
}
slog.Info("Started the network share successfully", "type", "smb", "ext", vc.NetTapCtx != nil)
var shareURL string
if b.sharePort != nil {
shareURL = "smb://" + net.JoinHostPort(b.listenIP.String(), fmt.Sprint(*b.sharePort)) + "/linsk"