2 * $Id: compat.h,v 0.0.0.1 2003/12/19
4 * AUTHOR: Michal Sojka sojka1@fel.cvut.cz
6 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
7 * --------------------------------------------------------------------
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
26 #include <linux/inet.h>
28 #define printf rtl_printf
29 #define gettimeofday(tv, tz) do_gettimeofday(tv)
31 #define socket ocn_socket
32 #define setsockopt ocn_setsockopt
33 #define getsockopt ocn_getsockopt
34 #define ioctl ocn_ioctl
36 #define getsockname ocn_getsockname
37 #define recvfrom ocn_recvfrom
38 #define sendto ocn_sendto
39 #define close ocn_close
41 static inline int atoi(const char* nptr)
43 return simple_strtol(nptr, (char **)NULL, 10);
46 static inline __u32 inet_addr(const char *cp)
51 static char inet_ntoa_buf[16];
52 static inline char *inet_ntoa(struct in_addr in) {
55 octet = (unsigned char *)&(in.s_addr);
56 sprintf(inet_ntoa_buf, "%u.%u.%u.%u", octet[0], octet[1], octet[2], octet[3]);
62 #endif /* _COMPAT_H */