Skip to content

Commit

Permalink
[runtime] add license for rust example
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlefisher619 authored and yunwei37 committed Mar 8, 2023
1 parent 218c829 commit 95f535a
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runtime/rust/src/func/attach.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use std::os::fd::AsRawFd;

use log::debug;
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/close.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use std::collections::hash_map::Entry;

use log::debug;
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/fd_by_name.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use log::debug;

use crate::{ensure_c_str, ensure_program_mut_by_caller, state::CallerType};
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/load.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use libbpf_rs::ObjectBuilder;
use log::debug;

Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/map_operate.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use libbpf_rs::libbpf_sys::{
bpf_map_delete_elem_flags, bpf_map_get_next_key, bpf_map_lookup_elem_flags,
bpf_map_update_elem, BPF_MAP_DELETE_ELEM, BPF_MAP_GET_NEXT_KEY, BPF_MAP_LOOKUP_ELEM,
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
pub const EINVAL: i32 = 22;
pub const ENOENT: i32 = 2;

Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/poll.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use std::{
ffi::c_void,
ptr::{null, null_mut},
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/func/wrapper_poll.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use log::error;

use crate::{func::EINVAL, state::CallerType};
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/log_format.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use flexi_logger::{DeferredNow, Record, TS_DASHES_BLANK_COLONS_DOT_BLANK};

pub fn my_log_format(
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use anyhow::{anyhow, Context};
use clap::Parser;
use flexi_logger::Logger;
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use std::{collections::HashMap, fs::File, ptr::null};

use libbpf_rs::{
Expand Down
5 changes: 5 additions & 0 deletions runtime/rust/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! SPDX-License-Identifier: MIT
//!
//! Copyright (c) 2023, eunomia-bpf
//! All rights reserved.
//!
use std::ffi::CStr;

use crate::{state::CallerType, AppState};
Expand Down

0 comments on commit 95f535a

Please sign in to comment.