Yeah, it's just to indicate that there are a variable number of "struct 
ofp_queue_prop_header" elements that follow. 

--Justin


> On Jun 3, 2015, at 8:30 PM, 林清祥 <woniu1...@gmail.com> wrote:
> 
> I thought "struct ofp_queue_prop_header properties[0];" is to define a 
> pointer of struct ofp_queue_prop_header.
> 
> Thanks!
> 
> 2015-06-04 11:27 GMT+08:00 Justin Pettit <jpet...@nicira.com>:
>> 
>>> On Jun 3, 2015, at 8:16 PM, 林清祥 <woniu1...@gmail.com> wrote:
>>> 
>>> I am reading openflow-spec-v1.3.0, and in page 37 there are a few codes as 
>>> follow:
>>> 
>>>> /* Full description for a queue. */
>>>> struct ofp_packet_queue {
>>>> uint32_t queue_id;
>>>> /* id for the specific queue. */
>>>> uint32_t port;
>>>> /* Port this queue is attached to. */
>>>> uint16_t len;
>>>> /* Length in bytes of this queue desc. */
>>>> uint8_t pad[6];
>>>> /* 64-bit alignment. */
>>>> struct ofp_queue_prop_header properties[0]; /* List of properties. */
>>>> };
>>>> OFP_ASSERT(sizeof(struct ofp_packet_queue) == 16);
>>> 
>>>  In my opinion, sizeof(struct ofp_packet_queue) = sizeof(queue_id) + 
>>> sizeof(port) + sizeof(len) + sizeof(pad[]) + sizeof(properties) = 4 + 4 + 2 
>>> + 6 + 4 = 20
>>> 
>>> But the ASSERT is sizeof(struct ofp_packet_queue) == 16.
>>> 
>>> Is there anyone can point out my misunderstanding?
>> 
>> The "properties" element has zero elements, which has no length. 
>> 
>> --Justin
> 
> 
> 
> -- 
>> 
>> Thanks.
>> 
>> Best Regards,
>> 
>> Qingxiang Lin(林清祥)
>> ------
>> Graduate
>> College of Mathematics and Computer Science, FZU
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to