Discussion:
Recent DNS changes
(too old to reply)
Richard Maher
2008-08-03 09:29:13 UTC
Permalink
Hi,

I'm guessing (with very little foundation in evidence and perhaps fact :-)
that recent changes to Multinet DNS behaviour has rendered my: -

acp_gethostbyname == <inetacp$c_trans * 256 +
inetacp_func$c_gethostbyname>

call "sys$qiow"
using by value 0, net_chan, io$_acpcontrol
by reference iosb
by value 0, 0
by descriptor acp_gethostbyname,
in_addr_name(1:in_addr_name_len)
by reference out_len
by descriptor rem_node_addr
by value 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.

as returning return ss$_endoffile when a perfectly valid ASCII IP address
has been entered that is not in the local host file.

Behaviour can be reproduced at will on the Deathrow cluster if you's like to
see it. (Not sure if they've upgraded recently but they're usually pretty
good about security related patches).

It may well be something I'm doing but, as they say, it worked last week and
now it doesn't; what's changed?

Cheers Richard Maher

demo_udp_msg.cob
*****************

****************************************************************************
********
*
*
* COPYRIGHT (c) BY TIER3 SOFTWARE LTD. ALL RIGHTS RESERVED.
*
*
*
* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
ONLY *
* IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF SUCH LICENSE AND WITH
THE *
* THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY
OTHER *
* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO
ANY *
* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS
HEREBY *
* TRANSFERRED.
*
*
*
* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
AND *
* SHOULD NOT BE CONSTRUED AS A COMMITMENT BY TIER3 SOFTWARE LTD.
*
*
*
****************************************************************************
********
*+
* Facilility: DEMO_UDP_MSG
*
* Abstract: Send a UDP message to a Java Applet Web client
*
* Build example:
* $COBOL/LIST DEMO_UDP_MSG
* $MACRO/LIST DEMO_TCP_IP_DEF
* $LINK DEMO_UDP_MSG, DEMO_TCP_IP_DEF
* $RUN DEMO_UDP_MSG
*-
identification division.
program-id. demo_udp_msg.
data division.
working-storage section.
01 stock_ticker pic s9(9) comp value external
stock_ticker.
01 acp_gethostbyname pic s9(9) comp value external
acp_gethostbyname.
01 io$_setmode pic s9(9) comp value external
io$_setmode.
01 io$_writevblk pic s9(9) comp value external
io$_writevblk.
01 io$_acpcontrol pic s9(9) comp value external
io$_acpcontrol.
01 ss$_bufferovf pic s9(9) comp value external
ss$_bufferovf.
01 ss$_endoffile pic s9(9) comp value external
ss$_endoffile.
01 ss$_abort pic s9(9) comp value external
ss$_abort.
01 ss$_normal pic s9(9) comp value external
ss$_normal.
01 sys_status pic s9(9) comp.
*
01 iosb.
03 cond_val pic s9(4) comp.
03 byte_count pic s9(4) comp.
03 pic s9(9) comp.
*
01 create_socket.
03 pic s9(4) comp value external
ucx$c_udp.
03 pic s9(4) comp value external
inet_protyp$c_dgram.
*
01 local_sock_desc.
03 pic s9(9) comp value 16.
03 pointer value
reference local_addr.
01 local_addr.
03 pic s9(4) comp value external
ucx$c_af_inet.
03 local_port_number.
05 low_byte pic x value
low-values.
05 high_byte pic x value
low-values.
03 pic s9(9) comp value external
ucx$c_inaddr_any.
03 pic x(8).
*
01 ast_area.
03 net_chan pic s9(4) comp.
03 stock_delta_secs pic s9(11)v9(7) comp value -2.
03 seed pic 9(9) comp.
03 ast_iosb.
05 ast_cond pic s9(4) comp.
05 pic x(6).
03 rem_sock_desc.
05 pic s9(9) comp value 16.
05 pointer value
reference rem_addr.
*+
* Use port number 1234 for example's sake
*-
01 rem_addr.
03 pic s9(4) comp value external
ucx$c_af_inet.
03 rem_port_number.
05 low_byte pic x value x"04".
05 high_byte pic x value x"D2".
03 rem_node_addr pic x(4).
03 pic x(8).
*
01 in_addr_name pic x(60).
01 in_addr_name_len pic 9(4) comp.
01 out_len pic 9(4) comp.
*
01 message_buffer.
03 message_type pic x(2) value "01".
03 message_text pic x(30).
*
01 user_exit pic x value "N".
01 end_key pic x(4).
01 in_time pic 9(8).
*
procedure division.
kick_off section.
00.
accept in_time from time.
move in_time to seed.

display "Enter Client's IP address or name: " erase screen no advancing.
accept in_addr_name protected reversed at end go to fini.

if in_addr_name = spaces go to fini.

perform get_udp_socket.
if sys_status not = ss$_normal go to fini.

move "Stock Ticker is now on-line" to message_text.
perform send_message.

call "sys$dclast"
using by value stock_ticker
by reference ast_area
by value 0
giving sys_status.
if sys_status not = ss$_normal go to fini.

perform get_user_message until user_exit = "Y" or sys_status not =
ss$_normal.
if sys_status not = ss$_normal go to fini.

perform socket_close.
*
fini.
call "sys$exit" using by value sys_status.
*
get_user_message section.
00.
display "Enter message text (ctrl/z = exit): " no advancing.
accept message_text reversed
bold
protected
default is space
at end move "Y" to user_exit
go to fini.

perform send_message.
*
fini.
*
send_message section.
00.
*+
* Call my Applet.
*-
call "sys$qiow"
using by value 0, net_chan, io$_writevblk
by reference iosb
by value 0, 0
by reference message_buffer
by value 32
by reference rem_sock_desc
by value 0, 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.
*
get_udp_socket section.
00.
call "sys$assign"
using by descriptor "_BG:"
by reference net_chan
by value 0, 0, 0
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.
*
call "str$trim"
using by descriptor in_addr_name, in_addr_name
by reference in_addr_name_len
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.

call "sys$qiow"
using by value 0, net_chan, io$_acpcontrol
by reference iosb
by value 0, 0
by descriptor acp_gethostbyname,
in_addr_name(1:in_addr_name_len)
by reference out_len
by descriptor rem_node_addr
by value 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.
*
evaluate sys_status
when ss$_endoffile display "Unknown node"
when other continue
end-evaluate.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.

call "sys$qiow"
using by value 0, net_chan, io$_setmode
by reference iosb
by value 0, 0
by reference create_socket, omitted, local_sock_desc
by value 0, 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.
*
socket_close section.
00.
call "sys$dassgn" using by value net_chan giving sys_status.
*
end program demo_udp_msg.
identification division.
program-id. stock_ticker.
data division.
working-storage section.
01 stock_ast pic s9(9) comp value external
stock_ast.
01 io$_writevblk pic s9(9) comp value external
io$_writevblk.
01 ss$_normal pic s9(9) comp value external
ss$_normal.
01 sys_status pic s9(9) comp.
*
01 random_num comp-1.
01 stock_message.
03 pic x(2) value "02".
03 stock_price pic zz9.99.
*
linkage section.
*
01 ast_area.
03 net_chan pic s9(4) comp.
03 stock_delta_secs pic s9(11)v9(7) comp.
03 seed pic 9(9) comp.
03 ast_iosb.
05 ast_cond pic s9(4) comp.
05 pic x(6).
03 rem_sock_desc.
05 pic s9(9) comp.
05 pointer.
*
procedure division using ast_area.
00.
call "mth$random" using seed giving random_num.
multiply random_num by 100 giving stock_price.

call "sys$qio"
using by value 0, net_chan, io$_writevblk
by reference ast_iosb
by value stock_ast
by reference ast_area, stock_message
by value 8
by reference rem_sock_desc
by value 0, 0, 0
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.

exit program.
*
end program stock_ticker.
identification division.
program-id. stock_ast.
data division.
working-storage section.
01 stock_ticker pic s9(9) comp value external
stock_ticker.
01 ss$_normal pic s9(9) comp value external
ss$_normal.
01 sys_status pic s9(9) comp.
*
linkage section.
01 ast_area.
03 net_chan pic s9(4) comp.
03 stock_delta_secs pic s9(11)v9(7) comp.
03 seed pic 9(9) comp.
03 ast_iosb.
05 ast_cond pic s9(4) comp.
05 ast_bytes pic s9(4) comp.
05 unix_cond pic s9(9) comp.
03 rem_sock_desc.
05 pic s9(9) comp.
05 pointer.
*+
procedure division using ast_area.
00.
if ast_cond not = ss$_normal call "lib$stop" using by value sys_status.

call "sys$setimr"
using by value 0
by reference stock_delta_secs
by value stock_ticker
by reference ast_area
by value 0
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value
sys_status.

exit program.
*
end program stock_ast.

DEMO_TCP_IP_DEF.MAR
***********************
.title DEMO_TCP_IP_DEF Demo example tcp/ip external
data
;
; If the macro file sys$library:ucx$inetdef.mar exists on your VMS server
system
; then you can uncomment the following commands by removing the
semi-colons, and
; delete the DEMO example specific symbols - starting from
inet_protyp$c_stream.
;;+
;; The following command can be used to create a macro library INET in your
default
;; area if one does not already exist:-
;;
;; $library/create/macro inet.mlb sys$library:ucx$inetdef
;;-
; .library /inet/
; $inetsymdef GLOBAL
; $siocdef GLOBAL
; $inetacpfsymdef GLOBAL
; $inetacpsymdef GLOBAL
; $ineterrdef GLOBAL
;

inet_protyp$c_stream == 1
inet_protyp$c_dgram == 2
ucx$c_tcp == 6
ucx$c_udp == 17
ucx$c_af_inet == 2
ucx$c_inaddr_any == 0
ucx$c_sockopt == 1
ucx$c_reuseaddr == 4
ucx$c_full_duplex_close == 8192
ucx$c_keepalive == 8
ucx$c_tcpopt == 6
ucx$c_tcp_probe_idle == 128
ucx$c_msg_blockall == 128

inetacp$c_trans = 2
inetacp_func$c_gethostbyname = 1
acp_gethostbyname == <inetacp$c_trans * 256 +
inetacp_func$c_gethostbyname>

.end
Richard Maher
2008-08-03 22:38:06 UTC
Permalink
Looks to be OK now.

Sorry to have bothered you.

Cheers Richard Maher

Loading...