Subversion Repositories Kolibri OS

Rev

Rev 9620 | Rev 9811 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef KOLIBRI_NETWORK_H
  2. #define KOLIBRI_NETWORK_H
  3.  
  4. #include <sys/socket.h>
  5. #include <sys/ksys.h>
  6.  
  7. #define EAI_ADDRFAMILY 1
  8. #define EAI_AGAIN      2
  9. #define EAI_BADFLAGS   3
  10. #define EAI_FAIL       4
  11. #define EAI_FAMILY     5
  12. #define EAI_MEMORY     6
  13. #define EAI_NONAME     8
  14. #define EAI_SERVICE    9
  15. #define EAI_SOCKTYPE   10
  16. #define EAI_BADHINTS   12
  17. #define EAI_PROTOCOL   13
  18. #define EAI_OVERFLOW   14
  19.  
  20. // Flags for addrinfo
  21. #define AI_PASSIVE     1
  22. #define AI_CANONNAME   2
  23. #define AI_NUMERICHOST 4
  24. #define AI_NUMERICSERV 8
  25. #define AI_ADDRCONFIG  0x400
  26.  
  27. #pragma pack(push, 1)
  28. struct ARP_entry{
  29. unsigned int IP;
  30. unsigned char MAC[6];
  31. unsigned short status;
  32. unsigned short TTL;
  33. };
  34. #pragma pack(pop)
  35.  
  36. #pragma pack(push, 1)  
  37. struct addrinfo {
  38.     int     ai_flags;
  39.     int     ai_family;
  40.     int     ai_socktype;
  41.     int     ai_protocol;
  42.     int     ai_addrlen;
  43.     char   *ai_canonname;
  44.     struct sockaddr *ai_addr;
  45.     struct addrinfo *ai_next;
  46. };  
  47. #pragma pack(pop)
  48.  
  49. DLLAPI int __stdcall inet_addr(const char* hostname);
  50. DLLAPI char* __stdcall inet_ntoa(int ip_addr);
  51. DLLAPI int __stdcall getaddrinfo(const char* hostname, const char* servname, const struct addrinfo* hints, struct addrinfo** res);
  52. DLLAPI void __stdcall freeaddrinfo(struct addrinfo* ai);
  53.  
  54. #endif
  55.