libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
WutSmbDriver.h
1/****************************************************************************
2 * Platform Abstraction Layer (WUT driver)
3 * Daryl Borth 2026
4 * WutSmbDriver.h
5 *
6 * Wii U SmbDriver. libsmb2 is a plain client library with no devoptab of its
7 * own: it hands back a struct smb2_context* and POSIX-shaped calls.
8 * WutSmbDriver registers its own "smb:/" newlib devoptab on top of libsmb2.
9 ***************************************************************************/
10#pragma once
11#include "../SmbDriver.h"
12
13struct smb2_context;
14
17class WutSmbDriver : public SmbDriver
18{
19 public:
20 void init() override;
21 void shutdown() override;
22
23 SmbConnectResult connect(const SmbShareInfo & info) override;
24 void disconnect() override;
25 bool isConnected() const override { return ctx != nullptr; }
26
27 const char * getMountPath() const override { return ctx ? "smb:/" : ""; }
28 const char * connectResultMessage(SmbConnectResult result) const override;
29 const char * getLastError() const override;
30
33 static smb2_context * getContext() { return ctx; }
34
35 bool isNetworkUp() const override;
36
40 bool ensureNetworkUp() override;
41
42 private:
43 static smb2_context * ctx;
44 SmbShareInfo current = {};
45 bool devoptabAdded = false;
46 bool acInitialized = false;
47 bool acConnected = false;
48};
Network-share driver.
Definition SmbDriver.h:43
Wii U SmbDriver built on libsmb2, registering its own smb:/ newlib devoptab.
void disconnect() override
Unmounts and drops the connection.
SmbConnectResult connect(const SmbShareInfo &info) override
Attempts to connect and mount in one call.
const char * getMountPath() const override
devoptab-style mount path (eg.
const char * connectResultMessage(SmbConnectResult result) const override
Short, user-displayable reason for a non-Success SmbConnectResult.
void init() override
One-time setup.
const char * getLastError() const override
Raw, implementation-specific detail behind the last failure.
bool isNetworkUp() const override
True if the network is already up, i.e.
bool ensureNetworkUp() override
Brings the Wii U network connection up if it isn't already, via nn::ac (ACConnect()).
void shutdown() override
Disconnects if connected and releases whatever init() set up.
bool isConnected() const override
static smb2_context * getContext()
The active context, used by the free-function devoptab callbacks in WutSmbDriver.cpp.
SmbConnectResult
Result of a single connect() attempt.
Definition SmbDriver.h:33
Credentials/target for a single SMB share.
Definition SmbDriver.h:20