1 Star 0 Fork 4.9K

罗小黑 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
inet-h.md 9.47 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

inet.h

Overview

Related Modules:

NET

Description:

Provides functions and data structures related to network operations.

For example, you can use the functions to send and receive network data, manage network addresses, and convert bytes.

Since:

1.0

Version:

1.0

Summary

Functions

Function Name

Description

htonl (uint32_t n)

uint32_t 

Converts an integer from the host byte order to the network byte order.

htons (uint16_t n)

uint16_t 

Converts a 16-bit integer from the host byte order to the network byte order.

ntohl (uint32_t n)

uint32_t 

Converts an integer from the network byte order to the host byte order.

ntohs (uint16_t n)

uint16_t 

Converts a 16-bit integer from the network byte order to the host byte order.

inet_addr (const char *p)

in_addr_t 

Converts a string from the IPv4 numbers-and-dots notation to the binary data in network byte order.

inet_network (const char *p)

in_addr_t 

Converts a string from the IPv4 numbers-and-dots notation to the binary data in host byte order.

inet_ntoa (struct in_addr in)

char * 

Converts a network address to a string in dotted-decimal format.

inet_pton (int af, const char *__restrict s, void *__restrict a0)

int 

Converts a string to a network address in the specified address family.

inet_ntop (int af, const void *restrict a0, char *restrict s, socklen_t l)

const char * 

Converts a network address in the specified address family to a string.

inet_aton (const char *s0, struct in_addr *dest)

int 

Converts an IP address from the string format to the 32-bit binary format in network byte order.

inet_makeaddr (in_addr_t n, in_addr_t h)

struct in_addr 

Converts the network number and host address to the network address.

inet_lnaof (struct in_addr in)

in_addr_t 

Converts an IP address into a host ID in host byte order without network bits.

inet_netof (struct in_addr in)

in_addr_t 

Extracts the network number from the in_addr structure and converts it to the host byte order.

1
https://gitee.com/lawguiren/docs.git
git@gitee.com:lawguiren/docs.git
lawguiren
docs
docs
master

搜索帮助