当前位置:网站首页>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)];
};
边栏推荐
- ORM--查询类型,关联查询
- UnityWebRequest基础使用之下载文本、图片、AB包
- ORM -- grouping query, aggregation query, query set queryset object properties
- ISP、IAP、ICP、JTAG、SWD的编程特点
- request对象对请求体,请求头参数的解析
- MongoDB创建一个隐式数据库用作练习
- Mongodb creates an implicit database as an exercise
- Memory ==c language 1
- 2016 CCPC Hangzhou Onsite
- 企业实战|复杂业务关系下的银行业运维指标体系建设
猜你喜欢
ArcGIS operation: converting DWG data to SHP data
嵌入式背景知识-芯片
Applet sliding, clicking and switching simple UI
The physical meaning of imaginary number J
一文讲解单片机、ARM、MUC、DSP、FPGA、嵌入式错综复杂的关系
企业实战|复杂业务关系下的银行业运维指标体系建设
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
A wave of open source notebooks is coming
Memory ==c language 1
官媒关注!国内数字藏品平台百强榜发布,行业加速合规健康发展
随机推荐
Sword finger offer II 107 Distance in matrix
XML配置文件解析与建模
Integer inversion
Postman tutorial - scripting
The new activity of "the arrival of twelve constellations and goddesses" was launched
Gauss elimination
Hcip first day notes sorting
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
能源路由器入门必读:面向能源互联网的架构和功能
Huffman encoded compressed file
中国首款电音音频类“山野电音”数藏发售来了!
Postman interface test I
Gym - 102219j kitchen plates (violent or topological sequence)
Phpcms realizes PC website access to wechat native payment
uboot机构简介
Fiddler simulates the interface test
高数_第1章空间解析几何与向量代数_向量的数量积
Enterprise practice | construction of banking operation and maintenance index system under complex business relations
ORM--数据库增删改查操作逻辑
CDZSC_ 2022 winter vacation personal training match level 21 (1)