z/OS Communications Server: IP CICS Sockets Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


PTON call

z/OS Communications Server: IP CICS Sockets Guide
SC27-3649-00

PTON converts an IP address in its standard text presentation form to its numeric binary form. On successful completion, PTON returns the converted IP address in the buffer provided.

The following requirements apply to this call:
Requirement Description
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
Amode: 31-bit or 24-bit
ASC mode: Primary address space control (ASC) mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space

Figure 1 shows an example of PTON call instructions.

Figure 1. PTON call instruction example
    WORKING-STORAGE SECTION.                                         
        01  SOC-NTOP-FUNCTION        PIC X(16)  VALUE IS 'PTON'.     
        01  S                        PIC 9(4) BINARY.                
                                                                     
    * IPv4 socket structure.                                         
        01  NAME.                                                    
            03  FAMILY      PIC 9(4) BINARY.                         
            03  PORT        PIC 9(4) BINARY.                         
            03  IP-ADDRESS  PIC 9(8) BINARY.                         
            03  RESERVED    PIC X(8).                                
                                                                     
    * IPv6 socket structure.                                         
        01  NAME.                                                    
            03  FAMILY      PIC 9(4) BINARY.                         
            03  PORT        PIC 9(4) BINARY.                         
            03  FLOWINFO    PIC 9(8) BINARY.                         
            03  IP-ADDRESS.                                          
                10 FILLER   PIC 9(16) BINARY.                        
                10 FILLER   PIC 9(16) BINARY.                        
            03  SCOPE-ID    PIC 9(8) BINARY.                         
                                                                     
        01  AF-INET         PIC 9(8) BINARY VALUE 2.                 
        01  AF-INET6        PIC 9(8) BINARY VALUE 19.                
                                                                     
    * IPv4 address.                                                  
        01  PRESENTABLE-ADDRESS      PIC X(45).                      
        01  PRESENTABLE-ADDRESS-IPV4 REDEFINES PRESENTABLE-ADDRESS.  
            05  PRESENTABLE-IPV4-ADDRESS PIC X(15)                   
                                                VALUE '192.26.5.19'. 
            05  FILLER      PIC X(30).                               
        01  PRESENTABLE-ADDRESS-LEN  PIC 9(4) BINARY VALUE 11.       
                                                                     
    * IPv6 address.                                                  
        01  PRESENTABLE-ADDRESS      PIC X(45)                       
                              VALUE '12f9:0:0:c30:123:457:9cb:1112'. 
        01  PRESENTABLE-ADDRESS-LEN  PIC 9(4) BINARY VALUE 29.       
                                                                     
    * IPv4-mapped IPv6 address.                                      
        01  PRESENTABLE-ADDRESS      PIC X(45)                       
                              VALUE '12f9:0:0:c30:123:457:192.26.5.19'.
        01  PRESENTABLE-ADDRESS-LEN  PIC 9(4) BINARY VALUE 32.       
                                                                     
        01  ERRNO           PIC 9(8) BINARY.                         
        01  RETCODE         PIC S9(8) BINARY.                        
                                                                     
        01  PRESENTABLE-ADDRESS      PIC X(45).                      
        01  PRESENTABLE-ADDRESS-LEN  PIC 9(4) BINARY.                
                                                                     
    PROCEDURE DIVISION.                                              
                                                                     
    * IPv4 address.                                               
      CALL 'EZASOKET' USING SOC-PTON-FUNCTION AF-INET             
                            PRESENTABLE-ADDRESS                   
                            PRESENTABLE-ADDRESS-LEN               
                            IP-ADDRESS                            
                            ERRNO RETURN-CODE.                    
    * IPv6 address.                                               
      CALL 'EZASOKET' USING SOC-PTON-FUNCTION AF-INET6            
                            PRESENTABLE-ADDRESS                   
                            PRESENTABLE-ADDRESS-LEN               
                            IP-ADDRESS                            
                            ERRNO RETURN-CODE.                    
       

For equivalent PL/I and assembler language declarations, see Converting parameter descriptions.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014