X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fvconn.h;h=f085dcbab3e13a88404531fa59cb1b59258e491c;hb=06e22ff0fe709ec119fea34c555e9411a4cce0d9;hp=6dcfd67558d4f59493af888f90efc4436b207a32;hpb=9e7df18a42ce58df546cb35909622403dbdfe473;p=sliver-openvswitch.git diff --git a/include/vconn.h b/include/vconn.h index 6dcfd6755..f085dcbab 100644 --- a/include/vconn.h +++ b/include/vconn.h @@ -38,69 +38,59 @@ #include #include -struct buffer; +struct ofpbuf; struct flow; -struct pollfd; struct ofp_header; +struct pvconn; struct vconn; -/* Client interface to vconns, which provide a virtual connection to an - * OpenFlow device. */ +void vconn_usage(bool active, bool passive, bool bootstrap); -void vconn_usage(bool active, bool passive); -int vconn_open(const char *name, struct vconn **); +/* Active vconns: virtual connections to OpenFlow devices. */ +int vconn_open(const char *name, int min_version, struct vconn **); void vconn_close(struct vconn *); const char *vconn_get_name(const struct vconn *); -bool vconn_is_passive(const struct vconn *); uint32_t vconn_get_ip(const struct vconn *); int vconn_connect(struct vconn *); -int vconn_accept(struct vconn *, struct vconn **); -int vconn_recv(struct vconn *, struct buffer **); -int vconn_send(struct vconn *, struct buffer *); -int vconn_transact(struct vconn *, struct buffer *, struct buffer **); +int vconn_recv(struct vconn *, struct ofpbuf **); +int vconn_send(struct vconn *, struct ofpbuf *); +int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **); -int vconn_open_block(const char *name, struct vconn **); -int vconn_send_block(struct vconn *, struct buffer *); -int vconn_recv_block(struct vconn *, struct buffer **); +int vconn_open_block(const char *name, int min_version, struct vconn **); +int vconn_send_block(struct vconn *, struct ofpbuf *); +int vconn_recv_block(struct vconn *, struct ofpbuf **); enum vconn_wait_type { WAIT_CONNECT, - WAIT_ACCEPT, WAIT_RECV, WAIT_SEND }; void vconn_wait(struct vconn *, enum vconn_wait_type); void vconn_connect_wait(struct vconn *); -void vconn_accept_wait(struct vconn *); void vconn_recv_wait(struct vconn *); void vconn_send_wait(struct vconn *); -void *make_openflow(size_t openflow_len, uint8_t type, struct buffer **); +/* Passive vconns: virtual listeners for incoming OpenFlow connections. */ +int pvconn_open(const char *name, struct pvconn **); +void pvconn_close(struct pvconn *); +int pvconn_accept(struct pvconn *, int min_version, struct vconn **); +void pvconn_wait(struct pvconn *); + +/* OpenFlow protocol utility functions. */ +void *make_openflow(size_t openflow_len, uint8_t type, struct ofpbuf **); void *make_openflow_xid(size_t openflow_len, uint8_t type, - uint32_t xid, struct buffer **); -void update_openflow_length(struct buffer *); -struct buffer *make_add_flow(const struct flow *, uint32_t buffer_id, + uint32_t xid, struct ofpbuf **); +void update_openflow_length(struct ofpbuf *); +struct ofpbuf *make_add_flow(const struct flow *, uint32_t buffer_id, uint16_t max_idle, size_t n_actions); -struct buffer *make_add_simple_flow(const struct flow *, +struct ofpbuf *make_add_simple_flow(const struct flow *, uint32_t buffer_id, uint16_t out_port, uint16_t max_idle); -struct buffer *make_buffered_packet_out(uint32_t buffer_id, +struct ofpbuf *make_buffered_packet_out(uint32_t buffer_id, uint16_t in_port, uint16_t out_port); -struct buffer *make_unbuffered_packet_out(const struct buffer *packet, +struct ofpbuf *make_unbuffered_packet_out(const struct ofpbuf *packet, uint16_t in_port, uint16_t out_port); -struct buffer *make_echo_request(void); -struct buffer *make_echo_reply(const struct ofp_header *rq); - -extern struct vconn_class tcp_vconn_class; -extern struct vconn_class ptcp_vconn_class; -extern struct vconn_class unix_vconn_class; -extern struct vconn_class punix_vconn_class; -#ifdef HAVE_OPENSSL -extern struct vconn_class ssl_vconn_class; -extern struct vconn_class pssl_vconn_class; -#endif -#ifdef HAVE_NETLINK -extern struct vconn_class netlink_vconn_class; -#endif +struct ofpbuf *make_echo_request(void); +struct ofpbuf *make_echo_reply(const struct ofp_header *rq); #endif /* vconn.h */