Refers to #164 [v0x04] Helps on OF spec understanding.
@diraol asked about the struct ofp_action_field struct, currently implemented as v0x04.common.action.ActionSetField() .
I checked the specs (OF1.3.0), and the implemented code, and I believe the
implementation does not complies with the spec.
It also affects:
v0x04.common.flow_match.Match() and
v0x04.common.flow_match.OxmHeader() (not implemented I believe)
In the current implementaion, OXM_TLV is treated as 4 independent 8bits 'field' in Match and in ActionSetField.
On #164, @diraol wrote:
It seems to be a UBInt8 array of size 4, and its content may be a "OXM TLV". But there it is not clear what is a OXM TLV. There is no structs on the spec for that, despite table 9 on page 41.
So, this struct has a variable length?
As I understand, OXM TLV is a simple TLV (Type Length Value), and therefore it has variable length. Its minimum length is 4 Bytes (figure 4 of pg 39):
- 1 UBInt16 for oxm_class (one of
- 7bits for oxm_field (and 1bit for oxm_hasmask - not used in this case)
- 1 UBInt8 for Length.
+ the value field
- 1 (length - 3bytes) oxm_value
the union of oxm_class and oxm_field (23 bits: OXM_TLV[:3] >> 1) is called oxm_type. Possible oxm_class and oxm_field are in pg 40 and 42 respectively.
From the spec:
The field contains a header field described using a single OXM TLV structure (see A.2.3). Set-Field
actions are defined by oxm_type, the type of the OXM TLV, and modify the corresponding header field in the packet with the value of oxm_value, the payload of the OXM TLV.
I hope I could clear the subject a bit. And I can implement it if needed.