|
|
#ifdef __cplusplus
|
|
|
extern "C"
|
|
|
{
|
|
|
#endif
|
|
|
|
|
|
#include "glbtypes.h"
|
|
|
#include "sysincs.h"
|
|
|
#include "signal.h"
|
|
|
#include "mmsdefs.h"
|
|
|
#include "mms_pvmd.h"
|
|
|
#include "mms_pvar.h"
|
|
|
#include "mms_vvar.h"
|
|
|
#include "mms_err.h"
|
|
|
#include "mms_pcon.h"
|
|
|
#include "asn1defs.h"
|
|
|
#include "mmsop_en.h"
|
|
|
#include "locale.h"
|
|
|
|
|
|
#include "mvl_acse.h"
|
|
|
#include "mvl_log.h"
|
|
|
#include "tp4api.h"
|
|
|
#include "clntobj.h"
|
|
|
#include "smpval.h"
|
|
|
|
|
|
#include "lean_a.h"
|
|
|
#include "scl.h"
|
|
|
#include "sx_arb.h"
|
|
|
#include "mloguser.h"
|
|
|
|
|
|
#include "mvl_defs.h"
|
|
|
#include "str_util.h"
|
|
|
|
|
|
#define MAX_REF_LEN 65 //最大的引用长度
|
|
|
#define MAX_NAME_LEN 128 //最大的名称长度
|
|
|
#define MAX_FILE_NAME 255 //最大文件名称长度
|
|
|
|
|
|
#define MAX_NAME_BUF 5000 //最大名称缓冲区长度
|
|
|
#define MAX_RPT_NAME_BUF 1000 //最大报告控制块名称缓冲区长度
|
|
|
#define MAX_OBJ_NAME 5000 //数据集中元素的最大数量
|
|
|
#define MAX_RPT_DATA_NUM 5000 //一个报告中的最大数据数目
|
|
|
|
|
|
|
|
|
//报告控制块相关结构体定义
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_INT mmsbool; /* named so not confused with C++ 'bool' type */
|
|
|
ST_INT int8u;
|
|
|
ST_INT int16u; /* for SqNum. */
|
|
|
/* NOTE: UCA server sends int8u for SqNum */
|
|
|
/* but it's safe to decode it as int16u */
|
|
|
ST_INT int32u; /* for IntgPd */
|
|
|
ST_INT vstring65; /* for RptID & ObjectReference */
|
|
|
ST_INT btime6; /* for EntryTime */
|
|
|
ST_INT ostring8; /* for EntryID */
|
|
|
ST_INT vstring32; /* for RptId */
|
|
|
ST_INT bvstring6; /* for TrgOps (IEC) */
|
|
|
ST_INT bvstring8; /* for OptFlds,TrgOps (UCA) */
|
|
|
ST_INT bvstring10; /* for OptFlds (IEC) */
|
|
|
ST_INT bstr6; /* for Reason (IEC) */
|
|
|
ST_INT bstr8; /* for Reason (UCA) */
|
|
|
ST_INT bstr9; /* for Writing OptFlds (IEC). Can't write all 10 bits.*/
|
|
|
} RPT_TYPEIDS;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_CHAR RptID[66];
|
|
|
struct /* BVstring */
|
|
|
{
|
|
|
ST_INT16 len_1;
|
|
|
ST_UCHAR data_1[2]; /* BVstring9 - need 2 bytes */
|
|
|
} OptFlds;
|
|
|
ST_UINT16 SqNum;
|
|
|
MMS_BTIME6 TimeOfEntry;
|
|
|
ST_CHAR DatSetNa[66];
|
|
|
ST_BOOLEAN BufOvfl;
|
|
|
ST_UINT16 SubSeqNum;
|
|
|
ST_BOOLEAN MoreSegmentsFollow;
|
|
|
ST_UINT8 EntryID [8]; /* ostring8 */
|
|
|
ST_UINT32 ConfRev;
|
|
|
ST_UINT8 *Inclusion; /* ptr to bitstring */
|
|
|
/* Must alloc appropriate size */
|
|
|
/* buffer for bitstring. */
|
|
|
ST_CHAR *dataRefName; /* ptr to array of dataRefName */
|
|
|
MMS_BVSTRING *Reason; /* ptr to array of Reason bitstrings */
|
|
|
/* WARNING: this only works for variable*/
|
|
|
/* len bitstring up to 8 bits. */
|
|
|
} RCB_DATA;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
MVL_VAR_ASSOC * RptID;
|
|
|
MVL_VAR_ASSOC * OptFlds;
|
|
|
MVL_VAR_ASSOC * SqNum;
|
|
|
MVL_VAR_ASSOC * TimeOfEntry;
|
|
|
MVL_VAR_ASSOC * DatSetNa;
|
|
|
MVL_VAR_ASSOC * BufOvfl;
|
|
|
MVL_VAR_ASSOC * SubSeqNum;
|
|
|
MVL_VAR_ASSOC * MoreSegmentsFollow;
|
|
|
MVL_VAR_ASSOC * EntryID;
|
|
|
MVL_VAR_ASSOC * ConfRev;
|
|
|
MVL_VAR_ASSOC * Inclusion;
|
|
|
MVL_VAR_ASSOC ** dataRefName; /* array of ptrs */
|
|
|
MVL_VAR_ASSOC ** dataValue; /* array of ptrs */
|
|
|
MVL_VAR_ASSOC ** Reason; /* array of ptrs */
|
|
|
} RCB_VAR;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
DBL_LNK link; /* allows linked list of this struct */
|
|
|
ST_INT rcb_type; /* RCB_TYPE_UCA, RCB_TYPE_IEC_BRCB, etc. */
|
|
|
ST_INT rcb_create_type; /*rcb建立方式,0表示动态建立,1表示静态建立 liwei 2012.07.13*/
|
|
|
/* see RCB_TYPE.. defines in 'mvl_uca.h'. */
|
|
|
ST_CHAR RptID [66]; /* RptID of this RCB (Vstring65) */
|
|
|
OBJECT_NAME **varNameArray; /* array of variable names in NVL */
|
|
|
ST_INT numDsVar; /* num variables in rpt dataset */
|
|
|
ST_INT *typeIdArr; /* array of type ids */
|
|
|
ST_INT InclusionTypeid; /*Type ID for Inclusion Bitstring*/
|
|
|
RCB_DATA rcb_data;
|
|
|
RCB_VAR rcb_var;
|
|
|
|
|
|
} RCB_INFO;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
RPT_TYPEIDS *rpt_typeids;
|
|
|
RCB_INFO *rcb_info_list; /* linked list of RCB_INFO structs */
|
|
|
} ALL_RCB_INFO; /* used to track multiple RCBs. */
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_CHAR *RptID;
|
|
|
struct /* BVstring */
|
|
|
{
|
|
|
ST_UINT16 len_1;
|
|
|
ST_UCHAR data_1[2]; /* BVstring9 - need 2 bytes */
|
|
|
} *OptFlds;
|
|
|
ST_UINT16 *SqNum;
|
|
|
MMS_BTIME6 *TimeOfEntry;
|
|
|
ST_CHAR *DatSetNa;
|
|
|
ST_BOOLEAN *BufOvfl;
|
|
|
ST_UINT16 *SubSeqNum;
|
|
|
ST_BOOLEAN *MoreSegmentsFollow;
|
|
|
ST_UINT8 *EntryID; /* ostring8 */
|
|
|
ST_UINT32 *ConfRev;
|
|
|
ST_UINT8 *Inclusion; /* ptr to bitstring */
|
|
|
/* Must alloc appropriate size */
|
|
|
/* buffer for bitstring. */
|
|
|
ST_CHAR **dataRefName; /* ptr to array of dataRefName */
|
|
|
ST_VOID **Value;
|
|
|
MMS_BVSTRING **Reason; /* ptr to array of Reason bitstrings */
|
|
|
|
|
|
/* 增加字段,存储此报告发送的数据集所包含的数据的个数 */
|
|
|
ST_INT num_data;
|
|
|
|
|
|
}RPT_INFO;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
time_t time; /* number of seconds elapsed since midnight (00:00:00), January 1, 1970 */
|
|
|
}MMS_GTIME;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_UCHAR value[1];
|
|
|
}MMS_BSTRING;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_INT32 numMSec; /* Number of milliseconds since midnight */
|
|
|
}MMS_BTIME4;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_UCHAR value[1];
|
|
|
}MMS_OSTRING;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_INT16 data_len;
|
|
|
ST_UCHAR value[1];
|
|
|
}MMS_OVSTRING;
|
|
|
|
|
|
typedef wchar_t ST_WCHAR;
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_CHAR name[MAX_REF_LEN + 1]; /* 指其Reference */
|
|
|
ST_INT type; /* 指其rt->el_tag */
|
|
|
ST_INT len; /* 指其rt->u.p.el_len */
|
|
|
|
|
|
ST_INT data_size; /* 指叶子数据长度 */
|
|
|
union
|
|
|
{
|
|
|
ST_BOOLEAN *bool_value;
|
|
|
ST_UCHAR *bcd_value;
|
|
|
|
|
|
ST_INT8 *int8_value;
|
|
|
ST_INT16 *int16_value;
|
|
|
ST_INT32 *int32_value;
|
|
|
|
|
|
ST_UINT8 *uint8_value;
|
|
|
ST_UINT16 *uint16_value;
|
|
|
ST_UINT32 *uint32_value;
|
|
|
|
|
|
ST_FLOAT *float_value;
|
|
|
ST_DOUBLE *double_value;
|
|
|
|
|
|
ST_CHAR *vstring_value;
|
|
|
ST_CHAR *fstring_value;
|
|
|
ST_WCHAR *utf8string_value;
|
|
|
ST_WCHAR *utf8vstring_value;
|
|
|
|
|
|
MMS_GTIME *gtime_value;
|
|
|
MMS_BTIME4 *btime4_value;
|
|
|
MMS_BTIME6 *btime6_value;
|
|
|
MMS_UTC_TIME *utctime_value;
|
|
|
|
|
|
MMS_BSTRING *bstring_value;
|
|
|
MMS_BVSTRING *bvstring_value;
|
|
|
|
|
|
MMS_OSTRING *ostring_value;
|
|
|
MMS_OVSTRING *ovstring_value;
|
|
|
|
|
|
ST_VOID *any_value;
|
|
|
}value;
|
|
|
|
|
|
MMS_BVSTRING *reason_code;
|
|
|
}PRIM_DATA;
|
|
|
|
|
|
//内存监控变量
|
|
|
static ST_CHAR *spareMem;
|
|
|
static ST_INT memErrDetected;
|
|
|
|
|
|
//服务器断开回调函数指针
|
|
|
typedef unsigned int (*SERVER_DISC_CALLBACK_FUN)(char *server_name, int reason);
|
|
|
//报告接收回调函数指针
|
|
|
typedef unsigned int (*RPT_CALLBACK_FUN)(char *server_name, RPT_INFO *rpt_info);
|
|
|
//控制报告接收回调函数指针
|
|
|
typedef unsigned int (*CTRL_RPT_CALLBACK_FUN)(char *server_name, char *oper_name, char oper_result);
|
|
|
|
|
|
//mms数据结构信息
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_CHAR name[MAX_REF_LEN + 1]; //本层名称
|
|
|
ST_INT type; //数据类型
|
|
|
ST_INT len; //数据长度
|
|
|
ST_INT size; //数据占用字节数
|
|
|
}DATA_DIR;
|
|
|
|
|
|
//mms文件列表结构信息
|
|
|
typedef struct
|
|
|
{
|
|
|
ST_UINT32 fsize; //文件长度
|
|
|
ST_BOOLEAN mtimpres; //是否显示最后一次修改时间标志
|
|
|
time_t mtime; //文件最后一次修改时间
|
|
|
ST_CHAR filename [MAX_FILE_NAME+1]; //文件名称
|
|
|
} DIR_ENTRY;
|
|
|
|
|
|
//客户端控制信息结构体,每连接一个服务器,应创建一个该结构体实例,并加入链表中
|
|
|
typedef struct
|
|
|
{
|
|
|
DBL_LNK l; //存放双向循环链表指针的结构体
|
|
|
ST_CHAR sever_name[MAX_NAME_LEN]; //被调用的远程服务器名称
|
|
|
ST_UINT8 level;
|
|
|
MVL_NET_INFO *clientNetInfo; //存放和远程服务器间联系的网络信息的结构体
|
|
|
MVL_VMD_CTRL *client_vmd; //存放远程服务器数据信息的结构体
|
|
|
ALL_RCB_INFO *all_rcb_info;
|
|
|
SERVER_DISC_CALLBACK_FUN server_disk_callback_fun;//服务器断开连接回调函数
|
|
|
RPT_CALLBACK_FUN rpt_callback_fun; //报告接收回调函数
|
|
|
CTRL_RPT_CALLBACK_FUN ctrl_rpt_callback_fun; //控制结束报告回调函数
|
|
|
}CLIENT_CTRL;
|
|
|
|
|
|
CLIENT_CTRL *head_client_ctrl_list;
|
|
|
|
|
|
|
|
|
/*外部接口函数*/
|
|
|
|
|
|
//初始化及连接管理函数
|
|
|
__declspec(dllexport) unsigned int mms_init();
|
|
|
__declspec(dllexport) unsigned int mms_quit();
|
|
|
__declspec(dllexport) unsigned int mms_connect(char *server_name, int level);
|
|
|
__declspec(dllexport) unsigned int mms_disconnect(char *server_name);
|
|
|
|
|
|
//目录服务函数
|
|
|
__declspec(dllexport) unsigned int mms_directory_service_fun(char *server_name);
|
|
|
__declspec(dllexport) unsigned int mms_directory_create_fun(char *server_name, char *scl_file_name, char *ied_name, char *access_point_name);//2010.5.26
|
|
|
__declspec(dllexport) unsigned int mms_free_directory_service_fun(char *server_name);//添加函数,用于释放指定服务器的虚拟设备控制体资源
|
|
|
|
|
|
//获得逻辑设备、逻辑节点、数据集、日志名称列表函数
|
|
|
__declspec(dllexport) unsigned int mms_fetch_domain_name_list(char *server_name, char(**domain_names)[MAX_NAME_LEN], int *num_dom);
|
|
|
__declspec(dllexport) void mms_free_domain_name_list(char (*domain_names)[MAX_NAME_LEN]);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_var_name_list(char *server_name, char *domain_name, char(**var_names)[MAX_NAME_LEN], int *num_var);
|
|
|
__declspec(dllexport) void mms_free_var_name_list(char (*var_names)[MAX_NAME_LEN]);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_dataset_name_list(char *server_name, char *domain_name, char (**ds_names)[MAX_NAME_LEN], int *num_ds);
|
|
|
__declspec(dllexport) void mms_free_dataset_name_list(char (*ds_names)[MAX_NAME_LEN]);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_dataset_entry_name_list(char *server_name, char *dataset_ref, char (**var_refs)[MAX_NAME_LEN], int *num_vars);
|
|
|
__declspec(dllexport) void mms_free_dataset_entry_name_list(char (*var_refs)[MAX_NAME_LEN]);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_log_name_list(char *server_name, char *domain_name, char (**log_names)[MAX_NAME_LEN], int *log_num);
|
|
|
__declspec(dllexport) void mms_free_log_name_list(char (*log_names)[MAX_NAME_LEN]);
|
|
|
|
|
|
//数据目录通用函数,可获得指定引用下一级的数据信息目录
|
|
|
__declspec(dllexport) unsigned int mms_fetch_data_directory(char *server_name, char *var_ref, DATA_DIR **dir_info, int *num);
|
|
|
__declspec(dllexport) void mms_free_data_directory(DATA_DIR *dir_info);
|
|
|
|
|
|
//叶子节点数据读写函数(本地)
|
|
|
__declspec(dllexport) unsigned int mms_local_read_prim_data(char *server_name, char *prim_ref, void *prim_buf);
|
|
|
__declspec(dllexport) unsigned int mms_local_write_prim_data(char *server_name, char *prim_ref, void *prim_buf);
|
|
|
|
|
|
//远程读写1个数据至本地数据缓冲区中
|
|
|
__declspec(dllexport) unsigned int mms_remote_read_1_data(char *server_name, char *data_ref);
|
|
|
__declspec(dllexport) unsigned int mms_remote_write_1_data(char *server_name, char *data_ref);
|
|
|
//远程读写多个数据至本地数据缓冲区中
|
|
|
__declspec(dllexport) unsigned int mms_remote_read_data(char *server_name, int var_num, char **var_refs, void *reserved);
|
|
|
__declspec(dllexport) unsigned int mms_remote_write_data(char *server_name, int var_num, char **var_refs, void *reserved);
|
|
|
|
|
|
//远程读写指定数据集数据至本地数据缓冲区
|
|
|
__declspec(dllexport) unsigned int mms_remote_read_dataset(char *server_name, char *dataset_ref, void *reserved );
|
|
|
__declspec(dllexport) unsigned int mms_remote_write_dataset(char *server_name, char *dataset_ref, void *reserved );
|
|
|
|
|
|
//动态建立数据集及删除数据集函数
|
|
|
__declspec(dllexport) unsigned int mms_create_dataset(char *server_name, char *dataset_ref, int var_num, char (*var_refs)[MAX_NAME_LEN], void *reserved);
|
|
|
__declspec(dllexport) unsigned int mms_delete_dataset(char *server_name, char *dataset_ref, void *reserved);
|
|
|
|
|
|
//报告回调函数注册
|
|
|
__declspec(dllexport) unsigned int mms_register_rpt_callback(char *server_name, RPT_CALLBACK_FUN callback_fun);
|
|
|
//服务器断开连接函数注册
|
|
|
__declspec(dllexport) unsigned int mms_register_server_disc_callback(char *server_name, SERVER_DISC_CALLBACK_FUN callback_fun);
|
|
|
//控制报告回调函数注册
|
|
|
__declspec(dllexport) unsigned int mms_register_ctrl_rpt_callback(char *server_name, CTRL_RPT_CALLBACK_FUN callback_fun);
|
|
|
|
|
|
//将报告数据转换为叶子节点数据的转换函数
|
|
|
__declspec(dllexport) unsigned int mms_rpt_info_to_prim_data_list(char *server_name, RPT_INFO *rpt_info, PRIM_DATA **prims, int *num );
|
|
|
__declspec(dllexport) void mms_free_prim_data_list(PRIM_DATA *prim_list, int num );
|
|
|
|
|
|
//获取与释放文件列表函数
|
|
|
__declspec(dllexport) unsigned int mms_get_file_list(char *server_name, char *fs_name, DIR_ENTRY **file_info, int *file_num, void *reserved );
|
|
|
__declspec(dllexport) unsigned int mms_free_file_list(char *server_name, DIR_ENTRY *dir_entries );
|
|
|
|
|
|
//获取远程服务器文件函数
|
|
|
__declspec(dllexport) unsigned int mms_get_file(char *server_name, char *rem_file_name, char *loc_file_name, void *reserved);
|
|
|
//更改远程服务器上文件名函数
|
|
|
__declspec(dllexport) unsigned int mms_rename_file(char *server_name, char *old_file_name, char *new_file_name, void *reserved );
|
|
|
//用本地文件替代远程服务器上的文件函数
|
|
|
__declspec(dllexport) unsigned int mms_set_file(char *server_name, char *loc_file_name, char *rem_file_name, void *reserved );
|
|
|
//删除远程服务器文件函数
|
|
|
__declspec(dllexport) unsigned int mms_delete_file(char *server_name, char *file_name, void *reserved);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_server_create_fun(char *server_name, char *scl_file_name, char *ied_name, char *access_point_name);
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_modify_server_ip_addr(char *server_name, ST_ULONG ip_addr);
|
|
|
|
|
|
////////////////////////////////////
|
|
|
__declspec(dllexport) unsigned int mms_jinit(char *server_name, char *log_ref);
|
|
|
__declspec(dllexport) unsigned int mms_jstat(char *server_name, char *log_ref);
|
|
|
__declspec(dllexport) unsigned int mms_jread(char *server_name, char *log_ref, int start_flag, int stop_flag,
|
|
|
char *start_entry, long num_of_entries, MMS_BTOD start_time, MMS_BTOD end_time);
|
|
|
|
|
|
__declspec(dllexport) unsigned int set_opear_name(char *opear_name);
|
|
|
|
|
|
|
|
|
////////////////////////////////////
|
|
|
typedef struct
|
|
|
{
|
|
|
char name[256];
|
|
|
int type;
|
|
|
int size;
|
|
|
char desc[1025];
|
|
|
}DATA_INFO;
|
|
|
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_dataset_datainfo(char *server_name,
|
|
|
char *dataset_ref,
|
|
|
DATA_INFO **data_info,
|
|
|
int *num,
|
|
|
int desc_get_mode,
|
|
|
int leaf_mode);
|
|
|
|
|
|
|
|
|
__declspec(dllexport) unsigned int mms_fetch_leaf_data_info(char *server_name,
|
|
|
char *data_ref,
|
|
|
char *comp_name,
|
|
|
DATA_INFO *data_info,
|
|
|
int *leaf_num,
|
|
|
int leaf_mode);
|
|
|
|
|
|
|
|
|
unsigned int get_dU_str(char *server_name, char *in_str, char *out_str);
|
|
|
|
|
|
//获取指定数据引用的类型及长度
|
|
|
__declspec(dllexport) unsigned int mms_fetch_data_type(char *server_name, char *var_ref, int *data_type, int *data_size, int *data_len);
|
|
|
//////////////////////////////////////
|
|
|
/*以下暂时为内部函数,不提供外部接口*/
|
|
|
MVL_VAR_ASSOC * fetch_vmd_var_ctrl(MVL_VMD_CTRL *vmd_ctrl, char *data_ref, char *data_name, char *ld_name, ST_UINT8 level);
|
|
|
MVL_NVLIST_CTRL * fetch_vmd_nvl_ctrl(MVL_VMD_CTRL *vmd_ctrl, char *dataset_ref, char *dataset_name, char *ld_name);
|
|
|
ST_RET fetch_remote_name_list(MVL_NET_INFO *clientNetInfo, char *name_dom, char(*name_list)[128], char(*rpt_list)[128], int *num_name, int *num_rpt, int mms_class, int objscope, ST_UINT8 level);
|
|
|
ST_RET fetch_remote_domain_name_list(MVL_NET_INFO *clientNetInfo, char(*name_list)[128], int *num_dom);
|
|
|
ST_RET fetch_remote_var_dom_list(MVL_NET_INFO *clientNetInfo, char *name_dom, char(*name_list)[128], char(*rpt_list)[128], int *num_var, int *num_rpt, ST_UINT8 level);
|
|
|
ST_RET fetch_remote_var_attr_dom(MVL_NET_INFO *clientNetInfo, MVL_VMD_CTRL *vmd_ctrl, char *name_dom, char *name_var, int *type_id, int *data_size);
|
|
|
ST_RET fetch_remote_nvl_dom_list(MVL_NET_INFO *clientNetInfo, char *name_dom, char(*name_list)[128], int *num_nvl);
|
|
|
ST_RET fetch_remote_nvl_attr_dom(MVL_NET_INFO *clientNetInfo, char *name_dom, char *name_nvl, OBJECT_NAME *var_obj, int *num_var_nvl);
|
|
|
MVL_NET_INFO *SearchConnectServer(char *server_name, CLIENT_CTRL **client_ctrl);
|
|
|
CLIENT_CTRL * FindConnectServer(MVL_NET_INFO *clientNetInfo);
|
|
|
|
|
|
/*以下为mms内部函数,不提供外部接口*/
|
|
|
void client_server(LPVOID pParam);
|
|
|
static ST_VOID disc_ind_fun (MVL_NET_INFO *cc, ST_INT discType);
|
|
|
|
|
|
MVL_NET_INFO *connectToServer (ST_CHAR *clientARName, ST_CHAR *serverARName);
|
|
|
ST_RET disconnectFromServer (MVL_NET_INFO *clientNetInfo);
|
|
|
ST_RET waitReqDone (MVL_REQ_PEND *req, ST_INT timeout);
|
|
|
ST_VOID doCommService ();
|
|
|
|
|
|
unsigned int init_iec_rpt (MVL_NET_INFO *clientNetInfo, RPT_TYPEIDS *rpt_typeids,MVL_VMD_CTRL *vmd_ctrl,
|
|
|
ST_CHAR *dom_name, ST_CHAR *rcb_name);
|
|
|
|
|
|
ST_RET var_read (MVL_NET_INFO *net_info, ST_CHAR *varName, ST_INT scope,
|
|
|
ST_CHAR *domName,ST_INT type_id, ST_VOID *dataDest,
|
|
|
ST_INT timeOut);
|
|
|
|
|
|
ST_RET nvl_read (MVL_NET_INFO *net_info, ST_CHAR *nvlName, ST_INT scope,
|
|
|
ST_CHAR *domName,ST_INT *type_id, ST_CHAR **dataDest,
|
|
|
ST_INT num_var, ST_INT timeOut);
|
|
|
|
|
|
ST_RET var_write (MVL_NET_INFO *netInfo, ST_CHAR *varName, ST_INT scope,
|
|
|
ST_CHAR *domName, ST_INT type_id, ST_VOID *dataSrc,
|
|
|
ST_INT timeOut);
|
|
|
|
|
|
ST_RET nvl_write (MVL_NET_INFO *net_info, ST_CHAR (*varName)[MAX_REF_LEN], ST_INT scope,
|
|
|
ST_CHAR *domName,ST_INT *type_id, ST_CHAR **dataSrc,
|
|
|
ST_INT num_var, ST_INT timeOut);
|
|
|
|
|
|
ST_RET m_var_read (MVL_NET_INFO *net_info, ST_CHAR (*varName)[MAX_REF_LEN], ST_INT scope,
|
|
|
ST_CHAR (*domName)[MAX_REF_LEN], ST_INT *type_id, ST_CHAR **dataDest,
|
|
|
ST_INT num_var, ST_INT timeOut);
|
|
|
|
|
|
ST_RET m_var_write (MVL_NET_INFO *net_info, ST_CHAR (*varName)[MAX_REF_LEN], ST_INT scope,
|
|
|
ST_CHAR (*domName)[MAX_REF_LEN], ST_INT *type_id, ST_CHAR **dataSrc,
|
|
|
ST_INT num_var, ST_INT timeOut);
|
|
|
|
|
|
static ST_RET getFile (MVL_NET_INFO *clientNetInfo, ST_CHAR *loc_file, ST_CHAR *rem_file);
|
|
|
|
|
|
static ST_VOID init_mem ();
|
|
|
static ST_VOID free_mem();
|
|
|
|
|
|
static ST_VOID init_log_cfg (ST_VOID);
|
|
|
static ST_VOID mem_chk_error_detected (ST_VOID);
|
|
|
static ST_VOID *my_malloc_err (ST_UINT size);
|
|
|
static ST_VOID *my_calloc_err (ST_UINT num, ST_UINT size);
|
|
|
static ST_VOID *my_realloc_err (ST_VOID *old, ST_UINT size);
|
|
|
|
|
|
ST_RET rpt_typeids_find (RPT_TYPEIDS *rpt_typeids);
|
|
|
|
|
|
RCB_INFO *rcb_info_create (MVL_NET_INFO *net_info, ST_CHAR *domName, MVL_VMD_CTRL *vmd_ctrl,
|
|
|
ST_CHAR *rcbName, RPT_TYPEIDS *rpt_typeids, ST_INT timeOut);
|
|
|
ST_VOID rcb_info_destroy (RCB_INFO *rcb_info);
|
|
|
|
|
|
ST_RET u_iec_rpt_ind (MVL_COMM_EVENT *event);
|
|
|
ST_VOID u_iec_rpt_ind_data (MVL_VAR_ASSOC **info_va,
|
|
|
ST_UINT8 *OptFldsData, /* ptr to data part of OptFlds bvstring */
|
|
|
ST_UINT8 *InclusionData, /* ptr to Inclusion bstring */
|
|
|
RCB_INFO *rcb_info,
|
|
|
ST_INT va_total,
|
|
|
RPT_INFO *rpt_info);
|
|
|
ST_INT vmd_type_id_create (MVL_VMD_CTRL *vmd_ctrl, ST_CHAR *type_name, ST_UCHAR *asn1_data, ST_UINT asn1_len);
|
|
|
|
|
|
//liwei 2012.07.13
|
|
|
ST_INT my_type_id_create_from_tdl (ST_CHAR *type_name, ST_CHAR *tdl, MVL_VMD_CTRL *vmd_ctrl);
|
|
|
ST_RET rcb_info_var_create (RCB_INFO *rcb_info, RPT_TYPEIDS *rpt_typeids);
|
|
|
|
|
|
|
|
|
static ST_VOID kbService (ST_VOID);
|
|
|
|
|
|
//yhc
|
|
|
__declspec(dllexport) void mms_free_dataset_datainfo(DATA_INFO *data_info);
|
|
|
|
|
|
//重新装置osicfg
|
|
|
__declspec(dllexport) unsigned int mms_load_OsiCfg(); //yhc
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
|