hi.someone knows why this in the world? i'm trying to make a piece of code
for obtaining infoss about ppp-layer and to manipulate some parameters ..i
get an error for the ioctl.doubt: have i to use ioctl? or get/setsockopt?
i'd like to use this code if possible.. Alan help me.
code:
................(etc..) ..............
unsigned long int gflags;
...............
if (!strcmp(ifr.ifr_name , "ppp0") ) { printf("\n
ok->%s \n", ifr.ifr_name);
/* go ppp0*/
/*flags 2-ioctl*/
if ( ioctl(so , SIOCGIFFLAGS, (char *) &ifr) == -1)
perror("\n error ioctl() 2\n");
if (ifr.ifr_flags & IFF_UP)
sprintf(flags , "UP");
if (ifr.ifr_flags & IFF_RUNNING)
strcat( flags , " RUNNING");
if (ifr.ifr_flags & IFF_BROADCAST)
strcat( flags ," BROADCAST" ); if
(ifr.ifr_flags & IFF_POINTOPOINT)
strcat( flags ," P-t-P" ); if
(ifr.ifr_flags & IFF_PROMISC) strcat(
flags ," PROMISCOUS" ); printf("\t
%s\n" , flags);
this !! -->
if (ioctl(so , PPPIOCGFLAGS, (char *) &gflags) == -1)
ioctl no goodd ---> perror("\n error ioctl()3\n");
whyz? if (gflags & SC_COMP_AC)
sprintf(pppflags, "COMP");
.................... (etc...)
---------------output:
ALTAG:/p_r_o_g_r_a_m_m_a_z_i_o_n_e/c/varie/aux-exp #
ok->ppp0 UP RUNNING P-t-P
error ioctl() 3 <---- this not good.......<<<:
Invalid argumenti whyz?
thankx a lot!
alex
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]