Article View: za.net.misc
Article #3Netware IPX Network Address
From: Daryl Anderson
Date: Fri, 22 Jul 1994 15:43
Date: Fri, 22 Jul 1994 15:43
100 lines
4396 bytes
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
+--------------------------------------------------------------------+
Technical Details
Message-ID:
<ccadda.293.2E2FE91B@beluga.upe.ac.za>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!ee.und.ac.za!nntp.und.ac.za!quagga.ru.ac.za!ops14.upe.ac.za!ccaddaShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fe659,93b94859018f00bd,start X-Google-Attributes: gidfe659,public X-Google-Thread: 10f918,93b94859018f00bd,start X-Google-Attributes: gid10f918,public X-Google-Thread: 10f035,93b94859018f00bd,start X-Google-Attributes: gid10f035,public X-Google-ArrivalTime: 1994-07-22 08:44:39 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!ee.und.ac.za!nntp.und.ac.za!quagga.ru.ac.za!ops14.upe.ac.za!ccadda From: ccadda@beluga.upe.ac.za (Daryl Anderson) Newsgroups: za.net.misc,bit.listserv.novell,comp.sys.novell Subject: Netware IPX Network Address Date: Fri, 22 Jul 1994 15:43:23 GMT Organization: University of Port Elizabeth Lines: 100 Message-ID: <ccadda.293.2E2FE91B@beluga.upe.ac.za> NNTP-Posting-Host: ops14.upe.ac.za