2 * $Id: compat.h,v 0.0.0.1 2003/12/19
4 * -------------------------------------------------------------------
6 * Open Real-Time Ethernet
8 * Copyright (C) 2001-2006
9 * Department of Control Engineering FEE CTU Prague, Czech Republic
10 * http://dce.felk.cvut.cz
11 * http://www.ocera.org
13 * Author: Petr Smolik petr@smoliku.cz
14 * Author - this code: Michal Sojka sojka1@fel.cvut.cz
16 * Project Responsible: Zdenek Hanzalek
17 * --------------------------------------------------------------------
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
36 #include <linux/inet.h>
38 #define printf rtl_printf
39 #define gettimeofday(tv, tz) do_gettimeofday(tv)
41 #define socket ocn_socket
42 #define setsockopt ocn_setsockopt
43 #define getsockopt ocn_getsockopt
44 #define ioctl ocn_ioctl
46 #define getsockname ocn_getsockname
47 #define recvfrom ocn_recvfrom
48 #define sendto ocn_sendto
49 #define close ocn_close
52 atoi(const char *nptr)
54 return simple_strtol(nptr, (char **)NULL, 10);
58 inet_addr(const char *cp)
63 static char inet_ntoa_buf[16];
65 inet_ntoa(struct in_addr in)
69 octet = (unsigned char *)&(in.s_addr);
70 sprintf(inet_ntoa_buf, "%u.%u.%u.%u", octet[0], octet[1], octet[2], octet[3]);
76 #endif /* _COMPAT_H */