⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ropkt.h

📁 ftam等标准协议服务器和客户端的源代码。
💻 H
字号:
/* ropkt.h - include file for remote operation providers (RoS-PROVIDER) *//*  * $Header: /f/iso/h/RCS/ropkt.h,v 5.0 88/07/21 14:39:19 mrose Rel $ * * Based on an TCP-based implementation by George Michaelson of University * College London. * * * $Log$ *//* *				  NOTICE * *    Acquisition, use, and distribution of this module and related *    materials are subject to the restrictions of a license agreement. *    Consult the Preface in the User's Manual for the full terms of *    this agreement. * */#ifndef	_RoSAP_#include "rosap.h"		/* definitions for RoS-USERs */#endif#ifdef HULA#define ACSE#include "acupkt.h"		/* definitions for AcS-PROVIDERs */#ifndef _AcuSAP_#include "acusap.h"#endif#else#include "acpkt.h"		/* definitions for AcS-PROVIDERs */#ifndef	_RtSAP_#include "rtsap.h"		/* definitions for RtS-USERs */#endif#ifndef _PSAP2_#include "psap2.h"		/* definitions for PS-USERs */#endif#ifndef	_SSAP_#include "ssap.h"		/* definitions for SS-USERs */#endif#endif/*  */#ifdef HULA#define	rosapPsig(acb, sd) \{ \    if ((acb = findacublk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_AUDT)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#define	rosapXsig(acb, sd) \{ \    if ((acb = findacublk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_AUDT)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#define	rosapFsig(acb, sd) \{ \    if ((acb = findacublk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_ROS)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "not an association descriptor for ROS"); \    } \    if (!(acb -> acb_flags & ACB_AUDT)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#else#define	rosapPsig(acb, sd) \{ \    if ((acb = findacblk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_CONN)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not connected"); \    } \    if (acb -> acb_flags & ACB_CLOSING) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_WAITING, NULLCP, NULLCP); \    } \    if (acb -> acb_flags & ACB_FINN) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor finishing"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#define	rosapXsig(acb, sd) \{ \    if ((acb = findacblk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_CONN)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not connected"); \    } \    if (acb -> acb_flags & ACB_FINN) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor finishing"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#define	rosapFsig(acb, sd) \{ \    if ((acb = findacblk (sd)) == NULL) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "invalid association descriptor"); \    } \    if (!(acb -> acb_flags & ACB_ROS)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "not an association descriptor for ROS"); \    } \    if (!(acb -> acb_flags & ACB_CONN)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not connected"); \    } \    if (!(acb -> acb_flags & ACB_FINN)) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not finishing"); \    } \    if (acb -> acb_putosdu == NULLIFP) { \	(void) sigsetmask (smask); \	return rosaplose (roi, ROS_OPERATION, NULLCP, \			    "association descriptor not bound"); \    } \}#endif#define	missingP(p) \{ \    if (p == NULL) \	return rosaplose (roi, ROS_PARAMETER, NULLCP, \			    "mandatory parameter \"%s\" missing", "p"); \}#ifndef	lint#ifndef	__STDC__#define	copyRoSAPdata(base,len,d) \{ \    register int i = len; \    if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \	bcopy (base, d -> d/* */_data, d -> d/* */_cc); \}#else#define	copyRoSAPdata(base,len,d) \{ \    register int i = len; \    if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \	bcopy (base, d -> d##_data, d -> d##_cc); \}#endif#else#define	copyRoSAPdata(base,len,d)	bcopy (base, (char *) d, len)#endif#define	pylose() \	ropktlose (acb, roi, ROS_PROTOCOL, NULLCP, "%s", PY_pepy)int	ropktlose (), rosapreject (), rosaplose ();/*  */int	acb2osdu ();#ifdef HULAint	ro2acuwrite (), ro2acuwait ();#elseint	ro2rtswrite (), ro2rtswait (), ro2rtsready (), ro2rtsasync (),	ro2rtsmask ();int	ro2pswrite (), ro2pswait (), ro2psasync (), ro2psmask ();int	ss2roslose (), ss2rosabort ();int	ro2sswrite (), ro2sswait (), ro2ssasync (), ro2ssmask (), ro2sslose (),	ro2ssready ();#endif/*  */				/* APDU types */#define	APDU_INVOKE	1	/* Invoke */#define	APDU_RESULT	2	/* Return result */#define	APDU_ERROR	3	/* Return error */#define	APDU_REJECT	4	/* Reject */#define	APDU_UNKNOWN	(-1)	/* anything other than the above */				/* Reject APDU types */#define	REJECT_GENERAL	0	/* General Problem */#define	  REJECT_GENERAL_BASE	ROS_GP_UNRECOG#define	REJECT_INVOKE	1	/* Invoke Problem */#define	  REJECT_INVOKE_BASE	ROS_IP_DUP#define	REJECT_RESULT	2	/* Return Result Problem */#define	  REJECT_RESULT_BASE	ROS_RRP_UNRECOG#define	REJECT_ERROR	3	/* Return Error Problem */#define	  REJECT_ERROR_BASE	ROS_REP_UNRECOG#define	REJECT_COMPLETE	4	/* more Invoke Problem codes */extern int rosap_operation;extern int rosap_error;extern int rosap_type;extern int rosap_id;extern int rosap_null;extern int rosap_linked;extern int rosap_lnull;extern PE  rosap_data;extern int rosap_reason;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -