mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-21 00:23:05 +00:00
Plumb injectPacketFromHost through to API.
This commit is contained in:
@ -328,6 +328,24 @@ public:
|
||||
t->put(from,to,etherType,data,len);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call injectPacketFromHost() on tap if it exists
|
||||
*
|
||||
* @param from Source MAC
|
||||
* @param to Destination MAC
|
||||
* @param etherType Ethernet frame type
|
||||
* @param data Packet data
|
||||
* @param len Packet length
|
||||
*/
|
||||
inline bool tapInjectPacketFromHost(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
EthernetTap *t = _tap;
|
||||
if (t)
|
||||
return t->injectPacketFromHost(from,to,etherType,data,len);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Tap device name or empty string if still initializing
|
||||
*/
|
||||
|
Reference in New Issue
Block a user