Programming with NetWare® XPlat APIs Novell BrainShare 2002 Programming with NetWare® XPlat APIs Joseph Cook Developer Support Engineer Novell, Inc. jcook@novell.com DCB105—Programming with NetWare XPlat APIs
Vision…one Net Mission A world where networks of all types—corporate and public, intranets, extranets, and the Internet—work together as one Net and securely connect employees, customers, suppliers, and partners across organizational boundaries Mission To solve complex business and technical challenges with Net business solutions that enable people, processes, and systems to work together and our customers to profit from the opportunities of a networked world
Introduction of the Novell Developer Kit (NDK) Novell BrainShare 2002 Introduction of the Novell Developer Kit (NDK) What is the NDK? How do I obtain the NDK? How do I use the SDK? DCB105—Programming with NetWare XPlat APIs
What Is the NDK? NetWare® NDK Set of components which allow development to NetWare Software Developer Kit (SDK) Hardware Developer Kit (HDK) Developer Tools Kit (DTK) Compatibility Test Kit (CTK)
Software Developer Kit Provides Libraries Documentation Sample code An open Application Programming Interface (API) which allow you, to easily access the Novell advanced network, Internet, and management services
Hardware Developer Kit Provides the information and sample source code needed for driver development and supports a wide range of hardware devices
Developer Tools Kit Provides the Novell and third-party tools needed to create solutions
Compatibility Test Kit ® Provides the test suites and compatibility test needed to meet Novell Yes, Tested and Approved requirements
How Do I Get the NDK? Where to go DeveloperNet® home page Novell BrainShare 2002 How Do I Get the NDK? Where to go DeveloperNet® home page developer.novell.com developer.novell.com/ndk Novell Developer Kit Development languages Novell source code Development and Test Kit information Downloads, patches, and updates DCB105—Programming with NetWare XPlat APIs
NDK on CD How to get it What do you get Novell BrainShare 2002 NDK on CD How to get it Be a DeveloperNet subscriber at the level of at least Netplus ($150.00) What do you get Everything that is on the web site plus Novell Software Connection Library (100 user) Novell Appnotes® DeveloperNet University on-line lessons And other benefits DCB105—Programming with NetWare XPlat APIs
Supported Platforms NetWare 4.x, 5.x, 6.x 32-bit Windows 95/98/NT/Windows 2000/XP
Supported SDK Development Tools Novell BrainShare 2002 Supported SDK Development Tools Borland C++ Microsoft Visual C++ Delphi Visual Basic CodeWarrior SDK DCB105—Programming with NetWare XPlat APIs
Programming with the Cross-Platform Connection Model
Objectives Initialization of the SDK Connection services and connection states Authentication and connection identity Understand the connection APIs
Initialization NWCallsInit(null, null); Called to initialization ALL SDK libraries
Connection Services NetWare SDK provides the APIs to allow control between the client and the network They configure, maintain and query the local client environment and connection tables
Connection Services (cont.) Open connections Attaching to servers Getting connection information Close and clear connections
Connection States Novell Directory Services® Novell BrainShare 2002 Connection States Novell Directory Services® Attached but not logged in Public access to the tree Logged in and authenticated Logged into a tree not to a server Authenticated and licensed Access to files on the server DCB105—Programming with NetWare XPlat APIs
Licensed Connection Automatic Program control The first time a client tries to access a file Program control NWCCLicenseConn NWCCUnlicenseConn
Connection Identity Connection information Not logged in After NWLoginToFileServer (bindery) Authentication = BINDERY Licensed state = CONNECTION LICENSED After NWDSLogin Authentication = NDS
Requester Connection Table Server Connection Number Connection Model Client Server Application Connection Handles Requester Handle Tables Requester Connection Table Server Connection Number 0x00000010 0x00000003 Process_A 0x00000003 0x00000004 0x00000010 0x00000054 Server_A 0x00000054
Requester Connection Table Server Connection Number Connection Model Client Server Application Connection Handles Requester Handle Tables Requester Connection Table Server Connection Number 0x00000010 0x00000003 Process_A 0x00000003 0x00000004 0x00000010 0x00000054 Server_A 0x00000004 0x00000011 0x00000054 0x00000011 Server_B 0x00000055 0x00000055
Requester Connection Table Server Connection Number Connection Model Client Server Application Connection Handles Requester Handle Tables Requester Connection Table Server Connection Number 0x00000003 0x00000010 Process_A 0x00000003 0x00000004 0x00000010 0x00000054 Server_A 0x00000011 0x00000004 0x00000054 Process_B 0x00000005 0x00000005 0x00000011 Server_B 0x00000055 0x00000011 0x00000055
Connection Calls NWCCGetConnAddress() NWCCOpenConnByAddress() NWCCOpenConnByName() NWCCOpenConnByRef() NWCCOpenConnByPref() NWCCCloseConn() NWCCGetAllConnInfo() NWCCGetConnInfo()
Connection Calls (cont.) NWCCGetConnAddressLength() NWCCGetPrefServerName() NWCCMakeConnPermanent() NWCCSetPrefServerName() NWCCSetPrimConn() NWCCLicenseConn() NWCCUnlicenseConn()
Reference Calls NWCCGetAllConnRefInfo() NWCCGetConnRefInfo() NWCCGetConnRefAddress() NWCCGetConnRefAddressLength() NWCCScanConnRefs() NWCCSysCloseConnRef() NWCCGetPrimaryConnRef()
NWCCOpenConnByName Opens a connection handle to a specified server rcode = NWCCOpenConnByName( /* > start Conn Handle */ startConnHandle, /* > Name of Server */ (pnstr8) name, /* > Name format */ nameFormat, /* > open state */ openState, /* > Tran Type */ NWCC_TRAN_TYPE_WILD, /* < Connection Handle */ &connHandle);
startConnHandle Handle used to resolve the name Connection handle to a server 0 if you don’t care which connection to use
Name of Server Bindery name Tree name
Name Format NWCC_NAME_FORMAT_BIND NWCC_NAME_FORMAT_NDS_TREE Use the bindery server name NWCC_NAME_FORMAT_NDS_TREE Use the NDS tree name
Open State—Available Options C Value Pascal Value Value Name 0x0001 $0001 NWCC_OPEN_LICENSED 0x0002 $0002 NWCC_OPEN_UNLICENSED This open state does not actually open a licensed connection It only sets a bit in the connection table that indicates that this is a PENDING licensed connection until such time that NWDSAuthenticate, or NWDSLogin is called This connection will then go licensed This is true even if the open state is set to NWCC_OPEN_UNLICENSED
Transport Type Values These are the transport type values C Value PascalValue Value Name 0x0001 $0001 NWCC_TRAN_TYPE_IPX 0x0003 $0003 NWCC_TRAN_TYPE_DDP 0x0004 $0004 NWCC_TRAN_TYPE_ASP 0x0008 $0008 NWCC_TRAN_TYPE_UDP 0x0009 $0009 NWCC_TRAN_TYPE_TCP 0x000A $000A NWCC_TRAN_TYPE_UDP6 0x000B $000B NWCC_TRAN_TYPE_TCP6 0x8000 $8000 NWCC_TRAN_TYPE_WILD
connHandle Returns a connection handle to the desired resource
Summary This connection model provides a consistent interface across all platforms Now the developer has a single mechanism for obtaining a connection resource Summary
Now Let’s Code!