NetWare 4.0 NCP Extension is the capability in the NetWare OS that allows server application developers to write NLMs to be implemented in the OS as NCPs.
NetWare does this by allowing the NLM to create an NCP extension that calls a service routine within the NLM. NetWare assigns an NCP number to the NCP extension. A workstation application can send a custom request to the NLM over the existing NCP connection (established when the workstation attached to the file server). The application does this by getting the NCP number and then by calling Execute NCP Extension.
In general, NetWare's NCP Extension can be implemented as follows. An NLM is written to perform some task within the server, such as accessing and retrieving information from a server database.
The NLM registers itself with the OS as NCP function number 37, and the OS assigns and returns to it a subfunction number. During registration, the NLM also identifies itself to the OS by passing a name such as "MyNCP." The NLM is now a custom-built NCP. Its function number is 37, and its subfunction number is assigned by the OS and maintained in a dynamic linked list in the OS until the NLM deregisters itself.
If the NLM unloads and therefore deregisters itself from the OS, it goes away and its subfunction number is taken out of the linked list in the OS. When the NLM registers itself as an NCP again, it is assigned another subfunction number.
To allow for this dynamic nature of the NCP subfunction number, the OS also provides NCP 36. It allows workstation applications to call an NCP Extension without knowing a subfunction number. It does this by providing workstation applications the ability to retrieve from the OS an NCP Extension subfunction number as well as some other NCP Extension information.
For example, a workstation application can call NCP 36, passing the name of an application NLM who has registered itself as an NCP. NCP 36 performs the following tasks as requested by the workstation application:
Scans currently loaded NCP Extensions by Number Scans currently loaded NCP Extensions by Name Returns the maximum NCP data size
Returns an NCP subfunction number that corresponds to the name of a custom-built NCP such as "MyNCP"
Applications distributed among servers and applications loaded on workstations benefit from NCP Extension primarily because of how simple it makes client-server communications. For example, workstation clients who use the NCP Extension can take advantage of established NCP Client-Server connections without being concerned with or even knowing about IPX/SPX. The work of opening sockets, preparing ECBs, filling out the IPX/SPX packet header, and so on is all taken care of. Overall, this encourages server application developers because the functionality provided by their NLMs are more accessible, and true distributed applications are that much simpler.
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (37) byte 7 SubFuncStrucLen (4 + sizeof RequestData) word (Hi-Lo) 9 NCPextensionNumber long (Lo-Hi) 13 RequestData byte[]
Reply
Offset Content Type (reply header) 8 ReplyBuffer byte[]
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call exectues an NCP Extension that has been registered with the OS. The caller specifies the NCPextensionNumber which was obtained by calling Get NCP Extension Information (0x2222 36 --). The NCPextensionNumber is equivalent to the NCP subfunction number. NOTE: The boundary checking is done by the ncp extension handler. Also note that the RequestData portion of the request packet is dependent on the ncp extension handler used. If you use clib.nlm's ncp extension handling capabilities, the following is an example of what might be expected in the RequestData buffer:
The reply buffer length varies depending on the protocol being used. IPX will allow a reply buffer of 536 bytes. IP will allow a bigger buffer depending on what packet size was negotiated on connection. NOTE: If you use clib.nlm's ncp extension handling capabilities, the following is an example of what might be expected in the reply buffer:Offset Content Type 13 MaximumReplyLength word (Lo-Hi) 15 RequestBuffer byte[] /* 528 bytes */ RequestBufferLength word (Lo-Hi)
Reply
Offset Content Type (reply header) 8 ReplyBufferLength word (Lo-Hi) 10 ReplyBuffer byte[]
See Also
Get NCP Extension Information (old) (0x2222 36 00)
Get NCP Extension Maximum Data Size (old) (0x2222 36 01)
Get NCP Extension Information by Name (0x2222 36 02)
Get Number of Registered NCP Extensions (0x2222 36 03)
Get NCP Extension Registered Verbs List (0x2222 36 04)
Return NCP Extension Information (0x2222 36 05)
Return NCP Extension Maximum Data Size (0x2222 36 06)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (5) word (Hi-Lo) 9 SubFuncCode (0) byte 10 NCPExtensionNumber long (Lo-Hi)
Reply (InformationType 0)
Offset Content Type (reply header) 8 NCPextensionNumber long (Lo-Hi) 12 NCPextensionMajorVersion byte 13 NCPextensionMinorVersion byte 14 NCPextensionRevisionNumber byte 15 NCPextensionNameLength byte 16 NCPextensionName byte[] 48 NCPextensionCustomData byte[]
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call retrieves information about an NCP Extension specified by the value of NCPextensionNumber. If the value is not found, the next increasing NCP Extension number will be returned if present. NOTE: It is recommended that NCPExtensionNumber be set to -1 initially. A scan for an NCP extension is performed until the first valid NCP extension is found and info about it returned. Using the NCP Extension Number that is returned in the reply packet, additional requests using this NCP can be made until the desired NCP extension is found. (See NCP 36 05 which looks only for a specified NCP extension and does not scan sequentially through loaded NCP extensions). This call returns the requested information. NCPextensionCustomData is a 32 byte buffer of custom information that the NCP extension handler can optionally use.
See Also
Execute NCP Extension (0x2222 37 --)
Return NCP Extension Information (0x2222 36 05)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFuncCode (1) byte
Reply (InformationType 0)
Offset Content Type (reply header) 8 NCPdataSize word (Lo-Hi)
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call returns maximum amount of data that may be sent in the packet.
See Also
Execute NCP Extension (0x2222 37 --)
Return NCP Extension Maximum Data Size (0x2222 36 06)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (3 + NCPextensionNameLen) word (Hi-Lo) 9 SubFuncCode (2) byte 10 NCPextensionNameLen byte 11 NCPextensionName byte[NCPextensioNameLen]
Reply (InformationType 0)
Offset Content Type (reply header) 8 NCPextensionNumber long (Lo-Hi) 12 NCPextensionMajorVersion byte 13 NCPextensionMinorVersion byte 14 NCPextensionRevisionNumber byte 15 NCPextensionNameLength byte 16 NCPextensionName byte[NCPextensioNameLen] 48 NCPextensionCustomData byte[]
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call retrieves information about an NCP Extension by suppling the name of the NCP Extension. NCPextensionCustomData is a 32 byte buffer of custom information that the NCP extension handler can optionally use.
See Also
Execute NCP Extension (0x2222 37 --)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFuncCode (3) byte
Reply (InformationType 0)
Offset Content Type (reply header) 8 NumberOfNCPExtensions long (Lo-Hi)
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call retrieves the current number of NCP Exentions that have been registered.
See Also
Execute NCP Extension (0x2222 37 --)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (5) word (Hi-Lo) 9 SubFuncCode (4) byte 10 StartingNumber long (Lo-Hi)
Reply (InformationType 0)
Offset Content Type (reply header) 8 ReturnedListCount long 12 nextStartingNumber long 16 NCPExtensionNumbers long[ReturnedListCount]
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call returns a list of registered NCP Extension numbers, starting at number specified by StartingNumber. NOTE: The StartingNumber should be set to 0 for the initial request. The nextStartingNumber will contain the next number to start for repeating the call to get all of the registered NCP Extensions. The list is complete when the nextStartNumber value is zero.
See Also
Execute NCP Extension (0x2222 37 --)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (5) word (Hi-Lo) 9 SubFuncCode (5) byte 10 NCPextensionNumber long (Lo-Hi)
Reply (InformationType 0)
Offset Content Type (reply header) 8 NCPextensionNumber long (Lo-Hi) 12 NCPextensionMajorVersion byte 13 NCPextensionMinorVersion byte 14 NCPextensionRevisionNumber byte 15 NCPextensionNameLength byte 16 NCPextensionName[NCPextensionNameLength] byte 48 NCPextensionCustomData byte[]
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call retrieves information about an NCP Extension. The caller specifies the NCP Extension number. This call will only return information if the NCP Extension Number is matched. NCPextensionCustomData is a 32 byte buffer of custom information that the NCP extension handler can optionally use.
See Also
Execute NCP Extension (0x2222 37 --)
| v2.x | v3.x | v4.x | v5.x |
Request
Offset Content Type (request header) 6 FunctionCode (36) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFuncCode (6) byte
Reply
Offset Content Type (reply header) 8 NCPDataSize long (Lo-Hi)
Completion Code
0 0x00 Successful 254 0xFE
Remarks
This call returns the largest size of data that may be placed in the packet for the specified NCP Extension.
See Also
Execute NCP Extension (0x2222 37 --)