Solved

Retrieve TCP/IP Information

Posted on 2008-10-30
2
877 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now