Finding an IP address in an IDMS task trace
search cancel

Finding an IP address in an IDMS task trace

book

Article ID: 29783

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

When a server-based task requests services from an IDMS CV, the IP address is stored in the IDMS control blocks. In debugging a task that fails, it may be helpful to identify the IP address from which that task originated.

Environment

Release: All supported releases.

Resolution

The short answer is, the IP address is at PTELSOC4+4 for r18.5 (PTE+174 in 18.0). Here is the long explanation: 

The PTE* fields belong to a LISTENER type PTE. When a new task is started by generic listening, it runs under control of a BULK PTE/LTE pair. The following fields from a BULK PTE can be examined:

  1. PTELSALN contains the length of the SOCKADDR structure filled in with info from the client
  2. PTELSOC4 and PTELSOC6 fields point to the same area and contain the SOCKADDR structure filled in with info from the client. An IPv4 type SOCKADDR structure is described by the SOCK@IN dsect; the IPv6 type structure is described by the SOCK@IN6 dsect; both dsects are generated by a #SOCKET TCPIPDEF assembler call. For an IPv4 type SOCKADDR structure, the IP address is saved at offset 4.

The IP address is stored in the control blocks as a fullword; each byte of the fullword represents a value that would normally be separated by a period. 

For example:

  • a hex value of F7000001 would translate to an IP address of 127.0.0.1
  • and a hex value of AC10FE01 would translate to 172.16.254.1.