Yanic,
If you don't want to walk the pointers yourself, just call EZACIC08.
Although it's intended to help with HLL's like Cobol, it can also be
called from Assembler.

Tony Thigpen

-----Original Message -----
 From: Yanick Jacques
 Sent: 01/05/2012 01:30 PM
I'm avancing in my developpement,now i receive the pointers to the
HOSTENTD struct. Can someone can help me write the name of the hostname to
the log .How can I obtain the content of an address ex: H@NAME ?


HOSTENTD DSECT ,
*
H@NAME   DS    A              A(hostname)
H@ALIAS  DS    A              A(zero-terminated array of aliases)
H@ADDRTY DS    F              Family of returned addresses
H@LENGTH DS    F              Length of returned addresses
H@ADDRLS DS    A              A(zero-terminated array of addresses)
*
HOSTENTL EQU   *-HOSTENTD     Length of HOSTENT main table




Here's what I'm doing.

#SOCKET GETHOSTBYADDR,IPADDR=HOSTIPA,IPADDRL=4,               X
        DOMAIN=AF@INET,HOSTENTP=(R2),                           X
        RETCODE=RETCODE,ERRNO=ERRNO,RSNCODE=RSNCODE
  LA R1,MSG15 DISPLAY GETHOSTBYADDR RESULTS
  L R15,=A(DISRC)
  BALR R14,R15 DISPLAY THE 3 RETURN CODES
  CLC RETCODE,=F'0' GETHOSTBYADDR SUCCESSFUL?
  BNE TCPCLOSE N. CLOSE SOCKET AND EXIT.
  USING HOSTENTD,R2
  LA    R6,H@NAME
  ST    R6,MYHOST
  LA    R1,MSG16 .
  L     R15,=A(DISLINE)
  BALR  R14,R15




DISLINE  DS 0H
          #SAVEREG SAVE THE CALLER'S REGISTERS
          LR R12,R15
          USING DISLINE,R12
          LR R3,R1 GET PARM IN R3
*
          #WTL MSGID=M#999043,MSGDICT=NO,OVRIDES=OVRLOG,                X
                PARMS=((R3)),RGSV=(R2-R8)
*
          #RESTREG RESTORE THE CALLER'S REGISTERS


Thanks


Reply via email to