• 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
WG: AW: PPP_PATH
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WG: AW: PPP_PATH


  • Subject: WG: AW: PPP_PATH
  • From: Halit Özüberk \(ProDyne\) <email@hidden>
  • Date: Wed, 22 Jun 2005 16:25:30 +0200
  • Thread-topic: AW: PPP_PATH

Title: Nachricht
 
I might intercept this Messagebox what you can see in the appendix.
With my own Messagebox substitute.
-----Ursprüngliche Nachricht-----
Von: Guy Meyer [mailto:email@hidden]
Gesendet: Mittwoch, 22. Juni 2005 12:38
An: Halit Özüberk (ProDyne)
Betreff: Re: AW: PPP_PATH



On Jun 22, 2005, at 12:59 PM, Halit Özüberk ((ProDyne)) wrote:

1.
The pppcallback function is called, but system message of the RAS comes up, nevertheless.
How can I catch to this Event before is indicated?

The question is not clear.

2.
after I call CFRunLoopStop, callback function is called, nevertheless.

Add printf("RunLoopRun stopped\n");
after CFRunLoopRun();
and see if the runloop actually stops as it should.


SourceCode:
int reftoAPIcallback;
u_int32_t Networklink;
int res;
CFSocketRef callbackSocketRef;
CFRunLoopSourceRef runLoopSource;
CFSocketContext context= { 0, NULL, NULL, NULL, NULL }; 
static void
pppCallBack(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info)
{
 CFSocketNativeHandle socket;
 socket=CFSocketGetNative(s);
 if ( socket== reftoAPIcallback)
 {
  fprintf(stderr, "MypppCallBack called.... \n");
  fprintf(stderr, "Data -> %2x .... \n",data);
  
  CFRunLoopStop( CFRunLoopGetCurrent());
  /// get event via calling PPPExec
 }
}
MyPPPConnect
{
 u_int32_t nLinks=0;
 PPPInit(&reftoAPIcallback);
 callbackSocketRef = CFSocketCreateWithNative(NULL, reftoAPIcallback, kCFSocketReadCallBack, pppCallBack, &context);
 if (callbackSocketRef == 0)
 {
  /// handle error and exit
  return;
 }
 CFSocketSetSocketFlags (callbackSocketRef,CFSocketGetSocketFlags(callbackSocketRef) && !!kCFSocketCloseOnInvalidate);
 CFSocketEnableCallBacks(callbackSocketRef, kCFSocketConnectCallBack);
 runLoopSource = CFSocketCreateRunLoopSource(NULL, callbackSocketRef, 0);
 if (runLoopSource == 0)
 {
  /// handle error and exit
  return;
 }
 CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource,kCFRunLoopDefaultMode);
 res = PPPGetNumberOfLinks (reftoAPIcallback,&nLinks);
 res = PPPGetLinkByIndex(reftoAPIcallback,0,&Networklink);
 res= PPPEnableEvents(reftoAPIcallback, Networklink,true);
 PPPConnect(reftoAPIcallback, Networklink);
 CFRunLoopRun();
 return;
}
-----Ursprüngliche Nachricht-----
Von: Guy Meyer [mailto:email@hidden]
Gesendet: Dienstag, 21. Juni 2005 20:36
An: Halit Özüberk (ProDyne)
Betreff: Re: PPP_PATH



On Jun 21, 2005, at 4:59 PM, Halit Özüberk ((ProDyne)) wrote:

#define PPP_PATH "/var/run/pppconfd\0"

for which is this constant?
what does to this file "pppconfd" ?


It is used for the socket connection

__private_extern__

int
PPPInit(int *ref)
{
int sock;
int status;
struct sockaddr_un sun;

sock = socket(AF_LOCAL, SOCK_STREAM, 0);

bzero(&sun, sizeof(sun));
sun.sun_family = AF_LOCAL;
strncpy(sun.sun_path, PPP_PATH, sizeof(sun.sun_path));

status = connect(sock, (struct sockaddr *)&sun, sizeof(sun));
if (status < 0) {
return errno;
}

*ref = sock;
return 0;
}

Attachment: RASEvent.tiff
Description: RASEvent.tiff

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: SystemConfiguration framework and Carbon CFM - continued
  • Next by Date: Re: SystemConfiguration framework and Carbon CFM - continued
  • Previous by thread: Re: SystemConfiguration framework and Carbon CFM - continued
  • Next by thread: streaming upload of a file
  • Index(es):
    • Date
    • Thread