Skip to content

Commit

Permalink
feat: IP Flow Information eXport (IPFIX) plugin (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii authored May 13, 2020
1 parent a8f52a6 commit d9b6dd4
Show file tree
Hide file tree
Showing 47 changed files with 4,753 additions and 0 deletions.
9 changes: 9 additions & 0 deletions clientv2/linux/data_change_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
vpp_abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
vpp_acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
vpp_interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
vpp_l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
vpp_l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -125,6 +126,12 @@ type PutDSL interface {
PuntToHost(val *punt.ToHost) PutDSL
// PuntException adds request to create or update exception to punt specific packets.
PuntException(val *punt.Exception) PutDSL
// IPFIX adds a request to update VPP IP Flow Information eXport configuration.
IPFIX(val *ipfix.IPFIX) PutDSL
// FlowprobeParams adds a request to update VPP Flowprobe Params.
FlowprobeParams(val *ipfix.FlowProbeParams) PutDSL
// FlowprobeFeature adds a request to enable Flowprobe Feature on interface.
FlowprobeFeature(val *ipfix.FlowProbeFeature) PutDSL

// Delete changes the DSL mode to allow removing an existing configuration.
// See documentation for DataChangeDSL.Delete().
Expand Down Expand Up @@ -208,6 +215,8 @@ type DeleteDSL interface {
PuntToHost(l3Proto punt.L3Protocol, l4Proto punt.L4Protocol, port uint32) DeleteDSL
// PuntException adds request to delete exception to punt specific packets.
PuntException(reason string) DeleteDSL
// FlowprobeFeature adds a request to disable Flowprobe Feature on interface.
FlowprobeFeature(val *ipfix.FlowProbeFeature) DeleteDSL

// Put changes the DSL mode to allow configuration editing.
// See documentation for DataChangeDSL.Put().
Expand Down
7 changes: 7 additions & 0 deletions clientv2/linux/data_resync_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
vpp_abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
vpp_acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
vpp_interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
vpp_l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
vpp_l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -105,6 +106,12 @@ type DataResyncDSL interface {
PuntToHost(val *punt.ToHost) DataResyncDSL
// PuntException adds request to create or update exception to punt specific packets.
PuntException(val *punt.Exception) DataResyncDSL
// IPFIX adds IPFIX configuration to the RESYNC request.
IPFIX(val *ipfix.IPFIX) DataResyncDSL
// FlowprobeParams adds Flowprobe Params configuration to the RESYNC request.
FlowprobeParams(val *ipfix.FlowProbeParams) DataResyncDSL
// FlowprobeFeature adds Flowprobe Feature configuration to the RESYNC request.
FlowprobeFeature(val *ipfix.FlowProbeFeature) DataResyncDSL

// Send propagates the RESYNC request to the plugins.
Send() vpp_clientv2.Reply
Expand Down
25 changes: 25 additions & 0 deletions clientv2/linux/dbadapter/data_change_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -275,6 +276,24 @@ func (dsl *PutDSL) PuntException(val *punt.Exception) linuxclient.PutDSL {
return dsl
}

// IPFIX adds a request to update VPP IP Flow Information eXport configuration.
func (dsl *PutDSL) IPFIX(val *ipfix.IPFIX) linuxclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// FlowprobeParams adds a request to update VPP Flowprobe Params.
func (dsl *PutDSL) FlowprobeParams(val *ipfix.FlowProbeParams) linuxclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// FlowprobeFeature adds a request to enable Flowprobe Feature on interface.
func (dsl *PutDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) linuxclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// Delete changes the DSL mode to allow removal of an existing configuration.
func (dsl *PutDSL) Delete() linuxclient.DeleteDSL {
return &DeleteDSL{dsl.parent, dsl.vppPut.Delete()}
Expand Down Expand Up @@ -482,6 +501,12 @@ func (dsl *DeleteDSL) PuntException(reason string) linuxclient.DeleteDSL {
return dsl
}

// FlowprobeFeature adds a request to disable Flowprobe Feature on interface.
func (dsl *DeleteDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) linuxclient.DeleteDSL {
dsl.parent.txn.Delete(models.Key(val))
return dsl
}

// Put changes the DSL mode to allow configuration editing.
func (dsl *DeleteDSL) Put() linuxclient.PutDSL {
return &PutDSL{dsl.parent, dsl.vppDelete.Put()}
Expand Down
28 changes: 28 additions & 0 deletions clientv2/linux/dbadapter/data_resync_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -272,6 +273,33 @@ func (dsl *DataResyncDSL) PuntException(val *punt.Exception) linuxclient.DataRes
return dsl
}

// IPFIX adds IPFIX configuration to the RESYNC request.
func (dsl *DataResyncDSL) IPFIX(val *ipfix.IPFIX) linuxclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// FlowprobeParams adds Flowprobe Params configuration to the RESYNC request.
func (dsl *DataResyncDSL) FlowprobeParams(val *ipfix.FlowProbeParams) linuxclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// FlowprobeFeature adds Flowprobe Feature configuration to the RESYNC request.
func (dsl *DataResyncDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) linuxclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// AppendKeys is a helper function that fills the keySet <keys> with values
// pointed to by the iterator <it>.
func appendKeys(keys *keySet, it keyval.ProtoKeyIterator) {
Expand Down
9 changes: 9 additions & 0 deletions clientv2/vpp/data_change_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -99,6 +100,12 @@ type PutDSL interface {
PuntToHost(val *punt.ToHost) PutDSL
// PuntException adds request to create or update exception to punt specific packets.
PuntException(val *punt.Exception) PutDSL
// IPFIX adds a request to update VPP IP Flow Information eXport configuration.
IPFIX(val *ipfix.IPFIX) PutDSL
// FlowprobeParams adds a request to update VPP Flowprobe Params.
FlowprobeParams(val *ipfix.FlowProbeParams) PutDSL
// FlowprobeFeature adds a request to enable Flowprobe Feature on interface.
FlowprobeFeature(val *ipfix.FlowProbeFeature) PutDSL

// Delete changes the DSL mode to allow removal of an existing configuration.
// See documentation for DataChangeDSL.Delete().
Expand Down Expand Up @@ -158,6 +165,8 @@ type DeleteDSL interface {
PuntToHost(l3Proto punt.L3Protocol, l4Proto punt.L4Protocol, port uint32) DeleteDSL
// PuntException adds request to delete exception to punt specific packets.
PuntException(reason string) DeleteDSL
// FlowprobeFeature adds a request to disable Flowprobe Feature on interface.
FlowprobeFeature(val *ipfix.FlowProbeFeature) DeleteDSL

// Put changes the DSL mode to allow configuration editing.
// See documentation for DataChangeDSL.Put().
Expand Down
7 changes: 7 additions & 0 deletions clientv2/vpp/data_resync_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -79,6 +80,12 @@ type DataResyncDSL interface {
PuntToHost(val *punt.ToHost) DataResyncDSL
// PuntException adds request to create or update exception to punt specific packets.
PuntException(val *punt.Exception) DataResyncDSL
// IPFIX adds IPFIX configuration to the RESYNC request.
IPFIX(val *ipfix.IPFIX) DataResyncDSL
// FlowprobeParams adds Flowprobe Params configuration to the RESYNC request.
FlowprobeParams(val *ipfix.FlowProbeParams) DataResyncDSL
// FlowprobeFeature adds Flowprobe Feature configuration to the RESYNC request.
FlowprobeFeature(val *ipfix.FlowProbeFeature) DataResyncDSL

// Send propagates the RESYNC request to the plugins.
Send() Reply
Expand Down
25 changes: 25 additions & 0 deletions clientv2/vpp/dbadapter/data_change_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
intf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -216,6 +217,24 @@ func (dsl *PutDSL) PuntException(val *punt.Exception) vppclient.PutDSL {
return dsl
}

// IPFIX adds a request to update VPP IP Flow Information eXport configuration.
func (dsl *PutDSL) IPFIX(val *ipfix.IPFIX) vppclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// FlowprobeParams adds a request to update VPP Flowprobe Params.
func (dsl *PutDSL) FlowprobeParams(val *ipfix.FlowProbeParams) vppclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// FlowprobeFeature adds a request to enable Flowprobe Feature on interface.
func (dsl *PutDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) vppclient.PutDSL {
dsl.parent.txn.Put(models.Key(val), val)
return dsl
}

// Delete changes the DSL mode to allow removal of an existing configuration.
func (dsl *PutDSL) Delete() vppclient.DeleteDSL {
return &DeleteDSL{dsl.parent}
Expand Down Expand Up @@ -366,6 +385,12 @@ func (dsl *DeleteDSL) PuntException(reason string) vppclient.DeleteDSL {
return dsl
}

// FlowprobeFeature adds a request to disable Flowprobe Feature on interface.
func (dsl *DeleteDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) vppclient.DeleteDSL {
dsl.parent.txn.Delete(models.Key(val))
return dsl
}

// Put changes the DSL mode to allow configuration editing.
func (dsl *DeleteDSL) Put() vppclient.PutDSL {
return &PutDSL{dsl.parent}
Expand Down
28 changes: 28 additions & 0 deletions clientv2/vpp/dbadapter/data_resync_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
acl "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/acl"
intf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"
ipfix "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipfix"
ipsec "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/ipsec"
l2 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l2"
l3 "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/l3"
Expand Down Expand Up @@ -256,6 +257,33 @@ func (dsl *DataResyncDSL) PuntException(val *punt.Exception) vppclient.DataResyn
return dsl
}

// IPFIX adds IPFIX configuration to the RESYNC request.
func (dsl *DataResyncDSL) IPFIX(val *ipfix.IPFIX) vppclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// FlowprobeParams adds Flowprobe Params configuration to the RESYNC request.
func (dsl *DataResyncDSL) FlowprobeParams(val *ipfix.FlowProbeParams) vppclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// FlowprobeFeature adds Flowprobe Feature configuration to the RESYNC request.
func (dsl *DataResyncDSL) FlowprobeFeature(val *ipfix.FlowProbeFeature) vppclient.DataResyncDSL {
key := models.Key(val)
dsl.txn.Put(key, val)
dsl.txnKeys = append(dsl.txnKeys, key)

return dsl
}

// AppendKeys is a helper function that fills the keySet <keys> with values
// pointed to by the iterator <it>.
func appendKeys(keys *keySet, it keyval.ProtoKeyIterator) {
Expand Down
3 changes: 3 additions & 0 deletions cmd/vpp-agent/app/vpp_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"go.ligato.io/vpp-agent/v3/plugins/vpp/abfplugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/aclplugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/ifplugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/ipfixplugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/ipsecplugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/l2plugin"
"go.ligato.io/vpp-agent/v3/plugins/vpp/l3plugin"
Expand Down Expand Up @@ -172,6 +173,7 @@ type VPP struct {
ABFPlugin *abfplugin.ABFPlugin
ACLPlugin *aclplugin.ACLPlugin
IfPlugin *ifplugin.IfPlugin
IPFIXPlugin *ipfixplugin.IPFIXPlugin
IPSecPlugin *ipsecplugin.IPSecPlugin
L2Plugin *l2plugin.L2Plugin
L3Plugin *l3plugin.L3Plugin
Expand All @@ -186,6 +188,7 @@ func DefaultVPP() VPP {
ABFPlugin: &abfplugin.DefaultPlugin,
ACLPlugin: &aclplugin.DefaultPlugin,
IfPlugin: &ifplugin.DefaultPlugin,
IPFIXPlugin: &ipfixplugin.DefaultPlugin,
IPSecPlugin: &ipsecplugin.DefaultPlugin,
L2Plugin: &l2plugin.DefaultPlugin,
L3Plugin: &l3plugin.DefaultPlugin,
Expand Down
Loading

0 comments on commit d9b6dd4

Please sign in to comment.