Apple AppleShare 3.0 File Server Controls Manual de usuario

Busca en linea o descarga Manual de usuario para Software Apple AppleShare 3.0 File Server Controls. Apple AppleShare 3.0 File Server Controls User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 79
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
AppleShare File Server 3.0 Control
_____________________________________________________________________________
CHAPTER 1-SERVER CONTROL CALLS
_____________________________________________________________________________
This chapter introduces the server control calls available with the
AppleShare File Server 3.0 and describes how server control calls interact
with the main elements of file server software. The chapter presents each
server control call individually and includes a sample code segment for each
call that demonstrates how you might use the call in your own programs.
Server control calls enable applications to monitor and control the major
functions of the AppleShare File Server 3.0. These control calls let your
programs
- get and modify server configuration information
- check a server's status
- start and stop file service
- get information on users, volumes, and shared items
- disconnect users (including the users of a specific volume)
- send messages to users
- set or clear the copy-protect status of files
- use server event handlers
Server control calls, together with server event handling (described in
Chapter 2), make it possible to create any number of services and utilities
for the AppleShare File Server 3.0. Because you can monitor file usage -- who
uses files, which files are saved to or deleted from a server, where files
are copied to, and so on -- you can create file-usage audit trails, generate
server-usage statistics, and perform other types of accounting services. You
can also control file servers remotely. By monitoring the number of active
users, logging off idle users, and controlling log-on access, you can perform
load-balancing services for a group of related servers. Many other services
are possible. AppleShare File Server 3.0 server control calls and event
handling form a complete interface through which your applications and
programs can control and extend the capabilities of the file server software.
This guide refers to such programs and applications as server additions.
Note Macintosh File Sharing supports a subset of the AppleShare File Server
3.0 server control calls. See Appendix A for a list of these calls.
Main elements of file servers and server control calls
This section describes the software components and data files that make up
the AppleShare File Server 3.0 and Macintosh File Sharing. Because the
AppleShare File Server 3.0 and Macintosh File Sharing perform similar
functions, the components for each are similar and both use the same types of
data files.
Vista de pagina 0
1 2 3 4 5 6 ... 78 79

Indice de contenidos

Pagina 1

AppleShare File Server 3.0 Control_____________________________________________________________________________CHAPTER 1-SERVER CONTROL CALLS_________

Pagina 2

VAR ServerError: Integer;VAR SecondsLeft: LongInt): OSErr;VARscPB: SCParamBlockRec;BEGINscPB.pollServerPB.scCode := SCPollServer;{ Macintosh File Shar

Pagina 3

VAR VolListModDate: LongInt):OSErr;VARscPB: SCParamBlockRec;BEGINscPB.statusPB.scCode := SCGetServerStatus;scPB.statusPB.scNamePtr := NamePtr;MySCGetS

Pagina 4

scPB: SCParamBlockRec;BEGINscPB.startPB.scCode := SCStartServer;scPB.startPB.scStartSelect := kCurInstalled;scPB.startPB.scEventSelect := kFinderExtn;

Pagina 5

MySCCancelShutDown := SyncServerDispatch(@scPB);END;SCSleepServerThe following function calls SCSleepServer to temporarily shut down the fileserver (&

Pagina 6

Obtaining status information about users, volumes, and shared itemsThis section describes the server control calls that you use to obtaininformation a

Pagina 7

NamePtr^ := '';ENDELSEBEGINscPB.standardPB.scNamePtr := NamePtr;END;scPB.standardPB.scIndex := Index;MySCGetExpFldr := SyncServerDispatch(@s

Pagina 8

END;SERVER CONTROL CALLSThe following procedure creates a list of shared volumes and folders. Beforeusing this procedure, you must initialize gMaxVolu

Pagina 9

END;ENDELSE IF err <> fnfErr THEN{ fnfErr only means there is nothing at this }{ Index position }BEGIN{ handle any unexpected errors }END;END;EN

Pagina 10

UNRecID := scPB.userInfoPB.scUNRecID;UserID := scPB.userInfoPB.scUserID;LoginTime := scPB.userInfoPB.scLoginTime;LastUseTime := scPB.userInfoPB.scLast

Pagina 11

{ handle any unexpected errors }END;UNTIL err <> noErr;END;SCGetUserMountInfoThe following function calls SCGetUserMountInfo to get information

Pagina 12

AppleShare File Server 3.0 software componentsThe AppleShare File Server 3.0 is composed of a number of files. The FileServer Extension provides the a

Pagina 13

procedure, you mustinitialize gMaxVolumes and gMaxExpFolders with the values returned bythe SCGetGetupInfo control call.PROCEDURE GetAllUserMountInfo

Pagina 14

a file server.Note Although Macintosh File Sharing implements SCDisconnect, there is noway to use this call with Macintosh File Sharing because Macin

Pagina 15

ArrayCount := 1; { one user }NumMinutes := 10;Flags := UNRFSendMsgMask; { send a message }Message := 'Goodbye.';err := MySCDisconnect(@UNRe

Pagina 16

scPB.disconnectPB.scFlags := Flags;scPB.disconnectPB.scMessagePtr := MessagePtr;MySCDisconnectVolUsers := SyncServerDispatch(@scPB);END;The following

Pagina 17

This section describes the server control call that lets you send messages tousers.SCSendMessageThe following function calls SCSendMessage to send a m

Pagina 18

DiscArrayPtr: LongIntPtr;ArrayCount: Integer;Flags: Integer;Message: tLoginMsg;BEGIN{ allocate an array large enough to get all users }DiscArrayPtr :=

Pagina 19

Flags := UNRFSendMsgMask; { send a message }Message := 'Moof!';err := MySCSendMessage(DiscArrayPtr, ArrayCount,Flags, @Message);IF err = noE

Pagina 20

VARscPB: SCParamBlockRec;BEGINscPB.standardPB.scNamePtr := NamePtr;scPB.standardPB.scVRefNum := VRefNum;scPB.standardPB.scCode := SCSetCopyProtect;scP

Pagina 21

Note This call is not supported by Macintosh File Sharing.FUNCTION mySCInstallServerEventProc(theSEHandler: ProcPtr): OSErr;VARscPB: SCParamBlockRec;

Pagina 22

scPB: SCParamBlockRec;BEGINscPB.serverEventPB.scCode := SCGetServerEventProc;MySCGetServerEventProc := SyncServerDispatch(@scPB);theSEQHdrPtr := QHdrP

Pagina 23

The AppleShare Installer initially installs the AppleShare File Serverapplication in the System Folder, but the file can reside anywhere on theserver

Pagina 24

to see if the handler is interested in the event that just happened. If itis, the server calls the handler, passing pointers to the tSEQEntry recordan

Pagina 25

been satisfied, you can use server events in conjunction with server controlcalls to respond to the condition. For example, you can shut the server do

Pagina 26

qLink: QElemPtr;qType: Integer;theSERec: ServerEventRecord;END;{ Extend the tSEQEntry with a few items we need access }{ to within the server event ha

Pagina 27

BEGINscPB.serverEventPB.scSEQEntryPtr := theSEHandler;scPB.serverEventPB.scCode := SCInstallServerEventProc;mySCInstallServerEventProc := SyncServerDi

Pagina 28

(theSEQPtr: ExtendedSEQEntryPtr;theSERecPtr: ServerEventRecordPtr);VARtheSERecQElemPtr: SERecQElemPtr;BEGINWITH theSEQPtr^ DOBEGINIF freeQ.qHead <&

Pagina 29

{ and enqueue my server event record into }{ the usedQ. }Enqueue(QElemPtr(theSERecQElemPtr), @usedQ);{ Wake up our process so it can handle the server

Pagina 30

{ clear all SEwhichAFPFlags, }theSEQEntry.SEwhichAFPFlag[0] := 0;theSEQEntry.SEwhichAFPFlag[1] := 0;{ and clear all SEwhichSCFlags. }theSEQEntry.SEwhi

Pagina 31

InitSEQEntry := TRUE; { Everything is OK. }ENDELSEInitSEQEntry := FALSE; { No memory. }IF GetCurrentProcess(ourPSN) <> noErr THEN; { Get our pro

Pagina 32

{ bits first. }PROCEDURE SetSEFlags;BEGINWITH gExtendedSEQEntry.theSEQEntry DOBEGIN{ If the bCSEHAFPInDoRequest or }{ bCSEHAFPInSendResponse bits in

Pagina 33

END;{ ProcessServerEvents should be called every time through }{ the event loop to see if there are any server event }{ records to process. If there

Pagina 34

The File Sharing Extension contains no user interface of its own. The userinterface is provided by the Network Extension, which allows users to starta

Pagina 35

END;{ Your application calls InstallServerEventHandler to }{ install the server event handler. Change the }{ InitSEQEntry function where indicated to

Pagina 36

{ Your application calls RemoveServerEventHandler to }{ remove the server event handler and dispose of the }{ memory allocated by InitSEQEntry (which

Pagina 37

of the parameter block, and lists the possible result codes. The calls arepresented in alphabetical order.SCCancelShutDownSCCancelShutDown cancels the

Pagina 38

Result Codes noErr 0 No error.paramErr -50 The server is not running.SCClrCopyProtect may also return errors returned by t

Pagina 39

Result Codes noErr 0 No error.AlreadyShuttingDown -1 The server is alreadyshutting down.AlreadyDisconnecting

Pagina 40

scMessagePtr Longword input value: A pointer to a Str199containing the message sent to theworkstations.Result Codes noErr 0

Pagina 41

negative, then an empty Pascal string ('') isreturned.scVRefNum Word result value: Returns the referencenumber

Pagina 42

Fields ioResult Word result value: Result code.scSEQEntryPtr Longword result pointer: Returns a pointer to an operating sys

Pagina 43

bJBSEnabled Set if Apple II boot service is enabled.All other bits are reserved.scNumSessions Word result value: The number of currently o

Pagina 44

volumes supported by the server.Note This value is not returned under Macintosh File Sharing. (The maximumnumber of volumes supported under Macintosh

Pagina 45

File Manager The Macintosh File Manager normally handles local requests forfile access. When Macintosh File Sharing is turned on, however, the FileSh

Pagina 46

scCode Word input value: The server control code; always SCGetUserMountInfo ($0014).scFilesOpen Word result value: Returns the total nu

Pagina 47

Fields ioResult Word result value: Result code.scNamePtr Longword result pointer: Points to a Str31where the user name will

Pagina 48

scSEQEntryPtr Longword input pointer: Points to the tSEQEntryserver event object to be installed in the serverevent handler queue.scCode

Pagina 49

SCPSJustDisabled Server was just disabled and there was no startuperror.SCPSDisabledwErr Server is disabled and there is an "SE" error ins

Pagina 50

SESysTooOldErr The System file is too old for AppleShare FileServer 3.0.SEInsuffAppMemErr There was not enough memory for the file server tostart

Pagina 51

SCSendMessageSCSendMessage sends a server message to every user whose user name record ID(UNRecID) is contained in the array pointed to by scDiscArray

Pagina 52

!! WARNING Macintosh File Sharing does not return a valid value forscServerVersion if the server is not running. !!Parameter (uses versionPB vari

Pagina 53

Fields ioResult Word result value: Result code.scNamePtr Longword input pointer: Points to the filename.scVRefNum Word input value: The

Pagina 54

scSetupPtr is NIL, or SetupInfoRec contains a value that is outof range.SCShutDownSCShutDown shuts down the file

Pagina 55

range, or an unknown bit isset in scFlags.SCSleepServerSCSleepServer shuts down the file server temporarily. This call has the sameparameters as SCShu

Pagina 56

Some of the server control call descriptions are accompanied by a secondsegment of sample code that shows a particular use of that call. Each ofthese

Pagina 57

SCStartServerSCStartServer starts the file server.!! IMPORTANT The AppleShare File Server 3.0 is normally started by theAppleShare File Server appli

Pagina 58

Note This call is not supported by Macintosh File Sharing.Parameter (uses standardPB variant of SCParamBlockRec)Block 16

Pagina 59

The SCDisconnect call does not send disconnect attention messages underMacintosh File Sharing.SCGetExpFldrWith Macintosh File Sharing, your program sh

Pagina 60

Macintosh File Sharing does not return a valid value for SCServerVersion ifthe server is not running.SCSetSetupInfoThe SCSetSetupInfo call does not us

Pagina 61

SCGetExpFldr = 6;SCGetSetupInfo = 7;SCSetSetupInfo = 8;SCSendMessage = 9;SCGetServerStatus = 10;SCIn

Pagina 62

{ and 7.0.1}{ $0031 = File Server Extension, version 3.0}{ $0032 = File Sharing Extension, version 7.0.2}{some random constants for SCStart

Pagina 63

{ SCPollServer in scServerError}SENoUGFileOpenErr = 1; {The Users & Groups Data }{ File could not be opened}SENoRealVolsErr = 2; {Ther

Pagina 64

{ File Server Extension or }{ File Sharing Extension }{ could not be found}SESysTooOldErr = 13; {The System File is too old }{ for AppleShare (

Pagina 65

{ and AppleShare 3.0}SIMaxLogins: Integer; {1..11 for File }{ Sharing; 1..121 }{ for AppleShare 3.0}SISrvrUsageLimit: Integer; {10 to 1

Pagina 66

scStartSelect: Integer;scEventSelect: Integer;reserved4: ARRAY[1..4] OF LongInt;END;disconnectParam =RECORDscDiscArrayPtr: LongIntPtr;scArrayCount

Pagina 67

Determining if server control calls are availableBefore using any of the other control calls, use the TrapAvailable call tomake sure that the server d

Pagina 68

scLogins: Integer;scCode: Integer;scIndex: Integer;scDirID: LongInt;END;setupParam =RECORDscSetupPtr: SetupInfoRecPtr;scMaxVolumes:

Pagina 69

reserved3: Integer;scCode: Integer;END;versionParam =RECORDscExtNamePtr: StringPtr;reserved2: Integer;reserved3: Integer;scC

Pagina 70

reserved3: Integer;scCode: Integer;scFilesOpen: Integer;scWriteableFiles: Integer;scUNRecID: LongInt;scMounted: Bo

Pagina 71

Server control routineFUNCTION SyncServerDispatch (pb: SCParamBlockPtr): OSErr;Server event interface fileThe ServerEventINTF file contains all of the

Pagina 72

{ to detect server starts and wakeups}bCSEHShare = 5;{An HFS Share trap has just been completed}bCSEHUnShare = 6;{An HFS UnShare

Pagina 73

bCSEHSessionTimedOut = 15;{A workstation's session timed out}bCSEHSrvrClosedSession = 16;{The server has closed a workstation's session}{W

Pagina 74

TYPEServerEventRecordPtr = ^ServerEventRecord;ServerEventRecord =RECORDtheEventNumber: LongInt;{the server event that's occuring; see the }{ SE

Pagina 75

{ bCSEHAFPInSendResponse: the first }{ BufferMax bytes of the AFP packet }{ if theEventNumber = bCSEHServerControlCall: }{ the first BufferMax b

Pagina 76

theUNSUserID: LongInt;{the UserID of the user that made the call}theUserName: Str31;{the name of the user that made the call}{Note: If theEve

Pagina 77

SEwhichSCFlag: LongInt;{specifies which Server Control calls will cause }{ the Server Event Handler to be called}END;Application-defined routinePROCE

Pagina 78

END;The following segment of code gets the server version information and storesit in global variables for later use. (Global variables and their data

Pagina 79

MaxVolumes := scPB.setupPB.scMaxVolumes;MaxExpFolders := scPB.setupPB.scMaxExpFolders;CurMaxSessions := scPB.setupPB.scCurMaxSessions;END;END;END;The

Comentarios a estos manuales

Sin comentarios