pton函数

PTON

z/OS V1R9.0 Communications Server IP CICS Sockets Guide
SC31-8807-04

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.


怎么记忆? presentation form to its numeric binary form即 p to n。我还是记不住,就记为PC输入的 to Networking 吧。


The following requirements apply to this call:

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 145 shows an example of PTON call instructions.

Figure 145. 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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值