sshmitm.plugins.netconf package

class sshmitm.plugins.netconf.NetconfLoggingForwarder(session)

Bases: NetconfBaseForwarder

Log 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-id attribute of the <rpc-reply>. element is the parsed <rpc-reply> element.

Return a modified element to rewrite the reply, or None to forward the original bytes unchanged. The default implementation always returns None.

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-id attribute 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 None to forward the original bytes unchanged. The default implementation always returns None.

Parameters:
  • message_id (str)

  • operation (str)

  • element (Element)

Return type:

Element | None

Submodules