libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

Question about accepting/starting netconf session with authenticated ssh channel

Open cmyager opened this issue 7 years ago • 3 comments

I'm currently migrating a project from libnetconf to libnetconf2. In libnetconf the function nc_session_accept_libssh_channel was capable of starting a netconf session with an authenticated libssh ssh channel. This seems to have been removed in libnetconf2, and I cannot find anything that accomplishes the same thing.

Is there one and I am just missing it, or was this functionality removed and expected to be implemented with nc_accept_inout?

Thank you for your time!

cmyager avatar Oct 25 '18 19:10 cmyager

Hi, you mean nc_session_accept_ssh_channel()? I do not know why this function should be hard to find.

Regards, Michal

michalvasko avatar Oct 26 '18 06:10 michalvasko

Hi, I did see that function, but I didn't think it accomplished the same thing.

In the original libnetconf nc_session_accept_libssh_channel() took an ssh_channel and returned a netconf session.

From what I understand from the libnetconf2 documentation the function nc_session_accept_ssh_channel() is used to create additional netconf sessions using one that has already been established?

cmyager avatar Oct 26 '18 09:10 cmyager

Oh, you have created the SSH channel yourself? Then yes, nc_accept_inout() is the function you want to use but this way you are not using maybe half of libnetconf2 if not even more. It really is better to use nc_ps_poll() and functions around that, if you can.

Regards, Michal

michalvasko avatar Oct 26 '18 09:10 michalvasko