2 * Copyright (c) 2008, 2009, 2010 Nicira Networks.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
32 struct ofp_action_header;
35 struct ofp_stats_reply;
39 void vconn_usage(bool active, bool passive, bool bootstrap);
41 /* Active vconns: virtual connections to OpenFlow devices. */
42 int vconn_verify_name(const char *name);
43 int vconn_open(const char *name, int min_version, struct vconn **);
44 void vconn_close(struct vconn *);
45 const char *vconn_get_name(const struct vconn *);
46 uint32_t vconn_get_remote_ip(const struct vconn *);
47 uint16_t vconn_get_remote_port(const struct vconn *);
48 uint32_t vconn_get_local_ip(const struct vconn *);
49 uint16_t vconn_get_local_port(const struct vconn *);
50 int vconn_connect(struct vconn *);
51 int vconn_recv(struct vconn *, struct ofpbuf **);
52 int vconn_send(struct vconn *, struct ofpbuf *);
53 int vconn_recv_xid(struct vconn *, uint32_t xid, struct ofpbuf **);
54 int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **);
56 void vconn_run(struct vconn *);
57 void vconn_run_wait(struct vconn *);
59 int vconn_open_block(const char *name, int min_version, struct vconn **);
60 int vconn_send_block(struct vconn *, struct ofpbuf *);
61 int vconn_recv_block(struct vconn *, struct ofpbuf **);
63 enum vconn_wait_type {
68 void vconn_wait(struct vconn *, enum vconn_wait_type);
69 void vconn_connect_wait(struct vconn *);
70 void vconn_recv_wait(struct vconn *);
71 void vconn_send_wait(struct vconn *);
73 /* Passive vconns: virtual listeners for incoming OpenFlow connections. */
74 int pvconn_verify_name(const char *name);
75 int pvconn_open(const char *name, struct pvconn **);
76 const char *pvconn_get_name(const struct pvconn *);
77 void pvconn_close(struct pvconn *);
78 int pvconn_accept(struct pvconn *, int min_version, struct vconn **);
79 void pvconn_wait(struct pvconn *);