I. INTRODUCCIÓN
1.3. Teorías relacionadas al tema
1.3.13. Gestión del riesgo de soborno identificado
ATape andMediumChangerUtilityProgramcalledtapeutilisprovidedwiththe IBM Tapeand MediumChangerDeviceDriverforHP-UXand installedin the /usr/bin directory.Thetapeutilprogramfulfillsseveralpurposes:
v Theprogramprovides thefollowingserviceaids forIBMtapesystems:
– Query DeviceType/VerifyDeviceAttachment – Query DeviceSerialNumber
– Query DeviceMicrocodeLevel – ForceDevice DiagnosticDump – StoreDeviceDiagnosticDump – DownloadDevice Microcode
HP-UX Device Driver (ATDD)
v Theprogramprovides amenudriventesttoolforexercisingortestingIBMtape andmediumchangerdeviceswith afullsuiteofsupportedoperations:
– Reading/WritingData – Tape MotionCommands
– Setting/DisplayingDevice Information/Status – Mounting/DemountingCartridges
– CartridgeInventory
v Inaddition tothemenudrivenfront end,thetapeutilprogramprovides a command-lineinterface,convenientforuseinshellscripts.
v Thesourcecodeforthetapeutilprogramisprovidedforexamplepurposesand isinstalledinthe/opt/tapeutildirectory duringthetapeutilpackage installation.
Thissourcecodeiscommentedand demonstratescallstoallthesupported devicedriverentrypoints andioctlcommands,givingtheapplication developer astartingpointforinterfacingtotheHP-UXdevicedriver.
Interactive Mode
Thetapeutilprogramprovidesbothaninteractivemodeanda command-line mode. Ifthetapeutilprogramiscalledwithnocommand-lineparameters,the interactivemodeversionisstarted.Intheinteractivemode,thedevicetobe operatedonshouldfirstbe openedusingoption1.Other optionsmaythen be selected.Theuser ispromptedforadditional informationif requiredforthe specific optionsselected.Theresultsofa commandaredisplayed afteritis executed.Ifanerroroccursforthecommand,errorinformationanddevicesense dataare displayed.Thedevicecanbeclosedusingoption2,oritisclosed automaticallywhentheQuitoptionisselected.Themenuisdisplayed once automaticallywhentheprogramisfirst called.Topreventunnecessaryscrollingof thescreen, themenuisnotdisplayedagainautomaticallyafter eachcommandbut insteadisrefreshedonlyaftertheM(menurefresh)commandisentered.
ThesecommandscanissuetheMTIOCTOPioctlwiththeMTopcodesdefinedin /usr/include/sys/mtio.h(MT mode),orissuetheSTIOC_TAPE_OPioctlwiththe ST_OPopcodesdefinedin/usr/include/sys/st.h(STmode).For detailedinformation, seetheMTIOCTOPandSTIOC_TAPE_OPsectionsintheIBMUltriumDevice Drivers: ProgrammingReference,GC35-0483.
Thedefaultfor tapeutilistheSTmode.TogglebetweentheMTorSTmodeby usingoption8. Thefollowingcommandsruninthetwomodes:
v WriteFileMark v EraseTape v Rewind v Offline
v Forward/BackwardSpaceFile v Forward/BackwardSpaceRecord v LocateEndofData
Figure6onpage102 andFigure7onpage102showthemenusthataredisplayed bythetapeutilprogramforHP-UX11.00and11iPCIBusSystems.
HP-UX Device Driver (ATDD)
Chapter22.TapeUtilityProgram 101
+---+
| IBM SCSITAPE & MEDIUM CHANGER UTILITY PROGRAM | +---+---+
| << GENERALCOMMANDS >> | << SERVICE COMMANDS >> |
| 1: Open Device | 3: Query Serial Number |
| 2: CloseDevice | 4: Query Microcode Level |
| D: DeviceType | 5: Force Dump |
| M: Menu Refresh | 6: Store Dump |
| Q: Quit Program | 7: Download Microcode |
| | 8: Query Driver Level |
+---+---+
| << BASIC SCSI COMMANDS >> |
| 9: Test UnitReady 10: Inquiry 11: Request Sense |
| 12: Log SensePage 13: Mode Page 14: Reserve on Close |
| 15: Release 16: Prevent/Allow Media Removal | +---+---+
| << TAPE DRIVE COMMANDS >> |
| 26: Read Data 27: Write Data |
| 28: WriteFile Mark 29: Erase Tape |
| 30: Rewind 31: Retension |
| 32: Offline 33: Load/Unload Tape |
| 34: ForwardSpace File 35: Backward Space File |
| 36: ForwardSpace Record 37: Backward Space Record |
| 38: LocateEnd Of Data 39: Get Parameter |
| 40: Set Parameter 41: Sync Buffer |
| 42: DisplayMessage 43: Report Tape Density |
| 44: CheckDevice Type 45: Get Record Size |
| 46: Set RecordSize 47: Get Device Status |
| 48: Get DeviceInformation 49: Get Media Information |
| 50: Get Position 51: Set Position |
| 52: Set MT/STMode |
+---+
Figure6.TAPEUTILProgramMenuforthetapedriveonHP-UX11.00and11iPCIBusSystems
+---+
| IBM SCSITAPE & MEDIUM CHANGER UTILITY PROGRAM | +---+---+
| << GENERALCOMMANDS >> | << SERVICE COMMANDS >> |
| 1: Open Device | 3: Query Serial Number |
| 2: CloseDevice | 4: Query Microcode Level |
| D: DeviceType | 5: Force Dump |
| M: Menu Refresh | 6: Store Dump |
| Q: Quit Program | 7: Download Microcode |
| | 8: Query Driver Level |
+---+---+
| << BASIC SCSI COMMANDS >> |
| 9: Test UnitReady 10: Inquiry 11: Request Sense |
| 12: Log SensePage 13: Mode Page 14: Reserve on Close |
| 15: Release 16: Prevent/Allow Media Removal | +---+---+
| << MEDIUM CHANGER COMMANDS >> |
| 17: Move Medium 18: Exchange Medium 11: Request Sense |
| 20: ElementInfo 21: Inventory 22: Read Device IDs |
| 23: Audit 24: Init Elem Status Range 25: Lock/Unlock Door|
+---+
Figure7.TAPEUTILProgramMenuforthemediumchangeronHP-UX11.00and11iPCIBusSystems
HP-UX Device Driver (ATDD)
Command-Line Interface
Ifcommand-line parametersareprovidedwhen theprogramisstarted,the programrunsincommand-linemode. Whenincommand-linemode, thedeviceis first opened,thespecificcommandisissued, andthedeviceisthen closed.The programcanbeinvoked fromwithina shellscriptifdesired.Resultsofthe operationare displayedonlywhenexecutedinverbosemode.Noinformationis displayed whennotinverbosemode.Thisisparticularlyusefulforquietshell script implementations.Acompletioncode,asdefinedin/usr/include/sys/errno.h,for theoperationrequested,isalways returnedfromtheprogramuponexit(inboth verboseandquietmode)
Theusage ofthetapeutilprogramincommand-linemodeisasfollows:
tapeutil -f device -o operation [options]
where deviceisthenameofthetapedevicespecialfile(forexample,/dev/rmt/1m) and operationisoneofthevalueslistedbelow.Thedevicespecialfileandthe operationare required.Thespecificoptionsassociatedwitha particularoperation are indicatedbelow.Parametersenclosedinsquarebracketsareoptional.All others are required.