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.1KB

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