• 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
arch/lm32 Loading commit data...
configs Loading commit data...
dev Loading commit data...
doc Loading commit data...
include Loading commit data...
ipc Loading commit data...
lib Loading commit data...
monitor Loading commit data...
pp_printf Loading commit data...
ppsi @ 5c5c8039
scripts Loading commit data...
sdb-lib Loading commit data...
shell Loading commit data...
softpll Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
COPYING Loading commit data...
Kconfig Loading commit data...
MAKEALL Loading commit data...
Makefile Loading commit data...
Makefile.kconfig Loading commit data...
bigobj.lds Loading commit data...
check-error.c Loading commit data...
dump-info.c Loading commit data...
revision.c Loading commit data...
system_checks.c Loading commit data...
wrc_main.c Loading commit data...
wrc_ptp.h Loading commit data...
wrs_main.c Loading commit data...