• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting PPP connection state on 10.1 fails mysteriously sometimes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting PPP connection state on 10.1 fails mysteriously sometimes


  • Subject: Re: Getting PPP connection state on 10.1 fails mysteriously sometimes
  • From: Morgan Redman <email@hidden>
  • Date: Fri, 17 May 2002 14:02:44 -0700

Hi Chris,

I was just wondering if you ever got a reply to the email below that was
not sent to this list. I am having the same problem. I dont check the
PPP state, but I use a function much like the one below to get the
connection state. I am using the same code that works in my OS 9
version, but I always get kOTBadOptionErr.

-Morgan

On Wednesday, January 9, 2002, at 07:32 AM, Chris Hanson wrote:

> I'm using the below code in a Mach-O bundle (built with CodeWarrior Pro
> 7.0) to get the CCMiscInfo structure for a PPP endpoint on Mac OS X
> 10.1.
>
> All I really want to do is determine whether PPP is connected during
> and after dialing, so I'm using an almost identical call to get the
> state of the PPP endpoint, and if the state is kPPPStateOpened I call
> the below function. However, sometimes -- not all the time --
> OTOptionManagement returns kOTBadOptionErr. This is the case even
> though PPP is obviously connected, and Apple's PPP menu bar extra shows
> the correct connection state.
>
> Am I doing something silly that's making this not work? Or are there
> known issues with this? (It'd be nice if there were OT/PPP sample code
> for Mac OS X. :)
>
> Thanks a lot.
>
> -- Chris
>
> OSStatus OTPPPGetMiscInfo(EndpointRef inEndpoint, CCMiscInfo* outInfo)
> {
> OSStatus anErr = noErr;
> Boolean wasSync;
>
> check(inEndpoint != kOTInvalidEndpointRef);
> check(outInfo != NULL);
>
> if ((inEndpoint == kOTInvalidEndpointRef) or (outInfo == NULL)) {
> return paramErr;
> }
>
> TOptMgmt cmd;
> TOption* option;
> UInt8 buf[sizeof(TOption) + sizeof(CCMiscInfo)];
>
> cmd.opt.buf = buf;
> cmd.opt.len = sizeof(TOption);
> cmd.opt.maxlen = sizeof(TOption) + sizeof(CCMiscInfo);
> cmd.flags = T_CURRENT;
>
> option = (TOption *) buf;
> option->len = sizeof(TOption);
> option->level = COM_PPP;
> option->name = CC_OPT_GETMISCINFO;
> option->status = 0;
>
> wasSync = OTIsSynchronous(inEndpoint);
>
> anErr = OTSetSynchronous(inEndpoint);
> check_noerr(anErr);
>
> if (anErr == noErr) {
> anErr = OTOptionManagement(inEndpoint, &cmd, &cmd);
> check_noerr(anErr);
>
> if (anErr == noErr) {
> option = (TOption *) cmd.opt.buf;
>
> if (option->status == T_SUCCESS)
> {
> CCMiscInfo *info = (CCMiscInfo *) &option->value[0];
>
> BlockMoveData(info, outInfo, sizeof(CCMiscInfo));
> }
> }
>
> if (wasSync == false) {
> (void) OTSetAsynchronous(inEndpoint);
> }
> }
>
> return anErr;
> }
>
> -- Chris Hanson | Email: email@hidden
> bDistributed.com, Inc. | Phone: +1-847-372-3955
> Making Business Distributed | Fax: +1-847-589-3738
> http://bdistributed.com/ | Personal Email: email@hidden
> _______________________________________________
> opentransportdev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/opentransportdev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Getting PPP connection state on 10.1 fails mysteriously sometimes
      • From: Herb Hrowal <email@hidden>
  • Prev by Date: Re: MoreNetworkSetup and CodeWarrior 7
  • Next by Date: Re: Getting PPP connection state on 10.1 fails mysteriously sometimes
  • Previous by thread: Re: PPP Connected?
  • Next by thread: Re: Getting PPP connection state on 10.1 fails mysteriously sometimes
  • Index(es):
    • Date
    • Thread