hsmsd_cli.h

00001 /*   
00002  *   (c) Copyright 2008 Philipp Skadorov (philipp_s@users.sourceforge.net)
00003  *
00004  *   This file is part of FREESECS.
00005  *
00006  *   FREESECS is free software: you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation, either version 3 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   FREESECS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with FREESECS, see COPYING.
00018  *   If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 #ifndef _HSMSD_CLI_H
00021 #define _HSMSD_CLI_H
00022 
00023 typedef long int hsmsd_handle_t;
00024 
00028 typedef enum
00029 {
00030     CNX_NOT_CONNECTED,
00031     CNX_NOT_SELECTED,
00032     CNX_SELECTED
00033 }hsmsd_cnx_state_t;
00034 
00039 typedef struct
00040 {
00041     unsigned short  stream;
00042     unsigned short  function;
00043     unsigned char   wbit;
00044     unsigned int    sysbytes;
00045     unsigned int    data_len;
00046     unsigned char   data[1];
00047 } hsmsd_msg_t;
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052 
00056 typedef void (*hsmsd_msg_handler_t)(hsmsd_msg_t*);
00060 typedef void (*hsmsd_cnx_state_handler_t)(hsmsd_cnx_state_t);
00064 typedef void (*hsmsd_cnx_error_handler_t)(int);
00068 int hsmsd_alloc_handle              (hsmsd_handle_t *ph, const char *cnx_name);
00072 int hsmsd_free_handle               (hsmsd_handle_t *ph);
00076 int hsmsd_subscribe_for_msgs        (hsmsd_handle_t h, hsmsd_msg_handler_t mh);
00080 int hsmsd_unsubscribe_for_msgs      (hsmsd_handle_t h);
00084 int hsmsd_subscribe_for_cnx_state   (hsmsd_handle_t h, hsmsd_cnx_state_handler_t sh);
00088 int hsmsd_unsubscribe_for_cnx_state (hsmsd_handle_t h);
00092 int hsmsd_subscribe_for_cnx_error   (hsmsd_handle_t h, hsmsd_cnx_error_handler_t);
00096 int hsmsd_unsubscribe_for_cnx_error (hsmsd_handle_t h);
00100 int hsmsd_cnx_start                 (hsmsd_handle_t h);
00104 int hsmsd_cnx_stop                  (hsmsd_handle_t h);
00108 int hsmsd_cnx_get_state             (hsmsd_handle_t h, hsmsd_cnx_state_t *pstate);
00112 int hsmsd_cnx_send_msg              (hsmsd_handle_t h, hsmsd_msg_t *pmsg);
00113 
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 #endif /*_HSMSD_CLI_H*/

Generated on Fri Oct 3 15:30:01 2008 for FREESECS hsms by  doxygen 1.5.1