From: Ico <at...@ze...> - 2014-07-11 08:52:21
|
* On 2014-07-08 14:42:57 +0200, chas williams - CONTRACTOR wrote: > On Mon, 07 Jul 2014 22:05:40 +0200 > Ico <at...@ze...> wrote: > > > * On 2014-07-07 21:56:47 +0200, chas williams - CONTRACTOR wrote: > > > > > If the in-kernel pppoatm works correctly on your hardware then it's > > > probably something with ppp wanting you to start the conversation. > > > > > > https://github.com/mmoya/ppp/blob/master/pppd/plugins/pppoatm/pppoatm.c > > > > > > The connect_pppoatm() routine here looks similar to your program so at > > > this point I think you need to start sending LCP messages to get the > > > other end to respond. > > > > This I tried: The example I posted was only the minimal code doing the > > ATM part. My current test code forks a pppd in a pty and uses a poll() > > loop to send data between the pty fd and the atm socket. Verifying using > > strace() I do indeed see LCP data coming from pppd, and my program > > sending it into the ATM socket. No response is given, however. > > Take a look at the kernel pppoatm module. There is optionally some > encapsulation that is done to the ppp packet before it is sent along > the pvc. There are basically two kinds, llc and vc. llc sticks an llc > header on (and removes) the ppp packets. I think vc encapsulation does > nothing (essentially your above method). >From reading the pppd code, I believe the PPP handshake is not done over the ATM socket itself, but over a /dev/ppp device which gets attached to the socket by a channel number with some magic PPP ioctl's. This might mean that the PPP communication is not even possible directly over the socket, at least on my platform. I'll investigate further to see if I can mimic pppd's behaviour (opening two /dev/ppp's, doing the ioctls, etc) to see if I'm able to get at least the ppp handshake going. > Also, make sure your atm program is actually sending the data. > strace'ing pppd might show pppd sending data to the pty but unless > something flushes the pipe, the data might not reach your atm program > in a timely fashion. I double checked, it is. > Again use atmdiag to see the tx counters increment. atmdiag always report zero's, even when running pppd with the pppoa plugin. I also never see any traffic on the atm0 network inteface while pppoa is connected and transmitting/receiving ppp data. > And you can look at /proc/net/atm/pvc to see stats for your atm > socket. All zeroes as well, even when the ppp is functioning. Thanks, -- :wq ^X^Cy^K^X^C^C^C^C |