MyPPPConnect()
{
.....
res = PPPSetOption(reftoAPIcallback, Networklink,
PPP_OPT_ALERTENABLE, ?????,????);
....
}
//ppplib.c
int
PPPSetOption(int ref, u_int32_t link, u_int32_t
option, void *data, u_int32_t
dataLen)
{
void *buf;
u_long bufLen;
int status;
bufLen =
sizeof(struct ppp_opt_hdr) + dataLen;
buf =
CFAllocatorAllocate(NULL, bufLen, 0);
bzero((struct
ppp_opt_hdr *)buf, sizeof(struct ppp_opt_hdr));
((struct ppp_opt_hdr
*)buf)->o_type = option;
bcopy(data, ((struct ppp_opt
*)buf)->o_data, dataLen);
status =
PPPExec(ref,
link,
PPP_SETOPTION,
buf,
bufLen,
NULL,
NULL);
if
(status != 0) {
fprintf(stderr, "PPPExec(PPP_SETOPTION) failed:
status = %d\n", status);
}
CFAllocatorDeallocate(NULL,
buf);
return
status;
}
//ppp_msg.h
.....
/* codes for options management */
enum
{
.....
PPP_OPT_ALERTENABLE, // 4 bytes
....
};
enum {
PPP_ALERT_ERRORS =
2, // disconnection causes
PPP_ALERT_PASSWORDS
= 8, // password and CCL Ask
PPP_ALERT_DISABLEALL =
0,
PPP_ALERT_ENABLEALL =
0xFFFFFFFF
};
_______________________________________________
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