I'm trying to check if a PPP interface is up, so I don't even try to bring
it up if it is (I know that NetLibIFUp should deal with it, but I want
to). I'm running through the list of interfaces using NetLibIFGet and
checking for netIFCreatorPPP, which works fine, except that this seems to
*close* the interface, at least on my xcopilot running OS 3.0. I know I
should spend the time to upgrade to POSE, but the needed compiler upgrade
is a little bit more work than I'm prepared to do right now. On my IIIx
running OS 3.3, this seems to work fine (i.e. NetLibIFGet doesn't close
the interface), but since LinkDirect isn't really needed under OS 3.3, it
doesn't really matter.
So, is this a know problem? Is it likely to be an OS 3.0 problem or a
xcopilot problem? Any workaround?
In case anyone cares, the code snippet is as follows:
FrmCustomAlert(ErrorMsgAlert, "Cannot connect", "We've found", \
"Net.lib");
err=NetLibIFGet(AppNetRefnum, index, &ifcreator, &ifinstance);
FrmCustomAlert(ErrorMsgAlert, "Cannot connect", "We're looking \
for", "the PPP IF");
while ((ifcreator!=netIFCreatorPPP) & \
(err!=netErrInvalidInterface))
{
index++;
err=NetLibIFGet(AppNetRefnum, index, &ifcreator, \
&ifinstance);
}
FrmCustomAlert(ErrorMsgAlert, "Cannot connect", "We've found", \
"the PPP IF");
The connection is dropped between the first two calls to FrmCustomAlert,
i.e. during the first call to NetLibIFGet.
I could be making a silly mistake or reading the docs wrong, but I can't
think of any reason why NetLibIFGet would close the interface, and it
works on my hardware.
Cheers
Richard