summaryrefslogtreecommitdiff
path: root/src/plugin
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2023-09-12 16:11:32 +0800
committerluwenpeng <[email protected]>2023-09-13 19:20:06 +0800
commit8f9e0f719055487e4a352f5da74cae063bbcdbcc (patch)
treea7d44661b4b2d79202abd2a79f3eeda1f791b98b /src/plugin
parent8755e95f068da56c099e9c51dc4a89b55960e48d (diff)
[feature] Support GTPv1-U Decode
Diffstat (limited to 'src/plugin')
-rw-r--r--src/plugin/example.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugin/example.rs b/src/plugin/example.rs
index 6819d75..bce1724 100644
--- a/src/plugin/example.rs
+++ b/src/plugin/example.rs
@@ -78,19 +78,19 @@ impl EventHandle for ExamplePulgin {
packet: Option<&Packet>,
session: Option<Rc<RefCell<Session>>>,
) {
+ self.plugin_ctx.borrow_mut().clear();
+ self.plugin_ctx.borrow_mut().push_str("1");
+
if session.is_none() {
return;
}
- let length = packet.unwrap().orig_len;
- let flow_id = packet.unwrap().get_flow_id();
- println!(
- "{} handle Packet: {:?} {:?}",
- self.plugin_name, length, flow_id
- );
-
- self.plugin_ctx.borrow_mut().clear();
- self.plugin_ctx.borrow_mut().push_str("1");
+ if packet.is_some() {
+ let flow_id = packet.unwrap().get_flow_id();
+ println!("{} handle Packet: {:?}", self.plugin_name, flow_id);
+ } else {
+ println!("{} handle Packet: None", self.plugin_name);
+ }
let session = session.unwrap();
if index == self.tcp_opening_event {