+/* Modifies 'match' so that the MPLS label is wildcarded. */
+void
+match_set_any_mpls_label(struct match *match)
+{
+ match->wc.masks.mpls_lse &= ~htonl(MPLS_LABEL_MASK);
+ flow_set_mpls_label(&match->flow, htonl(0));
+}
+
+/* Modifies 'match' so that it matches only packets with an MPLS header whose
+ * label equals the low 20 bits of 'mpls_label'. */
+void
+match_set_mpls_label(struct match *match, ovs_be32 mpls_label)
+{
+ match->wc.masks.mpls_lse |= htonl(MPLS_LABEL_MASK);
+ flow_set_mpls_label(&match->flow, mpls_label);
+}
+
+/* Modifies 'match' so that the MPLS TC is wildcarded. */
+void
+match_set_any_mpls_tc(struct match *match)
+{
+ match->wc.masks.mpls_lse &= ~htonl(MPLS_TC_MASK);
+ flow_set_mpls_tc(&match->flow, 0);
+}
+
+/* Modifies 'match' so that it matches only packets with an MPLS header whose
+ * Traffic Class equals the low 3 bits of 'mpls_tc'. */
+void
+match_set_mpls_tc(struct match *match, uint8_t mpls_tc)
+{
+ match->wc.masks.mpls_lse |= htonl(MPLS_TC_MASK);
+ flow_set_mpls_tc(&match->flow, mpls_tc);
+}
+
+/* Modifies 'match' so that the MPLS stack flag is wildcarded. */
+void
+match_set_any_mpls_bos(struct match *match)
+{
+ match->wc.masks.mpls_lse &= ~htonl(MPLS_BOS_MASK);
+ flow_set_mpls_bos(&match->flow, 0);
+}
+
+/* Modifies 'match' so that it matches only packets with an MPLS header whose
+ * Stack Flag equals the lower bit of 'mpls_bos' */
+void
+match_set_mpls_bos(struct match *match, uint8_t mpls_bos)
+{
+ match->wc.masks.mpls_lse |= htonl(MPLS_BOS_MASK);
+ flow_set_mpls_bos(&match->flow, mpls_bos);
+}
+