中易网

c语言中的 netinet/in是什么意思

答案:3  悬赏:20  
解决时间 2021-01-27 01:59
c语言中的 netinet/in是什么意思
最佳答案
1、netinet/in.h - Internet address family netinet / in.h 互联网地址族 的意思
2、如果要使用inet_network() / inet_addr() 等库函数,就要使用该头文件。
内核里面一般都是直接使用整数型,而不用点分十进制形式的IP形式。不过如果需要的话,可以使用 in_aton() 函数,包含 linux/inet.h 头文件即可。
全部回答

int是c的关键字,代表整型数类。
int a;//声明a为整型变量,int不是,(1楼的错误)
只有整型变量和整型常数,没有整数。(2楼的错误)
应该是整型变量的取值范围32768 ~ +32767(16位)-2147483648~2147483647(32位) (3楼更严重。)
case是用于开关语句中的关键字。
开关语句,又称switch语句,由关键字switch搭配若干个case及可能存在的default语句,共同组建成的一种分支结构语句。其一般形式为
switch(表达式)
{
case 常量表达式1:语句1;
....
case 常量表达式2:语句2;
default:语句;
}
其功能为判断表达式的值,然后跳转到与表达式值相同的常量表达式n对应的case上去执行。
其中,表达式必须为整型,case后的表达式必须为常量。
default语句可以省略。
在switch语句中,如果执行到break;语句,而break语句不在任何循环体内,那么会跳出switch语句。
名称
netinet/in.h - Internet address family netinet / in.h - 互联网地址族
SYNOPSIS故事大纲
#include #包括
DESCRIPTION描述
The header shall define the following types:该头应确定以下类型:
in_port_t in_port_t
Equivalent to the type uint16_t as defined in .等价的类型uint16_t在定义
in_addr_t in_addr_t
Equivalent to the type uint32_t as defined in .等价的类型uint32_t在定义
The sa_family_t type shall be defined as described in .该sa_family_t类型应被定义为描述
The uint8_t and uint32_t type shall be defined as described in .该uint8_t和uint32_t类型应被定义为描述 。 Inclusion of the header may also make visible all symbols from and .标题包含的也可从所有可见的符号
The header shall define the in_addr structure that includes at least the following member:该头应确定in_addr结构,至少包括以下成员:
in_addr_t s_addr in_addr_t s_addr
The header shall define the sockaddr_in structure that includes at least the following members:该头应确定SOCKADDR_IN结构,其中包括至少下列成员:
sa_family_t sin_family AF_INET. in_port_t sin_port Port number. struct in_addr sin_addr IP address. sa_family_t sin_family是AF_INET。in_port_t sin_port端口号。 结构in_addr sin_addr的IP地址。
The sin_port and sin_addr members shall be in network byte order.该sin_port和sin_addr成员应在网络字节顺序。
The sockaddr_in structure is used to store addresses for the Internet address family.该SOCKADDR_IN结构是用来存储家庭地址的Internet地址。 Values of this type shall be cast by applications to struct sockaddr for use with socket functions.值类型转换插座职能,应由申请与使用结构sockaddr的。
[ IP6 ] [ 肌醇 ] [备选案文开始] The header shall define the in6_addr structure that contains at least the following member:该头应确定in6_addr结构,至少包含以下成员:
uint8_t s6_addr[16] uint8_t s6_addr [16]
This array is used to contain a 128-bit IPv6 address, stored in network byte order.这个数组用来包含一个128位的IPv6地址,在网络存储字节顺序。
The header shall define the sockaddr_in6 structure that includes at least the following members:该头应确定sockaddr_in6结构,至少包括以下成员:
sa_family_t sin6_family AF_INET6. sa_family_t sin6_family AF_INET6。
in_port_t sin6_port Port number. in_port_t sin6_port端口号。
uint32_t sin6_flowinfo IPv6 traffic class and flow information. uint32_t sin6_flowinfo IPv6通信类和信息流。
struct in6_addr sin6_addr IPv6 address. 结构in6_addr sin6_addr IPv6地址。
uint32_t sin6_scope_id Set of interfaces for a scope. uint32_t sin6_scope_id范围一套接口。
The sin6_port and sin6_addr members shall be in network byte order.该sin6_port和sin6_addr成员应在网络字节顺序。
The sockaddr_in6 structure shall be set to zero by an application prior to using it, since implementations are free to have additional, implementation-defined fields in sockaddr_in6 .该sockaddr_in6结构应被设置为应用零一前使用它,因为可以自由的实现有执行定义的领域sockaddr_in6增加。
The sin6_scope_id field is a 32-bit integer that identifies a set of interfaces as appropriate for the scope of the address carried in the sin6_addr field.该sin6_scope_id字段是一个32位整数,在该领域的sin6_addr标识一组接口的地址进行适当的范围。 For a link scope sin6_addr , the application shall ensure that sin6_scope_id is a link index.对于一个链接范围sin6_addr的,应当确保sin6_scope_id是一个环比价格指数。 For a site scope sin6_addr , the application shall ensure that sin6_scope_id is a site index.对于一个场址范围sin6_addr的,应当确保sin6_scope_id是一个网站的索引。 The mapping of sin6_scope_id to an interface or set of interfaces is implementation-defined.该接口映射到一个或接口sin6_scope_id集是实现定义。
The header shall declare the following external variable:该头应宣布下列外部变量:
const struct in6_addr in6addr_any 常量结构in6_addr in6addr_any
This variable is initialized by the system to contain the wildcard IPv6 address.这个变量是由系统初始化包含通配符的IPv6地址。 The header also defines the IN6ADDR_ANY_INIT macro.该头还定义IN6ADDR_ANY_INIT宏。 This macro must be constant at compile time and can be used to initialize a variable of type struct in6_addr to the IPv6 wildcard address.这个宏必须保持在编译时,可以用来初始化一个类型变量的结构in6_addr到IPv6的通配符地址。
The header shall declare the following external variable:该头应宣布下列外部变量:
const struct in6_addr in6addr_loopback 常量结构in6_addr in6addr_loopback
This variable is initialized by the system to contain the loopback IPv6 address.这个变量是由系统初始化,控制回路的IPv6地址。 The header also defines the IN6ADDR_LOOPBACK_INIT macro.该头还定义IN6ADDR_LOOPBACK_INIT宏。 This macro must be constant at compile time and can be used to initialize a variable of type struct in6_addr to the IPv6 loopback address.这个宏必须保持在编译时,可以用来初始化一个类型变量的结构in6_addr到IPv6的环回地址。
The header shall define the ipv6_mreq structure that includes at least the following members:该头应确定ipv6_mreq结构,至少包括以下成员:
struct in6_addr ipv6mr_multiaddr IPv6 multicast address. 结构in6_addr ipv6mr_multiaddr IPv6组播地址。
unsigned ipv6mr_interface Interface index. 未签名的ipv6mr_interface接口索引。
[备选案文完]
The header shall define the following macros for use as values of the level argument of getsockopt () and setsockopt () :该头应确定水平的论点如下宏作为值使用getsockopt()和使用setsockopt() :
IPPROTO_IP IPPROTO_IP
Internet protocol.互联网协议。
IPPROTO_IPV6 IPPROTO_IPV6
[ IP6 ] [ 肌醇 ] [备选案文开始] Internet Protocol Version 6. Internet协议版本6。 [备选案文完]
IPPROTO_ICMP IPPROTO_ICMP
Control message protocol.控制消息协议。
IPPROTO_RAW IPPROTO_RAW
[ RS ] [ 遥感 ] [备选案文开始] Raw IP Packets Protocol.原始IP数据包协议。 [备选案文完]
IPPROTO_TCP IPPROTO_TCP
Transmission control protocol.传输控制协议。
IPPROTO_UDP IPPROTO_UDP
User datagram protocol.用户数据报协议。
The header shall define the following macros for use as destination addresses for connect () , sendmsg () , and sendto () :该头应确定目标地址为使用如下宏连接 () , sendmsg() ,和SendTo文件 () :
INADDR_ANY INADDR_ANY
IPv4 local host address. IPv4的本地主机地址。
INADDR_BROADCAST INADDR_BROADCAST
IPv4 broadcast address. IPv4的广播地址。
The header shall define the following macro to help applications declare buffers of the proper size to store IPv4 addresses in string form:该头应当载明下列事项,以帮助申请申报宏大小适当的缓冲区来存储的字符串形式的IPv4地址:
INET_ADDRSTRLEN INET_ADDRSTRLEN
16. 16。 Length of the string form for IP.长度为IP字符串形式。
The htonl () , htons () , ntohl () , and ntohs () functions shall be available as defined in .该htonl() , htons() , ntohl() ,和ntohs()函数应可在定义 。 Inclusion of the header may also make visible all symbols from .标题包含的也可从所有可见的符号 。
[ IP6 ] [ 肌醇 ] [备选案文开始] The header shall define the following macro to help applications declare buffers of the proper size to store IPv6 addresses in string form:该头应当载明下列事项,以帮助申请申报宏缓冲区的大小适当的形式存储的IPv6地址的字符串:
INET6_ADDRSTRLEN INET6_ADDRSTRLEN
46. 46。 Length of the string form for IPv6.长度为IPv6的字符串形式。
The header shall define the following macros, with distinct integer values, for use in the option_name argument in the getsockopt () or setsockopt () functions at protocol level IPPROTO_IPV6:该头应当载明下列事项宏,有明显的整数值,在参数的使用在option_name getsockopt()或使用setsockopt() IPPROTO_IPV6功能在协议级别:
IPV6_JOIN_GROUP IPV6_JOIN_GROUP
Join a multicast group.加入一个多播组。
IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP
Quit a multicast group.退出一个多播组。
IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS
Multicast hop limit.组播跳的限制。
IPV6_MULTICAST_IF IPV6_MULTICAST_IF
Interface to use for outgoing multicast packets.即将离任的接口用于多播数据包。
IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP
Multicast packets are delivered back to the local application.多播数据包被传递回本地应用程序。
IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS
Unicast hop limit.单播跳的限制。
IPV6_V6ONLY IPV6_V6ONLY
Restrict AF_INET6 socket to IPv6 communications only.限制AF_INET6到IPv6通讯插座只。
The header shall define the following macros that test for special IPv6 addresses.该头应当载明下列事项宏测试特殊的IPv6地址。 Each macro is of type int and takes a single argument of type const struct in6_addr * :每个宏是int 类型的常量 ,而所需的类型单一参数的结构in6_addr *:
IN6_IS_ADDR_UNSPECIFIED IN6_IS_ADDR_UNSPECIFIED
Unspecified address.未指定地址。
IN6_IS_ADDR_LOOPBACK IN6_IS_ADDR_LOOPBACK
Loopback address.环回地址。
IN6_IS_ADDR_MULTICAST IN6_IS_ADDR_MULTICAST
Multicast address.组播地址。
IN6_IS_ADDR_LINKLOCAL IN6_IS_ADDR_LINKLOCAL
Unicast link-local address.单播链路本地地址。
IN6_IS_ADDR_SITELOCAL IN6_IS_ADDR_SITELOCAL
Unicast site-local address.单播站点本地地址。
IN6_IS_ADDR_V4MAPPED IN6_IS_ADDR_V4MAPPED
IPv4 mapped address.映射的IPv4地址。
IN6_IS_ADDR_V4COMPAT IN6_IS_ADDR_V4COMPAT
IPv4-compatible address. IPv4兼容地址。
IN6_IS_ADDR_MC_NODELOCAL IN6_IS_ADDR_MC_NODELOCAL
Multicast node-local address.组播节点本地地址。
IN6_IS_ADDR_MC_LINKLOCAL IN6_IS_ADDR_MC_LINKLOCAL
Multicast link-local address.组播链路本地地址。
IN6_IS_ADDR_MC_SITELOCAL IN6_IS_ADDR_MC_SITELOCAL
Multicast site-local address.组播站点本地地址。
IN6_IS_ADDR_MC_ORGLOCAL IN6_IS_ADDR_MC_ORGLOCAL
Multicast organization-local address.组播组织本地地址。
IN6_IS_ADDR_MC_GLOBAL IN6_IS_ADDR_MC_GLOBAL
Multicast global address.全球多播地址。 [备选案文完]
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
我去,腾讯搞什么,卧槽
补充:哪些被湮没在历史尘埃中的民国红颜
商业帝国的游戏特点
观山海小区停车场(入口)地址在哪,我要去那里
描写霜的诗句有哪些
玉林街哪里有手工活做?
干荷叶生虫在家里有什么危害
在商务谈判中一般遵循的客观标准有A市场价值B
如何画ρ=asinθ和ρ=a(cosθ+sinθ)(a>0)的
论述孙子兵法对我国现代化国防的建设有哪些启
桔子摄影(天康大道圆林路208号广厦花园小区对
与花气相关的诗句
最近想看一下柯南剧场版,大家能推荐我先看哪
简述在民事审判中运用民俗习惯应当注意哪些问
建行的工资发了吗
推荐资讯
寓言故事《齐宣王以羊蹄替牛》对你有什么启发
discuz 上传图片后图片不显示
do great harm to 中为什么是用great 而不是g
福来居酒店(楚雄南华县)地址在哪,我要去那里
帮忙看一下这个是什么等级的芙蓉石,值不值这
代发:康熙来了候佩岑上过吗
求三国袁绍势力全人名
仙剑奇侠传4我用秋天存档修改器为什么我改了
铝板表面出现黑斑是怎么回事?
试管婴儿胚胎生化有哪些前兆
制作VCD光盘要用什么格式的视频文件
歌词温柔的什么是我的什么
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?