“Network library”的版本间差异

来自KolibriOS wiki
跳到导航 跳到搜索
(Created page with "=Network Library= ==inet_addr== '''Convert the string from standard IPv4 dotted notation to integer IP addr.'''<br> Input: ptr to ASCIIZ string containing standard dotted IPv4...")
(没有差异)

2015年2月24日 (二) 19:27的版本

Network Library

inet_addr

Convert the string from standard IPv4 dotted notation to integer IP addr.
Input: ptr to ASCIIZ string containing standard dotted IPv4 address.
Output: eax = converted IP address / -1 on error

Example:

; Code section:
invoke inet_addr ip_address
; eax should now be 0X0100A8C0

; Data section:
ip_address db '192.168.0.1', 0

inet_ntoa

Convert the Internet host address to standard IPv4 dotted notation.
Input: in_addr struct
Output: eax = pointer to resulting string (in static buffer)

Example:

getaddrinfo

Get a list of IP addresses and port numbers for given host and service
Input:

  • ptr to hostname (optional)
  • ptr to servname (optional)
  • ptr to addrinfo struct hints (optional)
  • ptr to result addrinfo struct

Output: eax = 0 on success / one of EAI codes on error

Example:

freeaddrinfo

Free one or more addrinfo structures returned by getaddrinfo.
Input: ptr to addrinfo struct
Output: /

Example: