ciena.grammar
changeset 28 3337257bf0e7
parent 27 99ddc553a868
child 33 91e312481f54
equal deleted inserted replaced
27:99ddc553a868 28:3337257bf0e7
     1 # Grammar for Ciena devices
     1 # Grammar for Ciena devices
     2 #
     2 #
     3 # Copyright (c) 2009, Tomas Zeman <tzeman@volny.cz>
     3 # Copyright (c) 2009, 2010 Tomas Zeman <tzeman@volny.cz>
     4 # All rights reserved.
     4 # All rights reserved.
     5 #
     5 #
     6 # Redistribution and use in source and binary forms, with or without
     6 # Redistribution and use in source and binary forms, with or without
     7 # modification, are permitted providing that the following conditions 
     7 # modification, are permitted providing that the following conditions 
     8 # are met:
     8 # are met:
    22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    23 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    23 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    24 # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    24 # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    25 # POSSIBILITY OF SUCH DAMAGE.
    25 # POSSIBILITY OF SUCH DAMAGE.
    26 #
    26 #
    27 #<autotree>
       
    28 { # perl code follows
    27 { # perl code follows
    29 
    28 
    30 $::res = {};
    29 $::res = {};
    31 $::res->{port} ={};
    30 $::res->{port} ={};
    32 $::res->{"sub-port"} ={};
    31 $::res->{"sub-port"} ={};
   152 avl:		"description" quoted_text
   151 avl:		"description" quoted_text
   153 		{ $avl->{description} = $item{quoted_text}; }
   152 		{ $avl->{description} = $item{quoted_text}; }
   154 		| word value
   153 		| word value
   155 		{ $avl->{$item{word}} = $item{value}; }
   154 		{ $avl->{$item{word}} = $item{value}; }
   156 # Sub-port
   155 # Sub-port
   157 l_sub_port:	"sub-port" /add|create/ "sub-port" identifier avls
   156 l_sub_port:	"sub-port" /add|create/ "sub-port" identifier avls /(vlan-untagged-data)?/
   158 		{
   157 		{
   159 		$avl->{action} = $item[2];
   158 		$avl->{action} = $item[2];
   160 		consume_avl("sub-port", $item{identifier}); 
   159 		consume_avl("sub-port", $item{identifier}); 
       
   160 		$::res->{'sub-port'}->{$item{identifier}}->{'vtag-stack'} = $item[6]
       
   161 			if (length $item[6] > 0);
   161 		}
   162 		}
   162 
   163 
   163 # PM
   164 # PM
   164 l_pm:		"pm" "enable" "pm-instance" identifier
   165 l_pm:		"pm" "enable" "pm-instance" identifier
   165 		{ $::res->{pm}->{instance}->{$item{identifier}} = "enabled" }
   166 		{ $::res->{pm}->{instance}->{$item{identifier}} = "enabled" }