Loading...
Searching...
No Matches
Server communication

Once at least one session is established, an nc_pollsession structure should be created with nc_ps_new(), filled with the session using nc_ps_add_session() and finally polled with nc_ps_poll(). Based on the return value from the poll, further actions can be taken. More sessions can be polled at the same time and any requests received on the sessions are handled internally.

If an SSH NETCONF session asks for a new channel, you can accept this request with nc_ps_accept_ssh_channel() or nc_session_accept_ssh_channel() depending on the structure you want to use as the argument.

The server-side notifications are also supported. You can create a new notification with nc_server_notif_new() and send it via nc_server_notif_send() to subscribed clients. Keep in mind that the session you wish to send a notification on has to have at least one subscriber, see nc_session_inc_notif_status(). Currently, only notifications about certificate expiration are implemented, see nc_server_notif_cert_expiration_thread_start().

## Functions List

Available in nc_server.h.

- nc_ps_new()
- nc_ps_add_session()
- nc_ps_del_session()
- nc_ps_session_count()
- nc_ps_free()
- nc_ps_poll()
- nc_ps_clear()
- nc_ps_accept_ssh_channel()
- nc_session_accept_ssh_channel()
- nc_server_notif_new()
- nc_server_notif_send()
- nc_server_notif_free()
- nc_server_notif_get_time()
- nc_session_inc_notif_status()
- nc_session_dec_notif_status()
- nc_session_get_notif_status()
- nc_server_notif_cert_expiration_thread_start()
- nc_server_notif_cert_expiration_thread_stop()