Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement connectioncontext/ethernetcontext/getmac #35

Open
edwarnicke opened this issue Dec 2, 2020 · 0 comments
Open

Implement connectioncontext/ethernetcontext/getmac #35

edwarnicke opened this issue Dec 2, 2020 · 0 comments
Labels
good first issue Good for newcomers

Comments

@edwarnicke
Copy link
Member

edwarnicke commented Dec 2, 2020

The Connection.ConnnectionContext.EthernetContext allows the NSE to specify the Source and Dest Mac address.

Often, the NSE will simply allow vpp itself to set a random Mac address for the interface it is creating. In this case, that Mac address needs to be retrieved to set the EthernetContext.DstMac.

Implementation notes:

  1. You need only implement the NetworkServiceServer in this case.
  2. SwInterfaceGetMacAddress can be used to retrieve the Mac address of the interface given the swIfIndex.
  3. You can retrieve the swIfIndex set by the mechanism chain elements using ifindex.Load. [Example of Use]
  4. Use types.ToVPPMacAddress to convert net.HardwareAddr to the govpp ethernet_types.MacAddress
  5. Once implemented, please add to the connectioncontext/client.go and connectioncontext/server.go.

Running end to end can be done using cmd-forwarder-vpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant