Previous |
Function SmbDaemon
SmbDaemon starts the SMB server:
int SmbDaemon(SmbConfigData *pConfig);
Parameters
pConfig
A pointer do the configuration data.
typedef struct
{
char cIpAddress[32];
int iSecurityMode;
int iMaxBufferSize;
int iPriority;
SmbTreeCheckProc pTreeCheck;
SmbUserLogonProc pUserLogon;
SmbGetPasswordProc pGetPassword;
}SmbConfigData;cIpAddress is the used ip-address of the server. i.e. "192.168.1.10"
iSecurityMode is the share mode of the server. (SMB_SHARE=share all, SMB_USER=user depents)
iMaxBufferSize is transfer buffer size of the server. i.e. 0x1000 to 0xFFFF.
iPriority is the task priority of the server.(0 to 256) for default use PRIOTASK_NORMAL*4.
pTreeCheck is a callback function with this you can check all connections, see at TreeCheck.
pUserLogon is a callback function with this you can check all user logons and assign all tree entries, see at UserLogon.
pGetPassword is a callback function to get the password for a user.
remark
If iSecurityMode will set to SMB_SHARE, the server will not need a valid user logon. The password of
the user isn't checked. The server only share the same paths for all users.
If iSecurityMode will set to SMB_USER, the server will need a valid logon. The server only share
can assign indivitual shares for each user.The callback functions are called in this order:
Order
Callback Function 1. pGetPassword The server will get a password for a user, to compare
it with the transmitted password. (only at SMB_USER)2. pUserLogon The server will know to wich path a user have access. 3. pTreeCheck The server want to know if a user has acces to an tree.
return value
Macro
Value Meaning SMB_ERR_NONE 0 no error SMB_ERR_SOCKET 1 socket error SMB_ERR_ISRUNNING 2 the server allready runs SMB_ERR_INIT 4 the server couln't be initialized SMB_ERR_MEMORY 5 not enouth memory SMB_ERR_WRONGSIZE 6 the iMaxBufferSize hase a wrong value SMB_ERR_WRONGIP 7 the ip address is wrong
Introduction
The SMB daemon
The NMB daemon
The CheckTree
Function
The
UserLogon Function
The
GetPassword Function
The
SmbInsertTreeEntry Function
The SmbInfo Function
OS-Independency
Copyright © 2003 Anton Zechner