{
struct ofconn *ofconn;
- HMAP_FOR_EACH_WITH_HASH (ofconn, struct ofconn, hmap_node,
+ HMAP_FOR_EACH_WITH_HASH (ofconn, hmap_node,
hash_string(target, 0), &ofproto->controllers) {
if (!strcmp(ofconn_get_target(ofconn), target)) {
return ofconn;
/* Add all the remotes. */
discovery = false;
- HMAP_FOR_EACH (ofconn, struct ofconn, hmap_node, &ofproto->controllers) {
+ HMAP_FOR_EACH (ofconn, hmap_node, &ofproto->controllers) {
struct sockaddr_in *sin = &addrs[n_addrs];
if (ofconn->band == OFPROTO_OUT_OF_BAND) {
n = 0;
rconns = xmalloc(hmap_count(&p->controllers) * sizeof *rconns);
- HMAP_FOR_EACH (ofconn, struct ofconn, hmap_node, &p->controllers) {
+ HMAP_FOR_EACH (ofconn, hmap_node, &p->controllers) {
rconns[n++] = ofconn->rconn;
}
/* Delete controllers that are no longer configured.
* Update configuration of all now-existing controllers. */
ss_exists = false;
- HMAP_FOR_EACH_SAFE (ofconn, next_ofconn, struct ofconn, hmap_node,
- &p->controllers) {
+ HMAP_FOR_EACH_SAFE (ofconn, next_ofconn, hmap_node, &p->controllers) {
struct ofproto_controller *c;
c = shash_find_data(&new_controllers, ofconn_get_target(ofconn));
/* Delete services that are no longer configured.
* Update configuration of all now-existing services. */
- HMAP_FOR_EACH_SAFE (ofservice, next_ofservice, struct ofservice, node,
- &p->services) {
+ HMAP_FOR_EACH_SAFE (ofservice, next_ofservice, node, &p->services) {
struct ofproto_controller *c;
c = shash_find_data(&new_controllers,
{
struct ofconn *ofconn;
- LIST_FOR_EACH (ofconn, struct ofconn, node, &ofproto->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &ofproto->all_conns) {
rconn_reconnect(ofconn->rconn);
}
}
os = ofproto->sflow = ofproto_sflow_create(ofproto->dpif);
refresh_port_groups(ofproto);
- HMAP_FOR_EACH (ofport, struct ofport, hmap_node, &ofproto->ports) {
+ HMAP_FOR_EACH (ofport, hmap_node, &ofproto->ports) {
ofproto_sflow_add_port(os, ofport->odp_port,
netdev_get_name(ofport->netdev));
}
ofproto_flush_flows(p);
classifier_destroy(&p->cls);
- LIST_FOR_EACH_SAFE (ofconn, next_ofconn, struct ofconn, node,
- &p->all_conns) {
+ LIST_FOR_EACH_SAFE (ofconn, next_ofconn, node, &p->all_conns) {
ofconn_destroy(ofconn);
}
hmap_destroy(&p->controllers);
dpif_close(p->dpif);
netdev_monitor_destroy(p->netdev_monitor);
- HMAP_FOR_EACH_SAFE (ofport, next_ofport, struct ofport, hmap_node,
- &p->ports) {
+ HMAP_FOR_EACH_SAFE (ofport, next_ofport, hmap_node, &p->ports) {
hmap_remove(&p->ports, &ofport->hmap_node);
ofport_free(ofport);
}
netflow_destroy(p->netflow);
ofproto_sflow_destroy(p->sflow);
- HMAP_FOR_EACH_SAFE (ofservice, next_ofservice, struct ofservice, node,
- &p->services) {
+ HMAP_FOR_EACH_SAFE (ofservice, next_ofservice, node, &p->services) {
ofservice_destroy(p, ofservice);
}
hmap_destroy(&p->services);
/* Pick a controller for monitoring. */
best = NULL;
- LIST_FOR_EACH (ofconn, struct ofconn, node, &ofproto->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &ofproto->all_conns) {
if (ofconn->type == OFCONN_PRIMARY
&& (!best || snoop_preference(ofconn) > snoop_preference(best))) {
best = ofconn;
in_band_run(p->in_band);
}
- LIST_FOR_EACH_SAFE (ofconn, next_ofconn, struct ofconn, node,
- &p->all_conns) {
+ LIST_FOR_EACH_SAFE (ofconn, next_ofconn, node, &p->all_conns) {
ofconn_run(ofconn, p);
}
fail_open_run(p->fail_open);
}
- HMAP_FOR_EACH (ofservice, struct ofservice, node, &p->services) {
+ HMAP_FOR_EACH (ofservice, node, &p->services) {
struct vconn *vconn;
int retval;
dpif_recv_wait(p->dpif);
dpif_port_poll_wait(p->dpif);
netdev_monitor_poll_wait(p->netdev_monitor);
- LIST_FOR_EACH (ofconn, struct ofconn, node, &p->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &p->all_conns) {
ofconn_wait(ofconn);
}
if (p->in_band) {
} else if (p->next_expiration != LLONG_MAX) {
poll_timer_wait_until(p->next_expiration);
}
- HMAP_FOR_EACH (ofservice, struct ofservice, node, &p->services) {
+ HMAP_FOR_EACH (ofservice, node, &p->services) {
pvconn_wait(ofservice->pvconn);
}
for (i = 0; i < p->n_snoops; i++) {
size_t i;
svec_init(&devnames);
- HMAP_FOR_EACH (ofport, struct ofport, hmap_node, &p->ports) {
+ HMAP_FOR_EACH (ofport, hmap_node, &p->ports) {
svec_add (&devnames, (char *) ofport->opp.name);
}
dpif_port_list(p->dpif, &odp_ports, &n_odp_ports);
ports = xmalloc(hmap_count(&p->ports) * sizeof *ports);
n_ports = 0;
- HMAP_FOR_EACH (port, struct ofport, hmap_node, &p->ports) {
+ HMAP_FOR_EACH (port, hmap_node, &p->ports) {
if (group == DP_GROUP_ALL || !(port->opp.config & OFPPC_NO_FLOOD)) {
ports[n_ports++] = port->odp_port;
}
{
/* XXX Should limit the number of queued port status change messages. */
struct ofconn *ofconn;
- LIST_FOR_EACH (ofconn, struct ofconn, node, &p->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &p->all_conns) {
struct ofp_port_status *ops;
struct ofpbuf *b;
{
struct ofport *port;
- HMAP_FOR_EACH_IN_BUCKET (port, struct ofport, hmap_node,
+ HMAP_FOR_EACH_IN_BUCKET (port, hmap_node,
hash_int(odp_port, 0), &ofproto->ports) {
if (port->odp_port == odp_port) {
return port;
{
struct ofservice *ofservice;
- HMAP_FOR_EACH_WITH_HASH (ofservice, struct ofservice, node,
- hash_string(target, 0), &ofproto->services) {
+ HMAP_FOR_EACH_WITH_HASH (ofservice, node, hash_string(target, 0),
+ &ofproto->services) {
if (!strcmp(pvconn_get_name(ofservice->pvconn), target)) {
return ofservice;
}
{
if (!rule->super) {
struct rule *subrule, *next;
- LIST_FOR_EACH_SAFE (subrule, next, struct rule, list, &rule->list) {
+ LIST_FOR_EACH_SAFE (subrule, next, list, &rule->list) {
revalidate_rule(ofproto, subrule);
}
} else {
(1u << OFPAT_SET_TP_DST) |
(1u << OFPAT_ENQUEUE));
- HMAP_FOR_EACH (port, struct ofport, hmap_node, &p->ports) {
+ HMAP_FOR_EACH (port, hmap_node, &p->ports) {
hton_ofp_phy_port(ofpbuf_put(buf, &port->opp, sizeof port->opp));
}
append_port_stat(port, ofconn, &msg);
}
} else {
- HMAP_FOR_EACH (port, struct ofport, hmap_node, &p->ports) {
+ HMAP_FOR_EACH (port, hmap_node, &p->ports) {
append_port_stat(port, ofconn, &msg);
}
}
odp_flows = xzalloc(n_odp_flows * sizeof *odp_flows);
if (rule->cr.wc.wildcards) {
size_t i = 0;
- LIST_FOR_EACH (subrule, struct rule, list, &rule->list) {
+ LIST_FOR_EACH (subrule, list, &rule->list) {
odp_flows[i++].key = subrule->cr.flow;
packet_count += subrule->packet_count;
byte_count += subrule->byte_count;
port_no = ntohs(qsr->port_no);
queue_id = ntohl(qsr->queue_id);
if (port_no == OFPP_ALL) {
- HMAP_FOR_EACH (port, struct ofport, hmap_node, &ofproto->ports) {
+ HMAP_FOR_EACH (port, hmap_node, &ofproto->ports) {
handle_queue_stats_for_port(port, queue_id, &cbdata);
}
} else if (port_no < ofproto->max_ports) {
if (role == NX_ROLE_MASTER) {
struct ofconn *other;
- HMAP_FOR_EACH (other, struct ofconn, hmap_node,
- &ofproto->controllers) {
+ HMAP_FOR_EACH (other, hmap_node, &ofproto->controllers) {
if (other->role == NX_ROLE_MASTER) {
other->role = NX_ROLE_SLAVE;
}
* requests that would not add new flows, so it is imperfect.) */
prev = NULL;
- LIST_FOR_EACH (ofconn, struct ofconn, node, &p->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &p->all_conns) {
if (rule->send_flow_removed && rconn_is_connected(ofconn->rconn)
&& ofconn_receives_async_msgs(ofconn)) {
if (prev) {
* due to an idle timeout. */
if (rule->cr.wc.wildcards) {
struct rule *subrule, *next;
- LIST_FOR_EACH_SAFE (subrule, next, struct rule, list, &rule->list) {
+ LIST_FOR_EACH_SAFE (subrule, next, list, &rule->list) {
rule_remove(p, subrule);
}
} else {
max_len = do_convert_to_packet_in(packet);
prev = NULL;
- LIST_FOR_EACH (ofconn, struct ofconn, node, &ofproto->all_conns) {
+ LIST_FOR_EACH (ofconn, node, &ofproto->all_conns) {
if (ofconn_receives_async_msgs(ofconn)) {
if (prev) {
schedule_packet_in(prev, packet, max_len, true);