patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9541, ppp: add get state pointer macro

 
 

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

patch #9541: ppp: add get state pointer macro

Submitter:  Joel Cunningham <jcunningham>
Submitted:  Tue 16 Jan 2018 11:39:35 PM UTC
   
 
Category:  PPP Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  jcunningham Open/Closed:  Closed
Planned Release:  None

Jump to the original submission

Wed 17 Jan 2018 04:17:21 PM UTC, comment #8: 

netif_client_data is working for me, thanks for the suggestion!

Joel Cunningham <jcunningham>
Group Member
Wed 17 Jan 2018 02:36:36 PM UTC, comment #7: 
Dirk Ziegelmeier <dziegel>
Group administrator
Wed 17 Jan 2018 02:35:08 PM UTC, comment #6: 

I'm using the netif->state pointer to store external state data that needs to be maintained per netif.  Rather than have a separate table and link each entry its corresponding netif, it is  easier to use the state pointer and existing netif_list.

In terms of how I'm over-riding it, I'm using the netif extended callback and when netif_add is invoked, over-ride the state in my callback with a new structure that also stores the original state pointer.  This is only needed for netifs that aren't my own (loopback, winpcap, ppp).

I'm not as familiar with netif_client_data but I took a look and that would allow me to achieve the same thing since I just need to store a pointer for each netif.


Joel Cunningham <jcunningham>
Group Member
Wed 17 Jan 2018 08:41:14 AM UTC, comment #5: 

PPP is special here: the netif is "external" since it is a netif. Before changing anything here, I'd rather first understand what the goal of this patch is.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 17 Jan 2018 08:38:34 AM UTC, comment #4: 

You think the migration path should be that netif->state is an "internal" pointer and netif_client_data is for users?

I had the impression it should be the other way 'round... :-)

Dirk Ziegelmeier <dziegel>
Group administrator
Wed 17 Jan 2018 08:34:53 AM UTC, comment #3: 

Hmm, I think netif->status is the right place for the ppp netif to keep its state. I think additional software could use netif_client_data, not the ppp core itself.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 17 Jan 2018 06:30:06 AM UTC, comment #2: 

... such as netif_client_data framework. Maybe we should port PPP to this instead :-)

If you like, Joel, do it ;-)

Dirk Ziegelmeier <dziegel>
Group administrator
Wed 17 Jan 2018 05:53:19 AM UTC, comment #1: 

Well, in the windows port, this is a rather ugly hack which I only did to prevent making the code handle something which I thought nobody else really needed. In that particular situation, we are using the pcap netif to run a simulation of our code on windows. Our driver code only delegates the I/O work to the pcap netif. Since this invokes C++ classes, this is even more hacky since I cannot define the offset via "offsetof" without compiling C code as C++ code...

The downside is that you need a place where you exchange the netif state. This is not even documented for the pcap netif.

Before just applying this, can you tell us more about why you need this? Maybe we can come up with an alternative which is easier to use and cleaner...

Simon Goldschmidt <goldsimon>
Group administrator
Tue 16 Jan 2018 11:39:35 PM UTC, original submission:  

RFC on this patch which adds PPPIF_GET_STATE_PTR to PPP options so the ppp netif can be used in applications which over-ride netif->state

This option is based off of PCAPIF_GET_STATE_PTR in lwip-contrib win32 port

Joel Cunningham <jcunningham>
Group Member

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by jcunningham (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-17 jcunningham StatusNone Wont Do
        Open/ClosedOpen Closed
    2018-01-16 jcunningham Attached File- Added 0001-ppp-add-get-state-pointer-macro.patch, #42931

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code