diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-07-30 20:40:28 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-07-30 20:40:28 +0000 |
commit | a8768281c993f0c711aec708d76d13c65ffc1949 (patch) | |
tree | 045f6c1764579d637ce1b1ecb702d4caee0989ce /libexec/tftp-proxy | |
parent | 8dad4f18d12e7c6593c5e8ec5e776746fbfa379e (diff) |
Remove unused add_nat() function, ok jcs@
Diffstat (limited to 'libexec/tftp-proxy')
-rw-r--r-- | libexec/tftp-proxy/filter.c | 36 | ||||
-rw-r--r-- | libexec/tftp-proxy/filter.h | 4 |
2 files changed, 2 insertions, 38 deletions
diff --git a/libexec/tftp-proxy/filter.c b/libexec/tftp-proxy/filter.c index 61b3a1756bb..89a7d358cd0 100644 --- a/libexec/tftp-proxy/filter.c +++ b/libexec/tftp-proxy/filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.c,v 1.2 2007/06/23 15:51:21 jcs Exp $ */ +/* $OpenBSD: filter.c,v 1.3 2009/07/30 20:40:27 sthen Exp $ */ /* * Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl> @@ -78,40 +78,6 @@ add_filter(u_int32_t id, u_int8_t dir, struct sockaddr *src, } int -add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, - u_int16_t d_port, struct sockaddr *nat, u_int16_t nat_range_low, - u_int16_t nat_range_high, u_int8_t proto) -{ - if (!src || !dst || !d_port || !nat || !nat_range_low || !proto || - (src->sa_family != nat->sa_family)) { - errno = EINVAL; - return (-1); - } - - if (prepare_rule(id, PF_RULESET_NAT, src, dst, d_port, proto) == -1) - return (-1); - - if (nat->sa_family == AF_INET) { - memcpy(&pfp.addr.addr.v.a.addr.v4, - &satosin(nat)->sin_addr.s_addr, 4); - memset(&pfp.addr.addr.v.a.mask.addr8, 255, 4); - } else { - memcpy(&pfp.addr.addr.v.a.addr.v6, - &satosin6(nat)->sin6_addr.s6_addr, 16); - memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); - } - if (ioctl(dev, DIOCADDADDR, &pfp) == -1) - return (-1); - - pfr.rule.rpool.proxy_port[0] = nat_range_low; - pfr.rule.rpool.proxy_port[1] = nat_range_high; - if (ioctl(dev, DIOCADDRULE, &pfr) == -1) - return (-1); - - return (0); -} - -int add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, u_int16_t d_port, struct sockaddr *rdr, u_int16_t rdr_port, u_int8_t proto) { diff --git a/libexec/tftp-proxy/filter.h b/libexec/tftp-proxy/filter.h index 04d43f737cb..bc0e6081f8d 100644 --- a/libexec/tftp-proxy/filter.h +++ b/libexec/tftp-proxy/filter.h @@ -1,4 +1,4 @@ -/* $OpenBSD: filter.h,v 1.1 2005/12/28 19:07:07 jcs Exp $ */ +/* $OpenBSD: filter.h,v 1.2 2009/07/30 20:40:27 sthen Exp $ */ /* * Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl> @@ -20,8 +20,6 @@ int add_filter(u_int32_t, u_int8_t, struct sockaddr *, struct sockaddr *, u_int16_t, u_int8_t); -int add_nat(u_int32_t, struct sockaddr *, struct sockaddr *, u_int16_t, - struct sockaddr *, u_int16_t, u_int16_t, u_int8_t); int add_rdr(u_int32_t, struct sockaddr *, struct sockaddr *, u_int16_t, struct sockaddr *, u_int16_t, u_int8_t); int do_commit(void); |