ligato / vpp-agent

⚡️ Control plane management agent for FD.io's VPP
https://docs.ligato.io/
Apache License 2.0
252 stars 125 forks source link

manually generated abf FibPath gives error? #1092

Open zurrehma opened 5 years ago

zurrehma commented 5 years ago

@ondrej-fabry i have generated the abf.ba.go file and it have this struct:

type FibPath struct { SwIfIndex uint32 TableID uint32 Weight uint8 Preference uint8 IsLocal uint8 IsDrop uint8 IsUDPEncap uint8 IsUnreach uint8 IsProhibit uint8 IsResolveHost uint8 IsResolveAttached uint8 IsDvr uint8 IsSourceLookup uint8 Afi uint8 NextHop []byte struc:"[16]byte" NextHopID uint32 RpfID uint32 ViaLabel uint32 NLabels uint8 LabelStack []FibMplsLabel struc:"[16]FibMplsLabel"

}
the label stack field gives this error: error struc: field LabelStack is a slice with no length or sizeof field is this is the solution here

ondrej-fabry commented 5 years ago

Yes, correct.

You need to apply the patches we have in binapi folder.

We do the patch apply here: https://github.com/ligato/vpp-agent/blob/1d8fb8efaed02c622054e2a13648b736e7225950/Makefile#L147

This is due some inconsistency in the VPP binary API that defines fixed size array ([16]FibMplsLabel) together with field (NLabels), which defines variable size of that array.