Commit Graph

21 Commits (2d7eaf2e15aa77bcf526b7ea9747732b35194b2e)

Author SHA1 Message Date
Felix Fietkau bc63786fbb swconfig: fix off-by-one error, causing segfaults on gcc 4.6+ (fixes #9765)
SVN-Revision: 30485
13 years ago
Jonas Gorski 936320f1f9 swconfig: fix vlan/port configs being applied to all switches
Check devn instead of dev (which will never be null at this point).

SVN-Revision: 28362
13 years ago
Felix Fietkau 7f9ad157b9 swconfig: hide inactive vlans on "swconfig dev switch0 show"
SVN-Revision: 28133
13 years ago
Gabor Juhos 2e339a6466 swconfig: fix backward compatibility
swconfig fails to load uci configuration after the generic switch
identifier changes.

root@OpenWrt:/# uci show network | grep switch
network.@switch[0]=switch
network.@switch[0].name=eth0
network.@switch[0].reset=1
network.@switch[0].enable_vlan=1
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device=eth0
network.@switch_vlan[0].vlan=1
network.@switch_vlan[0].ports=0t 2 3 4 5
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device=eth0
network.@switch_vlan[1].vlan=2
network.@switch_vlan[1].ports=0t 1
root@OpenWrt:/# swconfig dev eth0 load /etc/config/network
Failed to apply configuration for switch 'switch0'
root@OpenWrt:/# swconfig dev switch0 load /etc/config/network
Failed to apply configuration for switch 'switch0'

SVN-Revision: 27820
13 years ago
Jonas Gorski eaa935658b swconfig: Add generic switch identifiers
Also make switches available under a generic name "switch<num>" for device
name agnostic access. The old device name is used as an alias for backward
compatibility.

SVN-Revision: 27800
13 years ago
Felix Fietkau 3d9f6f3d35 swconfig: make reset and enable_vlan default to 1 (based on patch by Nikolay Martynov)
SVN-Revision: 27375
13 years ago
Felix Fietkau b017df3812 swconfig: avoid setting "NOVAL" attributes if "0" was provided as a value
SVN-Revision: 27374
13 years ago
Felix Fietkau 404fbd8c66 swconfig: add -lnl-genl (patch by Philip Prindeville) - purely cosmetic, swconfig uses libnl-tiny anyway
SVN-Revision: 25509
14 years ago
Gabor Juhos 9a32655293 package/swconfig: add sanity checks to prevent a segfault
SVN-Revision: 24932
14 years ago
Gabor Juhos f7cc3d576c swconfig: Add cpu port index to help output.
Let swconfig provide the cpu port index in its help page. This is
needed as e.g. Atheros switches have their cpu port at port 0, not
port 5.

This could allow e.g. luci to get a rough overview of the layout of
the switch.

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>

SVN-Revision: 20939
14 years ago
Gabor Juhos e1079c515a swconfig: Fix switch name.
This patch fixes a small typo in swconfig's client side that caused
it to print the interface name instead of the switch's device name
on the help page.

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>

SVN-Revision: 20938
14 years ago
Felix Fietkau e4dadf438e swconfig: Remove unused code
Signed-off-by: Martin Mares <mj@ucw.cz>

SVN-Revision: 19758
15 years ago
Felix Fietkau 1d1e4d1035 swconfig: add copyright for Martin Mares
Signed-off-by: Martin Mares <mj@ucw.cz>

SVN-Revision: 19642
15 years ago
Felix Fietkau 7dcd4af070 swconfig: use print_attr_val() in CMD_GET
Use the print_attr_val() function introduced by the previous patch
to simplify the get command.

Signed-off-by: Martin Mares <mj@ucw.cz>

SVN-Revision: 19641
15 years ago
Felix Fietkau b7d662dce8 swconfig: add show command
Add a "show" command, which displays all attributes of the selected port,
VLAN, or of the whole switch.

Signed-off-by: Martin Mares <mj@ucw.cz>

SVN-Revision: 19640
15 years ago
Felix Fietkau cfb74b3b81 swconfig: clean up command line parsing
The command line parser was unsystematic and it silently ignored
many illegal combinations of options. Try to clean that up.

Signed-off-by: Martin Mares <mj@ucw.cz>

SVN-Revision: 19639
15 years ago
Gabor Juhos 428f066b77 swconfig: show tagged port flag
SVN-Revision: 19238
15 years ago
Felix Fietkau 54bbc30687 swconfig: support providing the switch device name in an option instead of the section name - necessary to support switches that contain characters such as "-"
SVN-Revision: 19208
15 years ago
Felix Fietkau ad9d1857a5 swconfig: use libnl-tiny instead of libnl
SVN-Revision: 15508
15 years ago
Felix Fietkau 2fe29deb90 swconfig: implement uci loading support
SVN-Revision: 15315
15 years ago
Felix Fietkau 487c622ac0 add new switch configuration api
SVN-Revision: 13009
16 years ago