Something about Netserver API's
This fast-path document is designed to get your iSeries NetServer configured and running
quickly in your network. Use iSeries NetServer to share integrated file system directories as
well as output queues to your networked Windows or Linux computers for file and print access.
OS/400 setup
Note: In current releases of OS/400, iSeries NetServer is configured to start automatically
with TCP/IP. In that case you can connect your clients to iSeries NetServer right
out-of-the-box, using the default properties configuration. The following steps are helpful
for basic customization and verification of your server.
General setup
TCP/IP Support - Verfiy that TCP/IP support has been configured on your iSeries system. You
must have at least one external TCP/IP interface configured and active to use iSeries NetServer.
Use the Configure TCP/IP (CFGTCP) command to check and/or modify interfaces, routes, set up
host table and domain name services, etc. Once the configuration is complete use the Start
TCP/IP (STRTCP) command to activate the support.
QSERVER Subsystem - The QSERVER subsystem must be started. Confirm that it is started using
the Work with Subsystems (WRKSBS) command. If the QSERVER subsystem is not started, use the
Start Subsystem (STRSBS QSERVER) command.
Network Print Server - In order for iSeries NetServer print shares to function properly, the
Network Print Server (NPS) must be started. To determine the status of NPS, use the Work with
Active Job (WRKACTJOB) command to ensure that there is a QNPSERVD job active in the QSYSWRK
subsystem. If there is no QNPSERVD job, then you must start the NPS using the Start Host Server
(STRHOSTSVR *NETPRT) command.
iSeries NetServer setup
Note: If you use iSeries Navigator (a part of iSeries Access) for administration, then that is
the preferred method for configuring iSeries NetServer. See this document for more information
on GUI administration and using the configuration wizard for first-time setup. Otherwise, read
on for command line configuration without iSeries Navigator.
iSeries NetServer Name and Domain - Verify that the iSeries NetServer name is unique on the
network and that the iSeries NetServer domain (workgroup) is appropriate for the majority of
the clients accessing the iSeries file and print services (in many cases it can be the same
domain or workgroup as the PC clients). You must have *IOSYSCFG authority to modify any part
of the iSeries NetServer configuration. To change the iSeries NetServer default server and
domain name, use the following:
CALL QZLSCHSN PARM(server-name domain-name
'Server description' X'00000000')
Once the name has been changed, it should be added to the Domain Name Service, and/or Windows
Internet Name Service, if used at your location.
Notes:
If you still use the old Client Access/400 product, then the iSeries NetServer should be
configured to use a different name so as not to conflict with Client Access. The name would be
recognized by both and the first one to retrieve the name wins, leading to inconsistent results
seen by the client. In this case, it is recommended that the iSeries NetServer use a different
name in the network by using a "Q" plus the system name. For example, QAS400A would be used for
the iSeries NetServer on an iSeries system with the name AS400A.
If Client Access/400 is not being used (or you have all Client Access Express or iSeries Access
installations), then the iSeries NetServer name can be the same as the system name.
To display the current value of the iSeries system name, use the Display Network Attributes
(DSPNETA) command.
If you choose to configure the iSeries NetServer name different than the TCP/IP name of OS/400,
modern Windows workstations (e.g. Microsoft Windows 2000/XP) may still be able to find the
iSeries NetServer by the system TCP/IP name or TCP/IP address.
Guest iSeries NetServer User Profile - Guest support is needed for those iSeries NetServer users
requiring only file and print sharing support that do not have an iSeries user profile.
If you do not change the default setting (no guest support), then unknown users will not have
access to iSeries resources through iSeries NetServer. This is the most secure option. You must
have *IOSYSCFG and *SECADM authority to modify iSeries NetServer guest support. To modify the
iSeries NetServer guest support use the following:
CALL QZLSCHSG (guest-user-profile x'00000000')
Note: The Guest User Profile should have a password if it is being used for print sharing, and
MUST not have any special authority.
Sharing Directories and Printers - Only a couple of directories are shared in the initial
configuration. Sharing additional resources is not hard. Use the QZLSADFS API to add file
shares and the QZLSADPS to add printer shares. For example, the following command adds the
share name MYDATA for sharing the "/Data" directory with a 5 character pathname, job CCSID,
text description, read-write permissions (2), no maximum users (ffffffff), and no error code
structure:
CALL QZLSADFS PARM(MYDATA '/Data' x'00000005' x'00000000'
'NetServer Data share' x'00000002' x'ffffffff' x'00000000')For more information on using these
APIs (and others) to share resources, see the online API Mini-guide.
Current Configuration - From the green screen command line, you cannot easily tell the current
settings of iSeries NetServer since the API interface was designed to be used from an
administration application like iSeries Navigator. Starting in V5R2, command line wrappers to
many of the iSeries NetServer configuration APIs have been provided in a QUSRTOOL library
component, including the ability to display current and pending properties for iSeries NetServer.
See the GO NETS page for information on using these commands.
Starting and Ending iSeries NetServer - Any configuration changes made to iSeries NetServer,
with the exception of share and session administration, do not take effect until the you stop
and then start the server. You must have *IOSYSCFG authority to use the following to end and
start iSeries NetServer:
CALL QZLSENDS PARM(X'00000000')
CALL QZLSSTRS PARM('0' X'00000000')
Determining if iSeries NetServer is Running - Use the Work with Active Job (WRKACTJOB) command
to verify that there is a QZLSSERVER job running under the QSERVER subsystem. If the QZLSSERVER
job is not active, you must start iSeries NetServer.
iSeries NetServer Connections - Using the Work with TCP/IP Network Status (NETSTAT *CNN) command
you should see the following entries. If these connections do not exist, restart iSeries NetServer.
* * netbios > 001:27:44 Listen
* * netbios > 000:00:01 *UDP
* * netbios > 000:00:00 *UDP
* * netbios > 000:30:57 Listen
For OS/400 releases that support CIFS (Common Internet File System) protocol over TCP/IP, you will
also see the following entry:
* * cifs 001:27:32 Listen
Note: The NETSTAT command output may be many pages in length.
PC setup
Properly networked PC and Linux clients may not need additional configuration to connect to
iSeries NetServer. If you are experiencing trouble, please verify the settings described below.
Windows 98
Click Start-->Settings-->Control Panel-->Network-->Configuration and verify that you have
Client for Microsoft Networks and TCP/IP added and configured.
Go to the Identification tab and verify that you have a unique Computer Name on the network
and a valid Workgroup name configured (preferably the same one as the iSeries NetServer).
Windows NT
Click Start-->Settings-->Control Panel-->Network-->Identification and verify that you have a
unique Computer Name on the network and a valid Workgroup name configured (preferably the same
one as the iSeries NetServer).
Go to the Protocols tab and verify that the TCP/IP Protocol has been added and is configured
properly.
Windows 2000
Click Start-->Settings-->Control Panel-->Network and Dial-up Connections-->Local Area Connection.
Verify that Client for Microsoft Networks and Internet Protocol (TCP/IP) are both in the list and
checked.
Select Internet Protocol (TCP/IP) and click Properties. Click Advanced. Click the WINS tab and
verify that NetBIOS over TCP/IP is not disabled. Check other TCP/IP settings.
Click Start-->Settings-->Control Panel-->System-->Network Identification tab. Verify that you have
a unique Computer Name on the network and a valid Workgroup/Domain name configured.
Other Clients - See appropriate documentation in the Information Center or the Linux pages for
Samba clients.
Check TCP/IP Support - Test the support by PINGing the iSeries system from a DOS window as follows:
PING iSeries-NetServer-server-name
Resolving iSeries NetServer Name - Ensure that an entry for the iSeries NetServer is in the
Domain Name Server (DNS). If DNS is not being used or backup resolution mechanisms are needed,
then use the PC's local LMHOSTS, or set up a Windows Internet Name Server (WINS) to resolve the
iSeries NetServer server name.
The quickest way is to add an entry to the LMHOSTS file located in the \Windows directory on a
Windows 98 PC, or the \WINNT\system32\drivers\etc directory on Windows NT/2000/XP/2003. If you
cannot find an LMHOSTS file in the specified directory it might not have been created yet. Rename
LMHOSTS.SAM in that same directory to LMHOSTS and then add a line with the following format:
TCP/IP-address iSeries-NetServer-server-name #PRE
For example:
9.5.10.1 QNETSERVER #PRE
Finding iSeries NetServer and Shared Resources - iSeries NetServer may also appear in the
Windows Network Neighborhood but this depends on your network TCP/IP configuration. Find
Computer is more likely to work in all environments.
In order to display iSeries NetServer shares double click on iSeries NetServer accessed through
either Find Computer or Windows Network Neighborhood (a.k.a. My Network Places). Remember that
Windows Network Neighborhood is also available through Windows Explorer, so iSeries NetServer
shares can be explored as well.
To find computers on Windows 2000/XP, click Start-->Search-->For Files and Folders. In the
lower left pane of the search dialog, click Comuters. Now, enter the iSeries NetServer name
(or IP address) in the field provided.
Installing iSeries Access - You can use the iSeries NetServer to easily install iSeries
Access on your Windows 98/Me/NT/2000/XP client PC. Administrating iSeries NetServer from
a PC client requires the use of iSeries Navigator. iSeries NetServer automatically shares
the QIBM directory with clients for the purpose of allowing iSeries users who already have
user profiles to install iSeries Access on client PCs. For example, to install iSeries
Access on a Windows 2000 PC, use Setup.exe from
\\iSeries-NetServer-server-name\QIBM\ProdData\CA400\Express\Install\Image.
The 'mini' API guide:
iSeries NetServer is normally administered through the user interface provided in iSeries
Navigator. However, you can also access the administration functions by calling the iSeries
NetServer APIs. This page contains brief reference information to get you started. You may
also visit the Information Center for complete API documentation in order to build your own
administration interface.
Note: Starting in V5R2, you have the option of installing a green screen command menu of
iSeries NetServer function. Click here for details.
Following is a partial list of the APIs available for administration of the iSeries NetServer.
They do not include the latest parameter options, however, they demonstrate the use for all the
required parameters. The error code structure is always the last parameter and in these examples
x'00000000' is being used instead of the actual structure.
For more information about the error code structure reference the iSeries System API guide,
SC41-4801-00.
Note: Server configuration changes will take place the next time iSeries NetServer is started.
All share addition, changes and removal, will take place immediately.
Start/Stop iSeries NetServer
CALL QZLSSTRS PARM('0' x'00000000')
Start iSeries NetServer. See the QZLSSERVER job under the QSERVER subsystem. The QZLSSERVER
is automatically started every time the QSERVER subsystem is started.
Parameters:
'0' - Reset (0 indicated no reset)
x'00000000' - used in lieu of error code structure
CALL QZLSENDS PARM(x'00000000')
End iSeries NetServer.
Parameters:
x'00000000' - used in lieu of error code structure
Add/change a file share
CALL QZLSADFS PARM(MYSHARE '/Data' x'00000005' x'00000000'
'My shared data folder' x'00000001' x'ffffffff' x'00000000')
CALL QZLSCHFS PARM(MYSHARE '/Data' x'00000005' x'00000000'
'My shared data folder' x'00000002' x'ffffffff' x'00000000')
The first command adds the file share MYSHARE, which shares the /Data folder read-only.
The second command changes the file share properties to be read-write.
Parameters:
MYSHARE - share name
'/Data' - path name
x'00000005' - length of path name
x'00000000' - CCSID encoding of path name (0 indicates same as job)
'My shared data folder' - text description
x'00000002' - permissions (2 indicates r/w, 1 is read-only)
x'ffffffff' - maximum users (-1 indicates no max)
x'00000000' - used in lieu of error code structure
Add/change a printer share
CALL QZLSADPS PARM(LASEROQ 'QPRINT QGPL '
'Default iSeries outq' x'00000001' 'IBM 4039 LaserPrinter' x'00000000')
CALL QZLSCHPS PARM(LASEROQ 'QPRINT QGPL '
'LASEROQ iSeries outq' x'00000001' 'IBM 4039 LaserPrinter' x'00000000')
Add or change a print server share. Takes effect immediately.
Parameters:
LASEROQ - share name
'QPRINT QGPL ' - qualified output queue (10 spaces needed for queue, and 10 for library)
'Default iSeries outq' - text description (changed in the QZLSCHPS call)
x'0000001' - spool file type (1 indicates *USERASCII, 2 *AFP, 3 *SCS)
'IBM 4039 LaserPrinter' - print driver type (indentifes appropriate print driver for share)
x'00000000' - used in lieu of error code structure
Remove share
CALL QZLSRMS PARM(MYSHARE x'00000000')
Remove a server share. Takes effect immediately.
Parameters:
MYSHARE - share name
x'00000000' - used in lieu of error code structure
Change Guest
CALL QZLSCHSG PARM(NETGUEST x'00000000')
Change server guest profile. The initial configuration is to disallow guest users from accessing
shares. Note: The requested changes will take place the next time iSeries NetServer is started.
NETGUEST - name of guest user profile
x'00000000' - used in lieu of error code structure
Change server information
CALL QZLSCHSI PARM(RequestVar x'00000112' ZLSS0100 x'00000000')
Change iSeries NetServer information/properties.
Parameters:
RequestVar - variable holding input data structure
x'00000112' - length of variable data
ZLSS0100 - format requested for change (ZLSS0100 indicates server information)
x'00000000' - used in lieu of error code structure
Change server name
CALL QZLSCHSN PARM(AWESERVE SMBMANIA 'demo server' x'00000000')
Change server name. Note: The requested changes will take place the next time iSeries
NetServer is started.
Parameters:
AWESERVE - server name
SMBMANIA - domain name
'demo server' - text description
x'00000000' - used in lieu of error code structure
List server information
CALL QUSCRTUS PARM('OUTDATA QGPL '
PF 2048 X'00' *ALL 'API output space')
CALL QZLSLSTI PARM('OUTDATA QGPL '
ZLSL0100 *ALL x'00000000')
DSPF STMF('/qsys.lib/qgpl.lib/outdata.usrspc')
List server information. Data is dumped to a user space. A program could be written to
interpret the data.
QUSCRTUS Parameters:
'OUTDATA QGPL ' - name of user space to create (10 spaces needed for space name, 10 for library)
PF - extended attribute (PF = physical file)
2048 - initial size for user space
X'00' - initial value to clear user space with
*ALL - public authority
'API output space' - text description
QZLSLSTI Parameters:
'OUTDATA QGPL ' - name of user space to receive information (10 spaces needed for space name,
10 for library)
ZLSL0100 - format of data requested
ZLSL0100 - Share information
ZLSL0200 - dump configuration information
ZLSL0300 - Session information
*ALL - information qualifier
x'00000000' - used in lieu of error code structure
DSPF Parameter:
'/qsys.lib/qgpl.lib/outdata.usrspc' - stream file path name of the user space
End session
CALL QZLSENSS PARM(BUCKY x'00000000')
End server session(s) from workstation BUCKY.
Parameters:
BUCKY - workstation name
x'00000000' - used in lieu of error code structure
Thanks to iSeries Information Center
|