HP3000-L Archives

August 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Erik Vistica <[log in to unmask]>
Reply To:
Erik Vistica <[log in to unmask]>
Date:
Fri, 25 Aug 2000 15:30:59 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
Oops, TOKEN is not an HP function but one of my own. The WORD function
can be used these days. So, new and improved command files for
converting IP address to/from Integer. Note that a 128.0.0.0 or above
address will choke.

PARM IP
COMMENT FILE=IPTOINT.CMD

SETVAR IP '!IP'

SETVAR IPTOINT           ![WORD(IP,'.',1)] * 2^24
SETVAR IPTOINT IPTOINT + ![WORD(IP,'.',2)] * 2^16
SETVAR IPTOINT IPTOINT + ![WORD(IP,'.',3)] * 2^8
SETVAR IPTOINT IPTOINT + ![WORD(IP,'.',4)]

SHOWVAR IPTOINT
COMMENT END IPTOINT.CMD


PARM INT
COMMENT FILE=INTTOIP.CMD

SETVAR INTTOIP_1 !INT        LSR 24
SETVAR INTTOIP_2 !INT LSL  8 LSR 24
SETVAR INTTOIP_3 !INT LSL 16 LSR 24
SETVAR INTTOIP_4 !INT LSL 24 LSR 24

SETVAR  INTTOIP '!INTTOIP_1.!INTTOIP_2.!INTTOIP_3.!INTTOIP_4'
SHOWVAR INTTOIP
COMMENT END INTTOIP.CMD

ATOM RSS1 RSS2