socket.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef SCM_SOCKET_H
  2. #define SCM_SOCKET_H
  3. /* Copyright 1995-1997,2000-2001,2004-2006,2008,2014,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include "libguile/scm.h"
  18. SCM_API SCM scm_inet_aton (SCM address);
  19. SCM_API SCM scm_inet_ntoa (SCM inetid);
  20. SCM_API SCM scm_inet_netof (SCM address);
  21. SCM_API SCM scm_lnaof (SCM address);
  22. SCM_API SCM scm_inet_makeaddr (SCM net, SCM lna);
  23. SCM_API SCM scm_inet_pton (SCM family, SCM address);
  24. SCM_API SCM scm_inet_ntop (SCM family, SCM address);
  25. SCM_API SCM scm_socket (SCM family, SCM style, SCM proto);
  26. SCM_API SCM scm_socketpair (SCM family, SCM style, SCM proto);
  27. SCM_API SCM scm_getsockopt (SCM sfd, SCM level, SCM optname);
  28. SCM_API SCM scm_setsockopt (SCM sfd, SCM level, SCM optname, SCM value);
  29. SCM_API SCM scm_shutdown (SCM sfd, SCM how);
  30. SCM_API SCM scm_connect (SCM sockfd, SCM fam, SCM address, SCM args);
  31. SCM_API SCM scm_bind (SCM sockfd, SCM fam, SCM address, SCM args);
  32. SCM_API SCM scm_listen (SCM sfd, SCM backlog);
  33. SCM_INTERNAL SCM scm_accept4 (SCM sockfd, SCM flags);
  34. SCM_API SCM scm_accept (SCM sockfd);
  35. SCM_API SCM scm_getsockname (SCM sockfd);
  36. SCM_API SCM scm_getpeername (SCM sockfd);
  37. SCM_API SCM scm_recv (SCM sockfd, SCM buff_or_size, SCM flags);
  38. SCM_API SCM scm_send (SCM sockfd, SCM message, SCM flags);
  39. SCM_API SCM scm_recvfrom (SCM sockfd, SCM buff_or_size, SCM flags, SCM offset, SCM length);
  40. SCM_API SCM scm_sendto (SCM sockfd, SCM message, SCM fam, SCM address, SCM args_and_flags);
  41. SCM_INTERNAL void scm_init_socket (void);
  42. /* Wrapping/unwrapping address objects. */
  43. struct sockaddr;
  44. SCM_API SCM scm_from_sockaddr (const struct sockaddr *address,
  45. unsigned addr_size);
  46. SCM_API struct sockaddr *scm_to_sockaddr (SCM address, size_t *adress_size);
  47. SCM_API struct sockaddr *scm_c_make_socket_address (SCM family, SCM address,
  48. SCM args,
  49. size_t *address_size);
  50. SCM_API SCM scm_make_socket_address (SCM family, SCM address, SCM args);
  51. #endif /* SCM_SOCKET_H */