Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - IOCTL commands for setting MAC and IP addresses: Page 1 of 2 (2 Items)
   
IOCTL commands for setting MAC and IP addresses  
Hello,

I have a TAP interface and wish to override the default MAC and assign a IP address. What ioctl commands are available 
in QNX to support this. 
I saw a few posts around SIOCSIFADDR. Not sure if this is used for both of the above cases. Will 'ifru_addr' be used for
 setting both addresses?
--------------------------------------------------------------------
struct	ifreq {
	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		struct	sockaddr ifru_broadaddr;
		struct	sockaddr_storage ifru_space;
#ifndef __QNXNTO__
		short	ifru_flags;
#else
		int	ifru_flags;
#endif
		int	ifru_metric;
		int	ifru_mtu;
		int	ifru_dlt;
		unsigned int	ifru_value;
		void *	ifru_data;
		struct {
			uint32_t	b_buflen;
			void		*b_buf;
		} ifru_b;
#ifdef __QNXNTO__
		int ifru_fibmask;
#endif
	} ifr_ifru;
--------------------------------------------------