V$ PREFER031.AP PREFER031.ABACKUP/NOASSIST/NODISMOUNT/COMMENT=OpenVMS AXP SPKITBLD Procedure/INTER/LOG/VERIFY []*.* SYRSUP:[JWI.VMSINSTAL.KIT]PREFER031.A/LABEL=(PREFER)/SAVE/BLOCK=9000/GROUP=25OpenVMS AXP SPKITBLD Procedure WILLERJO IpV6.2 _DAFFY:: _$34$DKA200: V6.2 $*[PREFER]FREEWARE_CD.TXT;1+,1F ./ 4H0-FH|0123KPWO56?y7D@l89GHJ. RELEASE FORM. ------------OpenVMS Freeware CD--------------------DEVELOPER RELEASE FORM:A As the owner/developer of this software, I release it to be H included on the OpenVMS Freeware CD-ROM. I expect no renumerances H or payments for the use of this software from Digital or Digital's  customers.H _______________________ B Joel Paul Willeretz*[PREFER]FREEWARE_DEMO.TXT;1+,F./ 4<-FH|0123KPWO56i 7l89GHJ6PREFER, TOOLS, Specify a preferred path for DSA disks.!9 The PREFER command specifies a preferred path for7 DSA disks. This includes RA-series disks and disks: accessed through the MSCP server. If a preferred path9 is specified for a disk, the MSCP disk class drivers8 (DUDRIVER and DSDRIVER) use the path as their first9 attempt to locate the disk and bring it on line as a< result of a DCL command MOUNT or failover of an already: mounted disk. In addition, you can initiate failover 8 of a mounted disk in order to force the disk to the: preferred path, or to use load-balancing information - for disks accessed through MSCP servers.*[PREFER]FREEWARE_README.TXT;1+,F./ 468-FH|0123KPWO56578^m89GHJ6PREFER, TOOLS, Specify a preferred path for DSA disks.*[PREFER]KITINSTAL.COM;1+,F./ 4`-FH|0123KPWO568H_؛7s0m89Ԛ=GHJN$ ! UnCopyright 1997 J.P.Willeretz Software Product. All rights Unreserved.$ !4$ ! K I T I N S T A L . C O M $ !1$ ! UNCOPYRIGHT 1997 BY>$ ! J.P.WILLERETZ SOFTWARE PRODUCT, MAISONS LAFFITTE9$ ! FRANCE C.E.E. ALL RIGHTS UNRESERVED.$ ! H$ ! Ce n'est pas en marchant sur les traces du premier que l'on peut $ ! le dpasser....$ !J$ ! This software is furnished without a license. As the owner/developer K$ ! of this software, I expect no renumerances or payments for the use of 7$ ! this software from Digital or Digital's customers.$ !M$ ! J.P.WILLERETZ SOFTWARE PRODUCT ASSUMES NO RESPONSIBILITY FOR THE USE OR N$ ! RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.$ !N$ !***************************************************************************$ !$ Say := Write Sys$Output$ !;$ ! Mise en place des dbranchements Warning and Interrupt.$ !+$ On Control Then VMI$CALLBACK CONTROL_Y0$ On Warning Then Goto PREFER_INSTALL_WARNING$ ! $ ! Si mode DEBUG mettre verify $ !"$ Prefer_Verify = F$Verify (P2)$ !!$ ! Vrification des paramteres.$ !C$ ! Ne prendre que INSTALL et IVP. Exit sur n'importe quoi d'autre.$ !8$ If P1 .eqs. "VMI$_INSTALL" Then Goto PREFER_INSTALL0$ If P1 .eqs. "VMI$_IVP" Then Goto PREFER_IVP$ NO_MATCH: -$ Prefer_Verify = F$Verify (Prefer_Verify)$ Exit VMI$_UNSUPPORTED$ !$ ! Dbut d'installation$ !$ PREFER_INSTALL:$ !-$ ! Vrifier le numro de version de OpenVMS.$ !H$ ! Dfinir la version la plus rcente de OpenVMS supportant le produit.$ ! $ Product$Rel_Version = "062"$ !S$ ! Dfinir la version field test la plus rcente de OpenVMS supportant le produit.$ !$ Product$Ft_Version = "062"$ !5$ ! Extraire le numro courant de version de OpenVMS.$ !8$ Product$Type = F$Element (0, "," , Vmi$Vms_Version)$ ! $ V_RELEASED:$ !!$ ! Vrifier la version RELEASED.$ !K$ ! NOTE: utiliser la comparaison de chane de caractres afin de vrifier :$ ! si le numro de version contient des caractres.$ !8$ If Product$Type .nes. "RELEASED" Then Goto V_UPDATET$ If F$Element (1, ",", Vmi$Vms_Version) .ges. Product$Rel_Version Then Goto V_OK$ ! $ V_REL10:$ !9$ Ver = "V" + F$Extract (1, 1, Product$Rel_Version) +-6 "." + F$Extract (2, 2, Product$Rel_Version)K$ Say "This product requires OpenVMS version ''Ver' or later to install" $ Exit $ ! $ V_UPDATE:$ !#$ ! Vrifier la version Field Test.$ !<$ If Product$Type .nes. "UPDATE FT" Then Goto V_BASELEVELG$ If F$Element (1, ",", F$Element (1, " ", Vmi$Vms_Version)) .ges. -) Product$Ft_Version Then Goto V_OK$ ! $ V_UPD10:$ !8$ Ver = "T" + F$Extract (1, 1, Product$Ft_Version) +-5 "." + F$Extract (2, 2, Product$Ft_Version)K$ Say "This product requires OpenVMS version ''Ver' or later to install" $ Exit $ !$ !$ V_BASELEVEL:$ !G$ ! Toujours autoriser l'installation sur un niveau de base de OpenVMS.8$ ! Au besoin s'assurer des tests prcdants du produit.$ !H$ Baselevel = F$Element (1, ",", F$Element (1, " ", Vmi$Vms_Version))3$ If Product$Type .nes. "UPGRADE FT" Then $ ExitQ$ Say "Installing on OpenVMS baselevel ''Baselevel', installation continuing."$ !$ !$ V_OK:$ ! $ ASK_PURGE:$ !-$ ! Purge des fichiers aprs l'installation ??$ ! Option D = Une ligne est saute avant de poser la question.$ !!$ VMI$CALLBACK SET PURGE ASK D$ !U$ If F$Element (1, ",", Vmi$Vms_Version) .lts. "044" Then Goto AFTER_RELEASE_NOTES$ !'$ ! Passer l'IVP aprs l'installation ?$ !$ VMI$CALLBACK SET IVP ASK D$ ! $ ASK_LANG:$ !4$ ! Installation en franais [Defaut] ou en anglais.$ !6$ Phrase = "Installation in French or in English ?"<$ VMI$CALLBACK ASK PREFER$LANG "''Phrase'" French N,D,R,SQ$ If F$TrnLnm (Prefer$Lang) .nes. "" Then Prefer$Lang = F$TrnLnm (Prefer$Lang);$ B_Lang := True ! Installation en francais par dfaut.9$ If Prefer$Lang .nes. "FRENCH" Then $ B_Lang := FalseR$ Phras0A = "Questions and informations are displayed in Shakespeare language."`$ Phras0F = "Les questions et les informations sont affiches dans la langue de Victor Hugo."$ Phrase = Phras0A($ If (B_Lang) Then $ Phrase = Phras0F $ Say ""0$ VMI$CALLBACK MESSAGE I LANGUAGE "''Phrase'"$ !$ INF_ALTER_ROOT:$ !%$ ! Demander oPUC~$ PREFER031.AFFH|[PREFER]KITINSTAL.COM;1`}t" installer le produit.$ !$ If B_Lang $ Then$ Type Sys$InputI *********************************************************************F Par dfaut, l'installation du produit se fait dans les rpertoires> standards d'OpenVMS (Sys$System, Sys$Help, Sys$Test, ...).: Cependant, vous pouvez l'installer o bon vous semble.H Dans ce cas, il vous faut donner le nom complet d'un chemin d'accs 9 valide dans lequel sera stock l'ensemble du produit.I *********************************************************************$ ! $ Else$ !$ Type Sys$InputI *********************************************************************I By default, the product installation is done in the OpenVMS standards6 directories (Sys$System, Sys$Help, Sys$Test, ...).> Therefore, you can install this product anywhere you want.F In this case, you must specify the complete name of the directory & you want to use (Dev:[Directory]).I *********************************************************************$ ! $ EndIf$ !$ ASK_ALTER_ROOT:$ !;$ Phras1A = "Where do you want to install the product ?"6$ Phras1F = "O voulez-vous installer ce produit ?"$ Phrase = Phras1A($ If (B_Lang) Then $ Phrase = Phras1F=$ VMI$CALLBACK ASK PREFER$ROOT "''Phrase'" Default N,D,R,S$ !.$ ! Vrifier la cohrence de la chane donne.$ ! $ ! Est-ce un nom logique ?$ !Q$ If F$TrnLnm (Prefer$Root) .nes. "" Then Prefer$Root = F$TrnLnm (Prefer$Root)2$ B_Default := True ! Installation par dfaut.?$ If Prefer$Root .nes. "DEFAULT" Then $ B_Default := False -$ If B_Default Then Goto ASK_ALTER_ROOT_OK$ !$ ! Extraire le nom du device.$ !4$ Prefer$Device = F$Element (0, ":", Prefer$Root);$ If Prefer$Device .eqs. "" Then Goto ASK_ALTER_ROOT_BAD$ !$ ! Le device existe-t-il ?$ !M$ If .not. F$GetDvi (Prefer$Device, "Exists") Then Goto ASK_ALTER_ROOT_BAD$ !1$ ! Vrifier la prsence des open et back braket.$ !\$ If F$Locate ("[", Prefer$Root) .ge. F$Length (Prefer$Root) Then Goto ASK_ALTER_ROOT_BAD\$ If F$Locate ("]", Prefer$Root) .ge. F$Length (Prefer$Root) Then Goto ASK_ALTER_ROOT_BAD$ !$ ! Tout est OK$ !$ VMI$ALTERNATE_ROOT == 1$ Goto ASK_ALTER_ROOT_OK$ !$ ASK_ALTER_ROOT_BAD:*$ Phras2A = "No Such Device Available."-$ Phras2F = "Priphrique non disponible."$ Phrase = Phras2A($ If (B_Lang) Then $ Phrase = Phras2F1$ VMI$CALLBACK MESSAGE W NOSUCHDEV "''Phrase'"$ Goto ASK_ALTER_ROOT$ !$ ASK_ALTER_ROOT_OK:$ !$ If B_Lang $ Then$ Type Sys$InputI *********************************************************************I * Vous avez rpondu l'ensemble des questions relatives *I * l'installation de ce produit. *I * *I * L'installation ne devrait pas excder les 4 minutes.... *I * *I *********************************************************************$ ! $ Else$ !$ Type Sys$InputI *********************************************************************I * There are no more questions. You've answered ALL the questions *I * for the installation. *I * *I * Installation takes approximately 4 minutes on a standalone *I * *I *********************************************************************$ ! $ EndIf$ !$ AFTER_RELEASE_NOTES:$ !'$ ! Besoin de 450 blocs pour installer.$ ! $ BlcNeeded = 450H$ VMI$CALLBACK CHECK_NET_UTILIZATION PREFER_PLENTY_SPACE 'BlcNeeded'$ !!$ If .not. Prefer_Plenty_Space $ Then $ Say " "E$ Phras3A = "You need approximatively ''BlcNeeded' free blocks"L$ Phras3F = "Ce kit demande au moins ''BlcNeeded' blocs disque libres"$ Phrase = Phras3A+$ If (B_Lang) Then $ Phrase = Phras3F1$ VMI$CALLBACK MESSAGE E NOROOM "''Phrase'"$ Exit VMI$_FAILURE $ EndIf$ !$ ! Indicateur de suret.$ !4$ VMI$CALLBACK SET SAFETY CONDITIONAL 'BlcNeeded''$ If B_Default Then Goto BUILT_IMAGE$ !4$ ! Crer un rpertoire pour les fichiers de PREFER.$ !7$ VMI$CALLBACK CREATE_DIRECTORY USER 'PREFER$ROOT' -= "/PROTECTION=(SY:RWE,OW:RWE,GR:RWE,WO:RWE)"$ !F$ ! Modifier l'item IMAGE dans le CLD par rapport au rpertoire donn.$ !;$ VMI$CALLBACK FIND_FILE PREFER_ PREFER.CLD VMI$KWD W,E3$ Open /Read /Error=LOOP_END Prefer_Org Prefer_3$ Open /Write /Error=LOOP_END Prefer_New Prefer_$ LOOP:-$ Read /End=LOOP_END Prefer_Org Prefer_EnrA$ If F$Locate ("Image", Prefer_Enr) .lt. F$Length (Prefer_Enr) $ Then>$ Write Prefer_New " Image ''PREFER$ROOT'Prefer.Exe" $ Else#$ Write Prefer_New Prefer_Enr $ EndIf$ Goto LOOP $ LOOP_END:@$ If F$TrnLnm ("Prefer_Org") .nes. "" Then $ Close Prefer_Org@$ If F$TrnLnm ("Prefer_New") .nes. "" Then $ Close Prefer_New:$ Prefer_Cld = F$Element (0, ";", F$TrnLnm ("Prefer_"))$ Purge /NoLog 'Prefer_Cld'$ !$ BUILT_IMAGE:$ !$ ! Bibliothque d'Aide...$ !>$ VMI$CALLBACK FIND_FILE PREFER_HLP PREFER.HLP VMI$KWD W,E8$ Library /Help /Create Vmi$Kwd:PREFER.HLB PREFER_HLP$ !E$ ! Obtenir l'objet correspondant la version et l'architecture...$ !C$ Arch_Nam = F$Edit (F$GetSyi ("Arch_Name"), "Collapse, UpCase")8$ Product$Vers = F$Element (1, "," , Vmi$Vms_Version) $ If Product$Vers .ges. "062" $ Then!$ If Arch_Nam .eqs. "ALPHA" $ ThenN$ VMI$CALLBACK FIND_FILE PREFER_OBJ PREFER.OBJ_AXP_V62 VMI$KWD W,E $ ElseN$ VMI$CALLBACK FIND_FILE PREFER_OBJ PREFER.OBJ_VAX_V62 VMI$KWD W,E $ EndIf $ EndIf$ !E$ Link /NoDebug /NoTrace /Executable=Vmi$Kwd:Prefer.Exe Prefer_Obj?$ Prefer_Clear = F$Element (0, ";", F$TrnLnm ("Prefer_Obj")) $ Purge /NoLog 'Prefer_Clear'"$ Deassign /Process PREFER_OBJ $ !$ If .not. B_Default $ Then $ !<$ ! Copier l'ensemble des fichiers dans ce rpertoire. $ !D$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.C 'PREFER$ROOT'D$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.CLD 'PREFER$ROOT'D$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.HLB 'PREFER$ROOT'D$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.EXE 'PREFER$ROOT' $ ElseQ$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.C VMI$ROOT:[SYSHLP.EXAMPLES]H$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.HLB VMI$ROOT:[SYSHLP]H$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER.EXE VMI$ROOT:[SYSEXE] $ EndIf$ !7$ ! Insrer le HELP dans la bibliothque d'aide du DCL.$ !.$ VMI$CALLBACK PROVIDE_DCL_HELP PREFER.HLP$ ! $ Say ""7$ Phras4A = "Insert HELP into the DCL help library."J$ Phras4F = "Insertion de l'aide dans la bibliothque gnrale d'aide."$ Phrase = Phras4A($ If (B_Lang) Then $ Phrase = Phras4F2$ VMI$CALLBACK MESSAGE S INSERTHELP "''Phrase'"$ !1$ ! Ajouter la commande PREFER dans la table DCL.$ !1$ VMI$CALLBACK PROVIDE_DCL_COMMAND PREFER.CLD$ ! $ Say ""D$ Phras5A = "Add a DCL command PREFER to the DCL command tables."?$ Phras5F = "Ajout de la commande PREFER dans la table DCL."$ Phrase = Phras5A($ If (B_Lang) Then $ Phrase = Phras5F1$ VMI$CALLBACK MESSAGE S ADDTODCL "''Phrase'" $ Say ""$ !$ ! Mettre l'IVP dans SYS$TEST$ !P$ VMI$CALLBACK PROVIDE_FILE PREFER_ PREFER_IVP.COM VMI$ROOT:[SYSTEST]$ !$ ! Installation complte.$ !$ PREFER_INSTALL_DONE:-$ Prefer_Verify = F$Verify (Prefer_Verify)$ Exit VMI$_SUCCESS $ PREFER_IVP: $ Say ""4$ Say " Running the IVP for ''Vmi$Pretty' ..."$ !&$ @Vmi$Root:[SysTest]Prefer_Ivp.Com$ ! $ Say ""P$ If $Status Then Say " The IVP for ''Vmi$Pretty' completed successfully."$ Goto PREFER_INSTALL_DONE$ !$ ! Erreur d'installation.$ !$ PREFER_INSTALL_WARNING:$ Prefer_Status = $Status-$ Prefer_Verify = F$Verify (Prefer_Verify)$ Exit Prefer_Statusʥ͔$ PREFER031.A.GFH|[PREFER]PREFER.C;1d$`k*[PREFER]PREFER.C;1+,.G.$/ 4d$#-FH|0123KPWO%56=ޛ7+Sm89Ԛ=GHJ P/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/P/* Set Preferred Path */P/* */P/* The set preferred path function specifies a preferred path for DSA disks. */P/* This includes RA-series disks and disks accessed through the MSCP server. */P/* If a preferred path is specified for a disk, the MSCP disk class drivers */P/* (DUDRIVER and DSDRIVER) use the path as their first attempt to locate the */P/* disk and bring it on line as a result of a DCL command MOUNT or failover */P/* of an already mounted disk. In addition, you can initiate failover of a */P/* mounted disk in order to force the disk to the preferred path, or to use */P/* load-balancing information for disks accessed through MSCP servers. */P/* */P/* Note that forcing a path change places the disk in mount verification. */P/* New I/O requests are suspended until mount verification is complete */P/* */P/* Using IO$_SETPRFPATH with Phase II Volume Shadowing IO$_SETPRFPATH and */P/* IO$M_FORCEPATH are supported for shadow set members but not for virtual */P/* units. */P/* */P/* Note that if a disk can be accessed through both HSC and MSCP servers, */P/* you need not specify the HSC as a preferred path. HSC paths are always */P/* preferred to server paths. */P/* */P/* Using IO$M_FORCEPATH without a preferred path causes the disk class driver */P/* to move the disk to the server with the highest available capacity. */P/* */P/*--------------+---------------+------------------------------------------- */P/* Date ! Auteur ! Objet */P/*--------------+---------------+------------------------------------------- */P/* 14-Nov-1997 ! JWI ! */P/*--------------+---------------+------------------------------------------- */3 #include /* OpenVMS return codes */3 #include /* printf, ... functions */6 #include /* Calling std. descriptors */C #include /* memset, strcpy, memcpy, ... functions */6 #include /* CLI messages definitions */? #include /* exit, atoi, strtol, ... functions */- #include /* i/o definitions *//* Modules externes systme. */Lextern int SYS$GETMSG(), SYS$EXIT(), SYS$FAOL(), SYS$ASSIGN(), SYS$QIOW() ;:extern int SYS$DASSGN(), CLI$GET_VALUE(), CLI$PRESENT() ;J/* Dfinition des structures, macros & des variables globales de PREFER */(/* Structures de chane de caractres */struct S_String{d unsigned short W_Length; /* specific to descriptor class; typically a 16-bit (unsigned) length *// unsigned char B_Dtype; /* data type code */6 unsigned char B_Class; /* descriptor class code */F char *P_AfBytEl; /* address of first byte of data element */};/* Dfinition des macros... */0#define $Def_Desc(Name) static struct S_String \C Name = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}!#define Desc_Fix(Name, String) \= { Name.W_Length = sizeof(String)-1 ; \4 Name.P_AfBytEl = String ; }!#define Desc_Var(Name, String) \= { Name.W_Length = strlen (String) ; \4 Name.P_AfBytEl = String ; }A/* Maj dynamique de la variable descripteur avec la taille ... */</* ... max de la chaine (pour le passage sans le nul-end) */!#define Desc_Mem(Name, String) \; { Name.W_Length = sizeof(String) ; \3 Name.P_AfBytEl = String ; }4static const char rcsId[] = "PREFER V3.01 R325-97" ;)#define VERSION "PREFER V3.01 R325-97"#define TRUE 1#define FALSE 0#define BOOLEAN char+/* Descriptor de chane de caractres... */M$Def_Desc (D_QrDiskName) ; /* Parameter P1 specification (nom du disque) */L$Def_Desc (D_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */E$Def_Desc (D_QrForce) ; /* Qualifier Force (controler disque) */0$Def_Desc (D_QrLog) ; /* Qualifier Log */4$Def_Desc (D_QrVersion) ; /* Qualifier Version */0$Def_Desc (D_DiskName) ; /* Nom du disque */B$Def_Desc (D_HostName) ; /* Nom du noeud (controler disque) */'/* Variables globales z'et diverses. */int Stat_R1, St_Cli ;Xchar C_QrDiskName[] = {"DISK_NAME"} ; /* Parameter P1 specification (nom du disque) */Wchar C_QrHostName[] = {"HOST_NAME"} ; /* Qualifier Nom du noeud (controler disque) */Pchar C_QrForce[] = {"FORCE"} ; /* Qualifier Force (controler disque) */;char C_QrLog[] = {"LOG"} ; /* Qualifier Log */?char C_QrVersion[] = {"VERSION"} ; /* Qualifier Version */-char C_DiskName[32+1] ; /* Nom du disque */?char C_HostName[32+1] ; /* Nom du noeud (controler disque) */BOOLEAN B_OptLog ; P/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/P/* Fonction */P/* */P/* Get_String_Len */P/* */P/* Transforme une chane complte blanc en une chane au format C */P/* */P/* En entree: */P/* P_String : chane transformer */P/* L_Len : longueur max de la chane */P/* */P/* Resultat: */P/* longueur de la nouvelle chane */P/* */P/*--------------+---------------+------------------------------------------- */P/* Date ! Auteur ! Objet */P/*--------------+---------------+------------------------------------------- */P/* 14 Nov 1997 ! JWI ! */P/*--------------+---------------+------------------------------------------- */$int Get_String_Len (P_String, L_Len)char *P_String ; int L_Len ;{ L_Len-- ;< while ((L_Len >= 0) && (P_String[L_Len] == ' ')) L_Len-- ; P_String[++L_Len] = 0 ; return L_Len ;} P/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/P/* Fonction */P/* */P/* Edition d'un message d'erreur Systme */P/* */P/*--------------+---------------+------------------------------------------- */P/* Date ! Auteur ! Objet */P/*--------------+---------------+------------------------------------------- */P/* 14 Nov 1997 ! JWI ! */P/*--------------+---------------+------------------------------------------- */void Exit_OnError (){+&m$ PREFER031.A.GFH|[PREFER]PREFER.C;1d$g"/* Descriptor de chane de caractres... */>$Def_Desc (D_FinalMsg); /* Message retourn par $FaoL. */9$Def_Desc (D_PreMsg); /* Corps du message d'erreur */&/* Variables locales z'et diverses. */5register int St_Sys; /* Codes retour S.S. et RTL */ int L_Flags;>short W_MsgLen; /* Long. Message retourn par $GetMsg. */>short W_OutLen; /* Output length fields. */char B_OutBuff[4];=char C_PreMsg[255+1]; /* Message retourn par $GetMsg. */=char C_FinalMsg[255+1]; /* Message retourn par $FaoL. *//* Dbut de traitement. */ /* + */< /* Initialisation de certaines strings avec des "nulls" */) memset (C_PreMsg, 0, sizeof(C_PreMsg)); Desc_Mem (D_PreMsg, C_PreMsg);- memset (C_FinalMsg, 0, sizeof(C_FinalMsg));$ Desc_Mem (D_FinalMsg, C_FinalMsg); /* - */I /* Call $GETMSG to retrieve the format string and error text. This */I /* string will be INPUT to Sys$FaoL . */@ /* Mask L_Flags. Message components to be returned. */@ /* Bit 0: 1 => Include text message. */@ /* 0 => Do not include text message. */@ /* Bit 1: 1 => Include message identifier. */@ /* 0 => Do not include message identifier. */@ /* Bit 2: 1 => Include severity indicator. */@ /* 0 => Do not include severity indicator. */@ /* Bit 3: 1 => Include facility name. */@ /* 0 => Do not include facility name. */ L_Flags = 7 ;D St_Sys = SYS$GETMSG (Stat_R1, /* Ident. of the message. */E &W_MsgLen, /* Length of the message. */@ &D_PreMsg, /* Buffer to receive. */P L_Flags, /* Message components to be returned. */C &B_OutBuff[0]); /* Optional information. */& if (~(St_Sys)&1) SYS$EXIT (St_Sys) ;? D_PreMsg.W_Length = W_MsgLen ; /* Length of the message. */ C_PreMsg[W_MsgLen] = 0 ;> /* On va transformer le message OpenVMS en message PREFER */; strncpy (&C_FinalMsg[0], "%PREFER-F-IDENT, message", 8) ;4 strncpy (&C_FinalMsg[8], &C_PreMsg[1], W_MsgLen) ;E /* Afficher le message d'erreur et sortir sans laisser de trace. */ printf ("%s\n", C_FinalMsg) ;# SYS$EXIT (0X10000000 + Stat_R1) ;} P/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/P/* Programme */P/* */P/* Corps du programme */P/* */P/*--------------+---------------+------------------------------------------- */P/* Date ! Auteur ! Objet */P/*--------------+---------------+------------------------------------------- */P/* 14 Nov 1997 ! JWI ! */P/*--------------+---------------+------------------------------------------- */main (){/* Structures *///* IOSB Contents for the Sense Mode Function */ volatile struct {8 unsigned short W_Sts; /* Final IO status */< unsigned short W_DatLgth; /* Usually data Length */ char B_Sector ; char B_Tracks ;9 unsigned short W_Cylinders ; /* Device dependent */ } R_Iosb ;&/* A counted ASCII string (.ASCIC). */typedef struct { char B_Len ; char C_HostName[32+1] ; char B_End ; } S_HostName ;S_HostName R_HostName ;&/* Variables locales z'et diverses. */ int L_Length = 0 ; unsigned short W_Chan = 0 ; short W_FunCde = 0 ; char C_Message[255+1] ;/* Dbut de traitement. */< /* Initialisation de certaines strings avec des "nulls" *// memset (C_DiskName, 0, sizeof(C_DiskName)) ;/ memset (C_HostName, 0, sizeof(C_HostName)) ;. memset (C_Message, 0, sizeof(C_Message)) ;/ memset (&R_HostName, 0, sizeof(R_HostName)) ;2 /* Construction des descripteurs de String... */[ Desc_Fix (D_QrDiskName, C_QrDiskName) ; /* Parameter P1 specification (nom du disque) */Z Desc_Fix (D_QrHostName, C_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */S Desc_Fix (D_QrForce, C_QrForce) ; /* Qualifier Force (controler disque) */S Desc_Fix (D_QrVersion, C_QrVersion) ; /* Qualifier Force (controler disque) */> Desc_Fix (D_DiskName, C_DiskName) ; /* Nom du disque */P Desc_Fix (D_HostName, C_HostName) ; /* Nom du noeud (controler disque) */> Desc_Fix (D_QrLog, C_QrLog) ; /* Qualifier Log */ /* Qualifier Version */3 if (CLI$PRESENT (&D_QrVersion) == CLI$_PRESENT) {2 printf ("%%PREFER-I-VERSION, %s\n", VERSION); } /* Qualifier Log*/ B_OptLog = FALSE ;/ if (CLI$PRESENT (&D_QrLog) == CLI$_PRESENT) { B_OptLog = TRUE ; }C /* Paramtre P1 (nom du disque) Value (Type=$Device, Required) */B St_Cli = CLI$GET_VALUE (&D_QrDiskName, &D_DiskName, &L_Length) ;K D_DiskName.W_Length = Get_String_Len (&C_DiskName, D_DiskName.W_Length) ;3 /* Assigner un canal sur le device donn en P1 */6 Stat_R1 = SYS$ASSIGN (&D_DiskName, &W_Chan, 0, 0) ; % if (~(Stat_R1)&1) Exit_OnError () ;P /* Qualifier Host_Name, NonNegatable, Value (Type=$Quoted_String, Required) */B St_Cli = CLI$GET_VALUE (&D_QrHostName, &D_HostName, &L_Length) ;J D_HostName.W_Length = Get_String_Len (C_HostName, D_HostName.W_Length) ;H /* Construire une counted ASCII string pour le paramtre P1 de la */H /* QIO. On aurait pu le faire galement avec $Fao... */H /* The P1 parameter contains the address of a counted ASCII string */H /* (.ASCIC). This string is the node name of the HSC or system that */H /* is the preferred path. The node name must match an existing node */H /* that is known to the local node and if the node is a VAX or AXP */H /* system, it must be running the MSCP server. This function does */H /* not move the disk to the preferred path. */H /* */F memset (R_HostName.C_HostName, ' ', sizeof(R_HostName.C_HostName)) ;L strncpy (&R_HostName.C_HostName[0], &C_HostName[0], D_HostName.W_Length) ;* R_HostName.B_Len = D_HostName.W_Length ;* R_HostName.B_End = D_HostName.W_Length ;& /* Issue QIO to set prefered path */ W_FunCde = IO$_SETPRFPATH ;H Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) */= W_Chan, /* chan: Channel ID */D W_FunCde, /* func: QIO Function code */B &R_Iosb, /* iosb: IO status block */K 0, /* astadr: AST Address (Not used) */O 0, /* astprm: AST PAram Block (Not used) */V &R_HostName, /* p1: @ of a counted ASCII string (.ASCIC). */9 0, /* p2: Not used */9 0, /* p3: Not used */9 0, /* p4: Not used */9 0, /* p5: Not used */9 0) ; /* p6: Not used */% if (~(Stat_R1)&1) Exit_OnError () ; Stat_R1 = R_Iosb.W_Sts ;% if (~(Stat_R1)&1) Exit_OnError () ;# /* Qualifier Force (controler) */1 if (CLI$PRESENT (&D_QrForce) == CLI$_PRESENT) {+ /* Issue QIO to force prefered path */? /* Combine function code and modifier with a bitwise OR */1 W_FunCde = IO$_SETPRFPATH | IO$M_FORCEPATH ;K Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) */@ W_Chan, /* chan: Channel ID */G W_FunCde, /* func: QIO Function code */E &R_Iosb, /* iosb: IO status block */N 0, /* astadr: AST Address (Not used) */R 0, /* astprm: AST PAram Block (Not used) */< 0, /* p1: Not used */< 0, /* p2: Not used */< 0, /* p3: Not used */< 0, /* p4: Not used */< 0, /* p5: Not used */< 0) ; /* p:@?$ PREFER031.A.GFH|[PREFER]PREFER.C;1d$+"6: Not used */( if (~(Stat_R1)&1) Exit_OnError () ; Stat_R1 = R_Iosb.W_Sts ; ( if (~(Stat_R1)&1) Exit_OnError () ;] if (B_OptLog) printf ("%%PREFER-S-FORCEPATH, Force Preferred Path for %s on node %s.\n",/4 C_DiskName, C_HostName) ; }e else {\ if (B_OptLog) printf ("%%PREFER-S-SETPRFPATH, Set Preferred Path for %s on node %s.\n",4 C_DiskName, C_HostName) ; } 6 /* Dassigner le canal sur le device donn en P1 */6 /* Action implicite lorsque l'image est dactive */6 /* mais c'est plus propre comme cela !!! */" Stat_R1 = SYS$DASSGN (W_Chan) ; % if (~(Stat_R1)&1) Exit_OnError () ;  SYS$EXIT (Stat_R1) ;}i IO$_SETPRFPATH with Phase II Volume Shadowing IO$_SETPRFPATH and */P/* IO$M_FORCEPATH are supported for shadow set members but not for virtual */P/* units. */P/* *[PREFER]PREFER.CLD;1+,F./ 44-FH|0123KPWO56Z؛7m89Ԛ=GHJ! ! Dfinition du verbe PREFER.! Module PREFER Ident "3.01" Define Verb Prefer Synonym Prefer Image Sys$System:Prefer.Exe!! Dfinition des Parameters.! ! Nom du disque# Parameter P1, Label=Disk_Name,' Prompt="Disk_Name", 1 Value (Type=$Device, Required)!! Dfinition des Qualifiers.!) Qualifier Host_Name, Label=Host_Name NonNegatable4 Value (Type=$Quoted_String, Required)  Qualifier Force Qualifier Log Qualifier Version!! Restrictions d'usage...!/ Disallow ((NOT Host_Name) AND (NOT Force))/ Disallow ((NOT Host_Name) AND (NEG Force))*[PREFER]PREFER.HLB;1+,F.d/ 4d-FH|0123 KPWOe56Lݑٛ7܈m89Ԛ=GHJ% Librarian A09-19`ٛ؛ٛJ5 PREFER ؛ٛ1 PREFERG The PREFER command specifies a preferred path for DSA disks. This F includes RA-series disks and disks accessed through the MSCP server.G If a preferred path is specified for a disk, the MSCP disk class F drivers (DUDRIVER and DSDRIVER) use the path as their first attemptF to locate the disk and bring it on line as a result of a DCL commandF MOUNT or failover of an already mounted disk. In addition, you canF initiate failover of a mounted di sk in order to force the disk toF the preferred path, or to use load-balancing information for disks accessed through MSCP servers.F For more information on the use of preferred path, please refer to the VMS I/O User's Guide. FormatI PREFER device-name[:] /HOST_NAME=node-name [/FORCE] [/LOG] [/VERSION] ! --------- ! Niveau 2. 2 Description  Forcing a Path Change:C You can move a disk that is already mounted to its preferredC path by specifying the IO$M_FORCEPATH modifier. If a preferredC path has not been specified for a disk that is accessed throughC the MSCP server, the IO$M_FORCEPATH function causes the diskC class driver to use load-balancing information to select the6 server path with the highest load available rating.; Using IO$_SETPRFPATH with Disks Dual Pathed Between HSCs:D You can use the IO$_SETPRFPATH and IO$M_FORCEPATH functions to D load balance disks that are dual pathed betwee n HSCs. The C IO$M_FORCEPATH function initiates failover of the disk on allC nodes that have it mounted and that have a direct path to theC HSCs. Since the node that issues the IO$M_FORCEPATH might not beC the first one to attempt failover of the disk, it is essentialC that all nodes that have direct connections to the HSCs specifyC the same preferred path for the disk. Only one node should issue the IO$M_FORCEPATH request.> Using IO$_SETPRFPATH with Disks Dual Pathed Between Systems:C You can use IO$M_FORCEPATH to load balance RA-series disksC that are dual pathed between systems running the MSCP server.C Both serving nodes should specify the same preferred path. InD order to move the disk between systems, the system that currentlyC has the disk on line through its local controller should issueC the IO$M_FORCEPATH request. The disk must be mounted on both serving node.@ Using IO$_SETPRFPATH with Disks Acce ssed Through MSCP Servers:C You can specify a preferred path for disks that are accessedC through MSCP servers. However, this specification overrides any load-balancing decisions.C Note that if a disk can be accessed through both HSC and MSCPC servers, you need not specify the HSC as a preferred path. HSC. paths are always preferred to server paths.C Using IO$M_FORCEPATH without a preferred path causes the diskC class driver to move the disk to the &$ PREFER031.AFFH|[PREFER]PREFER.HLB;1dK server with the highest available capacity.5 Using IO$_SETPRFPATH with Phase I Volume Shadowing:C You can specify IO$_SETPRFPATH for shadow set members, but notD for virtual units. IO$M_FORCEPATH is not supported for shadow set members or virtual units.6 Using IO$_SETPRFPATH with Phase II Volume Shadowing:C IO$_SETPRFPATH and IO$M_FORCEPATH are supported for shadow set$ members but not for virtual unit. ! --------- ! Niveau 2. 2 Parameters device-n ame[:][,...]E Specifies the physical device name or logical name of the deviceD on which the volume is to be mounted. On a system where volumesC are not connected to hierarchical storage controllers, use the following format: ddcu:C The dd describes the device type of the physical devices used.C For example, an RA60 disk drive is device type DJ, and an RA80? or RA81 disk drive is device type DU. The c identifies theD controller, and the u identifies the unit number of the device. ! --------- ! Niveau 2. 2 Qualifiers /HOST_NAME /HOST_NAME=node-nameD Specifies the host node name that is the prefered path for C the disk. The node name must match an existing node that isC known to the local node and if the node is a VAX or AXP system,' it must be running the MSCP server./FORCE /FORCE /NOFORCE (Default)C Causes the disk class driver to select the server path with theD highest load available rating. The PHYS_IO privilege is required for this operation./VERSION /VERSION /NOVERSION (Default)C Displays whether the version of the PREFER software that is currently running./LOG /LOG /NOLOG (Default)C Determines whether the prefered path specification of the disk( is displayed after the modification. ! --------- ! Niveau 3. 3 /HOST_NAME /HOST_NAME=node-nameD Specifies the host node name that is the prefered path for C the disk. The node name must match an existing node that isC known to the local node and if the node is a VAX or AXP system,' it must be running the MSCP server. ! --------- ! Niveau 3.3 /FORCE /FORCE /NOFORCE (Default)C Causes the disk class driver to select the server path with theD highest load available rating. The PHYS_IO privilege is required for this operation. ! --------- ! Niveau 3. 3 /VERSION  /VERSION /NOVERSION (Default)C Displays whether the version of the PREFER software that is currently running. ! --------- ! Niveau 3.3 /LOG /LOG /NOLOG (Default)C Determines whether the prefered path specification of the disk( is displayed after the modification. ! --------- ! Niveau 2. 2 ExamplesC The disk $10$DUA10: has a primary path HSC015 and secondary path HSC014.C 1. Issuing the following PREFER command specifies the prefered" path HSC014 for $10$DUA10:( $ PREFER $10$DUA10: /HOST=HSC014A 2. Issuing the following PREFER command forces a Path Change2 to the prefered path HSC014 for $10$DUA10:/ $ PREFER $10$DUA10: /HOST=HSC014 /FORCEB Note that forcing a path change places the disk in mountB verification. New I/O requests are suspended until mount verification is complete.C 3. Issuing the following PREFER command specifies the p refered@ path HSC014 for $10$DUA10:, display the current version : running and the modification of the prefered path.= $ PREFER $10$DUA10: /HOST=HSC014 /FORCE /LOG /VERSION'%PREFER-I-VERSION, PREFER V3.01 R322-97H%PREFER-S-FORCEPATH, Force Preferred Path for $10$DUA10: on node HSC014.ww*[PREFER]PREFER.HLP;1+,F./ 4I-FH|0123KPWO56)CdSٛ7m89Ԛ=GHJ ! --------- ! Niveau 1.1 PREFERG The PREFER command specifies a preferred path for DSA disks. This F includes RA-series disks and disks accessed through the MSCP server.G If a preferred path is specified for a disk, the MSCP disk class F drivers (DUDRIVER and DSDRIVER) use the path as their first attemptF to locate the disk and bring it on line as a result of a DCL commandF MOUNT or failover of an already mounted disk. In addition, you canF initiate failover of a mounted disk in order to force the disk toF the preferred path, or to use load-balancing information for disks accessed through MSCP servers.F For more information on the use of preferred path, please refer to the VMS I/O User's Guide. FormatI PREFER device-name[:] /HOST_NAME=node-name [/FORCE] [/LOG] [/VERSION] ! --------- ! Niveau 2. 2 Description  Forcing a Path Change:C You can move a disk that is already mounted to its preferredC path by specifying the IO$M_FORCEPATH modifier. If a preferredC path has not been specified for a disk that is accessed throughC the MSCP server, the IO$M_FORCEPATH function causes the diskC class driver to use load-balancing information to select the6 server path with the highest load available rating.; Using IO$_SETPRFPATH with Disks Dual Pathed Between HSCs:D You can use the IO$_SETPRFPATH and IO$M_FORCEPATH functions to D load balance disks that are dual pathed between HSCs. The C IO$M_FORCEPATH function initiates failover of the disk on allC nodes that have it mounted and that have a direct path to theC HSCs. Since the node that issues the IO$M_FORCEPATH might not beC the first one to attempt failover of the disk, it is essentialC that all nodes that have direct connections to the HSCs specifyC the same preferred path for the disk. Only one node should issue the IO$M_FORCEPATH request.> Using IO$_SETPRFPATH with Disks Dual Pathed Between Systems:C You can use IO$M_FORCEPATH to load balance RA-series disksC that are dual pathed between systems running the MSCP server.C Both serving nodes should specify the same preferred path. InD order to move the disk between systems, the system that currentlyC has the disk on line through its local controller should issueC the IO$M_FORCEPATH request. The disk must be mounted on both serving node.@ Using IO$_SETPRFPATH with Disks Accessed Through MSCP Servers:C You can specify a preferred path for disks that are accessedC through MSCP servers. However, this specification overrides any load-balancing decisions.C Note that if a disk can be accessed through both HSC and MSCPC servers, you need not specify the HSC as a preferred path. HSC. paths are always preferred to server paths.C Using IO$M_FORCEPATH without a preferred path causes the diskC class driver to move the disk to the server with the highest available capacity.5 Using IO$_SETPRFPATH with Phase I Volume Shadowing:C You can specify IO$_SETPRFPATH for shadow set members, but notD for virtual units. IO$M_FORCEPATH is not supported for shadow set members or virtual units.6 Using IO$_SETPRFPATH with Phase II Volume Shadowing:C IO$_SETPRFPATH and IO$M_FORCEPATH are supported for shadow set$ members but not for virtual unit. ! --------- ! Niveau 2. 2 Parameters device-name[:][,...]E Specifies the physical device name or logical name of the deviceD on which the volume is to be mounted. On a system where volumesC are not connected to hierarchical storage controllers, use the following format: ddcu:C The dd describes the device type of the physical devices used.C For example, an RA60 disk drive is device type DJ, and an RA80? or RA81 disk drive is device type DU. The c identifies theD controller, and the u identifies the unit number of the device.뇽q$ PREFER031.AFFH|[PREFER]PREFER.HLP;1IfZ  ! --------- ! Niveau 2. 2 Qualifiers /HOST_NAME /HOST_NAME=node-nameD Specifies the host node name that is the prefered path for C the disk. The node name must match an existing node that isC known to the local node and if the node is a VAX or AXP system,' it must be running the MSCP server./FORCE /FORCE /NOFORCE (Default)C Causes the disk class driver to select the server path with theD highest load available rating. The PHYS_IO privilege is required for this operation./VERSION /VERSION /NOVERSION (Default)C Displays whether the version of the PREFER software that is currently running./LOG /LOG /NOLOG (Default)C Determines whether the prefered path specification of the disk( is displayed after the modification. ! --------- ! Niveau 3. 3 /HOST_NAME /HOST_NAME=node-nameD Specifies the host node name that is the prefered path for C the disk. The node name must match an existing node that isC known to the local node and if the node is a VAX or AXP system,' it must be running the MSCP server. ! --------- ! Niveau 3.3 /FORCE /FORCE /NOFORCE (Default)C Causes the disk class driver to select the server path with theD highest load available rating. The PHYS_IO privilege is required for this operation. ! --------- ! Niveau 3. 3 /VERSION /VERSION /NOVERSION (Default)C Displays whether the version of the PREFER software that is currently running. ! --------- ! Niveau 3.3 /LOG /LOG /NOLOG (Default)C Determines whether the prefered path specification of the disk( is displayed after the modification. ! --------- ! Niveau 2. 2 ExamplesC The disk $10$DUA10: has a primary path HSC015 and secondary path HSC014.C 1. Issuing the following PREFER command specifies the prefered" path HSC014 for $10$DUA10:( $ PREFER $10$DUA10: /HOST=HSC014A 2. Issuing the following PREFER command forces a Path Change2 to the prefered path HSC014 for $10$DUA10:/ $ PREFER $10$DUA10: /HOST=HSC014 /FORCEB Note that forcing a path change places the disk in mountB verification. New I/O requests are suspended until mount verification is complete.C 3. Issuing the following PREFER command specifies the prefered@ path HSC014 for $10$DUA10:, display the current version : running and the modification of the prefered path.= $ PREFER $10$DUA10: /HOST=HSC014 /FORCE /LOG /VERSION'%PREFER-I-VERSION, PREFER V3.01 R322-97H%PREFER-S-FORCEPATH, Force Preferred Path for $10$DUA10: on node HSC014.*[PREFER]PREFER.LIS_AXP_V62;1+,F .0/ 40/V-FH|0123KPWO156wޛ7_n89Ԛ=GHJ Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 1 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 T%CC-I-BADLOCALE, The compiler could not set its locale to the system default locale.9%CC-I-NEWLOCALE, The compiler is setting its locale to C.Y 1 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/Y 2 /* Set Preferred Path */Y 3 /* */Y 4 /* The set preferred path function specifies a preferred path for DSA disks. */Y 5 /* This includes RA-series disks and disks accessed through the MSCP server. */Y 6 /* If a preferred path is specified for a disk, the MSCP disk class drivers */Y 7 /* (DUDRIVER and DSDRIVER) use the path as their first attempt to locate the */Y 8 /* disk and bring it on line as a result of a DCL command MOUNT or failover */Y 9 /* of an already mounted disk. In addition, you can initiate failover of a */Y 10 /* mounted disk in order to force the disk to the preferred path, or to use */Y 11 /* load-balancing information for disks accessed through MSCP servers. */Y 12 /* */Y 13 /* Note that forcing a path change places the disk in mount verification. */Y 14 /* New I/O requests are suspended until mount verification is complete */Y 15 /* */Y 16 /* Using IO$_SETPRFPATH with Phase II Volume Shadowing IO$_SETPRFPATH and */Y 17 /* IO$M_FORCEPATH are supported for shadow set members but not for virtual */Y 18 /* units. */Y 19 /* */Y 20 /* Note that if a disk can be accessed through both HSC and MSCP servers, */Y 21 /* you need not specify the HSC as a preferred path. HSC paths are always */Y 22 /* preferred to server paths. */Y 23 /* */Y 24 /* Using IO$M_FORCEPATH without a preferred path causes the disk class driver */Y 25 /* to move the disk to the server with the highest available capacity. */Y 26 /* */Y 27 /*--------------+---------------+------------------------------------------- */Y 28 /* Date ! Auteur ! Objet */Y 29 /*--------------+---------------+------------------------------------------- */Y 30 /* 14-Nov-1997 ! JWI ! */Y 31 /*--------------+---------------+------------------------------------------- */ 32 < 33 #include /* OpenVMS return codes */< 1537 #include /* printf, ... functions */? 2209 #include /* Calling std. descriptors */L 3185 #include /* memset, strcpy, memcpy, ... functions */? 3586 #include /* CLI messages definitions */H 3943 #include /* exit, atoi, strtol, ... functions */6 4851 #include /* i/o definitions */ 5858 ( 5859 /* Modules externes systme. */U 5860 extern int SYS$GETMSG(), SYS$EXIT(), SYS$FAOL(), SYS$ASSIGN(), SYS$QIOW() ;C 5861 extern int SYS$DASSGN(), CLI$GET_VALUE(), CLI$PRESENT() ; 5862 S 5863 /* Dfinition des structures, macros & des variables globales de PREFER */1 5864 /* Structures de chane de caractres */ 5865 struct S_String 5866 {m 5867 unsigned short W_Length; /* specific to descriptor class; typically a 16-bit (unsigned) length */8 5868 unsigned char B_Dtype; /* data type code */? 5869 unsigned char B_Class; /* descriptor class code */O 5870 char *P_AfBytEl; /* address of first byte of data element */ Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 2 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 5871 }; 5872 ' 5873 /* Dfinition des macros... */9 5874 #define $Def_Desc(Name) static struct S_String \L 5875 Name = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0} 5876 * 5877 #define Desc_Fix(Name, String) \F 5878 { Name.W_Length = sizeof(String)-1 ; \= 5879 Name.P_AfBytEl = String ; } 5880 * $8 $ PREFER031.AF FH|[PREFER]PREFER.LIS_AXP_V62;10Z 5881 #define Desc_Var(Name, String) \F 5882 { Name.W_Length = strlen (String) ; \= 5883 Name.P_AfBytEl = String ; } 5884 J 5885 /* Maj dynamique de la variable descripteur avec la taille ... */E 5886 /* ... max de la chaine (pour le passage sans le nul-end) */* 5887 #define Desc_Mem(Name, String) \D 5888 { Name.W_Length = sizeof(String) ; \< 5889 Name.P_AfBytEl = String ; } 5890 = 5891 static const char rcsId[] = "PREFER V3.01 R325-97" ; 5892 2 5893 #define VERSION "PREFER V3.01 R325-97" 5894 #define TRUE 1 5895 #define FALSE 0 5896 #define BOOLEAN char 5897 4 5898 /* Descriptor de chane de caractres... */V 5899 $Def_Desc (D_QrDiskName) ; /* Parameter P1 specification (nom du disque) */U 5900 $Def_Desc (D_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */N 5901 $Def_Desc (D_QrForce) ; /* Qualifier Force (controler disque) */9 5902 $Def_Desc (D_QrLog) ; /* Qualifier Log */= 5903 $Def_Desc (D_QrVersion) ; /* Qualifier Version */9 5904 $Def_Desc (D_DiskName) ; /* Nom du disque */K 5905 $Def_Desc (D_HostName) ; /* Nom du noeud (controler disque) */ 5906 0 5907 /* Variables globales z'et diverses. */ 5908 int Stat_R1, St_Cli ; 5909 a 5910 char C_QrDiskName[] = {"DISK_NAME"} ; /* Parameter P1 specification (nom du disque) */` 5911 char C_QrHostName[] = {"HOST_NAME"} ; /* Qualifier Nom du noeud (controler disque) */Y 5912 char C_QrForce[] = {"FORCE"} ; /* Qualifier Force (controler disque) */D 5913 char C_QrLog[] = {"LOG"} ; /* Qualifier Log */H 5914 char C_QrVersion[] = {"VERSION"} ; /* Qualifier Version */ 5915 6 5916 char C_DiskName[32+1] ; /* Nom du disque */H 5917 char C_HostName[32+1] ; /* Nom du noeud (controler disque) */ 5918  5919 BOOLEAN B_OptLog ; 5920  Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 3 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 Y 5922 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/Y 5923 /* Fonction */Y 5924 /* */Y 5925 /* Get_String_Len */Y 5926 /* */Y 5927 /* Transforme une chane complte blanc en une chane au format C */Y 5928 /* */Y 5929 /* En entree: */Y 5930 /* P_String : chane transformer */Y 5931 /* L_Len : longueur max de la chane */Y 5932 /* */Y 5933 /* Resultat: */Y 5934 /* longueur de la nouvelle chane */Y 5935 /* */Y 5936 /*--------------+---------------+------------------------------------------- */Y 5937 /* Date ! Auteur ! Objet */Y 5938 /*--------------+---------------+------------------------------------------- */Y 5939 /* 14 Nov 1997 ! JWI ! */Y 5940 /*--------------+---------------+------------------------------------------- */ 5941 - 5942 int Get_String_Len (P_String, L_Len) 5943  5944 char *P_String ; 5945 int L_Len ; 5946 { 5947 L_Len-- ;E 5948 while ((L_Len >= 0) && (P_String[L_Len] == ' ')) L_Len-- ;" 5949 P_String[++L_Len] = 0 ; 5950 return L_Len ; 5951 } Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 4 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 Y 5953 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/Y 5954 /* Fonction */Y 5955 /* */Y 5956 /* Edition d'un message d'erreur Systme */Y 5957 /* */Y 5958 /*--------------+---------------+------------------------------------------- */Y 5959 /* Date ! Auteur ! Objet */Y 5960 /*--------------+---------------+------------------------------------------- */Y 5961 /* 14 Nov 1997 ! JWI ! */Y 5962 /*--------------+---------------+------------------------------------------- */ 5963  5964 void Exit_OnError () 5965 {4 5966 /* Descriptor de chane de caractres... */G 5967 $Def_Desc (D_FinalMsg); /* Message retourn par $FaoL. */B 5968 $Def_Desc (D_PreMsg); /* Corps du message d'erreur */ 5969 / 5970 /* Variables locales z'et diverses. */> 5971 register int St_Sys; /* Codes retour S.S. et RTL */ 5972  5973 int L_Flags; 5974 G 5975 short W_MsgLen; /* Long. Message retourn par $GetMsg. */G 5976 short W_OutLen; /* Output length fields. */ 5977  5978 char B_OutBuff[4];F 5979 char C_PreMsg[255+1]; /* Message retourn par $GetMsg. */F 5980 char C_FinalMsg[255+1]; /* Message retourn par $FaoL. */ 5981 # 5982 /* Dbut de traitement. */ 5983  5984 /* + */E 5985 /* Initialisation de certaines strings avec des "nulls" */2 5986 memset (C_PreMsg, 0, sizeof(C_PreMsg));) 5987 Desc_Mem (D_PreMsg, C_PreMsg);6 5988 memset (C_FinalMsg, 0, sizeof(C_FinalMsg));- 5989 Desc_Mem (D_FinalMsg, C_FinalMsg); 5990 /* - */ 5991 R 5992 /* Call $GETMSG to retrieve the format string and error text. This */R 5993 /* string will be INPUT to Sys$FaoL . */I 5994 /* Mask L_Flags. Message components to be returned. */I 5995 /* Bit 0: 1 => Include text message. */I 5996 /* 0 => Do not include text message. */I 5997 /* Bit 1: 1 => Include message identifier. */I 5998 /* 0 => Do not include message identifier. */I 5999 /* Bit 2: 1 => Include severity indicator. */I 6000 /* 0 => Do not include severity indicator. */I 6001 /* Bit 3: 1 => Include facility name. */I 6002 /* 0 => Do not include facility name. */ 6003 L_Flags = 7 ;M 6004 St_Sys = SYS$GETMSG (Stat_R1, /* Ident. of the message. */N 6005 &W_MsgLen, /* Length of the message. */I 6006 &D_PreMsg, /* Buffer to receive. */Y 6007 L_Flags, /* Message components to be returned. */L 6008 &B_OutBuff[0]); /* Optional information. *// 6009 if (~(St_Sys)&1) SYS$EXIT (St_Sys) ; Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 5 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 6010 H 6011 D_PreMsg.W_Length = W_MsgLen ; /* Length of the message. */# 6012 C_PreMsg[W_MsgLen] = 0 ; 6013 G 6014 /* On va transformer le message OpenVMS en message PREFER */D 6015 strncpy (&C_FinalMsg[0], "%PREFER-F-IDENT, message", 8) ;= 6016 strncpy (&C_FinalMsg[8], &C_PreMsg[1], W_MsgLen) ; 6017 N 6018 /* Afficher le message d'erreur et sortir sans la |,$ PREFER031.AF FH|[PREFER]PREFER.LIS_AXP_V62;10/isser de trace. */( 6019 printf ("%s\n", C_FinalMsg) ;, 6020 SYS$EXIT (0X10000000 + Stat_R1) ; 6021 } Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 6 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 Y 6023 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/Y 6024 /* Programme  */Y 6025 /* */Y 6026 /* Corps du programme */Y 6027 /* */Y 6028 /*--------------+---------------+------------------------------------------- */Y 6029 /* Date ! Auteur ! Objet */Y 6030 /*--------------+---------------+------------------------------------------- */Y 6031 /* 14 Nov 1997 ! JWI ! */Y 6032 /*--------------+---------------+------------------------------------------- */ 6033  6034 main () 6035 { 6036 /* Structures */8 6037 /* IOSB Contents for the Sense Mode Function */ 6038 volatile struct {A 6039 unsigned short W_Sts; /* Final IO status */E 6040 unsigned short W_DatLgth; /* Usually data Length */ 6041 char B_Sector ; 6042 char B_Tracks ;B 6043 unsigned short W_Cylinders ; /* Device dependent */ 6044 } R_Iosb ; 6045 / 6046 /* A counted ASCII string (.ASCIC). */ 6047 typedef struct { 6048 char B_Len ;& 6049 char C_HostName[32+1] ; 6050 char B_End ; 6051 } S_HostName ; 6052 6053 S_HostName R_HostName ; 6054 / 6055 /* Variables locales z'et diverses. */ 6056 int L_Length = 0 ;' 6057 unsigned short W_Chan = 0 ; 6058 short W_FunCde = 0 ;# 6059 char C_Message[255+1] ; 6060 # 6061 /* Dbut de traitement. */ 6062 E 6063 /* Initialisation de certaines strings avec des "nulls" */8 6064 memset (C_DiskName, 0, sizeof(C_DiskName)) ;8 6065 memset (C_HostName, 0, sizeof(C_HostName)) ;7 6066 memset (C_Message, 0, sizeof(C_Message)) ;8 6067 memset (&R_HostName, 0, sizeof(R_HostName)) ; 6068 o; 6069 /* Construction des descripteurs de String... */5d 6070 Desc_Fix (D_QrDiskName, C_QrDiskName) ; /* Parameter P1 specification (nom du disque) */c 6071 Desc_Fix (D_QrHostName, C_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */ \ 6072 Desc_Fix (D_QrForce, C_QrForce) ; /* Qualifier Force (controler disque) */\ 6073 Desc_Fix (D_QrVersion, C_QrVersion) ; /* Qualifier Force (controler disque) */G 6074 Desc_Fix (D_DiskName, C_DiskName) ; /* Nom du disque */ Y 6075 Desc_Fix (D_HostName, C_HostName) ; /* Nom du noeud (controler disque) */ G 6076 Desc_Fix (D_QrLog, C_QrLog) ; /* Qualifier Log */f 6077 r" 6078 /* Qualifier Version */< 6079 if (CLI$PRESENT (&D_QrVersion) == CLI$_PRESENT) { e Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 7 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 r; 6080 printf ("%%PREFER-I-VERSION, %s\n", VERSION);a 6081 } 6082 n 6083 /* Qualifier Log*/l 6084 B_OptLog = FALSE ;o8 6085 if (CLI$PRESENT (&D_QrLog) == CLI$_PRESENT) { 6086 B_OptLog = TRUE ;o 6087 } 6088 fL 6089 /* Paramtre P1 (nom du disque) Value (Type=$Device, Required) */K 6090 St_Cli = CLI$GET_VALUE (&D_QrDiskName, &D_DiskName, &L_Length) ; T 6091 D_DiskName.W_Length = Get_String_Len (&C_DiskName, D_DiskName.W_Length) ; 6092 /< 6093 /* Assigner un canal sur le device donn en P1 */? 6094 Stat_R1 = SYS$ASSIGN (&D_DiskName, &W_Chan, 0, 0) ; . 6095 if (~(Stat_R1)&1) Exit_OnError () ; 6096 _Y 6097 /* Qualifier Host_Name, NonNegatable, Value (Type=$Quoted_String, Required) */EK 6098 St_Cli = CLI$GET_VALUE (&D_QrHostName, &D_HostName, &L_Length) ;8S 6099 D_HostName.W_Length = Get_String_Len (C_HostName, D_HostName.W_Length) ; 6100 Q 6101 /* Construire une counted ASCII string pour le paramtre P1 de la */ Q 6102 /* QIO. On aurait pu le faire galement avec $Fao... */Q 6103 /* The P1 parameter contains the address of a counted ASCII string */sQ 6104 /* (.ASCIC). This string is the node name of the HSC or system that */ Q 6105 /* is the preferred path. The node name must match an existing node */ Q 6106 /* that is known to the local node and if the node is a VAX or AXP */ Q 6107 /* system, it must be running the MSCP server. This function does */hQ 6108 /* not move the disk to the preferred path. */ Q 6109 /* */-O 6110 memset (R_HostName.C_HostName, ' ', sizeof(R_HostName.C_HostName)) ; U 6111 strncpy (&R_HostName.C_HostName[0], &C_HostName[0], D_HostName.W_Length) ;-3 6112 R_HostName.B_Len = D_HostName.W_Length ;-3 6113 R_HostName.B_End = D_HostName.W_Length ; 6114 / 6115 /* Issue QIO to set prefered path */ & 6116 W_FunCde = IO$_SETPRFPATH ;Q 6117 Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) */eF 6118 W_Chan, /* chan: Channel ID */M 6119 W_FunCde, /* func: QIO Function code */rK 6120 &R_Iosb, /* iosb: IO status block */uT 6121 0, /* astadr: AST Address (Not used) */X 6122 0, /* astprm: AST PAram Block (Not used) */_ 6123 &R_HostName, /* p1: @ of a counted ASCII string (.ASCIC). */tB 6124 0, /* p2: Not used */B 6125 0, /* p3: Not used */B 6126 0, /* p4: Not used */B 6127 0, /* p5: Not used */B 6128 0) ; /* p6: Not used */. 6129 if (~(Stat_R1)&1) Exit_OnError () ;# 6130 Stat_R1 = R_Iosb.W_Sts ;(. 6131 if (~(Stat_R1)&1) Exit_OnError () ; 6132 *, 6133 /* Qualifier Force (controler) */: 6134 if (CLI$PRESENT (&D_QrForce) == CLI$_PRESENT) {4 6135 /* Issue QIO to force prefered path */H 6136 /* Combine function code and modifier with a bitwise OR */ 7 Source Listing 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 8 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 *: 6137 W_FunCde = IO$_SETPRFPATH | IO$M_FORCEPATH ;T 6138 Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) */I 6139 W_Chan, /* chan: Channel ID */ P 6140 W_FunCde, /* func: QIO Function code */N 6141 &R_Iosb, /* iosb: IO status block */W 6142 0, /* astadr: AST Address (Not used) */ [ 6143 0, /* astprm: AST PAram Block (Not used) */ E 6144 0, /* p1: Not used */hE 6145 0, /* p2: Not used */aE 6146 0, /* p3: Not used */fE 6147 0, /* p4: Not used */;E 6148 0, /* p5: Not used */-E 6149 0) ; /* p6: Not used */1 6150 if (~(Stat_R1)&1) Exit_OnError () ;F& 6151 Stat_R1 = R_Iosb.W_Sts ;1 6152 if (~(Stat_R1)&1) Exit_OnError () ;df 6153 if (B_OptLog) printf ("%%PREFER-S-FORCEPATH, Force Preferred Path for %s on node %s.\n",= 6154 C_DiskName, C_HostName) ;o 6155 } 6156 else {9e 6157 if (B_OptL =|$ PREFER031.AF FH|[PREFER]PREFER.LIS_AXP_V62;10)-og) printf ("%%PREFER-S-SETPRFPATH, Set Preferred Path for %s on node %s.\n",;= 6158 C_DiskName, C_HostName) ;; 6159 } 6160 *? 6161 /* Dassigner le canal sur le device donn en P1 */ ? 6162 /* Action implicite lorsque l'image est dactive */s? 6163 /* mais c'est plus propre comme cela !!! */s+ 6164 Stat_R1 = SYS$DASSGN (W_Chan) ; 9. 6165 if (~(Stat_R1)&1) Exit_OnError () ; 6166 a 6167 SYS$EXIT (Stat_R1) ;d 6168 } Command Line ------- ----CC/LIS PREFER.C ;These macros are in effect at the start of the compilation.F;----- ------ --- -- ------ -- --- ----- -- --- ------------sK __VMS_VERSION="V6.2-1H3" __DECC_MODE_RELAXED=1 __vms_version="V6.2-1H3" F VMS_VERSION="V6.2-1H3" __ALPHA=1 __Alpha_AXP=1 vms=1 __D_FLOAT=0 M __DECC=1 __alpha=1 __32BITS=1 __X_FLOAT=1 VMS=1 vms_version="V6.2-1H3" cJ __IEEE_FLOAT=0 __vms=1 __G_FLOAT=1 CC$gfloat=1 __BIASED_FLT_ROUNDS=2 L __DECC_VER=50590002 __INITIAL_POINTER_SIZE=0 __VMS=1 __VMS_VER=60210822  __PRAGMA_ENVIRONMENT=1 27-NOV-1997 10:48:32 DEC C V5.5-002 Page 3 o 27-NOV-1997 10:45:41 SRCC:[PREFER]PREFER.C;1 Y 5922 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/Y 5923 /* Fonction */Y 5924 /* *[PREFER]PREFER.LIS_VAX_V62;1+,F .4/ 443 -FH|0123KPWO556=VVޛ7Pn89Ԛ=GHJ PREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 1~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (1)` 1 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/` 2 /* Set Preferred Path */` 3 /* */` 4 /* The set preferred path function specifies a preferred path for DSA disks. */` 5 /* This includes RA-series disks and disks accessed through the MSCP server. */` 6 /* If a preferred path is specified for a disk, the MSCP disk class drivers */` 7 /* (DUDRIVER and DSDRIVER) use the path as their first attempt to locate the */` 8 /* disk and bring it on line as a result of a DCL command MOUNT or failover */` 9 /* of an already mounted disk. In addition, you can initiate failover of a */` 10 /* mounted disk in order to force the disk to the preferred path, or to use */` 11 /* load-balancing information for disks accessed through MSCP servers. */` 12 /* */` 13 /* Note that forcing a path change places the disk in mount verification. */` 14 /* New I/O requests are suspended until mount verification is complete */` 15 /* */` 16 /* Using IO$_SETPRFPATH with Phase II Volume Shadowing IO$_SETPRFPATH and */` 17 /* IO$M_FORCEPATH are supported for shadow set members but not for virtual */` 18 /* units. */` 19 /* */` 20 /* Note that if a disk can be accessed through both HSC and MSCP servers, */` 21 /* you need not specify the HSC as a preferred path. HSC paths are always */` 22 /* preferred to server paths. */` 23 /* */` 24 /* Using IO$M_FORCEPATH without a preferred path causes the disk class driver */` 25 /* to move the disk to the server with the highest available capacity. */` 26 /* */` 27 /*--------------+---------------+------------------------------------------- */` 28 /* Date ! Auteur ! Objet */` 29 /*--------------+---------------+------------------------------------------- */` 30 /* 14-Nov-1997 ! JWI ! */` 31 /*--------------+---------------+------------------------------------------- */ 32 C 33 #include /* OpenVMS return codes */C 1524 #include /* printf, ... functions */F 2258 #include /* Calling std. descriptors */S 3234 #include /* memset, strcpy, memcpy, ... functions */F 3652 #include /* CLI messages definitions */O 3998 #include /* exit, atoi, strtol, ... functions */= 4913 #include /* i/o definitions */ 5888 / 5889 /* Modules externes systme. */\ 5890 extern int SYS$GETMSG(), SYS$EXIT(), SYS$FAOL(), SYS$ASSIGN(), SYS$QIOW() ;J 5891 extern int SYS$DASSGN(), CLI$GET_VALUE(), CLI$PRESENT() ; 5892 Z 5893 /* Dfinition des structures, macros & des variables globales de PREFER */8 5894 /* Structures de chane de caractres */ 5895 struct S_String 5896 {t 5897 unsigned short W_Length; /* specific to descriptor class; typically a 16-bit (unsigned) length */? 5898 unsigned char B_Dtype; /* data type code */F 5899 unsigned char B_Class; /* descriptor class code */V 5900 char *P_AfBytEl; /* address of first byte of data element */ 5901 }; 5902 . 5903 /* Dfinition des macros... */ PREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 2~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (1)@ 5904 #define $Def_Desc(Name) static struct S_String \S 5905 Name = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0} 5906 1 5907 #define Desc_Fix(Name, String) \M 5908 { Name.W_Length = sizeof(String)-1 ; \D 5909 Name.P_AfBytEl = String ; } 5910 1 5911 #define Desc_Var(Name, String) \M 5912 { Name.W_Length = strlen (String) ; \D 5913 Name.P_AfBytEl = String ; } 5914 Q 5915 /* Maj dynamique de la variable descripteur avec la taille ... */L 5916 /* ... max de la chaine (pour le passage sans le nul-end) */1 5917 #define Desc_Mem(Name, String) \K 5918 { Name.W_Length = sizeof(String) ; \C 5919 Name.P_AfBytEl = String ; } 5920 D 5921 static const char rcsId[] = "PREFER V3.01 R325-97" ; 5922 9 5923 #define VERSION "PREFER V3.01 R325-97"$ 5924 #define TRUE 1$ 5925 #define FALSE 0' 5926 #define BOOLEAN char 5927 ; 5928 /* Descriptor de chane de caractres... */] 5929 $Def_Desc (D_QrDiskName) ; /* Parameter P1 specification (nom du disque) */\ 5930 $Def_Desc (D_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */U 5931 $Def_Desc (D_QrForce) ; /* Qualifier Force (controler disque) */@ 5932 $Def_Desc (D_QrLog) ;  $ PREFER031.AF FH|[PREFER]PREFER.LIS_VAX_V62;14 /* Qualifier Log */D 5933 $Def_Desc (D_QrVersion) ; /* Qualifier Version */@ 5934 $Def_Desc (D_DiskName) ; /* Nom du disque */R 5935 $Def_Desc (D_HostName) ; /* Nom du noeud (controler disque) */ 5936 7 5937 /* Variables globales z'et diverses. */& 5938 int Stat_R1, St_Cli ; 5939 h 5940 char C_QrDiskName[] = {"DISK_NAME"} ; /* Parameter P1 specification (nom du disque) */g 5941 char C_QrHostName[] = {"HOST_NAME"} ; /* Qualifier Nom du noeud (controler disque) */` 5942 char C_QrForce[] = {"FORCE"} ; /* Qualifier Force (controler disque) */K 5943 char C_QrLog[] = {"LOG"} ; /* Qualifier Log */O 5944 char C_QrVersion[] = {"VERSION"} ; /* Qualifier Version */ 5945 = 5946 char C_DiskName[32+1] ; /* Nom du disque */O 5947 char C_HostName[32+1] ; /* Nom du noeud (controler disque) */ 5948 # 5949 BOOLEAN B_OptLog ; 5950  5951  PREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 3~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (2) ` 5952 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/` 5953 /* Fonction */` 5954 /* */` 5955 /* Get_String_Len */` 5956 /* */` 5957 /* Transforme une chane complte blanc en une chane au format C */` 5958 /* */` 5959 /* En entree: */` 5960 /* P_String : chane transformer */` 5961 /* L_Len : longueur max de la chane */` 5962 /* */` 5963 /* Resultat: */` 5964 /* longueur de la nouvelle chane */` 5965 /* */` 5966 /*--------------+---------------+------------------------------------------- */` 5967 /* Date ! Auteur ! Objet */` 5968 /*--------------+---------------+------------------------------------------- */` 5969 /* 14 Nov 1997 ! JWI ! */` 5970 /*--------------+---------------+------------------------------------------- */ 5971 4 5972 int Get_String_Len (P_String, L_Len) 5973 5974 char *P_String ; 5975 int L_Len ; 1 5976 {e 1 5977 L_Len-- ;nL 1 5978 while ((L_Len >= 0) && (P_String[L_Len] == ' ')) L_Len-- ;) 1 5979 P_String[++L_Len] = 0 ; 1 5980 return L_Len ; 5981 }  5982  PREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 4~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (3) ` 5983 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/` 5984 /* Fonction */` 5985 /* */` 5986 /* Edition d'un message d'erreur Systme */` 5987 /* */` 5988 /*--------------+---------------+------------------------------------------- */` 5989 /* Date ! Auteur ! Objet */` 5990 /*--------------+---------------+------------------------------------------- */` 5991 /* 14 Nov 1997 ! JWI ! */` 5992 /*--------------+---------------+------------------------------------------- */ 5993 $ 5994 void Exit_OnError () 1 5995 {.; 1 5996 /* Descriptor de chane de caractres... */CN 1 5997 $Def_Desc (D_FinalMsg); /* Message retourn par $FaoL. */I 1 5998 $Def_Desc (D_PreMsg); /* Corps du message d'erreur */* 1 5999 6 1 6000 /* Variables locales z'et diverses. */E 1 6001 register int St_Sys; /* Codes retour S.S. et RTL */f 1 6002  1 6003 int L_Flags;  1 6004 N 1 6005 short W_MsgLen; /* Long. Message retourn par $GetMsg. */N 1 6006 short W_OutLen; /* Output length fields. */ 1 6007 # 1 6008 char B_OutBuff[4] ; M 1 6009 char C_PreMsg[255+1]; /* Message retourn par $GetMsg. */ M 1 6010 char C_FinalMsg[255+1]; /* Message retourn par $FaoL. */  1 6011 * 1 6012 /* Dbut de traitement. */ 1 6013  1 6014 /* + */ L 1 6015 /* Initialisation de certaines strings avec des "nulls" */9 1 6016 memset (C_PreMsg, 0, sizeof(C_PreMsg));n0 1 6017 Desc_Mem (D_PreMsg, C_PreMsg);= 1 6018 memset (C_FinalMsg, 0, sizeof(C_FinalMsg)); 4 1 6019 Desc_Mem (D_FinalMsg, C_FinalMsg); 1 6020 /* - */  1 6021 Y 1 6022 /* Call $GETMSG to retrieve the format string and error text. This */ Y 1 6023 /* string will be INPUT to Sys$FaoL . */ P 1 6024 /* Mask L_Flags. Message components to be returned. */P 1 6025 /* Bit 0: 1 => Include text message. */P 1 6026 /* 0 => Do not include text message. */P 1 6027 /* Bit 1: 1 => Include message identifier. */P 1 6028 /* 0 => Do not include message identifier. */P 1 6029 /* Bit 2: 1 => Include severity indicator. */P 1 6030 /* 0 => Do not include severity indicator. */P 1 6031 /* Bit 3: 1 => Include facility name. */P 1 6032 /* 0 => Do not include facility name. */ 1 6033 L_Flags = 7 ; T 1 6034 St_Sys = SYS$GETMSG (Stat_R1, /* Ident. of the message. */U 1 6035 &W_MsgLen, /* Length of the message. */ P 1 6036 &D_PreMsg, /* Buffer to receive. */` 1 6037 L_Flags, /* Message components to be returned. */S 1 6038 &B_OutBuff[0]); /* Optional information. */t gPREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 5~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (3)6 1 6039 if (~(St_Sys)&1) SYS$EXIT (St_Sys) ; 1 6040 O 1 6041 D_PreMsg.W_Length = W_MsgLen ; /* Length of the message. */+* 1 6042 C_PreMsg[W_MsgLen] = 0 ; 1 6043 N 1 6044 /* On va transformer le message OpenVMS en message PREFER */K 1 6045 strncpy (&C_FinalMsg[0], "%PREFER-F-IDENT, message", 8) ; D 1 6046 strncpy (&C_FinalMsg[8], &C_PreMsg[1], W_MsgLen) ; 1 6047 U 1 6048 /* Afficher le message d'erreur et sortir sans laisser de trace. */ / 1 6049 printf ("%s\n", C_FinalMsg) ;3 1 6050 SYS$EXIT (0X10000000 + Stat_R1) ;- 6051 }- 6052  /PREFER 27-NOV-1997 10:51:30  v $ PREFER031.AF FH|[PREFER]PREFER.LIS_VAX_V62;14eDEC C V5.6-003 Page 6~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (4) ` 6053 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/` 6054 /* Programme */` 6055 /* */` 6056 /* Corps du programme */` 6057 /* */` 6058 /*--------------+---------------+------------------------------------------- */` 6059 /* Date ! Auteur ! Objet */` 6060 /*--------------+---------------+------------------------------------------- */` 6061 /* 14 Nov 1997 ! JWI ! */` 6062 /*--------------+---------------+------------------------------------------- */ 6063  6064 main ()  1 6065 { 1 6066 /* Structures */? 1 6067 /* IOSB Contents for the Sense Mode Function */g# 1 6068 volatile struct {iH 1 6069 unsigned short W_Sts; /* Final IO status */L 1 6070 unsigned short W_DatLgth; /* Usually data Length */$ 1 6071 char B_Sector ;$ 1 6072 char B_Tracks ;I 1 6073 unsigned short W_Cylinders ; /* Device dependent */  1 6074 } R_Iosb ;  1 6075 6 1 6076 /* A counted ASCII string (.ASCIC). */ 1 6077 typedef struct {" 1 6078 char B_Len ;- 1 6079 char C_HostName[32+1] ;R" 1 6080 char B_End ;! 1 6081 } S_HostName ;t 1 6082 ' 1 6083 S_HostName R_HostName ;  1 6084 6 1 6085 /* Variables locales z'et diverses. */% 1 6086 int L_Length = 0 ; . 1 6087 unsigned short W_Chan = 0 ;' 1 6088 short W_FunCde = 0 ; * 1 6089 char C_Message[255+1] ; 1 6090 * 1 6091 /* Dbut de traitement. */ 1 6092 L 1 6093 /* Initialisation de certaines strings avec des "nulls" */? 1 6094 memset (C_DiskName, 0, sizeof(C_DiskName)) ;E? 1 6095 memset (C_HostName, 0, sizeof(C_HostName)) ;e> 1 6096 memset (C_Message, 0, sizeof(C_Message)) ;? 1 6097 memset (&R_HostName, 0, sizeof(R_HostName)) ; 1 6098 B 1 6099 /* Construction des descripteurs de String... */k 1 6100 Desc_Fix (D_QrDiskName, C_QrDiskName) ; /* Parameter P1 specification (nom du disque) */ j 1 6101 Desc_Fix (D_QrHostName, C_QrHostName) ; /* Qualifier Nom du noeud (controler disque) */c 1 6102 Desc_Fix (D_QrForce, C_QrForce) ; /* Qualifier Force (controler disque) */ c 1 6103 Desc_Fix (D_QrVersion, C_QrVersion) ; /* Qualifier Force (controler disque) */ N 1 6104 Desc_Fix (D_DiskName, C_DiskName) ; /* Nom du disque */` 1 6105 Desc_Fix (D_HostName, C_HostName) ; /* Nom du noeud (controler disque) */N 1 6106 Desc_Fix (D_QrLog, C_QrLog) ; /* Qualifier Log */ 1 6107 ) 1 6108 /* Qualifier Version */r sPREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 7~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (4)C 2 6109 if (CLI$PRESENT (&D_QrVersion) == CLI$_PRESENT) {*B 2 6110 printf ("%%PREFER-I-VERSION, %s\n", VERSION); 1 6111 }  1 6112 $ 1 6113 /* Qualifier Log*/$ 1 6114 B_OptLog = FALSE ;? 2 6115 if (CLI$PRESENT (&D_QrLog) == CLI$_PRESENT) {_& 2 6116 B_OptLog = TRUE ; 1 6117 }  1 6118 S 1 6119 /* Paramtre P1 (nom du disque) Value (Type=$Device, Required) */ R 1 6120 St_Cli = CLI$GET_VALUE (&D_QrDiskName, &D_DiskName, &L_Length) ;[ 1 6121 D_DiskName.W_Length = Get_String_Len (&C_DiskName, D_DiskName.W_Length) ;  1 6122 C 1 6123 /* Assigner un canal sur le device donn en P1 */eF 1 6124 Stat_R1 = SYS$ASSIGN (&D_DiskName, &W_Chan, 0, 0) ; 5 1 6125 if (~(Stat_R1)&1) Exit_OnError () ;  1 6126 ` 1 6127 /* Qualifier Host_Name, NonNegatable, Value (Type=$Quoted_String, Required) */R 1 6128 St_Cli = CLI$GET_VALUE (&D_QrHostName, &D_HostName, &L_Length) ;Z 1 6129 D_HostName.W_Length = Get_String_Len (C_HostName, D_HostName.W_Length) ; 1 6130 X 1 6131 /* Construire une counted ASCII string pour le paramtre P1 de la */X 1 6132 /* QIO. On aurait pu le fa)ire galement avec $Fao... */X 1 6133 /* The P1 parameter contains the address of a counted ASCII string */X 1 6134 /* (.ASCIC). This string is the node name of the HSC or system that */X 1 6135 /* is the preferred path. The node name must match an existing node */X 1 6136 /* that is known to the local node and if the node is a VAX or AXP */X 1 6137 /* system, it must be running the MSCP server. This function does */X 1 6138 /* not move the disk to the preferred path. */X 1 6139 /* */V 1 6140 memset (R_HostName.C_HostName, ' ', sizeof(R_HostName.C_HostName)) ;\ 1 6141 strncpy (&R_HostName.C_HostName[0], &C_HostName[0], D_HostName.W_Length) ;: 1 6142 R_HostName.B_Len = D_HostName.W_Length ;: 1 6143 R_HostName.B_End = D_HostName.W_Length ; 1 6144 6 1 6145 /* Issue QIO to set prefered path */- 1 6146 W_FunCde = IO$_SETPRFPATH ;sX 1 6147 Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) */M 1 6148 W_Chan, /* chan: Channel ID */ T 1 6149 W_FunCde, /* func: QIO Function code */R 1 6150 &R_Iosb, /* iosb: IO status block */[ 1 6151 0, /* astadr: AST Address (Not used) */ _ 1 6152 0, /* astprm: AST PAram Block (Not used) */ f 1 6153 &R_HostName, /* p1: @ of a counted ASCII string (.ASCIC). */I 1 6154 0, /* p2: Not used */ I 1 6155 0, /* p3: Not used */ I 1 6156 0, /* p4: Not used */ I 1 6157 0, /* p5: Not used */ I 1 6158 0) ; /* p6: Not used */E5 1 6159 if (~(Stat_R1)&1) Exit_OnError () ; * 1 6160 Stat_R1 = R_Iosb.W_Sts ;5 1 6161 if (~(Stat_R1)&1) Exit_OnError () ;R 1 6162 3 1 6163 /* Qualifier Force (controler) */A 2 6164 if (CLI$PRESENT (&D_QrForce) == CLI$_PRESENT) { ; 2 6165 /* Issue QIO to force prefered path */M ePREFER 27-NOV-1997 10:51:30 DEC C V5.6-003 Page 8~V1.0 27-NOV-1997 10:44:28 DISK_1:[WILLERJO.PREFER]PREFER.C;1 (4)O 2 6166 /* Combine function code and modifier with a bitwise OR */sA 2 6167 W_FunCde = IO$_SETPRFPATH | IO$M_FORCEPATH ;[ 2 6168 Stat_R1 = SYS$QIOW (0, /* efn: event flag (not used) *//P 2 6169 W_Chan, /* chan: Channel ID */W 2 6170 W_FunCde, /* func: QIO Function code */ U 2 6171 &R_Iosb, /* iosb: IO status block */)^ 2 6172 0, /* astadr: AST Address (Not used) */b 2 6173 0, /* astprm: AST PAram Block (Not used) */L 2 6174 0, /* p1: Not used */L 2 6175 0, /* p2: N  $ PREFER031.AF FH|[PREFER]PREFER.LIS_VAX_V62;14y0ot used */L 2 6176 0, /* p3: Not used */L 2 6177 0, /* p4: Not used */L 2 6178 0, /* p5: Not used */L 2 6179 0) ; /* p6: Not used */8 2 6180 if (~(Stat_R1)&1) Exit_OnError () ;- 2 6181 Stat_R1 = R_Iosb.W_Sts ;-8 2 6182 if (~(Stat_R1)&1) Exit_OnError () ;m 2 6183 if (B_OptLog) printf ("%%PREFER-S-FORCEPATH, Force Preferred Path for %s on node %s.\n",-D 2 6184 C_DiskName, C_HostName) ; 1 6185 }6 2 6186 else {l 2 6187 if (B_OptLog) printf ("%%PREFER-S-SETPRFPATH, Set Preferred Path for %s on node %s.\n",D 2 6188 C_DiskName, C_HostName) ; 1 6189 }i 1 6190 F 1 6191 /* Dassigner le canal sur le device donn en P1 */F 1 6192 /* Action implicite lorsque l'image est dactive */F 1 6193 /* mais c'est plus propre comme cela !!! */2 1 6194 Stat_R1 = SYS$DASSGN (W_Chan) ; 5 1 6195 if (~(Stat_R1)&1) Exit_OnError () ;. 1 6196 & 1 6197 SYS$EXIT (Stat_R1) ; 6198 }n  Command Line ------------ [CC/LIS PREFER.C  6;These macros are in effect at the start of the compilation. ;----- ------ --- -- ------ -- --- ----- -- --- ------------ { __G_FLOAT=0 __DECC=1 vms=1 VMS=1 __PRAGMA_ENVIRONMENT=1 vax=1 __vms_version="V6.2 " __vax=1 CC$gfloat=0 VAX=1 } vms_version="V6.2 " __DATE__="Nov 27 1997" __DECC_MODE_RELAXED=1 __DECC_VER=50690003 __VMS=1 VMS_VERSION="V6.2 " __IEEE_FLOAT=0 __VMS_VERSION="V6.2 " __TIME__="10:51:31" __VMS_VER=60200022 CC$parallel=0 __VAX=1 __STDC__=1 __vms=1  __LANGUAGE_C__=1 __D_FLOAT=1  e*[PREFER]PREFER.MAR-ORG;1+,*D. / 4O J-FH|0123KPWO 56=V7n89Ԛ=GHJ .TITLE PREFER .IDENT /V2.0-8/;M;****************************************************************************;* **;* COPYRIGHT (c) 1990, 1991 BY *A;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. *#;* ALL RIGHTS RESERVED. *;* *M;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED *M;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE *M;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER *M;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY *M;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY *;* TRANSFERRED. *;* *M;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE *M;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT *;* CORPORATION. *;* *M;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS *B;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. *;* *;* *M;****************************************************************************;; ; OVERVIEW:; K; This MACRO program provides a DCL command line interface to the preferred; path QIO function.;E; To use it, place the executable in SYS$SYSTEM and issue the command; SET COMMAND PREFER.CLD; O; Issue the command "PREFER device/HOST=hsc[/FORCE]" where "hsc" is name of theO; HSC that is the prefered path, e.g. $10$DUA10: has a primary path HSC015 and0; secondary path HSC014. To select HSC014, use :; ; $PREFER $10$DUA10:/HOST=HSC014; K; For information on the use of preferred path, please refer to the VMS I/O; User's Guide. ;; MACRO LIBRARY CALLS; .LIBRARY /SYS$LIBRARY:LIB/ $SSDEF $ASSIGNDEF $QIODEF $IODEF $EXITDEF .PSECT RWDATA,WRT,NOEXE,QUAD DEV_LABEL: .ASCID "disk_name" .ALIGN LONG DEV_DESC:, .WORD 32 ; Fixed length string descriptor .BYTE DSC$K_DTYPE_T .BYTE DSC$K_CLASS_S .ADDRESS DEV_NAME DEV_NAME:* .BLKB 32 ; Device to change the path onDEV_LEN:# .LONG 0 ; Returned actual length HOST_LABEL: .ASCID "host_name" .ALIGN LONG HOST_DESC:, .WORD 31 ; Fixed length string descriptor .BYTE DSC$K_DTYPE_T .BYTE DSC$K_CLASS_S .ADDRESS HOST_NAME HOST_COUNT: .BLKB 1 HOST_NAME:* .BLKB 31 ; Device to change the path on HOST_LEN:# .LONG 0 ; Returned actual length FORCE_LABEL: .ASCID "force" .ALIGN LONG FORCE_SWITCH: .LONG 0 CHNL: .WORD 0 ; Channel"IOSB: .BLKW 4 ; I/O Status Block .PSECT CODE,NOWRT,EXE,LONG .ENTRY PREFER,^M<>' ; To test for global presence this" ; must be the first CLI$ call% PUSHAL FORCE_LABEL ; Switch to test0 CALLS #1,CLI$PRESENT ; Is it present globally?. MOVL R0,FORCE_SWITCH ; Save status for later0 PUSHAL DEV_DESC ; Address of string descriptor& PUSHAL DEV_LABEL ; Want device name 3 CALLS #2,G^CLI$GET_VALUE ; From the command line BLBS R0,1$ ; Success BRW 10$1$: & $ASSIGN_S - ; Assign an I/O channel DEVNAM=DEV_DESC,- CHAN=CHNL BLBS R0,2$$ BRW 10$ ; Branch if error occured2$: PUSHAL HOST_LEN PUSHAL HOST_DESC# PUSHAL HOST_LABEL ; Get host name6 CALLS #3,G^CLI$GET_VALUE ; From the command line BLBS R0,3$ ; Success CMPL #CLI$_ABSENT,R03 BEQL 21$ ; No Host specified, should be a /FORCE BRW 10$ 21$: BRW 7$3$: 0 MOVB HOST_LEN,HOST_COUNT ; Create .ASCIC string - $QIOW_S - ; Issue QIO to set prefered path CHAN=CHNL,- FUNC=#IO$_SETPRFPATH,- IOSB=IOSB,-# P1=HOST_COUNT ; .ASCIC Node name BLBS R0,6$ ; Success BRW 10$6$: BLBS IOSB,7$ MOVW IOSB,R0 BRW 10$7$: CMPL #CLI$_PRESENT,FORCE_SWITCH) BEQL 13$ ; Issue QIO to force the path10$: $EXIT_S R0;+,; Need to switch Primary and Secondary Hosts;-13$: $QIOW_S - CHAN=CHNL,-) FUNC=#,- IOSB=IOSB BLBC R0,10$ MOVW IOSB,R0 BRB 10$ .END PREFER*[PREFER]PREFER.OBJ_AXP_V62;1+,F./ 4-FH|0123KPWO562wޛ7|n89Ԛ=GHJBBPREFERV1.027-NOV-1997 10:48DEC C V5.5-002  $ABS$i$CODE$ $LITERAL$$LINK$H$DATA$$BSS$ $READONLY_ADDR$ $READONLY$  C_QRDISKNAME  C_QRHOSTNAME C_QRFORCEC_QRLOG C_QRVERSION DECC$GXPRINTF DECC$STRNCPY SYS$GETMSGSYS$EXIT SYS$ASSIGNSYS$QIOW SYS$DASSGN CLI$GET_VALUE CLI$PRESENT STAT_R1( STAT_R1 ST_CLI(ST_CLI0  C_QRDISKNAME0 C_QRHOSTNAME0 C_QRFORCE( C_QRLOG0 C_QRVERSION ! C_DISKNAME0 C_DISKNAME ! C_HOSTNAME0 C_HOSTNAME B_OPTLOG0B_OPTLOG0JGET_STRING_LEN0JP EXIT_ONERROR(JMAIN(Jp__MAIN DECC$MAIN DECC$EXIT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INTF4b# DECC$GXPRINTF4@ DECC$GXPRINTF4GSYS$EXIT4b#SYS$EXIT4@SYS$EXIT4LGlOTS$ZERO4h@lOTS$ZERO4pGOTS$ZERO4@OTS$ZERO4GOTS$ZERO4@OTS$ZERO4Gp CLI$PRESENT48b# CLI$PRESENT4l@p CLI$PRESENT4|G DECC$GXPRINTF4b# DECC$GXPRINTF4@ DECC$GXPRINTF4G CLI$PRESENT4b# CLI$PRESENT4@ CLI$PRESENT4 G CLI$GET_VALUEP P4b# CLI$GET_VALUE4 @ CLI$GET_VALUE4 G@ SYS$ASSIGN4  b# SYS$ASSIGN4 <@@ SYS$ASSIGN4 TGp CLI$GET_VALUE4Xb# CLI$GET_VALUE4 l@p CLI$GET_VALUE4 GOTS$FILL4 @OTS$FILL4G DECC$STRNCPY4b# DECC$STRNCPY4@ DECC$STRNCPY4GDSYS$QIOW4b#SYS$QIOW4@@DSYS$QIOW4lG CLI$PRESENT4pb# CLI$PRESENT4|@ CLI$PRESENT4GSYS$QIOW4b#SYS$QIOW4@SYS$QIOW4$G< DECC$GXPRINTF4(b# DECC$GXPRINTF48@< DECC$GXPRINTF4@GT SYS$DASSGN4Hb# SYS$DASSGN4P@T SYS$DASSGN4dGxSYS$EXIT4pb#SYS$EXIT4t@xSYS$EXITE E=(%PREFER-F-IDENT, message =H?%%PREFER-S-SETPRFPATH, Set Preferred Path for %s on node %s. `=`V%%PREFER-S-FORCEPATH, Force Preferred Path for %s on node %s. PREFER V3.01 R325-97=!%%PREFER-I-VERSION, %s | |=0 P;=@ 8;7STAT_R1SYS$EXIT DECC$STRNCPY DECC$GXPRINTF;=%s p SYS$GETMSG=0; ; SYS$ASSIGN ;8OTS$FILL CLI$GET_VALUE7ST_CLI CLI$PRESENT7 C_DISKNAME=0H";= 7 C_HOSTNAME7B_OPTLOG8OTS$ZEROSYS$QIOW;P SYS$DASSGN ; ;=08";=P 7DECC$$SHELL_HANDLER= DECC$EXIT DECC$MAINQ Q6=66=66=66=66=66=66=66=66=6 5 5=PREFER V3.01 R325-97* *= DISK_NAME* * = HOST_NAME& & =FORCE$ $ = LOG( ( =VERSION< <=,$# PREFERDEC C V5.5-002? ?= 4=TRANSFER$BREAK$GO = 44=Get_String_Len4= :: := L4= X X= P44= Exit_OnErrorP4= K K K K K K b a a a c c d b db s b s z { z z z {$$ $= 4: := 4= m m= 44= main4=  #  #  |$ PREFER031.AFFH|[PREFER]PREFER.OBJ_AXP_V62;1v                                            z             8$ $= X4: := 4= ` `= 4p4= __main<4: := x4=  =   p*[PREFER]PREFER.OBJ_VAX_V62;1+,F./ 4 -FH|0123KPWO 56L{ޛ7o89Ԛ=GHJ 3PREFERV1.027-NOV-1997 10:51DEC C V5.6-003P%%PREFER-S-SETPRFPATH, Set Preferred Path for %s on node %s. eP%%PREFER-S-FORCEPATH, Force Preferred Path for %s on node %s. PPPREFER V3.01 R325-978P%%PREFER-I-VERSION, %s 0P%s P%PREFER-F-IDENT, messageBP:P PVERSIONPLOGPFORCEPHOST_NAMEPDISK_NAME2P*P"PPP PPPPREFER V3.01 R325-97P׬ЬQ#޼PA`PP ׬ЬP ޼Q@aPP ֬ЬP޼Q@aPRRP ^R<~ DECC$MEMSET@D<~ DECC$MEMSETⰏ8<SS@? SYS$GETMSGP\\PP \SYS$EXIT@2\LZ DECC$STRNCPY2~ DECC$STRNCPYN DECC$DPRINTF~SYS$EXITP^ DECC$MAIN Y W XVTZ/P^ Y W XVTZ[!h DECC$MEMSETRb!gb<~b#b d    $ (h, 0g4  CLI$PRESENTPN2 DECC$DPRINTFi CLI$PRESENTPi(d CLI$GET_VALUEPȞhU<(SSCe\\  S Ce\\ SCeS\\(|~?( SYS$ASSIGNPfPRR EXIT_ONERROR0 CLI$GET_VALUEPɞgS<0RRBc\\ PR Bc\\ RBcR0!  DECC$MEMSET<0~g DECC$STRNCPY3030S|~|~|~2S~<~ SYS$QIOWPfPRR EXIT_ONERROR<\\f\RR EXIT_ONERROR CLI$PRESENTP\RS|~|~|~|~2S~R PREFERGet_String_LenC, Exit_OnError main Sz      STAT_R1ST_CLI  C_QRDISKNAME  C_QRHOSTNAME  C_QRFORCE C_QRLOG C_QRVERSION C_DISKNAME C_HOSTNAME B_OPTLOG DECC$EXIT EXIT_ONERROR CLI$PRESENT CLI$GET_VALUE SYS$DASSGNSYS$QIOW SYS$ASSIGNSYS$EXIT SYS$GETMSG DECC$STRNCPY DECC$MEMSET DECC$DPRINTF GET_STRING_LEN , EXIT_ONERROR __MAIN 8MAIN DECC$MAIN$CODEH$DATA $ADDRESS_DATA STAT_R1 ST_CLI C_QRDISKNAME C_QRHOSTNAME C_QRFORCEC_QRLOG C_QRVERSION ! C_DISKNAME ! C_HOSTNAME B_OPTLOG<~ SYS$QIOWPfPRR EXIT_ONERROR<\\f\RR EXIT_ONERRORi\'gh DECC$DPRINTFPi\gh DECC$DPRINTF<~ SYS$DASSGNPfPRR EXIT_ONERRORfSYS$EXITZ [ DECC$EXIT[P*[PREFER]PREFER_IVP.COM;1+,Fq./ 4]-FH|0123KPWO 56G=ޛ7Ko89Ԛ=GHJ N$ ! UnCopyright 1997 J.P.Willeretz Software product. All rights Unreserved.$ ! +$ ! Procdure IVP de PREFER.$ ! $ ! Auteur: DECYLOG - JWI.$ ! Date: 19 Novembre 1997$ ! -!$ Saved_Verify = 'F$Verify(0)' $ Set NoOn#$ Say := Write Sys$OutPutB$ ProcName = F$Parse (F$Environment ("Procedure"),,, "Name"),$ Default = F$Environment ("Default")<$ Node = F$Edit (F$GetSyi ("ScsNode"), "Collapse")+$ Node_Numb = F$GetSyi ("Node_Number"))$ Arch_Nam = F$GetSyi ("Arch_Name")$ DefReper := O$ Status = %X10000001 ! %SYSTEM-S-NORMAL, normal successful completion<$ !---------------------------------------------------------?$ Temps = 40 ! Temps strictement infrieur 255 Secondes.$ Label := THE_ENDD$ Quest := Read Sys$Command /Time='Temps' /Error='Label'/ Prompt=#$ Show Device /System /Mounted D $ SELECT: $ Say " ";$ Quest "_Please, select a device disk [NONE]: " Le_Disk>$ Le_Disk = F$Edit (Le_Disk, "UnComment, Upcase, Collapse")*$ If Le_Disk .eqs. "" Then Goto THE_END*$ If .not. F$GetDvi (Le_Disk, "Exists") $ ThenK$ Say "%''ProcName'-W-NOSUCHDEV, no such device available ''Le_Disk'"$ Goto SELECT $ Else5$ If .not. F$GetDvi (Le_Disk, "Alt_Host_Avail") $ ThenU$ Say "%''ProcName'-W-NOALTHOST, no Alternate Host available for ''Le_Disk'"$ Goto SELECT $ Else>$ Alt_Host_Name = F$GetDvi (Le_Disk, "Alt_Host_Name") $ EndIf $ EndIf$ !X$ Quest "_Please, select the Host Name (preferred path) [''Alt_Host_Name']: " Le_Path>$ Le_Path = F$Edit (Le_Path, "UnComment, Upcase, Collapse")7$ If Le_Path .eqs. "" Then $ Le_Path = Alt_Host_Name$ Type Sys$Input? Note that forcing a path change places the disk in mount? verification. New I/O requests are suspended until mount verification is complete.]$ Say "%''ProcName'-I-COMMAND, Prefer /Log /Version /Force /Host=''Le_Path' ''Le_Disk'..."C$ Quest "_Do want to execute the command below ? [YES]: " La_Rep<$ La_Rep = F$Edit (La_Rep, "UnComment, Upcase, Collapse"),$ If La_Rep .eqs. "" Then $ La_Rep := Yes6$ If F$Extract (0, 1, La_Rep) .eqs. "Y" .or. La_Rep $ Then=$ Prefer /Log /Version /Force /Host='Le_Path' 'Le_Disk' $ EndIf<$ !--------------------------------------------------------- $ THE_END:&$ If Saved_Verify Then $ Set Verify$ Exit 'Status'N~$ PREFER031.AV zw CXT31KHW%72^LG<>2&C\1m}{ 2_bYTWNA:URahQ5 I=r,aw׸?^D=,=nQ#3($͞,qNGP+F6| \rJF5%`ϓ/#MlV)Bet lb/AfEn*~-x 3H FM):HHy/_y=9Dk!C{n3BB(& ߛ +AkJ?J|NoyNbR|@`D\ ~h΢Cv h;lY$ct^GΧ1ӹщr&fX*,8Y~ 459/A,F RDȔO|^,L.0BV1ѧGB(xx V2IO%>Xlm6S/zyY2p1/9yЛ ^ \g}eS˼b'(8SL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