xenserver: Don't delete pidfile when stopping monitor-external-ids
[openvswitch] / lib / ofp-parse.c
index 9068772f898dce8b7ad9fd9ef701126817f0ebf3..06d5bd11d6cf61dc62aa952d6b5f0d60f2116407 100644 (file)
@@ -144,6 +144,14 @@ put_output_action(struct ofpbuf *b, uint16_t port)
     return oao;
 }
 
+static void
+put_enqueue_action(struct ofpbuf *b, uint16_t port, uint32_t queue)
+{
+    struct ofp_action_enqueue *oae = put_action(b, sizeof *oae, OFPAT_ENQUEUE);
+    oae->port = htons(port);
+    oae->queue_id = htonl(queue);
+}
+
 static void
 put_dl_addr_action(struct ofpbuf *b, uint16_t type, const char *addr)
 {
@@ -255,8 +263,21 @@ str_to_action(char *str, struct ofpbuf *b)
             nast->vendor = htonl(NX_VENDOR_ID);
             nast->subtype = htons(NXAST_SET_TUNNEL);
             nast->tun_id = htonl(str_to_u32(arg));
+        } else if (!strcasecmp(act, "drop_spoofed_arp")) {
+            struct nx_action_header *nah;
+            nah = put_action(b, sizeof *nah, OFPAT_VENDOR);
+            nah->vendor = htonl(NX_VENDOR_ID);
+            nah->subtype = htons(NXAST_DROP_SPOOFED_ARP);
         } else if (!strcasecmp(act, "output")) {
             put_output_action(b, str_to_u32(arg));
+        } else if (!strcasecmp(act, "enqueue")) {
+            char *sp = NULL;
+            char *port = strtok_r(arg, ":q", &sp);
+            char *queue = strtok_r(NULL, "", &sp);
+            if (port == NULL || queue == NULL) {
+                ovs_fatal(0, "\"enqueue\" syntax is \"enqueue:PORT:QUEUE\"");
+            }
+            put_enqueue_action(b, str_to_u32(port), str_to_u32(queue));
         } else if (!strcasecmp(act, "drop")) {
             /* A drop action in OpenFlow occurs by just not setting
              * an action. */