GNIP - (G)NIP is a (N)ew (I)nterface for (P)ING =============================================== Purpose ------- The GNIP program was created to provide two new features not currently available with the LANtastic 6.0 'NET PING' command: 1. GNIP displays the serial number of each node found on the network. This allows a network administrator to quickly determine which machines on the network are using which serial numbers. 2. To return errorlevel codes which can be used in DOS batch files for determining presence of a node and whether the node is a LANtastic server. How PING Works -------------- The LANtastic 6.0 PING interface uses network broadcast datagrams to identify nodes by their machine names. The REDIR program listens for PING query datagrams that match its name and respond with a datagram containing information about the node, including version, serial number, and whether SERVER is currently running. Once a node has been identified, a "be quiet" datagram is sent to it. Queries and "be quiet" datagrams are sent until the ping response buffer fills or no further responses are received. Caveats ------- 1. The PING interface is only available in LANtastic 6.0 or higher. Earlier versions will not run GNIP and will not respond to PING query datagrams. 2. Datagrams are by definition a "non-reliable" transport mechanism. They can be lost due to collisions on the network or if the receiver is busy doing something else, like processing another datagram. Although the PING interface usually finds all the matching nodes, network performance and traffic can affect results. 3. Only one node on the network can issue PING broadcasts at any one time. A PING reservation and release broadcast is used to arbitrate among multiple nodes. GNIP will automatically try twice before returning a "Network Busy" error. 4. A LANtastic node does not reply to its own PINGs. When enumerating serial numbers, you can type REDIR /DESCRIBE to see the serial number of the node you are using. 5. Wildcard PINGs will cause a burst of datagrams on the network, determined by how many nodes match the wildcard, and how readily they recognize a "be quiet" datagram. A non-wildcard, single-node ping will not cause any significant network traffic. Syntax ------ The GNIP command line looks like: GNIP {A=Adapter} {N=Number} {Raw} {Silent} Where: is the machine name of the node or nodes on the network that you wish to identify. You can PING for nodes beginning with a common string by appending the '*' wildcard character to the string or identify all nodes on the network by specifying with a single '*'. This is the only required command line argument. 'Adapter' is the logical adapter number on which to perform the PING. If no adapter is specified, all adapters will be searched. 'Number' is the number of responses to collect during the PING. A node may reply several times before seeing a "be quiet" message, so it is best to specify N to be at least twice the number of nodes you expect to discover. The default number is 1, which is sufficient for a PING of a single node. The maximum N is 910. Specifying a larger value will return a "Not enough memory" error. The 'Raw' command line switch turns off filtering of multiple responses. This switch can be used to identify network nodes that are not receiving "be quiet" messages due to network delays or hardware problems. The 'Silent' command line switch turns off all displays other than command line or memory errors. This switch can be used to test for a single node from within a batch file and testing ERRORLEVEL for the results of the PING. See below for a sample batch file. Display ------- The ping response data is displayed in five columns. A sample display looks like this: Machine Adapter Version Server Serial Number TOWER1 0 6.0 û ABC0001001 Examples -------- GNIP TOWER1 Looks for a machine named 'TOWER1' on any adapter. GNIP TOWER* A=0 N=10 Looks for any machines with names starting with 'TOWER' on adapter 0. A total of ten responses will be accepted before filtering multiple responses. GNIP * N=50 Identifies all machines on all adapters. A total of 50 responses will be accepted before filtering out multiple responses. GNIP * N=200 Raw Identifies all machines on all adapters. A total of 200 responses will be accepted. Multiple responses will be displayed. ERRORLEVEL Values ----------------- GNIP will return one of six error codes depending on the results of a non-wildcard PING: 0 - Indicates that the PING found the specified node and it is running SERVER. 1 - Is the DOS error code for Invalid function. This usually means that a LANtastic 6.x REDIR is not present on the machine trying to run GNIP. 8 - Is the DOS error code for Out of memory. N was greater than 910 or there was insufficient DOS memory. 54 - Is the DOS error code for Network Busy. This means that another node on the network is currently using PING. 148 - Is the error code returned if there were no responders to the PING. 149 - Is the error code returned if the specified node was found but it is only running REDIR. It is not running SERVER. GNIP can return error codes 1, 8, 54 or 148 above for wildcard PINGs. A return code of 0 only means that a wildcard PING found at least one node. Sample Batch File ----------------- Here is a sample batch file that tests the error code returned by GNIP. Note the use of the 'Silent' command line switch to turn off any display and that errorlevels must be tested in descending order. @echo off gnip %1 silent if errorlevel 149 goto foundw if errorlevel 148 goto noresp if errorlevel 54 goto busy if errorlevel 1 goto invalid echo %1 is a server goto end :invalid echo REDIR not present goto end :busy echo Network busy goto end :foundw echo %1 is a workstation goto end :noresp echo %1 not found :end ------------------------------------------------------------------ ARTISOFT, Inc. makes no warranties as to the completeness or accuracy of this document. LANtastic is a trademark of ARTISOFT, Inc. Brand names, company names, and product names are trademarks or registered trademarks of their respective companies.