ReactOS  0.4.14-dev-323-g6fe6a88
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,
17  DNS_TYPE_A,
18  sizeof(IP4_ADDRESS),
19  sizeof(SOCKADDR_IN),
20  FIELD_OFFSET(SOCKADDR_IN, sin_addr)
21  },
22  {
23  AF_INET6,
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 
41 WINAPI
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 
#define AF_ATM
Definition: winsock.h:368
#define DNS_TYPE_ATMA
Definition: windns.h:74
#define IN
Definition: typedefs.h:38
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
#define DNS_TYPE_AAAA
Definition: windns.h:68
#define DNS_TYPE_A
Definition: windns.h:41
DNS_FAMILY_INFO AddrFamilyTable[3]
Definition: addr.c:13
DWORD IP4_ADDRESS
Definition: windns.h:36
struct _ATM_ADDRESS ATM_ADDRESS
smooth NULL
Definition: ftsmooth.c:416
#define AF_INET6
Definition: winsock.h:369
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define AF_INET
Definition: tcpip.h:117
PDNS_FAMILY_INFO WINAPI FamilyInfo_GetForFamily(IN WORD AddressFamily)
Definition: addr.c:42