Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Retrieve TCP/IP Information

Posted on 2008-10-30
2
Medium Priority
?
915 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 375 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

971 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