#include <gwenhywfar/plugin.h>
#include <gwenhywfar/nl_ssl.h>
#include <gwenhywfar/ipc.h>
#include <gwenhywfar/requestmgr.h>
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/netlayer.h>
#include <chipcard3/chipcard3.h>
#include "common/card.h"
#include "common/reader.h"
#include "connection_l.h"
#include "devicemanager/devicemanager_l.h"
#include "clientmanager/clientmanager_l.h"
#include "cardmanager/cardmanager_l.h"
#include "servicemanager/servicemanager_l.h"
#include "slavemanager/slavemanager_l.h"


Go to the source code of this file.
Defines | |
| #define | LCS_MARK_SERVER 1 |
| #define | LCS_MARK_DRIVER 2 |
| #define | LCS_MARK_CLIENT 3 |
| #define | LCS_MARK_SLAVE 4 |
| #define | LCS_PLUGIN_DRIVER "Libchipcard2_Driver" |
| #define | LCS_PLUGIN_SERVICE "Libchipcard2_Service" |
| #define | LCS_WORKRESULT_CHANGED 0 |
| #define | LCS_WORKRESULT_UNCHANGED 1 |
| #define | LCS_WORKRESULT_ERROR (-1) |
| #define | LCS_WORKRESULT_RESTART (-2) |
| #define | LCS_INITRESULT_OK 0 |
| #define | LCS_INITRESULT_ERROR (-1) |
| #define | LCS_INITRESULT_RESTART 1 |
| #define | LCS_DEFAULT_DHFILE "chipcardd-dh.pem" |
| #define | LCS_DEFAULT_CERTFILE "chipcardd-cert.pem" |
| #define | LCS_IPC_URL "/libchipcard2/server" |
| #define | LCS_PATH_DESTLIB "libchipcard2" |
| #define | LCS_PATH_DRIVER_INFODIR "DriverInfoDir" |
| #define | LCS_PATH_DRIVER_EXECDIR "DriverExecDir" |
| #define | LCS_PATH_SERVICE_EXECDIR "ServiceExecDir" |
| #define | LCS_PATH_SERVER_DATADIR "DataDir" |
| #define | LCS_PATH_SERVER_NEWCERTDIR "NewCertDir" |
| #define | LCS_PATH_SERVER_TRUSTEDCERTDIR "TrustedCertDir" |
| #define | LCS_PATH_SERVER_LOGDIR "LogDir" |
| #define | LCS_REGKEY_BASE "Software\\Libchipcard2\\Server\\Paths" |
Typedefs | |
| typedef struct LCS_SERVER | LCS_SERVER |
| typedef GWEN_NL_SSL_ASKADDCERT_RESULT(* | LCS_SERVER_ASKADDCERT_FN )(LCS_SERVER *cs, GWEN_NETLAYER *nl, const GWEN_SSLCERTDESCR *cert) |
Enumerations | |
| enum | LCS_SERVER_ROLE { LCS_Server_RoleStandAlone = 0, LCS_Server_RoleMaster, LCS_Server_RoleSlave } |
Functions | |
| LCS_SERVER * | LCS_Server_new () |
| void | LCS_Server_free (LCS_SERVER *cs) |
| int | LCS_Server_Init (LCS_SERVER *cs, GWEN_DB_NODE *db) |
| int | LCS_Server_Fini (LCS_SERVER *cs, GWEN_DB_NODE *db) |
| int | LCS_Server_Work (LCS_SERVER *cs) |
| void | LCS_Server_BeginUseReaders (LCS_SERVER *cs) |
| void | LCS_Server_EndUseReaders (LCS_SERVER *cs, int count) |
| LCS_SERVER_ASKADDCERT_FN | LCS_Server_SetAskAddCertFn (LCS_SERVER *cs, LCS_SERVER_ASKADDCERT_FN fn) |
| void | LCS_Server_UseConnectionFor (LCS_SERVER *cs, GWEN_NETLAYER *conn, LCS_CONNECTION_TYPE t, GWEN_TYPE_UINT32 ipcId) |
| GWEN_IPCMANAGER * | LCS_Server_GetIpcManager (const LCS_SERVER *cs) |
| GWEN_IPC_REQUEST_MANAGER * | LCS_Server_GetRequestManager (const LCS_SERVER *cs) |
| LCDM_DEVICEMANAGER * | LCS_Server_GetDeviceManager (const LCS_SERVER *cs) |
| LCCM_CARDMANAGER * | LCS_Server_GetCardManager (const LCS_SERVER *cs) |
| LCSV_SERVICEMANAGER * | LCS_Server_GetServiceManager (const LCS_SERVER *cs) |
| LCSL_SLAVEMANAGER * | LCS_Server_GetSlaveManager (const LCS_SERVER *cs) |
| int | LCS_Server_ReplaceVar (const char *path, const char *var, const char *value, GWEN_BUFFER *nbuf) |
| int | LCS_Server_SendErrorResponse (LCS_SERVER *cs, GWEN_TYPE_UINT32 rid, int code, const char *text) |
| int | LCS_Server_CheckIpcResponse (GWEN_DB_NODE *db) |
| LCS_SERVER_ROLE | LCS_Server_GetRole (const LCS_SERVER *cs) |
| GWEN_NL_SSL_ASKADDCERT_RESULT | LCS_Server_AskAddCert (GWEN_NETLAYER *nl, const GWEN_SSLCERTDESCR *cert, void *user_data) |
| void | LCS_Server_DumpState (const LCS_SERVER *cs) |
| int | LCS_Server_GetClientCount (LCS_SERVER *cs) |
| void | LCS_Server_TriggerHwScan (LCS_SERVER *cs) |
Functions Called by other managers | |
| void | LCS_Server_DriverChg (LCS_SERVER *cs, GWEN_TYPE_UINT32 did, const char *driverType, const char *driverName, const char *libraryFile, LC_DRIVER_STATUS newSt, const char *reason) |
| void | LCS_Server_ReaderChg (LCS_SERVER *cs, GWEN_TYPE_UINT32 did, LCCO_READER *r, LC_READER_STATUS newSt, const char *reason) |
| void | LCS_Server_NewReader (LCS_SERVER *cs, LCCO_READER *r) |
| void | LCS_Server_NewCard (LCS_SERVER *cs, LCCO_CARD *card) |
| void | LCS_Server_CardRemoved (LCS_SERVER *cs, LCCO_CARD *card) |
| void | LCS_Server_ConnectionDown (LCS_SERVER *cs, GWEN_NETLAYER *conn) |
| void | LCS_Server_ServiceChg (LCS_SERVER *cs, GWEN_TYPE_UINT32 sid, const char *serviceType, const char *serviceName, LC_SERVICE_STATUS newSt, const char *reason) |
| #define LCS_MARK_SERVER 1 |
| #define LCS_MARK_DRIVER 2 |
| #define LCS_MARK_CLIENT 3 |
| #define LCS_MARK_SLAVE 4 |
| #define LCS_DEFAULT_DHFILE "chipcardd-dh.pem" |
defaults
| #define LCS_DEFAULT_CERTFILE "chipcardd-cert.pem" |
| #define LCS_IPC_URL "/libchipcard2/server" |
| #define LCS_PATH_DESTLIB "libchipcard2" |
paths
| #define LCS_PATH_DRIVER_INFODIR "DriverInfoDir" |
| #define LCS_PATH_DRIVER_EXECDIR "DriverExecDir" |
| #define LCS_PATH_SERVICE_EXECDIR "ServiceExecDir" |
| #define LCS_PATH_SERVER_DATADIR "DataDir" |
| #define LCS_PATH_SERVER_NEWCERTDIR "NewCertDir" |
| #define LCS_PATH_SERVER_TRUSTEDCERTDIR "TrustedCertDir" |
| #define LCS_PATH_SERVER_LOGDIR "LogDir" |
| #define LCS_REGKEY_BASE "Software\\Libchipcard2\\Server\\Paths" |
| #define LCS_PLUGIN_DRIVER "Libchipcard2_Driver" |
If this name is changed it must be changed in all plugin description files of the drivers!
| #define LCS_PLUGIN_SERVICE "Libchipcard2_Service" |
If this name is changed it must be changed in all plugin description files of the services!
| #define LCS_WORKRESULT_CHANGED 0 |
| #define LCS_WORKRESULT_UNCHANGED 1 |
| #define LCS_WORKRESULT_ERROR (-1) |
| #define LCS_WORKRESULT_RESTART (-2) |
| #define LCS_INITRESULT_OK 0 |
| #define LCS_INITRESULT_ERROR (-1) |
| #define LCS_INITRESULT_RESTART 1 |
| typedef struct LCS_SERVER LCS_SERVER |
| typedef GWEN_NL_SSL_ASKADDCERT_RESULT(* LCS_SERVER_ASKADDCERT_FN)(LCS_SERVER *cs, GWEN_NETLAYER *nl, const GWEN_SSLCERTDESCR *cert) |
| enum LCS_SERVER_ROLE |
| LCS_SERVER* LCS_Server_new | ( | ) |
| void LCS_Server_free | ( | LCS_SERVER * | cs | ) |
| int LCS_Server_Init | ( | LCS_SERVER * | cs, | |
| GWEN_DB_NODE * | db | |||
| ) |
| int LCS_Server_Fini | ( | LCS_SERVER * | cs, | |
| GWEN_DB_NODE * | db | |||
| ) |
| int LCS_Server_Work | ( | LCS_SERVER * | cs | ) |
| void LCS_Server_BeginUseReaders | ( | LCS_SERVER * | cs | ) |
This function is used when a client sends a WaitForCard-request.
| void LCS_Server_EndUseReaders | ( | LCS_SERVER * | cs, | |
| int | count | |||
| ) |
| LCS_SERVER_ASKADDCERT_FN LCS_Server_SetAskAddCertFn | ( | LCS_SERVER * | cs, | |
| LCS_SERVER_ASKADDCERT_FN | fn | |||
| ) |
| void LCS_Server_UseConnectionFor | ( | LCS_SERVER * | cs, | |
| GWEN_NETLAYER * | conn, | |||
| LCS_CONNECTION_TYPE | t, | |||
| GWEN_TYPE_UINT32 | ipcId | |||
| ) |
This tells the server to use this connection. Basically this just sets the connectionUp callback to call an internal server function which in turn calls LCS_Server_ConnectionDown.
| void LCS_Server_DriverChg | ( | LCS_SERVER * | cs, | |
| GWEN_TYPE_UINT32 | did, | |||
| const char * | driverType, | |||
| const char * | driverName, | |||
| const char * | libraryFile, | |||
| LC_DRIVER_STATUS | newSt, | |||
| const char * | reason | |||
| ) |
| void LCS_Server_ReaderChg | ( | LCS_SERVER * | cs, | |
| GWEN_TYPE_UINT32 | did, | |||
| LCCO_READER * | r, | |||
| LC_READER_STATUS | newSt, | |||
| const char * | reason | |||
| ) |
| void LCS_Server_NewReader | ( | LCS_SERVER * | cs, | |
| LCCO_READER * | r | |||
| ) |
Make a new reader known to the system.
| void LCS_Server_NewCard | ( | LCS_SERVER * | cs, | |
| LCCO_CARD * | card | |||
| ) |
Makes the given new card known to the system. Right after this function is called by the LCDM_DeviceManager it is free'd, so the handler in this function MUST call LCCO_Card_Attach if it wants to use this card afterwards.
| void LCS_Server_CardRemoved | ( | LCS_SERVER * | cs, | |
| LCCO_CARD * | card | |||
| ) |
| void LCS_Server_ConnectionDown | ( | LCS_SERVER * | cs, | |
| GWEN_NETLAYER * | conn | |||
| ) |
| void LCS_Server_ServiceChg | ( | LCS_SERVER * | cs, | |
| GWEN_TYPE_UINT32 | sid, | |||
| const char * | serviceType, | |||
| const char * | serviceName, | |||
| LC_SERVICE_STATUS | newSt, | |||
| const char * | reason | |||
| ) |
| GWEN_IPCMANAGER* LCS_Server_GetIpcManager | ( | const LCS_SERVER * | cs | ) |
| GWEN_IPC_REQUEST_MANAGER* LCS_Server_GetRequestManager | ( | const LCS_SERVER * | cs | ) |
| LCDM_DEVICEMANAGER* LCS_Server_GetDeviceManager | ( | const LCS_SERVER * | cs | ) |
| LCCM_CARDMANAGER* LCS_Server_GetCardManager | ( | const LCS_SERVER * | cs | ) |
| LCSV_SERVICEMANAGER* LCS_Server_GetServiceManager | ( | const LCS_SERVER * | cs | ) |
| LCSL_SLAVEMANAGER* LCS_Server_GetSlaveManager | ( | const LCS_SERVER * | cs | ) |
| int LCS_Server_ReplaceVar | ( | const char * | path, | |
| const char * | var, | |||
| const char * | value, | |||
| GWEN_BUFFER * | nbuf | |||
| ) |
| int LCS_Server_SendErrorResponse | ( | LCS_SERVER * | cs, | |
| GWEN_TYPE_UINT32 | rid, | |||
| int | code, | |||
| const char * | text | |||
| ) |
| int LCS_Server_CheckIpcResponse | ( | GWEN_DB_NODE * | db | ) |
| LCS_SERVER_ROLE LCS_Server_GetRole | ( | const LCS_SERVER * | cs | ) |
| GWEN_NL_SSL_ASKADDCERT_RESULT LCS_Server_AskAddCert | ( | GWEN_NETLAYER * | nl, | |
| const GWEN_SSLCERTDESCR * | cert, | |||
| void * | user_data | |||
| ) |
| void LCS_Server_DumpState | ( | const LCS_SERVER * | cs | ) |
| int LCS_Server_GetClientCount | ( | LCS_SERVER * | cs | ) |
| void LCS_Server_TriggerHwScan | ( | LCS_SERVER * | cs | ) |
1.5.3