sshmitm.plugins.netconf.log_session module
NETCONF session-logging plugin.
Logs every RPC operation (operation name + message-id) and every RPC reply (message-id + ok / error-tag list) to the sshmitm logger. All messages are forwarded transparently — nothing is modified.
Enable with:
ssh-mitm server --netconf-forwarder log-session ...
- class sshmitm.plugins.netconf.log_session.NetconfLoggingForwarder(session)
Bases:
NetconfBaseForwarderLog all NETCONF RPC operations and replies; forward everything unchanged.
- Parameters:
session (
Session)
- handle_rpc_reply(message_id, element)
Called for each server RPC reply after the
<hello>exchange.message_id is the
message-idattribute of the<rpc-reply>. element is the parsed<rpc-reply>element.Return a modified element to rewrite the reply, or
Noneto forward the original bytes unchanged. The default implementation always returnsNone.- Parameters:
message_id (
str)element (
Element)
- Return type:
Element|None
- handle_rpc_request(message_id, operation, element)
Called for each client RPC after the
<hello>exchange.message_id is the
message-idattribute of the<rpc>element. operation is the local name of the operation (e.g."get-config"). element is the parsed<rpc>Element.Return a modified element to rewrite the message, or
Noneto forward the original bytes unchanged. The default implementation always returnsNone.- Parameters:
message_id (
str)operation (
str)element (
Element)
- Return type:
Element|None