ovs-ofctl: Document that "actions" must be last in flow specifications.
[sliver-openvswitch.git] / ofproto / pinsched.c
index 306d851..6af2bb6 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <config.h>
 #include "pinsched.h"
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -228,7 +230,7 @@ pinsched_create(int rate_limit, int burst_limit, struct switch_status *ss)
 {
     struct pinsched *ps;
 
-    ps = xcalloc(1, sizeof *ps);
+    ps = xzalloc(sizeof *ps);
     port_array_init(&ps->queues);
     ps->n_queued = 0;
     ps->last_tx_port = PORT_ARRAY_SIZE;
@@ -265,6 +267,14 @@ pinsched_destroy(struct pinsched *ps)
     }
 }
 
+void
+pinsched_get_limits(const struct pinsched *ps,
+                    int *rate_limit, int *burst_limit)
+{
+    *rate_limit = ps->rate_limit;
+    *burst_limit = ps->burst_limit;
+}
+
 void
 pinsched_set_limits(struct pinsched *ps, int rate_limit, int burst_limit)
 {