NEW-AX.25: Starting to clean up socket API

From: Joerg Reuter (dpa@fristaden.se)
Date: Thu Mar 02 2000 - 20:18:51 EET

  • Next message: Chuck Gelm: "Re: NEW-AX.25: Starting to clean up socket API"

    Hi folks,

    the existing API for AX.25 sockets is a bit too liberal concerning
    the size of the sockaddr structure. It makes the code hard to read
    (thus difficult to maintain) and almost impossible to implement
    alternative ideas. In fact, we have three different structures to
    choose from:

    - struct sockaddr_ax25 (obsolete, does not allow digipeaters)
    - old struct full_sockaddr_ax25 with place for 6 digipeaters
    - new struct full_sockaddr_ax25 with place for 8 digipeaters

    To make things worse, this is also true for NET/ROM and Rose, but
    let's concentrate on AX.25 for now. To make things outright evil,
    the existing code allows any size of struct sockaddr from
    sizeof(struct sockaddr_ax25) to sizeof(struct full_sockaddr_ax25).
    I believe this was well-meant, though kludgy and should go away. The
    following patch does:

    - remove support for struct sockaddr_ax25
    - issues a warning for struct full_sockaddr_ax25 with 6 digipeaters
    - only accepts either struct full_sockaddr_ax25 variants

    The background is that we want to prepare the API for further
    extensions (binding to interfaces instead of call signs, for example)
    and warn users of old binaries that depreciated structures will go
    away soon. Regardless the new things we might implement in the future,
    IMO the current struct full_sockaddr_ax25 has to stay for quite a while.

    Please, everybody try this patch (it is against kernel 2.3.48) and
    tell me your observations. I'll try to get this into 2.3/2.4 if it
    doesn't cause problems.

    73,
    Jörg



    Joerg Reuter http://poboxes.com/jreuter/
    And I make my way to where the warm scent of soil fills the evening air.
    Everything is waiting quietly out there.... (Anne Clark)



    This archive was generated by hypermail 2b29 : Thu Mar 02 2000 - 21:40:33 EET