diff --git a/datapath/forward.c b/datapath/forward.c index 747e4aa..c078813 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -249,7 +249,7 @@ add_flow(struct sw_chain *chain, const struct sender *sender, /* Fill out flow. */ flow->idle_timeout = ntohs(ofm->idle_timeout); flow->hard_timeout = ntohs(ofm->hard_timeout); - flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_EXP) ? 1 : 0; + flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_REM) ? 1 : 0; flow_setup_actions(flow, ofm->actions, actions_len); /* Act. */ @@ -320,7 +320,7 @@ mod_flow(struct sw_chain *chain, const struct sender *sender, /* Fill out flow. */ flow->idle_timeout = ntohs(ofm->idle_timeout); flow->hard_timeout = ntohs(ofm->hard_timeout); - flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_EXP) + flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_REM) ? 1 : 0; flow_setup_actions(flow, ofm->actions, actions_len); error = chain_insert(chain, flow, diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 811dad4..df9272b 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -46,7 +46,7 @@ enum nicira_type { NXT_FLOW_END_CONFIG, /* Sent by switch when a flow ends. These messages are turned into - * ofp_flow_expired and NetFlow messages in user-space. */ + * ofp_flow_removed and NetFlow messages in user-space. */ NXT_FLOW_END }; diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h index 72024d5..3867837 100644 --- a/include/openflow/openflow.h +++ b/include/openflow/openflow.h @@ -112,7 +112,7 @@ enum ofp_type { /* Asynchronous messages. */ OFPT_PACKET_IN, /* Async message */ - OFPT_FLOW_EXPIRED, /* Async message */ + OFPT_FLOW_REMOVED, /* Async message */ OFPT_PORT_STATUS, /* Async message */ /* Controller command messages. */ @@ -534,7 +534,7 @@ OFP_ASSERT(sizeof(struct ofp_match) == 36); #define OFP_DEFAULT_PRIORITY 0x8000 enum ofp_flow_mod_flags { - OFPFF_SEND_FLOW_EXP = 1 << 0, /* Send expiration message when flow expires. */ + OFPFF_SEND_FLOW_REM = 1 << 0, /* Send expiration message when flow expires. */ OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ OFPFF_EMERG = 1 << 2 /* Ramark this is for emergency. */ }; @@ -564,19 +564,19 @@ struct ofp_flow_mod { OFP_ASSERT(sizeof(struct ofp_flow_mod) == 64); /* Why did this flow expire? */ -enum ofp_flow_expired_reason { - OFPER_IDLE_TIMEOUT, /* Flow idle time exceeded idle_timeout. */ - OFPER_HARD_TIMEOUT, /* Time exceeded hard_timeout. */ - OFPER_DELETE /* Evicted by a DELETE flow mod. */ +enum ofp_flow_removed_reason { + OFPRR_IDLE_TIMEOUT, /* Flow idle time exceeded idle_timeout. */ + OFPRR_HARD_TIMEOUT, /* Time exceeded hard_timeout. */ + OFPRR_DELETE /* Evicted by a DELETE flow mod. */ }; /* Flow expiration (datapath -> controller). */ -struct ofp_flow_expired { +struct ofp_flow_removed { struct ofp_header header; struct ofp_match match; /* Description of fields. */ uint16_t priority; /* Priority level of flow entry. */ - uint8_t reason; /* One of OFPER_*. */ + uint8_t reason; /* One of OFPRR_*. */ uint8_t pad[1]; /* Align to 32-bits. */ uint32_t duration; /* Time flow was alive in seconds. */ @@ -585,7 +585,7 @@ struct ofp_flow_expired { uint64_t packet_count; uint64_t byte_count; }; -OFP_ASSERT(sizeof(struct ofp_flow_expired) == 72); +OFP_ASSERT(sizeof(struct ofp_flow_removed) == 72); /* Values for 'type' in ofp_error_message. These values are immutable: they * will not change in future versions of the protocol (although new values may diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 051bfe9..09c4e1e 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -293,8 +293,8 @@ lswitch_process_packet(struct lswitch *sw, struct rconn *rconn, process_stats_reply }, { - OFPT_FLOW_EXPIRED, - sizeof(struct ofp_flow_expired), + OFPT_FLOW_REMOVED, + sizeof(struct ofp_flow_removed), NULL }, }; diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 4cdb43b..29fa8b4 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -761,21 +761,21 @@ ofp_print_flow_mod(struct ds *string, const void *oh, size_t len, ds_put_char(string, '\n'); } -/* Pretty-print the OFPT_FLOW_EXPIRED packet of 'len' bytes at 'oh' to 'string' +/* Pretty-print the OFPT_FLOW_REMOVED packet of 'len' bytes at 'oh' to 'string' * at the given 'verbosity' level. */ static void -ofp_print_flow_expired(struct ds *string, const void *oh, size_t len UNUSED, +ofp_print_flow_removed(struct ds *string, const void *oh, size_t len UNUSED, int verbosity) { - const struct ofp_flow_expired *ofe = oh; + const struct ofp_flow_removed *ofe = oh; ofp_print_match(string, &ofe->match, verbosity); ds_put_cstr(string, " reason="); switch (ofe->reason) { - case OFPER_IDLE_TIMEOUT: + case OFPRR_IDLE_TIMEOUT: ds_put_cstr(string, "idle"); break; - case OFPER_HARD_TIMEOUT: + case OFPRR_HARD_TIMEOUT: ds_put_cstr(string, "hard"); break; default: @@ -1390,10 +1390,10 @@ static const struct openflow_packet packets[] = { ofp_print_flow_mod, }, { - OFPT_FLOW_EXPIRED, - "flow_expired", - sizeof (struct ofp_flow_expired), - ofp_print_flow_expired, + OFPT_FLOW_REMOVED, + "flow_removed", + sizeof (struct ofp_flow_removed), + ofp_print_flow_removed, }, { OFPT_PORT_MOD, diff --git a/lib/ofpstat.c b/lib/ofpstat.c index 706b163..5db0f59 100644 --- a/lib/ofpstat.c +++ b/lib/ofpstat.c @@ -79,8 +79,8 @@ inc_protocol_message(struct ofpstat *ifps, struct ofp_header *hdr) case OFPT_PACKET_IN: INC_IFP_STAT(ifps, ofps_packet_in); break; - case OFPT_FLOW_EXPIRED: - INC_IFP_STAT(ifps, ofps_flow_expired); + case OFPT_FLOW_REMOVED: + INC_IFP_STAT(ifps, ofps_flow_removed); break; case OFPT_PORT_STATUS: INC_IFP_STAT(ifps, ofps_port_status); diff --git a/lib/ofpstat.h b/lib/ofpstat.h index 64bb77b..836d5d5 100644 --- a/lib/ofpstat.h +++ b/lib/ofpstat.h @@ -75,7 +75,7 @@ struct ofpstat { uint64_t ofps_get_config_reply; uint64_t ofps_set_config; uint64_t ofps_packet_in; - uint64_t ofps_flow_expired; + uint64_t ofps_flow_removed; uint64_t ofps_port_status; uint64_t ofps_packet_out; uint64_t ofps_flow_mod; diff --git a/lib/vconn.c b/lib/vconn.c index b5318e7..687f795 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -492,7 +492,7 @@ again: { if (vconn->version < 0) { if (oh->type == OFPT_PACKET_IN - || oh->type == OFPT_FLOW_EXPIRED + || oh->type == OFPT_FLOW_REMOVED || oh->type == OFPT_PORT_STATUS) { /* The kernel datapath is stateless and doesn't really * support version negotiation, so it can end up sending diff --git a/regress/lib/Perl5/OF/OFUtil.pm b/regress/lib/Perl5/OF/OFUtil.pm index aa09cac..2f254d6 100644 --- a/regress/lib/Perl5/OF/OFUtil.pm +++ b/regress/lib/Perl5/OF/OFUtil.pm @@ -1092,7 +1092,7 @@ sub wait_for_flow_expired_readone { my ( $ofp, $sock, $options_ref, $pkt_len, $pkt_total, $idle_timeout ) = @_; wait_for_flow_expired_readsize( $ofp, $sock, $options_ref, $pkt_len, $pkt_total, $idle_timeout, - $ofp->sizeof('ofp_flow_expired') ); + $ofp->sizeof('ofp_flow_removed') ); } sub wait_for_flow_expired_readsize { @@ -1116,32 +1116,32 @@ sub wait_for_flow_expired_total_bytes { my $recvd_mesg; sysread( $sock, $recvd_mesg, $read_size ) - || die "Failed to receive ofp_flow_expired message: $!"; + || die "Failed to receive ofp_flow_removed message: $!"; #print HexDump ($recvd_mesg); # Inspect message my $msg_size = length($recvd_mesg); - my $expected_size = $ofp->sizeof('ofp_flow_expired'); - compare( "ofp_flow_expired msg size", length($recvd_mesg), '==', $expected_size ); + my $expected_size = $ofp->sizeof('ofp_flow_removed'); + compare( "ofp_flow_removed msg size", length($recvd_mesg), '==', $expected_size ); - my $msg = $ofp->unpack( 'ofp_flow_expired', $recvd_mesg ); + my $msg = $ofp->unpack( 'ofp_flow_removed', $recvd_mesg ); #print Dumper($msg); # Verify fields - compare( "ofp_flow_expired header version", $$msg{'header'}{'version'}, '==', $of_ver ); - compare( "ofp_flow_expired header type", $$msg{'header'}{'type'}, '==', $enums{'OFPT_FLOW_EXPIRED'} ); - compare( "ofp_flow_expired header length", $$msg{'header'}{'length'}, '==', $msg_size ); + compare( "ofp_flow_removed header version", $$msg{'header'}{'version'}, '==', $of_ver ); + compare( "ofp_flow_removed header type", $$msg{'header'}{'type'}, '==', $enums{'OFPT_FLOW_REMOVED'} ); + compare( "ofp_flow_removed header length", $$msg{'header'}{'length'}, '==', $msg_size ); # Disable for platforms that don't have byte counts... - Jean II if ( not defined( $$options_ref{'ignore_byte_count'} ) ) { - compare( "ofp_flow_expired byte_count", $$msg{'byte_count'}, '==', $bytes ); + compare( "ofp_flow_removed byte_count", $$msg{'byte_count'}, '==', $bytes ); } - compare( "ofp_flow_expired packet_count", $$msg{'packet_count'}, '==', $pkt_total ); + compare( "ofp_flow_removed packet_count", $$msg{'packet_count'}, '==', $pkt_total ); if ( defined $idle_timeout ) { - compare( "ofp_flow_expired idle_timeout", $$msg{'idle_timeout'}, '==', $idle_timeout ); + compare( "ofp_flow_removed idle_timeout", $$msg{'idle_timeout'}, '==', $idle_timeout ); } } @@ -1539,7 +1539,7 @@ sub forward_simple { } my $flow_mod_pkt; - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; if ($type eq 'drop') { $flow_mod_pkt = create_flow_mod_from_udp_action( $ofp, $test_pkt, $in_port, $out_port, $$options_ref{'max_idle'}, $flags, $wildcards, 'drop', $vlan_id ); @@ -1776,7 +1776,7 @@ sub forward_simple_icmp { my $fool_port = 0; my $flow_mod_pkt_fool; - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; if ($type eq 'all') { $out_port = $enums{'OFPP_ALL'}; # all physical ports except the input @@ -1910,16 +1910,16 @@ sub wait_for_two_flow_expired { # Inspect message my $msg_size = length($recvd_mesg); - my $expected_size = $ofp->sizeof('ofp_flow_expired'); + my $expected_size = $ofp->sizeof('ofp_flow_removed'); #compare( "msg size", length($recvd_mesg), '==', $expected_size ); - my $msg = $ofp->unpack( 'ofp_flow_expired', $recvd_mesg ); + my $msg = $ofp->unpack( 'ofp_flow_removed', $recvd_mesg ); #print Dumper($msg); # Verify fields #compare( "header version", $$msg{'header'}{'version'}, '==', $of_ver ); - #compare( "header type", $$msg{'header'}{'type'}, '==', $enums{'OFPT_FLOW_EXPIRED'} ); + #compare( "header type", $$msg{'header'}{'type'}, '==', $enums{'OFPT_FLOW_REMOVED'} ); #compare( "header length", $$msg{'header'}{'length'}, '==', $msg_size ); #compare( "byte_count", $$msg{'byte_count'}, '==', $bytes ); #compare( "packet_count", $$msg{'packet_count'}, '==', $pkt_total_size ); diff --git a/regress/projects/black_box/regress/test_barrier/run.pl b/regress/projects/black_box/regress/test_barrier/run.pl index 3f12b84..14bafa4 100755 --- a/regress/projects/black_box/regress/test_barrier/run.pl +++ b/regress/projects/black_box/regress/test_barrier/run.pl @@ -25,7 +25,7 @@ sub my_test { print $sock $packet; my $wildcards = 0x03fe; - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $packet = create_flow_mod_from_udp($ofp, $base_packet, $in_port, $out_port, $max_idle, $flags, $wildcards); # BAR diff --git a/regress/projects/black_box/regress/test_delete_send_flow_exp/run.pl b/regress/projects/black_box/regress/test_delete_send_flow_exp/run.pl index f53e17d..047a32b 100755 --- a/regress/projects/black_box/regress/test_delete_send_flow_exp/run.pl +++ b/regress/projects/black_box/regress/test_delete_send_flow_exp/run.pl @@ -34,7 +34,7 @@ sub my_test { } # Create a flow mod with expiry - $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); print $sock $flow_mod_pkt; diff --git a/regress/projects/black_box/regress/test_delete_strict/run.pl b/regress/projects/black_box/regress/test_delete_strict/run.pl index 6281383..fb8ca33 100755 --- a/regress/projects/black_box/regress/test_delete_strict/run.pl +++ b/regress/projects/black_box/regress/test_delete_strict/run.pl @@ -38,7 +38,7 @@ sub send_expect_exact_with_wildcard { # Flow entry -- exact match, $out_port my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_exact_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); @@ -106,7 +106,7 @@ sub delete_strict_send_expect { my $test_pkt2 = new NF2::UDP_pkt(%$test_pkt_args2); my $wildcards = $enums{'OFPFW_TP_SRC'} | $enums{'OFPFW_TP_DST'}; # wildcard match (don't care udp src/dst ports) - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_wildcard_pkt = # delete_strict_from_udp( $ofp, $test_pkt, $in_port, $out_port2, $wildcards ); diff --git a/regress/projects/black_box/regress/test_flow_expired/run.pl b/regress/projects/black_box/regress/test_flow_expired/run.pl index 75019a5..97ea35c 100755 --- a/regress/projects/black_box/regress/test_flow_expired/run.pl +++ b/regress/projects/black_box/regress/test_flow_expired/run.pl @@ -15,7 +15,7 @@ sub my_test { my $max_idle = 0x1; # second before flow expiration my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); diff --git a/regress/projects/black_box/regress/test_flow_expired_idle_timeout/run.pl b/regress/projects/black_box/regress/test_flow_expired_idle_timeout/run.pl index 1648224..5fa7492 100755 --- a/regress/projects/black_box/regress/test_flow_expired_idle_timeout/run.pl +++ b/regress/projects/black_box/regress/test_flow_expired_idle_timeout/run.pl @@ -15,7 +15,7 @@ sub my_test { my $max_idle = 0x1; # second before flow expiration my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); diff --git a/regress/projects/black_box/regress/test_flow_expired_send_flow_exp/run.pl b/regress/projects/black_box/regress/test_flow_expired_send_flow_exp/run.pl index 5eedaa9..4a47cae 100755 --- a/regress/projects/black_box/regress/test_flow_expired_send_flow_exp/run.pl +++ b/regress/projects/black_box/regress/test_flow_expired_send_flow_exp/run.pl @@ -29,7 +29,7 @@ sub my_test { } # Create a flow mod with expiry - $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); print $sock $flow_mod_pkt; diff --git a/regress/projects/black_box/regress/test_forward_after_expiration/run.pl b/regress/projects/black_box/regress/test_forward_after_expiration/run.pl index f81bf76..347051c 100755 --- a/regress/projects/black_box/regress/test_forward_after_expiration/run.pl +++ b/regress/projects/black_box/regress/test_forward_after_expiration/run.pl @@ -16,7 +16,7 @@ sub send_expect_exact { #print HexDump ( $test_pkt->packed ); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, diff --git a/regress/projects/black_box/regress/test_forward_overlapping_flow_entries/run.pl b/regress/projects/black_box/regress/test_forward_overlapping_flow_entries/run.pl index 02193f5..6ed870e 100755 --- a/regress/projects/black_box/regress/test_forward_overlapping_flow_entries/run.pl +++ b/regress/projects/black_box/regress/test_forward_overlapping_flow_entries/run.pl @@ -16,7 +16,7 @@ sub send_expect_multi_flow { #print HexDump ( $test_pkt->packed ); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, diff --git a/regress/projects/black_box/regress/test_ip_offset/run.pl b/regress/projects/black_box/regress/test_ip_offset/run.pl index eeea4aa..019b032 100755 --- a/regress/projects/black_box/regress/test_ip_offset/run.pl +++ b/regress/projects/black_box/regress/test_ip_offset/run.pl @@ -42,7 +42,7 @@ sub send_expect_exact { #print HexDump ( $test_pkt->packed ); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); diff --git a/regress/projects/black_box/regress/test_ip_options/run.pl b/regress/projects/black_box/regress/test_ip_options/run.pl index aaacb97..25cfd4d 100755 --- a/regress/projects/black_box/regress/test_ip_options/run.pl +++ b/regress/projects/black_box/regress/test_ip_options/run.pl @@ -34,7 +34,7 @@ sub send_expect_exact { #print HexDump ( $test_pkt->packed ); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards ); diff --git a/regress/projects/black_box/regress/test_set_nw_dst/run.pl b/regress/projects/black_box/regress/test_set_nw_dst/run.pl index c52f056..d0b5027 100755 --- a/regress/projects/black_box/regress/test_set_nw_dst/run.pl +++ b/regress/projects/black_box/regress/test_set_nw_dst/run.pl @@ -47,7 +47,7 @@ sub send_expect_exact { #print HexDump ($test_pkt->packed); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry # Get to the IP address in the expected packet - Jean II my $ref_to_ip_hdr = ( $expect_pkt->{'IP_hdr'} ); diff --git a/regress/projects/black_box/regress/test_set_nw_tos/run.pl b/regress/projects/black_box/regress/test_set_nw_tos/run.pl index ddbbc98..ffcbd8a 100755 --- a/regress/projects/black_box/regress/test_set_nw_tos/run.pl +++ b/regress/projects/black_box/regress/test_set_nw_tos/run.pl @@ -49,7 +49,7 @@ sub send_expect_exact { #print HexDump ($test_pkt->packed); my $wildcards = 0x0; # exact match - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry my $nw_tos = 0x56; my $flow_mod_pkt = create_flow_mod_from_udp_action($ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards, 'OFPFC_ADD', 'nw_tos', $nw_tos); diff --git a/regress/projects/black_box/regress/test_tcp_options/run.pl b/regress/projects/black_box/regress/test_tcp_options/run.pl index f5c9dba..cd7e553 100755 --- a/regress/projects/black_box/regress/test_tcp_options/run.pl +++ b/regress/projects/black_box/regress/test_tcp_options/run.pl @@ -129,7 +129,7 @@ sub send_tcp_op_expect_exact { $enums{'OFPFW_TP_DST'};# | # $enums{'OFPFW_NW_PROTO'}; # wildcard match (don't care udp src/dst ports) - my $flags = $enums{'OFPFF_SEND_FLOW_EXP'}; + my $flags = $enums{'OFPFF_SEND_FLOW_REM'}; my $flow_mod_pkt = create_flow_mod_from_ip( $ofp, $test_pkt, $in_port, $out_port, $max_idle, $flags, $wildcards, $src_tcp_port, $dst_tcp_port ); diff --git a/regress/projects/controller_disconnect/regress/test_emergency_table/run.pl b/regress/projects/controller_disconnect/regress/test_emergency_table/run.pl index 081ae05..55acfad 100755 --- a/regress/projects/controller_disconnect/regress/test_emergency_table/run.pl +++ b/regress/projects/controller_disconnect/regress/test_emergency_table/run.pl @@ -29,7 +29,7 @@ sub test_emergency_cache_first { # 1st flow entry -- exact match, normal flow table my $max_idle_no_expire = 0; my $normal_wildcards = 0x0; # exact match - my $normal_flags = $enums{'OFPFF_SEND_FLOW_EXP'}; # want flow expiry + my $normal_flags = $enums{'OFPFF_SEND_FLOW_REM'}; # want flow expiry my $flow_mod_normal_pkt = create_flow_mod_from_udp( $ofp, $test_pkt, $in_port, $out_port, $max_idle_no_expire, $normal_flags, $normal_wildcards ); diff --git a/secchan/flow-end.c b/secchan/flow-end.c index 2267beb..c0a4b50 100644 --- a/secchan/flow-end.c +++ b/secchan/flow-end.c @@ -187,7 +187,7 @@ send_netflow_msg(const struct nx_flow_end *nfe, struct flow_end_data *fe) static void send_ofp_expired(const struct nx_flow_end *nfe, const struct flow_end_data *fe) { - struct ofp_flow_expired *ofe; + struct ofp_flow_removed *ofe; struct ofpbuf *b; if ((nfe->reason != NXFER_IDLE_TIMEOUT) @@ -196,15 +196,15 @@ send_ofp_expired(const struct nx_flow_end *nfe, const struct flow_end_data *fe) return; } - ofe = make_openflow(sizeof(*ofe), OFPT_FLOW_EXPIRED, &b); + ofe = make_openflow(sizeof(*ofe), OFPT_FLOW_REMOVED, &b); ofe->match = nfe->match; ofe->priority = nfe->priority; if (nfe->reason == NXFER_IDLE_TIMEOUT) { - ofe->reason = OFPER_IDLE_TIMEOUT; + ofe->reason = OFPRR_IDLE_TIMEOUT; } else if (nfe->reason == NXFER_HARD_TIMEOUT) { - ofe->reason = OFPER_HARD_TIMEOUT; + ofe->reason = OFPRR_HARD_TIMEOUT; } else { - ofe->reason = OFPER_DELETE; + ofe->reason = OFPRR_DELETE; } /* 'duration' is in seconds, but we keeping track of milliseconds. */ ofe->duration = htonl((ntohll(nfe->end_time)-ntohll(nfe->init_time))/1000); diff --git a/secchan/protocol-stat.c b/secchan/protocol-stat.c index 404ed26..d54548b 100644 --- a/secchan/protocol-stat.c +++ b/secchan/protocol-stat.c @@ -75,7 +75,7 @@ do { \ COPY_OFPS(dst_ofps, src_ofps, ofps_get_config_reply); \ COPY_OFPS(dst_ofps, src_ofps, ofps_set_config); \ COPY_OFPS(dst_ofps, src_ofps, ofps_packet_in); \ - COPY_OFPS(dst_ofps, src_ofps, ofps_flow_expired); \ + COPY_OFPS(dst_ofps, src_ofps, ofps_flow_removed); \ COPY_OFPS(dst_ofps, src_ofps, ofps_port_status); \ COPY_OFPS(dst_ofps, src_ofps, ofps_packet_out); \ COPY_OFPS(dst_ofps, src_ofps, ofps_flow_mod); \ diff --git a/secchan/secchan.c b/secchan/secchan.c index ac278e7..61a8bf0 100644 --- a/secchan/secchan.c +++ b/secchan/secchan.c @@ -388,7 +388,7 @@ vconn_name_without_subscription(const char *vconn_name) if (sscanf(vconn_name, "nl:%d", &nl_index) == 1) { /* nl:123 or nl:123:1 opens a netlink connection to local datapath 123. * nl:123:0 opens a netlink connection to local datapath 123 without - * obtaining a subscription for ofp_packet_in or ofp_flow_expired + * obtaining a subscription for ofp_packet_in or ofp_flow_removed * messages. */ return xasprintf("nl:%d:0", nl_index); } else { diff --git a/udatapath/datapath.c b/udatapath/datapath.c index 8d58dc6..7c30376 100644 --- a/udatapath/datapath.c +++ b/udatapath/datapath.c @@ -1019,7 +1019,7 @@ add_flow(struct datapath *dp, const struct sender *sender, /* Fill out flow. */ flow->idle_timeout = ntohs(ofm->idle_timeout); flow->hard_timeout = ntohs(ofm->hard_timeout); - flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_EXP) ? 1 : 0; + flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_REM) ? 1 : 0; flow_setup_actions(flow, ofm->actions, actions_len); /* Act. */ @@ -1092,7 +1092,7 @@ mod_flow(struct datapath *dp, const struct sender *sender, /* Fill out flow. */ flow->idle_timeout = ntohs(ofm->idle_timeout); flow->hard_timeout = ntohs(ofm->hard_timeout); - flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_EXP) ? 1 : 0; + flow->send_flow_exp = (ntohs(ofm->flags) & OFPFF_SEND_FLOW_REM) ? 1 : 0; flow_setup_actions(flow, ofm->actions, actions_len); error = chain_insert(dp->chain, flow, (ntohs(ofm->flags) & OFPFF_EMERG) ? 1 : 0); diff --git a/utilities/dpctl.c b/utilities/dpctl.c index 473607a..9bde664 100644 --- a/utilities/dpctl.c +++ b/utilities/dpctl.c @@ -560,10 +560,10 @@ print_protocol_stat(struct ofpstat *ofps_rcvd, struct ofpstat *ofps_sent) ntohll(ifps->ofps_set_config)); fprintf(stdout, PREFIX_STR - "%"PRIu64" packet in, %"PRIu64" flow expried, " + "%"PRIu64" packet in, %"PRIu64" flow removed, " "%"PRIu64" port status\n", ntohll(ifps->ofps_packet_in), - ntohll(ifps->ofps_flow_expired), + ntohll(ifps->ofps_flow_removed), ntohll(ifps->ofps_port_status)); fprintf(stdout, PREFIX_STR diff --git a/utilities/wireshark_dissectors/openflow/packet-openflow.c b/utilities/wireshark_dissectors/openflow/packet-openflow.c index f469464..0d86939 100644 --- a/utilities/wireshark_dissectors/openflow/packet-openflow.c +++ b/utilities/wireshark_dissectors/openflow/packet-openflow.c @@ -69,7 +69,7 @@ static const value_string names_ofp_type[] = { /* Asynchronous messages. */ { OFPT_PACKET_IN, "Packet In (AM)" }, - { OFPT_FLOW_EXPIRED, "Flow Expired (AM)" }, + { OFPT_FLOW_REMOVED, "Flow Removed (AM)" }, { OFPT_PORT_STATUS, "Port Status (AM)" }, /* Controller command messages. */ @@ -171,15 +171,15 @@ static const value_string names_ofp_packet_in_reason[] = { { 0, NULL } }; -/** names from ofp_flow_expired_reason */ -static const value_string names_ofp_flow_expired_reason[] = { - { OFPER_IDLE_TIMEOUT, "Flow idle time exceeded idle_timeout" }, - { OFPER_HARD_TIMEOUT, "Time exceeded hard_timeout" }, - { OFPER_DELETE, "Evicted by a DELETE flow mod." }, +/** names from ofp_flow_removed_reason */ +static const value_string names_ofp_flow_removed_reason[] = { + { OFPRR_IDLE_TIMEOUT, "Flow idle time exceeded idle_timeout" }, + { OFPRR_HARD_TIMEOUT, "Time exceeded hard_timeout" }, + { OFPRR_DELETE, "Evicted by a DELETE flow mod." }, { 0, NULL } }; -/** names from ofp_flow_expired_reason */ +/** names from ofp_flow_removed_reason */ static const value_string names_ip_frag[] = { { OFPC_FRAG_NORMAL, "No special handling for fragments." }, { OFPC_FRAG_DROP, "Drop fragments." }, @@ -557,14 +557,14 @@ static gint ofp_packet_in_in_port = -1; static gint ofp_packet_in_reason = -1; static gint ofp_packet_in_data_hdr = -1; -static gint ofp_flow_expired = -1; +static gint ofp_flow_removed = -1; /* field: ofp_match */ -static gint ofp_flow_expired_priority = -1; -static gint ofp_flow_expired_reason = -1; -static gint ofp_flow_expired_duration = -1; -static gint ofp_flow_expired_idle_timeout = -1; -static gint ofp_flow_expired_packet_count = -1; -static gint ofp_flow_expired_byte_count = -1; +static gint ofp_flow_removed_priority = -1; +static gint ofp_flow_removed_reason = -1; +static gint ofp_flow_removed_duration = -1; +static gint ofp_flow_removed_idle_timeout = -1; +static gint ofp_flow_removed_packet_count = -1; +static gint ofp_flow_removed_byte_count = -1; static gint ofp_port_status = -1; static gint ofp_port_status_reason = -1; @@ -631,7 +631,7 @@ static gint ett_ofp_packet_out_data_hdr = -1; /* Asynchronous Messages */ static gint ett_ofp_packet_in = -1; static gint ett_ofp_packet_in_data_hdr = -1; -static gint ett_ofp_flow_expired = -1; +static gint ett_ofp_flow_removed = -1; static gint ett_ofp_port_status = -1; static gint ett_ofp_error_msg = -1; static gint ett_ofp_error_msg_data = -1; @@ -1283,7 +1283,7 @@ void proto_register_openflow() { "Out Port (delete* only)", "of.fm_out_port", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Out Port (delete* only)", HFILL } }, { &ofp_flow_mod_flags[0], - { "Send flow expirations", "of.fm_flags", FT_UINT16, BASE_DEC, VALS(names_choice), OFPFF_SEND_FLOW_EXP, "Send flow expirations", HFILL }}, + { "Send flow expirations", "of.fm_flags", FT_UINT16, BASE_DEC, VALS(names_choice), OFPFF_SEND_FLOW_REM, "Send flow expirations", HFILL }}, { &ofp_flow_mod_flags[1], { "Check for overlap before adding flow", "of.fm_flags", FT_UINT16, BASE_DEC, VALS(names_choice), OFPFF_CHECK_OVERLAP, "Check for overlap before adding flow", HFILL } }, @@ -1295,26 +1295,26 @@ void proto_register_openflow() { "Reserved", "of.fm_reserved", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Reserved", HFILL } }, - /* AM: Flow Expired */ - { &ofp_flow_expired, - { "Flow Expired", "of.fe", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Expired", HFILL } }, + /* AM: Flow Removed */ + { &ofp_flow_removed, + { "Flow Removed", "of.fe", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Removed", HFILL } }, - { &ofp_flow_expired_priority, + { &ofp_flow_removed_priority, { "Priority", "of.fe_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, - { &ofp_flow_expired_reason, - { "Reason", "of.fe_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_flow_expired_reason), NO_MASK, "Reason", HFILL } }, + { &ofp_flow_removed_reason, + { "Reason", "of.fe_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_flow_removed_reason), NO_MASK, "Reason", HFILL } }, - { &ofp_flow_expired_duration, + { &ofp_flow_removed_duration, { "Flow Duration (sec)", "of.fe_duration", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Time Flow was Alive (sec)", HFILL } }, - { &ofp_flow_expired_idle_timeout, + { &ofp_flow_removed_idle_timeout, { "Idle Time (sec) Before Discarding", "of.fe_idle_timeout", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Idle Time (sec) Before Discarding", HFILL } }, - { &ofp_flow_expired_packet_count, + { &ofp_flow_removed_packet_count, { "Packet Count", "of.fe_packet_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Packet Cout", HFILL } }, - { &ofp_flow_expired_byte_count, + { &ofp_flow_removed_byte_count, { "Byte Count", "of.fe_byte_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Byte Count", HFILL } }, @@ -1660,7 +1660,7 @@ void proto_register_openflow() &ett_ofp_packet_out_actions_hdr, &ett_ofp_packet_in, &ett_ofp_packet_in_data_hdr, - &ett_ofp_flow_expired, + &ett_ofp_flow_removed, &ett_ofp_port_status, &ett_ofp_error_msg, &ett_ofp_error_msg_data, @@ -2623,19 +2623,19 @@ static void dissect_openflow_message(tvbuff_t *tvb, packet_info *pinfo, proto_tr break; } - case OFPT_FLOW_EXPIRED: { - type_item = proto_tree_add_item(ofp_tree, ofp_flow_expired, tvb, offset, -1, FALSE); - type_tree = proto_item_add_subtree(type_item, ett_ofp_flow_expired); + case OFPT_FLOW_REMOVED: { + type_item = proto_tree_add_item(ofp_tree, ofp_flow_removed, tvb, offset, -1, FALSE); + type_tree = proto_item_add_subtree(type_item, ett_ofp_flow_removed); dissect_match(type_tree, type_item, tvb, pinfo, &offset); - add_child(type_tree, ofp_flow_expired_priority, tvb, &offset, 2); - add_child(type_tree, ofp_flow_expired_reason, tvb, &offset, 1); + add_child(type_tree, ofp_flow_removed_priority, tvb, &offset, 2); + add_child(type_tree, ofp_flow_removed_reason, tvb, &offset, 1); dissect_pad(type_tree, &offset, 1); - add_child(type_tree, ofp_flow_expired_duration, tvb, &offset, 4); - add_child(type_tree, ofp_flow_expired_idle_timeout, tvb, &offset, 2); + add_child(type_tree, ofp_flow_removed_duration, tvb, &offset, 4); + add_child(type_tree, ofp_flow_removed_idle_timeout, tvb, &offset, 2); dissect_pad(type_tree, &offset, 2); - add_child(type_tree, ofp_flow_expired_packet_count, tvb, &offset, 8); - add_child(type_tree, ofp_flow_expired_byte_count, tvb, &offset, 8); + add_child(type_tree, ofp_flow_removed_packet_count, tvb, &offset, 8); + add_child(type_tree, ofp_flow_removed_byte_count, tvb, &offset, 8); break; }