reactos/lib/dnslib/addr.c
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

66 lines
1.5 KiB
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS DNS Shared Library
* FILE: lib/dnslib/addr.c
* PURPOSE: Contains the Address Family Information Tables
*/
/* INCLUDES ******************************************************************/
#include "precomp.h"
/* DATA **********************************************************************/
DNS_FAMILY_INFO AddrFamilyTable[3] =
{
{
AF_INET,
DNS_TYPE_A,
sizeof(IP4_ADDRESS),
sizeof(SOCKADDR_IN),
FIELD_OFFSET(SOCKADDR_IN, sin_addr)
},
{
AF_INET6,
DNS_TYPE_AAAA,
sizeof(IP6_ADDRESS),
sizeof(SOCKADDR_IN6),
FIELD_OFFSET(SOCKADDR_IN6, sin6_addr)
},
{
AF_ATM,
DNS_TYPE_ATMA,
sizeof(ATM_ADDRESS),
sizeof(SOCKADDR_ATM),
FIELD_OFFSET(SOCKADDR_ATM, satm_number)
}
};
/* FUNCTIONS *****************************************************************/
PDNS_FAMILY_INFO
WINAPI
FamilyInfo_GetForFamily(IN WORD AddressFamily)
{
/* Check which family this is */
switch (AddressFamily)
{
case AF_INET:
/* Return IPv4 Family Info */
return &AddrFamilyTable[0];
case AF_INET6:
/* Return IPv6 Family Info */
return &AddrFamilyTable[1];
case AF_ATM:
/* Return ATM Family Info */
return &AddrFamilyTable[2];
default:
/* Invalid family */
return NULL;
}
}