🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Daryl Anderson Fri, 22 Jul 1994 15:43
Netware IPX Network Address
#3
Author: Daryl Anderson
Date: Fri, 22 Jul 1994 15:43
100 lines
4396 bytes
Helo Netters,

I enclose some source code to determine the network address of a
workstation attached to a Novell Netware server.
On campus we find it usefull, especially in matching up nodes for
a corresponding BOOTP over IP.
I have used both Microsoft 7.00 and Borland C 3.1 to compile this.
Using tiny, small or medium models tends to crash some ODI drivers.

I am sorry but I have as yet no Anon FTP site to dump the executable. 
You will have to request it via email.

Comments would be appreciated, especially those in a Netware 4.X
environment only.  It has been tested and works on 3.X and 2.X
servers.

Regards
Daryl
-------------------8<-------------------------8<----------------------
/*
*   Nodeid written by Daryl Anderson (ccadda@dolphin.upe.ac.za)
*   from the University of Port Elizabeth, South Africa
*
*   Feel free to use and distribute this code
*   Comments would be appreciated, via email
*
*/
/* Utility to determine the node address of a Netware LAN workstation */
/* Use compact, large or huge model (requires far data pointers) */

#include <stdio.h>
#include <dos.h>

typedef unsigned char BYTE;


const char nodeid[] = "NODEID v7.01 by DLS Software";
const char MSG[]    = "This station's NODE ID is";

/*------------------------------------------------------------------------*/
void RemoveZeros(char *in)
{
   while (*in && (*in=='0')) {
      *in++ = ' ';
   }
}
/*------------------------------------------------------------------------*/
void main(void)
{
   union REGS r;
   struct SREGS s;
   BYTE buff_in[20], buff_out[20];
   char NetNetwork[9], NetHost[13];

   r.h.ah = 0xDC;		/* Get Station Logical Number */
   				/* al=Station Number */
                                /* cx=Station Number ASCII */
                                /* ch=First ASCII digit */
                                /* cl=Second ASCII digit */
   intdos(&r, &r);

   r.h.ah = 0xE3;               /* Bindery function call */
   s.ds   = FP_SEG(buff_out);
   r.x.si = FP_OFF(buff_out);
   s.es   = FP_SEG(buff_in);
   r.x.di = FP_OFF(buff_in);
   buff_out[0] = 0;
   buff_out[1] = 2;		/* length of rest of packet in Big Endian */
   buff_out[2] = 19;            /* Map connection to Internetwork Address */
   buff_out[3] = r.h.al;        /* supply logical station number */
   buff_in[0]  = 0;
   buff_in[1]  = 12;            /* size of return buffer */
                                /* 2-5   Network Address */
                                /* 6-11  Node Address */
                                /* 12-13 Socket Address */
   intdosx(&r, &r, &s);
   if (!r.h.al) {
      sprintf(NetNetwork, "%02X%02X%02X%02X", buff_in[2],buff_in[3],
					      buff_in[4],buff_in[5]);
      sprintf(NetHost, "%02X%02X%02X%02X%02X%02X", buff_in[6],
						   buff_in[7],
						   buff_in[8],
						   buff_in[9],
						   buff_in[10],
						   buff_in[11]);
      RemoveZeros(NetNetwork);
      RemoveZeros(NetHost);
   }
   printf("\n%s\n\n%s  [%s][%s]\n", nodeid,MSG,NetNetwork,NetHost);
}
/*------------------------------------------------------------------------*/
/* eof : NODEID.C */

+--------------------------------------------------------------------+
 Daryl Anderson                     Internet: ccadda@beluga.upe.ac.za
 Network Consultant                      Tel: +27 41 5042321
 University of Port Elizabeth            Fax: +27 41 5042574

  "A program that works first time contains a more subtle bug" - DLS
+--------------------------------------------------------------------+
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads