SAPGetLanData(3sapd)


SAPGetLanData -- get LAN statistics for NetWare management

Synopsis

#include <sap_app.h> 

int SAPGetLanData(int lanNumber, SAPL *LanDataBuffer);

Description

SAPGetLanData returns LAN statistics information.


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

The SAPL structure has the following format:

   typedef struct SapLanData 
   { 
      uint16   LanNumber; 
      uint16   UpdateInterval; 
      uint16   AgeFactor; 
      uint16   PacketGap; 
      int32    Network; 
      int32    LineSpeed; 
      uint32   PacketSize; 
      uint32   PacketsSent; 
      uint32   PacketsReceived; 
      uint32   BadPktsReceived; 
   } SAPL, *SAPLP; 
The following table describes the SAPL fields.

Field Description
LanNumber LAN number.
UpdateInterval Periodic update interval in seconds.
AgeFactor Number of periodic update intervals to miss before marking the server ``down''.
PacketGap Time in milliseconds between packets. Time is zero for a WAN, nonzero for a LAN.
Network Network number for this LAN.
LineSpeed Linespeed in MBS. If the sign bit is set, KBS. Currently always zero.
PacketSize Packet size that will be sent on this LAN.
PacketsSent Number of packets sent.
PacketsReceived Number of packets received.
BadPktsReceived Number of bad packets received.

 
 -------------------------------------------------------------- 
| Field          |  Description                               | 
|----------------|--------------------------------------------| 
| LanNumber      |  LAN number.                               | 
|----------------|--------------------------------------------| 
| UpdateInterval |  Periodic update interval in seconds.      | 
|----------------|--------------------------------------------| 
| AgeFactor      |  Number of periodic update intervals to    | 
|                |  miss before marking the server ``down''.  | 
|----------------|--------------------------------------------| 
| PacketGap      |  Time in milliseconds between packets. Time| 
|                |  is zero for a WAN, nonzero for a LAN.     | 
|----------------|--------------------------------------------| 
| Network        |  Network number for this LAN.              | 
|----------------|--------------------------------------------| 
| LineSpeed      |  Linespeed in MBS. If the sign bit is set, | 
|                |  KBS. Currently always zero.               | 
|----------------|--------------------------------------------| 
| PacketSize     |  Packet size that will be sent on this LAN.| 
|----------------|--------------------------------------------| 
| PacketsSent    |  Number of packets sent.                   | 
|----------------|--------------------------------------------| 
| PacketsReceived|  Number of packets received.               | 
|----------------|--------------------------------------------| 
| BadPktsReceived|  Number of bad packets received.           | 
|----------------|--------------------------------------------| 
If successful, the function returns a 1. If the LAN number specified does not exist, the function returns a zero (0).


NOTE: To details of how to display the information maintained in the SAPL structure, refer to the nwsapinfo(1ipx) manual page.

Parameters

(IN) lanNumber
Specifies the network to return information about.

(OUT) LanDataBuffer
Pointer to the address of the SAPL structure to fill with data about the LAN.

Usage

The lanNumber argument specifies the network to return information about. LAN 0 is always the internal network. The other LAN numbers are assigned sequentially starting with 1. You can get the number of LANs from a SAPStatistics(3sapd) call.

If no internal LAN exists, the LanDataBuffer is set to zeros and a successful (1) code is returned. The LanDataBuffer argument is the address of the SAPL structure to fill with data about the LAN.

Return values

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

1
successful

0
no data available for specified LAN

-10
not supported (SAP daemon not running)

Examples

   ret = SAPGetLanData (1, &LanDataBuffer); 

30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.