Re: Question about VLANs in Mac OS X
Re: Question about VLANs in Mac OS X
- Subject: Re: Question about VLANs in Mac OS X
- From: Allan Nathanson <email@hidden>
- Date: Tue, 18 Mar 2008 08:49:57 -0400
On Mar 18, 2008, at 12:13 AM, Terry Simons wrote:
Ok, a slightly modified (hopefully more read-able) example.
I figured out a workaround, but I'm not sure I understand why.
Here's the new code:
...
I still get the following when running the above code:
There are 2 physical interfaces capable of supporting VLANs.
(null) supports VLANs.
(null) supports VLANs.
If I step through the code, bsdInterfaceName contains "en0" and
"en1" respectively, but attempting to call CFStringGetCStringRef on
it always returns NULL, but it works fine if I use
kCFStringEncodingMacRoman. Why can't I use kCFStringEncodingUTF8
(Or ASCII) in this example?
Check the doc on CFStringGetCStringPtr. That function either returns
the requested pointer immediately or NULL. IF the latter than you
need to use one of the alternative functions such as CFStringGetCString.
char bsdName[256];
CFStringGetCString(bsdInterfaceName, bsdName,
sizeof(bsdName), kCFStringEncodingUTF8);
printf("%s supports VLANs.\n", bsdName);
- Allan
_______________________________________________
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