Exemple #1
0
 def pretty_print(self, q):
     q.text("match_v1 {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("wildcards = ")
             q.text(util.pretty_wildcards(self.wildcards))
             q.text(",")
             q.breakable()
             q.text("in_port = ")
             q.text(util.pretty_port(self.in_port))
             q.text(",")
             q.breakable()
             q.text("eth_src = ")
             q.text(util.pretty_mac(self.eth_src))
             q.text(",")
             q.breakable()
             q.text("eth_dst = ")
             q.text(util.pretty_mac(self.eth_dst))
             q.text(",")
             q.breakable()
             q.text("vlan_vid = ")
             q.text("%#x" % self.vlan_vid)
             q.text(",")
             q.breakable()
             q.text("vlan_pcp = ")
             q.text("%#x" % self.vlan_pcp)
             q.text(",")
             q.breakable()
             q.text("eth_type = ")
             q.text("%#x" % self.eth_type)
             q.text(",")
             q.breakable()
             q.text("ip_dscp = ")
             q.text("%#x" % self.ip_dscp)
             q.text(",")
             q.breakable()
             q.text("ip_proto = ")
             q.text("%#x" % self.ip_proto)
             q.text(",")
             q.breakable()
             q.text("ipv4_src = ")
             q.text(util.pretty_ipv4(self.ipv4_src))
             q.text(",")
             q.breakable()
             q.text("ipv4_dst = ")
             q.text(util.pretty_ipv4(self.ipv4_dst))
             q.text(",")
             q.breakable()
             q.text("tcp_src = ")
             q.text("%#x" % self.tcp_src)
             q.text(",")
             q.breakable()
             q.text("tcp_dst = ")
             q.text("%#x" % self.tcp_dst)
         q.breakable()
     q.text('}')
Exemple #2
0
 def pretty_print(self, q):
     q.text("match_v1 {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("wildcards = ")
             q.text(util.pretty_wildcards(self.wildcards))
             q.text(",")
             q.breakable()
             q.text("in_port = ")
             q.text(util.pretty_port(self.in_port))
             q.text(",")
             q.breakable()
             q.text("eth_src = ")
             q.text(util.pretty_mac(self.eth_src))
             q.text(",")
             q.breakable()
             q.text("eth_dst = ")
             q.text(util.pretty_mac(self.eth_dst))
             q.text(",")
             q.breakable()
             q.text("vlan_vid = ")
             q.text("%#x" % self.vlan_vid)
             q.text(",")
             q.breakable()
             q.text("vlan_pcp = ")
             q.text("%#x" % self.vlan_pcp)
             q.text(",")
             q.breakable()
             q.text("eth_type = ")
             q.text("%#x" % self.eth_type)
             q.text(",")
             q.breakable()
             q.text("ip_dscp = ")
             q.text("%#x" % self.ip_dscp)
             q.text(",")
             q.breakable()
             q.text("ip_proto = ")
             q.text("%#x" % self.ip_proto)
             q.text(",")
             q.breakable()
             q.text("ipv4_src = ")
             q.text(util.pretty_ipv4(self.ipv4_src))
             q.text(",")
             q.breakable()
             q.text("ipv4_dst = ")
             q.text(util.pretty_ipv4(self.ipv4_dst))
             q.text(",")
             q.breakable()
             q.text("tcp_src = ")
             q.text("%#x" % self.tcp_src)
             q.text(",")
             q.breakable()
             q.text("tcp_dst = ")
             q.text("%#x" % self.tcp_dst)
         q.breakable()
     q.text("}")
Exemple #3
0
 def pretty_print(self, q):
     q.text("bsn_vport_l2gre {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("flags = ")
             q.text("%#x" % self.flags)
             q.text(",")
             q.breakable()
             q.text("port_no = ")
             q.text(util.pretty_port(self.port_no))
             q.text(",")
             q.breakable()
             q.text("loopback_port_no = ")
             q.text(util.pretty_port(self.loopback_port_no))
             q.text(",")
             q.breakable()
             q.text("local_mac = ")
             q.text(util.pretty_mac(self.local_mac))
             q.text(",")
             q.breakable()
             q.text("nh_mac = ")
             q.text(util.pretty_mac(self.nh_mac))
             q.text(",")
             q.breakable()
             q.text("src_ip = ")
             q.text(util.pretty_ipv4(self.src_ip))
             q.text(",")
             q.breakable()
             q.text("dst_ip = ")
             q.text(util.pretty_ipv4(self.dst_ip))
             q.text(",")
             q.breakable()
             q.text("dscp = ")
             q.text("%#x" % self.dscp)
             q.text(",")
             q.breakable()
             q.text("ttl = ")
             q.text("%#x" % self.ttl)
             q.text(",")
             q.breakable()
             q.text("vpn = ")
             q.text("%#x" % self.vpn)
             q.text(",")
             q.breakable()
             q.text("rate_limit = ")
             q.text("%#x" % self.rate_limit)
             q.text(",")
             q.breakable()
             q.text("if_name = ")
             q.pp(self.if_name)
         q.breakable()
     q.text('}')
Exemple #4
0
 def pretty_print(self, q):
     q.text("bsn_interface {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("hw_addr = ");
             q.text(util.pretty_mac(self.hw_addr))
             q.text(","); q.breakable()
             q.text("name = ");
             q.pp(self.name)
             q.text(","); q.breakable()
             q.text("ipv4_addr = ");
             q.text(util.pretty_ipv4(self.ipv4_addr))
             q.text(","); q.breakable()
             q.text("ipv4_netmask = ");
             q.text(util.pretty_ipv4(self.ipv4_netmask))
         q.breakable()
     q.text('}')
Exemple #5
0
 def pretty_print(self, q):
     q.text("bsn_interface {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("hw_addr = ");
             q.text(util.pretty_mac(self.hw_addr))
             q.text(","); q.breakable()
             q.text("name = ");
             q.pp(self.name)
             q.text(","); q.breakable()
             q.text("ipv4_addr = ");
             q.text(util.pretty_ipv4(self.ipv4_addr))
             q.text(","); q.breakable()
             q.text("ipv4_netmask = ");
             q.text(util.pretty_ipv4(self.ipv4_netmask))
         q.breakable()
     q.text('}')
Exemple #6
0
 def pretty_print(self, q):
     q.text("ipv4 {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("value = ");
             q.text(util.pretty_ipv4(self.value))
         q.breakable()
     q.text('}')
Exemple #7
0
 def pretty_print(self, q):
     q.text("bsn_vport_l2gre {")
     with q.group():
         with q.indent(2):
             q.breakable()
             q.text("flags = ");
             q.text("%#x" % self.flags)
             q.text(","); q.breakable()
             q.text("port_no = ");
             q.text(util.pretty_port(self.port_no))
             q.text(","); q.breakable()
             q.text("loopback_port_no = ");
             q.text(util.pretty_port(self.loopback_port_no))
             q.text(","); q.breakable()
             q.text("local_mac = ");
             q.text(util.pretty_mac(self.local_mac))
             q.text(","); q.breakable()
             q.text("nh_mac = ");
             q.text(util.pretty_mac(self.nh_mac))
             q.text(","); q.breakable()
             q.text("src_ip = ");
             q.text(util.pretty_ipv4(self.src_ip))
             q.text(","); q.breakable()
             q.text("dst_ip = ");
             q.text(util.pretty_ipv4(self.dst_ip))
             q.text(","); q.breakable()
             q.text("dscp = ");
             q.text("%#x" % self.dscp)
             q.text(","); q.breakable()
             q.text("ttl = ");
             q.text("%#x" % self.ttl)
             q.text(","); q.breakable()
             q.text("vpn = ");
             q.text("%#x" % self.vpn)
             q.text(","); q.breakable()
             q.text("rate_limit = ");
             q.text("%#x" % self.rate_limit)
             q.text(","); q.breakable()
             q.text("if_name = ");
             q.pp(self.if_name)
         q.breakable()
     q.text('}')