• 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: Question about VLANs in Mac OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Question about VLANs in Mac OS X (From: Terry Simons <email@hidden>)
 >Re: Question about VLANs in Mac OS X (From: Allan Nathanson <email@hidden>)
 >Re: Question about VLANs in Mac OS X (From: Terry Simons <email@hidden>)
 >Re: Question about VLANs in Mac OS X (From: Terry Simons <email@hidden>)

  • Prev by Date: Re: Question about VLANs in Mac OS X
  • Next by Date: poll on BPF devices
  • Previous by thread: Re: Question about VLANs in Mac OS X
  • Next by thread: how to write a virtual network device driver based on USBCDCECM (Or Quacomm MSM interface)
  • Index(es):
    • Date
    • Thread