1238104Sdes/*- 2238104Sdes * Copyright (c) 2003-2004, Maxime Henrion <mux@FreeBSD.org> 3238104Sdes * All rights reserved. 4238104Sdes * 5238104Sdes * Redistribution and use in source and binary forms, with or without 6238104Sdes * modification, are permitted provided that the following conditions 7238104Sdes * are met: 8238104Sdes * 1. Redistributions of source code must retain the above copyright 9238104Sdes * notice, this list of conditions and the following disclaimer. 10238104Sdes * 2. Redistributions in binary form must reproduce the above copyright 11238104Sdes * notice, this list of conditions and the following disclaimer in the 12238104Sdes * documentation and/or other materials provided with the distribution. 13238104Sdes * 14238104Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15238104Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16238104Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17238104Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18238104Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19238104Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20238104Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21238104Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22238104Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23238104Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24238104Sdes * SUCH DAMAGE. 25238104Sdes * 26238104Sdes * $FreeBSD: releng/10.2/usr.bin/csup/mux.h 204556 2010-03-02 07:26:07Z lulf $ 27238104Sdes */ 28238104Sdes#ifndef _MUX_H_ 29238104Sdes#define _MUX_H_ 30238104Sdes 31238104Sdesstruct mux; 32238104Sdesstruct chan; 33238104Sdes 34238104Sdesstruct mux *mux_open(int, struct chan **); 35238104Sdesvoid mux_shutdown(struct mux *, const char *, int); 36238104Sdesint mux_close(struct mux *); 37238104Sdes 38238104Sdesvoid chan_wait(struct chan *); 39238104Sdesint chan_listen(struct mux *); 40238104Sdesstruct chan *chan_accept(struct mux *, int); 41238104Sdesssize_t chan_read(struct chan *, void *, size_t); 42238104Sdesssize_t chan_write(struct chan *, const void *, size_t); 43238104Sdesint chan_close(struct chan *); 44238104Sdes 45238104Sdes#endif /* !_MUX_H_ */ 46238104Sdes