From 65bc070b05a2ae43a45d3fdf4a2579280f1623cc Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 22 Jun 2010 19:12:40 +0100 Subject: [interface] Allow for non-pass-through interface methods xfer_vredirect() should not be allowed to propagate to a pass-through interface. For example, when an HTTPS connection is opened, the redirect message should cause the TLS layer to reopen the TCP socket, rather than causing the HTTP layer to disconnect from the TLS layer. Fix by allowing for non-pass-through interface methods, and setting xfer_vredirect() to be one such method. This is slightly ugly, in that it complicates the notion of an interface method call by adding a "pass-through" / "non-pass-through" piece of metadata. However, the only current user of xfer_vredirect() is iscsi.c, which uses it only because we don't yet have an ioctl()-style call for retrieving the underlying socket address. The new interface infrastructure allows for such a call to be created, at which time this sole user of xfer_vredirect() can be removed, xfer_vredirect() can cease to be an interface method and become simply a wrapper around xfer_vreopen(), and the concept of a non-pass-through interface method can be reverted. Signed-off-by: Michael Brown --- src/include/ipxe/interface.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/include/ipxe/interface.h') diff --git a/src/include/ipxe/interface.h b/src/include/ipxe/interface.h index 49add3306..a474aaad0 100644 --- a/src/include/ipxe/interface.h +++ b/src/include/ipxe/interface.h @@ -132,6 +132,9 @@ extern void intf_nullify ( struct interface *intf ); extern struct interface * intf_get ( struct interface *intf ); extern void intf_put ( struct interface *intf ); extern void * __attribute__ (( pure )) intf_object ( struct interface *intf ); +extern void * intf_get_dest_op_no_passthru_untyped ( struct interface *intf, + void *type, + struct interface **dest ); extern void * intf_get_dest_op_untyped ( struct interface *intf, void *type, struct interface **dest ); @@ -171,6 +174,18 @@ static inline void intf_init ( struct interface *intf, .desc = &(descriptor), \ } +/** + * Get object interface destination and operation method (without pass-through) + * + * @v intf Object interface + * @v type Operation type + * @ret dest Destination interface + * @ret func Implementing method, or NULL + */ +#define intf_get_dest_op_no_passthru( intf, type, dest ) \ + ( ( type ## _TYPE ( void * ) * ) \ + intf_get_dest_op_no_passthru_untyped ( intf, type, dest ) ) + /** * Get object interface destination and operation method * -- cgit