diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-06-14 17:13:46 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-06-14 17:13:46 +0200 |
| commit | 7f13c95e16a802d0706e9f5a6d5d845d7fd67631 (patch) | |
| tree | 65cb3c0faec397cb1b06894645d060514f6b242d /esds/plugins/node_plugin.py | |
| parent | b6877cb81e56c3991d0dbcf9fa579f627a4c2a29 (diff) | |
Major refactoring:
- Create pip package
- Reorganized source code
Diffstat (limited to 'esds/plugins/node_plugin.py')
| -rw-r--r-- | esds/plugins/node_plugin.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/esds/plugins/node_plugin.py b/esds/plugins/node_plugin.py new file mode 100644 index 0000000..325ff8a --- /dev/null +++ b/esds/plugins/node_plugin.py @@ -0,0 +1,29 @@ +class NodePlugin: + """ + Node plugins get register to the node API get notified when events occurs. + The call and return suffixes are used for methods that are called at the beginning + and the end, respectively, of API calls triggered by the node source code. + + Changing this API could brake most of the node plugins. + """ + + def __init__(self,plugin_name,api): + self.api=api + self.plugin_name=plugin_name + api.plugin_register(self) + + def on_send_call(self,interface,data,datasize,dst): + pass + + def on_send_return(self,interface,data,datasize,dst,code): + pass + + def on_receive_return(self,interface,data,start_at,end_at): + pass + + def on_terminated(self): + pass + + def log(self,msg): + self.api.log(self.plugin_name+"(NP) "+msg) + |
