Obtaining a MAC address on VxWorks 6.8

I'm trying to solve another problem , but I'm stuck with getting MAC addresses on VxWorks 6.8 .

With muxIoctl()

I am not getting the correct result:

/* Binding the cookie */
PROTO_COOKIE muxCookie = muxBind( ... ); /* Binding network service <-> end */

/*
 * Error handling etc.
 * [...]
 */

/* Getting the the address */
char result[6];
STATUS status = muxIoctl(muxCookie, EIOCGADDR, result); /* ioctl the device address */

if( status != OK )
{
    /* Error handling */
}
else
{
    /* ioctl() was Ok, print 'result' */
}

      

What looks good to me is not in reality. As a result, the muxIoctl()

buffer does not contain the corresponding MAC addres, instead it looks something like this (tested on two devices):

 Device #1: 00 00 00 00 0A 00
 Device #2: 00 00 00 00 0B 00
                        ^
                        |
 Every byte is 0, with the exception of these

      

Both devices have a valid MAC address, this can be seen either with ifconfig

or with the transmitted packets. The interfaces (as mentioned above) work and work fine.

Receiving a cookie through muxDevAcquire()

(or dropped out endFindByName()

) instead of using one of them muxBind()

has the same result.

Also: muxDevExists()

returns TRUE

, and other "hacky" code doesn't work either (however it returns values ​​as above):

const char* devName = ...
int unit = ...

char result[6];
END_OBJ* end = endFindByName(devName, unit);

STATUS status = end->pFuncTable->ioctl(end, EIOCGADDR, result);

      

Btw. other controls over muxIoctl()

in the same location work very well.

The devices mentioned above use dtsec, which also work fine, with one exception: the corresponding case dtsecEndIoctl()

- base ioctl()

for delegates muxIoctl()

- doesn't set the address! It only executes once on system boot (otherwise it copies the bytes above)!

Since EIOCGADDR

of is dtsecEndIoctl()

not much larger than the a bcopy()

of pDrvCtrl->dtsecAddr

( pDrvCtrl

= muxCookie

, cast to DTSEC_DRV_CTRL*

!?), It looks like a problem to muxCookie

me. However, the cookie works fine every time and everywhere - expected here (side note: not tested for etsec yet).

Long explanation, short question: How to fix this, respectively, how to get the MAC address?


Other discussions related to this issue:

  • http://compgroups.net/comp.os.vxworks/read-mac-address-on-vxworks-6.8/1115852
  • https://groups.google.com/forum/?_escaped_fragment_=topic/comp.os.vxworks/djh_jH1I0Uk#!topic/comp.os.vxworks/djh_jH1I0Uk

(Everyone doesn't work)


[Update]: Etsec muxIoctl()

uses correct MAC, dtsec wit does not work as above.

+3
c networking mac-address microcontroller vxworks


source to share


No one has answered this question yet

Check out similar questions:

495
Finding local IPs using Python stdlib
263
Get local IP address
one hundred
Reliable method to get MAC address of a machine in C #
8
How to Reliably and Quickly Obtain the MAC Address of a Network Card Given the Device Instance ID
3
How do I get the MAC address of a client device in Xamarin.Forms?
2
VxWorks 6.8 project won't compile
2
How to setup network interface in vxworks-cert-6.6 without using ifLib
2
How do I create a unique ID in VxWorks 6.8?
0
Windows gives strange 8-byte hardware addresses
0
Java - Can't get MAC address for Ubuntu device using getHardwareAddress ()



All Articles
Loading...
X
Show
Funny
Dev
Pics