tools/testing/selftests/net/ioam6_parser.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/ioam6_parser.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/ioam6_parser.c
Extension
.c
Size
26708 bytes
Lines
1102
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ioam_config {
	__u32 id;
	__u64 wide;
	__u16 ingr_id;
	__u16 egr_id;
	__u32 ingr_wide;
	__u32 egr_wide;
	__u32 ns_data;
	__u64 ns_wide;
	__u32 sc_id;
	__u8 hlim;
	char *sc_data;
};

/*
 * Be careful if you modify structs below - everything MUST be kept synchronized
 * with configurations inside ioam6.sh and always reflect the same.
 */

static struct ioam_config node1 = {
	.id = 1,
	.wide = 11111111,
	.ingr_id = 0xffff, /* default value */
	.egr_id = 101,
	.ingr_wide = 0xffffffff, /* default value */
	.egr_wide = 101101,
	.ns_data = 0xdeadbeef,
	.ns_wide = 0xcafec0caf00dc0de,
	.sc_id = 777,
	.sc_data = "something that will be 4n-aligned",
	.hlim = 64,
};

static struct ioam_config node2 = {
	.id = 2,
	.wide = 22222222,
	.ingr_id = 201,
	.egr_id = 202,
	.ingr_wide = 201201,
	.egr_wide = 202202,
	.ns_data = 0xffffffff, /* default value */
	.ns_wide = 0xffffffffffffffff, /* default value */
	.sc_id = 0xffffff, /* default value */
	.sc_data = NULL,
	.hlim = 63,
};

enum {
	/**********
	 * OUTPUT *
	 **********/
	__TEST_OUT_MIN,

	TEST_OUT_UNDEF_NS,
	TEST_OUT_NO_ROOM,
	TEST_OUT_NO_ROOM_OSS,
	TEST_OUT_BIT0,
	TEST_OUT_BIT1,
	TEST_OUT_BIT2,
	TEST_OUT_BIT3,
	TEST_OUT_BIT4,
	TEST_OUT_BIT5,
	TEST_OUT_BIT6,
	TEST_OUT_BIT7,
	TEST_OUT_BIT8,
	TEST_OUT_BIT9,
	TEST_OUT_BIT10,
	TEST_OUT_BIT11,
	TEST_OUT_BIT22,
	TEST_OUT_SIZE4,
	TEST_OUT_SIZE8,
	TEST_OUT_SIZE12,
	TEST_OUT_SIZE16,
	TEST_OUT_SIZE20,
	TEST_OUT_SIZE24,
	TEST_OUT_SIZE28,
	TEST_OUT_SIZE32,
	TEST_OUT_SIZE36,
	TEST_OUT_SIZE40,
	TEST_OUT_SIZE44,
	TEST_OUT_SIZE48,
	TEST_OUT_SIZE52,
	TEST_OUT_SIZE56,
	TEST_OUT_SIZE60,
	TEST_OUT_SIZE64,
	TEST_OUT_SIZE68,
	TEST_OUT_SIZE72,
	TEST_OUT_SIZE76,
	TEST_OUT_SIZE80,
	TEST_OUT_SIZE84,

Annotation

Implementation Notes