Skip to content

Commit

Permalink
[Agent] Enhance the direction judgment of eBPF data
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoMr committed Oct 12, 2023
1 parent c8f1188 commit e9a03c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agent/src/common/meta_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ pub struct MetaPacket<'a> {
pub process_kname: [u8; PACKET_KNAME_MAX_PADDING], // kernel process name
// for PcapAssembler
pub flow_id: u64,
pub socket_role: u8,

/********** for GPID **********/
pub gpid_0: u32,
Expand Down Expand Up @@ -932,6 +933,7 @@ impl<'a> MetaPacket<'a> {
packet.thread_id = data.thread_id;
packet.coroutine_id = data.coroutine_id;
packet.syscall_trace_id = data.syscall_trace_id_call;
packet.socket_role = data.socket_role;
#[cfg(target_arch = "aarch64")]
ptr::copy(
data.process_kname.as_ptr() as *const u8,
Expand Down
5 changes: 5 additions & 0 deletions agent/src/flow_generator/flow_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,11 @@ impl FlowMap {
],
signal_source: meta_packet.signal_source,
is_active_service,
direction_score: if meta_packet.socket_role > 0 {
ServiceTable::MAX_SCORE
} else {
0
},
..Default::default()
};
tagged_flow.flow = flow;
Expand Down

0 comments on commit e9a03c7

Please sign in to comment.