]> git.proxmox.com Git - mirror_ovs.git/blame - lib/vconn.h
Remove stream, vconn, and rconn functions to get local/remote IPs/ports.
[mirror_ovs.git] / lib / vconn.h
CommitLineData
064af421 1/*
4766ce7a 2 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
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
064af421 20#include <stdbool.h>
3021ea60 21#include "openvswitch/types.h"
733c8ed3 22#include "openflow/openflow.h"
064af421 23
43d1478b
CB
24#ifdef __cplusplus
25extern "C" {
26#endif
27
7f009380 28struct list;
064af421 29struct ofpbuf;
064af421
BP
30struct pvconn;
31struct vconn;
32
33void vconn_usage(bool active, bool passive, bool bootstrap);
34
35/* Active vconns: virtual connections to OpenFlow devices. */
30012c72 36int vconn_verify_name(const char *name);
82c8c53c
BP
37int vconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
38 struct vconn **vconnp);
064af421
BP
39void vconn_close(struct vconn *);
40const char *vconn_get_name(const struct vconn *);
4766ce7a 41
7a25bd99 42uint32_t vconn_get_allowed_versions(const struct vconn *vconn);
e182670b
SH
43void vconn_set_allowed_versions(struct vconn *vconn,
44 uint32_t allowed_versions);
4766ce7a
BP
45int vconn_get_version(const struct vconn *);
46void vconn_set_recv_any_version(struct vconn *);
47
064af421
BP
48int vconn_connect(struct vconn *);
49int vconn_recv(struct vconn *, struct ofpbuf **);
50int vconn_send(struct vconn *, struct ofpbuf *);
dbba996b 51int vconn_recv_xid(struct vconn *, ovs_be32 xid, struct ofpbuf **);
064af421 52int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **);
33af7dca 53int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **);
7f009380
BP
54int vconn_transact_multiple_noreply(struct vconn *, struct list *requests,
55 struct ofpbuf **replyp);
064af421 56
60cb3eb8
BP
57void vconn_run(struct vconn *);
58void vconn_run_wait(struct vconn *);
59
82c8c53c 60int vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp,
2e3fa633 61 struct vconn **);
6d1fb217 62int vconn_connect_block(struct vconn *);
064af421
BP
63int vconn_send_block(struct vconn *, struct ofpbuf *);
64int vconn_recv_block(struct vconn *, struct ofpbuf **);
65
66enum vconn_wait_type {
67 WAIT_CONNECT,
68 WAIT_RECV,
69 WAIT_SEND
70};
71void vconn_wait(struct vconn *, enum vconn_wait_type);
72void vconn_connect_wait(struct vconn *);
73void vconn_recv_wait(struct vconn *);
74void vconn_send_wait(struct vconn *);
75
76/* Passive vconns: virtual listeners for incoming OpenFlow connections. */
30012c72 77int pvconn_verify_name(const char *name);
82c8c53c
BP
78int pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
79 struct pvconn **pvconnp);
064af421
BP
80const char *pvconn_get_name(const struct pvconn *);
81void pvconn_close(struct pvconn *);
7a25bd99 82int pvconn_accept(struct pvconn *, struct vconn **);
064af421
BP
83void pvconn_wait(struct pvconn *);
84
43d1478b
CB
85#ifdef __cplusplus
86}
87#endif
88
064af421 89#endif /* vconn.h */