e439450fc19f560ec1b3ff6900c2c9d73435a7c4
[cascardo/ovs.git] / secchan / pinsched.h
1 /*
2  * Copyright (c) 2008, 2009 Nicira Networks.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #ifndef PINSCHED_H
18 #define PINSCHED_H_H 1
19
20 #include <stdint.h>
21
22 struct ofpbuf;
23 struct switch_status;
24
25 typedef void pinsched_tx_cb(struct ofpbuf *, void *aux);
26 struct pinsched *pinsched_create(int rate_limit, int burst_limit,
27                                  struct switch_status *);
28 void pinsched_set_limits(struct pinsched *, int rate_limit, int burst_limit);
29 void pinsched_destroy(struct pinsched *);
30 void pinsched_send(struct pinsched *, uint16_t port_no, struct ofpbuf *,
31                    pinsched_tx_cb *, void *aux);
32 void pinsched_run(struct pinsched *, pinsched_tx_cb *, void *aux);
33 void pinsched_wait(struct pinsched *);
34
35 #endif /* pinsched.h */