NetconfServiceProvider

class NetconfServiceProvider : public path::ServiceProvider

Implementation of ServiceProvider for the netconf protocol.

NetconfServiceProvider(std::string address, std::string username, std::string password, int port = 830)

Constructs an instance of the NetconfServiceProvider to connect to a server which has to support model download

Parameters:
  • address – IP address of the device supporting a netconf interface
  • username – Username to log in to the device
  • password – Password to log in to the device
  • port – Device port used to access the netconf interface. Default value is 830
NetconfServiceProvider(const path::Repository &repo, std::string address, std::string username, std::string password, int port = 830)

Constructs an instance of the NetconfServiceProvider using the provided repository

Parameters:
  • repository – Reference to an instance of path::Repository
  • address – IP address of the device supporting a netconf interface
  • username – Username to log in to the device
  • password – Password to log in to the device
  • port – Device port used to access the netconf interface. Default value is 830
path::RootSchemaNode &get_root_schema() const

Returns the RootSchemaNode tree supported by this instance of the ServiceProvider.

Returns:Pointer to the RootSchemaNode or nullptr if one could not be created.
std::shared_ptr<path::DataNode> invoke(path::Rpc &rpc) const
Invokes or executes the given rpc and returns a DataNode pointer if the Rpc has an output modelled in YANG.
Parameters:rpc – Reference to the Rpc node.
Returns:Shared pointer to the DataNode representing the output.
EncodingFormat get_encoding()

Returns the type of encoding supported by the service provider. In the case of netconf service provider, EncodingFormat::XML is returned.

~NetconfServiceProvider()