Subversion Repositories Kolibri OS

Rev

Rev 9811 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9620 turbocat 1
#ifndef KOLIBRI_NETWORK_H
2
#define KOLIBRI_NETWORK_H
8687 turbocat 3
 
4
#include 
5
#include 
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
 
9812 Coldy 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);
8687 turbocat 53
 
54
#endif