* about generic_establish_ppp()
@ 2008-05-06 3:49 cyx_mail
2008-05-06 6:50 ` James Cameron
2008-05-06 7:25 ` cyx_mail
0 siblings, 2 replies; 3+ messages in thread
From: cyx_mail @ 2008-05-06 3:49 UTC (permalink / raw)
To: linux-ppp
in generic_establish_ppp():
ioctl(fd, PPPIOCATTCHAN, &chindex)
1.fd, is the parameter fd a channel's file descriptor or the file descriptor for "/dev/ppp0"?
2.chindex, is this a output parameter or input parameter? what is meaning?
I'm coufused about this function
2008-05-06
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about generic_establish_ppp()
2008-05-06 3:49 about generic_establish_ppp() cyx_mail
@ 2008-05-06 6:50 ` James Cameron
2008-05-06 7:25 ` cyx_mail
1 sibling, 0 replies; 3+ messages in thread
From: James Cameron @ 2008-05-06 6:50 UTC (permalink / raw)
To: linux-ppp
On Tue, May 06, 2008 at 11:49:29AM +0800, cyx_mail@foxmail.com wrote:
> in generic_establish_ppp():
> ioctl(fd, PPPIOCATTCHAN, &chindex)
> 1.fd, is the parameter fd a channel's file descriptor or the file
> descriptor for "/dev/ppp0"?
In the PPPIOCATTCHAN, it is the fd opened from /dev/ppp, but in the
PPPIOCGCHAN just prior it is the fd of the tty. The same variable is
re-used.
> 2.chindex, is this a output parameter or input parameter? what is meaning?
At that time, input. In the previous ioctl, it is output. This is
obvious because of the error messages in each return status check, and
because it is used uninitialised first.
You would need to read the kernel source to be certain.
Read the Documentation/networking/ppp_generic.txt file. Focus on the
definition of channels.
Then read the ppp_generic.c source, concentrating on the PPPIOCGCHAN and
PPPIOCATTCHAN matches.
--
James Cameron
http://ftp.hp.com.au/sigs/jc/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: about generic_establish_ppp()
2008-05-06 3:49 about generic_establish_ppp() cyx_mail
2008-05-06 6:50 ` James Cameron
@ 2008-05-06 7:25 ` cyx_mail
1 sibling, 0 replies; 3+ messages in thread
From: cyx_mail @ 2008-05-06 7:25 UTC (permalink / raw)
To: linux-ppp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1703 bytes --]
in link_required():
devfd = the_channel->connect();
fd_ppp = the_channel->establish_ppp(devfd);
if uses rp-pppoe plugin , I think devfd is the socket fd not the descriptor for "/dev/ppp0"
How to explain this?
2008-05-06
·¢¼þÈË£º James Cameron
·¢ËÍʱ¼ä£º 2008-05-06 14:51:16
ÊÕ¼þÈË£º cyx_mail@foxmail.com
³ËÍ£º linux-ppp
Ö÷Ì⣺ Re: about generic_establish_ppp()
On Tue, May 06, 2008 at 11:49:29AM +0800, cyx_mail@foxmail.com wrote:
> in generic_establish_ppp():
> ioctl(fd, PPPIOCATTCHAN, &chindex)
> 1.fd, is the parameter fd a channel's file descriptor or the file
> descriptor for "/dev/ppp0"?
In the PPPIOCATTCHAN, it is the fd opened from /dev/ppp, but in the
PPPIOCGCHAN just prior it is the fd of the tty. The same variable is
re-used.
> 2.chindex, is this a output parameter or input parameter? what is meaning?
At that time, input. In the previous ioctl, it is output. This is
obvious because of the error messages in each return status check, and
because it is used uninitialised first.
You would need to read the kernel source to be certain.
Read the Documentation/networking/ppp_generic.txt file. Focus on the
definition of channels.
Then read the ppp_generic.c source, concentrating on the PPPIOCGCHAN and
PPPIOCATTCHAN matches.
--
James Cameron
http://ftp.hp.com.au/sigs/jc/
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
__________ NOD32 3072 (20080503) Information __________
This message was checked by NOD32 antivirus system.
http://www.nod32cn.com
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þiþ)í
æèw*\x1fjg¬±¨\x1e¶Ý¢jÿ¾\a«þG«éÿ¢¸\f¢·¦j:+v¨wèjØm¶ÿþø\x1e¯ù\x1e®w¥þàþf£¢·hâúÿÙ¥
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-06 7:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06 3:49 about generic_establish_ppp() cyx_mail
2008-05-06 6:50 ` James Cameron
2008-05-06 7:25 ` cyx_mail
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).