Plumb injectPacketFromHost through to API.
This commit is contained in:
parent
6ab7b1b915
commit
351db7f1a0
5 changed files with 82 additions and 1 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue