-
I want to run multiple instances of a Zephyr application on a Linux box running under the NATIVE POSIX 64 environment. Each instance would need to create two virtual Ethernet interfaces with different IP/MAC addresses for each of these 2 virtual TAP interface runtime. I would prefer this to occur at boot, but it is not clear how each instance will know the number of other instances present. Under embedded Linux I would use something like "pidof" to determine the count of running instances. I could also use something like global shared memory or a file to keep track of the number of running instances. But I do not want to have this based on storing content to the littlefs - but it is an option of nothing else is discovered that is better. Since under NATIVE POSIX, the littlefs seems to write to a single file as FLASH.BIN, presumably that file would need to be used by all instances. Notionally, the 1st instance would get assigned a node id of 1, would use this information to create unique IP and MAC addresses for each virtual Ethernet interface. These interfaces need to act like promiscuous sockets with a larger MTU of 9k. If command line parameter were available, the node id could be assigned via a command line argument. How would you fine folks solve this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
native_posix does support command line arguments, and it can be extended as well. Search for |
Beta Was this translation helpful? Give feedback.
-
Thanks to the community for providing a response, I believe I have a direction on this issue. |
Beta Was this translation helpful? Give feedback.
-
@aescolar maybe worth documenting this somewhere if not covered already. |
Beta Was this translation helpful? Give feedback.
native_posix does support command line arguments, and it can be extended as well. Search for
NATIVE_TASK
which can call a hook to add new command line options.