当前位置:网站首页>IPv4套接字地址结构
IPv4套接字地址结构
2022-07-07 07:41:00 【zimingxiayi】
IPv4套接字地址结构通常也称为“网络套接字地址结构”,它以 sockaddr_in 命名,定义在<netinet/in.h>头文件中
/* Internet address. */
typedef uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr; /* 32-bit IPv4 address */
/* network byte ordered */
};
/* POSIX.1g specifies this type name for the `sa_family' member. */
typedef unsigned short int sa_family_t;
/* This macro is used to declare the initial common members of the data types used for socket addresses, `struct sockaddr', `struct sockaddr_in', `struct sockaddr_un', etc. */
#define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family
/* Structure describing an Internet socket address. */
struct sockaddr_in
{
__SOCKADDR_COMMON (sin_); /* AF_INET */
in_port_t sin_port; /* Port number. */
struct in_addr sin_addr; /* Internet address. */
/* Pad to size of `struct sockaddr'. */
unsigned char sin_zero[sizeof (struct sockaddr) -
__SOCKADDR_COMMON_SIZE -
sizeof (in_port_t) -
sizeof (struct in_addr)];
};
边栏推荐
- CentOS installs JDK1.8 and mysql5 and 8 (the same command 58 in the second installation mode is common, opening access rights and changing passwords)
- Basic use of JMeter to proficiency (I) creation and testing of the first task thread from installation
- Web3.0 series distributed storage IPFs
- Analyze Android event distribution mechanism according to popular interview questions (I)
- The combination of over clause and aggregate function in SQL Server
- Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
- CDZSC_ 2022 winter vacation personal training match level 21 (1)
- 2020 Zhejiang Provincial Games
- Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation
- 虚数j的物理意义
猜你喜欢
随机推荐
Garbage disposal method based on the separation of smart city and storage and living digital home mode
Sword finger offer II 107 Distance in matrix
Writing file types generated by C language
[untitled]
2020 Zhejiang Provincial Games
Pit encountered by vs2015 under win7 (successful)
【ORM框架】
Enterprise practice | construction of banking operation and maintenance index system under complex business relations
The combination of over clause and aggregate function in SQL Server
EXT2 file system
Bean 作⽤域和⽣命周期
ORM -- grouping query, aggregation query, query set queryset object properties
Guys, have you ever encountered the case of losing data when Flink CDC reads mysqlbinlog? Every time the task restarts, there is a probability of losing data
Apprentissage avancé des fonctions en es6
ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
Codeforces - 1324d pair of topics
Can't connect to MySQL server on '(10060) solution summary
XML配置文件解析与建模
运用tensorflow中的keras搭建卷积神经网络
Postman interface test I









