go-openvswitch
go-openvswitch copied to clipboard
ovs: ability to set VLAN tag on port
Hi. I want to use the vSwitch client to add the port with the vlan tag.
I saw the original AddPort method only accept the interface name but no more options.
https://github.com/digitalocean/go-openvswitch/blob/813765f6db709e0aa0a8d837eac1d3c1518824d0/ovs/vswitch.go#L54-L57
Thanks.
I wasn't even aware of this option until now. To clarify, can you not accomplish the same thing by pushing/popping VLANs with flows?
In some scenario, we use the normal action to do the simple L2 forwarding and we will use the trunk for some ports and tag for some ports.
It's not convenient to use the flow to push/pop vlang when we use the normal action to forward packets.
I think I would prefer to add this alongside the other "ovs-vsctl set" methods in this structure: https://github.com/digitalocean/go-openvswitch/blob/master/ovs/vswitch.go#L182 for consistency, rather than adding more parameters to AddPort immediately. PRs are welcome.
Please have a look. #57