ReactOS
0.4.15-dev-8614-gbc76250
addr.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS DNS Shared Library
4
* FILE: lib/dnslib/addr.c
5
* PURPOSE: Contains the Address Family Information Tables
6
*/
7
8
/* INCLUDES ******************************************************************/
9
#include "precomp.h"
10
11
/* DATA **********************************************************************/
12
13
DNS_FAMILY_INFO
AddrFamilyTable
[3] =
14
{
15
{
16
AF_INET
,
17
DNS_TYPE_A
,
18
sizeof
(
IP4_ADDRESS
),
19
sizeof
(
SOCKADDR_IN
),
20
FIELD_OFFSET
(
SOCKADDR_IN
, sin_addr)
21
},
22
{
23
AF_INET6
,
24
DNS_TYPE_AAAA
,
25
sizeof
(
IP6_ADDRESS
),
26
sizeof
(
SOCKADDR_IN6
),
27
FIELD_OFFSET
(
SOCKADDR_IN6
, sin6_addr)
28
},
29
{
30
AF_ATM
,
31
DNS_TYPE_ATMA
,
32
sizeof
(
ATM_ADDRESS
),
33
sizeof
(
SOCKADDR_ATM
),
34
FIELD_OFFSET
(
SOCKADDR_ATM
, satm_number)
35
}
36
};
37
38
/* FUNCTIONS *****************************************************************/
39
40
PDNS_FAMILY_INFO
41
WINAPI
42
FamilyInfo_GetForFamily
(
IN
WORD
AddressFamily
)
43
{
44
/* Check which family this is */
45
switch
(
AddressFamily
)
46
{
47
case
AF_INET
:
48
/* Return IPv4 Family Info */
49
return
&
AddrFamilyTable
[0];
50
51
case
AF_INET6
:
52
/* Return IPv6 Family Info */
53
return
&
AddrFamilyTable
[1];
54
55
case
AF_ATM
:
56
/* Return ATM Family Info */
57
return
&
AddrFamilyTable
[2];
58
59
default
:
60
/* Invalid family */
61
return
NULL
;
62
}
63
64
}
65
AddrFamilyTable
DNS_FAMILY_INFO AddrFamilyTable[3]
Definition:
addr.c:13
FamilyInfo_GetForFamily
PDNS_FAMILY_INFO WINAPI FamilyInfo_GetForFamily(IN WORD AddressFamily)
Definition:
addr.c:42
NULL
#define NULL
Definition:
types.h:112
AF_INET
#define AF_INET
Definition:
tcpip.h:117
WORD
unsigned short WORD
Definition:
ntddk_ex.h:93
AddressFamily
IN PCO_ADDRESS_FAMILY AddressFamily
Definition:
ndis.h:1906
ATM_ADDRESS
Definition:
ws2atm.h:27
IP6_ADDRESS
Definition:
windns.h:164
_DNS_FAMILY_INFO
Definition:
dnslib.h:74
sockaddr_atm
Definition:
ws2atm.h:78
sockaddr_in6
Definition:
ws2ipdef.h:178
sockaddr_in
Definition:
winsock.h:509
FIELD_OFFSET
#define FIELD_OFFSET(t, f)
Definition:
typedefs.h:255
IN
#define IN
Definition:
typedefs.h:39
DNS_TYPE_ATMA
#define DNS_TYPE_ATMA
Definition:
windns.h:74
IP4_ADDRESS
DWORD IP4_ADDRESS
Definition:
windns.h:36
DNS_TYPE_AAAA
#define DNS_TYPE_AAAA
Definition:
windns.h:68
DNS_TYPE_A
#define DNS_TYPE_A
Definition:
windns.h:41
WINAPI
#define WINAPI
Definition:
msvc.h:6
AF_ATM
#define AF_ATM
Definition:
winsock.h:368
AF_INET6
#define AF_INET6
Definition:
winsock.h:369
sdk
lib
dnslib
addr.c
Generated on Sat Sep 7 2024 06:13:18 for ReactOS by
1.9.6