ReactOS 0.4.15-dev-5664-g3bf4ef6
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
14{
15 {
16 AF_INET,
18 sizeof(IP4_ADDRESS),
19 sizeof(SOCKADDR_IN),
20 FIELD_OFFSET(SOCKADDR_IN, sin_addr)
21 },
22 {
25 sizeof(IP6_ADDRESS),
26 sizeof(SOCKADDR_IN6),
27 FIELD_OFFSET(SOCKADDR_IN6, sin6_addr)
28 },
29 {
30 AF_ATM,
32 sizeof(ATM_ADDRESS),
33 sizeof(SOCKADDR_ATM),
34 FIELD_OFFSET(SOCKADDR_ATM, satm_number)
35 }
36};
37
38/* FUNCTIONS *****************************************************************/
39
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
DNS_FAMILY_INFO AddrFamilyTable[3]
Definition: addr.c:13
PDNS_FAMILY_INFO WINAPI FamilyInfo_GetForFamily(IN WORD AddressFamily)
Definition: addr.c:42
#define NULL
Definition: types.h:112
#define AF_INET
Definition: tcpip.h:117
unsigned short WORD
Definition: ntddk_ex.h:93
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define IN
Definition: typedefs.h:39
#define DNS_TYPE_ATMA
Definition: windns.h:74
DWORD IP4_ADDRESS
Definition: windns.h:36
#define DNS_TYPE_AAAA
Definition: windns.h:68
#define DNS_TYPE_A
Definition: windns.h:41
#define WINAPI
Definition: msvc.h:6
#define AF_ATM
Definition: winsock.h:368
#define AF_INET6
Definition: winsock.h:369