# rtnetP.h

    00001 /*
    00002  * Copyright (C) 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>
    00003  *
    00004  * This program is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU General Public License as
    00006  * published by the Free Software Foundation; either version 2 of the
    00007  * License, or (at your option) any later version.
    00008  *
    00009  * This program is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  * GNU General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU General Public License
    00015  * along with this program; if not, write to the Free Software
    00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00019 #ifndef __RTNET_RTNETP_H
    00020 #define __RTNET_RTNETP_H
    00021
    00022 int soft_rt_bind(int s,
    00023                  struct sockaddr *my_addr,
    00024                  int addrlen);
    00025
    00026 int soft_rt_close(int s);
    00027
    00028 int soft_rt_recvfrom(int s,
    00029                      void *buf,
    00030                      int len,
    00031                      unsigned int flags,
    00032                      struct sockaddr *from,
    00033                      int *fromlen);
    00034
    00035 int soft_rt_sendto(int s,
    00036                    const void *buf,
    00037                    int len,
    00038                    unsigned int flags,
    00039                    struct sockaddr *to,
    00040                    int tolen);
    00041
    00042 int soft_rt_socket(int domain,
    00043                    int type,
    00044                    int protocol);
    00045
    00046 int soft_rt_socket_callback(int s,
    00047                             int (*func)(int s, void *arg),
    00048                             void *arg);
    00049
    00050 struct sock_t {
    00051         int sock, opnd;
    00052         int tosend, recvd;
    00053         struct sockaddr addr;
    00054         int addrlen;
    00055         int (*callback)(int sock, void *arg);
    00056         void *arg;
    00057         char msg[MAX_MSG_SIZE];
    00058 };
    00059
    00060 #ifdef COMPILE_ANYHOW
    00061
    00062 /* the hard RTNet external interface, used just to check netrpc compiles */
    00063
    00064 int rt_socket(int domain,
    00065               int type,
    00066               int protocol);
    00067
    00068 int rt_bind(int s,
    00069             struct sockaddr *my_addr,
    00070             int addrlen);
    00071
    00072 int rt_close(int s);
    00073
    00074 int rt_recvfrom(int s,
    00075                 void *buf,
    00076                 int len,
    00077                 unsigned int flags,
    00078                 struct sockaddr *from,
    00079                 int *fromlen);
    00080
    00081 int rt_sendto(int s,
    00082               const void *buf,
    00083               int len,
    00084               unsigned int flags,
    00085               struct sockaddr *to,
    00086               int tolen);
    00087
    00088 int rt_socket_callback(int s,
    00089                        int (*func)(int s, void *arg),
    00090                        void *arg);
    00091
    00092 #endif /* COMPILE_ANYHOW */
    00093
    00094 #endif /* !__RTNET_RTNETP_H */