Exemple #1
0
func handleEthernetFlowKeyOptions(flow odp.FlowSpec, src string, dst string) error {
	var err error
	takeErr := func(key [ETH_ALEN]byte, mask [ETH_ALEN]byte,
		e error) ([ETH_ALEN]byte, [ETH_ALEN]byte) {
		err = e
		return key, mask
	}

	fk := odp.NewEthernetFlowKey()

	fk.SetMaskedEthSrc(takeErr(handleEthernetAddrOption(src)))
	fk.SetMaskedEthDst(takeErr(handleEthernetAddrOption(dst)))

	if err != nil {
		return err
	}

	flow.AddKey(fk)
	return nil
}
Exemple #2
0
func (fop odpFlowKeyFlowOp) updateFlowSpec(flow *odp.FlowSpec) {
	flow.AddKey(fop.key)
}