Home | History | Annotate | Line # | Download | only in common
linux_socketcall.h revision 1.1
      1  1.1  fvdl /*	$NetBSD: linux_socketcall.h,v 1.1 1995/02/28 23:26:05 fvdl Exp $	*/
      2  1.1  fvdl 
      3  1.1  fvdl /*
      4  1.1  fvdl  * Copyright (c) 1995 Frank van der Linden
      5  1.1  fvdl  * All rights reserved.
      6  1.1  fvdl  *
      7  1.1  fvdl  * Redistribution and use in source and binary forms, with or without
      8  1.1  fvdl  * modification, are permitted provided that the following conditions
      9  1.1  fvdl  * are met:
     10  1.1  fvdl  * 1. Redistributions of source code must retain the above copyright
     11  1.1  fvdl  *    notice, this list of conditions and the following disclaimer.
     12  1.1  fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  fvdl  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  fvdl  *    documentation and/or other materials provided with the distribution.
     15  1.1  fvdl  * 3. All advertising materials mentioning features or use of this software
     16  1.1  fvdl  *    must display the following acknowledgement:
     17  1.1  fvdl  *      This product includes software developed for the NetBSD Project
     18  1.1  fvdl  *      by Frank van der Linden
     19  1.1  fvdl  * 4. The name of the author may not be used to endorse or promote products
     20  1.1  fvdl  *    derived from this software without specific prior written permission
     21  1.1  fvdl  *
     22  1.1  fvdl  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  1.1  fvdl  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  1.1  fvdl  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  1.1  fvdl  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  1.1  fvdl  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  1.1  fvdl  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  1.1  fvdl  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  1.1  fvdl  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  1.1  fvdl  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  1.1  fvdl  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  1.1  fvdl  */
     33  1.1  fvdl 
     34  1.1  fvdl #ifndef _LINUX_SOCKETCALL_H
     35  1.1  fvdl #define _LINUX_SOCKETCALL_H
     36  1.1  fvdl 
     37  1.1  fvdl /*
     38  1.1  fvdl  * Values passed to the Linux socketcall() syscall, determining the actual
     39  1.1  fvdl  * action to take.
     40  1.1  fvdl  */
     41  1.1  fvdl #define LINUX_SYS_socket	1
     42  1.1  fvdl #define LINUX_SYS_bind		2
     43  1.1  fvdl #define LINUX_SYS_connect	3
     44  1.1  fvdl #define LINUX_SYS_listen	4
     45  1.1  fvdl #define LINUX_SYS_accept	5
     46  1.1  fvdl #define LINUX_SYS_getsockname	6
     47  1.1  fvdl #define LINUX_SYS_getpeername	7
     48  1.1  fvdl #define LINUX_SYS_socketpair	8
     49  1.1  fvdl #define LINUX_SYS_send		9
     50  1.1  fvdl #define LINUX_SYS_recv		10
     51  1.1  fvdl #define LINUX_SYS_sendto	11
     52  1.1  fvdl #define LINUX_SYS_recvfrom	12
     53  1.1  fvdl #define LINUX_SYS_shutdown	13
     54  1.1  fvdl #define LINUX_SYS_setsockopt	14
     55  1.1  fvdl #define LINUX_SYS_getsockopt	15
     56  1.1  fvdl 
     57  1.1  fvdl /*
     58  1.1  fvdl  * Structures for the arguments of the different system calls. This looks
     59  1.1  fvdl  * a little better than copyin() of all values one by one.
     60  1.1  fvdl  */
     61  1.1  fvdl struct linux_socket_args {
     62  1.1  fvdl 	int domain;
     63  1.1  fvdl 	int type;
     64  1.1  fvdl 	int protocol;
     65  1.1  fvdl };
     66  1.1  fvdl 
     67  1.1  fvdl struct linux_bind_args {
     68  1.1  fvdl 	int s;
     69  1.1  fvdl 	struct sockaddr *name;
     70  1.1  fvdl 	int namelen;
     71  1.1  fvdl };
     72  1.1  fvdl 
     73  1.1  fvdl struct linux_connect_args {
     74  1.1  fvdl 	int s;
     75  1.1  fvdl 	struct sockaddr *name;
     76  1.1  fvdl 	int namelen;
     77  1.1  fvdl };
     78  1.1  fvdl 
     79  1.1  fvdl struct linux_listen_args {
     80  1.1  fvdl 	int s;
     81  1.1  fvdl 	int backlog;
     82  1.1  fvdl };
     83  1.1  fvdl 
     84  1.1  fvdl struct linux_accept_args {
     85  1.1  fvdl 	int s;
     86  1.1  fvdl 	struct sockaddr *addr;
     87  1.1  fvdl 	int *namelen;
     88  1.1  fvdl };
     89  1.1  fvdl 
     90  1.1  fvdl struct linux_getsockname_args {
     91  1.1  fvdl 	int s;
     92  1.1  fvdl 	struct sockaddr *addr;
     93  1.1  fvdl 	int *namelen;
     94  1.1  fvdl };
     95  1.1  fvdl 
     96  1.1  fvdl struct linux_getpeername_args {
     97  1.1  fvdl 	int s;
     98  1.1  fvdl 	struct sockaddr *addr;
     99  1.1  fvdl 	int *namelen;
    100  1.1  fvdl };
    101  1.1  fvdl 
    102  1.1  fvdl struct linux_socketpair_args {
    103  1.1  fvdl 	int domain;
    104  1.1  fvdl 	int type;
    105  1.1  fvdl 	int protocol;
    106  1.1  fvdl 	int *rsv;
    107  1.1  fvdl };
    108  1.1  fvdl 
    109  1.1  fvdl struct linux_send_args {
    110  1.1  fvdl 	int s;
    111  1.1  fvdl 	void *msg;
    112  1.1  fvdl 	int len;
    113  1.1  fvdl 	int flags;
    114  1.1  fvdl };
    115  1.1  fvdl 
    116  1.1  fvdl struct linux_recv_args {
    117  1.1  fvdl 	int s;
    118  1.1  fvdl 	void *msg;
    119  1.1  fvdl 	int len;
    120  1.1  fvdl 	int flags;
    121  1.1  fvdl };
    122  1.1  fvdl 
    123  1.1  fvdl struct linux_sendto_args {
    124  1.1  fvdl 	int s;
    125  1.1  fvdl 	void *msg;
    126  1.1  fvdl 	int len;
    127  1.1  fvdl 	int flags;
    128  1.1  fvdl 	struct sockaddr *to;
    129  1.1  fvdl 	int tolen;
    130  1.1  fvdl };
    131  1.1  fvdl 
    132  1.1  fvdl struct linux_recvfrom_args {
    133  1.1  fvdl 	int s;
    134  1.1  fvdl 	void *buf;
    135  1.1  fvdl 	int len;
    136  1.1  fvdl 	int flags;
    137  1.1  fvdl 	struct sockaddr *from;
    138  1.1  fvdl 	int *fromlen;
    139  1.1  fvdl };
    140  1.1  fvdl 
    141  1.1  fvdl struct linux_shutdown_args {
    142  1.1  fvdl 	int s;
    143  1.1  fvdl 	int how;
    144  1.1  fvdl };
    145  1.1  fvdl 
    146  1.1  fvdl struct linux_getsockopt_args {
    147  1.1  fvdl 	int s;
    148  1.1  fvdl 	int level;
    149  1.1  fvdl 	int optname;
    150  1.1  fvdl 	void *optval;
    151  1.1  fvdl 	int *optlen;
    152  1.1  fvdl };
    153  1.1  fvdl 
    154  1.1  fvdl struct linux_setsockopt_args {
    155  1.1  fvdl 	int s;
    156  1.1  fvdl 	int level;
    157  1.1  fvdl 	int optname;
    158  1.1  fvdl 	void *optval;
    159  1.1  fvdl 	int optlen;
    160  1.1  fvdl };
    161  1.1  fvdl 
    162  1.1  fvdl #endif /* _LINUX_SOCKETCALL_H */
    163