diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-10-30 20:42:12 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-10-30 20:42:12 +0000 |
commit | 4c4ecf9baa584933b6cc9b4823641aacbbb34cfc (patch) | |
tree | 803f6c7ea66ae5a9544466e7b1d3b82ab3d24e5a /sbin/ipsecctl/parse.y | |
parent | 3dfe578b823f39090b6b6ff69d486a2d09f0a619 (diff) |
prepare for more flexible hostname resolver. Right now just v4, more to come
(if groups, v6, dns).
Diffstat (limited to 'sbin/ipsecctl/parse.y')
-rw-r--r-- | sbin/ipsecctl/parse.y | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y index aefada102e8..74bc45cd570 100644 --- a/sbin/ipsecctl/parse.y +++ b/sbin/ipsecctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.30 2005/10/30 19:50:23 hshoexer Exp $ */ +/* $OpenBSD: parse.y,v 1.31 2005/10/30 20:42:11 hshoexer Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -113,9 +113,6 @@ struct ipsec_key *parsekey(unsigned char *, size_t); struct ipsec_key *parsekeyfile(char *); struct ipsec_addr *host(const char *); struct ipsec_addr *host_v4(const char *, int); -#if 0 -struct ipsec_addr *host_if(const char *, int); -#endif struct ipsec_addr *copyhost(const struct ipsec_addr *); const struct ipsec_xf *parse_xf(const char *, const struct ipsec_xf *); struct ipsec_transforms *transforms(const char *, const char *, const char *); @@ -1017,7 +1014,6 @@ host(const char *s) int mask, v4mask, cont = 1; char *p, *q, *ps; - /* XXX for now only AF_INET. */ if ((p = strrchr(s, '/')) != NULL) { mask = strtol(p + 1, &q, 0); if (!q || *q || mask > 32 || q == (p + 1)) @@ -1033,9 +1029,21 @@ host(const char *s) mask = -1; } +#if notyet + /* Does interface with this name exist? */ + if (cont && (ipa = host_if(ps, mask)) != NULL) + cont = 0; +#endif + /* IPv4 address? */ if (cont && (ipa = host_v4(s, mask)) != NULL) cont = 0; + +#if notyet + /* IPv6 address? */ + if (cont && (ipa = host_dsn(ps, v4mask, 0)) != NULL) + cont = 0; +#endif free(ps); if (ipa == NULL || cont == 1) { |