This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
31 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../bpf-sdk/bpf.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @brief Example C-based BPF program that prints out the parameters | ||
* passed to it | ||
*/ | ||
|
||
#include <sol_bpf.h> | ||
|
||
/** | ||
* Number of SolKeyedAccounts expected. The program should bail if an | ||
* unexpected number of accounts are passed to the program's entrypoint | ||
*/ | ||
#define NUM_KA 1 | ||
|
||
extern bool entrypoint(const uint8_t *input) { | ||
SolKeyedAccounts ka[NUM_KA]; | ||
uint8_t *data; | ||
uint64_t data_len; | ||
|
||
if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) { | ||
return false; | ||
} | ||
sol_print_params(NUM_KA, ka, data, data_len); | ||
return true; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash -ex | ||
|
||
make -C ../../../examples/bpf-c-noop/ | ||
cp ../../../examples/bpf-c-noop/out/noop.o . |
Binary file not shown.