diff options
author | Matus Fabian <matfabia@cisco.com> | 2024-06-04 19:00:00 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-06-13 06:35:26 +0000 |
commit | 82ad9660becfcdd93c906d909d7e478733c5fbbe (patch) | |
tree | 9eb2615037a0e49d87ed73dc2ca8447eeeafc32c /extras/hs-test/vppinstance.go | |
parent | eaa7d91ad77f9c6691b42b0e9f631166b4bcf44f (diff) |
http: return more than url to server app
Provide all bytes as received from transport as data in the http
message to server. Additionally provide offset and length of target
path, target query, headers and body. Offers apis for parsing of
headers, percent decoding, target path/query syntax verification.
Type: improvement
Change-Id: Idbe6f13afa378650cc5212ea7d3f9319183ebbbe
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/vppinstance.go')
-rw-r--r-- | extras/hs-test/vppinstance.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/extras/hs-test/vppinstance.go b/extras/hs-test/vppinstance.go index 8a92776894c..4b2c7551034 100644 --- a/extras/hs-test/vppinstance.go +++ b/extras/hs-test/vppinstance.go @@ -3,7 +3,9 @@ package main import ( "context" "fmt" + "go.fd.io/govpp/binapi/ethernet_types" "io" + "net" "os" "os/exec" "os/signal" @@ -64,6 +66,7 @@ plugins { plugin tlsopenssl_plugin.so { enable } plugin ping_plugin.so { enable } plugin nsim_plugin.so { enable } + plugin mactime_plugin.so { enable } } logging { @@ -395,6 +398,21 @@ func (vpp *VppInstance) createTap( if err = api.RetvalToVPPApiError(reply.Retval); err != nil { return err } + tap.peer.index = reply.SwIfIndex + + // Get name and mac + if err := vpp.apiStream.SendMsg(&interfaces.SwInterfaceDump{ + SwIfIndex: reply.SwIfIndex, + }); err != nil { + return err + } + replymsg, err = vpp.apiStream.RecvMsg() + if err != nil { + return err + } + ifDetails := replymsg.(*interfaces.SwInterfaceDetails) + tap.peer.name = ifDetails.InterfaceName + tap.peer.hwAddress = ifDetails.L2Address // Add address addAddressReq := &interfaces.SwInterfaceAddDelAddress{ @@ -421,7 +439,6 @@ func (vpp *VppInstance) createTap( SwIfIndex: reply.SwIfIndex, Flags: interface_types.IF_STATUS_API_FLAG_ADMIN_UP, } - vpp.getSuite().log("set tap interface " + tap.Name() + " up") if err := vpp.apiStream.SendMsg(upReq); err != nil { return err @@ -435,6 +452,12 @@ func (vpp *VppInstance) createTap( return err } + // Get host mac + netIntf, err := net.InterfaceByName(tap.Name()) + if err == nil { + tap.hwAddress, _ = ethernet_types.ParseMacAddress(netIntf.HardwareAddr.String()) + } + return nil } |