wfreerdp-server: added APIs for more info on peers

This commit is contained in:
Corey C 2012-10-05 19:22:38 -04:00
parent e7a751c930
commit 8074b0b842
2 changed files with 79 additions and 1 deletions

View File

@ -211,3 +211,78 @@ FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr)
}
}
FREERDP_API BOOL wfreerdp_server_peer_is_local(int pId)
{
wfInfo* wfi;
freerdp_peer* peer;
wfi = wf_info_get_instance();
peer = wfi->peers[pId];
if (peer)
{
return peer->local;
}
else
{
return FALSE;
}
}
FREERDP_API BOOL wfreerdp_server_peer_is_connected(int pId)
{
wfInfo* wfi;
freerdp_peer* peer;
wfi = wf_info_get_instance();
peer = wfi->peers[pId];
if (peer)
{
return peer->connected;
}
else
{
return FALSE;
}
}
FREERDP_API BOOL wfreerdp_server_peer_is_activated(int pId)
{
wfInfo* wfi;
freerdp_peer* peer;
wfi = wf_info_get_instance();
peer = wfi->peers[pId];
if (peer)
{
return peer->activated;
}
else
{
return FALSE;
}
}
FREERDP_API BOOL wfreerdp_server_peer_is_authenticated(int pId)
{
wfInfo* wfi;
freerdp_peer* peer;
wfi = wf_info_get_instance();
peer = wfi->peers[pId];
if (peer)
{
return peer->authenticated;
}
else
{
return FALSE;
}
}

View File

@ -95,7 +95,10 @@ FREERDP_API void wfreerdp_server_free(wfServer* server);
FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server);
FREERDP_API UINT32 wfreerdp_server_num_peers();
FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr);
FREERDP_API BOOL wfreerdp_server_peer_is_local(int pId);
FREERDP_API BOOL wfreerdp_server_peer_is_connected(int pId);
FREERDP_API BOOL wfreerdp_server_peer_is_activated(int pId);
FREERDP_API BOOL wfreerdp_server_peer_is_authenticated(int pId);
#endif /* WF_INTERFACE_H */