include/uapi/linux/icmp.h

Source file repositories/reference/linux-study-clean/include/uapi/linux/icmp.h

File Facts

System
Linux kernel
Corpus path
include/uapi/linux/icmp.h
Extension
.h
Size
4800 bytes
Lines
163
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct icmphdr {
  __u8		type;
  __u8		code;
  __sum16	checksum;
  union {
	struct {
		__be16	id;
		__be16	sequence;
	} echo;
	__be32	gateway;
	struct {
		__be16	__unused;
		__be16	mtu;
	} frag;
	__u8	reserved[4];
  } un;
};


/*
 *	constants for (set|get)sockopt
 */

#define ICMP_FILTER			1

struct icmp_filter {
	__u32		data;
};

/* RFC 4884 extension struct: one per message */
struct icmp_ext_hdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
	__u8		reserved1:4,
			version:4;
#elif defined(__BIG_ENDIAN_BITFIELD)
	__u8		version:4,
			reserved1:4;
#else
#error	"Please fix <asm/byteorder.h>"
#endif
	__u8		reserved2;
	__sum16		checksum;
};

/* RFC 4884 extension object header: one for each object */
struct icmp_extobj_hdr {
	__be16		length;
	__u8		class_num;
	__u8		class_type;
};

/* RFC 8335: 2.1 Header for c-type 3 payload */
struct icmp_ext_echo_ctype3_hdr {
	__be16		afi;
	__u8		addrlen;
	__u8		reserved;
};

/* RFC 8335: 2.1 Interface Identification Object */
struct icmp_ext_echo_iio {
	struct icmp_extobj_hdr extobj_hdr;
	union {
		char name[IFNAMSIZ];
		__be32 ifindex;
		struct {
			struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
			union {
				__be32		ipv4_addr;
				struct in6_addr	ipv6_addr;
			} ip_addr;
		} addr;
	} ident;
};
#endif /* _UAPI_LINUX_ICMP_H */

Annotation

Implementation Notes