Skip to content

Commit 7ea0365

Browse files
Alan-JowettCopilot
andcommitted
Regenerate bpf2c expected output
Run generate_expected_bpf2c_output.ps1 to update all expected output files after the connect_authorization helper changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 08e32bc commit 7ea0365

38 files changed

+330
-1266
lines changed

tests/bpf2c_tests/expected/bind_policy_dll.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ _get_hash(_Outptr_result_buffer_maybenull_(*size) const uint8_t** hash, _Out_ si
4545

4646
#pragma data_seg(push, "maps")
4747
static map_entry_t _maps[] = {
48-
{{0, 0},
48+
{
49+
{0, 0},
4950
{
50-
1, // Current Version.
51-
80, // Struct size up to the last field.
52-
80, // Total struct size including padding.
51+
1, // Current Version.
52+
80, // Struct size up to the last field.
53+
80, // Total struct size including padding.
5354
},
5455
{
5556
BPF_MAP_TYPE_HASH, // Type of map.
@@ -83,19 +84,19 @@ _get_global_variable_sections(
8384

8485
static helper_function_entry_t authorize_bind_helpers[] = {
8586
{
86-
{1, 40, 40}, // Version header.
87-
15,
88-
"helper_id_15",
87+
{1, 40, 40}, // Version header.
88+
15,
89+
"helper_id_15",
8990
},
9091
{
91-
{1, 40, 40}, // Version header.
92-
1,
93-
"helper_id_1",
92+
{1, 40, 40}, // Version header.
93+
1,
94+
"helper_id_1",
9495
},
9596
{
96-
{1, 40, 40}, // Version header.
97-
13,
98-
"helper_id_13",
97+
{1, 40, 40}, // Version header.
98+
13,
99+
"helper_id_13",
99100
},
100101
};
101102

tests/bpf2c_tests/expected/cgroup_connect_authorization4_dll.c

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ _get_hash(_Outptr_result_buffer_maybenull_(*size) const uint8_t** hash, _Out_ si
4545

4646
#pragma data_seg(push, "maps")
4747
static map_entry_t _maps[] = {
48-
{{0, 0},
48+
{
49+
{0, 0},
4950
{
50-
1, // Current Version.
51-
80, // Struct size up to the last field.
52-
80, // Total struct size including padding.
51+
1, // Current Version.
52+
80, // Struct size up to the last field.
53+
80, // Total struct size including padding.
5354
},
5455
{
5556
BPF_MAP_TYPE_HASH, // Type of map.
@@ -83,14 +84,14 @@ _get_global_variable_sections(
8384

8485
static helper_function_entry_t count_tcp_connect_authorization4_helpers[] = {
8586
{
86-
{1, 40, 40}, // Version header.
87-
1,
88-
"helper_id_1",
87+
{1, 40, 40}, // Version header.
88+
1,
89+
"helper_id_1",
8990
},
9091
{
91-
{1, 40, 40}, // Version header.
92-
2,
93-
"helper_id_2",
92+
{1, 40, 40}, // Version header.
93+
2,
94+
"helper_id_2",
9495
},
9596
};
9697

@@ -172,12 +173,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
172173
// EBPF_OP_CALL pc=11 dst=r0 src=r0 offset=0 imm=1
173174
#line 41 "sample/cgroup_connect_authorization4.c"
174175
r0 = runtime_context->helper_data[0].address(r1, r2, r3, r4, r5, context);
175-
#line 41 "sample/cgroup_connect_authorization4.c"
176-
if ((runtime_context->helper_data[0].tail_call) && (r0 == 0)) {
177-
#line 41 "sample/cgroup_connect_authorization4.c"
178-
return 0;
179-
#line 41 "sample/cgroup_connect_authorization4.c"
180-
}
181176
// EBPF_OP_MOV64_IMM pc=12 dst=r1 src=r0 offset=0 imm=1
182177
#line 41 "sample/cgroup_connect_authorization4.c"
183178
r1 = IMMEDIATE(1);
@@ -222,12 +217,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
222217
// EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=2
223218
#line 46 "sample/cgroup_connect_authorization4.c"
224219
r0 = runtime_context->helper_data[1].address(r1, r2, r3, r4, r5, context);
225-
#line 46 "sample/cgroup_connect_authorization4.c"
226-
if ((runtime_context->helper_data[1].tail_call) && (r0 == 0)) {
227-
#line 46 "sample/cgroup_connect_authorization4.c"
228-
return 0;
229-
#line 46 "sample/cgroup_connect_authorization4.c"
230-
}
231220
// EBPF_OP_LDXDW pc=26 dst=r1 src=r10 offset=-16 imm=0
232221
#line 51 "sample/cgroup_connect_authorization4.c"
233222
READ_ONCE_64(r1, r10, OFFSET(-16));
@@ -287,7 +276,7 @@ static void
287276
_get_version(_Out_ bpf2c_version_t* version)
288277
{
289278
version->major = 1;
290-
version->minor = 1;
279+
version->minor = 2;
291280
version->revision = 0;
292281
}
293282

tests/bpf2c_tests/expected/cgroup_connect_authorization4_raw.c

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ _get_hash(_Outptr_result_buffer_maybenull_(*size) const uint8_t** hash, _Out_ si
1515

1616
#pragma data_seg(push, "maps")
1717
static map_entry_t _maps[] = {
18-
{{0, 0},
18+
{
19+
{0, 0},
1920
{
20-
1, // Current Version.
21-
80, // Struct size up to the last field.
22-
80, // Total struct size including padding.
21+
1, // Current Version.
22+
80, // Struct size up to the last field.
23+
80, // Total struct size including padding.
2324
},
2425
{
2526
BPF_MAP_TYPE_HASH, // Type of map.
@@ -53,14 +54,14 @@ _get_global_variable_sections(
5354

5455
static helper_function_entry_t count_tcp_connect_authorization4_helpers[] = {
5556
{
56-
{1, 40, 40}, // Version header.
57-
1,
58-
"helper_id_1",
57+
{1, 40, 40}, // Version header.
58+
1,
59+
"helper_id_1",
5960
},
6061
{
61-
{1, 40, 40}, // Version header.
62-
2,
63-
"helper_id_2",
62+
{1, 40, 40}, // Version header.
63+
2,
64+
"helper_id_2",
6465
},
6566
};
6667

@@ -142,12 +143,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
142143
// EBPF_OP_CALL pc=11 dst=r0 src=r0 offset=0 imm=1
143144
#line 41 "sample/cgroup_connect_authorization4.c"
144145
r0 = runtime_context->helper_data[0].address(r1, r2, r3, r4, r5, context);
145-
#line 41 "sample/cgroup_connect_authorization4.c"
146-
if ((runtime_context->helper_data[0].tail_call) && (r0 == 0)) {
147-
#line 41 "sample/cgroup_connect_authorization4.c"
148-
return 0;
149-
#line 41 "sample/cgroup_connect_authorization4.c"
150-
}
151146
// EBPF_OP_MOV64_IMM pc=12 dst=r1 src=r0 offset=0 imm=1
152147
#line 41 "sample/cgroup_connect_authorization4.c"
153148
r1 = IMMEDIATE(1);
@@ -192,12 +187,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
192187
// EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=2
193188
#line 46 "sample/cgroup_connect_authorization4.c"
194189
r0 = runtime_context->helper_data[1].address(r1, r2, r3, r4, r5, context);
195-
#line 46 "sample/cgroup_connect_authorization4.c"
196-
if ((runtime_context->helper_data[1].tail_call) && (r0 == 0)) {
197-
#line 46 "sample/cgroup_connect_authorization4.c"
198-
return 0;
199-
#line 46 "sample/cgroup_connect_authorization4.c"
200-
}
201190
// EBPF_OP_LDXDW pc=26 dst=r1 src=r10 offset=-16 imm=0
202191
#line 51 "sample/cgroup_connect_authorization4.c"
203192
READ_ONCE_64(r1, r10, OFFSET(-16));
@@ -257,7 +246,7 @@ static void
257246
_get_version(_Out_ bpf2c_version_t* version)
258247
{
259248
version->major = 1;
260-
version->minor = 1;
249+
version->minor = 2;
261250
version->revision = 0;
262251
}
263252

tests/bpf2c_tests/expected/cgroup_connect_authorization4_sys.c

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ _get_hash(_Outptr_result_buffer_maybenull_(*size) const uint8_t** hash, _Out_ si
170170

171171
#pragma data_seg(push, "maps")
172172
static map_entry_t _maps[] = {
173-
{{0, 0},
173+
{
174+
{0, 0},
174175
{
175-
1, // Current Version.
176-
80, // Struct size up to the last field.
177-
80, // Total struct size including padding.
176+
1, // Current Version.
177+
80, // Struct size up to the last field.
178+
80, // Total struct size including padding.
178179
},
179180
{
180181
BPF_MAP_TYPE_HASH, // Type of map.
@@ -208,14 +209,14 @@ _get_global_variable_sections(
208209

209210
static helper_function_entry_t count_tcp_connect_authorization4_helpers[] = {
210211
{
211-
{1, 40, 40}, // Version header.
212-
1,
213-
"helper_id_1",
212+
{1, 40, 40}, // Version header.
213+
1,
214+
"helper_id_1",
214215
},
215216
{
216-
{1, 40, 40}, // Version header.
217-
2,
218-
"helper_id_2",
217+
{1, 40, 40}, // Version header.
218+
2,
219+
"helper_id_2",
219220
},
220221
};
221222

@@ -297,12 +298,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
297298
// EBPF_OP_CALL pc=11 dst=r0 src=r0 offset=0 imm=1
298299
#line 41 "sample/cgroup_connect_authorization4.c"
299300
r0 = runtime_context->helper_data[0].address(r1, r2, r3, r4, r5, context);
300-
#line 41 "sample/cgroup_connect_authorization4.c"
301-
if ((runtime_context->helper_data[0].tail_call) && (r0 == 0)) {
302-
#line 41 "sample/cgroup_connect_authorization4.c"
303-
return 0;
304-
#line 41 "sample/cgroup_connect_authorization4.c"
305-
}
306301
// EBPF_OP_MOV64_IMM pc=12 dst=r1 src=r0 offset=0 imm=1
307302
#line 41 "sample/cgroup_connect_authorization4.c"
308303
r1 = IMMEDIATE(1);
@@ -347,12 +342,6 @@ count_tcp_connect_authorization4(void* context, const program_runtime_context_t*
347342
// EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=2
348343
#line 46 "sample/cgroup_connect_authorization4.c"
349344
r0 = runtime_context->helper_data[1].address(r1, r2, r3, r4, r5, context);
350-
#line 46 "sample/cgroup_connect_authorization4.c"
351-
if ((runtime_context->helper_data[1].tail_call) && (r0 == 0)) {
352-
#line 46 "sample/cgroup_connect_authorization4.c"
353-
return 0;
354-
#line 46 "sample/cgroup_connect_authorization4.c"
355-
}
356345
// EBPF_OP_LDXDW pc=26 dst=r1 src=r10 offset=-16 imm=0
357346
#line 51 "sample/cgroup_connect_authorization4.c"
358347
READ_ONCE_64(r1, r10, OFFSET(-16));
@@ -412,7 +401,7 @@ static void
412401
_get_version(_Out_ bpf2c_version_t* version)
413402
{
414403
version->major = 1;
415-
version->minor = 1;
404+
version->minor = 2;
416405
version->revision = 0;
417406
}
418407

tests/bpf2c_tests/expected/cgroup_connect_authorization6_dll.c

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ _get_hash(_Outptr_result_buffer_maybenull_(*size) const uint8_t** hash, _Out_ si
4545

4646
#pragma data_seg(push, "maps")
4747
static map_entry_t _maps[] = {
48-
{{0, 0},
48+
{
49+
{0, 0},
4950
{
50-
1, // Current Version.
51-
80, // Struct size up to the last field.
52-
80, // Total struct size including padding.
51+
1, // Current Version.
52+
80, // Struct size up to the last field.
53+
80, // Total struct size including padding.
5354
},
5455
{
5556
BPF_MAP_TYPE_HASH, // Type of map.
@@ -83,14 +84,14 @@ _get_global_variable_sections(
8384

8485
static helper_function_entry_t count_tcp_connect_authorization6_helpers[] = {
8586
{
86-
{1, 40, 40}, // Version header.
87-
1,
88-
"helper_id_1",
87+
{1, 40, 40}, // Version header.
88+
1,
89+
"helper_id_1",
8990
},
9091
{
91-
{1, 40, 40}, // Version header.
92-
2,
93-
"helper_id_2",
92+
{1, 40, 40}, // Version header.
93+
2,
94+
"helper_id_2",
9495
},
9596
};
9697

@@ -172,12 +173,6 @@ count_tcp_connect_authorization6(void* context, const program_runtime_context_t*
172173
// EBPF_OP_CALL pc=11 dst=r0 src=r0 offset=0 imm=1
173174
#line 41 "sample/cgroup_connect_authorization6.c"
174175
r0 = runtime_context->helper_data[0].address(r1, r2, r3, r4, r5, context);
175-
#line 41 "sample/cgroup_connect_authorization6.c"
176-
if ((runtime_context->helper_data[0].tail_call) && (r0 == 0)) {
177-
#line 41 "sample/cgroup_connect_authorization6.c"
178-
return 0;
179-
#line 41 "sample/cgroup_connect_authorization6.c"
180-
}
181176
// EBPF_OP_MOV64_IMM pc=12 dst=r1 src=r0 offset=0 imm=1
182177
#line 41 "sample/cgroup_connect_authorization6.c"
183178
r1 = IMMEDIATE(1);
@@ -222,12 +217,6 @@ count_tcp_connect_authorization6(void* context, const program_runtime_context_t*
222217
// EBPF_OP_CALL pc=25 dst=r0 src=r0 offset=0 imm=2
223218
#line 46 "sample/cgroup_connect_authorization6.c"
224219
r0 = runtime_context->helper_data[1].address(r1, r2, r3, r4, r5, context);
225-
#line 46 "sample/cgroup_connect_authorization6.c"
226-
if ((runtime_context->helper_data[1].tail_call) && (r0 == 0)) {
227-
#line 46 "sample/cgroup_connect_authorization6.c"
228-
return 0;
229-
#line 46 "sample/cgroup_connect_authorization6.c"
230-
}
231220
// EBPF_OP_LDXDW pc=26 dst=r1 src=r10 offset=-16 imm=0
232221
#line 51 "sample/cgroup_connect_authorization6.c"
233222
READ_ONCE_64(r1, r10, OFFSET(-16));
@@ -287,7 +276,7 @@ static void
287276
_get_version(_Out_ bpf2c_version_t* version)
288277
{
289278
version->major = 1;
290-
version->minor = 1;
279+
version->minor = 2;
291280
version->revision = 0;
292281
}
293282

0 commit comments

Comments
 (0)