Exemplo n.º 1
0
/**
 * Finish with TLS session
 *
 * @v tls		TLS session
 * @v rc		Status code
 */
static void tls_close ( struct tls_session *tls, int rc ) {

	/* Remove process */
	process_del ( &tls->process );
	
	/* Close ciphertext and plaintext streams */
	intf_shutdown ( &tls->cipherstream, rc );
	intf_shutdown ( &tls->plainstream, rc );
}
Exemplo n.º 2
0
Arquivo: dns.c Projeto: Afterglow/ipxe
/**
 * Mark DNS request as complete
 *
 * @v dns		DNS request
 * @v rc		Return status code
 */
static void dns_done ( struct dns_request *dns, int rc ) {

	/* Stop the retry timer */
	stop_timer ( &dns->timer );

	/* Shut down interfaces */
	intf_shutdown ( &dns->socket, rc );
	intf_shutdown ( &dns->resolv, rc );
}
Exemplo n.º 3
0
/**
 * Close Fibre Channel ELS transaction
 *
 * @v els		Fibre Channel ELS transaction
 * @v rc		Reason for close
 */
static void fc_els_close ( struct fc_els *els, int rc ) {

    if ( rc != 0 ) {
        DBGC ( els, FCELS_FMT " complete (%s)\n",
               FCELS_ARGS ( els ), strerror ( rc ) );
    }

    /* Stop process */
    process_del ( &els->process );

    /* Shut down interfaces */
    intf_shutdown ( &els->xchg, rc );
    intf_shutdown ( &els->job, rc );
}
Exemplo n.º 4
0
/**
 * Terminate download
 *
 * @v downloader	Downloader
 * @v rc		Reason for termination
 */
static void downloader_finished ( struct downloader *downloader, int rc ) {

	/* Log download status */
	if ( rc == 0 ) {
		syslog ( LOG_NOTICE, "Downloaded \"%s\"\n",
			 downloader->image->name );
	} else {
		syslog ( LOG_ERR, "Download of \"%s\" failed: %s\n",
			 downloader->image->name, strerror ( rc ) );
	}

	/* Shut down interfaces */
	intf_shutdown ( &downloader->xfer, rc );
	intf_shutdown ( &downloader->job, rc );
}
Exemplo n.º 5
0
Arquivo: resolv.c Projeto: 42wim/ipxe
/**
 * Child finished resolution
 *
 * @v mux		Name resolution multiplexer
 * @v rc		Return status code
 */
static void resmux_child_close ( struct resolv_mux *mux, int rc ) {

	/* Restart child interface */
	intf_restart ( &mux->child, rc );

	/* If this resolution succeeded, stop now */
	if ( rc == 0 ) {
		DBGC ( mux, "RESOLV %p succeeded using method %s\n",
		       mux, mux->resolver->name );
		goto finished;
	}

	/* Attempt next child resolver, if possible */
	mux->resolver++;
	if ( mux->resolver >= table_end ( RESOLVERS ) ) {
		DBGC ( mux, "RESOLV %p failed to resolve name\n", mux );
		goto finished;
	}
	if ( ( rc = resmux_try ( mux ) ) != 0 )
		goto finished;

	/* Next resolver is now running */
	return;

 finished:
	intf_shutdown ( &mux->parent, rc );
}
Exemplo n.º 6
0
/**
 * Transfer finished or was aborted
 *
 * @v file		Data transfer file
 * @v rc		Reason for close
 */
static void efi_download_close ( struct efi_download_file *file, int rc ) {

	file->finish_callback ( file->context, EFIRC ( rc ) );

	intf_shutdown ( &file->xfer, rc );

	efi_snp_release();
}
Exemplo n.º 7
0
/**
 * Close CMRC connection
 *
 * @v cmrc		Communication-Managed Reliable Connection
 * @v rc		Reason for close
 */
static void ib_cmrc_close ( struct ib_cmrc_connection *cmrc, int rc ) {

	/* Close data transfer interface */
	intf_shutdown ( &cmrc->xfer, rc );

	/* Schedule shutdown process */
	process_add ( &cmrc->shutdown );
}
Exemplo n.º 8
0
/**
 * Shut down and restart an object interface
 *
 * @v intf		Object interface
 * @v rc		Reason for close
 *
 * Shuts down the interface, then unblocks operations that were
 * blocked during shutdown.
 */
void intf_restart ( struct interface *intf, int rc ) {
	struct interface_descriptor *desc = intf->desc;

	/* Shut down the interface */
	intf_shutdown ( intf, rc );

	DBGC ( INTF_COL ( intf ), "INTF " INTF_FMT " restarting\n",
	       INTF_DBG ( intf ) );

	/* Restore the interface descriptor.  Must be done after
	 * shutdown (rather than inhibiting intf_shutdown() from
	 * nullifying the descriptor) in order to avoid a potential
	 * infinite loop as the intf_close() operations on each side
	 * of the link call each other recursively.
	 */
	intf->desc = desc;
}
Exemplo n.º 9
0
Arquivo: fc.c Projeto: 3a9LL/panda
/**
 * Close Fibre Channel exchange
 *
 * @v xchg		Fibre Channel exchange
 * @v rc		Reason for close
 */
static void fc_xchg_close ( struct fc_exchange *xchg, int rc ) {
	struct fc_port *port = xchg->port;

	if ( rc != 0 ) {
		DBGC2 ( port, "FCXCHG %s/%04x closed: %s\n",
			port->name, xchg->xchg_id, strerror ( rc ) );
	}

	/* Stop timer */
	stop_timer ( &xchg->timer );

	/* If list still holds a reference, remove from list of open
	 * exchanges and drop list's reference.
	 */
	if ( ! list_empty ( &xchg->list ) ) {
		list_del ( &xchg->list );
		INIT_LIST_HEAD ( &xchg->list );
		ref_put ( &xchg->refcnt );
	}

	/* Shutdown interfaces */
	intf_shutdown ( &xchg->ulp, rc );
}
Exemplo n.º 10
0
Arquivo: hw.c Projeto: 42wim/ipxe
static void hw_finished ( struct hw *hw, int rc ) {
	intf_shutdown ( &hw->xfer, rc );
	process_del ( &hw->process );
}
Exemplo n.º 11
0
Arquivo: resolv.c Projeto: 42wim/ipxe
static void numeric_step ( struct numeric_resolv *numeric ) {

	if ( numeric->rc == 0 )
		resolv_done ( &numeric->resolv, &numeric->sa );
	intf_shutdown ( &numeric->resolv, numeric->rc );
}
Exemplo n.º 12
0
Arquivo: resolv.c Projeto: 42wim/ipxe
/**
 * Terminate named socket opener
 *
 * @v named		Named socket
 * @v rc		Reason for termination
 */
static void named_close ( struct named_socket *named, int rc ) {
	/* Shut down interfaces */
	intf_shutdown ( &named->resolv, rc );
	intf_shutdown ( &named->xfer, rc );
}