getting there...
This commit is contained in:
parent
5e35346f17
commit
2eef9d22e6
11 changed files with 278 additions and 45 deletions
|
@ -661,3 +661,52 @@ extern "C" void ZT_GoTap_setMtu(ZT_GoTap *tap,unsigned int mtu)
|
|||
{
|
||||
reinterpret_cast<EthernetTap *>(tap)->setMtu(mtu);
|
||||
}
|
||||
|
||||
extern "C" int ZT_GoTap_addRoute(ZT_GoTap *tap,int targetAf,const void *targetIp,int targetNetmaskBits,int viaAf,const void *viaIp,unsigned int metric)
|
||||
{
|
||||
InetAddress target,via;
|
||||
switch(targetAf) {
|
||||
case AF_INET:
|
||||
target.set(targetIp,4,(unsigned int)targetNetmaskBits);
|
||||
break;
|
||||
case AF_INET6:
|
||||
target.set(targetIp,16,(unsigned int)targetNetmaskBits);
|
||||
break;
|
||||
}
|
||||
switch(viaAf) {
|
||||
case AF_INET:
|
||||
via.set(viaIp,4,0);
|
||||
break;
|
||||
case AF_INET6:
|
||||
via.set(viaIp,16,0);
|
||||
break;
|
||||
}
|
||||
return reinterpret_cast<EthernetTap *>(tap)->addRoute(target,via,metric);
|
||||
}
|
||||
|
||||
extern "C" int ZT_GoTap_removeRoute(ZT_GoTap *tap,int targetAf,const void *targetIp,int targetNetmaskBits,int viaAf,const void *viaIp,unsigned int metric)
|
||||
{
|
||||
InetAddress target,via;
|
||||
switch(targetAf) {
|
||||
case AF_INET:
|
||||
target.set(targetIp,4,(unsigned int)targetNetmaskBits);
|
||||
break;
|
||||
case AF_INET6:
|
||||
target.set(targetIp,16,(unsigned int)targetNetmaskBits);
|
||||
break;
|
||||
}
|
||||
switch(viaAf) {
|
||||
case AF_INET:
|
||||
via.set(viaIp,4,0);
|
||||
break;
|
||||
case AF_INET6:
|
||||
via.set(viaIp,16,0);
|
||||
break;
|
||||
}
|
||||
return reinterpret_cast<EthernetTap *>(tap)->removeRoute(target,via,metric);
|
||||
}
|
||||
|
||||
extern "C" int ZT_GoTap_syncRoutes(ZT_GoTap *tap)
|
||||
{
|
||||
return reinterpret_cast<EthernetTap *>(tap)->syncRoutes();
|
||||
}
|
||||
|
|
|
@ -91,6 +91,12 @@ void ZT_GoTap_setFriendlyName(ZT_GoTap *tap,const char *friendlyName);
|
|||
|
||||
void ZT_GoTap_setMtu(ZT_GoTap *tap,unsigned int mtu);
|
||||
|
||||
int ZT_GoTap_addRoute(ZT_GoTap *tap,int targetAf,const void *targetIp,int targetNetmaskBits,int viaAf,const void *viaIp,unsigned int metric);
|
||||
|
||||
int ZT_GoTap_removeRoute(ZT_GoTap *tap,int targetAf,const void *targetIp,int targetNetmaskBits,int viaAf,const void *viaIp,unsigned int metric);
|
||||
|
||||
int ZT_GoTap_syncRoutes(ZT_GoTap *tap);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue