aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-25 17:56:09 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-25 21:41:43 +0200
commit9eebe15cd1309011d43a3490de7fbc973966f120 (patch)
treeaf7b49b5ba14548a0b5977fc0f4e955e50b8f232
parent31e1dab2c00301822e08a33b55698f829919946a (diff)
lib/tun: Remove tun_setaddr() API, as everyone is using tun_addaddr() now
-rw-r--r--lib/tun.c14
-rw-r--r--lib/tun.h3
2 files changed, 0 insertions, 17 deletions
diff --git a/lib/tun.c b/lib/tun.c
index 122d38c..6498945 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -97,20 +97,6 @@ static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_ad
return rc;
}
-int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen)
-{
- struct in_addr netmask;
- switch (addr->len) {
- case 4:
- netmask.s_addr = htonl(0xffffffff << (32 - prefixlen));
- return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask);
- case 16:
- return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen);
- default:
- return -1;
- }
-}
-
static int tun_addaddr4(struct tun_t *this, struct in_addr *addr,
struct in_addr *dstaddr, struct in_addr *netmask)
{
diff --git a/lib/tun.h b/lib/tun.h
index c9e8e34..e41ee69 100644
--- a/lib/tun.h
+++ b/lib/tun.h
@@ -49,9 +49,6 @@ extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len);
extern int tun_addaddr(struct tun_t *this, struct in46_addr *addr,
struct in46_addr *dstaddr, size_t prefixlen);
-extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr,
- struct in46_addr *his_adr, size_t prefixlen);
-
extern int tun_set_cb_ind(struct tun_t *this,
int (*cb_ind) (struct tun_t * tun, void *pack,
unsigned len));