xref: /netbsd-src/external/bsd/ipf/dist/lib/vtof.c (revision bc4097aacfdd9307c19b7947c13c6ad6982527a9)
1*bc4097aaSchristos /*	$NetBSD: vtof.c,v 1.1.1.1 2012/03/23 21:20:10 christos Exp $	*/
2*bc4097aaSchristos 
3*bc4097aaSchristos #include "ipf.h"
4*bc4097aaSchristos 
5*bc4097aaSchristos int
vtof(version)6*bc4097aaSchristos vtof(version)
7*bc4097aaSchristos 	int version;
8*bc4097aaSchristos {
9*bc4097aaSchristos #ifdef USE_INET6
10*bc4097aaSchristos 	if (version == 6)
11*bc4097aaSchristos 		return AF_INET6;
12*bc4097aaSchristos #endif
13*bc4097aaSchristos 	if (version == 4)
14*bc4097aaSchristos 		return AF_INET;
15*bc4097aaSchristos 	if (version == 0)
16*bc4097aaSchristos 		return AF_UNSPEC;
17*bc4097aaSchristos 	return -1;
18*bc4097aaSchristos }
19