当前位置:网站首页>IPv4 socket address structure
IPv4 socket address structure
2022-07-07 10:15:00 【zimingxiayi】
IPv4 Socket address structures are often referred to as “ Network socket address structure ”, It uses sockaddr_in name , It's defined in <netinet/in.h> Header file
/* 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)];
};
边栏推荐
- Leetcode exercise - 113 Path sum II
- LLVM之父Chris Lattner:為什麼我們要重建AI基礎設施軟件
- ORM model -- creation and query of data records
- uboot机构简介
- Agile course training
- 中国首款电音音频类“山野电音”数藏发售来了!
- ORM -- database addition, deletion, modification and query operation logic
- The request object parses the request body and request header parameters
- Official media attention! The list of top 100 domestic digital collection platforms was released, and the industry accelerated the healthy development of compliance
- 【剑指Offer】42. 栈的压入、弹出序列
猜你喜欢
官媒关注!国内数字藏品平台百强榜发布,行业加速合规健康发展
Pytest learning - dayone
[learning notes - Li Hongyi] Gan (generation of confrontation network) full series (I)
This article explains the complex relationship between MCU, arm, muc, DSP, FPGA and embedded system
串口通讯继电器-modbus通信上位机调试软件工具项目开发案例
ES6中的原型对象
Postman interface test VI
Appx代码签名指南
ES类和对象、原型
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
随机推荐
【acwing】786. 第k个数
为什么安装mysql时starting service报错?(操作系统-windows)
Enterprise practice | construction of banking operation and maintenance index system under complex business relations
Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation
ES类和对象、原型
Appx代碼簽名指南
Delete a record in the table in pl/sql by mistake, and the recovery method
Word自动生成目录的方法
Inno Setup 打包及签名指南
ORM model -- creation and query of data records
Postman interface test II
uboot机构简介
fiddler-AutoResponder
ISP、IAP、ICP、JTAG、SWD的编程特点
Pytest learning - dayone
ORM--查询类型,关联查询
ES6中的原型对象
STM32 ADC和DMA
Performance optimization record of the company's product "yunzhujia"
单片机(MCU)最强科普(万字总结,值得收藏)