DIRECTORY Driver USING [GetNetworkChain, Network, Type], EthernetDriverStats USING [EtherStats]; EthernetDriverStatsImpl: CEDAR PROGRAM IMPORTS Driver EXPORTS EthernetDriverStats = { Network: TYPE = Driver.Network; GetEthernetConfig: PUBLIC PROC RETURNS [instances: NAT _ 0] = { FOR network: Network _ Driver.GetNetworkChain[], network.next UNTIL network = NIL DO IF network.type = ethernet THEN instances _ instances + 1; ENDLOOP; }; GetEthernetOneConfig: PUBLIC PROC RETURNS [instances: NAT _ 0] = { FOR network: Network _ Driver.GetNetworkChain[], network.next UNTIL network = NIL DO IF network.type = ethernetOne THEN instances _ instances + 1; ENDLOOP; }; GetEthernetStats: PUBLIC PROC [instance: NAT] RETURNS [stats: EthernetDriverStats.EtherStats _ NIL] = { network: Network _ GetNthDeviceLikeMe[ethernet, instance]; IF network # NIL THEN stats _ NARROW[network.stats]; }; GetEthernetOneStats: PUBLIC PROC [instance: NAT] RETURNS [stats: EthernetDriverStats.EtherStats _ NIL] = { network: Network _ GetNthDeviceLikeMe[ethernetOne, instance]; IF network # NIL THEN stats _ NARROW[network.stats]; }; GetNthDeviceLikeMe: PROC [type: Driver.Type, physicalOrder: NAT] RETURNS [Network] = { i: NAT _ 0; FOR network: Network _ Driver.GetNetworkChain[], network.next UNTIL network = NIL DO IF network.type = type THEN { IF i = physicalOrder THEN RETURN[network]; i _ i + 1; } ENDLOOP; RETURN[NIL]; }; }. JEthernetDriverStatsImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Major rewrite of old EthernetOneDriver, HGM, Jan 86 Hal Murray, February 4, 1986 3:45:47 am PST Returns how many instances are present for the Xerox research Ethernet (3Mbit). Returns how many instances are present for the Xerox research Ethernet (3Mbit). ... returns the EtherStats object for the given instance of the Xerox research Ethernet driver. Note that these numbers are not monitor protected, so be prepared for strange results every so often. NIL will be returned for invalid instances. ... returns the EtherStats object for the given instance of the Xerox research Ethernet driver. Note that these numbers are not monitor protected, so be prepared for strange results every so often. NIL will be returned for invalid instances. ΚY˜codešœ™Kšœ Οmœ1™