Solved

Retrieve TCP/IP Information

Posted on 2008-10-30
2
884 Views
Last Modified: 2008-11-10
Does anyone know how to retrieve the HOSTNAME field from TCP/IP in a CL program? The field is the HOSTNAME field if you do a CHGTCPDMN-F4.  It seems like you should be able to retrieve this to be used in a CL, but I haven't been able to find anything regarding it.

I appreciate any help.
0
Comment
Question by:Matthew Roessner
2 Comments
 
LVL 33

Expert Comment

by:shalomc
ID: 22843333
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/ghostn.htm

I think that you will have to write a wrapper program in RPGLE or C to use this API.

ShalomC
0
 
LVL 27

Accepted Solution

by:
tliotta earned 125 total points
ID: 22855154
hfcsp:

Assuming that you're really intending to mean the field that is affected by the HOSTNAME() parameter, then this is the API that you need:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qtocrtvtcpa.htm

As with gethostname() that Shalom suggested, this API must be called as a procedure. For CL, that means you must use ILE CL and use the CALLPRC command. You can bind system service program QTOCNETSTS to access the QtocRtvTCPA API. Request format 'TCPA0300' and extract the value from the field documented as "Host name". Note that "Domain name" is available in the next field.

Tom
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: rfc1180
The Maximum Segment size (MSS) is an important consideration when troubleshooting connectivity via the Internet/Intranet. As the packets are routed via the Internet/Intranet, the packets must traverse through multiple routers in the path between two…
Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question