buffers_net.h 1013 B

12345678910111213141516171819202122232425262728293031323334
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file buffers_net.h
  8. *
  9. * \brief Header file for buffers_net.c.
  10. **/
  11. #ifndef TOR_BUFFERS_NET_H
  12. #define TOR_BUFFERS_NET_H
  13. #include <stddef.h>
  14. #include "lib/net/socket.h"
  15. struct buf_t;
  16. int buf_read_from_socket(struct buf_t *buf, tor_socket_t s, size_t at_most,
  17. int *reached_eof,
  18. int *socket_error);
  19. int buf_flush_to_socket(struct buf_t *buf, tor_socket_t s, size_t sz,
  20. size_t *buf_flushlen);
  21. int buf_read_from_pipe(struct buf_t *buf, int fd, size_t at_most,
  22. int *reached_eof,
  23. int *socket_error);
  24. int buf_flush_to_pipe(struct buf_t *buf, int fd, size_t sz,
  25. size_t *buf_flushlen);
  26. #endif /* !defined(TOR_BUFFERS_H) */