The NetWare API: Getting File Server Configuration Information, Part I
Articles and Tips: article
Senior Research Engineer
Developer Services Division
01 Jan 1997
Describes several server configuration parameters returned by the File Server Environment APIs, which are not documented in the Novell SDK.
Introduction
NetWare's File Server Environment functions enable you to get vast quantities of information about a file server. Unfortunately, the Novell SDK does not document all the server configuration parameters returned by File Server Environment APIs. This DevNote will attempt to fill in some of the gaps in the SDK documentation.
File server environment APIs can be separated into three groups, depending on how dynamic the data returned by the API is:
Server Configuration Data-things like how much memory is in the server, and what type of CPU it has, rarely change.
Configurable Parameters-like the server's SET console parameters, can be changed by the console operator, but are unlikely to change from one minute to the next.
Statistics-like the number of packets that a particular protocol stack has routed, change constantly.
This DevNote deals only with the first two categories. I've further divided the file server configuration data elements into the following groups:
Physical Configuration
Set Commands
Communication Protocols
NLMs
Users
Component Versions
LAN/Router
File System
Disk
Media Manager
Because of the number of configuration parameters for a file server, I'll only cover the first five categories in Part I of this DevNote. I'll list the File Server Environment APIs that return the data elements in each category, then give a brief description of each data element returned by the API. In Part II, I'll cover the remaining categories, then give an algorithm for a NetWare-version-independent utility to get all the available configuration data for a server.
Physical Configuration
There are two APIs that give information about the physical attributes of the file server, NWGetCPUInfo and NWGetFileServerMiscInfo. The former is available on NetWare 4, the latter for NetWare 2. There is no corresponding API on NetWare 3.
NWGetCPUInfo
Gets hardware information about the server. Available on all versions of NetWare 4. You do not need to be a console operator to call this function.
ReturnedParameter Name
|
Description
|
CPUName |
String containing CPU type: 80386 80486 Pentium |
numCoprocessor |
Pointerto a string indicating whether a numeric coprocessor is present. |
bus |
Stringcontaining bus type: PCI bus PCMCIA bus Micro channel bus EISA bus ISA bus Unknown bus type |
numOfCPUs |
Numberof CPUs in the server. |
pageTableOwnerFlag |
Indicateswhich domain is the current domain. |
CPUTypeFlag |
The CPU type: 0=80386 1=80486 2=Pentium |
coProcessorFlag |
Indicateswhether a numeric coprocessor is present (1=present). |
busTypeFlag |
The bus type: 0x01=micro channel 0x02=EISA 0x04=PCI 0x08=PCMCIA 0x10=ISA |
IOEngineFlag |
Indicateswhether the SFT III IO engine is installed (1=installed). |
FSEngineFlag |
Indicateswhether the SFT III file system engine is installed (1=installed). |
nonDedicatedFlag |
Indicateswhether the CPU is dedicated, 0=nondedicated. |
NWGetFileServerMiscInfo
Gets server configuration information. Available on NetWare 2. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
processor |
1=8086/8088, 2=80286 |
configuredObjs |
The maximum number of Bindery objects the file server will track. A 0 means an unlimited number. |
totalMem |
Thetotal amount of memory installed on the server. |
Set Commands
NWGetServerSetCategories
Get the categories of console SET parameters for the server. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
numberOfSetCategories |
The total number of set categories supported on the server. |
categoryName [512] |
The null terminated (not length preceded) string describing the category. |
NWGetServerSetCommandsInfo
Get the name and value for a console SET parameter. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
numberOfSetCommands |
The total number of set commands for all the categories on the server. |
setCmdType |
Indicatesthe set parameter type as follows: O TYPE_NUMBER 1 TYPE_BOOLEAN 2 TYPE_TICKS 3 TYPE_BLOCK_SHIFT (512*number) 4 TYPE_TIME_OFFSET ([+| ]hh:mm:ss converted to seconds ) 5 TYPE_STRING 6 TYPE_TRIGGER The following show the types of triggers: 0x00 TYPE_TRIGGER_OFF0x01 TYPE_TRIGGER_ON 0x10 TYPE_TRIGGER_PENDING0x20 TYPE_TRIGGER_SUCCESS 0x30 TYPE_TRIGGER_FAILED |
setCmdCategory |
Indicatesthe category this parameter belongs to, as follows: 0 COMMUNICATIONS 1 MEMORY 2 FILE_CACHE 3 DIR_CACHE 4 FILE_SYSTEM 5 LOCKS 6 TRANSACTION_TRACKING 7 DISK 8 TIME 9 NCP 10 MISCELLANEOUS11 ERRORS |
setCmdFlags |
Indicates the ways in which this category may be changed, as follows:0x01 STARTUP_ONLY 0x02 HIDE 0x04 ADVANCED 0x08 STARTUP_OR_LATER 0x10 NOT_SECURED_CONSOLE (Can't be performed on secured console) |
setNameAndValueInfo [500] |
A null terminated string containing the name of the command at index 0, and the value that begins at strlen(name). The string is not length preceded |
Communication Protocols
NWGetActiveProtocolStacks
Gets the names of all active protocols. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
StackNum |
Protocol number. |
StackShortName [16] |
Length-precededstring with short name of the protocol stack. |
NWGetGeneralRouterAndSAPInfo
Get router status information. Available on all versions of NetWare 4. You must be a console operator to call this function.
Returned Parameter Name
|
Description
|
internalRIPSocket |
The router socket number. |
internalRouterDownFlag |
Indicateswhether the internal router is up or down. |
trackOnFlag |
Indicateswhether router tracking is active (the consoleoperator issued the TRACK ON console command). |
externalRouterActiveFlag |
Indicateswhether an external router is active. |
internalSAPSocketNumber |
Indicatesthe number of the socket that receives SAP packets. |
replyToNearestServerFlag |
Indicateswhether the server will respond to GetNearestServer. |
NWGetProtocolStackConfigInfo
Get name and version information for a specified protocol stack. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
stackFullName |
Pointsto the full description of the protocol stack. |
configMajorVersionNum |
The major version number of the configuration table. |
configMinorVersionNum |
The minor version number of the configuration table. |
stackMajorVersionNum |
The major version number of the protocol stack. |
stackMinorVersionNum |
The minor version number of the protocol stack. |
stackShortName [16] |
The short protocol name; name used to register the stack with the LSL. The first byte is the length of the string followed by the string itself. It is not a null terminated string. |
NWGetProtocolStkNumsByLANBrdNum
Get protocol stack numbers bound to a specified LAN card. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
stackIDCount |
The protocol stack ID number. Number returned in stackIDs by NWGetProtocolStkNumsByMediaNum |
stackIDs [FSE_STACK_IDS_MAX] |
An array of stack ID numbers. |
NWGetProtocolStkNumsByMediaNum
Get protocol stack numbers for a specified media number. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
stackIDCount |
Specifies the ID number representing the frame type used by the protocol. |
stackIDs [FSE_STACK_IDS_MAX] |
The protocol stack ID number. Number returned in stackIDs by NWGetProtocolStkNumsByMediaNum |
NLMs
NWGetNLMInfo
Returns information about a specific loaded NLM. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
fileName |
Points to the name of the NLM file. |
NLMName |
Points to the NLM name. |
copyright |
Points to the copyright string. |
identificationNum |
The number assigned to the NLM when it was loaded. |
flags |
A bit mask containing NLM flags. Bits are defined as follows: 0x0000 = REENTRANT0x0002= MULTIPLE0x0003 = SYNCHRONIZE0x0008 = PSEUDOPREEMPTION |
type |
The NLM type:0 = NLM_GENERIC1 = LAN_DRIVER2 = DSK_DRIVER3 = NAM_SPACE4 = NLM_UTILITY5= MIRRORED_SERVER_LINK6 = NLM_OS7 = NLM_PAGED_HIGH_OS8 = HOST_ADAPTER_MODULE9 = CUSTOM_DEVICE_MODULE10 = NLM_FILE_SYSTEM11 = NLM_REAL_MODE |
parentID |
The number of the NLM that caused this NLM to be loaded. |
majorVersion |
The major version of the NLM. |
minorVersion |
The minor version of the NLM. |
revision |
The revision letter of the NLM. |
year |
Year of the timestamp of the NLM. |
month |
Month of the timestamp of the NLM. |
day |
Day of the timestamp of the NLM. |
allocAvailableBytes |
Memory bytes available for allocation by the NLM. |
allocFreeCount |
The number of bytes freed that can be reclaimed. |
lastGarbageCollection |
The last time garbage collection was done for the NLM. |
messageLanguage |
A number representing the language the NLM uses. |
numOfReferencedPublics |
The number of external symbols referenced by the NLM. |
NWGetNLMLoadedList
Returns a list of loaded NLM sequence numbers. Available on all versions of NetWare 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
numberNLMsLoaded |
The total number of NLMs loaded on the server. |
NLMsInList |
The number of valid NLM IDs returned in NLMNums. |
NLMNums |
An array of NLM Numbers for all loaded NLMs. |
Users
NWCheckConsolePrivileges
Determines if the logged in user is a console operator. Available on NetWare versions 2, 3, and 4. You do not need to be a console operator to call this function.
ReturnedParameter Name
|
Description
|
Return value |
Returns 0 if user is a console operator, 0x89C6 if not. |
NWIsManager
Determine whether you are a SUPERVISOR, or in the MANAGER property of the supervisor object. Available on NetWare versions 2, 3, and 4. You must be a console operator to call this function.
ReturnedParameter Name
|
Description
|
Return value |
Returns 0 if the calling station is a manager, 0x89FF if not. A station is a manager if it is asupervisor, or if it appears in the MANAGERS property of the supervisor object. |
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.