)
type VppInstance struct {
- container *Container
- additionalConfig Stanza
- connection *core.Connection
- apiChannel api.Channel
+ container *Container
+ additionalConfig Stanza
+ connection *core.Connection
+ apiChannel api.Channel
}
func (vpp *VppInstance) Suite() *HstSuite {
// Create startup.conf inside the container
configContent := fmt.Sprintf(
- vppConfigTemplate,
- containerWorkDir,
- defaultCliSocketFilePath,
- defaultApiSocketFilePath,
- )
+ vppConfigTemplate,
+ containerWorkDir,
+ defaultCliSocketFilePath,
+ defaultApiSocketFilePath,
+ )
configContent += vpp.additionalConfig.ToString()
startupFileName := vpp.getEtcDir() + "/startup.conf"
vpp.container.createFile(startupFileName, configContent)
func (vpp *VppInstance) createAfPacket(
netInterface NetInterface,
) (interface_types.InterfaceIndex, error) {
- veth := netInterface.(*NetworkInterfaceVeth)
+ veth := netInterface.(*NetworkInterfaceVeth)
createReq := &af_packet.AfPacketCreateV2{
UseRandomHwAddr: true,
if veth.AddressWithPrefix() == (AddressWithPrefix{}) {
var err error
var ip4Address string
- if veth.peerNetworkNamespace != "" {
- ip4Address, err = veth.addresser.
- NewIp4AddressWithNamespace(veth.peerNetworkNamespace)
- } else {
- ip4Address, err = veth.addresser.
- NewIp4Address()
- }
- if err == nil {
+ if ip4Address, err = veth.addresser.NewIp4Address(veth.peerNetworkNumber); err == nil {
veth.SetAddress(ip4Address)
} else {
return 0, err