[BACK]Return to ox_socket.h CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_socket

Annotation of OpenXM/src/ox_socket/ox_socket.h, Revision 1.2

1.1       maekawa     1: /*-
                      2:  * Copyright (c) 2000 MAEKAWA Masahide <maekawa@math.sci.kobe-u.ac.jp>
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms, with or without
                      6:  * modification, are permitted provided that the following conditions
                      7:  * are met:
                      8:  * 1. Redistributions of source code must retain the above copyright
                      9:  *    notice, this list of conditions and the following disclaimer.
                     10:  * 2. Redistributions in binary form must reproduce the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer in the
                     12:  *    documentation and/or other materials provided with the distribution.
                     13:  *
                     14:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
                     15:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     16:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     17:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
                     18:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     19:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     20:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     21:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     22:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     23:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     24:  * SUCH DAMAGE.
                     25:  *
1.2     ! maekawa    26:  *     $OpenXM: OpenXM/src/ox_socket/ox_socket.h,v 1.1 2000/12/01 07:50:25 maekawa Exp $
1.1       maekawa    27:  */
                     28:
                     29: #ifndef _OX_SOCKET_H_
                     30: #define        _OX_SOCKET_H_
                     31:
1.2     ! maekawa    32: #define        OX_MAXSOCKS     32
1.1       maekawa    33:
                     34: struct ox_sockarray {
1.2     ! maekawa    35:        int     sock[OX_MAXSOCKS];
1.1       maekawa    36:        int     nsocks;
                     37: };
                     38:
                     39: struct ox_sockopt {
                     40:        int             level;
                     41:        int             option_name;
                     42:        void            *option_value;
                     43:        socklen_t       option_len;
                     44: };
                     45:
                     46: int ox_connect(const char *hostname, int port, struct ox_sockopt *opt);
                     47: struct ox_sockarray *ox_listen(const char *hostname, int *port, int backlog,
                     48:                               struct ox_sockopt *opt);
                     49: int ox_accept(struct ox_sockarray *socks);
                     50: int ox_getsockname(int socket, struct sockaddr **addr, socklen_t *addrlen);
                     51: int ox_getport(int socket);
                     52:
                     53: #endif /* !_OX_SOCKET_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>