support IPv4 & IPv6 frag reassemble
This commit is contained in:
@@ -35,6 +35,16 @@ extern "C"
|
||||
* + +
|
||||
* | |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*
|
||||
* Fragment Header
|
||||
*
|
||||
* 0 1 2 3
|
||||
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Next Header | Reserved | Fragment Offset |Res|M|
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
* | Identification |
|
||||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
@@ -81,6 +91,15 @@ static inline struct in6_addr ipv6_hdr_get_dst_in6_addr(const struct ip6_hdr *hd
|
||||
return hdr->ip6_dst;
|
||||
}
|
||||
|
||||
static inline struct ip6_frag *ipv6_hdr_get_frag_ext(const struct ip6_hdr *hdr)
|
||||
{
|
||||
if (hdr->ip6_nxt != IPPROTO_FRAGMENT)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return (struct ip6_frag *)((char *)hdr + sizeof(struct ip6_hdr));
|
||||
}
|
||||
|
||||
// TODO IPv6 extension headers
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user