+ ofpact_init_AUTOPATH(autopath);
+ autopath->dst.field = mf_from_nxm_header(ntohl(nap->dst));
+ autopath->dst.ofs = nxm_decode_ofs(nap->ofs_nbits);
+ autopath->dst.n_bits = nxm_decode_n_bits(nap->ofs_nbits);
+ autopath->port = ntohl(nap->id);
+
+ if (autopath->dst.n_bits < 16) {
+ VLOG_WARN("at least 16 bit destination is required for autopath "
+ "action.");
+ return OFPERR_OFPBAC_BAD_ARGUMENT;
+ }
+
+ return autopath_check(autopath, NULL);
+}
+
+enum ofperr
+autopath_check(const struct ofpact_autopath *autopath, const struct flow *flow)
+{
+ VLOG_WARN_ONCE("The autopath action is deprecated and may be removed in"
+ " February 2013. Please email dev@openvswitch.org with"
+ " concerns.");
+ return mf_check_dst(&autopath->dst, flow);
+}
+
+void
+autopath_to_nxast(const struct ofpact_autopath *autopath,
+ struct ofpbuf *openflow)
+{
+ struct nx_action_autopath *ap;
+
+ ap = ofputil_put_NXAST_AUTOPATH__DEPRECATED(openflow);
+ ap->ofs_nbits = nxm_encode_ofs_nbits(autopath->dst.ofs,
+ autopath->dst.n_bits);
+ ap->dst = htonl(autopath->dst.field->nxm_header);
+ ap->id = htonl(autopath->port);