static void dump_filter_strict( void ) { oxm_matches *match = create_oxm_matches(); append_oxm_match_in_port( match, 1 ); append_oxm_match_eth_type( match, 0x0800 ); append_oxm_match_vlan_vid( match, 0, 0 ); append_oxm_match_ipv4_src( match, 0x0a000001, 0 ); append_oxm_match_ipv4_dst( match, 0x0a000002, 0 ); append_oxm_match_ip_dscp( match, 0 ); append_oxm_match_ip_ecn( match, 0 ); append_oxm_match_ip_proto( match, 0x6 ); append_oxm_match_tcp_src( match, 1024 ); append_oxm_match_tcp_dst( match, 2048 ); static handler_data data; data.match = match; snprintf( data.service_name, sizeof( data.service_name ), "dumper" ); data.service_name[ sizeof( data.service_name ) - 1 ] = '\0'; data.strict = true; bool ret = dump_packetin_filter( data.match, OFP_HIGH_PRIORITY, data.service_name, data.strict, dump_filters, &data ); if ( ret == false ) { error( "Failed to dump packetin filters ( ret = %d ).", ret ); } else { add_periodic_event_callback( 5, timeout, &data ); } }
static VALUE pack_tcp_dst_port( VALUE self, VALUE actions, VALUE options ) { VALUE r_transport_port = HASH_REF( options, transport_port ); if ( rb_obj_is_kind_of( actions, basic_action_eval ) ) { append_action_set_field_tcp_dst( openflow_actions_ptr( actions ), ( const uint16_t ) NUM2UINT( r_transport_port ) ); } else if ( rb_obj_is_kind_of( actions, flexible_action_eval ) ) { append_oxm_match_tcp_dst( oxm_match_ptr( actions ), ( uint16_t ) NUM2UINT( r_transport_port ) ); } return self; }
static void alloc_MATCH() { uint8_t dst_mac[6] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; uint8_t src_mac[6] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; uint8_t nomask[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; MATCH = create_oxm_matches(); append_oxm_match_in_port( MATCH, 1 ); append_oxm_match_eth_dst( MATCH, dst_mac, nomask ); append_oxm_match_eth_src( MATCH, src_mac, nomask ); append_oxm_match_vlan_vid( MATCH, 1, 0 ); append_oxm_match_vlan_pcp( MATCH, 1 ); append_oxm_match_eth_type( MATCH, 0x0800 ); append_oxm_match_ip_proto( MATCH, 0x6 ); append_oxm_match_ipv4_src( MATCH, 0x0a090807, 0x00000000 ); append_oxm_match_ipv4_dst( MATCH, 0x0a090807, 0x00000000 ); append_oxm_match_tcp_src( MATCH, 1024 ); append_oxm_match_tcp_dst( MATCH, 2048 ); }