X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fodp-util.c;h=511ec3a99f8b403273d0b7a25cebb4817f862c1b;hb=b827c67b9e59af0daee434df715e3bc3f945c249;hp=b497538d522af9e490ac241789aeec83dc9c89a9;hpb=a01ef04ced0d3e04e7d5e5038ef76c861b5c1da3;p=openvswitch diff --git a/lib/odp-util.c b/lib/odp-util.c index b497538d..511ec3a9 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -71,27 +71,10 @@ format_odp_action(struct ds *ds, const union odp_action *a) case ODPAT_SET_TUNNEL: ds_put_format(ds, "set_tunnel(0x%08"PRIx32")", ntohl(a->tunnel.tun_id)); break; - case ODPAT_SET_DL_TCI: { - int vid = vlan_tci_to_vid(a->dl_tci.tci); - int pcp = vlan_tci_to_pcp(a->dl_tci.tci); - - ds_put_cstr(ds, "set_tci("); - switch (ntohs(a->dl_tci.mask)) { - case VLAN_VID_MASK: - ds_put_format(ds, "set_tci(vlan=%d)", vid); - break; - case VLAN_PCP_MASK: - ds_put_format(ds, "set_tci(pcp=%d)", pcp); - break; - case VLAN_VID_MASK | VLAN_PCP_MASK: - ds_put_format(ds, "set_tci(vlan=%d,pcp=%d)", vid, pcp); - break; - default: - ds_put_format(ds, "set_tci(tci=%04"PRIx16",mask=%04"PRIx16")", - ntohs(a->dl_tci.tci), ntohs(a->dl_tci.mask)); - break; - } - } + case ODPAT_SET_DL_TCI: + ds_put_format(ds, "set_tci(vid=%"PRIu16",pcp=%d)", + vlan_tci_to_vid(a->dl_tci.tci), + vlan_tci_to_pcp(a->dl_tci.tci)); break; case ODPAT_STRIP_VLAN: ds_put_format(ds, "strip_vlan");