buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55078, Add custom data to pbuf struct

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #55078: Add custom data to pbuf struct

Submitter:  Davide Rizzi <drizzi>
Submitted:  Fri 23 Nov 2018 03:49:34 PM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  2.1.1

Wed 23 Feb 2022 04:47:38 PM UTC, comment #3: 


comment #2:

> I use this feature for adding PTP timestamps:
>
> lwipopts.h:
>
> #define LWIP_PBUF_CUSTOM_DATA       \
>     u8_t   timestamp_flags;         \
>     struct timespec timestamp;
>
> Question:
>
> How do I make sure, that the fields are initialized to zero?
>
> pbuf_init_alloced_pbuf() function only initializes the old members, but leaves my own field uninitialized.
>
> Perhaps we should add a LWIP_PBUF_CUSTOM_DATA_INIT_HOOK macro or something?
>


I just submitted the patch #10181 for it

Max <mastupristi>
Fri 29 Jan 2021 04:08:28 PM UTC, comment #2: 

I use this feature for adding PTP timestamps:

lwipopts.h:

#define LWIP_PBUF_CUSTOM_DATA       \
    u8_t   timestamp_flags;         \
    struct timespec timestamp;

Question:

How do I make sure, that the fields are initialized to zero?

pbuf_init_alloced_pbuf() function only initializes the old members, but leaves my own field uninitialized.

Perhaps we should add a LWIP_PBUF_CUSTOM_DATA_INIT_HOOK macro or something?

Thomas Kindler <thomask77>
Sun 25 Nov 2018 01:02:11 PM UTC, comment #1: 

I implemented your suggestion!

Dirk Ziegelmeier <dziegel>
Group administrator
Fri 23 Nov 2018 03:49:34 PM UTC, original submission:  

It can be necessary, or otherwise handy, to add custom data to pbuf struct (e.g.: timestamps for PTP).

I propose to add LWIP_PBUF_CUSTOM_DATA at the end of struct pbuf, and defining it empty in opt.h. The user can then define it in lwipopts.h to whatever it wants.


Davide Rizzi <drizzi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mastupristi (Posted a comment)
  • -email is unavailable- added by thomask77 (Posted a comment)
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by drizzi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-25 dziegel StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.12