📄 psap2.h
字号:
/* psap2.h - include file for presentation users (PS-USER) continued *//* * $Header: /f/iso/h/RCS/psap2.h,v 5.0 88/07/21 14:39:16 mrose Rel $ * * * $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 _PSAP2_#define _PSAP2_#include "psap.h" /* definitions for PS-USERs */#include "ssap.h" /* definitions for SS-USERs */#ifndef _ISOADDRS_#include "isoaddrs.h" /* definitions of ISO addresses */#endif/* */#define NPDATA 25 /* arbitrary */struct PSAPcontext { /* presentation context */ int pc_id; /* identifier */ OID pc_asn; /* abstract syntax name */ OID pc_atn; /* abstract transfer name */ /* NULLOID if provider should handle it */ int pc_result; /* same codes as pc_result below */};struct PSAPctxlist { /* list of presentation contexts */ int pc_nctx; /* number of contexts */#define NPCTX 10 /* arbitrary */ struct PSAPcontext pc_ctx[NPCTX];};#define NULLPC ((struct PSAPctxlist *) 0)struct SSAPref *addr2ref (); /* address to session reference */char *sprintref (); /* return session reference in string form *//* */struct PSAPstart { /* P-CONNECT.INDICATION */ int ps_sd; /* PRESENTATION descriptor */ struct PSAPaddr ps_calling; /* address of peer calling */ struct PSAPaddr ps_called; /* address of peer called */ struct PSAPctxlist ps_ctxlist;/* list of proposed contexts */ OID ps_defctx; /* name of proposed default context */ int ps_defctxresult; /* what the provider thinks about it */ int ps_prequirements; /* presentation requirements */ int ps_srequirements; /* session requirements */ int ps_settings; /* initial settings of tokens */ long ps_isn; /* initial serial number */ struct SSAPref ps_connect; /* session connection identifier */ int ps_ssdusize; /* largest atomic SSDU */ int ps_sversion; /* session service version number */ struct QOStype ps_qos; /* quality of service */ /* initial data from peer */ int ps_ninfo; /* number of elements */ PE ps_info[NPDATA]; /* data */};#define PSFREE(ps) \{ \ register int PSI; \ \ for (PSI = (ps) -> ps_ctxlist.pc_nctx - 1; PSI >= 0; PSI--) { \ oid_free ((ps) -> ps_ctxlist.pc_ctx[PSI].pc_asn); \ oid_free ((ps) -> ps_ctxlist.pc_ctx[PSI].pc_atn); \ (ps) -> ps_ctxlist.pc_ctx[PSI].pc_asn = \ (ps) -> ps_ctxlist.pc_ctx[PSI].pc_atn = NULLOID; \ } \ (ps) -> ps_ctxlist.pc_nctx = 0; \ if ((ps) -> ps_defctx) \ oid_free ((ps) -> ps_defctx), (ps) -> ps_defctx = NULLOID; \ for (PSI = (ps) -> ps_ninfo - 1; PSI >= 0; PSI--) \ if ((ps) -> ps_info[PSI]) \ pe_free ((ps) -> ps_info[PSI]), (ps) -> ps_info[PSI] = NULLPE; \ (ps) -> ps_ninfo = 0; \}struct PSAPconnect { /* P-CONNECT.CONFIRMATION */ int pc_sd; /* PRESENTATION descriptor */ struct PSAPaddr pc_responding;/* address of peer responding */ struct PSAPctxlist pc_ctxlist;/* the list of negotiated contexts */ int pc_defctxresult; /* result for proposed default context name */ int pc_prequirements; /* presentation requirements */ int pc_srequirements; /* session requirements */ int pc_settings; /* initial settings of tokens */ int pc_please; /* tokens requested by PS-user */ long pc_isn; /* initial serial number */ struct SSAPref pc_connect; /* session connection identifier */ int pc_ssdusize; /* largest atomic SSDU */ int pc_sversion; /* session service version number */ struct QOStype pc_qos; /* quality of service */ int pc_result; /* result */#define PC_ACCEPT (-1)#define PC_REJECTED 0 /* Rejected by peer */ /* Provider-reason */#define PC_NOTSPECIFIED 1 /* Reason not specified */#define PC_CONGEST 2 /* Temporary congestion */#define PC_EXCEEDED 3 /* Local limit exceeded */#define PC_ADDRESS 4 /* Called presentation address unknown */#define PC_VERSION 5 /* Protocol version not supported */#define PC_DEFAULT 6 /* Default context not supported */#define PC_READABLE 7 /* User-data not readable */#define PC_AVAILABLE 8 /* No PSAP available */ /* Abort-reason */#define PC_UNRECOGNIZED 9 /* Unrecognized PPDU */#define PC_UNEXPECTED 10 /* Unexpected PPDU */#define PC_SSPRIMITIVE 11 /* Unexpected session service primitive */#define PC_PPPARAM1 12 /* Unrecognized PPDU parameter */#define PC_PPPARAM2 13 /* Unexpected PPDU parameter */#define PC_INVALID 14 /* Invalid PPDU parameter value */ /* Provider-reason */#define PC_ABSTRACT 15 /* Abstract syntax not supported */#define PC_TRANSFER 16 /* Proposed transfer syntaxes not supported */#define PC_DCSLIMIT 17 /* Local limit on DCS exceeded */ /* begin UNOFFICIAL */#define PC_REFUSED 18 /* Connect request refused on this network connection */#define PC_SESSION 19 /* Session disconnect */#define PC_PROTOCOL 20 /* Protocol error */#define PC_ABORTED 21 /* Peer aborted connection */#define PC_PARAMETER 22 /* Invalid parameter */#define PC_OPERATION 23 /* Invalid operation */#define PC_TIMER 24 /* Timer expired */#define PC_WAITING 25 /* Indications waiting */ /* end UNOFFICIAL */#define PC_FATAL(r) ((r) < PC_PARAMETER)#define PC_OFFICIAL(r) ((r) < PC_REFUSED) /* initial data from peer */ int pc_ninfo; /* number of elements */ PE pc_info[NPDATA]; /* data */};#define PCFREE(pc) \{ \ register int PCI; \ \ for (PCI = (pc) -> pc_ctxlist.pc_nctx - 1; PCI >= 0; PCI--) { \ oid_free ((pc) -> pc_ctxlist.pc_ctx[PCI].pc_asn); \ oid_free ((pc) -> pc_ctxlist.pc_ctx[PCI].pc_atn); \ (pc) -> pc_ctxlist.pc_ctx[PCI].pc_asn = \ (pc) -> pc_ctxlist.pc_ctx[PCI].pc_atn = NULLOID; \ } \ (pc) -> pc_ctxlist.pc_nctx = 0; \ for (PCI = (pc) -> pc_ninfo - 1; PCI >= 0; PCI--) \ if ((pc) -> pc_info[PCI]) \ pe_free ((pc) -> pc_info[PCI]), (pc) -> pc_info[PCI] = NULLPE; \ (pc) -> pc_ninfo = 0; \} /* PRESENTATION requirements */#define PR_MANAGEMENT 0x0001 /* context management */#define PR_RESTORATION 0x0002 /* context restoration */#define PR_MYREQUIRE 0x0000struct PSAPdata { /* P-READ.INDICATION */ int px_type; /* type of indication */ /* same values as sx_type */ int px_ninfo; /* number of elements */ PE px_info[NPDATA]; /* data */};#define PXFREE(px) \{ \ register int PXI; \ \ for (PXI = (px) -> px_ninfo - 1; PXI >= 0; PXI--) \ if ((px) -> px_info[PXI]) \ pe_free ((px) -> px_info[PXI]), (px) -> px_info[PXI] = NULLPE; \ (px) -> px_ninfo = 0; \}struct PSAPtoken { /* P-{TOKEN-*,GIVE-CONTROL}.INDICATION */ int pt_type; /* type of indication */ /* same values as st_type */ u_char pt_tokens; /* tokens offered/wanted */ /* same values as st_tokens */ u_char pt_owned; /* tokens owned by user */ /* PLEASE TOKEN only */ int pt_ninfo; /* number of elements */ PE pt_info[NPDATA]; /* data */};#define PTFREE(pt) \{ \ register int PTI; \ \ for (PTI = (pt) -> pt_ninfo - 1; PTI >= 0; PTI--) \ if ((pt) -> pt_info[PTI]) \ pe_free ((pt) -> pt_info[PTI]), (pt) -> pt_info[PTI] = NULLPE; \ (pt) -> pt_ninfo = 0; \}struct PSAPsync { /* P-*-SYNC.{INDICATION,CONFIRMATION} */ int pn_type; /* type of indication/confirmation */ /* same values as sn_type */ int pn_options; /* options (!!) */ /* same values as sn_options */ long pn_ssn; /* serial number */ /* same values as sn_ssn */ int pn_settings; /* new token settings (RESYNC only) */ /* sync data from peer */ int pn_ninfo; /* number of elements */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -