Reimplement BpfProgram

This commit is contained in:
Pragyansh Chaturvedi
2025-10-18 13:24:03 +05:30
parent 2b99f01b02
commit 5c74be041e
3 changed files with 63 additions and 76 deletions

View File

@ -16,7 +16,7 @@ private:
std::string program_name_;
public:
explicit BpfProgram(std::shared_ptr<BpfObject> parent, struct bpf_program *raw_prog, std::string program_name = "");
explicit BpfProgram(std::shared_ptr<BpfObject> parent, struct bpf_program *raw_prog, const std::string& program_name);
~BpfProgram();
@ -28,8 +28,6 @@ public:
bool attach();
bool detach();
void load_and_attach();
[[nodiscard]] bool is_attached() const { return link_ != nullptr; }
[[nodiscard]] std::string get_name() const { return program_name_; }
};