当前位置:网站首页>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)];
};
边栏推荐
- Agile course training
- 2020 Zhejiang Provincial Games
- arcgis操作:dwg数据转为shp数据
- Three years after graduation
- ES类和对象、原型
- 14th test
- The applet realizes multi-level page switching back and forth, and supports sliding and clicking operations
- Natapp intranet penetration
- Apprentissage avancé des fonctions en es6
- ORM--逻辑关系与&或;排序操作,更新记录操作,删除记录操作
猜你喜欢

Agile course training
![[original] what is the core of programmer team management?](/img/11/d4b9929e8aadcaee019f656cb3b9fb.png)
[original] what is the core of programmer team management?

ArcGIS operation: batch modify attribute table
![[ORM framework]](/img/72/13eef38fc14d85978f828584e689a0.png)
[ORM framework]

虚数j的物理意义

LeetCode 练习——113. 路径总和 II

Win10 installation vs2015

Garbage disposal method based on the separation of smart city and storage and living digital home mode

Performance optimization record of the company's product "yunzhujia"

Memory ==c language 1
随机推荐
CDZSC_ 2022 winter vacation personal training match level 21 (1)
Applet popup half angle mask layer
ES6中的函数进阶学习
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
ORM--数据库增删改查操作逻辑
Software modeling and analysis
ORM -- database addition, deletion, modification and query operation logic
Internship log - day04
ES6中的原型对象
Interface test
内存==c语言1
AI moves from perception to intelligent cognition
Codeforces - 1324d pair of topics
Qualifying 3
Main (argc, *argv[]) details
The physical meaning of imaginary number J
EXT2 file system
Guys, how can mysql-cdc convert the upsert message to append only
[ORM framework]
conda离线创建虚拟环境