SAPListPermanentServers(3sapd)


SAPListPermanentServers -- get list of permanently advertised servers

Synopsis

#include <sap_app.h> 

int SAPListPermanentServers(char *ServerEntry, PersistList_t *ServerBuf, int MaxEntries);

Description

SAPListPermanentServers fills the provided buffer with one or more PersistList_t structures. The PersistList_t structure contains information about servers that have been advertised with the SAP_ADVERTISE_FOREVER flag. These servers are listed in /etc/netware/sapouts. This function reads the records stored in that file. All numerical values are returned in machine order.


NOTE: This function is meaningful only when the SAP daemon is running.

The PersistList_t structure has the following format:

   typedef struct PersistList{ 
      uint8   ServerName[SAP_MAX_SERVER_NAME_LENGTH]; 
      uint16  ServerType; 
      uint16  ServerSocket; 
   } PersistList_t; 
If successful, SAPListPermanentServers returns the number of PersistList_t entries placed in ServerBuf.

Parameters

(IN/OUT) ServerEntry
Pointer to an index value that indicates the position in SAP responses from which the next MaxEntries will be returned. Modified on return. Should initially be set to 0.

(OUT) ServerBuf
Specifies the address of a buffer whose size is calculated as follows:
sizeof(PersistList_t *MaxEntries) 
which will be filled with PersistList_t entries.

(IN) MaxEntries
Specifies the maximum number of PersistList_t entries which can be put in ServerBuf.

Usage

The ServerEntry argument is set to the index of the server entry to be read when the next function call is made. All server entries have been returned when the function return value is less than the value of MaxEntries or zero (0).

Return values

If an error occurs, the function returns a negative number which is the negative of the error code.

>=0
successful

-7
unable to find/read NetWare® configuration file path

-28
error opening /etc/netware/sapouts file

-29
unable to read /etc/netware/sapouts file

Examples

   ServerEntry = 0; 
   MaxEntries = 1; 
   

ret=SAPListPermanentServers(&ServerEntry,&ServerBuf,MaxEntries);

References

SAPAdvertiseMyServer(3sapd)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.