]>
Commit | Line | Data |
---|---|---|
064af421 | 1 | /* |
30012c72 | 2 | * Copyright (c) 2008, 2009, 2010 Nicira Networks. |
064af421 | 3 | * |
a14bc59f BP |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
064af421 | 7 | * |
a14bc59f BP |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
064af421 BP |
15 | */ |
16 | ||
17 | #ifndef VCONN_H | |
18 | #define VCONN_H 1 | |
19 | ||
20 | #include <assert.h> | |
21 | #include <stdbool.h> | |
22 | #include <stddef.h> | |
23 | #include <stdint.h> | |
24 | ||
25 | #include "flow.h" | |
26 | ||
27 | struct ofpbuf; | |
28 | struct ofp_action_header; | |
29 | struct ofp_header; | |
30 | struct ofp_match; | |
31 | struct ofp_stats_reply; | |
32 | struct pvconn; | |
33 | struct vconn; | |
34 | ||
35 | void vconn_usage(bool active, bool passive, bool bootstrap); | |
36 | ||
37 | /* Active vconns: virtual connections to OpenFlow devices. */ | |
30012c72 | 38 | int vconn_verify_name(const char *name); |
064af421 BP |
39 | int vconn_open(const char *name, int min_version, struct vconn **); |
40 | void vconn_close(struct vconn *); | |
41 | const char *vconn_get_name(const struct vconn *); | |
4408d18a BP |
42 | ovs_be32 vconn_get_remote_ip(const struct vconn *); |
43 | ovs_be16 vconn_get_remote_port(const struct vconn *); | |
44 | ovs_be32 vconn_get_local_ip(const struct vconn *); | |
45 | ovs_be16 vconn_get_local_port(const struct vconn *); | |
064af421 BP |
46 | int vconn_connect(struct vconn *); |
47 | int vconn_recv(struct vconn *, struct ofpbuf **); | |
48 | int vconn_send(struct vconn *, struct ofpbuf *); | |
49 | int vconn_recv_xid(struct vconn *, uint32_t xid, struct ofpbuf **); | |
50 | int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **); | |
33af7dca | 51 | int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **); |
064af421 | 52 | |
60cb3eb8 BP |
53 | void vconn_run(struct vconn *); |
54 | void vconn_run_wait(struct vconn *); | |
55 | ||
064af421 BP |
56 | int vconn_open_block(const char *name, int min_version, struct vconn **); |
57 | int vconn_send_block(struct vconn *, struct ofpbuf *); | |
58 | int vconn_recv_block(struct vconn *, struct ofpbuf **); | |
59 | ||
60 | enum vconn_wait_type { | |
61 | WAIT_CONNECT, | |
62 | WAIT_RECV, | |
63 | WAIT_SEND | |
64 | }; | |
65 | void vconn_wait(struct vconn *, enum vconn_wait_type); | |
66 | void vconn_connect_wait(struct vconn *); | |
67 | void vconn_recv_wait(struct vconn *); | |
68 | void vconn_send_wait(struct vconn *); | |
69 | ||
70 | /* Passive vconns: virtual listeners for incoming OpenFlow connections. */ | |
30012c72 | 71 | int pvconn_verify_name(const char *name); |
064af421 BP |
72 | int pvconn_open(const char *name, struct pvconn **); |
73 | const char *pvconn_get_name(const struct pvconn *); | |
74 | void pvconn_close(struct pvconn *); | |
75 | int pvconn_accept(struct pvconn *, int min_version, struct vconn **); | |
76 | void pvconn_wait(struct pvconn *); | |
77 | ||
064af421 | 78 | #endif /* vconn.h */ |