Is PPP connected
Is PPP connected
- Subject: Is PPP connected
- From: <email@hidden>
- Date: Mon, 30 Sep 2002 17:24:29 +0100
- Organization: Coderus Ltd
Hi,
I am using a modified version of the below code to detect whether or not
that a machine is actually connected to the internet via PPP for MacOS 9.x,
I am now doing a MacOS-X version, but the code fails with a bad option for
CC_OPT_GETMISCINFO.
I've read the Technote 1145, which seems to imply that you should iterate
the IP address of the machine to find out if you are connected is this true
???,
Any Ideas
Thanks
Mark.
>
>
OSStatus IsPPPConnected()
>
{
>
OSStatus err;
>
>
TOptMgmt cm;
>
TOption *option;
>
char buffer[256];
>
Str255 buf;
>
CCMiscInfo c;
>
>
cm.opt.buf=(unsigned char*)buffer;
>
cm.opt.len=sizeof(TOptionHeader);
>
cm.opt.maxlen=255;
>
cm.flags=T_CURRENT;
>
option = (TOption *)buffer;
>
option->level='PPPC';
>
option->name=CC_OPT_GETMISCINFO;
>
option->status=0;
>
option->len=sizeof(TOptionHeader);
>
err = OTOptionManagement(gPPPEndpointRef,&cm,&cm);
>
>
if(!err)
>
switch(c.connectionStatus)
>
{
>
case kPPPConnectionStatusConnecting:
>
case kPPPConnectionStatusIdle:
>
case kPPPConnectionStatusDisconnecting:
>
err = false;
>
break;
>
>
case kPPPConnectionStatusConnected:
>
err = true;
>
break;
>
>
}
>
>
return err;
>
}
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.