• Subject: TCP/IP sockets - Getservbyname
  • From: Chris Bipes <ChrisB@xxxxxxxxxxxxxxx>
  • Date: Thu, 22 Jul 1999 15:59:50 -0700

I am trying to add the ability to look up a service name using the
Getservbyname function provided in TCO/IP Sockets.  I am using RPGLE under
V3R7.  I suppose I could just open the file qusrsys/qatocls1 and chain to
receive but that would be cheating.... Has any one else attempted this feat?

Here is what I have achieved so far:

1. The function is working and returning the pointer.  The file is pointing
to the correct record, (wrkjob open files rrn while in debug).

2. I have defined the structure to be a 200 character field based on the
returned pointer.  The field though seem to have garbage in it.  See

 00000     80000000 00000000 F0ABF1E1 1900E600   - .......01..W. 
 00010     80000000 00000000 F0ABF1E1 1900E650   - .......01..W& 
 00020     0000A41C 00000000 00000000 00000000   - ..u............. 
 00030     80000000 00000000 F0ABF1E1 1900E621   - .......01..W. 
 00040     96856081 A4A38800 40404040 40404040   - oe-auth.         
 00050     40404040 40404040 40404040 40404040   -                  
 00060     00A38397 00404040 40404040 40404040   - .TCP.            
 00070     40404040 40404040 40404040 40404040   -                  
 00080     40000000 00000000 00000000 00000000   -  ............... 
 00090     80000000 00000000 F0ABF1E1 1900E6A0   - .......01..W 
 000A0     80000000 00000000 F0ABF1E1 1900E6C1   - .......01..WA 
 000B0     80000000 00000000 F0ABF1E1 1900E6E2   - .......01..WS 
 000C0     00000000 00000000 00000000 00000000   - ................ 

The service name is "oe-auth" and protocol = "tcp".  I have highlight them.
The port number = 42012 or A41C which I also highlighted.  There are several
aliases that do not show up in the 200 byte string but are further down the
line.  Now for the question, is this function returning pointers or the
values?  It looks like F0ABF1E11900E600 might be a pointer to the data.  
The pointer returned is SPP:F0ABF1E11900E5C0 

Can one of you "C" programmers tell this RPGer what I am getting?  How to
use this function?
What I am doing wrong?

Thanks in advance,

Christopher K. Bipes            mailto:ChrisB@Cross-Check.com
Sr. Programmer/Analyst          mailto:Chris_Bipes@Yahoo.com
CrossCheck, Inc.                http://www.cross-check.com
6119 State Farm Drive           Phone: 707 586-0551 x 1102
Rohnert Park  CA  94928 Fax: 707 586-1884


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.