2 * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #include <gpxe/xfer.h>
20 #include <gpxe/filter.h>
24 * Data transfer filters
29 * Pass-through methods to be used by filters which don't want to
30 * intercept all events.
34 void filter_close ( struct xfer_interface *xfer, int rc ) {
35 struct xfer_interface *other = filter_other_half ( xfer );
37 xfer_close ( other, rc );
40 int filter_vredirect ( struct xfer_interface *xfer, int type,
42 struct xfer_interface *other = filter_other_half ( xfer );
44 return xfer_vredirect ( other, type, args );
47 int filter_seek ( struct xfer_interface *xfer, off_t offset, int whence ) {
48 struct xfer_interface *other = filter_other_half ( xfer );
50 return xfer_seek ( other, offset, whence );
53 size_t filter_window ( struct xfer_interface *xfer ) {
54 struct xfer_interface *other = filter_other_half ( xfer );
56 return xfer_window ( other );
59 struct io_buffer * filter_alloc_iob ( struct xfer_interface *xfer,
61 struct xfer_interface *other = filter_other_half ( xfer );
63 return xfer_alloc_iob ( other, len );
66 int filter_deliver_iob ( struct xfer_interface *xfer, struct io_buffer *iobuf,
67 struct xfer_metadata *meta ) {
68 struct xfer_interface *other = filter_other_half ( xfer );
70 return xfer_deliver_iob_meta ( other, iobuf, meta );
73 int filter_deliver_raw ( struct xfer_interface *xfer, const void *data,
75 struct xfer_interface *other = filter_other_half ( xfer );
77 return xfer_deliver_raw ( other, data, len );