Lines Matching refs:connection

65 static struct conn_list *ndmp_connect_list_find(ndmp_connection_t *connection);
70 /* routines for connection info */
75 static void ndmp_connect_get_v2(ndmp_connection_t *connection,
85 static void ndmp_connect_get_v3(ndmp_connection_t *connection,
131 * This handler sets the protocol version to be used on the connection.
134 * connection (input) - connection handle.
142 ndmpd_connect_open_v2(ndmp_connection_t *connection, void *body)
150 if (!(session = (ndmpd_session_t *)ndmp_get_client_data(connection)))
159 ndmp_send_reply(connection, (void *) &reply,
171 ndmp_set_version(connection, request->protocol_version);
180 * This handler authorizes the NDMP connection.
183 * connection (input) - connection handle.
190 ndmpd_connect_client_auth_v2(ndmp_connection_t *connection, void *body)
220 ndmpd_audit_connect(connection, EINVAL);
230 ndmp_set_authorized(connection, FALSE);
231 ndmp_send_reply(connection, (void *) &reply,
233 ndmpd_audit_connect(connection,
242 ndmpd_audit_connect(connection,
252 ndmp_set_authorized(connection, FALSE);
253 ndmp_send_reply(connection, (void *) &reply,
255 ndmpd_audit_connect(connection,
269 ndmpd_audit_connect(connection, reply.error ?
282 ndmp_set_authorized(connection, FALSE);
283 ndmp_send_reply(connection, (void *) &reply,
285 ndmpd_audit_connect(connection,
295 ndmp_set_authorized(connection, FALSE);
296 ndmp_send_reply(connection, (void *) &reply,
298 ndmpd_audit_connect(connection,
304 session = ndmp_get_client_data(connection);
320 ndmpd_audit_connect(connection, reply.error ?
331 ndmp_set_authorized(connection, TRUE);
333 ndmp_set_authorized(connection, FALSE);
335 ndmp_send_reply(connection, (void *) &reply,
346 * connection (input) - connection handle.
353 ndmpd_connect_server_auth_v2(ndmp_connection_t *connection, void *body)
386 ndmp_send_reply(connection, (void *) &reply,
394 * This handler closes the connection.
397 * connection (input) - connection handle.
405 ndmpd_connect_close_v2(ndmp_connection_t *connection, void *body)
409 if ((session = (ndmpd_session_t *)ndmp_get_client_data(connection))) {
410 (void) ndmp_close(connection);
424 * This handler authorizes the NDMP connection.
427 * connection (input) - connection handle.
434 ndmpd_connect_client_auth_v3(ndmp_connection_t *connection, void *body)
457 ndmpd_audit_connect(connection, ENOTSUP);
467 ndmp_set_authorized(connection, FALSE);
468 ndmp_send_reply(connection, (void *) &reply,
470 ndmpd_audit_connect(connection,
478 ndmpd_audit_connect(connection, reply.error ?
489 ndmp_set_authorized(connection, FALSE);
490 ndmp_send_reply(connection, (void *) &reply,
492 ndmpd_audit_connect(connection,
497 session = ndmp_get_client_data(connection);
501 ndmpd_audit_connect(connection, reply.error ?
508 ndmpd_audit_connect(connection, EINVAL);
512 ndmp_set_authorized(connection, TRUE);
514 ndmp_set_authorized(connection, FALSE);
515 if (tcp_get_peer(connection->conn_sock, &addr.s_addr,
523 ndmp_send_reply(connection, (void *) &reply,
531 * Close the connection to the DMA.
532 * Send the SHUTDOWN message before closing the socket connection to the DMA.
535 * connection (input) - connection handle.
543 ndmpd_connect_close_v3(ndmp_connection_t *connection, void *body)
549 if (!(session = (ndmpd_session_t *)ndmp_get_client_data(connection)))
557 /* Send the SHUTDOWN message before closing the connection. */
562 if (ndmp_send_request(connection, NDMP_NOTIFY_CONNECTION_STATUS,
564 NDMP_LOG(LOG_NOTICE, "Sending connection shutdown notify");
569 ndmp_close(connection);
638 * Find the element in the active connection list.
641 * connection (input) - connection handler.
645 * connection list element pointer
648 ndmp_connect_list_find(ndmp_connection_t *connection)
652 NDMP_LOG(LOG_DEBUG, "connection: 0x%p",
653 connection);
656 if (clp->cl_conn == connection) {
667 * Add the new connection to the list of the active connections.
670 * connection (input) - connection handler.
671 * id (input/output) - pointer to connection id.
678 ndmp_connect_list_add(ndmp_connection_t *connection, int *id)
682 if (connection == NULL) {
690 clp->cl_conn = connection;
704 * Delete the specified connection from the list.
707 * connection (input) - connection handler.
714 ndmp_connect_list_del(ndmp_connection_t *connection)
719 if (!(clp = ndmp_connect_list_find(connection))) {
721 NDMP_LOG(LOG_DEBUG, "connection not found");
739 * id (input) - connection id.
743 * connection list element pointer
765 * Get common fields of the active connection.
791 * Get the connection SCSI info.
806 * Get the connection tape info.
828 * Get the connection mover info.
846 * Get the connection common data info.
882 * Get the connection data info.
919 * Get V2 connection info.
922 ndmp_connect_get_v2(ndmp_connection_t *connection, ndmp_door_ctx_t *enc_ctx)
926 if ((session = (ndmpd_session_t *)ndmp_get_client_data(connection))) {
935 * Get the V3 connection mover info.
957 * Get the connection data info.
986 * Get V3 connection info.
989 ndmp_connect_get_v3(ndmp_connection_t *connection, ndmp_door_ctx_t *enc_ctx)
993 if ((session = (ndmpd_session_t *)ndmp_get_client_data(connection))) {
1037 * Kill the connection based on its version.
1040 * connection (input) - connection handler.
1047 ndmpd_connect_kill(ndmp_connection_t *connection)
1051 if (!(session = (ndmpd_session_t *)ndmp_get_client_data(connection)))
1056 ndmpd_connect_close_v2(connection, (void *)NULL);
1060 ndmpd_connect_close_v3(connection, (void *)NULL);
1098 * Find a connection by its id and kill it.
1101 * id (input) - connection id.