• Alessandro Rubini's avatar
    vlan: add "vlan off" command, switch pfilter rule-set at runtime · d4c72f47
    Alessandro Rubini authored
    This allows a node built with CONFIG_VLAN to choose at run-time
    whether vlans are allowed or not.  We build both pfilter rule-sets,
    and according to the active vlan number we write one or the other.
    
    The case "CONFIG_VLAN is not set" is handled by providing default
    NULL pointers for beginning and end of the vlan rule-set.
    
    As a side effect, I renamed the files and the functions in
    the pfilter-builder.
    
    This is how it works for me, with CONFIG_PFILTER_VERBOSE set,
    so you see different rule-set  are used (29 rules vs. 16 rules):
    
        wrc# vlan set 0
        0 ("0") out of range
        Command "vlan": error -22
        wrc# vlan off
        fixing MAC adress in rule: use 22:33:44:55:66:77
        pfilter rule 00: 4.00000000
        pfilter rule 01: 1.e4466013
        [...]
        pfilter rule 28: 8.00000000
        current vlan: 0 (0x0)
        wrc# ip set 10.0.0.2
        IP-address: 10.0.0.2 (static assignment)
    
      (and I am now reachable by untagged frames)
    
        wrc# vlan set 10
        fixing MAC adress in rule: use 22:33:44:55:66:77
        fixing VLAN number in rule: use 10
        pfilter rule 00: 4.00000000
        pfilter rule 01: 1.e4466013
        [...]
        pfilter rule 15: 8.00000000
        current vlan: 10 (0xa)
    
      (and I am now reachable on vlan 10)
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    
    Conflicts:
    	Makefile
    d4c72f47
Name
Last commit
Last update
..
ad9516.c Loading commit data...
ad9516_config.h Loading commit data...
dev.mk Loading commit data...
devicelist.c Loading commit data...
eeprom.c Loading commit data...
endpoint.c Loading commit data...
ep_pfilter.c Loading commit data...
flash.c Loading commit data...
i2c.c Loading commit data...
minic.c Loading commit data...
pps_gen.c Loading commit data...
rxts_calibrator.c Loading commit data...
sdb-storage.c Loading commit data...
sfp.c Loading commit data...
syscon.c Loading commit data...
timer-wrs.c Loading commit data...
uart-sw.c Loading commit data...
uart.c Loading commit data...
w1-eeprom.c Loading commit data...
w1-hw.c Loading commit data...
w1-shell.c Loading commit data...
w1-temp.c Loading commit data...
w1.c Loading commit data...