libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

callhome bind with multiple ip

Open palaniace opened this issue 3 years ago • 3 comments

hi ,

client application should bind and listen to three different ip , and should establish the callhome connection with three different netconf server.

current libnetconf2 api [nc_client_ssh_ch_add_bind_listen() api will support to listen on single ip ..

whether any other libnetconf2 api is available to bind and listen with differnt ip ?

so how we can acheive this ?

palaniace avatar Feb 16 '22 10:02 palaniace

You are free to call the function repeatedly to add more listening address/port pairs.

michalvasko avatar Feb 17 '22 07:02 michalvasko

As you mentioned we can add more listening address/port pair with nc_client_ssh_ch_add_bind_listen() api .

But how we can provide three different netconf server login details ?

     struct nc_session *session = NULL;
      nc_client_ssh_ch_set_auth_pref(NC_SSH_AUTH_INTERACTIVE, -1);
       nc_client_ssh_ch_set_auth_pref(NC_SSH_AUTH_PUBLICKEY, -1);
        nc_client_ssh_ch_set_auth_pref(NC_SSH_AUTH_PASSWORD, 4);
        nc_client_ssh_ch_set_auth_hostkey_check_clb(nc_auth_hostkey_check_clb, NULL);
        nc_client_ssh_ch_set_auth_password_clb(nc_auth_password_clb, NULL);
       nc_client_ssh_ch_set_username(oru_gw_oru_ssh_user.c_str());

palaniace avatar Feb 17 '22 11:02 palaniace

I suppose only with that callback, one of the parameters is hostname and based on that you can provide what credentials you want.

michalvasko avatar Feb 17 '22 13:02 michalvasko