Henner Eisen writes:
> >>>>> "jamal" == jamal <hadi@xxxxxxxxxx> writes:
> jamal> -Hard coded for PPPOE -Creating a whole socket family for
> jamal> just PPPOE is a bad idea (claim: Could make it for PPPOX
> jamal> with type PPPOE, L2TP etc).
> What about a generic ´ppp over socket´ paradigm which would eliminate
> the need of special protocol families for each ppp carrier?
> I´was thinking about it like this:
Your outline is almost identical to the code I've got right now. Feel
free to take a look: http://www.math.uwaterloo.ca/~mostrows
> ppp connections would be set up like this:
> - pppd creates socket corresponding to ppp carrier, e.g.
> PPP over ethernet: s = socket(PF_PACKET,SOCK_PACKET,ETH_P_PPPOE);
The problem here is that you need to use bind and/or connect
(regardless of where negotiation is performed), and you need to do
with a sockaddr that is not compatible with PF_PACKET. It is this
need for an addressing scheme which is unique to PPPoE that made me go
with PF_PPPOE. Modifying PF_PACKET to make exceptions and support
"protocols" that have different addressing schemes would be rather
To do PPPoE you must bind sockets to addresses that consist of an
ethernet MAC address and a PPPoE session id (and implicitly an
ethernet data type of 0x8864). I don't think there's any way of doing
this cleanly inside another address family such as PF_PACKET.
Things get a bit more complicated when you want to do in-kernel
connection negotiation, since you may then have to bind sockets to an
additional address component: the access-concentrator name.