Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Dec 1998 21:23:42 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        arch@FreeBSD.ORG
Subject:   Re: IFF_UP, IFF_RUNNING semantics... 
Message-ID:  <1004.913580622@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 13 Dec 1998 18:10:53 %2B0100." <19981213181053.47030@uriah.heep.sax.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
I have a version of SPPP here which works a lot better than the
one in the tree, but it breaks, I'm almost certain, the if_ar,
if_cx and if_sr drivers we have.  And the ISDN stuff as well.  On
the other hand, as I said: it works.

What I would really like to do is to untangle this enough that the
underlying structure shines sufficiently through to let other people
use this intelligently.

What needs done is more or less:

	Move the "struct if" back into the drivers private space, so
	that other encapsulations can use the same interface struct.

	Clean up the boundary between sppp and the driver.

	Add a "ifconfig <ifname> encapsulation {ppp|cisco-hdlc|...}"
	facility

	Yank the cisco stuff from isppp and put it in its own 
	encapsulation method.

As I said, this will break everything we have in there, so I think the
right way to do it is for me to clone if_sppp* and do it "right" then
migrate the other drivers to use it, that way I don't yank the rug
on anybody else.

The ISDN stuff will benefit from this as well, but I will need for
somebody else to take that bit, I don't have an ISDN card running
right now, and will not have time for that also.

The interface I have in mind is something like this:

An encapsulation (PPP, Cisco-HDLC) provides a struct like this for each
instance:

        struct if_hdlc_encap {
                char    *name;      
                void    (*up)(struct if_hdlc_encap *);      
                void    (*down)(struct if_hdlc_encap *);      
                void    (*input)(struct if_hdlc_encap *, struct mbuf *);      
                int     (*ioctl)(struct ifnet *ifp, u_long cmd, void *data)     
                int     (*destroy)(struct if_hdlc_encap *);
                
                struct  if_hdlc_driver *driver;
                void    *privatep;
                int     *privatei;
        };


An HDLC driver provides one of these for each channel:

        struct if_hdlc_driver {
                void    (*open)(struct if_hdlc_driver *, char *dialinfo);      
                void    (*close)(struct if_hdlc_driver *);       
                void    (*output)(struct if_hdlc_driver *);      
                int     (*ioctl)(struct ifnet *ifp, u_long cmd, void *data)     
                struct  if_hdlc_encap *encapsulation;
                struct  ifnet pp_if;
                void    *privatep;
                int     *privatei;
        };

A generic system ioctl routing is used to change encapsulation (down & destroy
old one, create new one, hook it up to interface).

How does that sound ?  I think I can have this done PDQ so you can have
some actual code to look at.

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
"ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1004.913580622>