Function librist_sys::rist_auth_handler_set[][src]

pub unsafe extern "C" fn rist_auth_handler_set(
    ctx: *mut rist_ctx,
    connect_cb: Option<unsafe extern "C" fn(arg: *mut c_void, conn_ip: *const c_char, conn_port: u16, local_ip: *const c_char, local_port: u16, peer: *mut rist_peer) -> c_int>,
    disconn_cb: Option<unsafe extern "C" fn(arg: *mut c_void, peer: *mut rist_peer) -> c_int>,
    arg: *mut c_void
) -> c_int

@brief Assign dynamic authentication handler

Whenever a new peer is connected, @a connect_cb is called. Whenever a new peer is disconnected, @a disconn_cb is called.

@param ctx RIST context @param connect_cb A pointer to the function that will be called when a new peer connects. Return 0 or -1 to authorize or decline (NULL function pointer is valid) @param disconn_cb A pointer to the function that will be called when a new peer is marked as dead (NULL function pointer is valid) @param arg is an the extra argument passed to the conn_cb and disconn_cb