static void update_port_flags(struct datapath *, const struct ofp_port_mod *);
static int update_port_status(struct sw_port *p);
static void send_port_status(struct sw_port *p, uint8_t status);
-static void del_switch_port(struct sw_port *p);
/* Buffers are identified by a 31-bit opaque ID. We divide the ID
* into a buffer number (low bits) and a cookie (high bits). The buffer number
}
}
-/* Delete 'p' from switch. */
-static void
-del_switch_port(struct sw_port *p)
-{
- send_port_status(p, OFPPR_DELETE);
- netdev_close(p->netdev);
- p->netdev = NULL;
- list_remove(&p->node);
-}
-
-void
-dp_destroy(struct datapath *dp)
-{
- struct sw_port *p, *n;
-
- if (!dp) {
- return;
- }
-
- LIST_FOR_EACH_SAFE (p, n, struct sw_port, node, &dp->port_list) {
- del_switch_port(p);
- }
- chain_destroy(dp->chain);
- free(dp);
-}
-
/* Send packets out all the ports except the originating one. If the
* "flood" argument is set, don't send out ports with flooding disabled.
*/