X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fflow.h;h=5d78615a41990b532c2acf23002855c0cc78ece8;hb=efba5ae4643c3806dabe4d0dff5494ddb6359b69;hp=7be03adba6ccc86a1861f35f4f2c8736cafdec14;hpb=e496a484cf53f29f3bf663d2d18a4cd22ea761ea;p=cascardo%2Fovs.git diff --git a/lib/flow.h b/lib/flow.h index 7be03adba..5d78615a4 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -788,14 +788,12 @@ miniflow_get__(const struct miniflow *mf, size_t idx) [FLOW_U64_OFFREM(FIELD) / sizeof(TYPE)] \ : 0) -/* Get a pointer to the ovs_u128 value of struct flow 'FIELD' from miniflow - * 'FLOW'. */ -#define MINIFLOW_GET_U128_PTR(FLOW, FIELD) \ - ((MINIFLOW_IN_MAP(FLOW, FLOW_U64_OFFSET(FIELD)) \ - && (MINIFLOW_IN_MAP(FLOW, FLOW_U64_OFFSET(FIELD) + 1))) \ - ? &((OVS_FORCE const ovs_u128 *)miniflow_get__(FLOW, FLOW_U64_OFFSET(FIELD))) \ - [FLOW_U64_OFFREM(FIELD) / sizeof(ovs_u128)] \ - : NULL) +#define MINIFLOW_GET_U128(FLOW, FIELD) \ + (ovs_u128) { .u64 = { \ + (MINIFLOW_IN_MAP(FLOW, FLOW_U64_OFFSET(FIELD)) ? \ + *miniflow_get__(FLOW, FLOW_U64_OFFSET(FIELD)) : 0), \ + (MINIFLOW_IN_MAP(FLOW, FLOW_U64_OFFSET(FIELD) + 1) ? \ + *miniflow_get__(FLOW, FLOW_U64_OFFSET(FIELD) + 1) : 0) } } #define MINIFLOW_GET_U8(FLOW, FIELD) \ MINIFLOW_GET_TYPE(FLOW, uint8_t, FIELD)