当前位置:网站首页>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)];
};
边栏推荐
- Selenium+bs4 parsing +mysql capturing BiliBili Tarot data
- The physical meaning of imaginary number J
- Parameter sniffing (2/2)
- UnityWebRequest基础使用之下载文本、图片、AB包
- 2020 Zhejiang Provincial Games
- 使用BigDecimal的坑
- Enterprise practice | construction of banking operation and maintenance index system under complex business relations
- Luogu p2482 [sdoi2010] zhuguosha
- Can I open a stock trading account online? Is it safe
- ISP、IAP、ICP、JTAG、SWD的编程特点
猜你喜欢

Deep understanding of UDP, TCP

VS Code指定扩展安装位置

The landing practice of ByteDance kitex in SEMA e-commerce scene

Qualifying 3

能源路由器入门必读:面向能源互联网的架构和功能

The new activity of "the arrival of twelve constellations and goddesses" was launched

STM32中AHB总线_APB2总线_APB1总线这些是什么

ORM model -- associated fields, abstract model classes

ORM -- database addition, deletion, modification and query operation logic

Official media attention! The list of top 100 domestic digital collection platforms was released, and the industry accelerated the healthy development of compliance
随机推荐
【ORM框架】
Do you have a boss to help look at this error report and what troubleshooting ideas are there? Oracle CDC 2.2.1 flick 1.14.4
网上可以开炒股账户吗安全吗
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)
Pit using BigDecimal
VS Code指定扩展安装位置
单片机(MCU)最强科普(万字总结,值得收藏)
Horizontal split of database
反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
Word自动生成目录的方法
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
每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?
Basic use of JMeter to proficiency (I) creation and testing of the first task thread from installation
内存==c语言1
MySQL can connect locally through localhost or 127, but cannot connect through intranet IP (for example, Navicat connection reports an error of 1045 access denied for use...)
Postman interface test V
Writing file types generated by C language
Advanced function learning in ES6
Memory ==c language 1
Write it into the SR table in the way of flinksql. It is found that the data to be deleted has not been deleted. Refer to the document https://do