📄 ipv6.h
字号:
#ifndef INCLUDE_IPv6_H
#define INCLUDE_IPv6_H
/* Include IPv6 Stack definitions */
#include <netIPv6.h>
#define IP_UDP IPPROTO_UDP
#define IP_TCP IPPROTO_TCP
#define IP_ICMPv6 IPPROTO_ICMPv6
#define IP_HLEN 40 /* IP Header Length in bytes */
#define IP_MIN_HLEN 40
#define IP_DEF_VIHL 0x60
#define IP_DEF_TTL 100
#define MAX_IP_OPTLEN 0 /* Max IP Header option field length */
#define IP_MAX_HLEN IP_MIN_HLEN + MAX_IP_OPTLEN
#define IP_DONT_FRAGMENT 0x4000 /* Don't Fragment Flag */
#define IP_FRAGOFF 0x1FFF /* Fragment offset mask */
#define IP_MOREFRAGS 0x2000 /* More fragments bit */
#define IP_GOOD_CS 0
struct ipv6_frame
{
uint32 vers_class_flow; /* 4 bits Version, 8 Traffic Class, 20 Flow Label. */
uint16 len; /* Zero indicates Jumbo Payload hop-by-hop option. */
// uint8 next_header; /* Values are superset of IPv4's Protocol field. */
uint8 protocol; /* Values are superset of IPv4's Protocol field. */
uint8 hop_limit; /* IP4 TTL equivalent field measured in hops */
struct _in6_addr sip;
struct _in6_addr dip;
UINT16 buf_index;
};
#define ip_frame ipv6_frame
extern INT16 process_ip_in (struct ethernet_frame*);
extern UINT16 ip_checksum (UINT16 cs, UINT8 dat, UINT8 count);
extern UINT32 ip_checksum_buf (UINT16 cs, UINT8* buf, UINT16 len);
extern INT16 process_ip_out(IPv6Addr *, UINT8, UINT8, UINT8, UINT8*, UINT16);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -