typedef char boolean ;

struct TSCB {
                char    name[3]  ;
                char    version  ;
                long    idsys   ;
                long    iduser  ;
                short   signal  ;
                short   typrac  ;
                short   origsev ;
                short   causdiag ;
                long    nomarque  ;
                char    delimiteur ;
                char    typmarque  ;
                char    etatjetdata  ;
                char    etatjetsyn  ;
                char    etatjetsynm  ;
                char    etatjetfin  ;
                boolean donjetdata  ;
                boolean donjetsyn  ;
                boolean donjetsynm  ;
                boolean donjetfin  ;
                short    typresync ;
                boolean indicateur ;    
                char    lg48  ;
                char    data48  ;
                char    lg40 ;
                char    data40   ;
                char    lg45 ;
                short   data45 ;
                char    lg44 ;
                char    data44 ;
                char    oldident[6]  ;
                char    ident[6] ;
		char	lgoldident ;
                char     lgident  ;
           }  ;
 typedef struct TSCB *ADSCB ;

struct tadrres {
               unsigned short ladrres;
               unsigned char typadr[8];
                };
struct qostype {
                unsigned short lfac;
                unsigned char typfac[10];
               } ;
struct  BYT18 {
                unsigned char octets[18] ;
              } ;

/* profil de transport */


struct  TABSIT {
             unsigned char stcl   ;
             unsigned char staltcl   ;
             unsigned short stexp  ;
             unsigned short stctrl  ;
             unsigned short stcrdt  ;
             unsigned short stltpdu  ;
             unsigned short stcheck  ;
             unsigned short stlnsdu  ;
             unsigned short stlnpdu   ;
             unsigned char stwi  ;
             unsigned char stwo  ;
             unsigned char stypres  ;
             unsigned char stcnx  ;
             struct tadrres stfrna  ;
             struct tadrres sttona  ;
             struct qostype stqos   ;
           } ;   
typedef struct TABSIT *PTTABSIT  ;

/*   profil adressage session */


struct  ADRESSESSION {
                       unsigned short lgingus ;
                       char inguser[64];
                       unsigned short lgedus ;
                       char    eduser[64] ;
                       unsigned short lgcom ;
                       char comref[64] ;
                       unsigned short lgref ;
                       char addref[4] ;
                       unsigned short lgsesing;
                       char sesing[16];
                       unsigned short lgsesed ;
                       char  sesed[16];
                     };
typedef struct ADRESSESSION *PTADSE ; 

/*  profil de negociation */


struct  NEGOCIATION {
                         unsigned short lgssdue   ;
                         unsigned short lgssdur   ;
                         unsigned short lgquare   ;
                         unsigned short  lgquarr   ;
                         unsigned short lgspdue   ;
                         unsigned short lgspdur   ;
                         unsigned short lg2       ;
                         char data2[6]   ;
                         unsigned short  option    ;
                         boolean segment   ;
                         unsigned char choisubset   ;
                         unsigned char jetondata   ;
                         unsigned char jetonsyn  ;
                         unsigned char jetonsynm  ;
                         unsigned char jetonfin   ;
                         unsigned short lg8       ;
                         unsigned char data8     ;
			 unsigned char fil1 ;
                         char nomarque[4]   ;
                         boolean concatene  ;
                         boolean demtour   ;
                        } ;
typedef struct NEGOCIATION   *PTNEGO  ;


/* code d'erreur */


#define normal 	 0x56000000	/* normal */
#define errtronc 0x56000001    	/* donnees tronquees */
#define errinc 	 0x56010009   	/* requete non connu du service */
#define errucb 	 0x5601000a   	/* nombre de descripteur erronnes */
#define errbataille 0x5601000b 	/* taille structure erronnee */
#define errscb 	 0x5601000c     /* scb incorrect */
#define seinex 	 0x5601000d   	/* numero de session inexistant */
#define rqidem   0x5601000f   	/* requete de meme type en cours */
#define errdsa 	 0x5601001a    	/* controle raccordement dsa incorrect */
#define errstid  0x5601001d   	/* controle stid incorrect */





#define indtronc       0x05000001   /* DONNEES TRONQUEES */ 
#define errcapa        0x05010003    /* SERVICE CAPABILITE NON PERMIS */ 
#define errtyped       0x05010004    /* SERVICE DONNEES TYPEES NON PERMIS */ 
#define errsermrkb     0x05010005    /* SERVICE MARQUE MINEURE NON PERMIS */ 
#define errsermrkd     0x05010006    /* SERVICE MARQUE MAJEURE NON PERMIS */ 
#define errserrs       0x05010007    /* SERVICE RESYNCHRO NON PERMIS */ 
#define errserit       0x05010008    /* SERVICE MESSAGE EXPRESS NON PERMIS */ 
#define errsertok      0x05010009    /* SERVICE GESTION TOK_ NON PERMIS */ 
#define errsererr      0x0501000A    /* SERVICE ERREUR NON PERMIS */ 
#define errsernf       0x0501000B    /* SERVICE FERMETURE NEGOCIE NON PERMIS */ 
 /*  */ 
 /*  */ 
#define errrefclo      0x05010013    /* REFUS DE DECONNEXION PAR DISTANT */
#define erroption      0x05010014    /* OPTION NON  PERMISE */ 
#define errlgappel     0x05010015    /* LONGUEUR DONNEES APPEL INCORRECTE */ 
#define errsubset      0x05010016    /* SUBSET NON GERE */ 
#define errprofneg     0x05010017    /* STRUC PROFIL NEGOTIATION INCORRECT */ 
#define errproftrp     0x05010018    /* STRUCT PROFIL TRANSPORT INCORRECT */ 
#define errprofadd     0x05010019    /* STRUCT PROFIL address INCORRECTE */ 
#define errnummrk      0x0501001D    /* NUMERO DE MARQUE INCORRECT */ 
#define errraison      0x0501001E    /* CODE RAISON INCONNU */ 
#define errferactiv    0x05010020    /* FERMETURE ACTIVITE EN COURS */ 
#define errconcat      0x05010021    /* CONCATENATION NON PERMISE */ 
#define errtyprs       0x05010022    /* TYPE DE RESYNCHRO INCORRECTE */ 
#define errtymrk       0x05010023    /* TYPE DE MARQUE INCORRECT */ 
 /*  */ 
 /*  */ 
#define errnomid        0x05010032   /* NOM IDENTIQUE EN COURS */ 
#define erretat         0x05010033   /* INCOMPATIBLE AVEC L  ETAT */ 
#define errturn         0x05010034   /* INCOMPATIBLE  TURN */ 
#define errtoken        0x05010035   /* INCOMPATIBLE TOK_ */ 
#define errlg           0x05010036   /* LONGUEUR INCORRECTE */ 
#define errdt           0x05010037   /* DON OU DEMANDE TOK_ IMPOSSIBLE */ 
#define erridses        0x05010038   /* IDENTIFICATION SESSION INCORRECTE */ 
#define errreq          0x05010039   /* REQUETE NON PERMISE */ 
#define errclo          0x0500003A   /* CLOSE EN COURS */ 
#define errab           0x0501003B   /* ABORT EN COURS */ 
#define errsync         0x0501003C   /* RESYNCHRO EN COURS */ 
#define errdem          0x0501003D   /* REQUETE IDENTIQUE EN COURS */ 
#define errto           0x0501003E   /* ERREUR SUR TIME OUT */ 
#define errmrkd         0x0501003F   /* MARQUE D EN COURS */ 
#define errexcept       0x05010040   /* ARRIVEE MESSAGE EXCEPTION */
#define errenclo        0x05010041   /* INCOMPATIBLE ENCLOSURE */ 
#define errnonsig       0x05010042   /* PAS DE DONNES EN QUARANTAINE */ 
#define errrefus        0x05010043   /* REFUS DE CONNEXION */ 
#define errtrans        0x05010044   /* FERMETURE  TRANSPORT */ 
#define indcolclo       0x05000045   /* COLLISION DECONNEXION TRANSPORT */ 
#define erractiv        0x05010046   /* ACTIVITE EN COURS */ 
#define errnonactiv     0x05010048   /* PAS D ACTIVITE EN COURS */ 
#define errcollres      0x05010049   /* COLLISION DE RESYNCHRO */ 
#define indclo         0x05010066    /* SESSION FERMEE */ 
#define erractivnger   0x05010067    /* ACTIVITE NON GERE */ 
 /*  */ 
 /*  */ 
#define errgenses      0x0502004B    /* PLUS DE CONTEXTES SESSSION */ 
#define errgencv       0x0502004C    /* PLUS DE CONTEXTES CV */ 
#define errchain       0x0502004D    /* PLUS DE CHAINE */ 
#define errtsapinc     0x0502004E    /* TSAP INCONNU */ 
 /*  */ 
 /*  */ 

/* code requete session */


#define OPEN  65 
#define ACPT  66 
#define OPNO  67 
#define OPNN  68 
#define CLOS  69 
#define RCLO  70 
#define ABRT  71 
#define SEND  72 
#define RECE  73 
#define SENX  74  
#define SENT  75  
#define ERRO  76  
#define GIVE  77  
#define PLEA  78  
#define MARK  79  
#define RMRK  80  
#define RESY  81  
#define RRES  82  
#define SACT  83  
#define RACT  84  
#define FACT  85  
#define CFAC  86  
#define IACT  87  
#define RIAC  88  
#define DACT  89 
#define RDAC  90  
#define CAPA  91  
#define RCAP  92  
#define ETAT  93  
#define STAT  94  
#define SIGN  95  
#define TSIG  96  
 /*  */ 
 /*  */ 
 /*  definition des signaux session */
#define SIGCLOS  5 
#define SIGABORT  7 
#define SIGDATA  8 
#define SIGSENX  10  
#define SIGSENT  11  
#define SIGERRO  12  
#define SIGGIVE  13  
#define SIGPLEA  14  
#define SIGMARK  15  
#define SIGRMRK  16  
#define SIGRESY  17  
#define SIGSACT  19  
#define SIGRACT  20  
#define SIGFACT  21  
#define SIGIACT  23  
#define SIGDACT  25 
#define SIGCAPA  27  
 /*  */ 
 /*  */ 
struct TUCBS {
                char    	u ;
                char    	un  ;
                unsigned short  nbinfo  ;
                char   		nbdescout  ;
                char    	nbdescin  ;
                unsigned short  codecanal  ;
                long    	destination ;
                long    	adbloc  ;
                unsigned char   userid  ;
                unsigned char   tamd    ;  /* adressage implicite */
                unsigned char   smbx  ;    /* file descripteur appelant */
		unsigned char 	mods ;	/* module origine */
                unsigned char   modd       ;  /* module distant    */
                unsigned char   systdest   ;  /* numero de site dsitant */
                unsigned char   modg     ; /* module de gateway  */
                unsigned char   systsrce   ; /* numero de site local */
                char    	chain  ;
                char    	typcmd  ;
                unsigned short  codrequete ;
                long     	coderetour  ;
                char    	*ibuf1  ;
                unsigned short  ilbuf1  ;
                unsigned short  resbuf1  ; /*RESERVED*/
                char    	*ibuf2  ;
                unsigned short  ilbuf2  ;
                unsigned short  resbuf2  ; /*RESERVED*/
                char    	*ibuf3  ;
                unsigned short  ilbuf3  ;
                unsigned short  resbuf3  ; /*RESERVED*/
                char    	*ibuf4  ;
                unsigned short  ilbuf4  ;
                unsigned short  resbuf4  ; /*RESERVED*/
                char    	*ibuf5  ;
                unsigned short  ilbuf5  ;
                unsigned short  resbuf5  ; /*RESERVED*/
                char    	*ibuf6  ;
                unsigned short  ilbuf6  ;
                unsigned short  resbuf6  ; /*RESERVED*/
                char    	*ibuf7  ;
                unsigned short  ilbuf7  ;
                unsigned short  resbuf7  ; /*RESERVED*/
                char    	*ibuf8  ;
                unsigned short  ilbuf8  ;
                unsigned short  resbuf8  ; /*RESERVED*/
                char    	*ibuf9  ;
                unsigned short  ilbuf9  ;
                unsigned short  resbuf9  ; /*RESERVED*/
                char    	*ibuf10  ;
                unsigned short  ilbuf10  ;
                unsigned short  resbuf10  ; /*RESERVED*/
                 } ;
 typedef struct TUCBS *ADUCBS ;

