address.h 965 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. *
  4. * Authors: Mike Sperber, Marcus Crestani
  5. */
  6. #ifndef __NET_ADDRESS_H__
  7. #define __NET_ADDRESS_H__
  8. #ifdef _WIN32
  9. #include <winsock2.h>
  10. #include <mswsock.h>
  11. typedef int sa_family_t;
  12. typedef unsigned char uint8_t;
  13. #else
  14. #include <sys/types.h>
  15. #include <sys/socket.h>
  16. #include <netinet/in.h>
  17. #endif
  18. #include <scheme48.h>
  19. extern sa_family_t s48_extract_af(s48_call_t call, s48_ref_t sch_af_val);
  20. extern s48_ref_t s48_enter_af(s48_call_t call, sa_family_t af);
  21. extern int s48_extract_socket_type(s48_call_t call, s48_ref_t sch_socktype);
  22. extern s48_ref_t s48_enter_socket_type(s48_call_t call, int socktype);
  23. extern s48_ref_t s48_enter_sockaddr(s48_call_t call, const struct sockaddr* sa, socklen_t salen);
  24. extern s48_ref_t s48_enter_in6_addr(s48_call_t call, const struct in6_addr* addr);
  25. extern void s48_extract_in6_addr(s48_call_t call, s48_ref_t sch_addr, struct in6_addr* addr);
  26. #endif