Developing lightweight computation at the DSG edge

Commit f71f9ddd authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system] Use two characters in short interface names

Virtual devices for an interface use a stripped-down version of the
name, eth0=>e0. Before DSA, eth0.1/eth0.2/wlan0 became e0_1, e0_2 and
w0. With DSA, lan1/lan2/wan/wlan0 would become l1/l2/w/w0.

To avoid confusions (e.g., wan0/wlan0 would both become w0), use
two characters: eth0.1/eth0.2/wlan0 become et0_1, et0_2 and wl0,
and lan1/lan2/wan/wlan0 become la1/la2/wa/wl0.
Signed-off-by: default avatarRoger Pueyo Centelles <>
parent 219af226
......@@ -160,8 +160,8 @@ qmp_get_virtual_iface() {
# id_char is the first char of the device: [e]th0, [e]th0.2, [w]lan1a
local id_char=$(echo $device | cut -c 1)
# id_char are the two leading chararacters of the device name: [et]h0, [et]h0.2, [wl]an1a, [la]n1, [wa]n
local id_char=$(echo $device | cut -c 1,2)
# id_num is the number of the device: eth[0], eth[0,2] wlan[1]a
local id_num=$(echo $device | tr -d "[A-z]" | tr - _ | tr . _)
# id_extra are the extra characters after the number: eth0[], eth0.2[], wlan1[a]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment