Menu

#227 Possibility to set interface default name used by vos

2.0.1.0
closed
None
2019-08-30
2018-12-19
No

Currently there is no possibilty to change the default interface name for a specific system cause it
is hardcoded and only differed by the different types of os/vos (windows,posix,vxworks).
To have a possibility to set it from "outside" would be great. If it isn't set from outside
hardcoded default value/string shall be used.

Discussion

  • Bernd Löhr

    Bernd Löhr - 2018-12-21

    Selecting the network interface is usually done by the kernel of the operating system on base of the assigned IP address. A TRDP application session can provide the IP address of the interface (default INADDR_ANY means default interface) and provides the socket binding with that address.
    Providing the interface name violates the 'abstraction' notion of the VOS.
    BTW, there is the function vos_getInterfaces(), which provides a list of available interfaces with their IP and MAC addresses. This can be used to select a specific interface without knowing its name.
    Another point involves the upcoming TSN additions to the TRDP stack: TSN traffic will use a VLAN tagged interface (on POSIX), which will also follow target-specific names (vlan0, eth0:10 etc.). The stack itself (or VOS) has to determine the correct (virtual) interface to transmit VLAN tagged frames.

     
  • Bernd Löhr

    Bernd Löhr - 2018-12-21
    • Milestone: 1.4.1.0 --> 2.0.0.0
     
  • Matthias Mossner

    It's right that network interface is normally selected by OS according to the used IP address. In this case the stack wants to gather out the MAC address of an interface to use it to create an UUID (vos_sockGetMAC). And the network interface used for that is hardcoded (in case of vxWorks "fec") but in our case the network interface has a different name ("ser") => vos_sockGetMAC fails cause the interface doesn't exist. My intention was to be more flexible being able to set a default network interface by an API routine and use the hardcoded default one if it isn't set through that routine.
    This is only used for gathering out the MAC address but not for routing/selecting the interface used for IP communication. I didn't find any solution to "change" the interface without changing the code itself. My aim is to take the TRDP stack as it is without changing anything when integrating in our system.
    I checked in an implementation of that already on "my" branch. Please have a small review about that and tell me what you think about that solution. Thanks!

     
  • Stefan Bender

    Stefan Bender - 2019-02-18

    I have changed the vos_sockGetMAC() function for Posix and vxWorks to get the first MAC address it can get out of the array returned by vos_getInterfaces() to make the function independant from the names of the interfaces

     

    Last edit: Stefan Bender 2019-02-18
  • Bernd Löhr

    Bernd Löhr - 2019-08-16
    • status: open --> closed
     
  • Bernd Löhr

    Bernd Löhr - 2019-08-16

    Now, cDefaultIface is used only as a fall back, if getMacAddress() is called without interface name. For vlan selection, unfortunately more interface name handling might come up :-(

     
  • Armin-Hagen Weiss

    • Milestone: 2.0.0.0 --> 2.0.1.0
     

Log in to post a comment.

MongoDB Logo MongoDB