Re: IP ADDRESS




I don't follow you. If you want an application case, then consider a
workstation with 5 or 6 TCP based devices physically located at the
workstation with no programmatic connection to the client machine. In my
case I have 2 label printers, a scale, and a laser printer. When someone
goes to pack+ship an order, I don't want to force a specific user to be
logged in at that one station or to nail a specific PIB to that station.
Instead, I configured a station map that contains all of the workstation's
peripheral addresses and/or LPR devices based on the client machines IP
addresses. When anyone logs onto a specific workstation an identification
routine looks up the machine's IP and uses that to obtain the proper remote
devices map. Several different users could use any of the stations
(potentially in different SSH sessions on the same machine) and I can still
route the "data" where it needs to go and query the correct network scale
regardless of PIB/User/etc. There are other, possibly simpler, ways of
accomplishing this but this method seemed the most flexible and expandable
to me with the least amount of client machine configuration or programming.
Originally, I used the screen/window name from AccuTerm to determine
who-is-who and looked the map up that way. Unfortunately, it didn't work
100% of the time during extremely active testing and my subroutine often
chose the "Duh.. I dunno, use the default laser printer and the local label
printer" logic due to an invalid/chopped off/missing screen name.

Of course, application limitations could also be placed on the client
based on IP, subnet, or netmask. We don't have a need for that right now,
but it would be simple to implement with a client IP lookup tool similar to
this.

GlenB

"Peter McMurray" <excalibur21@xxxxxxxxxxx> wrote in message
news:zs6kk.24252$IK1.8844@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
I can see that the program is fine, I am just utterly confused as to why
one would be the least interesrted in doing it.
In the words of the inimitable Pauline "Please Explain"
Peter McMurray

"GlenB" <batchelg@xxxxxxxxxxxxx> wrote in message
news:8189c925-bfc5-4622-9603-ae4e536ad077@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The following code requires that you either don't have any of the
machines in DNS or RDNS, or that you have them all in DNS & RDNS. If
you are using it for identification only, you can create your own DNS
map in D3 and do the lookups yourself if you have a mixed/incomplete
DNS environment. The "REMOTE" in the call name is relative to the fact
that I'm asking Linux on the remote(server) side who the client side
is for a specific PIB. Enjoy!

SUBROUTINE GET.REMOTE.IP(REMOTE_IP)
NETWORK = "192.168.0.0"
!
! GET LINUX DEVICE NAME
!
PORT.NUM = SYSTEM(22)
EXECUTE 'LIST-LINES ':PORT.NUM CAPTURING OUTPUT
OUTPUT = OUTPUT<2>
CONVERT CHAR(32) TO CHAR(254) IN OUTPUT
LASTIDX = DCOUNT(OUTPUT,CHAR(254))
DEVID = OUTPUT<LASTIDX>
DEVID = SWAP(DEVID,"/dev/","")
!
! GET THE HOSTNAME FOR THE DEVICE
!
EXECUTE '!w -h' CAPTURING OUTPUT
LNS = DCOUNT(OUTPUT,CHAR(254))
IDX = 0
FOR PTR = 1 TO LNS
TLINE = OUTPUT<PTR>
CONVERT CHAR(32) TO CHAR(254) IN TLINE
LOCATE DEVID IN TLINE SETTING VM THEN
IDX = PTR
END
NEXT PTR
IF IDX > 0 THEN
WLINE = OUTPUT<IDX>
END ELSE
RETURN
END
CONVERT CHAR(32) TO CHAR(254) IN WLINE
LNS = DCOUNT(WLINE,CHAR(254))
IPCOL = 0
HOSTNAME = ''
FOR PTR = 1 TO LNS
IF WLINE<PTR> # "" AND IPCOL = 1 THEN
HOSTNAME = WLINE<PTR>
GO DONE
END
IF WLINE<PTR> = DEVID THEN
IPCOL = 1
END
NEXT PTR
STOP
DONE:
HOSTNAME = TRIM(HOSTNAME)
!
! DETERMINE IF HOSTNAME IS IP OR DNS RESOLVED HOSTNAME
! IF IT'S NOT AN IP, GET THE IP FROM LOCAL DNS
!
IPADDR = ''
IF HOSTNAME[1,3] # NETWORK[1,3] THEN
EXECUTE '!host ':HOSTNAME CAPTURING IPADDR
CONVERT CHAR(32) TO CHAR(254) IN IPADDR
LNS = DCOUNT(IPADDR,CHAR(254))
REMOTE_IP = IPADDR<LNS>
END ELSE
REMOTE_IP = HOSTNAME
END
RETURN




.



Relevant Pages

  • Re: IP ADDRESS
    ... machines in DNS or RDNS, or that you have them all in DNS & RDNS. ... GET THE HOSTNAME FOR THE DEVICE ... LNS = DCOUNT) ... FOR PTR = 1 TO LNS ...
    (comp.databases.pick)
  • Re: IP ADDRESS
    ... machines in DNS or RDNS, or that you have them all in DNS & RDNS. ... GET THE HOSTNAME FOR THE DEVICE ... LNS = DCOUNT) ... FOR PTR = 1 TO LNS ...
    (comp.databases.pick)
  • Re: adding a second nic
    ... > internal Active Directory domain zone. ... with a gateway of 192.168.1.1 and assign it in DNS as a domain name ... and use that as my internet connection ... on 192.168.1.200 called outside, with hostname ohostname. ...
    (microsoft.public.win2000.dns)
  • Re: Security flaw in ALCATEL/THOMSON Speed Touch Pro ADSL modems
    ... | because it's a way DHCP and DNS are supposed to work and it's ... firmware simply doesn't validate any further Hostname given to it, ... this flaw allows to corrupt the local zone file ...
    (Bugtraq)
  • Re: DNS-AD integration
    ... When a new non domain client machine first try to join to domain, ... the DNS will direct it to use the live domain controller for authenication? ... I have also set up AD-integrated DNS in both of these servers. ... It will use DNS Round Robin to resolve it. ...
    (microsoft.public.windows.server.dns)