diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-03 00:47:03 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-08-11 13:12:04 +0200 |
commit | 2e48a44952fdc68eb3e5d3680f944507a4a129c1 (patch) | |
tree | 70ea7d0783c3a5ade0083442a08b7cafea087d04 /lib/tun.h | |
parent | 72a38b55e38407aa6c6b1cd32f848198ceee1287 (diff) |
Support setting TUN device IPv6 address + prefix
As we can now have PDP contexts with IPv6 user IP payload,
it is useful to extend the TUN related code to be able to
configure the tun device IPv6 address + prefix length
Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
Diffstat (limited to 'lib/tun.h')
-rw-r--r-- | lib/tun.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte <laforge@gnumonks.org> * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -12,6 +13,8 @@ #ifndef _TUN_H #define _TUN_H +#include "../lib/in46_addr.h" + #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 #define TUN_ADDRSIZE 128 @@ -66,8 +69,8 @@ extern int tun_encaps(struct tun_t *tun, void *pack, unsigned len); extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); |