mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Add ipv6_get_data_any and ip_get_data_any.
These version allow returning an extension header or other non–upper-layer protocol if it is the final header before the end of the packet. This is used to parse the broken packets sent as part of protocol scan.
This commit is contained in:
@@ -194,12 +194,15 @@ int mac_cache_set(struct sockaddr_storage *ss, u8 *mac);
|
||||
|
||||
const void *ip_get_data(const void *packet, unsigned int *len,
|
||||
struct abstract_ip_hdr *hdr);
|
||||
const void *ip_get_data_any(const void *packet, unsigned int *len,
|
||||
struct abstract_ip_hdr *hdr);
|
||||
/* Get the upper-layer protocol from an IPv4 packet. */
|
||||
const void *ipv4_get_data(const struct ip *ip, unsigned int *len);
|
||||
/* Get the upper-layer protocol from an IPv6 packet. This skips over known
|
||||
extension headers. The length of the upper-layer payload is stored in *len.
|
||||
The protocol is stored in *nxt. Returns NULL in case of error. */
|
||||
const void *ipv6_get_data(const struct ip6_hdr *ip6, unsigned int *len, u8 *nxt);
|
||||
const void *ipv6_get_data_any(const struct ip6_hdr *ip6, unsigned int *len, u8 *nxt);
|
||||
const void *icmp_get_data(const struct icmp_hdr *icmp, unsigned int *len);
|
||||
const void *icmpv6_get_data(const struct icmpv6_hdr *icmpv6, unsigned int *len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user