}
func (vpp *VppInstance) createAfPacket(
- netInterface NetInterface,
+ veth *NetInterface,
) (interface_types.InterfaceIndex, error) {
- veth := netInterface.(*NetworkInterfaceVeth)
-
createReq := &af_packet.AfPacketCreateV2{
UseRandomHwAddr: true,
HostIfName: veth.Name(),
if veth.AddressWithPrefix() == (AddressWithPrefix{}) {
var err error
var ip4Address string
- if ip4Address, err = veth.addresser.NewIp4Address(veth.peerNetworkNumber); err == nil {
+ if ip4Address, err = veth.addresser.NewIp4Address(veth.Peer().networkNumber); err == nil {
veth.SetAddress(ip4Address)
} else {
return 0, err
}
func (vpp *VppInstance) createTap(
- hostInterfaceName string,
- hostIp4Address IP4AddressWithPrefix,
- vppIp4Address AddressWithPrefix,
+ id uint32,
+ tap *NetInterface,
) error {
createTapReq := &tapv2.TapCreateV2{
+ ID: id,
HostIfNameSet: true,
- HostIfName: hostInterfaceName,
+ HostIfName: tap.Name(),
HostIP4PrefixSet: true,
- HostIP4Prefix: hostIp4Address,
+ HostIP4Prefix: tap.IP4AddressWithPrefix(),
}
createTapReply := &tapv2.TapCreateV2Reply{}
addAddressReq := &interfaces.SwInterfaceAddDelAddress{
IsAdd: true,
SwIfIndex: createTapReply.SwIfIndex,
- Prefix: vppIp4Address,
+ Prefix: tap.Peer().AddressWithPrefix(),
}
addAddressReply := &interfaces.SwInterfaceAddDelAddressReply{}