You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

filter.c 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. */
  18. #include <gpxe/xfer.h>
  19. #include <gpxe/filter.h>
  20. /** @file
  21. *
  22. * Data transfer filters
  23. *
  24. */
  25. /*
  26. * Pass-through methods to be used by filters which don't want to
  27. * intercept all events.
  28. *
  29. */
  30. void filter_close ( struct xfer_interface *xfer, int rc ) {
  31. struct xfer_interface *other = filter_other_half ( xfer );
  32. xfer_close ( other, rc );
  33. }
  34. int filter_vredirect ( struct xfer_interface *xfer, int type,
  35. va_list args ) {
  36. struct xfer_interface *other = filter_other_half ( xfer );
  37. return xfer_vredirect ( other, type, args );
  38. }
  39. size_t filter_window ( struct xfer_interface *xfer ) {
  40. struct xfer_interface *other = filter_other_half ( xfer );
  41. return xfer_window ( other );
  42. }
  43. struct io_buffer * filter_alloc_iob ( struct xfer_interface *xfer,
  44. size_t len ) {
  45. struct xfer_interface *other = filter_other_half ( xfer );
  46. return xfer_alloc_iob ( other, len );
  47. }
  48. int filter_deliver_iob ( struct xfer_interface *xfer, struct io_buffer *iobuf,
  49. struct xfer_metadata *meta ) {
  50. struct xfer_interface *other = filter_other_half ( xfer );
  51. return xfer_deliver_iob_meta ( other, iobuf, meta );
  52. }
  53. int filter_deliver_raw ( struct xfer_interface *xfer, const void *data,
  54. size_t len ) {
  55. struct xfer_interface *other = filter_other_half ( xfer );
  56. return xfer_deliver_raw ( other, data, len );
  57. }