1842811 Members
2878 Online
110209 Solutions
New Discussion

Re: Validate Node Name

 
James Port
New Member

Validate Node Name

Need a single command to validate a DECnet node name entered by a user from within a C program. Something like a system service call rather than executing a script.
6 REPLIES 6
Robert Gezelter
Honored Contributor

Re: Validate Node Name

James,

What do you mean by "Validate"?

Do you mean: Syntactically valid?

Or do you mean: Exists in the node database?

Also, what version of DECnet are you talking about: Phase IV or Phase V?

- Bob Gezelter, http://www.rlgsc.com
Hoff
Honored Contributor

Re: Validate Node Name

Syntactic checks implemented in local code are to be avoided, best to call through to the responsible code to verify the structure. This because it is the underlying code that best knows the rules. And the rules can change. (Though for DECnet Phase IV, that's really unlikely. The folks that parsed ODS-2 file names did get surprised, however.)

I'll assume you want to validate the node, and against the contents of the local database.

The DECUS Pageswapper from January 1986 has an article on using the IO$_ACPCONTROL function and the device-level path into DECnet Phase IV, and the documented path is through DECnet Phase IV NICE and there are examples of that approach on recent OpenVMS Freeware releases.

http://mvb.saic.com/freeware/vax85c/ljk/pagswp706.mem
http://h71000.www7.hp.com/freeware/freeware80/hoffman_examples/nice.c

I'll assume you are not looking for a DECnet ping; a test for current network reachability. DECnet doesn't really have a direct ping (though you can do quite well with the non-transparent connect and connect reject message sequence in your own code, or with the mirror or NML servers if configured and accessible), the general DECnet assumption is to just try the connection.

The architecture documentation for DECnet will have the details of the node name syntax, if you really want to go after that yourself. The OpenVMS FAQ has pointers to the DECnet Phase IV docs. The Phase IV architecture documents are on an HP FTP server, and the Phase IV user manuals are on the Freeware V5.0 distro:

http://www.hp.com/go/openvms/freeware/
http://ftp.digital.com/pub/DEC/DECnet/PhaseIV/
http://www.hoffmanlabs.com/vmsfaq/

Stephen Hoffman
Hoffmanlabs

James Port
New Member

Re: Validate Node Name

I am sorry I was not clear when I said validate. The C program in question is part of a X/Motif screen. The input gathered from the screen is used to build a DCL script. The script contains code which will copy/delete files from the node entered by the user. I need a simple way to "validate" the node entered is in the DECnet database.

Thank you...
Hoff
Honored Contributor

Re: Validate Node Name

I'd encourage simply building and executing the COPY or COPY/FTP command procedure, and catching the errors with a SET NOON or an ON err-lvl command, and propagating back the status as required.

(I'll assume that other means of storing and/or transferring and/or identifying data have been investigated.)

While you can certainly use either the NICE (documented) or IO$_ACPCONTROL (undocumented) approaches to poke at the DECnet database for the particular node, you'll likely still have to capture outages and errors arising from the COPY or COPY/FTP operation itself. Should you poke at the DECnet database for validity and for connectivity, the node or the circuit can conceivably drop offline between the time you've probed and the COPY or COPY/FTP operation.

There is no more direct API into the DECnet Phase IV database around that I'm aware of.

There's also no callable copy, though the FTSV Freeware has had something similar. (That package is long retired, and not available on OpenVMS I64.)
James Port
New Member

Re: Validate Node Name

Thanks to those who provided response to my questions. I will use your responses to finish the program I am working on.

Thank you...
Robert Gezelter
Honored Contributor

Re: Validate Node Name

James,

My apologies for not being able to followup my first posting promptly, I got called into an unscheduled emergency situation.

I will amplify Hoff's comment in light of your clarification.

Not only is the name syntax possibly different in Phase IV and Phase V, but the aa.nnn node number format is also used. I agree with Hoff, let DECnet check the name and report back the result.

There are also a variety of other cases, including:
- username/password not authorized; or other
account usage/validation issues
- protection on the file/directory

If you are attempting to validate what could be extended operations, a small suggestion: Open the file using the transparent remote access facility; read one record from the file; close the file.

This sequence will assure a high likelihood that the file can be accessed and read by the user. It is not a guarantee, however. It is always possible that one of the underlying conditions could change between the check and the actual copy.

For that I would recommend that you ensure that the DCL COPY code that is built deal with the error cases and report the errors.

- Bob Gezelter, http://www.rlgsc.com