def start(self): # Start Ryu event loop thread super(OVSNeutronAgentRyuApp, self).start() # patch ryu ofproto_v1_3.oxm_types.append( oxm_fields.NiciraExtended0('vlan_tci', 4, type_desc.Int2)) oxm_fields.generate(ofproto_v1_3.__name__) def _make_br_cls(br_cls): return functools.partial(br_cls, ryu_app=self) # Start agent main loop thread bridge_classes = { 'br_int': _make_br_cls(br_int.OVSIntegrationBridge), 'br_phys': _make_br_cls(br_phys.OVSPhysicalBridge), 'br_tun': _make_br_cls(br_tun.OVSTunnelBridge), } return hub.spawn(agent_main_wrapper, bridge_classes)
match = parser.OFPMatch( tcp_flags_nxm=(flag, flag), ip_proto=inet.IPPROTO_TCP, eth_type=eth_type) # Works flag = tcp.TCP_ACK match = parser.OFPMatch( tcp_flags_nxm=(flag, flag), ip_proto_nxm=inet.IPPROTO_TCP, eth_type_nxm=eth_type) """ oxm_types = [ # OFPXMC_NXM_0 oxm_fields.NiciraExtended0('in_port_nxm', 0, type_desc.Int2), oxm_fields.NiciraExtended0('eth_dst_nxm', 1, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_src_nxm', 2, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_type_nxm', 3, type_desc.Int2), oxm_fields.NiciraExtended0('vlan_tci', 4, type_desc.Int2), oxm_fields.NiciraExtended0('nw_tos', 5, type_desc.Int1), oxm_fields.NiciraExtended0('ip_proto_nxm', 6, type_desc.Int1), oxm_fields.NiciraExtended0('ipv4_src_nxm', 7, type_desc.IPv4Addr), oxm_fields.NiciraExtended0('ipv4_dst_nxm', 8, type_desc.IPv4Addr), oxm_fields.NiciraExtended0('tcp_src_nxm', 9, type_desc.Int2), oxm_fields.NiciraExtended0('tcp_dst_nxm', 10, type_desc.Int2), oxm_fields.NiciraExtended0('udp_src_nxm', 11, type_desc.Int2), oxm_fields.NiciraExtended0('udp_dst_nxm', 12, type_desc.Int2), oxm_fields.NiciraExtended0('icmpv4_type_nxm', 13, type_desc.Int1), oxm_fields.NiciraExtended0('icmpv4_code_nxm', 14, type_desc.Int1), oxm_fields.NiciraExtended0('arp_op_nxm', 15, type_desc.Int2),
def oxm_tlv_header_extract_length(header): if oxm_tlv_header_extract_hasmask(header): length = (header & 0xff) / 2 else: length = header & 0xff return length oxm_types = [ oxm_fields.OpenFlowBasic('in_port', 0, type_desc.Int4), oxm_fields.OpenFlowBasic('in_phy_port', 1, type_desc.Int4), oxm_fields.OpenFlowBasic('metadata', 2, type_desc.Int8), oxm_fields.OpenFlowBasic('eth_dst', 3, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_dst_nxm', 1, type_desc.MacAddr), oxm_fields.OpenFlowBasic('eth_src', 4, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_src_nxm', 2, type_desc.MacAddr), oxm_fields.OpenFlowBasic('eth_type', 5, type_desc.Int2), oxm_fields.OpenFlowBasic('vlan_vid', 6, type_desc.Int2), oxm_fields.OpenFlowBasic('vlan_pcp', 7, type_desc.Int1), oxm_fields.OpenFlowBasic('ip_dscp', 8, type_desc.Int1), oxm_fields.OpenFlowBasic('ip_ecn', 9, type_desc.Int1), oxm_fields.OpenFlowBasic('ip_proto', 10, type_desc.Int1), oxm_fields.OpenFlowBasic('ipv4_src', 11, type_desc.IPv4Addr), oxm_fields.OpenFlowBasic('ipv4_dst', 12, type_desc.IPv4Addr), oxm_fields.OpenFlowBasic('tcp_src', 13, type_desc.Int2), oxm_fields.OpenFlowBasic('tcp_dst', 14, type_desc.Int2), oxm_fields.OpenFlowBasic('udp_src', 15, type_desc.Int2), oxm_fields.OpenFlowBasic('udp_dst', 16, type_desc.Int2), oxm_fields.OpenFlowBasic('sctp_src', 17, type_desc.Int2),
flag = tcp.TCP_ACK match = parser.OFPMatch( tcp_flags_nxm=(flag, flag), ip_proto=inet.IPPROTO_TCP, eth_type=eth_type) # Works flag = tcp.TCP_ACK match = parser.OFPMatch( tcp_flags_nxm=(flag, flag), ip_proto_nxm=inet.IPPROTO_TCP, eth_type_nxm=eth_type) """ oxm_types = [ oxm_fields.NiciraExtended0('eth_dst_nxm', 1, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_src_nxm', 2, type_desc.MacAddr), oxm_fields.NiciraExtended0('eth_type_nxm', 3, type_desc.Int2), oxm_fields.NiciraExtended0('ip_proto_nxm', 6, type_desc.Int1), oxm_fields.NiciraExtended1('tunnel_id_nxm', 16, type_desc.Int8), oxm_fields.NiciraExtended1('tun_ipv4_src', 31, type_desc.IPv4Addr), oxm_fields.NiciraExtended1('tun_ipv4_dst', 32, type_desc.IPv4Addr), oxm_fields.NiciraExtended1('pkt_mark', 33, type_desc.Int4), oxm_fields.NiciraExtended1('tcp_flags_nxm', 34, type_desc.Int2), oxm_fields.NiciraExtended1('conj_id', 37, type_desc.Int4), oxm_fields.NiciraExtended1('ct_state', 105, type_desc.Int4), oxm_fields.NiciraExtended1('ct_zone', 106, type_desc.Int2), oxm_fields.NiciraExtended1('ct_mark', 107, type_desc.Int4), oxm_fields.NiciraExtended1('ct_label', 108, type_desc.Int16), oxm_fields.NiciraExtended1('tun_ipv6_src', 109, type_desc.IPv6Addr), oxm_fields.NiciraExtended1('tun_ipv6_dst', 110, type_desc.IPv6Addr),