]> git.proxmox.com Git - mirror_ovs.git/blame - lib/vconn.h
ofproto-dpif: Fix small typo in comment.
[mirror_ovs.git] / lib / vconn.h
CommitLineData
064af421 1/*
dbba996b 2 * Copyright (c) 2008, 2009, 2010, 2011 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
43d1478b
CB
27#ifdef __cplusplus
28extern "C" {
29#endif
30
7f009380 31struct list;
064af421
BP
32struct ofpbuf;
33struct ofp_action_header;
34struct ofp_header;
35struct ofp_match;
28c8bad1 36struct ofp_stats_msg;
064af421
BP
37struct pvconn;
38struct vconn;
39
40void vconn_usage(bool active, bool passive, bool bootstrap);
41
42/* Active vconns: virtual connections to OpenFlow devices. */
30012c72 43int vconn_verify_name(const char *name);
064af421
BP
44int vconn_open(const char *name, int min_version, struct vconn **);
45void vconn_close(struct vconn *);
46const char *vconn_get_name(const struct vconn *);
4408d18a
BP
47ovs_be32 vconn_get_remote_ip(const struct vconn *);
48ovs_be16 vconn_get_remote_port(const struct vconn *);
49ovs_be32 vconn_get_local_ip(const struct vconn *);
50ovs_be16 vconn_get_local_port(const struct vconn *);
064af421
BP
51int vconn_connect(struct vconn *);
52int vconn_recv(struct vconn *, struct ofpbuf **);
53int vconn_send(struct vconn *, struct ofpbuf *);
dbba996b 54int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **);
064af421 55int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **);
33af7dca 56int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **);
7f009380
BP
57int vconn_transact_multiple_noreply(struct vconn *, struct list *requests,
58 struct ofpbuf **replyp);
064af421 59
60cb3eb8
BP
60void vconn_run(struct vconn *);
61void vconn_run_wait(struct vconn *);
62
064af421
BP
63int vconn_open_block(const char *name, int min_version, struct vconn **);
64int vconn_send_block(struct vconn *, struct ofpbuf *);
65int vconn_recv_block(struct vconn *, struct ofpbuf **);
66
67enum vconn_wait_type {
68 WAIT_CONNECT,
69 WAIT_RECV,
70 WAIT_SEND
71};
72void vconn_wait(struct vconn *, enum vconn_wait_type);
73void vconn_connect_wait(struct vconn *);
74void vconn_recv_wait(struct vconn *);
75void vconn_send_wait(struct vconn *);
76
77/* Passive vconns: virtual listeners for incoming OpenFlow connections. */
30012c72 78int pvconn_verify_name(const char *name);
064af421
BP
79int pvconn_open(const char *name, struct pvconn **);
80const char *pvconn_get_name(const struct pvconn *);
81void pvconn_close(struct pvconn *);
82int pvconn_accept(struct pvconn *, int min_version, struct vconn **);
83void pvconn_wait(struct pvconn *);
84
43d1478b
CB
85#ifdef __cplusplus
86}
87#endif
88
064af421 89#endif /* vconn.h */