bool use_priority_tags; /* Use 802.1p tag for frames in VLAN 0? */
/* Status. */
- bool floodable; /* True if no port has OFPPC_NO_FLOOD set. */
+ bool floodable; /* True if no port has OFPUTIL_PC_NO_FLOOD set. */
/* Port mirroring info. */
mirror_mask_t src_mirrors; /* Mirrors triggered when packet received. */
static void
get_features(struct ofproto *ofproto_ OVS_UNUSED,
- bool *arp_match_ip, uint32_t *actions)
+ bool *arp_match_ip, enum ofputil_action_bitmap *actions)
{
*arp_match_ip = true;
- *actions = ((1u << OFPAT10_OUTPUT) |
- (1u << OFPAT10_SET_VLAN_VID) |
- (1u << OFPAT10_SET_VLAN_PCP) |
- (1u << OFPAT10_STRIP_VLAN) |
- (1u << OFPAT10_SET_DL_SRC) |
- (1u << OFPAT10_SET_DL_DST) |
- (1u << OFPAT10_SET_NW_SRC) |
- (1u << OFPAT10_SET_NW_DST) |
- (1u << OFPAT10_SET_NW_TOS) |
- (1u << OFPAT10_SET_TP_SRC) |
- (1u << OFPAT10_SET_TP_DST) |
- (1u << OFPAT10_ENQUEUE));
+ *actions = (OFPUTIL_A_OUTPUT |
+ OFPUTIL_A_SET_VLAN_VID |
+ OFPUTIL_A_SET_VLAN_PCP |
+ OFPUTIL_A_STRIP_VLAN |
+ OFPUTIL_A_SET_DL_SRC |
+ OFPUTIL_A_SET_DL_DST |
+ OFPUTIL_A_SET_NW_SRC |
+ OFPUTIL_A_SET_NW_DST |
+ OFPUTIL_A_SET_NW_TOS |
+ OFPUTIL_A_SET_TP_SRC |
+ OFPUTIL_A_SET_TP_DST |
+ OFPUTIL_A_ENQUEUE);
}
static void
}
static void
-port_reconfigured(struct ofport *port_, ovs_be32 old_config)
+port_reconfigured(struct ofport *port_, enum ofputil_port_config old_config)
{
struct ofport_dpif *port = ofport_dpif_cast(port_);
struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto);
- ovs_be32 changed = old_config ^ port->up.opp.config;
+ enum ofputil_port_config changed = old_config ^ port->up.pp.config;
- if (changed & htonl(OFPPC_NO_RECV | OFPPC_NO_RECV_STP |
- OFPPC_NO_FWD | OFPPC_NO_FLOOD)) {
+ if (changed & (OFPUTIL_PC_NO_RECV | OFPUTIL_PC_NO_RECV_STP |
+ OFPUTIL_PC_NO_FWD | OFPUTIL_PC_NO_FLOOD)) {
ofproto->need_revalidate = true;
- if (changed & htonl(OFPPC_NO_FLOOD) && port->bundle) {
+ if (changed & OFPUTIL_PC_NO_FLOOD && port->bundle) {
bundle_update(port->bundle);
}
}
/* Update state. */
if (ofport->stp_state != state) {
- ovs_be32 of_state;
+ enum ofputil_port_state of_state;
bool fwd_change;
VLOG_DBG_RL(&rl, "port %s: STP state changed from %s to %s",
}
/* Update the STP state bits in the OpenFlow port description. */
- of_state = (ofport->up.opp.state & htonl(~OFPPS_STP_MASK))
- | htonl(state == STP_LISTENING ? OFPPS_STP_LISTEN
- : state == STP_LEARNING ? OFPPS_STP_LEARN
- : state == STP_FORWARDING ? OFPPS_STP_FORWARD
- : state == STP_BLOCKING ? OFPPS_STP_BLOCK
- : 0);
+ of_state = ofport->up.pp.state & ~OFPUTIL_PS_STP_MASK;
+ of_state |= (state == STP_LISTENING ? OFPUTIL_PS_STP_LISTEN
+ : state == STP_LEARNING ? OFPUTIL_PS_STP_LEARN
+ : state == STP_FORWARDING ? OFPUTIL_PS_STP_FORWARD
+ : state == STP_BLOCKING ? OFPUTIL_PS_STP_BLOCK
+ : 0);
ofproto_port_set_state(&ofport->up, of_state);
}
}
bundle->floodable = true;
LIST_FOR_EACH (port, bundle_node, &bundle->ports) {
- if (port->up.opp.config & htonl(OFPPC_NO_FLOOD)) {
+ if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD
+ || !stp_forward_in_state(port->stp_state)) {
bundle->floodable = false;
break;
}
port->bundle = bundle;
list_push_back(&bundle->ports, &port->bundle_node);
- if (port->up.opp.config & htonl(OFPPC_NO_FLOOD)) {
+ if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD
+ || !stp_forward_in_state(port->stp_state)) {
bundle->floodable = false;
}
}
struct ofpbuf packet;
ofpbuf_init(&packet, 0);
- cfm_compose_ccm(ofport->cfm, &packet, ofport->up.opp.hw_addr);
+ cfm_compose_ccm(ofport->cfm, &packet, ofport->up.pp.hw_addr);
send_packet(ofport, &packet);
ofpbuf_uninit(&packet);
}
rule = rule_dpif_lookup(ofproto, flow, 0);
if (!rule) {
- /* Don't send a packet-in if OFPPC_NO_PACKET_IN asserted. */
+ /* Don't send a packet-in if OFPUTIL_PC_NO_PACKET_IN asserted. */
struct ofport_dpif *port = get_ofp_port(ofproto, flow->in_port);
if (port) {
- if (port->up.opp.config & htonl(OFPPC_NO_PACKET_IN)) {
+ if (port->up.pp.config & OFPUTIL_PC_NO_PACKET_IN) {
COVERAGE_INC(ofproto_dpif_no_packet_in);
/* XXX install 'drop' flow entry */
return;
if (ofport) {
struct priority_to_dscp *pdscp;
- if (ofport->up.opp.config & htonl(OFPPC_NO_FWD)
+ if (ofport->up.pp.config & OFPUTIL_PC_NO_FWD
|| (check_stp && !stp_forward_in_state(ofport->stp_state))) {
return;
}
if (all) {
compose_output_action__(ctx, ofp_port, false);
- } else if (!(ofport->up.opp.config & htonl(OFPPC_NO_FLOOD))) {
+ } else if (!(ofport->up.pp.config & OFPUTIL_PC_NO_FLOOD)) {
compose_output_action(ctx, ofp_port);
}
}
static bool
may_receive(const struct ofport_dpif *port, struct action_xlate_ctx *ctx)
{
- if (port->up.opp.config & (eth_addr_equals(ctx->flow.dl_dst, eth_addr_stp)
- ? htonl(OFPPC_NO_RECV_STP)
- : htonl(OFPPC_NO_RECV))) {
+ if (port->up.pp.config & (eth_addr_equals(ctx->flow.dl_dst, eth_addr_stp)
+ ? OFPUTIL_PC_NO_RECV_STP
+ : OFPUTIL_PC_NO_RECV)) {
return false;
}