📄 in.h
字号:
#define htonl(val) (u32)(val)#endif /* CPU_IS_BIG_ENDIAN *//*#endif*/ /* htonl *//************************************************************************* ** Aligned 32 Bit Network Byte Order to Host Byte Order Conversion ** *************************************************************************/#ifndef ntohl#ifdef CPU_IS_BIG_ENDIAN /* big endian processor definition */#define ntohl(val) (u32)(val)#endif /* CPU_IS_BIG_ENDIAN */#endif /* ntohl *//************************************************************************* ** values for IP level socket options ** *************************************************************************/#define IP_O_TOS 1 /* Type of service */ #define IP_O_FRAG 2 /* Fragmentation Control */#define IP_O_MAXTTL 3 /* Maximum TTL value */ #define IP_O_MINTTL 4 /* Minimum TTL value */ #define IP_O_SECURE 5 /* security:compartment:handling:tcc */#define IP_O_LSRR 6 /* loose source and record route */#define IP_O_SSRR 7 /* strict source and record route */#define IP_O_RR 8 /* record route */#define IP_O_STREAM 9 /* stream identifier */#define IP_O_TIME 10 /* Internet timestamp *//* Berkely-compatible socket options */#define IP_ADD_MEMBERSHIP 11 /* Multicasts for the specified multicast group received at the interface with the specified local IP address will be delivered to the application that owns the socket */#define IP_DROP_MEMBERSHIP 12 /* Reverses the action of IP_ADD_MEMBERSHIP */#define IP_MULTICAST_IF 13 /* Specifies, for multicast datagrams sent on this socket, which interface the multicast will be transmitted on. */#define IP_MULTICAST_LOOP 14 /* Enable/disable local loopback of multicast datagrams. If enabled (the default), outgoing multicast datagrams on an interface will be also be looped back to any application which is a member of that multicast group on that interface */#define IP_MULTICAST_TTL 15 /* Set the TTL field of outgoing multicast datagrams from this socket. Default is 1, which would limit he datagram to the local subnet */struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface;};#define IPPROTO_IP IP_IP /* for Berkely socket compatibility *//************************************************************************* ** values for TCP level socket options ** *************************************************************************/#define TCP_O_SEQNO 1 /* retrieve current sequence number; useful * for counting number of bytes sent on * connection */ #define TCP_NODELAY 2 /* Berkely standard: if set, disables Nagle algorithm, i.e., we don't inhibit the sending of smaller-than-MSS-sized segments. */#ifdef TCP_WND_SCALE#define TCP_WINDOW_SCALE 10 /* Enable/disable TCP windowscale option. Enabled by default. */ #endif#ifdef TCP_RTTM#define TCP_RTT_ALGORITHM 11 /* NOTE: Not Berkely standard */ /* Select between standard TCP round trip time measurement algorithm and the algorithm described in RFC 1323 using the timestamps option. *//* OPTVALS for the TCP_RTTM option*//* NOTE: If you change the values of the following two defines, you will need to change code in tcp_getopt_bitmap2 and tcp_setopt_bitmap2 */#define TCP_RTTM_STANDARD 0 /* The default */#define TCP_RTTM_RFC_1323 1 /* If timestamps option is succesfully negotiated with peer, this algorithm will be used, otherwise will fall back to the standard algorithm.*/#endif /* TCP_RTTM */#ifdef TCP_PAWS#define TCP_ENABLE_PAWS 12 /* NOTE: Not Berkely standard. */ /* Enable/disable the "protect against wrapped sequence numbers" checking, as defined in RFC 1323. If enabled, depends on succesful negotiation of timestamps */#endif /*TCP_PAWS */#ifdef TCP_TIMESTAMPS#define TCP_PROVIDE_TIMESTAMPS 13 /* NOTE: Not Berkely standard. */ /* Will cause TCP to generate/echo timestamps whether or not we need them for any processing. Allows us to comply with a peer that wants to use timestamps. It is not necessary to use this option if the TCP_RTTM option is set to TCP_RTTM_RFC_1323 (it is redundant) */#endif /* TCP_TIMESTAMPS */#define TCP_MAXSEG 14 /* NOTE: This is a standard Berkely option per Stevens. */ /* Option to get/set the maximum-sized segment that TCP will send to the peer. Normally TCP would set this MSS to the lesser of the interface MTU or the MSS option received from the peer in a SYN. This option may be used to set it lower, but cannot be used to set it higher. "getting" this option before the connection has been established, it will return the value we would use if an MSS option were not received from the other end. */#define TCP_USE_PEER_MSS_OPTION 15 /* NOTE: Not Berkely standard. */ /* If set, then TCP will set its send MSS to the value received in the MSS option of a SYN (if any), regardless of the interface MTU or any value that may have been set via the TCP_MAXSEG option. This allows TCP to send segments that will be fragmented by the IP layer. */ #define TCP_SET_RCV_MSS 16 /* NOTE: Not Berkely standard. */ /* Option to set the value that TCP will advertise to the peer in the MSS option (i.e., the largest segment we are willing to receive). If not set, then TCP will advertise the interface MTU. (NOTE: The peer, if it follows RFC 1122, will use as its Send MSS the lesser of the value we are sending it and its own MTU (path or interface) for that connection. The peer would need functionality similar to our TCP_USE_PEER_MSS option in order to utilize a larger value that we set here) */ /* NOTE: The following three options are not Berkely Standard */#define TCP_REX_MAX 17 /* Maximum TCP retransmission timeout */#define TCP_REX_MIN 18 /* Minimum TCP retransmission timeout */#define TCP_REX_INIT 19 /* Inital TCP retransmission timeout */ /* NOTE: The following four options are not Berkely Standard */#define TCP_ACKDELAYTIME 23 /* The delay period (in ms) used for delayed ACKs. A value of zero turns off delayed ACKs, i.e., every data segment is ACKed immediately. */#define TCP_ACKNSEG 24 /* Ack every Nth segment. Default value is 2 */#ifdef TCP_SELACK_ENHANCEMENTS /* NOTE: The following two options are not Berkely Standard */#define TCP_PERMIT_SACKS 25 /* Allow the other end of connection to send selective acknowledgements to us, and process them when received. Will cause the SACK_PERMITTED socket option to be sent in a SYN. By default, this option is disabled. */#define TCP_SEND_SACKS 26 /* If the other end has permitted us to send selecive acknowledgements (via the SACK_PERMITTED option in the SYN), then send selective acknowledgments in all permitted circumstances. If this option is not enabled, we will not send selective acknowledgements, whether we are permitted to do so or not. By default, this option is disabled. */#endif /* TCP_SELACK_ENHANCEMENTS */#ifdef TCP_SS_CA_FRETR_FREC /* NOTE: The following option is not Berkely Standard */#define TCP_FAST_RETR_RECOV 27 /* Enables/disables fast retransmit/recovery as defined in RFC 2001. By default, disabled. */#define TCP_SLOW_START_CA 28 /* Enables/disables TCP slow start/congestion avoidance algorithms as defined in RFC 2001. By default, enabled. */#endif /* TCP_SS_CA_FRETR_FREC */#ifdef TCP_TRANSACTION_TCP#define TCP_ENABLE_TRANSACTION_TCP 29 /* Enables the t/tcp protocol on this socket. */#endif /* TCP_TRANSACTION_TCP */#define IPPROTO_TCP IP_TCP /* for Berkely socket compatibility */#endif /*_IN_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -