in.h
来自「vxworks 6.x 的全部头文件」· C头文件 代码 · 共 739 行 · 第 1/2 页
H
739 行
#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */#define INADDR_NONE 0xffffffff /* -1 return */#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */#define INADDR_NEW_ALLRTRS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22 */#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */#define IN_LOOPBACKNET 127 /* official! */#define IN_ADDR_IS_LINKLOCAL(i) (((i)[0] == 169) && ((i)[1] == 254))#if _BYTE_ORDER == _BIG_ENDIAN#define ntohl(x) (x)#define ntohs(x) (x)#define htonl(x) (x)#define htons(x) (x)#define NTOHL(x) do {} while (FALSE)#define NTOHS(x) do {} while (FALSE)#define HTONL(x) do {} while (FALSE)#define HTONS(x) do {} while (FALSE)#else#define ntohl(x) ((((x) & 0x000000ff) << 24) | \ (((x) & 0x0000ff00) << 8) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0xff000000) >> 24))#define htonl(x) ((((x) & 0x000000ff) << 24) | \ (((x) & 0x0000ff00) << 8) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0xff000000) >> 24))#define ntohs(x) ((((x) & 0x00ff) << 8) | \ (((x) & 0xff00) >> 8))#define htons(x) ((((x) & 0x00ff) << 8) | \ (((x) & 0xff00) >> 8))#define NTOHL(x) do {(x) = ntohl((u_long)(x)); } while (FALSE)#define NTOHS(x) do {(x) = ntohs((u_short)(x)); } while (FALSE)#define HTONL(x) do {(x) = htonl((u_long)(x)); } while (FALSE)#define HTONS(x) do {(x) = htons((u_short)(x)); } while (FALSE)#endif /* _BYTE_ORDER *//* * Socket address, internet style. */struct sockaddr_in { u_char sin_len; u_char sin_family; u_short sin_port; struct in_addr sin_addr; char sin_zero[8];};#define INET_ADDRSTRLEN 16/* * Options for use with [gs]etsockopt at the IP level. * First word of comment is data type; bool is stored in int. */#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */#define IP_HDRINCL 2 /* int; header is included with data */#define IP_TOS 3 /* int; IP type of service and preced. */#define IP_TTL 4 /* int; IP time to live */#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */#define IP_RETOPTS 8 /* ip_opts; set/get IP options */#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */#define IP_RSVP_ON 15 /* enable RSVP in kernel */#define IP_RSVP_OFF 16 /* disable RSVP in kernel *//* * Removed the IP_RSVP_VIF_ON/IP_RSVP_VIF_OFF as we support router alert * through the IP_ROUTER_ALERT option (defined below) */#define IP_PORTRANGE 19 /* int; range to choose for unspec port */#define IP_RECVIF 20 /* bool; receive reception if w/dgram *//* for IPSEC */#define IP_IPSEC_POLICY 21 /* int; set/get security policy */#define IP_FAITH 22 /* bool; accept FAITH'ed connections */#define IP_BLOCK_SOURCE 23 /* ip_mreq_source; block data from a src */#define IP_UNBLOCK_SOURCE 24 /* ip_mreq_source; undo block filter */#define IP_ADD_SOURCE_MEMBERSHIP 25 /* ip_mreq_source; add a single source */#define IP_DROP_SOURCE_MEMBERSHIP 26 /* ip_mreq_source; drop a single source *//* MCAST_* sockopts number should not be duplicated with IPv6-level sockopts */#define MCAST_JOIN_GROUP 70 /* group_req; */#define MCAST_BLOCK_SOURCE 71 /* group_source_req; */#define MCAST_UNBLOCK_SOURCE 72 /* group_source_req; */#define MCAST_LEAVE_GROUP 73 /* group_req; */#define MCAST_JOIN_SOURCE_GROUP 74 /* group_source_req; */#define MCAST_LEAVE_SOURCE_GROUP 75 /* group_source_req; */#define IP_ONESBCAST 27 /* bool: send all-ones broadcast */#define IP_ROUTER_ALERT 23 /* bool; accept router alert packets *//* We currently don't support the ip_fw and ip_dummynet options. They are * retained in this file for consistency with other systems */#if 0#define IP_FW_ADD 50 /* add a firewall rule to chain */#define IP_FW_DEL 51 /* delete a firewall rule from chain */#define IP_FW_FLUSH 52 /* flush firewall rule chain */#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */#define IP_FW_GET 54 /* get entire firewall rule chain */#define IP_FW_RESETLOG 55 /* reset logging counters */#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */#endif /* #ifdef 0 *//* * Defaults and limits for options */#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */#define IP_MAX_MEMBERSHIPS 20 /* per socket */#define IP_MAX_SOURCE_FILTER 128 /* max number of MSF per group */#define SO_MAX_SOURCE_FILTER 64 /* max number of MSF per socket *//* * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */};#define MCAST_INCLUDE 1 /* ip_msfilter's imsf_fmode value */#define MCAST_EXCLUDE 2 /* ip_msfilter's imsf_fmode value *//* * Argument structure for IP_{BLOCK|UNBLOCK}_SOURCE and * IP_{ADD|DROP}_SOURCE_MEMBERSHIP. */struct ip_mreq_source { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_sourceaddr; /* source address of group */ struct in_addr imr_interface; /* local IP address of interface */};/* * Argument structure for SIOCSIPMSFILTER. */struct ip_msfilter { struct in_addr imsf_multiaddr; /* IP multicast address of group */ struct in_addr imsf_interface; /* local IP address of interface */ u_int32_t imsf_fmode; /* filter mode */ u_int32_t imsf_numsrc; /* number of sources in src_list */ struct in_addr imsf_slist[1]; /* start of source list */};#define IP_MSFILTER_SIZE(numsrc) \ (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \ + (numsrc) * sizeof(struct in_addr))/* * Protocol-Independent Multicast Source Filter APIs */struct group_req { u_int32_t gr_interface; /* interface index */ struct sockaddr_storage gr_group; /* group address */};struct group_source_req { u_int32_t gsr_interface; /* interface index */ struct sockaddr_storage gsr_group; /* group address */ struct sockaddr_storage gsr_source; /* source address */};struct group_filter { u_int32_t gf_interface; /* interface index */ struct sockaddr_storage gf_group; /* multicast address */ u_int32_t gf_fmode; /* filter mode */ u_int32_t gf_numsrc; /* number of sources */ struct sockaddr_storage gf_slist[1]; /* source address */};#define GROUP_FILTER_SIZE(numsrc) \ (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ + (numsrc) * sizeof(struct sockaddr_storage))/* * Argument for IP_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */#define IP_PORTRANGE_DEFAULT 0 /* default range */#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security *//* Packet reassembly stuff */#define IPREASS_NHASH_LOG2 6#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)#define IPREASS_HMASK (IPREASS_NHASH - 1)#define IPREASS_HASH(x,y) \ (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes *//* * Definitions for inet sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */#define CTL_IPPROTO_NAMES { \ { "ip", CTLTYPE_NODE }, \ { "icmp", CTLTYPE_NODE }, \ { "igmp", CTLTYPE_NODE }, \ { "ggp", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { "tcp", CTLTYPE_NODE }, \ { 0, 0 }, \ { "egp", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "pup", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "udp", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "idp", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "ipsec", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "pim", CTLTYPE_NODE }, \}/* * Names for IP sysctl objects */#define IPCTL_FORWARDING 1 /* act as router */#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */#define IPCTL_DEFTTL 3 /* default TTL */#ifdef notyet#define IPCTL_DEFMTU 4 /* default MTU */#endif#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */#define IPCTL_SOURCEROUTE 8 /* may perform source routes */#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */#define IPCTL_STATS 12 /* ipstat structure */#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */#define IPCTL_MAXID 17#define IPCTL_NAMES { \ { 0, 0 }, \ { "forwarding", CTLTYPE_INT }, \ { "redirect", CTLTYPE_INT }, \ { "ttl", CTLTYPE_INT }, \ { "mtu", CTLTYPE_INT }, \ { "rtexpire", CTLTYPE_INT }, \ { "rtminexpire", CTLTYPE_INT }, \ { "rtmaxcache", CTLTYPE_INT }, \ { "sourceroute", CTLTYPE_INT }, \ { "directed-broadcast", CTLTYPE_INT }, \ { "intr-queue-maxlen", CTLTYPE_INT }, \ { "intr-queue-drops", CTLTYPE_INT }, \ { "stats", CTLTYPE_STRUCT }, \ { "accept_sourceroute", CTLTYPE_INT }, \ { "fastforwarding", CTLTYPE_INT }, \}/* INET6 stuff, temporary workaround */#define __KAME_NETINET_IN_H_INCLUDED_#include <netinet6/in6.h>#undef __KAME_NETINET_IN_H_INCLUDED_#ifdef _WRS_KERNELstruct ifnet; /* forward declarations for Standard C */int in_broadcast __P((struct in_addr, struct ifnet *));int in_canforward __P((struct in_addr));_WRS_FASTTEXTint in_cksum __P((struct mbuf *, int));int in_localaddr __P((struct in_addr));void inet_ntoa_b __P((struct in_addr, char *));char *inet_ntoa __P((struct in_addr)); /* in libkern */struct in_ifaddr *in_ifexists_ifa __P((struct ifnet *));void in_socktrim __P((struct sockaddr_in *));#define satosin(sa) ((struct sockaddr_in *)(sa))#define sintosa(sin) ((struct sockaddr *)(sin))#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))#endif /* _WRS_KERNEL */#ifdef __cplusplus}#endif #endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?