Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-12-2008, 06:43 AM   #5 (permalink)
md582
Registered Member
 
Join Date: Oct 2008
Posts: 6
Default

I think the iPhone doesn't have a IPv6 Address ? I only get the IPv4 with this code ! And IPv6 is not the MAC-Address !?
I thought i can use the <in.h> like this >>
...
struct ifreq ifr;
...
a = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
printf("%02x:%02x:%02x:%02x:%02x:%02x\n", a[0],a[1],a[2],a[3],a[4],a[5]);
...
but the <in.h> hasn't the "ifr_hwaddr" like Linux has !! ??


see this >> from my Mac !!!
struct ifreq {
#ifndef IFNAMSIZ
#define IFNAMSIZ IF_NAMESIZE
#endif
char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
short ifru_flags;
int ifru_metric;
int ifru_mtu;
int ifru_phys;
int ifru_media;
int ifru_intval;
caddr_t ifru_data;
struct ifdevmtu ifru_devmtu;
struct ifkpi ifru_kpi;
} ifr_ifru;

and this from Linux >>>
166 union {
167 struct sockaddr ifru_addr;
168 struct sockaddr ifru_dstaddr;
169 struct sockaddr ifru_broadaddr;
170 struct sockaddr ifru_netmask;
171 struct sockaddr ifru_hwaddr;
172 short ifru_flags;
173 int ifru_ivalue;
174 int ifru_mtu;
175 struct ifmap ifru_map;
176 char ifru_slave[IFNAMSIZ]; /* Just fits the size */
177 char ifru_newname[IFNAMSIZ];
178 void __user * ifru_data;
179 struct if_settings ifru_settings;
180 } ifr_ifru;

on my MAC (and iPhone) i'm missing the "ifr_hwaddr" !!
md582 is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 317
14 members and 303 guests
AgCode, ansonl, beginer2007, bluelobster, ceggert, Eagle11, irishkiwi, Jeremy1026, kindelizaxi, mallmertl, mcgrath3, Rudy, slahteine, vargonian
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,221
Threads: 39,001
Posts: 171,067
Top Poster: smasher (2,569)
Welcome to our newest member, kindelizaxi
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:58 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.