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.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _GPXE_FILTER_H
  2. #define _GPXE_FILTER_H
  3. /** @file
  4. *
  5. * Filter streams
  6. */
  7. #include <gpxe/stream.h>
  8. /** A filter stream */
  9. struct filter_stream {
  10. /** Downstream
  11. *
  12. * This is the end pointing towards the bottom-level
  13. * connection (e.g. TCP).
  14. */
  15. struct stream_application downstream;
  16. /** Upstream
  17. *
  18. * This is the end pointing towards the top-level application
  19. * (e.g. HTTP).
  20. */
  21. struct stream_connection upstream;
  22. };
  23. extern void filter_connected ( struct stream_application *app );
  24. extern void filter_closed ( struct stream_application *app, int rc );
  25. extern void filter_senddata ( struct stream_application *app,
  26. void *data, size_t len );
  27. extern void filter_acked ( struct stream_application *app, size_t len );
  28. extern void filter_newdata ( struct stream_application *app,
  29. void *data, size_t len );
  30. extern int filter_bind ( struct stream_connection *conn,
  31. struct sockaddr *local );
  32. extern int filter_connect ( struct stream_connection *conn,
  33. struct sockaddr *peer );
  34. extern void filter_close ( struct stream_connection *conn );
  35. extern int filter_send ( struct stream_connection *conn,
  36. void *data, size_t len );
  37. extern int filter_kick ( struct stream_connection *conn );
  38. extern int insert_filter ( struct stream_application *app,
  39. struct filter_stream *filter );
  40. #endif /* _GPXE_FILTER_H */