filter.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 FILE_LICENCE ( GPL2_OR_LATER );
00020 
00021 #include <gpxe/xfer.h>
00022 #include <gpxe/filter.h>
00023 
00024 /** @file
00025  *
00026  * Data transfer filters
00027  *
00028  */
00029 
00030 /*
00031  * Pass-through methods to be used by filters which don't want to
00032  * intercept all events.
00033  *
00034  */
00035 
00036 void filter_close ( struct xfer_interface *xfer, int rc ) {
00037         struct xfer_interface *other = filter_other_half ( xfer );
00038 
00039         xfer_close ( other, rc );
00040 }
00041 
00042 int filter_vredirect ( struct xfer_interface *xfer, int type,
00043                         va_list args ) {
00044         struct xfer_interface *other = filter_other_half ( xfer );
00045 
00046         return xfer_vredirect ( other, type, args );
00047 }
00048 
00049 size_t filter_window ( struct xfer_interface *xfer ) {
00050         struct xfer_interface *other = filter_other_half ( xfer );
00051 
00052         return xfer_window ( other );
00053 }
00054 
00055 struct io_buffer * filter_alloc_iob ( struct xfer_interface *xfer,
00056                                       size_t len ) {
00057         struct xfer_interface *other = filter_other_half ( xfer );
00058 
00059         return xfer_alloc_iob ( other, len );
00060 }
00061 
00062 int filter_deliver_iob ( struct xfer_interface *xfer, struct io_buffer *iobuf,
00063                          struct xfer_metadata *meta ) {
00064         struct xfer_interface *other = filter_other_half ( xfer );
00065 
00066         return xfer_deliver_iob_meta ( other, iobuf, meta );
00067 }
00068 
00069 int filter_deliver_raw ( struct xfer_interface *xfer, const void *data,
00070                          size_t len ) {
00071         struct xfer_interface *other = filter_other_half ( xfer );
00072 
00073         return xfer_deliver_raw ( other, data, len );
00074 }

Generated on Tue Apr 6 20:00:51 2010 for gPXE by  doxygen 1.5.7.1