ArnLib
4.0.x
Active Registry Network
|
Class for making an Arn Server. More...
#include <ArnServer.hpp>
Classes | |
struct | Type |
Public Member Functions | |
ArnServer (Type serverType, QObject *parent=arnNullptr) | |
Create an Arn server object. More... | |
~ArnServer () | |
void | start (int port=-1, QHostAddress listenAddr=QHostAddress::Any) |
Start the Arn server More... | |
int | port () |
Port number of the Arn server More... | |
QHostAddress | listenAddress () |
Address of the interface used to listening for connections to the Arn server More... | |
void | addAccess (const QString &userName, const QString &password, Arn::Allow allow) |
Add an access entry. More... | |
bool | isDemandLogin () const |
Get servers demand for login. More... | |
void | setDemandLogin (bool isDemandLogin) |
Set servers demand for login. More... | |
void | setNoLoginNets (const QStringList &noLoginNets) |
Set the nets not demanding login. More... | |
QStringList | noLoginNets () const |
Get the nets not demanding login. More... | |
bool | isDemandLoginNet (const QHostAddress &remoteAddr) const |
Return if a host address demands login. More... | |
void | addFreePath (const QString &path) |
Add a new "freePath". More... | |
QStringList | freePaths () const |
Returns current list of freePaths. More... | |
void | setWhoIAm (const Arn::XStringMap &whoIAmXsm) |
Set servers human readable identification information. More... | |
Class for making an Arn Server.
About Sharing Arn Data Objects
Example usage
Definition at line 98 of file ArnServer.hpp.
ArnServer::ArnServer | ( | Type | serverType, |
QObject * | parent = arnNullptr |
||
) |
Create an Arn server object.
[in] | serverType | For now only NetSync is available. |
[in] | parent |
Definition at line 198 of file ArnServer.cpp.
ArnServer::~ArnServer | ( | ) |
Definition at line 212 of file ArnServer.cpp.
void ArnServer::addAccess | ( | const QString & | userName, |
const QString & | password, | ||
Arn::Allow | allow | ||
) |
Add an access entry.
This adds an entry to build an access table for the server. This access table restricts the operations of connected clients. Each client refer to one entry by its userName. Each entry must have a unique userName. Any equal userName is making the entry being replaced by the last added one. The password can be in clear text or a Hashed password which can be generated by ArnClient::passwordHash() (see also ArnBrowser Settings).
[in] | userName | |
[in] | password | in clear text or Hashed |
[in] | allow | have flags defining allowed basic operations (write, delete ...) |
Definition at line 263 of file ArnServer.cpp.
void ArnServer::addFreePath | ( | const QString & | path | ) |
Add a new "freePath".
A freePath can be used even if not logged in to an ArnServer that demands login. Also all children below freePath is free to use. Usage is restricted to read operations and alike from ArnServer to ArnClient. Setting a freePath at ArnServer gives the actual permision for read usage. All wanted freePaths must be added before ArnServer is started.
[in] | path | is the freePath, eg "/Local/Sys/Legal/". |
Definition at line 363 of file ArnServer.cpp.
QStringList ArnServer::freePaths | ( | ) | const |
Returns current list of freePaths.
The list of freePaths is used to give permision for read uasge of the paths.
Definition at line 372 of file ArnServer.cpp.
bool ArnServer::isDemandLogin | ( | ) | const |
Get servers demand for login.
If any of server or client demand login, it must be used.
true | if server demand login. |
Definition at line 271 of file ArnServer.cpp.
bool ArnServer::isDemandLoginNet | ( | const QHostAddress & | remoteAddr | ) | const |
Return if a host address demands login.
[in] | remoteAddr | is the tested host address. |
false | if the host address belongs to any net not demanding login |
Definition at line 303 of file ArnServer.cpp.
QHostAddress ArnServer::listenAddress | ( | ) |
Address of the interface used to listening for connections to the Arn server
is | the address (which usually is QHostAddress::Any). |
Definition at line 254 of file ArnServer.cpp.
QStringList ArnServer::noLoginNets | ( | ) | const |
Get the nets not demanding login.
Definition at line 295 of file ArnServer.cpp.
int ArnServer::port | ( | ) |
Port number of the Arn server
is | the port number. |
Definition at line 246 of file ArnServer.cpp.
void ArnServer::setDemandLogin | ( | bool | isDemandLogin | ) |
Set servers demand for login.
If any of server or client demand login, it must be used.
[in] | isDemandLogin | true if server demand login. |
Definition at line 279 of file ArnServer.cpp.
void ArnServer::setNoLoginNets | ( | const QStringList & | noLoginNets | ) |
Set the nets not demanding login.
The net can be "localhost", "localnet", "any" or a subnet using syntax from QHostAddress::parseSubnet(). The "localnet" matches direct adresses on all of the available interfaces. The "any" will effectively turn off setDemandLogin().
[in] | noLoginNets | is the list of no login nets, e.g ("localhost" "192.168.1.0/255.255.255.0"). |
Definition at line 287 of file ArnServer.cpp.
void ArnServer::setWhoIAm | ( | const Arn::XStringMap & | whoIAmXsm | ) |
Set servers human readable identification information.
This is used to identify the server. Standard keys to use are: Contact, Location, Description.
Example usage
[in] | whoIAmXsm | contains the information. |
Definition at line 404 of file ArnServer.cpp.
void ArnServer::start | ( | int | port = -1 , |
QHostAddress | listenAddr = QHostAddress::Any |
||
) |
Start the Arn server
[in] | port | is the server port, -1 gives Arn::defaultTcpPort, 0 gives dynamic port |
[in] | listenAddr | is the interface address to listen for connections (default any) |
Definition at line 218 of file ArnServer.cpp.